text stringlengths 14 410k | label int32 0 9 |
|---|---|
private synchronized boolean processLine() throws IOException {
if (!isFull() && (eof == false)) {
String theLine = buffer.readLine();
if (theLine == null) {
eof = true;
fileOpen = false;
return false;
} else {
add(theLine);
return true;
}
} else {
return false;
}
} | 3 |
@Override
public boolean equals(Object obj) {
if (obj instanceof DrawableSegment) {
DrawableSegment d = (DrawableSegment) obj;
if (this.x1 == d.x1 && this.x2 == d.x2 && this.y1 == d.y1 && this.y2 == d.y2 && this.color.equals(d.color)
&& this.brushWidth == d.brushW... | 7 |
public Effect(Type type, float effectDuration) {
this.type = type;
this.effectDuration = effectDuration;
// Apply effect (if applicable)
switch (type) {
case ENLARGE_PADDLE:
App.getMainWindow().getScene().getPaddle().expand();
break;
case MULTIBALL:
App.getMainWindow().getScene().spawnBal... | 9 |
private void initMsInfo() {
msCheck = new LinkedHashMap<String, JCheckBox>();
isMsCheck = new HashMap<String, Boolean>();
// Cookie情報用リストにCookieからMS種別の選択状態を取得
List<String> valueGetList = Arrays.asList(SystemProperties.getInstance().getDefaultMsList());
// ArrayList<String> valueGetList = cm.getCookie(... | 8 |
private boolean setModDir() {
if (!useModDirCheckBox.isSelected()) {
if (hadModDir)
config.removeVariable("moddir");
return true;
} else {
StringBuilder filename = new StringBuilder(mainDirTextField.getText());
char last = filename.charAt(f... | 7 |
private boolean r_combo_suffix() {
int among_var;
int v_1;
// test, line 91
v_1 = limit - cursor;
// (, line 91
// [, line 92
ket = cursor;
// substring, line 92
... | 9 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
QuizImpl quiz = (QuizImpl) o;
if (quizId != quiz.quizId) return false;
if (quizName != null ? !quizName.equals(quiz.quizName) : quiz.quizName !... | 8 |
public synchronized boolean insertarProcesoExpirado(Proceso p) {
boolean insertado = false;
/* Si el proceso esta corriendo o es interrumpible*/
if (p.getEstado() == Constantes.TASK_RUNNING || p.getEstado() == Constantes.TASK_INTERRUPTIBLE) {
insertado = expirados.insertarProceso(p)... | 5 |
public String getAge() {
return age;
} | 0 |
public boolean equals(Object var1) {
if(!(var1 instanceof PathPoint)) {
return false;
} else {
PathPoint var2 = (PathPoint)var1;
return this.hash == var2.hash && this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord;
}
} | 4 |
@Override
public void messageArrived(String data)
{
String text = responseTextArea.getText();
if(!text.isEmpty())
text += "\n";
responseTextArea.setText(text + data);
} | 1 |
protected void logout() {
this.dispose();
if (setTeamRepJfme != null) {
setTeamRepJfme.dispose();
}
if (editDetailsJfme != null) {
editDetailsJfme.dispose();
}
if (newActionJfme != null) {
newActionJfme.dispose();
}
if (editDetailsJfme != null) {
editDetailsJfme.dispose();
}
LoginGUI... | 4 |
public boolean setOffset(Point paramPoint)
{
if ((paramPoint.x < 0) || (paramPoint.y < 0) || (paramPoint.x >= this.MapSize.width - WINDOWTILEWIDTH) || (paramPoint.y >= this.MapSize.height - WINDOWTILEHEIGHT))
{
return false;
}
this.NewOffset = paramPoint;
repaint();
return true;
} | 4 |
public Tester(String name) {
this.name = name;
} | 0 |
private void checkSong(final String song, final FolderConfig folderConfig) {
String trackString = null;
final long trackId;
try {
trackId = getApi().resolve(song);
final HttpResponse trackResponse = getApi().get(new Request(String.format(Constants.TRACK_URL, trackId, Constants.CLIENT_ID)));
trackString =... | 8 |
public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb=new StringBuilder();
for (String ln;(ln=in.readLine())!=null;) {
int N=parseInt(ln.trim()),max=0,C,R;
String[] arr=new String[N];
for(int i=0;i<N;i++)max=ma... | 8 |
@Override
public boolean incrementToken() {
if (valSize == 0)
throw new IllegalStateException("call set???Value() before usage");
if (shift >= valSize)
return false;
clearAttributes();
final char[] buffer;
switch (valSize) {
case 64:
buffer = termAtt.resizeTermBuffer(Num... | 6 |
public static int flipCoin()
{
if(RAND_GENERATOR.nextBoolean())
return 0;
else
return 2;
} | 1 |
public Map<QName, String> getOtherAttributes() {
return otherAttributes;
} | 0 |
public int compareTo(Individual arg) {
// Compare by class name first:
String first = getClass().getSimpleName();
String argFirst = arg.getClass().getSimpleName();
int firstCompare = first.compareTo(argFirst);
if(firstCompare != 0)
return firstCompare;
if(name != null && arg.name != null) {
... | 6 |
public void update(){
for(int x = 0; x < tiles.length; x++){
for(int y = 0; y < tiles.length; y++){
if(tiles[x][y] == null)
continue;
if(tiles[x][y].foreground != null)
tiles[x][y].foreground.update();
if(tiles[x][y].background != null){
tiles[x][y].background.background = true;
... | 5 |
private void initialize() {
model = new PortTableModel();
manager = new DataAccess(model);
table=new PortTable(model);
PortTablePanel panel = new PortTablePanel(table);
setLayout(new BorderLayout());
GridBagConstraints c = new GridBagConstraints();
SearchPanel search = new SearchPanel(manager);
c.gri... | 0 |
public static Cons translateLoomStatement(Cons tree) {
{ GeneralizedSymbol testValue000 = ((GeneralizedSymbol)(tree.value));
if (testValue000 == Logic.SYM_STELLA_ASK) {
return (Logic.translateLoomAsk(tree));
}
else if (testValue000 == Logic.SYM_STELLA_RETRIEVE) {
return (Logic.tra... | 8 |
private static int elementNumber(String element) { //locates the element in elementStringArray and
for (int x = 0; x <= elementStringArray.length -1; x++) { //returns the string's int /
if (elementStringArray[x].equalsIgnoreCase(element)) { //the location of the string in the
return x; //array
}
}
retu... | 2 |
public boolean processMsg(CConnection cc) {
boolean res = true;
if (state == 0) {
if (state0 != null)
res = state0.processMsg(cc);
if (!res)
return res;
state++;
}
if (state == 1) {
if (state1 != null)
res = state1.processMsg(cc);
if (!res)
... | 6 |
public void action(){
Player player = World.current.getPlayers().get(0);
switch(type){
case GoldCoin:
player.coins += actionFactor;
player.inventory.inventory.remove(this);
break;
case HealthUp:
player.addHealth(actionFactor);
player.inventory.inventory.remove(this);
break;
case MeleeW... | 3 |
private void recover() throws IOException {
String logName = makeLogName();
File logFile = new File(logName);
if (!logFile.exists())
return;
if (logFile.length() == 0) {
logFile.delete();
return;
}
FileInputStream fis = new FileInputSt... | 8 |
public ByteBuffer processInput(ByteBuffer buffer) throws SSLException {
mAppData.clear();
mInboundData = buffer;
insertUnderflowData();
loop:
while (mInboundData.hasRemaining() && canProceed()) {
SSLEngineResult result = mEngine.unwrap(mInboundData, mAppData);
switch (result.getStatus()) {
case ... | 5 |
public String[] getUriAndLyricsSnippet(String artistName,String songName){
if (artistName.equals(null) || artistName.equals("") || songName.equals(null) || songName.equals(""))
return null;
String url = buildUrl(artistName,songName);
try {
Document document = reader.read(url);
// XMLUtil.writeToFile(docume... | 6 |
private void addProgram(String text, int type) {
int shader = glCreateShader(type);
if (shader == 0) {
System.err
.println("engine.graphics.Shader creation failed: Could not find valid memory location when adding shader");
System.exit(1);
}
g... | 2 |
public void getSystemTray(){
//Check the SystemTray is supported
if (!SystemTray.isSupported()) {
System.out.println("SystemTray is not supported");
return;
}
final PopupMenu popup = new PopupMenu();
trayIcon =
new TrayIcon(Toolkit.ge... | 9 |
public int getDirection() {
if (this.getOneLength() > 1) {
Logger
.printLine("ERROR: Requested direction of Offset longer than 1");
}
if (this.xOffset == 1)
return 0;
else if (this.yOffset == 1)
return 1;
else if (this.xOffset == -1)
return 2;
else if (this.yOffset == -1)
return 3;
els... | 5 |
private static String getByteBinaryStringForFloat(float f) {
String signBit = "0";
if (f < 0) {
signBit = "1";
f = -f;
}
int integerPart = (int) f;
float fractionalPart = f - integerPart;
fractionalPart *= 16;
float tmp = fractionalPart;
... | 7 |
private void reportNode(
Side s, Node node,
String indent, StringBuffer sB
) {
if (node == null) return ;
else {
final String tick = (s == null) ? "" : ((s == Side.L) ? " \\" : " /") ;
final String cross = (s == null) ?
">-|- " :
((node.height > 0)) ? "|- " : ">- " ;
... | 6 |
public int getNumberOfDead(){
int res = 0;
for (Being being: beings){
if (being.isDead()){
res++;
}
}
return res;
} | 2 |
private boolean checkInput()
{
boolean result = true;
result = result && !loginTextField.getText().equals("");
result = result && !nameTextField.getText().equals("");
result = result && !surnameTextField.getText().equals("");
result = result && !passwordField.getText().equals... | 9 |
public static void main(String[] args) {
try {
Mongo mongo = new Mongo("localhost", 27017);
DB db = mongo.getDB("yourdb");
// get a single collection
DBCollection collection = db.getCollection("dummyColl");
logger.debug("Testing 1...");
insertDummyDocuments(collection);
//find hosting = hostB, an... | 2 |
private String getContentInfo(String[] cbEntries) {
String comboboxHintAddition = "";
if (cbEntries != null) {
String sep = System.getProperty("line.separator");
comboboxHintAddition = sep + sep + GUIStrings.keyToLocatedString(GUIStrings.KEY_EDITOR_COMBOBOXHINTCONTENT) + sep;
... | 2 |
public void copyToPencilMode () {
int i = 0, j = 0;
for (i = 0; i < 9; i++) {
for (j = 0; j < 9; j++) {
if ((pencilEntries[i][j].isEditable()) && (pencilEntries[i][j].getText().equals(""))) {
pencilEntries[i][j].setText(entries[i][j].getText());
}
}
}
} | 4 |
protected void fireInsertUpdate(DocumentEvent e) {
/*
* Now that the text is actually inserted into the content and
* element structure, we can update our token elements and "last
* tokens on lines" structure.
*/
Element lineMap = getDefaultRootElement();
DocumentEvent.ElementChange change = e.getCh... | 6 |
public void checkGECKs() throws IOException {
if (new File("plugins/CakesMinerApocalypse/").mkdirs())
System.out.println("GECK file created");
File myFile = new File("plugins/CakesMinerApocalypse/GECKs.txt");
if (!myFile.exists()){
PrintWriter outputFile = new PrintWriter("plugins/CakesMinerApocalypse/GECKs... | 9 |
@onKeyAction(actions = {KeyAction.down, KeyAction.up, KeyAction.left, KeyAction.right, KeyAction.zoom_in, KeyAction.zoom_out}, states = {KeyState.held, KeyState.pressed})
private void moveCamera(KeyActionEvent event){
KeyAction action = event.getKeyAction();
if(action.equals(KeyAction.down)){
yD--;
}else if(a... | 6 |
static int[] buildSuffixArray(String s) {
int n = s.length(); // 空文字を含むならここで+1
SuffixArrayEntry[] sa = new SuffixArrayEntry[n];
int[][] pos = new int[2][n]; // pos[t][i]: s.substr(i)の位置(ランク)
for (int i = 0; i < n; i++) { // まず1文字だけでのランクを作成
sa[i] = new SuffixArrayEntry();
... | 9 |
public boolean isANeighbor(MenPoint toCheck) {
if (this.hasNeighborPoint(MenPointNeighbor.Upper) && this.neighborPoint(MenPointNeighbor.Upper).equals(toCheck)) {
return true;
} else if (this.hasNeighborPoint(MenPointNeighbor.Left) && this.neighborPoint(MenPointNeighbor.Left).equals(toCheck)... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cliente other = (Cliente) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
... | 6 |
public void useDynamite() {
if(dynamite >= 1) {
notifyPropertyChangeListeners(new PropertyChangeEvent(this, "dynamite",
dynamite, --dynamite));
}
} | 1 |
private byte[] put(String filename, byte[] file, boolean isFirstRun) {
//System.out.println("put entrance");
this.fs.getGs().getMembershipList().setMaster();
//if you are the master you need to shard the file and send a call to the
//other servers to save the file
this.fs.getGs().getMembershipList().setSucces... | 9 |
private long updateRewrite(Master master, File f, Location accessLoc, int rewriteCount) {
MasterMeta fm = null;
if (master.map.containsKey(f.getId())) {
fm = master.map.get(f.getId());
} else {
fm = new MasterMeta(f);
master.map.put(f.getId(), fm);
}
int cCount = master.clusters.s... | 8 |
public static void captureScreenshot() {
Calendar cal = new GregorianCalendar();
int month = cal.get(Calendar.MONTH); //4
int year = cal.get(Calendar.YEAR); //2013
int sec =cal.get(Calendar.SECOND);
int min =cal.get(Calendar.MINUTE);
int date = cal.get(Calendar.DATE);
int day =cal.get(Cale... | 1 |
protected boolean layout(Construct construct) {
if(construct == null || mConstructRatioWidth == 0.0f) {
return false;
}
if(construct.getIsMultilined() == false) {
construct.setMultilined(true);
mFrame.invalidate();
mFrame.repaint();
return true;
} else {
for(Construct child : construct.... | 5 |
private String getFileName(String f) {
// get file name of a file
String fname = "";
int i = f.lastIndexOf('.');
if (i > 0 && i < f.length() - 1) {
fname = f.substring(0, i);
}
return fname;
} | 2 |
public boolean remove(DockLayoutNode node) {
if (node == mChildren[0]) {
mChildren[0] = null;
pullUp(mChildren[1]);
return true;
} else if (node == mChildren[1]) {
mChildren[1] = null;
pullUp(mChildren[0]);
return true;
}
for (DockLayoutNode child : mChildren) {
if (child instanceof DockLay... | 5 |
@Override
public void read(String path) {
long startTime = System.currentTimeMillis();
try {
Scanner in = new Scanner(new FileReader(path));
rows = in.nextInt();
cols = in.nextInt();
in.useLocale(Locale.US);
for (int i = 0; i < rows; i++... | 4 |
public void checkLives()
{
// Whenever player lose life, remove corresponding life bar
if (lives == 3)
{
removeObject(live3);
}
if (lives == 2)
{
removeObject(live2);
}
if (lives == 1)
{
removeObject(live... | 4 |
private static int parseObjectives(int index, List<Word> wordList,
List<Field> objectives, String comma) throws SQLCompilerException {
while (index < wordList.size()) {
ParseExpressionResult result = ExpressionParser.parse(index,
wordList);
if (result.getIndex() <= index) {
break;
} else {
Fi... | 9 |
public void setType(int type) {this.type = type;} | 0 |
public float diff(MultiColor b)
{
float res = 0;
for (int i = 0; i < data.length; i++)
{
if (data[i] == -1 || b.data[i] == -1)
continue;
float d = data[i] - b.data[i];
res += d * d;
}
... | 3 |
public void menuStopped(ACTION action)
{
switch(action)
{
case NEW_GAME:
graphicsEngine.stopMenu(ui);
playTheGame();
break;
case OPTIONS:
break;
case MANUAL:
break;
... | 5 |
public void renderShadowedString(String text, float x, float y, float factor) {
boolean flag = false;
if (factor <= 0.0F) {
flag = true;
}
forceUseGL = true;
glDisable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA... | 6 |
@Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
// Put the named entities recognized by PosAnnotator in a sentence into mPosSet.
mPosSet.clear();
for (org.apache.uima.jcas.tcas.Annotation geneEntity : aJCas
.getAnnotationIndex(Annotation.type)) {
Annotat... | 9 |
public Traversal<T> getRest() {
if (isEmpty()) {
throw new UnsupportedOperationException(
"Cannot advance to the rest of an empty data set"); // empty tree
}
if (leftBranch != null && !leftBranch.isEmpty()) { // if there's non-empty left sub-tree
Traversal<T> lbRest = leftBranch.getRest(); /... | 5 |
public Object opt(int index) {
return (index < 0 || index >= this.length()) ? null : this.myArrayList
.get(index);
} | 2 |
public Entity fillModel() {
Entity entity = new Entity();
entity.setName(this.name);
entity.setDescription(this.description);
return entity;
} | 0 |
public void dump(String prefix) {
System.out.println(toString(prefix));
if (children != null) {
for (int i = 0; i < children.length; ++i) {
SimpleNode n = (SimpleNode)children[i];
if (n != null) {
n.dump(prefix + " ");
}
}
}
} | 3 |
@Override
public Set<FoodObject> lookUpFoodByCollection(Collection<String> names) {
Set<FoodObject> resultSet = new HashSet<FoodObject>();
for (String s : names)
{
resultSet.add(this.lookUpFood(s));
}
return resultSet;
} | 1 |
private void findDNGFiles(AbstractQueue<String> queue, String path) {
System.out.print(".");
File root = new File(path);
File[] list = root.listFiles();
if (list == null) return;
for (File f : list) {
if (f.isDirectory()) {
findDNGFiles(queue, f.getAbsolutePath());... | 4 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
m = sc.nextInt();
if(m==0)break;
n = sc.nextInt();
s = sc.nextInt();
int[][][] a = new int[s][m+1][n+1];
for(int i=0;i<s;i++)a[i]=bfs(sc.nextInt(), sc.nextInt());
int max = 0;
int t = sc.nextInt();
... | 9 |
final private boolean jj_3R_94() {
if (jj_3R_42()) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(13)) {
jj_scanpos = xsp;
if (jj_3R_129()) return true;
}
if (jj_scan_token(IDENTIFIER)) return true;
xsp = jj_scanpos;
if (jj_3R_178()) jj_scanpos = xsp;
xsp = jj_sc... | 7 |
public boolean anyValid(OthelloPiece colour){
boolean valid = false;
for(int i=0; i<WIDTH;i++){
for(int j=0;j<HEIGHT;j++){
if(anyMove(i,j,colour)){
valid = true;
}
}
}
clea... | 3 |
@Override
public void deserialize(ByteBuffer buf) {
name = BufferUtil.getString(buf);
type = buf.get() == 0 ? PlayerType.PLAYING : PlayerType.SPECTATING;
side = Side.values()[buf.get()];
} | 1 |
public Point getNeighbour(Direction direction) {
switch (direction) {
case UP: return new Point(x, y-1);
case DOWN: return new Point(x, y+1);
case LEFT: return new Point(x-1, y);
default: return new Point(x+1, y);
}
} | 3 |
private List<List<MazeNode>> generateBlankMaze(){
List<List<MazeNode>> maze = new ArrayList<List<MazeNode>>(columns);
for(int i = 0; i < rows; i++){
maze.add(new ArrayList<MazeNode>());
}
//add a node to each element
for(int row = 0; row < rows; row++){
for(int column = 0; column < columns; column++){
... | 7 |
public void setLive(boolean isLive) {
this.isLive = isLive;
} | 0 |
public void getUser() throws IOException{
while(true){
String line = reader2.readLine();
if (line == null) break;
try {
JSONObject user = new JSONObject(line);
String u_id = user.getString("user_id");
String u_name = user.getString("name");
int u_reviewCount = user.getInt("review_count");
... | 3 |
private void btnLogarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLogarActionPerformed
if (!txtUsuario.getText().isEmpty() && !txtSenha.getText().isEmpty()) {
Validacoes valida = new Validacoes();
boolean valido = valida.isValidLogin(txtUsuario.getText(), txtSen... | 3 |
public void gameLoop() throws IOException{
while(gameRunning)
{
player1move();
renderSprites(); // Iterate through and draw all sprites
if(player1.Collided(powerUp1))
{
spriteCache.remove(powerUp... | 7 |
private char escapedStringChar(PositionTrackingPushbackReader par1PositionTrackingPushbackReader) throws IOException, InvalidSyntaxException
{
char var3 = (char)par1PositionTrackingPushbackReader.read();
char var2;
switch (var3)
{
case 34:
var2 = 34;
... | 9 |
static public Location[] getLocations()
{
Charset charset = Charset.forName("UTF-8");
try (BufferedReader reader = Files.newBufferedReader(new File("VMlocations.ini").toPath(), charset))
{
String line;
StringBuilder builder = new StringBuilder();
while ((line = reader.readLine()) != nul... | 3 |
public JInternalFrame createInfoFrame(final JFrame frame, String objName, GameObject rootObj)
{
String name = "";
if(objName.endsWith(" <GameObject>"))
{
objName = objName.substring(0, objName.length() - 13);
}
int index = 0;
boolean instantClose = false;
synchronized(rootObj.getAllAttache... | 5 |
public void generateParentsTree(String current){
int rank = fullGenreList.get(current).getRank();
if(rank ==0)
{
return;
}
else {
int max = 0;
List<String> parents = new ArrayList<String>();
for (String keys : fullGenr... | 8 |
public void updateLight(int x, int y) {
BlockType b = getBlockAt(x, y);
boolean air = false;
if (b == null) {
air = true;
byte l = (byte) 0x0;
int airCount = 0;
for (int i = y; i > 0; i--) {
airCount++;
}
l += airCount / 40;
setLight(x, y, l);
if (getTopY(x) > y)
return;
}
if (... | 8 |
@Override
public Query parse() {
if(!this.prepared) {
this.prepared = true;
String P_KEY = null;
StringBuilder sB = new StringBuilder();
sB.append("CREATE TABLE ");
sB.append(this.t.replace("#__", this.db.getPrefix()));
sB.append("\n");
sB.append(" (\n");
int i = 0;
for(Col... | 9 |
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockPhysics(BlockPhysicsEvent event){
if (event.getChangedType() != Material.PORTAL) return;
if (event.getChangedType() == Material.PORTAL){
event.setCancelled(true);
}
} | 2 |
public void matchesContainsMethodWithArguments()
{
Filter containsMethod = containsMethod( "matches", Class.class );
assert containsMethod.matches( Filter.class );
assert !containsMethod.matches( MeiyoScanner.class );
} | 0 |
public void setSpeakerList(final List<Speaker> speakerList) {
this.speakerList = speakerList;
} | 0 |
public boolean TopologicalSort(ArrayList<Vertex> graph) {
Stack<Vertex> vertexStack = new Stack<Vertex>();
//ArrayList<Vertex> vertexVisitedOrder = new ArrayList<Vertex>();
// Add all vertices with an indegree of 0 to the stack.
for (Vertex vertex : graph) {
if (vertex.inCount == 0) {
ve... | 7 |
private static void combine(String f, String s){
try{
readerA = new BufferedReader(new FileReader("" + f + ".txt"));
new Scanner(readerA);
readerB = new BufferedReader(new FileReader("" + s + ".txt"));
new Scanner(readerB);
}
catch(FileNotFoundException e){
System.err.println("Files Could Not Be Fo... | 8 |
@Override
public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException {
List paramList1 = new ArrayList<>();
List paramList2 = new ArrayList<>();
StringBuilder sb = new StringBuilder(UPDATE_QUERY);
String ... | 1 |
private void AreaDFS(AreaNode n)
{
ArrayList<Goal> neighborGoals = new ArrayList<Goal>();
// BFS adding all fields to AreaNode
Queue<Field> queue = new LinkedList<Field>();
queue.add(n.fields.get(0));
while (queue.size() > 0) {
Field t = queue.poll();
for (Field field : t.neighbors) {
if (field=... | 7 |
public PlayerActionGenerator(GameState a_gs) {
// Generate the reserved resources:
base_ru = new PlayerAction(a_gs.getMapWidth(), a_gs.getMapHeight());
gs = a_gs;
for(Unit u:gs.getMyUnits()) {
if (u.hasAction()) {
base_ru.mergeResourceUsage(u, u.getAc... | 7 |
@Override
@SuppressWarnings("empty-statement")
public boolean savePrefs() throws IOException {
String rawData = toString();
byte[] data = rawData.getBytes();
FileOutputStream fileOut = null;
try {
fileOut = new FileOutputStream(prefsFile);
fileOut... | 2 |
public void mouseEntered(MouseEvent evt) {
if (evt.getSource()==buysell){
mousein = 1;
}
if (evt.getSource()==close){
mousein = 2;
}
} | 2 |
public boolean isEncoded(){
return audioInputStream.getFormat().getEncoding() != Encoding.PCM_SIGNED
&& audioInputStream.getFormat().getEncoding() != Encoding.PCM_UNSIGNED;
} | 1 |
public SpaceShip(String name) {
this.name = name;
} | 0 |
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... paramTypes) {
Class<?>[] t = toPrimitiveTypeArray(paramTypes);
for (Constructor<?> c : clazz.getConstructors()) {
Class<?>[] types = toPrimitiveTypeArray(c.getParameterTypes());
if (equalsTypeArray(types, t))
return c;
}
return nu... | 8 |
public void setType(int type) {
this.type = type;
} | 0 |
public void load30DegreeSlope(Rectangle2D e) {
for(int x = 0; x < TileSet.tileWidth / 2; x++) {
platforms.add(new Platform(new Rectangle2D.Double(e.getX() + (2f * x), e.getY() + x, 2f, 2f)));
//System.out.println("Upper " + platforms.get(platforms.size() - 1).getBox().getY());
}
} | 1 |
@Override
public void simpleUpdate(float tpf)
{
Vector3f camDirection = cam.getDirection().clone().multLocal(0.6f);
Vector3f camLeft = cam.getLeft().clone().multLocal(0.4f);
listener.setLocation(cam.getLocation());
listener.setRotation(cam.getRotation());
walkDirecti... | 4 |
private static void insertUserAndTweets(List<User> users, List<Tweet> tweets) {
Connection con = null;
PreparedStatement stat = null;
ResultSet res = null;
try {
con = Database.getConnection();
for (User user : users) {
String preparedQuery = "INSERT INTO User VALUES (?,?,?,?)";
stat = con.prepa... | 9 |
public Picture apply(String effect) {
List<Integer> attributes = new ArrayList<>();
int red;
int green;
int blue;
boolean invR;
boolean invG;
boolean invB;
if (effect != "inv") {
for (String string : Arrays.asList(effect.split(","))) {
int bytee = Integer.parseInt(string.trim());
// System.ou... | 9 |
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.