method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
4330f667-b45e-42c5-b1a1-b4f6adb4d5c5 | 9 | protected Object invokeReadFromXML(Element node) throws Exception {
Method method;
Class[] methodClasses;
Object[] methodArgs;
boolean array;
boolean useDefault;
useDefault = false;
method = null;
m_CurrentNode = node;
... |
ed9f142c-8c84-4425-a285-146b709a53cf | 5 | @Test
public void testConnectComponents(){
gameEngine.connectComponentTo(valve1, valve1, true);
InfoPacket info = null;
Iterator<InfoPacket> it = gameEngine.getAllComponentInfo().iterator();
while(it.hasNext()){
info = it.next();
Iterator<Pair<?>> pIt = info.namedValues.iterator();
while(pIt.hasNex... |
441fefa3-6d32-48e4-be51-32b25479ad55 | 2 | private String getLevelNodeValue(final Document doc) {
Node node = this.getFirstLevelNodeByTag(doc, LEVEL_TAG);
if (node == null) {
return DEFAULT_LEVEL;
}
String value = this.getNodeValue(node);
if (value.isEmpty()) {
value = DEFAULT_LEVEL;
}
return value;
} |
a2e2a293-8aa3-4476-870c-30d9ed2aa576 | 6 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
int nCases = Integer.parseInt(in.readLine().trim());
for (int t = 0; t < nCases; t++) {
int r = Integer.parseInt(in.readLine().trim())... |
1c2f3006-be8e-4936-84de-9af606109b35 | 3 | public static Type fromInt(int x)
{
switch ( x % 3 )
{
case 0:
return simple;
case 1:
return conjugation;
case 2:
return number;
}
return null;
} |
96877e0e-4713-4b12-b670-da0b214ac1be | 4 | @Override
public void analyse() throws AnalyseException {
if (this.sentence != null && this.sentence.length() != 0) {
this.analyseImpl();
if (this.errorMsg == null || this.errorMsg.size() == 0) {
this.isComplete = true;
}
} else {
AnalyseException exception = new AnalyseException(
"Error your ... |
03f2b363-5151-4cd7-91bd-ea1505fddc7b | 5 | public void write(DataOutput out) throws IOException {
try{
// minhash is not maxed out, M is redundant so don't write it
if (s < k) {
// Use -p to signify no M
out.writeByte(-p);
out.writeInt(k);
out.writeInt(s);
for(int i=0; i < s; i++){
out.writeLong(... |
e7537cb3-729b-41c5-bdb5-fc4a20f5d819 | 3 | public void findNearestFreeSpot()
{
if (getEntities() == null) return;
Deque<Double> xQueue = new ArrayDeque<>();
Deque<Double> yQueue = new ArrayDeque<>();
List<Double> usedX = new ArrayList<>();
List<Double> usedY = new ArrayList<>();
enqueueCoor... |
b057b4a3-c32c-4ef7-ab4b-5cca3a4474a8 | 4 | public static void rectangle(double x, double y, double halfWidth, double halfHeight) {
if (halfWidth < 0) throw new RuntimeException("half width can't be negative");
if (halfHeight < 0) throw new RuntimeException("half height can't be negative");
double xs = scaleX(x);
double ys = scal... |
9e7950f7-a7d2-4a94-ba05-7f175cb2c038 | 2 | private static int RodCutTopDownHelper(int n, int[] p, int[] s) {
if ( s[n] != Integer.MIN_VALUE ) return s[n];
// divide the problem into subproblem
int max = Integer.MIN_VALUE;
for ( int i=1; i <= n ; ++i ) {
// conquer each subproblem and combine them together
max = Math.max(max, p[i-1]+RodCutT... |
6d231995-45e4-48bb-a037-f9d6841f2ebc | 3 | private Integer loadPropertyInt(Properties properties, String key) {
String value = properties.getProperty(key);
if (value == null) {
return null;
}
if(!value.matches("[0-9]+")){
throw new DBException(properties+"-value from properties file must be an integer value (0-9) but is '"+value+"'");
}
try {... |
63b62345-dcb8-424f-9b12-682b31ddf5de | 6 | public List<StudentObj> getStudentByMark(String classname, int objId, int topicId, float mark) {
List<StudentObj> items = new LinkedList<StudentObj>();
String sql = "select Student.classname, Student.rollNo, fullname, email, mark from Student inner join Result on Student.rollNo = Result.rollNo inner joi... |
20aee12a-af1a-4b41-88ec-66bb1d825aa4 | 9 | @Override
public void addBinaryField(FieldInfo field, Iterable<BytesRef> values) throws IOException {
// write the byte[] data
meta.writeVInt(field.number);
meta.writeByte(Lucene54DocValuesFormat.BINARY);
int minLength = Integer.MAX_VALUE;
int maxLength = Integer.MIN_VALUE;
final long startFP ... |
ccef035c-4a63-409c-bbba-1c06a023ccd2 | 1 | @Override
public void closeHandler() {
try {
con.close();
} catch (SQLException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
}
} |
1441cf48-c6c6-4866-832f-6184dd8509e1 | 2 | @Override
public String getOne(String strTabla, String strCampo, int id) throws Exception {
Statement oStatement;
ResultSet oResultSet;
try {
oStatement = (Statement) oConexionMySQL.createStatement();
String strSQL = "SELECT " + strCampo + " FROM " + strTabla + " WHER... |
9f40c3f6-96de-4a27-860e-19ed72d3185d | 2 | @Test()
public void preAuthCompletionDifferentOrderNumber()
throws BeanstreamApiException {
CardPaymentRequest paymentRequest = getCreditCardPaymentRequest(
getRandomOrderId("GAS"), "120.00");
PaymentResponse response = beanstream.payments()
.preAuth(paymentRequest);
if (response.isApproved()) {
P... |
a4f87aaa-74f8-4446-acb9-5f2c08901789 | 5 | private void handleDeleteCommands(ClientHandler handler, String command)
throws SocketTimeoutException, IOException, CacheException {
/*
delete <key> [noreply]\r\n
*/
String cmdData[] = command.split(" ");
String cmd = cmdData[0];
String key = cmdData[1];
if(QuickCached.DEBUG==false) {
logger.l... |
4539801a-b2c5-43da-95bf-65cfe2bb81b2 | 1 | @Override
public int entryCount(String word) {
return storage.get(word) == null ? 0 : storage.get(word);
} |
08f87ec7-b9d4-4cc4-9b80-c27440ea8dfa | 0 | public RefinedAbstractionA(Implementor implementor) {
super(implementor);
} |
339b3d12-02b2-40bd-aa68-fb76348f8aba | 7 | public RealmStatus getRealmStatus(String... realms) throws CharacterNotFoundException {
URI uri = null;
try {
uri = new URI("https", String.format(URL_BASE, region), REALM_API_URL, null);
} catch (URISyntaxException e) {
e.printStackTrace();
}
if(uri == n... |
fc56013b-119e-4e49-aaaf-60d59d258d66 | 2 | public final String getStrings(int from)
{
if (!this.hasPositional(from))
{
return null;
}
StringBuilder sb = new StringBuilder(this.getString(from));
while (this.hasPositional(++from))
{
sb.append(" ").append(this.getString(from));
}
... |
54efd9e9-fe51-4835-b07e-6c36abe1372a | 9 | public boolean validate()
{
if(this.city.getText() != "" &&
this.email.getText() != "" &&
this.fname.getText() != "" &&
this.lname.getText() != "" &&
this.phone.getText() != "" &&
this.state.getItem(state.getSelectionIndex()) != "" &&
this.address1.getText() != "" &&
this.address2.getText... |
1a1c8d01-4db2-4768-8315-bf3f49de98c2 | 2 | private void deleteMails(){
for (Integer n : deletedMails) {
// Hole den Namen der Datei
String fileName = mails.get(n);
// Namens String in File Objekt, das auf die Datei im Mail
// Ordner
// referenziert, umwandeln
File mailFile = Paths.get(
Proxy.MAIL_STORAGE_PATH + "/" + fileName).toFile();... |
145b8e53-1fef-4f8e-a326-4c00f15b24c1 | 6 | @Override
public void handleOutOfBounds(EntityGrid grid) {
float tx = -1;
float ty = -1;
float gWidth = grid.getSize().x;
float gHeight = grid.getSize().y;
float pAdjustedWidth = sprite.getLocalBounds().width * .9f;
float pAdjustedHeight = sprite.getLocalBounds().he... |
f36f447f-4c92-4961-a048-5b49747253f4 | 1 | @Test
public void transferInstrSTORE_testInvalidRegisterRef() { //Checks STORE instruction not created with invalid register ref.
try {
instr = new TransferInstr(Opcode.STORE, 50, 17);
}
catch (IllegalStateException e) {
System.out.println(e.getMessage());
}
assertNull(instr);
} |
90776266-df0c-464e-978c-a735bbb91dd1 | 4 | public void searchFor(String text) {
if (worker != null) {
if (currentquery.equals(text.trim())) {
System.out.println("I'm too lazy to do another search");
return;
} else {
worker.halt();
}
}
currentquery = text.trim();
int n = results.size();
if (n != 0) {
results.clear();
this.fir... |
4768d397-0f9e-41b9-be53-01d94631eceb | 0 | protected void initialize() {
System.out.println("Tilting");
Robot.tilter.moveUp();
} |
ebb04c47-06bb-40f8-8ccd-bfd92b674078 | 0 | public void setDescription(String description) {
this.description = description;
} |
61797614-4b7a-4507-85bd-38ca2be2e21e | 1 | public synchronized void trust(Certificate cert) {
clear();
try {
trusted.setCertificateEntry("cert-" + tserial++, cert);
} catch(KeyStoreException e) {
/* The keystore should have been initialized and should
* not have the generated alias, so this should not
* happen. */
throw(new Runtime... |
3aaaaca9-2ddb-4cba-aeef-014bcb3d3747 | 6 | public ArrayList<SubscriptionPlan> removeExpiredSubs() {
ArrayList<SubscriptionPlan> result = new ArrayList<SubscriptionPlan>();
ArrayList<Integer> subremove = new ArrayList<Integer>();
ArrayList<Integer> orderremove = new ArrayList<Integer>();
PreparedStatement sqlRead = null;
R... |
0e623100-c414-4082-936e-ef16212d7315 | 2 | public synchronized void windowClosed(WindowEvent evt)
{
quit=true;
this.notifyAll(); // stop all threads
try { reader.join(1000);pin.close(); } catch (Exception e){}
try { reader2.join(1000);pin2.close(); } catch (Exception e){}
... |
f1f1d6c8-1222-4707-815e-3bd88db825b5 | 4 | private void posicionarBarandales(Node barandal)
{
barandal.setLocalTranslation(-697, 0, 797);
//rootNode.attachChild(barandal);
for (int i=1,x=0; i<=9; i++,x+=150)
{
// Del frente
Node tmp = barandal.clone(false);
tmp.move(x, 0, 0);
... |
f69a05ec-3faa-48ac-a2bd-4262314cfc6e | 8 | protected void testOptimalEncoding( Number v, byte optimalEncoding ) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
StandardValueOps.writeNumberCompact(v, baos);
byte[] encoded = baos.toByteArray();
if( optimalEncoding == StandardValueOps.NE_INT6 ) {
assertEquals(1, encoded.length);... |
b277be40-5d5e-424a-b262-d00b17335d38 | 2 | public void checkTrips() {
enablePreviewButtons (MainWindow.tripDB.checkDay (targetDay.getTime(), checkResultText));
int e = MainWindow.tripDB.getCheckErrors();
int w = MainWindow.tripDB.getCheckWarnings();
if (e > 0) {
errorsField.setFont(errorsField.getFont().deriveFont(Font.BOLD));
errorsField.setFo... |
2482e647-63e2-4636-87f1-cf5e1642b1d9 | 5 | private static BufferedImage renderNumber(Number number) {
BufferedImage integer = render(number.getInteger() == null ? "0" : number.getInteger());
BufferedImage decimal = number.getDecimal() == null ? null : render("." + number.getDecimal());
BufferedImage multiplication = null;
if(number.getScientificNotat... |
b3b93a4b-39f6-4ca0-a6d0-aa8e449769e5 | 5 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((ativo == null) ? 0 : ativo.hashCode());
result = prime * result + ((autores == null) ? 0 : autores.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((isbn ... |
f30c2aa4-eb43-4624-adb4-0ce2499b95b9 | 6 | private String readWord() {
String s = null;
holdPos = pos;
while ( pos < line.length()
&& isWord( String.valueOf( line.charAt( pos ) ) ) ) {
if ( isBadChar( line.charAt( pos ) ) ) {
if ( isSpace( String.valueOf( line.charAt( pos - 1 ) ) )
... |
60a36fbb-f06c-44a5-94cf-6c0937ad852a | 0 | public KeyDataType createKeyDataType() {
return new KeyDataType();
} |
190ed441-80b1-4335-bf1d-0566893bc207 | 6 | @Override
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String label, String[] args) {
for (CommandGroup command : commands) {
if (command.getName().equalsIgnoreCase(cmd.getName())) {
String subCommand = args.length > 0 ? args[0] : "";
... |
b55d430d-5cef-4c17-a6e0-e90b1e32a449 | 7 | private String compute(String[] input) {
try {
Integer operand1 = Integer.parseInt(input[1]);
Integer operand2 = Integer.parseInt(input[3]);
if (!node.getOperators().contains(input[2]))
return "Error: Operation not supported!";
String result = "";
switch (input[2]) {
case "+":
result = St... |
26a3647d-2da1-46a9-a13e-daff4cc2ca90 | 2 | private void handleTime(int year, int month) {
int newMonth = month;
int newYear = year;
if (newMonth == 0) {
newMonth = 12;
newYear -= 1;
} else if (newMonth == 13) {
newMonth = 1;
newYear += 1;
}
RoosterProgramma.getInstan... |
a97c525d-8736-47a5-b5b7-0bcb657bed7b | 4 | @Override
public void init(GameContainer container) throws SlickException
{
grassmap = new TiledMap("data/40X40Map.tmx");
player1 = new Player(Username,35f,35f*3);
Tinput = new TextField(container, container.getDefaultFont(), (int)chatx,(int)(chaty+chat.getHeight() + 5),(int)(c... |
4ffa2ea9-3b0a-44bd-8dfd-fdf1b36269f4 | 2 | @Override
public int hashCode() {
int hashFirst = first != null ? first.hashCode() : 0;
int hashSecond = second != null ? second.hashCode() : 0;
return (hashFirst + hashSecond) * hashSecond + hashFirst;
} |
7db06c6b-13b7-4a8f-91e5-50f7ec90666a | 1 | public boolean canCommit(ReservationStation resStation) {
// where index is the index of the required ROB
int index = Integer.parseInt(resStation.getDest());
return (ROB.getHead() == index && ROB.isReady(index));
} |
0e5a93c7-1437-4037-9ac2-ac5d20df2c7e | 8 | protected void emoteHere(Room room, MOB emoter, String emote)
{
if(room==null)
return;
final Room oldLoc=emoter.location();
if(emoter.location()!=room)
emoter.setLocation(room);
final CMMsg msg=CMClass.getMsg(emoter,null,CMMsg.MSG_EMOTE,emote);
if(room.okMessage(emoter,msg))
{
for(int i=0;i<room.n... |
1f7b2343-b3b4-410b-bd62-9b26b39966ec | 6 | public static Stella_Object accessTokenizerTokenSlotValue(TokenizerToken self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Stella.SYM_STELLA_TYPE) {
if (setvalueP) {
self.type = ((Keyword)(value));
}
else {
value = self.type;
}
}
else if... |
eb7d4e90-43a4-40e9-9b0d-b1a5736a6e9f | 7 | public void interpolate(int[] /* fc_point */f0_base[], int p0, int pn,
PointPlotter plotter, double res) {
double k1, k2;
// Set up points for first curve segment.
int p1 = p0;
++p1;
int p2 = p1;
++p2;
int p3 = p2;
++p3;
// Draw each curve segment.
for (; p2 != pn; ++p0, ++p1, ++p2, ++p3) {
... |
bb843b22-3235-49f0-a567-c5ba980abfc9 | 2 | public static HashMap<String, String> getBoundKeys(String url)
{
HashMap<String, String> map = new HashMap<String, String>();
try
{
Scanner scan = new Scanner(new URL(url).openStream());
while (scan.hasNext())
{
String line = scan.next();
String pubkey = line.split("=", 2)[1];
String signer ... |
72d2e5cd-3716-4736-9f14-2907852bcbfd | 3 | @Override
public void process(SimEvent event) {
NodeReachedEvent _event = (NodeReachedEvent) event;
this.setPosition(_event.getPosition()); //Sets the actual position to the one provided by the event.
System.out.println(getName() + "@" + getEngine().getCurrentTime() + ": reached node (" + getPosition().getX() + ... |
e93fd9ba-9ebf-4f78-8fc3-77db436941cb | 3 | public boolean ValidateTickers(List<String> tickers){
if(tickers.isEmpty()){
return false;
}
boolean areValid = true;
for(String s : tickers){
if(!ValidateTicker(s)){
areValid = false;
}
}
return are... |
c51ae17d-1649-4974-8083-1fd404eab2d3 | 1 | public MethodAnalyzer getMethodAnalyzer() {
ClassAnalyzer ana = getClassAnalyzer();
if (ana == null)
return null;
return ana.getMethod(methodName, methodType);
} |
21051c20-11ec-4a48-971a-96af4d05fedf | 3 | public void makeCollisionConnection(String firstLayer, String secondLayer, CollisionReport reportTo) {
if (firstLayer != null || secondLayer != null || reportTo != null) {
LayerConnection lc = new LayerConnection( findLayerByName(firstLayer), findLayerByName(secondLayer), reportTo);
coll... |
827ad544-8936-4dd2-8d01-94c121996310 | 4 | @Override
public int getFreeSpace() {
int freeSpace = 0;
for (int i = 1; i <= aisleCount; i++) {
try {
Aisle aisle = (Aisle) manager.get("A" + i);
List<Rack> racks = aisle.getRacks();
for (int j = 0; j < racks.size(); j++) {
... |
0bffd329-0360-4518-ae6e-8027df30185e | 8 | private static Hashtable getMatch(Term term, Term pattern) {
//System.out.println("\n------ match -------");
//System.out.println(term);
//System.out.println(pattern);
Hashtable result = new Hashtable();
if (pattern.isVariable()) {
result.put(pattern.getVariable(), term);
} else if (term.getTopOperation(... |
d2f93707-d4f4-4fa1-b918-b76c57e0b7d7 | 0 | public LSystemDisplay(LSystemEnvironment environment) {
super(environment, "Render System", null);
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_D,
MAIN_MENU_MASK));
} |
1c55203d-e1db-4e78-ab82-4781462b14f9 | 2 | public Usuario buscaPorEmailESenha(String email, String senha) {
if (!USUARIOS.containsKey(email))
return null;
Usuario usuario = USUARIOS.get(email);
if (usuario.getSenha().equals(senha))
return usuario;
return null;
} |
44bb78e4-a71c-442b-a280-a2c9ec60a2f1 | 1 | public void testConstructor() {
assertEquals(1, DateTimeZone.class.getDeclaredConstructors().length);
assertTrue(Modifier.isProtected(DateTimeZone.class.getDeclaredConstructors()[0].getModifiers()));
try {
new DateTimeZone(null) {
public String getNameKey(long instant... |
60e8e003-77c2-4a39-a598-99df0232dde2 | 5 | private Node resolveStatement(int offset)
{
while(args.size() > offset+1)
{
int index = -1;
Object e;
int maxPrio = -1;
for(int i = offset; i < args.size(); i++)
{
e = args.get(i);
if (e instanceof OperationNode)
{
int curPrio = ((OperationNode) e).getPriority();
if (curPrio > ... |
b52b28d6-7b4e-4cbf-be53-05c95e387e6b | 3 | public ShadingPattern getShading(String name) {
// look for pattern name in the shading dictionary, used by 'sh' tokens
if (shading != null) {
Object shadingDictionary = library.getObject(shading, name);
if (shadingDictionary != null && shadingDictionary instanceof Hashtable) {
... |
de0e69d9-6462-4e41-af36-cea947035edb | 9 | private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed
if (lab_modo.getText().equals("Alta")){
if (camposCompletos()){
ocultar_Msj();
insertar();
menuDisponible(true);
... |
e5eb6e29-6cc2-4ba0-9d96-9ed0de286fda | 5 | private static void drawOcean(Graphics graphics, Ocean ocean) {
if (ocean != null) {
int width = ocean.width();
int height = ocean.height();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int contents = ocean.cellContents(x, y);
if (contents == Oc... |
0671edf0-b63b-4d75-92b9-046f9581f057 | 2 | private String calc(String input) {
String output = "";
int length = input.length();
Integer[] tempArray = new Integer[length];
for(int i = 0; i < length; i++){
tempArray[i] = i;
}
Collections.shuffle(Arrays.asList(tempArray));
for(int x = 0; x < length; x++){
output += input.charAt(tempArr... |
327c28b5-7d0e-4ddb-a7d0-d1f93c6fa705 | 5 | protected Floor decodeFloor(VorbisStream vorbis, BitInputStream source) throws VorbisFormatException, IOException {
//System.out.println("decodeFloor");
if(!source.getBit()) {
//System.out.println("null");
return null;
}
Floor1 clone=(Floor1)clone();
clone.yList=new int[x... |
c99994ef-2f80-432d-aafb-c0099b3d2f90 | 8 | public void deleteReplication(IInsertDeleteReplicationRequest req) throws RemoteException{
String key = req.getKey().trim();
int serverId = getServer(key);
String value = (String)req.getValue();
// drop the package, if the request is visited all servers
if(req.getProbe().contains(this.myId)){
h... |
1788a376-642b-4faf-a8d6-9df358315046 | 7 | @Override
public void draw() {
texture.bind();
//Center
for (int x = 0; x < Main.xLen; x += 1) {
for (int y = 0; y < Main.yLen; y += 1) {
drawTexture(0, 0, 32, 32, Main.padding + x * Main.tileSize, Main.padding + y * Main.tileSize, Main.tileSize, Main.tileSize);
}
}
//Edges
for (int x = 0; x <... |
4a0772ec-959a-45e3-9084-7b1d31a0d607 | 9 | public void ShuffleDeck(DeckType type) {
logger.debug("Shuffling Deck " + type);
switch(type){
default:
case Corpse: cardHolder.corpseDeck.shuffle(); processDrawCorpseCard(); break;
case Crypt: cardHolder.cryptDeck.shuffle(); processDrawCryptCard(); break;
... |
5255c2b0-2f38-4463-be58-b9b021fb7d36 | 7 | private void txtcedulaKeyTyped(java.awt.event.KeyEvent evt) {
char caracter = evt.getKeyChar();//Validacion del campo cedula
if (caracter >= '0' && caracter <= '9' || caracter == 8 || caracter == KeyEvent.VK_BACK_SPACE || caracter == KeyEvent.VK_CAPS_LOCK || caracter ... |
3a6df2c2-09e9-4558-989b-749d2fd471cd | 5 | @Override
protected ExpressionElement protectedNext() {
switch (this.nextState) {
case LEFT_BRACKET:
this.nextState = State.LEFT_OPERAND;
return new OpenBracketExpression();
case LEFT_OPERAND:
this.nextState = State.OPERATOR;
Operand firstOperand = operator.getFirstOperand();
this.innerI... |
dc956ddf-0139-4c53-baf5-61b23155441f | 3 | private boolean isOver(int x, int y) {
return x >= 0 && y >= 0 && x < getWidth() && y < getHeight();
} |
445a8414-4668-46b8-bc2a-254340986b8f | 7 | Scriptable compile(Context cx, Scriptable scope, Object[] args)
{
if (args.length > 0 && args[0] instanceof NativeRegExp) {
if (args.length > 1 && args[1] != Undefined.instance) {
// report error
throw ScriptRuntime.typeError0("msg.bad.regexp.compile");
... |
944dbd86-8b42-43d3-afc8-2380f1d709de | 5 | private void fixNegativeRed(Node negRed)
{
Node n1, n2, n3, n4, t1, t2, t3, child;
Node parent = negRed.parent;
if (parent.left == negRed)
{
n1 = negRed.left;
n2 = negRed;
n3 = negRed.right;
n4 = pare... |
37e8e44a-8242-4fb8-83fb-9d2c734334ed | 4 | public boolean createPartition(int partId, int numPE,
PartitionPredicate predicate) {
if(partId >= partitions.length || partId < 0) {
throw new IndexOutOfBoundsException("It is not possible to " +
"add a partition with index: " + partId + ".");
}
else if(numPE < 0) {
throw new IllegalArgum... |
b265bb44-f81e-4eee-840e-13598568a967 | 9 | @Override
public void run() {
//shadow mode
Coordinate p;
p = gui.getPlayerCoordinate(player);
while (true) {
// Check if Paused
synchronized (Game.lockPause) {
if(Game.isPaused() || Game.isHasWinner())
try {
Game.lockPause.wait();
} catch (InterruptedException e) {
e.printStac... |
c537fe06-4fbf-4fcc-ad21-c70a15faf239 | 8 | public static void testDenominators() {
DB db = DBMaker.newFileDB(new File(serializationFolder + "denominators" + "_mapdb.bin" ))
.readOnly()
.make();
Map<Tuple_WithEqualityConstraints, int[]> myMap_counts_first_tuple_directed = db.getHashMap("counts_first_tuple_directed");
Map<Tuple_WithEqualityConstrai... |
3769ac0d-744b-4500-8115-b261ee8675dc | 6 | @Override
public String getMessage() {
// server 1 and server 2
if (this.server != null && this.server2 != null) {
return String.format("%s %s %s", this.getCommandName(), this.server, this.server2);
}
// server 1 but not server 2
if (this.server != null && this.server2 == null) {
return String.form... |
321432f4-d8be-4e51-b8c3-c3e7e8b4fcc3 | 4 | public static void addSystemTestScroe(String state ,HashMap<String, Float> systemTestScores, float systemTestPoints) {
if(lastSystemTestPoints == null)
lastSystemTestPoints = new HashMap<String, Float>();
if(lastSystemTestPoints.containsKey(state))
last... |
0c39a7ee-74b1-45e2-87b6-c30269a645be | 3 | public static void main(String[] args) {
IDBFactoryPlugin plugin=new NonSQLPlugin();
System.out.println("plugin made-pre start");
plugin.start();
System.out.println("connection made-pre clear");
plugin.clearAllTables();
System.out.println("made db-pre save");
//Test Users
List<String> names=new ArrayLis... |
a1b73fe2-1c34-4edf-af6d-11ee14865341 | 6 | private String getTranslation(String address) throws Exception {
String content = loadPage(address);
if(content.indexOf("nebylo nic nalezeno") != NOT_FOUND || content.indexOf("li jste hledat?") != NOT_FOUND)
return NO_TRANSLATION;
String[] translations = getAllPossibleTranslations(... |
dc8e5ba5-7391-4309-aa6f-25292e04b96d | 3 | @Override
protected void keyTyped(char var1, int var2) {
if(var2 == 1) {
this.func_22115_j();
} else if(var2 == 28) {
String var3 = this.message.trim();
if(var3.length() > 0) {
this.mc.thePlayer.sendChatMessage(this.message.trim());
}
this.message... |
37200d6a-94f8-4799-95e6-637470762160 | 7 | protected TechComponent findComponentByName(List<? extends TechComponent> list, String prefix, String name)
{
if(list.size()==0)
return null;
name=name.toUpperCase();
if(name.startsWith(prefix))
{
final String numStr=name.substring(6);
if(!CMath.isInteger(numStr))
return null;
final int num=CMa... |
801bfbe1-5530-4b44-85c9-529db33397ad | 0 | public String getSuffix()
{
return _suffix;
} |
9c751802-985f-46fa-bf26-6415218edafa | 5 | @Override
public Matrix run(Matrix coef, Matrix free) {
int n = coef.getHeight();
double[][] alpha = new double[n][n];
double[][] beta = new double[n][1];
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
alpha[i][j] = (i == j ? 0. : -coef.get(i, j) / coef.get(i, i));
}
beta[i][0] = free... |
9d1401fe-8939-4892-a3b8-bd32963aef77 | 5 | public void run ()
{
while (true)
{
if ( !plugin.isEnabled())
break;
try
{
if (this.updateCheck() && download)
{
this.downloadLatestVersion();
}
Thread.slee... |
d35e6ae9-c980-415c-ae2c-53bc4b1b7438 | 5 | private static Monster[] renameDouble(Monster[] group) {
for (int i = 0; i < group.length; i++) {
for (int j = i + 1; j < group.length; j++) {
if (group[i].getName().equals(group[j].getName())) {
int doubleCount = 1;
for(int k = 0; k < j; k++){
if(group[k].getName().contains(group[i].getName... |
88d93b2c-f41c-4885-825e-ceed2bba0069 | 4 | private SootMethod initializeSoot() {
Options.v().set_no_bodies_for_excluded(true);
Options.v().set_allow_phantom_refs(true);
Options.v().set_output_format(Options.output_format_none);
Options.v().set_whole_program(true);
Options.v().set_soot_classpath(apkFileLocation + File.pathSeparator
+ Scene.v().getA... |
437e5555-19c6-4021-a87b-01ff09079b97 | 3 | public int[] twoSum(int[] numbers, int target) {
// IMPORTANT: Please reset any member data you declared, as
// the same Solution instance will be reused for each test case.
// Arrays.sort(numbers);
int[] res = new int[2];
for (int i = 0; i < numbers.length; ++i) {
int subTarget = target - numbers[i];
i... |
1f0d3d44-a6c3-4a1c-abc8-ab7db2c70e6e | 7 | public CypherType predictNew(String text)
{
//to determine the type. get the sig and scrawl predictions,
// then get the highest value of their vector additions.
double [] sigPredict = sigPredict(text);
double [] scrawlPredict = scrawlPredict(text);
int highestIndex;
double highestValue;
highest... |
4608720c-bc18-4b4c-8934-f57c66bf3254 | 2 | @Override
@SuppressWarnings("unchecked")
public String toJSONString() {
BetterJSONObject o = new BetterJSONObject();
o.put("meta", this.meta);
if (this.network != null) {
o.put("network", this.network);
}
if (this.performance != null) {
o.put("performance", this.performance);
}
return o.toJSON... |
1b210060-6a13-4b42-a597-7d14e5911759 | 6 | private synchronized Bestandteil getBestandTeilvonFile(File f) {
try{
Scanner fileScanner = new Scanner(f);
if(!fileScanner.hasNext()){ //Sollte kein bestandteil vorhanden sein wird null zurueckgegeben
fileScanner.close(); //filescanner vor dem return wieder freigeben
return null;
}
Stri... |
8d013ffb-a8fe-40b0-9419-7e5020ae88dc | 2 | public String getFilter() {
if (this.isValid()) {
final StringBuilder sb = new StringBuilder("filters");
for (final String field : this.path) {
sb.append("[").append(field).append("]");
}
return sb.toString();
}
return null;
} |
c06869ae-547a-43a8-9c8a-b7640f283fed | 4 | @Override
public boolean removeLockByTransaction(String transaction) {
Set<String> thisResources = this.resourcesOfT.get(transaction);
// This transaction locks no resources
if (thisResources == null || thisResources.isEmpty())
return false;
boolean thereturn = false;
... |
3244ccb5-0488-4f20-973d-d6f3ea17cc2f | 4 | public boolean ruleFires(ArrayList<Conditional> facts)
{
//if counter is not set correctly, return false
if(counter != -1 && counter < counterLimit)
return false;
for(Conditional item: Conditions)
{
if(!facts.contains(item))
{
... |
870b6dbe-8e1f-44d8-bba8-2ae0c93e4725 | 6 | public Boolean concluir(Emprestimo emprestimo) {
Boolean sucesso = false;
Connection connection = conexao.getConnection();
try {
String valorDoComandoUm = comandos.get("concluir" + 1);
String valorDoComandoDois = comandos.get("concluir" + 2);
StringBuilder que... |
38998796-c8fb-4588-872e-047170faa259 | 2 | public String toString(){
String resultado = "{ ";
if(getInicio() == null){
return "Lista personas esta vacia";
}else{
NodoPersonas q = this.inicio;
while(q != null){
resultado += q.getInfo().toString() + ",\n\n";
q = q.getLiga();
}
return resultado.substring(0,resultado.length() -1 ) ... |
d1adc327-a7a5-4220-985e-49bae6b3efee | 0 | public QuitParseException(String msg)
{
super(msg);
} |
df3549f3-9abc-430b-8e37-0964d3bfce02 | 4 | public List getMaps(GameAction gameCode) {
ArrayList list = new ArrayList();
for (int i=0; i<keyActions.length; i++) {
if (keyActions[i] == gameCode) {
list.add(getKeyName(i));
}
}
for (int i=0; i<mouseActions.length; i++) {
if (mouse... |
43020095-212e-4201-903a-987dc570ff79 | 7 | public void writeEnvironment(StringBuilder code, Environment env) {
for (Environment.EnvironmentEntry ent : env) {
if (ent.loc.type != Location.LocationType.HeapLocation)
continue;
if (ent.val.type instanceof ArrayType) {
ArrayType t = (ArrayType) ent.val.type;
int min = Math.min(t.min, 0);
int... |
92b3f04c-cafa-4397-9338-c5898a59e82e | 7 | public void paint(Graphics2D g2, boolean draw, boolean fill ){
if (calcularvarr) {
calcularvar();
calcularvarr = false;
}
if (draw && !fill) {
g2.draw(path);
}else if(fill && !draw){
g2.fill(path);
}else if(draw && fi... |
8d289d58-7358-4561-8dbb-1515a5c4663d | 1 | private Component getParseButton() {
JButton jbParse = new JButton("Parse");
jbParse.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
String text = inputText.getText();
String regex = jtfParseExpression.getSelected... |
5c33c255-e3a4-43fa-b4ef-00da4a3aa6b4 | 9 | public void findHiddenPrice() {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your MySQL JDBC Driver?");
e.printStackTrace();
}
PreparedStatement ps = null;
Connection con = nul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.