__key__
stringlengths 16
21
| __url__
stringclasses 1
value | txt
stringlengths 183
1.2k
|
---|---|---|
funcom_train/17624283 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void loadFromStream(InputStream in) throws IOException {
scores = 0;
for (int i = 0; i < 4; i++) {
scores += in.read() << (i * 8);
}
level = in.read();
difficulty = in.read();
gameOver = in.read() == 1;
gameType = GameType.fromInt(in.read());
}
COM: <s> method loads settings state from stream </s>
|
funcom_train/33734380 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setId(String id) {
if(id == null) {
log.error("The id cannot be null");
throw new IllegalArgumentException("The id cannot be null");
}
if(id.trim().length() == 0) {
log.error("The id cannot be empty");
throw new IllegalArgumentException("The id cannot be empty");
}
this.id = id;
}
COM: <s> setter of the photos id number </s>
|
funcom_train/8305699 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Fraction reduce() {
if (numerator == 0) {
return equals(ZERO) ? this : ZERO;
}
int gcd = greatestCommonDivisor(Math.abs(numerator), denominator);
if (gcd == 1) {
return this;
}
return Fraction.getFraction(numerator / gcd, denominator / gcd);
}
COM: <s> p reduce the fraction to the smallest values for the numerator and </s>
|
funcom_train/3000217 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addRow(Object row[]) throws Exception {
if (row.length != m_metaData.getColumnCount()) {
throw new Exception("Invalid number of columns: expected " + m_metaData.getColumnCount() + " got " + row.length);
}
// FIXME: validate datatypes.
m_rowList.add(row);
}
COM: <s> appends the given row to the end of the table </s>
|
funcom_train/23713593 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean output(ActorMsg sig, Schedulable curfsm) {
boolean ok = out(sig, curfsm);
if (ok && curfsm != null ) {
if (isTraceOn() && !sig.getMsgId().equals(JFConstants.TIMER_ID)) {
curfsm.getScheduler().getTraceObject().traceOutput(sig);
}
}
return ok;
}
COM: <s> post the message to the input queue of the receiving scheduable </s>
|
funcom_train/39531327 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public JMenu getMenu(String menuName) {
for (int i=0; i < getJMenuBar().getMenuCount(); i++) {
JMenu jMenu= getJMenuBar().getMenu(i);
if (menuName.equals(jMenu.getName()))
return jMenu;
}
return null;
}
COM: <s> returns the menu corresponding to a given result or null </s>
|
funcom_train/22277779 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object anObject) {
Color theColor;
if (anObject instanceof Color) {
theColor = (Color)anObject;
return _color.equals(theColor.awtColor());
} else if (anObject instanceof java.awt.Color) {
return _color.equals((java.awt.Color)anObject);
}
return false;
}
COM: <s> returns b true b if b an object b equals the color </s>
|
funcom_train/19308680 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void loadImageError(final IOException e) throws GraphicException {
String message = "Error while loading image "
+ getUrl().toString() + " : ";
if (e != null) {
message += e.getClass() + " - " + e.getMessage();
}
throw new GraphicException(message);
}
COM: <s> standard method for throwing an io related exception </s>
|
funcom_train/35273192 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void connect(){
try {
skt = new Socket(host,port);
is = skt.getInputStream();
ois = null;
os = skt.getOutputStream();
oos = new ObjectOutputStream(os);
}//try
catch (Exception e){
System.out.println("NwClient.connect(): " + e.toString());
}//catch
}//connect()
COM: <s> make a client connection to the server </s>
|
funcom_train/39296864 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected AbstractNode getSubNode(int index) {
if (index == -1) {
return null;
}
AbstractNode subNode = null;
if (subNodeIDs[index] != null) {
subNode = nodeRepository.getNode(subNodeIDs[index]);
if (subNode == null) {
throw new RuntimeException("Inconsistent state of the tree - couldn't find node '" + subNodeIDs[index]
+ "'");
}
}
return subNode;
}
COM: <s> returns sub node for the given index </s>
|
funcom_train/50152483 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getCopyButton() {
if (copyButton == null) {
copyButton = new JButton();
ResourceHelper.setText(copyButton, "copy_appt");
copyButton.setIcon(new ImageIcon(getClass().getResource(
"/resource/Copy16.gif")));
copyButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent e) {
copyAppt();
}
});
}
return copyButton;
}
COM: <s> gets the copy button </s>
|
funcom_train/18191451 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void scaleInTheMiddleOfCube(double deltaZoom, double[][] matrix) {
multiply(Configuration.dimX / 2, Configuration.dimY / 2, Configuration.dimZ / 2, matrix);
double offsetX = resultX;
double offsetY = resultY;
double offsetZ = resultZ;
translate(-offsetX, -offsetY, -offsetZ, matrix);
scale(deltaZoom, matrix);
translate(offsetX, offsetY, offsetZ, matrix);
}
COM: <s> scales the transformation matrix but does not set the zoom factor to this </s>
|
funcom_train/43539695 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getResetTriggerInternal() {
int triggerValue = -1;
String property = getProperty(ITestSuiteBuilderConstants.PROPERTY_RESET_TRIGGER);
if ((property != null) && (property.length() > 0)) {
try {
triggerValue = Integer.parseInt(property);
} catch (NumberFormatException nfe) { /* gulp! */
}
}
streamProperty(Integer.toString(triggerValue), ITestSuiteBuilderConstants.PROPERTY_RESET_TRIGGER);
return triggerValue;
}
COM: <s> read the reset trigger property and parse the value </s>
|
funcom_train/29550334 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testGetFolderUriSkeleton() {
String expectedFolder = "http://" + MindRaider.profile.getHostname()
+ "/e-mentality/folder#";
String actualFolder = MindRaiderVocabulary.getFolderUriSkeleton();
assertEquals("actualFolder is: " + actualFolder, expectedFolder,
actualFolder);
}
COM: <s> the get folder uri skeleton test case </s>
|
funcom_train/38471621 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createPartControl(Composite parent) {
viewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
viewer.setSorter(new NameSorter());
viewer.setInput(input);
DataChangeEventsManager.addChangeListener(DataType.CHARACTER, this);
makeActions();
hookContextMenu();
hookClickAction();
contributeToActionBars();
}
COM: <s> this is a callback that will allow us </s>
|
funcom_train/43096814 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testDoClick() {
Object spec = Model.getFacade().getOwnerScope(elem);
if (box == null) {
return; // Inconclusive
}
box.doClick();
assertEquals(
Model.getScopeKind().getClassifier(),
Model.getFacade().getOwnerScope(elem));
}
COM: <s> tests the marking clicking of the checkbox </s>
|
funcom_train/21877618 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Model getXformModel(Collection uris, Model input) throws DepoException {
Model oMod = getKnowledgeMap().readlockXforms();
try {
for (Iterator i = uris.iterator(); i.hasNext();) {
String uri = (String) i.next();
getXformModel(uri, input);
}
return input;
} finally {
getKnowledgeMap().unlockXforms();
}
}
COM: <s> get a model containing the statements for all instances listed </s>
|
funcom_train/18785982 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int retrieveLargestTrackNumber(){
if ( cd.getTracks() == null )
{
return 0;
}
Iterator iter = cd.getTracks().iterator();
int largestTrackNumber = 0;
while (iter.hasNext())
{
Track aTrack = (Track) iter.next();
if (aTrack != null)
{
int tracknumber = aTrack.getNumber().intValue();
if (tracknumber > largestTrackNumber)
{
largestTrackNumber = tracknumber;
}
}
}
return largestTrackNumber;
}
COM: <s> this method calculates the largest track number </s>
|
funcom_train/3176913 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void stop() {
// perform step to final frame
animate(END);
// restore edges
// TODO currently edges are layed out without bends in animation
Iterator<?> it = edgesAndShapes.iterator();
while (it.hasNext()) {
((EditableEdge)it.next()).setPath((Routing)it.next());
}
// stop all moves
motions=null;
// done
}
COM: <s> stops the animation by setting it to the last frame </s>
|
funcom_train/25568332 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected GridBagConstraints getConstraints(int x, int y) {
GridBagConstraints con = new GridBagConstraints();
con.insets = new java.awt.Insets(4, 4, 4, 4);
con.gridy = y;
con.gridx = x; con.ipadx = 30;
con.weightx = 1;
con.weighty = 0;
con.gridwidth = 1;
con.anchor = GridBagConstraints.NORTH;
con.fill = GridBagConstraints.BOTH;
return con;
}
COM: <s> getting component constraints </s>
|
funcom_train/50297436 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean nullsAreSortedHigh() throws SQLException {
// in Firebird 1.5.x NULLs are always sorted at the end
// in Firebird 2.0.x NULLs are sorted low
if (getDatabaseMajorVersion() == 1) {
return false;
} else
if (getDatabaseMajorVersion() == 2) {
return false;
} else
throw new FBDriverNotCapableException();
}
COM: <s> are null values sorted high </s>
|
funcom_train/33371374 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Matrix scale(double k) {
Matrix result = new Matrix(row, col);
for(int i=0; i<row; i++) {
for(int j=0; j<col; j++) {
result.set(scale(get(i, j), k), i, j);
}
}
return result;
}
COM: <s> scales this matrix with the given scalar </s>
|
funcom_train/20583513 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public RdpPacket_Localised receive() throws IOException, RdesktopException, OrderException, CryptoException {
int[] type = new int[1];
RdpPacket_Localised buffer = receiveMessage(type);
if(buffer==null) return null;
if (type[0] != DATA_TRANSFER) {
throw new RdesktopException("Expected DT got:" + type[0]);
}
return buffer;
}
COM: <s> receive a data transfer message from the server </s>
|
funcom_train/44733064 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void sVertex3(double x, double y, double z, final Matrix4d mat) {
Point3d win = new Point3d();
Point3d v = new Point3d(x, y, z);
projectCustom(v, win, mat);
// Can be optimized by avoiding matrix inversion if it's always the same
gluUnProject(win, mat, matProjection, vecViewport, v);
glVertex3dv(StelUtility.toArray(v), 0);
}
COM: <s> override gl vertex3f </s>
|
funcom_train/35282078 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addListener(InputListener listener, String... mappingNames) {
for (String mappingName : mappingNames) {
Mapping mapping = mappings.get(mappingName);
if (mapping == null) {
mapping = new Mapping(mappingName);
mappings.put(mappingName, mapping);
}
if (!mapping.listeners.contains(listener)) {
mapping.listeners.add(listener);
}
}
}
COM: <s> adds a new listener to receive events on the given mappings </s>
|
funcom_train/4582948 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setUseDefaultJRE() {
if (fDefaultDescriptor != null) {
fDefaultButton.setSelection(true);
fSpecificButton.setSelection(false);
fEnvironmentsButton.setSelection(false);
fCombo.setEnabled(false);
fEnvironmentsCombo.setEnabled(false);
firePropertyChange();
}
}
COM: <s> sets this control to use the default jre </s>
|
funcom_train/5824103 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void append(int[] ids) {
if (ids != null && ids.length != 0) {
int[] tmp = new int[m_data.length + ids.length];
System.arraycopy(m_data, 0, tmp, 0, m_data.length);
System.arraycopy(ids, 0, tmp, m_data.length, ids.length);
m_data = tmp;
}
}
COM: <s> appends the specified identifiers to the current object </s>
|
funcom_train/5729186 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean equals(Object object) {
if (this == object) {
return true;
}
if (!(object instanceof Answer)) {
return false;
}
final Answer that = (Answer) object;
if (this.answerPk == null || that.getAnswerPk() == null || !this.answerPk.equals(that.getAnswerPk())) {
return false;
}
return true;
}
COM: <s> returns code true code if the argument is an answer instance and all </s>
|
funcom_train/3970688 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String replaceKeyMaskWithKeyValue(String xsql, Map acceptedFilters) {
for(Iterator it = acceptedFilters.keySet().iterator();it.hasNext();){
Object key = it.next();
xsql = StringUtils.replace(xsql, markKeyStartChar+key+markKeyEndChar, acceptedFilters.get(key).toString());
}
return xsql;
}
COM: <s> xsql key key </s>
|
funcom_train/28486180 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void inherit(ClientConfig parent) {
this.userIdProvider = parent.userIdProvider;
this.clientAppName = parent.clientAppName;
this.clientAppVersion = parent.clientAppVersion;
this.endpointURL = parent.endpointURL;
this.handlerChain = parent.handlerChain;
this.timeout = parent.timeout;
this.wsdlFile = parent.wsdlFile;
this.auditEnabled = parent.auditEnabled;
this.httpPassword = parent.httpPassword;
this.httpUsername = parent.httpUsername;
}
COM: <s> overrides all the current properties with those not null of the parent </s>
|
funcom_train/18727832 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setJmlLatexScaleFactor(final float newJmlScale) {
final Float old = jmlLatexScaleFactor;
this.jmlLatexScaleFactor = newJmlScale;
firePropertyChange("jlmlatexscalefactor", old, jmlLatexScaleFactor);
iconFactory.setSize(latexTextSize.size * jmlLatexScaleFactor);
createIcon();
}
COM: <s> set the latex font scale factor </s>
|
funcom_train/35306291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void initMnemonics() {
mnemonicToIndexMap = new Hashtable<Integer, Integer>();
mnemonicInputMap = new ComponentInputMapUIResource(tabPane);
mnemonicInputMap.setParent(SwingUtilities.getUIInputMap(tabPane,
JComponent.WHEN_IN_FOCUSED_WINDOW));
SwingUtilities.replaceUIInputMap(tabPane,
JComponent.WHEN_IN_FOCUSED_WINDOW,
mnemonicInputMap);
}
COM: <s> installs the state needed for mnemonics </s>
|
funcom_train/42660249 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void fireOnAfterPutEvent(R r, C c, V v) {
if (this.onAfterPutEvent != null) {
Cell<R,C,V> cell = new CellImpl_1x2<R,C,V>(r, c, v);
this.onAfterPutEvent.fire(new ActionEventAfter_1x0<Cell<R,C,V>>(this, 0, CM_AFTER_PUT, cell));
}
}
COM: <s> fires on after put event </s>
|
funcom_train/37763562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection query(Criteria criteria) throws QueryFailedException, PostLoadFailedException {
Collection col = new ArrayList();
if (criteria.getTable().equals("org.jaffa.modules.setup.domain.ValidFieldValue"))
queryValidFieldValue(criteria, col);
else if (criteria.getTable().equals("test.rules.Strings1"))
queryStrings1(criteria, col);
return col;
}
COM: <s> queries the underlying persistent store based on the search profile passed in the </s>
|
funcom_train/50982871 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testAddComponentTwice() {
final TableLayout layout = new TableLayout();
final JPanel panel = new JPanel();
layout.addLayoutComponent( panel, new TableLayoutConstraints(3,4) );
try {
layout.addLayoutComponent(panel, new TableLayoutConstraints(1,2));
fail("Should not be able to add the same component twice");
}
catch( final IllegalArgumentException e ) {
// Expected path
}
}
COM: <s> make sure you cant add the same component twice </s>
|
funcom_train/534415 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean remove(Object o) {
// start by finding the element
int i;
for(i = 1; i < this.size() + 2; i++) {
if(this.data[i].equals(o)) break;
}
// unused spots are nulled out
if(data[i] == null) return false;
// set the comparator to the remove comparator temporarily
Comparator remove = new RemoveComparator(o, comparator);
Comparator original = comparator;
comparator = remove;
percolateUp(i);
deleteMin();
comparator = original;
return true;
}
COM: <s> removes the requested element from the queue if it exists </s>
|
funcom_train/12181001 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void processEndSchema() throws SAXException {
// If we've reached the end of the schema successfully, then no action
// is required. If we've been recording events to allow groups to be
// completed, then now is the time to play back those events.
if (recorder != null) {
SAXEventRecorder localRecorder = recorder;
recorder = null;
groupsProcessed = true;
localRecorder.playback(this);
}
}
COM: <s> helper method that handles the ending of a schema </s>
|
funcom_train/27712862 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected Node getFirstChildOfType(Node node, short type) {
if (node != null) {
Node child = node.getFirstChild();
while (child != null) {
if (child.getNodeType() == type) {
return child;
}
child = child.getNextSibling();
}
}
return null;
}
COM: <s> returns the first child of the given node type </s>
|
funcom_train/6446189 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void writeTemplate(PrintWriter out, InputStream template) throws IOException{
int b = template.read();
//System.out.println("[] read");
while (b != -1 && b != SUBSTITUTE) {
out.write( b );
b = template.read();
}
//System.out.println("[] done reading");
}
COM: <s> writes a template from the input stream to the output stream </s>
|
funcom_train/34580117 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Command getCancelCommand1() {
if (cancelCommand1 == null) {//GEN-END:|220-getter|0|220-preInit
// write pre-init user code here
cancelCommand1 = new Command("Cancel", Command.CANCEL, 0);//GEN-LINE:|220-getter|1|220-postInit
// write post-init user code here
}//GEN-BEGIN:|220-getter|2|
return cancelCommand1;
}
COM: <s> returns an initiliazed instance of cancel command1 component </s>
|
funcom_train/26240378 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void updateSpinnerRanges(int fromValue, int toValue) {
Integer min = new Integer(fromValue);
Integer max = new Integer(toValue);
for (int i=0; i<itemSpinners.length; i++) {
SpinnerNumberModel model = (SpinnerNumberModel) itemSpinners[i].getModel();
model.setMinimum(min);
model.setMaximum(max);
model.setValue(min);
}
}
COM: <s> update the range of all jspinners </s>
|
funcom_train/28252797 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void replace(FormElement other) {
this.form = other.form;
this.hasGetterParameters = other.hasGetterParameters;
this.hasSetter = other.hasSetter;
this.id = other.id;
this.javaType = other.javaType;
this.parent = other.parent;
this.setUniqueId(other.uniqueId);
this.getterName = other.getterName;
this.setterName = other.setterName;
loadFrom(other);
getParent().childReplace(other, this);
}
COM: <s> loads data from another form element </s>
|
funcom_train/25471356 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String shuffle(String s) {
StringBuffer sb = new StringBuffer(s);
for (int k = 0; k < N_SHUFFLES; k++) {
int a = (int)(Math.random() * sb.length());
int b = (int)(Math.random() * sb.length());
char ch = sb.charAt(a);
sb.setCharAt(a, sb.charAt(b));
sb.setCharAt(b, ch);
}
return sb.toString();
}
COM: <s> shuffle randomly shuffles the characters in a string </s>
|
funcom_train/4658045 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setSubElement(String name, String value) {
if (value == null) {
removeSubElement(name);
} else {
if (subElements == null) {
subElements = new HashMap<String, String>();
}
subElements.put(name, value);
}
}
COM: <s> sets the value of a sub tag </s>
|
funcom_train/37595278 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean isWellFormed() {
NormSubtyper sub = new NormSubtyper();
for (VariableType var : intersection(_lowerBounds.keySet(), _upperBounds.keySet())) {
if (!sub.contains(lowerBound(var), upperBound(var))) { return false; }
}
return true;
}
COM: <s> test whether all variables have compatible bounds </s>
|
funcom_train/10927595 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected boolean getBooleanParameter(Map<String, String> parameters, String name, boolean defValue) {
if (parameters == null) {
return defValue;
}
String value = parameters.get(name);
if ((value == null) || (value.trim().length() == 0)) {
return defValue;
}
return Boolean.parseBoolean(value);
}
COM: <s> extracts a boolean parameter from the parameters </s>
|
funcom_train/45545843 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean checkConfiguration() {
if (!isJSCconfiguredCorrectly()) {
// Create the ConfigureJSCWizard
ConfigureJSCWizard wizard = new ConfigureJSCWizard();
wizard.init(getWorkbench(), new StructuredSelection());
WizardDialog dialog = new WizardDialog(EclipseUtility.getActiveWorkbenchShell(),wizard);
dialog.open();
// If the dialog was canceld, return false
if (dialog.getReturnCode() != Window.OK || !isJSCconfiguredCorrectly()) {
return false;
}
}
return true;
}
COM: <s> checks if jsceclipse is configured correctly and tries to </s>
|
funcom_train/11707168 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void trimToSize() {
if (this.pos == this.array.length) {
return;
}
int[] new_array = new int[this.pos];
System.arraycopy(this.array, 0, new_array, 0, this.pos);
this.array = new_array;
return;
}
COM: <s> reduce the size of the internal array to the number of current elements </s>
|
funcom_train/42440694 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void shutdown() {
// Call super dispose because we want the partitioner to be
// disconnected.
super.dispose();
if (inMessageColor != null) {
inMessageColor.dispose();
}
if (outMessageColor != null) {
outMessageColor.dispose();
}
MidiclipseUiPlugin.getPlugin().getPreferenceStore()
.removePropertyChangeListener(this);
}
COM: <s> clean up created colors </s>
|
funcom_train/33439337 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void interruptIdleWorkers(boolean onlyOne) {
final ReentrantLock mainLock = this.mainLock;
mainLock.lock();
try {
Iterator it = workers.iterator();
while (it.hasNext()) {
Worker w = (Worker) it.next();
Thread t = w.thread;
if (!t.isInterrupted() && w.tryLock()) {
try {
t.interrupt();
} catch (SecurityException ignore) {
} finally {
w.unlock();
}
}
if (onlyOne)
break;
}
} finally {
mainLock.unlock();
}
}
COM: <s> interrupts threads that might be waiting for tasks as indicated by </s>
|
funcom_train/38224346 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String getIndex(){
String key = "lucene.index";
String property = getProperty(key);
if ( property == null ){
log.warn("the index location is null: org.exteca.search.lucene.index not found in properties file");
}
else{
if ( log.isDebugEnabled())
log.debug("index location: " + property);
}
return property;
}
COM: <s> returns the index location </s>
|
funcom_train/48877472 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Payment create() throws DataException {
String id = null;
try {
id = GUID.generate();
} catch(GUIDException guide) {
throw new DataException("Could not generate a GUID", guide);
}
Payment payment = new Payment();
payment.setID(id);
Cache cache = Cache.getInstance();
cache.put(id, payment);
return payment;
} //create
COM: <s> creates a new payment business object </s>
|
funcom_train/1379791 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private JButton getBtnPortate() {
if (btnPortate == null) {
btnPortate = new JButton();
btnPortate.setText("Portate");
btnPortate.setPreferredSize(new Dimension(90, 50));
btnPortate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
apriGestionePortate(); // TODO Auto-generated Event stub
// actionPerformed()
}
});
}
return btnPortate;
}
COM: <s> this method initializes btn portate </s>
|
funcom_train/20659597 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean checkRoot(){
String line, execStr = "", line2, execStr2 = "";
boolean isRoot = false;
try {
Process p = Runtime.getRuntime().exec("whoami");
BufferedReader input = new BufferedReader(new InputStreamReader(p
.getInputStream()));
while ((line = input.readLine()) != null) {
execStr = line;
}
input.close();
} catch (Exception err) {
err.printStackTrace();
}
if (execStr.equals("root")) {
isRoot = true;
} else {
isRoot = false;
}
return isRoot;
}
COM: <s> checking if the user is root or not </s>
|
funcom_train/14091831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void attributeRemoved(HttpSessionBindingEvent event) {
if (event.getName().equals(EVENT_KEY)) {
SecurityContext securityContext = (SecurityContext) event.getValue();
User user =
(User) securityContext.getAuthentication().getPrincipal();
removeUsername(user);
}
}
COM: <s> when users logout remove their name from the hash map </s>
|
funcom_train/937349 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void setIProperty(OptionTreeNode otn, DisplayableOption d, String name, String english) {
String key = optionManager.getI18nPrefix() + "." + otn.getCompositeKey('.') + '.' + d.getId() + '.' + name;
d.setProperty(name, messageProvider.getMessage(locale, key, english));
}
COM: <s> sets the i property attribute of the option loader object </s>
|
funcom_train/22386693 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected FText getFText(ZZCell c, int scale) {
Vector v = new Vector();
ZZCursorVirtual[] path = new ZZCursorVirtual[] {
new ZZCursorVirtual(c)
};
ZZCell exp = c.s("d.expression", -1);
if(exp != null)
addExpression(v, new Expression(exp), path, null, null, scale);
else
addTypeQuestion(v, c.getSpace(), null, null, path, null, scale);
return new FText(v);
}
COM: <s> get the ftext for this cell at the given scale </s>
|
funcom_train/18781349 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void notifyPlayThread() {
synchronized(this) {
stateDirty = true;
}
// Make a copy, in case the player thread decides to go away.
Thread pt = getPlayingThread();
if (pt != null) {
// We synchronize here to make sure that we don't interrupt the player
// thread at an inconvenient time for it.
synchronized(this) {
pt.interrupt();
}
}
}
COM: <s> notify the player thread if it exists of any state changes </s>
|
funcom_train/10008747 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void displayMessage(String from, String msg, boolean local) {
String color = "'#ff0000'";
if (local)
color = "'#0000ff'";
outgoingMessagePane.append("<p><font color="+color+"><b>"+from+":</b></font> "+msg+"</p>");
}
COM: <s> displays the message to the messages text pane </s>
|
funcom_train/15614036 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String logoutAction() throws IOException {
if (UserBean.logger.isTraceEnabled()) {
UserBean.logger.trace("Performing log out operation of user " + this.loggedUser.getLogin());
}
this.getSession().invalidate();
FacesContext.getCurrentInstance().getExternalContext().redirect("/iwii-organizer/");
return null;
}
COM: <s> logs out currently logged user </s>
|
funcom_train/25467450 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void onClick(View view) {
try {
savePreferences(view.getContext());
} catch (IOException e) {
Message msg = new Message();
msg.obj = R.string.errorSaveProperties;
// TODO verify why he was not using view.handlerDialog.sendMessage as he normally should !
//OSMPreferencesForm.this.view.handlerDialog.handleMessage(msg);
OSMPreferencesForm.this.view.displayErrorMessage(msg);
}
}
COM: <s> when the save button is pressed </s>
|
funcom_train/17898634 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void paintIcon(Component c, Graphics g, int x, int y) {
g.setColor(UIManager.getColor("controlShadow").darker().darker());
g.drawLine(x, y, x + ICON_WIDTH - 1, y + ICON_HEIGHT - 1);
g.drawLine(x + ICON_WIDTH - 1, y, x, y + ICON_HEIGHT - 1);
}
COM: <s> draw the icon at the specified location </s>
|
funcom_train/39314562 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testOkActionPerformed() {
System.out.println("testOkActionPerformed");
ActionEvent evt=new ActionEvent(f,1,"hi");
stretch s=new stretch(f,true);
s.okActionPerformed(evt);
assertNotNull(f.center.getBufferedImage());
}
COM: <s> test of ok action performed method of class stretch </s>
|
funcom_train/20205563 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void addTrail(String path) {
for (String excludedPath : getExcludedPaths()) {
if (path.indexOf(excludedPath) >= 0) {
return;
}
}
if (getTrail().containsKey(path)) {
collapseTrail(path);
return;
}
String pageName = getDisplayLabel(path);
getTrail().put(path, pageName);
}
COM: <s> add the specified path to the trail </s>
|
funcom_train/21087516 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addFontSizePropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(), getResourceLocator(),
getString("_UI_SNI_Objet_fontSize_feature"),
getString("_UI_SNI_Objet_fontSize_description"),
SNI_Package.Literals.SNI_OBJET__FONT_SIZE, false, false, false,
ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
getString("_UI_AffichagePropertyCategory"), null));
}
COM: <s> this adds a property descriptor for the font size feature </s>
|
funcom_train/13647630 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deleteEmptyHttpHeader() {
for (int i = this.httpHeader.size() - 1; i >= 0; i--) {
PartnerHttpHeader header = this.httpHeader.get(i);
if (header.getKey() == null || header.getKey().trim().length() == 0) {
this.httpHeader.remove(i);
}
}
}
COM: <s> deletes http headers that contain only of a value but no key </s>
|
funcom_train/36906291 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void deletePerson(String name) {
VQLQuery query = new VQLQuery(session, "select * from model.Person where surName like $1");
query. bind(name);
VEnumeration venum = query.execute();
while (venum.hasMoreElements ()) {
Object person = venum.nextElement();
this.session.deleteObject(person);
}
}
COM: <s> deletes all one or more persons from the database </s>
|
funcom_train/4377643 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String next(int n) throws RJSONException {
if (n == 0) {
return "";
}
char[] chars = new char[n];
int pos = 0;
while (pos < n) {
chars[pos] = next();
if (end()) {
throw syntaxError("Substring bounds error");
}
pos += 1;
}
return new String(chars);
}
COM: <s> get the next n characters </s>
|
funcom_train/8685952 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void restoreSystem() throws BuildException {
if (sys == null) {
throw new BuildException("Unbalanced nesting of SysProperties");
}
try {
System.setProperties(sys);
sys = null;
} catch (SecurityException e) {
throw new BuildException("Cannot modify system properties", e);
}
}
COM: <s> restore the system properties to the cached value </s>
|
funcom_train/34069018 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void createConnector(String title, GraphicsObject n1, GraphicsObject n2) {
GraphicsConnector gc = new GraphicsConnector(title, n1, n2);
pict.addObject(gc);
resetEditors();
setChanged();
notifyObservers(new Msg(Msg.CONNECTOR_CREATED));
}
COM: <s> creates new connector </s>
|
funcom_train/40676391 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private boolean ensureLoaded(int numberDesired) {
int numberToLoad = numberDesired - entityBuffer.size();
if (numberToLoad > 0 && resultsSource.hasMoreEntities()) {
saveNextCursor(entityBuffer.size(),
resultsSource.loadMoreEntities(numberToLoad, entityBuffer));
}
return entityBuffer.size() >= numberDesired;
}
COM: <s> request enough additional </s>
|
funcom_train/44283864 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private void setupTronUpPanel(JPanel parentPanel, Patch patch) {
addWidget(parentPanel,new KnobWidget("Peak", patch, 0, 127,0,new ScaledParamModel(patch, 53 + pgmDumpheaderSize, 127, 63),new CCSender(40)),6,0,1,1,32);
}
COM: <s> sets up the tron up effects panel </s>
|
funcom_train/13519496 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isTransformableIntoFunction(String formula, String[] varPossible){
// generate the list of variable use in the formula
StringBuffer function=new StringBuffer("f(");
for(int i=0;i<varPossible.length;i++){
function=function.append(varPossible[i]);
if (i!=(varPossible.length-1)) {
function=function.append(",");
}
}
function=function.append(")=");
// check if the created formula is valide
FunctionParser parser=new FunctionParser();
try{
parser.compileFunction(function.toString()+formula);
return true;
}
catch(Exception e){
return false;
}
}
COM: <s> check if the array of variable names can be used to correctly </s>
|
funcom_train/16162696 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ArrayList descendants()
{ HashSet set = new HashSet(2*inDegree());
set = descendants(set);
Iterator it = set.iterator();
ArrayList result = new ArrayList (set.size());
while(it.hasNext())
result.add(it.next());
return result;
}
COM: <s> returns an array list of all digraph nodes that are reachable </s>
|
funcom_train/16269759 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public String codecPrefString() {
char[] prefs = {
VoiceFrame.ULAW_NO //, VoiceFrame.LIN16_NO //, VoiceFrame.ALAW_NO
};
String ret = "";
for (int i = 0; i < prefs.length; i++) {
ret += (char) (prefs[i] + 66);
}
return ret;
}
COM: <s> indicate to asterisk our preferences removed alaw due to bug </s>
|
funcom_train/34451408 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addTargetPropertyDescriptor(Object object) {
itemPropertyDescriptors.add(createItemPropertyDescriptor(
((ComposeableAdapterFactory) adapterFactory)
.getRootAdapterFactory(), getResourceLocator(),
getString("_UI_MActivityEdge_target_feature"), getString(
"_UI_PropertyDescriptor_description",
"_UI_MActivityEdge_target_feature",
"_UI_MActivityEdge_type"),
M3ActionsPackage.Literals.MACTIVITY_EDGE__TARGET, true, false,
true, null, null, null));
}
COM: <s> this adds a property descriptor for the target feature </s>
|
funcom_train/18660655 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testSetHighresLocation_String() {
PictureInfo pi = new PictureInfo();
pi.setHighresLocation( "file:///dir/picture.jpg" );
File f = pi.getHighresFile();
assertEquals( "Testing that the Highres Location was memorised correctly", f.toString(), "/dir/picture.jpg" );
}
COM: <s> test of set highres location method of class picture info </s>
|
funcom_train/46591865 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private CSPRegistrationCOType buildCSPRegistrationCO(SSTPRegistration regDoc) {
// SSTPDocument/SSTPRegistration/CSPRegistrationCO
CSPRegistrationCOType couReg = regDoc.addNewCSPRegistrationCO();
// SSTPDocument/SSTPRegistration/CSPRegistrationCO/ActionCode
couReg.setActionCode(CSPRegistrationCOType.ActionCode.C);
// SSTPDocument/SSTPRegistration/CSPRegistrationCO/EffectiveDate
couReg.setEffectiveDate(today);
return couReg;
}
COM: <s> returns a cou registration element to insert into an sstpdocument will </s>
|
funcom_train/8579730 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private String identifier() throws InvalidPropertyPathException {
StringBuilder result = new StringBuilder();
assertPropertyPathIsValid(!isEndOfPath() &&
PropertyNamesHelper.isValidPropertyNameCharacter((char)nextChar()));
do
{
result.append((char)nextChar());
consume();
} while (!isEndOfPath() &&
PropertyNamesHelper.isValidPropertyNameCharacter((char)nextChar()));
return result.toString();
}
COM: <s> method for the identifier rule </s>
|
funcom_train/46755209 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void updateModelWithScript() {
try {
if (model != null && model.isNew() && !model.isModified()) {
IControlScript controlScript = getControlScript(null, null);
controlScript.execute(formDisplay.getModelDefaultScript(),
"select model_default_script from application_views where application_view_id = " + formDisplay.getId());
}
} catch (Exception ex) {
Log.exception(ex);
}
}
COM: <s> execute model default script to custom define </s>
|
funcom_train/8362135 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean isThereBreakpoint(int lineNumber) {
final int size = this.size();
for (int i = 0; i < size; i++) {
BreakpointInfo breakpoint = (BreakpointInfo) this.get(i);
int currLineNumber = breakpoint.getLineNumber();
if (currLineNumber == lineNumber) {
return true;
} else if (currLineNumber > lineNumber) {
return false;
}
}
return false;
}
COM: <s> checks if breakpoint at specified line number already exists </s>
|
funcom_train/43233904 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public IncidentType getIncidentTypeByName(final String incidentTypeName) throws NoObjectFindException {
final List<IncidentType> incidentTypes =
this.getAllOfTypeWithFilter(IncidentType.class, new Predicate<IncidentType>() {
@Override
public boolean test(final IncidentType element) {
return element.getName().equals(incidentTypeName);
}
});
if (incidentTypes.size() == 0) {
throw new NoObjectFindException("Could not find IncidentType!");
}
return incidentTypes.get(0);
}
COM: <s> getter of a incident type by its name </s>
|
funcom_train/5377631 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void processExtension(BundleData bundleData, byte type) throws BundleException {
if ((bundleData.getType() & BundleData.TYPE_FRAMEWORK_EXTENSION) != 0) {
validateExtension(bundleData);
processFrameworkExtension(bundleData, type);
} else if ((bundleData.getType() & BundleData.TYPE_BOOTCLASSPATH_EXTENSION) != 0) {
validateExtension(bundleData);
processBootExtension(bundleData, type);
}
}
COM: <s> processes an extension bundle </s>
|
funcom_train/37241099 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public int getMajorKey() {
int[] keys = {11, 6, 1, 8, 3, 10, 5, 0, 7, 2, 9, 4, 11, 6, 1};
return keys[keySignature + 7];
}
COM: <s> returns the current major key for this stave instance as a integer </s>
|
funcom_train/3002857 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void selectInput() {
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int answer = chooser.showOpenDialog(XPontusComponentsUtils.getTopComponent()
.getDisplayComponent());
if (answer == JFileChooser.APPROVE_OPTION) {
view.getModel().setInput(chooser.getSelectedFile().getAbsolutePath());
}
}
COM: <s> select a schema </s>
|
funcom_train/20219261 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void testHandleProperty() throws Exception{
PropertyHandler propertyHandler = new DayOfYearHandler();
Calendar calendar = Calendar.getInstance();
Date dt = new Date();
calendar.setTime(dt);
calendar.set(Calendar.YEAR, 2008);
calendar.set(Calendar.MONDAY, Calendar.FEBRUARY);
calendar.set(Calendar.DAY_OF_MONTH, 29);
assertEquals(new Integer(60), propertyHandler.doProperty(calendar.getTime()));
}
COM: <s> day of year handler </s>
|
funcom_train/10587250 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private int getMaxCol(HSSFSheet sheet) {
int max = -1;
HSSFRow row = null;
Iterator rows = sheet.rowIterator();
while (rows.hasNext()) {
row = (HSSFRow) rows.next();
int lastNum = row.getLastCellNum();
if (lastNum > max) {
max = lastNum;
}
}
return max;
}
COM: <s> returns the max column index of the given sheet </s>
|
funcom_train/43827683 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addFalseValuePropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_CPNBool_falseValue_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_CPNBool_falseValue_feature", "_UI_CPNBool_type"),
CpntypesPackage.Literals.CPN_BOOL__FALSE_VALUE,
true,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
null));
}
COM: <s> this adds a property descriptor for the false value feature </s>
|
funcom_train/38787249 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void craftDisplayLists(GL gl) {
openGL_Lists = new HashMap<String, Integer>();
for (Ship s : blueprints) {
Integer listnr = gl.glGenLists(1);
gl.glNewList(listnr, gl.GL_COMPILE);
{
s.ship_graphic.draw_fordisplaylist(gl);
}
gl.glEndList();
openGL_Lists.put(s.identifier, listnr);
}
}
COM: <s> create display lists for all ship blueprints </s>
|
funcom_train/36012116 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private Composite createsGeneralComposite(Composite parent) {
Composite child = new Composite(parent, SWT.LEFT);
FormLayout layout = new FormLayout();
layout.marginWidth = 7;
clientWidth = clientWidth - (7 * 2);
layout.marginHeight = 7;
child.setLayout(layout);
return child;
}
COM: <s> creates view preference frame and return the child composite </s>
|
funcom_train/32195325 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void buildColumns(String[][] header) {
//treeViewer.setColumnProperties(header);
treeColumns = new TreeColumn[header.length];
for(int i = 0; i < header.length; i++) {
treeColumns[i] = new TreeColumn(tree, SWT.PUSH);
treeColumns[i].setText(header[i][0]);
treeColumns[i].setWidth(Integer.parseInt(header[i][1]));
}
}
COM: <s> builds the columns headers </s>
|
funcom_train/806664 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean saveInFormat(IBioResourceFormat format) {
if (!(format instanceof UnknownBioResourceFormat)) {
String message="BioResource: " + getName() + " could not be saved in format: " + format.getFormatName();
logger.debug(message);
BioclipseConsole.writeToConsole(message);
return false;
}
// UnknownBioResourceFormat newFormat = (UnknownBioResourceFormat) format;
return save();
}
COM: <s> provide a default implementation able to save only in unknown format text format </s>
|
funcom_train/48706205 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public ExternalFileType getExternalFileTypeByMimeType(String mimeType) {
for (Iterator<ExternalFileType> iterator = externalFileTypes.iterator(); iterator.hasNext();) {
ExternalFileType type = iterator.next();
if ((type.getMimeType() != null) && type.getMimeType().equals(mimeType))
return type;
}
return null;
}
COM: <s> look up the external file type registered for this mime type if any </s>
|
funcom_train/18872021 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: private BitSet fromByteArray(byte[] bytes) {
BitSet bits = new BitSet();
bits.clear();
for (int i=0; i<bytes.length; i++) {
if(bytes[i]=='1')
{
bits.set(i);
}
}
return bits;
}
COM: <s> from byte array </s>
|
funcom_train/28108430 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public boolean updateFromCoObRA() {
DataHolder dH = ((EhDataImpl) dataModule).updateFromCoObRA();
if (dH != null) {
dataHolder = dH;
try {
configurator.updateGUI();
return true;
} catch (Exception e) {
log.error("updateFromCoObRa: updateGUI failed", e);
return false;
}
}
return false;
}
COM: <s> updates the data from the co ob ra server </s>
|
funcom_train/19322513 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public Collection values() {
clearCacheWeakReferences();
List val = new ArrayList();
synchronized (_cache) {
for(Iterator i = _cache.values().iterator(); i.hasNext(); ) {
WeakReferenceValue wrv = (WeakReferenceValue) i.next();
val.add(wrv.get());
}
}
return val;
}
COM: <s> return all the values in the cache </s>
|
funcom_train/44779671 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void addIndex() {
String l_index = (String)pageContext.getAttribute( PAGER_INDEX );
if ( l_index == null ) {
l_index = new String( "0" );
} else {
l_index = String.valueOf( Integer.parseInt( l_index ) + 1 );
}
pageContext.setAttribute( PAGER_INDEX, l_index );
}
COM: <s> add current index of this pager to page context </s>
|
funcom_train/22186040 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: final private boolean buffer(int min) throws IOException {
if (len >= min) return true;
bufferExtend(min-len);
while (min > len) {
int newlen = in.read(buf, off+len, buf.length-(off+len));
if (newlen < 0) return false;
len += newlen;
}
return true;
}
COM: <s> attempt to fill the buffer </s>
|
funcom_train/1548831 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: protected void checkBound(final int bound, final String type) {
if (bound > this.endIndex) {
throw new ArrayIndexOutOfBoundsException("Attempt to make an ArrayIterator that " + type + "s beyond the end of the array. ");
}
if (bound < 0) {
throw new ArrayIndexOutOfBoundsException("Attempt to make an ArrayIterator that " + type + "s before the start of the array. ");
}
}
COM: <s> checks whether the index is valid or not </s>
|
funcom_train/1733360 | /tmp/hf-datasets-cache/medium/datasets/31837353763449-config-parquet-and-info-apcl-funcom-java-long-1b0b1ae9/downloads/d42b7d3130dd02820b64692a8810efdf479c66e589141ea4cfe3cb3bba421716 | TDAT: public void retrieveStoredSettings(){
Preferences prefs = java.util.prefs.Preferences
.userNodeForPackage(VegaDataEditorApp.class);
dbUser = prefs.get("dbUser", "");
dbPass = prefs.get("dbPass", "");
dbHost = prefs.get("dbHost","localhost");
dbName = prefs.get("dbName", "vega");
}
COM: <s> retrieves the stored db conn settings </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.