method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9a6888a2-cb04-4e9e-ac05-599fce569aa2 | 0 | public String getName() {
String name = target.getName();
return name;
} |
16ec4230-03f7-4ff7-b5e0-436f8b12f73d | 3 | public static final synchronized METSMetadata parse( String filename, String mimetype, METSMetadata global_metadata ) throws InstantiationException {
try {
for ( int i=0; i< parsers.length; i++ ) {
if( mimetype.equals( (String) parsers[i][0] ) ) {
// attempt
Parser p = (Parser) parsers[i][1];
p.se... |
8698df15-7afc-45df-a7c0-09356f04bd62 | 7 | private final boolean cons(int i)
{ switch (b[i])
{ case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
}
} |
1f1f26be-2f26-44b1-b54c-6359a555ade4 | 5 | public static boolean isTypeEquals(String type1, String type2) {
if (type1 != null && ("jar".equals(type1) || "bundle".equals(type1))) {
return ("jar".equals(type2) || "bundle".equals(type2));
}
if (type1 != null) {
return type1.equals(type2);
}
return typ... |
680b5f38-4d3f-41a6-8969-13fe7a198fb0 | 6 | public static void putIntNullable(ByteBuffer out, Integer x)
{
if (x == null)
{
out.put( NULL );
}
else
{
int value = (x < 0 ? -x : x);
int sign = (x < 0 ? BYTE_SIGN_NEG : BYTE_SIGN_POS);
int a = (value & 0x1F);
int... |
bedc5a3a-c8c9-4788-9ee5-d07a3ea8b383 | 5 | public void startLog(){
try{
if(!_logEnabled){
int result = _logFileChooser.showDialog(null, "Log file");
if(result == JFileChooser.APPROVE_OPTION){
_logFile = _logFileChooser.getSelectedFile();
if (_logFile.getPath().indexOf(".html") != _logFile.getPath().length() - 5 ){
String newFilePath =... |
a4848d63-ae24-42f7-92a6-5d85a7df6bbf | 8 | public Response login(String user, String password, String server) {
greet(server);
if (!hasExtension("auth"))
throw new SMTPException("Authentication not supported");
String authMethod = esmtpFeatures.get("auth").toUpperCase();
Response response = new Response(-1, "Error");
... |
a790e20f-a8ce-4b07-a28f-34f504eb1c27 | 3 | protected Subscribers(final PluginManager pm, final String permission) {
this.pm = pm;
this.permission = permission;
final Set<Permissible> permissibles = this.pm.getPermissionSubscriptions(this.permission);
for (final Permissible permissible : permissibles) {
... |
94ef4a68-237c-4500-b570-47660bf07b3d | 0 | @Test
public void testCompareTextStringStringInt()
{
assertTrue(true);
} |
36ca8e9f-405c-4f32-b2cf-c39205b0216b | 8 | @Override
public void actionPerformed(ActionEvent e) {
String name = e.getActionCommand();
switch(name)
{
case "login":
{
Login_GUI aLoginFrame = new Login_GUI();
aLoginFrame.setVisible(true);
break;
}
case "search":
{
Search_GUI aSearchFrame = new Search_GUI();
aSearchFrame.setVisible(true);
br... |
1873b8f4-e339-4cf4-8d15-74ed21d25969 | 5 | public ArrayList<Pawn> getOpponentPawns(ArrayList<Player> opponents) {
ArrayList<Pawn> opponentPawns = new ArrayList<Pawn>();
for (Player opponent : opponents) {
if (opponent.getColor().equals("green")) { opponentPawns.addAll(new ArrayList<Pawn>(Arrays.asList(greenPawn)));}
else ... |
fdf07444-dcc9-495c-871d-76435d23dc3f | 2 | private static void makeArray(int array[][]) {
Random generator = new Random();
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array.length; j++) {
array[i][j] = generator.nextInt(8);
}
}
} |
f475c8ec-1f3a-4d1b-9332-15f2869075e9 | 0 | public void deleteRoomType(Scanner sc) {
System.out.println("Delete a type");
System.out.print("Enter type name: ");
String name = sc.nextLine();
System.out.println();
System.out.println(shsmb.deleteRoomType(name));
} |
6079634b-282d-44a3-93f6-33988c2b5b6c | 1 | public void dbInsert(String SDA, String DN) {
try {
//System.err.println("DBThread Runs");
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager.getConnection("jdbc:mysql://localhost/cdr_data?user=root&password=root");
preparedStatement = connect.prepare... |
f199fef6-d5cc-4102-bf7f-1f685f3d117e | 0 | public void setSeller(IautosSellerInfo seller) {
this.seller = seller;
} |
4e603c06-dce9-4de5-93da-686103b9bdf4 | 8 | public static int largestPeriod(int n) {
int ret = 0;
int max = 0;
String temp;
char util;
for (int i = 2; i < n; i++) {
temp = String.valueOf(i);
util = temp.charAt(temp.length() - 1);
if (util == '1' || util == '3' || util == '7' || util == '9') {
for (int a = 1; a < Integer.MAX_VALUE; a++) {
... |
4c449c54-4ed3-4e1a-b698-9454f389be82 | 2 | private static void renameButton(CustomButton a) {
String newName = a.getText();
if (getCountAll(a.getText()) != null)
newName += " (" + getCountAll(a.getText()) + ")";
if (getCountMatch(a.getText()) != null)
newName += " (" + getCountMatch(a.getText()) + ")";
a.setText(newName);
} |
097e3fdf-e072-4ad5-ae53-741dd5e71ef4 | 5 | @Override
public void transcribe(Dictionary dictionary) {
Iterator<String> iterator = text.iterator();
List<String> passage = new ArrayList<String>();
while (iterator.hasNext()) {
String line = iterator.next().trim();
if (line.isEmpty() && !passage.isEmpty())... |
a64f2bab-add8-4ecb-abe6-a00656dae4e4 | 9 | private List parseList(String s, boolean ordered) throws IOException {
List list = new List(ordered ? List.ORDERED : List.UNORDERED);
final Character listChar = ordered ? '#' : '*';
final int level = countChars(s, listChar);
ListItem item = parseListItem(s, listChar);
list.add... |
e3c98d8a-97c6-42de-9a4f-11b5e6b3ba02 | 4 | public UnicastReceiver(NetInterface net, int preferredPort) {
this.net = net;
this.port = preferredPort;
connections = new ArrayList<UnicastReceiver.AcceptedConnectionThread>(
NetInterface.NB_UNICAST_CONNECTIONS);
InetAddress inetAddress;
try {
inetAddress = InetAddress.getByName(Address.getDefaultIPAd... |
f12009ef-4323-4047-9072-b77172148a0d | 4 | private void setUpLevelSeven() {
int placeHolder = generator.nextInt(4);
if (placeHolder == 0){
centerTitle = imageMap.get("frizzled");
startingArrowStrand[2] = new StartingArrow(2, false,imageMap.get("blueArrow"), ArrowType.ACTIVATE, "blue");
startingArrowStrand[0] = new StartingArrow(0, true, imageMap.ge... |
388275e4-fb54-4e17-918f-ff7a629dfbb2 | 5 | public ThemeUtils(Frame frame) {
this.frame = frame;
int round = Client_Loader.round;
int width = 91, height = 27;
for(int i = 0; i < frame.questions.length; i++) {
int row = i / 5, column = i % 5, cost = round * BaseUtils.multiplier * (column + 1);
int x = questi... |
9925344e-e545-488a-9968-eb46ff8dc8cf | 9 | public void render(GameContainer container, StateBasedGame arg1, Graphics g)
throws SlickException {
space.draw(0, 0);
planetImg.draw(150, 150);
nextTurn.draw(900, 650);
int posX = Mouse.getX();
int posY = 768 - Mouse.getY();
String win = "False";
if(game.win() == true){
win = "True";
}
String l... |
c9d71b73-6547-421e-b941-738f3f0da465 | 2 | static void eraseBoard()
{
for(int i=0;i<pad.length;i++)
{
for(int l=0;l<pad[i].length;l++)
{
pad[i][l].delete();
}
}
red.erase();
blue.erase();
console.erase();
res.delete();
restxt.erase();
//song.stopPlayFile();
} |
bd3362dd-fb4f-4222-bce6-693b161dfc21 | 8 | @EventHandler(priority = EventPriority.LOW)
public void onPotionSplash(PotionSplashEvent event) {
plugin.debugMsg("Potion Splash event");
// who is the attacker?
if(event.getEntity().getShooter() instanceof Player) {
Player attacker = (Player) event.getEntity().getShooter();
... |
a60e610c-861f-45e0-8160-13ca4ae67e85 | 4 | public String mode_string()
{
switch (h_mode)
{
case STEREO:
return "Stereo";
case JOINT_STEREO:
return "Joint stereo";
case DUAL_CHANNEL:
return "Dual channel";
case SINGLE_CHANNEL:
return "Single channel";
}
return null;
} |
18861eba-c9d9-48ce-8a61-9ced8b65b6a4 | 6 | @Override
public void doAction() {
//if (!marioObject.isPreformingSpecialMove() && !marioObject.isJump()) {
if (marioObject.isLeft() && !marioObject.isRight()) {
doLeft();
} else if (marioObject.isRight() && !marioObject.isLeft()) {
doRight();
} else if (mario... |
de31d94e-2f31-49d8-8342-2ae284b839bf | 8 | public static String[] getObjetos( String com, String pro, String reg,String ultimocambiado){
String[] retorno = new String[3];
if(ultimocambiado.equalsIgnoreCase("R")){
com="0";
pro="0";
}else if(ultimocambiado.equalsIgnoreCase("P")){
com="0";
reg... |
81f16c45-b731-4982-b63c-bcd0416756ed | 1 | private String endTimeToString()
{
long end = this.videoSection.getEnd();
if (videoSection.getTimeUnit() == TimeUnit.SECONDS)
{
end *= 1000;
}
int millisecond = (int) (end % 1000);
end /= 1000;
int second = (int) (end % 60);
end /= 60;
... |
10c5b3d1-6c3e-47ee-b56f-2c33bb2c437e | 8 | @Override
public void execute() {
int howMany = new Random().nextInt(30);
int startRow = new Random().nextInt(100);
int endRow = new Random().nextInt(100);
if ( 0 <= howMany) howMany = 2;
if ( endRow < startRow ) endRow = startRow + 1;
System.out.println("howMany:" + howMany + ", startR:" + sta... |
4515f18d-dffb-4e09-ba30-4894f829bd0b | 7 | private void grabOSName() {
if (Main.VERBOSE) {
System.out.println("[INFO] Determining OS name...");
}
if (isWindows) {
builder.append("OS_Name=Windows\n");
} else {
BufferedReader buffRead = null;
String name = null;
try {
... |
f72e359f-ad6e-43a7-b124-42f20e90bace | 2 | private void removeCustomValue() {
for (int i = 0; i < getItemCount(); i++) {
ColorValue cv = (ColorValue) getItemAt(i);
if (cv.isCustom) {
DefaultComboBoxModel model = (DefaultComboBoxModel) getModel();
model.removeElementAt(i);
return;
... |
ecf18741-feb5-4583-85c9-8da8d9ce76b0 | 6 | public static void open(File path) {
if (!path.exists()) {
return;
}
try {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().open(path);
} else if (getCurrentOS() == OS.UNIX) {
// Work-around to support non-GNOME Linux desktop environments with xdg-open installed
if (new File("/usr/bin... |
ca94bcb3-68a6-4275-82b3-19bc0f1fdce6 | 1 | @Override
public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException {
List paramList1 = new ArrayList<>();
List paramList2 = new ArrayList<>();
StringBuilder sb = new StringBuilder(UPDATE_QUERY);
String ... |
711b7491-019e-4a4b-9797-6a50cc7c92d1 | 5 | public static boolean assetsUpdateRequired(String directory) throws IOException {
if (!(directory.endsWith("/")||directory.endsWith("\\"))) {
Logger.warning("Assets", "A slash was not added at the end of the asset directory to check for updates. Attempting to fix...");
directory = direct... |
2925dfcf-d083-4581-b3a9-af43e1c94228 | 9 | public void sitDown(Table[] tables, Restaurant restaurant)
{
//Le statut de la table passe a occupé
int numberOfPoeple;
System.out.println("How many people are you?");
numberOfPoeple = scan.nextInt();
//for sitting down a table must be free and must have the right superior number of chairs
for(int i = 0; ... |
dddff77a-5876-48dd-bc0b-de8d110f4bec | 1 | private void infoButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_infoButtonActionPerformed
if (difficulty == 0) {
extraTextField.setText("Enter number of throws per match and "
+ "difficulty to start");
} else {
extraTextField.setText(... |
2c7d90b5-2b9d-403f-be72-b70fe8e1b662 | 4 | public boolean moveBack(boolean isloaded, float tpf, int naarkolom) {
// vector van de huidige locatie van de kraan
if (this.getLocalTranslation().z < -50 && isloaded == false) {//terugrijden met snelheid 3 als ongeladen is
this.move(0, 0, tpf * 3 / 3);
return false;
} e... |
447736fd-216b-410c-9164-22d50e829a3d | 5 | @Override
public boolean cancelAuction(AuctionBean auction) {
if(this.getRole().equals(RoleEnum.SELLER_BUYER) || this.getRole().equals(RoleEnum.SELLER)){
//On verifie si l'enchere appartient a l'utilisateur
if(this.getListAuctionBean().get(auction.getAuctionId())!=null){
//On verifie si elle n'est ... |
0fbb1066-ce6f-44d3-81f8-650f3bbc5b4b | 9 | static void mainToOutput(String[] args, PrintWriter output) throws Exception {
if (parseArgs(args)) {
if (!showAuc && !showConfusion && !showScores) {
showAuc = true;
showConfusion = true;
}
Auc collector = new Auc();
LogisticModelParameters lmp = LogisticModelParameters.loa... |
9ac320dc-ae28-40ac-a950-c8245801e47f | 7 | private final void method484(int i) {
if (aBooleanArray1664[i]) {
method485(i);
return;
}
int j = anIntArray1631[i];
int k = anIntArray1632[i];
int l = anIntArray1633[i];
Texture.aBoolean1462 = aBooleanArray1663[i];
if (anIntArray1639 == null)
Texture.anInt1465 = 0;
else
Texture.anInt1465 = ... |
eaddef8d-a31e-4e58-903b-d33def1eb7b1 | 4 | public String getText() {
StringBuilder buffer=new StringBuilder();
int i=displayCounter+1,count=0;
// Check it hasn't reached its maximum size
if (i>=DISPLAYCOUNT) i=0;
while(count<DISPLAYCOUNT) {
if (displayString[i]!=null) {
buffer.append(displayString[i]);
buffer.append("\n");
}
i++;
... |
076717c1-2bf4-487f-b338-aa0017de059a | 4 | private static void mycrosss(CharSeq s1, CharSeq s2) {
CharSeqIt si1 = new CharSeqIt(s1);
boolean first = true;
while ( si1.hasNext() ) {
try {
char p1 = si1.next();
CharSeqIt si2 = new CharSeqIt(s2);
while ( si2.hasNext() ) {
... |
72aeb4a4-672c-4c08-8dc7-5a7ff018811c | 1 | public void pause(int millisec) {
try {
Thread.sleep(millisec);
} catch (InterruptedException e) {
e.printStackTrace();
}
} |
a92a3d43-ae5d-4c3a-906e-9c1b9b372111 | 8 | public int stringFinder(int start, int end, String string )
{
int mid;
while(start <= end && str[start] == "")
{
start++;
}
while(end >= start && str[end] == "")
{
end--;
}
System.out.println("start:"+start+" "+"end:"+end);
if(start > end)
{
return -1;
}
mid = (start+end)/2;
... |
d7deb769-aa9c-4e56-b345-e900f7544ede | 5 | private void closeSerialPort() {
// Wenn ein Port geoeffnet ist wird dieser geschlossen
if (serialPortOpen == true) {
System.out.println("Close serialport");
serialPortOpen = false;
if (serialSend != null) {
serialSend = null;
}
if (serialRecv != null) {
serialRecv = null;
}
if (seri... |
f6739099-4bbb-45ae-8f41-97986be85e40 | 9 | protected void checkData(Workbook wb) throws Exception {
Sheet sheet = wb.getSheetAt(0);
Row row = sheet.getRow(3);
Cell cell = row.getCell(0);
if (cell != null) {
String value = cell.getStringCellValue();
if (value == null || value.trim().isEmpty())
... |
05c5f4b1-ff42-47f6-91f1-e81819570c89 | 9 | @Override
public double h(Object state) {
Sudoku sudoku = (Sudoku) state;
// sudoku.print();
int grille[][] = sudoku.getGrille();
int min = 10;
for(int i = 0; i < 9 ; i++){
for(int j = 0; j < 9 ; j++){
if(grille[i][j] == 0 ){
Set<String> numbers = new LinkedHashSet<String>(... |
3369e1dd-040e-486a-984a-c03b1f7625ef | 0 | public String getChefVente() {
return chefVente;
} |
6a6377e9-f2e1-4330-abca-5e2d54de161c | 9 | @Override
public Location getTarget() throws ArrayIndexOutOfBoundsException,
InputMismatchException {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
System.out
.println("Please enter a number (0 - 9) "
+ "to represent the X coordinate of the TARGET you are shooting at: ");
... |
415d864d-895d-43dd-a268-c3c24a6564c7 | 9 | public int synthesis(Packet op){
Info vi=vd.vi;
// first things first. Make sure decode is ready
opb.readinit(op.packet_base, op.packet, op.bytes);
// Check the packet type
if(opb.read(1)!=0){
// Oops. This is not an audio data packet
return (-1);
}
// read our mode and pre/... |
4a354651-0327-41e3-a7f2-8a97c16c06e3 | 7 | @Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == chatField) {
if (cc != null) {
try {
cc.send(chatField.getText());
chatField.setText("");
chatField.requestFocus();
} catch (IOException ex) { ex.printStackTrace(); }
}
} else if (e.getSource() == ... |
ed0e7979-df32-42f0-8119-4c1474602743 | 5 | private static int med3(double x[], int a, int b, int c) {
return (x[a] < x[b] ? (x[b] < x[c] ? b : x[a] < x[c] ? c : a) : (x[b] > x[c] ? b : x[a] > x[c] ? c : a));
} |
a4828def-2eff-4b14-aae4-3b60372ad9be | 7 | public void setTableState() {
frame.question.setVisible(false);
for(int i = 0; i < frame.categories.length; i++) frame.categories[i].setVisible(true);
for(int i = 0; i < frame.questions.length; i++) {
frame.questions[i].setVisible(true);
frame.questions[i].setEnabled(fals... |
a1b6e3b6-838b-466d-85d9-55b1df531622 | 4 | private static void createBarbarianMotherfuckers()
{
new Thread("barbarian thread")
{
public void run()
{
try
{
Thread.sleep(100000);
}
catch(Exception ex)
{
ex.printStackTrace();
}
Random rand = new Random();
int time = 20000;
while(time > 100)
{
try
... |
2ef0cee9-f1fe-4936-865b-8d76bdd7b13d | 4 | @Override
public boolean equals(Object obj) {
if (obj == null){
return false;
}
if ( this.getClass() == obj.getClass()){
if(this.id.equals(((Operator)obj).id) && this.pos == ((Operator)obj).pos){
return true;
}
}
return fals... |
ded5be55-f3dc-436b-9057-bc0d9375e934 | 5 | public static String solve(int n) {
int n3 = 0;
boolean found = false;
for (; n3 <= n; n3 += 5) {
if ((n - n3) % 3 == 0) {
found = true;
break;
}
}
if (!found) {
return "-1";
}
StringBuilder sb... |
7987974c-6f6a-4451-8d10-0f4c01f1eb78 | 9 | static void checkLis(int[] a, int[] lis) {
int n = a.length;
boolean found = false;
m1:
for (int mask = 0; mask < 1 << n; mask++) {
int len = Integer.bitCount(mask);
if (len < lis.length)
continue;
for (int i = 0, prev = Integer.MIN_VALUE; i < n; i++)
if ((mask & (1 << i)) != 0) {
if (prev... |
0307caaf-3336-4fdc-a620-0d6c6befd7e3 | 7 | private synchronized void keyTranslate(int direction) {
if (allowDragCoordinatePlane) {
float xmin = xAxis.getMin();
float xmax = xAxis.getMax();
float ymin = yAxis.getMin();
float ymax = yAxis.getMax();
switch (direction) {
case KeyEvent.VK_RIGHT:
float dx = xmax - xmin;
xmin -= movePerc... |
c7e698c7-fc1c-40f5-a18f-af0580582f94 | 6 | public void processConfig(ArrayList<String> lines){
String s;
// Read the lines and find the link rule and local conditions
//TODO add support for multiple link rules and local conditions
for(int i=0;i<lines.size();i++)
{
// link rule found
if(lines.get(i)... |
f0ff3ffd-a3db-4c60-bfd1-da336f48431e | 5 | public int getIndex( String key )
{
int back = -1 ;
if ( key != null)
{
if (key.length() > 0)
{
int keyHash = key.hashCode() ;
int counter = 0 ;
Enumeration myEnum = translations.elements() ;
while ( ( myEnum.hasMoreElements() ) && ( back < 0 ) )
{
... |
e45828d1-197d-4687-8c4f-f623a4078f52 | 6 | public IpalilosCard() {
/*
* kartela ipalilou apo thn opoioa epilegei ti energeia thelei na kanei
*/
this.setTitle("Kartela Ipallilou"); //titlos parathirou
/* vgazei to para8uro sto kedro tis othonis me diastaseis 250x238 */
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
this.setBounds(di... |
2e7e4ff2-e9dc-4de3-a652-07448f852b50 | 0 | public String toString() {
return "Version{" + _version + "}" +
" Connected{" + isConnected() + "}" +
" Server{" + _server + "}" +
" Port{" + _port + "}" +
" Password{" + _password + "}";
} |
4e4fca73-8a2e-4335-bcca-bd971f3e7585 | 0 | public void setCallId(long callId) {
this.callId = callId;
} |
835990e1-96df-42e4-b260-ef3ce82303ff | 2 | public void mouseReleased(MouseEvent e) {
if (isIntro) {
} else if (isRunning) {
player.canShoot = true;
} else {
}
} |
d6b9363e-c6b1-4efd-bfb9-14ff39bafc85 | 3 | private void copyAnimations() {
standAnim = new Animation[PlayerEntity.STAND_ANIMATIONS.length];
for(int i = 0; i < PlayerEntity.STAND_ANIMATIONS.length; i++)
standAnim[i] = PlayerEntity.STAND_ANIMATIONS[i].copy();
moveAnim = new Animation[PlayerEntity.MOVE_ANIMATIONS.length];
for(int i = 0; i < PlayerEntity... |
031d2683-5c3c-4108-bd54-6ea0504a8a87 | 2 | public static String eliminarComillas(String s){
String ret = new String();
for (int x = 0; x < s.length(); x++)
if (s.charAt(x) != '"') ret += s.charAt(x);
return ret;
} |
bb4d249a-9593-4412-9af9-9f4427180e3b | 6 | public void advancedSearch(String tag) {
listD = getAllMetaData();
while(listD.size() > actual) {
try{
if (listD.getElementPosition(actual, 1).equals(tag)) {
listD1.addEnd(listD.getElementPosition(actual, 1), listD.getElementPosition(actual, 2), listD.getE... |
780384c5-e2da-441e-85b3-de222b319f53 | 2 | public void setBaggageWeight(double baggageWeight) throws OutOfRangeException {
if (( baggageWeight < 0 )||( baggageWeight > MAX_BAGGAGE_WEIGHT)){
logger.error( "incorrect baggage weight argument: " + baggageWeight );
throw new OutOfRangeException();
}
this.baggageWeight = baggageWeight;
} |
2f49d48b-34d4-4f74-99ce-3d7e787f642b | 0 | @Override
public String getDesc() {
return "Intimidate";
} |
63909646-2845-4ad4-9b3a-e52bcc2ffaa5 | 4 | @SubCommand(arg = "full")
void full(CommandSender sender, Args args) {
if (args.length() < 2) {
sender.sendMessage("Need the packet name and true or false");
return;
}
boolean full;
if (args.get(1).equalsIgnoreCase("true")) {
full = true;
}... |
006e782e-75ea-4cc4-b054-571f90975c86 | 0 | public long getLeft() {
return this.left;
} |
0047ad92-ef2c-4004-80b7-1092820134f5 | 2 | public static void makeRandomInteger(Matrix matrix) throws MatrixIndexOutOfBoundsException {
int rows = matrix.getRowsCount();
int cols = matrix.getColsCount();
double temp = 0;
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
// fill with ra... |
faef211a-cc7f-4398-a49f-623e4d215dff | 1 | protected Integer calcBPB_FATSz32() throws UnsupportedEncodingException {
byte[] bTemp = new byte[4];
for (int i = 36;i < 40; i++) {
bTemp[i-36] = imageBytes[i];
}
BPB_FATSz32 = byteArrayToInt(bTemp);
System.out.println("FATSz32 (количество секторов) = " + BPB_FATSz32... |
ba06f4e2-8f90-420f-88f4-d3129aafbc0b | 7 | private HttpResponse createResponse(HttpMessage message) throws IOException {
String resourcePath = ROOT_WEBSITE_DIR + message.getHeader().getLocation();
HttpResponse.HttpResponseCode responseCode = HttpResponse.HttpResponseCode.NOT_FOUND;
ReadOnlyResource resource = null;
if(resourceP... |
1ae584d7-4cd7-4010-84f4-f032b4ef085e | 6 | public void indexJarFile(Path jarFilePath)
throws IOException {
try (ZipInputStream zip = new ZipInputStream(new FileInputStream(jarFilePath.toString()))) {
for (ZipEntry entry = zip.getNextEntry(); entry != null; entry = zip.getNextEntry()) {
if ((entry.getName().endsWi... |
72c6093c-ec60-4197-8dd3-e889bd9c014d | 0 | private void Order(ArrayList<Person> Persons) {
Collections.sort(Persons, new Comparator<Person>() {
@Override
public int compare(Person p1, Person p2) {
return new String(p1.getLastName()).compareTo(p2.getLastName());
}
});
} |
78ddd3d1-b768-4f1b-86d6-c979a8b5e0f7 | 9 | @SuppressWarnings("unchecked")
public void run() {
if (startTimeNsec == 0) {
startTimeNsec = System.nanoTime();
}
synchronized (rehashMonitor) {
boolean boolval;
// Fast forward to make room for at least the current count. Use... |
1ee1419d-5aa9-444a-b978-bc16ca51d5f4 | 9 | private double workDuration(List<Worker> workerList1, String workerName,
String date) {
long workStartTime = 0;
long workEndTime = 0;
boolean flog = false; //8:00整打卡的标志位,"08:00:00"时workerTime=0,影响数据
for (Worker worker : workerList1) {
String workerDate;
try {
workerDate = dateFormat3.format(dateFor... |
a7e8f7b0-f18d-4bf3-9d53-23e7768734ae | 2 | public int executeUpdate(String query) {
int resultCode = 0; // result code from SQL update
//System.out.println("MySQL DAO execute");
// --- 3) prepare and execute statement
stmt = null; // SQL statement object
rset = null; // statement result set object
// get resultset
// System.out.... |
0aa4017f-a21d-4c49-a3a3-eb8197c6af05 | 8 | private void renderActorTitles(PrintWriter out) {
ArrayList titles = new ArrayList();
if (!uid.equals(""))
titles = actMethods.getTitlesAndUserRating(aid, uid);
else
titles = actMethods.getTitlesAndRole(aid);
if (titles.size() > 0) {
out.println("\t\... |
e9d68c90-6ec6-44e1-aea2-99fbe982379d | 6 | protected void UpdateLineColumn(char c)
{
column++;
if (prevCharIsLF)
{
prevCharIsLF = false;
line += (column = 1);
}
else if (prevCharIsCR)
{
prevCharIsCR = false;
if (c == '\n')
{
prevCharIsLF = true;
}
else
... |
6bddbbf1-e67f-47a3-ad27-b6708d5e3043 | 2 | public void setBalance(float balance) {
this.balance = balance;
if (outputLine == null) {
return;
}
try {
FloatControl control = (FloatControl) outputLine.getControl(FloatControl.Type.BALANCE);
control.setValue(balance);
} catch (IllegalArgumentException e) {
// balance not supported
}
} |
e11b7c0f-4830-4493-acd5-720f4173076d | 1 | private void launchMovieActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_launchMovieActionPerformed
Movie sMovie = movieViewerPanel1.getSelectedMovie();
try {
System.out.println(controller.getModel().getVlcLocation()+" --fullscreen"+sMovie.getMovieFile());
Runtime.getRuntime().exec(control... |
de288663-efa2-45cf-acf4-76c08fa4521d | 7 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final WorkPlan other = (WorkPlan) obj;
if (this.id != other.id) {
return false;
}
i... |
d4ad7b80-cc7d-4e23-a647-0df4c361e4d5 | 8 | private void updateBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateBtnActionPerformed
successLabel.setVisible(false);
if (activityNameBox.getText() == null
|| activityNameBox.getText().equals("")) {
//we don't want to do anything
//cus... |
d544ded0-1ec2-4b65-ad48-c086b2f94aee | 9 | private void field_nro_clienteFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_nro_clienteFocusLost
// TODO add your handling code here:
habilitarConfirmar1();
boolean es_componente=false;
if (evt.getOppositeComponent()!= field_punto_venta){
//voy a preguntar... |
5ae439f2-c5fc-4725-98d7-7d6dd0446792 | 8 | public String getCreationSQL() {
final StringBuilder sbSQL = new StringBuilder(100);
sbSQL.append("CREATE SEQUENCE ");
sbSQL.append(PgDiffUtils.getQuotedName(name));
if (startWith != null) {
sbSQL.append("\n\tSTART WITH ");
sbSQL.append(startWith);
}
... |
9b4db1cc-b4f5-41c1-b1b2-a996fc80dd58 | 4 | public void initializeFiles() {
File Users, Scores, Saved_Games;
Users = new File("Users.txt");
Scores = new File("Scores.txt");
Saved_Games = new File("Saved_Games.txt");
try{
if (!Users.exists()) {
Users.createNewFile();
}
if (!Scores.exists()) {
Scores.createNewFile();
}
if (!Saved_G... |
b0f4de31-1719-477c-90a4-1b69094201b3 | 8 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)&&(affected instanceof Item))
{
if((msg.amITarget(affected))&&(msg.targetMinor()==CMMsg.TYP_GET)&&(msg.source()!=invoker))
destroyOnNextTick=true;
else
if((msg.tool()!=nu... |
df22b082-a6cd-47dc-9210-9ca97bce908c | 1 | public void collectCallbackMethods() {
Transform transform = new Transform("wjtp.ajc", new SceneTransformer() {
protected void internalTransform(String phaseName, @SuppressWarnings("rawtypes") Map options) {
// Find the mappings between classes and layouts
findClassLayoutMappings();
// Process the cal... |
66e854c1-d2c5-474e-b433-34f97c5582f9 | 8 | public void updateFrame(Region newFrame){
double prevMinLat = 0;
double prevMaxLat = 0;
double prevMinLon = 0;
double prevMaxLon = 0;
double minLat = 0;
double maxLat = 0;
double minLon = 0;
double maxLon = 0;
synchronized (newFrame) {
prevMinLat = _frame.getMinLat();
prevMaxLat = _frame.... |
97d3ecd1-e8fc-4a8a-8341-ae554c3f0902 | 7 | private void runVote(World current_world) {
//vote_session = true;
// Set the worlds vote session to true
vote_session_world.put(current_world, true);
Player players [] = current_world.getPlayers().toArray(new Player[0]);
for (int i = 0;i < players.length; i++) {
if (vote_session_world.contains... |
a98b11ea-7f54-47f2-873e-0e962902c718 | 5 | public void doubleron(String winner1, String winner2, String loser, int hou1, int han1, int hou2, int han2)
{
int tempr, tempd, tempb;// round,dealer,bonus
tempr = round;
tempd = dealer;
tempb = bonus;
int start;
start = (position(loser) + 1) % 4;
for (int i = 1; i < 4; i++, start = (start + 1) % 4)
{... |
920a1944-f2ae-4851-a034-c9149ec40dc2 | 6 | public Set<Integer> getColorsInHand() {
Set<Integer> colorArray = new TreeSet<Integer>();
for (int i = 0; i < this.hand.length; i++) {
switch(this.hand[i].getColor()) {
case "blue": colorArray.add(1);
break;
case "green": colorArray.add(2);
break;
case "red": colorArray.add(3);
... |
260121cb-0f74-42dd-82c9-5eab06de20ae | 3 | public String check(int N) {
for(int i = 1;Math.pow(i, 2) <= N;i++){
if((N % Math.pow(i, 2)) == 0){
int a = (int)(N / Math.pow(i, 2));
if(a < i){
return "Yes";
}
}
}
return "No";
} |
f71fd62d-bb2e-4843-aaad-419a7ac16b0b | 7 | @Override
public List<Predicat> createPredicats(Request request, List<Predicat> predicats) throws Exception {
DataSetApplication dsApplication = (DataSetApplication) getContext().getAttributes().get("DataSetApplication");
DataSet ds = dsApplication.getDataSet();
Form params = request.getResourceRef().get... |
3298462e-4a23-49cc-9f6e-737d8b68d875 | 5 | public void draw(Graphics g) {
for (int i = 0; i < tiles.length; i++)
for (int j = 0; j < tiles[i].length; j++) {
if (tiles[i][j] != null) {
tiles[i][j].draw(g);
}
}
for (Item i : items) {
i.draw(g);
}
if (character != null) {
character.draw(g);
}
} |
081fb450-1159-4380-b2f3-abf2ecbd0551 | 7 | private void move() {
xa = 0;
ya = 0;
List<Player> players = level.getPlayers(this, 60);
if(players.size() > 0) {
Player player = players.get(0);
if(x < player.getX()) xa += speed;
if(x > player.getX()) xa -= speed;
if(y < player.getY()) ya += speed;
if(y > player.getY()) ya -= speed;
}
if(... |
af9d8857-d471-4a26-b210-bf1e79fc724d | 8 | public String getPartnerName()
{
if(conProt == null && internetCon == null)
return "";
if(conProt != null)
{
if(conProt.getConnectedName().equals("null") && getLANConnections())
return "Unidentified System";
if(!conProt.getConnectedName().equals(""))
return conProt.getConnectedName();
}
if(i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.