method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b9395e10-4cc8-4aa7-9196-dd80b83be4c2 | 4 | public void clearDisplay() {
if(userValues !=null && systemValues !=null) {
for(int row = 0; row < systemValues.length; row++) {
for(int col = 0; col < systemValues[row].length; col++) {
userValues[row][col] = 0;
}
}
updateD... |
7a82946f-4df5-44af-9d0a-aeccfc922325 | 3 | private static boolean withinGrid(int x, int y, Boolean[][] walkways) {
return y >= 0 && x >= 0 && x < walkways.length && y < walkways[x].length;
} |
1f8bd3da-012b-407a-a286-8ac774448156 | 5 | private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... |
40ce828b-67bd-462d-b479-9359188374ea | 6 | private ObjectDef method457()
{
int i = -1;
try {
if(anInt1601 != -1)
{
VarBit varBit = VarBit.cache[anInt1601];
int k = varBit.anInt648;
int l = varBit.anInt649;
int i1 = varBit.anInt650;
int j1 = client.anIntArray1232[i1 - l];
i = clientInstance.variousSettings[k] >> l & j1;
} el... |
c0553a39-16d5-4a1a-ba08-79ec862c1a0c | 9 | public boolean authenticateOwnerPassword(String ownerPassword) {
// Step 1: Computer an encryption key from the supplied password string,
// as described in steps 1 to 4 of algorithm 3.3.
byte[] encryptionKey = calculateOwnerPassword(ownerPassword,
"", true);
// Step 2: ... |
9597c99d-e3a9-43ea-9fc6-58ca10031036 | 5 | @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 Prueba)) {
return false;
}
Prueba other = (Prueba) object;
if ((this.idPrueba == null && other.idPrueba != null... |
415bcbbb-a231-4e5f-b185-30be007bc8f2 | 8 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected==null)||(!(affected instanceof Room)))
return super.okMessage(myHost,msg);
final Room R=(Room)affected;
if(msg.targetMinor()==CMMsg.TYP_DAMAGE)
{
final Set<MOB> H=msg.source().getGroupMembers(new HashSet<MOB... |
259cc49f-5c38-4fbc-b1fc-c38ac646b821 | 3 | public Float getFeatureValueByName(String name) {
Float result = null;
for (int i = 0; i < QuestionData.featureNames.size(); i++) {
if (QuestionData.featureNames.get(i).equals(name)) {
result = featureValues.get(i);
break;
}
}
if (result == null) {
throw new RuntimeException("Unexistent Feature... |
48a7cb22-8ec2-449b-89d8-2195fd808a95 | 7 | protected int widestDim(double[][] nodeRanges, double[][] universe) {
final int classIdx = m_Instances.classIndex();
double widest = 0.0;
int w = -1;
if (m_NormalizeNodeWidth) {
for (int i = 0; i < nodeRanges.length; i++) {
double newWidest = nodeRanges[i][WIDTH] / universe[i][WIDTH];
... |
ad50e74b-0ab7-4142-b95d-fbbd74ac4862 | 8 | private static void buildTillageForage(Statement in, Statement outA, Statement outB, String inTbl, String outTbl, String outTblHru, int type, int[] data, boolean isConv, Connection c) {
try {
ResultSet inRs = in.executeQuery("SELECT * FROM " + inTbl + ";");
ResultSet outRs = outA.execute... |
6fe81114-7399-453a-80bb-be60f4470699 | 9 | public static void main(String[] args) {
sc = new Scanner(System.in);
do{
System.out.print("Username: ");
owner = sc.nextLine();
System.out.print("Password: ");
String p = sc.nextLine();
boolean a = (JDBC.logIn(owner, p));
if (!a) {
System.out.println("Wrong username or password.");
contin... |
6da4a069-645f-4e19-b345-f32240c43db2 | 2 | public void setHolder(Mob holder)
{
if(holder != null && holder.getClient() != null)
return;
this.holder = holder;
this.holder.setClient(this);
} |
e64d96c3-0ea5-4668-b180-30d17a1b1830 | 8 | */
public Iterator<K> keys() {
return new Iterator<K>() {
int bucketIndex = 0;
LinkedList<MyEntry> bucket = table[bucketIndex];
Iterator<MyEntry> listIt = bucket.iterator();
MyEntry cur;
/**
* Finds whether or not there is a next MyEntry object in the array.
* @return
*/
... |
f4df595c-7f06-4f25-be18-d3514c4e2cee | 9 | public static void main(String args[]) throws IOException {
short val;
if ((args.length != 3) || (args[0].charAt(0) != '-')) {
System.out.println("Usage: Genfile2 <option> <filename> <size>" +
"\nOptions ust be '-a' for ASCII, or '-b' for binary." +
"\nSize i... |
d318d59d-332f-4d3b-b13c-271136b0d3a5 | 9 | public int addChannel(String id1, String id2, float tr, float dp){
int index = 0;
Nodo source = null, destination = null;
while(index < _network.size() && (source == null || destination == null)){
if(source == null && _network.elementAt(index).getId().equals(id1)){
so... |
38cbc127-bdb0-4734-a3b4-94b5a8717322 | 5 | final int[][] method1274(int i, int j) {
int ai[][] = super.aClass112_3320.method1036(-110, i);
if (super.aClass112_3320.aBoolean1822) {
int ai1[][] = method1280(i, -109, 0);
int ai2[] = ai1[0];
int ai3[] = ai1[1];
int ai4[] = ai1[2];
int ai5[]... |
40fd1663-ccb5-400f-8eec-7b1483969bbc | 1 | public Cache(int s, int l, int m, boolean writeThrough,
boolean writeAround, int cycles) {
this.s = s;
this.l = l;
this.m = m;
this.c = s / l;
this.i = (int) (Math.log(c / m) / Math.log(2));
this.offset = (int) (Math.log(l) / Math.log(2));
this.t = 16 - (i + offset);
cache = new HashMap<String, Set>(... |
1adaa477-5956-455c-89e4-cdc4081c322b | 3 | public int countOpponents(int P, int K) {
int i = 1;
int ans;
while(true){
ans = (i / 3) + (i / K) * 3;
if(ans >= P)break;
i++;
}
if(ans == P){
return i;
}else{
return -1;
}
} |
c86e4fc4-9343-4ce6-9f83-ac78eded4aef | 2 | private void openFAT() {
JFileChooser fileChooser = new JFileChooser("./");
int answer = fileChooser.showDialog(null, "Октрыть файл FAT");
if (answer == JFileChooser.APPROVE_OPTION) {
extractor = new BaseExtractor();
boolean checkFAT = extractor.openFAT(fileChooser.getSel... |
5977b71e-6b19-4146-b4fa-df63940a9f00 | 7 | private void startNextTrialGroup() {
if (experimentPhase == PHASE_TRAINING) {
//we're in the first block's training phase
if (!Trial.trainingTrialGroups.isEmpty()) {
//start next training block
startTrialGroup(Trial.trainingTrialGroups.remove(0));
} else {
//all training blocks shown, ... |
0322530e-3963-4e8c-af5f-625429de1219 | 9 | public double classify(Instance inst)
{
Instance tInst;
// fill in missing values
fillMissing(inst);
// Conservative
if (m_classificationMode == CLASSIFICATION_CONSERVATIVE)
{
for(int i=0; i < rules.size(); i++)
{
tInst = (Instance)rules.elementAt(i);
... |
83c707dd-6d7a-4f01-b95a-84e45584f841 | 7 | String getState() {
StringBuffer commands = new StringBuffer("# connections;\n");
String cmd;
if (reportFormalCharges) {
Hashtable ht = new Hashtable();
for (int i = 0; i < atomCount; i++)
StateManager.setStateInfo(ht, i, i, "set formalCharge " + atoms[i].getFormalCharge());
commands.append(StateMana... |
c5a5eaf3-0fae-467b-98e0-75f614a98e9a | 2 | public void addResults(String label) {
// Create results array
double[] res = new double[size()];
for (int i = 0; i < res.length; i++) {
Entity e = entities.get(i);
if (e.hasOutput()) res[i] = e.getOutput();
else res[i] = Double.NaN;
}
// Add to results
results.add(res);
labels.add(label);
} |
fad511a5-057c-4fac-aca4-9ec88ecfd985 | 3 | private boolean containsNullValue() {
Entry[] tab = this.table;
for (int i = 0; i < tab.length; i++)
for (Entry e = tab[i]; e != null; e = e.next)
if (e.value == null) return true;
return false;
} |
d991ca83-b55d-4a9c-8f7c-0668c718e55b | 1 | public static void main(String[] args) {
Random rand = new Random(47);
SortedSet<Integer> intset = new TreeSet<Integer>();
for (int i = 0; i < 10000; i++)
intset.add(rand.nextInt(30));
System.out.println(intset);
} |
afb0c593-8a76-4040-8001-283d1039d800 | 0 | private Set<Card> fourFlushWithStraight() {
return convertToCardSet("AS,KS,QS,JS,TC,KC,QC");
} |
0008909e-5f5d-414a-95ea-aeb850aae4bb | 8 | private List getNeighbors(int location) {
List neighbors = new ArrayList();
// if location is not on left side, then add neighbors from left
if (location%(10)!=0) {
neighbors.add(new Integer(location-1));
if (location>9) {
neighbors.add(new Integer(location-11));
}
if (location<90) {
neigh... |
981a4952-1806-4ca4-b1bc-eb7d1584592b | 0 | public Marker (AbstractPlay play){
this.relatedPlay=play;
} |
ad289b76-f464-401f-b243-9ca46a5b71b2 | 2 | public boolean canEnter(Entity entity) {
return entering.size() == 0 && occupying.size() == 0 && leaving.size() == 0;
} |
5cffc2d7-0fc6-4cce-8a62-24a5e0e6b2ca | 0 | public int loadRunTimeStack(int offset) {
return runStack.load(offset);
} |
d1ea3093-8da1-492d-a4e0-1a9af3da0963 | 0 | JNotifyWatchKey(Integer assignedWatchKey, String folderPath) {
this.watchKey = assignedWatchKey;
this.setFolderPath(folderPath);
} |
7a4586f2-ea7f-407c-af31-14c10419317f | 9 | @Override
public void paint(Graphics graphics) {
// BASIC SETTINGS
Graphics2D g = (Graphics2D) graphics;
AffineTransform normal = g.getTransform();
AffineTransform rotated = g.getTransform();
rotated.quadrantRotate(3);
AffineTransform FLIP_X_COORDINATE =
new AffineTransform(1, 0, 0, -1, 0, getHeight()... |
d8dc9fec-0979-45a4-b4ba-75781be40c1c | 4 | public String nextName() throws IOException {
int p = peeked;
if (p == PEEKED_NONE) {
p = doPeek();
}
String result;
if (p == PEEKED_UNQUOTED_NAME) {
result = nextUnquotedValue();
} else if (p == PEEKED_SINGLE_QUOTED_NAME) {
result = nextQuotedValue('\'');
} else if (p == P... |
a5d8377d-a5f7-4e64-bd9e-afcbbd30b28f | 1 | public byte[] getMD5Sum() {
if (MD5Sum == null) {
MD5Sum = Base64.decodeBase64(MD5SumString);
}
return MD5Sum;
} |
dd81435a-e193-4013-952c-81d642fb5018 | 3 | public void setTrackLength(int trackNumber, int lengthInSeconds) throws SQLException
{
Track t = null;
for (Track track : getTracks())
if (track.getFormTrackNumber() == trackNumber)
if (t == null)
t = track;
else
return;
t.setLengthInS... |
f21c1070-4066-4644-aa3f-f3adc4a5b483 | 4 | @Override
public void performEvent(ActionEvent e)
{
if ("password".equals(e.getActionCommand())) if (password.getText().replaceAll(" ", "").isEmpty())
{
password.setForeground(Color.RED);
password.setText("Invalid New Password!");
}
else if (oldPassword.getText().equals(Save.FILE_PASSWORD))
{
new W... |
d3bb978e-7bdb-499c-ba63-428a47d18607 | 6 | 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;
} |
a61b1771-c917-463d-9c25-e2e26c3c27ec | 4 | public ChatClient( String serverName, int serverPort ) {
System.out.println( "Establishing connection. Please wait ..." );
try {
socket = new Socket( serverName, serverPort );
System.out.println( "Connected: " + socket );
start();
} catch( UnknownHostExcepti... |
ba1b81fc-2e65-4697-910b-538477a4cbdc | 1 | public boolean enregistrer() throws IOException{
try{
FileOutputStream fichier = new FileOutputStream(this.nomFichier);
propriete.store(fichier, "-Enregistrement config-");
fichier.close();
return true;
}
catch(FileNotFoundException e){
... |
913072c5-e2a7-4647-8132-bccbe3b91d20 | 7 | private void modifyPanelInit() {
modifyPanel = new JPanel();
//generates panels formatted layout of components
generator.createRigidSpace(modifyPanel, 15);
final JTable allClients = new JTable(allClientsModel.getTableModel(2));
allClients.removeColumn(allClients.getColumn("ID Number"));
allClients.setPre... |
6728cc93-9d5a-4c94-a485-e7f36fcf4d47 | 1 | public void stopServer() {
try {
serverIsRaning = false;
socket.close();
// socket = null;
// clientSocket.close();
} catch (Exception e) {
// TODO Автоматически созданный блок catch
e.printStackTrace();
}
} |
3a60e38b-6e99-4eb6-8f28-d89a9fe1418a | 6 | public synchronized void run()
{
if (_responseQueue != null)
System.out.println(getName() + " : starting dispatch");
if (_responseQueue == null)
{
while (_isRunning)
{
try
{
wait();
}
... |
9792c5a6-5983-4ed4-8b90-dfa157f24076 | 1 | public void removeLesson(Lesson l) {
int i = this.timeTable.getSlots().indexOf(l);
this.timeTable.getSlots().remove(i);
this.timeTable.getSlots().add(i, l.getSlot());
this.timeTable.checkForDuplicates();
if (this instanceof Group) {
((Group)this).done.put(l.getField(), false);
}
} |
b75fddb3-0b30-43bc-bdd4-56a93b1f4935 | 2 | public pgrid.service.corba.CorbaRoutingTable routingTable ()
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _request ("_get_routingTable", true);
$in = _invoke ($out);
pgrid.service.corba.CorbaRo... |
cdadb0a1-ff5b-4127-85a1-87a479ef7651 | 6 | public static byte[] encrypt(byte[] in,byte[] key){
Nb = 4;
Nk = key.length/4;
Nr = Nk + 6;
int lenght=0;
byte[] padding = new byte[1];
int i;
lenght = 16 - in.length % 16;
padding = new byte[lenght];
padding[0] = (byte) 0x80;
for (i = 1; i < lenght; i++)
padding[i] = 0;
... |
0f81cc02-a71a-42fe-9e64-03e778865429 | 3 | @Override
public boolean vorbedingungErfuellt(ServerKontext kontext, Spieler spieler,
Befehlszeile befehlszeile)
{
Raum aktuellerRaum = kontext.getAktuellenRaumZu(spieler);
boolean hasKuchen = false;
for(Item item : aktuellerRaum.getItems())
{
if(isKuchen(item))
{
hasKuchen = true;
break;
... |
f048069c-afce-48ec-b841-3ae3a16e5c1f | 0 | public String getNewText() {
return this.newText;
} |
87104109-2602-475b-95c6-d9a2e450d128 | 5 | public static <GInput> Filter<GInput> disjunctionFilter(final Filter<? super GInput> filter1, final Filter<? super GInput> filter2)
throws NullPointerException {
if (filter1 == null) throw new NullPointerException("filter1 = null");
if (filter2 == null) throw new NullPointerException("filter2 = null");
return n... |
aa881124-fbf3-4788-bb48-ce3d61c409a1 | 4 | public static final Map<Byte, String> agentOptionsToMap(byte[] buf) {
if (buf == null) {
return null;
}
Map<Byte, String> map = new LinkedHashMap<Byte, String>();
int i = 0;
while (i < buf.length) {
if (buf.length - i < 2) {
... |
4b505f90-4771-4cef-81fb-4a1c45ac85f9 | 1 | public String getStringForStates(State[] states) {
StringBuffer buffer = new StringBuffer();
for (int k = 0; k < states.length - 1; k++) {
buffer.append(Integer.toString(states[k].getID()));
buffer.append(",");
}
buffer.append(Integer.toString(states[states.length - 1].getID()));
return buffer.toString(... |
f40cfb88-b12f-44c3-ab7e-f0c24c91b013 | 0 | public float[] getXY(float t) {
return new float[] { (float) (this.x0 + Math.cos(this.radian) * t),
(float) (this.y0 + Math.sin(this.radian) * t) };
} |
043494c0-4a62-4094-87c3-8d9bedc5c4a4 | 8 | private int[] getTurns(int dir)
{
switch(dir)
{
case Directions.NORTH:
case Directions.SOUTH:
if (originalDirection == Directions.EAST)
return new int[] { Directions.EAST };
if (originalDirection == Directions.WEST)
return new int[] { Directions.WEST };
return new int[] { Directions.... |
ab3d1c09-55e7-495c-aaaa-5e33ee11019e | 0 | public Cost getCost() {
return cost;
} |
a2daec5d-cfd9-42ec-b844-c4ae8228f58e | 1 | public void closeConection(){
isConected =false;
try {
socket.close();
} catch (IOException e) {
// TODO Автоматически созданный блок catch
e.printStackTrace();
}
} |
da6a6bc0-013a-4826-96a6-0a1f7fb3425f | 8 | public static String findcachedirORIG() {
String as[] = { "c:/windows/", "c:/winnt/", "d:/windows/", "d:/winnt/",
"e:/windows/", "e:/winnt/", "f:/windows/", "f:/winnt/", "c:/",
"~/", "/tmp/", "", "c:/rscache", "/rscache" };
if (storeid < 32 || storeid > 34)
storeid = 32;
String s = ".file_store_" + sto... |
a2702965-d7a7-4c86-83a0-ebcce7fdc44a | 0 | public Bid getLatestBid() {
return bidsCatalog.get(bidsCatalog.size() - 1);
} |
46c62a5f-77c2-416b-a2e1-0f248121b5cd | 3 | public void run() {
if (this.monitor.isSlaComplient(System.currentTimeMillis() - parameters.getStartTime())) {
if (this.monitor.isAvailable()) {
this.monitor.registerRequest(true);
} else {
this.monitor.registerRequestOnDowntime();
}
} else {
if (this.monitor.isAvailable()) {
this.monitor.re... |
1de66384-fd78-47f1-8216-dcd8e29ea244 | 1 | private static void addTopLevelBrowser(Browser browser) {
if(topLevelBrowsers == null)
topLevelBrowsers = new ArrayList<Browser>();
topLevelBrowsers.add(browser);
} |
af65a4f3-358f-432e-a4eb-118545c4ff20 | 8 | public static void initialize() {
Scanner scanner = null;
try {
scanner = new Scanner(new File("postaggerkey"));
} catch (FileNotFoundException e) {
}
while (scanner.hasNextLine()) {
int indexRow = 0, indexCol = 0;
@SuppressWarnings("resourc... |
75dee98f-3de4-415f-aefa-1e45769f3aac | 2 | public List<Planet> MyPlanets() {
List<Planet> r = new ArrayList<Planet>();
for (Planet p : planets) {
if (p.Owner() == 1) {
r.add(p);
}
}
return r;
} |
26543b32-3004-449c-aae4-db130998d490 | 4 | public static void gotoPreviousLevel(GameStateManager gsm){
World cw = (World)gsm.getGameState(gsm.getCurrentState());
if(index == 0){
cw.getPlayer().setVector(4, 0);
return;
}
//save world we are currently in
Save.writeWorld(cw, index);
Save.writePlayerData(cw.getPlayer());
//get gametime to tr... |
16149067-7c51-447a-a99b-b9a1aed454ad | 7 | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof AbstractFlower)) {
return false;
}
AbstractFlower other = (AbstractFlower) o;
if (id != other.id) {
return false;
}
if ... |
7f7258ff-5091-4b99-a68f-18cf7b5b3c88 | 3 | void print(Node t, int n, boolean p)
{
if (p)
{
t.getCar().print(-n, false);
System.out.println();
printLambda(t.getCdr(), n);
}
else
{
if (n > 0)
{
for (int i = 0; i < n; i++)
Sy... |
325d07a2-9a44-413d-8295-49dd99128397 | 1 | public void mouseClicked(MouseEvent e) {
checked = !checked;
if(checked) {
textColor = "white";
}
CheckBox.this.fireEvent(new ActionEvent());
} |
11290159-149e-4c8a-b4fc-5bc5d7b8dd6b | 9 | private void move() {
xa = 0;
ya = 0;
int px = (int)level.getPlayerAt(0).getX();
int py = (int)level.getPlayerAt(0).getY();
Vector2i start = new Vector2i((int)getX() >> 4, (int)getY() >> 4);
Vector2i destination = new Vector2i(px >> 4, py >> 4);
if(time % 3 == 0) path = level.findPath(start, destination);... |
5b2dc455-9d40-4406-8302-717e322c2974 | 7 | @Override
/**
* Movement allowed, stopping to the first obstacle[non VOID] : TOP-DOWN-LEFT-RIGHT
* RETURNS true if the move is allowed
*/
public boolean checkMove(int Px, int Py,Player J,Piece[] B){
int Dx = Px - getPosx();
int Dy = Py - getPosy();
boolean W = J.isWhite();
boolean moveok = false;
//Lo... |
4e4820b8-ee3c-46bc-bc34-1b6f943eda4d | 5 | public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getTeamNameBytes());
}
if (((bitField0_ & ... |
fa060d3b-3250-4581-a6b5-25e641a9c4f6 | 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... |
30120557-4144-460d-b860-4cf1a880a9b8 | 2 | private void loadFeatureFromFile(String featureFile) throws IOException
{
FileReader fr = new FileReader(featureFile);
BufferedReader br = new BufferedReader(fr);
String line = null;
while((line = br.readLine()) != null)
{
String[] tks = line.trim().split("[\t]+");
int fid = Integer.parseInt(tks[0]);
... |
7824088a-763c-41a1-b57f-903102b26aec | 0 | private static void swap(String[] a, int i, int j) {
String temp = a[i];
a[i] = a[j];
a[j] = temp;
} |
592ec929-540f-4779-8227-d9c16f42ebe5 | 0 | protected void toggleResizable() {
setResizable(!this.isResizable);
} |
452836e8-d876-4a93-bf7e-8e070c643776 | 7 | protected static void search(ProcessSearchFlights processSearchFlights) {
StringBuffer stringBuffer = new StringBuffer(TravelSDK.INSTANCE.getSettingsResult().getWsUrl());
stringBuffer.append("?prgm=flight.search");
TravelSDK.appendStandartServiceParameters(stringBuffer);
stringBuffer.append("&offset=0&limit=").... |
7e6280bf-5537-43b9-aef7-d759965d4841 | 3 | public Integer getTier() {
Integer tier = 1;
if (!parents.isEmpty()) {
int tmpTier = 0;
int maxTier = 0;
for (Long parentId : parents) {
tmpTier = nodes.get(parentId).getTier();
if (maxTier < tmpTier) {
maxTier = tmp... |
a2bed2a7-47d0-41f9-876a-25dc8a8b19a0 | 2 | public Connection getConnection() {
Connection connection = null;
DbConfiguration dbConfiguration = new DbConfiguration();
String driver = dbConfiguration.getDbProperty(DRIVER);
String className = dbConfiguration.getDbProperty(CLASS_NAME);
String datasurce = dbConfiguration.getDbProperty(DATA_SOURCE);
m_log... |
650944c3-1d5b-42fa-a36d-65df7b254f7d | 1 | public final void mergePuzzlePieces(final SlidingPuzzleBoard newGameBoard,
final List<SlidingPuzzlePiece> puzzlePiece) {
for (int i = 0; i <= mergeProcedures; i++) {
SlidingPuzzlePiece firstPiece = SlidingPuzzlePiece.getPuzzlePiece()
.get(randomDigit(0, SlidingPuzzl... |
db8939f9-a50e-4eac-92ec-3a0893d32696 | 6 | @Override
public void process(OurSim ourSim) {
ActiveEntity monitoredObj = ourSim.getGrid().getObject(monitored);
if (monitoredObj != null && monitoredObj.isUp()) {
Monitor reverseMonitor = monitoredObj.getMonitor(interested);
if (isCreatingConnection && reverseMonitor == null) {
reverseMonitor = Mon... |
69ccd62b-b60f-4e6c-addb-09878d588405 | 6 | @SuppressWarnings("unchecked")
public static void updateSwitch(Switch sw) throws JSONException{
String dpid = sw.getDpid();
List<Port> ports = new ArrayList<Port>();
JSONObject obj, portObj = null, featuresObj = null;
Map<String, Future<Object>> stats;
// Start the rest calls, true is passed since we are ... |
20094dc3-a0da-4d2d-a7f8-581ea26360b7 | 4 | public static void sendResponse(String output, Long id, Long prdetailsId) {
try {
post = new HttpPost(prop.getString("BSSServerQuery").trim() + "/" +id);
post.setHeader("Authorization", "Basic " + new String(encoded));
post.setHeader("Content-Type", "application/json");
post.addHeader("X-Mifos-Platform... |
f07be2c8-3cd5-4446-aa7a-5f93b106987b | 8 | private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... |
2fe8fa12-fad9-4b0c-9b62-11ab8435c697 | 1 | public List<? extends Piece> getAvailablePieces() {
return availablePieces;
} |
894ee1d9-af60-4e26-b3e6-5f7f5162a5b1 | 6 | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
BotMessage other = (BotMessage) obj;
if (me... |
91eecbdd-a583-4dc7-ac6c-c03f19209679 | 2 | public void releaseBuffer(ByteBuffer bb){
if(this.createCount.intValue() > maxBufferPoolSize && (this.usableCount.intValue() > (this.createCount.intValue() / 2) ) ){
bb = null;
this.createCount.decrementAndGet();
}else{
this.queue.add(bb);
this.usableCount.incrementAndGet();
}
} |
17008f45-1b85-4c61-9352-bd493d22c8e0 | 6 | private int getOctaveOfHindustaniNote(String h) {
if (h.charAt(0) != '.' || h.charAt(h.length()) != '.') {
return wBaseOctave;
} else {
if (h.charAt(0) == '.') {
int count = 0;
while... |
3bc7985f-20ab-446f-b606-9a45ca7330d6 | 5 | public void stateChanged(ChangeEvent arg0)
{
if (arg0.getSource().equals(roundSpinner))
config.setMaxRounds(((Integer) ((JSpinner) arg0.getSource()).getValue()).intValue());
else if(arg0.getSource().equals(numLightsSpinner))
config.setNumLights(((Integer) ((JSpinner) arg0.getSource()).getValue()).intValue())... |
dd8aa11d-a931-4f3e-bbdc-3ba9165c5147 | 4 | public void vieillir() {
super.vieillir();
loterie = new Random();
if (age <= 15 && poids < 50)
grossir(loterie.nextInt(4) + 2);
if (age > 15 && poids < 40)
esperancevie = age + 1;
} |
162132db-704b-4c17-b7dd-ba77bdc4d248 | 1 | protected void setup() {
try {
Thread.sleep(10000);
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
// if (logger.isLoggable(jade.util.Logger.WARNING))
// logger.log(jade.util.Logger.WARNING, "greetings from setup()");
System.out.println("Hello Eclips... |
47d68e44-f6de-4835-9519-ac1d467e33c6 | 1 | private static void routeDirLog() throws Exception{
try{
File myRouteDir = new File(dayDir + "/Route");
myRouteDir.mkdir();
routeLogDir = myRouteDir.getAbsolutePath();
}catch(Exception e){
throw new Exception (e);
}
} |
2bf1ca41-5715-4995-b5ad-33338f48ea14 | 4 | private static void writeByte(int x) {
assert x >= 0 && x < 256;
// optimized if byte-aligned
if (N == 0) {
try { out.write(x); }
catch (IOException e) { e.printStackTrace(); }
return;
}
// otherwise write one bit at a time
for (int i... |
80dccef8-cce9-489c-bab5-eec5f2472256 | 6 | public void run() throws UnknownJobException, IOException, JSchException {
switch (type) {
case COMBINE:
executeCombineJob((CombineJob) job);
break;
case COMPRESS:
executeCompressJob((CompressJob) job);
break;
case DOWNLOAD:
executeDownloadJob((DownloadJob) job);
break;
case FORWARD:
exec... |
72fb3cb2-c053-4178-9e4a-9bb0fa8c6a28 | 8 | public static void main(final String[] args) throws IOException {
final Document doc = Jsoup.connect("http://en.wikipedia.org/wiki/World_War_II_casualties").get();
final Elements els = doc.getElementsByClass("wikitable");
// fourth table in the article is the terrorist stuff
final Element ww2CasualtiesTable =... |
61b632f6-c38b-45e5-a3f0-482e066b32d3 | 3 | public void addTransition(Transition t) {
try {
int ttapes = ((TMTransition) t).tapes();
if (tapes == 0)
tapes = ttapes;
if (ttapes != tapes)
throw new IllegalArgumentException("Transition has " + ttapes
+ " tapes while TM has " + tapes);
super.addTransition(t);
} catch (ClassCastException... |
9d8840df-e91d-4f4b-b8aa-4f53fdcfc0d1 | 9 | public void initialize(int numInputs, int numHiddenNodes, int numHiddenLayers) throws Exception {
Layer inputLayer = new Layer();
inputLayer.ID = 0;
Layer[] hiddenLayers = new Layer[numHiddenLayers];
Layer outputLayer = new Layer();
outputLayer.ID = numHiddenLayers + 1;
if (numHiddenLayers == 0) {
... |
5a272865-b23b-4faf-bad9-3cff1ab93266 | 1 | public static String escape(String str) {
String r = str;
for (char c: TO_ESCAPE.toCharArray()) {
r = r.replaceAll("\\" + c, "\\\\" + c);
}
return r;
} |
0610cb88-0bd0-4604-a90a-11249b5b07b0 | 1 | public Object dequeue() {
if(first != null) {
Object item = first.data;
first = first.next;
size--;
return item;
}
return null;
} |
2368b1a7-833f-4ea7-bb63-737776ef520a | 7 | public static int run_AI_BASIC()
{
System.out.println("BASIC AI Initiated");
int temp=(int)(Math.random()*4);
if(enemyLockedMove!=-1)
temp=enemyLockedMove;
//while(!Mechanics.enemyHasPP(enemy[enemyIndex].move[temp])&&(temp<0||temp>3))
while((temp<0||temp>3)||enemy[enemyIndex].move[temp]==Pokemon.Move.N... |
8a5b8272-5deb-4916-ac73-883c0de164e7 | 8 | @SuppressWarnings({ "rawtypes", "unchecked" })
public Room(RealClient p_client, Object[] p_data, String p_name, int p_width, boolean p_in)
{
this.client = p_client;
this.width = p_width;
this.name = p_name;
this.setLayout(new BorderLayout(0, 0));
menuBar = new JMenuBar();
this.add(menuBar, BorderLayout.NO... |
a241c232-f4a3-4dba-b8b1-3e9a2078bb83 | 6 | private ScoreObject modop(ScoreObject a, ScoreObject b) {
if (a.isNumeric() && b.isNumeric()) {
if (a.isFloat() || b.isFloat())
return new ScoreObject(a.getAsFloat() % b.getAsFloat());
// must both be int then
else if (a.isInt() && b.isInt())
return new ScoreObject(a.getInt() % b.getInt());
}
thr... |
113f27d8-2e73-4304-8a3b-9807c79d00ee | 9 | public void direction() {
if (untouchable > 0) {
Dolphin dolphin = (Dolphin) getWorld().getObjects(Dolphin.class).get(0);
if (dolphin.direction == 0) {
setRotation(0);
}
else if (dolphin.direction == 1) {
setRotation(-45);
... |
473175f0-ac35-4f52-b345-11e75cb8d9ab | 6 | public static String constructSymbolConstantName(GeneralizedSymbol symbol) {
{ String prefix = null;
String environmentname = "";
if (((Module)(symbol.homeContext)) != null) {
environmentname = ((Module)(symbol.homeContext)).moduleName + "-";
}
if (!(Stella.incrementalTranslationP()... |
65c80ff0-a4ed-4987-8e85-af5ce40fd014 | 5 | @Override
public String getFeature(int wordId, int... fields) {
String[] allFeatures = getAllFeaturesArray(wordId);
if (allFeatures == null) {
return null;
}
StringBuilder sb = new StringBuilder();
if (fields.length == 0) { // All features
for (String feature : allFeatures) {
sb.append(CSVUtil.quot... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.