method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
48dd9e69-f342-4d33-80e4-83c2acacb42b | 7 | public void setEditable(boolean value) {
if (inputText.getParentElement().getParentElement() == null && value) {
tagList.appendChild(inputText.getParentElement());
for (ItemTag<T> itemTag : getInputTags()) {
itemTag.listItem.getFirstChildElement().getNextSiblingElement().... |
e4c00ed0-a6ce-4c32-a51b-3bdb93d2eb01 | 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://do... |
551beff0-014d-493d-a8bc-60fba67deaed | 5 | private Player createNewPlayer(Socket cs, Server server, String name, Connection c) throws SQLException, IOException, NoSuchAlgorithmException {
//Offer to create a new player
Telnet.writeLine(cs, "This is your first time logging in, do you want to create a new character? ");
String input = Telnet.readLine(cs);
... |
b91e52d5-cc84-492f-818e-b0517d3944bc | 8 | public int nstStraight(Block set, Material m, BlockFace bf)
{
int x = 1;
int a = gen.nextInt(40);
if (a < 12) {
a = 12;
}
while (x < a) {
int newx = x - 1;
Block otherset = set.getRelative(bf, newx);
Block set1 = otherset.getRelative(BlockFace.WEST, 1);
Block set2 = ... |
aa70479a-8fb5-4594-9ea6-7de16c65e5e4 | 0 | private ParticipantList() {
textColors = new ArrayList<String>();
textColors.add("0000FF");
textColors.add("FF0000");
textColors.add("00FF00");
textColors.add("FF00FF");
textColors.add("00FFFF");
textColors.add("FFFF00");
} |
dd2c948d-f9ce-4d3f-a8d6-9f169cbca5c3 | 0 | public int getIdEncargo() {
return idEncargo;
} |
4bd2792e-2895-4d41-a234-27ad14d3ddea | 8 | private boolean isValidVertMove(int r1, int c1, int r2, int c2) {
if (c1 != c2) {
return false;
}
int step = r1 - r2 < 0 ? 1 : -1;
if (step > 0) {
for (int r = r1 + step; r < r2; r += step) {
if (board[r][c1] != EMPTY) {
return... |
c9609d46-7e32-4df7-a53a-e8c7694da9a5 | 7 | public void put(String key, MqttPersistable message) throws MqttPersistenceException {
checkIsOpen();
File file = new File(clientDir, key+MESSAGE_FILE_EXTENSION);
File backupFile = new File(clientDir, key+MESSAGE_FILE_EXTENSION+MESSAGE_BACKUP_FILE_EXTENSION);
if (file.exists()) {
// Backup the existing fi... |
37d53363-ca44-4c02-89cf-bf15ee986e0d | 0 | public String getOrder() {
return order;
} |
d957ea7a-45f9-46ca-9792-125dbd2ee292 | 6 | static final void method696(int i, int i_0_, int i_1_, int i_2_) {
if (i_2_ == -1007) {
if ((i ^ 0xffffffff) == -1010)
ScriptExecutor.method701(Class327.aClass273_4091, i_1_, i_0_);
else if ((i ^ 0xffffffff) != -1013) {
if (i == 1002)
ScriptExecutor.method701(Class348_Sub40_Sub32.aClass273_9415,
... |
dfe19025-1e85-45bc-8698-4793f82f147b | 9 | @Override
public void compile(Possession possession, Team home, Team away, TimeStamp timeStamp)
{
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch b... |
cee6fae9-c3ed-4c22-8ab5-90358d1fa9ac | 8 | public static int oppgave2()
{
int antallFeil = 0;
DobbeltLenketListe<Integer> liste =
new DobbeltLenketListe<>();
if (!liste.toString().equals("[]"))
{
antallFeil++;
System.out.println("Oppgave 2a: Tom liste skal gi []!");
}
if (!liste.omvendtStri... |
1dbb784a-5fbd-4901-900b-e1440dd69ac7 | 5 | public void actionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getSource() == jTextField1) {
PanelPedidos.this.jTextField1ActionPerformed(evt);
}
else if (evt.getSource() == jBtnDelete) {
PanelPedidos.this.jBtnDeleteActionPerformed(evt);
}
else if (... |
7491334c-0684-44fe-ae3a-655bc454d787 | 5 | @Override
public void stateChanged(ChangeEvent e) {
if(objPanelMR != null) {
if(e.getSource().equals(objPanelMR.sliderWC)){
objPanelMR.textFieldWC.setText(objPanelMR.sliderWC.getValue()+"");
}
if(e.getSource().equals(objPanelMR.sliderWW)){
... |
b9cf7ce3-0402-4b30-a1fe-0e461fd6f8aa | 1 | private void addPlanTicketToGroup(PlanTicket pt)
{
StopRange range = new StopRange();
range.start = pt.getStartStop();
range.end = pt.getEndStop();
int pos = CollectionUtils.binarySearchBy(this._stopRangeGroups, range, new Selector<StopRangeGroup, StopRange>(){
@Override
public StopRange select(StopR... |
f22bb6e0-1c50-46fd-a34c-d2fe659669c1 | 1 | private void evaluateOperatorByCount(int n) throws BinaryOperatorException {
int count = 0;
while (count < n) {
evaluateOperator();
count++;
}
} |
99d425c8-ac3c-41fd-b081-cd5fdd79f3e2 | 5 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UsersSubscribeHashtagsEntityPK that = (UsersSubscribeHashtagsEntityPK) o;
if (hashtagId != that.hashtagId) return false;
if (userId != that.use... |
0a5754cf-65bb-4913-9a4e-08d06858db81 | 0 | @Override
public void buildDough() { pizza.setDough("pan baked"); } |
4de09d36-8098-4f13-a0e2-912208e1221e | 2 | public FIB getModel(int Question_ID) {
FIB fibQuestion = new FIB();
try {
StringBuffer sql = new StringBuffer("");
sql.append("SELECT QuestionID,QuestionType,QuestionText, Instructions");
sql.append(" FROM `FIB`");
sql.append(" where QuestionID="... |
f41d6688-c76e-4fe6-9fba-bd1f2f90dcce | 3 | protected static HashMap<String, String> parseHeaders(String wholeMessage){
HashMap<String, String> answer= new HashMap<String, String>();
try {
String tempMessage= wholeMessage;
int indexOfNewline= tempMessage.indexOf(StompFrame.endlineChar);
String newLine= tempMessage.substring(0, indexOfNewline);
te... |
30f1c314-f6b2-430b-af65-ab4fe2e70c01 | 5 | public void startClient() throws IOException {
Socket socket = null;
PrintWriter out = null;
BufferedReader in = null;
InetAddress host = null;
BufferedReader stdIn = null;
try {
host = InetAddress.getLocalHost();
socket = new Socket(host.getHostName(), 5559);
out = new PrintWriter(socket.get... |
1c04a41f-e316-4a70-83e8-dfe5ec22fc92 | 1 | public boolean register(String user, String password){
PreparedStatement st;
Integer rs;
String query;
query="INSERT INTO people(name,password) VALUES('"+user+"','"+password+"')";
try {
st = conn.prepareStatement(query);
rs = st.executeUpdate();
st.close();
} catch (SQLException e) {
return fals... |
8e4005ee-bd61-414d-80c8-a226f1302309 | 3 | private void addBlankBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBlankBtnActionPerformed
try {
question = questionField.getText();
instructions = instructionField.getText();
hlanswer = questionField.getSelectedText();
hlanswer2="[" +... |
87789b44-45ba-4db8-be9d-b8d84487e817 | 6 | public void setCombatModifiers(int typeID) {
switch (typeID) {
case 0: weakAgainst = 4;
strongAgainst = 2;
break;
case 1: weakAgainst = 0;
strongAgainst = 3;
break;
case 2: weakAgainst = 2;
strongAgainst = 4;
break;
case 3: weakAgainst = 3;
strongAgainst = 0;
break... |
9b423cd5-ede5-4ecf-a363-8935b9e969fa | 5 | public static boolean isReservedAssignmentOp(String candidate) {
int START_STATE = 0;
int TERMINAL_STATE = 1;
char next;
if (candidate.length()!=1){
return false;
}
int state = START_STATE;
for (int i = 0; i < candidate.length(); ... |
2c048c56-ca7e-4792-be01-d2444e634c00 | 7 | @Override
public void removeMyAffectsFrom(Physical P)
{
if(!(P instanceof MOB))
return;
final List<Ability> V=getMySpellsV();
final Set<String> removedAbles = new HashSet<String>();
for(int v=0;v<V.size();v++)
{
final Ability A=V.get(v);
if(!A.isSavable())
{
removedAbles.add(A.ID());
((M... |
8d0a6bff-5cdb-41eb-93ad-8081aee50c08 | 2 | public static <T> NBTList fromArray(T[] args)
{
final NBTList list = new NBTList(args.length);
for (T arg : args)
{
final NamedBinaryTag tag = NBTParser.wrap(arg);
if (tag != null)
{
list.addTag(tag);
}
}
return list;
} |
a3ac1cdc-db2c-4089-b22a-74257ac50e09 | 6 | public boolean checkCollision(Cell[][] tiles){
for(int i = 0; i < tiles.length; i++){
for(int j = 0; j < tiles[i].length; j++){
if(tiles[i][j] != null && hitbox.checkCollision(tiles[i][j].getHitbox())){
return true;
}
else if(tiles[i][j] != null && feetBox.checkCollision(tiles[i][j].getHitbox())){... |
f7b3566b-6a09-43b0-8e3c-5e144c33c1bd | 4 | public void play(Sequence sequence, boolean loop) {
if (sequencer != null && sequence != null && sequencer.isOpen()) {
try {
sequencer.setSequence(sequence);
sequencer.start();
this.loop = loop;
}
catch (InvalidMidiDataException... |
e937c25a-2baf-48c1-82b4-464e79340957 | 6 | public static StringWrapper cppTranslateTypeSpec(StandardObject typespec) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(typespec);
if (Surrogate.subtypeOfParametricTypeSpecifierP(testValue000)) {
{ ParametricTypeSpecifier typespec000 = ((ParametricTypeSpecifier)(typespec));
if... |
e33d19f7-9730-4f16-b138-891e17538d22 | 7 | public Mensaje crearMensaje(String xml, String ip) {
Mensaje mensaje = null;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
StringReader sr = new StringReader(xml);
... |
c3dce10e-a75d-416b-a089-1b66614d9355 | 3 | public static void restart(boolean ausloggen)
{
if(ausloggen)
{
try
{
startUp._client.logout();
}
catch(RemoteException e)
{
e.printStackTrace();
}
}
startUp._server = null;
startUp._client = null;
startUp = null;
System.gc();
KeyboardFocusManager
.setCurrentKeyboardFocu... |
074ed418-3bb5-4ec9-a47b-1b6f111085bd | 8 | public void printFrameInfo() throws IOException {
int fn = -1;
FlacAudioFrame audio;
while ((audio=flac.getNextAudioPacket()) != null) {
fn++;
System.out.print("frame="+fn);
System.out.print(SPACER);
System.out.print("offset=??");
Syst... |
74b542f4-06a0-4d39-a570-f8e4e2929603 | 0 | public boolean getColor (){
return color;
} |
dacc4869-0455-43bf-8963-fd03527a2648 | 9 | public void paint(Graphics g) {
g.setFont(f);
FontMetrics fm = g.getFontMetrics(f);
int ascent = fm.getAscent() / 2;
// ruler
int maxValue = 0;
if (type == PITCH) maxValue = maxPitchValue;
else if (type == RHYTHM) maxValue = maxRhythmValue;
else if (type =... |
8e360df3-fb77-4cbb-882b-db26ba8886d3 | 0 | public Booking(String HKID, String userName, GregorianCalendar date){
this.HKID = HKID;
this.userName = userName;
this.date = date;
} |
9375f0d2-8e53-471b-ac52-09fbdb838c06 | 2 | public void reset(int width, int height, Minesweeper game) {
sections.clear();
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
sections.add(new Section(x, y, game));
}
}
} |
1fc74720-e6c7-40df-97f2-77bd8b3ec5c0 | 2 | private void getDataFromSectionTable () {
try {
connection = DriverManager.getConnection(Utils.DB_URL);
statement = connection.createStatement();
resultSet = statement.executeQuery("SELECT id, name FROM Section");
while (resultSet.next()) {
section... |
8fb3da1c-d26a-4764-86b0-cc6041b3b728 | 4 | public static void iceManipulationWaterWalk(Player player) {
for (int x = -1; x < 2; x++) {
for (int z = -1; z < 2; z++) {
Location location = new Location(player.getWorld(), player.getLocation().getBlockX() + x, player.getLocation().getBlockY(), player.getLocation().getBlockZ() + z);
Block block = locatio... |
e8b71b9a-f04d-4a18-929d-ff62d7a5adcf | 4 | private void doStop() throws Exception {
if (isActive()) {
doSetActive(false);
//..stop GarbageConnectios
try {
if ((garbageConnections != null) && (garbageConnections.isAlive())) {
garbageConnections.setStopped(true);
}
//..destroy listener
if (listener ... |
96847354-81e6-4316-9215-643c63603e44 | 2 | private static ServerSocketChannel createServerChannel() throws IOException {
ServerSocketChannel serverChannel = ServerSocketChannel.open();
serverChannel.configureBlocking(false);
for (int port = PORT_RANGE_LOWER; port <= PORT_RANGE_UPPER; port++) {
try {
serverChannel.bind(new InetSocketAddress(port));
... |
54b07265-6f45-472f-a7b3-422112e5b077 | 0 | @Override
public String getErrorMessage() {
return errormessage;
} |
c80c2070-2980-44f3-b642-390557795404 | 5 | public static void main(String[] args) {
System.out.println("Initialisation du client");
System.out.println("Specifiez l'adresse IP (127.0.0.1 par defaut): ");
String ip ="";
int port1 = 9876;
try
{
ip = bufferedReader.readLine();
if(ip == null || ip == "")
{
ip = "127.0.0.1";
}
Clie... |
b4fbaa9c-0f83-4b72-a6ef-c5cdd0ba2305 | 8 | @Override
public boolean equals(Object obj){
boolean out = false;
if (obj instanceof ChessGameConfiguration){
ChessGameConfiguration acg = (ChessGameConfiguration) obj;
if(this.currentBoard.length == acg.getCurrentBoard().length){
... |
2088b0c5-b0aa-4f83-9153-e2e1298872ae | 6 | @Override
public void run() {
long beforeTime, afterTime, timeDiff, sleepTime;
long overSleepTime = 0L;
int noDelays = 0;
long excess = 0L;
beforeTime = System.nanoTime();
running = true;
while (running) {
update();
render();
... |
13713b9c-8a14-45ea-97d3-6eda1d499ecd | 7 | public ChatClient () {
client = new Client();
client.start();
// For consistency, the classes to be sent over the network are
// registered by the same method for both the client and server.
Network.register(client);
client.addListener(new Listener() {
public void connected (Connection connection) {
... |
20d12cd5-8053-4509-b6ab-0059e9c332bc | 2 | public ScreenEffect(Vector4f start, Vector4f end, float duration, boolean moveTo, Tween tween) {
if(moveTo) {
Vector4f.sub(end, start, end);
}
this.startingValue = start;
this.endingValue = end;
// Using a duration of zero causes the effects to return NaN
if(duration == 0) {
duration = 0.001f;
}
t... |
2f3c2708-14c4-4267-96a9-501fe06d7f69 | 5 | private void nonTrivial(int[] section) {
int s, e;
for (e = buffer.length() - 1; e > 0 && buffer.charAt(e) == BLANK; e--)
;
if (buffer.charAt(e) != BLANK)
e++;
for (s = 0; s < e && buffer.charAt(s) == BLANK; s++)
;
section[0] = s;
section[1] = e;
} |
027a08dd-2e26-470d-8eea-f49cd1472a61 | 9 | public void takeClickDown(MouseEvent e)
{
if(drawing && selectedPoints.size()==0)
{
image.addPoint(e.getX(), e.getY()-22);
}
if(drawing && selectedPoints.size()==1)
{
image.insertPoint(e.getX(), e.getY()-22, iindex);
iindex++;
}
... |
19bfb261-976e-49ef-9eba-3d59b3cdd7de | 4 | public int AddPhrase(String Text, String ID) {
//Controllo se l'ID sia presente nella lista
for (int i = 0; i < this._MyPhraseList.size(); i++) {
if (this._MyPhraseList.get(i).GetID().equals(ID)) {
//Creo la stringa che contiene il testo
Chunk TmpChunk... |
40cea826-c2ac-4de3-8494-c3135d8dec3a | 4 | public void mouseMoved(MouseEvent e) {
// @TODO not built to handle multiple mice
float x = e.getX();
float y = e.getY();
float dx = x - mouse_old_x;
float dy = y - mouse_old_y;
mouse_old_x = x;
mouse_old_y = y;
data.items_new[FIRST_MOUSE_AXIS+0].value += dx>0? dx:0;
data.i... |
f45c167f-5b62-4285-880f-a47a9e945a39 | 9 | public int getLevel()
{
if (experience < 250) {
return 1;
} else if (experience < 750) {
return 2;
} else if (experience < 1250) {
return 3;
} else if (experience < 2000) {
return 4;
} else if (experience < 3250) {
return 5;
} else if (experience < 5500) {
return 6;
} else if (experienc... |
e26ce0f3-c41c-4f86-a5e5-c5fa975926fb | 0 | protected double getBreedingProbability()
{
return BREEDING_PROBABILITY;
} |
539edda3-3b88-4681-860d-b2db7470283c | 9 | private void addLink(JLabel label, final Key key) {
label.setCursor(getPredefinedCursor(HAND_CURSOR));
label.addMouseListener(
new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
Game game = gameListModel.getSelection();
String oldValue = null;
... |
9907b385-ea15-4e5f-8bfa-aade466da285 | 2 | @Override
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
if (!initSoundPlayed) {
initSoundPlayed = true;
}
if (InputChecker.isInputPressed(container, KeyBindings.P1_INPUT)) {
GameState levelState = new LevelState();
levelState.init(container, game)... |
2328965f-2a44-4913-bbec-5950ebe07c5e | 8 | public void shiftLeftClick() {
int flagCount = 0;
for (int i = -1; i < 2; ++i) {
for (int k = -1; k < 2; ++k) {
Tile update = this.board.getTile(super.row + i, super.col + k);
if (update != null) {
if (update.state.equals("flag")) {
++flagCount;
}
}
}
}
if (flagCount == this.n... |
3e326a41-4ba0-4655-a91e-b04cd5a702e9 | 0 | public long getMax() {
return max;
} |
1be009b9-581d-4d57-9ddd-bbd6854b5f70 | 6 | static void addEntries(JSONArray entry_list, int index, Connection Con, String str, int start_index, int max_fetch) throws Exception {
switch(index) {
case 0: {
entry_list.addAll(Course.Query(Con,str,start_index,max_fetch));
break;
}
case 1: {
... |
58e3e6c2-9390-4041-8a96-a7de697660b7 | 9 | public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for (int c=0,T=parseInt(in.readLine().trim());c++<T;) {
StringTokenizer st=new StringTokenizer(in.readLine());
int A=parseInt(st.nextToken()),B=parseInt(st.nextToken()),C=parseIn... |
7d79fb47-20bf-4a5d-8a4a-20bbbb54f0ec | 6 | public void setCurrent(int numberResults, Double timeInSeconds) {
if(run>=0 && timeInSeconds>=0.0) {
int queryNr = queryMix[currentQueryIndex];
int nrRuns = runsPerQuery[queryNr]++;
aqet[queryNr] = (aqet[queryNr] * nrRuns + timeInSeconds) / (nrRuns+1);
avgResults[queryNr] = (avgResults[queryNr] * nrRuns... |
a6ae3c93-df9d-4675-8713-44dbc33a3a16 | 9 | private void openSelected()
{
IFile file = ((SearchResult) resultList.get(resourceNames
.getSelectionIndex())).getFile();
try
{
// open the file
// @Eclipse2
// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor... |
736b5665-d7d9-4198-b1ae-901af6004ccc | 7 | public String sortingMethod(String[] stringList){
boolean lexSorted = true;
boolean lengthSorted = true;
int n = stringList.length;
for(int i=0; i<n-1; i++){
if(stringList[i].length()>stringList[i+1].length()) lengthSorted=false;
if(stringList[i].compareTo(stringL... |
7a6524de-58df-483e-899f-b986dbc14b52 | 6 | public void createGUI(Composite parent) {
GridLayout gridLayout;
GridData gridData;
/*** Create principal GUI layout elements ***/
Composite displayArea = new Composite(parent, SWT.NONE);
gridLayout = new GridLayout();
gridLayout.numColumns = 1;
displayArea.setLayout(gridLayout);
// Creating these e... |
5ebcc3e7-9f3b-4bca-9004-fc28235f0e89 | 4 | private boolean read() {
try {
final URLConnection conn = this.url.openConnection();
conn.setConnectTimeout(5000);
if (this.apiKey != null) {
conn.addRequestProperty("X-API-Key", this.apiKey);
}
conn.addRequestProperty("User-Agent", Up... |
e03c450a-1dbe-4755-8198-b143cb7909b2 | 6 | double[] compob(double x[]) {
for (int j = 0; j < parameters.length; j++) {
parameters[j] = x[j];
}
// singleRun();
// modelrun !!!!!!!!!
double F[] = new double[M];
for (int i = 0; i < M; i++) {
if (MaximizeEff[i] == Statistics.MINIMIZATION) {
... |
c2805f7a-7dad-4cf4-9189-3816fc78b522 | 3 | public static TreeMap<Integer,Integer> pitchRangeTrunkate(TreeMap<Integer,Integer> pitchTreeIn){
TreeMap<Integer,Integer> pitchTreeOut = new TreeMap<Integer,Integer>();
Iterator<Integer> pitchIterator = pitchTreeIn.keySet().iterator();
while(pitchIterator.hasNext()){
int key = pitchIterator.next();... |
fce6999b-01bf-4727-b065-1f00cc25de94 | 9 | @Override
public boolean equals(Object person) {
if (Java8.Person2.this == person)
return true;
//if (!(person instanceof Person2))
if (person.getClass() != Person2.class)
return false;
Java8.Person2 p = (Java8.Person2) person;
... |
ecc8e6b6-397d-4b33-882b-caa525dae6db | 1 | public void setMetadonnee(File doc) {
if (doc == null) {
nom = "Inconnu";
chemin = "0";
taille = 0;
dateModif = "Inconnu";
auteur = "Inconnu";
duree = "Inconnu";
note = 0;
icone = "img//icoNotFound.png";
listeSeries = null;
} else {
nom = doc.getName();
chemin = doc.getPath();
ta... |
67e61b88-fd08-47ea-91dc-f185de674748 | 0 | public void setAccountId(String accountId) {
this.accountId = accountId;
} |
39003dbe-a431-4ab0-bb06-c27cd28f2d0b | 6 | public Login1() {
Runnable obt_run = new Runnable() {
//check Caps Lock is On
public void run() {
while (check) {
if (Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK)) {
JOptionPane.showMessageDialog(n... |
9c9003ef-fae1-461c-8b03-0a78d5bbe9d5 | 0 | public IrcClient getCurrentClient(){ return CurrentClient; } |
4dc79746-4d60-45d9-9ed0-72598d2ab8f3 | 5 | @Override
public void run() {
while (this.parent.sckt.isConnected() && !this.parent.sckt.isInputShutdown()) {
try {
if (this.in.available() > 0) {
this.parent.onInputReceived(this.in);
}
... |
2104d360-cc84-4758-855c-12241094ce70 | 0 | public void setDays(ArrayList <Day> list)
{
days = list;
} |
1343820d-4af3-483e-a20f-bb2fb21db6de | 2 | public TreeNode getMaxNode() {
TreeNode current = root;
if (current == null)
return null;
while (current.right != null) {
current = current.right;
}
return current;
} |
d65fd78d-b305-4dc3-96e0-e7fd900cf50e | 7 | static final int method3266(AbstractToolkit var_ha, int i, Class277 class277) {
try {
anInt9674++;
if ((((Class277) class277).anInt3569 ^ 0xffffffff) == 0) {
if (((Class277) class277).anInt3575 != -1) {
TextureDefinition class12 = ((AbstractToolkit) var_ha).aD4579.getTexture(
((Class277) class27... |
59c2e65d-af40-4bae-9dc9-a2c946c10553 | 8 | public <T> void loadingMatches(final ObjectMapper<T> objectMapper) {
try {
while (getXmlStreamReader().hasNext()) {
getXmlStreamReader().nextTag();
if (getXmlStreamReader().getEventType() == XMLStreamConstants.START_ELEMENT) {
if (getXmlStreamReade... |
5166473c-084f-4153-8333-75ac90dbc0a0 | 4 | private static TypeArgument[] parseTypeArgs(String sig, Cursor c) throws BadBytecode {
ArrayList args = new ArrayList();
char t;
while ((t = sig.charAt(c.position++)) != '>') {
TypeArgument ta;
if (t == '*' )
ta = new TypeArgument(null, '*');
e... |
0f63b221-2963-4bd8-90ae-a58ef7c72b91 | 9 | private LinkedList<Vector2> findPath(Vector2 goal) {
// Get start position and direction
Vector2 start = iState.getAgentPosition();
int currentDirection = iState.getAgentDirection();
// Tentative G score
int tentativeG;
// Allows us to build the optimal path later
... |
0676fb64-cc92-4981-a86a-3508fa0c1dec | 1 | public Project updateProject(String projectName, String projectID,
String startDate, String endDate, String scope, String status,
String category, String outcome, String lastUpdated,
String updatedBy) {
Project prj = manager.find(Project.class, projectID);
if (prj != null) {
prj.setProjectName(projectNa... |
3e0d0b69-c6dc-4e05-b07b-380ea611c893 | 7 | private boolean isDragOk(final java.io.PrintStream out,
final java.awt.dnd.DropTargetDragEvent evt) {
boolean ok = false;
// Get data flavors being dragged
java.awt.datatransfer.DataFlavor[] flavors = evt
.getCurrentDataFlavors();
// See if any of the flavors are a file list
int i = 0;
while (!ok &... |
f4e76664-1cfa-4d93-babd-bfcfb080cf34 | 2 | public static String squeeze(String s) {
s = StringDemo.allTrim(s);
int count = StringDemo.spaceCount(s);
char c[] = s.toCharArray();
char c1[] = new char[c.length - count];
for (int i = 0, j = 0; i < c.length; i++) {
if (c[i] != ' ') {
c1[j] = c[i];
j++;
}
}
s = new String(c1);
return s;
... |
2efe593b-59ce-47d9-a5c9-5148e6ff0de4 | 7 | public static String doNameRequest(String userID, Boolean isGroup) throws ParseException
{
URL vkRequest;
String jsonResponse;
JSONObject obj;
JSONArray array;
JSONParser parser = new JSONParser();
if (userID.isEmpty())
return null;
try
{
... |
eebacfa9-8384-49b4-9443-3edbf8523c6c | 8 | public void getPeopleYouMightKnowToFile(FileWriter f) throws IOException {
ArrayList<String> ppl = new ArrayList<>();
for (User user : followers) {
if (user.getFollowers().size() == 0) {
ppl.add("The user: " + user.getName() + " doesn't follow anybody.\n");
} else... |
38a3767f-8e01-4cc4-987b-2fbf515d8941 | 8 | public static void main(String[] args) {
boolean teste = true;
MenuOpenHash menuOpenHash = null;
MenuClosedHash menuClosedHash = null;
MenuHma menuHma = null;
Scanner entrada = new Scanner(System.in);
while(teste) {
short opcao;
System.out.println("\n\n1- Open Hash\n2- Closed H... |
2ad07b3f-0150-49d9-8e5e-9d3b71e33304 | 5 | @Override
public boolean valid() {
if (options.useBOB.get() && options.beastOfBurden.bobSpace() > 0 && System.currentTimeMillis() > script.nextSummon.get()) {
if (!ctx.summoning.summoned() || ctx.summoning.timeLeft() <= nextRenew) {
return ctx.summoning.canSummon(options.beastOfBurden);
}
}
return fals... |
5bb2e865-1351-40cf-bc7b-846af784a992 | 2 | public static void main(String args[])
{
long begin=System.currentTimeMillis();
int total=1632442;
int limit=108829;
ExecutorService executorService=Executors.newFixedThreadPool(total/limit);
String name="";
for(int i=0;i<=total/limit;i++)
{
name="T"+i;
executorService.execute(new SetPaperAuthorLis... |
a41f75ef-32c9-4db7-9b44-166d3598c85f | 9 | public String replaceDocRootDir(String htmlstr) {
// Return if no inline tags exist
int index = htmlstr.indexOf("{@");
if (index < 0) {
return htmlstr;
}
String lowerHtml = htmlstr.toLowerCase();
// Return index of first occurrence of {@docroot}
// Not... |
f16d6c30-ae23-424d-8229-cf55402401c9 | 0 | public GeoJsonObject()
{
type = getClass().getSimpleName();
} |
036dc37e-8f0a-4e70-8926-bed25f3ad765 | 2 | @Override
public String getMessageErreur(int index) throws Exception {
if (index >= 0 && index < erreurs.size()) {
return erreurs.get(index);
} else {
throw new Exception("Index d'activité hors limite.");
}
} |
7bfcac85-b996-496d-9f90-20604065d43a | 8 | public void zoomOut(boolean center){
double x = EditorWindow.getPanelWidth()/2;
double y = EditorWindow.getPanelHeight()/2;
if ((mouseX-mainX)/tileBuffer.getMapPixelWidth() < 0 ||
(mouseX-mainX)/tileBuffer.getMapPixelWidth() > 1 ||
(mouseY-mainY)/tileBuffer.getMapPixelHei... |
0a50297b-d64d-4bb6-85d5-4d60a9621ab0 | 6 | public static boolean containsAny(Collection<?> source,
Collection<?> candidates) {
if (isEmpty(source) || isEmpty(candidates)) {
return false;
}
for (Object candidate : candidates) {
if (source.contains(candidate)) {
return true;
}
}
return false;
} |
28245426-a7e8-4fc4-b3f4-c4d079d1cb6f | 0 | public void setPruebaCollection(Collection<Prueba> pruebaCollection) {
this.pruebaCollection = pruebaCollection;
} |
4f33ef3d-4c38-48c8-b348-88dc787ed4d3 | 9 | private boolean r_verb_suffix() {
int among_var;
int v_1;
int v_2;
int v_3;
// setlimit, line 164
v_1 = limit - cursor;
// tomark, line 164
if (cursor < I_pV)
{
... |
64a6fe89-e524-4f5a-a472-d49002c944be | 2 | @Override
public String convertToText(String language, String filePath) {
StringBuilder responseText = new StringBuilder();
try {
int responseCode = sendImage(language, filePath, responseText);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
... |
3e54ff19-4d00-4527-8b85-7807dd828aa0 | 3 | private FieldIdentifier findField(String name, String typeSig) {
for (Iterator i = fieldIdents.iterator(); i.hasNext();) {
FieldIdentifier ident = (FieldIdentifier) i.next();
if (ident.getName().equals(name) && ident.getType().equals(typeSig))
return ident;
}
return null;
} |
5a8a4a8c-f4b6-48ed-a0e4-4470cc9884ee | 8 | private void checkOSStarted(VirtualMachine virtualMachine)
throws Exception {
String startTimeout = virtualMachine.getProperty(VirtualMachineConstants.START_TIMEOUT);
boolean checkTimeout = startTimeout != null;
int remainingTries = 0;
if (checkTimeout) {
remainingTries = Integer.parseInt(startTimeo... |
2f533294-163b-4efa-8140-1fedfb8791f1 | 5 | public static void GedExportTest(ArrayList<Dwarf> dwarfs) throws SAXException, IOException {
PrintWriter writer = new PrintWriter("dwarf.ged", "UTF-8");
for (int i = 0; i < dwarfs.size(); i++) {
if (dwarfs.get(i).getGender().contentEquals("MALE")) {
if (dwarfs.get(i).getSpous... |
c3bfdcc1-16d6-4012-bcc9-dbc72c100141 | 7 | private void placeZAxis(final List<Player> orderedPlayerList) {
ListIterator<Player> it = orderedPlayerList.listIterator();
boolean hasLegalSpot = true;
while (it.hasNext() && hasLegalSpot) {
Player player = it.next();
Set<PlanetEntrance> availableEntrances = galaxy.getAvailableSpots();
if (availableEnt... |
56232dbd-7911-4a00-a7a5-39b652cc6f4c | 3 | public void setEnderchestContents(ItemStack[] contents)
{
for (int i = 0; i < Enderchest.length; i++)
{
if (i < contents.length && contents[i] != null)
Enderchest[i] = contents[i].clone();
else
Enderchest[i] = null;
}
} |
6eb630c2-77a0-48e5-8123-3dde9ba30749 | 1 | @Override
protected void setReaction(Message message) {
try {
String url = getUrl(message.text);
reaction.add( getDefinition(url) );
} catch (Exception e) {
setError("Cannot load given URL.", e);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.