method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
fd47f80b-5716-475c-a3b9-8638b1cc4f65 | 1 | public void hint() {
if (remainingTransitions.size() == 0) {
JOptionPane.showMessageDialog(view,
"All transitions are in place already!");
return;
}
Iterator it = new HashSet(remainingTransitions).iterator();
Transition t = (Transition) it.next();
minDfa.addTransition(t);
} |
8ac0b323-3031-4698-a8d0-fd6789c13927 | 4 | public static String getHumanSize(Long size) {
if (size == null) {
return "";
}
String s = "";
double num = 0;
if (size < 1024) {
num = size;
} else if (size < (1024 * 1024)) {
num = (double) size / 1024;
s = "Kb";
... |
79c629ef-edac-4cda-bc2c-e28c1361a43f | 3 | public static void continuallySyncFiles(User u) {
Thread initClient = new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(600000);
} catch (InterruptedException ex) {
Logger.getLogger(ClientHelper.class.getName()).log(
Level.SEVERE, null, ex);
}
while (true) {
B... |
66c45e6d-7a7d-4f37-9c19-99500f00d36f | 4 | public int getBoardValue(int i,int j) {
if(i < 0 || i >= 3) return EMPTY;
if(j < 0 || j >= 3) return EMPTY;
return board[i][j];
} |
e420003d-b2f1-4def-907d-01047a0cb002 | 2 | public int connect() {
//System.out.println("Connecting to the database...");
int errorCode = 0;
// load MySQL driver
// --- 1) get the Class object for the driver
try
{
Class.forName ("com.mysql.jdbc.Driver");
// System.out.println("Found/loaded MySQL Connector JDBC driver");
}
... |
6219c965-19f3-4506-b534-5af83a6a9650 | 4 | public static String replace(String from, String to, String source)
{
if ((source == null) || (from == null) || (to == null))
return null;
StringBuffer str = new StringBuffer("");
int index = -1;
while ((index = source.indexOf(from)) != -1) {
str.append(source.substring(0, index) + to);
... |
b028e355-ce8d-4bc1-9d25-6b45c26e3b07 | 8 | public static LinkedList<String> transform(String start, String end,
Set<String> dict) {
LinkedList<String> res = new LinkedList<String>();
HashMap<String, String> backTrackMap = new HashMap<String, String>();
Queue<String> queue = new LinkedList<String>();
Set<String> visited = new HashSet<String>();
qu... |
5526164a-c70f-4f10-93ea-55d014dbdaec | 3 | public JSONWriter array() throws JSONException {
if (this.mode == 'i' || this.mode == 'o' || this.mode == 'a') {
this.push(null);
this.append("[");
this.comma = false;
return this;
}
throw new JSONException("Misplaced array.");
} |
24d5ecf9-a0a4-4e99-a8fc-9c17ba1ad024 | 8 | public void AVLinsert(int key) {
Node uusi = insert(key);
if (uusi == null) {
return;
}
Node p = uusi.parent;
// Tarkistetaan menikö puu epätasapainoon, jos meni niin suoritetaan tarvittavat kierrot
while (p != null) {
Node alipuu;
int ... |
d29ecae7-ef9b-4dd3-a5e9-b2ade8fd40f9 | 1 | @Override
public Void doInBackground() {
AudioPlay ad = new AudioPlay();
while(!isCancelled()) {
ad.Ringtone();
}
return null;
} |
67f1a94c-1779-457c-a123-81e92835758e | 9 | public static void useStemmer(Stemmer stemmer, String[] options)
throws Exception {
Reader reader;
StringBuffer input;
Writer output;
String tmpStr;
boolean lowerCase;
// help?
if (Utils.getFlag('h', options)) {
System.out.println(makeOp... |
b2d827a5-f74f-4585-9518-b3cb10594c9e | 8 | private void startCollection() throws SQLException {
Timer = new TimeCal(Settings.timer);
Timer.start();
dataStore = new DataStorage();
dataStore.initialTable();
dataStore.start();
while(true){
System.out.print("");
if(TwitterCrawler.finishStore){
TwitterCrawler.finishStore = false;
... |
90e54dc4-9869-4f2b-813d-2b9dc2e0465a | 2 | int distTo(int v) throws NonExistentVertexException
{
if (v < 0 || v >= distTo.length)
throw (new NonExistentVertexException("BFS : distTo() : " + v
+ " does not exist"));
return distTo[v];
} |
cbf6ca61-85ef-42a9-86bd-01f6c9fccabf | 6 | @Ignore
@Test
public void statementOfMaxFiguresOnBoard14Bishops16Kings() {
Map<String, Integer> figureQuantityMap = new HashMap<>();
figureQuantityMap.put(BISHOP.toString(), 14);
figureQuantityMap.put(KING.toString(), 16);
int dimension = 8;
Chessboard chessboard = Chess... |
c28f2bf5-87e2-4341-bdd1-bbbea45a671f | 0 | @Override
public void keyPressed(KeyEvent e) {
unprocessedEvents.add(e);
} |
c4e8f1ed-92f1-42a4-8652-60ea1ce6fe23 | 2 | @SuppressWarnings("unchecked")
ArrayList new56() /* reduce ANonTerminal$Stmt */
{
@SuppressWarnings("hiding") ArrayList nodeList = new ArrayList();
@SuppressWarnings("unused") ArrayList nodeArrayList2 = pop();
@SuppressWarnings("unused") ArrayList nodeArrayList1 = pop();
LinkedL... |
4427d24b-de65-47a7-a220-73af660133b4 | 1 | public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
for(IntegerHashBucket bucket : map) {
sb.append(bucket.toString());
}
sb.append("]");
return sb.toString();
} |
9777bb88-fe09-467c-8d9a-051e50901e30 | 7 | public void run(){
try{
socket=Util.createSocket(host, port, TIMEOUT);
socket.setTcpNoDelay(true);
io=new IO();
io.setInputStream(socket.getInputStream());
io.setOutputStream(socket.getOutputStream());
sendOpenConfirmation();
}
catch(Exception e){
sendOpenFailure(... |
43b32d19-9558-42a7-85d0-ad8c2d71aa13 | 1 | public static void printTab(String string, int l) {
if (check(l)) {
toTerminal(" " + string, l);
}
} |
d1a1c603-b20e-4196-bc9d-7a1f4d44bd58 | 5 | public void checkCollisions() {
Rectangle rCraft = craft.getBounds();
for (Alien alien : alAliens) {
Rectangle rAlien = alien.getBounds();
if (rCraft.intersects(rAlien)) {
craft.setVisible(false);
alien.setVisible(false);
ingame = f... |
49a57fad-7706-407d-8106-8262bb9dbc8e | 3 | public void printMaze(Node currentNode, ArrayList<Node> closedNodes) {
// Closed nodes will use "X" symbol
for (Node closed : closedNodes) {
// System.out.println("PRINT: Closed.getX(): " + closed.getX() + " Closed.getY(): " + closed.getY());
this.maze[closed.getX()][closed.getY()] = "X";
}
// Current nod... |
8905f31d-fba2-415d-8abb-26d628d93be7 | 4 | public static boolean isSame(ChipColor color1, ChipColor color2) {
if((color1 == BLACK && color2 == BLACK) || (color1 == WHITE && color2 == WHITE) )
return true;
else
return false;
} |
602d4066-2ab4-4e80-91f9-5b17134fb6de | 7 | public String changeNew(char change, char changeTo) {
String out = start;
boolean delete = (changeTo == 't');
for (String s : pieces) {
StringBuilder st = new StringBuilder();
try {
NoteLine n = new NoteLine(s);
ArrayList<String> notes = n.... |
8302f1fd-9865-43f2-b625-8032b5c73c26 | 9 | @Override
public void setUpPhase(CatanColor pieceColor, IPresenter presenter) {
Player player = presenter.getClientModel().getServerModel().getPlayers().get(presenter.getPlayerInfo().getIndex());
if (player.getRoads() == 15) {
startDrop(PieceType.ROAD, pieceColor, false);
}
else if (player.getRoads() == ... |
339e9872-d10b-4d97-906d-16d40c7effcf | 9 | boolean read() throws IOException {
if(status == Status.CLOSING) {
return false;
}
if (socketChannel.isConnected() == false) {
return false;
}
if(pingSentTime != 0) {
if(System.currentTimeMillis() - pingSentTime > PING_WAIT_TIME) {
socketChannel.close();
status = Status.CLOSING;
thr... |
9a15c1e6-aca9-4c86-b06e-38f11b9aacdd | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
Employee other = (Employee) obj;
if (divisionName == null) {
if (o... |
2b19448c-f5b1-4e72-b35f-a398bd161342 | 3 | @Override
public void serialize(ByteWriter bw) throws IOException {
int size = 10;
for (byte[] i : list)
size += i.length + 2;
bw.write2bytes(size);
for (byte[] i : list) {
bw.write2bytes(i.length + 2);
for (byte j : i)
bw.write(j);
}
bw.write2bytes(0);
} |
dc2e54c5-a2e3-4a57-93c0-e06103b6847c | 6 | public void deerPopulationCalculations(){
int growthDays = 365;
if(Variables.deerPopulation >= 2){ //checks to see the amount of deer is greater than or equal to 2
Variables.offSpring = Variables.offSpring + 5; //creates 5 offspring
}
if(Variables.totalDays == growthDays){ //checks to see the total amount of... |
e0e57cd1-34c9-4527-8555-dcf297dacbc4 | 6 | public void cropBy(Box3D box) {
if (xpos < box.xpos) xpos = box.xpos ;
if (ypos < box.ypos) ypos = box.ypos ;
if (zpos < box.zpos) zpos = box.zpos ;
if (xmax > box.xmax) xmax = box.xmax ;
if (ymax > box.ymax) ymax = box.ymax ;
if (zmax > box.zmax) zmax = box.zmax ;
xdim = xmax - xpos ;
y... |
e101b039-e1f8-41bf-aac6-6ef15cb8686d | 7 | public LocalVariableState constructorCall(StackEntry entry) {
List<StackEntry> newContents = new ArrayList<StackEntry>(contents.size());
if (entry.getType() == StackEntryType.UNINITIALIZED_THIS) {
for (int i = 0; i < contents.size(); ++i) {
StackEntry stackEntry = contents.ge... |
494ba59b-f326-4104-91bb-0c781fbb6b18 | 2 | public void mousemove(Coord c) {
for (Widget wdg = lchild; wdg != null; wdg = wdg.prev) {
if (!wdg.visible)
continue;
Coord cc = xlate(wdg.c, true);
wdg.mousemove(c.add(cc.inv()));
}
} |
142aa04b-b991-49fd-9b2d-b65053388dd9 | 3 | public static Image saltAndPepper(Image original, double minP, double maxP) {
if (original == null)
return null;
Image saltAndPepper = original.shallowClone();
for (int x = 0; x < original.getWidth(); x++) {
for (int y = 0; y < original.getHeight(); y++) {
double p = Math.random();
setPixelSaltAndPe... |
2bce1ab0-42af-4fe8-8711-6fcc8c1e9de3 | 1 | private static void closeClientSocket(Socket clientSocket) {
try {
clientSocket.close();
log.info("Close client Socket");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
log.info("Close client Socket: fail IOException");
}
return;
} |
9f96e272-0fa1-4963-8497-9a3746d67ff3 | 9 | public void initializeDataStorage() throws Exception
{
System.out.println("This inicialization will put values in storage and release Targets for each period");
/*
* And also put the weights on each of the component
* data will be put manual but this should be upgraded to put over a php form (internet)
... |
bbd8cf96-c911-43aa-b790-4124cb700c4e | 6 | private ArrayList<File> dirFolderlist(File f) {
ArrayList<File> res = new ArrayList<>();
if (f.exists() && f.isDirectory()) {
File[] chld = f.listFiles();
for (File sf : chld) {
if (!sf.getName().equals(".") && !sf.getName().equals("..") && sf.isDirectory()) {
res.add(sf);
}
}
}
return r... |
b3772216-6645-4bfe-9a75-b8e3673042f5 | 7 | private void commit() {
String serverName = (String)server.getSelectedItem();
if (serverName == null || serverName.equals("")) {
vlog.error("No server name specified!");
if (VncViewer.nViewers == 1)
cc.viewer.exit(1);
ret = false;
endDialog();
}
// set params
opts.se... |
adcc17bf-67cc-4348-ab8a-dcd41d7fb5f5 | 5 | @Override
public boolean activate() {
SceneObject tree = SceneEntities.getNearest(Variables.arcticPine_ID);
if(Variables.choppingArea.contains(Players.getLocal().getLocation())){
if(!Inventory.contains(Variables.articLogs_ID)){
if(Players.getLocal().getAnimation() == -1 || Players.getLocal().getAnimation() ... |
95e1ad5b-78e5-4f1b-b376-7e932e19504c | 5 | private void removeJSR(FlowBlock tryFlow, FlowBlock subRoutine) {
for (Jump jumps = tryFlow.removeJumps(subRoutine); jumps != null; jumps = jumps.next) {
StructuredBlock prev = jumps.prev;
prev.removeJump();
if (prev instanceof EmptyBlock && prev.outer instanceof JsrBlock
&& ((JsrBlock) prev.outer).is... |
72eb765b-1fc2-40be-b634-43c35afe7ac3 | 2 | public int getColumn(mxCellState state, boolean isSource)
{
if (state != null)
{
if (isSource)
{
return mxUtils.getInt(state.getStyle(), "sourceRow", -1);
}
else
{
return mxUtils.getInt(state.getStyle(), "targetRow", -1);
}
}
return -1;
} |
267f6815-ee88-4fe1-ba9a-5205112c3a79 | 7 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Board board = (Board) o;
if (length != board.length) return false;
if (width != board.width) return false;
if (!devices.equals(board.de... |
233f798d-6b7b-4074-8164-04c51d4a5766 | 6 | boolean startGoalEmpty(int col){
if (col == Chip.WHITE) {
for (int i = 1; i<7; i++) {
if(board[0][i].returnColor() == Chip.WHITE)
return false;
}
}
if (col == Chip.BLACK) {
for (int i = 1; i<7; i++) {
if(board[i][0].returnColor() == Chip.BLACK)
return fa... |
bde382ae-6ee5-4e67-8243-870bac26fd6b | 0 | public static void main(String[] args)
{
JFrame frame = new JFrame();
final Rectangle rect = new Rectangle();
final JPanel panel = new JPanel(){
@Override
public void paintComponent(Graphics g)
{
g.clearRect(0, 0, getWidth(), getHeight());... |
e2209076-83c2-4eb2-8a1f-b2e81a87e538 | 4 | @Override
public void readFromData(DataIn dataIn) throws IOException {
int i = dataIn.readInt();
classes = new ArrayList<>();
while(i > 0) {
try {
@SuppressWarnings("unchecked")
Class<? extends APacket> clazz = (Class<? extends APacket>) Class.forName(dataIn.readUTF());
classes.add(clazz);
} c... |
14c4d703-e447-4409-8d16-5b5fedac8284 | 1 | public void setProperty(String property, String value) {
properties.setProperty(property, value);
if(property.equals("language")) {
language.init(value);
setChanged();
notifyObservers(ModelNotification.LANGUAGE_CHANGED);
}
setChanged();
notifyObservers(ModelNotification.SETTINGS_CHANGED);
} |
25d44f79-d68c-4923-b0f0-b934293992b1 | 7 | public String toString() {
if (m_Instances == null) {
return "Naive Bayes (simple): No model built yet.";
}
try {
StringBuffer text = new StringBuffer("Naive Bayes (simple)");
int attIndex;
for (int i = 0; i < m_Instances.numClasses(); i++) {
text.append("\n\nClass " + m_Ins... |
316821f5-69bd-456a-be97-114414ea1792 | 0 | public String getShopName() {
return shopName;
} |
61f13193-6d2a-45dc-ae0c-aa7c7357e247 | 2 | @Override
public synchronized void handleBitfieldAvailability(SharingPeer peer,
BitSet availablePieces) {
// Determine if the peer is interesting for us or not, and notify it.
BitSet interesting = (BitSet)availablePieces.clone();
interesting.andNot(this.completedPieces);
interesting.andNot(this.requestedPie... |
c422c05d-fd64-4657-ad7d-269a020dbd5a | 9 | public static List readDelimitedList(char delim, PushbackReader r, boolean isRecursive) throws Exception{
final int firstline =
(r instanceof LineNumberingPushbackReader) ?
((LineNumberingPushbackReader) r).getLineNumber() : -1;
ArrayList a = new ArrayList();
for(; ;)
{
int ch = r.read();
while(isWhites... |
5580f4f9-ba0c-4a65-ad76-4f794681d33f | 2 | public void render(GameContainer gc, Graphics g) {
int xPos = Level.getScaledX(level.getXPosition(), x);
int width = Level.getScaledX(level.getXPosition(), x + 1) - xPos;
if (!isDead()) {
g.setColor(ColorDirector.getCurrentPrimary(ColorType.PLAYER));
g.fillOval(xPos + X_OFFSET * DEFAULT_WIDTH_RATIO, Y_OFFS... |
a8519b05-a431-48b1-a6e9-548254441109 | 8 | public static int numNeighbours(Element element, World world) {
if (element.xdim() > 4 || element.xdim() != element.ydim()) {
I.complain("This method is intended only for small, regular elements.") ;
}
final int size = element.xdim() - 1 ;
int numNeighbours = 0 ;
final Element near[] = NEAR_AR... |
abd86472-5d40-4dca-aa4d-f0999d4662f8 | 5 | public BroadcastReceiver(NetInterface net) {
this.net = net;
// find a free UDP port for this application, in case several
// applications run on the same machine
port = NetInterface.BROADCAST_PORT;
int i = 0;
boolean portOK = false;
while (!portOK && i < NetInterface.NB_BROADCAST_PORTS) {
try {
/... |
241c9c68-20a3-4b70-b877-bd1ec0b0cfa7 | 1 | public static void resetLevel(){
CharacterManager.health = CharacterManager.defaultHealth;
CharacterManager.invincibleTick = 0;
CharacterManager.invincible = true;
CharacterManager.character = CharacterManager.defineChar();
PlatformManager.defineFloors(level);
LivingEntityManager.defineEnemies(level);
Cha... |
327392c5-5c24-4173-a734-1d583abf8523 | 3 | private void updateResourceDetails(String resourceName) {
GridResource resource = null;
for (GridResource tmpRes : resources) {
if(tmpRes.getName().equals(resourceName)) {
resource = tmpRes;
break;
}
}
if(resource == null) {
return;
}
ResourceCharacteristics charact = resource.getResour... |
076deba6-88ba-4e60-8da4-7c6426dcb5ef | 5 | public Tile[][] generateLBlock()
{
Tile[][] piece = new Tile[2][3];
for (int i = 0; i < piece.length; i++)
for (int j = 0; j < piece[i].length; j++)
{
if (i == 0 || (i == 1 && j == 2... |
42bef8fc-30bb-4df1-8c56-bebe241104e4 | 3 | public Object[] getCellsForGroup(Object[] cells)
{
List<Object> result = new ArrayList<Object>(cells.length);
if (cells.length > 0)
{
Object parent = model.getParent(cells[0]);
result.add(cells[0]);
// Filters selection cells with the same parent
for (int i = 1; i < cells.length; i++)
{
if (... |
2de4529b-14ca-4ad8-aab4-d2fd379843c6 | 9 | double pointToObstacle(Polygon polygon, Point2D centre, Point2D front, boolean first) {
int j;
double minDistance = -1.0;
double dist;
double px, py;
double x1, y1, x2, y2;
double m1, q1, m2, q2;
Line2D.Double beam = new Line2D.Double(centre, front);
for (int i = 0; i < polygon.npoints; i++) {
j = i... |
69862cbd-ee98-4a98-9cc9-515c1189caf0 | 4 | public Image getImage() {
img = arnEnemy[k];
if (nHit == nEXP) {
k = 0;
x = 3000;
y = 3000;
nSpawn++;
if (nSpawn >= 20) {
nSpawn = 0;
x = 100;
y = 100;
nEXP += 5;
}
... |
770c3713-54cf-441a-8916-918ccd1d37c8 | 2 | @Override
public synchronized void reset() throws IOException {
if(mark<0 || mark > data.length)
{
throw new IOException("The position is not valid !");
}
ptr = mark;
} |
cbac162d-2e4d-4e85-b7cb-f72618065b9e | 9 | public int calculateMeleeAttack() {
int attackLevel = c.playerLevel[0];
if (c.prayerActive[2])
attackLevel += c.getLevelForXP(c.playerXP[c.playerAttack]) * 0.05;
else if (c.prayerActive[7])
attackLevel += c.getLevelForXP(c.playerXP[c.playerAttack]) * 0.1;
else if (c.pra... |
d6cac62d-7823-4052-b4dd-a0dcb1f9d856 | 2 | @Override
public boolean a() {
if (Bukkit.getPlayer(p) == null) {
return path != null;
}
Location targetLocation = Bukkit.getPlayer(p).getLocation();
boolean flag = this.entity.getNavigation().c();
this.entity.getNavigation().b(false);
this.path = this.entity.getNavigation().a(targetLoca... |
0c7eb93f-9b92-4ebb-af7e-07fec0a25bbe | 4 | private void addTest2Out(DiscreteDistr d1, String label, FullResult reference)
throws Exception
{
if ( reference == null ) return;
DiscreteDistr d2 = reference.get(label);
if ( d2 == null ) return;
Set freedom = d1.combinedKeys(d2);
if ( freedom.size() == 1 ) return;
... |
b6d9356f-b8c3-469e-bbf6-f30cc0cc6525 | 8 | public void move(SyrianGraph g) throws AgentHasNoMoveException,
AgentIsDoneException {
// evacuate all possible chemicals
if (this.hasChemicals() && this.getLocation() == this.getTarget()) {
System.out.println("Agent " + this.getName()
+ " evacuated chemicals to it's target");
this.setChemicalsEvacua... |
5fd90c36-8a82-4057-8251-8c688f54d1f6 | 0 | public void setInternal(Object internal) {
this.internal = internal;
} |
cb31ce00-12c3-4fac-a677-1990227dbabd | 8 | public Student addStudent() throws ClientException{
if (logger.isDebugEnabled()){
logger.debug("Called adding student");
}
String groupNumber = null;
String fak = null;
for (int i = 0; i < groups.size(); i++) {
if (elemGr.equals(groups.get(i).getFakulty())... |
4540508b-2317-4f5e-916e-43c5cda477e0 | 8 | public int minimumTotal(ArrayList<ArrayList<Integer>> triangle) {
if (triangle == null || triangle.size() < 1)
return 0;
int min = Integer.MAX_VALUE;
int[][] buff = new int[2][triangle.size()];
for (int i = 0; i < triangle.size(); i++) {
ArrayList<Integer> row ... |
14f96c0e-826e-4595-ad5c-e08dd28064f5 | 7 | public int getPosition(Component c) {
if (c == null)
return -1;
if (getDocument() == null)
return -1;
if (getDocument().getLength() <= 0)
return -1;
AbstractDocument.BranchElement section = (AbstractDocument.BranchElement) getDocument().getDefaultRootElement();
AbstractDocument.BranchElement paragrap... |
e80fafc0-b126-4cb1-a902-f99613502bb3 | 8 | public PlanPanel(SimController simController, Courses courses) {
this.courses = courses;
Course course = courses.getCurrentCourse();
Observers.subscribeTimeGUI(simController);
// get data
// timeBlocks = new TimeBlocks(course.getLecture().getTimeBlocks());
// init this Panel
this.setBorder(BorderFactor... |
63930602-5bc3-48ed-97ad-0b4020dec045 | 6 | public void deselect(HashMap<Integer, ArrayList<Integer>> X, HashMap<Integer, ArrayList<Integer>> Y, int r, HashMap<Integer, ArrayList<Integer>> cols) {
ArrayList<Integer> rowY = Y.get(r);
for( int f = rowY.size()-1; f >=0; f--) {
int j = rowY.get(f);
// for( int j : rowY ) {
ArrayList<Integer> rowX = cols.r... |
b32594e1-c25a-4ab4-a092-8a064cfeb86f | 6 | public boolean validate() {
DwDBridgePlugin plugin = DwDBridgePlugin.getPlugin();
String sqlStatement = "SELECT f.`user_id`, u.`username`, u.`user_group_id`, u.`secondary_group_ids`, u.`is_mcConfirmed` FROM `xf_user_field_value` f LEFT JOIN `xf_user` u ON f.`user_id`=u.`user_id` WHERE f.`field_id`='" +... |
cda18b01-536e-4f95-b883-224dfc4040fc | 7 | @Override
public String generateLabel(CategoryDataset dataset, int row, int column) {
if (minLabels == null || maxLabels == null) return "";
String minMax = dataset.getRowKey(row).toString();
String xkey = dataset.getColumnKey(column).toString();
Number yval = dataset.getValue(row, c... |
a6a082e2-3dc3-4c15-b81a-c2d33d4e37c4 | 1 | public void maximize(DockContainer dc) {
if (mMaximizedContainer != null) {
mMaximizedContainer.getHeader().adjustToRestoredState();
}
mMaximizedContainer = dc;
mMaximizedContainer.getHeader().adjustToMaximizedState();
getLayout().forEachDockContainer((target) -> target.setVisible(target == mMaximizedConta... |
4a04e37d-cd0e-41d3-9f46-14ee615cf45a | 0 | public static Set<Integer> getAllRatings() {
return ratingsMap.keySet();
} |
6f3caf13-6b8f-41f7-92e7-6c1a107b5609 | 6 | @EventHandler
public void onPlayerCommandPreprocessEvent(PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
if(!player.hasPermission("roboticstaff.blockedcommands.bypass")) {
// Blocked commands (general)
List<String> blockedCommands = Main.getPlugin().getConfig().getStringList("bloc... |
0ee06a8c-49bf-4115-9315-cbe7ab496324 | 0 | @Override
public void focusGained(FocusEvent e) {
handleUpdate();
} |
aa649392-7763-47b8-af83-666a573cc98c | 8 | public void setEditValue(int n, EditInfo ei) {
if (n == 0 && ei.value > 0)
nom_pow = ei.value;
if (n == 1 && ei.value > 0)
nom_v = ei.value;
if (n == 2 && ei.value > 0)
warmTime = ei.value;
if (n == 3 && ei.value > 0)
coolTime = ei.value;
} |
ab7a6b78-896e-417d-b9f7-2331dc587f26 | 4 | @Override
protected void recalculateAvgs() {
innerSum[0] = innerSum[1] = outerSum[0] = outerSum[1] = innerSize = outerSize = 0;
for (int x = 0; x < image.getWidth(); x++) {
for (int y = 0; y < image.getHeight(); y++) {
if (getValue(x, y) == 3) {
addToOuter(x, y);
} else if (getValue(x, y) == -3) {
... |
c1e998fc-f547-4ac9-87e4-00c70b4ff9d9 | 1 | public String getDefaultName() {
if (elementType instanceof ArrayType)
return elementType.getDefaultName();
return pluralize(elementType.getDefaultName());
} |
e20bcf7b-2779-4beb-9558-e345782aa77e | 4 | private synchronized void updateBoard() {
if (this.board == null)
this.board = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g = this.board.createGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
synchronized (this) {... |
e8e35b07-ae2b-4a02-8e0a-b7b2015eb850 | 8 | @Test
public void testSpeed() throws Exception {
int avgCounter = 10;
for (Class type : this.types) {
System.out.println(type.getSimpleName().toUpperCase() + " TEST:");
for (int length : this.lengths) {
HashMap<String, Double[]> speeds = new HashMap<String, ... |
b684ac29-e0ea-43f1-9cac-0b0887c06f86 | 7 | @Override
public void mouseClicked(MouseEvent e) {
if(game.getCurrentPlayer().getName().equals(game.getHumanPlayer().getName())
&& game.getCurrentPlayer().getMustFinish()){
boolean valid = false;
boolean suggest = false;
ArrayList <BoardCell> targs = new ArrayList <BoardCell>();
targs.addAll(tar... |
cf69aa62-4433-48bc-9f9b-6198b91b2eea | 4 | private void takeFirstTurn() {
Player currentPlayer = this.game.getCurrentPlayer();
if (this.game.getStatus() == StatusType.NEW_GAME
&& this.game.getGameType() == GameType.ONE_PLAYER
&& currentPlayer.getPlayerType() == PlayerType.COMPUTER_PLAYER) {
tr... |
a02146eb-8da1-473e-af7c-4888a8f7c5e7 | 8 | public void start() {
logger.info("Stage:" + server.getStage().info().getTitle() + " Loaded.");
logger.info("Enter \"h\" to show help info.");
while (!CheckGameSuccess.check(server.getStage()) && !quited) {
// check if the player could not win.
if (new CheckDead().check(s... |
4daf8837-3537-47d4-8e9b-79d9f869e26e | 0 | public void setArea(String area) {
Area = area;
} |
ce260530-8fd7-4ff1-a6a6-cd124f2c89fd | 3 | public static int getPrimeNumber(int number) {
Sequence<Integer> primes = new ArrayedPrimesSequence();
int c = 0;
try {
while (true) {
c++;
int prime = primes.next();
if (c == number) {
return prime;
... |
bd035c9c-032b-4c0f-bbb7-d52ac2770ca0 | 4 | public void calculateAcceleration(){
if(conductorBrake)
currentAcceleration = -1.2; // m/sec^2
else if(eBrake)
currentAcceleration = -2.73; // m/sec^2
/* else if(inputBrakeFailure)
currentAcceleration = 0;
else if(currentSpeed==blockSpeedL... |
3f9d880f-03a1-4ef2-a38d-184df1a6d3df | 0 | void down(int velocity) {
} |
a8c66d84-74a0-4090-a03a-5d62ba3d040e | 0 | public List findByErrorType(Object errorType) {
return findByProperty(ERROR_TYPE, errorType);
} |
a303a7cd-1c75-4351-a851-1b75bc59fbb2 | 4 | public boolean collided(Pinball pinball)
{
if(pinball.getX() < this.maxXY.getX() && pinball.getX() > this.minXY.getX() && pinball.getY() < this.maxXY.getY()
&& pinball.getY() > this.minXY.getY())
return true;
else
return false;
} |
330cffb2-d3a7-437f-9fcf-6b7527ad13fa | 7 | static boolean equipEquipment(Equipment equipment, Player player) {
switch (equipment.getLocation()) {
case BODY:
return player.setBody(equipment);
case HEAD:
return player.setHead(equipment);
case FEET:
return player.setFeet(equipment);
case HANDS:
return player.setHands(equipment);
case NECK:
... |
f4764279-079f-4e71-a271-d000d691f331 | 6 | private Configuration buildConfiguration() {
Configuration result;
Metamodel metamodel;
Collection<EntityType<?>> entities;
Collection<EmbeddableType<?>> embeddables;
result = new Configuration();
metamodel = entityManagerFactory.getMetamodel();
entities = metamodel.getEntities();
for (EntityT... |
571a5f6d-ed66-4fba-9b21-340ab5d35623 | 7 | public boolean intersect(IntersectionRecord outRecord, Ray rayIn) {
Vector3 a_minus_b = new Vector3();
a_minus_b.sub(owner.getVertex(index[0]), owner.getVertex(index[1]));
Vector3 a_minus_c = new Vector3();
a_minus_c.sub(owner.getVertex(index[0]), owner.getVertex(index[2]));
Vector3... |
8a8539c5-038d-4e3a-8c5f-76d328bbcc2e | 5 | @Override
public void setStatus(PlayerStatus value) {
if (Status != PlayerStatus.Out || Status != PlayerStatus.Bowled
|| Status != PlayerStatus.Stumped
|| Status != PlayerStatus.RunOut
|| Status != PlayerStatus.Caught) {
PreviousSatus = Status;
Status = value;
}
} |
9e36909b-3d2c-4d02-9777-14e67b5c0aea | 3 | public boolean isWallCollision(int x, int y, ArrayList walls)
{
Wall tempWall;
for (int i = 0; i < walls.size(); i++)
{
tempWall = (Wall) walls.get(i);
if(tempWall.x == x && tempWall.y == y)
{
return true;
}
... |
47ff6d1c-2259-4285-8a16-cc5e427e4bdb | 8 | public void run() {
try {
Selector selector = Selector.open();
ServerSocketChannel server_channel = ServerSocketChannel.open();
server_channel.configureBlocking(false);
server_channel.socket().bind(new InetSocketAddress("localhost", this.port));
server_channel.register(selector, SelectionKey.... |
0cb44fd9-e32f-4ef9-9dc4-7fa06533f8a3 | 3 | public CachedRowSetImpl getRanking(){
try {
Socket socket = new Socket(SERVER_ADDRESS_MAIN, MAIN_PORT);
socket.setSoTimeout(TIMEOUT);
OutputStream outputStream = socket.getOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);
InputStream inputStream =... |
1fd8ffc8-9d55-416b-af55-c60ca2a489b5 | 2 | public void testProperty() {
DateTime test = new DateTime();
assertEquals(test.year(), test.property(DateTimeFieldType.year()));
assertEquals(test.dayOfWeek(), test.property(DateTimeFieldType.dayOfWeek()));
assertEquals(test.secondOfMinute(), test.property(DateTimeFieldType.secondOfMinut... |
ad0181d5-0e23-442c-a73e-9dff65191c43 | 5 | public boolean removeTarget(Random target, Random data)
{
if(_head == null) return false;
Node _cursor = _head;
if(target == null)
{
if(_manyNodes >=1)
{
_head=_head.next;
_manyNodes--;
return true;
}
else
{
return false;
}
}
while(_cursor != null)
{
if(_cursor.... |
a39e8841-27a4-4dea-93fe-f61bdf36a3c8 | 6 | private static void merge(Comparable[] a, Comparable[] tmp, int left, int right, int rightEnd) {
int leftEnd = right - 1;
int k = left;
int num = rightEnd - left + 1;
while (left <= leftEnd && right <= rightEnd)
if (a[left].compareTo(a[right]) <= 0)
tmp[k++] ... |
333f5286-008d-49de-831b-37f0db7627e2 | 4 | private Integer Majority(Hashtable<Integer, Integer> decisions) {
HashMap<Integer, Integer> frequency = new HashMap<Integer, Integer>();
// include process itself in deciding majority
frequency.put(p.getX(), 1);
for (Integer each : decisions.values()) {
int f = 0;
if (frequency.containsKey(each)) {
f ... |
6adce721-be0d-469b-af46-5a15cdab0f27 | 2 | public void setQualification(int qualification) {
this.qualification = (qualification > 0 && qualification < 5) ? qualification:
0;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.