text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean contains(DockLayoutNode node) {
if (node == this) {
return true;
}
for (DockLayoutNode child : mChildren) {
if (child == node) {
return true;
}
if (child instanceof DockLayout) {
if (((DockLayout) child).contains(node)) {
return true;
}
}
}
return false;
} | 5 |
public void setPos1(int val){ if (val == 1){p1 = true;} else { p1 = false; }} | 1 |
public static void main(String[] args) {
/* Use an appropriate Look and Feel */
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
//UIManager.setLookAndFeel("... | 4 |
private void setGrid(Grid grid) {
if (grid == null)
throw new IllegalArgumentException("Grid can't be null!");
this.grid = grid;
} | 1 |
public static long unsignedInt (byte[] byteArray, int selector, int byteOrdering)
{
// byteOrdering tells how bytes are stored
// selector should always point to lowest byte position of range
// local vars
int a = 0 ;
// case out on the storage scheme
switch (byteOrdering) {
case HI_TO_LO: //... | 2 |
final public Identifier ValueIdentifier() throws ParseException {
ModuleIdentifier module;
Token dot_t;
NodeToken value;
Identifier identifier;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TYPE_IDENTIFIER_T:
module = ModuleIdentifier();
dot_t = jj_consume_token(DOT_T);
value = ... | 9 |
private void addSearchPanel() {
Dimension inputDimension = Constants.getInputDimension();
Dimension dateDimension = Constants.getDateDimension();
searchPanel = new JPanel();
searchPanel.setBorder(new TitledBorder("查询条件"));
searchPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
... | 5 |
public static boolean isWhitespace(String str)
{
if (str == null)
{
return false;
}
int sz = str.length();
for (int i = 0; i < sz; i++)
{
if ((Character.isWhitespace(str.charAt(i)) == false))
{
return false;
... | 3 |
@Override
public synchronized void run() {
try{
while (true){
while (ch1.isEmpty()||!ch2.isEmpty()){
wait();
} // Wait for something to do
val=int_receive();
while (numberOfRepetitionAndLost < maxError){
Random random = new Random();
int randomInt = random.nextInt(3); // randomIn... | 9 |
public boolean initialize(ArrayList<String> in) {
assert (in != null) : "Cannot initialize with a null list";
assert (tokens == null) : "Cannot reinitialize EnglishNumber";
assert (in.size() != 0) : "Cannot accept an empty arraylist";
if (in == null)
{
em.error(... | 5 |
@Override
public String getConnectionsString() {
String result = "";
for (Iterator<ISocketServerConnection> it = getConnections().iterator(); it.hasNext();) {
ISocketServerConnection ssc = it.next();
if (result.isEmpty()) {
result = new Long(ssc.getIdConnection()).toString();
}
... | 2 |
public void setName( String name )
{
if( cxnSp != null )
{
cxnSp.setName( name );
}
else if( sp != null )
{
sp.setName( name );
}
else if( pic != null )
{
pic.setName( name );
}
else if( graphicFrame != null )
{
graphicFrame.setName( name );
}
else if( grpSp != null )
{
grpSp... | 5 |
private void createAndAddApplicationToSystemTray() throws IOException {
// Check the SystemTray support
if (!SystemTray.isSupported()) {
System.out.println("SystemTray is not supported");
return;
}
Image image = new ImageIcon("").getImage();
final TrayIcon trayIcon = new TrayIcon(image, TOOL_TIP);
thi... | 2 |
private void drawBeastRadius(GOut g) {
String name;
g.chcolor(255, 0, 0, 96);
synchronized (glob.oc) {
for (Gob tg : glob.oc) {
name = tg.resname();
if ((tg.sc != null)
&& (!name.contains("/cdv"))
&& ((na... | 5 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
List<Usuario> us = new Conectar().ConexionUs();
Usuario u = new Usuario();
String s = null;
try {
s = new UseUser().Ge... | 4 |
public void addRoom(String showName, String dei, Room room){
Days day = Days.valueOf(dei);
int d = day.ordinal();
for (Show show : days[d].getShows()) { //iter the shows of that day
if (!show.getName().equals(showName)){ //see if there is a show with tha correct name
... | 4 |
@Override
public int fight() {
return super.fight();
} | 0 |
boolean isImportTaxApplicable(String sItem)
{
if(sItem.contains("import"))
return true;
return false;
} | 1 |
public void startup(Window window) {
this.window = window;
csvLoadCard.init(this);
serializationLoadCard.init(this);
manualSetupCard.init(this);
scrapeInfoCard.init(this);
setupBatteriesCard.init(this);
if (StartupSequence.checkForSerializedData()) {
... | 2 |
@EventHandler(priority = EventPriority.HIGH)
public void playerPickUpItem(PlayerPickupItemEvent e) {
if(e.getItem().getItemStack().equals(new ItemStack(Material.SKULL_ITEM, 1))) {
for(TTEnTGame game: TTEnTMain.activeGames) {
for(IngamePlayer p: game.players) {
e.getItem().getLocation().equals(p.getSpawnH... | 5 |
public double nota()
{
double acum =0;
for(RespuestaAlumno respuesta: respuestas)
{
acum = acum + this.puntaje(respuesta);
}
double laNota = acum*10/this.puntajeTotal();
return(laNota);
} | 1 |
public String getName() {
return name;
} | 0 |
public void reorderList(ListNode head){
if(head != null && head.next != null){
ListNode slow = head;
ListNode fast = head;
while(fast!=null && fast.next!=null&&fast.next.next!=null){
slow = slow.next;
fast=fast.next.next;
}
ListNode second = slow.... | 6 |
* @return The column, or <code>null</code> if none is found.
*/
public Column overColumnDivider(int x) {
int pos = getInsets().left;
int count = mModel.getColumnCount();
for (int i = 0; i < count; i++) {
Column col = mModel.getColumnAtIndex(i);
if (col.isVisible()) {
pos += col.getWidth() + (mDrawCol... | 5 |
public void damage(Vector2f lineStart, Vector2f lineEnd, Vector2f nearestIntersection)
{
Vector2f nearestBotIntersect = null;
Enemies nearestBot = null;
for (Enemies enemies : enemises)
{
Vector2f colVector = Game.getLevel().lineInterSectRect(lineStart, lineEnd, new Vecto... | 7 |
public Speaker findSpeakerById(final Long id) {
return new Speaker();
} | 0 |
private static void addMetadata( OtuWrapper wrapper, File inFile, File outFile,
boolean fromR) throws Exception
{
HashMap<String, Integer> caseControlMap = getCaseControlMap();
BufferedReader reader = new BufferedReader(new FileReader(inFile));
BufferedWriter writer = new BufferedWriter(new FileWriter(out... | 7 |
private DataModel loadFromFile(File pathToFile) {
DataModel dm = null;
if (pathToFile != null) {
ObjectInputStream ois = null;
if (pathToFile.exists()) {
try {
ois = new ObjectInputStream(new FileInputStream(pathToFile));
... | 5 |
public static JSONArray rowToJSONArray(JSONTokener x) throws JSONException {
JSONArray ja = new JSONArray();
for (;;) {
String value = getValue(x);
if (value == null) {
return null;
}
ja.put(value);
for (;;) {
ch... | 8 |
protected final void setTComponentContainer(TComponentContainer componentContainer)
{
if (tComponentContainer != componentContainer)
{
if (tComponentContainer != null)
{
tComponentContainer.getParent().removeMouseListener(this);
tComponentContainer.getParent().removeMouseMotionL... | 7 |
public boolean bishopMove(int startRow, int startCol, int endRow, int endCol)
{
Piece piece = checker[startRow][startCol];
Piece endTile = checker[endRow][endCol];
if(endTile == null || endTile.alligence != piece.alligence) //only move or move and attack
{
if(Math.abs(endCol-startCol) == Math.abs(end... | 7 |
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 |
protected void openXmlPng(BasicGraphEditor editor, File file)
throws IOException
{
Map<String, String> text = mxPngTextDecoder
.decodeCompressedText(new FileInputStream(file));
if (text != null)
{
String value = text.get("mxGraphModel");
if (value != null)
{
Document document = mx... | 2 |
public static RoutingMessage getRoutingMessage(ByteBuffer buffer) {
int headerSize = buffer.getInt();
// header
Map<String, String> header = null;
if (headerSize > 0) {
header = new HashMap<>();
for (int i = 0; i < headerSize; i++) {
String key = ... | 3 |
private void establishConnection(String url, boolean willRetryOnFailure) throws SQLException
{
if (!isEncryptionEnabled())
jdbc = DriverManager.getConnection(url);
else if (0 == encryptionPassword.length)
throw new IllegalStateException(
"The password is no longer available. Please set the password agai... | 9 |
public byte[] getData() {
if(tmpData != null) {
if(data == null || tmpData.size() != data.length) {
data = tmpData.toByteArray();
}
}
return data;
} | 3 |
private void AddNodeToQueue( CommandNode node )
throws CreateCMDTreeErrorException
{
if ( SwitchStack.empty() )
{
if ( IfStack.empty() && WhileStack.empty() )
{
__AddNodeToQueue__( CMDTree, node );
}
else
{
RTTestLog.logToConsole( "Stack Error.", LogCollector.ERROR );
Crea... | 8 |
@Override
public void endTransaction() {
if(commit()){
this.transaction = false;
}
} | 1 |
public int countPlayerPoints(int player)
{
int points = 0;
for (int[] row : board)
{
for (int value : row)
{
if(value == W && player == W)
{
points++;
}
else if(value == B && player ==... | 6 |
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
if (key == KeyEvent.VK_LEFT) {
dx = 0;
}
if (key == KeyEvent.VK_RIGHT) {
dx = 0;
}
if (key == KeyEvent.VK_UP) {
dy = 0;
}
if (key == KeyEvent.VK_DOWN) {... | 4 |
@GET
@Path("/{repoName}")
@Produces(MediaType.APPLICATION_JSON)
public String getRepositoryFiles(
@PathParam("repoName") String repoName,
@Context HttpServletRequest request) {
RepositoryVm repositoryVm;
Gson gson = new Gson();
if (StringUtil... | 3 |
private void printAddUser() throws IOException {
String s, username = null, password = null;
printMenu(PrintMenuName.ADD_USER);
while (true) {
s = br.readLine();
System.out.println(s);
if (s.equals("b")) break;
else if (s != null) {
if (username == null) username = s;
else {
password = s;... | 7 |
public static AbstractModel getRandomGrid(int min, int max, int distance,AbstractModel result) {
// AbstractModel result = new ModelParallel();
Random r = new Random(1);
for (int i = min; i < max; i += distance) {
for (int j = min; j < max; j += distance) {
result.p.add(new Particle(0.5, 0, 0, i + 0.5 - r.n... | 2 |
public static ArrayList<Integer> primeNumbers(int n) {
if (n < 2)
return new ArrayList<Integer>();
isPrime = new boolean[n];
char[] is_composite = new char[(n - 2 >> 5) + 1];
final int limit_i = n - 2 >> 1, limit_j = 2 * limit_i + 3;
ArrayList<Integer> results = new ArrayList<Integer>(
(int) Math.ceil(... | 4 |
@Test
public void minimalTest()
throws Exception
{
Thread.sleep( 5000 );
assertTrue( this.timedTask.getInvocationsTimedTaskA() > 0 );
} | 0 |
public static void main(String[] args) {
ServerSocket server;
final int DAYTIME_PORT = 1300;
Socket socket;
try {
server = new ServerSocket(DAYTIME_PORT);
do {
socket = server.accept();
PrintWriter output = new PrintWriter(socket.getOutputStream(),
true);
Date date = new Date();
out... | 2 |
private static void readFromFile() {
filepath = JOptionPane
.showInputDialog("Enter the file path of the file you wish to read from:");
try {
File f = new File(filepath);
Scanner sc = new Scanner(f);
while (sc.hasNextLine()) {
String name = sc.nextLine();
String title = sc.nextLine();
Array... | 9 |
public static int[] findPrimes(int max) {
int[] prime = new int[max+1];
ArrayList list = new ArrayList();
//假设所有数都是质数
for(int i = 2; i <= max; i++){
prime[i] = 1;
}
//检查所有数
for(int i = 2; i*i <= max; i++) { // 這邊可以改進
//如果当前数是质数
... | 8 |
public void sublogic(int index) {
Graphics2D g2 = (Graphics2D) bi.getGraphics();
// We talked about this above...
if (foci[index] == null) {
if (DALLATONCE)
return;
else
generateCircle(index);
}
Circle subject = fo... | 8 |
private double expectedValue(int[] bowl, int bowlId, int round){
int bowlSize = 0;
for(int i=0; i<bowl.length; i++)
bowlSize += bowl[i];
double avgFruitScore = 0;
int totFruitsInDistribution = 0;
for(int i=0; i<NUM_FRUITS; i++){
if(currentDistribution[i] > 0){
totFruitsInDis... | 4 |
public static int[] rightHalf(int[] array) {
int size1 = array.length / 2;
int size2 = array.length - size1;
int[] right = new int[size2];
for (int i = 0; i < size2; i++) {
right[i] = array[i + size1];
}
... | 1 |
public static void main(String[] args) {
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=AdventureWorks;integratedSecurity=true;";
// Declare the JDBC objects.
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
... | 8 |
public void playerHoldings() {
if (!register || !Methods.hasMethod()) {
return;
}
Format sdf = new SimpleDateFormat(larvikGaming.getConfig().getString("TimeFormat", "yyyy-MM-dd HH:mm:ss"));
Date date = new Date();
String timeStamp = sdf.format(date);
File outFile = new File(fileDir + "Player-Holdings... | 6 |
private String formatProperty(String fieldKey, String fieldValue) {
if (!safe) {
// Remove whitespace from name and quotes the value.
// This typically still returns bash-unsafe key-value pairs.
return fieldKey + "=" + fieldValue;
} else {
// This returns ... | 2 |
public boolean avaiable(Dish dish) {
LinkedList<Material> materials = dish.getMaterials();
for (Material tmp : materials) {
for (StorageAdapter storage : storageList) {
if (tmp.getName().equals(storage.getName()) && tmp.getAmount() > storage.getAmount()) {
return false;
}
}
}
LinkedList<Ing... | 8 |
@Override
public void onDraw(Graphics G, int viewX, int viewY) {
if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
{
Graphics2D g = (Graphics2D)G;
Composite c = g.getComposite();
// g.setComposite(new Additive());
g.setColor(new Color(255,r.nextInt(255),... | 5 |
static int process(String line) {
int[] arr = giveArray(line.trim().split(" "));
if(arr.length == 1 && arr[0] == 0)
return 0;
int n = arr[0], c = arr[1];
String[] chosen = readLine().trim().split(" ");
boolean[] mp = new boolean[10002];
for(String s : chosen) {
mp[Integer.parseInt(s)] = true;
}
... | 8 |
public static String numberToString(Number number)
throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
... | 6 |
private static int getLineNumber(){
return Thread.currentThread().getStackTrace()[3].getLineNumber();
} | 0 |
@Test
public void testTimeStep_PERIOD() throws Exception {
printDebug("----------------------------");
printDebug("PERIOD: " + this.toString());
printDebug("----------------------------");
CSTable t = DataIO.table(r, "obs");
Assert.assertNotNull(t);
... | 1 |
public void init() {
if (inited) {
return;
}
// try and find the form's resources dictionary.
Resources leafResources = library.getResources(entries, "Resources");
// apply resource for tiling if any, otherwise we use the default dictionary.
if (leafResource... | 5 |
void prefetch_all_headers(Info first_i, Comment first_c, int dataoffset)
throws SoundException {
Page og = new Page();
int ret;
vi = new Info[links];
vc = new Comment[links];
dataoffsets = new long[links];
pcmlengths = new long[links];
serialnos = new... | 8 |
public PixImage toPixImage() {
PixImage image = new PixImage(width,height);
RunIterator iterate = iterator();
int row = 0;
int column = 0;
do {
int[] runArray = iterate.next();
int count = runArray[0];
while (count > 0) {
image.setPixel(column,row,(short)runArray[1],(short)... | 3 |
public ResourceClump(int cx, int cy, int radius, int type) {
this.cx = cx;
this.cy = cy;
this.radius = radius;
this.num_voxels = 0;
this.type = type;
int ci = getI(cx);
int cj = getJ(cy);
int iradius = getI(radius);
for (int i = ci - iradius; i < ci + iradius; i++) {
for (int j = cj - i... | 7 |
@EventHandler
public void login(PlayerLoginEvent ple) {
MemberManager memberManager = Citadel.getMemberManager();
memberManager.addOnlinePlayer(ple.getPlayer());
String playerName = ple.getPlayer().getDisplayName();
Member member = memberManager.getMember(playerName);
if(member == null){
... | 5 |
public static Matrice multiply(Matrice a, Matrice b) throws MatrixException
{
//Condition sur les dimensions
if(a.columns != b.lines)
{
throw new MatrixException("Problème de dimension !");
}
Matrice res = new Matrice(a.lines, b.columns);
... | 4 |
@Override
public void execute() {
Vars.status = "SummoningNode";
Vars.needToSummon = true;
Timer t = new Timer(2500);
if (Summoning.getPoints() < 1 && !Summoning.isFamiliarSummoned()) {
Vars.status = "Pot";
Inventory.getItem(Const.SUM_POT).getWidgetChild().interact("Drink");
t.reset();
while (t.isR... | 8 |
public final static String htmlEscape(String line)
{
StringBuilder sb = new StringBuilder();
char[] chars = line.toCharArray();
for (int i=0; i<chars.length; i++) {
char cur = chars[i];
if ((cur == '\n') || (cur == '\r') || (cur == '\t')) {
sb.append(c... | 9 |
public static int storeVersion(byte[] target, int targetOffset, int targetLength, int targetLimit,
long versionHandle, byte[] source, int sourceOffset, int sourceLength) {
int existedMask = 0;
int to = targetOffset;
if (targetLimit > target.length) {
throw new IllegalArgu... | 9 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((dataNascimento == null) ? 0 : dataNascimento.hashCode());
result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime ... | 5 |
protected Direction decide() {
if (followingWall && rotation == 0) {
// "When the solver is facing the original direction again,
// and the angular sum of the turns made is 0,
// the solver leaves the obstacle and continues
// moving in its original direction." (Wikipedia)
followingWall = false;
}
... | 7 |
public static String formatRange(long... range) {
switch (range.length) {
case 0: return "bytes=0-";
case 1:
if (range[0] < 0) throw new IllegalArgumentException("negative range");
return "bytes="+range[0]+"-";
case 2:
if (range... | 6 |
Font(BufferedImage sheet, int charWidth, int charHeight) {
this.charWidth = charWidth;
this.charHeight = charHeight;
sprites = new Sprite[L.length()];
int sheetWidth = sheet.getWidth();
for (int i = 0; i < sprites.length; i++) {
sprites[i] = new Sprite(sheet.getSubimage(i * this.charWidth % sheetWidth, (i ... | 1 |
public String getPath(String path) {
String split[] = path.split("\\.");
if (split.length <= 0)
return path;
String newPath = "";
boolean set = true;
ConfigurationSection section = config.getRoot();
for (int i = 0; i < split.length; i++) {
if (!set) {
newPath += "." + split[i];
continue;
... | 7 |
public void getMap(){
int x = xStart;
int y = yStart;
mapWidth = 0;
mapHeight = 0;
int doorCount = 0;
int interactiveCount = 0;
//Gets map from globalMap
LocalMap blockTypes = globalMap.enterLocalMap(globalPosX , globalPosY);
columns = blockTypes.x;
rows = blockTypes.y;
blocks = new Block[... | 5 |
boolean isAttackPlaceDiagonallyAboveRightNotHarming(int position, char[] boardElements, int dimension, int attackPlacesOnTheRight) {
int positionRightAbove = 1;
while (attackPlacesOnTheRight > 0) {
if (isPossibleToPlaceDiagRightAbove(position, dimension, positionRightAbove)
... | 3 |
String getAuthors()
{
return authors;
} | 0 |
public void writeSentence(TokenStructure syntaxGraph) throws MaltChainedException {
if (syntaxGraph == null || dataFormatInstance == null) {
return;
}
if (syntaxGraph.hasTokens()) {
sentenceCount++;
final PhraseStructure phraseStructure = (PhraseStructure)syntaxGraph;
try {
sentenceID.setLength(0)... | 7 |
@Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
} | 0 |
public static void main(String[] args)
{
TuringTrimmingTester t=new TuringTrimmingTester("productions.txt");
} | 0 |
public void visit_lrem(final Instruction inst) {
stackHeight -= 4;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 2;
} | 1 |
void balance(Entry<V> x) {
Entry<V> y;
x.color = true;
while (x != root && x.parent.color) {
if (x.parent == x.parent.parent.left) {
y = x.parent.parent.right;
if (y != null && y.color) {
x.parent.color = false;
... | 9 |
public static String getContentFromSeekableInput(SeekableInput in, boolean convertToHex) {
String content = null;
try {
in.beginThreadAccess();
long position = in.getAbsolutePosition();
ByteArrayOutputStream out = new ByteArrayOutputStream();
/*
... | 4 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
int times = Integer.parseInt(in.readLine().trim());
for (int t = 0; t < times; t++) {
in.readLine();
String firstLine = in.readLine... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FavoritesTag other = (FavoritesTag) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
retur... | 6 |
private int readStringTable
(byte[] remainingData,
int offset,
int blockStart,
ResStringPool_Header stringPoolHeader,
Map<Integer, String> stringList) throws IOException {
// Read the strings
for (int i = 0; i < stringPoolHeader.stringCount; i++) {
int stringIdx = readUInt32(remainingData, offset)... | 2 |
@Override
public void insertAt(T object, int index) throws DAIllegalArgumentException, DAIndexOutOfBoundsException
{
if(object == null)
{
throw new IllegalArgumentException();
}
else if((index >= 0) && (index <= size))
{
if(size >= array.length)
{
growArray();
}
//starts at the end an... | 6 |
public ArrayList<String> getEspTitles() {
return espTitles;
} | 0 |
public boolean getScrollableTracksViewportWidth() {
return getPreferredSize().width < getParent().getSize().width;
} | 0 |
public List<Claim> getClaimAndSubclaimList(String teamType) {
List<Claim> claimList = new ArrayList<Claim>();
Element claimE;
Claim claim;
for (Iterator i = root.elementIterator("claim"); i.hasNext();) {
claimE = (Element)i.next();
if (claimE.attributeValue("teamType").equals(teamType)) {
if (cla... | 6 |
public static boolean canAccess(String position, String subsystem){
if(position.equals("manager"))
return true;
if(position.equals("pharmacist")&&!subsystem.equals("employee"))
return true;
if(position.equals("tech")&&subsystem.equals("patient"))
return true;
return false;
} | 5 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ServicePK_Simple other = (ServicePK_Simple) obj;
if (client == null) {
if (other.client != null)
return false;
} else if (!client.equals... | 9 |
public static Point2D lookUpNextStep(Point2D start, Point2D end, Class<?>... ignoredObstacles) {
if (Field.arePointsNear(start, end)) { return end; }
int[][] map = getMap(ignoredObstacles);
map[start.x+1][start.y+1] = 0;
map[end.x+1][end.y+1] = 0;
Queue<Integer... | 6 |
@Override
public void run() {
for(Player p : DeityNether.plugin.getServer().getOnlinePlayers()){
if(p.getWorld() == DeityNether.plugin.getServer().getWorld(DeityNether.config.getNetherWorldName())){
if(!p.hasPermission(DeityNether.OVERRIDE_PERMISSION) && p.hasPermission(DeityNether.GENERAL_PERMISSION)){
... | 8 |
public boolean setWumpusPos(Position newPos){
boolean success = false;
if(getWumpusPos().getX() != -1 && getWumpusPos().getY() != -1) { // Wumpus already exists
removeWumpus();
}
if(this.isInsideBoard(newPos)) {
if(this.isEmpty(newPos)) {
// Set Wumpus
if(writeOnBoard(newPos,WUMPUS)){
getW... | 8 |
public static List<RecParametr> StringToParams(String str)
{
List<RecParametr> list = new ArrayList<RecParametr>();
String[] strs = str.split(";");
for(String s1 : strs)
{
RecParametr r = new RecParametr(s1.trim() + ";");
if(!r.GetName().equals("") &&... | 3 |
@Override
public int rowsX() {
return isNotPlayerInventory() ? 4 : 5;
} | 1 |
public static void loadData(ArrayList<ResourceLoader> loaders){
for(ResourceLoader loader : loaders){
loader.addResources();
}
OutputUtility.outputLine("-Loading Resources-");
OutputUtility.increment();
OutputUtility.outputLine("-Loading Images-");
Outp... | 2 |
public double[][] standardizedCovariances(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.covariancesCalculated)this.covariancesAndCorrelationCoefficients();
return this.standardizedCovariances;
} | 2 |
public boolean execute() {
final int cycle=CDState.getCycle();
if( shuffle ) rperm.reset( Network.size() );
for(int j=0; j<Network.size(); ++j)
{
Node node = null;
if( getpair_rand )
node = Network.get(CDState.r.nextInt(Network.size()));
else if( shuffle )
node = Network.get(rperm.next());
else
no... | 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.