method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
5f5d32c3-f421-4fa7-ac91-26ba28237077 | 5 | public void testReadMultithreadedBulkWrite() throws IOException, InterruptedException {
final int numThreads = 16;
final int insertsPerThread = 256;
final int numEntries = numThreads*insertsPerThread;
final ByteChunk[] keys = new ByteChunk[numEntries];
final ByteChunk[] values = new ByteChunk[numEntries]... |
07b6dd1a-7f1e-4001-a14b-2e5ee4f5d5d9 | 8 | public RegExMultiReplace(String args[]) {
// Get argument for configFile
String configPath = null;
try {configPath = args[0];} catch (ArrayIndexOutOfBoundsException e) {}
if (configPath != null) {
// Set startpath from command line if it was provided
String startPathFromArgs = null;
try {start... |
502a5d38-c77d-472b-8dc1-fa4883503bd1 | 1 | @SuppressWarnings({ "unchecked", "rawtypes" })
private void setEnumValue(final Cursor cursor, final int index, final Field field, final Object object) {
final int value = cursor.getInt(index);
final Object result = (!cursor.isNull(index) ? valueOf((Class<Enum>) field.getType(), value) : null);
Reflection.setFiel... |
afee041e-0294-4259-bcd6-b282cd4e57de | 4 | private Action selectAction() {
int y = uniform(2);
if (current == Action.UP || current == Action.DOWN) {
current = y == 0 ? Action.RIGHT : Action.LEFT;
} else {
current = y == 0 ? Action.UP : Action.DOWN;
}
return current;
} |
ea665ca2-26d1-45d8-a6ab-d942ec1f5289 | 1 | private void disconnect() {
graph.removeGraphListener( graphListener );
for( GraphItem item : items() ) {
graphListener.itemRemoved( graph, item );
}
} |
6f731080-92dd-49cc-829b-5fb272f6532b | 9 | public String analyzerAll(String sourceString) {
String result = null;
List<String> mentions = new ArrayList<String>();
List<LinkLabel> links = new ArrayList<LinkLabel>();
List<String> emoticons = new ArrayList<String>();
ContentLabel contentLabel = new ContentLabel();
//bad codes to repeat and copy/paste ... |
fa1a4a7d-9aae-4aea-b05d-73edf669ce62 | 8 | public ConnectionInfo(JsonObject poolsJson) throws RestApiException {
JsonElement eTmp;
eTmp = poolsJson.get("implementationVersion");
if (eTmp == null) {
throw new RestApiException("implementationVersion missing", poolsJson);
}
clusterVersion = eTmp.getAsString();
eTmp = poolsJson.get("p... |
3b21ee51-e77e-48b8-a81e-59b6f6242700 | 5 | String getDuplicatedChannelsMsg() {
if (DuplicatedChannels.isEmpty()) {
return null;
}
String msg = null;
if (DuplicatedChannels.size() == 1) {
msg = "Channel " + DuplicatedChannels.first() + " is";
} else {
msg = "Channels ";
for (Integer i : DuplicatedChannels) {
if (i == Duplicate... |
d7eb7cdc-dd1f-4b9b-b6d1-eb6dabce6d3e | 6 | public boolean canMove(){
if(loc1.getRow() == board.getLength() - 1 || loc2.getRow() == board.getLength() - 1 || loc3.getRow() == board.getLength() - 1
|| loc4.getRow() == board.getLength() - 1){
return false;
}
ArrayList<Location> bottomLocs = getBottomLocs();
for(int i = 0; i < bottomLocs.size(); i++){... |
697b0cbd-75b8-4d49-99ea-e96becf788d7 | 9 | public boolean verifVoisins(int a, int b, int c) {
int tab[][] = new int[6][5];
int count;
tab = (int[][]) getPlateau().getPlateau();
if (tab[a][b] == 0) {
if (a > 0) {
if (tab[a - 1][b] == c) {
return true;
}
}
if (b > 0) {
if (tab[a][b - 1] == c) {
return true;
}
}
i... |
9d12ee32-aedd-42e5-a566-58c654b42dc8 | 3 | public void removeIntelCreature() {
synchronized (simpleCreatures) {
List<SimpleCreature> cList = Collections
.synchronizedList(simpleCreatures);
for (Iterator<SimpleCreature> it = cList.iterator(); it.hasNext();) {
SimpleCreature c = it.next();
if (c.getClass() == IntelCreature.class) {
if (c.is... |
03683102-54d8-4991-a34b-20076a30ae2e | 5 | @Override
public void start(String type) {
String tmp = "";
/*String tmp = "";
for (int i = this.messages.size() - 1; i >= 0; i--) {
if (type.contains("[*]")) {
tmp += this.messages.get(i) + "\r\n";
} else {
if (this.messages.contains(type)) {
tm... |
2919d674-a8e9-4919-a8a7-24e337137661 | 6 | public synchronized void gridletPause(int gridletId, int userId, boolean ack)
{
boolean status = false;
// Find in EXEC List first
int found = gridletInExecList_.indexOf(gridletId, userId);
if (found >= 0)
{
// updates all the Gridlets first before pausing
... |
2e0d854b-0b1a-4183-9b6d-4d29e5eabe25 | 0 | public synchronized String getString(ConfigValues path) {
return this.yaml.getString(path.getPath());
} |
5c8d3bfb-657e-4369-8e28-64d8810fef76 | 6 | public void onBlockFromTo(BlockFromToEvent e) {
if (e.isCancelled()) return;
CBlock conBlock = parent.getControllerBlockFor(null, e.getToBlock().getLocation(), null, true);
if (conBlock == null) return;
if (conBlock.isBeingEdited()) {
// Scheduled event should normally do this for us
if (!parent.blockPhys... |
04bb0bbb-e220-4c3d-9cdb-417c9fbe20f7 | 7 | public static JasperPrint generateBDC(Integer numFacture){
Connection conn=null;
JasperPrint printBDC=new JasperPrint();
long start =System.currentTimeMillis();
if (numFacture >0){
try {
... |
c75b34ec-c41a-44cb-a957-d79655649702 | 2 | @Override
public String toString() {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < array.length; i++) {
sb.append("Array[" + i + "] = " + array[i]);
if (i < array.length - 1) {
sb.append("\n");
}
}
return sb.toString();
... |
06c701ce-d3ab-4a9d-8c35-8d9922a0d7aa | 0 | public void accept(OperationVisitor visitor){
visitor.visit(this);
} |
7038556b-b0b5-4683-89d8-fdf680c88663 | 2 | public static void main(String[] args)throws Exception {
// TODO Auto-generated method stub
ServerSocket sSock = new ServerSocket(3000);
System.out.println("Server is waiting for client...");
Socket sock = sSock.accept();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Out... |
16bd7270-fc26-4fe8-b4b6-d5a4cac04760 | 5 | public ChatPlayer getChatPlayer(String player) throws SQLException {
sql.initialise();
plugin.cl.cLog("Loading "+ player);
ResultSet res = sql.sqlQuery("SELECT * FROM BungeePlayers WHERE PlayerName = '"+player+"'");
ChatPlayer cp = null;
while(res.next()){
ChatChannel channel = plugin.chatChannels.get(res.... |
8b5d1955-825c-4e36-a8e0-d06601f1a5a5 | 6 | private void monitorListInit()
{
monitorMap = new HashMap<Integer,MonitorView>();
Map<Integer, Integer> typeMap=contextService.loadIndicatorTypeMap();
for(int i:typeMap.keySet()){
switch(typeMap.get(i)){
case UIConstant.BASIC_INFO_ID:
monitorMap.put(i, groupbasicInfo.getMonitorList().get(i));
break... |
0832f5c8-e9ab-414d-95f2-235524f28a30 | 8 | public long computeCostOf(int[] tuple) {
for (Task task : tasks) {
if (task.evaluate(tuple) == 1)
return 1;
// task.displayEvaluations();
}
for (int i = 0; i < tasks.length; i++) {
for (int period = tasks[i].getOriginValue(); period < tasks[i].getEndValue(); period++) {
int heightSum = tasks[i].g... |
a9055a67-342d-48ba-9c20-19a667fca8f8 | 8 | @Override
public void setOnline(boolean online) {
if(online){
if(onlineImage == null && onlineImageIcon == null && onlineImageURL == null){
onlineImageURL = getClass().getResource("/images/user online 32x32.png");
onlineImage = Toolkit.getDefaultToolkit().getImage(onlineImageURL);
Image newimg = onlin... |
f168d60f-8884-4fb3-a4ff-55398524d0ae | 3 | public void scoreSort() {
ArrayList<User> temp = new ArrayList<User>(scoreboard.size());
int highscore = 0;
while (scoreboard.size() != 0) {
int pos = 0;
for (int i = 0; i < scoreboard.size(); i++) {
highscore = scoreboard.get(0).getScore();
if (highscore < scoreboard.get(i).getScore()) {
highs... |
fe1d79ee-4a93-40f3-9c64-21b6ec20d1ff | 8 | public boolean multis() {
switch (c.MAGIC_SPELLS[c.oldSpellId][0]) {
case 12891:
case 12881:
case 13011:
case 13023:
case 12919: // blood spells
case 12929:
case 12963:
case 12975:
return true;
}
return false;
} |
480e6558-8757-41b1-8a7f-dc9d60cee234 | 0 | public static direction dirFromString(String name) {
return getEnumFromString(direction.class, name);
} |
07a30895-26e4-449f-8644-1d70eee4ce0b | 4 | public static void main(String[] args) {
//旧版本排序
List<String> names = Arrays.asList("peter", "anna", "mike", "xenia");
Collections.sort(names, new Comparator<String>() {
@Override
public int compare(String a, String b) {
return b.compareTo(a);
}
});
System.out.println(names);
... |
4427537b-8067-4d20-adaa-2b20dcb74685 | 7 | protected int[] transmit56(int[] in) throws Exception {
//*deb*/System.out.println("transmit56() length: " +in.length);
int length = in.length;
int remain = length;
int out[] = new int[length];
int pointerInArray = 0;
int pointerOutArray = 0;
int partLength = 0;
... |
6c27b62b-51b1-48fa-9af3-aacdab9d0926 | 6 | protected static Ptg calcImSum( Ptg[] operands )
{
if( operands.length < 1 )
{
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "IMSUM" );
Ptg[] ops = PtgCalculator.getAllComponents( operands );
String[] complexStrings = new String[ops.length];
for( int i = 0; i < ops.length; i++ )
... |
ecaea739-421f-4fb5-8cdc-e6c2edb84c74 | 5 | private void rec(State s, int i, int remDelay, StateBuffer out) {
moves[i].clearCache();
if(i == moves.length-1) {
moves[i].execute(remDelay);
if(metric.getMetric() != 0)
out.addState(Gameboy.curGb.createState(true));
} else if (!moves[i].isDelayable()) {
moves[i].execute(0);
rec(curGb.newState(),... |
1d287d7a-4e07-42ec-abc6-883ffa0428bc | 5 | private units.Base FindTarget(int destx, int desty, boolean hostilefire, boolean friendlyfire) {
for (units.Base unit : Game.units) {
if (Game.player.get(unit.owner).team!=Game.player.get(owner).team||friendlyfire) {
if (unit.x==destx&&unit.y==desty) {return unit;}
}
}
return null;
} |
9b99112d-a9d6-4da8-9d33-e7737afb2700 | 0 | public int getLV() {
return lv;
} |
f723f45c-6eae-4afc-be1a-8447369eff7a | 2 | public Polygon getIntersectingPolygon(Vector3f origin, Vector3f direction) {
for(Polygon p : polygons) {
if (p.isIntersecting(origin, direction)) {
return p;
}
}
return null;
} |
6578e19d-b002-4c55-82e0-3fb456da9873 | 3 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String email = request.getParameter("email");
String password = request.getParameter("password");
//Hash password before storing in database. Compare hereafter with hashes only
String... |
4fab2343-a8dc-4346-b602-27636c3550f5 | 5 | public int maxProduct(int[] A) {
int length = A.length;
int max = 0;
if(length == 1)
return A[0];
if(A== null || A.length ==0 )
return 0;
int index = 0;
for(int i = 0; i < length; i++){
if(A[i] == 0 ){
max = Math.max(max... |
4a739261-30ad-42d4-90ab-4d3bab1ae11f | 9 | @Override
public boolean tick(Tickable ticking, int tickID)
{
if((affected!=null)
&&(affected instanceof MOB)
&&(tickID==Tickable.TICKID_MOB))
{
final MOB mob=(MOB)affected;
if((taming==null)||(mob.location()==null))
{
messedUp=true;
unInvoke();
}
if((taming instanceof MOB)&&(!mob.locat... |
50bd1c4d-8eeb-42e4-ac5a-d43944f8259b | 5 | public synchronized void close() {
if(!closed){
System.out.println("Умираю :(");
if(battleStarted)
battle.removeChannel(this);
if(userId != null){
gameServer.deleteUser(userId, currentBattle);
userId = n... |
722abdd3-6b1d-467c-a099-b2b35e411724 | 2 | public static String helpInfo() {
StringBuilder help = new StringBuilder("Arguments:\n");
String line = null;
for (Argument arg : arguments.values()) {
line = arg.description() == null? String.format("\t-%s,--%s: %s\n", arg.shortKey(), arg.fullKey(), arg.description()):
String.format("\t-%s,--... |
5c5a1e0d-a734-4c59-a7d0-dbef4825e0c6 | 2 | public void addParam(String field, String value) throws Exception
{
if (value != null && value.trim().length() != 0)
{
params.put(field, encodeUrl(value));
}
} |
bbddac6b-d37a-44bc-b108-46a26ae46e92 | 4 | public LayerManager() {
super(new LayerTreeModel());
model_ = (LayerTreeModel) getModel();
this.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent arg0) {
if (!__locked) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) getLastSelect... |
134eea7d-5de9-4cf9-a3ff-23cf34a1252b | 7 | public void validate() {
// check each entity descriptor
for (Entry<Class<?>, EntityDescriptor> entry : entityDescriptors.entrySet()) {
EntityDescriptor ed = entry.getValue();
// check pk
if (ed.getPrimaryKey()==null) {
throw new MissingPrimaryKeyException(ed);
}
// check FKs
for (Entry<Pro... |
b9d5c2dd-bfcb-48c2-ae2c-f40885475aa5 | 5 | static int[] merge(int[] a,int[] b){
if (a.length==0)
return b;
if (b.length==0)
return a;
if (a[0]<b[0]){
int t = a[0];
int[] r = new int[a.length-1];
for(int i = 0 ; i < r.length ; i++){
r[i]= a[i+1];
}
... |
e32c511e-6e9f-4872-83e5-84f4ef69adec | 7 | public static void main(String[] args) throws IOException, InterruptedException {
dialog = new MyDialog("Bluetooth multi-sender",null, new DevicesDialogListener());
remoteDeviceDiscoverer = new RemoteDeviceDiscoverer();
// First run RemoteDeviceDiscovery and use discovered device
dial... |
348257d8-6624-4c00-857e-d4866ade5800 | 8 | protected boolean writeMainDate() {
if ( mainWriteHandle == null ) {
return false;
}
// ˳StyleDVDUser
// 汾УϢ
for (String a : FILE_VERSION_STRINGS) {
mainWriteHandle.println(a);
}
mainWriteHandle.println();
mainWriteHandle.println("FileB");
mainWriteHandle.println();
mainWriteHandle.println("St... |
9b1b35d1-8e19-4a62-9409-cb43e6d15d81 | 9 | public void handOpened() {
Platform.runLater(new Runnable() {
@Override
public void run() {
switch (state) {
case SUPER_FREE:
break;
case FREE:
handToOpen();
b... |
576bc31e-49bf-4623-b3cf-5cd432e4e5ab | 5 | @Override
public void statusChanged(Status status) {
switch (status) {
case READY:
infoLabel.setText("Ready to go. Press Start to play."); break;
case ONGOING:
infoLabel.setText("Game is on. Choose a column to drop your piece"); break;
case RED_WIN:
infoLabel.setText("Red wins");
break;
case B... |
da033ca8-3fc8-4460-8cf2-882eff034f3c | 4 | public Data() {
this.secondaryRectangles = new ArrayList<>();
String[] data = Text.load("entree");
if (data.length == 2) {
data[0] = data[0].trim();
String[] line1 = data[0].split("x");
if (line1.length == 2) {
this.mainRectangle = new Rectangle(0, 0,
Integer.parseInt(line1[0]), Integer.parseIn... |
f6a4c028-cc8e-4a51-9478-991b07cf19ef | 0 | public void spy(String fileName){
search(fileName);
} |
65b117a1-0589-461f-9e02-0f24964b2cc6 | 0 | public AuthModule(){
setAuthor("Sinrel Group");
setName("Авторизация");
setVersion("1.0.0");
} |
1ba19a23-d778-43d6-86e1-95a4cdc4f792 | 3 | public boolean isSpace(int token) {
return (token == 0x20 || token == 0x0A || token == 0x0D || token == 0x09);
} |
2f69dc01-6fbe-44e4-9887-73570c6f7579 | 2 | public static Map<String, String> decode(String qs) {
Map<String, String> qry = new HashMap<String, String>();
String[] pairs = qs.split("&");
for (String _pair : pairs) {
String[] pair = _pair.split("=");
qry.put(Global.decodeURIComponent(pair[0]),
pa... |
e5165d73-d403-4c3c-b1d3-b756c8115774 | 4 | private void rightComp(float a, int vel) {
for (float i = 0; i < a; i++) {
if (!this.touchRobotRotate()) {
this.rotateRobot(1);
if (this.checkTouchBullet()) {
this.onHitByBullet();
return;
}
... |
9826f3bf-0a20-4336-83b9-94876344fd86 | 7 | public static String nowTime(){//現在時刻を出力する
Calendar cal1 = Calendar.getInstance();
int year = cal1.get(Calendar.YEAR);
int month = cal1.get(Calendar.MONTH) + 1;
int day = cal1.get(Calendar.DATE);
int hour = cal1.get(Calendar.HOUR_OF_DAY);
int minute = cal1.get(Calendar.M... |
2f272b3a-8306-496c-8d53-466b879acce8 | 9 | @Override
public void run(String[] args) throws IOException, Exception {
ExportOptions options = new ExportOptions();
CmdLineParser parser = new CmdLineParser(options);
try {
parser.parseArgument(args);
if (options.getIndex() == null) {
throw n... |
9381e6a4-682a-4025-951b-ef536e862acf | 0 | @Test
public void returnOne_whenInputCharsAreAllTheSame() {
List<Character> chars = new ArrayList<Character>(Arrays.asList('b', 'b', 'b'));
String expected = "[[b, b, b]]";
String actual = permutation.permute(chars).toString();
assertEquals(expected, actual);
} |
a7866161-3016-4b06-9f30-d2f16a9c60f5 | 8 | private void generatePattern(String filter) {
expr = new String(filter);
int index = filter.indexOf("\\");
String toReplace = "\\\\";
while (index != -1) {
filter = filter.substring(0, index) + toReplace +
filter.substring(index + 1);
index = fil... |
90cdad2d-8665-4f78-9c80-ebfd7d7ca2dd | 6 | public LMove giveMove(){
pGameForUser(); //give the user a visual representation on the game
Scanner keyboard = new Scanner (System.in);
String mStr = keyboard.nextLine();
if((mStr.length() % 2) == 1){
Letterpress.p("Please ensure that your coordinates are balanced.");
giveMove();
}
LMove m = new LMov... |
51e52a0c-f244-4bd9-8a1a-26e4ed76d540 | 8 | static int countFrom(Object o){
if(o == null)
return 0;
else if(o instanceof IPersistentCollection) {
ISeq s = seq(o);
o = null;
int i = 0;
for(; s != null; s = s.next()) {
if(s instanceof Counted)
return i + s.count();
i++;
}
return i;
}
else if(o instanceof CharSequence)
return ((CharSeq... |
cf0180d6-765a-4250-b264-13385401a430 | 8 | public static Stella_Object access_Fault_Slot_Value(Fault self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == SoapEnv.SYM_SOAP_ENV_faultcode) {
if (setvalueP) {
self.faultcode = ((faultcode)(value));
}
else {
value = self.faultcode;
}
}
el... |
04bda33b-463b-472a-ada7-85c778f4db9e | 2 | public final void move(final Field f) {
final Point goal =
f.sanitizeCoordinates(direction.getCoordinate(position));
if (!f.isWalkable(goal)) {
return;
}
if (f.isGrass(goal)) {
health += Parameter.HEALTH_PER_FOOD.getValue();
f.removeGrass... |
8e08b95c-29b2-4d05-baf0-f48f516f53e2 | 3 | @Override
public boolean acceptsDraggableObject(DraggableObject object)
{
if(object instanceof DraggableObjectFile)
{
DraggableObjectFile fileobj = ((DraggableObjectFile)object);
if(fileobj.file != null)
{
if(fileobj.file.getName().endsWith(".png"))
return true;
}
}
return false;
} |
be41dfb7-90bb-4f99-ba10-ff59cca509ff | 1 | private void addTree(IntBTNode addroot){
if(addroot != null){
add(addroot.getData());
addTree(addroot.getLeft());
addTree(addroot.getRight());
}
} |
056e28ef-4ce0-42d3-ae03-0a0929088cb2 | 0 | public byte[] getExponent() {
return exponent;
} |
45f38541-76b3-4060-89fa-26bcf853a001 | 7 | protected void agregarEnJuego(){
int numeroNave = 0;
final Nave controllerNave = this;
Color miColor = Color.GREEN;
switch(this.tipo){
case NONE:
miColor = Color.GREEN;
break;
case LANCHA:
miColor = Color.BLUE;
break;
case DESTRUCTOR:
miColor = Color.RED;
break;
case PORTAAVI... |
2db3108c-c604-4875-a5e7-8da7c632db5e | 6 | public static int objectAtTile(String name, Coord tile) {
Coord my = MapView.tilify(tile);
double min = 5;
Gob min_gob = null;
synchronized (glob.oc) {
for (Gob gob : glob.oc) {
double len = gob.position().dist(my);
boolean m = ((name.length()... |
a850a9eb-00ee-4f1a-b418-21adaf9128c9 | 1 | private GameSocketServer() {
super();
for (int i = 0; i < briscaGames.length; i++) {
briscaGames[i] = BriscaGameRoom
.getInstance(MAX_NUMBER_OF_USERS_PER_GAME);
briscaGames[i].addGameLawEnforcer((GameLawEnforcer) briscaGames[i]);
briscaGames[i].setId(i);
}
} |
1a281174-0420-4474-8468-e75f803a308d | 7 | public synchronized void render() {
int timePause;
if (this.visible == false) {
throw new MinuetoWindowInvalidStateException("Window is invisible");
}
if(this.isClosed()) {
throw new MinuetoWindowInvalidStateException("Window is closed!");
}
this.frameCount++;
if (this.frameCount == 50) {
... |
80bf2ae6-4b8a-45b5-81fd-ff5c65eac0ca | 6 | private static void writeMethod(BufferedWriter out, Box b)
{
Day d = b.getDayStored();
ArrayList <Event> list = d.getEvents();
String s1 = "$%$%$!~";//identify space between event attributes
String s2 = "!@#$*$%";//identify the end of a day
try{
Event e = list.get(list.size()-1);
if(e.getName()!=null)... |
0ee84d0e-2854-4754-9b36-37d7c224ffcd | 6 | public void countSensorsType() {
String str = "";
str += "\n" + equal + "\n" + "COUNT TYPE SENSOR - " + this.nameSensorGroup+ "\n" + equal;
Iterator iterator = iterator();
while (iterator.hasNext()) {
Sensor temp = (Sensor) iterator.next();
if (temp instanceof ... |
c161f3fd-755f-4aba-a058-b61e0f2b5f4d | 0 | private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
//set a Zelda Theme!
world.setThemes("Zelda");
this.repaint();
}//GEN-LAST:event_jMenuItem6ActionPerformed |
e9d6c841-05af-405b-92ae-e8d8f6039992 | 9 | public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
Player player = (Player) sender;
if (commandLabel.equalsIgnoreCase("Reset") && sender instanceof Player){
if (player.hasPermission("EasyPvpKits.Admin")){
if (args.length == 0){
player.sendMessage(ChatColor.RED ... |
d7263714-0f18-493d-865d-5d1d7a855e95 | 5 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Cidade other = (Cidade) obj;
if (this.idCidade != other.idCidade && (this.idCidade == null || !this.idCid... |
ac6c1c0b-048f-4356-af27-500376afde14 | 1 | public FSAConvertController(ConvertPane pane, SelectionDrawer drawer,
FiniteStateAutomaton automaton) {
super(pane, drawer, automaton);
converter = new FSAToRegularGrammarConverter();
converter.initializeConverter(automaton);
fillMap();
// Sets the labels.
State[] states = automaton.getStates();
for (i... |
44be57e1-a6c4-443c-924b-753cd89016a5 | 6 | @EventHandler(priority=EventPriority.HIGH)
public void onPlayerUseXp(PlayerExpChangeEvent event){
Player p = event.getPlayer();
Fruit f = null;
if(FruitManager.getInstance().checkIfPlayerIsDFUser(p))
{
f = FruitManager.getInstance().getFruitByPlayer(p);
switch(f.getId())
{
... |
ed691be0-fe08-4383-89b0-9b0f91d10785 | 3 | public static boolean hasPrayingPerm(Player p, Praying praying) {
if(p.hasPermission("adrundaalgods.praying.*"))
return true;
if(praying == null) return false;
if(p.hasPermission("adrundaalgods.praying."+praying.getName()))
return true;
return false;
} |
6e4dc473-001c-485c-9899-01d5ac7f8c8f | 2 | private static void register(BufferedReader br, ServiceInterface obj, Scanner cs)
throws IOException {
// TODO Auto-generated method stub
String str[] = new String[3];
for (int i = 0; i < 3; i++) {
str[i] = br.readLine();
}
if(obj.register(str[0], str[1], str[2])){
System.out.println(str[0]+" Regis... |
64d4325d-055a-4e2a-a510-b5079397c9e5 | 9 | public EntityFast(TileMap tm, double dx){
super(tm);
this.tiley = tm;
width = 35;
cwidth = 32;
height = 160;
cheight = 128
;
moveSpeed = dx;
maxSpeed = dx;
stopSpeed = 0.0;
fallSpeed = 0.1;
maxFallSpeed = 4.0;
jumpStart = -6.5;//-5.8
stopJumpSpeed = 0.3;
facingRight = true;
hea... |
37ddc43b-949b-43e2-9024-500b2e7f34e7 | 1 | @Override
protected void initializationLevel() {
MassAttractObject3D tempObj;
SimpleVector tempVec;
system = new ArrayList<MassAttractObject3D>();
for (StarSystemEnum p : StarSystemEnum.values()) {
tempVec = p.getVelocity();
tempVec.scalarMul(scalingFa... |
6123fa31-30fc-4dec-a7fe-ef81f133c212 | 0 | void with(final Gizmo g) {
// ! g = new Gizmo(); // Illegal -- g is final
} |
267b4ab2-fef0-4f9c-b2c1-b4c27fc7dd0d | 1 | public BufferedImage createCompatibleImage(int w, int h, int t){
Window win = vc.getFullScreenWindow();
if(win != null){
GraphicsConfiguration gc = win.getGraphicsConfiguration();
return gc.createCompatibleImage(w, h, t);
}
return null;
} |
f36150fb-1dba-44da-ba4c-a98373e460c0 | 0 | public Arena getArena(String name) {
return arenas.get(name);
} |
da1c18ad-58c5-4b6f-a0a2-9c7940c809a2 | 4 | public void paint(Graphics g) {
g.setColor(Color.green);
for(int i = 0; i < curPolygon.size(); i++) {
Point P = curPolygon.get(i);
Point Q = curPolygon.get(i + 1);
g.drawOval(P.ix - 2, P.iy - 2, 4, 4);
g.drawLine(P.ix, P.iy, Q.ix, Q.iy);
}
for(Poly polygon : visGraph.getPolygons()) {
g.setColor(C... |
54fe7dd3-5cfa-46f9-9996-f3d4dd00d120 | 7 | 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... |
6d6a3c1f-22a7-4dc2-a181-d5457092932e | 4 | private static void handleHeroAbilityKeys(Hero hero, Input input, HUD hud) {
for (int i = 0; i < HeroInfo.MAX_ABILITIES; i++) {
if (input.isKeyDown(ABILITY_KEYS[i])) {
try {
AbilityType ability = hud.getAbilityWithNumber(i + 1);
hero.tryToUseAbility(ability);
if (input.isKeyPressed(ABILITY_KEYS[... |
b905349e-7742-419d-87c2-b16b656e0dfd | 3 | public void saveLibrary() {
final String libraryFilePath = dlgLibrary.open();
if (libraryFilePath != null) {
Yaml yaml = new Yaml();
BufferedWriter stream = null;
try {
stream = new BufferedWriter(new FileWriter(libraryFilePath));
strea... |
38f9150e-3806-4ece-9d20-3a4ed31ce735 | 8 | public static void runCommand(String path, String options,String input) {
Object lockStdOut = new Object();
Object lockStdErr = new Object();
Process process = null;
OsUtils.errors=new StringBuffer();
OsUtils.result = new StringBuffer();
try {
//create a new process for dlv
process = Runtime.getRuntim... |
fc6294f1-e673-47c3-82e8-43428292b2b7 | 0 | public void setCurrentClient(IrcClient client){ CurrentClient = client; } |
da864d3e-f38b-433c-a75f-ac1e332e72c5 | 0 | public void addToPanels(Layer l, Panel p) {
l.getDrawable().add(p);
} |
e655a0c8-a93c-4964-933a-c8827ce33c71 | 2 | public void close() {
if (mFp != null) {
try {
mFp.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
mFp = null;
}
} |
2908c721-e09b-466e-8bc8-ed0144940703 | 4 | public static <T extends Comparable<? super T>> T min(T a, T b) {
if (a == null) return b;
if (b == null) return a;
return a.compareTo(b) > 0 ? b : a;
} |
4057907e-7de7-42ee-9d26-d05d202caa94 | 3 | private void flushBuffer() throws IOException {
if(bufferIndex > 0) {
SnappyCompressor.compress(buffer, 0, bufferIndex, cbuffer, effort);
bufferIndex = 0;
int l = cbuffer.getLength();
while(l>0) {
delegate.write(l >= 128 ? 0x80 | (l&0x7f) : l);
l >>= 7;
}
delegate.write(cbuffer.getData(), 0,... |
9026ff29-b9ae-4779-b6de-5003cbd45eed | 8 | public void run(){
Scanner uScan;
String sMsg;
String sStatus = "";
String sPrevStatus = "";
while(true){
//Check to see if the player is in an active game:
uScan = new Scanner(Client.sendMsg("GET_PLAYER_STATUS"));
uScan.next();
sStatus = uScan.next();
if(sStatus.equals("ACTI... |
b09c5a19-3bd9-48bb-8d18-70c8a65fc466 | 6 | private void readValues(Stream stream) {
anInt406 = stream.readUnsignedWord();
anInt405 = stream.readUnsignedWord();
if (Animation.anims != null && anInt406 != 65535 && anInt406 != -1)
aAnimation_407 = Animation.anims[anInt406];
anInt410 = stream.readUnsignedByte();
anInt411 = stream.readUnsignedByte();
i... |
5ca25eb6-9454-4877-b589-8a57fc18d99b | 8 | @Override
void think(World w)
{
/*
* Needs to be remade: instead make task do an AreWeThereYet() function
*/
if( getPathfollow().getRunning()==false) //if we are at the end of a scheduled route
{
if(this.getTask()!=null) //if we have to do something
{
... |
93d51029-0ea2-40cf-84c0-5f3465746472 | 5 | public boolean checkLogin(String mcuser, String pass) {
SecretPlayer player = secplayers.get(mcuser);
if (player == null) return false;
try {
byte[] hashtocompare = DatabaseUtils.base64ToByte(player.getData().getString("Word"));
byte[] salt = DatabaseUtils.base64ToByte(player.getData().getString("Salt"))... |
93f299c5-5748-45ca-a8c1-9132d9f4a061 | 2 | private void resetPlayerPositions(){
for (Team team : playmode.getTeams()) {
for (User user : team.getUser()) {
gameObjects.get("PLAYER" + user.getID()).resetLocation();
}
}
} |
e07a7e97-b19a-4fbd-bbd9-a50d9d7d8908 | 0 | public String getActivity() {
return activity;
} |
4bd49e8c-57f3-4ad7-89b0-79bfdd9b473a | 5 | public int getCursor(MouseEvent me) {
Component c = me.getComponent();
boolean isEditable = false;
boolean isLinkAnnot = false;
// get render flags from component.
if (c instanceof AnnotationComponentImpl){
AnnotationComponentImpl annot = (AnnotationComponentImpl) c;... |
06d785bd-337d-4826-8eab-2760d268fc76 | 8 | public void move(int xa, int ya)
{
if(xa > 0) dir = 1;
if(xa < 0) dir = 3;
if(ya > 0) dir = 2;
if(ya < 0) dir = 0;
collided = false;
mobCollision();
if(!tileCollision(xa, 0) && !collided)
{
x += xa;
}
if(!tileCollision(0, ya) && !collided)
{
y += ya;
}
} |
a07c90d9-fbf7-4246-af3b-5495eb381a12 | 1 | @Override
public void disconnect() throws Exception {
if (remoteClientCall == null) {
throw new IllegalStateException("RemoteClientConnection is not initial.");
}
remoteClientCall.disconnect();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.