method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9f767db4-1457-4ae9-9f07-6e4cd97ac892 | 4 | public void drawPoint(Graphics2D g2, Pair pr, int id) {
/*if (p.owner==-1) {
g2.setPaint(Color.BLACK);
}
else {
g2.setPaint(Color.WHITE);
}*/
if (id == 0)
g2.setPaint(Color.WHITE);
else if (id == 1)
... |
d0c21193-c6b1-4d0a-9492-6ca18a07af26 | 5 | public void saveState(int difficulty, int time, int hints,
boolean[][] editableArray) throws IOException {
File save = new File("save.txt");
save.createNewFile();
FileWriter writer = new FileWriter(save);
Integer timeInteger = (Integer)time;
writer.write(timeInteger.toString());
writer.write("\n");
Int... |
5aa16691-90e6-49ec-bc0a-a35a1d9bb99b | 5 | public void clickEvent(double mouseX, double mouseY){
double x1 = this.getX1();
double x2 = this.getX2();
double y1 = this.getY1();
double y2 = this.getY2();
if(x1 <= mouseX && x2 >= mouseX && y1 <= mouseY && y2 >= mouseY)
{
double relMouseX = mouseX - x1;
//System.out.println("X: " + ... |
eae351b3-14e7-445d-aaa8-d23c9934b22b | 4 | public void render(final Graphics g, final int x, final int y) {
if (!solid || c == '9')
return;
if (img != null) {
g.drawImage(img, x, y);
} else {
if (Game.getInstance().getCurrentLevel().getLevelType() == Level.LEVEL_MID)
g.drawImage(ImageLoader.tile_glass_black, x, y);
else
g.g().fillRect... |
35abd27f-89cd-4d0e-9f15-1112685011de | 1 | @Override//toString method that prints the whole array
public String toString ()
{
String message = "";
for (int index = 0; index < data.length; index++){
message = message + data[index] + " ";
}
return message;
} |
17d87bb8-1adf-4d10-a72e-bf3f18868d54 | 6 | private static void lineBorderLimitedMean (int radius, float[] cache, float[] pixels, int writeFrom, int writeTo,
int pixel0, int pointInc) {
double sum = 0;
int length = cache.length;
int sumFrom = (writeFrom-radius>0) ? writeFrom-radius : 0;
int sumTo = (writeFrom+radius<le... |
f778da77-b361-4a65-bdb9-4808c3f121d3 | 4 | public String getCurrentDirec() {
int val = droid.getCurDirec();
String retString = "";
switch (val) {
case 0:
retString = "North";
break;
case 1:
retString = "East";
break;
case 2:
... |
29e2f63a-282d-477f-911e-6ca5151849ad | 5 | public Color elementAt(Coords coords) {
Integer col = coords.getCol();
Integer row = Math.abs(coords.getRow());
if (col < 0 || row > 4 || row + col > 8) {
return Color.INVALID;
}
Ball ball = new Ball(Color.WHITE, coords);
if (this.balls.contains(ball)) {
return Colo... |
08a83897-6845-43c1-ac04-666f3d2d3e2d | 4 | public String getStatusDesc() {
if (status.equals("1")) {
return "Em Andamento";
} else if (status.equals("2")) {
return "Aguardando Retorno";
} else if (status.equals("3")) {
return "Finalizada";
} else if (status.equals("4")) {
return "Ca... |
e1f1c768-c153-4c0d-9927-45d0c0f40b43 | 6 | private void putChecker(int player, int column) {
if ((column < -1) || (column > NUM_POINTS)) {
System.err.println("Error, out of range.");
} else {
int p_type = pType(player);
if (column==-1 || column==NUM_POINTS) {
in_home[player]++;
} el... |
de8e29b2-9ab7-4952-bcbf-51fb0c2e21a9 | 8 | void extendLeft( FragList prev, String mergedCell, short base )
{
// find the next space in the merged cell
String token = getToPrevBreakPoint( mergedCell );
if ( !doubledUp(token,mergedCell,prev) && token.length() > 0
&& fragments.size()>0 )
{
Atom first = t... |
5656c8cc-6e67-4c46-bc7d-3155bfc61cce | 3 | public void showHelp(CommandSender sender) {
returnMessage(sender, "&f----- &6MCNSA Ranks Help &f-----");
for(String command: plugin.commands.keySet()) {
boolean hasPermission = true;
if(sender instanceof Player) {
hasPermission = plugin.hasPermission((Player)sender, plugin.commands.get(command).requiredP... |
ca33bc0a-d2cb-4e12-adcb-ac55cc58b818 | 0 | protected void doEditing() {} |
78654a64-ce71-4906-8bd0-20c56f2e7684 | 7 | public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... |
6fd3d000-f195-4c1e-8912-d93f2757f28b | 0 | public synchronized void unRegisterConnection(Socket socket) {
openConnections.remove(socket);
} |
49352e55-0b50-44eb-a802-83f5107c5542 | 2 | public static void placeBeeper(int x, int y)
{
if (WorldBackend.getCurrent() == null) {
Display.openDefaultWorld();
}
if (isDead())
return;
WorldBackend.getCurrent().putBeepers(x, y, 1);
WorldPanel.getCurrent().repaint();
} |
20b76662-04f5-45b8-9b05-5f126cac1883 | 3 | private static String getStateString(MinimizeTreeNode node) {
State[] states = (State[]) node.getUserObject();
int[] ids = new int[states.length];
for (int i = 0; i < ids.length; i++)
ids[i] = states[i].getID();
Arrays.sort(ids);
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < ids.length; i... |
97285fe3-2e24-4e15-8654-2a0619f61062 | 3 | public void reSync()
{
reSynced = false;
//track the number of time this function is called, even if a resync is not
//successful - this will track the number of sync errors
reSyncCount++;
try{
while (byteIn.available() > 0) {
byteIn.read(inBuffer, 0, 1);
if (inBuf... |
1d51b6be-197b-4e5c-b5dd-6da54bb93c88 | 4 | public int predict(_Doc doc) {
_SparseFeature[] fv = doc.getSparse();
double maxScore = Utils.dotProduct(m_pWeight, fv, 0);
if (m_classNo==2) {
return maxScore>0?1:0;
} else {//we will have k classes for multi-class classification
double score;
int pred = 0;
for(int i = 1; i < m_classNo; i++) {... |
3287a618-d1f4-4660-9f13-4d7205d24d0d | 5 | public HashSet<Tile> getTileRadius(Tile center, int radius)
{
HashSet<Tile> innerTiles = new HashSet<Tile>(); //"Visited" tiles in range.
HashSet<Tile> outerTiles = new HashSet<Tile>(); //"Found" tiles on the edge of our current range.
outerTiles.add(center);
while (radius > 0) {
HashSet<Tile> newOuterTile... |
18ca4fc5-890e-448e-9a0e-db0239688009 | 8 | @Override
public void restore() throws PersistenceException
{
isRestoring=true;
if(myobj instanceof Intermud)
{
try
{
final CMFile F=new CMFile("resources/ppeer."+myID,null);
if(!F.exists())
return;
final ObjectInputStream in=new ObjectInputStream(new ByteArrayInputStream(F.raw()));
... |
39c97715-1aa6-4ae1-942c-df24c56d32a9 | 4 | private Image drawCell(int index)
{
IMazeStructure mazeStructure = DataModel.getInstance().getMazeStructure();
BufferedImage result = new BufferedImage(CELL_WIDTH,
CELL_HEIGHT,
BufferedImage.TYPE_INT_A... |
2ac08356-9225-4d05-adce-953f13527e00 | 5 | public static void mapinit() throws SlickException{
if(mapControl==0)
land = new Image("resources/images/ToxicWasteland.png");
if(mapControl==1)
land = new Image("resources/images/paradise.png");
if(mapControl==2)
land = new Image("resources/images/LavaPit.png");
if(mapControl==3)
land = new Image("resour... |
b99a2853-2d2a-42a7-9810-463c85d0cbb7 | 4 | public static void main(String[] args) throws IOException {
System.out.println("The Processing server handles source connection on port 7007 and sink connections on port 7008");
//source socket
final ServerSocket source_Socket = new ServerSocket(7007);
//sink socket
final ServerS... |
7911c836-2b84-4364-85be-5d1cb4450bac | 4 | @Override
public void selectAll() {
TreeRow[] oldSelection = mSelectedRows.toArray(new TreeRow[mSelectedRows.size()]);
boolean added = false;
mAnchorRow = null;
for (TreeRow row : new TreeRowViewIterator(this, mRoot.getChildren())) {
if (mAnchorRow == null) {
mAnchorRow = row;
}
if (mSelectedRows.... |
3c569cc0-e4ee-4149-981f-898fae8407db | 8 | void hookCustomListener (final String eventName) {
if (eventName == "ExtendedModifyListener") {
styledText.addExtendedModifyListener (new ExtendedModifyListener() {
public void modifyText(ExtendedModifyEvent event) {
log (eventName, event);
}
});
}
if (eventName == "BidiSegmentListener") {
s... |
2257eeaf-183d-4644-a420-99c74c10c6e9 | 7 | void showstudent() {
try {
expr = xpath.compile("//student/@regno");
result = expr.evaluate(doc, XPathConstants.NODESET);
nodes = (NodeList) result;
String tr;
boolean fr=false;
for(int i=0;i<nodes.getLength();i++) {
tr=nodes.item(i).getNod... |
c839af37-cf90-499d-81e3-4799783ba389 | 6 | private void fireMouseEvent(MouseEvent e) {
TextMouseEvent textMouseEvent = null;
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == TextMouseListener.class) {
if (textMouseEvent == null)
... |
bbad1ed4-f6d4-445f-958c-febcbf35c5a5 | 8 | @Override
public void run() {
try {
try {
output = new ObjectOutputStream(connection.getSocket().getOutputStream());
} catch (IOException ioe) {
connection.sendMessage(new SocketDiscon... |
800f7f9f-939c-40bc-a3f5-1ef36d451a9c | 5 | private void idCmbxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_idCmbxActionPerformed
String id = "";
if (idCmbx.getSelectedItem() != null && idCmbx.getSelectedIndex() != 0) {
id = idCmbx.getSelectedItem().toString();
try {
Student student = ... |
f1d14400-d4ef-40b2-b23d-6bcc0ebb6538 | 4 | public void unlock(){
if (isDoor[0]){
rooms[currentY - 1][currentX].unlock();
isLocked[0] = false;
}
if (isDoor[1]){
rooms[currentY][currentX + 1].unlock();
isLocked[1] = false;
}
if (isDoor[2]){
rooms[currentY + 1][currentX].unlock();
isLocked[2] = false;
}
if (isDoor[3]){
rooms[curr... |
4e5ba769-0330-4d70-8200-ae3d5baa0554 | 9 | public void moveMonster(){
//xPos,yPos is the position the monster is going to move to
int gridWidth, gridHeight, xPos, yPos;
int[] direction = new int[2];
Monster mon[][] = logicHandler.getMonsters();
gridHeight = canvas.getGridHeight();
gridWidth = canvas.getGridWidth();
/* loops through all the monste... |
fcf6c6d1-a1c6-4e9a-ba47-62858009c301 | 0 | @Override
public ArrayList<String> getQuestAnswer() {
// TODO Auto-generated method stub
return answerList;
} |
26c385c8-fef5-4852-8f9e-7993e5cadda7 | 8 | @Override
public void update() {
if (delay > 0) delay--;
if (play.isPressedLeft() && delay == 0) {
delay = 20;
load();
}
if (about.isPressedLeft() && delay == 0) {
delay = 20;
screen.setMenu(screen.getAboutMenu());
}
if (custom.isPressedLeft() && delay == 0) {
delay = 20;
screen.setMenu((... |
db5d82de-68a3-4827-a14c-c981a8f78326 | 0 | public List findBySampleOutput(Object sampleOutput) {
return findByProperty(SAMPLE_OUTPUT, sampleOutput);
} |
6a45b229-7ad5-4426-b045-b2605c038615 | 6 | public void collision(PhysicsCollisionEvent event) {
if (event != null) {
Spatial a = event.getNodeA();
Spatial b = event.getNodeB();
if (b != null && a != null) {
final String nameA = a.getName();
final String nameB = b.getName();
... |
782ce06a-e801-4048-afe8-7f0fff032708 | 0 | @Override
public void detach(Observer observer) {
observerVector.remove(observer);
} |
282e5ee1-3ca5-4266-8340-50c1ce528e25 | 3 | private void processReplicaDelivery(Sim_event ev)
{
if (ev == null) {
return;
}
Object[] data = (Object[]) ev.get_data();
if (data == null) {
return;
}
String filename = (String) data[0]; // get file name
Integer rcID = (Integer) ... |
6e3eae7d-24b8-4a23-95d1-8d32370f2a51 | 4 | public void multiply(Polynomials p){
Polynomials p1 = new Polynomials("");
Polynomials p2 = new Polynomials("");
ListIterator lIt1 = polynomial.listIterator();
if(lIt1.hasNext()){
Term t1 = new Term((Term)lIt1.next());
ListIterator lIt2 = p.polynomial.listIterator... |
bf9ae02c-e16d-43f7-bca6-f19c04da6f7e | 7 | protected void decode(final byte[] data,
final int offset,
final int len)
throws StreamCorruptedException
{
int i;
short val;
int outputSize = 0;
/* read packet bytes into bitstream */
bits.read_from(data, offset, len);
for (int frame=0; fram... |
282c1b2c-1342-4101-91d0-a50cbba9c111 | 1 | public void InputAll(float delta)
{
Input(delta);
for(GameObject child : m_children)
child.InputAll(delta);
} |
dd46dcec-159a-4240-adc7-693bb5eb5ab4 | 0 | private void jPasswordFieldMdpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPasswordFieldMdpActionPerformed
//Récupération de la méthode contrôleur 'valider'
this.ctrl.valider();
}//GEN-LAST:event_jPasswordFieldMdpActionPerformed |
61468b68-3e62-46ea-b86c-1ea91f137364 | 7 | public void timeoutTimer(SpotTimer timeout) throws IOException
{
//switch states
switch(this.currentState.getIdName())
{
case READY_ST_NUM://ready status
break;
case WAIT_ST_NUM://wait response
//control to be sure that the PID of the Timer is the ID of the FSM
if(timeout.getPID().compareTo(th... |
38e3d581-3cde-4000-b40b-e88c41ac5a3d | 5 | public void render(GameContainer gc, Graphics g) throws SlickException {
if(frame == Frames.MAIN){
mainRender(gc, g);
}
if(frame == Frames.NEWGAME){
newGameRender(gc, g);
}
if(frame == Frames.CREDITS){
creditsRender(gc, g);
}
if(frame == Frames.OPTIONS){
optionsRender(gc, g);
}
if(frame ... |
4383e199-9a85-4eac-87df-370999f97b36 | 3 | @Override
public void Play(PlayerResponse response) {
// Send trump to players
Map<Position,Integer> playersMeldServer = getPlayersMeld(Position.South);
mP.setTeam1Score(playersMeldServer.get(Position.North) + playersMeldServer.get(Position.South));
mP.setTeam2Score(playersMeldServer.get(Position.East) + playe... |
997aecf0-28f2-448d-ba64-d18c6059a80b | 7 | @Override
public AbilityMapper.AbilityMapping modifyAllQualifyEntry(MOB mob, String eachOrAll, Ability me, int showFlag) throws IOException
{
if((showFlag == -1) && (CMProps.getIntVar(CMProps.Int.EDITORTYPE)>0))
showFlag=-999;
final Map<String,Map<String,AbilityMapper.AbilityMapping>> map=CMLib.ableMapper().ge... |
5aa2c999-cb61-49ce-9ef0-316163bdd1c4 | 2 | public String toStringWithoutSupport() {
String itemSetContents = "";
int num = this.itemSet.size();
for (int i = 0; i < this.itemSet.size(); i++) {
itemSetContents = itemSetContents + this.itemSet.get(i).toString();
if (i < num - 1) {
itemSetContents = itemSetContents + " AND ";
}
}
return itemS... |
4c81568e-b9dc-41fc-bda0-1c62f4cf34aa | 3 | public static void main(String[] args)
{
int average = 0;
average = average + 2;
for (int i=12; i>1; i--)
{
if (i%2 == 0)
{
System.out.println(average);
average = (average + i);
}
}
System.out.println(average);
System.out.println(average);
average=average*10+1;
int inv... |
ef0ff126-336a-408d-80ea-285562256ce3 | 0 | public TrapTransitionTool(AutomatonPane view, AutomatonDrawer drawer,
AddTrapStateController controller) {
super(view, drawer);
myController = controller;
} |
4a160e5e-20ff-436d-8e85-76f45e3453e7 | 7 | private void initListeners(){
/*
* Just moves towards next step of question modification
*/
btnNextPart.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
cardsQPanel.show(pnlQuestionEdit, STEP_2);
}
});
btnNewQBack.addActionListener(new ... |
54d68c97-8b18-4021-9425-3552de213aa9 | 8 | private void createBrickImages(int size)
{
Graphics g;
try
{
standardBricks[0] = ImageIO.read(new File("src" + separator + "images" + separator + "brick1.jpg"));
}
catch (IOException e)
{
e.printStackTrace();
System.... |
0ef61f49-39ad-4c7a-ad8f-412c7ceac641 | 3 | @Override
public void run() {
try (ServerSocket server = new ServerSocket(6666);) {
while (true) {
try {
Socket socket = server.accept();
OutgoingThread outThread = new OutgoingThread(socket.getOutputStream());
new Thread(outThread).start();
new Thread(new IncomingThread(socket.getInputStr... |
382cc22e-f00b-45da-ad2e-c075212b080b | 6 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int nCase = 1;
while ((line = in.readLine()) != null && line.length() != 0) {
size = Integer.parseInt(line.trim())... |
e5db8660-4706-4a2d-9f25-ecead3ebb207 | 9 | public void initialize() throws SlickException {
arrow = new Image("res/arrow.png");
for(int i = 1; i < 10; i++) {
{
rogueMoveImages[i-1] = new Image("res/roguewalkframe" + i + ".png");
rogueMoveImages[i-1] = rogueMoveImages[i-1].getScaledCopy((float) .5);
rogueMoveImagesFlipped[i-1] = rogueMoveI... |
82dcc893-b3b8-4e3f-8239-bba60a4616a1 | 6 | public void setValue(int x, int y, int z, int value)
{
if (x >= getWidth() || y >= getHeight() || z >= getDepth() || x < 0 || y < 0 || z < 0)
{
return;
}
rawData[x][y][z] = value;
/*
Stack<Integer> stack = rawData[x][y][z];
if (stack.peek() != -3 || value == -4)
stack.push(value);*/
} |
296f67c8-0044-49ac-b0cd-a0672f1af8c2 | 0 | public ServerSocket getSocketListen() {
return socketListen;
} |
086cfa29-8268-42fd-b0a3-f5375138f851 | 1 | public void lastUpdateDetail() {
loggerMainClass.entry();
long BLANK_LINES = DetailObject.getTOTAL_BLANK_LINES();
long CODE_LINES = DetailObject.getTOTAL_LINES_OF_CODE();
long COMMENT_LINES = DetailObject.getTOTAL_COMMENT_LINES();
long NUMBER_OF_FILES = DetailObject.getTOTAL_NUMBER_OF_FILES();
long TOTAL_LI... |
680011ab-4896-4d72-adf9-8b24aaafa1a7 | 2 | @EventHandler(priority=EventPriority.NORMAL)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
{
String[] split = event.getMessage().split("\\s+");
String command = split[0].substring(1);
if ((command.equalsIgnoreCase("kill"))) {
event.getPlayer().sendMessage("Unknown command. Type ... |
ec2f490a-a914-4aec-8ac4-2ee1cf42caf0 | 0 | private void refreshForms() {
String name = settings.getProperty("name");
String port = settings.getProperty("port");
Boolean minimizeToTray = Boolean.parseBoolean(settings.getProperty("minimizeToTray"));
String language = settings.getProperty("language");
System.out.println("language: " + language);
lan... |
c72fff54-3112-4ebf-879e-6352ac3d37c2 | 0 | @Override
public void windowDeactivated(WindowEvent arg0)
{
} |
21503d4a-625f-4e9e-8eed-7fdefb5f67ba | 5 | public void run(ImageProcessor ip) {
int w = ip.getWidth();
int h = ip.getHeight();
for (int x = 1; x < w - 2; x++) {
for (int y = 1; y < h - 2; y++) {
int[] rgb = new int[3];
ip.getPixel(x, y, rgb);
if (rgb[0] < threshold && rgb[1] < threshold && rgb[2] < threshold) {
ip.set(x, y, Color.BLA... |
d575ac5b-a437-44be-a5df-f5cb78fc7724 | 6 | public void save()
{
try
{
if (file.getParentFile() != null)
{
file.getParentFile().mkdirs();
}
if (!file.exists() && !file.createNewFile())
{
return;
}
if (file.canWrite())
... |
1db2c53b-666f-41c1-88ed-770aba8426ae | 1 | public static Balance create(){
if(balanceClass == null)
balanceClass = new Balance();
return balanceClass;
} |
4e401e2a-074f-4834-9ef3-f3f58aae45ab | 6 | public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (taskId >= 0) {
return true;
}
// Begin hitting the se... |
e97ca5e3-28eb-45a0-b79e-da74c22d1feb | 8 | protected void service(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String uri = getURI(request);
request.setCharacterEncoding("UTF-8");
// Room 관련
if ("/comm/getAllRooms".equals(uri)) {
getAllRooms(request, respons... |
ed580192-55a8-4ae4-b8f3-0c494246462f | 4 | private static void findCardIntersections() {
for (Pair p1 : values) {
Card[] c1 = p1.cards;
int i1 = p1.ordinal;
for (Card c2 : Card.values()) {
int i2 = c2.ordinal;
intersectsCard[i1][i2] = false;
if(c1[0] == c2) intersectsCard[i1][i2] = true;
if(c1[1] == c2) intersectsCard[i1][i2] = true;
... |
32e1b5bf-4ec7-465b-be9b-8c0326900bab | 6 | private void checkGuess() {
//Runs through the turnRecord array and checks to see if each one
//has compatibility with the last guess.
//Returns true if each one does and false if there is a conflict.
goodRecords = 0;
i = 0;
whileloop:
while(true) {
if (turnRecord[i].hasInput()==false) {
if (fi... |
f6757a88-be99-4e72-a5e5-9dc4492e5d64 | 5 | public static void deikstr_sort(Comparable[] a, int lo, int hi) {
if (hi <= lo) return;
int lt = lo, gt = hi;
Comparable v = a[lo];
int i = lo;
while (i <= gt) {
int cmp = a[i].compareTo(v);
if (cmp < 0) {
exch(a, lt++, i++);
... |
8d66aabd-a2c6-4e9f-9b3d-c4b61dfb2e0c | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
c1d4ef90-9530-49ee-8a94-92b445b16f3e | 0 | public void setRate(int rate) {
this.rate = rate;
} |
a28e7501-77d1-463c-9b0f-518e8db1b4d0 | 7 | @Override
public void Input(float delta)
{
Vector2f centerPosition = new Vector2f(Window.GetWidth()/2, Window.GetHeight()/2);
if(Input.GetKey(m_unlockMouseKey))
{
Input.SetCursor(true);
m_mouseLocked = false;
}
if(Input.GetMouseDown(0))
{
Input.SetMousePosition(centerPosition);
Input.SetCurso... |
3af3f0f8-ca9e-4450-9709-8cf8eefcdbf1 | 2 | public GuessingScreen(final CLayout layout, final JPanel panelContainer) {
addMouseListener(this);
this.setLayout(null);
this.layout = layout;
this.cl = layout.cl;
this.panelContainer = panelContainer;
// Path to the background image
background = Toolkit.getDefau... |
4c73bf6b-2d8a-47d8-a850-db03d6fbd374 | 4 | public Boolean isOnceJob() {
if(daily || weekly || monthly || atStart) {
return false;
} else {
return true;
}
} |
57fc08e7-3e3d-47cc-b11d-884ff82e5637 | 4 | public void removeVersion( int version )
{
Node n = start;
while ( n != end )
{
Arc a = n.pickOutgoingArc( version );
// get next n before a.to becomes null
n = a.to;
if ( a.versions.cardinality()==1 )
{
a.from.removeOutgoing( a );
a.to.removeIncoming( a );
// is it a child arc?
... |
87511b80-011c-4eae-8e07-eab2b3a7ce51 | 9 | public Hash[] readHash(long hash) throws IOException {
processQueue();
Hash RAMHash = RAMMap.get(hash);
if (RAMHash != null) {
Hash[] single = new Hash[1];
single[0] = RAMHash;
return single;
}
int fileId = FAT.get(hash);
if (fileId == -1) {
return null;
}
fileSync.lock();
try {
File f ... |
89baff16-318e-460f-a868-72ad13c6b71a | 4 | @Override
public void startGame(String playername, Strategy strategy, int startinground) {
try {
if (inGame) {
playermanager.sendErrorPacket(playername, "Game already running!", ErrorReason.NOT_ENOUGH_PLAYERS);
LOG.warn(String.format("%s tried to start an already ... |
099b9af3-8a95-47b1-88d4-ddb9124fcc61 | 0 | public int getId() {
return this.id;
} |
458b786f-1445-4112-86a4-2c3315c67ddf | 1 | public final void hideLayer(GameLayer layer) {
if (!gameLayers.containsValue(layer)) {
logger.error(new NullPointerException(),
"Tried to hide a game layer that isn't registered to the GameScreen :: ", this);
} else {
layer.hide();
}
} |
cd417778-a2a6-4f92-b637-914d633934b6 | 6 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
int nCase = 1;
while ((line = in.readLine()) != null) {
String first = line;
String second = in.readLine();
... |
874d01a7-368e-4aa2-bd0e-f0ac62a76508 | 5 | private void updateBN(Matrice iDansB)
{
int colB = 0;
int colN = 0;
boolean estDansB = false;
for(int j = 0; j<iDansB.getNbLines(); j++)
{
copyColumn((int)iDansB.getValueAt(j, 0), colB, this.Abarre, this.B);
colB++;
}
... |
0d1d18cd-ebce-4564-b683-42af9aaa00f9 | 4 | @Override
public List<IApplicationPortForwarding> startPortForwarding()
throws OpenShiftSSHOperationException {
if (!hasSSHSession()) {
throw new OpenShiftSSHOperationException(
"SSH session for application \"{0}\" is closed or null. Cannot start port forwarding",
getName());
}
for (IApplicationP... |
550ac3da-def6-4deb-b49b-06dfc8433d45 | 1 | @Override
public void handleStateChangeNotification(StateChangeNotification scn) {
System.out.println(scn.getType());
if (scn.getType() == StateChangeNotification.Type.BEFORE_START) {
stage.hide();
}
} |
58c28b91-bea5-443b-86a9-9711782befeb | 9 | @Override
public void run() {
TableManager tableManager = new TableManager("tables.dat");
TableBoundary tableBoundary = new TableBoundary(tableManager);
StaffManager staffManager = new StaffManager("staffs.dat");
StaffBoundary staffBoundary = new StaffBoundary(staffManager);
MenuManager menuManager = new ... |
b086c578-472f-401d-8c56-c83f87bd2e8d | 2 | public void message(String msg, LoggingLevel severity) {
if ((severity.getCode() & logMask) != 0) { //True only if all logMask bits are set in severity
writeMessage(msg);
}
if (next != null) {
next.message(msg, severity);
}
} |
f1ec7250-74d6-4ba2-9632-775b332f80d1 | 4 | public void testBinaryCycAccess9() {
System.out.println("\n**** testBinaryCycAccess 9 ****");
CycAccess cycAccess = null;
try {
try {
if (connectionMode == LOCAL_CYC_CONNECTION) {
cycAccess = new CycAccess(testHostName, testBasePort);
} else if (connectionMode == SOAP_CYC_CO... |
61451d53-63b1-408f-93a8-ba0972973064 | 0 | public String getCountry() {
return Address.getCountry();
} |
f81036d0-f550-40a6-a407-b52f0a39bc9c | 9 | private static void solve(int[] moves, int k) {
if (k==9) {
if (isTwelve(clocks)) {
int val = 0;
for (int i=0; i<9; i++)
val += moves[i];
if (bestMovesVal == 0 || val < bestMovesVal) {
bestMovesVal = val;
for (int i=0; i<9; i++)
bestMoves[i] = moves[i];
}
}
return;
}
... |
027ea8ff-0e89-4c2f-b328-979a87a52b51 | 2 | public Entity init(){
setVelocity(new Vector2f(-0.6f,0f));
try {
AddComponent( new ImageRenderComponent("BoardRender", new Image("assets/board.png")) );
} catch (SlickException e) {
// TODO Auto-generated catch block
e.printStackTrace();
... |
01bee026-693a-4764-b23d-3cb8566cdb39 | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
} |
2f7d28ac-f7bb-4b8d-aaa4-a7cab56e9e2c | 9 | public void layoutContainer(Container target) {
//Let's make a local copy of components to avoid concurrent modification
//which could happen if someone adds something to the layout outside
//of the EDT. This is faster than do any synchronization or brute force
//exception catching
... |
12bd539d-1049-4da6-8321-0f195519166c | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof College)) {
return false;
}
College other = (College) object;
if ((this.id == null && other.id != null) || (thi... |
32183937-b72a-4883-871f-af8f25d39277 | 5 | private void searchAndReplaceFor(File directory)
{
File[] directories = directory.listFiles(dirFilter);
for (int i = 0; i < directories.length; i++)
{
searchAndReplaceFor(directories[i]);
}
File[] files = directory.listFiles(fileFilter);
System.out.println("*");
System.out.println("* MODIFYING FILES... |
a8c81ec4-61f8-4e8c-a932-69208270d1d7 | 5 | public void saveToDB() {
if (!changed) {
return;
}
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE storages SET slots = ?, meso = ? WHERE storageid = ?");
ps.setInt(1, slots);
ps.setInt(2, meso);
ps.setInt(3, id);
ps.e... |
6fe0b960-aa90-4d9b-98e5-9f14b20d377e | 9 | @Override
public TwoPhaseIterator twoPhaseIterator() {
final float matchCost = matchCost(reqApproximation, reqTwoPhaseIterator, exclApproximation, exclTwoPhaseIterator);
if (reqTwoPhaseIterator == null
|| (exclTwoPhaseIterator != null && reqTwoPhaseIterator.matchCost() <= exclTwoPhaseIterator.matchCo... |
2b141002-f30d-4ef0-ab9a-382ea26bc18f | 5 | @SuppressWarnings("unchecked")
@Override
public boolean equals(Object o) {
if (!(o instanceof Tree)) {
return false;
}
if (o == this) {
return true;
}
Tree<T> tr = (Tree<T>) o;
if (size() != tr.size()) {
return false;
}
Iterator<Node<T>> it1 = iterator();
Iterator<Node<T>> it2 = tr.iterator... |
87f973dd-989b-42df-986f-d0c2390bb107 | 6 | public Vec3D track(float s, float v) {
// s = sight, v = view/2
Vec3D vec = new Vec3D();
float count = 0.0f;
neighbours = p5.manager.pheroKDTree.getNearestNeighbors(this, 150, true);
if (neighbours != null) {
for (int i = 0; i < neighbours.length; i++) {
Phero cur = (Phero) neighbours[i].point(... |
88cf700f-97a3-4340-9fb5-b22f45be5c24 | 8 | public void initialize() throws SyslogRuntimeException {
super.initialize();
final SSLTCPNetSyslogConfigIF sslTcpNetSyslogConfig = (SSLTCPNetSyslogConfigIF) this.tcpNetSyslogConfig;
final String keyStore = sslTcpNetSyslogConfig.getKeyStore();
if (keyStore != null && !"".equals(keyStore.trim())) {
Syste... |
e156e9d8-0bdc-4725-b06b-1a5f2e0d5e5c | 1 | public ResultSet getList(String whereString){
StringBuffer sql=new StringBuffer("");
sql.append("SELECT AnswerID,QuestionID,AnswerContentText");
sql.append(" FROM `FIBAnswer`");
if (whereString.trim()!="") {
sql.append(" where "+whereString);
}
SQLHel... |
d8c39b0a-8929-4839-b326-0efed4129c15 | 3 | private String getBooleanValue(final Field field, final Object object) {
String resValue = null;
Object value = getRawValue(field, object);
if (value != null && value instanceof Boolean) {
resValue = ((Boolean) value).booleanValue() ? "1" : "0";
}
return resValue;
} |
30edcb54-c7ff-4efb-a544-14491051f622 | 5 | private String appendNumberOfComponents() {
int i = 0;
StringBuilder field = new StringBuilder();
for (Integer key : cardInFieldGame.keySet()) {
if (!listeofcontains.contains(key)) {
int fehlt = LEGHTFORSTRING - 1;
int me = fehlt / 2;
fehlt = fehlt - me;
field.append("|");
for (int loop = 0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.