method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
e9bdaa4e-55eb-4190-9f85-061e99761203 | 1 | public boolean isLiving(Player player) {
if (livingplayers.contains(player))
return true;
return false;
} |
244c3bbf-971f-484b-9714-2486ce909f06 | 8 | public static void getProgramStats() throws IOException{
// INIT
List <Word> anew = StatsBank.buildANEW();
List<String> dictionaryAnew = new ArrayList<String>();
PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter("files/result-programStats.csv",true)));
List<String> items ... |
3f0b922f-5dac-47ac-84e7-40096bbb04bf | 0 | public long getBulletDelay(){
return this.bulletDelay;
} |
18e10391-8cfb-4744-8377-d3957e4e9158 | 2 | @Override
public void move(Excel start, Excel end) {
// TODO Auto-generated method stub
if (start.getX() == begin.getX() && start.getY() == begin.getY())
{
begin = end;
setColoredExes();
}
} |
6a294dff-38ae-4a7d-9221-e372cbe08cbe | 1 | public void writeRevTable() {
TranslationTable revtable = new TranslationTable();
basePackage.writeTable(revtable, true);
try {
OutputStream out = new FileOutputStream(outRevTableFile);
revtable.store(out);
out.close();
} catch (java.io.IOException ex) {
GlobalOptions.err.println("Can't write rename... |
25015c9b-92d8-4f17-bfa1-fc0f0389ce64 | 0 | @Override
public String getCur() {
return convertToString(cur);
} |
9f644d93-9b0f-4ab0-9b22-e4eab299cd79 | 6 | public void moveInDirection(double d, HashSet<Line2D> walls) {
d = d -30 + GameConfig.random.nextInt(60);
if(location.getY() - Math.sin(d*Math.PI/180) < 0 || location.getY() - Math.sin(d*Math.PI/180) > 100 || location.getX() + Math.cos(d*Math.PI/180) > 100 || location.getX() + Math.cos(d*Math.PI/180) < 0)
return... |
b51b34c5-4152-4fe9-a5b9-8559ffa2b2fa | 8 | @Override
public String toString() {
String type = "UNKNOWN";
switch (bufferType) {
case POINT_BUFFER: type = "POINT_BUFFER"; break;
case LINE_BUFFER: type = "LINE_BUFFER"; break;
case TRIANGLE_BUFFER: type = "TRIANGLE_BUFFER"... |
ad06182a-3c2e-4763-95d3-18c29e28f359 | 0 | public void removeInstance(Instance instance) {
this.instances.remove(instance);
} |
e4bd17d6-e10f-46be-ba6b-5eac8e0669d2 | 2 | public void run() {
try {
reader=new BufferedReader(new InputStreamReader(socket.getInputStream()));
write=new PrintWriter(socket.getOutputStream(),true);
String msg;
while((msg=reader.readLine())!=null) {
System.out.println(msg);
socketMan.writeAll(msg); //ͻϢд
}
}catch(Exception e){... |
013c7ffc-204f-4436-8eaa-777ffe1ec954 | 3 | public void busAdded (Bus bus)
throws IOException
{
if (model == null)
return;
synchronized (busses) {
Bus newBusses [] = new Bus [busses.length + 1];
HubNode newHubs [] = new HubNode [newBusses.length];
// old busses first
System.arraycopy (busses, 0, newBusses, 0, busses.length);
System.ar... |
ea0f8fa4-1789-47cf-bee4-d6132de5f3c0 | 0 | public void setItemName(String itemName) {
this.itemName = itemName;
} |
dbdc0d20-a021-455e-b61a-d747880d4daa | 7 | private void optimizeMondayTimeTableForIAndIIGymnasium() {
List<LinkedHashMap> daysTimeTablesForItr = addDaysTimeTablesForIteration();
List<String> teachersForIteration = createTeachersListForIteration();
LinkedHashMap<String, String> teachersTimeTable;
HashMap<String, Teacher> teacher... |
6ab6b6a0-cdb8-42c1-ba70-fa6c159bfe28 | 5 | @Override
public ResultMessage check(UserPO po) {
// TODO Auto-generated method stub
boolean exist=false;
for(UserPO realPO:users){
if(po.getUserName().equals(realPO.getUserName())&&po.getPassword().equals(realPO.getPassword())
&&po.getUserSort()==realPO.getUserSort()){
exist=true;
break;
}
... |
51219221-44d0-4183-88bb-8fee592c4e01 | 7 | public void renderSprite(Graphics g, Sprite s)
{
// ONLY RENDER THE VISIBLE ONES
if (!s.getState().equals(pathXTileState.INVISIBLE_STATE.toString()) &&
!s.getSpriteType().getSpriteTypeID().contains(LEVEL_BUTTON_TYPE) &&
!s.getSpriteType().getSpriteTypeID().contains(MAP_TYPE) ... |
17da11da-0596-4fb9-ab6e-d8e43ecd396d | 5 | public void mouseMoved(MouseEvent ev) {
//récupération de la position de la souris
final Point p = ev.getPoint();
if (m.zoneAccueil.contains(p)) {
m.afficheEffet(1);
} else if (m.zoneAllSeries.contains(p)) {
m.afficheEffet(2);
} else if (m.zoneMySeries.co... |
8c0261d6-5923-4f7b-95ae-bfe04279c142 | 9 | @Override
public void update(GameContainer gc, StateBasedGame game, int delta) throws SlickException {
//delta calculates frames per second (stay at same speed regardless of framerate)
super.update(gc, game, delta);
timer++;
levelTimer++;
int randomInt = r.nextInt(550);
int randomAlien = r.nextInt(550);
... |
60f06552-7421-43e6-8fd0-22a8e0d96071 | 1 | @Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} |
a658fc10-f1c8-4be8-918c-b7da60314a0c | 3 | public boolean Autorizar(){
JPasswordField pass = new JPasswordField(10);
pass.setEchoChar('*');
JPanel p = new JPanel();
p.add(pass);
try {
con.ConsultarSQL("select id,senha from tb_usuarios where funcao = 1",true);
con.rs.first();
JOptionPane... |
1e1dcf21-7eb2-4656-a5f2-1024049eba4e | 8 | private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
successLabel.setVisible(false);
if (groupNameBox.getText() == null
|| groupNameBox.getText().equals("")) {
//we don't want to do anything, no name set
... |
7197bc3b-a96e-43cc-8f25-1f87924c2ec6 | 2 | protected HttpURLConnection createConnection(URL url, String method,
Map<String, String> options) throws Exception {
HttpURLConnection connection = null;
if(testFlag)
connection = (HttpURLConnection)url.openConnection();
else
connection = (HttpsURLConnection)url.openConnection();
connection.set... |
a8533cd1-0bcb-4070-aa00-f111ffae4b8b | 4 | private void init(){
//Fill dungeon with walls.
for(int y = 0; y < height; y++){
for(int x = 0; x < width; x++){
setTile(x, y, 2);
}
}
//Place start and end rooms.
for(int y = 0; y < 9; y++){
int ya = y + (32 / 2) - (9 / 2);
for(int x = 0; x < 9; x++){
int xa = x + (64 - 9);
setTile... |
6938be4b-f805-4808-a42d-be9f8db42a87 | 3 | public void addProduction(Production production) {
super.addProduction(production);
// If it's both, we shouldn't change at all.
if (ProductionChecker.isRightLinear(production)
&& ProductionChecker.isLeftLinear(production))
return;
// If we get to this point it must be either left or right
// linear, a... |
316a6afe-ece6-4196-9c14-7cd44ca4ab95 | 3 | public void generate() {
System.out.println("Generating world. Please be patient, as older computers will take longer to create the chunks.");
chunks = new Chunk[WORLD_SIZE][WORLD_SIZE];
for(int x = 0; x < WORLD_SIZE; x++)
{
for(int y = 0; y < WORLD_SIZE; y++)
{
chunks[x][y]=new Chunk();
if(chunk... |
dfb71c2f-ab74-48c1-947b-53d855507a17 | 0 | private static int getIntBigEndian(byte[] a, int offs) {
return
(a[offs] & 0xff) << 24 |
(a[offs + 1] & 0xff) << 16 |
(a[offs + 2] & 0xff) << 8 |
a[offs + 3] & 0xff;
} |
5de9b480-8aed-4986-9752-f4135f9b7d3f | 0 | public static String getRequestParameter(String key) {
return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(key);
} |
5c51c736-9b5b-488c-884f-224860108d79 | 7 | public static void main(String[] args) throws IOException {
if(args.length < 1) {
System.err.println("No key file specified.");
System.exit(-1);
}
ByteBuffer buffer = new ByteBuffer();
System.err.print("Loading key file");
DotThread dt = new DotThread();
dt.start();
try(FileInputStream in =... |
404342cd-dcdb-415f-b225-5a3eded43c1c | 5 | public void fixTopics() {
Map<String, String> topicMap = new HashMap();
try {
Properties prop = new Properties();
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("Journal.properties");
prop.load(inputStream);
BufferedReader fin =... |
cb675e46-0bbd-4314-9224-21fa6e009bf7 | 0 | public PelaajaTest() {
} |
d75edb06-466c-426c-adec-094f5fbcc0ba | 7 | public static void preloadAll()
{
try
{
CodeSource cs = RHImageLoader.class.getProtectionDomain()
.getCodeSource();
File codeSource = new File(URLDecoder.decode(cs.getLocation()
.getFile(), "UTF-8"));
String desiredPackage = RHImageLoader.class.getPackage().getName()
.replace('.', '/');
... |
85422620-e47e-4294-a56f-c0ac51220321 | 1 | public ChatGui() {
super();
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
settings = Settings.getInstance();
participantList = ParticipantList.getInstance();
chatHistory = ChatHistory.getInstance();
URL iconUrl = ClassLoader.getSystemResource(Constants.ICON_FILE);
Image icon = new ImageIcon( ico... |
440c026e-4187-4432-8b28-95c3a407ce81 | 3 | public static String selectListParam(Map<String, Object> paramMap) throws SQLException{
@SuppressWarnings("unchecked")
java.util.Map<String,Object> sqlWhereMap = (Map<String, Object>) (paramMap.get("sqlWhereMap")==null ? "": paramMap.get("sqlWhereMap"));
BEGIN();
SELECT(Permission.COLUMNS);
FROM(... |
b38eae6a-8d6c-4507-8fc0-9d6aae102061 | 7 | @Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode() == KeyEvent.VK_UP) {
thita -= (float) (Math.PI / 14);
thita %= 2*Math.PI;
}
if(e.getKeyCode() == KeyEvent.VK_DOWN) {
thita += (float) (Math.PI / 14);
thita %= 2*Math.PI;
}
if(e.getKeyCode() == KeyEvent.VK_LEFT) {
phi += (... |
7d323b2c-68fe-4bc8-8f26-1c00afdca241 | 6 | public boolean getBoolean(int index) throws JSONException {
Object object = get(index);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String) object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Bool... |
c5e827d8-fce1-4390-995e-0a7a1cc5542d | 8 | private static int method524(char arg0[]) {
if (arg0.length > 6) {
return 0;
}
int k = 0;
for (int l = 0; l < arg0.length; l++) {
char c = arg0[arg0.length - l - 1];
if (c >= 'a' && c <= 'z') {
k = k * 38 + c - 97 + 1;
} else if (c == '\'') {
k = k * 38 + 27;
} else if (c >= '0' && c <= '... |
46e69d83-3f23-40c7-ad8b-1df8884b25ff | 8 | @Override
public void promptPrint(String msg)
{
print(msg);
if(promptSuffix.length>0)
{
try
{
rawBytesOut(rawout, promptSuffix);
}
catch (IOException e)
{
}
}
final MOB mob=mob();
if((!getClientTelnetMode(TELNET_SUPRESS_GO_AHEAD))
&& (!killFlag)
&& (mightSupportTelnetMode(TELNET... |
5b14bb64-03fc-474c-8f62-b5ba948fbe9a | 4 | private void calculatePosition(){
nx = Math.cos(getRadians());
ny = Math.sin(getRadians());
x+=speed*nx;
y+=speed*ny;
if(x>MainWindow.WIDTH) x = -sprite.getWidth();
if(y>MainWindow.HEIGHT) y = -sprite.getHeight();
if(x+sprite.getWidth()<0) x = MainWindow.WIDTH;
if(y+sprite.getHeight()<0) y = Ma... |
55fbed6c-db64-48f9-89b6-886239dda5be | 5 | private void initUserlistLayoutMenu(Color bg) {
this.userlistLayoutMenu = new JPanel();
this.userlistLayoutMenu.setBackground(bg);
this.userlistLayoutMenu.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
// size
this.userlistLayoutMenu.add(new Numberfield(this.skin.getUser... |
c5c9652f-9995-4053-ad1f-6ad9457eb0c3 | 9 | public ClassDescriptorSourceScript sourceFileSearch(boolean firstTime,SourceScriptRoot scriptFile,ClassDescriptorSourceFileRegistry sourceRegistry,LinkedList<ClassDescriptorSourceUnit> updatedSourceFiles,LinkedList<ClassDescriptorSourceUnit> newSourceFiles)
{
ClassDescriptorSourceScript scriptFileDesc = (sc... |
55d3c196-2311-4999-aca0-29d48ba2534d | 6 | public CardSetStats(Collection<Card> cardCollection) {
// Find dupes
Map<Rank, Set<Card>> rankMap = new HashMap<Rank, Set<Card>>();
for (Card card : cardCollection) {
Set<Card> dupeSet = rankMap.get(card.rank);
if (dupeSet == null) {
dupeSet = new HashSet<Card>();
}
dupeSet... |
84bf9ad5-d5e4-4086-ad38-f7058375741a | 1 | public final EsperParser.print_return print() throws RecognitionException {
EsperParser.print_return retval = new EsperParser.print_return();
retval.start = input.LT(1);
Object root_0 = null;
Token PRINT42=null;
EsperParser.expr_return expr43 =null;
Object PRINT42_tr... |
dc6ce724-b890-45b6-a3c7-8d24b6eb7fda | 2 | public void printVal() {
int i = 0;
while (true) {
System.out.println(Thread.currentThread().getName() + " " + this.getVal() + "\t" + i );
if (i == 10000) {
break;
} else {
i++;
}
}
} |
e2207939-4880-4884-9438-4a26145ee275 | 8 | void drawboard(Graphics g) {
g.setColor(Color.black);
g.fillRect(0,0,getWidth(), getHeight());
sqw = getWidth()/xdim;
sqh = getHeight()/ydim;
// draw background panels
if (def != null) {
for (int y=0; y<ydim; y++) {
for (int x=0; x<xdim; x++) def.drawObject(g, x, y, sqw, sqh, this);
}
}
... |
4f692a47-b6a8-4b17-86c0-88f632057d58 | 5 | private void jButton8ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton8ActionPerformed
{//GEN-HEADEREND:event_jButton8ActionPerformed
if (!gameover) {
if (rule.turn()) {
if (rule.check(1, 2)) {
rule.pressed(1, 2);
if ... |
6d6ffc4e-d354-4171-b888-9e8b609fcef9 | 9 | public void getClientCommand()
throws Exception
{
int Addr_Len;
SOCKS_Version = getByte();
socksCommand = getByte();
RSV = getByte();
ATYP = getByte();
Addr_Len = ADDR_Size[ATYP];
DST_Addr[0] = getByte();
if( ATYP==0x03 ) {
Addr_Len = DST_Addr[0]+1;
}
for( int i=1; i<Ad... |
0d4d3fad-1273-48ce-938f-a1e22502ea50 | 1 | public StructuredBlock appendBlock(StructuredBlock block) {
if (outer instanceof ConditionalBlock) {
IfThenElseBlock ifBlock = new IfThenElseBlock(
((ConditionalBlock) outer).getInstruction());
ifBlock.moveDefinitions(outer, this);
ifBlock.replace(outer);
ifBlock.moveJump(outer.jump);
ifBlock.setT... |
c49d740d-7ac5-4628-ab8f-d62dee92fb50 | 5 | protected static Ptg calcIsna( Ptg[] operands )
{
if( operands.length != 1 )
{
return PtgCalculator.getError();
}
if( operands[0] instanceof PtgErr )
{
PtgErr per = (PtgErr) operands[0];
if( per.getErrorType() == PtgErr.ERROR_NA )
{
return new PtgBool( true );
}
}
else if( operands[0].... |
9503dec0-daae-4378-bfa7-cd22277d636c | 1 | public void showMatrixS()
{
System.out.print("Second column");
System.out.println();
for(int j=0; j<rows; j++)
{
System.out.print(matrix[1][j]);
}
} |
839bb807-8a98-4ce9-bf52-ff9d5e8e7529 | 7 | public void go() {
try {
PrintWriter writer = new PrintWriter(new FileOutputStream("xkcdTitles.txt"));
for(int i = 1; i <= 1330; i++) {
if(i == 100 || i == 404 || i == 1037) {
System.out.println("Skipping " + Integer.toString(i));
continue;
}
File file = new File("XKCD/" + Integer.toStrin... |
6d617985-1b59-4007-bef2-77598ab50b96 | 4 | public void setLineNumbers(final LineNumberDebugInfo[] lineNumbers) {
if (lineNumbers == null) {
for (int i = 0; i < attrs.length; i++) {
if (this.lineNumbers == attrs[i]) {
final Attribute[] a = attrs;
attrs = new Attribute[a.length - 1];
System.arraycopy(a, 0, attrs, 0, i);
System.arrayco... |
427d188f-0293-4025-9000-62e7f924ba70 | 0 | public static void main(String[] args)
{
ParentInterface<String,String> P = null;
P = new ChildClass<String,String>("aaa");
P.setFoo2("ljgla");
System.out.println(P.getFoo2());
} |
6eb88b41-4f3f-44a2-b363-259f45e8b9bd | 9 | public DataSourceImpl(List<String> data) {
final Pattern p = Pattern.compile("\\{[-+#!*/]?");
for (String s : data) {
final StringTokenizer st = new StringTokenizer(s, "|}", true);
while (st.hasMoreTokens()) {
final String token = st.nextToken().trim();
if (token.equals("|")) {
continue;
}
... |
09bb7901-b887-4d8c-a397-2401fd40e9a9 | 1 | @Test
public void pieniEsteVasemmalla() {
laitetaasPariPientaEstetta();
pe.siirra(900, 0);
pe.liikuVasemmalle();
for (int i = 0; i < 100; i++) {
pe.eksistoi();
}
assertTrue("Hahmo pääsi matalasta seinästä läpi vasemmalle paahtaessaan. x = "
... |
d2f7389d-1396-425e-9289-c6a1829c74cc | 7 | public void invoke(MindMapNode pNode) {
// generate string to search for
StringBuffer sb = new StringBuffer();
List selecteds = getMindMapController().getSelecteds();
for (Iterator it = selecteds.iterator(); it.hasNext(); ) {
MindMapNode node = (MindMapNode) it.next();
... |
0f6a01b2-3d24-491e-a764-aa6ed7a2ea78 | 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... |
f3f78a75-ef32-460f-b012-cc98ede37291 | 3 | boolean boardFull(){
for(int j = 0; j < HEIGHT; j++){
for(int i = 0; i < WIDTH; i++){
if(m_Pieces[i][j].equals(m_EmptyPiece)){
return false;
}
}
}
return true;
} |
28949bf0-e020-436d-b943-602b2eadda3e | 2 | public int getAdjacentBlank(State s,Hexpos hp){
// iterate over a list of all neighbours
int adjacent=0;
MyList neighbours = hp.neighbours();
Iterator it = neighbours.iterator();
while (it.hasNext()) {
Hexpos neighbour = (Hexpos) it.next();
// only 'change' ownership if the square was not empty
if... |
2838c08f-f540-4ba7-9260-aa3736462d52 | 9 | public void loadFromObject() { try {
if (cls==null) return;
for (int i=0; i<fields.size(); i++) {
String fieldname = (String)fields.get(i);
String fieldtype = (String)fieldtypes.get(fieldname);
//System.out.println("<field "+fieldname+" "+fieldvalue);
if (fieldtype.equals("key")
|| fieldtype.equals(... |
b8aa4355-e091-4c06-ae3d-79a9f1825e14 | 6 | static Object[][] add(Object[][] x, Object[][] y) {
Object[][] ret = new Object[x.length][];
for (int i = 0; i < x.length; i++) {
ret[i] = new Object[x[i].length];
for (int j = 0; j < x[i].length; j++) {
Object a = x[i][j];
... |
2a00b6f7-5267-4f9b-827d-d91700a7f689 | 2 | private void shiftStackTwoUp(){
if(array[stack2StartIndex]==null){
stack2StartIndex++;
return;
}
else{
Object current = array[stack2StartIndex];
Object next = array[stack2StartIndex+1];
Object temp = next... |
1f84e6b1-3ffb-4ed1-a9c4-17e90cf5fb69 | 2 | public void addPhi(final Block block) {
if (phis[cfg.preOrderIndex(block)] != null) {
return;
}
final VarExpr target = (VarExpr) prototype.clone();
final PhiJoinStmt phi = new PhiJoinStmt(target, block);
phis[cfg.preOrderIndex(block)] = phi;
if (SSA.DEBUG) {
System.out.println(" place " + phi + " ... |
fcc6f1fe-6446-4eef-a706-c1bacf6c2d73 | 1 | public boolean running() {
try {
process.exitValue();
return false;
} catch (IllegalThreadStateException e) {
return true;
}
} |
72f2f026-ea1e-4d01-8b1d-e5c897ff388b | 8 | public void visit_fload(final Instruction inst) {
final int index = ((LocalVariable) inst.operand()).index();
if (index + 1 > maxLocals) {
maxLocals = index + 1;
}
if (inst.useSlow()) {
if (index < 256) {
addOpcode(Opcode.opc_fload);
addByte(index);
} else {
addOpcode(Opcode.opc_wide);
... |
d81bf708-f7f0-4bb9-a8a3-a3c5f874738f | 7 | public TreeNode buildTree(int[] inorder, int[] postorder) {
if(postorder.length == 0 || inorder.length == 0) return null;
TreeNode mid = new TreeNode(postorder[postorder.length-1]);
if(postorder.length == 1) return mid;
int midIndex = -1;
for(int i=0; i< i... |
646051a3-141d-407c-84ef-68cf95d13f8a | 2 | public void getStudents(String courseID) throws Exception {
String sql;
PreparedStatement st;
ResultSet rs;
Connection db = ConnectionUtils.getConnection();
//String student_ID = UserLogin.id;
// get the student information
sql = "select course.... |
2901e29e-9489-42b8-8d6f-b3eb54ccab55 | 4 | public File askForTargetArchive(File def) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String suffix = model.getAlgorithm().getSuffix();
while (true) {
try {
sysOut.println(bundle.getString("path_correct_suffix") + " \"" + suffix + "\"."... |
4737c35d-e0db-4155-8573-025b629646bd | 3 | void addData(String fn, String id,String name, float price) {
File fname = new File(fn);
FileOutputStream f_out = null;
BufferedOutputStream b_out = null;
DataOutputStream d_out = null;
try {
f_out = new FileOutputStream(fname,true);
b_out = new BufferedOutputStream(f_out);
d_out =... |
7d502b19-0953-4d94-97e8-0e4287af3578 | 6 | public char[] othelierTab()
{
char []TAB=new char[66];
if(this.tour==Pion.NOIR)
TAB[0]='X';
else
TAB[0]='O';
// TAB[1]=difficultee;
for(int i=0,k=2;i<NB_LIGNE;i++)
{
for(int j=0;j<NB_COLONNE;j++,k++)
{... |
b6cc22ae-9555-4341-8d8d-54ef2b8e8d0a | 0 | public AbstractPlay getRelatedPlay(){
return this.relatedPlay;
} |
846ad7cd-540c-4ad5-829a-6cda6ebcb0b0 | 0 | public float getVelocityX() {
return dx;
} |
6392725d-c3a8-4412-a105-6b43f029c541 | 8 | public int compare(String o1, String o2)
{
String s1 = (String)o1;
String s2 = (String)o2;
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length)
{
... |
dddad6fc-53b6-4a8a-816d-5534814abc3b | 9 | private void rotate_nearest_z(final Image image, final Image rotated) {
// Initialization:
messenger.log("Nearest-neighbor sampling in x-y");
progressor.status("Rotating"+component+"...");
progressor.steps(odims.c*odims.t*odims.z*odims.y);
// Rotate using the inverse of the rotation matrix:
final Coor... |
6d6387f1-982b-4e86-b9da-3b37565e74c0 | 2 | public ICacheable remove(Object key){
if (key == null) {
throw new NullPointerException("key == null");
}
ICacheable previous = null;
synchronized (this) {
previous = mCacheMap.remove(key);
if (previous != null) {
mCurrSize -= safeSizeOf(key, prev... |
4c3a8235-f434-43e2-acfb-81058be95ac1 | 3 | public static boolean setWindowsExplorerActive(boolean active) {
boolean ret = false;
if (active) {
try {
ret = WindowsExplorer.start();
} catch (IOException
| InterruptedException e) {
// TODO Auto-generated catch block
... |
b5258621-7766-4b93-af47-25e9e3675daf | 4 | public void updateViews() {
View tab = tabWindow.getFocusedView();
if (tab == curTab)
return;
if (tab instanceof NSMBeTab) {
curTab = (NSMBeTab)tab;
for (View v : rootViews) {
if (v instanceof NSMBeView) {
((NSMBeView)v).upd... |
698f6119-e2a6-40d7-a0fd-7a59f86b7146 | 4 | public void parseVersion(String inString){
try{
if(inString.contains(".")){
// there is more than one integer
int occurances = countOccurrencesOf(inString, '.');
for(int i = 0; i < occurances; i++){
int nextOccurance = inString.indexOf('.');
String number = inString.substring(0, nextOccurance);
... |
2ca4c1cc-af4b-40d3-890c-0fff08db8ded | 5 | private static void readMessageAux(Core output, Document xml, XmlMessage type) {
if (type == XmlMessage.DESCONECTAR) readInDesconectar(output, xml);
else if (type == XmlMessage.PESO) readInPeso(output, xml);
else {
String updateId = xml.getElementsByTagName(UPDATEID).item(HEAD).getTe... |
ad6d187d-50c4-4b58-9c70-83201f17ce59 | 0 | public Point2D getRelativeChunkCenter()
{
return new Point2D.Double(getChunkSideLength()/2.0, getChunkSideLength()/2.0);
} |
8bb3e8d6-40ca-4bd2-bab2-8c8af39193a4 | 3 | private void sort(int[] A, int low, int high){
if(high - low == 1){
if(A[high] < A[low]) {
exchange(A, low, high);
}
}
if(high - low > 1) {
int mid = (int)Math.ceil(2.0 * (high - low + 1) / 3.0);
sort(A, low, low + mid - 1);
sort(A, high - mid + 1, high);
sort(A, low, low + mid - 1);
}
... |
377bb667-415f-42bb-829f-83c9115e98e7 | 8 | public String getRecommendListForTransition(){
String recommend = "";
try {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager.getConnection("jdbc:mysql://localhost/NETWORK_TEST?"
+ "user=root&password=root");
connect.setAutoCommit(false);
statement = connect.createStatement();... |
c20b917d-8232-4b1b-82c6-5b49c28a7bde | 3 | public static void addToShopList(String[] newList){
String[] combineList;
int i = 0;
if (shopListArr == null){
combineList = new String[newList.length];
}else{
combineList = new String[shopListArr.length + newList.length];
for ( ;i < shopListArr.length;i++)
... |
d72dba11-fa95-4e22-a4b0-57c3251460fc | 8 | */
public void rename(Nameable object) {
Player player = freeColClient.getMyPlayer();
if (!(object instanceof Ownable)
|| !player.owns((Ownable) object)) {
return;
}
String name = null;
if (object instanceof Colony) {
Colony colony = (Colo... |
60561aca-a250-4579-a61c-ab7f248ca643 | 4 | protected List<Integer> getAllPrimes() {
boolean[] sito = new boolean[N];
for (int i = 1; i < sito.length; i++) {
sito[i] = true;
}
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < sito.length; i++) {
if (sito[i]) {
int i1 = i + 1;
list.add(i1);
int x = 2;
int j ... |
6e721b1a-9afd-4605-b193-34da2a0306cf | 9 | public static char convertFromString(String s) {
// if (s.contains("E")) {
// return 'E';
//}
if (s.contains("M")) {
return 'M';
}
if (s.contains("D")) {
return 'D';
}
if (s.contains("C")) {
return 'C';
}
... |
1f94afa8-5f80-4d82-bd07-5894e01aed14 | 5 | private void addShadows(Bitmap tile){
if (isShadowed_north) {
tile.blit(Art.shadow_north, 0, 0);
} else {
if (isShadowed_north_east) {
tile.blit(Art.shadow_north_east, Tile.WIDTH - Art.shadow_east.w, 0);
}
if (isShadowed_north_west) {
tile.b... |
06209935-7baf-4014-a31d-a15170f69aaf | 7 | private String changed(String inp, int len) {
StringBuilder c = new StringBuilder();
int count = 0;
int b = 0;
boolean first = true;
for (int i = 0; i < inp.length(); i++) {
char ch = inp.charAt(i);
switch (ch) {
case ' ':
break; // TODO, repect string quotes.
case LB:
case RB:
... |
adc8e0c7-c6cd-40f1-9a5a-2e3c02db280c | 4 | public void verifyBallCollides(Ball ball) {
//TODO: refactor this.
for (Collidable collidable : this.getCollidables()) {
GameComponent<?> component = collidable.asComponent();
if (CollisionDetector.INSTANCE.collidesCircleAgainstRect(ball.getCirc(), component.getRect())) {
... |
9b0d9545-9479-4e06-a957-1fe21d4361a2 | 1 | public void setMusicPlaying(final boolean m) {
musicPlaying = m;
if (musicPlaying) {
SoundStore.get().restartLoop();
}
else {
SoundStore.get().pauseLoop();
}
} |
09712ca8-f97e-4566-968c-fe0b312d581b | 0 | protected synchronized Integer initialValue() {
return rand.nextInt(10000);
} |
f21cbb1d-a2f1-4795-bc05-1d88c7f26d0f | 1 | @Override
public List<Integer> delete(Criteria criteria, GenericDeleteQuery deleteGeneric, Connection conn) throws DaoQueryException {
List paramList = new ArrayList<>();
StringBuilder sb = new StringBuilder(DELETE_QUERY);
String queryStr = new QueryMapper() {
@Override
... |
0c520d9a-7883-4bfa-bf38-74dc9a0d7750 | 9 | public static Object newInstance(Node xml) {
try {
Class<?> c = Class.forName(xml.getNodeName());
Constructor<?> constructor =
c.getConstructor(new Class[] { Class.forName("org.w3c.dom.Element") });
return constructor.newInstance(xml);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} c... |
070bdac8-9ef0-4e1d-bf4f-155da3dfaa6e | 5 | public void login(PlayerDetails details) throws Exception {
int response = Constants.LOGIN_RESPONSE_OK;
// Check if the player is already logged in.
for (Player player : World.getWorld().getPlayers()) {
if (player == null) {
continue;
}
if (player.getUsername().equals(details.getUsername())) {
r... |
41d68eaa-c831-4586-ae04-39809cfef509 | 4 | public static void main(String[] args) {
// 初始化一个Callable对象和FutureTask对象
Callable pAccount = new PrivateAccount();
FutureTask futureTask = new FutureTask(pAccount);
// 使用futureTask创建一个线程
Thread pAccountThread = new Thread(futureTask);
System.out.println("futureTask线程现在开始启... |
d423c9a0-8d8e-43ce-8af0-540319e51fae | 0 | public StopRangeGroup getGroup() {
return this._group;
} |
a6d2c3f2-67c4-47fa-afbc-ff16daa63b1a | 7 | private TreeMap<Integer, Integer> notWantedColor(int nbCouleur, TreeMap< Integer, TreeSet<Integer>> couleurNonVoulue)
{
TreeMap<Integer, TreeSet<Integer>> couleurPossible = new TreeMap<Integer, TreeSet<Integer>>();
ArrayList<Integer> elementNonColorie = new ArrayList<Integer>();
for(Integer key : noeuds.keySe... |
9f36576b-7327-463c-a137-4954cb9f2d5e | 7 | public String getBrowserEXEpath (String browserName, String browserVersion){
String browserEXEpath = "" ;
try{
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
//Getting the instance of DocumentBuilderFactory
domFactory.setNamespaceAware(true);
//true if the parser produce... |
7b527bcb-602e-4cf9-ae52-384511ba552e | 2 | public int getSize() {
return type == Type.LONG_TYPE || type == Type.DOUBLE_TYPE ? 2 : 1;
} |
20934031-782f-490f-b93a-8c15359c5351 | 9 | @Override
public boolean remove(E value) {
Node<E> link=head;
while(link!=null&&!value.equals(link.value)) {
link=link.next;
}
if (link == null) return false;
Node<E> prev = link.prev;
Node<E> next = link.next;
if(prev!=null&&next!=null){
... |
84eb218e-3b6e-42f2-b40a-0f38bdc066bc | 0 | @Override
public void loadConsole() throws DataLoadFailedException {
Map<String, Object> data = getData("server", "name", "console");
load(PermissionType.CONSOLE, "console", data);
} |
15e81bd0-7355-4070-b349-d11f3327f445 | 4 | public void setPaused(boolean paused) {
if (this.paused != paused && sequencer != null && sequencer.isOpen()) {
this.paused = paused;
if (paused) {
sequencer.stop();
}
else {
sequencer.start();
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.