text stringlengths 14 410k | label int32 0 9 |
|---|---|
public T read(Timestamp currentDateTime) throws IOException {
Deal deal = new Deal();
int type = dataInput.readUnsignedByte();
if ((type & DealFlags.DATE_TIME.getValue()) > 0) {
lassMillis = DataReader.readGrowing(dataInput, lassMillis);
}
// Timestamp timestamp = Ut... | 8 |
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 List<Double> getKurtosisList() {
List<Double> result= new ArrayList<Double>();
double[] values= this.getKurtosisArray();
for (int i= 0; i< values.length; ++i) {
result.add(Double.valueOf(values[i]));
}
return result;
} | 1 |
private BufferedImage getView() {
if (this.getWidth() > 0 && this.getHeight() > 0) {
// maps size in pixels
int mapSize = (mapImage_Scaled.getHeight());
// checks new position is valid
if (viewPort.x + this.getWidth() > mapSize) {
int moveXBy = viewPort.x + this.getWidth() - mapSize;
moveView(-m... | 7 |
public void next()
{
i--;
if(i<0)
i=modtexts.length-1;
modname = modtexts[i].getName();
boolean gef=false;
for(Modinfo prop: proposals)
if(prop.getName().equals(modname)) gef=true;
if(!gef)next();
headl.setText(modname);
headl2.setText(modname);
if(geladen)
laden();
else neu=fa... | 5 |
@Override
public void onDraw(Graphics G, int viewX, int viewY) {
if (X>viewX&&X<viewX+300&&Y>viewY&&Y<viewY+300)
{
G.setColor(c);
G.fillArc(((int)X-radius)-viewX, ((int)Y-radius)-viewY, radius*2, radius*2, 0, 360);
}
} | 4 |
public int getNoValidMoves(int player)
{
int cnt = 0;
if (player == 1)
{
for (int i = START_S; i <= END_S; i++)
{
if (board[i] > 0) cnt++;
}
}
else
{
for (int i = START_N; i <= END_N; i++)
... | 5 |
public ArrayList<ArrayList<Integer>> generate(int rowIndex) {
ArrayList<ArrayList<Integer>> results = new ArrayList<ArrayList<Integer>>();
ArrayList<Integer> result = new ArrayList<Integer>();
if (rowIndex == 0)
return results;
result.add(1);
results.add(new Array... | 3 |
public EntityPlayer getClosestVulnerablePlayer(double par1, double par3, double par5, double par7)
{
double var9 = -1.0D;
EntityPlayer var11 = null;
for (int var12 = 0; var12 < this.playerEntities.size(); ++var12)
{
EntityPlayer var13 = (EntityPlayer)this.playerEntities.... | 6 |
public boolean compare(Fechas f){
StringTokenizer cadena = new StringTokenizer(fecha, "/");
boolean res = false, exit = false;
StringTokenizer token = new StringTokenizer(f.getCadena(), "/");
while (token.hasMoreTokens() && cadena.hasMoreTokens() && !exit){
String tok = token... | 5 |
*
* @throws IOException if a data communication error occurs
* @throws UnknownHostException if cyc server host not found on the network
* @throws CycApiException if the api request results in a cyc server error
* @throws RuntimeException if the return from Cyc is not a string
*/
public String converseS... | 2 |
public MicroscopeCaptureResponse() {
} | 0 |
public static String replaceSection( String originalText, String replaceBegin, String replacementText, String replaceEnd )
{
StringBuffer sb = new StringBuffer( originalText.length() );
if( (originalText.indexOf( replaceBegin ) < 0) || (originalText.indexOf( replaceEnd ) < 0) )
{
return originalText;
}
in... | 7 |
@Override
public void unInvoke()
{
if(canBeUninvoked())
{
if(affected instanceof MOB)
{
final MOB mob=(MOB)affected;
if((found!=null)&&(!aborted)&&(mob.location()!=null))
{
if(messedUp)
commonTell(mob,L("You've messed up salvaging @x1!",oldItemName));
else
{
Item baseS... | 8 |
private Noeud noeudNonVisitePlusProche(List<Noeud> noeudsNonVus, List<Float> dist) {
int indexNoeud = -1;
float distMin = Float.POSITIVE_INFINITY;
for(int i = 0 ; i < noeudsNonVus.size() ; i++) {
if(dist.get(this.noeuds.indexOf(noeudsNonVus.get(i))) < distMin) {
distMin = dist.get(this.noeuds.indexOf(noeud... | 3 |
public void setAccount(SHSMemberEntity account) {
this.account = account;
} | 0 |
private void setStateIfMinecartInteractsWithRail(World var1, int var2, int var3, int var4, int var5) {
boolean var6 = (var5 & 8) != 0;
boolean var7 = false;
float var8 = 0.125F;
List var9 = var1.getEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getBoundingBoxFromPool((double)((float)var2... | 6 |
private void _replaceToken(){
if(m_token.type == Tokenizer.TokType.NUMBER)
m_token.value = numer_terminal;
else if(m_token.type == Tokenizer.TokType.KWORIDENT
&& !(m_key_words.contains(m_token.value)))
m_token.value = variable_terminal;
//else if(m_token.... | 3 |
public static void main (String[] args){
TiliaCollection collectionBlue = new TiliaCollection(100000,CreditChecker.BLUE_PROCESSING_THREAD);
Integer[] rew = collectionBlue.getRewards();
TiliaCollection collectionRed = new TiliaCollection(100000,rew,CreditChecker.RED_PROCESSING_THREAD);
GUI gui = new GU... | 4 |
private Long getSmallestId() throws SQLException
{
StringBuilder statement = new StringBuilder(100);
statement.append("SELECT ");
statement.append(Defaults.ID_COL);
statement.append(" FROM ");
statement.append(sourceObjectTableName);
statement.append(" ORDER BY ");
statement.append(Defaults.ID_COL);
st... | 2 |
@ChattingAnnotation(feature = "History", type = "method")
@Override
public String retriveChatHistory(String sender) {
String sCurrentLine = null;
String Allfile = null;
BufferedReader br = null;
try {
File file = new File("./ChatHistory.txt");
if (!file.exists()) {
file.createNewFile();
}
br =... | 6 |
*/
public boolean isOrthogonal(mxCellState edge)
{
if (edge.getStyle().containsKey(mxConstants.STYLE_ORTHOGONAL))
{
return mxUtils
.isTrue(edge.getStyle(), mxConstants.STYLE_ORTHOGONAL);
}
mxEdgeStyle.mxEdgeStyleFunction tmp = view.getEdgeStyle(edge, null,
null, null);
return tmp == mxEdgeStyl... | 6 |
public String toStringJava(){
String attributes="//Attributes list\n",methods="",defaultConstructor="",publicS="";
if(OBJECTTYPE.getName().equals("Class")){
publicS="public class ";
}
if(OBJECTTYPE.getName().equals("Interface")){
publicS="public interface ";
}
if(OBJECTTYPE.getName().equals("Abstract"... | 5 |
@Override
public void setValue(Object o) {
// instance must encapsulate a ResizingByteBuffer
this.rawFrameContents=(ResizingByteBuffer) this.convertObject(o);
} | 0 |
int minDistance(Marker queryMarker, Markers markers) {
int minDist = Integer.MAX_VALUE;
for (Marker m : markers) {
// We don't care about these
if ((m instanceof Chromosome) || (m instanceof Intergenic) || (m instanceof Gene) || (m instanceof Transcript)) continue;
// Find closest marker that has a transc... | 7 |
public static <T> boolean equals(final Collection<T> collection1, final Collection<T> collection2) {
if (collection1.size() != collection2.size())
return false;
final Iterator<T> iterator1 = collection1.iterator();
final Iterator<T> iterator2 = collection2.iterator();
while... | 5 |
public void visitForceChildren(final TreeVisitor visitor) {
if (visitor.reverse()) {
array.visit(visitor);
} else {
array.visit(visitor);
}
} | 1 |
public boolean equals(final Object value) {
if (value == this) {
return true;
} else if (value instanceof BasicValue) {
if (type == null) {
return ((BasicValue) value).type == null;
} else {
return type.equals(((BasicValue) value).type);
}
} else {
return false;
}
} | 3 |
public void trapFieldWrite(String name, Object value) {
Class jc = getClassMetaobject().getJavaClass();
try {
jc.getField(name).set(getObject(), value);
}
catch (NoSuchFieldException e) {
throw new RuntimeException(e.toString());
}
catch (IllegalAc... | 2 |
public static void leerNumerosEnterosBajos(BufferedReader br) {
// variables
Scanner s = null;
int temp = 0;
try {
s = new Scanner(br); // para scannear solo un tipo de datos
while (s.hasNext()) {
if (s.hasNextInt()) {
temp = s.nextInt();
BigNumberException.checkearNumero(temp);
System... | 4 |
public JSONRPCRequest buildRPCRequest( Reader reader )
throws NullPointerException,
JSONSyntaxException,
JSONRPCException,
JSONException,
IOException {
if( reader == null )
throw new NullPointerException( "Cannot read JSONRPCRequest from null reader." );
// Create JSONRPCValu... | 3 |
public void breakBlock(int x, int y, int z)
{
Level level = minecraft.level;
Block block = Block.blocks[level.getTile(x, y, z)];
boolean success = level.netSetTile(x, y, z, 0);
if(block != null && success)
{
if(minecraft.isOnline())
{
minecraft.networkManager.sendBlockChange(x, y, z, 0, minecraft... | 4 |
protected void renderSelected(Graphics g)
{
final int mouse = getSelectedTile(mMouseX, mMouseY);
final int mouseX = Tile.getX(mouse), mouseY = Tile.getY(mouse);
if (mouseX >= 0 && mouseY >= 0 && mouseX < mWidth && mouseY < mHeight)
{
mRenderer.renderSelectedTile(mouseX, mouseY, g);
for (int tile : mField... | 5 |
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 fe... | 6 |
public void setAll(double min, double max, double value)
{
if (min < max)
{
mmin = min;
mmax = max;
}
else
{
mmin = max;
mmax = min;
}
if (testValue(value))
mvalue = value;
else
mvalue = mmin;
recalcDifference();
} | 2 |
public void removeBySpan(long startTime, long endTime) {
int startIndex = this.getIndex(startTime);
int endIndex = this.getIndex(endTime);
for (int i = startIndex; i < endIndex; i++)
{
if (i < 0 || i >= nSlot)
continue;
this.aIsAvailable[i] = false;
}
} | 3 |
private void createCommand(Player player, String args[]){
if (args.length < 2 || args.length > 3){
player.sendMessage(Util.edit("Usage: /ci create <item name> <player>"));
return;
}
if (instance.hasPermission(player, Constants.CREATE_PERMS)){
if (instance.getItemHandler().getItemType().containsKey(args[1... | 8 |
public static String getTextureFile(int type) {
switch(type) {
case GRASS:
return "grass.png";
case DIRT:
return "dirt.png";
case STONE:
return "stone.png";
case WATER:
return "water.png";
... | 7 |
@Override
public void visit(Page page) {
String url = page.getWebURL().getURL();
System.out.println("URL: " + url);
if (page.getParseData() instanceof HtmlParseData) {
HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();
String text = htmlParseData.getT... | 7 |
public void move(int keycode){
if(dead){
movement.setX(0);
this.animation = death;
return;
}
if (keycode == KeyEvent.VK_LEFT || keycode == KeyEvent.VK_A){
movement.setX(-STEP_SIZE);
this.animation = type.getAnimationLeft();
this.prevAnimation = animation;
}
else if (keycode == KeyEvent.VK_RI... | 5 |
public void readResponse() throws IOException, InterruptedException, ClassPathOutOfSyncException {
Object readObject;
try {
readObject = readObject();
} catch (ClassNotFoundException e) {
throw new ClassPathOutOfSyncException(e);
}
if(readObject != null && readObject instanceof Transport) {
Transpor... | 5 |
public void close() throws IOException {
if (br != null) {
br.close();
}
} | 1 |
public ITicketPool getPool(TicketQueryArgs args)
{
String key = args.getTrainNumber() + "|" + args.getDate().toString();
return this._pools.get(key);
} | 0 |
public String getName(short entropyType)
{
switch (entropyType)
{
case HUFFMAN_TYPE:
return "HUFFMAN";
case ANS_TYPE:
return "ANS";
case RANGE_TYPE:
return "RANGE";
case PAQ_TYPE:
return "PAQ";
case FPAQ_TYPE:
... | 8 |
protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
super.loadFields(__in, __typeMapper);
__in.peekTag();
if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) {
... | 9 |
private static void printAllPermutations2(char[] str) {
Set<String> sofar = new HashSet<String>();
sofar.add("" + str[0]);
for (int i = 1; i < str.length; i++) {
Set<String> toAdd = new HashSet<String>();
for (String s : sofar) {
for (int k = 0; k <= s.length(); k++) {
toAdd.add(s.substring(0, k) +... | 4 |
private void searchSelectedTower(int x, int y){
PointI p = transformPointBack(x, y).getPointI();
for(Tower t:level.towers){
int n = t.def.size;
PointI pt = t.getPointI();
if((p.x >= pt.x) && (p.x < pt.x + n) && (p.y >= pt.y) && (p.y < pt.y + n)){
selectedTower = t;
return;
}
}
selectedTower ... | 5 |
public static ArrayList<Monster> getMonster(int room, int numMons) {
//Generates a random monster
ArrayList<Monster> monsters = new ArrayList<Monster>();
for(int i = 0; i < numMons; i ++){
int type = 999;
Random randomGenerator = new Random();
randomGenerator.nextInt(100);
type = randomGenerator.ne... | 6 |
public int numberOfScores() {
File file;
file = new File("Scores.txt");
Scanner scanner;
int numberofScores = 0;
String line = "";
StringTokenizer scoreData;
try {
scanner = new Scanner(file);
while(scanner.hasNextLine()) {
line = scanner.nextLine();
users.add(line);
line = scanner.nextL... | 2 |
public static int getLevenshteinDistance1 (String s, String t)
{
int d[][]; // matrix
int n; // length of s
int m; // length of t
int i; // iterates through s
int j; // iterates through t
char s_i; // ith character of s
char t_j; // jth character of t
... | 7 |
@Override
public void unInvoke()
{
final Physical P=affected;
super.unInvoke();
if((P instanceof MOB)&&(this.canBeUninvoked)&&(this.unInvoked))
{
if((!P.amDestroyed())&&(((MOB)P).amFollowing()==null))
{
final Room R=CMLib.map().roomLocation(P);
if(!CMLib.law().doesHavePriviledgesHere(invoker(), ... | 8 |
public void update() {
//Crear archive random llamado nomina
try
{
RandomAccessFile miArchivo=new RandomAccessFile("ArchivoBinario.dat","rw"); // rw significa que el archive se podrá leer y escribir
//inicializando variables para leer los datos de teclado
St... | 7 |
@Override
public void getMouseEvent(int button) {
if (button == 0 && !oldmouse){
double distance = PointMath.distance2Points(parent.getMapX(), parent.getMapY(), Boot.getPlayer().getX(), Boot.getPlayer().getY());
if (distance < 2){
parent.setSolid(!parent.isSolid());
int oldmeta = parent.getMetadata();
... | 4 |
public KismetConnection(String host, int port) throws IOException {
socket = new Socket(host, port);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
out.write("!0 REMOVE TIME\r\n... | 8 |
public void update() {
up = keys[KeyEvent.VK_UP] || keys[KeyEvent.VK_W];
down = keys[KeyEvent.VK_DOWN] || keys[KeyEvent.VK_S];
left = keys[KeyEvent.VK_LEFT] || keys[KeyEvent.VK_A];
right = keys[KeyEvent.VK_RIGHT] || keys[KeyEvent.VK_D];
} | 4 |
public void testWithField2() {
YearMonthDay test = new YearMonthDay(2004, 6, 9);
try {
test.withField(null, 6);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
public boolean isReceive(){
if(NBcell<Constantes.MAXDATA) return true;
else return false;
} | 1 |
public void stop() {
if ( _started ) {
try {
// EventBus如果没有正常关闭,打个日志好了
EventBus.shutdown();
} catch ( Exception e ) {
// TODO: 记录EventBus无法正常关闭的日志
}
stopNettyServer();
}
} | 2 |
ArticleSelector(final CaisseControler controller) {
this.controller = controller;
this.controller.addCaisseListener(this);
this.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.weightx = 1;
c.fil... | 9 |
public static void main(String[] args) {
ServerSocketChannel serverChannel;
Selector selector;
try{
serverChannel = ServerSocketChannel.open();
ServerSocket ss = serverChannel.socket();
InetSocketAddress addr = new InetSocketAddress(DEFAULT_PORT);
ss.bind(addr);
serverChannel.configureBlocking(fal... | 9 |
public void openFileAction() {
int nA, nO;
int i, selected;
String sName;
NSObject o;
NSRelation or;
TclSnippet s;
JFileChooser fch = new JFileChooser(this.lastpath);
fch.setDialogTitle(Messages.tr("script_open"));
selected = fch.showOpenDialog(th... | 8 |
public WebPages(){
docCount = 0;
termIndex = new BST();
} | 0 |
public int match_main(String text, String pattern, int loc) {
// Check for null inputs.
if (text == null || pattern == null) {
throw new IllegalArgumentException("Null inputs. (match_main)");
}
loc = Math.max(0, Math.min(loc, text.length()));
if (text.equals(pattern)) {
// Shortcut (pot... | 6 |
public void recalc_matches() {
try {
int non_matches_map = 0;
int non_matches_file = 0;
int map_index = comboBoxMapLayer.getSelectedIndex();
int file_index = comboBoxFileLinkColumn.getSelectedIndex();
if( map_index < 0 || file_index < 0) {
System.out.println("recalc: bad index");
return;
}
... | 9 |
public static void main(String[] args) {
Ex2 x = new Ex2();
} | 0 |
@Override
public double[] calculateJulia3DWithoutPeriodicity(Complex pixel) {
iterations = 0;
double temp = 0;
Complex tempz2 = new Complex(init_val2.getPixel(pixel));
Complex[] complex = new Complex[3];
complex[0] = new Complex(pixel);//z
complex[1] = new C... | 9 |
@Test
public void testItemGen() {
Item testItem = new Item();
boolean itemName = false;
if(testItem.getName().equalsIgnoreCase("Potion") ||
testItem.getName().equalsIgnoreCase("MagicStone") ||
testItem.getName().equalsIgnoreCase("UltimaStone")){
itemName = true;
... | 3 |
public void viewTicketsMenu() {
//===================== Local Data ======================//
boolean quit = false;
//wrap in do while to allow repetition of menu
do {
//if logged in user is a standard user, get a list of all tickets
//assigned to him/her
... | 9 |
private synchronized SSLContext ctx() {
if(ctx == null) {
TrustManagerFactory tmf;
KeyManagerFactory kmf;
try {
ctx = SSLContext.getInstance("TLS");
tmf = TrustManagerFactory.getInstance("PKIX");
kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
KeyManager[] kms = nul... | 6 |
public double evaluateSubset (BitSet subset) throws Exception {
int [] fs;
int i;
int count = 0;
for (i=0;i<m_numAttribs;i++) {
if (subset.get(i)) {
count++;
}
}
double [] instArray = new double[count];
int index = 0;
fs = new int[count];
for (i=0;i<m_numAttribs;i++) {... | 8 |
public void solve() {
if (solved) {
System.out.println("Sudoku Puzzle already Solved!");
return;
}
if (board == null) {
System.out.println("No Puzzle Loaded");
return;
}
extractCandidates();
solved = (solved) ? solved : nakedQuadSolver(new LinkedList<NakedCandidates>(), new LinkedList... | 6 |
public void set_nation(String nation){
this.nation=nation;
switch (this.nation){
case "all":
this.nation_nr=0;
break;
case "American":
this.nation_nr=1;
break;
case "British":
this.nation_nr=2;
break;
case "German":
this.nation_nr=3;
break;
case "French":
this.nati... | 7 |
public void readFromUser(BinarySearchTree<String, String> tree, int size) {
Scanner inn = new Scanner(System.in);
String compare ="N";
String comText= null;
String name = null;
String roll = null;
do {
System.out.println("\nEnter the fullName and rollNo as (DW-2XX):");
nam... | 2 |
public static Cons helpDefineKeywordAxioms(Symbol selfname, Keyword key, Stella_Object value) {
{ Cons axioms = Stella.NIL;
Symbol relationname = Symbol.internSymbol(key.symbolName);
if (Stella_Object.symbolP(value) &&
Stella.stringEqualP(((Symbol)(value)).symbolName, "TRUE")) {
axiom... | 9 |
private void getNextChangingElement(int a0, boolean isWhite, int[] ret) {
// Local copies of instance variables
int[] pce = this.prevChangingElems;
int ces = this.changingElemSize;
// If the previous match was at an odd element, we still
// have to search the preceeding element.
// int start = lastChanging... | 5 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ModelProperty)) {
return false;
}
ModelProperty other = (ModelProperty) object;
if ((this.modelPropertyPK == nu... | 5 |
public static void main(String[] args) {
boolean doPrint = false;
// Make sure they specified a File and Algorithm to use
if (args.length < 2) {
usage();
System.exit(1);
}
int idx = 0;
if (args[idx].equals("-p"))
{
doPrint = true;
idx = 1;
}
// get the filenames for those
String d... | 8 |
public int compare(Object obj1, Object obj2) {
String name1 = null;
String name2 = null;
if (obj1 instanceof Product) {
Product pro1 = (Product) obj1;
name1 = pro1.getName();
} else {
System.out.println("类型转换错误!");
}
if (obj1 instanceof Product) {
Product pro2 = (Product) obj2;
name2 = pro... | 7 |
public void advanceState(){
for(int y = 0; y <= ysiz-1; y++){
for(int x = 0; x <= xsiz-1; x++){
switch(mothership.getOpMode()){
case 1: mothership.state[xmin+x][ymin+y] = bintoInt(convertBin(newstate[x][y])); break;
case 4: mothership.state[xmin+x][ymin+y] = newstate[x][y]; break;
case 5: if(culture[x... | 8 |
public Component getComponent(String id) {
for (Component comp : components) {
if (comp.getId().equalsIgnoreCase(id))
return comp;
}
return null;
} | 2 |
public Help(MenuItem aboutMenuItem, MenuItem helpMenuItem) {
this.aboutMenuItem = aboutMenuItem;
this.helpMenuItem = helpMenuItem;
setSize(500,500);
setLocation(200,200);
textArea = new TextArea("", 100 , 100 , TextArea.SCROLLBARS_VERTICAL_ONLY);
textArea.setSize... | 0 |
public Period(int year, int month)
{
this.jaar = year;
this.maand = month;
this.locations = new ArrayList<DataPoint>();
} | 0 |
public int func_48462_d(int par1, int par2, int par3)
{
return par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000 ? (par2 < 0 ? 0 : (par2 >= 256 ? 0 : this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4).getBlockLightOpacity(par1 & 15, par2, par3 & 15))) : 0;
} | 6 |
public String jsonparse(String file, String name) {
JSONParser parser = new JSONParser();
try {
Object obj = parser.parse(new FileReader(file));
JSONObject jsonObject = (JSONObject) obj;
String gap = (String) jsonObject.get(name);
return gap;
} cat... | 3 |
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (!plugin.hasPerm(sender, "worldlist", true)) {
sender.sendMessage(ChatColor.YELLOW
+ "You do not have permission to use /" + label);
return true;
}
sender.sendMessage(ChatColor.YELLOW + "Worlds running... | 5 |
public int compare(Point a, Point b) {
if (priorityX) {
if (a.x < b.x) {
return -1;
} else if (a.x > b.x) {
return 1;
} else {
if (a.y < b.y) {
return -1;
} else if (a.y > b.y) {
return 1;
} else {
return 0;
}
}
} else {
if (a.y < b.y) {
return -1;
} else... | 9 |
@Override
public void affectPhyStats(Physical affected, PhyStats affectableStats)
{
super.affectPhyStats(affected,affectableStats);
// when this spell is on a MOBs Affected list,
// it should consistantly put the mob into
// a sleeping state, so that nothing they do
// can get them out of it.
if((affected... | 7 |
public void setNom(String nom) {
this.nom = nom;
} | 0 |
public void updateItem(PosListaPrecio itemOracle,
int idPos){
// PREGUNTO SI EL ID DEL ITEM VIENE EN NULO
if (itemOracle.getPcaIdElemento() != null) {
//TRAIGO EL ITEM POS SEGUN EL PCIDELEMENTO DE ORACLE
PhpposItemsEntity itemPos = getItemPos(itemOracle.getPcaIdElemen... | 5 |
private Node insert(K key, E value, Node node) {
if (node == null) {
return new Node(key, value, 1);
}
int compareResult = node.key.compareTo(key);
if (compareResult == 0) {
node.value = value;
} else if (compareResult > 0) {//new key is less than in curre... | 4 |
@JavaScriptMethod
public void startAlarm() {
if (isDemoModeEnabled()) {
CiLightGlobalConfiguration config = CiLightGlobalConfiguration.get();
List<Endpoint> endpoints = config.getEndpoints();
for (Endpoint endpoint : endpoints) {
try {
... | 3 |
public void update(Observable o, Object arg)
{
if (cellModel.getExploded()) { //means we draw an exploded mine, should only be true once per game
representation = 'X';
}
else {
if (!cellModel.getRevealed()) {
if (cellModel.getFlagged()) {
representation = 'F'; //draw a flagged cell (note tha... | 5 |
@Override
protected void readChild(XMLStreamReader in) throws XMLStreamException {
String childName = in.getLocalName();
if (Event.getXMLElementTagName().equals(childName)) {
Event event = new Event(null, getSpecification());
event.readFromXML(in);
events.add(even... | 8 |
public void setEnabled(Component component, boolean enabled) {
tabbed.setEnabledAt(tabbed.indexOfComponent(component), enabled);
distributeChangeEvent();
} | 0 |
public Subcommand checkCommand(String name) throws CommandException {
Subcommand cmd = cmdMap.get(name);
if (cmd == null) {
throw new CommandException("Command \"" + name + "\" not found");
}
return cmd;
} | 1 |
private static void loadServerInfo(Element element) throws ESBBaseCheckedException {
String serverName;
String serverType;
String nodeName;
String memo;
// 启用CPU测量和线程争用监视
ManagementFactory.getThreadMXBean().setThreadCpuTimeEnabled(true);
ManagementFactory.getThre... | 9 |
public static boolean dbConnect(String confName){
try{
Map<String,String> confMap = config.get(confName);
if (confMap != null){
if (confMap.get("type").equals("db")){
DataBase dataBase = null;
switch (confMap.get("base_type")){
case "mysql": dataBase = new MySQLImpl();
break;
c... | 6 |
public boolean validateLoggedIn() {
boolean result = false;
if(this.name != null && this.password != null) {
result = true;
}
return result;
} | 2 |
public static void main(String[] argv) {
// Fonction main contenant des jeux de tests pour les méthodes à compléter.
// En commentaire : la trace d'exécution attendue.
MyPanel panel = new MyPanel();
int x = 50;
int y = 50;
int size = 40;
int colorIndexFrom0To5 = 4;
int posX = 1;
int posY = 1;
B... | 4 |
public static void getDiff(File newFile, File printFile, File replaceFile) {
HashMap<String, Integer> printed;
HashMap<String, Integer> potentialPrints = new HashMap<String, Integer>();
HashMap<String, Integer> latestEdition = new HashMap<String, Integer>();
try {
printed = addFiles(printedFile);
potent... | 1 |
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.