text stringlengths 14 410k | label int32 0 9 |
|---|---|
static String generateEquivalentJoinClause(List<ColumnNode> nodes) {
if (nodes.isEmpty()) {
return "";
}
Set<String> tableNames = new LinkedHashSet<String>();
ListMap columnMap = new ListMap();
for (ColumnNode node : nodes) {
final String tableName = node.... | 8 |
public void DisplayCluster()
{
System.out.printf("%s\n", CurrentCluster);
for (int x = 0; x < GetCluster().getChild().length; x++)
{
System.out.printf("%s\n", SectorDetails(x));
for (int y = 0; y < GetSector(x).getChild().length; y++)
{
System.out.printf("%s\n", StarDetails(x,y));
for (int z = 0... | 5 |
private final void method3970(int i) {
if (aBoolean9911)
OpenGL.glPopMatrix();
anInt9840++;
if (i != 1)
method3950(69);
if (!((NativeToolkit) this).aClass196_8184.method1450(-98)) {
if (((NativeToolkit) this).aBoolean8069) {
OpenGL.glLoadIdentity();
aBoolean9911 = false;
} else {
OpenGL.gl... | 6 |
private boolean enemyAttackCollision(AnimationCommands commands){
CollisionResults results = new CollisionResults();
BoundingVolume bv = ((Node)spatial).getChild("Ninja").getWorldBound();
getEnemyModels().collideWith(bv, results);
if(results.size() > 0){
Str... | 9 |
@Override
public void valueUpdated(Setting s, Value v) {
String setting = s.getName();
if (setting.equals(Mode)) {
try {
TimerMode m = (TimerMode) v.getEnum();
if (timerMode_ != m) {
timerMode_ = m;
if (m == TimerMode.INFINITE) {
stopper_ = addInput(Stopper, ValueType.VOID);
stoppe... | 4 |
public SmallToken scan() throws IOException {
// 去掉空字符
for ( ; ; readch()) {
if (peek == ' ' || peek == '\t') continue;
else if (peek == '\n') line = line + 1;
else break;
}
// 特殊符号的情况
/*
switch (peek) {
case '&':
if (readch('&')) return Word.And;
else return new Token('&');
case '|':
... | 9 |
private void initComponents() {
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
selectSectionLbl = new JLabel();
sectionScrollPane = new JScrollPane();
sectionListTable = new JTable();
enterMotherLangWordLbl = new JLabel();
enterTranslationLbl = new JLabel(... | 4 |
public String eventDescription(Event e){
//by Budhitama Subagdja
String desc = "";
desc = desc + "At (" + e.x + "," + e.z +") ";
desc = desc + "Health: " + e.curHealth + " ";
if(e.emeDistance<1){
desc = desc + "Enemy Detected! Distance: " + e.emeDistance;
}
desc = desc + "\n";
if... | 9 |
public CategorizedAndroidSourceSinkParser(Set<CATEGORY> categories, String filename, boolean isSources, boolean isSinks){
this.categories = categories;
this.fileName = filename;
this.isSources = isSources;
this.isSinks = isSinks;
} | 0 |
@Override
public void setValueAt(Object value, int rowIndex, int columnIndex) {
switch (columnIndex) {
case 0:
isFileSelected.put(user.getFiles().get(rowIndex), (Boolean) value);
break;
case 5:
user.getFiles(... | 2 |
protected void doPaethLine(byte[] curLine, byte[] prevLine) {
// get the number of bytes per sample
int sub = (int) Math.ceil((getBitsPerComponent() * getColors()) / 8.0);
for (int i = 0; i < curLine.length; i++) {
int left = 0;
int up = 0;
int upLe... | 5 |
public void rescan()
{
rescanButton.setEnabled(false);
// get the shared data structure
WizardData data = this.getWizardData() ;
if ( data != null )
{
// get the Project
TProject dummy = ( TProject ) data.getData() ;
// project data
TProjectData pdat = dummy.getProjectDa... | 4 |
public void insertarExtraccion()
{
ArrayList nom = new ArrayList();
nom.add(this.nombre_proyecto);
extraccion.insertarRegistros("proyecto", nom);
int ultimoReg = extraccion.extraerUltimoRegistro("proyecto", camposProyecto);
this.id_proyecto=ultimoReg;
ArrayLi... | 7 |
public static RoomType randomRoom(int fullMapSize) {
int x = 0;
while (x == 0) {
Iterator<RoomType> it = roomGenList.iterator();
while (it.hasNext()) {
RoomType room = it.next();
if (room.getPercentageGen() == 0) {
it.remove();
... | 7 |
void onDestroy()
{
String tableName;
setSelectAll(false);
queryBuilderPane.sqlDiagramViewPanel.removeAllRelation(this);
queryBuilderPane.sqlBrowserViewPanel.removeFromClause(tableToken);
QuerySpecification qs = queryBuilderPane.sqlBrowserViewPanel.getQuerySpecification();
if (tableToken.isAliasS... | 9 |
public ViewController(GameController game, JFrame frame){
this.game2 = game;
//pause game when frame looses focus
frame.requestFocus();
frame.addFocusListener(new FocusListener(){
@Override
public void focusGained(FocusEvent e) {
for (Player p: game2.getPlayers()){
p.resetSpeed();
... | 5 |
public static int utf8EncodingSize(int ch) {
if (ch <= 0x007f)
return 1;
else if (ch > 0x07ff)
return 3;
return 2;
} | 2 |
public void addOptions(CmdLineOption... options) {
for (CmdLineOption option : options) {
addOption(option);
}
} | 1 |
public static void main(String args[]) {
Logger log = Logger.getLogger("MAIN");
Properties pt = new Properties();
try
{
pt.load(new FileInputStream(args[0]));
}catch (IOException ioe)
{
log.fatal("Couldn't load the config file!");
log.fatal("Us... | 4 |
private void setupTimer(int fps) {
if (!(fpsTimer == null) && fpsTimer.isRunning()) fpsTimer.stop();
fpsTimer = new Timer(fps, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
repaint();
}
});
fpsTimer.start();
} | 2 |
@Test
public void test_numberOfPawns() {
assertNotNull(board);
assertEquals(numberOfPawns, board.numberOfPawns());
} | 0 |
public static void setColor(String nom, int color) {
Connection con = null;
try {
Class.forName("org.sqlite.JDBC");
con = DriverManager.getConnection("jdbc:sqlite:" + Parametre.workspace + "/bdd_models");
Statement stmt = con.createStatement();
String query = "select nom from modeles where nom=\"" + nom... | 4 |
public String getLongDescription()
{
String longRoom = "You are " + description + ".\n" + getExitString();
String itemList = items.size() > 0 ? "\nItems: " + items.get(0) : "";
String charList = characters.size() > 0 ? "\nCharacters: " + characters.get(0) : "";
if(items.size() > 1) {... | 6 |
public String[] loadAllBoardData() {
if (pathLocation == null) {
System.out.println("No loaded Path Location");
return new String[1];
}
// Ensures the filename matches the sudoku format //
String[] loadedData = null;
String[] parseFiles = pathLocation.split("\\.");
if (parseFiles.length == 2 ... | 8 |
private boolean prefers(Object x, Object y) throws Exception{
IPersistentSet xprefs = (IPersistentSet) getPreferTable().valAt(x);
if(xprefs != null && xprefs.contains(y))
return true;
for(ISeq ps = RT.seq(parents.invoke(y)); ps != null; ps = ps.next())
{
if(prefers(x, ps.first()))
return true;
}
for(ISeq... | 6 |
public Pair<String,Node> rewriteExpression(String expr, XVariableContext varContext, XNamespaceContext nsContext) throws XPathException {
this.varContext = varContext;
this.nsContext = nsContext;
String rewrittenExpression = expr;
Node dominantNode = null;
// Split into subexpressions
... | 9 |
public void Control () {
String mess;
do {
mess= receive();
if (mess.equals("1")){
LCD.drawString("it works!", 2, 2);
//Location();
//set the return values
//FlowOut.writeBytes("Message")
}else if (in.equals("2")){
//getMap();
... | 5 |
public void printDocumentTopics (File file, double threshold, int max) throws IOException {
PrintWriter out = new PrintWriter(file);
out.print ("#doc source topic proportion ...\n");
int docLen;
int[] topicCounts = new int[ numTopics ];
IDSorter[] sortedTopics = new IDSorter[ numTopics ];
for (int topic =... | 9 |
public void testConstructor_ObjectStringEx2() throws Throwable {
try {
new TimeOfDay("1970-04-06T+14:00");
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
private boolean onlyButtonOne( MouseEvent e ){
if( e.getButton() == MouseEvent.BUTTON1 ){
int modifiers = e.getModifiersEx();
int mask = MouseEvent.BUTTON2_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK |
MouseEvent.SHIFT_DOWN_MASK | MouseEvent.CTRL_DOWN_MASK | MouseEvent.ALT_DOWN_MASK |
MouseEvent.ALT_GR... | 1 |
public Value<?> readValue () throws IOException {
final Value<?> val = readValueRec();
if (val == BVOID) {
throw new IOException("Unexpected end value");
}
return val;
} | 3 |
public static void main(String[] args) {
Connection con = null;
Statement st = null;
ResultSet rs = null;
String url = "jdbc:postgresql://localhost/postgres";
String user = "postgres";
String password = "super";
try {
con = DriverManager.getConnect... | 9 |
public GithubExploreMessage parse(String path) throws FileNotFoundException, IllegalArgumentException {
// If we don't have a path to anything, no point in continuing.
if (Strings.isEmpty(path)) {
throw new IllegalArgumentException("Path is Null or Blank");
}
File file = new... | 3 |
public void putAll(Map<? extends String, ? extends V> m) {
// TODO Auto-generated method stub
if (m != null && !m.isEmpty()) {
for (Entry<? extends String, ? extends V> entry : m.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}
} | 7 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
while ((line = in.readLine()) != null && line.length() != 0) {
if(line.equals("0"))
break;
int n = Integer.p... | 8 |
static float lpc_from_data(float[] data, float[] lpc, int n, int m){
float[] aut=new float[m+1];
float error;
int i, j;
// autocorrelation, p+1 lag coefficients
j=m+1;
while(j--!=0){
float d=0;
for(i=j; i<n; i++)
d+=data[i]*data[i-j];
aut[j]=d;
}
// Generate ... | 8 |
private void validateRestrictions(String rql) {
char chr = '-';
Stack<Integer> stack = new Stack<Integer>();
Integer integer = Integer.valueOf(0);
boolean isString = false;
for (int i = 0; i < rql.length(); i++) {
chr = rql.charAt(i);
... | 9 |
@Test(expected = ProcessRollbackException.class)
public void testRollbackFail1() throws InvalidProcessStateException, ProcessExecutionException,
InterruptedException, ExecutionException, ProcessRollbackException {
// test executed component (execution completed)
IProcessComponent<Void> decoratedComponent = Tes... | 5 |
private boolean processData(RdpPacket_Localised data, int[] ext_disc_reason)
throws RdesktopException, OrderException {
int data_type, ctype, clen, len, roff, rlen;
data_type = 0;
data.incrementPosition(6); // skip shareid, pad, streamid
len = data.getLittleEndian16();
data_type = data.get8();
ctype = d... | 7 |
public void dispatcherMessage(String message) {
StringTokenizer stringTokenizer = new StringTokenizer(message, "@");
String source = stringTokenizer.nextToken();
String owner = stringTokenizer.nextToken();
String content = stringTokenizer.nextToken();
... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof MyString)) {
return false;
}
MyString other = (MyString) obj;
if (name == null) {
if (other.name != null) {
return false;
}
} else... | 6 |
public User addUser(boolean newDB)
{
String input = null;
if (newDB)
{
input = JOptionPane.showInputDialog(new JFrame(),
"Could not find any User, please add a new one. Username: ",
"Add User", JOptionPane.PLAIN_MESSAGE);
if(input == null)
System.exit(0);
while (input.equals(""))
{
... | 7 |
public JSONObject processLoginTag(String email,String password)
{
try {
Class.forName(JDBC_DRIVER);
conn=DriverManager.getConnection(DB_URL,USER,PASS);
stmt=conn.createStatement();
String sql="Select * from LOGIN_INFO where EMAIL='"+email+"'";
rs=stmt.executeQuery(sql);
json=new JSONOb... | 9 |
public void move(){
if(getDirection() == Moveable.RIGHT && getX() + getWidth() < Board.WIDTH)
setX(getX() + 2);
else if(getDirection() == Moveable.LEFT && getX() > 0)
setX(getX() - 2);
else if(getDirection() == Moveable.UP && getY() > 0)
setY(getY() - 2);
else if(getDirection() == Moveable.DOWN && getY... | 8 |
static String extractVariableName(String variable) {
if (variable == null || variable.startsWith(":") == false || variable.length() < 2) {
throw new IllegalArgumentException("Argument is not a variable (starting with a colon)");
}
String postColon = variable.substring(1);
if (postColon.startsWith(... | 5 |
public boolean isLand() {
switch(value) {
case 12: case 13: case 14: case 15: return false;
default: return true;
}
} | 4 |
public void finish() throws IOException {
int err;
do{
z.next_out=buf;
z.next_out_index=0;
z.avail_out=bufsize;
if(compress){ err=z.deflate(JZlib.Z_FINISH); }
else{ err=z.inflate(JZlib.Z_FINISH); }
if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK)
throw new ZStreamExcep... | 7 |
public KDPoint vecinoMasCercano(KDNode node, KDPoint q) {
KDNode farNode = null;
if (node.isLeaf()) {
updateIfBest(node.getPoint(), q);
return mejorActual;
} else if (node.greaterThanAxis(q)) {
vecinoMasCercano(node.getRight(), q);
farNode = node.... | 4 |
public int blockType(final Block block) {
if (loopEdgeModCount != edgeModCount) {
buildLoopTree();
}
return block.blockType();
} | 1 |
public void start(ServerHandler serverHandler){
if (!idleThreads.isEmpty()) {
WorkerThread borrowedThread = this.borrowThread();
borrowedThread.setTask(serverHandler);
} else {
WorkerThread newThread = new WorkerThread(serverHandler);
newThread.start();
}
} | 1 |
protected final void addSchedulerListener( Class<? extends SchedulerListener> schedulerListenerType )
{
doBind( schedulerListeners, schedulerListenerType );
} | 1 |
public void setDirty(final boolean dirty) {
this.isDirty = dirty;
if (isDirty == true) {
this.editor.setDirty(true);
}
} | 1 |
@BeforeClass
public static void setUpClass() throws Exception {
} | 0 |
@Test
public void saveLoadMatch(){
InputStream is = LoadGame.class.getResourceAsStream("standardMap.xml");
File targetFile = null;
File saveFile = new File(System.getProperty("user.home"),"testSaveGame.xml");
byte[] buffer;
try {
buffer = new byte[is.available()];
is.read(buffer);
targetFile = new... | 4 |
public JLabel getjLabelVille() {
return jLabelVille;
} | 0 |
public static void checkMethodTypeSig(String typesig)
throws IllegalArgumentException {
try {
if (typesig.charAt(0) != '(')
throw new IllegalArgumentException("No method signature: "
+ typesig);
int i = 1;
while (typesig.charAt(i) != ')')
i = checkTypeSig(typesig, i);
// skip closing pare... | 5 |
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] A = new int[n];
for(int i=0;i<n;i++){
A[i]=in.nextInt();
}
int[] results = mergeSort(A, 0, n-1);
for(int i:results)
System.out.println(i);
} | 2 |
public static void swap()
{
if(isTwoPlayers)
{
readyToSwap = false;
swappingNow = true;
game.swapStates();
}
} | 1 |
public void update(InputHandler input) {
if(input.up)hero.y -= hero.speed;
if(input.down)hero.y += hero.speed;
if(input.left)hero.x -= hero.speed;
if(input.right)hero.x += hero.speed;
} | 4 |
public String alphabetizeYourName(String first, String middle, String last)
{
String nameInOrder = "";
if (first.compareTo(middle) < 0)
{
if (first.compareTo(last) < 0)
{
if (middle.compareTo(last) < 0)
{
nameInOrder = first = ", " + middle + ", " + last;
}
else
{
nameInOrder... | 5 |
public Object getValueAt(int rowIndex, int columnIndex) {
TableRow row = m_rows.get(rowIndex);
switch (columnIndex) {
case 0:
return row.m_user1 + " v. " + row.m_user2;
case 1:
Generation gen = m_link.getGenerations()[row.m_generation];
... | 8 |
private synchronized SSLSocketFactory sfac() {
if(sfac == null)
sfac = ctx().getSocketFactory();
return(sfac);
} | 1 |
public EarthCreep(int id){
if (id > 0 && id < 4){
if (id == 1){
maxHp = 50;
armor = 10;
speed = 3f;
}else if (id == 2){
maxHp = 500;
armor = 15;
... | 5 |
public Laser getLaser(Sprite laserParent){
for(int i = 0; i < lasers.size(); i++){
Sprite p = (Sprite) lasers.get(i).parent;
if(p == laserParent){
return (Laser)lasers.get(i);
}
}
return null;
} | 2 |
private boolean r_mark_suffix_with_optional_y_consonant() {
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
// (, line 153
// or, line 155
lab0: do {
... | 9 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected==null)||(!(affected instanceof MOB))||(target==null))
return super.okMessage(myHost,msg);
final MOB mob=(MOB)affected;
if(msg.amISource(mob)
&&(msg.amITarget(target))
&&(msg.targetMinor()==CMMsg.TYP_DAMAGE))
... | 8 |
public boolean dfs(int k){
if(k > 325) return true;
int s = Integer.MAX_VALUE, c = 0;
for(int t = R[Head]; t != Head; t = R[t]){
if(S[t] < s){
s = S[t];
c = t;
}
}
if(c == 0) return true;
remove(c);
for(int i = D[c]; i != c; i = D[i]){
int t = (i - 325) / 4;
oridata[t / 9] = (char)(t %... | 8 |
public boolean validPixel(int x, int y) {
return y >= 0 && y < height && x >= 0 && x < width;
} | 3 |
public void deParse(AlterFuzzyDomain alterFuzzyDomain) {
buffer.append("CREATE FUZZY DOMAIN ")
.append(alterFuzzyDomain.getName());
ExpressionDeParser expressionDeParser = new ExpressionDeParser(null, buffer);
if (null != alterFuzzyDomain.getAddValues()) {
buffer.append... | 8 |
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if (source.equals(input)) {
String line = input.getText().trim();
if (line.length() > 0) {
mainFrame.parseCmd(line);
resetLine();
addCmdToHistory(line);
}
}
} | 2 |
public void Agility(String message, int newX, int newY, int lvlReq, int XPgained, int delay, int emote) {
if(AgilityTimer == 0) {
if(playerLevel[16] >= lvlReq) {
sendMessage(message);
addSkillXP(XPgained, 16);
teleportToX = newX;
teleportToY = newY;
AgilityTimer = delay;
setAnimation(emote);
upd... | 3 |
final public void Parameter() throws ParseException {
/*@bgen(jjtree) Parameter */
SimpleNode jjtn000 = new SimpleNode(JJTPARAMETER);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
Identifier();
} catch (Throwable jjte000) {
... | 8 |
@Override
protected ManifestEntry parseManifestEntryLine(String pLine, int lHighestSequencePosition)
throws ExParser, ExManifest {
ManifestEntry lManifestEntry = ManifestEntry.parseManifestFileLine(pLine, true);
//Validate that sequence values are properly sequential
if(lManifestEntry.getSequ... | 4 |
private Connection getConnection() throws LoginException {
final String dsJndi = this.getProperty(PARAM_DATASOURCE_JNDI);
final String dbUser = this.getProperty(PARAM_DB_USER);
final String dbPassword = this.getProperty(PARAM_DB_PASSWORD);
try {
/*String nonTxJndiName = dsJn... | 3 |
public static void loadBill(String path){
tableData=xmlHandler.XMLHandler.readXML(path);
total=0;
for (int i=0;i<tableData.length;i++){
total+=(Integer)(tableData[i][2])*(Integer)(tableData[i][3]);
}
} | 1 |
@Override
public void createSymbolicLink(String source, String destination) throws PathNotFoundException, SourceAlreadyExistsException, AccessDeniedException, UnsupportedFeatureException {
if (symlinks)
{
try {
if (pathExists(source))
throw new SourceAlreadyExistsException();
innerFs.createFile(sou... | 5 |
public double getSTDofDuration(RequestType type)
{
long temp = 0;
int cnt = 0;
double mean = getMeanofDuration(type);
switch (type) {
case ONDEMAND:
for (OndemandRequest on : getOndemand()) {
long duration = on.getDuration();
temp += (mean - duration) * (mean - duration);
cnt++;
}
break;... | 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://down... | 6 |
public static int login(String username, String password) {
DBHelper db = DBHelperFactory.createDBHelper();
Account temp = db.retrieveAccount(username);
if (temp == null) {
return -1;
}
String passHash = "";
try {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = dig... | 5 |
public void setValue(Keyword key, String value) {
if (key.equals(Keyword.CONTENT)) {
content = value;
} else if (key.equals(Keyword.START)) {
start = value;
} else if (key.equals(Keyword.END)) {
end = value;
} else if (key.equals(Keyword.TYPE)) {
... | 7 |
private static boolean isDataCorrect(ParticleEffect effect, ParticleData data) {
return ((effect == BLOCK_CRACK || effect == BLOCK_DUST) && data instanceof BlockData) || (effect == ITEM_CRACK && data instanceof ItemData);
} | 4 |
public Integer getEnd()
{
if (end != null)
if (end < 0 || end > 100)
throw new RuntimeException("end取值范围0~100!");
return end;
} | 3 |
@Override
public void setMobile(String mobile) {
super.setMobile(mobile);
} | 0 |
private static ArrayList findModeAverage(int[] array, int size, int highestNumber) {
ArrayList positionsOfModeValues = new ArrayList();
int highestFrequency = 0;
int[] frequencyOf = new int[highestNumber+1];
for (int i=0; i<size; i++) {
int c... | 3 |
public int createExchangeUsersBatch(List<VaultUser> users)
{
int recAdded = 0;
Connection con = null;
java.sql.PreparedStatement psExchangeUser = null;
java.sql.PreparedStatement psLoginData = null;
String psVaultUserSql = "INSERT INTO Users (" +
"UserID,"+
"Email,"+
"ForeName,"+
"Last... | 7 |
public void sortLabs(){
ArrayList<Timeslot>overfilledLabs;
for(Student s: students){
if(!s.getFlaggedForLabs()){
s.setAssignedLab(s.getCombinedLabs().get(0));
s.getCombinedLabs().get(0).addStudent(s);
}
}
Student currentStudent;
overfilledLabs=overFilledLabs();
while(!overfilledLabs.isEmpty(... | 8 |
public final void run() throws FatalError, RestartLater, JSONException {
BefehlFile file = new BefehlFile();
JSONObject now = file.getBefehl();
while (now != null) {
printJump("(hole einen)");
PlanObject doit = PlanObject.get(now);
doit.run();
now = file.getBefehl();
}
printJump("(nichts)");
} | 1 |
public boolean isAvailableAt(Date targetDay) {
RosterAvailability ra = checkAvailability (targetDay);
if (ra == null)
return false;
if ((ra.getAvailabilityCode().equals(RosterAvailability.ROSTER_AVAILABLE)) ||
(ra.getAvailabilityCode().equals(RosterAvailability.ROSTER_OFFICE)))
return true;
re... | 3 |
public boolean validAttack(int myXCoor, int myYCoor, int targXCoor, int targYCoor, Board board){
int offset = -1; //Can only move forward
if (COLOR.equals("B"))
offset = 1;
if (myYCoor + offset == targYCoor && Math.abs(myXCoor - targXCoor) == 1)
return true;
else{
return false;
}
} | 3 |
public int getRawValue() {
switch (this.type) {
case GPR: return this.register.ordinal();
case GPR_DEREF: return 0x08 + this.register.ordinal();
case GPR_RELATIVE_DEREF: return 0x10 + this.register.ordinal();
case SPR: return this.value;
case CONST_DEREF: r... | 6 |
private void btnCerrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarActionPerformed
setVisible(false);
}//GEN-LAST:event_btnCerrarActionPerformed | 0 |
private static WebDriver createLocalDriver(Capabilities capabilities) {
String browserType = capabilities.getBrowserName();
if (browserType.equals("firefox"))
return new FirefoxDriver(capabilities);
if (browserType.startsWith("internet explorer"))
return new InternetExplorerDriver(capabilities);
if (brows... | 4 |
private void deleteZIP(String fileName) {
File f = new File(getCacheDir() + fileName);
if (!f.exists())
throw new IllegalArgumentException(
"Delete: no such file or directory: " + fileName);
if (!f.canWrite())
throw new IllegalArgumentException("Delete: write protected: " + fileName);
if (f... | 5 |
public void save(File file) throws IOException {
boolean jar = file.getName().endsWith(".jar") || file.getName().endsWith(".zip");
if(jar) {
File temp = new File("./temp" + System.currentTimeMillis() + "/").getCanonicalFile();
loader.setOutputDir(temp);
commit();
JarOutputStream jos = new JarOut... | 2 |
public static L2PcInstance getRandomPlayer(L2Npc npc)
{
List<L2PcInstance> result = new ArrayList<>();
for (L2PcInstance player : npc.getKnownList().getKnownType(L2PcInstance.class))
{
if (player.isDead())
continue;
if (player.isGM() && player.getAppearance().getInvisible())
continue;
... | 5 |
public static BuildContoursFlags swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) {
return swigValues[swigValue];
}
for (int i = 0; i < swigValues.length; i++) {
if (swigValues[i].swigValue ==... | 5 |
public void broadcast(Event event) {
for(IModule listener : registeredObjects) {
if(event.getOrigin() == listener) continue;
listener.recieveEvent(event);
}
} | 2 |
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return false;
} | 1 |
public int compare(Object o1, Object o2) {
String str1=(String) o1;
String str2=(String) o2;
int index1=str1.indexOf("/");
String loc1=str1.substring(index1+1);
int index1_1=loc1.indexOf(",");
int lc1_1=Integer.parseInt(loc1.substring(0,index1_1));
int lc1_2=Integer.parseInt(loc1.substring(index1_1+1));
... | 1 |
public void drawBackgroundStars(Graphics g) {
int numStarsToFar = 0;
Object[] bgStars = bgStarMap.keySet().toArray();
//count the number of bg stars out of range
for (int i = 0; i < bgStars.length; i++) {
Pair key = (Pair) bgStars[i];
int x = (int) key.getFirst()... | 6 |
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.