code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public int hashCode(){
return this.value.hashCode() * 21;
}
| The hash of the Primitive is tied to the hash of the wrapped value but shifted so that they are not the same. |
public static String escapeXml(String s,boolean advanced,boolean recognizeUnicodeChars,boolean translateSpecialEntities,boolean isDomCreation,boolean transResCharsToNCR,boolean translateSpecialEntitiesToNCR){
return escapeXml(s,advanced,recognizeUnicodeChars,translateSpecialEntities,isDomCreation,transResCharsToNCR,t... | change notes: 1) convert ascii characters encoded using &#xx; format to the ascii characters -- may be an attempt to slip in malicious html 2) convert &#xxx; format characters to " style representation if available for the character. 3) convert html special entities to xml &#xxx; when outputing in xml |
public synchronized boolean isStopped(){
return playerState == PlayerStates.STOPPED;
}
| Checks whether the player is currently stopped (not playing) |
public void dispose(){
if (t2 != null) {
t2.cancel();
}
t2=null;
}
| fix submitted by Niklas Matthies |
public LongsRef(int capacity){
longs=new long[capacity];
}
| Create a LongsRef pointing to a new array of size <code>capacity</code>. Offset and length will both be zero. |
public HeadPhaseBuilder<S> findFirst(S defaultValue,RError.Message message,Object... messageArgs){
pipelineBuilder().appendFindFirst(defaultValue,elementClass,null,message,messageArgs);
return new HeadPhaseBuilder<>(pipelineBuilder());
}
| The inserted cast node returns the default value if the input vector is empty. It also reports the warning message. |
public Pan(AbstractChart chart){
super(chart);
}
| Builds and instance of the pan tool. |
public DeviceAutomator checkForegroundAppIs(String packageName){
return checkForegroundAppIs(packageName,5000);
}
| Asserts that the foreground app has the given package name. Waits for up to 5 seconds for the given package to become the foreground app. |
public ActionEvent(Component dragged,Type type,Component drop,int x,int y){
this.source=dragged;
this.sourceComponent=drop;
this.keyEvent=x;
this.y=y;
this.trigger=type;
}
| Creates a new instance of ActionEvent for a drop operation |
public ServerConfiguration enableDurableWrite(boolean enabled){
setProperty(SERVER_DURABLE_WRITE_ENABLED,enabled);
return this;
}
| Set the flag to enable/disable durable write |
public static Matrix fromLocalOrientation(Vec4 origin,Vec4[] axes){
if (origin == null) {
String msg=Logging.getMessage("nullValue.OriginIsNull");
Logging.logger().severe(msg);
throw new IllegalArgumentException(msg);
}
if (axes == null) {
String msg=Logging.getMessage("nullValue.AxesIsNull");
... | Returns a Cartesian transform <code>Matrix</code> that maps a local origin and orientation to model coordinates. The transform is specified by a local <code>origin</code> and an array of three <code>axes</code>. The <code>axes</code> array must contain three non-null vectors, which are interpreted in the following orde... |
public AspectContainer load(@Nullable NBTTagCompound nbt,@Nullable List<Aspect> staticAspects){
List<InternalAspect> aspects=new ArrayList<InternalAspect>();
if (nbt != null) {
NBTTagList typesList=nbt.getTagList(ASPECTS_NBT_TAG,Constants.NBT.TAG_LIST);
int typesCount=typesList.tagCount();
for (int i=0;... | Reads the container from the specified NBT and adds the static aspects |
public void addDevices(Collection<IEspDevice> devices,int upgradeType){
for ( IEspDevice device : devices) {
addDevice(device,upgradeType);
}
}
| Add devices to upgrade |
public static void register(){
FilePath.register(new FilePathEncrypt());
}
| Register this file system. |
public static void updateBeforeLoad(final DigestURL url){
final String host=url.getHost();
if (host == null) return;
String hosthash=url.hosthash();
Host h=map.get(hosthash);
if (h == null) {
h=new Host(host,500,0);
if (map.size() > mapMaxSize || MemoryControl.shortStatus()) map.clear();
map... | update the latency entry before a host is accessed |
public RoleException(Throwable cause){
super(cause);
}
| Constructs an instance of <code>RoleException</code> with the specified cause. |
private CMemoryFunctions(){
}
| You are not supposed to instantiate this class. |
private void writeAttribute(java.lang.String namespace,java.lang.String attName,java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
if (namespace.equals("")) {
xmlWriter.writeAttribute(attName,attValue);
}
else {
registerPrefix(xmlWriter,namesp... | Util method to write an attribute without the ns prefix |
public static <T>LtPredicate<T> lt(Property<T> property,T value){
return new LtPredicate<>(property(property),value);
}
| Create a new LESSER THAN specification for a Property. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public boolean poolMatchesCapacity(StoragePool pool,long requiredCapacity,long resourceSize,boolean checkPoolMaxSizeLimit,boolean supportsThinProvisioning,Long thinVolumePreAllocationResourceSize){
if (null == pool.getTotalCapacity() || pool.getTotalCapacity() == 0) {
return false;
}
long preAllocationSizeInK... | Decision is made as following: 1. Check volume size against maximum volume size limit of storage pool (if required). 2. --- Thick pool: solely based on the pool utilization capacity including the current request & the requested capacity < pool freeCapacity. --- Thin pool: It depends on two factors. 1. pool utilization ... |
@Override public void update(){
if (block != null) {
((Updater)block).update(0.05);
}
}
| Updates the block. |
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 synchronized void warning(String s,Parameter p1){
println("WARNING:\n" + s,ALL_MESSAGE_LOGS,true);
if (p1 != null) println("PARAMETER: " + p1,ALL_MESSAGE_LOGS,true);
}
| Posts a warning. |
private void zzScanError(int errorCode){
String message;
try {
message=ZZ_ERROR_MSG[errorCode];
}
catch ( ArrayIndexOutOfBoundsException e) {
message=ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
throw new Error(message);
}
| Reports an error that occured while scanning. In a wellformed scanner (no or only correct usage of yypushback(int) and a match-all fallback rule) this method will only be called with things that "Can't Possibly Happen". If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty scanner ... |
public void print(final String str){
if ((str != null) && (str.length() > 0)) {
_append(str);
}
}
| Print text to the console |
static void propertiesComments(StringBuffer result,long val){
result.append(" ");
switch ((int)(val & maskType)) {
case UnicodeSpec.CONTROL:
result.append("Cc");
break;
case UnicodeSpec.FORMAT:
result.append("Cf");
break;
case UnicodeSpec.PRIVATE_USE:
result.append("Co");
break;
case UnicodeSpec.SURROGATE:
re... | The propertiesComments method generates comments describing encoded character properties. |
public SocketTimeoutException(String detailMessage,Throwable cause){
super(detailMessage,cause);
}
| Constructs a new instance with given detail message and cause. |
static ZipFile buildProjectFromSources(Path sourcesPath,String artifactNamePattern) throws IOException, InterruptedException {
final String[] command;
if (SystemInfo.isWindows()) {
command=new String[]{"CMD","/C","mvn","clean","package"};
}
else {
command=new String[]{MavenUtils.getMavenExecCommand(),"cl... | Builds project with Maven from the specified sources. |
public static int root(int value){
if (value < 0) {
TestBase.logError("function called but should not",null);
}
return (int)Math.sqrt(value);
}
| This method is called via reflection from the database. |
@Override public void registerOutParameter(String parameterName,int sqlType,int scale) throws SQLException {
registerOutParameter(getIndexForName(parameterName),sqlType,scale);
}
| Registers the given OUT parameter. |
protected void describe(String description){
SwiftTestUtils.noteAction(description);
}
| Describe the test, combining some logging with details for people reading the code |
public boolean fireMapMouseDragged(MouseEvent evt){
if (DEBUG_DETAIL) {
logger.finer("MapMouseSupport: fireMapMouseDragged");
}
clickHappened=false;
boolean consumed=false;
if (proxy == null || evt.isShiftDown() || (proxyDistributionMask & PROXY_DISTRIB_MOUSE_DRAGGED) > 0) {
evt=new MapMouseEvent(getP... | Handle a mouseDragged MouseListener event. |
static int findDisplayedMnemonicIndex(String text,int mnemonic){
if (text == null || mnemonic == '\0') {
return -1;
}
char uc=Character.toUpperCase((char)mnemonic);
char lc=Character.toLowerCase((char)mnemonic);
int uci=text.indexOf(uc);
int lci=text.indexOf(lc);
if (uci == -1) {
return lci;
}
... | Returns index of the first occurrence of <code>mnemonic</code> within string <code>text</code>. Matching algorithm is not case-sensitive. |
public void useProgram(int programId){
if (this.programId != programId) {
this.programId=programId;
GLES20.glUseProgram(programId);
}
}
| Makes an OpenGL program object active as part of current rendering state. This has no effect if the specified program object is already active. The default is program 0, indicating that no program is active. |
private void parse() throws IOException {
int majorVersion=readByte();
int minorVersion=readByte();
int hdrsz=readByte();
int offsize=readByte();
int fnames=hdrsz;
int topdicts=fnames + getIndexSize(fnames);
int theNames=topdicts + getIndexSize(topdicts);
gsubrbase=theNames + getIndexSize(theNames);
g... | parse the font data. |
private void pushPacket(IOFSwitch sw,Match match,OFPacketIn pi,OFPort outport){
if (pi == null) {
return;
}
OFPort inPort=(pi.getVersion().compareTo(OFVersion.OF_12) < 0 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT));
if (inPort.equals(outport)) {
if (log.isDebugEnabled()) {
log.debug("... | Pushes a packet-out to a switch. The assumption here is that the packet-in was also generated from the same switch. Thus, if the input port of the packet-in and the outport are the same, the function will not push the packet-out. |
public int decrement(int offset){
return increment(-offset);
}
| Decrement the numeric badge label. If the current badge label cannot be converted to an integer value, its label will be set to "0". |
public NetworkComponent(final String name,final Network network){
super(name);
this.network=network;
init();
}
| Create a new network component. |
public Scanner(Context cx,InputBuffer input){
init(cx,true);
this.input=input;
cx.input=input;
}
| This contructor is used by Flex direct AST generation. It allows Flex to pass in a specialized InputBuffer. |
public void stopProxy(int hostNumber){
proxySet.get(currentType)[hostNumber - 1].stop();
}
| Stop proxy. |
public static PKIXCertPathValidatorResult validate(CertPath path,PKIXParameters params) throws Exception {
CertPathValidator validator=CertPathValidator.getInstance("PKIX");
return (PKIXCertPathValidatorResult)validator.validate(path,params);
}
| Perform a PKIX validation. On failure, throw an exception. |
public boolean isSslClientAuth(){
return sslClientAuth;
}
| Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which validity will be verified with trust manager. |
public SPFRecord(Name name,int dclass,long ttl,List strings){
super(name,Type.SPF,dclass,ttl,strings);
}
| Creates a SPF Record from the given data |
void putObject(int offset,NativeObject ob){
switch (addressSize()) {
case 8:
putLong(offset,ob.address);
break;
case 4:
putInt(offset,(int)(ob.address & 0x00000000FFFFFFFF));
break;
default :
throw new InternalError("Address size not supported");
}
}
| Writes the base address of the given native object at the given offset of this native object. |
public JsonWriter endArray() throws IOException {
return close(JsonScope.EMPTY_ARRAY,JsonScope.NONEMPTY_ARRAY,"]");
}
| Ends encoding the current array. |
public void add(int index,E element){
rangeCheckForAdd(index);
ensureCapacity(size + 1);
System.arraycopy(elementData,index,elementData,index + 1,size - index);
elementData[index]=element;
size++;
}
| Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). |
public void mouseEntered(MouseEvent event){
initiateToolTip(event);
}
| Called when the mouse enters the region of a component. This determines whether the tool tip should be shown. |
public JobDefinitionEntity createJobDefinitionEntity(String namespaceCode,String jobName,String description,String activitiId){
NamespaceEntity namespaceEntity=namespaceDao.getNamespaceByCd(namespaceCode);
if (namespaceEntity == null) {
namespaceEntity=namespaceDaoTestHelper.createNamespaceEntity(namespaceCode)... | Creates and persists a new job definition entity. |
public boolean contains(double x,double y,double w,double h){
if (npoints <= 0 || !bounds.intersects(x,y,w,h)) {
return false;
}
updateComputingPath();
return closedPath.contains(x,y,w,h);
}
| Tests if the interior of this <code>Polygon</code> entirely contains the specified set of rectangular coordinates. |
public List<Poi> queryForAllWays(){
return poiDao.queryForAllWays();
}
| Query for all POIs who are ways. |
public boolean containsAll(float[] array){
for (int i=array.length; i-- > 0; ) {
if (!contains(array[i])) {
return false;
}
}
return true;
}
| Tests the set to determine if all of the elements in <tt>array</tt> are present. |
@Ignore public static LongArray instance(long[] value){
throw Util.makeJavaArrayWrapperException();
}
| The size of the new array. |
private void deleteBV(Matrix alpha,Matrix C,Matrix Q,double[][] basisVectors,int d,int index){
int inputDim=basisVectors[0].length;
int dMax=basisVectors.length;
double[] t_row;
double t_scalar=0;
t_scalar=alpha.getArray()[index][0];
alpha.getArray()[index][0]=alpha.getArray()[d][0];
alpha.getArray()[d][0... | Delete the given BV from the BV set by adjusting the parametrisation of the GP using eqs. (3.19), (3.21) and (3.22): alpha_t+1 = alpha^{(r)} - alpha^star / (c^star + q^star) * (Q^star + C^star) C_t+1 = C^{(r)} + Q^star * Q^star^T / q^star - (Q^star + C^star) * (Q^star + C^star)^T / (q^star + c^star) Q_t+1 = Q^{(r)} - Q... |
private byte[] crypt_raw(byte password[],byte salt[],int log_rounds){
int rounds, i, j;
int cdata[]=(int[])bf_crypt_ciphertext.clone();
int clen=cdata.length;
byte ret[];
if (log_rounds < 4 || log_rounds > 31) throw new IllegalArgumentException("Bad number of rounds");
rounds=1 << log_rounds;
if (salt.l... | Perform the central password hashing step in the bcrypt scheme |
public boolean more() throws JSONException {
this.next();
if (this.end()) {
return false;
}
this.back();
return true;
}
| Determine if the source string still contains characters that next() can consume. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
@Override public SurfaceBuilder<T> cornerClickRadius(double radius){
cornerClickRadius=radius;
return this;
}
| Sets the radius which forms a circle around a given corner, within which a corner drag gesture will be recognized. |
final void internalSetModifiers(int pmodifiers){
supportedOnlyIn2();
preValueChange(MODIFIERS_PROPERTY);
this.modifierFlags=pmodifiers;
postValueChange(MODIFIERS_PROPERTY);
}
| Internal synonym for deprecated method. Used to avoid deprecation warnings. |
public static int interleave(int x,int y){
if (((x | y) & 0xFFFF0000) != 0) throw new IllegalArgumentException("Overflow");
return part1by1(x) | (part1by1(y) << 1);
}
| Interleaves the bits of the two specified integer values (Morton code). |
public PopulationIterator(){
super();
nextIndex=0;
currentIndex=-1;
expectedModCount=modCount;
}
| Constructs a population iterator. |
public void addFooterView(View v){
addFooterView(v,null,true);
}
| Add a fixed view to appear at the bottom of the list. If addFooterView is called more than once, the views will appear in the order they were added. Views added using this call can take focus if they want. <p>NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will ... |
public static Range visibleRange(ContourDataset data,Range x,Range y){
Range range=null;
range=((DefaultContourDataset)data).getZValueRange(x,y);
return range;
}
| Returns the visible z-range. |
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
s.defaultReadObject();
}
| Adds semantic checks to the default deserialization method. This method must have the standard signature for a readObject method, and the body of the method must begin with "s.defaultReadObject();". Other than that, any semantic checks can be specified and do not need to stay the same from version to version. A readObj... |
public Instance calcPivot(TempNode node1,TempNode node2,Instances insts) throws Exception {
int classIdx=m_Instances.classIndex();
double[] attrVals=new double[insts.numAttributes()];
Instance temp;
double anchr1Ratio=(double)node1.points.length / (node1.points.length + node2.points.length), anchr2Ratio=(double... | Calculates the centroid pivot of a node based on its two child nodes. |
private void calcMaxTextOffset(Rectangle viewRect){
if (!isColumnLayout || !isLeftToRight) {
return;
}
int offset=viewRect.x + leadingGap + checkSize.maxWidth+ afterCheckIconGap+ iconSize.maxWidth+ gap;
if (checkSize.maxWidth == 0) {
offset-=afterCheckIconGap;
}
if (iconSize.maxWidth == 0) {
off... | Calculates maximal text offset. It is required for some L&Fs (ex: Vista L&F). The offset is meaningful only for L2R column layout. |
@Override public void onCreate(){
super.onCreate();
mConnectivityManager=(ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
}
| What to do when the application starts |
public boolean hasDebugInfo(){
for ( AbstractBlockBase<?> b : linearScanOrder()) {
for ( LIRInstruction op : getLIRforBlock(b)) {
if (op.hasState()) {
return true;
}
}
}
return false;
}
| Determines if any instruction in the LIR has debug info associated with it. |
public RealMatrix create(){
RealMatrix rotation=newIdentityMatrix();
for ( Plane plane : planes) {
double theta=plane.getTheta();
if (Double.isNaN(theta)) {
continue;
}
rotation=rotation.multiply(newRotationMatrix(plane.getFirstAxis(),plane.getSecondAxis(),theta));
}
return rotation;
}
| Returns the rotation matrix resulting from applying all 2D rotation planes and angles added to this builder. |
@Override public boolean contains(Object object){
if (object == null) {
return false;
}
for (int i=0; i < size; i++) {
if (object.equals(elements[i])) {
return true;
}
}
return false;
}
| Answers if there is an element in this queue equals to the object. |
public static boolean isNullConversion(MethodType call,MethodType recv,boolean keepInterfaces){
if (call == recv) return true;
int len=call.parameterCount();
if (len != recv.parameterCount()) return false;
for (int i=0; i < len; i++) if (!isNullConversion(call.parameterType(i),recv.parameterType(i),keepIn... | True if a method handle can receive a call under a slightly different method type, without moving or reformatting any stack elements. |
protected ResourceInfo newElement(int type){
ResourceInfo result=null;
switch (type) {
case IResource.FILE:
case IResource.FOLDER:
result=new ResourceInfo(type);
break;
case IResource.PROJECT:
result=new ResourceInfo(type);
break;
case IResource.ROOT:
result=new ResourceInfo(type);
break;
}
return result;
}
| Create and return a new tree element of the given type. |
boolean isYoung(){
return mYoung;
}
| Tell whether this node is consumed since last layout. |
public InlineQueryResultCachedPhotoBuilder caption(String caption){
this.caption=caption;
return this;
}
| *Optional Sets the caption to the provided value. This can be 0-200 characters in length |
public ClusterTopologyCheckedException(String msg){
super(msg);
}
| Creates new topology exception with given error message. |
public ForumPostConfig update(ForumPostConfig config){
config.addCredentials(this);
String xml=POST(this.url + "/update-forum-post",config.toXML());
Element root=parse(xml);
if (root == null) {
return null;
}
try {
config=new ForumPostConfig();
config.parseXML(root);
return config;
}
catc... | Update the forum post. |
public void translate(final double offsetX,final double offsetY){
for ( Neuron neuron : this.getFlatNeuronList()) {
neuron.setX(neuron.getX() + offsetX);
neuron.setY(neuron.getY() + offsetY);
}
}
| Translate all neurons (the only objects with position information). |
public void saveBooleanToPreference(String key,Boolean value){
if (value == null) {
mSharedPreference.edit().remove(key).apply();
}
else {
mSharedPreference.edit().putBoolean(key,value).apply();
}
}
| Saves a boolean value under the provided key in the preference manager. If <code>value</code> is <code>null</code>, then the provided key will be removed from the preferences. |
public StateMachineTestPlanStepBuilder expectVariable(Object key,Object value){
this.expectVariables.put(key,value);
return this;
}
| Expect variable to exist in extended state variables and match with the value. |
public static Network createTestNetwork(){
double freespeed=2.7;
double capacity=500.;
double numLanes=1.;
MutableScenario scenario=(MutableScenario)ScenarioUtils.createScenario(ConfigUtils.createConfig());
Network network=(Network)scenario.getNetwork();
Node node1=NetworkUtils.createAndAddNode(network,Id.c... | This method creates a test network. It is used for example in PtMatrixTest.java to test the pt simulation in MATSim. The network has 9 nodes and 8 links (see the sketch below). |
public static <T>Set<T> emptySet(){
return java.util.Collections.emptySet();
}
| Create an empty immutable set. |
@Override public void connectionStateChanged(State state){
log.info("Site info connection state changed to {}",state);
if (state.equals(State.CONNECTED)) {
log.info("Curator (re)connected. Waking up the vdc manager...");
wakeup();
}
}
| called when connection state changed. |
@Inline @Interruptible public static int[] newContiguousIntArray(int n){
return new int[n];
}
| Allocate a contiguous int array |
public static boolean ignoreWARCRecord(WARCWritable value) throws IOException {
int contentLength=value.getRecord().getHeader().getContentLength();
if (contentLength >= 10000000) {
return true;
}
if (!value.getRecord().isContentApplicationHttpResponse()) {
return true;
}
String httpHeaderText=value.... | Checks whether the given WARC record should be ignored; this applies for documents longer than 10 MB and documents that are not text/html |
public void back(){
if (--pos == -1) {
pos=0;
}
}
| Unreads the most recent character of input. If no input characters have been read, the input is unchanged. |
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.thermometerStroke=SerialUtilities.readStroke(stream);
this.thermometerPaint=SerialUtilities.readPaint(stream);
this.valuePaint=SerialUtilities.readPaint(stream);
this.mercuryPaint=Se... | Provides serialization support. |
private void generatePrivacyKeyPair(boolean clientMode) throws IOException, UnsupportedEncodingException, NoSuchAlgorithmException, SaslException {
byte[] ccmagic=CLIENT_CONF_MAGIC.getBytes(encoding);
byte[] scmagic=SVR_CONF_MAGIC.getBytes(encoding);
MessageDigest md5=MessageDigest.getInstance("MD5");
int n;
... | Generates client-server and server-client keys to encrypt and decrypt messages. Also generates IVs for DES ciphers. |
public static double calculateKilometers(double meters){
double kilometers=meters * 0.001;
return kilometers;
}
| The calculateKilometers method displays the kilometers that are equivalent to a specified number of meters. |
protected void hitOrDraw(Graphics2D graphics,DrawInfo2D info,Bag putInHere){
}
| Instead of overriding the draw and hitObjects methods, you can optionally override this method to provide <i>both</i> the draw(...) and hitObjects(...) functionality in a single method, as it's common that these two methods have nearly identical code. You should test which operation to do based on whether or not graph... |
public static void v(String tag,String msg,Object... args){
if (sLevel > LEVEL_VERBOSE) {
return;
}
if (args.length > 0) {
msg=String.format(msg,args);
}
Log.v(tag,msg);
}
| Send a VERBOSE log message. |
@SuppressWarnings("unchecked") public void updateStory(final String message,final String name,final String caption,final String description,final String link,final String picture,final SocialAuthListener<Integer> listener) throws UnsupportedEncodingException {
try {
if (getCurrentProvider().getProviderId().equals... | Method to share message with link preview on facebook only |
public BitVector(int size){
this.size=size;
if ((size % 8) > 0) {
size=(size / 8) + 1;
}
else {
size=(size / 8);
}
data=new byte[size];
}
| Constructs a new <tt>BitVector</tt> instance with a given size. <p> |
public static boolean isPowerOfTwo(int value){
return value != 0 && (value & (value - 1)) == 0;
}
| Indicates whether a specified value is a power of two. |
public User checkEmailOrLoginAndPsw(String loginOrEmail,String psw) throws NotActivatedUserException, BannedUserException, Exception {
UserExt user=universal.selectOne(new SelectUserByLoginOrEmail(loginOrEmail));
if (user == null) return null;
checkStatus(user,loginOrEmail);
return equalsPsw(user,psw) ? user.... | Try find user by login or email and check status and psw |
public static final byte[] decodeUrl(byte[] bytes) throws DecoderException {
if (bytes == null) {
return null;
}
ByteArrayOutputStream buffer=new ByteArrayOutputStream();
for (int i=0; i < bytes.length; i++) {
int b=bytes[i];
if (b == '+') {
buffer.write(' ');
}
else if (b == '%') {
... | Decodes an array of URL safe 7-bit characters into an array of original bytes. Escaped characters are converted back to their original representation. |
public void addAnimation(ComponentAnimation an){
anims.add(an);
Display.getInstance().notifyDisplay();
}
| Adds the animation to the end to the animation queue |
public static String buildSuccessOutput(AsicContainerVerifier verifier){
StringBuilder builder=new StringBuilder();
builder.append("Verification successful.\n");
builder.append("Signer\n");
builder.append(" Certificate:\n");
appendCert(builder,verifier.getSignerCert());
builder.append(" ID: " + verifi... | Generates the output in case of successful verification. |
private boolean compareString(Object valueObj,String value1S,String value2S){
m_numeric=false;
String valueObjS=String.valueOf(valueObj);
String op=getOperation();
if (OPERATION_Eq.equals(op)) return valueObjS.compareTo(value1S) == 0;
else if (OPERATION_Gt.equals(op)) return valueObjS.compareTo(value1S) ... | Compare String |
static private String readFromFile(final File file) throws IOException {
final LineNumberReader r=new LineNumberReader(new FileReader(file));
try {
final StringBuilder sb=new StringBuilder();
String s;
while ((s=r.readLine()) != null) {
if (r.getLineNumber() > 1) sb.append("\n");
sb.ap... | Read the contents of a file. <p> Note: This makes default platform assumptions about the encoding of the file. |
public void destroy(){
log.fine("");
}
| Clean up resources |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.