text stringlengths 14 410k | label int32 0 9 |
|---|---|
static String getDataSource() {
Properties props = new Properties();
try {
props.load(new InputStreamReader(new FileInputStream("pos.properties"), "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
} catch (FileNotFoundException e) {
throw new RuntimeE... | 3 |
public ArrayList<T> levelOrdertoArray(LBT<T> t) {
ArrayList<T> list;
list = new ArrayList<>();
int height=t.height();
for(int i=0;i<Math.pow(2, height)-2;i++){
list.add(null);
}
int i = 0;
ArrayQueue<BinaryTreeNode<T>> q = new ArrayQueue<>();
B... | 5 |
public static boolean combineObject(SynchronizedBlock synBlock,
StructuredBlock last) {
/* Is there another expression? */
if (!(last.outer instanceof SequentialBlock))
return false;
SequentialBlock sequBlock = (SequentialBlock) last.outer;
if (!(sequBlock.subBlocks[0] instanceof InstructionBlock))
r... | 6 |
private String calc(String input) {
//Person 2 put your implementation here
Random r = new Random();
char[] str = input.toCharArray();
char temp;
int rIndex;
for(int i = 0; i < input.length(); i++){
temp = str[i];
rIndex = r.nextInt(input.length());
str[i] = str[rIndex];
str[rIndex] = temp;
... | 2 |
public void setInstances(Instances inst) {
m_Instances = inst;
String [] attribNames = new String [m_Instances.numAttributes()];
for (int i = 0; i < attribNames.length; i++) {
String type = "";
switch (m_Instances.attribute(i).type()) {
case Attribute.NOMINAL:
type = "(Nom) ";
break;
... | 8 |
@Override
public void update(long delta) {
double timeFactor = (delta) / Main.targetFrameDuration;
System.out.println(timeFactor);
// SPACE DOWN
if (Input.keyDown(32)) {
spaceDown = true;
progressSpeed += 0.05 * timeFactor;
} else {
if (spaceDown && releaseListener != null) {
releaseListener.... | 5 |
public static void main(String[] args) throws IOException {
Thread threads[] = new Thread[10];
Thread.State status[] = new Thread.State[10];
for(int i = 0; i <10; i++){
threads[i] = new Thread(new Calculator(i));
if(i%2 == 0){
threads[i].setPriority(Thread.MAX_PRIORITY);
}else{
threads[i].setPrio... | 9 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Triple)) return false;
Triple triple = (Triple) o;
if (first != null ? !first.equals(triple.first) : triple.first != null) return false;
return !(second != null ? !second.equals(tripl... | 7 |
private void etsiSiirrot() {
paivitaTiedot();
for (int i = 0; i < 10; i++) { //etsii lailliset x-sijainnit
Muodostelma muod = putoava.kloonaa();
if (muod.getMuoto() == Muoto.nelio) {
// nelio-muoto aina samanlainen, ts. sillä ei ole kiertoja
siirra... | 8 |
private void render() {
BufferStrategy bs = getBufferStrategy();
if (bs == null) {
createBufferStrategy(3);
return;
}
Graphics g = bs.getDrawGraphics();
loadLevel.render(render);
player.render(render);
for (int i = 0; i < pixels.length; i++) {
pixels[i] = render.pixels[i];
}
Menu.score... | 7 |
@SuppressWarnings("static-access")
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerInteract (PlayerInteractEntityEvent event) {
Entity interactedEntity = event.getRightClicked();
if (interactedEntity instanceof Wolf) {
Wolf hound = (Wolf) inte... | 2 |
public void checkOval(){
if (ovalHeight <= HEIGHT && ovalWidth <= getWidth()){
resetOval();
}
} | 2 |
private void initWinchPositionsList() {
try{
RecentLaunchSelections recent = RecentLaunchSelections.getRecentLaunchSelections();
winchPositions = DatabaseUtilities.DatabaseDataObjectUtilities.getWinchPositions();
List<WinchPosition> recentWinchPositions = recent.getRecentWinc... | 3 |
public void actionPerformed(ActionEvent e){
if(e.getSource() == brushPicker){
for(int ind = 0; ind < brushes.length; ind++){
//Set Editing Brush type
if(brushPicker.getSelectedItem() == brushes[ind]){command = 401; bruush = ind+1; setGonzo(bruush); toggleControls(); break;}
}
fireucEvent();
command = 404; fi... | 5 |
public void addData(TagAndURISubModel dictionary) throws Exception {
boolean alreadyExists = false;
for (int i = 0; i < datas.size() && !alreadyExists; i++) {
TagAndURISubModel item = datas.get(i);
if (item.getTag().equals(dictionary.getTag()) && item.getURI().equals(dictionary.getURI())) {
alreadyExists ... | 5 |
public boolean insert(String s, State data) {
TrieNode current = root;
if (s.length() == 0) //For an empty character
{
if (!current.isMarker()) {
current.setMarker(true);
} else {
return false;
}
}
for ... | 6 |
private boolean checkForStraight(List<Card> hand)
{
List<Card> newHand = new ArrayList<Card>();
int s = hand.size()-1;
int initValue = 0;
boolean flag = true;
do {
flag = true;
initValue = hand.get(s).getValue();
for (int i = 0 ; i < 5 ; i++)
{
if (hand.get(s-(i+1)).getValue() == initValue)
... | 5 |
public void emitEvent(EventObject event) {
int eventType = ((Integer) event.getSource()).intValue();
if (eventType == DataPortListener.DATA_PORT_FINISH_READING) {
System.out.println("Data port read event...\nData port read:");
ByteBuffer bb = dataPort.getReadBuffer();
// debugging
BufferUtil.debug(bb)... | 9 |
private boolean touchHorizontally(Line first, Line second) {
Point fEnd = first.getEnd();
Point sEnd = second.getEnd();
if (fEnd.getY() != sEnd.getY()) {
return false;
}
Point fStart = first.getStart();
Point sStart = second.getStart();
if ((fStart.... | 7 |
private String getDescription() {
String desc = "@Update(" + this.getParsedSql().getOriginalExpression() + ")";
if(this.isReturnId()) {
desc = desc + ",@ReturnId()";
}
return desc;
} | 1 |
@Override public ArrayList<Suunta> suunnat()
{
ArrayList<Suunta> suunnat = new ArrayList<Suunta>();
if(palikat[0].sijainti().y() != vertailupiste.y())
suunnat.add(palikat[0].sijainti().y() > vertailupiste.y() ? Suunta.ALAS : Suunta.YLOS);
if(palikat[0].sijainti... | 4 |
protected void cellDrawn(mxICanvas canvas, mxCellState state)
{
if (isFoldingEnabled() && canvas instanceof mxGraphics2DCanvas)
{
mxIGraphModel model = graph.getModel();
mxGraphics2DCanvas g2c = (mxGraphics2DCanvas) canvas;
Graphics2D g2 = g2c.getGraphics();
// Draws the collapse/expand icons
... | 6 |
protected void receiveQueryData(IRemoteCallObjectMetaData meta,
IRemoteCallObjectData data, final long callObjectId) throws Exception {
ExceptionList excl = new ExceptionList();
try {
//..execute handler
Object result = null;
if (!meta.getExecCommand().equalsIgnoreCase(ISession.KEEP... | 4 |
public Map<String, String> returnMap() throws Exception {
Map<String, String> map = new HashMap<String,String>();
BufferedReader reader = new BufferedReader(new FileReader(this.fileName));
String line;
while ((line = reader.readLine()) != null) {
if (line.trim().length() == 0) {
continue;
}
if (lin... | 3 |
static private boolean jj_3R_12() {
if (jj_scan_token(SEND)) return true;
if (jj_3R_18()) return true;
if (jj_scan_token(TO)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_17()) {
jj_scanpos = xsp;
if (jj_3_18()) return true;
}
return false;
} | 5 |
public static String query(int table_id, String str, int start_index, int max_fetch) throws Exception
{
JSONObject result = new JSONObject();
JSONArray entry_list = new JSONArray();
Map temp = new LinkedHashMap();
int max_count,count;
int maxCount[] = new int[6];
Conn... | 8 |
public MultiPolygon add(Polygon polygon)
{
coordinates.add(polygon.getCoordinates());
return this;
} | 0 |
public static void main(String[] args) {
//TODO find out what the hell this thing was supposed to do
/*
String path = jPapaya.class.getProtectionDomain().getCodeSource().getLocation().getPath();
try {
String decodedPath = URLDecoder.decode(path, "UTF-8");
System.out.println(path);
System.out.printl... | 6 |
final private boolean jj_3R_121() {
if (jj_scan_token(FOR)) return true;
if (jj_scan_token(LPAREN)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3R_192()) jj_scanpos = xsp;
if (jj_scan_token(SEMICOLON)) return true;
xsp = jj_scanpos;
if (jj_3R_193()) jj_scanpos = xsp;
if (jj_scan... | 9 |
public static int fromDigit(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
} else if (c >= 'A' && c <= 'F') {
return c - 'A' + 10;
} else if (c >= 'a' && c <= 'f') {
return c - 'a' + 10;
} else
throw new IllegalArgumentException("Invalid hexadecimal dig... | 6 |
public boolean insert(DatabaseTableData data, Class<?> layout, boolean instant) {
Field[] publicFields = layout.getFields();
String fields = "(";
String values = "VALUES (";
for (Field field : publicFields) {
fields += field.getName() + ",";
try {
if (field.getType().isEnum()) {
values... | 5 |
public void menuPrincipal() {
mostrar("Bienvenido al sistema de administracion remota de Bases de datos");
linea();
mostrar("Por favor, ingrese el nombre de la base de datos a consultar");
String db = entrada.nextLine();
while (db == null) {
mostrar("No se ha ingresado el nombre de la base de datos, intent... | 2 |
@Override
public boolean equals(Object o) {
if (o instanceof Vector2D) {
Vector2D p = (Vector2D) o;
double xD = p.x - x, yD = p.y - y;
return xD == 0 && yD == 0;
}
return false;
} | 2 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
int X = Main.DecodeInt();
int Y = Main.DecodeInt();
Room Room = Environment.RoomManager.GetRoom(Main.Data.CurrentRoom);
if (Room == null)
{
return;
}
Main.Data.RoomUser.Id... | 3 |
public static Picture readPictureFromTriangles(String path) throws Exception {
List<Triangle> triangles = new ArrayList<Triangle>();
File file = new File(path);
System.out.println(file.getAbsolutePath());
// File file = new File("/home/arto/Popup-course/triangulation/testi.tr");
... | 3 |
private void generatePositions() {
// rozměry
int X = lab.length + 1;
int Y = lab[0].length() + 1;
int tryNr = 0;
int x, y;
// pozice hráče a nepřátel
pos = new Coord[enemies + 1];
// nejprve pozice hráče na volném políčku
int x0 = 0, y0 = 0;
while (pos[0] == null) {
x0 = (int)(Math.rand... | 8 |
public static boolean isSkeletonWarriorGold (
SkeletonWarriorGold MMSkeletonWarriorGold) {
if (MMSkeletonWarriorGold instanceof Skeleton) {
Skeleton SkeletonWarriorGold = (Skeleton) MMSkeletonWarriorGold;
if (SkeletonWarriorGold.getEquipment().getChestplate()
... | 2 |
public void updateLists() {
// Listen clearen
boxitems.clear();
lastname.clear();
prename.clear();
table.clear();
// L�schdaten einlesen
zeile = 0;
BufferedReader br = null;
String line;
try {
System.out.println("*** Auschecken-Tabllen-Daten werden geladen ***");
br = new Buffere... | 8 |
public static Session getSession() throws HibernateException {
Session session = (Session) threadLocal.get();
if (session == null || !session.isOpen()) {
if (sessionFactory == null) {
rebuildSessionFactory();
}
session = (sessionFactory != null) ? sessionFactory.openSession()
: null;
thr... | 4 |
private void parentRank() {
// TODO Auto-generated method stub
long totalFitness = 0;
for(Chromasome chro : population){
totalFitness += chro.getFitness();
int index = 0;
while(true){
if(index + 1 > parents.size()){
rouletteTable.add(chro);
break;
}
else if(chro.getFitness() < paren... | 9 |
public void changeDirection()
{
int x= 0, y= 0, d= 0, posX, posY;
boolean wall = true;
//Get current position on the board
posX = this.getHLocation();
posY = this.getVLocation();
while(wall) //Are you going to hit a wall?
{
d = r... | 7 |
public boolean isEmptySpace() {
for(int i = 0; i < 9; i++) {
for(int j = 0; j < 9; j++) {
if(entries[i][j].getText().equals("")) {
System.out.println("isEmptySpace() returned false at i: " + i + " j: " + j);
return false;
}
}
}
return true;
} | 3 |
private void pivot(int p, int q) {
// everything but row p and column q
for (int i = 0; i <= M; i++)
for (int j = 0; j <= M + N; j++)
if (i != p && j != q) a[i][j] -= a[p][j] * a[i][q] / a[p][q];
// zero out column q
for (int i = 0; i <= M; i++)
... | 8 |
private void checkCollisionBar(OperateShape ball, OperateShape bar) {
boolean isBallXBarRange = ball.getX() >= bar.getX() - bar.getWidthFromCenter()
&& ball.getX() <= bar.getX() + bar.getWidthFromCenter();
boolean isBallYBarRange = ball.getY() >= bar.getY() - bar.getHeightFromCenter()
&& ball.getY() <= bar.... | 8 |
public static void main(String[] args) {
/*
* if the user has not specified just a URL then
* we don't even want to try to handle the request
*/
if (args.length != 1)
usage();
/*
* We setup a URL object to parse the hostname and
*/
URL url = new URL(args[0]);
/*
... | 9 |
public void setCost(int cost) {
this.cost = cost;
} | 0 |
private void checkCollision(double x, double y) {
int leftTile = (int) getBounds(x, y).getMinX() >> 4;
int rightTile = (int) (getBounds(x, y).getMaxX() - 1) >> 4;
int topTile = (int) getBounds(x, y).getMinY() >> 4;
int bottomTile = (int) (getBounds(x, y).getMaxY() - 1) >> 4;
topLeft = level.getTile(leftTile,... | 0 |
private void displayHelp(String helpType) {
String helpText = null;
switch (helpType) {
case HelpMenuView.OBJECTIVE: helpText =
"\t The objective of this game is to try and find \n\n"
+ "\tthe match for each cards by memorizing them";
break;
... | 4 |
public void bind(SocketAddress address, IoHandler handler,
IoServiceConfig config) throws IOException {
if (handler == null)
throw new NullPointerException("handler");
if (config == null) {
config = getDefaultConfig();
}
if (address != null && !(addre... | 7 |
protected Transition initTransition(State from, State to)
{
return new MooreTransition(from, to, "");
} | 0 |
@Override
public Object clone() throws CloneNotSupportedException {
Student1 student1 = (Student1)super.clone();
student1.setT1((teacher)student1.getT1().clone());
return student1;
} | 0 |
private void planForAgent(Agent agent)
{
TaskDispenser td = agent.td;
Node node = agent.node;
// Remove completed task from queue
if (agent.request != null) {
if (agent.request.requestBox.atField == agent.request.requestGoal) {
agent.request = null;
// System.err.println("Completed request");
... | 9 |
private boolean jj_2_8(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_8(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(7, xla); }
} | 1 |
public static ArrayList LexBFS(Graph G, Partition P){
ArrayList sigma = new ArrayList();
System.out.println();
System.out.println("STEP A: Let L be the one element ordered list (V)");
System.out.println("L => (" + P.toString() + ")\n");
System.out.println("STEP B: i 1 to " + G.cardV() + "\n");
int i = 1;... | 8 |
public boolean isSetMethodPresentFor(Field field) {
FieldStoreItem item = store.get(FieldStoreItem.createKey(field));
if(item != null) {
return item.getSetMethod() != null ? true : false;
}
return false;
} | 2 |
public static String caesarianShift(String code, int shift) {
char[] codeline = code.toCharArray();
String result = "";
for(int i = 0; i < codeline.length; i++) {
if(codeline[i] >= 'a' && codeline[i] <= 'z') {
if(codeline[i] + shift > 'z') codeline[i] = (char) (('a' -... | 8 |
public final void addSlider(BufferedImage i)
{
TButton slider;
if (i != null)
slider = new TButton(0, 0, i);
else
slider = new TButton(0, 0, 1, 1, "");
sliders.add(slider);
if (i == null)
setSliderImage(sliders.size() - 1, i);
int sWidth = slider.getWidthI();
int sHeigh... | 5 |
static long solve(int l, int prev, int acum) {
if (l == k)
return 1L;
if ((s - acum) > (k - l) * n)
return 0L;
if (dp[l][prev][acum] != -1L)
return dp[l][prev][acum];
long ans = 0;
int min = Math.min(n, s - acum - (k - l - 1) * n);
min = Math.max(min, prev + 1);
int max = Math.max(0, (s - acum) -... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof ElectricLocomotive))
return false;
ElectricLocomotive other = (ElectricLocomotive) obj;
if (batteryVolume != other.batteryVolume)
return false;
return true;
} | 4 |
public void move()
{
animation = (animation + 1) % 50;
x -= left? speed:0;
x += right? speed:0;
y -= up? speed:0;
y += down? speed:0;
if ( x < 0 )
x = 0;
if ( x + width > 800 )
x = 800 - width;
if ( y + height > 600 )
... | 9 |
protected void createTradingInventories()
{
int rows = 4;
int rowsP1 = getAllowedGuiRows(p1);
int rowsP2 = getAllowedGuiRows(p2);
if (rowsP2 > rowsP1) {
if (plugin.yamlHandler.configYaml.getBoolean("use_biggest", true))
rows = rowsP2;
else {
rows = rowsP1;
}
}
... | 3 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | 0 |
public void refreshNickname() {
AbstractTab tab = InputHandler.getActiveTab();
if (tab != null) {
String nick = tab.getServerTab().getConnection().getNick();
setText(nick);
}
} | 1 |
public void register(Object value) {
if (JSONzip.probe) {
int integer = find(value);
if (integer >= 0) {
JSONzip.log("\nDuplicate key " + value);
}
}
if (this.length >= this.capacity) {
compact();
}
this.list[this.le... | 4 |
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... | 6 |
@Override
public void actionPerformed(ActionEvent e) {
if ( e.getSource() == certifications ) {
switchContentPanel(new EditCertificationsPanel());
} else if ( e.getSource() == users ) {
switchContentPanel(new EditUsersPanel());
} else if ( e.getSource() == tools ) {
switchContentPanel(new Edi... | 9 |
@Override
Object writeObject(Map<String, Object> functions, Map<String, Object> model, TemplateMessages messages) throws TemplateException {
String o = (String) functionIdentifier.writeObject(functions, model, messages);
Object fp = functions.get(o);
if (fp == null && functionIdentifier.is... | 9 |
public static void unZiphasDir(String zipFileName, String targetDir) throws Exception {
ZipFile zipFile = new ZipFile(zipFileName, "GBK");
Enumeration emu = zipFile.getEntries();
while (emu.hasMoreElements()) {
ZipEntry entry = (ZipEntry) emu.nextElement();
if (entry.isD... | 6 |
@Override
public void paste(int x, int y, BaseImage img) {
if(img.getMode() != mode) {
img = img.changeMode(mode);
}
if (img.getHeight()+y < 0 || y >= this.height) {
return;
}
if (img.getWidth()+x < 0 || x >= this.width) {
return;
}
int imgXOff = 0;
int imgYOff = 0;... | 9 |
public void update() {
if(autoUpdate == true) {
try {
Updater updater = new Updater(this, "magic-explosion", this.getFile(), Updater.UpdateType.DEFAULT, false);
Updater.UpdateResult result = updater.getResult();
switch(result) {
case SUCCESS:
System.out.println("[M... | 9 |
private void placePlayers(){
for (Player p : players) {
grid.addElement(p);
}
} | 1 |
private static void inputLoop(GUIConsoleInterface console, String prompt) {
Reader input;
input = ((JConsole)console).getIn();
BufferedReader bufInput = new BufferedReader(input);
String newline = System.getProperty("line.separator");
console.print(prompt, Color.BLUE);
String line;
... | 3 |
public static List<String> asArray(final String jsonString) {
if (!jsonString.startsWith("[")) {
throw new IllegalArgumentException(jsonString + " does not appear to be an array");
}
final List<String> elements = new ArrayList<String>();
final StringBuilder sb = new StringBuilder();
int depth = 0;
fo... | 6 |
public QryResult evaluateBoolean (RetrievalModel r) throws IOException {
// Initialization
allocDaaTPtrs (r);
QryResult result = new QryResult ();
// Sort the arguments so that the shortest lists are first. This
// improves the efficiency of exact-match AND without changing
// the result... | 9 |
static private int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(1, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(2, active0);
return 3;
}
switch(curChar)
{
cas... | 9 |
public MazeCell anyIntactNeighbor(MazeCell[] Array){ //Will try to find and choose randomly an intact neighbour with his walls up
//Used when creating a labyrinth
MazeCell randcell = null;
int count = 0;
if(Array.length == 0)
System.out.println("No neighbours");
for(int i = 0; i < Array.lengt... | 9 |
private static void testStructures() {
out.println("Reading test_structures.sdl");
Tag root = null;
try {
root=new Tag("root").read(new InputStreamReader(
Test.class.getResourceAsStream("test_structures.sdl"),
"UTF8"));
} catch(IOException ioe) {
reportException("Problem reading test_st... | 9 |
private MyConnection() {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (ClassNotFoundException ex) {
Logger.getLogger(MyConnection.class.getName()).
log(Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
Lo... | 4 |
@Override
public String toString() {
String sz = "Z[";
String sy = "Y[";
for (E e : controleZ)
sz += e.toString() + ", ";
for (E e : controleY)
sy += e.toString() + ", ";
if (sz.length() > 2)
sz = sz.substring(0, sz.length() - 2);
if (sy.length() > 2)
sy = sy.substring(0, sy.length() - 2);
... | 4 |
public Location(double latitude , double longitude) {
this.latitude = String.valueOf(latitude);
this.longitude = String.valueOf(longitude);
} | 0 |
public int [][] multiResultsetWins(int comparisonColumn, int [][] nonSigWin)
throws Exception {
int numResultsets = getNumResultsets();
int [][] win = new int [numResultsets][numResultsets];
// int [][] nonSigWin = new int [numResultsets][numResultsets];
for (int i = 0; i < numResultsets; i++) {... | 8 |
public void setVSBBottomCorner(Component component) {
if (mVSBBottomCorner != component) {
if (mVSBBottomCorner != null) {
remove(mVSBBottomCorner);
}
mVSBBottomCorner = component;
if (mVSBBottomCorner != null) {
add(mVSBBottomCorner);
}
}
} | 3 |
protected void setColoredExes() {
ArrayList<Excel> temp = PyramidGenerator.generatePyramid4(side, base);
coloredEx.clear();
for(Excel ex: temp)
{
ex.setX(ex.getX() + Dx);
ex.setY(ex.getY() + Dy);
coloredEx.add(ex);
}
} | 1 |
public void tick() {
if (displayedMessage > -1) {
if (!fading) {
displayTicks++;
if (displayTicks == TICKS_PER_MESSAGE) {
displayTicks = 0;
fading = true;
}
} else {
fadingTicks++;
if (fadingTicks == FADE_TICKS) {
fadingTicks = 0;
fading = false;
displayedMessage--;
... | 4 |
public static void h() throws Exception {
try {
f();
} catch (Exception e) {
System.out.println("Inside h(),e.printStackTrace()");
e.printStackTrace(System.out);
throw (Exception) e.fillInStackTrace();
}
} | 1 |
public boolean canHaveAsBalance(BigInteger balance) {
return (balance != null) && (balance.compareTo(this.getCreditLimit()) >= 0);
} | 1 |
public boolean equals(Object object) {
return object == null || object == this;
} | 1 |
public static void main(String[] args) throws Exception {
Command command = processArgs(args, "OpusComment");
OpusFile op = new OpusFile(new File(command.inFile));
if (command.command == Commands.List) {
listTags(op.getTags());
} else {
// Have t... | 3 |
public static int min(int depth, int hardMin){
if (depth == MAX_DEPTH) return evaluate();
int bestScore = Integer.MAX_VALUE;
long[] tempData = data;
String moves = MoveGenerator.getMoves(data);
for (int i = 0; i < moves.length(); i += 4){
data = MoveGenerator.makeMove(moves.substring(i, i + 4), tempData... | 8 |
@Override
public void onTakeStep()
{
// _players[0].setBehaviour(_behaviours[1]);
Queue<Message> messagelist = getTrainerMessages();
while (!messagelist.isEmpty()){
Message message = messagelist.poll();
if (message instanceof MessageEvent) {
MessageEvent messageEvent = (MessageEvent) message;
i... | 7 |
private void colorMidTemp(int i, int j, long temp) {
for (int k = 0; k < tempRangesMid.length; k++) {
if (temp < tempRangesMid[k]) {
drawing.setRGB(i, j, colorRangesMid[k]);
break;
}
}
} | 2 |
public void startMaze() {
for (int i = 0; i < newRun.BOARD_MAX; i++) {
for (int j = 0; j < newRun.BOARD_MAX; j++) {
board[i][j].setBorder(null);
}
}
} | 2 |
public static Keyword uBaseMeasuresSpecialist(ControlFrame frame, Keyword lastmove) {
{ Proposition proposition = frame.proposition;
Stella_Object mainarg = (proposition.arguments.theArray)[0];
Stella_Object mainargvalue = Logic.argumentBoundTo(mainarg);
int value = Stella.NULL_INTEGER;
if ... | 8 |
public static void main(String args[]){
MyDataImpl obj = new MyDataImpl();
obj.print("");
obj.isNull("abc");
} | 0 |
public void searchFor(String key) throws SQLException {
if (dic != null) {
this.key = key;
if (key.isEmpty()) {
ids = dic.getAllIDs();
} else {
ids = dic.searchID(key);
}
for (TableModelListener l : listeners) {
l.tableChanged(new TableModelEvent(this));
}
}
} | 3 |
public void addComment(String path, String... commentLines) {
StringBuilder commentstring = new StringBuilder();
String leadingSpaces = "";
for(int n = 0; n < path.length(); n++) {
if(path.charAt(n) == '.') {
leadingSpaces += " ";
}
}
for(String line : commentLines) {
if(!line.isEmpty()) {
l... | 5 |
public static void saveProperties(Properties props, File propertyFile, String headerText) {
OutputStream out = null;
try {
out = new FileOutputStream(propertyFile);
if (StringUtils.isNotBlank(headerText)) {
props.store(out, headerText);
}
} ca... | 5 |
public ArrayList<ArrayList<String>> partition(String s) {
isPal = new boolean[s.length()][s.length()];
this.s = s;
isPal[0][0] = true;
for (int i = 1; i < s.length(); i++) {
isPal[i][i] = true;
isPal[i - 1][i] = s.charAt(i - 1) == s.charAt(i);
}
... | 4 |
public void saveUndefinedStrings(String path){
if(save){
String stringsToSave = getUndefinedStringsForSave();
if(!stringsToSave.equals("")){
Path p = Paths.get(path);
Path parent = p.getParent();
boolean exists = Files.exists(p);
if(!Files.exists(parent)){
try {
Files.createDirectorie... | 6 |
@Override
protected byte[] load_from_current_position(String frameId, int dataLength, RandomAccessFile openFile) throws IOException {
byte[] frameData=super.load_from_current_position(frameId, dataLength, openFile);
if(frameData==null) {
this.setValue(null);
} else if(frameData.leng... | 2 |
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.