text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean isLiving(Player player) {
if (livingplayers.contains(player))
return true;
return false;
} | 1 |
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 ... | 8 |
public long getBulletDelay(){
return this.bulletDelay;
} | 0 |
@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();
}
} | 2 |
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... | 1 |
@Override
public String getCur() {
return convertToString(cur);
} | 0 |
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... | 6 |
@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"... | 8 |
public void removeInstance(Instance instance) {
this.instances.remove(instance);
} | 0 |
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){... | 2 |
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... | 3 |
public void setItemName(String itemName) {
this.itemName = itemName;
} | 0 |
private void optimizeMondayTimeTableForIAndIIGymnasium() {
List<LinkedHashMap> daysTimeTablesForItr = addDaysTimeTablesForIteration();
List<String> teachersForIteration = createTeachersListForIteration();
LinkedHashMap<String, String> teachersTimeTable;
HashMap<String, Teacher> teacher... | 7 |
@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;
}
... | 5 |
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) ... | 7 |
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... | 5 |
@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);
... | 9 |
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} | 1 |
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... | 3 |
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
... | 8 |
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... | 2 |
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... | 4 |
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... | 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... | 3 |
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;
} | 0 |
public static String getRequestParameter(String key) {
return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(key);
} | 0 |
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 =... | 7 |
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 =... | 5 |
public PelaajaTest() {
} | 0 |
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('.', '/');
... | 7 |
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... | 1 |
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(... | 3 |
@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 += (... | 7 |
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... | 6 |
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 <= '... | 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... | 8 |
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... | 4 |
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... | 5 |
public ClassDescriptorSourceScript sourceFileSearch(boolean firstTime,SourceScriptRoot scriptFile,ClassDescriptorSourceFileRegistry sourceRegistry,LinkedList<ClassDescriptorSourceUnit> updatedSourceFiles,LinkedList<ClassDescriptorSourceUnit> newSourceFiles)
{
ClassDescriptorSourceScript scriptFileDesc = (sc... | 9 |
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... | 6 |
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... | 1 |
public void printVal() {
int i = 0;
while (true) {
System.out.println(Thread.currentThread().getName() + " " + this.getVal() + "\t" + i );
if (i == 10000) {
break;
} else {
i++;
}
}
} | 2 |
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);
}
}
... | 8 |
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 ... | 5 |
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... | 9 |
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... | 1 |
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].... | 5 |
public void showMatrixS()
{
System.out.print("Second column");
System.out.println();
for(int j=0; j<rows; j++)
{
System.out.print(matrix[1][j]);
}
} | 1 |
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... | 7 |
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... | 4 |
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());
} | 0 |
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;
}
... | 9 |
@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 = "
... | 1 |
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();
... | 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... | 6 |
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;
} | 3 |
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... | 2 |
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(... | 9 |
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];
... | 6 |
private void shiftStackTwoUp(){
if(array[stack2StartIndex]==null){
stack2StartIndex++;
return;
}
else{
Object current = array[stack2StartIndex];
Object next = array[stack2StartIndex+1];
Object temp = next... | 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 + " ... | 2 |
public boolean running() {
try {
process.exitValue();
return false;
} catch (IllegalThreadStateException e) {
return true;
}
} | 1 |
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);
... | 8 |
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... | 7 |
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.... | 2 |
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 + "\"."... | 4 |
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 =... | 3 |
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++)
{... | 6 |
public AbstractPlay getRelatedPlay(){
return this.relatedPlay;
} | 0 |
public float getVelocityX() {
return dx;
} | 0 |
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)
{
... | 8 |
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... | 9 |
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... | 2 |
public static boolean setWindowsExplorerActive(boolean active) {
boolean ret = false;
if (active) {
try {
ret = WindowsExplorer.start();
} catch (IOException
| InterruptedException e) {
// TODO Auto-generated catch block
... | 3 |
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... | 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);
... | 4 |
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... | 5 |
public Point2D getRelativeChunkCenter()
{
return new Point2D.Double(getChunkSideLength()/2.0, getChunkSideLength()/2.0);
} | 0 |
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);
}
... | 3 |
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();... | 8 |
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++)
... | 3 |
*/
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... | 8 |
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 ... | 4 |
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';
}
... | 9 |
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... | 5 |
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:
... | 7 |
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())) {
... | 4 |
public void setMusicPlaying(final boolean m) {
musicPlaying = m;
if (musicPlaying) {
SoundStore.get().restartLoop();
}
else {
SoundStore.get().pauseLoop();
}
} | 1 |
protected synchronized Integer initialValue() {
return rand.nextInt(10000);
} | 0 |
@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
... | 1 |
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... | 9 |
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... | 5 |
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线程现在开始启... | 4 |
public StopRangeGroup getGroup() {
return this._group;
} | 0 |
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... | 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... | 7 |
public int getSize() {
return type == Type.LONG_TYPE || type == Type.DOUBLE_TYPE ? 2 : 1;
} | 2 |
@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){
... | 9 |
@Override
public void loadConsole() throws DataLoadFailedException {
Map<String, Object> data = getData("server", "name", "console");
load(PermissionType.CONSOLE, "console", data);
} | 0 |
public void setPaused(boolean paused) {
if (this.paused != paused && sequencer != null && sequencer.isOpen()) {
this.paused = paused;
if (paused) {
sequencer.stop();
}
else {
sequencer.start();
}
}
} | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.