code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public static void storeLocation(Context context,LatLng location){
SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor=prefs.edit();
editor.putLong(PREFERENCES_LAT,Double.doubleToRawLongBits(location.latitude));
editor.putLong(PREFERENCES_LNG,Double.do... | Store the location in the app preferences. |
@Override public synchronized boolean put(final Entry row) throws IOException, SpaceExceededException {
Index index=getIndex();
if (index == null) return false;
try {
boolean b=index.put(row);
if (this.sizecache >= 0 && b) this.sizecache++;
return b;
}
catch ( IOException e) {
throw e;
... | Adds the row to the index. The row is identified by the primary key of the row. |
public Matrix arrayRightDivide(Matrix B){
checkMatrixDimensions(B);
Matrix X=new Matrix(m,n);
double[][] C=X.getArray();
for (int i=0; i < m; i++) {
for (int j=0; j < n; j++) {
C[i][j]=A[i][j] / B.A[i][j];
}
}
return X;
}
| Element-by-element right division, C = A./B |
@Override public void process(JCas jcas) throws AnalysisEngineProcessException {
CAS cas=jcas.getCas();
modelProvider.configure(cas);
mappingProvider.configure(cas);
DependencyParser dp=modelProvider.getResource();
if (!exists(jcas,Sentence.class) || !exists(jcas,Token.class)) {
return;
}
try {
St... | Processes the given text using the MSTParser. As the MSTParser expects an input file, a temporary file is created. |
public void write(BufferedWriter writer) throws Exception {
Enumeration<String> enm;
writer.write("# generated " + new Date());
writer.newLine();
enm=elements();
while (enm.hasMoreElements()) {
writer.write(enm.nextElement().toString());
writer.newLine();
}
writer.flush();
writer.close();
}
| Writes the current stopwords to the given writer. The writer is closed automatically. |
public void saveCurrentProject(){
saveProject(currentProject);
}
| Saves the active project |
public void remove(T object){
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.remove(object);
}
else {
mObjects.remove(object);
}
}
if (mNotifyOnChange) notifyDataSetChanged();
}
| Removes the specified object from the array. |
private boolean isCapabilityRefreshRequired(long timestampOfLastResponse,RcsSettings rcsSettings){
long now=System.currentTimeMillis();
if (now < timestampOfLastResponse) {
return true;
}
return (now > (timestampOfLastResponse + rcsSettings.getCapabilityExpiryTimeout()));
}
| Check if refresh of capability is required |
public void asTimestamp(MutableDateTime t){
if (length != 17 && length != 21) throw new FIXValueFormatException("Not a timestamp");
int year=getDigits(4,offset + 0);
int monthOfYear=getDigits(2,offset + 4);
int dayOfMonth=getDigits(2,offset + 6);
int hourOfDay=getDigits(2,offset + 9);
int minuteOfHour=get... | Get the value as a timestamp. |
public void doGenerate(IProgressMonitor monitor) throws IOException {
if (!targetFolder.getLocation().toFile().exists()) {
targetFolder.getLocation().toFile().mkdirs();
}
monitor.subTask("Loading...");
com.github.lbroudoux.dsl.eip.gen.camel.main.GenerateJavaRoutes gen0=new com.github.lbroudoux.dsl.eip.gen.c... | Launches the generation. |
static int convertToPixels(float value,String unit,boolean isHor,float ref,ContainerWrapper parent,ComponentWrapper comp){
UnitValue uv=(isHor ? HOR_DEFS : VER_DEFS).get(unit);
return uv != null ? MathUtil.round(value * uv.getPixels(ref,parent,comp)) : UnitConverter.UNABLE;
}
| Understands ("r", "rel", "related") OR ("u", "unrel", "unrelated") OR ("i", "ind", "indent") OR ("p", "para", "paragraph"). |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:02:26.022 -0500",hash_original_method="FA1F5320A185260C8447F83652566D78",hash_generated_method="FA121AF2BD9F319D567304C1AD79CBE4") public static String readFileAsString(String path) throws IOException {
return readFileAsBytes(path).t... | Returns the contents of 'path' as a string. The contents are assumed to be UTF-8. |
public RpcAuditEvent(String sessionId,CurrentUser who,String what,long when,Multimap<String,?> params,String httpMethod,Object input,int status,Object result){
super(sessionId,who,what,when,params,httpMethod,input,status,result);
}
| Creates a new audit event with results |
public static _Fields findByThriftId(int fieldId){
switch (fieldId) {
case 1:
return TYPE;
case 2:
return DATA;
default :
return null;
}
}
| Find the _Fields constant that matches fieldId, or null if its not found. |
public static List<Map.Entry<List<String>,List<double[]>>> sort(Map<List<String>,List<Double>> mapForSort,Map<List<String>,List<double[]>> valueMap,List<SortOption> sortOptions,int topN){
processIndex(sortOptions);
List<Map.Entry<List<String>,List<double[]>>> result=new ArrayList<Map.Entry<List<String>,List<double[... | sort aggregated results with sort options |
public PcapByteOutputStream(ByteArrayOutputStream baos){
this.baos=baos;
list=new ArrayList<Byte>();
createGlobalHeader();
}
| Instantiates a new pcap byte output stream. |
private boolean matchesMobile4g(NetworkIdentity ident){
ensureSubtypeAvailable();
if (ident.mType == TYPE_WIMAX) {
return true;
}
else if (matchesMobile(ident)) {
switch (getNetworkClass(ident.mSubType)) {
case 3:
return true;
}
}
return false;
}
| Check if mobile network classified 4G with matching IMSI. |
public List<Object> syncAndReturnAll(){
List<Object> formatted=new ArrayList<Object>();
for ( Client client : clients) {
formatted.add(generateResponse(client.getOne()).get());
}
return formatted;
}
| Syncronize pipeline by reading all responses. This operation closes the pipeline. Whenever possible try to avoid using this version and use ShardedJedisPipeline.sync() as it won't go through all the responses and generate the right response type (usually it is a waste of time). |
public DExportCertificates(JFrame parent,String entryAlias,boolean chain){
super(parent,Dialog.ModalityType.DOCUMENT_MODAL);
this.entryAlias=entryAlias;
this.chain=chain;
initComponents();
}
| Creates a new DExportCertificate dialog. |
private void onStopTrackingTouch(){
mIsDragging=false;
}
| This is called when the user either releases his touch or the touch is canceled. |
public VariableModel(){
}
| Creates a new VariableModel. |
public SmoothPagedView(Context context,AttributeSet attrs,int defStyle){
super(context,attrs,defStyle);
mUsePagingTouchSlop=false;
mDeferScrollUpdate=mScrollMode != X_LARGE_MODE;
}
| Used to inflate the Workspace from XML. |
private boolean equalsFragments(ByteString other){
int thisOffset=0;
Iterator<LiteralByteString> thisIter=new PieceIterator(this);
LiteralByteString thisString=thisIter.next();
int thatOffset=0;
Iterator<LiteralByteString> thatIter=new PieceIterator(other);
LiteralByteString thatString=thatIter.next();
in... | Determines if this string is equal to another of the same length by iterating over the leaf nodes. On each step of the iteration, the overlapping segments of the leaves are compared. |
public TipOfTheDay addTip(final String tip){
this.tips.add(tip);
return this;
}
| Add a tip |
@MethodDesc(description="Confirm service liveness",usage="isAlive") public boolean isAlive(){
return true;
}
| Returns true so that clients can confirm connection liveness. |
public static Integer toRef(int i){
return Integer.valueOf(i);
}
| cast a int value to his (CFML) reference type Integer |
public static <K,V>Map<K,V> of(K k1,V v1,K k2,V v2,K k3,V v3,K k4,V v4,K k5,V v5,K k6,V v6,K k7,V v7,K k8,V v8){
return new ImmutableCollections.MapN<K,V>(k1,v1,k2,v2,k3,v3,k4,v4,k5,v5,k6,v6,k7,v7,k8,v8);
}
| Returns an immutable map containing eight mappings. See <a href="#immutable">Immutable Map Static Factory Methods</a> for details. |
private void collapseExpanded(final TreePath newPath){
if (!m_stayExpandedPaths.isEmpty()) {
TreePath root=newPath;
while (root.getPathCount() > 1) {
root=root.getParentPath();
}
final Enumeration<TreePath> expandedDescendants=m_tree.getExpandedDescendants(root);
final TreePath selectedPath=... | collapses expanded paths except if new path is a descendant |
public static boolean cs_lsolve(Scs L,float[] x){
int p, j, n, Lp[], Li[];
float Lx[];
if (!Scs_util.CS_CSC(L) || x == null) return (false);
n=L.n;
Lp=L.p;
Li=L.i;
Lx=L.x;
for (j=0; j < n; j++) {
x[j]/=Lx[Lp[j]];
for (p=Lp[j] + 1; p < Lp[j + 1]; p++) {
x[Li[p]]-=Lx[p] * x[j];
}
}
... | Solves a lower triangular system Lx=b where x and b are dense. x=b on input, solution on output. |
public static Coordinate[] linkIdList2Coordinates(Network network,List<Id<Link>> linkIdList){
List<Coordinate> coordList=new ArrayList<>();
for ( Id<Link> linkId : linkIdList) {
if (network.getLinks().containsKey(linkId)) {
coordList.add(MGC.coord2Coordinate(network.getLinks().get(linkId).getFromNode().g... | Converts a list of link ids to an array of coordinates for shp features |
public IdentityBuilder increment(int increment){
if (increment < 0 || increment % 2 == 0) {
throw new IllegalArgumentException(L.l("'{0}' is an invalid sequence increment",increment));
}
_sequenceIncrement=increment;
return this;
}
| Id generator used for session id generation. This id may not be strictly increasing because the sequence increment may cause wrap-around of the sequence bits. The wrap-around will not caused collisions because the increment is relatively prime to the sequence space, i.e. all the sequence bits will be used, just not in ... |
public static int binarySearchFromTo(int[] list,int key,int from,int to){
int midVal;
while (from <= to) {
int mid=(from + to) / 2;
midVal=list[mid];
if (midVal < key) from=mid + 1;
else if (midVal > key) to=mid - 1;
else return mid;
}
return -(from + 1);
}
| Searches the list for the specified value using the binary search algorithm. The list must <strong>must</strong> be sorted (as by the sort method) prior to making this call. If it is not sorted, the results are undefined: in particular, the call may enter an infinite loop. If the list contains multiple elements equa... |
private static List<String> fetchEngineConfigs(Draft2Job context,String language){
if (context == null) {
return null;
}
List<String> result=new ArrayList<>();
List<Draft2ExpressionEngineRequirement> requirements=context.getApp().getExpressionEngineRequirements();
if (requirements != null) {
for ( ... | Fetch engine configuration from requirements |
public void checkPermission(Object object,NamespacePermissionEnum[] permissions){
List<AccessDeniedException> accessDeniedExceptions=new ArrayList<>();
checkPermission(object,permissions,accessDeniedExceptions);
if (!accessDeniedExceptions.isEmpty()) {
throw getAccessDeniedException(accessDeniedExceptions);
... | Checks the current user's permissions against the given object which may represent a single or multiple namespaces. Allowed types are String or Collection of String. |
@RequestMapping(value="",method={RequestMethod.POST}) @ResponseBody public StreamingRequest saveStreamingConfig(@RequestBody StreamingRequest streamingRequest){
String project=streamingRequest.getProject();
TableDesc tableDesc=deserializeTableDesc(streamingRequest);
StreamingConfig streamingConfig=deserializeSche... | create Streaming Schema |
public static <T>T max(Iterator<T> self,Comparator<T> comparator){
return max((Iterable<T>)toList(self),comparator);
}
| Selects the maximum value found from the Iterator using the given comparator. |
private void showPopupUnchecked(int maxActivityCount){
if (mAdapter.getDataModel() == null) {
throw new IllegalStateException("No data model. Did you call #setDataModel?");
}
getViewTreeObserver().addOnGlobalLayoutListener(mOnGlobalLayoutListener);
final boolean defaultActivityButtonShown=mDefaultActivityBu... | Shows the popup no matter if it was already showing. |
public static int methodModifiers(){
return PUBLIC | PROTECTED | PRIVATE| ABSTRACT| STATIC| FINAL| SYNCHRONIZED| NATIVE| STRICT;
}
| Returns a mask of all the modifiers that may be applied to methods. |
static public Formatter intFormatter(){
return intFormatter;
}
| It returns a <tt>Formatter</tt> that formats an integer so that commas separate groups of three integral digits. |
protected static void postProcessFlood(IHex[] hexSet,int modifier){
int n;
IHex field;
ITerrainFactory f=Terrains.getTerrainFactory();
for (n=0; n < hexSet.length; n++) {
field=hexSet[n];
int elev=field.getLevel() - modifier;
if ((elev == 0) && !(field.containsTerrain(Terrains.WATER)) && !(field.con... | Flood negative hex levels Shoreline / salt marshes effect Works best with more elevation |
public void checkExcluded(GeneralName name) throws PKIXNameConstraintValidatorException {
switch (name.getTagNo()) {
case 1:
checkExcludedEmail(excludedSubtreesEmail,extractNameAsString(name));
break;
case 2:
checkExcludedDNS(excludedSubtreesDNS,DERIA5String.getInstance(name.getName()).getString());
break;
case 4... | Check if the given GeneralName is contained in the excluded set. |
public PresentationData(){
}
| Creates an instance with no parameters specified. |
@Restrictions({@Restrict({"SYSTEM_ADMIN","SECURITY_ADMIN"}),@Restrict({"RESTRICTED_SYSTEM_ADMIN","RESTRICTED_SECURITY_ADMIN"})}) public static void validatePasswords(SetupForm setup){
setup.validatePasswords();
if (Validation.hasErrors()) {
renderJSON(ValidationResponse.collectErrors());
}
else {
renderJ... | Validate passwords from the initial setup form, rendering the result as JSON. |
public double splitCritValue(Distribution train,Distribution test,Distribution defC){
return 0;
}
| Computes result of splitting criterion for given training and test distributions and given default distribution. |
public static String toJson(Object o) throws Exception {
return objectMapper.writeValueAsString(o);
}
| Convert an object to JSON using Jackson's ObjectMapper |
public void deregister(TrainSchedule schedule){
if (schedule == null) {
return;
}
Integer oldSize=Integer.valueOf(_scheduleHashTable.size());
_scheduleHashTable.remove(schedule.getId());
setDirtyAndFirePropertyChange(LISTLENGTH_CHANGED_PROPERTY,oldSize,Integer.valueOf(_scheduleHashTable.size()));
}
| Forget a NamedBean Object created outside the manager. |
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case FunctionblockPackage.OPERATION__NAME:
setName((String)newValue);
return;
case FunctionblockPackage.OPERATION__PARAMS:
getParams().clear();
getParams().addAll((Collection<? extends Param>)newValue);
... | <!-- begin-user-doc --> <!-- end-user-doc --> |
protected Expression variable(int opPos) throws TransformerException {
Variable var=new Variable();
opPos=getFirstChildPos(opPos);
int nsPos=getOp(opPos);
java.lang.String namespace=(OpCodes.EMPTY == nsPos) ? null : (java.lang.String)getTokenQueue().elementAt(nsPos);
java.lang.String localname=(java.lang.Stri... | Compile a variable reference. |
@Override public Enumeration listOptions(){
Vector newVector=new Vector();
newVector.addElement(new Option("\tChange generalization parameter Rho\n","P",0,"-P"));
newVector.addElement(new Option("\tChange threshold to select activated neurons (no-winner-takes-all)\n","THR",0,"-THR"));
newVector.addElement(new O... | Returns an enumeration describing the available options. |
public void run(){
try {
while (!kill) {
doQuery();
Thread.sleep((int)(Math.random() * 3000d));
}
}
catch ( Exception ex) {
ex.printStackTrace();
}
}
| Opens a read-committed view of the triple store using the last commit point and issues a query for a list of all LUBM full professors. Does this every few seconds until killed. |
public void print(int w,int d){
print(new PrintWriter(System.out,true),w,d);
}
| Print the matrix to stdout. Line the elements up in columns with a Fortran-like 'Fw.d' style format. |
public static void e(String tag,String msg,Throwable tr){
println(ERROR,tag,msg,tr);
}
| Prints a message at ERROR priority. |
public String toString(){
StringBuffer buffer=new StringBuffer();
buffer.append("FieldFormat ver[");
buffer.append(ver);
buffer.append("] numflds [");
buffer.append(numflds);
buffer.append("] flddef [");
Integer key=null;
for (Iterator it=flddefs.keySet().iterator(); it.hasNext(); ) {
key=(Integer)i... | Public methods |
protected void paintLayers(Graphics g){
synchronized (getTreeLock()) {
int i=getComponentCount() - 1;
if (i < 0) {
return;
}
for (; i >= 0; i--) {
Component comp=getComponent(i);
final boolean isLayer=comp instanceof Layer;
if (isLayer && comp.isVisible()) {
comp.paint(g)... | A method that grabs the component list of the MapBean, and renders just the layers from back to front. No clipping is set, other than what is set on the Graphics object. |
private CreateVolumeParams populateVolumeParams(URI volumeId,URI storageSystemId,URI neighborhoodId,String internalSiteName,boolean production,String rpCopyName,String wwn,int maxNumberOfSnapShots){
CreateVolumeParams volumeParams=new CreateVolumeParams();
volumeParams.setVirtualArray(neighborhoodId);
volumeParam... | Assemble the CreateVolumeParams object with the input arguments. Written to keep the prepare code tidy. |
private void closeInternal(boolean selfInitiated) throws IOException {
if ((debug != null) && Debug.isOn("ssl")) {
System.out.println(Thread.currentThread().getName() + ", called closeInternal(" + selfInitiated+ ")");
}
int state=getConnectionState();
boolean closeSocketCalled=false;
Throwable cachedThrow... | Don't synchronize the whole method because waitForClose() (which calls readRecord()) might be called. |
public RandomBallCover(List<V> vecs,DistanceMetric dm,ExecutorService execServ){
this.dm=dm;
this.size=vecs.size();
this.allVecs=new ArrayList<V>(vecs);
if (execServ instanceof FakeExecutor) this.distCache=dm.getAccelerationCache(allVecs);
else this.distCache=dm.getAccelerationCache(allVecs,execServ);
In... | Creates a new Random Ball Cover |
@Override public void remove(ShockStatus status,StatusList statusList){
statusList.removeInternal(status);
RPEntity entity=statusList.getEntity();
if (entity == null) {
return;
}
Status nextStatus=statusList.getFirstStatusByClass(ShockStatus.class);
if (nextStatus != null) {
TurnNotifier.get().notif... | removes a status |
protected HashAttributeSet(Attribute attribute,Class<?> interfaceName){
if (interfaceName == null) {
throw new NullPointerException("null interface");
}
myInterface=interfaceName;
add(attribute);
}
| Construct a new attribute set, initially populated with the given attribute, where the members of the attribute set are restricted to the given interface. |
public boolean hasEventStatus(){
return super.hasElement(EventStatus.KEY);
}
| Returns whether it has the event status. |
final public void IntegerRange() throws ParseException {
ASTIntegerRange jjtn000=new ASTIntegerRange(this,JJTINTEGERRANGE);
boolean jjtc000=true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(LBRACKET);
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case WHITESPACE:
jj_consume_token(WHITESPACE)... | supports the [n..m] vector generator for use in the #foreach() to generate measured ranges w/o needing explicit support from the app/servlet |
private boolean outputIsError(String output){
if (output == null) return false;
boolean error=false;
for (int i=0; i < ERROR_OUTPUTS.length; i++) {
error=output.indexOf(ERROR_OUTPUTS[i]) > -1;
if (error) return error;
}
return error;
}
| Returns <code>true</code> if the <code>output</code> string contains a known error message. |
private SpeechletResponse handleNoSlotDialogRequest(final Intent intent,final Session session){
if (session.getAttributes().containsKey(SESSION_CITY)) {
String speechOutput="Please try again saying a day of the week, for example, Saturday";
return newAskResponse(speechOutput,speechOutput);
}
else {
ret... | Handle no slots, or slot(s) with no values. In the case of a dialog based skill with multiple slots, when passed a slot with no value, we cannot have confidence it is is the correct slot type so we rely on session state to determine the next turn in the dialog, and reprompt. |
private void resetBounds(){
switch (this.mode) {
case HALF_ANCHORED:
Rectangle temp=new Rectangle(this.mouseTrackPoint.x,this.mouseTrackPoint.y,0,0);
setBounds(getNode1().getBounds().union(temp.getBounds()));
this.relativeMouseTrackPoint=new Point(this.mouseTrackPoint);
getRelativeMouseTrackPoint().translate(-get... | This method resets the bounds of the edge component to the union of the bounds of the two components which the edge connects. It also calculates the bounds of these two components relative to this new union. |
public StoredHtmlSrc(String elementType,String srcLocation){
this.setElementType(elementType);
URL url=getClass().getClassLoader().getResource(srcLocation);
if (url == null) {
log.warning("failed to load html-src: " + srcLocation);
return;
}
InputStreamReader ins;
try {
ins=new InputStreamReader... | Load html-src (text) stored in JAR, e.g. to load a style-sheet |
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:12.274 -0500",hash_original_method="AE07D7138DB6945AA08789E90E80B92B",hash_generated_method="1B289DA79CEA990160878E347151CD53") public void reload(boolean allowStale){
addTaint(allowStale);
}
| Reload the current main frame. |
public void encode(DerOutputStream out) throws IOException {
DerOutputStream tmp=new DerOutputStream();
issuerDomain.encode(tmp);
subjectDomain.encode(tmp);
out.write(DerValue.tag_Sequence,tmp);
}
| Write the CertificatePolicyMap to the DerOutputStream. |
TypePath(byte[] b,int offset){
this.b=b;
this.offset=offset;
}
| Creates a new type path. |
public void loadConceptData(String locale){
synchronized (sLoadingLock) {
if (!locale.equals(sLoadedLocale)) {
sConceptNames=new HashMap<>();
try (Cursor c=mContentResolver.query(ConceptNames.CONTENT_URI,new String[]{ConceptNames.CONCEPT_UUID,ConceptNames.NAME},ConceptNames.LOCALE + " = ?",new String[]{... | Loads concept names and types from the app db into HashMaps in memory. |
public GenericListModel(final Collection<? extends E> consumers){
if (consumers instanceof List) {
this.list=(List<? extends E>)consumers;
}
else {
this.list=new ArrayList<E>(consumers);
}
}
| Constructs a list of consumers. If consumers collection is a List instance, it is used as the backing list, if not a new List will be created and populated from the collection. |
private static boolean doDeleteDir(File file,boolean recurse){
if (file != null && file.exists()) {
if (file.isFile() || !recurse) {
return file.delete();
}
String[] fnames=file.list();
File child=null;
for (int i=0; i < fnames.length; i++) {
child=new File(file,fnames[i]);
if (!... | Implementation of the file deletion |
private void pad(long pos) throws IOException {
long currIndex=cacheStart + cache.size() - 1;
long lastIndex=pos / BUFFER_LENGTH;
long numNewBuffers=lastIndex - currIndex;
for (long i=0; i < numNewBuffers; i++) {
try {
cache.add(new byte[BUFFER_LENGTH]);
}
catch ( OutOfMemoryError e) {
t... | Ensure that there is space to write a byte at the given position. |
private void connect(final String existingSessionID){
final Map<String,Object> data=new HashMap<String,Object>();
data.put(Protocol.Field.MESSAGE,Protocol.Message.CONNECT);
data.put(Protocol.Field.VERSION,mDdpVersion);
data.put(Protocol.Field.SUPPORT,SUPPORTED_DDP_VERSIONS);
if (existingSessionID != null) {
... | Establish the connection to the server as requested by the DDP protocol (after the websocket has been opened) |
@Override protected void drawCompositeImage(int width,int height){
Display display=Display.getDefault();
Image image=new Image(display,ARROW_SIZE,ARROW_SIZE * 2);
GC gc=new GC(image);
Color triangle=createColor(SWT.COLOR_LIST_FOREGROUND,SWT.COLOR_LIST_BACKGROUND,20,display);
Color aliasing=createColor(SWT.COL... | Draw the composite images. <p> Subclasses must implement this framework method to paint images within the given bounds using one or more calls to the <code>drawImage</code> framework method. </p> |
public int currentBuffer(int target){
if (target == GLES20.GL_ARRAY_BUFFER) {
return this.arrayBufferId;
}
else if (target == GLES20.GL_ELEMENT_ARRAY_BUFFER) {
return this.elementArrayBufferId;
}
else {
return 0;
}
}
| Returns the name of the OpenGL buffer object bound to the specified target buffer. |
public String toString(){
StringBuffer sb=new StringBuffer("Qty=").append(Qty).append(",Cost=").append(Cost);
return sb.toString();
}
| String Representation |
protected void createHttpClient(boolean recreateClientWhenExists,ConfigData configData) throws Exception {
if (_client != null) {
if (recreateClientWhenExists) try {
_client.stop();
}
catch ( Exception exc) {
}
else return;
}
SslContextFactory factory=new SslContextFactory(false);
... | Creates an HttpClient configured by properties from properties.txt. |
private int readWithQuotes(char[] chars,int start,int len,StrBuilder workArea,List tokens,int quoteStart,int quoteLen){
workArea.clear();
int pos=start;
boolean quoting=(quoteLen > 0);
int trimStart=0;
while (pos < len) {
if (quoting) {
if (isQuote(chars,pos,len,quoteStart,quoteLen)) {
if (i... | Reads a possibly quoted string token. |
public static Individuum nullIndividuum(int dim){
short[] gene=new short[dim];
Arrays.fill(gene,DONT_CARE);
return new Individuum(0.0,gene);
}
| Create a "null" individuum (full space). |
public ZoneRulesBuilder addRuleToWindow(int year,int month,int dayOfMonthIndicator,LocalTime time,boolean timeEndOfDay,TimeDefinition timeDefinition,int savingAmountSecs){
return addRuleToWindow(year,year,month,dayOfMonthIndicator,-1,time,timeEndOfDay,timeDefinition,savingAmountSecs);
}
| Adds a single transition rule to the current window. <p> This adds a rule such that the offset, expressed as a daylight savings amount, changes at the specified date-time. |
@Override public boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
debugCodeCall("storesLowerCaseQuotedIdentifiers");
String m=conn.getMode();
if (m.equals("MySQL")) {
return true;
}
return false;
}
| Checks if for CREATE TABLE "Test"(ID INT), getTables returns test as the table name. |
@Override protected void doGet(SlingHttpServletRequest request,SlingHttpServletResponse response) throws ServletException, IOException {
Resource resource=request.getResourceResolver().getResource(ASSET_LIST_COMPONENT_PATH);
request.getRequestDispatcher(resource).include(request,response);
}
| Return AssetList component HTML in the response. |
public Vector4i negate(){
x=-x;
y=-y;
z=-z;
w=-w;
return this;
}
| Negate this vector. |
public boolean isLibraryClass(){
return Scene.v().getLibraryClasses().contains(this);
}
| Convenience method returning true if this class is a library class. |
private boolean maybeSeekForCues(PositionHolder seekPosition,long currentPosition){
if (seekForCues) {
seekPositionAfterBuildingCues=currentPosition;
seekPosition.position=cuesContentPosition;
seekForCues=false;
return true;
}
if (sentSeekMap && seekPositionAfterBuildingCues != UNKNOWN) {
seek... | Updates the position of the holder to Cues element's position if the extractor configuration permits use of master seek entry. After building Cues sets the holder's position back to where it was before. |
public IOException(Throwable cause){
super(cause == null ? null : cause.toString(),cause);
}
| Constructs a new instance of this class with its detail cause filled in. |
public static boolean checkConnected(ConnectivityManager cm){
return checkConnected(cm,Controller.getInstance().onlyUseWifi(),false);
}
| Wrapper for Method checkConnected(ConnectivityManager cm, boolean onlyWifi) |
public void addCondition(final ValueExpr condition){
final ValueExpr newCondition=condition.clone();
if (this.condition == null) {
setCondition(newCondition);
}
else {
setCondition(new And(this.condition,newCondition));
}
this.condition.visit(visitor);
if (trivialCondition(this.condition)) {
th... | Constrain a rule with a filter condition. If there are already conditions on the rule, they will be ANDed together. If this rule doesn't define all the variables used in the condition (because the rule only matches one statement pattern), it will assume those portions match, so that we are guaranteed to include all rel... |
private BusinessObjectDataStatus createNotAvailableBusinessObjectDataStatus(StorageUnitEntity storageUnitEntity,Set<BusinessObjectDataEntity> archivedBusinessObjectDataEntities){
BusinessObjectDataEntity businessObjectDataEntity=storageUnitEntity.getBusinessObjectData();
BusinessObjectDataStatus businessObjectDataS... | Creates a business object data status instance from the storage unit entity. |
@Override public final String leftSide(Instances data){
return data.attribute(m_attIndex).name();
}
| Prints left side of condition. |
public void allowLoops(final boolean allowLoops){
this.allowLoops=allowLoops;
}
| Sets whether loops, i.e. edges with the same start and end vertex, are allowed to be generated. |
public RecentFilesHandlerWithCommandline(String propsFile,String propPrefix,int maxCount,M menu){
super(propsFile,propPrefix,maxCount,menu);
}
| Initializes the handler. |
public void addAll(Collection<? extends T> collection){
synchronized (mLock) {
if (mOriginalValues != null) {
mOriginalValues.addAll(collection);
}
else {
mObjects.addAll(collection);
}
}
if (mNotifyOnChange) notifyDataSetChanged();
}
| Adds the specified Collection at the end of the array. |
public SoundInfo(Sound sound,float volume,float pitch){
this.sound=sound;
this.volume=volume;
this.pitch=pitch;
}
| Constructs a new GlowSound with the given sound, volume and pitch |
@Override public String toString(){
return name + ": " + value;
}
| Get string representation of attribute suitable for inclusion in encoded PEM: "<name>: <value>". |
protected POInfo initPO(Properties ctx){
POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName());
return poi;
}
| Load Meta Data |
public boolean appliesOnlyToBlockScopedElements(){
return false;
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
private String removeNonce(String topologyId){
return topologyId.substring(0,topologyId.substring(0,topologyId.lastIndexOf("-")).lastIndexOf("-"));
}
| Removes nonce appended to topology name (e.g. "Example-Topology-1-2345" -> "Example-Topology") |
public static void swapPivot(double[][] source,int diag,double[][] s,double[][] t){
int swapRow=diag;
int swapCol=diag;
double maxValue=Math.abs(source[diag][diag]);
int rows=source.length;
int cols=source[0].length;
double abs=0;
double[] r=null;
for (int row=diag; row < rows; row++) {
r=source[row... | Swap the matrices so that the largest value is on the pivot |
public boolean isBoolean(){
return value instanceof Boolean;
}
| Check whether this primitive contains a boolean value. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.