method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
896e76c8-19e3-4c96-80b6-5e01772026ec | 4 | public Slot relink(Slot rest) {
if (strongkey() != null && strongvalue() != null) {
if (rest == null && this.next == null) {
return this;
} else {
return copy(rest);
}
} else {
return rest;
}
} |
9d0a7e8c-30be-4a80-a4d4-69a75185a355 | 0 | public REToFSAAction(RegularEnvironment environment) {
super("Convert to NFA", null, environment);
} |
3afb44be-1257-4faa-8339-cb4d5445d1d7 | 0 | @Override
public Address getAddress() {
return super.getAddress();
} |
934d14c4-a476-49c2-a1d0-d57154e3abcb | 9 | protected void setGapSequence(String newGapSequence, int whichGapSequence) {
int sLen = 0;
switch (whichGapSequence) {
case GAP_ONE:
sLen = m_s1_size;
break;
case GAP_TWO:
sLen = m_s2_size;
break;
default:
System.err.pr... |
6bb3f1a0-50a3-4e19-99fb-79984dac9faa | 9 | private void initSocServer(String databaseUserName, String databasePassword, Properties props)
{
printVersionText();
/* Check for problems during super setup (such as port already in use) */
if (error != null)
{
System.err.println("* Exiting due to network setup ... |
e0475046-c8e7-4c86-8612-8b4336080e33 | 8 | @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void handleClickEvent(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if(!event.hasBlock() || (event.getAction() != Action.RIGHT_CLICK_BLOCK) || !player.hasPermission("rcost.use"))
{
... |
143acbbc-688b-4dd7-a26a-5f8e1a436f4d | 8 | private String makeHeader(String nameOp, String variant,
boolean add, boolean hasAlpha, boolean hasAux,
boolean tranA, boolean tranB)
{
if( add ) nameOp += "Add";
// make the op name
if( tranA && tranB ) {
nameOp += "Tr... |
8e445468-2505-4fe6-8e31-308069750c89 | 3 | @Override
public String[] getTableRenameStatements(String oldTableName, Class<?> oldClass, String newTableName,
Class<?> newClass)
{
// get a comma-separated list of implemented fields
ObjectStack oldStack = new ObjectStack(this, oldClass);
ObjectRepresentation oldRep = oldStack.getActualRepresentation();
... |
8872a5a6-b2a4-4045-9a6c-7d56634bf763 | 2 | public static String replace(String... cols) {
StringBuilder sb = new StringBuilder();
for (int i=0; i<cols.length; i++) {
sb.append(",?");
}
return cols.length > 0 ? sb.substring(1) : "";
} |
68ea924b-cb23-4b01-9116-50e9056adc4e | 8 | public static Punkt3D relativeToAbsolutePunkt3D(Punkt3D punkt,int direction)
{
Punkt3D p = new Punkt3D(punkt);
if(direction == Consts.NORTH)
{
p.setX(p.abs()/Math.sqrt(2));
p.setY(p.abs()/Math.sqrt(2));
}
else if(direction == Consts.EAST)
{
... |
631bd4a9-abdb-4524-8ec5-080873a2c390 | 1 | public void remover(FonteFinanciamento fontefinanciamento) throws Exception
{
String sql = "DELETE FROM fontefinanciamento WHERE id = ?";
try
{
PreparedStatement stmt = ConnectionFactory.getConnection().prepareStatement(sql);
stmt.setLong(1, fontefinanciamento.getId());
stmt.executeUpdate();
}
ca... |
1919ee21-9be8-4a3e-8b9a-03823c3c554b | 9 | public boolean equals(Object other) {
if (other instanceof TypeName) {
if (super.equals(other)) {
// check types
boolean valid = false;
if (mType == null) {
valid = (null == ((TypeName)other).getType());
}
... |
e0576054-81fc-468a-8b72-3a1026846ed8 | 2 | public int maxProfit3(int[] prices) { // can also get least lost
int maxp = prices[1] - prices[0];
int diff = 0;
for (int i = 0; i < prices.length - 1; i++) {
if (diff >= 0)
diff += prices[i + 1] - prices[i];
else
diff = Math.max(diff, prices[i + 1] - prices[i]);
maxp = Math.max(diff, maxp);
}
... |
0afd7424-711d-4507-8167-a1c9ac766a00 | 3 | private String getMessageSeparatorNodeValue(final Document doc) {
Node messageNode = this.getFirstLevelNodeByTag(doc, MESSAGE_TAG);
if (messageNode == null) {
return null;
}
Node separatorNode = this.getNodeByTagInNode(messageNode, MESSAGE_SEPARATOR_TAG);
if (separatorNode == null) {
return null;
}
... |
c2ea0c02-fc64-4ba4-a045-63bdcc663687 | 3 | public boolean isNearlyUnit(double tolerance){
boolean test = true;
for(int i=0; i<this.numberOfRows; i++){
for(int j=0; j<this.numberOfColumns; j++){
if(Math.abs(this.matrix[i][j] - 1.0D)>Math.abs(tolerance))test = false;
}
}
return test;
... |
9e095291-c419-4ebd-8bec-ab6a901f06e0 | 3 | private void initialisiereRaeume()
{
for(Raum raum : _connections.keySet())
{
raum.verbindeZweiRaeume(TextVerwalter.RICHTUNG_NORDEN,
_connections.get(raum)[0], TextVerwalter.RICHTUNG_SUEDEN);
raum.verbindeZweiRaeume(TextVerwalter.RICHTUNG_OSTEN,
_connections.get(raum)[1], TextVerwalter.RICHTUNG_WE... |
ce55807e-6424-4555-bede-228f00bb9e20 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
UserDetailsImpl other = (UserDetailsImpl) obj;
if (password == null) {
if (other.password != null)
return false;
} else if (!password.eq... |
0bbc5c7c-71bd-4e9f-a6c6-a80fd2fb43dc | 7 | public int[] readNewLines() {
int[] r = {-1, nextReadedNumber};
CSVParser csvParser = null;
try {
csvParser = new CSVParser(new FileInputStream(logPath));
for (int i = 0; i < nextReadedNumber; i++) {
csvParser.getLine();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
return r;
}... |
aa75e4b5-635d-4251-bbc4-9527b2bd6d80 | 3 | public List<Schat> zoekAlleSchatten()
{
List<Schat> schatten = new ArrayList<>();
try (Connection conn = DriverManager.getConnection(JDBC_URL)) {
PreparedStatement queryAlleSchatten = conn.prepareStatement("SELECT * FROM SCHAT");
try (ResultSet rs = queryAlleSchatten.execute... |
6f9f870e-1d6b-4dce-a805-804e648c4e54 | 4 | private void prepareResults()
{
// Preparing the results.
if (progress != null) {
this.progress.progress(NbBundle.getMessage(LabelPropagationClusterer.class, "LabelPropagationClusterer.preparingResults"));
}
// regroup nodes into separate groups based on their la... |
1acdc3a5-05bb-43dc-bacf-d265a8a56442 | 5 | public static void main(String args []) throws ParseException
{
EG1 parser = new EG1(System.in);
while (true)
{
System.out.println("Reading from standard input...");
System.out.print("Enter an expression like \u005c"1+(2+3)*4;\u005c" :");
try
{
switch (EG1.one_line())
... |
6c630ae7-f2e6-439d-825b-866e42e0d503 | 3 | public static void moveFile(Path file, Path destination) throws IOException {
if ((file == null) || !Files.exists(file, LinkOption.NOFOLLOW_LINKS) || (destination == null)) {
IllegalArgumentException iae = new IllegalArgumentException("The filepath is null or points to an invalid location! " + file)... |
9077a56f-eafa-4150-a099-e0888d984141 | 8 | * @return True if the contents of the objects are equal.
*/
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
@SuppressWarnings("unchecked")
final BloomFilter... |
ebcc4111-35d1-4ba0-be86-eacf87de8f27 | 6 | private static int[] read_s3m_sequence( byte[] s3m_file ) {
int num_pattern_orders, sequence_length;
int sequence_idx, order_idx, pattern_order;
int[] sequence;
num_pattern_orders = get_num_pattern_orders( s3m_file );
sequence_length = 0;
for( order_idx = 0; order_idx < num_pattern_orders; order_idx++ ) {
... |
846f6ef2-0fdb-4398-8a2c-f79c652882e0 | 7 | protected boolean isFullHouse(final Deck deck) {
usesLow = true;
usesAllCards = false;
high = null;
low = null;
for (Rank rank : Rank.values()) {
if (high == null && deck.getRank(rank).size() >= 3) {
high = rank;
} else if (low == ... |
d97c7bc0-c8a5-4e4b-861c-d5411d93ab34 | 1 | @Override
public void update(Observable arg0, Object arg1) {
if (!(arg0 instanceof logic.GekozenAntwoord)) return;
Onderdeel onderdeel = ((logic.GekozenAntwoord) arg0).getGekozenOnderdeel();
comboBoxModel.setSelectedItem(onderdeel);
revalidate();
repaint();
} |
1bbd1e62-80ca-4800-9415-87a1cddb997e | 6 | public void run() {
jdbcValueReader = jdbcValueReaderProvider.getValueReaderFor(desc
.getTargetTable());
final List<String> sourceColumns = allSourceColumns();
FutureTask<TableHash> futureSourceHash = futureSourceHash(sourceColumns);
FutureTask<TableHash> futureTargetHash = futureTargetHash(sourceColumns);... |
0a81f2dd-cc41-420c-bf59-ebc00daeceba | 9 | protected static Vector<String> toBraille(String strTextPass,
boolean clearChinese) throws NullPointerException {
strTextPass = strTextPass.replaceAll("[\\s\\n]+", " ");// 替换连续空白符
logger.log(Level.INFO, "处理连续空白符:" + strTextPass);
strTextPass = strTextPass.trim();
logger.log(Level.INFO, "处理首尾空白符:" + strTextPa... |
900fa129-dac6-45bc-bd41-166440d6fe83 | 1 | public ArrayList viewMyBooking() {
ArrayList temp = new ArrayList();
Query q = em.createQuery("SELECT t from BookingEntity t");
for (Object o : q.getResultList()) {
BookingEntity p = (BookingEntity) o;
System.out.println("viewbooking: reached 1" + userId);
Sy... |
41632d48-a1bb-4a83-b5bb-5e0b2294d9fa | 5 | private String conseguirImagenes( String ci ){
// Datos del servidor identikitServer
Socket unSocket = null;
PrintWriter out = null;
BufferedReader in = null;
String respuesta = null;
try {
// Se crea el socket que se conectara con el servidor ServidorIdentikit
unSocket = new Socket(... |
3c91abb4-1aee-48dd-95a5-b42b19cafeed | 5 | private void btnAgregarActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
a.AgregarProceso(txtNombre.getText(), Integer.parseInt(txtRafaga.getText()));
if (a.getSizeArray() < 15) {
for (int i = 0;... |
acd6a34d-cccb-4e5d-997d-74c834efc8f1 | 1 | public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
ResultSetMetaData metaData = rs.getMetaData();
int columnCount = metaData.getColumnCount();
Map<String, Object> mapOfColValues = createColumnMap(columnCount);
for (int i = 1; i <= columnCount; i++) {
String key = getColumnKey(J... |
7c6f7c8f-de66-45a9-80e4-1d70416146a1 | 6 | public boolean continueExecuting()
{
EntityLiving var1 = this.taskOwner.getAttackTarget();
if (var1 == null)
{
return false;
}
else if (!var1.isEntityAlive())
{
return false;
}
else if (this.taskOwner.getDistanceSqToEntity(var1... |
65a39ed9-a8c4-4903-9d74-18dc03f03f2c | 2 | public ASTree compute(int op, ASTree right) {
if (right instanceof IntConst)
return compute0(op, (IntConst)right);
else if (right instanceof DoubleConst)
return compute0(op, (DoubleConst)right);
else
return null;
} |
db7ad517-98e2-47cc-b1ca-5694e18b2a54 | 3 | public GestionarCliente() {
try{
//obtenemos el driver de para mysql
Class.forName("org.gjt.mm.mysql.Driver");
//obtenemos la conexión
connection = DriverManager.getConnection(url,login,password);
}
catch(SQLException e){
System.out.pri... |
4d02064b-72f9-490e-820f-7fd05600f3cb | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
3438df9b-d0fb-4075-8009-42747b143040 | 6 | private static String parseString(String s)
{
final StringBuilder sb = new StringBuilder();
boolean add = false;
for (int i = 0; i < s.length(); i++)
{
if (s.charAt(i) == '"')
{
if (i > 0 && s.charAt(i - 1) != '\\' || i == 0)
{
add = !add;
}
else
{
sb.append(s.charAt(i));
... |
c56fd3f7-408f-4ca6-a724-77c784eef9ba | 6 | public static Keyword tryScanPartialPropositionsProof(ControlFrame frame) {
{ Proposition proposition = frame.proposition;
Iterator iterator = ((Iterator)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_STELLA_ITERATOR, null)));
Keyword result = Logic.KWD_FAILURE;
if (iterator == null... |
fd2f9f07-1d95-48e3-9d7e-6410d190e768 | 4 | private void setActionEnablement(StructuredSelection ss) {
if (ss == null) {
return;
}
Map<String, Object> config = new HashMap<String, Object>();
Object sel = ss.getFirstElement();
if (sel instanceof String || sel instanceof AliasTask) {
String task = "";
if (sel instanceof String) {
task = (Str... |
b0a6ef0e-b2c6-4eb4-850f-edc54f8af638 | 9 | int calcHbondEnergy(Atom nitrogen, Point3f nitrogenPoint,
Point3f hydrogenPoint, AminoMonomer target) {
Point3f targetOxygenPoint = target.getCarbonylOxygenAtomPoint();
/*
* the following were changed from "return -9900" to "return 0"
* Bob Hanson 8/30/06
*/
float distO... |
1b07d1bb-0245-4942-a3ed-34576a23dc37 | 8 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if(!(affected instanceof MOB))
return;
final MOB mob=(MOB)affected;
if((msg.amISource(mob))
&&(msg.tool()!=this)
&&(!CMath.bset(msg.sourceMajor(),CMMsg.MASK_CHANNEL))
&&((CMath.bset(msg.sour... |
59719039-313f-48be-8afd-a0a7cea5d3c5 | 9 | public void handshake() throws Exception {
generateHash();
sendHandshakeMessage("hash:" + clientInfo.hashID);
sendHandshakeMessage("username:" + clientInfo.username);
sendHandshakeMessage("ipaddress:" + clientConnection.getLocalAddress().toString());
sendHandshakeMessage("port:" + Integer.toString(clientConne... |
25ebf279-32ca-48ba-8099-c2093698a453 | 6 | private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
... |
64cb8006-e3cc-4a86-bc13-ab5e9e646a1a | 6 | public static void main(String[] args){
//creating list
List<Integer> l1=new ArrayList<Integer>();
//adding elements to list
l1.add(1);
l1.add(2);
l1.add(1);
l1.add(3);
l1.add(4);
l1.add(1);
l1=Collections.unmodifiableList(l1);//Read-Only collection
//Collections.replaceAll(l1, 1, 100);
int size=l1.size()... |
86ae7b98-0206-4c13-ae7f-4b5093f5c0df | 4 | public List<Hoja> getListaHoja(){
LinkedList<Hoja> ListaHoja = new LinkedList();
Conexionbd.conexion bd = new Conexionbd.conexion();
bd.conectarBase();
ResultSet rs;
try {
rs = bd.sentencia.executeQuery("SELECT * FROM CATEGORIA WHERE TIPO = 'h... |
6cf41dcf-dbae-4691-a07f-882fafaa5a66 | 2 | public String getShortTime12(){
int hourI = cal.get(Calendar.HOUR);
int amPm = cal.get(Calendar.AM_PM);
this.shortTime12 = (new Integer(hourI)).toString();
int minI = this.getMinute();
if(minI<10){
this.shortTime12 += ".0" + minI;
}
else{
... |
347e0c6f-e49e-4af7-becb-80e680080a5d | 9 | public void target() {
GameActor t = getTargetedActor();
if(t != null) {
PhysicsComponent tPC = (PhysicsComponent)t.getComponent("PhysicsComponent");
if(tPC != null) {
PhysicsComponent ownPC = (PhysicsComponent)getOwningActor().getComponent("PhysicsComponent");
... |
99495ce2-d9e3-4561-8340-3c23704927fc | 1 | *
* @throws UnknownHostException if cyc server host not found on the network
* @throws IOException if a data communication error occurs
* @throws CycApiException if the api request results in a cyc server error
*/
public int converseInt(Object command)
throws UnknownHostException, IOException, C... |
7a2b1a27-902f-4af5-8901-1b0ed78e707b | 4 | public static String readFile(String pathname) {
File file = new File(pathname);
StringBuilder fileContents = new StringBuilder((int)file.length());
Scanner scanner = null;
try {
scanner = new Scanner(file);
} catch (FileNotFoundException e) {
System.err.println("FILE PATH INVALID");
e.printStack... |
df6980d3-6f8f-4d26-aeee-6fe978d262f2 | 5 | public void preCalc() {
List<Entity> entities = Game.getInstance().getEntities();
double minDst = Agent.visualRange + 1;
for (Entity e : entities) {
if (e.getClass().equals(FoodEntity.class) && owner.sees(e)) {
double distance = Math.sqrt(owner.distanceSquared(e));
if (minDst > distance)
minDst = ... |
a9280dd5-a64b-4273-a987-dd5295909b2d | 5 | private void assignJobs() {
ServerSideJob job;
final Collection<Communicator> clients = clientManager.getClients();
Collection<Communicator> comms;
while (!jobQueue.isEmpty() && isAnyClientFree(clients)) {
comms = pickOnlineClients(clients);
for (Communicator com... |
25e653d2-9b36-490f-a4f2-7dbea563c86b | 0 | @Test
public void insertLastAddsAtTheEndOfList() {
l.insertLast(a);
l.insertLast(b);
assertEquals(b, l.max());
} |
3fc5e946-d33f-43d3-bcbd-4823dbab551b | 6 | public void deleteAccount(final String username) throws IOException {
if( username.equals("admin") ) {
throw new IOException("Cannot delete admin");
}
final StringBuffer doReload = new StringBuffer();
/**
* For some reason, ON DELETE CASCADE referencing valid_accounts produces a weird derby e... |
73494ba2-7a98-4fe1-b04a-922f0a2929c4 | 2 | public ROPacketTransmitter(ROJoystickHandler assignedJoystickHandler) {
try {
ipAddr = InetAddress.getByName("10.0.0.22");
} catch (Exception e) {
System.out.println(e.toString());
}
joystickHandler = assignedJoystickHandler;
try {
serverSocke... |
5236cc8a-e293-490e-9dba-7fb09578ec5b | 8 | @Override
public void run() {
try {
reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
writer = new PrintWriter(socket.getOutputStream(), true);
// Read client requests
while ((request = reader.readLine()) != null) {
String parts[] = request.split("_");
switch (parts[0... |
dab6a4a2-f055-4c1f-abf4-4159a7aff498 | 0 | public ThreadVersionCheck()
{
super("Mattparks Version Check Thread");
} |
adbde0ed-ea12-4c2c-85ed-a412d4717b3a | 7 | private void addBallsFromQueue() {
int numBallsToDoInNextCall = 0;//Used to make the method stop when this number of elements
//is in the queue.
Ball waiting = toAdd.peek();
boolean spaceFree = true;
for(Ball b : ballarray){
if(waiting.getX()>=b.x-b.getRadius()&&waiting.getX()<=b.x+b.getRadius()
&&wa... |
6dda7b19-be95-4b4c-b0a0-04f60fe7cfe5 | 5 | protected mxRectangle apply(TreeNode node, mxRectangle bounds)
{
mxIGraphModel model = graph.getModel();
Object cell = node.cell;
mxRectangle g = model.getGeometry(cell);
if (cell != null && g != null)
{
if (isVertexMovable(cell))
{
g = setVertexLocation(cell, node.x, node.y);
if (resizeParen... |
77bc8a32-c61b-4bed-afe3-a476b19da639 | 3 | private static boolean isBothTypes(Entity firstEntity, Entity secondEntity, Category firstType, Category secondType) {
return firstEntity.isType(firstType) && secondEntity.isType(secondType) ||
firstEntity.isType(secondType) && secondEntity.isType(firstType);
} |
f34e0ebe-9d63-4ae0-9dfd-eb6f1f3a8148 | 8 | final r ba(r var_r) {
try {
anInt5513++;
if ((anInt5475 ^ 0xffffffff) == -1)
return null;
if (!aBoolean5477)
method675(0);
int i;
int i_24_;
if ((((NativeToolkit) aHa_Sub3_5419).anInt8133 ^ 0xffffffff) >= -1) {
i = (-(anInt5461 * ((NativeToolkit) aHa_Sub3_5419).anInt8133
>>... |
b93d2b35-a8f1-4c5b-aa4a-2063a5c5709a | 8 | public boolean isCellEditable(int row, int col) {
switch (col) {
case 1:
return true;
case 5:
return true;
case 16:
return true;
case 17:
return true;
case 18:
return true;
case 23:
return true;
case 20:
return true;
case 21:
return true;
default:
return false;
}
} |
e9070afa-f8ca-4a58-90dd-9ffc544a2088 | 0 | private void warning(String msg){
DebugUtils.warning("Unable to load module, " + msg);
} |
c99a0261-2a93-4b37-8fba-ad135d6c438e | 7 | private void getTruthTable() {
variables = "";
// on extrait toutes les variables de la fonction
getVariables();
triVariables();
if (variables.length() > 8)
error = new SyntaxErrorException(
Tools.getLocalizedString("TOO_MUCH_VARIABLES"));
// on initialise la table de vérité
TruthTable = new bool... |
b7b0d13a-2333-47e5-84af-e2a0736ba186 | 5 | private void sysCallWrite()
{
int data = m_CPU.popStack();
int addr = m_CPU.popStack();
int deviceID = m_CPU.popStack();
//SOS.debugPrintln("sysCallWrite");
//If the device exists
DeviceInfo di;
if((di = findDevice(deviceID)) != null)
{
//I... |
139aa002-dfa2-4ef9-aaf3-35c3c47ce1c4 | 9 | public boolean pickAndExecuteAnAction()
{
if(beltDisabled && conveyorOn)
{
StopConveyor();
return true;
}
if(conveyorFlagged && conveyorOn)
{
//Turn the conveyor off
//if(sensor2)
if(this.glassList.size() > 0)
{
StopConveyor();
return true;
}
}
/* if(!beltDisabled... |
83007c1a-5038-40df-8669-590730fdc446 | 2 | private float calculateDifferenceBetweenAngles(float firstAngle, float secondAngle)
{
float difference = secondAngle - firstAngle;
while (difference < -180) difference += 360;
while (difference > 180) difference -= 360;
return difference;
} |
7d4dea33-d47c-4ee2-8437-a7aa29688eb7 | 7 | @Override public void process(HttpRequest request, HttpContext context) throws HttpException, IOException {
if (request == null) throw new IllegalArgumentException("HTTP request may not be null");
if (context == null) throw new IllegalArgumentException("HTTP context may not be null");
if (!requ... |
b445a643-c494-4fdb-879c-3471a315c854 | 7 | void load(Connection connection, ValueList list) {
int count = list.getNextInt();
types.clear();
for (int i=0;i<count;i++) {
String eName = list.getNextString();
int eType = list.getNextInt();
ElementType type = new ElementType(eName,eType);
if ((e... |
0d064b49-9c0f-4beb-a5ea-bf3a9673ba98 | 4 | private boolean xIntersects(Vec3D var1) {
return var1 == null?false:var1.y >= this.y1 && var1.y <= this.y2 && var1.z >= this.z1 && var1.z <= this.z2;
} |
7ef4a79c-f6ab-4cfc-baf4-bc86ef821d46 | 5 | public void paint(Graphics g) {
Graphics2D g2D = (Graphics2D) g;
Composite savedComposite = g2D.getComposite();
Paint savedPaint = g2D.getPaint();
boolean isPressed = getModel().isPressed();
boolean isRollover = getModel().isRollover();
int width = getWidth();
i... |
cc83d402-a8e3-452a-a2a9-77301e85e252 | 5 | private void printIsUserExist() throws IOException {
String s;
printMenu(PrintMenuName.IS_USER_EXIST);
while (true) {
s = br.readLine();
System.out.println(s);
if (s.equals("b")) {
break;
} else if (s != null && !s.trim().equals("")) {
System.out.print("User " + s);
System.out.println(user... |
82644516-43db-465e-824e-708fffd46358 | 2 | public void setPreviousGlied(SchlangenGlied glied) {
if (previousGlied != null) {
previousGlied.removeNextGlied();
}
previousGlied = glied;
if (glied.getNextGlied() != this) {
glied.setNextGlied(this);
}
} |
a89ed62f-fe40-4420-8f32-2cae1bc1fec9 | 3 | public static void main(String[] args){
//Setting up some objects to test.
Colour[] four = new Colour[4];
Colour[] five = new Colour[5];
Colour[] six = new Colour[6];
Colour white = new Colour("#FFFFFF");
four[0] = white;
five[0] = white;
six[0] = white;
Colour black = new Colour("#000000");
four... |
fe0f90da-1950-438c-a697-fcf9402ea5f9 | 2 | public void run() {
try {
for (int i = 0; i < 10; i++) {
ResultSet rs = dbc.open(query);
System.out.println("Thread " + id + " executed the query for " + i + " times");
}
Main.pool.releaseConnection(dbc);
} catch (Exception e) {
... |
d1983098-25d3-4ba1-a24c-6e21c8296861 | 9 | @Override public boolean equals ( Object obj ) {
if ( this == obj ) { return true ; }
if ( obj == null ) { return false ; }
if ( this.getClass ( ) != obj.getClass ( ) ) { return false ; }
final Move other = (Move) obj ;
if ( this.isUpDown != other.isUpDown ) { return false ; }
if ( this.word == ... |
f752ba5c-59af-46a5-a2c8-9c8d6b5b2074 | 7 | private void scaleByMax() {
//ammendment to what i may have commented before
//this takes the lowest x and highest x and uses that as the scaling
//factor
double l_x = 5000,h_x = -5000;
for (int noa = 0;noa < m_groupNum;noa++) {
if (l_x > m_groups[noa].m_left) {
l_x = m_groups[noa].m_left;
... |
46a91e9a-6cc8-4268-9764-b0e3869d0a09 | 0 | public void setCanEditFirst(boolean canEdit) {
canEditColumn[1] = canEdit;
} |
c76e3a7f-5771-40ef-8df0-4bd2139aab27 | 9 | public void update(State state, float dt) {
Vector2d updateVelocity = new Vector2d(velocity);
Vector2d force = new Vector2d();
float velocityMagnitude = Vec2dMath.magnitude(velocity);
/**************************************** Mousey Things ****************************************/
if (state.mouseMode ==... |
dde7a924-bd1e-471a-a4c9-37cf1023de7e | 8 | private void growObstaclesPass() {
// grow obstacles
for (int i = 0; i < userObstacles.size(); i++)
((Obstacle) userObstacles.get(i)).growVertices();
// go through paths and test segments
for (int i = 0; i < workingPaths.size(); i++) {
Path path = (Path) workingPaths.get(i);
for (int e = 0; e < path.... |
81b243b3-44a1-4727-9d22-3669cf9a5362 | 2 | public FastqBuilder appendQuality(final String quality) {
if( quality == null ) { throw new IllegalArgumentException("quality must not be null"); }
if( this.quality == null ) {
this.quality = new StringBuilder(quality.length());
}
this.quality.append(quality);
return this;
} |
463778c3-7eee-430d-92a7-e3ef8216d49f | 5 | @Override
public void rotate(int angle) {
Tile[][] trans;
int xtrans = 0, ytrans = 0;
switch (angle) {
case ROTATE_90:
trans = new Tile[bounds.width][bounds.height];
xtrans = bounds.height - 1;
break;
case ROTATE_180:
... |
57ee68a4-5570-4761-9e80-08c2f5d411ec | 7 | @Override
public void unInvoke()
{
// undo the affects of this spell
if(!(affected instanceof MOB))
return;
final MOB mob=(MOB)affected;
super.unInvoke();
if(canBeUninvoked())
{
if((!mob.amDead())&&(CMLib.flags().isInTheGame(mob,false)))
{
if(mob==invoker)
{
if(mob.location()!=null... |
45a360dc-93a9-4d6d-9022-70ed881fa61c | 9 | public void keyReleased( KeyEvent e )
{
//if ( hasFocus )
{
//System.out.println( "Key=" + e ) ;
int kc = e.getKeyCode() ;
if ( Utils.contains( Config.keysPause, kc )
&& ( (steppingState == STEP_CONT_FORWARD)
|| (steppingState == STEP_CONT_BACKWARD)
)
)
tbPauseButtonA... |
514766a3-2359-4675-b9c2-ee8cbd20bf50 | 3 | public void keyTyped(int i) {
if ((i <= 20) || (i > 127)) return;
if (keyBuffer[(kwp & 0x3F)] == 0) {
keyBuffer[(kwp++ & 0x3F)] = (char)i;
doInterrupt = true;
}
} |
05fe7f57-563b-4091-80e2-2a0eab4b723a | 2 | @Override
public boolean add(Object item) {
if (item == null)
throw new IllegalArgumentException();
if (numItems == items.length)
return false; // no more room!
else {
items[numItems] = item;
numItems++;
return true;
}
} |
80f2d886-7814-42be-a7d9-3b4acc358c0b | 3 | private boolean isInside(Point p) {
int x = p.getX();
int y = p.getY();
return x >= 0 && y >= 0 && x < rows[0].length && y < rows.length;
} |
194dc7bf-1076-471a-ac05-2375ed9bc877 | 7 | void nextChar() throws Exception
{
if ((line == null) || (++linePos >= line.length()))
{
line = reader.readLine();
if (line != null)
{
while (line.length() > 0 && line.charAt(0) == ';')
{
System.out.println("[" + ++lineNumber + "] " + line... |
bd57c263-e582-4a88-a1f4-43a39b61679e | 3 | protected static CharSequence getTextFromURI(URI file) {
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(file.toURL().openStream(), "UTF-8"));
String line;
StringBuilder buffer = new StringBuilder();
while ((line = in.readLine()) != null) {
buffer.append(line).append('\... |
516475de-b7b8-42a7-a362-72e31681e4b6 | 4 | public int getHeight() {
if (this.isEmpty())
return 0;
if (this.isLeaf())
return 1;
if (this.left == null)
return 1 + this.right.getHeight();
if (this.right == null)
return 1 + this.left.getHeight();
return 1 + Math.max(this.left.getHeight(), this.right.getHeight());
} |
863e0664-f1d5-42d6-96d3-9173efc3f063 | 8 | public void paint(Graphics g) {
super.paint(g);
this.g = g;
appletSize = this.getSize();
//GUI: Setting up when buttons are visible and invisible
if (h.netWorth() < h.bet() && h.netWorth() <= 10) {
restart.setVisible(false);
bank.setVisible(true);
} else {
bank.setVisible(false);
if (h.netWorth... |
0470e4e3-f1ff-474c-bf1d-13b2a995bb72 | 1 | public ResultSetSlice(java.sql.ResultSet rs, Integer lo, Integer hi)
throws SQLException {
this.rs = rs;
rowCount = rs.last() ? rs.getRow() : 0;
columnCount = rs.getMetaData().getColumnCount();
first = lo.intValue();
last = Math.min(hi.intValue(), rowCount);
sliceRowCount = last + 1 - first... |
ef19c563-b46e-4701-b272-5b5c3ac3a37d | 7 | public static void startupSoapServer() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/POWERLOOM-SERVER/PLSOAP", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Ste... |
1d027dcf-af08-4245-a1fb-206461dc3b68 | 7 | private void checkRotations(TetrominoMoveSelector moves, Tetromino tetromino, int x, int y) {
//Si c'est un carré, la rotation est transparente
if(tetromino.getHeight() == tetromino.getWidth()){
moves.addRotateRight();
moves.addRotateLeft();
}else{
TetrominoMo... |
755e9d24-b6d3-4fc2-b015-c11ff2bebce8 | 5 | public void genInventory()
{
Item.modifyAll(locale);
for (int x = 0; x < locale.getOrbitalClass().GetProperties().length-1; x++)
{
if(inventory == null)
{
inventory = new Vector<Item>();
}
for(int y = 0; y < locale.getOrbitalClass().GetProperties()[x]+1; y++)
{
if (y == 0)
{
if (r... |
17c7fee6-956c-4ec1-a841-e587f9966e3a | 6 | public static HashMap<String, String> getSequenceToOtuMap(String filepath)
throws Exception
{
HashMap<String, String> returnMap = new HashMap<String, String>();
BufferedReader reader = new BufferedReader(new FileReader(new File(
filepath)));
String nextLine = reader.readLine();
int index =0;
... |
7bc3829d-6130-4c1d-8cda-c5f9997c048f | 1 | private boolean jj_2_64(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_64(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(63, xla); }
} |
d3be4904-7fd9-494f-a1f8-0ab069e78218 | 9 | public static void clientMenu() {
System.out.println("\nPlease select following options");
System.out.println("1. Find");
System.out.println("2. Download");
System.out.println("3. UpdateList");
System.out.println("4. GetLoad");
System.out.println("5. Exit");
System.out.print("Command: ");
Scanner option... |
8ab03866-c228-4880-aa77-aec71e393b3e | 7 | @EventHandler
public void SkeletonWaterBreathing(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getZombieConfig().getDouble("Skele... |
66b84460-1899-4a65-8103-76918c40ec8d | 7 | String getLandingLocation(Request request, String sessionKey) {
String host = request.header.getProperty("host");
StringBuilder l = new StringBuilder(host.length() + 10);
boolean ssl = request.socket instanceof SSLSocket;
l.append("http");
if (ssl)
l.append('s');
l.append("://");
l.append(host);
int... |
8c9b0f89-b9ae-49b8-9bf0-d7fbd7f399a5 | 0 | @Test
public void generationFractionnelle() {
x = 3;
y = 3;
rule = new RuleSet("23/3");
grid = new Grille(x, y, rule);
boolean[][] originalValue = {{true, false, false}, {true, true, false}, {true, false, false}};
grid.setBooleans(originalValue);
Grille orig... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.