code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
|---|---|
public <T>List<T> testOneThreadTwoItems(T a,T b){
Trace.trace(Item.SCHEDULER,"testOneThreadTwoItems: in");
List<T> results=new ArrayList<T>(2);
Scheduler.scheduleMutator(new TestMutator<T>(results,a,b));
Scheduler.schedule();
Trace.trace(Item.SCHEDULER,"testOneThreadTwoItems: out");
return results;
}
|
One thread inserts two items into the result list <p> Expected result: A list containing the two items in order.
|
boolean checkTransitivityOutgoing(Fact fact){
return fact.span() >= minTransitiveRight;
}
|
Determine whether transitivity should be applied to an outgoing triple. Decide based on the distance of the relationship. For any length l, there should be a unique split l1 and l2 such that any connection of length l will be made only by combining a left-hand/incoming connection of length l1 and a right-hand/outgoing connection of length l2.
|
public void clearUserConstraint(){
setUserConstraint(USER_ANY);
}
|
Clear constraints on the user.
|
public void addUseCount(){
if (_indirectSource != null) {
_indirectSource.addUseCount();
}
else if (_useCount != null) {
_useCount.incrementAndGet();
}
}
|
Adds a use-counter, so getInputStream can be called multiple times.
|
public Instance replaceMovieClip(Symbol symbol,int depth,Transform matrix2,AlphaTransform cxform,String name,Actions[] clipActions){
Transform matrix=matrix2;
Instance inst=new Instance(symbol,depth);
if (matrix == null) {
matrix=new Transform();
}
Placement placement=new Placement(inst,matrix,cxform,name,-1,-1,frameNumber,false,true,clipActions);
placements.add(placement);
return inst;
}
|
Replace the Symbol at the given depth with the new MovieClip
|
@Override public void onProjectClosed(ProjectActionEvent event){
ProjectDescriptor project=event.getProject();
final String projectTypeId=project.getType();
boolean isJSProject=projectTypeId.endsWith("JS");
if (isJSProject) {
workspaceAgent.removePart(yeomanPartPresenter);
}
}
|
Remove Yeoman panel when closing the project if this panel is displayed.
|
@Override public int previewTexturesLength(){
return this.getPreviewTilesNumber();
}
|
texture methods
|
public T caseBootstrapModule(BootstrapModule object){
return null;
}
|
Returns the result of interpreting the object as an instance of '<em>Bootstrap Module</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
|
private static void fillBasin(DTSweepContext tcx,AdvancingFrontNode node){
if (orient2d(node.point,node.next.point,node.next.next.point) == Orientation.CCW) {
tcx.basin.leftNode=node;
}
else {
tcx.basin.leftNode=node.next;
}
tcx.basin.bottomNode=tcx.basin.leftNode;
while (tcx.basin.bottomNode.hasNext() && tcx.basin.bottomNode.point.getY() >= tcx.basin.bottomNode.next.point.getY()) {
tcx.basin.bottomNode=tcx.basin.bottomNode.next;
}
if (tcx.basin.bottomNode == tcx.basin.leftNode) {
return;
}
tcx.basin.rightNode=tcx.basin.bottomNode;
while (tcx.basin.rightNode.hasNext() && tcx.basin.rightNode.point.getY() < tcx.basin.rightNode.next.point.getY()) {
tcx.basin.rightNode=tcx.basin.rightNode.next;
}
if (tcx.basin.rightNode == tcx.basin.bottomNode) {
return;
}
tcx.basin.width=tcx.basin.rightNode.getPoint().getX() - tcx.basin.leftNode.getPoint().getX();
tcx.basin.leftHighest=tcx.basin.leftNode.getPoint().getY() > tcx.basin.rightNode.getPoint().getY();
fillBasinReq(tcx,tcx.basin.bottomNode);
}
|
Fills a basin that has formed on the Advancing Front to the right of given node.<br> First we decide a left,bottom and right node that forms the boundaries of the basin. Then we do a reqursive fill.
|
public OnePointCrossover(double probability){
this.probability=probability;
}
|
Constructs a one-point crossover operator with the specified probability of applying this operator to solutions.
|
public static Map ordinalMap(Iterator tuples,String field,Comparator cmp){
Object[] o=ordinalArray(tuples,field,cmp);
HashMap map=new HashMap();
for (int i=0; i < o.length; ++i) map.put(o[i],new Integer(i));
return map;
}
|
Get map mapping from column values (as Object instances) to their ordinal index in a sorted array.
|
protected void emit_InterfaceImplementsList_ExtendsKeyword_0_0_or_ImplementsKeyword_0_1(EObject semanticObject,ISynNavigable transition,List<INode> nodes){
acceptNodes(transition,nodes);
}
|
Ambiguous syntax: 'extends' | 'implements' This ambiguous syntax occurs at: (rule start) 'interface' (ambiguity) superInterfaceRefs+=ParameterizedTypeRefNominal declaredModifiers+=N4Modifier 'interface' (ambiguity) superInterfaceRefs+=ParameterizedTypeRefNominal name=BindingIdentifier (ambiguity) superInterfaceRefs+=ParameterizedTypeRefNominal typeVars+=TypeVariable '>' (ambiguity) superInterfaceRefs+=ParameterizedTypeRefNominal typingStrategy=TypingStrategyDefSiteOperator (ambiguity) superInterfaceRefs+=ParameterizedTypeRefNominal
|
@DSComment("From safe class list") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:33:23.428 -0500",hash_original_method="F893922E2C2E4CF6AF95C190516DB394",hash_generated_method="FDE8D96477E28E3BDD367BAF0ED08001") public LongSparseArray(){
this(10);
}
|
Creates a new SparseArray containing no mappings.
|
public nobr(Element element){
addElement(element);
}
|
Use the set* methods to set the values of the attributes.
|
protected void checkOpenAngle(){
int bufferEnd=getBufferEnd();
int tokenStart=getTokenEnd();
int run=tokenStart;
CharSequence buffer=getBuffer();
while (run < bufferEnd && buffer.charAt(run) == '<') {
run++;
}
if (run > tokenStart) {
if (run == bufferEnd || run == tokenStart + 1 || Character.isWhitespace(buffer.charAt(run))) {
pushPreparsedToken(tokenStart,run,POD_ANGLE_LEFT);
myOpenedAngles.add(run - tokenStart);
}
else {
pushPreparsedToken(tokenStart,tokenStart + 1,POD_ANGLE_LEFT);
myOpenedAngles.add(1);
}
}
}
|
Pre-parses opening angles
|
public List<A> prependList(List<A> xs){
if (this.isEmpty()) return xs;
else if (xs.isEmpty()) return this;
else return this.prependList(xs.tail).prepend(xs.head);
}
|
Prepend given list of elements to front of list, forming and returning a new list.
|
public void addGap(int length){
super.addGap(length);
}
|
Appends the length-byte gap to the end of the bytecode sequence.
|
public static boolean writeMessage(MessageWrapper mw){
if (mw.t == null) return false;
try {
synchronized (DAO.class) {
boolean exists=false;
if (mw.t.getCreatedAt().after(DateParser.oneHourAgo())) {
exists=messages_hour.writeEntry(new IndexEntry<MessageEntry>(mw.t.getIdStr(),mw.t.getSourceType(),mw.t));
if (exists) return false;
}
if (mw.t.getCreatedAt().after(DateParser.oneDayAgo())) {
exists=messages_day.writeEntry(new IndexEntry<MessageEntry>(mw.t.getIdStr(),mw.t.getSourceType(),mw.t));
if (exists) return false;
}
if (mw.t.getCreatedAt().after(DateParser.oneWeekAgo())) {
exists=messages_week.writeEntry(new IndexEntry<MessageEntry>(mw.t.getIdStr(),mw.t.getSourceType(),mw.t));
if (exists) return false;
}
exists=messages.writeEntry(new IndexEntry<MessageEntry>(mw.t.getIdStr(),mw.t.getSourceType(),mw.t));
if (exists) return false;
users.writeEntry(new IndexEntry<UserEntry>(mw.u.getScreenName(),mw.t.getSourceType(),mw.u));
if (mw.dump) message_dump.write(mw.t.toJSON(mw.u,false,Integer.MAX_VALUE,""));
}
Classifier.learnPhrase(mw.t.getText(Integer.MAX_VALUE,""));
}
catch ( IOException e) {
Log.getLog().warn(e);
}
return true;
}
|
Store a message together with a user into the search index
|
protected void addPeriod(ReadablePeriod period){
if (period != null) {
setValues(addPeriodInto(getValues(),period));
}
}
|
Adds the fields from another period.
|
public static int[] toArray(String s){
return toArray(s,IPv4);
}
|
Convert a string containing an IPv4 address to an array of 4 integers.
|
public DefineTag build(){
int count=glyphEntryMap.size();
if (Trace.font) Trace.trace("Building font '" + tag.fontName + "' with "+ count+ " characters.");
if (flashType && tag instanceof DefineFont3) {
DefineFont3 df3=(DefineFont3)tag;
df3.zones=new DefineFontAlignZones();
df3.zones.font=df3;
df3.zones.zoneTable=new ZoneRecord[count];
df3.zones.csmTableHint=1;
}
tag.glyphShapeTable=new Shape[count];
if (tag.code != Tag.stagDefineFont) {
tag.codeTable=new char[count];
if (tag.hasLayout) {
tag.advanceTable=new short[count];
tag.boundsTable=new Rect[count];
}
}
Iterator it=glyphEntryMap.iterator();
int i=0;
while (it.hasNext() && i < count) {
GlyphEntry ge=(GlyphEntry)((Map.Entry)it.next()).getValue();
if (flashType && tag instanceof DefineFont3) {
((DefineFont3)tag).zones.zoneTable[i]=ge.zoneRecord;
}
tag.glyphShapeTable[i]=ge.shape;
ge.setIndex(i);
if (tag.code != Tag.stagDefineFont) {
tag.codeTable[i]=ge.character;
if (tag.hasLayout) {
tag.advanceTable[i]=(short)ge.advance;
tag.boundsTable[i]=IDENTITY_RECT;
}
else {
if (Trace.font) Trace.trace("Warning: font tag created without layout information.");
}
}
i++;
}
if (tag.hasLayout) {
tag.kerningTable=new KerningRecord[0];
}
if (useLicenseTag && ((getFSType() != null && !getFSType().installable) || getCopyright() != null || getName() != null)) {
tag.license=new DefineFontName();
tag.license.font=tag;
tag.license.fontName=getName();
tag.license.copyright=getCopyright();
}
return tag;
}
|
Creates a DefineFont2 or DefineFont3 tag depending on the code specified on construction.
|
public void addResponse(RecordResponse response){
if (response.getResponseSize() + getResponseSize() > 248) {
throw new IllegalArgumentException();
}
if (records == null) {
records=new RecordResponse[1];
}
else {
RecordResponse old[]=records;
records=new RecordResponse[old.length + 1];
System.arraycopy(old,0,records,0,old.length);
}
records[records.length - 1]=response;
setDataLength(getResponseSize());
}
|
addResponse -- add a new record response.
|
public static void placePlayerIntoWorldOnLogin(final RPObject object,final Player player){
StendhalRPZone zone=null;
String zoneName=System.getProperty("stendhal.forcezone");
if (zoneName != null) {
zone=SingletonRepository.getRPWorld().getZone(zoneName);
zone.placeObjectAtEntryPoint(player);
return;
}
try {
if (object.has("zoneid") && object.has("x") && object.has("y")) {
if (Version.checkCompatibility(object.get("release"),Debug.VERSION)) {
zone=SingletonRepository.getRPWorld().getZone(object.get("zoneid"));
}
else {
if (player.getLevel() >= 2) {
TutorialNotifier.newrelease(player);
}
}
player.put("release",Debug.VERSION);
}
}
catch ( final RuntimeException e) {
logger.warn("Cannot place player at its last position. Using default",e);
}
if (zone != null) {
if (!StendhalRPAction.placeat(zone,player,player.getX(),player.getY())) {
logger.warn("Cannot place player at their last position: " + player.getName());
zone=null;
}
}
if (zone == null) {
final String defaultZoneName=getDefaultZoneForPlayer(player);
zone=SingletonRepository.getRPWorld().getZone(defaultZoneName);
if (zone == null) {
logger.error("Unable to locate default zone [" + defaultZoneName + "]");
return;
}
zone.placeObjectAtEntryPoint(player);
}
}
|
Places the player (and his/her sheep if there is one) into the world on login.
|
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:40.797 -0500",hash_original_method="1E545822701FEAEF52AB68BFB73351A8",hash_generated_method="67B0DB4F7332E1551B3772D6F1B4F707") private boolean isClosed(){
return buf.getTaintBoolean();
}
|
Indicates whether or not this reader is closed.
|
protected void firePropertyChange(PropertyChangeEvent evt){
propertyChangeSupport.firePropertyChange(evt);
}
|
Fire property change.
|
public static final double log(double a){
return ieee754_log(a);
}
|
Return the natural logarithm, ln(a), as it relates to Math.E. This in turn uses ieee7854_log(double).
|
private SynthStyle mergeStyles(List styles){
int size=styles.size();
if (size == 0) {
return null;
}
else if (size == 1) {
return (SynthStyle)((DefaultSynthStyle)styles.get(0)).clone();
}
DefaultSynthStyle style=(DefaultSynthStyle)styles.get(size - 1);
style=(DefaultSynthStyle)style.clone();
for (int counter=size - 2; counter >= 0; counter--) {
style=((DefaultSynthStyle)styles.get(counter)).addTo(style);
}
return style;
}
|
Creates a single Style from the passed in styles. The passed in List is reverse sorted, that is the most recently added style found to match will be first.
|
private OcrResultIterator findString(String str,OcrResult result){
OcrResultIterator iter=new OcrResultIterator(result);
while (iter.hasNext()) {
if (stringMatch(str,iter)) return iter;
iter.moveToNext();
}
return null;
}
|
very inefficient implementation of string search
|
public void removeDispatcherListener(DispatcherListener listener){
removeListener(BeforeDispatch,listener);
removeListener(AfterDispatch,listener);
}
|
Removes a previously added listener.
|
@SuppressWarnings("deprecation") public void configureManagers(){
powerManager=new jmri.jmrix.mrc.MrcPowerManager(this);
InstanceManager.store(powerManager,jmri.PowerManager.class);
turnoutManager=new jmri.jmrix.mrc.MrcTurnoutManager(getMrcTrafficController(),getSystemPrefix());
InstanceManager.setTurnoutManager(turnoutManager);
throttleManager=new jmri.jmrix.mrc.MrcThrottleManager(this);
InstanceManager.setThrottleManager(throttleManager);
InstanceManager.setProgrammerManager(getProgrammerManager());
clockManager=new jmri.jmrix.mrc.MrcClockControl(getMrcTrafficController(),getSystemPrefix());
InstanceManager.addClockControl(clockManager);
}
|
Configure the common managers for MRC connections. This puts the common manager config in one place.
|
public void aggregateAsync(final KVO<BigdataValue>[] chunk,final BlobsWriteProc.Result result,final Split split){
for (int i=0; i < chunk.length; i++) {
final int counter=result.counters[i];
if (counter == BlobsIndexHelper.NOT_FOUND) {
if (!readOnly) throw new AssertionError();
}
else {
final BigdataValue value=chunk[i].obj;
@SuppressWarnings("rawtypes") final BlobIV<?> iv=new BlobIV(VTE.valueOf(value),value.hashCode(),(short)counter);
value.setIV(iv);
if (chunk[i] instanceof KVOList) {
final KVOList<BigdataValue> tmp=(KVOList<BigdataValue>)chunk[i];
if (!tmp.isDuplicateListEmpty()) {
tmp.map(new AssignTermId(iv));
}
}
if (log.isDebugEnabled()) {
log.debug("termId=" + iv + ", term="+ chunk[i].obj);
}
}
}
}
|
Copy the assigned / discovered term identifiers onto the corresponding elements of the terms[].
|
public SpannableString render(Context context){
Settings settings=new Settings(context);
if (canvas == null) {
String prefix=hasIcon() && settings.showIcons() ? " " : "";
String nick=hasSender() ? " " + sender + " - " : "";
String timestamp=settings.showTimestamp() ? renderTimeStamp(settings.use24hFormat(),settings.includeSeconds()) : "";
canvas=new SpannableString(prefix + timestamp + nick);
SpannableString renderedText;
if (settings.showMircColors()) {
renderedText=MircColors.toSpannable(text);
}
else {
renderedText=new SpannableString(MircColors.removeStyleAndColors(text));
}
if (settings.showGraphicalSmilies()) {
renderedText=Smilies.toSpannable(renderedText,context);
}
canvas=new SpannableString(TextUtils.concat(canvas,renderedText));
if (hasSender()) {
int start=(prefix + timestamp).length() + 1;
int end=start + sender.length();
if (settings.showColorsNick()) {
canvas.setSpan(new ForegroundColorSpan(getSenderColor()),start,end,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
if (hasIcon() && settings.showIcons()) {
Drawable drawable=context.getResources().getDrawable(icon);
drawable.setBounds(0,0,drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight());
canvas.setSpan(new ImageSpan(drawable,ImageSpan.ALIGN_BOTTOM),0,1,Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
if (hasColor() && settings.showColors()) {
ForegroundColorSpan[] spans=canvas.getSpans(0,canvas.length(),ForegroundColorSpan.class);
int start=0;
for (int i=0; i < spans.length; i++) {
canvas.setSpan(new ForegroundColorSpan(color),start,canvas.getSpanStart(spans[i]),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
start=canvas.getSpanEnd(spans[i]);
}
canvas.setSpan(new ForegroundColorSpan(color),start,canvas.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
return canvas;
}
|
Render message as spannable string
|
public static Column fromOrd(int i){
if ((i < 0) || (i >= Column.values().length)) {
throw new IndexOutOfBoundsException("Invalid ordinal");
}
return Column.values()[i];
}
|
Converts an ordinal into a column.
|
private void createSignalControlFor4LightCrossing(Id<SignalSystem> signalSystemId,SignalControlData control){
SignalSystemControllerData controller=control.getFactory().createSignalSystemControllerData(signalSystemId);
control.addSignalSystemControllerData(controller);
controller.setControllerIdentifier(DefaultPlanbasedSignalSystemController.IDENTIFIER);
SignalPlanData plan=control.getFactory().createSignalPlanData(Id.create(signalSystemId.toString() + "P",SignalPlan.class));
controller.addSignalPlanData(plan);
plan.setCycleTime(this.cycle);
plan.setOffset(0);
SignalGroupSettingsData settings1=control.getFactory().createSignalGroupSettingsData(Id.create(signalSystemId.toString() + "S1",SignalGroup.class));
plan.addSignalGroupSettings(settings1);
settings1.setOnset(this.onset1);
settings1.setDropping(this.dropping1);
SignalGroupSettingsData settings2=control.getFactory().createSignalGroupSettingsData(Id.create(signalSystemId.toString() + "S3",SignalGroup.class));
plan.addSignalGroupSettings(settings2);
settings2.setOnset(this.onset1);
settings2.setDropping(this.dropping1);
SignalGroupSettingsData settings3=control.getFactory().createSignalGroupSettingsData(Id.create(signalSystemId.toString() + "S2",SignalGroup.class));
plan.addSignalGroupSettings(settings3);
settings3.setOnset(this.onset2);
settings3.setDropping(this.dropping2);
SignalGroupSettingsData settings4=control.getFactory().createSignalGroupSettingsData(Id.create(signalSystemId.toString() + "S4",SignalGroup.class));
plan.addSignalGroupSettings(settings4);
settings4.setOnset(this.onset2);
settings4.setDropping(this.dropping2);
}
|
creates signal control for a crossing like node 2 or 7, which contains 4 signal groups with single signals. this method switches signal 1 and 3 together in the first onset-dropping rhythm and signal 2 and 4 together in the second onset-dropping rhythm.
|
public SubtreeDragControl(){
}
|
Creates a new subtree drag control that issues repaint requests as an item is dragged.
|
protected String paramString(){
String horizontalAlignmentString;
if (horizontalAlignment == LEFT) {
horizontalAlignmentString="LEFT";
}
else if (horizontalAlignment == CENTER) {
horizontalAlignmentString="CENTER";
}
else if (horizontalAlignment == RIGHT) {
horizontalAlignmentString="RIGHT";
}
else if (horizontalAlignment == LEADING) {
horizontalAlignmentString="LEADING";
}
else if (horizontalAlignment == TRAILING) {
horizontalAlignmentString="TRAILING";
}
else horizontalAlignmentString="";
String commandString=(command != null ? command : "");
return super.paramString() + ",columns=" + columns+ ",columnWidth="+ columnWidth+ ",command="+ commandString+ ",horizontalAlignment="+ horizontalAlignmentString;
}
|
Returns a string representation of this <code>JTextField</code>. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be <code>null</code>.
|
public static void appendToCore(String str){
CORE_SCRIPT.append(str);
}
|
the angularBeansMainObject is the angularBeans object in the angularBeans javascript api
|
public static char[] toCharArray(byte[] input){
char[] result=new char[input.length];
for (int i=0; i < input.length; i++) {
result[i]=(char)input[i];
}
return result;
}
|
Rewrite a byte array as a char array
|
@Override public void updateInt(int columnIndex,int x) throws SQLException {
try {
if (isDebugEnabled()) {
debugCode("updateInt(" + columnIndex + ", "+ x+ ");");
}
update(columnIndex,ValueInt.get(x));
}
catch ( Exception e) {
throw logAndConvert(e);
}
}
|
Updates a column in the current or insert row.
|
protected void addStrategyPropertyDescriptor(Object object){
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),getResourceLocator(),getString("_UI_Aggregator_strategy_feature"),getString("_UI_PropertyDescriptor_description","_UI_Aggregator_strategy_feature","_UI_Aggregator_type"),EipPackage.Literals.AGGREGATOR__STRATEGY,true,false,false,ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,null,null));
}
|
This adds a property descriptor for the Strategy feature. <!-- begin-user-doc --> <!-- end-user-doc -->
|
public MetricSchemaRecord(String scope,String metric){
this(null,scope,metric,null,null);
}
|
Creates a new MetricSchemaRecord object.
|
public RectF toCameraSpace(RectF source){
RectF result=new RectF();
mPreviewToCameraTransform.mapRect(result,source);
return result;
}
|
Transform a rectangle in preview view space into a new rectangle in camera view space.
|
public final RegExp rev(Macros macros){
RegExp1 unary;
RegExp2 binary;
RegExp content;
switch (type) {
case sym.BAR:
binary=(RegExp2)this;
return new RegExp2(sym.BAR,binary.r1.rev(macros),binary.r2.rev(macros));
case sym.CONCAT:
binary=(RegExp2)this;
return new RegExp2(sym.CONCAT,binary.r2.rev(macros),binary.r1.rev(macros));
case sym.STAR:
unary=(RegExp1)this;
content=(RegExp)unary.content;
return new RegExp1(sym.STAR,content.rev(macros));
case sym.PLUS:
unary=(RegExp1)this;
content=(RegExp)unary.content;
return new RegExp1(sym.PLUS,content.rev(macros));
case sym.QUESTION:
unary=(RegExp1)this;
content=(RegExp)unary.content;
return new RegExp1(sym.QUESTION,content.rev(macros));
case sym.BANG:
unary=(RegExp1)this;
content=(RegExp)unary.content;
return new RegExp1(sym.BANG,content.rev(macros));
case sym.TILDE:
content=resolveTilde(macros);
return content.rev(macros);
case sym.STRING:
case sym.STRING_I:
unary=(RegExp1)this;
return new RegExp1(unary.type,revString((String)unary.content));
case sym.CHAR:
case sym.CHAR_I:
case sym.CCLASS:
case sym.CCLASSNOT:
unary=(RegExp1)this;
return new RegExp1(unary.type,unary.content);
case sym.MACROUSE:
unary=(RegExp1)this;
return macros.getDefinition((String)unary.content).rev(macros);
}
throw new Error("unknown regexp type " + type);
}
|
Create a new regexp that matches the reverse text of this one.
|
protected boolean initialUseOptimalColumnWidths(){
return false;
}
|
Returns the initial setting of whether to set optimal column widths. Default implementation returns "false", since large tables might take too long to be displayed otherwise.
|
public static ARRAY toARRAY(double[] doubles,String dataType,OracleConnection connection) throws SQLException {
ArrayDescriptor descriptor=ArrayDescriptor.createDescriptor(dataType,connection);
return new ARRAY(descriptor,connection,doubles);
}
|
Convience method for ARRAY construction. </p>
|
public void run(){
QueueElement qe;
try {
while ((qe=dequeue()) != null) {
EventObject e=qe.event;
Vector<NamingListener> v=qe.vector;
for (int i=0; i < v.size(); i++) {
if (e instanceof NamingEvent) {
((NamingEvent)e).dispatch(v.elementAt(i));
}
else if (e instanceof NamingExceptionEvent) {
((NamingExceptionEvent)e).dispatch(v.elementAt(i));
}
else if (e instanceof UnsolicitedNotificationEvent) {
((UnsolicitedNotificationEvent)e).dispatch((UnsolicitedNotificationListener)v.elementAt(i));
}
}
qe=null;
e=null;
v=null;
}
}
catch ( InterruptedException e) {
}
}
|
Pull events off the queue and dispatch them.
|
public boolean equals(Object other){
if (!(other instanceof Name)) return false;
Name o=(Name)other;
return kind == o.kind && name.equals(o.name) && nsset.equals(o.nsset);
}
|
exact equality. Both names must have the same kind, name, and equal namespace sets.
|
private ValueGraphVertex findOrCreateVertex(Object var){
if (var instanceof Register) {
return findOrCreateVertex((Register)var);
}
else if (var instanceof RegisterOperand) {
return findOrCreateVertex(((RegisterOperand)var).getRegister());
}
else if (var instanceof ConstantOperand) {
return findOrCreateVertex((ConstantOperand)var);
}
else if (var instanceof TypeOperand) {
return findOrCreateVertex((TypeOperand)var);
}
else if (var instanceof MethodOperand) {
return findOrCreateVertex((MethodOperand)var);
}
else if (var instanceof ConditionOperand) {
return findOrCreateVertex((ConditionOperand)var);
}
else {
throw new OptimizingCompilerException("ValueGraph.findOrCreateVertex: unexpected type " + var.getClass());
}
}
|
Find or create an ValueGraphVertex corresponding to a given variable.
|
private void linearScan(Relation<? extends O> relation,DBIDIter iter,O obj,double range,ModifiableDoubleDBIDList result){
final double upper=range * 1.0000001;
final double sqrange=upper * upper;
while (iter.valid()) {
final double sqdistance=SQUARED.distance(obj,relation.get(iter));
if (sqdistance <= sqrange) {
final double dist=Math.sqrt(sqdistance);
if (dist <= range) {
result.add(dist,iter);
}
}
iter.advance();
}
}
|
Main loop for linear scan,
|
public String toString(){
return "XMLStreamReader - State: " + NAMES_OF_EVENTS[_eventType] + ", Location: "+ _location.toString();
}
|
Returns the textual representation of this reader current state.
|
private void updateProgress(String progressLabel,int progress){
if (myHost != null && ((progress != previousProgress) || (!progressLabel.equals(previousProgressLabel)))) {
myHost.updateProgress(progressLabel,progress);
}
previousProgress=progress;
previousProgressLabel=progressLabel;
}
|
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
|
public boolean hasBreakpoint(final Module module,final Address address){
Preconditions.checkNotNull(address,"Error: Address argument can not be null");
return breakpointManager.hasBreakpoint(BreakpointType.REGULAR,new BreakpointAddress(module == null ? null : module.getNative(),new UnrelocatedAddress(new CAddress(address.toLong()))));
}
|
Checks whether a regular breakpoint exists at a given address.
|
public static Object moveObject(Object fromObj,Object toObj,int numBytes,RVMClass type){
return JavaHeader.moveObject(fromObj,toObj,numBytes,type);
}
|
Copies a scalar object to the given raw storage address.
|
public void addActionListener(ActionListener al){
if (backButton != null && forwardButton != null) {
backButton.addActionListener(al);
forwardButton.addActionListener(al);
}
else {
if (listeners == null) {
listeners=new Vector();
}
listeners.add(al);
}
}
|
Add an ActionListener for events that trigger events to shift the Projection stack. If you are hooking up a ProjectionStack, you don't need to call this. The ProjectionStack will call this when you can addProjectionStackTrigger on it.
|
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:52.959 -0500",hash_original_method="574B1997394313A9CBB50913816A2452",hash_generated_method="F7A59FE591A255BCF961218A4165471C") @DSVerified @DSSafe(DSCat.UTIL_FUNCTION) public static byte[] encodeBase64(byte[] binaryData,boolean isChunked){
int lengthDataBits=binaryData.length * EIGHTBIT;
int fewerThan24bits=lengthDataBits % TWENTYFOURBITGROUP;
int numberTriplets=lengthDataBits / TWENTYFOURBITGROUP;
byte encodedData[]=null;
int encodedDataLength=0;
int nbrChunks=0;
if (fewerThan24bits != 0) {
encodedDataLength=(numberTriplets + 1) * 4;
}
else {
encodedDataLength=numberTriplets * 4;
}
encodedData=new byte[encodedDataLength];
encodedData.addTaint(isChunked);
encodedData.addTaint(binaryData.getTaint());
return encodedData;
}
|
Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
|
public static Remote exportObject(Remote obj,ActivationID id,int port,RMIClientSocketFactory csf,RMIServerSocketFactory ssf) throws RemoteException {
return exportObject(obj,new ActivatableServerRef(id,port,csf,ssf));
}
|
Export the activatable remote object to the RMI runtime to make the object available to receive incoming calls. The object is exported on an anonymous port, if <code>port</code> is zero. <p> During activation, this <code>exportObject</code> method should be invoked explicitly by an "activatable" object, that does not extend the <code>Activatable</code> class. There is no need for objects that do extend the <code>Activatable</code> class to invoke this method directly because the object is exported during construction.
|
@RequestMapping(value="/emrHiveSteps",method=RequestMethod.POST,consumes={"application/xml","application/json"}) @Secured(SecurityFunctions.FN_EMR_HIVE_STEPS_POST) public EmrHiveStep addHiveStepToEmrCluster(@RequestBody EmrHiveStepAddRequest request) throws Exception {
return (EmrHiveStep)emrService.addStepToCluster(request);
}
|
Adds a hive step to the existing cluster <p>Requires EXECUTE permission on namespace</p>
|
public BatchUpdateException(String reason,int[] updateCounts,Throwable cause){
super(reason,cause);
this.updateCounts=updateCounts;
}
|
Creates an BatchUpdateException object. The cause Throwable object is set to the given cause Throwable object. SQLState is initialized to null while vendorCode is zero.
|
public DrawerBuilder withSliderBackgroundColor(@ColorInt int sliderBackgroundColor){
this.mSliderBackgroundColor=sliderBackgroundColor;
return this;
}
|
Set the background color for the Slider. This is the view containing the list.
|
@Override public void toggleSelection(Photo photo){
if (selectedPhotos.contains(photo)) {
selectedPhotos.remove(photo);
}
else {
selectedPhotos.add(photo);
}
}
|
Toggle the selection status of the item at a given position
|
public LoadUnit(String tu,String physicalPosition,Product product){
this(tu,physicalPosition);
this.product=product;
}
|
Create a new LoadUnit.
|
private static void d_ucumm(double[] a,double[] agg,double[] c,int m,int n,int rl,int ru){
double[] cprods=(agg != null) ? agg : new double[n];
if (agg == null) Arrays.fill(cprods,1);
for (int i=rl, aix=rl * n; i < ru; i++, aix+=n) {
productAgg(a,cprods,aix,0,n);
System.arraycopy(cprods,0,c,aix,n);
}
}
|
CUMPROD, opcode: ucum*, dense input.
|
public boolean isElement(){
return true;
}
|
This is used to determine if this node is an element. This allows users of the framework to make a distinction between nodes that represent attributes and nodes that represent elements. This is particularly useful given that attribute nodes do not maintain a node map of attributes.
|
public Xml(Element element){
this((element == null) ? null : detachElement(element));
}
|
Creates an XML property.
|
public static String[] partitionOptions(String[] options){
for (int i=0; i < options.length; i++) {
if (options[i].equals("--")) {
options[i++]="";
String[] result=new String[options.length - i];
for (int j=i; j < options.length; j++) {
result[j - i]=options[j];
options[j]="";
}
return result;
}
}
return new String[0];
}
|
Returns the secondary set of options (if any) contained in the supplied options array. The secondary set is defined to be any options after the first "--". These options are removed from the original options array.
|
public void insert(final AbstractInsnNode location,final AbstractInsnNode insn){
++size;
AbstractInsnNode next=location.next;
if (next == null) {
last=insn;
}
else {
next.prev=insn;
}
location.next=insn;
insn.next=next;
insn.prev=location;
cache=null;
insn.index=0;
}
|
Inserts the given instruction after the specified instruction.
|
@Deprecated public Task<VolumeRestRep> activateFullCopy(URI id,URI copyId){
return postTask(getFullCopyUrl() + "/{copyId}/activate",id,copyId);
}
|
Begins activating a full copy of the given block volume. <p> API Call: <tt>POST /block/volumes/{id}/protection/full-copies/{copyId}/activate</tt>
|
public void addModifyListener(final ModifyListener listener){
checkWidget();
this.composite.addModifyListener(listener);
}
|
Adds the listener to the collection of listeners who will be notified when the receiver's text is modified, by sending it one of the messages defined in the <code>ModifyListener</code> interface.
|
public MucEntry(String id,String text){
this.id=id;
this.text=text;
}
|
Instantiates a new muc entry.
|
@Override public void validate(final StatementDescription cd){
final String microSpeciesName=cd.getLitteral(TARGET);
if (microSpeciesName != null) {
final SpeciesDescription macroSpecies=cd.getSpeciesContext();
final TypeDescription microSpecies=macroSpecies.getMicroSpecies(microSpeciesName);
if (microSpecies == null) {
cd.error(macroSpecies.getName() + " species doesn't contain " + microSpeciesName+ " as micro-species",IGamlIssue.UNKNOWN_SUBSPECIES,TARGET,microSpeciesName);
}
}
}
|
Method validate()
|
public void seek(){
seekN(1);
}
|
Skip 1 char ahead.
|
public PluginProperties(Class<? extends Plugin> pluginClass){
String propsPath=pluginClass.getName().replace('.','/').concat(".properties");
props=new Properties();
try {
InputStream instream=pluginClass.getClassLoader().getResourceAsStream(propsPath);
if (instream != null) {
props.load(instream);
}
else {
System.err.println("Unable to read properties from file " + propsPath + ". The "+ pluginClass.getName()+ " plugin may not run correctly.");
}
}
catch ( IOException iox) {
System.err.println("Unable to read properties from file " + propsPath + ". The "+ pluginClass.getName()+ " plugin may not run correctly.");
iox.printStackTrace();
}
}
|
Create an instance by reading in the properties file associated with the plugin class. If there is a failure while reading the file, then fail silently and output an error message.
|
public StressFactor(){
super(Options.set,"Stress Factor","Force a collection after this much allocation",Integer.MAX_VALUE >>> LOG_BYTES_IN_PAGE);
}
|
Create the option, defaulting to the maximum possible value.
|
public boolean isSpurious(int minClSize){
return children.isEmpty() && members.size() < minClSize;
}
|
Test if a cluster is spurious.
|
public StopWatch(final String id){
this.id=id;
}
|
Construct a new stop watch with the given id. Does not start any task.
|
protected void rolloverColumnUpdated(int oldColumn,int newColumn){
}
|
This method gets called every time when a rollover column in the table header is updated. Every look and feel that supports a rollover effect in a table header should override this method and repaint the header.
|
public void insertRegTrueOutEdge(DepGraphNode node,RegisterOperand op){
DepGraphEdge e=new DepGraphEdge(op,this,node,REG_TRUE);
this.appendOutEdge(e);
node.appendInEdge(e);
}
|
Add an out edge this node to the given node because of a register true dependence of a given operand.
|
private void processJournal() throws IOException {
deleteIfExists(journalFileTmp);
for (Iterator<Entry> i=lruEntries.values().iterator(); i.hasNext(); ) {
Entry entry=i.next();
if (entry.currentEditor == null) {
for (int t=0; t < valueCount; t++) {
size+=entry.lengths[t];
}
}
else {
entry.currentEditor=null;
for (int t=0; t < valueCount; t++) {
deleteIfExists(entry.getCleanFile(t));
deleteIfExists(entry.getDirtyFile(t));
}
i.remove();
}
}
}
|
Computes the initial size and collects garbage as a part of opening the cache. Dirty entries are assumed to be inconsistent and will be deleted.
|
private void addReachable(Node startNode,Subgraph subgraph){
Stack nodeStack=new Stack();
nodeStack.add(startNode);
while (!nodeStack.empty()) {
Node node=(Node)nodeStack.pop();
addEdges(node,nodeStack,subgraph);
}
}
|
Adds all nodes and edges reachable from this node to the subgraph. Uses an explicit stack to avoid a large depth of recursion.
|
public void destroy(){
log.fine("destroy");
}
|
Clean up resources
|
public boolean isSpinning(){
return isSpinning;
}
|
Check if the wheel is currently spinning
|
public static ANRequest.PatchRequestBuilder patch(String url){
return new ANRequest.PatchRequestBuilder(url);
}
|
Method to make PATCH request
|
@Override public void accept(ICompilationUnit sourceUnit,AccessRestriction accessRestriction){
CompilationResult unitResult=new CompilationResult(sourceUnit,this.totalUnits,this.totalUnits,this.options.maxProblemsPerUnit);
unitResult.checkSecondaryTypes=true;
try {
CompilationUnitDeclaration parsedUnit;
if (this.totalUnits < this.parseThreshold) {
parsedUnit=this.parser.parse(sourceUnit,unitResult);
}
else {
parsedUnit=this.parser.dietParse(sourceUnit,unitResult);
}
parsedUnit.bits|=ASTNode.IsImplicitUnit;
this.lookupEnvironment.buildTypeBindings(parsedUnit,accessRestriction);
addCompilationUnit(sourceUnit,parsedUnit);
this.lookupEnvironment.completeTypeBindings(parsedUnit);
}
catch ( AbortCompilationUnit e) {
if (unitResult.compilationUnit == sourceUnit) {
this.requestor.acceptResult(unitResult.tagAsAccepted());
}
else {
throw e;
}
}
}
|
Add an additional compilation unit into the loop -> build compilation unit declarations, their bindings and record their results.
|
public static String separatorsToUnix(String path){
if (path == null || path.indexOf(WINDOWS_SEPARATOR) == -1) {
return path;
}
return path.replace(WINDOWS_SEPARATOR,UNIX_SEPARATOR);
}
|
Converts all separators to the Unix separator of forward slash.
|
@BeforeClass protected void init(){
this.gitlabUrl=this.gitlabUrlParser.parse("https://gitlab.com/eclipse/che");
assertNotNull(this.gitlabUrl);
}
|
Setup objects/
|
public int nextNode(){
if (m_foundLast) return DTM.NULL;
if (DTM.NULL == m_lastFetched) {
resetProximityPositions();
}
int next;
org.apache.xpath.VariableStack vars;
int savedStart;
if (-1 != m_stackFrame) {
vars=m_execContext.getVarStack();
savedStart=vars.getStackFrame();
vars.setStackFrame(m_stackFrame);
}
else {
vars=null;
savedStart=0;
}
try {
do {
if (0 == m_extendedTypeID) {
next=m_lastFetched=(DTM.NULL == m_lastFetched) ? m_traverser.first(m_context) : m_traverser.next(m_context,m_lastFetched);
}
else {
next=m_lastFetched=(DTM.NULL == m_lastFetched) ? m_traverser.first(m_context,m_extendedTypeID) : m_traverser.next(m_context,m_lastFetched,m_extendedTypeID);
}
if (DTM.NULL != next) {
if (DTMIterator.FILTER_ACCEPT == acceptNode(next)) break;
else continue;
}
else break;
}
while (next != DTM.NULL);
if (DTM.NULL != next) {
m_pos++;
return next;
}
else {
m_foundLast=true;
return DTM.NULL;
}
}
finally {
if (-1 != m_stackFrame) {
vars.setStackFrame(savedStart);
}
}
}
|
Returns the next node in the set and advances the position of the iterator in the set. After a NodeIterator is created, the first call to nextNode() returns the first node in the set.
|
public Object clone(){
try {
OutputProperties cloned=(OutputProperties)super.clone();
cloned.m_properties=(Properties)cloned.m_properties.clone();
return cloned;
}
catch ( CloneNotSupportedException e) {
return null;
}
}
|
Clone this OutputProperties, including a clone of the wrapped Properties reference.
|
private JsonWriter open(JsonScope empty,String openBracket) throws IOException {
beforeValue(true);
stack.add(empty);
out.write(openBracket);
return this;
}
|
Enters a new scope by appending any necessary whitespace and the given bracket.
|
@SuppressWarnings("unchecked") public Map<String,Object> decodeDetails(final byte[] data){
final VersionedDecoder decoder=new VersionedDecoder(data,typeInfos);
return (Map<String,Object>)decoder.instance(gameDetailsTypeid);
}
|
Decodes the replay details data.
|
public static void main(String[] args){
try {
Stemming.useStemmer(new LovinsStemmer(),args);
}
catch ( Exception e) {
e.printStackTrace();
}
}
|
Runs the stemmer with the given options
|
private void initCache(){
lruCacheMap=new LinkedHashMap<String,Cacheable>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE,1.0f,true);
}
|
initialize lru cache
|
public Query copy(){
Query query=new Query(queryString);
query.parameters.putAll(parameters);
query.firstResult=firstResult;
query.maxResults=maxResults;
query.cacheable=cacheable;
return query;
}
|
Creates a copy of this Query instance.
|
protected Boolean visitUnionSubtype(AnnotatedUnionType subtype,AnnotatedTypeMirror supertype,VisitHistory visited){
return areAllSubtypes(subtype.getAlternatives(),supertype,visited);
}
|
A union type is a subtype if ALL of its alternatives are subtypes of supertype
|
public NAPTRRecord(Name name,int dclass,long ttl,int order,int preference,String flags,String service,String regexp,Name replacement){
super(name,Type.NAPTR,dclass,ttl);
this.order=checkU16("order",order);
this.preference=checkU16("preference",preference);
try {
this.flags=byteArrayFromString(flags);
this.service=byteArrayFromString(service);
this.regexp=byteArrayFromString(regexp);
}
catch ( TextParseException e) {
throw new IllegalArgumentException(e.getMessage());
}
this.replacement=checkName("replacement",replacement);
}
|
Creates an NAPTR Record from the given data
|
protected static boolean convertToType(TInstance type){
TClass tclass=TInstance.tClass(type);
return ((tclass.getClass() == MNumeric.class) || (tclass == AkBool.INSTANCE));
}
|
If the type's internal representation corresponds to a Java type for which there is standard YAML tag, can use it. Otherwise, must resort to string, either because the internal value isn't friendly (<code>Date</code> is a <code>Long</code>) or isn't standard (<code>Decimal</code> turns into <code>!!float</code>).
|
@DSComment("Method returns IO Object") @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:56:57.589 -0500",hash_original_method="10F29762DE0104F8A39064501FA4AE67",hash_generated_method="AA1E1902CBC1C56C3259D6D39450828D") public static ReadableByteChannel newChannel(InputStream inputStream){
return new InputStreamChannel(inputStream);
}
|
Returns a readable channel on the given input stream. The resulting channel has the following properties: <ul> <li>If the channel is closed, then the underlying stream is closed as well.</li> <li>It is not buffered.</li> </ul>
|
public byte[] toByteArray(){
BaggageMessage message=buildMessage();
return message == null ? ArrayUtils.EMPTY_BYTE_ARRAY : message.toByteArray();
}
|
Construct a BaggageMessage protobuf message and serialize it to a byte array. If this baggage is empty, an empty byte array will be returned
|
@Override public boolean isRowAvailable(){
return list != null && index >= 0 && index < list.size();
}
|
<p>Return a flag indicating whether there is <code>rowData</code> available at the current <code>rowIndex</code>. If no <code>wrappedData</code> is available, return <code>false</code>.</p>
|
public PutIndexTemplateRequestBuilder addMapping(String type,Map<String,Object> source){
request.mapping(type,source);
return this;
}
|
Adds mapping that will be added when the index gets created.
|
public TagDispatcherBuilder enableBroadcomWorkaround(boolean enableBroadcomWorkaround){
this.enableBroadcomWorkaround=enableBroadcomWorkaround;
return this;
}
|
Delays presence check. <p> Delays presence check, that on Broadcom chips uses an APDU that resets the tag. See <a href="https://code.google.com/p/android/issues/detail?id=58773">issue on Google Code.</a>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.