text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static int lowestBit(long value) {
int low = 0;
if (((int) value) == 0) {
low += 32;
value = value >> 32;
}
if ((value & 0xFFFF) == 0) {
low += 16;
value = value >> 16;
}
if ((value & 0xFF) == 0) {
low +=... | 7 |
public static int chooseOptionRandomlyWithWeights(boolean areValuesNormalizedToOne,
double... weights) {
double[] normalized;
if (!areValuesNormalizedToOne) {
normalized = new double[weights.length];
double total = 0;
for (double value : weights) {
total += value;
}
int counter = 0;
for ... | 6 |
private static boolean test4_2() throws FileNotFoundException {
String input = "new\n" + "pick up key\n" + "drop key\n" + "quit\n"
+ "yes\n";
HashMap<Integer, String> output = new HashMap<Integer, String>();
boolean passed = true;
try {
in = new ByteArrayInputStream(input.getBytes());
System.setIn(... | 7 |
public static Set<GraphNode> Dijkstra(GraphNode origin, List<GraphNode> nodes) {
Set<GraphNode> visited = new HashSet<GraphNode>();
PriorityQueue<GraphNode> frontier = new PriorityQueue<GraphNode>(10, new GraphNodeComparator());
for (int i = 1; i < nodes.size(); i++) {
frontier.add(nodes.get(i));
}
G... | 6 |
private static void displayDrugs(ResultSet rs) throws SQLException{
StringBuilder bf = new StringBuilder();
while (rs.next()){
bf.append(rs.getInt("drugid")).append(": ");
bf.append(rs.getString("drugname")).append(": ");
bf.append(rs.getBigDecimal("price"));
System.out.println(bf.toString());... | 1 |
public synchronized List<Book> getEditorPicks(int numBooks)
throws BookStoreException {
if (numBooks < 0) {
throw new BookStoreException("numBooks = " + numBooks
+ ", but it must be positive");
}
List<BookStoreBook> listAllEditorPicks = new ArrayList<BookStoreBook>();
List<Book> listEditorPicks = ne... | 7 |
private static boolean popTwo() {
if ( calcStack.getCount() < 2 ) {
System.out.println("Insufficient operand count");
if ( calcStack.getCount() == 1 )
System.out.println(calcStack.getValueAtIndex(0));
return false;
}
else {
x = calc... | 2 |
public int getNextCompatibleIndex(Item item, int min)
{
for(int i = min;i<slots.length;i++)
{
ItemStack s = getStackIn(i);
if(s != null && s.nbr > 0 && s.item.equals(item) && s.nbr < item.getMaxInStack())
return i;
}
return getNextCompletlyFreeIndex();
} | 5 |
static void checkOpcode(final int opcode, final int type) {
if (opcode < 0 || opcode > 199 || TYPE[opcode] != type) {
throw new IllegalArgumentException("Invalid opcode: " + opcode);
}
} | 3 |
public static void registerPlugin(Plugin p)
{
HTTPRequestHandler.getInstance().registerPlugin(p);
} | 0 |
protected SchlangenGlied(Rectangle masse, IntHolder unit, Color color) {
super(masse, unit);
this.color = color;
} | 0 |
private void reglerAction(String s) {
if(s.equals("Crypter un message")) {
this.action=ACTIONS.CRYPTER;
}
if(s.equals("Gnrer une cl")) {
this.action=ACTIONS.GENERER;
}
if(s.equals("Dcrypter un message")) {
this.action=ACTIONS.DECRYPTER;
}
if(s.equals("Cryptanalyser")) {
this.action=ACTIONS.CRY... | 5 |
public TransformsType getTransforms() {
return transforms;
} | 0 |
static void generateNextWave() {
Game.world.core.dealDamage(-5, null);
monsters.clear();
wave++;
/*
* either parabola: 0.075 * wave*wave + 3
* or line: 2 * wave + 3
*/
if (wave < 30) monsters.put(Monster.ZOMBIE, Math.round(2 * wave + 1));
else monsters.put(Monster.GOLEM, Math.round(wave - 29)... | 7 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (boolValue ? 1231 : 1237);
result = prime * result + byteValue;
result = prime * result
+ ((dateTimeValue == null) ? 0 : dateTimeValue.hashCode());
result = prime * result
+ ((decimalValue == null) ? 0... | 6 |
@SuppressWarnings("deprecation")
public void LoadConf(String id) {
HashMap<Enchantment, Integer> effects = new HashMap<Enchantment, Integer>();
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
FileConfiguration config = plugin.getConfig();
for(String item : config.getStringList("kits." +id + ".items"))... | 7 |
private void extractFile() {
if (contentList.isSelectionEmpty()) {
JOptionPane.showMessageDialog(this, "Файл не выбран");
} else {
if ((extractedFile.getDIR_Attr()
& extractor.getATTR_DIRECTORY()) == extractor.getATTR_DIRECTORY()) {
JOptionPan... | 4 |
public void setContacter(String contacter) {
this.contacter = contacter;
} | 0 |
public boolean moveToTail(Node<E> e){
mPutLock.lock();
try {
mPollLock.lock();
try{
if (e == null)
return false;
if (e.mRemoved)
return false;
if (mSize.get() == 0)
... | 9 |
public String toString() {
ToStringBuilder sb = new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE)
.append("username", this.username)
.append("enabled", this.enabled)
.append("accountExpired", this.accountExpired)
.append("credentialsExpired", ... | 3 |
public void remover(PalavraChave palavrachave) throws Exception
{
String sql = "DELETE FROM palavrachave WHERE id = ?";
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setLong(1, palavrachave.getId());
stmt.executeUpdate();
}
catch (SQLException e)
{... | 1 |
boolean shootLaser(JSONObject action, GraphicsConnection graphicsConnection, int turnsLeft){
int laserLevel = 1;
if(primaryWeapon.equals("laser")){
laserLevel = primaryWeaponLevel;
}
else if(secondaryWeapon.equals("laser")){
laserLevel = secondaryWeaponLevel;
}
else {
return false;
}
try {
S... | 4 |
@Override
public void execute(IContext context) /*throws Exception*/ {
String path = (String) context.getParameter("path");
File f = new File(context.getProperties().get("file.repository").toString() + "/" + path );
System.out.println(f.getPath());
if (!f.isDirectory()){
/*byte buffer[] = new byte[16384];
... | 3 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
private void jPanel2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel2MouseClicked
JFrame currentFrame = (JFrame) SwingUtilities.getWindowAncestor(this);
try
{
UserClient.getOnlineUsers(new User(clientUserInMain.getText().trim()));
} catch (IOException ex)... | 2 |
public static List<String> getPluginInventory()
{
List<String> pluginList = new ArrayList<String>();
try
{
File jarLocation = new File(ControllerEngine.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
String parentDirName = jarLocation.getParent(); // to get the parent dir nam... | 5 |
@SuppressWarnings("resource")
public void login() {
while (true) {
System.out.print("Enter username: ");
String DB_USERNAME = new Scanner(System.in).nextLine();
System.out.print("Enter password: ");
String DB_PASSWORD = new Scanner(System.in).nextLine();
ds = new DataSource(DB_URL, DB_USERNAME, DB_PAS... | 2 |
@Override
public void draw(Graphics2D drawScreen, int offsetX, int offsetY) {
if (drawRequired) {
getCurrentGraphic().draw(drawScreen, (int) (offsetX + getX()), (int) (offsetY + getY()));
}
} | 1 |
public static String getHost(String vncServerName) {
int colonPos = vncServerName.lastIndexOf(':');
while (colonPos > 0 && vncServerName.charAt(colonPos - 1) == ':')
colonPos--;
if (colonPos == 0)
return "localhost";
if (colonPos == -1)
colonPos = vncServerName.length();
return vnc... | 4 |
public Object evalExpValue(MTuple tuple, MExp exp) throws SQLException {
Object o2 = null;
if(exp instanceof MConstant) {
MConstant c = (MConstant)exp;
switch(c.getType()) {
case MConstant.COLUMNNAME:
Object o1 = tuple.getAttValue(c.getValue());
if(o1 == null)
... | 7 |
private void updateGroupMembers() {
int selectedIndex = groupsList.getSelectedIndex();
if (selectedIndex != -1) {
listModelgroupMembers.removeAllElements();
if (selectedIndex == 0){
groupMembers = null;
groupMembers = Frame.getClient().getDataStorage().users().getAllUsers();
for (String i:groupMem... | 4 |
public static void testFunction(Function subject) {
for(double i = -1; i < 1; i+=0.1) {
System.out.println(subject.toString(""+i)+"="+subject.evaluate(i));
}
} | 1 |
public boolean DoesSatisfyConditions() {
boolean doesSatisfy = true;
Iterator<Condition> iter = conditions.iterator();
while (iter.hasNext()) {
Condition c = iter.next();
if (! c.IsSatisfied()) {
doesSatisfy = false;
}
}
if ((type == null || type.equals("single")) && used == true) {
doesSatisf... | 5 |
@Test
public void onlyBishopOnEmptyBoard() {
Map<String, Integer> figureQuantityMap = new HashMap<>();
figureQuantityMap.put(BISHOP.toString(), 2);
Chessboard chessboard = Chessboard.newBuilder(figureQuantityMap)
.withDimension(DIMENSION_6)
... | 7 |
@Override
public Component getListCellRendererComponent(
final JList<? extends Symmetry<?>> list, final Symmetry<?> value,
final int index, final boolean isSelected, final boolean cellHasFocus) {
if (value.coxeter().length() > 0) coxeter.setText("C: " + value.coxeter());
if (value.schoenflies().... | 7 |
@RequestMapping(method = RequestMethod.DELETE, value = "{id}")
public void deleteTask(@PathVariable("id") Integer id) {
stepsService.deleteById(id);
} | 0 |
public boolean canExistingBlockSeeTheSky(int var1, int var2, int var3) {
if (var1 >= -32000000 && var3 >= -32000000 && var1 < 32000000 && var3 <= 32000000) {
if (var2 < 0) {
return false;
} else if (var2 >= 128) {
return true;
} else if (!this.... | 7 |
public AdjacencyList(String fileName, int sz)throws IOException, NumberFormatException{
n=sz;
vertexCount=(n-1);
adj = (List<Integer>[])new List[n];
for (int i = 1; i < n; i++)
adj[i] = new ArrayList<Integer>();
readFile(fileName);
for(int p=1;p<n;p++){
// System.out.println(outEdges(p));
// ... | 6 |
@SuppressWarnings( { "unchecked", "rawtypes" } )
public List<DefaultItem<?>> getDefaultItems() {
// all the Items are DefaultItems
return (List) getItems();
} | 1 |
* @return boolean
*/
public static boolean logicModuleP(Module self) {
{ boolean testValue000 = false;
if (self == Logic.$PL_KERNEL_MODULE$) {
testValue000 = true;
}
else {
{
{ boolean foundP000 = false;
{ Module m = null;
Cons iter000 = s... | 6 |
void zapis_Q_do_pliku(int numer_agenta)
{
FileOutputStream fos = null;
File file = new File("Qagenta" +numer_agenta+ ".txt");
try {
fos = new FileOutputStream(file);
} catch (FileNotFoundException fnfe) {
System.out.println("Brak pliku!");
}
... | 7 |
private void btnPrestarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrestarActionPerformed
String text = txtBuscar.getText().toString();
ArrayList<Libros> rows = new ArrayList<>();
LibrosCRUD pdao = new LibrosCRUD(MyConnection.getConnection());
Libros lib;
... | 5 |
public double getDouble(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number
? ((Number)object).doubleValue()
: Double.parseDouble((String)object);
} catch (Exception e) {
throw new JSONEx... | 2 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
String nom=TxtNom.getText();
Double prix=0.0;
String lieu=TextLieux.getText();
if( !"".equals(TxtPrix.getText()))
{
prix=Double.parseDouble(TxtPrix.getText());
}
String type=Combotype.getSelectedIt... | 5 |
protected void updateAsMobile() {
//
// Firstly, check whether you even need to exist any more-
super.updateAsMobile() ;
if (
(! followed.inWorld()) ||
! followed.mind.agenda().includes(tracked)
) {
if (passenger != null) {
////I.say("Depositing passenger...") ;
fi... | 5 |
@Test
public void oneOunceEqualTwoTablespoon(){
ArithmeticQuantity oz = new ArithmeticQuantity(1, Volume.OUNCE);
ArithmeticQuantity tbs = new ArithmeticQuantity(2, Volume.TABLESPOON);
assertEquals(oz, tbs);
assertEquals(tbs, oz);
} | 0 |
private String getURLContent(String url) throws IOException {
StringBuilder str = new StringBuilder();
HttpURLConnection conn = (HttpURLConnection) new URL(url)
.openConnection();
try (BufferedInputStream in = new BufferedInputStream(
conn.getInputStream())) {
int c;
while ((c = in.read()) != -1) {
s... | 1 |
@Override
protected int getStateFromNeighbours(int currentState, int[] neighbours)
{
int deadNeighbours = countState(DEAD, neighbours);
int humanNeighbours = countState(HUMAN, neighbours);
int zombieNeighbours = countState(ZOMBIE, neighbours);
if (currentState == DEAD)
{
if (humanNeighbours == 3)
... | 9 |
public static String getConfigurationText(Object o) {
if(o instanceof String) {
return o.toString();
}
if(o instanceof java.awt.Color) {
Color c = (Color) o;
return "r=" + c.getRed() + ",g=" + c.getGreen() + ",b=" + c.getBlue();
}
return o.toString();
} | 2 |
public void setDay(int days) {
DefaultComboBoxModel<Integer> model = (DefaultComboBoxModel<Integer>) day
.getModel();
model.removeAllElements();
for (int i = 1; i <= days; ++i)
model.addElement(i);
} | 1 |
public boolean existConnection(int id) {
ListElement current = head;
while (current != null) {
if (current.getId() == id) {
return true;
}
current = current.getNext();
}
return false;
} | 2 |
public void printInfoChild(INodeMenu child){
System.out.println("Name: " + child.getText());
System.out.println("Weight: " + child.getWeight());
System.out.println("Url: " + child.getUrl());
String iconUrl = child.getIconUrl();
if(iconUrl != null){
System.out.println("Icon url: " + iconUrl);
}
... | 4 |
public void testPingPong () throws IOException {
final AtomicInteger stringCount = new AtomicInteger(0);
final Server server = new Server();
startEndPoint(server);
server.addListener(new Listener() {
public void connected (Connection connection) {
connection.sendTCP("TCP from server");
connection.se... | 4 |
public void run() {
try {
Output.printClockLn("Glücksrad", 1);
String s = Utils.getString("guild_challenge/index");
int i = s.indexOf("var flashvars = {");
i = s.indexOf("var flashvars = {", i + 1);
i = s.indexOf("var flashvars = {", i + 1);
s = s.substring(s.indexOf("guild_id:", i + 1));
s = s.... | 4 |
private void ArrInst(String name) {
String size;
boolean error = false;
if(current.getId().equals("NEW")) {
nextToken();
if(current.getId().length() > 4 && current.getId().substring(0,4).equals("TYPE")) {
if(current.getId().equals(Values.getType(name))) {
nextToken();
if(current.getId().eq... | 8 |
private static boolean loadParameter(String line) {
String[] parts;
try {
parts = line.split(" ");
} catch (PatternSyntaxException e) {
return false;
}
if (parts.length != 2)
return false;
ParameterCode code = getParameterCode(parts[0]);
if (code == ParameterCode.NO_CODE)
return false;
tr... | 9 |
public static void warnAboutNonDirectSupers(Stella_Class renamed_Class) {
if (renamed_Class.multipleParentsP() &&
Stella_Class.createNativeClassP(renamed_Class)) {
{ List directsupers = renamed_Class.classDirectSupers;
{ Surrogate renamed_Super = null;
Cons iter000 = directsupers.th... | 8 |
public void decodeCharacter (StringBuffer buffer, String msg, int offset)
{
if (offset >= msg.length())
return;
if (decoder.get(msg.charAt(offset)) instanceof Object[]) {
Object[] array = (Object[]) decoder.get(msg.charAt(offset));
for (int k = 0; k < array.lengt... | 5 |
protected void onKick(String channel, String kickerNick, String kickerLogin, String kickerHostname, String recipientNick, String reason) {} | 0 |
public boolean hasNonIndentTabsOrMultipleCarriageReturns() {
int lnth=space.length();
if (lnth<2) {
return false;
}
if (lnth<4 && !space.contains("\\t")) {
return false;
}
return true;
} | 3 |
private static void connectAndAuthenticate() {
try {
Mongo mongo = new Mongo("localhost", 27017);
DB db = mongo.getDB("paldb");
boolean auth = db.authenticate("pal", "admin123".toCharArray());
DBCollection collection = db.getCollection("users");
logger.debug("collection: " + collection);
logger.... | 2 |
public static String task2(String expression) {
int openBrackets = 0;
for(int i=0; i<expression.length(); i++) {
if(expression.charAt(i) == '(') {
openBrackets ++;
}
if(expression.charAt(i) == ')' && openBrackets>0) {
openBrackets --;
... | 7 |
@Override
public boolean supportsComments() {return true;} | 0 |
public void startElement(String uri, String localName, String qName,Attributes attributes) throws SAXException {
// Check an element has a value //
if (attributes.getLength()>0) {
// Get the elements value //
String aval=attributes.getValue(0);
// MMSI
if (qName.equals("mmsi")) {
mmsi=... | 4 |
private EntityManagerFactorySingleton() {
} | 0 |
private void schedule_MinMin(Vector<Task> metaSet, int currentTime){
/*We do not actually delete the task from the meta-set rather mark it as removed*/
boolean[] isRemoved=new boolean[metaSet.size()];
/*Matrix to contain the completion time of each task in the meta-set on each machine.*/
... | 7 |
public Player getPlayer(Color c)
{
if (c == Color.NONE) {
return ai;
}
for (Player player: players) {
if (player != null && player.getColor() == c) {
return player;
}
}
return null;
} | 4 |
@Override
public String toString() {
String s = "";
if (this.props != null) {
s = "Skin data:\n";
s += "[" + super.toString() + "]\n";
s += this.props.toString();
} else {
s = "Uninitialized skin object.";
}
return s;
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Room other = (Room) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (n... | 9 |
public void setPepIdElemento(int pepIdElemento) {
this.pepIdElemento = pepIdElemento;
} | 0 |
@Override
public void keyPressed(KeyEvent e) {
switch ((int) e.getKeyCode()) {
case 38: // up
if (curDir != Direction.moveToDown)
newDir = Direction.moveToUp;
break;
case 40: // down
if (curDir != Direction.moveToUp)
newDir = Direction.moveToDown;
break;
case 37: // left
if (curDir != Di... | 8 |
public Entities[][] itemEnumsInArea (Area a) {
Entities[][] enumObjects = new Entities[board.length][board[0].length];
for (int x = 0; x < board.length; x++) {
for (int y = 0; y < board[0].length; y++) {
InanimateEntity on = board[x][y].getOn();
if (on != null && a.contains(board[x][y])) {
enumObjec... | 4 |
public PNGDecoder(InputStream input) throws IOException {
this.input = input;
this.crc = new CRC32();
this.buffer = new byte[4096];
this.readFully(buffer, 0, SIGNATURE.length);
if(!checkSignature(buffer)) {
throw new IOException("Not a valid PNG file");
... | 7 |
public String getDesc() {
return this.desc;
} | 0 |
private boolean checkValidLetters(String number) {
for (char c : number.toCharArray()) {
float value = getValue(c);
if (value < 0) {
statusCode = 1;
return false;
}
}
return true;
} | 2 |
public void clearHedrons()
{
for(int i=0; i<shapes.size(); i++)
{
if(shapes.get(i).getPoints().size()==0 && !shapes.get(i).isSelected())
{
shapes.remove(i);
i--;
}
}
} | 3 |
public String labelDataforPredict(String predictData)
throws NumberFormatException, IOException {
String predict_out = predictData.substring(0, predictData.indexOf(".")) + "_labeled.txt";
File fout = new File(predict_out);
if (fout.exists()) {
fout.delete();
}
BufferedWriter bw = new BufferedWriter(new... | 8 |
private void encodeRefresh(ItemInfo itemInfo, Object[] orderEntries, boolean completed, boolean solicited)
{
OMMMsg outmsg = _mgr.getPool().acquireMsg();
outmsg.setAttribInfo(itemInfo.getOMMAttribInfo());
outmsg.setItemGroup(0);
// Set the message type to be refresh respons... | 6 |
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
PrimaryUserTable model = (PrimaryUserTable) table.getModel();
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, c... | 1 |
public void pause() {
if (!isPlaying()) {
return;
}
synchronized (MP3Player.this) {
isPaused = true;
MP3Player.this.notifyAll();
}
} | 1 |
public short getIntValue() {
short result;
switch (code) {
case iconst_0:
result = 0; break;
case iconst_1:
result = 1; break;
case iconst_2:
result = 2; break;
case iconst_3:
result = 3; brea... | 9 |
@Override
public void run() {
while(true) {
boolean b;
synchronized (requests) {
b = !requests.isEmpty();;
}
Request req;
while (b) {
synchronized (requests) {
req = requests.remove(0);
}
searchPage(req);
synchronized (requests) {
b = !requests.isEmpty();
}
}
... | 3 |
public boolean searchMatrix(int[][] matrix, int target) {
// Start typing your Java solution below
// DO NOT write main() function
if (matrix.length == 0 || matrix[0].length == 0) {
return false;
}
if (matrix.length == 1) {
return searchRow(matrix[0], target);
}
int row = 0;
for (row = 0; row < ma... | 7 |
public static Stella_Object accessConditionalAntecedentProofAdjunctSlotValue(ConditionalAntecedentProofAdjunct self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Logic.SYM_LOGIC_PROVABLE_RULE) {
if (setvalueP) {
self.provableRule = ((Proposition)(value));
}
el... | 6 |
public Grille randomize() {
for (int i = 0; i < grid.length; i++) {
for (int j = 0; j < grid[0].length; j++) {
grid[i][j] = new Random().nextBoolean(); // Ça devrait être une méthode statique
}
}
return this;
} | 2 |
public void setSpeedAbs(double xspeed, double yspeed) {
if (xspeed < 0.0) {
xdir = -1;
this.xspeed = -xspeed;
} else if (xspeed == 0.0) {
xdir = 0;
this.xspeed = 0;
} else {
xdir = 1;
this.xspeed = xspeed;
}
if (yspeed < 0.0) {
ydir = -1;
this.yspeed = -yspeed;
} else if (yspeed == 0... | 4 |
@Override
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
if (DATA_FLAVOR.equals(flavor)) {
return mDockable;
}
throw new UnsupportedFlavorException(flavor);
} | 1 |
@Override
protected void drawInternalU(UGraphic ug, Area area) {
final StringBounder stringBounder = ug.getStringBounder();
final double textHeight = getTextHeight(stringBounder);
ug = ug.apply(new UChangeColor(getForegroundColor()));
final double xRight = arrowWidth - 3;
if (getArrowConfiguration().isDott... | 9 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ItItemHasEmpleado)) {
return false;
}
ItItemHasEmpleado other = (ItItemHasEmpleado) object;
if ((this.itItemHas... | 5 |
public static int[] getWindowsAttributes(String portName) throws IOException, SerialException {
String[] command = { "cmd.exe", "/c", winCmd.replace("?", portName)};
Process p = Runtime.getRuntime().exec(command);
String output = new BufferedReader(new InputStreamReader(p.getInputStream())).read... | 9 |
public void setBumoncode(int bumoncode) {
this.bumoncode = bumoncode;
} | 0 |
public synchronized void setOperator(String op) {
if (op.equals(ADD)) {
this.op = ADD;
} else if (op.equals(SUBTRACT)) {
this.op = SUBTRACT;
} else if (op.equals(MULTIPLY)) {
this.op = MULTIPLY;
} else if (op.equals(DIVIDE)) {
this.op = DIVIDE;
} else {
System.out.println("Undefined Operator in... | 4 |
@Override
public void unsafe_set(int row, int col, double val) {
if( row != 0 && col != 0 )
throw new IllegalArgumentException("Row or column must be zero since this is a vector");
int w = Math.max(row,col);
if( w == 0 ) {
a1 = val;
} else if( w == 1 ) {
... | 8 |
private void getActionsResults(String actionItem) {
titleDLM.removeAllElements();
switch (actionItem) {
case CASECLAIM:
getClaimList();
break;
case CASESUBCLAIM:
getSubClaimList();
break;
case CASEEVIDENCE:
getEvidenceList("evidence");
break;
case CASECOUNTERCLAIM:
getCounterClaimList()... | 8 |
public void test_23() throws IOException {
String vcfFileName = "tests/test.chr1.vcf";
int MAX_TEST = 1000;
Random random = new Random(20130217);
// Index file
System.out.println("Indexing file '" + vcfFileName + "'");
FileIndexChrPos idx = new FileIndexChrPos(vcfFileName);
idx.setVerbose(verbose);
idx... | 7 |
@Override
public boolean evaluate(Auction t) {
ArrayList<Auction> temp = new ArrayList<Auction>(searches.values());
for(Auction auc : temp){
if(auc.getName().equalsIgnoreCase(criteria)){
temp.add(auc);
}
}
return t.getName().contains(criteria) || t.getDescription().contains(criteria);
} | 3 |
public void mouseReleased(MouseEvent e) {
if (!enabled)
return;
pressed = false;
if (entered) {
setModal("entered");
} else {
setModal("");
}
} | 2 |
public void dispose() {
try {
in.close();
System.out.println("dispose() successful");
} catch (IOException e2) {
throw new RuntimeException("in.close() failed");
}
} | 1 |
public static JSONValue parse(TokenReader tokens, String token)
throws IOException, ParseException {
JSONArray result = new JSONArray();
if ((token = tokens.next()).equals("]")) {
return result;
}
do {
result.add(JSONValue.parse(tokens, token));
if (!(token = tokens.next()).equals(",")) {
brea... | 3 |
public String toRow() {
if (columns.size() == 0) {
return "";
}
StringBuilder builder = new StringBuilder();
Iterator iterator = columns.iterator();
while (iterator.hasNext()) {
builder.append(iterator.next());
if (iterator.hasNext()) {
builder.append(outputDelimiter);
}
}
return builder.t... | 3 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.