text stringlengths 14 410k | label int32 0 9 |
|---|---|
public JSONArray names() {
JSONArray ja = new JSONArray();
Iterator keys = this.keys();
while (keys.hasNext()) {
ja.put(keys.next());
}
return ja.length() == 0 ? null : ja;
} | 2 |
private String AddByBit(String str1, String str2)
{
StringBuffer sumBuffer = new StringBuffer();
for(int i = 0; i < str1.length(); ++i)
{
if(str1.charAt(i) == str2.charAt(i))
{
sumBuffer.append("0");
}
else
{
sumBuffer.append("1");
}
}
return sumBuffer.toString();
} | 2 |
public void printMetadataInfo() throws IOException {
if (flac instanceof FlacOggFile) {
FlacOggFile ogg = (FlacOggFile)flac;
System.out.println("FLAC-in-Ogg, in stream " + ogg.getSid());
} else {
System.out.println("FLAC Native");
}
// Output The info... | 3 |
public static void toggleMoveableInheritance(Node currentNode, JoeTree tree, OutlineLayoutManager layout) {
CompoundUndoablePropertyChange undoable = new CompoundUndoablePropertyChange(tree);
JoeNodeList nodeList = tree.getSelectedNodes();
for (int i = 0, limit = nodeList.size(); i < limit; i++) {
toggleMov... | 3 |
Point3f[] getFaceVertices(byte face) {
if (faceVertices == null) {
faceVertices = new Point3f[4];
for (int i = 0; i < 4; i++)
faceVertices[i] = new Point3f();
}
float x = Math.abs(corner.x);
float y = Math.abs(corner.y);
float z = Math.abs(corner.z);
switch (face) {
case FRONT:
faceVertices[0... | 8 |
public SecuredMessageTriggerBean execute(SecuredMessageTriggerBean message) throws GranException {
ArrayList<String> possibleHandlers = new ArrayList<String>();
List<String> users = KernelManager.getStep().getHandlerList(message.getMstatusId(), message.getTaskId());
for (String userId : users) ... | 5 |
public MapObject[] getCollisionObject(Rectangle rect) {
List<MapObject> objects = new ArrayList<MapObject>();
// Iterate through the layers
for (int i = 0; i < layers.size(); i++) {
// Get the layer
Layer layer = layers.get(i);
// Is it an object group?
if (layer instanceof ObjectGroup) {
// We ... | 6 |
public void analyzeInnerClasses(ProgressListener pl, double done,
double scale) {
double subScale = scale / innerComplexity;
// If output should be immediate, we delay analyzation to output.
// Note that this may break anonymous classes, but the user
// has been warned.
if ((Options.options & Options.OPTIO... | 5 |
public static Rule_dirMethod parse(ParserContext context)
{
context.push("dirMethod");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>();
... | 7 |
@Override
public void insert(String key) {
totOps++;
if (find(key))
return;
if (isOverLoaded(numElements + 1))
increaseTable();// Increase table size if table will be overloaded.
int hCode = hashCode.giveCode(key);
int compKey = compressKey(hCode);
totProb++;
if (table[compKey] == null || table[... | 7 |
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
JButton button = (JButton) evt.getSource();
if ("启动评价".equals(button.getText())) {
jButton4.setText("暂停评价");
flagComment = ... | 9 |
public void setSelectedItem(Object element) {
if (element == null) {
if (elementIndex != -1) {
elementIndex = -1;
fireContentsChanged(this, -1, -1);
}
} else if (element instanceof String) {
for (int i=0; i<elementTypeStrings.length; i+... | 6 |
public void getTaskData(int pos, TaskDesc td, Task task) {
if (task.taskMD.parent != null && task.numParentDataRecv < task.taskMD.parent.size()) {
String data = requestData(task.taskId, task.taskMD.parent.get(pos), td,
task.taskMD.dataSize.get(pos), task.taskMD.dataNameList.get(pos));
while (data != null &&... | 9 |
private void removeOldChildren()
{
Map<String, Object> attributes = component.getAttributes();
List<String> currentComponents = createdComponents;
// Get the old list of created component ids and update the current list as a
// component attribute
Object oldValue;
i... | 9 |
public void addNotification(String[][] map, TrayPlugin trayplugin, int delay) {
String title = "", subtitle = "", message = "", time = "", icon = "";
for(String[] values: map) {
if(values[0].equals("title")) {
title = values[1];
} else if(values[0].equals("subtitle")) {
subtitle = values[1];
} e... | 8 |
public int update() throws SQLException {
StringBuilder sb = new StringBuilder();
if (commentLine != null) {
sb.append("/* ").append(commentLine).append(" */");
}
sb.append("update " + TABLENAME + " set ");
int i = 1;
List<Object> list = new ArrayList<Object>();
for (Fields hf : fieldValueMap.keySet())... | 9 |
@Override
public void paint(Graphics g) {
Color colores[] = new Color[6];
colores[0] = Constantes.COLOR_CIC_0;
colores[1] = Constantes.COLOR_CIC_1;
colores[2] = Constantes.COLOR_CIC_2;
colores[3] = Constantes.COLOR_CIC_3;
colores[4] = Constantes.COLOR_CIC_4;
colores[5] = Constantes.COLOR_CIC_5;
super.pain... | 7 |
@Override
public boolean hitField(int x, int y) {
Field tolook = getFields()[y][x];
if(tolook.getBattleState() == null)
{
if (tolook.getFieldState() == eFieldState.Empty) {
tolook.setBattleState(eFieldBattleState.Missed);
return false;
... | 2 |
@Override
public void keyPressed(KeyEvent e) {
int keyCode = e.getKeyCode();
// Controls for player 1
if(keyCode == KeyEvent.VK_W) {
GameMaster.player.moveUp = true;
}
if(keyCode == KeyEvent.VK_S) {
GameMaster.player.moveDown = true;
}
// Controls for player 2
if(keyCode == KeyEvent.VK_UP... | 5 |
void setParameter(int position, Object value) {
if (position >= 0 && position < values.length) {
values[position] = value;
}
} | 2 |
private String getPage(int page, Map<String, Object> map) {
int factor = 5;
int index = (page - 1) * factor;
int listSize = map.size();
if (index > listSize) {
return "";
}
int upper = index + factor;
if (upper >= listSize) {
upper = listSi... | 6 |
private static void runTests(){
if(!initializationTests()) return;
if(!insertTests()) return;
if(!selectTests()) return;
if(!updateTests()) return;
if(!deletionTests()) return;
if(!shutdownTests()) return;
} | 6 |
public Habitat getHabitatByOwner(String owner) {
for (Habitat h : getHabitats().values()) {
if (h != null)
if (h.getOwner().equalsIgnoreCase(owner)) return h;
}
return null;
} | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (getClass() != obj.getClass())
return false;
Path other = (Path) obj;
if (endPoint == null) {
if (other.endPoint != null)
return false;
} else if (!endPoint.equals(other.endPoint))
return false;
if (startPoint ==... | 9 |
public static synchronized ConnectionPool getInstance() {
if (instance == null) {
instance = new ConnectionPool();
}//if
return instance;
}//getInstance | 1 |
public static int size(TypeType type) {
switch (type) {
case DOUBLE:
case LONG:
return 2;
case INT:
case SHORT:
case CHAR:
case BYTE:
case BOOLEAN:
return 1;
case REF:
case... | 9 |
public Dimension getPreferredSize() {
int x = 0, y = 0;
for (Iterator<ZElement> e = enumElements(); e.hasNext();) {
MPDEntite o = (MPDEntite) e.next();
x = o.getX() + o.getWidth() > x ? o.getX() + o.getWidth() : x;
y = o.getY() + o.getHeight() > y ? o.getY() + o.getHe... | 3 |
private void setTotalRecord(Page<?> page, MappedStatement mappedStatement, Connection connection) {
//获取对应的BoundSql,这个BoundSql其实跟我们利用StatementHandler获取到的BoundSql是同一个对象。
//delegate里面的boundSql也是通过mappedStatement.getBoundSql(paramObj)方法获取到的。
BoundSql boundSql = mappedStatement.getBoundSql(page);... | 6 |
public SolutionState solve(int timeLimit, int bound) {
int n = graph.getNbVertices();
int minCost = graph.getMinArcCost();
int maxCost = graph.getMaxArcCost();
int[][] cost = graph.getCost();
next = new int[n];
Solver solver = new Solver();
// Create variables
... | 6 |
public Monster(int x, int y, String name,int difficulty){
position = new Position(x, y);
this.target = GameManager.getPlayer().get(0);
//Novice
if(difficulty==1){
power = new AtomicInteger(5);
speed = new AtomicInteger(1);
LIFE_MAX = 50;
life = new AtomicInteger(50);
}
//Normal
else if(diffi... | 3 |
private boolean goalReached()
{
if(position[0] == bestgoal[0] && position[1] == bestgoal[1])
{
return(true);
}
else
{
return(false);
}
} | 2 |
private static void method495(char arg0[]) {
int off = 0;
for (int chars = 0; chars < arg0.length; chars++) {
if (Censor.method496(arg0[chars])) {
arg0[off] = arg0[chars];
} else {
arg0[off] = ' ';
}
if (off == 0 || arg0[off] != ' ' || arg0[off - 1] != ' ') {
off++;
}
}
for (int chars... | 6 |
public GuiTest() {
addMenu();
// addToolbar();
addCenter();
addStatusbar();
makeVisible();
new Thread() {
@Override
public void run() {
while (true) {
setColor();
try {
Thread.sleep(250);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
p... | 2 |
private static boolean collapseOK(Element e1, Element e2) {
if (e1.getTagName() != e2.getTagName()) return false;
NamedNodeMap nnm1 = e1.getAttributes();
NamedNodeMap nnm2 = e2.getAttributes();
if (nnm1.getLength() != nnm2.getLength()) return false;
for (int i = 0; i < nnm1.getLe... | 6 |
public String displayContent() {
String[] temp = this.content.split(" ");
String toReturn = "";
for (int i = 0; i < temp.length; i++) {
if (i % 20 != 0 || i == 0) {
toReturn += temp[i] + " ";
} else {
toReturn += temp[i] + "\n";
... | 3 |
public static final ByteBuffer getInfoBytes(byte[] torrent_file_bytes) throws BencodingException
{
Object[] vals = decodeDictionary(torrent_file_bytes,0);
if(vals.length != 3 || vals[2] == null)
throw new BencodingException("Exception: No info bytes found!");
return (ByteBuffer)v... | 2 |
public boolean play() {
if (playing()) {
return true;
}
for (int i=0; i<buffers.capacity(); i++) {
if (!stream(buffers.get(i))) {
return false;
}
}
AL10.alSourceQueueBuffers(source.get(0), buffers);
AL10.alSourcePlay(source.get(0));
return true;
} | 3 |
public static Matrix getRotationMatrix(int axis, double angle)
throws IndexOutOfBoundsException {
if (axis < X_AXIS || axis > Z_AXIS)
throw new IndexOutOfBoundsException();
double c = Math.cos(angle);
double s = Math.sin(angle);
Matrix rotate = Matrix.getIdentityMatrix();
switch (axis) {
case X_AXI... | 5 |
private int validaDia( int d ) {
if ( d > 0 && d <= diasPorMes[ mes ] ) return d;
// se Fevereiro: Verifica se ano bissexto
if ( mes == 2 && d == 29 && anoBissexto(ano) )
return d;
System.out.println( "Dia " + d + " invalido. Colocado o dia 1." );
re... | 5 |
public static <T> T[] intern(T[] arr) {
synchronized(ArrayIdentity.class) {
if(cleanint++ > 100) {
clean();
cleanint = 0;
}
}
Entry<T> e = new Entry<T>(arr);
synchronized(ArrayIdentity.class) {
Entry<T> e2 = getcanon(e);
T[] ret;
if(e2 == null) {
set.put(e, e);
ret = arr;
} els... | 3 |
private void lstKullaniciListesiValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_lstKullaniciListesiValueChanged
String kulAdi = (String) lstKullaniciListesi.getSelectedValue();
Musteri m = (Musteri) mutlakkafe.MutlakKafe.
mainCont.getMusteriCon... | 5 |
public String getSessionId() {
return sessionId;
} | 0 |
private int high(int startindex)
{
if (startindex == grades.length-1)
{
return grades[startindex];
}
else
{
int highRest = high(startindex+1);
if (grades[startindex] > highRest)
{
return grades[startindex];
}
else
{
return highRest;... | 2 |
@Override
public String toString() {
if(getDenominator() == 1){
return "" + getNumerator();
}
return "" + getNumerator() + '/' + getDenominator();
} | 1 |
private int sameHandUpdated(ArrayList<Card> c, int recursion) {
ArrayList<Card> cards_tmp = new ArrayList<Card>();
Card yourCard = c.get(0);
if (recursion==1) {
if (c.get(1).getValue()>yourCard.getValue())
yourCard = c.get(1);
cards_tmp.add(yourCard);
for (int i=2; i<c.size(); i++)
cards_tmp.... | 6 |
public boolean createDirs() {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: createDirs() BEGIN");
}
new File(getPath()).mkdirs();
if (test || m_test) {
System.out.println("FileManager :: createDirs() END");
}
return true;
} | 4 |
public static void multipartUploadObejctByMultithreading(KS3Client client,
InputStream inputstream, long offset, long length, String bucketName,
String objectKey,String mimeType) throws Exception {
// 要上传到文件至少要一个Part的大小
if (length < PART_SIZE)
throw new IllegalArgumentException(
"The object you are t... | 9 |
ITransientMap doAssoc(Object key, Object val) {
if (key == null) {
if (this.nullValue != val)
this.nullValue = val;
if (!hasNull) {
this.count++;
this.hasNull = true;
}
return this;
}
// Box leafFlag = new Box(null);
leafFlag.val = null;
INode n = (root == null ? BitmapIndexedNode.EMPTY... | 6 |
@Override
public double[] getData()
{
if (ptr != 0) {
return null;
} else {
if (isConstant()) {
if (length > getMaxSizeOf32bitArray()) return null;
double[] out = new double[(int) length];
for (int i = 0; i < length; i++) {
... | 4 |
@Override
public void sortArray() {
this.arrayAccess = 0;
this.comparisions = 0;
T[] auxArray = array.clone();
for (int d = width - 1; d >= 0; d--) {
count = new int[radix + 1];
for (T item : array) {
count[keyMap.get(item) + 1]++;
... | 4 |
public static ItemInfo itemByItem(ItemInfo item) {
for (ItemInfo i : items) {
if (item.equals(i)) {
return i;
}
}
return null;
} | 2 |
public static void main(String[] args) {
int len = 10;
Array<Integer> arr = new Array<Integer>(len);
for (int i = 0; i < len; ++i) {
arr.append(i);
}
System.out.println(arr);
for (int i = 0; i < len; ++i) {
System.out.println("Random #" + i + ": "... | 2 |
public List<Integer> getValues() {
List<Integer> valuesList = new ArrayList<Integer>();
for(int i = 0; i < size; i++) {
valuesList.addAll(map[i].getValues());
}
return valuesList;
} | 1 |
public String toString() {
try {
return this.toJSON().toString(4);
} catch (JSONException e) {
return "Error";
}
} | 1 |
public State completeWith(State other) {
completeStylesWith(other);
if (other != null) {
description = StringUtils.defaultString(description, other.description);
if(other.isDoubled())
markDoubled();
}
return this;
} | 2 |
private void enqueueParents(final SSAConstructionInfo consInfo) {
final Set seen = new HashSet();
final Iterator iter = cfg.nodes().iterator();
while (iter.hasNext()) {
final Block block = (Block) iter.next();
final Iterator e = consInfo.realsAtBlock(block).iterator();
while (e.hasNext()) {
final... | 7 |
public static Cons allSuperrelations(NamedDescription relation, boolean removeequivalentsP) {
{ MemoizationTable memoTable000 = null;
Cons memoizedEntry000 = null;
Stella_Object memoizedValue000 = null;
if (Stella.$MEMOIZATION_ENABLEDp$) {
memoTable000 = ((MemoizationTable)(Logic.SGT_LOGI... | 7 |
private void toggleDebugger(JMenuItem src, Class<?> listener) {
Bot b = window.getActiveBot();
if (b != null) {
HijackCanvas c = b.getCanvas();
boolean removed = false;
if (c == null) {
b.getLogger().log(new LogRecord(Level.SEVERE, "Error accessing canvas..."));
return;
}
for (int i = 0; i < ... | 8 |
private static void firstStrategy()
{
Semaphore MReading = new Semaphore(1);
Semaphore MWriting = new Semaphore(1);
int counter = 0;
Random r = new Random();
while(true)
{
if(r.nextDouble() > 0.5)
{
Lecteur l = new Lecteur(MReading,MWriting,counter);
l.run();
counter = l.counter;
}... | 2 |
protected Object evaluateElement(Object current, Object next)
throws UDFArgumentException {
boolean lessThan = false;
if (next==null)
return current;
if (current == null)
return next;
switch (elementOI.getPrimitiveCategory()) {
case INT: lessThan = (((IntObjectInspector)element... | 8 |
public int getExperienceToLevel(int skill, int level) {
if (level < 0 || level > 99)
return -1;
int experience = getExperience(skill);
if (experience == -1)
return -1;
return EXPERIENCE_TABLE[level] - experience;
} | 3 |
public ArrayList<ArrayList<Integer>> zigzagLevelOrder(TreeNode root) {
// Start typing your Java solution below
// DO NOT write main() function
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
if(root == null)return result;
LinkedList<TreeNode> queue = new LinkedLi... | 9 |
private void recreateMesh() {
Vertex[] vertexes = new Vertex[text.length() * 4];
int[] indices = new int[6 * text.length()];
float lastX = 0;
for(int i=0; i<text.length(); i++){
Glyph glyph = font.getGlyph((int)text.charAt(i));
vertexes[0 + i*4] = new Vertex(... | 1 |
public void setId(String value) {
this.id = value;
} | 0 |
public boolean checkPossible() {
int[] horizontalMax = new int[myLawn.length];
int[] verticalMax = new int[myLawn[0].length];
for (int i = 0; i < myLawn.length; i++) {
int max = 0;
for (int j = 0; j < myLawn[0].length; j++)
if (max < myLawn[i][j])
max = myLawn[i][j];
horizontalMax[i] = max;
}
... | 9 |
*/
public void birthNewVictim(int i) {
if (i % 5 == 0) {
ArrayList <Ostrich> arrayList = new ArrayList<Ostrich>();
for (int index = 0; index < animalFactory.getQuantityOfVictims(); index++) {
Ostrich ostrich = (Ostrich) animalFactory.createNewVictim();
... | 3 |
private void updateTabla(){
//** pido los datos a la tabla
Object[][] vcta = this.getDatos();
//** se colocan los datos en la tabla
DefaultTableModel datos = new DefaultTableModel();
tabla.setModel(datos); ... | 5 |
public int majorityNumber(List<Integer> nums) {
// write your code
int candicate1 = 0, candicate2 = 0, count1 = 0, count2 = 0;
for (int i = 0; i < nums.size(); i++) {
if (nums.get(i) == candicate1) {
count1++;
} else if (nums.get(i) == candicate2) {
... | 9 |
@Override
public long defier(String a, String b) {
Player p1 = em.find(Player.class, a);
Player p2 = em.find(Player.class, b);
if (p2 != null && p1 != null) {
Defi d = new Defi(p1, p2);
em.persist(d);
return d.getId();
} else {
return 0... | 2 |
public static void main(String[] args) {
if (args.length > 0) {
if (args[0].equalsIgnoreCase("load-database")) {
System.out.println("Loading database...");
SqlFortune f = new SqlFortune();
f.createDb();
f.loadFromFiles();
System.out.println(f.getFortune());
System.out.println(f.getF... | 6 |
public Class<?> getDataType() {
if(superProperty == null) {
if(dataType == null) {
return null;
}
return dataType;
}
return superProperty.getDataType();
} | 3 |
@Override
public boolean perform(final Context context) {
// Example: /<command> off[ <Player>]
OfflinePlayer target = Parser.parsePlayer(context, 1);
if (target == null && context.sender instanceof OfflinePlayer) target = (OfflinePlayer) context.sender;
if (target == null) {
... | 5 |
public List<Location> adjacentLocations(Location location) {
assert location != null : "Null location passed to adjacentLocations";
// The list of locations to be returned.
List<Location> locations = new LinkedList<>();
if (location != null) {
int row = location.getRow();
... | 9 |
public static void editPartDialog(Part p) {
JPanel addPart = new JPanel();
JPanel input = new JPanel(new SpringLayout());
JLabel nameLabel = new JLabel("Name*");
JTextField name = new JTextField(p.name);
JLabel quantLabel = new JLabel("Quantity");
SpinnerNumberModel quantMod = new SpinnerNumberModel(p.quant... | 4 |
public static void main(String[] args) {
ConsistentGlobalProblemSetInitialisation starter = new ConsistentGlobalProblemSetInitialisation();
starter.initLanguage(new char[] { '0', '1' }, 10, "(1(01*0)*1|0)*");
int solutionFoundCounter = 0;
int noSolutionFound = 0;
List<Long> cycleCount = new LinkedList<Long>(... | 8 |
public <T extends ActiveRecord> T createObject(ResultSet rs, Class<T> clazz,
PropertyDescriptor[] props, int[] columnToProperty)
throws SQLException {
T object = newInstance(clazz);
for (int i = 1; i < columnToProperty.length; i++) {
if (columnToProperty[i] == -1) {
continue;
}
PropertyDescript... | 6 |
public void setPassword(String password) {
this.password = password;
} | 0 |
public static int deleteFileByScanPrefixFilter(String tablename, String rowPrifix) {
HTableInterface table = null;
int count = 0;
try {
table = getTable(tablename);
Scan s = new Scan();
s.setFilter(new PrefixFilter(rowPrifix.getBytes()));
ResultS... | 8 |
public void render() {
counter++;
if (counter % 100 == 0)
xtime++;
if (counter % 100 == 0)
ytime++;
for (int y = 0; y < height; y++) {
if (ytime >= height)
break;
for (int x = 0; x < width; x++) {
if (xtime >= width)
break;
pixels[xtime + ytime * width] = 0xff00ff;
}
}
} | 6 |
public void sign(String file, String encrypted_file) throws Exception {
FileOutputStream PGP_file = new FileOutputStream(encrypted_file, true);
SP sp = new SP(file, pub_exp, priv_exp, mod);
sp.dump(PGP_file);
//PGP_file.write((byte)0xDE);
//PGP_file.write((byte)0xAD);
PGP... | 0 |
public static String getEntityName(Class<?> clazz) {
Annotation entityAnnotation = null;
for (Annotation annotation : clazz.getAnnotations()) {
Class<?> annotationClass = annotation.annotationType();
if (annotationClass.getName().equals("javax.persistence.Entity")) {
entityAnnotation = annotation;
}
... | 8 |
private final int getNextProbableNode(int y) {
if (toVisit > 0) {
int danglingUnvisited = -1;
final double[] weights = new double[visited.length];
double columnSum = 0.0d;
for (int i = 0; i < visited.length; i++) {
... | 9 |
public JsonSettings() {
String jsonData = "";
try {
//TODO Find a better way to store the settings file
FileInputStream settingsStream = new FileInputStream("/tmp/settings.json");
try (java.util.Scanner s = new java.util.Scanner(settingsStream)) {
json... | 3 |
public void setFunHabilitado(String funHabilitado) {
this.funHabilitado = funHabilitado;
} | 0 |
void assignBMEWeights( double[][] A )
{
edge e;
e = depthFirstTraverse(null);
while (null != e)
{
if ( e.head.leaf() || e.tail.leaf() )
e.BalWFext(A);
else
e.BalWFint(A);
e = depthFirstTraverse(e);
}
} | 3 |
@Override
public void clear() {
for (int i=0; i<filter.length; i++) { filter[i] = 0; }
} | 1 |
public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
if(container.getInput().isKeyPressed(Keyboard.KEY_ESCAPE)){
game.enterState(MenuState.ID);
}
if(!b.isGameOver()){
TetrisRobot.findGhost();
totalDelta += delta;
if(FacebookBoard.isFound()){
if(moved)... | 9 |
public GT getGameTable() {
if(gameTable.isSetUp) {
return gameTable;
} else {
gameTable.setupTable();
return gameTable;
}
} | 1 |
public DataModule getDataModule(String moduleName) {
if(!fragments.contains(moduleName)){
addModule(moduleName);
}
return NSpaceManager.getDataModule(moduleName);
} | 1 |
public boolean isUpperTriagonal(){
boolean test = true;
for(int i=0; i<this.numberOfRows; i++){
for(int j=0; j<this.numberOfColumns; j++){
if(j<i && this.matrix[i][j]!=0.0D)test = false;
}
}
return test;
} | 4 |
private void routeReplyReceived(RREP rrep, int senderNodeAddress) {
//rrepRoutePrecursorAddress is an local int used to hold the next-hop address from the forward route
int rrepRoutePrecursorAddress = -1;
//Create route to previous node with unknown seqNum (neighbour)
if(routeTableManager.createForwardRouteEnt... | 9 |
public ServerConnection(String server, int id, int tab)
{
serverid = id;
servertab = tab;
serverip = server;
setName(Main.user);
try
{
connect(server);
}
catch (IOException e)
{
Main.gui.tabs.get(tab).addMessage((e.getMessage()));
}
catch (IrcException e)
{
Main.gui.tabs.get(tab).addMe... | 2 |
public static void main(String[] a) throws IOException {
Scanner s = new Scanner(new File(a[0]));
while (s.hasNextLine()) {
String[] arr1 = s.nextLine().split("\\|");
String sub = arr1[1].trim();
String[] arr2 = arr1[0].split(" ");
// init
Map<char[], String> map = new LinkedHashMap<char[], Strin... | 9 |
public void release(int x, int y) {
if (amplitude.isActive()) {
amplitude.release();
} else if (period.isActive()) {
period.release();
} else if (amplitude2.isActive()) {
amplitude2.release();
} else if (period2.isActive()) {
period2.releas... | 4 |
private void method98(Mobile mobile) {
if (mobile.anInt1548 == Client.loopCycle || mobile.animationId == -1 || mobile.animationDelay != 0 || mobile.anInt1528 + 1 > Sequence.sequenceCache[mobile.animationId].getFrameLength(mobile.anInt1527)) {
int i = mobile.anInt1548 - mobile.anInt1547;
... | 8 |
public void atualizar(Material material) {
jComboBoxEdicao.removeAllItems();
jComboBoxAnoPublicacao.removeAllItems();
jComboBoxAutor.removeAllItems();
jComboBoxEditora.removeAllItems();
jComboBoxCategoria.removeAllItems();
jComboBoxPublico.removeAllItems();
jCombo... | 7 |
public Destination destination(String s) {
return new PDestination(s);
} | 0 |
public void addAllShips()
{
for(int i = 0; i < BattleShipGame.shipSizes.length; i++)
addShip(BattleShipGame.shipSizes[i]);
updateNums();
} | 1 |
public void stateChanged(ChangeEvent e){
SpinnerModel hModel = HSelector.getModel();
SpinnerModel wModel = WSelector.getModel();
Integer hValue = this.getHSelectorValue();
Integer wValue = this.getWSelectorValue();
if (hModel instanceof SpinnerNumberModel || wModel instanceof SpinnerNumberModel){
if (hV... | 6 |
public int getGridX(int x, int y)
{
Insets myInsets = getInsets();
int x1 = myInsets.left;
int y1 = myInsets.top;
x = x - x1 - GRID_X;
y = y - y1 - GRID_Y;
if (x < 0)
{ //To the left of the grid
return -1;
}
else if (y < 0)
{ //Above the grid
return -1;
}
else if ((x % (INNER_CELL_... | 8 |
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.