code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public double nextDouble(){
return nextDouble(this.freedom);
}
| Returns a random number from the distribution. |
private static void verifyCodewordCount(int[] codewords,int numECCodewords) throws FormatException {
if (codewords.length < 4) {
throw FormatException.getFormatInstance();
}
int numberOfCodewords=codewords[0];
if (numberOfCodewords > codewords.length) {
throw FormatException.getFormatInstance();
}
i... | Verify that all is OK with the codeword array. |
String serializeToString(){
final StringBuilder sb=new StringBuilder();
sb.append(String.format("%d,%d,",numActive,keys.length));
for (int i=0; i < keys.length; i++) {
if (states[i] != 0) {
sb.append(String.format("%d,%d,",keys[i],values[i]));
}
}
return sb.toString();
}
| Returns a String representation of this hash map. |
private void serializeResultsDoc(KXmlSerializer serializer,String startTime,String endTime) throws IOException {
serializer.startTag(ns,RESULT_TAG);
serializer.attribute(ns,PLAN_ATTR,mPlanName);
serializer.attribute(ns,STARTTIME_ATTR,startTime);
serializer.attribute(ns,"endtime",endTime);
serializer.attribute... | Output the results XML. |
@Override public String toString(){
StringBuffer buffer=new StringBuffer();
if (terms.size() > 0) {
buffer.append("if ");
boolean firstTerm=true;
for ( SplitCondition condition : terms) {
if (!firstTerm) {
buffer.append(" and ");
}
buffer.append(condition.toString());
... | This method returns a String representation of this rule. |
private void returnData(Object ret){
if (myHost != null) {
myHost.returnData(ret);
}
}
| Used to communicate a return object from a plugin tool to the main Whitebox user-interface. |
void write(ByteCodeWriter out) throws IOException {
out.write(ConstantPool.CP_CLASS);
out.writeShort(_nameIndex);
}
| Writes the contents of the pool entry. |
public void invalidate(){
}
| Sets this SurfaceData object to the invalid state. All Graphics objects must get a new SurfaceData object via the refresh method and revalidate their pipelines before continuing. |
public bdo addElement(Element element){
addElementToRegistry(element);
return (this);
}
| Adds an Element to the element. |
private String[] separatorAndEnclosuresToArray(){
String[] parts=m_Enclosures.split(",");
String[] result=new String[parts.length + 1];
result[0]=m_FieldSeparator;
int index=1;
for ( String e : parts) {
if (e.length() > 1 || e.length() == 0) {
throw new IllegalArgumentException("Enclosures can only... | Assemble the field separator and enclosures into an array of Strings |
private void storeKVTabularDataGeneric(ScanData scanData,MetricsGroup mg,Map<String,String> kvPairs,int queryTime) throws SQLException {
if (mg == null || !mg.isStoreInCommonTable()) {
logger.warning(mg.getGroupName() + " is not defined to store metrics in shared table. Ignore it.");
return;
}
if (kvPairs... | Store data in shared table |
private void configureDecoder() throws IOException {
byte[] prefix=new byte[]{0x00,0x00,0x00,0x01};
ByteBuffer csd0=ByteBuffer.allocate(4 + mSPS.length + 4+ mPPS.length);
csd0.put(new byte[]{0x00,0x00,0x00,0x01});
csd0.put(mSPS);
csd0.put(new byte[]{0x00,0x00,0x00,0x01});
csd0.put(mPPS);
mDecoder=MediaCod... | Instantiates and starts the decoder. |
@SuppressWarnings("unchecked") public void sendMessage(SimpleMailMessage msg,String templateName,Map model){
String result=null;
try {
result=VelocityEngineUtils.mergeTemplateIntoString(velocityEngine,templateName,model);
}
catch ( VelocityException e) {
log.error(e.getMessage());
}
msg.setText(resu... | Send a simple message based on a Velocity template. |
public Minutes toStandardMinutes(){
return Minutes.minutes(FieldUtils.safeMultiply(getValue(),DateTimeConstants.MINUTES_PER_DAY));
}
| Converts this period in days to a period in minutes assuming a 24 hour day and 60 minute hour. <p> This method allows you to convert between different types of period. However to achieve this it makes the assumption that all days are 24 hours long and all hours are 60 minutes long. This is not true when daylight saving... |
@NotNull public PsiQuery siblings(@NotNull final String name){
return siblings(PsiNamedElement.class,name);
}
| Filter siblings by name |
public HGHandle refreshHandle(HGHandle handle){
if (handle instanceof HGPersistentHandle) {
HGHandle result=cache.get((HGPersistentHandle)handle);
return result != null ? result : handle;
}
else {
HGLiveHandle live=(HGLiveHandle)handle;
if (live.getRef() == null) {
HGLiveHandle updated=cache.... | <p> Refresh an atom handle with a currently valid and efficient run-time value. HyperGraph manages essentially two types of handles: run-time handles that are reminiscent to memory pointers and provide very fast access to loaded atoms and persistent handles that refer to long term storage. An atom can be accessed with ... |
public ITurnOrdered nextElement(){
return this.getTurnTotalEnum().nextElement();
}
| Get the next "total" <code>TurnOrdered</code> marker. |
public TextPanel(){
initComponents();
}
| Creates new form NumberPanel |
private void cmd_archive(){
int record_ID=m_curTab.getRecord_ID();
log.info("ID=" + record_ID);
if (record_ID <= 0) return;
int AD_Table_ID=m_curTab.getAD_Table_ID();
new AArchive(aArchive.getButton(),AD_Table_ID,record_ID);
}
| Open/View Archive |
public synchronized UDAudio pause(){
final MediaPlayer player=getMediaPlayer();
if (player != null) {
try {
player.pause();
}
catch ( Exception e) {
e.printStackTrace();
}
}
return this;
}
| pause playing audio |
public void registerRenderInformation(){
}
| Register and load client-only render information. |
public void toggle(Animation animIn,Animation animOut){
toggle(true,animIn,animOut);
}
| Toggle the badge visibility in the UI. |
public void resetCounter(){
if (this.bitsInBuffer < 8) {
this.bitsInBuffer=0;
this.bitBuffer=0;
}
this.byteCounter=0L;
}
| Reset the byte counter for the stream. The Inside bit buffer will be reset also if it is not full. |
public String removeProperty(String property){
return this.properties.remove(property);
}
| Remove the property setting. |
@SuppressWarnings("unchecked") public CnATreeElement loadById(String typeId,int id) throws CommandException {
LoadCnAElementById command=new LoadCnAElementById(typeId,id);
command=getCommandService().executeCommand(command);
return command.getFound();
}
| Load object with given ID for given class. |
public static double calculateFStat(double rsq,int n,int k){
if (n < 1 || k < 2 || n == k) {
System.err.println("Cannot calculate F-stat.");
return Double.NaN;
}
double numerator=rsq / (k - 1);
double denominator=(1 - rsq) / (n - k);
return numerator / denominator;
}
| Returns the F-statistic for a linear regression model. |
public void cancel(){
cancel=true;
}
| Calling this method cancels the event |
public final ASTNode createCopyTarget(ASTNode node){
return createTargetNode(node,false);
}
| Creates and returns a placeholder node for a true copy of the given node. The placeholder node can either be inserted as new or used to replace an existing node. When the document is rewritten, a copy of the source code for the given node is inserted into the output document at the position corresponding to the placeho... |
public Iterator<ViewMetadata> views(){
return Collections.unmodifiableMap(views).values().iterator();
}
| The views that are being processed in index name order. |
private void initComponents(){
toolButtonGroup=new javax.swing.ButtonGroup();
drawingPanel=new org.jhotdraw.samples.draw.DrawingPanel();
jToolBar1=new javax.swing.JToolBar();
loadButton=new javax.swing.JButton();
saveButton=new javax.swing.JButton();
FormListener formListener=new FormListener();
getConten... | This method is called from within the init() method to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor. |
protected void reportAccurateEnumConstructorReference(SearchMatch match,FieldDeclaration field,AllocationExpression allocation) throws CoreException {
if (allocation == null || allocation.enumConstant == null) {
report(match);
return;
}
int sourceStart=match.getOffset() + match.getLength();
if (allocati... | Finds the accurate positions of each valid token in the source and reports a reference to this token to the search requestor. A token is valid if it has an accuracy which is not -1. |
public boolean handleEntry(String startingDir){
File startingFile=null;
if (startingDir != null) {
startingFile=new File(startingDir);
if (!startingFile.exists()) {
startingFile=null;
Debug.output("RpfFileSearch: " + startingDir + " doesn't exist.");
return false;
}
}
if (startingF... | Search, starting with the given directory pathname. |
public void close(Throwable cause){
requireNonNull(cause,"cause");
final DefaultStreamMessage<T> m=new DefaultStreamMessage<>();
m.close(cause);
delegate(m);
}
| Closes the deferred stream without setting a delegate. |
public JSONArray put(int index,boolean value) throws JSONException {
this.put(index,value ? Boolean.TRUE : Boolean.FALSE);
return this;
}
| Put or replace a boolean value in the JSONArray. If the index is greater than the length of the JSONArray, then null elements will be added as necessary to pad it out. |
private void addToken(int tokenType){
addToken(zzStartRead,zzMarkedPos - 1,tokenType);
}
| Adds the token specified to the current linked list of tokens. |
public static float asin(float fValue){
if (-1.0f < fValue) {
if (fValue < 1.0f) {
return (float)Math.asin(fValue);
}
return HALF_PI;
}
return -HALF_PI;
}
| Returns the arc sine of a value. Special cases: If fValue is smaller than -1, then the result is -HALF_PI. If the argument is greater than 1, then the result is HALF_PI. |
@Override public boolean showEdgeLabelsDefault(){
return false;
}
| Returns false. |
private static Capitalization containsAt(String s,int index,String... substrings){
for ( String substring : substrings) {
if (index + substring.length() <= s.length()) {
boolean found=true;
Boolean up1=null;
Boolean up2=null;
for (int i=0; i < substring.length(); i++) {
char c1=s.... | Returns a capitalization strategy if the specified string contains any of the specified substrings at the specified index. The capitalization strategy indicates the casing of the substring that was found. If none of the specified substrings are found, this method returns <code>null</code> . |
private <T>T[] copyElements(T[] a){
if (head < tail) {
System.arraycopy(elements,head,a,0,size());
}
else if (head > tail) {
int headPortionLen=elements.length - head;
System.arraycopy(elements,head,a,0,headPortionLen);
System.arraycopy(elements,0,a,headPortionLen,tail);
}
return a;
}
| Copies the elements from our element array into the specified array, in order (from first to last element in the deque). It is assumed that the array is large enough to hold all elements in the deque. |
public static boolean equalsContent(String oldLicenseText,String newLicenseText){
String contentOldLicenseText;
String contentNewLicenseText;
contentOldLicenseText=getContent(oldLicenseText);
contentNewLicenseText=getContent(newLicenseText);
return contentOldLicenseText.equalsIgnoreCase(contentNewLicenseText)... | Compare two strings for content only. Ignore all formatting. |
public static boolean writeFile(String filePath,String content,boolean append){
FileWriter fileWriter=null;
try {
fileWriter=new FileWriter(filePath,append);
fileWriter.write(content);
fileWriter.close();
return true;
}
catch ( IOException e) {
throw new RuntimeException("IOException occurre... | write file |
public static long diffTimestamps(final int a,final int b){
final long unsignedA=a & 0xFFFFFFFFL;
final long unsignedB=b & 0xFFFFFFFFL;
final long delta=unsignedA - unsignedB;
return delta;
}
| Calculates the delta between two time stamps, adjusting for time stamp wrapping. |
public Long lrem(final String key,final long count,final String value){
checkIsInMulti();
client.lrem(key,count,value);
return client.getIntegerReply();
}
| Remove the first count occurrences of the value element from the list. If count is zero all the elements are removed. If count is negative elements are removed from tail to head, instead to go from head to tail that is the normal behaviour. So for example LREM with count -2 and hello as value to remove against the list... |
public static boolean supportedType(int type){
Type.check(type);
return (type == Type.PTR || type == Type.CNAME || type == Type.DNAME || type == Type.A || type == Type.AAAA || type == Type.NS);
}
| Indicates whether generation is supported for this type. |
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 static int abs(int a){
return (a ^ (a >> 31)) - (a >> 31);
}
| Possibly faster than java.lang.Math.abs(int). |
public void testHasProperty(){
UnboundArbitraryBean instance=new UnboundBeanImpl();
assertTrue(instance.hasProperty(STRING_PROPERTY));
assertTrue(instance.hasProperty(INDEXED_PROPERTY));
assertTrue(instance.hasProperty(MAPPED_STRING));
assertTrue(instance.hasProperty(MAPPED_INDEXED));
assertFalse(instance.h... | Test of hasProperty method, of class UnboundBean. |
private int measureShort(int measureSpec){
int result;
int specMode=MeasureSpec.getMode(measureSpec);
int specSize=MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
result=specSize;
}
else {
result=(int)(2 * mRadius + getPaddingTop() + getPaddingBottom() + 1);
if (specMode ... | Determines the height of this view |
@Override public String toString(){
return this.name;
}
| Returns a string representation for this loss action. |
public ParameterTypeRepositoryLocation(String key,String description,boolean allowEntries,boolean allowDirectories,boolean optional){
this(key,description,allowEntries,allowDirectories,false,optional,false,false);
}
| Creates a new parameter type for files with the given extension. If the extension is null no file filters will be used. |
@Override protected Document readPreProcess(Document document) throws Exception {
NodeList list;
int i;
Element node;
String clsName;
Vector<Element> children;
int id;
int n;
Element child;
m_BeanInstances=new Vector<Object>();
m_BeanInstancesID=new Vector<Integer>();
list=document.getElementsByTa... | additional pre-processing can happen in derived classes before the actual reading from XML (working on the raw XML). right now it does nothing with the document, only empties the help-vector for the BeanInstances and reads the IDs for the BeanInstances, s.t. the correct references can be set again |
public final void updateImage(BufferedImage img,int yAddr,int cbAddr,int crAddr,int align){
final int imageWidth=img.getWidth();
final int imageHeight=img.getHeight();
if ((imageWidth & 0x1) != 0 || (align & 1) != 0) {
throw new RuntimeException("Lcd: image width must be aligned to 32!");
}
int[] pixels=(... | this method can be used to show any screen or picture buffer in YCbCr 4:2:2 format |
public static JLabel createLabel_style3(String txt){
return createLabel_root(txt,__Icon9Factory__.getInstance().getOrangeBaloon(),new Insets(4,9,9,9),new Color(255,255,255),null);
}
| Creates a new N9Component object. |
public void ensureCapacity(int minCapacity){
if (table.length < minCapacity) {
int newCapacity=nextPrime(minCapacity);
rehash(newCapacity);
}
}
| Ensures that the receiver can hold at least the specified number of associations without needing to allocate new internal memory. If necessary, allocates new internal memory and increases the capacity of the receiver. <p> This method never need be called; it is for performance tuning only. Calling this method before <t... |
public TableRowSorter(){
this(null);
}
| Creates a <code>TableRowSorter</code> with an empty model. |
public static boolean matchActionMouseShortcutsModifiers(final Keymap activeKeymap,@JdkConstants.InputEventMask int modifiers,final String actionId){
final MouseShortcut syntheticShortcut=new MouseShortcut(MouseEvent.BUTTON1,modifiers,1);
for ( Shortcut shortcut : activeKeymap.getShortcuts(actionId)) {
if (sho... | Checks that one of the mouse shortcuts assigned to the provided action has the same modifiers as provided |
public static void execute(ExecutablePool pool,String region,EntryEventImpl event){
AbstractOp op=new InvalidateOpImpl(region,event);
pool.execute(op);
}
| Does a region invalidate on a server using connections from the given pool to communicate with the server. |
public static void saveSettings(final AbstractSQLProvider provider,final CView view,final Map<String,String> settings) throws CouldntSaveDataException {
checkArguments(provider,view);
Preconditions.checkNotNull(settings,"IE02414: settings argument can not be null");
if (settings.isEmpty()) {
return;
}
fin... | Stores the settings map of a view to the database. |
public char next(char c) throws JSONException {
char n=this.next();
if (n != c) {
throw this.syntaxError("Expected '" + c + "' and instead saw '"+ n+ "'");
}
return n;
}
| Consume the next character, and check that it matches a specified character. |
private void implPutAll(Map<?,?> t){
for ( Map.Entry<?,?> e : t.entrySet()) {
implPut(e.getKey(),e.getValue());
}
}
| Copies all of the mappings from the specified Map to this provider. Internal method to be called AFTER the security check has been performed. |
public Bag removeObjectsAtLocation(final Double3D location){
Bag bag=getObjectsAtLocation(location);
if (bag != null) {
Object[] objs=bag.objs;
int numObjs=bag.numObjs;
for (int i=0; i < bag.numObjs; i++) remove(objs[i]);
}
return bag;
}
| Removes objects at exactly the given location, and returns a bag of them, or null of no objects are at that location. The Bag may be empty, or null, if there were no objects at that location. You can freely modify this bag. |
private void resetCoordinatorData(CoordinatorClient coordinator,CassandraTokenManager tokenManager1,CassandraTokenManager tokenManager2,Base64TokenEncoder encoder1,Base64TokenEncoder encoder2,TokenKeyGenerator tokenKeyGenerator1,TokenKeyGenerator tokenKeyGenerator2) throws Exception {
final long ROTATION_INTERVAL_MSE... | Convenience function to reset the coordinator data, call init on the two involved nodes, and check they agree on the curent key id. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:46.021 -0500",hash_original_method="7C8784537648600B4251C9E262BFEFC5",hash_generated_method="9F167F07FC0CADA08203BAA255DB9A81") public static EntityIterator newEntityIterator(Cursor cursor){
return new EntityIteratorImpl(cursor);
... | TODO: javadoc |
private static void calculateThresholdForBlock(byte[] luminances,int subWidth,int subHeight,int width,int height,int[][] blackPoints,BitMatrix matrix){
for (int y=0; y < subHeight; y++) {
int yoffset=y << BLOCK_SIZE_POWER;
int maxYOffset=height - BLOCK_SIZE;
if (yoffset > maxYOffset) {
yoffset=maxYO... | For each block in the image, calculate the average black point using a 5x5 grid of the blocks around it. Also handles the corner cases (fractional blocks are computed based on the last pixels in the row/column which are also used in the previous block). |
public void testBug41566() throws Exception {
this.rs=this.stmt.executeQuery("-- this should't change the literal\n select '{1}'");
this.rs.next();
assertEquals("{1}",this.rs.getString(1));
}
| Bug #41566 - Quotes within comments not correctly ignored by escape parser |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public Collection<ObjectReference> dumpRoots(int width){
List<ObjectReference> roots=new ArrayList<ObjectReference>();
for (int i=0; i < values.length; i++) {
Value value=get(i);
String name=method.getSlotName(i);
if (value != null && value instanceof ObjectValue) {
ObjectReference ref=((ObjectVal... | Debug printing support: dump this stack frame and return roots. |
@Override public boolean equals(Object obj){
return obj instanceof PairComparator;
}
| Indicates whether some other object is "equal to" to this Comparator. This method must obey the general contract of <tt>Object.equals(Object)</tt>. Additionally, this method can return <tt>true</tt> <i>only</i> if the specified Object is also a comparator and it imposes the same ordering as this comparator.... |
@ApiOperation(value="Sync triggers on the specified engine") @RequestMapping(value="engine/{engine}/synctriggers",method=RequestMethod.POST) @ResponseStatus(HttpStatus.NO_CONTENT) @ResponseBody public final void postSyncTriggersByEngine(@PathVariable("engine") String engineName,@RequestParam(required=false,value="force... | Creates instances of triggers for each entry configured table/trigger for the specified engine on the node |
private void readZipFile(String classPath,DependenciesListener builder,ProgressListener progress) throws IOException {
ClassFileReader reader=new ClassFileReader(analysisStats);
ZipFile zipFile=new ZipFile(classPath);
JarFileLister jarReader=new JarFileLister(zipFile,builder,reader,progress);
jarReader.start();... | Build Java dependencies from a Jar file. |
private int measureHeight(int measureSpec){
float result;
int specMode=MeasureSpec.getMode(measureSpec);
int specSize=MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
result=specSize;
}
else {
result=mPaintSelected.getStrokeWidth() + getPaddingTop() + getPaddingBottom();
i... | Determines the height of this view |
public OrganizationParser(String organization){
super(organization);
}
| Creates a new instance of OrganizationParser |
private void reportValues(){
double prob=(1.0 * delivered) / created;
write(format(getSimTime()) + " " + created+ " "+ delivered+ " "+ format(prob));
}
| Writes the current values to report file |
public boolean markSupported(){
return false;
}
| Tests if this input stream supports the <code>mark</code> and <code>reset</code> methods. The <code>markSupported</code> method of <code>InflaterInputStream</code> returns <code>false</code>. |
public DividerItemDecoration withOffset(boolean withOffset){
this.withOffset=withOffset;
return this;
}
| Applies the physical offset between items, of the same size of the divider previously set. |
public BridgeContext(UserAgent userAgent,DocumentLoader loader){
this(userAgent,sharedPool,loader);
}
| Constructs a new bridge context. |
private void onFinishedMovement(){
if (mSuppressSelectionChanged) {
mSuppressSelectionChanged=false;
super.selectionChanged();
}
checkSelectionChanged();
invalidate();
}
| Called when rotation is finished |
@Override public <A extends Annotation>ExpressionResult checkPermission(Class<A> annotationClass,PersistentResource resource,ChangeSpec changeSpec){
if (requestScope.getSecurityMode() == SecurityMode.SECURITY_INACTIVE) {
return ExpressionResult.PASS;
}
Expressions expressions;
if (SharePermission.class == a... | Check permission on class. |
public boolean hasIncomingBatchInstances(){
if (m_listenees.size() == 0) {
return false;
}
if (m_listenees.containsKey("trainingSet") || m_listenees.containsKey("testSet") || m_listenees.containsKey("dataSet")) {
return true;
}
return false;
}
| Returns true if this clusterer has an incoming connection that is a batch set of instances |
public void addComponentListener(String formName,String componentName,Object listener){
if (localComponentListeners == null) {
localComponentListeners=new Hashtable();
Hashtable formListeners=new Hashtable();
formListeners.put(componentName,listener);
localComponentListeners.put(formName,formListeners... | Adds a component listener that would be bound when a UI for this form is created. Notice that this method is only effective before the form was created and would do nothing for an existing form |
protected void dumpWaitingThreads(){
VM.sysWrite(" waiting: ");
waiting.dump();
}
| Dump threads waiting to be notified on this lock |
public MPPOrderWorkflow(Properties ctx,int PP_Order_Workflow_ID,String trxName){
super(ctx,PP_Order_Workflow_ID,trxName);
if (PP_Order_Workflow_ID == 0) {
setAccessLevel(ACCESSLEVEL_Organization);
setAuthor(MClient.get(ctx).getName());
setDurationUnit(DURATIONUNIT_Day);
setDuration(1);
setEntity... | Create/Load Workflow |
protected Reader createReader(InputStream in) throws IOException {
return new BufferedReader(new InputStreamReader(in));
}
| Factory method to create a Reader from the given InputStream. |
private FilePreferencesImpl(AbstractPreferences parent,String name){
super(parent,name);
path=((FilePreferencesImpl)parent).path + File.separator + name;
initPrefs();
}
| Construct a prefs using given parent and given name |
public void updateSizes(@ProgressDrawableSize int size){
if (size == LARGE) {
setSizeParameters(CIRCLE_DIAMETER_LARGE,CIRCLE_DIAMETER_LARGE,CENTER_RADIUS_LARGE,STROKE_WIDTH_LARGE,ARROW_WIDTH_LARGE,ARROW_HEIGHT_LARGE);
}
else {
setSizeParameters(CIRCLE_DIAMETER,CIRCLE_DIAMETER,CENTER_RADIUS,STROKE_WIDTH,ARR... | Set the overall size for the progress spinner. This updates the radius and stroke width of the ring. |
public R addParams(String key,File file,String contentType){
addParams(key,file,contentType,null);
return (R)this;
}
| add file params. |
public static String javaEncoding(String encoding){
return (String)ENCODINGS.get(encoding.toUpperCase());
}
| Returns the Java encoding string mapped with the given standard encoding string. |
void trace(){
glUseProgram(computeProgram);
glUniform3f(eyeUniform,cameraPosition.x,cameraPosition.y,cameraPosition.z);
invViewProjMatrix.transformProject(tmpVector.set(-1,-1,0)).sub(cameraPosition).normalize();
glUniform3f(ray00Uniform,tmpVector.x,tmpVector.y,tmpVector.z);
invViewProjMatrix.transformProject(... | Compute one frame by tracing the scene using our compute shader. |
protected ShoppingCartItem(Delegator delegator,String itemTypeId,String description,String categoryId,BigDecimal basePrice,Map<String,Object> attributes,String prodCatalogId,Locale locale,ShoppingCart.ShoppingCartItemGroup itemGroup){
this.delegator=delegator;
this.itemType=itemTypeId;
this.itemGroup=itemGroup;
... | Creates new ShopingCartItem object. |
private String removeStatusChar(String nick){
if (nick.startsWith("@") || nick.startsWith("+") || nick.startsWith("%")) {
nick=nick.substring(1);
}
return nick;
}
| Remove the status char off the front of a nick if one is present |
public static Classifier makeCopy(Classifier model) throws Exception {
return (Classifier)new SerializedObject(model).getObject();
}
| Creates a deep copy of the given classifier using serialization. |
void startRename(){
int row=TABLE.getSelectedRow();
if (row == -1) return;
}
| Programatically starts a rename of the selected item. |
public static String toString(Resource file,Charset charset) throws IOException {
Reader r=null;
try {
r=getReader(file,charset);
String str=toString(r);
return str;
}
finally {
closeEL(r);
}
}
| reads String data from File |
protected String sortPartition(TrackingDirectoryWrapper trackingDir) throws IOException {
try (IndexOutput tempFile=trackingDir.createTempOutput(tempFileNamePrefix,"sort",IOContext.DEFAULT);ByteSequencesWriter out=getWriter(tempFile)){
BytesRef spare;
long start=System.currentTimeMillis();
BytesRefIterato... | Sort a single partition in-memory. |
public static String createFaultXml(QName faultCode,String faultString,String faultActor,String detail) throws IOException {
try {
final SOAPMessage msg=SoapUtils.MESSAGE_FACTORY.createMessage();
final SOAPFault soapFault=msg.getSOAPBody().addFault();
soapFault.setFaultCode(faultCode);
if (faultActor ... | Creates a SOAP fault message. |
boolean ClosedStart(Token t){
return t.kind == IDENTIFIER || (t.kind >= op_57 && t.kind <= op_119) || t.kind == NUMBER_LITERAL || t.kind == LBR || t.kind == LSB || t.kind == LAB || t.kind == LBC || t.kind == LWB || t.kind == STRING_LITERAL || t.kind == WF || t.kind == SF;
}
| Note: the non-terminal ClosedStart was commented out, apparently to be replaced by this boolean-valued method. |
final public MutableString append(boolean b){
return append(String.valueOf(b));
}
| Appends a boolean to this mutable string. |
public static Map<?,?> convertBeanToMap(Object source){
return null;
}
| Convert bean to map |
private static void ExceptionDescribe(JNIEnvironment env){
if (traceJNI) VM.sysWrite("JNI called: ExceptionDescribe \n");
RuntimeEntrypoints.checkJNICountDownToGC();
try {
Throwable e=env.getException();
if (e != null) {
env.recordException(null);
e.printStackTrace(System.err);
}
}
c... | ExceptionDescribe: print the exception description and the stack trace back, then clear the exception |
@Override public BufferedImage applyEffect(BufferedImage src,BufferedImage dst,int w,int h){
if (src == null || (src.getType() != BufferedImage.TYPE_INT_ARGB && src.getType() != BufferedImage.TYPE_INT_ARGB_PRE)) {
throw new IllegalArgumentException("Effect only works with source images of type BufferedImage.TYPE_... | Apply the effect to the src image generating the result . The result image may or may not contain the source image depending on what the effect type is. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.