code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static String validateConnectionDetails(final UserInterfaceMqttConnectionDetails connectionDetails,final boolean finalCheck){
String returnValue=pl.baczkowicz.mqttspy.utils.ConnectionUtils.validateConnectionDetails(connectionDetails);
if (connectionDetails.getUserAuthentication() != null && connectionDetails... | Validates given connection details. |
public RepeatedFieldBuilder<MType,BType,IType> addAllMessages(Iterable<? extends MType> values){
for ( final MType value : values) {
if (value == null) {
throw new NullPointerException();
}
}
if (values instanceof Collection) {
@SuppressWarnings("unchecked") final Collection<MType> collection=(... | Appends all of the messages in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator. |
public void addInvokeinterface(CtClass clazz,String name,CtClass returnType,CtClass[] paramTypes,int count){
String desc=Descriptor.ofMethod(returnType,paramTypes);
addInvokeinterface(clazz,name,desc,count);
}
| Appends INVOKEINTERFACE. |
public void startThreads(){
int priority=Thread.currentThread().getPriority();
log.debug("startThreads current priority = " + priority + " max available = "+ Thread.MAX_PRIORITY+ " default = "+ Thread.NORM_PRIORITY+ " min available = "+ Thread.MIN_PRIORITY);
Thread retryThread=new Thread(retryHandler,"MX1 retry h... | Invoked at startup to start the threads needed here. |
public void draw(Graphics2D g2,Rectangle2D chartArea,Point2D anchor,ChartRenderingInfo info){
notifyListeners(new ChartProgressEvent(this,this,ChartProgressEvent.DRAWING_STARTED,0));
if (this.elementHinting) {
Map m=new HashMap<String,String>();
if (this.id != null) {
m.put("id",this.id);
}
m.... | Draws the chart on a Java 2D graphics device (such as the screen or a printer). <P> This method is the focus of the entire JFreeChart library. |
@Override @Deprecated public BudgetUsage consumeEncumbranceBudget(final String appropriationnumber,final Long financialyearid,final Integer moduleid,final String referencenumber,final Integer departmentid,final Long functionid,final Integer functionaryid,final Integer schemeid,final Integer subschemeid,final Integer bo... | Does the same as the above API. Except this API returns BudgetUsage object if the available amount is >=0. If there is insufficient available amount then null is returned. Note that the first parameter is a String, unlike the previous API. |
public JSONArray put(int index,int value) throws JSONException {
this.put(index,new Integer(value));
return this;
}
| Put or replace an int value. If the index is greater than the length of the JSONArray, then null elements will be added as necessary to pad it out. |
private CResultColor(){
}
| You are not supposed to instantiate this class. |
protected void processDataAdd(SimEvent ev,boolean ack){
if (ev == null) {
return;
}
Object[] pack=(Object[])ev.getData();
if (pack == null) {
return;
}
File file=(File)pack[0];
file.setMasterCopy(true);
int sentFrom=((Integer)pack[1]).intValue();
Object[] data=new Object[3];
data[0]=file.get... | Process a file inclusion request. |
private void closeExternalStorageFiles(final String storagePath){
stop(true);
notifyChange(QUEUE_CHANGED);
notifyChange(META_CHANGED);
}
| Called when we receive a ACTION_MEDIA_EJECT notification. |
public NsHead(byte[] input){
wrap(input);
}
| Creates a new instance of NsHead. |
public static void send(InternalDistributedMember recipient,int processorId,RawValue val,ReplySender replySender) throws RemoteOperationException {
Assert.assertTrue(recipient != null,"PRDistribuedGetReplyMessage NULL reply message");
GetReplyMessage m=new GetReplyMessage(processorId,val);
m.setRecipient(recipien... | Return the value from the get operation, serialize it bytes as late as possible to avoid making un-neccesary byte[] copies. De-serialize those same bytes as late as possible to avoid using precious threads (aka P2P readers). |
public Iterator<Contact> iterator(){
return values().iterator();
}
| This is used to iterate over the <code>Contact</code> objects in a for each loop. Iterating over the contacts allows them to be easily added to a list of unique contacts. |
public void tryLock(int key,long timeout,int lockCount){
try {
LockerData data=getData(key,lockCount);
doLock(data.getLock(),timeout);
checkException(data);
}
finally {
_data.remove(key);
}
}
| Locks the calling thread until someone will release it, or timeout will occur. On release - the given recipient will be notified. |
public String generateResponseUrlForTenant(LogoutResponse samlResponse,String tenant){
String retval=null;
log.debug("generateResponseUrlForTenant, tenant " + tenant + ", SLO response "+ samlResponse);
try {
Validate.notNull(this.idmAccessor);
Validate.isTrue(this.logoutRequest != null || this.logoutRespo... | Based on all processing, encode and sign response and generate a redirect |
public static boolean isInformational(int status){
return (status >= 100 && status < 200);
}
| Returns whether the status is informational (i.e. 1xx). |
public final double distanceSquared(Point3d p){
return location.distanceSquared(p);
}
| Return the squared distance to the given point. This method saves some execution time by not applying the square root so a squared distance is returned. |
public void addEntry(int severity,String msg,RefactoringStatusContext context,String pluginId,int code){
fEntries.add(new RefactoringStatusEntry(severity,msg,context,pluginId,code));
fSeverity=Math.max(fSeverity,severity);
}
| Adds a new entry filled with the given arguments to this status. The severity of this status is set to the maximum of <code>fSeverity</code> and <code>severity</code>. |
private static void sortedAdd(RatTermVec vec,RatTerm newTerm){
int deg=newTerm.expt;
for (int i=0, size=vec.size(); i < size; i++) {
if (vec.get(i).expt == deg) {
if (vec.get(i).coeff.add(newTerm.coeff).equals(ZERO)) {
vec.remove(i);
return;
}
else {
vec.set(new RatTerm(vec.... | Merges a term into a sequence of terms, preserving the sorted nature of the sequence (helper procedure). Definitions: Let a "Sorted RatTermVec" be a RatTermVec V such that [1] V is sorted in descending exponent order && [2] there are no two RatTerms with the same exponent in V && [3] there is no RatTerm in V with a coe... |
private void onPathButtonClick(IDirectory newSelection){
if ((mDirectoryListener != null) && (newSelection != null)) {
mCurrentPath=newSelection.getAbsolute();
mDirectoryListener.onDirectoryPick(mCurrentPath,this.mDirQueryID);
}
}
| path/directory was clicked |
@Override public void expandMetaVolume(StorageSystem storageSystem,StoragePool storagePool,Volume metaHead,List<String> newMetaMembers,MetaVolumeTaskCompleter metaVolumeTaskCompleter) throws DeviceControllerException {
_log.info(String.format("Expand Meta Volume Start - Array: %s, Head: %s, %n New members:%s",stora... | Expand meta volume. |
@SuppressWarnings({"rawtypes","unchecked"}) public static void main(final String[] args) throws Exception {
if (!prepareHomeDir()) {
System.exit(-1);
}
System.out.println("Preparing Jetty...");
ProtectionDomain domain=Starter.class.getProtectionDomain();
URL warUrl=domain.getCodeSource().getLocation();
... | Extracts required Jetty libs and JettyLauncher to temp folder and launches Jetty from there. |
@Override public void ensureMapped(Address start,int pages){
int startChunk=addressToMmapChunksDown(start);
int endChunk=addressToMmapChunksUp(start.plus(Conversions.pagesToBytes(pages)));
for (int chunk=startChunk; chunk < endChunk; chunk++) {
if (mapped[chunk] == MAPPED) continue;
Address mmapStart=... | Ensure that a range of pages is mmapped (or equivalent). If the pages are not yet mapped, demand-zero map them. Note that mapping occurs at chunk granularity, not page granularity.<p> NOTE: There is a monotonicity assumption so that only updates require lock acquisition. TODO: Fix the above to support unmapping. |
public static PlatformProcessor platformProcessor(Ignite grid){
GridKernalContext ctx=((IgniteKernal)grid).context();
return ctx.platform();
}
| Get GridGain platform processor. |
public static CommandlineOptions parseCommandLine(final String[] arguments){
Preconditions.checkNotNull(arguments,"IE02087: Arguments argument can not be null");
final CommandlineOptions options=new CommandlineOptions();
for ( final String argument : arguments) {
if ("-v".equals(argument)) {
options.se... | Parses the command line arguments passed to BinNavi. |
public boolean remove(final Object o){
return remove(((((Character)(o)).charValue())));
}
| Delegates to the corresponding type-specific method. |
public final int writeFieldName(String name){
if (_type == TYPE_OBJECT) {
if (_currentName != null) {
return STATUS_EXPECT_VALUE;
}
_currentName=name;
return (_index < 0) ? STATUS_OK_AS_IS : STATUS_OK_AFTER_COMMA;
}
return STATUS_EXPECT_VALUE;
}
| Method that writer is to call before it writes a field name. |
public final int yystate(){
return zzLexicalState;
}
| Returns the current lexical state. |
public static float calculateMaxTurnsAtSafe(Aero aero){
int fuelPoints=aero.getFuel();
float fuelPerTurn;
if (aero.getEntityType() == Entity.ETYPE_CONV_FIGHTER) {
fuelPerTurn=aero.getWalkMP() * 0.5f;
}
else {
fuelPerTurn=aero.getWalkMP();
}
return fuelPoints / fuelPerTurn;
}
| Computes and returns the maximum number of turns the given unit could fly at safe thrust given its fuel payload. Aerospace fighters consume 1 fuel point per thrust point spent up the the maximum safe thrust, whereas conventional fighters consume 0.5 fuel points per thrust point spent up to the maximum safe thrust. ... |
public String toString(){
final String TAB=" ";
StringBuffer retValue=new StringBuffer();
retValue.append("InOperator ( ").append("range = ").append(Arrays.toString(this.range)).append(TAB).append(" )");
return retValue.toString();
}
| Constructs a <code>String</code> with all attributes in name = value format. |
private void configureExtraClasspath(WAR war,Element context){
if (war.getExtraClasspath() != null) {
((Tomcat5xStandaloneLocalConfiguration)getContainer().getConfiguration()).configureExtraClasspathToken(war,context);
}
}
| Configures the specified context element with the extra classpath (if any) of the given WAR. |
public Object[] lookupCflow(String name){
if (cflow == null) cflow=new Hashtable();
return (Object[])cflow.get(name);
}
| Undocumented method. Do not use; internal-use only. |
public void removeFileTransferListener(final FileTransferListener li){
if (listeners == null) {
return;
}
synchronized (this.listeners) {
listeners.remove(li);
}
}
| Removes a file transfer listener. |
private void removeItem(ExpandItem item){
fontListener.removeControl(((SourceViewer)viewers.get(item)).getControl());
final Object data=item.getData(KEY);
items.remove(Integer.parseInt(data.toString()));
item.getControl().dispose();
item.dispose();
}
| Removes the item from the view, performing necessary cleanup. |
public boolean hasValue(){
return super.hasTextValue();
}
| Returns whether it has the value. |
public Object nextValue() throws JSONException {
char c=nextClean();
String s;
switch (c) {
case '"':
case '\'':
return nextString(c);
case '{':
back();
return new JSONObject(this);
case '[':
back();
return new JSONArray(this);
}
StringBuffer sb=new StringBuffer();
char b=c;
while (c >= ' ' && ",:]}/\\\"[{;=#... | Get the next value. The value can be a Boolean, Double, Integer, JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object. |
public static Spacing createDependentLFSpacing(int minSpaces,int maxSpaces,TextRange dependency,boolean keepLineBreaks,int keepBlankLines){
return createDependentLFSpacing(minSpaces,maxSpaces,dependency,keepLineBreaks,keepBlankLines,DependentSpacingRule.DEFAULT);
}
| Creates a spacing setting instance which inserts a line break if the specified text range also contains a line break. Used for formatting rules like the "next line if wrapped" brace placement. |
public static int loadShader(int type,String shaderCode){
int shader=GLES20.glCreateShader(type);
GLES20.glShaderSource(shader,shaderCode);
GLES20.glCompileShader(shader);
return shader;
}
| Utility method for compiling a OpenGL shader. |
public Mine(){
super();
}
| Needed by CGLib |
public CustomPotionEffect(int potionID,int duration,int amplifier,List<ItemStack> curativeItems){
super(potionID,duration,amplifier);
if (curativeItems == null) {
this.setCurativeItems(new ArrayList<ItemStack>());
}
else {
this.setCurativeItems(curativeItems);
}
}
| Creates a potion effect with custom curable items. |
private void addDroppableObjects(RPObject obj,List<Pair<RPObject,RPSlot>> list){
boolean droppable=true;
for ( RPSlot slot : obj.slots()) {
for ( RPObject subobj : slot) {
addDroppableObjects(subobj,list);
droppable=false;
}
}
if (obj instanceof Item) {
Item item=(Item)obj;
if (i... | Add any droppable objects inside an object, including the object itself if it's droppable and empty. The contents are scanned recursively. |
public void fireStatusUpdate(LayerStatusEvent evt){
for ( LayerStatusListener listener : lsListeners) {
listener.updateLayerStatus(evt);
}
}
| Sends a status update to the LayerStatusListener. |
public void readSessionState(){
if (!sessionStateChanged || sessionStateUpdating) {
return;
}
sessionStateChanged=false;
sessionState=New.arrayList();
CommandInterface ci=prepareCommand("SELECT * FROM INFORMATION_SCHEMA.SESSION_STATE",Integer.MAX_VALUE);
ResultInterface result=ci.executeQuery(0,false);
... | Read the session state if necessary. |
public FluentFunction<T,R> visitEvent(final Consumer<R> eventConsumer,final Consumer<Throwable> errorConsumer){
return FluentFunctions.of(null);
}
| Visit the result of this Function once it has been executed, if the Function executes successfully the result will be passes to the eventConsumer, if there is an error it will be passed to the errorConsumer |
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException {
TranslationHelpers.checkTranslationArguments(environment,instruction,instructions,"cmpsd");
new CmpsGenerator().generate(environmen... | Translates a CMPSD instruction to REIL code. |
public boolean isProcessed(){
Object oo=get_Value(COLUMNNAME_Processed);
if (oo != null) {
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
| Get Processed. |
private void removeDeadCode(MethodNode method){
try {
Analyzer analyzer=new Analyzer(new BasicInterpreter());
analyzer.analyze(specializedClassName,method);
Frame[] frames=analyzer.getFrames();
AbstractInsnNode[] insns=method.instructions.toArray();
for (int i=0; i < frames.length; i++) {
Ab... | Remove the dead code - or unreachable code - from a method. |
public JPanel(){
this(true);
}
| Creates a new <code>JPanel</code> with a double buffer and a flow layout. |
public void testDoCheckWithDefaultNotDetectionResultAndDetectionResultOverridenByConstructor(){
LOGGER.debug("doCheckWithDefaultNotDetectionResultAndDetectionResultOverridenByConstructor");
elements.add(element);
expect(mockTextElementBuilder.buildTextFromElement(element)).andReturn("test.php");
mockTestSolutio... | Test of doCheck method, of class TextEndsWithChecker. |
protected synchronized Instance processBuffers(){
if (m_firstBuffer != null && m_secondBuffer != null && m_firstBuffer.size() > 0 && m_secondBuffer.size() > 0) {
if (m_stopRequested.get()) {
return null;
}
InstanceHolder firstH=m_firstBuffer.peek();
InstanceHolder secondH=m_secondBuffer.peek();
... | Process the current state of the two buffers. Compares the head of both buffers and will return a merged instance if they match on the key fields. Will remove instances from one or the other buffer if it is behind according to the keys comparison |
public void curveTo(double x1,double y1,double x2,double y2,double x3,double y3){
if (size() == 0) {
throw new IllegalPathStateException("curveTo only allowed when not empty");
}
Node lastPoint=get(size() - 1);
lastPoint.mask|=C2_MASK;
lastPoint.x[2]=x1;
lastPoint.y[2]=y1;
if ((lastPoint.mask & C1C2_M... | Adds a cubic curve to the bezier path. <p> This is a convenience method for adding a node with control point C0 and C1 (incoming curve) to the bezier path, and also specifying the control point C2 (outgoing curve) of the previous node. <p> The bezier path must already have at least one node. |
public static double pointCircleDistance(Geo p1,Geo p2,Geo center){
Geo n=Geo.crossNormalize(p1,p2,new Geo());
Geo c=center.normalize(new Geo());
double cosTheta=Geo.dot(n,c);
double theta=Math.acos(cosTheta);
return Math.abs(Math.PI / 2 - theta);
}
| Calculates the great circle distance from the point (center) to the great circle containing the points (p1) and (p2). |
public void addRule(Rule rule){
ruleManager.addRule(rule);
}
| Add a rule to this stylesheet. |
private String _serializeStruct(Struct struct,Map<Object,String> done,String id) throws ConverterException {
StringBuilder sb=new StringBuilder(goIn() + "<STRUCT ID=\"" + id+ "\">");
Iterator<Key> it=struct.keyIterator();
deep++;
while (it.hasNext()) {
Key key=it.next();
String value=_serialize(struct.g... | serialize a Struct |
public synchronized void clear(){
topology.clear();
}
| It will remove all elements as if it haven't received anyone from the server. |
public POJOPropertyBuilder withName(String newName){
return new POJOPropertyBuilder(this,newName);
}
| Method for constructing a renamed instance |
public void hide(){
hide(false,null);
}
| Make the badge non-visible in the UI. |
public SGenItemProviderAdapterFactory(){
supportedTypes.add(IEditingDomainItemProvider.class);
supportedTypes.add(IStructuredItemContentProvider.class);
supportedTypes.add(ITreeItemContentProvider.class);
supportedTypes.add(IItemLabelProvider.class);
supportedTypes.add(IItemPropertySource.class);
}
| This constructs an instance. <!-- begin-user-doc --> <!-- end-user-doc --> |
public synchronized void reopen(int offset) throws FormatException {
try {
if (inputFile == null) {
inputFile=new BinaryBufferedFile(filename);
inputFile.byteOrder(byteOrder);
}
if (offset > 0) {
inputFile.seek(offset);
}
}
catch ( IOException i) {
throw new FormatException("... | Reopen the associated input file. |
@Provides @Config("googleAppsAdminEmailAddress") public static String provideGoogleAppsAdminEmailAddress(RegistryEnvironment environment){
switch (environment) {
case PRODUCTION:
return "admin@registry.google";
default :
return "admin@domainregistry-sandbox.co";
}
}
| Gets the email address of the admin account for the Google App. |
protected boolean[] canTakeOptions(){
boolean[] result=new boolean[2];
print("options...");
if (m_Kernel instanceof OptionHandler) {
println("yes");
if (m_Debug) {
println("\n=== Full report ===");
Enumeration<Option> enu=((OptionHandler)m_Kernel).listOptions();
while (enu.hasMoreElement... | Checks whether the scheme can take command line options. |
public final boolean commitProcessReceived(Object key,DM dm){
if (key instanceof TXLockId) {
TXLockId lk=(TXLockId)key;
waitForMemberToDepart(lk.getMemberId(),dm);
}
else if (key instanceof TXId) {
TXId id=(TXId)key;
waitForMemberToDepart(id.getMemberId(),dm);
}
else {
Assert.assertTrue(fa... | Answers fellow "Far Siders" question about an DACK transaction when the transaction originator died before it sent the CommitProcess message. |
public void runTest() throws Throwable {
Document doc;
NodeList elementList;
Node employeeNode;
NodeList employeeList;
int length;
doc=(Document)load("hc_staff",false);
elementList=doc.getElementsByTagName("p");
employeeNode=elementList.item(2);
employeeList=employeeNode.getChildNodes();
length=(int... | Runs the test case. |
public OpenDataException(String msg){
super(msg);
}
| An OpenDataException with a detail message. |
private boolean isEscapingDisabled(){
return m_disableOutputEscapingStates.peekOrFalse();
}
| Tell if the character escaping should be disabled for the current state. |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public boolean isValid(INode staten){
if (!(staten instanceof FifteenPuzzleNode)) {
throw new IllegalArgumentException("SlideMove expects state objects of class EightPuzzleNode");
}
FifteenPuzzleNode state=(FifteenPuzzleNode)staten;
if (fromC < 0 || fromC > FifteenPuzzleNode.MaxR) {
return false;
}
... | Determine if move is valid for the given state. |
@Override protected EClass eStaticClass(){
return TypeRefsPackage.Literals.FUNCTION_TYPE_EXPR_OR_REF;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
@LogMessageDoc(level="ERROR",message="No listener dependency solution: " + "No listeners without incoming dependencies",explanation="The set of listeners installed " + "have dependencies with no solution",recommendation="Install a different set of listeners " + "or install all dependencies. This is a defect in " + "th... | Add a listener to the list of listeners |
public void writeObjectFieldValueSeparator(JsonGenerator jg) throws IOException, JsonGenerationException {
if (_spacesInObjectEntries) {
jg.writeRaw(" : ");
}
else {
jg.writeRaw(':');
}
}
| Method called after an object field has been output, but before the value is output. <p> Default handling (without pretty-printing) will output a single colon to separate the two. Pretty-printer is to output a colon as well, but can surround that with other (white-space) decoration. |
private static Vector<Entity> createAngelEnemy(IPlayer owner,IGame mockGame){
Vector<Entity> entitiesVector=new Vector<Entity>();
Entity enemy1=Mockito.mock(Mech.class);
Coords ecm1Pos=new Coords(5,5);
ECMInfo ecm1=new ECMInfo(6,ecm1Pos,owner,0,1);
Mockito.when(enemy1.getOwner()).thenReturn(owner);
Mockito.... | Creates a single enemy with Angel ECM owned by the supplied owner and returning the supplied game. Other enemies are created without ECM. |
private String moveToFolder(final String file,final String folder){
final File source=new File(file);
final File destination=new File(folder + File.separator + source.getName());
Log.i(TAG,file + " stored in temp folder. Moving to " + destination.getAbsolutePath());
try {
FileUtils.moveFile(source,destinati... | Moves file to specified folder |
public void reader(RecordReader reader){
this.reader=reader;
}
| Overrides default input data reader. |
public static void main(String[] args){
TestHeadings tester=new TestHeadings();
run(tester,ARGS,TEST,NEGATED_TEST);
tester.printSummary();
}
| The entry point of the test. |
public static FileDetailFragment newInstance(OCFile fileToDetail,Account account){
FileDetailFragment frag=new FileDetailFragment();
Bundle args=new Bundle();
args.putParcelable(ARG_FILE,fileToDetail);
args.putParcelable(ARG_ACCOUNT,account);
frag.setArguments(args);
return frag;
}
| Public factory method to create new FileDetailFragment instances. When 'fileToDetail' or 'ocAccount' are null, creates a dummy layout (to use when a file wasn't tapped before). |
private void addArcView(){
setClipChildren(false);
progressArc=new ProgressArcView(getContext(),arcColor,arcWidth,roundedStroke);
progressArc.setInternalListener(this);
addView(progressArc,new FrameLayout.LayoutParams(getFabDimension() + arcWidth,getFabDimension() + arcWidth,Gravity.CENTER));
}
| We need to draw a new view with the arc over the FAB, to be able to hide the fab shadow (if it exists). |
public Builder add(Element element,String name){
return add(element,name,1);
}
| Add a single element to this Element. |
static boolean isJavaBaseAssignable(Class lhsType,Class rhsType){
if (lhsType == null) return false;
if (rhsType == null) return !lhsType.isPrimitive();
if (lhsType.isPrimitive() && rhsType.isPrimitive()) {
if (lhsType == rhsType) return true;
if ((rhsType == Byte.TYPE) && (lhsType == Short.TYPE |... | Is the assignment legal via original Java (up to version 1.4) assignment rules, not including auto-boxing/unboxing. |
public EventStoreBuilder tcpWriteBufferHighWaterMark(int size){
tcpSettingsBuilder.writeBufferHighWaterMark(size);
return this;
}
| Sets write buffer high watermark in bytes. |
public Response createResponse(int statusCode,CallIdHeader callId,CSeqHeader cSeq,FromHeader from,ToHeader to,List via,MaxForwardsHeader maxForwards,ContentTypeHeader contentType,Object content) throws ParseException {
if (callId == null || cSeq == null || from == null || to == null || via == null || maxForwards == n... | Creates a new Response message of type specified by the statusCode paramater, containing the mandatory headers of the message with a body in the form of a Java object and the body content type. |
protected DoubleMatrix1D viewSelectionLike(int[] offsets){
return new SelectedDenseDoubleMatrix1D(this.elements,offsets);
}
| Construct and returns a new selection view. |
private void dumpOption(String option,Object value){
String label=Localization.Main.getText("config." + option + ".label");
label=Helper.pad(label,' ',50) + " : ";
if (label.startsWith(doNot)) {
if (value.toString().equalsIgnoreCase(yes)) value=no;
else value=yes;
}
logger.info(label + value);
}
| Dump the value for the given option to the log file <p/> Makes the following assumptions about entries in the localization properties files for each option to be dumped: - The name in the localization file is of the form config.xxxx.label - The text associated with the name is the text to be used for dumping - If the x... |
protected void fillVersionedObjectList(VersionedObjectList list){
for ( PutAllEntryData entry : this.putAllData) {
if (entry.versionTag != null) {
list.addKeyAndVersion(entry.key,entry.versionTag);
}
}
}
| version tags are gathered from local operations and remote operation responses. This method gathers all of them and stores them in the given list. |
private static void processPendingEntries() throws IllegalAccessException {
while (!pendingEntries.isEmpty()) {
BootImageMap.Entry mapEntry=pendingEntries.remove();
mapEntry.clearPendingEntry();
if (mapEntry.imageAddress.EQ(OBJECT_NOT_ALLOCATED)) {
mapEntry.imageAddress=copyToBootImage(mapEntry.jdkO... | Process any entries that have been deferred |
void renderEdge(){
glDisable(GL_DEPTH_TEST);
if (outlineOnly) {
glUseProgram(this.outlineProgram);
glUniform1i(outlineShowEdgeUniform,showEdge ? 1 : 0);
}
else {
glUseProgram(this.edgeProgram);
glUniform1i(edgeShowEdgeUniform,showEdge ? 1 : 0);
}
glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT,f... | Render the edges using the Sobel edge filter and blend that with the normals. |
@Override protected boolean isPrepared(final Player player){
if (player.isEquipped("money",30)) {
return true;
}
else {
player.sendPrivateText("You need 30 coins to make a wish.");
return false;
}
}
| Decides if the activity can be done. |
public static double cauchy(){
return Math.tan(Math.PI * (uniform() - 0.5));
}
| Returns a random real number from the Cauchy distribution. |
private static void selectAndPossiblyCenter(JTextArea textArea,int start,int end){
textArea.setSelectionStart(start);
textArea.setSelectionEnd(end);
Rectangle r=null;
try {
r=textArea.modelToView(start);
if (r == null) {
return;
}
if (end != start) {
r=r.union(textArea.modelToView(en... | Selects a range of text in a text component. If the new selection is outside of the previous viewable rectangle, then the view is centered around the new selection. |
public static float scale(float v,float vMin,float vMax,float pMin,float pMax){
return (pMax - pMin) * (v - vMin) / (vMax - vMin) + pMin;
}
| Project a value that is within the in(Min/Max) number space into the to(Min/Max) number space. |
public final void addElement(int value){
if ((m_firstFree + 1) >= m_mapSize) {
m_mapSize+=m_blocksize;
int newMap[]=new int[m_mapSize];
System.arraycopy(m_map,0,newMap,0,m_firstFree + 1);
m_map=newMap;
}
m_map[m_firstFree]=value;
m_firstFree++;
}
| Append a int onto the vector. |
public static _Fields findByThriftIdOrThrow(int fieldId){
_Fields fields=findByThriftId(fieldId);
if (fields == null) {
throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
}
return fields;
}
| Find the _Fields constant that matches fieldId, throwing an exception if it is not found. |
private static void swap(double x[],int a,int b){
double t=x[a];
x[a]=x[b];
x[b]=t;
}
| Swaps x[a] with x[b]. |
public void removeListener(final IToolbarPanelSynchronizerListener listener){
m_listeners.removeListener(listener);
}
| Removes a listener object. |
private void cmd_print(){
if (fPaymentRule.getSelectedItem() == null) return;
String PaymentRule=fPaymentRule.getSelectedItem().toValueNamePair().getValue();
log.info(PaymentRule);
if (!getChecks(PaymentRule)) return;
List<File> pdfList=new ArrayList<File>();
for (int i=0; i < m_checks.length; i++) {
... | Print Checks and/or Remittance |
@RequestProcessing(value="/kill-browser",method=HTTPRequestMethod.GET) @Before(adviceClass=StopwatchStartAdvice.class) @After(adviceClass=StopwatchEndAdvice.class) public void showKillBrowser(final HTTPRequestContext context,final HttpServletRequest request,final HttpServletResponse response){
final AbstractFreeMarke... | Shows kill browser page with the specified context. |
protected Object reportReturn(String methodCall,Object value){
reportAllReturns(methodCall,"" + value);
return value;
}
| Conveniance method to report (for logging) that a method returned an Object. |
public static void extract(int format,Resource[] sources,Resource target) throws IOException {
if (format == FORMAT_ZIP || format == FORMAT_TAR) {
for (int i=0; i < sources.length; i++) {
extract(format,sources[i],target);
}
}
else throw new IOException("can't extract in given format");
}
| extract a zip file to a directory |
@Override protected void preUpdateMenu(){
super.preUpdateMenu();
m_MinNumParentDirs=determineMinimumNumberOfParentDirs();
}
| Hook method which gets executed just before updating the menu. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public JavaPairRDD<Polygon,HashSet<Point>> SpatialJoinQuery(PointRDD pointRDD,PolygonRDD polygonRDD){
if (pointRDD.gridPointRDD == null) {
throw new NullPointerException("Need to do spatial partitioning first, gridedSRDD is null");
}
JavaPairRDD<Integer,Tuple2<Iterable<Point>,Iterable<Polygon>>> cogroupResult... | Spatial Join Query using regular nested loop. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.