code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static <T>T max(T[] self,@ClosureParams(value=FromString.class,options={"T","T,T"}) Closure closure){
return max((Iterable<T>)toList(self),closure);
}
| Selects the maximum value found from the Object array using the closure to determine the correct ordering. <p> If the closure has two parameters it is used like a traditional Comparator. I.e. it should compare its two parameters for order, returning a negative integer, zero, or a positive integer when the first paramet... |
public static void main(String[] args) throws Exception {
parseArguments(args);
String[] configs=new File(directory).list();
for ( String benchmarkdir : configs) {
String dir=directory + "/" + benchmarkdir;
File configsDir=new File(dir + "/config/");
String trainDirName=dir + "/train/";
File trai... | Run a benchmark test against each subdirectory within the benchmark directory. |
public void breadthFirstTraversal(){
if (root == null) return;
java.util.Queue<TreeNode<E>> queue=new java.util.LinkedList<>();
queue.add(root);
while (!queue.isEmpty()) {
TreeNode<E> current=queue.element();
if (current.left != null) {
queue.add(current.left);
}
if (current.right != nul... | Displays the nodes in a breadth-first traversal |
@Override public int previous(){
CharacterIterator text=getText();
if (current() == text.getBeginIndex()) {
return BreakIterator.DONE;
}
int start=current();
int lastResult=cachedLastKnownBreak;
if (lastResult >= start || lastResult <= BreakIterator.DONE) {
getPrevious();
lastResult=handlePrevio... | Advances the iterator backwards, to the last boundary preceding this one. |
public void testZeroPos(){
byte aBytes[]={0};
byte bBytes[]={-2,-3,-4,-4,5,14,23,39,48,57,66,5,14,23};
int aSign=0;
int bSign=1;
byte rBytes[]={0};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger bNumber=new BigInteger(bSign,bBytes);
BigInteger result=aNumber.and(bNumber);
byte resBytes[]=... | And for zero and a positive number |
public SQLClientInfoException(String reason,String SQLState,Map<String,ClientInfoStatus> failedProperties,Throwable cause){
super(reason,SQLState);
initCause(cause);
this.failedProperties=failedProperties;
}
| Constructs a <code>SQLClientInfoException</code> object initialized with a given <code>reason</code>, <code>SQLState</code>, <code>cause</code> and <code>failedProperties</code>. The vendor code is initialized to 0. <p> |
@Override public final boolean enabled(){
return bookFile.canRead();
}
| Return true if the external book is available. |
public static String quoteIdentifier(String s){
int length=s.length();
StringBuilder buff=new StringBuilder(length + 2);
buff.append('\"');
for (int i=0; i < length; i++) {
char c=s.charAt(i);
if (c == '"') {
buff.append(c);
}
buff.append(c);
}
return buff.append('\"').toString();
}
| Enclose a string with double quotes. A double quote inside the string is escaped using a double quote. |
private Expression compileExpression(ClassLoader parent) throws ParseException {
final Map<String,Integer> externalsMap=new LinkedHashMap<>();
final ClassWriter classWriter=new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
generateClass(getAntlrParseTree(),classWriter,externalsMap);
try {
... | Compiles the given expression with the specified parent classloader |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public JavaScriptException(Object value,String sourceName,int lineNumber){
recordErrorOrigin(sourceName,lineNumber,null,0);
this.value=value;
if (value instanceof NativeError && Context.getContext().hasFeature(Context.FEATURE_LOCATION_INFORMATION_IN_ERROR)) {
NativeError error=(NativeError)value;
if (!err... | Create a JavaScript exception wrapping the given JavaScript value |
private void updateBusinessObjectDefinitionEntityDescriptiveInformation(BusinessObjectDefinitionEntity businessObjectDefinitionEntity,BusinessObjectDefinitionDescriptiveInformationUpdateRequest request){
businessObjectDefinitionEntity.setDescription(request.getDescription());
businessObjectDefinitionEntity.setDispl... | Update and persist the business object definition descriptive information per specified update request. |
public static String toVariableName(Object o) throws PageException {
String str=toString(o);
if (!Decision.isVariableName(str)) throw new ExpressionException("can't cast [" + str + "] to variable name value");
return str;
}
| cast a Object to a Variable Name |
private void checkValid(String authority) throws Exception {
FileSystem fs=fileSystem(authority,tcp);
assert fs.exists(new Path(PATH.toString()));
}
| Check valid file system endpoint. |
protected void startAdditionalServices(final Cache cache,final Map<String,Object> options) throws Exception {
}
| This method is called immediately following cache creation in the spawned process, but prior to setting the RUNNING flag in the status file. So the spawning process will block until this method completes. |
public static String toHexString(byte[] array){
if (array == null) {
return null;
}
if (array.length == 0) {
return "[]";
}
StringBuilder sb=new StringBuilder();
sb.append('[');
sb.append(String.format("%02x",array[0] & 0xff));
for (int i=1; i < array.length; i++) {
sb.append(", ");
sb.a... | Returns a string representation of a byte array that's more useful for debugging. TODO: move this somewhere where it's available to all tests. |
public static MethodAnnotation fromForeignMethod(@SlashedClassName String className,String methodName,String methodSig,int accessFlags){
className=ClassName.toDottedClassName(className);
MethodAnnotation methodAnnotation=new MethodAnnotation(className,methodName,methodSig,(accessFlags & Constants.ACC_STATIC) != 0);... | Factory method to create the MethodAnnotation from the classname, method name, signature, etc. The method tries to look up source line information for the method. |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public static void registerPeripheralProvider(IPeripheralProvider handler){
findCC();
if (computerCraft_registerPeripheralProvider != null) {
try {
computerCraft_registerPeripheralProvider.invoke(null,handler);
}
catch ( Exception e) {
}
}
}
| Registers a peripheral handler to convert blocks into IPeripheral implementations. |
public boolean isUseBias(){
return useBias;
}
| Returns whether or not an implicit bias term is in use |
public void historicalDataComplete(Tradestrategy tradestrategy){
}
| Method historicalDataComplete. |
private static double min(double d1,double d2){
if (Double.isNaN(d1)) {
return d2;
}
if (Double.isNaN(d2)) {
return d1;
}
return Math.min(d1,d2);
}
| Returns the minimum value. If either value is NaN, the other value is returned. If both are NaN, NaN is returned. |
public GlobeAnnotation(String text,Position position,Font font,Color textColor){
this.init(text,position,font,textColor);
}
| Creates a <code>GlobeAnnotation</code> with the given text, at the given globe <code>Position</code>. Specify the <code>Font</code> and text <code>Color</code> to be used. |
@RequestMapping(value="/{cubeName}/segs/{segmentName}",method={RequestMethod.DELETE}) @ResponseBody public CubeInstance deleteSegment(@PathVariable String cubeName,@PathVariable String segmentName){
CubeInstance cube=cubeService.getCubeManager().getCube(cubeName);
if (cube == null) {
throw new InternalErrorExce... | Delete a cube segment |
private void expandAffixes(){
StringBuffer buffer=new StringBuffer();
if (posPrefixPattern != null) {
positivePrefix=expandAffix(posPrefixPattern,buffer);
positivePrefixFieldPositions=null;
}
if (posSuffixPattern != null) {
positiveSuffix=expandAffix(posSuffixPattern,buffer);
positiveSuffixField... | Expand the affix pattern strings into the expanded affix strings. If any affix pattern string is null, do not expand it. This method should be called any time the symbols or the affix patterns change in order to keep the expanded affix strings up to date. |
private final void rehash(){
long min=this.count, max=0;
int[][] oldTable=this.table;
int oldCapacity=oldTable.length;
int[][] newTable=new int[oldCapacity * 2][];
final int onebitmask=oldCapacity;
for (int i=0; i < oldCapacity; i++) {
int[] list=oldTable[i];
if (list != null) {
int cnt0=0;
... | Rehashes the contents of the hashtable into a hashtable with a larger capacity. This method is called automatically when the number of items in the hashtable exceeds this hashtable's capacity and load factor. |
@Override public void takeMultipleColumnFamilySnapshot(String tag,String... columnFamilyList) throws IOException {
Map<Keyspace,List<String>> keyspaceColumnfamily=new HashMap<Keyspace,List<String>>();
for ( String columnFamily : columnFamilyList) {
String splittedString[]=columnFamily.split("\\.");
if (spl... | Takes the snapshot of a multiple column family from different keyspaces. A snapshot name must be specified. |
protected void onProgressUpdate(String... progress){
pDialog.setProgress(Integer.parseInt(progress[0]));
}
| Updating progress bar |
public int optInt(String key){
return this.optInt(key,0);
}
| Get an optional int value associated with a key, or zero if there is no such key or if the value is not a number. If the value is a string, an attempt will be made to evaluate it as a number. |
public void addItem(final String title,final String image){
checkWidget();
this.items.add(new LauncherItem(title,image));
this.needRedraw=true;
}
| Add an item to the launcher |
public SimpleBooleanProperty showProperty(){
return this.show;
}
| 'Show' flag. |
public void onAnimationRepeat(Animator animation){
}
| Ignore repeat events for now |
@Override public void start(Map<String,String> props){
if (cacheName != null) return;
cacheName=props.get(IgniteSinkConstants.CACHE_NAME);
igniteConfigFile=props.get(IgniteSinkConstants.CACHE_CFG_PATH);
if (props.containsKey(IgniteSinkConstants.CACHE_ALLOW_OVERWRITE)) StreamerContext.getStreamer().allowOver... | Initializes grid client from configPath. |
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 int hashCode(){
return getNameForComparisons().hashCode();
}
| Return the hashcode of the name, because it is fairly unique. |
private void logEventToCSV(String[] row){
try {
Log.i(TAG,row.toString());
String BENCHMARK_FILENAME="benchmarks.csv";
FileWriter file=new FileWriter(new File(getBenchmarkDataDir(),BENCHMARK_FILENAME));
CSVWriter writer=new CSVWriter(file,',','\'');
writer.writeNext(row);
file.close();
wri... | Logs events to a CSV file on external storage. TODO(lerner): Log to file instead of just to console! |
public ViewExpiredException(String viewId){
this.viewId=viewId;
}
| <p>Construct a new exception with the specified view identifier.</p> |
@Override public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
instence=this;
setContentView(R.layout.main);
initViews();
}
| Called when the activity is first created. |
public static void d(String tag,String msg,Throwable throwable){
if (sLevel > LEVEL_DEBUG) {
return;
}
Log.d(tag,msg,throwable);
}
| Send a DEBUG log message |
public AddSharedLibraryToDeployableScriptCommand(Configuration configuration,String resourcePath,Deployable deployable,String sharedLibraryPath){
super(configuration,resourcePath);
this.deployable=deployable;
this.sharedLibraryPath=sharedLibraryPath;
}
| Sets configuration containing all needed information for building configuration scripts. |
public NSSet(){
set=new LinkedHashSet<NSObject>();
}
| Creates an empty unordered set. |
public ContainerUndoState(IContainer container){
super(container);
this.name=container.getName();
if (container.isLinked()) {
this.location=container.getLocationURI();
}
try {
if (container.isAccessible()) {
defaultCharSet=container.getDefaultCharset(false);
IResource[] resourceMembers=con... | Create a ContainerState from the specified container handle. Typically used when the container handle represents a resource that actually exists, although it will not fail if the resource is non-existent. |
protected Link determineOrderPageLink(final CustomerOrder order,final String linkId){
final PageParameters viewOrder=new PageParameters();
viewOrder.set("order",order.getCartGuid());
return new BookmarkablePageLink(linkId,OrderPage.class,viewOrder);
}
| Extension hook. |
void findConnections(WBEMClient client,String namespace){
CloseableIterator<CIMInstance> instances=null;
try {
connections.clear();
instances=client.associatorInstances(cimPath,null,"CISCO_ProtocolEndpoint",null,null,false,null);
while (instances.hasNext()) {
CIMInstance instance=instances.next();... | Find connections to this endpoint. Put them in the connections map. |
public IgniteConsistencyException(String msg,@Nullable Throwable cause){
super(msg,cause);
}
| Creates new exception with given error message and optional nested exception. |
public String formatDateTimeMedium(Date d){
return d.toString();
}
| Formats a date and a time in a default form e.g. 1/1/2011 10:00AM |
public void subscribeToAsyncResellerService() throws Exception {
VendorData supplierData=setupNewSupplier("2013-01-01 08:00:00");
setDateFactory("2013-01-02 20:00:00");
VOServiceDetails supplService=createPublishActivateAsyncService(supplierData,TestPriceModel.EXAMPLE_RATA_WEEK_ROLES,"supplSrvForReseller");
Ven... | Subscribe to an Async Reseller Service. |
private boolean columnFamilyExists(final String columnFamily) throws IOException {
return this.table.getTableDescriptor().hasFamily(Bytes.toBytes(columnFamily));
}
| Checks to see if table contains the given column family |
public static TestSuite suite() throws Exception {
Class testClass=ClassLoader.getSystemClassLoader().loadClass("org.w3c.domts.level3.xpath.alltests");
Constructor testConstructor=testClass.getConstructor(new Class[]{DOMTestDocumentBuilderFactory.class});
DOMTestDocumentBuilderFactory factory=new LSDocumentBuilde... | Create instance of test suite. |
public boolean isRecordAccess(int AD_Table_ID,int Record_ID,boolean ro){
loadRecordAccess(false);
boolean negativeList=true;
for (int i=0; i < m_recordAccess.length; i++) {
MRecordAccess ra=m_recordAccess[i];
if (ra.getAD_Table_ID() != AD_Table_ID) continue;
if (ra.isExclude()) {
if (ra.getR... | Access to Record (no check of table) |
private void writeQNameAttribute(java.lang.String namespace,java.lang.String attName,javax.xml.namespace.QName qname,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException {
java.lang.String attributeNamespace=qname.getNamespaceURI();
java.lang.String attributePrefix=xmlWriter.getPre... | Util method to write an attribute without the ns prefix |
public TreeParameterModel(TreeModel tree,Parameter parameter,boolean includeRoot){
this(tree,parameter,includeRoot,Intent.NODE);
}
| This class constructs a tree parameter, and will set the dimension of the parameter to match the appropriate number of nodes if necessary. |
@Override public long write(ByteBuffer[] srcs,int offset,int length) throws IOException {
throw new NonWritableChannelException();
}
| Unsupported method. This channel can only be read only. |
public void enableShadow(boolean enabled){
getShadowMap().setEnabled(enabled);
shadowEffects.shadowEnabled=enabled;
}
| Make the shadows visible |
public SparseArrayCompat(){
this(10);
}
| Creates a new SparseArray containing no mappings. |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:55:46.078 -0500",hash_original_method="9F68B71E39A8D368C1910EB63F18B506",hash_generated_method="EC23550E2D5DC2CBAD5A8C6F680A40F1") public SIPHeader parse() throws ParseException {
UnsupportedList unsupportedList=new UnsupportedList()... | parse the String message |
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:00:09.115 -0500",hash_original_method="E2914311E18C41738022F5D7A73FEC8A",hash_generated_method="6F752AA4232CE3D0BF9CC57A1B3B6A57") private void readElementDeclaration() throws I... | Read an element declaration. This contains a name and a content spec. <!ELEMENT foo EMPTY > <!ELEMENT foo (bar?,(baz|quux)) > <!ELEMENT foo (#PCDATA|bar)* > |
public NotificationChain basicSetBogusTypeRef(TypeRef newBogusTypeRef,NotificationChain msgs){
TypeRef oldBogusTypeRef=bogusTypeRef;
bogusTypeRef=newBogusTypeRef;
if (eNotificationRequired()) {
ENotificationImpl notification=new ENotificationImpl(this,Notification.SET,N4JSPackage.VARIABLE_DECLARATION__BOGUS_T... | <!-- begin-user-doc --> <!-- end-user-doc --> |
public static Permutation newPermutation(int length){
return new Permutation(length);
}
| Returns a new permutation with the specified number of items. |
public static Map<String,Object> updateCreditCard(DispatchContext ctx,Map<String,Object> context){
Map<String,Object> result=FastMap.newInstance();
Delegator delegator=ctx.getDelegator();
Security security=ctx.getSecurity();
GenericValue userLogin=(GenericValue)context.get("userLogin");
Locale locale=(Locale)... | Updates CreditCard and PaymentMethod entities according to the parameters passed in the context <b>security check</b>: userLogin partyId must equal partyId, or must have PAY_INFO_UPDATE permission |
public Property createProperty(){
PropertyImpl property=new PropertyImpl();
return property;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
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. |
public JSONObject merge(JSONObject object){
if (object == null) {
throw new NullPointerException("object is null");
}
for ( Member member : object) {
this.set(member.name,member.value);
}
return this;
}
| Copies all members of the specified object into this object. When the specified object contains members with names that also exist in this object, the existing values in this object will be replaced by the corresponding values in the specified object. |
public static void write(float lt,float ln,int radius,LinkProperties properties,DataOutputStream dos) throws IOException {
dos.write(Link.POINT_HEADER.getBytes());
dos.writeByte(GRAPHICTYPE_POINT);
dos.writeByte(RENDERTYPE_LATLON);
dos.writeFloat(lt);
dos.writeFloat(ln);
dos.writeInt(radius);
properties.w... | Create a lat/lon point. |
public void accept(final MethodVisitor mv){
mv.visitParameter(name,access);
}
| Makes the given visitor visit this parameter declaration. |
public static BigDecimal safeAdd(BigDecimal left,BigDecimal right){
return right != null ? left.add(right) : left;
}
| A null-aware method for adding BigDecimal, but only for the right operand. |
public void insert(int index,double v){
_insert(index,numberNode(v));
}
| Method for setting value of a field to specified numeric value. |
private void updateRange(double value){
mMinValue=Math.min(mMinValue,value);
mMaxValue=Math.max(mMaxValue,value);
}
| Updates the values range. |
public void removeLayer(int index){
List<Layer> currentLayers=getLayerList();
try {
currentLayers.remove(index);
setLayerList(currentLayers);
}
catch ( IndexOutOfBoundsException ioobe) {
}
}
| Remove a layer from the list of potentials. |
@Override public void run(){
amIActive=true;
String inputHeader=null;
String outputHeader=null;
int row, col, x, y;
int progress=0;
int oldProgress;
double slope;
double z, z2;
int i;
int[] dX=new int[]{1,1,1,0,-1,-1,-1,0};
int[] dY=new int[]{-1,0,1,1,1,0,-1,-1};
double[] inflowingVals=new doubl... | Used to execute this plugin tool. |
public void clear(){
orders.clear();
}
| Clear all data. |
public static Coords scatterDirectArty(Coords coords,int moF){
return Compute.scatter(coords,moF);
}
| scatter from hex according to direct fire artillery rules (based on MoF) |
public void output(PrintWriter out){
if (doctype != null) {
doctype.output(out);
try {
out.write('\n');
}
catch ( Exception e) {
}
}
html.output(out);
}
| Write the container to the PrinteWriter |
private void initMergeTarget(){
final File mergeInfoHolder=myMerger.getMergeInfoHolder();
if (mergeInfoHolder != null) {
final Status svnStatus=SvnUtil.getStatus(myVcs,mergeInfoHolder);
if (svnStatus != null && svnStatus.isProperty(StatusType.STATUS_MODIFIED)) {
myMergeTarget=VcsUtil.getFilePath(merge... | folder that is going to keep merge info record should also be changed |
public static VOPricedRole toVOPricedProductRole(PricedProductRole role,LocalizerFacade facade){
VOPricedRole voRole=new VOPricedRole();
updateValueObject(voRole,role);
voRole.setPricePerUser(role.getPricePerUser());
voRole.setRole(RoleAssembler.toVORoleDefinition(role.getRoleDefinition(),facade));
return voR... | Converts a priced product role domain object into the corresponding value object representation. |
public static org.oscm.internal.vo.VOServiceListResult convertToUp(org.oscm.vo.VOServiceListResult oldVO){
if (oldVO == null) {
return null;
}
org.oscm.internal.vo.VOServiceListResult newVO=new org.oscm.internal.vo.VOServiceListResult();
newVO.setResultSize(oldVO.getResultSize());
for ( org.oscm.vo.VOSer... | Convert source version VO to target version VO. |
@Override public String toString(){
return "MLC localhost Socket Factory";
}
| Overridden to provide a better name for the RMI RenewClean thread. |
public String pullRequestHtmlUrl(String account,String collection,String projectName,String repositoryName,String pullRequestId){
Objects.requireNonNull(projectName,"Project name required");
Objects.requireNonNull(repositoryName,"Repository name required");
Objects.requireNonNull(pullRequestId,"Pull request id re... | Returns pull request html url. |
public LayerControlButtonPanel createControlButtons(){
return new LayerControlButtonPanel(this);
}
| Set up the buttons used to move layers up and down, or add/remove layers. The button component should hook itself up to the LayersPanel, and assume that the LayersPanel has a BorderLayout with the list in the center spot. |
private Request callWithClassLoader(Callable<Request> callable) throws MatlabConnectionException {
Thread currentThread=Thread.currentThread();
ClassLoader originalClassLoader=null;
try {
originalClassLoader=currentThread.getContextClassLoader();
currentThread.setContextClassLoader(RemoteMatlabProxyFactor... | Calls the given callable while temporarily using our classloader. |
public double distanceToSquared(Vec2 vector){
if (vector == null) {
throw new IllegalArgumentException(Logger.logMessage(Logger.ERROR,"Vec2","distanceToSquared","missingVector"));
}
double dx=this.x - vector.x;
double dy=this.y - vector.y;
return dx * dx + dy * dy;
}
| Computes the squared distance from this vector to a specified vector. This is equivalent to squaring the result of <code>distanceTo</code> but is potentially much more efficient. |
@PUT @Consumes({Servlets.JSON_MEDIA_TYPE,MediaType.APPLICATION_JSON}) @Produces(Servlets.JSON_MEDIA_TYPE) public Response updateEntities(@Context HttpServletRequest request){
String entityJson=null;
AtlasPerfTracer perf=null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf=AtlasPerfTracer... | Complete update of a set of entities - the values not specified will be replaced with null/removed Adds/Updates given entities identified by its GUID or unique attribute |
public static DbException convertInvocation(InvocationTargetException te,String message){
Throwable t=te.getTargetException();
if (t instanceof SQLException || t instanceof DbException || t instanceof InvocationTargetException) {
return convert(t);
}
message=message == null ? t.getMessage() : message + ": "... | Convert an InvocationTarget exception to a database exception. |
protected N4MemberDeclarationImpl(){
super();
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public static boolean isExtension(String filename,Collection<String> extensions){
if (filename == null) {
return false;
}
if (extensions == null || extensions.isEmpty()) {
return indexOfExtension(filename) == -1;
}
String fileExt=getExtension(filename);
for ( String extension : extensions) {
if... | Checks whether the extension of the filename is one of those specified. <p> This method obtains the extension as the textual part of the filename after the last dot. There must be no directory separator after the dot. The extension check is case-sensitive on all platforms. |
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. |
public Pin(int datasetIndex){
super(datasetIndex);
this.paint=Color.red;
this.stroke=new BasicStroke(3.0f,BasicStroke.CAP_ROUND,BasicStroke.JOIN_BEVEL);
}
| Creates a new instance. |
public void addCloseClientListener(CloseClientListener l){
closeClientListeners.addElement(l);
}
| Adds the specified close client listener to receive close client events. This is used by external programs running megamek |
@Override public void handleResponse(final HttpProxyResponse response) throws ProxyAuthException {
if (!isHandshakeComplete() && ("close".equalsIgnoreCase(StringUtilities.getSingleValuedHeader(response.getHeaders(),"Proxy-Connection")) || "close".equalsIgnoreCase(StringUtilities.getSingleValuedHeader(response.getHead... | Handle a HTTP response from the proxy server. |
public static <W>void writeLmBinary(final NgramLanguageModel<W> lm,final String file){
IOUtils.writeObjFileHard(file,lm);
}
| Writes a binary file representing the LM using the built-in serialization. These binaries should load much faster than ARPA files. |
public int[][] toIntArray2(){
int[][] array=new int[rows][columns];
for (int r=0; r < rows; r++) {
for (int c=0; c < columns; c++) {
array[r][c]=(int)Math.rint(get(r,c));
}
}
return array;
}
| Convert the matrix to a two-dimensional array of integers. |
public static final byte composeStoreAndForwardMode(byte esmClass){
return composeMessagingMode(esmClass,SMPPConstant.ESMCLS_STORE_FORWARD);
}
| Messaging Mode. |
public boolean hasNotifications(){
return CENTER.hasEntries();
}
| Whether any notifications exist. |
public static boolean isXML11NameFirstCharacter(char c){
return (NAME11_FIRST_CHARACTER[c / 32] & (1 << (c % 32))) != 0;
}
| Tests whether the given character is usable as the first character of an XML 1.1 name. |
private static void addEncodedParameter(StringBuilder sb,String name,String value) throws IOException {
if (sb.length() > 0) {
sb.append("&");
}
sb.append(URLEncoder.encode(name,"UTF-8"));
sb.append("=");
if (value == null) throw new IOException("ERROR: " + name + " is null");
else sb.append(URLEncod... | Dynamically adds a url-form-encoded key/value to a StringBuilder |
public static SymbolToken[] newSymbolTokens(SymbolTable symtab,String... text){
if (text != null) {
int count=text.length;
if (count != 0) {
SymbolToken[] result=new SymbolToken[count];
for (int i=0; i < count; i++) {
String s=text[i];
result[i]=newSymbolToken(symtab,s);
}
... | Validates each text element. |
@Override public final int computeHashCode(long val){
return HashFunctions.hash(val);
}
| Default implementation of TLongHashingStrategy: delegates hashing to HashFunctions.hash(long). |
public FrameworkException(String message,Throwable cause){
super(message,cause);
}
| Constructs a new framework exception with the specified message and cause. |
public T[] values(){
return mValues.clone();
}
| Like an enum's values() method. |
public GenericElement(){
}
| Base class for defining all elements. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.