code
stringlengths 10
174k
| nl
stringlengths 3
129k
|
|---|---|
@Inject(method="genTerrainBlocks(Lnet/minecraft/world/World;Ljava/util/Random;Lnet/minecraft/world/chunk/ChunkPrimer;IID)V",at=@At("HEAD"),cancellable=true) public void genTerrainBlocks(World world,Random rand,ChunkPrimer chunk,int x,int z,double stoneNoise,CallbackInfo ci){
ci.cancel();
}
|
Cancel the call to place the terrain blocks as this is instead handled through our custom genpop.
|
private ActionErrors comprobarDuplicados(GestionDescripcionBI descripcionService,HttpServletRequest request,ActionErrors errors,AreaVO areaVO,String guid){
if (errors == null) {
errors=new ActionErrors();
}
comprobarExistenciaRegistroByKey(request,errors,ArchivoModules.DESCRIPCION_MODULE,ArchivoTables.ADAREA_TABLE,guid,LABEL_AREA,Constants.ETIQUETA_GUID);
comprobarExistenciaRegistroByValue(request,errors,ArchivoModules.DESCRIPCION_MODULE,ArchivoTables.ADAREA_TABLE,areaVO.getId(),areaVO.getNombre(),LABEL_AREA,Constants.ETIQUETA_NOMBRE);
return errors;
}
|
Comprueba que no existan duplicados en la base de datos.
|
public boolean isAfter(Year other){
return year > other.year;
}
|
Checks if this year is after the specified year.
|
protected void paintLoc(Graphics2D g2,String loc){
Map map=getMapEnv().getMap();
Point2D pt=map.getPosition(loc);
if (pt != null) {
int x=x(pt);
int y=y(pt);
String info="";
List<String> track=new ArrayList<String>();
if (!env.getAgents().isEmpty()) track=getTrack(env.getAgents().get(0));
ArrayList<Integer> list=new ArrayList<Integer>();
for (int i=0; i < track.size(); i++) if (track.get(i).equals(loc)) list.add(i + 1);
if (!list.isEmpty()) info=list.toString();
if (scenario != null && scenario.getInitAgentLocation().equals(loc)) {
g2.setColor(Color.red);
g2.fillOval(x - 7,y - 7,14,14);
}
if (getAgentLocs().contains(loc)) {
g2.setColor(Color.red);
g2.fillOval(x - 4,y - 4,8,8);
}
if (destinations != null && destinations.contains(loc)) g2.setColor(Color.green);
else if (track.contains(loc)) g2.setColor(Color.black);
else g2.setColor(Color.gray);
g2.drawString(loc + info,x,y);
}
}
|
Displays a map location.
|
public void init(Properties prop,Index<String> featureIndex,AlignmentTemplates alTemps){
this.prop=prop;
this.featureIndex=featureIndex;
this.alTemps=alTemps;
}
|
Initialize variables possibly needed by feature extractors.
|
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 13:01:58.296 -0500",hash_original_method="50F0E936640865FC69642EB9E9B7DACD",hash_generated_method="0108B88B4CBED651CB8E96F68E07A12C") public FactoryConfigurationError(Exception e){
super(e.toString());
this.exception=e;
}
|
Create a new <code>FactoryConfigurationError</code> with a given <code>Exception</code> base cause of the error.
|
public MarkerDescription(String type,Map attributes,IResource resource){
this.type=type;
this.attributes=attributes;
this.resource=resource;
}
|
Create a marker description from the specified marker type, attributes, and resource.
|
public void testGetSubjectDN(){
if (this.cert == null) {
return;
}
assertEquals("The subject DN is not correct.",tbt_cert.getSubjectDN(),cert.getSubjectDN());
}
|
getSubjectDN() method testing.
|
public void onTerminate(){
sContext.unregisterReceiver(mModel);
final LauncherAppsCompat launcherApps=LauncherAppsCompat.getInstance(sContext);
launcherApps.removeOnAppsChangedCallback(mModel);
PackageInstallerCompat.getInstance(sContext).onStop();
}
|
Call from Application.onTerminate(), which is not guaranteed to ever be called.
|
static void resetRoundingParams(Rounded rounded){
rounded.setCircle(false);
rounded.setRadius(0);
rounded.setBorder(Color.TRANSPARENT,0);
rounded.setPadding(0);
}
|
Resets the rounding params on the specified rounded drawable, so that no rounding occurs.
|
@Override public void postProcess() throws Exception {
m_ResultListener.postProcess(this);
if (m_debugOutput) {
if (m_ZipDest != null) {
m_ZipDest.finished();
m_ZipDest=null;
}
}
}
|
Perform any postprocessing. When this method is called, it indicates that no more requests to generate results for the current experiment will be sent.
|
@Override public void delete(InternalLog log) throws IOException {
final byte[] rowkey=RowkeyHelper.getRowkey(log);
final Delete delete=createDelete(rowkey);
tbl.delete(delete);
}
|
support delete by constructing a rowkey or by encoded rowkey passed from client
|
protected void didAdjustTree(){
}
|
Messaged when this node either expands or collapses.
|
public static void writeStringToFile(File file,String data,String encoding,boolean append) throws IOException {
OutputStream out=null;
try {
out=openOutputStream(file,append);
IOUtils.write(data,out,encoding);
}
finally {
IOUtils.closeQuietly(out);
}
}
|
Writes a String to a file creating the file if it does not exist.
|
public void dispose(){
clearChildContexts();
synchronized (eventListenerSet) {
Iterator iter=eventListenerSet.iterator();
while (iter.hasNext()) {
EventListenerMememto m=(EventListenerMememto)iter.next();
NodeEventTarget et=m.getTarget();
EventListener el=m.getListener();
boolean uc=m.getUseCapture();
String t=m.getEventType();
boolean in=m.getNamespaced();
if (et == null || el == null || t == null) {
continue;
}
if (m instanceof ImplementationEventListenerMememto) {
String ns=m.getNamespaceURI();
Node nde=(Node)et;
AbstractNode n=(AbstractNode)nde.getOwnerDocument();
if (n != null) {
XBLEventSupport es;
es=(XBLEventSupport)n.initializeEventSupport();
es.removeImplementationEventListenerNS(ns,t,el,uc);
}
}
else if (in) {
String ns=m.getNamespaceURI();
et.removeEventListenerNS(ns,t,el,uc);
}
else {
et.removeEventListener(t,el,uc);
}
}
}
if (document != null) {
removeDOMListeners();
removeBindingListener();
}
if (animationEngine != null) {
animationEngine.dispose();
animationEngine=null;
}
Iterator iter=interpreterMap.values().iterator();
while (iter.hasNext()) {
Interpreter interpreter=(Interpreter)iter.next();
if (interpreter != null) interpreter.dispose();
}
interpreterMap.clear();
if (focusManager != null) {
focusManager.dispose();
}
}
|
Disposes this BridgeContext.
|
@Override public boolean isTraceOnConsole(){
return super.getBooleanPreferencesValue(TypeScriptCorePreferenceConstants.TSSERVER_TRACE_ON_CONSOLE,false);
}
|
Returns true if JSON request/response can be traced inside Eclipse console and false otherwise.
|
@Override protected void extendSignatureTag() throws DSSException {
super.extendSignatureTag();
if (xadesSignature.hasLTAProfile()) {
checkSignatureIntegrity();
final ValidationContext validationContext=xadesSignature.getSignatureValidationContext(certificateVerifier);
removeLastTimestampValidationData();
incorporateTimestampValidationData(validationContext);
}
incorporateArchiveTimestamp();
}
|
Adds the ArchiveTimeStamp element which is an unsigned property qualifying the signature. The hash sent to the TSA (messageImprint) is computed on the XAdES-LT form of the electronic signature and the signed data objects.<br> A XAdES-LTA form MAY contain several ArchiveTimeStamp elements.
|
public static void showConsole(@NotNull final ConsoleView consoleView,@Nullable final JComponent actionListenerComponent,@NotNull final String title,@NotNull final Project project,@Nullable final Collection<Runnable> closeListeners,@NotNull final AnAction... customActions){
final AnAction[] actions=ArrayUtil.mergeArrays(customActions,consoleView.createConsoleActions());
show(consoleView.getComponent(),actionListenerComponent,title,project,closeListeners,actions);
}
|
Displays console in the toolwindow
|
public void destroy() throws Exception {
this.bootstrap.group().shutdownGracefully().sync();
this.bootstrap.childGroup().shutdownGracefully().sync();
DefaultServer.LOGGER.warn("Server shutdown ... ");
}
|
For Spring
|
public long numberOfParts(){
return numberOfParts;
}
|
Returns number of parts
|
public Sector union(Sector sector){
if (sector == null) {
throw new IllegalArgumentException(Logger.logMessage(Logger.ERROR,"Sector","union","missingSector"));
}
if ((sector.minLatitude < sector.maxLatitude) && (sector.minLongitude < sector.maxLongitude)) {
if ((this.minLatitude < this.maxLatitude) && (this.minLongitude < this.maxLongitude)) {
if (this.minLatitude > sector.minLatitude) this.minLatitude=sector.minLatitude;
if (this.maxLatitude < sector.maxLatitude) this.maxLatitude=sector.maxLatitude;
if (this.minLongitude > sector.minLongitude) this.minLongitude=sector.minLongitude;
if (this.maxLongitude < sector.maxLongitude) this.maxLongitude=sector.maxLongitude;
}
else {
this.minLatitude=sector.minLatitude;
this.maxLatitude=sector.maxLatitude;
this.minLongitude=sector.minLongitude;
this.maxLongitude=sector.maxLongitude;
}
}
return this;
}
|
Sets this sector to the union of itself and a specified sector. This has no effect if the specified sector is empty. If this sector is empty, it is set to the specified sector.
|
@Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs){
switch (eContainerFeatureID()) {
case DomPackage.LINE_TAG__DOCLET:
return eInternalContainer().eInverseRemove(this,DomPackage.DOCLET__LINE_TAGS,Doclet.class,msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public static byte[] excelFrom(List<Issue> issueList) throws WriteException, IOException {
WritableWorkbook workbook;
WritableSheet sheet;
WritableFont wf1=new WritableFont(WritableFont.TIMES,13,WritableFont.BOLD,false,UnderlineStyle.SINGLE,Colour.BLUE_GREY,ScriptStyle.NORMAL_SCRIPT);
WritableCellFormat cf1=new WritableCellFormat(wf1);
cf1.setBorder(Border.ALL,BorderLineStyle.DOUBLE);
cf1.setAlignment(Alignment.CENTRE);
WritableFont wf2=new WritableFont(WritableFont.TAHOMA,11,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLACK,ScriptStyle.NORMAL_SCRIPT);
WritableCellFormat cf2=new WritableCellFormat(wf2);
cf2.setShrinkToFit(true);
cf2.setBorder(Border.ALL,BorderLineStyle.THIN);
cf2.setAlignment(Alignment.CENTRE);
DateFormat valueFormatDate=new DateFormat("yyyy-MM-dd HH:mm:ss");
WritableCellFormat cfDate=new WritableCellFormat(valueFormatDate);
cfDate.setFont(wf2);
cfDate.setShrinkToFit(true);
cfDate.setBorder(Border.ALL,BorderLineStyle.THIN);
cfDate.setAlignment(Alignment.CENTRE);
ByteArrayOutputStream bos=new ByteArrayOutputStream();
workbook=Workbook.createWorkbook(bos);
sheet=workbook.createSheet(String.valueOf(JodaDateUtil.today().getTime()),0);
String[] labalArr={"ID","STATE","TITLE","ASSIGNEE","DATE"};
for (int i=0; i < labalArr.length; i++) {
sheet.addCell(new jxl.write.Label(i,0,labalArr[i],cf1));
sheet.setColumnView(i,20);
}
for (int i=1; i < issueList.size() + 1; i++) {
Issue issue=issueList.get(i - 1);
int colcnt=0;
sheet.addCell(new jxl.write.Label(colcnt++,i,issue.id.toString(),cf2));
sheet.addCell(new jxl.write.Label(colcnt++,i,issue.state.toString(),cf2));
sheet.addCell(new jxl.write.Label(colcnt++,i,issue.title,cf2));
sheet.addCell(new jxl.write.Label(colcnt++,i,getAssigneeName(issue.assignee),cf2));
sheet.addCell(new jxl.write.DateTime(colcnt++,i,issue.createdDate,cfDate));
}
workbook.write();
try {
workbook.close();
}
catch ( WriteException e) {
e.printStackTrace();
}
catch ( IOException e) {
e.printStackTrace();
}
return bos.toByteArray();
}
|
Generate a Microsoft Excel file in byte array from the given issue list, using JXL.
|
public LoggingScriptCommand(Configuration configuration,String resourcePath){
super(configuration,resourcePath);
}
|
Sets configuration containing all needed information for building configuration scripts.
|
public GraphicsNode lastChild(){
GraphicsNode result=getLastChild(currentNode);
if (result != null) {
currentNode=result;
}
return result;
}
|
Returns the last child of the current <tt>GraphicsNode</tt>. If the current graphics node does not have a last child, returns null and retains the current node.
|
private void updateProgress(int progress){
if (myHost != null) {
myHost.updateProgress(progress);
}
else {
System.out.println("Progress: " + progress + "%");
}
}
|
Used to communicate a progress update between a plugin tool and the main Whitebox user interface.
|
public DAddExtensions(JFrame parent,String title,X509ExtensionSet extensions,PublicKey authorityPublicKey,X500Name authorityCertName,BigInteger authorityCertSerialNumber,PublicKey subjectPublicKey){
super(parent,Dialog.ModalityType.DOCUMENT_MODAL);
setTitle(res.getString("DAddExtensions.Title"));
this.extensions=extensions;
this.authorityPublicKey=authorityPublicKey;
this.authorityCertName=authorityCertName;
this.authorityCertSerialNumber=authorityCertSerialNumber;
this.subjectPublicKey=subjectPublicKey;
initComponents();
}
|
Creates a new DAddExtensions dialog.
|
private void addFreightPop(Population populationOut){
File freightPlansFile=new File(outputDir + "plans/freight_plans.xml.gz");
if (!freightPlansFile.exists()) {
log.warn("Freight population file not found under " + freightPlansFile + "; no freight population added.");
}
else {
log.info("Adding freight population to O-D based population");
Scenario scenarioFreight=ScenarioUtils.createScenario(ConfigUtils.createConfig());
new PopulationReader(scenarioFreight).readFile(freightPlansFile.toString());
for ( Person person : scenarioFreight.getPopulation().getPersons().values()) {
populationOut.addPerson(person);
}
}
}
|
Freight traffic will only be added to population if file exists. Otherwise do nothing.
|
public void shortHorn(){
VSDSound snd=sound_list.get("HORN");
snd.play();
}
|
Turn the horn sound on (Short burst)
|
public TestableVisionOpMode(){
super(false);
}
|
Creates the Testable OpMode.
|
public void trainSystem(int system,String savename) throws IOException {
switch (system) {
case 0:
SentimentSystemNRC nrcSystem=new SentimentSystemNRC(tweetList);
nrcSystem.train(savename);
break;
case 1:
SentimentSystemGUMLTLT gumltltSystem=new SentimentSystemGUMLTLT(tweetList);
gumltltSystem.train(savename);
break;
case 2:
SentimentSystemKLUE klueSystem=new SentimentSystemKLUE(tweetList);
klueSystem.train(savename);
break;
default :
throw new IllegalArgumentException("Invalid system: " + system);
}
}
|
Trains a specific system
|
public BreakpointHitReply(final int packetId,final int errorCode,final long tid,final RegisterValues registerValues){
super(packetId,errorCode,tid,registerValues);
}
|
Creates a new breakpoint hit reply object.
|
public final void appendPhase(BasePhase<? super C> phase){
phases.add(phase);
}
|
Add a new phase at the end of this suite.
|
private synchronized void syncUsers(){
try {
users.clear();
users.addAll(provider.loadUsers());
}
catch ( final CouldntLoadDataException exception) {
CUtilityFunctions.logException(exception);
}
}
|
Synchronizes the internal list of known users with the list of known users in the database.
|
public static String toString(final BigDecimal value){
return value.toString();
}
|
Converts the given value to the XML string value.
|
public LabelledStatement createLabelledStatement(){
LabelledStatementImpl labelledStatement=new LabelledStatementImpl();
return labelledStatement;
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public void updateHostIOLimitIOPs(WBEMClient client,CIMObjectPath storageGroupPath,Integer hostIOLimitIOPs) throws WBEMException {
if (hostIOLimitIOPs == null) {
return;
}
_log.info("Attempting to update Host IO Limit IOPs for Storage Group : {} to {}",storageGroupPath.toString(),hostIOLimitIOPs);
CIMPropertyFactory factoryRef=(CIMPropertyFactory)ControllerServiceImpl.getBean("CIMPropertyFactory");
CIMInstance toUpdate=new CIMInstance(storageGroupPath,new CIMProperty[]{factoryRef.uint32(EMC_MAX_IO,hostIOLimitIOPs)});
_log.debug("Params: " + toUpdate.toString());
client.modifyInstance(toUpdate,new String[]{EMC_MAX_IO});
}
|
Set storage group host io limit iops
|
private File subFolder(String subFolder){
try {
return getBrokerInstance().toPath().resolve(subFolder).toFile();
}
catch ( Exception e) {
throw new RuntimeException(e);
}
}
|
It will find the right location of a subFolder, related to artemisInstance
|
public SlotWindow(String title,int width,int height){
super(title,title);
content=new SlotGrid(width,height);
setContent(content);
}
|
Create a new EntityContainer.
|
public void blockDestroy(GlowPlayer player,GlowBlock block,BlockFace face){
}
|
Called when a player attempts to destroy a block.
|
@Override public ImmutableListMultimap<K,V> build(){
return (ImmutableListMultimap<K,V>)super.build();
}
|
Returns a newly-created immutable multimap.
|
private boolean isVolumeNameTaken(String name){
return !BlockStorageUtils.getVolumeByName(name).isEmpty();
}
|
Determines if the given volume name is already taken.
|
@SuppressWarnings("unchecked") @Override public void eSet(int featureID,Object newValue){
switch (featureID) {
case UmplePackage.ANONYMOUS_ENTRY_OR_EXIT_ACTION_1__CODE_LANG_1:
getCodeLang_1().clear();
getCodeLang_1().addAll((Collection<? extends CodeLang_>)newValue);
return;
case UmplePackage.ANONYMOUS_ENTRY_OR_EXIT_ACTION_1__CODE_LANGS_1:
getCodeLangs_1().clear();
getCodeLangs_1().addAll((Collection<? extends CodeLangs_>)newValue);
return;
}
super.eSet(featureID,newValue);
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public final void addAttribute(String uri,String local,String qname,String type,String val){
int index=super.getLength();
super.addAttribute(uri,local,qname,type,val);
if (index < MAXMinus1) {
return;
}
else if (index == MAXMinus1) {
switchOverToHash(MAX);
}
else {
Integer i=new Integer(index);
m_indexFromQName.put(qname,i);
m_buff.setLength(0);
m_buff.append('{').append(uri).append('}').append(local);
String key=m_buff.toString();
m_indexFromQName.put(key,i);
}
return;
}
|
This method adds the attribute, but also records its qName/index pair in the hashtable for fast lookup by getIndex(qName).
|
private void reportAbuse(final String selectedWallId){
ReportAbuseRequestModel reportAbuseRequestModel=new ReportAbuseRequestModel();
reportAbuseRequestModel.setType(AppConstants.TYPE);
reportAbuseRequestModel.setId(selectedWallId);
RetroCallback retroCallback;
retroCallback=new RetroCallback(this);
retroCallback.setRequestId(HttpConstants.ApiResponseCodes.REPORT_ABUSE);
retroCallbackList.add(retroCallback);
mYeloApi.reportAbuse(reportAbuseRequestModel,retroCallback);
}
|
Report abuse
|
private void initialize(){
this.setSize(750,584);
}
|
This method initializes this
|
public String valueOf(int i){
return Integer.toString(i);
}
|
Returns the string representation of the <code>int</code> argument. <p> The representation is exactly the one returned by the <code>Integer.toString</code> method of one argument.
|
public static void scanThread(RVMThread thread,TraceLocal trace,boolean processCodeLocations,boolean newRootsSufficient){
if (DEFAULT_VERBOSITY >= 1) {
VM.sysWriteln("scanning ",thread.getThreadSlot());
}
AbstractRegisters regs=thread.getContextRegisters();
Address gprs=Magic.objectAsAddress(regs.getGPRs());
Address ip=regs.getInnermostInstructionAddress();
Address fp=regs.getInnermostFramePointer();
regs.clear();
regs.setInnermost(ip,fp);
scanThread(thread,trace,processCodeLocations,gprs,Address.zero(),newRootsSufficient);
}
|
Scan a thread, placing the addresses of pointers into supplied buffers.
|
public ConfirmPanel(boolean withCancelButton,boolean withRefreshButton,boolean withResetButton,boolean withCustomizeButton,boolean withHistoryButton,boolean withZoomButton,boolean withText){
super();
BorderLayout mainLayout=new BorderLayout();
this.setLayout(mainLayout);
this.setName("confirmPanel");
CPanel okCancel=new CPanel(new FlowLayout(FlowLayout.RIGHT));
okCancel.setOpaque(false);
bCancel=createCancelButton(withText);
okCancel.add(bCancel);
bOK=createOKButton(withText);
okCancel.add(bOK);
setCancelVisible(withCancelButton);
this.add(okCancel,BorderLayout.EAST);
if (withRefreshButton) {
bRefresh=createRefreshButton(withText);
addComponent(bRefresh);
}
if (withResetButton) {
bReset=createResetButton(withText);
addComponent(bReset);
}
if (withCustomizeButton) {
bCustomize=createCustomizeButton(withText);
addComponent(bCustomize);
}
if (withHistoryButton) {
bHistory=createHistoryButton(withText);
addComponent(bHistory);
}
if (withZoomButton) {
bZoom=createZoomButton(withText);
addComponent(bZoom);
}
}
|
Create Confirmation Panel with different buttons
|
public void rotateLeft(int places,int startIndex,int endIndex){
for (int x=0; x < places; x++) {
rotateLeft(startIndex,endIndex);
}
}
|
Left rotates the bits between start and end indices, number of places.
|
public static void generateRPClass(){
final RPClass rpclass=new RPClass(Events.IMAGE);
rpclass.addAttribute(IMAGE_ATTR,Type.STRING);
rpclass.addAttribute(ATTACH_ATTR,Type.FLAG);
rpclass.addAttribute(X_ATTR,Type.INT);
rpclass.addAttribute(Y_ATTR,Type.FLAG);
}
|
Creates the rpclass.
|
public DataSourceManager(){
}
|
Creates a new instance.
|
static boolean contains(Object enumValue,Object[] expectedValues){
for ( final Object expected : expectedValues) {
if (enumValue.equals(expected)) {
return true;
}
}
return false;
}
|
Does expectedValues contain enumValue. This is just a linear search.
|
public void scale(double scale,Component comp){
setImage(mDefaultImage);
_scale=scale;
if (Math.abs(scale - 1.0) > .00001) {
_transformS=AffineTransform.getScaleInstance(scale,scale);
}
rotate(_deg,comp);
}
|
Scale as a percentage
|
public boolean isRelative(){
if (relative == null) {
return false;
}
else {
return relative;
}
}
|
Gets the value of the relative property.
|
public void copyFrom(BlockType other){
this.isValid=other.isValid;
this.isTop=other.isTop;
if (isValid) {
this.depth=other.depth;
this.clear();
this.or(other);
}
}
|
Make this object an exact duplicate of given object.
|
@Override public int eDerivedStructuralFeatureID(int baseFeatureID,Class<?> baseClass){
if (baseClass == ScriptElement.class) {
switch (baseFeatureID) {
default :
return -1;
}
}
if (baseClass == AnnotableScriptElement.class) {
switch (baseFeatureID) {
case N4JSPackage.ANNOTABLE_SCRIPT_ELEMENT__ANNOTATION_LIST:
return N4JSPackage.N4_TYPE_DECLARATION__ANNOTATION_LIST;
default :
return -1;
}
}
if (baseClass == ModifiableElement.class) {
switch (baseFeatureID) {
case N4JSPackage.MODIFIABLE_ELEMENT__DECLARED_MODIFIERS:
return N4JSPackage.N4_TYPE_DECLARATION__DECLARED_MODIFIERS;
default :
return -1;
}
}
if (baseClass == ExportableElement.class) {
switch (baseFeatureID) {
default :
return -1;
}
}
if (baseClass == NamedElement.class) {
switch (baseFeatureID) {
default :
return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID,baseClass);
}
|
<!-- begin-user-doc --> <!-- end-user-doc -->
|
public int oom_adj() throws IOException {
return Integer.parseInt(read("oom_adj"));
}
|
<p>/proc/[pid]/oom_adj (since Linux 2.6.11)</p> <p>This file can be used to adjust the score used to select which process should be killed in an out-of-memory (OOM) situation. The kernel uses this value for a bit-shift operation of the process's oom_score value: valid values are in the* range -16 to +15, plus the special value -17, which disables OOM-killing altogether for this process. A positive score increases the likelihood of this process being killed by the OOM-killer; a negative score decreases the likelihood.</p> <p>The default value for this file is 0; a new process inherits its parent's oom_adj setting. A process must be privileged (CAP_SYS_RESOURCE) to update this file.</p> <p>Since Linux 2.6.36, use of this file is deprecated in favor of /proc/[pid]/oom_score_adj.</p>
|
LoadedClass(String name,boolean systemClass){
this.name=name;
this.systemClass=systemClass;
}
|
Constructs a new class.
|
@CheckReturnValue public ThreadFactory build(){
return build(this);
}
|
Returns a new thread factory using the options supplied during the building process. After building, it is still possible to change the options used to build the ThreadFactory and/or build again. State is not shared amongst built instances.
|
public boolean equals(Object object){
return (super.equals(object) && object instanceof OutputDeviceAssigned);
}
|
Returns whether this output device assigned attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true: <OL TYPE=1> <LI> <CODE>object</CODE> is not null. <LI> <CODE>object</CODE> is an instance of class OutputDeviceAssigned. <LI> This output device assigned attribute's underlying string and <CODE>object</CODE>'s underlying string are equal. <LI> This output device assigned attribute's locale and <CODE>object</CODE>'s locale are equal. </OL>
|
@Override public void registerOutParameter(String parameterName,int sqlType,String typeName) throws SQLException {
registerOutParameter(getIndexForName(parameterName),sqlType,typeName);
}
|
Registers the given OUT parameter.
|
private final void updateHeap(final double distance,final int iid){
final double prevdist=kdist;
final int previd=heap.peekValue();
heap.replaceTopElement(distance,iid);
kdist=heap.peekKey();
if (kdist < prevdist) {
numties=0;
}
else {
addToTies(previd);
}
}
|
Do a full update for the heap.
|
public boolean isMetaphoneEqual(String str1,String str2){
return metaphone(str1).equals(metaphone(str2));
}
|
Tests is the metaphones of two strings are identical.
|
public void defineDictionary(String name,Map<String,Object> mapping){
dictionaries.put(name,mapping);
}
|
Define a map for this group. <p> Not thread safe...do not keep adding these while you reference them.</p>
|
private synchronized void saveTokenKeysBundle(String vdcID,TokenKeysBundle bundle){
InterProcessLock tokenBundleLock=null;
try {
tokenBundleLock=coordinator.getLock(FOREIGN_TOKEN_BUNDLE_CONFIG_LOCK);
if (tokenBundleLock == null) {
log.error("Could not acquire lock for tokenkeys bundle caching");
throw SecurityException.fatals.couldNotAcquireLockTokenCaching();
}
tokenBundleLock.acquire();
Configuration config=coordinator.queryConfiguration(FOREIGN_TOKEN_KEYS_BUNDLE_CONFIG,FOREIGN_TOKEN_KEYS_BUNDLE_KEYID);
ConfigurationImpl configImpl=null;
if (config == null) {
configImpl=new ConfigurationImpl();
configImpl.setId(FOREIGN_TOKEN_KEYS_BUNDLE_KEYID);
configImpl.setKind(FOREIGN_TOKEN_KEYS_BUNDLE_CONFIG);
log.debug("Creating new foreign tokens config");
}
else {
configImpl=(ConfigurationImpl)config;
log.debug("Updating existing foreign token config");
}
configImpl.setConfig(vdcID,SerializerUtils.serializeAsBase64EncodedString(bundle));
coordinator.persistServiceConfiguration(configImpl);
foreignTokenKeysMap.put(vdcID,bundle);
}
catch ( Exception ex) {
log.error("Could not acquire lock while trying to cache tokenkeys bundle.",ex);
}
finally {
try {
if (tokenBundleLock != null) {
tokenBundleLock.release();
}
}
catch ( Exception ex) {
log.error("Unable to release token keys bundle caching lock",ex);
}
}
}
|
Stores the token key bundle in cache (zookeeper path based on vdcid) Locks on vdcid for the write.
|
private static char[] encode(final byte[] data,final char[] toDigits){
final int l=data.length;
final char[] out=new char[l << 1];
for (int i=0, j=0; i < l; i++) {
out[j++]=toDigits[(0xF0 & data[i]) >>> 4];
out[j++]=toDigits[0x0F & data[i]];
}
return out;
}
|
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order. The returned array will be double the length of the passed array, as it takes two characters to represent any given byte.
|
private void packAllMassnahmeColumns(){
imageColumnMassnahme.pack();
numberColumnMassnahme.pack();
nameColumnMassnahme.pack();
}
|
Adjusts all columns of the TableViewer.
|
public FastCharBuffer append(CharSequence csq,int start,int end){
for (int i=start; i < end; i++) {
append(csq.charAt(i));
}
return this;
}
|
Appends character sequence to buffer.
|
public VMwareStorage addStorage(String host,List<DynamicProperty> properties){
if (properties == null || properties.size() == 0) {
return null;
}
VMwareStorage result=new VMwareStorage();
for ( DynamicProperty dp : properties) {
String key=dp.getName();
if ("summary.name".equals(key) && dp.getVal() != null) {
result.setName(dp.getVal().toString());
}
else if ("summary.capacity".equals(key) && dp.getVal() != null) {
result.setCapacity(VMwareValue.fromBytes(Long.parseLong(dp.getVal().toString())));
}
else if ("summary.freeSpace".equals(key) && dp.getVal() != null) {
result.setFreeStorage(VMwareValue.fromBytes(Long.parseLong(dp.getVal().toString())));
}
}
storages.put(result.getName(),result);
if (storageByHost.containsKey(host)) {
storageByHost.get(host).add(result);
}
else {
List<VMwareStorage> storage=new ArrayList<VMwareStorage>();
storage.add(result);
storageByHost.put(host,storage);
}
return result;
}
|
Adds a storage instance to the inventory based on given properties.
|
protected void attrRemoved(Attr node,String oldv){
}
|
Called when an attribute has been removed.
|
@Override public void receiveDecoderStateEvent(DecoderStateEvent event){
switch (event.getEvent()) {
case RESET:
resetState();
break;
default :
break;
}
}
|
Responds to reset events issued by the channel state
|
public ServerHelloDone(){
}
|
Creates outbound message
|
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:28:38.342 -0500",hash_original_method="D26DF74C9E797B538D6D01C69F8C39EB",hash_generated_method="9F23384B40E9CEBA3B49A12206B6C84E") public static void cursorIntToContentValues(Cursor cursor,String field,ContentValues values,String key){
int colIndex=cursor.getColumnIndex(field);
if (!cursor.isNull(colIndex)) {
values.put(key,cursor.getInt(colIndex));
}
else {
values.put(key,(Integer)null);
}
}
|
Reads a Integer out of a field in a Cursor and writes it to a Map.
|
private void initialize(){
this.setContinuousLayout(true);
this.setRightComponent(getJPanel1());
this.setDividerLocation(200);
this.setDividerSize(3);
this.setResizeWeight(0.3D);
this.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED));
this.setLeftComponent(getJScrollPane());
}
|
This method initializes this
|
public long size(){
return size;
}
|
Returns the number of keys defined in the map.
|
public static void mergeArrays(Object[] arr1,Object[] arr2,Object[] destinationArray){
System.arraycopy(arr1,0,destinationArray,0,arr1.length);
System.arraycopy(arr2,0,destinationArray,arr1.length,arr2.length);
}
|
Merges arrays into one larger array
|
public String toString(){
if (version == null || version.isEmpty()) {
return name;
}
return name + "/" + version;
}
|
The formatted module spec
|
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 15:01:17.723 -0400",hash_original_method="E76D6159725CEBB486CB0BAB91729041",hash_generated_method="FAD7F25542D518C23F190AC1C8A02A15") final void unsplice(Node pred,Node s){
s.forgetContents();
if (pred != null && pred != s && pred.next == s) {
Node n=s.next;
if (n == null || (n != s && pred.casNext(s,n) && pred.isMatched())) {
for (; ; ) {
Node h=head;
if (h == pred || h == s || h == null) return;
if (!h.isMatched()) break;
Node hn=h.next;
if (hn == null) return;
if (hn != h && casHead(h,hn)) h.forgetNext();
}
if (pred.next != pred && s.next != s) {
for (; ; ) {
int v=sweepVotes;
if (v < SWEEP_THRESHOLD) {
if (casSweepVotes(v,v + 1)) break;
}
else if (casSweepVotes(v,0)) {
sweep();
break;
}
}
}
}
}
}
|
Unsplices (now or later) the given deleted/cancelled node with the given predecessor.
|
public void removeAllElements(){
if (null == m_map) return;
for (int i=0; i < m_firstFree; i++) {
m_map[i]=DTM.NULL;
}
m_firstFree=0;
}
|
Inserts the specified node in this vector at the specified index. Each component in this vector with an index greater or equal to the specified index is shifted upward to have an index one greater than the value it had previously.
|
public static GroupCategorySet union(GroupCategorySet one,GroupCategorySet two){
Assert.isNotNull(one);
Assert.isNotNull(two);
if (one == two) return one;
if (one == NONE) return two;
if (two == NONE) return one;
Set combined=new HashSet();
combined.addAll(one.asList());
combined.addAll(two.asList());
return new GroupCategorySet(combined);
}
|
Creates a new group category set containing the union of the given two group category sets
|
private static void writeMutation(final Text table,final Mutation mutation,final Context context,final boolean isDelete) throws IOException, InterruptedException {
if (isDelete) {
final List<ColumnUpdate> updates=mutation.getUpdates();
final ColumnUpdate columnUpdate=updates.get(0);
final ColumnVisibility cv=columnUpdate.getColumnVisibility() != null ? new ColumnVisibility(columnUpdate.getColumnVisibility()) : null;
final Mutation deleteMutation=new Mutation(new Text(mutation.getRow()));
deleteMutation.putDelete(columnUpdate.getColumnFamily(),columnUpdate.getColumnQualifier(),cv,columnUpdate.getTimestamp());
context.write(table,deleteMutation);
}
else {
context.write(table,mutation);
}
}
|
Writes a mutation to the specified table. If the mutation is meant to delete then the mutation will be transformed to a delete mutation.
|
private boolean shouldIgnoreInputEventFromClass(String clzName){
for ( Pattern re : IGNORE_INPUT_EVENTS_IN) {
Matcher matcher=re.matcher(clzName);
if (matcher.matches()) return true;
}
return false;
}
|
Return true if the class of the input event is in the ignore list, and thus the input event should be ignored.
|
public static Type resolveVariable(TypeVariable variable,final Class implClass){
final Class rawType=getRawType(implClass,null);
int index=ArraysUtil.indexOf(rawType.getTypeParameters(),variable);
if (index >= 0) {
return variable;
}
final Class[] interfaces=rawType.getInterfaces();
final Type[] genericInterfaces=rawType.getGenericInterfaces();
for (int i=0; i <= interfaces.length; i++) {
Class rawInterface;
if (i < interfaces.length) {
rawInterface=interfaces[i];
}
else {
rawInterface=rawType.getSuperclass();
if (rawInterface == null) {
continue;
}
}
final Type resolved=resolveVariable(variable,rawInterface);
if (resolved instanceof Class || resolved instanceof ParameterizedType) {
return resolved;
}
if (resolved instanceof TypeVariable) {
final TypeVariable typeVariable=(TypeVariable)resolved;
index=ArraysUtil.indexOf(rawInterface.getTypeParameters(),typeVariable);
if (index < 0) {
throw new IllegalArgumentException("Invalid type variable:" + typeVariable);
}
final Type type=i < genericInterfaces.length ? genericInterfaces[i] : rawType.getGenericSuperclass();
if (type instanceof Class) {
return Object.class;
}
if (type instanceof ParameterizedType) {
return ((ParameterizedType)type).getActualTypeArguments()[index];
}
throw new IllegalArgumentException("Unsupported type: " + type);
}
}
return null;
}
|
Resolves <code>TypeVariable</code> with given implementation class.
|
@Override public void selectAgent(final DrawingAttributes attributes){
IAgent ag=null;
boolean withHighlight=true;
if (attributes != null) if (attributes.getSpeciesName() != null) {
withHighlight=false;
final GamaPoint pickedPoint=renderer.getIntWorldPointFromWindowPoint(renderer.camera.getLastMousePressedPosition());
ag=scope.getRoot().getPopulationFor(attributes.getSpeciesName()).getAgent(scope,new GamaPoint(pickedPoint.x,-pickedPoint.y));
}
else {
final AgentIdentifier id=attributes.getAgentIdentifier();
if (id != null) ag=id.getAgent(scope);
}
if (withHighlight) menuManager.buildMenu(renderer.camera.getMousePosition().x,renderer.camera.getMousePosition().y,ag,cleanup,AgentsMenu.HIGHLIGHT_ACTION);
else menuManager.buildMenu(renderer.camera.getMousePosition().x,renderer.camera.getMousePosition().y,ag,cleanup);
}
|
Method selectAgents()
|
public void add(Rule rule){
this.rules.add(rule);
}
|
Method add.
|
@Override public MemBufferHolder<SysMemAllocator> resizeBuffer(MemBufferHolder<SysMemAllocator> mholder,long size){
MemBufferHolder<SysMemAllocator> ret=null;
boolean ac=null != mholder.getRefId();
if (size > 0) {
int bufpos=mholder.get().position();
int buflimit=mholder.get().limit();
if (currentMemory.get() + size > maxStoreCapacity) {
if (m_activegc) {
m_bufcollector.waitReclaimCoolDown(m_gctimeout);
}
}
if (currentMemory.get() + size <= maxStoreCapacity) {
ByteBuffer buf=Utils.resizeByteBuffer(mholder.get(),size);
if (null != buf) {
mholder.clear();
mholder.destroy();
buf.position(bufpos <= size ? bufpos : 0);
buf.limit(buflimit <= size ? buflimit : (int)size);
ret=new MemBufferHolder<SysMemAllocator>(this,buf);
if (ac) {
m_bufcollector.register(ret);
}
}
}
}
return ret;
}
|
resize a specified buffer on its backed memory pool.
|
public void startSystem(){
paused=false;
for ( Module module : new ArrayList<Module>(modules)) {
try {
if (!module.isRunning()) {
module.start();
}
else {
module.pause(false);
}
}
catch ( RuntimeException e) {
log.warning("could not start module " + module.getClass().getCanonicalName() + ": "+ e);
e.printStackTrace();
modules.remove(module);
}
}
synchronized (curState) {
curState.setAsNew();
update();
}
}
|
Starts the dialogue system and its modules.
|
public static int[][] mirrorMatrixBothCoords(int[][] matrix){
int rows=matrix.length;
int cols=matrix[0].length;
int[][] mirrored=new int[rows][cols];
for (int r=0; r < rows; r++) {
for (int c=0; c < cols; c++) {
mirrored[(rows - 1) - r][(cols - 1) - c]=matrix[r][c];
}
}
return mirrored;
}
|
Mirrors the matrix in both coordinates
|
public static void restorePriorities(){
PRIORITIES=Collections.unmodifiableMap(DEFAULT_PRIORITIES);
}
|
for test only
|
public String optString(int index,String defaultValue){
Object object=this.opt(index);
return JSONObject.NULL.equals(object) ? defaultValue : object.toString();
}
|
Get the optional string associated with an index. The defaultValue is returned if the key is not found.
|
public ElideResponse post(String path,String jsonApiDocument,Object opaqueUser){
return this.post(path,jsonApiDocument,opaqueUser,SecurityMode.SECURITY_ACTIVE);
}
|
Handle POST.
|
public Dimension preferredSize(){
return getPreferredSize();
}
|
DEPRECATED: Replaced by getPreferredSize().
|
private int[][] generateImageMap(ArrayList nodes_ID){
int numOfNode=nodes_ID.size();
int rowNode_count=(int)Math.ceil((float)numOfNode / SIZE);
int rowTotal_count=2 * rowNode_count - 1;
int ROW=rowTotal_count;
int COL=2 * SIZE - 1;
int[][] imageMap=new int[ROW][COL];
boolean isEmptyRow_Right=true;
boolean isForwardRow=true;
int row_Last=ROW - 1;
int index_Row=0;
int index_Node=0;
int i, j;
for (index_Row=0; index_Row < ROW; index_Row++) {
if ((index_Row % 2) != 0) {
if (isEmptyRow_Right) {
imageMap[index_Row][COL - 1]=ARROW_DOWN;
isEmptyRow_Right=false;
}
else {
imageMap[index_Row][0]=ARROW_DOWN;
isEmptyRow_Right=true;
}
}
if ((index_Row % 2) == 0) {
if (isForwardRow) {
isForwardRow=false;
if (index_Row == row_Last) {
j=0;
for (i=index_Node; i < numOfNode; i++) {
imageMap[index_Row][j++]=((Integer)nodes_ID.get(i)).intValue();
if (i != numOfNode - 1) imageMap[index_Row][j++]=ARROW_FORWARD;
}
}
else {
for (i=0; i < COL; i++) imageMap[index_Row][i]=((i % 2 == 0) ? ((Integer)nodes_ID.get(index_Node++)).intValue() : ARROW_FORWARD);
}
}
else {
isForwardRow=true;
if (index_Row == row_Last) {
j=0;
for (i=index_Node; i < numOfNode; i++) {
imageMap[index_Row][COL - 1 - j++]=((Integer)nodes_ID.get(i)).intValue();
if (i != numOfNode - 1) imageMap[index_Row][COL - 1 - j++]=ARROW_BACKWARD;
}
}
else {
j=0;
for (i=0; i < COL; i++) {
imageMap[index_Row][COL - 1 - i]=(i % 2 == 0) ? ((Integer)nodes_ID.get(index_Node++)).intValue() : ARROW_BACKWARD;
}
}
}
}
}
return imageMap;
}
|
Generate image map array. - Generate the orientation of workflow automatically
|
public Matrix4f scaleLocal(float x,float y,float z){
return scaleLocal(x,y,z,this);
}
|
Pre-multiply scaling to this matrix by scaling the base axes by the given x, y and z factors. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>S * M</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>S * M * v</code>, the scaling will be applied last!
|
public void testHasFeatureCore() throws Throwable {
Document doc;
DOMImplementation domImpl;
boolean state;
doc=(Document)load("staff",builder);
domImpl=doc.getImplementation();
state=domImpl.hasFeature("core","2.0");
assertTrue("domimplementationFeaturecoreAssert",state);
}
|
Runs the test case.
|
public boolean isAbstract(){
return Modifier.isAbstract(_class.getModifiers());
}
|
Returns true for an abstract class
|
public final void testValidateSucceeds(){
IPv6AddressValidator iPv4AddressValidator=new IPv6AddressValidator("foo");
assertTrue(iPv4AddressValidator.validate(""));
assertTrue(iPv4AddressValidator.validate("FE80:0000:0000:0000:0202:B3FF:FE1E:8329"));
assertTrue(iPv4AddressValidator.validate("FE80::0202:B3FF:FE1E:8329"));
}
|
Tests the functionality of the validate-method, if it succeeds.
|
private static char[] encodeHex(final byte[] data,final char[] toDigits){
final int l=data.length;
final char[] out=new char[l << 1];
for (int i=0, j=0; i < l; i++) {
out[j++]=toDigits[(0xF0 & data[i]) >>> 4];
out[j++]=toDigits[0x0F & data[i]];
}
return out;
}
|
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order. The returned array will be double the length of the passed array, as it takes two characters to represent any given byte.
|
@Override public void onSortByRating(){
mSorter.sortMoviesByRating(mListMovies);
mAdapter.notifyDataSetChanged();
}
|
Called when the user chooses to sort results by rating through the menu displayed inside FAB
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.