text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void timechk() {
for (World w : plugin.gmtWorlds) {
if (plugin.getConfig().getBoolean("worlds." + w.getName() + ".keep_night")
&& plugin.gmtPlayerCount.containsKey(w.getName())
&& plugin.gmtHasSwitched.contains(w.getName())) {
if (plugin... | 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 void mouseReleased(MouseEvent e) {} | 0 |
public ImagePreview(String src) {
super();
try {
image = ImageIO.read(new File(src));
} catch (IOException ex) {
}
setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
} | 1 |
public void scrollCellToView(JTable table, int rowIndex, int vColIndex) {
if (!(table.getParent() instanceof JViewport)) {
return;
}
JViewport viewport = (JViewport) table.getParent();
Rectangle rect = table.getCellRect(rowIndex, vColIndex, true);
Rectangle viewRect =... | 9 |
public final void grabMouse() {
if(!this.hasMouse) {
this.hasMouse = true;
if(this.levelLoaded) {
try {
Mouse.setNativeCursor(this.cursor);
Mouse.setCursorPosition(this.width / 2, this.height / 2);
} catch (LWJGLException var2) {
var2.printStackTrace();
}
if(this.canvas == null) ... | 4 |
public boolean isViable(Field field)
{
// How many counts are non-zero.
int nonZero = 0;
if(!countsValid) {
generateCounts(field);
}
for(Class key : counters.keySet()) {
Counter info = counters.get(key);
if(info.getCount() > 0) {
... | 3 |
@Override
public void copySources( HashMap<String, Source> srcMap )
{
if( srcMap == null )
return;
Set<String> keys = srcMap.keySet();
Iterator<String> iter = keys.iterator();
String sourcename;
Source source;
// Make sure the buffer m... | 9 |
public boolean add(Pet pet) {
for (int i = 0; i < list.length; i++) {
if (list[i] == null) {
list[i] = pet;
return true;
}
}
Pet[] tempList = new Pet[list.length + 1];
for (int j = 0; j < list.length; j... | 3 |
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(map, 0, 0, this);
if (players != null) {
for (Player p: players) {
g.setColor(Color.RED);
g.fillOval(p.getX(), p.getY(), 10, 10);
g.setColor(Color.BLACK);
g.drawOval(p.getX(), p.getY(), 10, 10)... | 3 |
public void load() throws IOException, InvalidConfigurationException {
if (!file.exists()) {
BufferedWriter writer = null;
BufferedReader reader = null;
try {
InputStream in = CommandBoat.getInstance().getResource("commands.yml");
reader = new... | 5 |
public static void UpperStreet(){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
conn.setAutoCommit(false);
PreparedStatement stmnt... | 4 |
public void actionPerformed(ActionEvent e) {
ConfigurationButton button = null;
try {
button = (ConfigurationButton) e.getSource();
} catch (ClassCastException ex) {
return; // Then, we don't care.
}
Configuration config = button.getConfiguration();
if (!configurationToButtonMap.containsKey(config))
... | 3 |
public void allMove() {
// 물고기들을 이동시키고 충돌확인하고 이벤트를 처리하는 메소드
// 컴퓨터 물고기와 플레이어 물고기를 모두 논리이동시킨다
for (int i = 0; i < curFishNumber; i++) {
fishList.elementAt(i).move();
}
this.playerFish1.move();
if (this.gameMode == FishEater.GAME_RUN_2P) {
this.play... | 9 |
protected void toString2(StringBuffer sbuf) {
sbuf.append("pos=").append(position).append(", len=")
.append(length).append(", in=").append(incoming)
.append(", exit{");
if (exit != null) {
for (int i = 0; i < exit.length; i++)
sbuf.append(exit[i].posit... | 3 |
protected void submitData(){
if (isComplete()){
String name = nameField.getText();
float magneticHeading = Float.parseFloat(magneticHeadingField.getText());
//float altitude = Float.parseFloat(altitudeField.getText()) / UnitConversionRate.convertDistanceUnitIndexToFactor(runw... | 9 |
public Player(Vector3f position) {
if(mesh == null)
{
Vertex[] vertices = new Vertex[]{new Vertex(new Vector3f(-SIZEX,START,START), new Vector2f(0.1f,0.1f)),
new Vertex(new Vector3f(-SIZEX,SIZEY,START), new Vector2f(0.1f,0.1f)),
new Vertex(new Vector3... | 2 |
@Test
public void testCreateServices() throws Exception {
//Test TestTicketPoolManager can be initialized without throwing any exception.
ServiceManager.getServices().initializeServices(new Object[] {new TestRailwayRepository(), new TestTicketPoolManager()});
//IRailwayRepository repo = ServiceManager.getS... | 0 |
public ConnectionHandler(Socket sock) throws IOException {
this.socket = sock;
out = new PrintWriter(socket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
} | 0 |
public static boolean transform(LoopBlock forBlock, StructuredBlock last) {
if (!(last.outer instanceof SequentialBlock))
return false;
SequentialBlock sequBlock = (SequentialBlock) last.outer;
if (!(sequBlock.subBlocks[0] instanceof InstructionBlock))
return false;
InstructionBlock init = (Instructio... | 6 |
@Override
public double getFMeasure(String classValue)
throws IllegalArgumentException {
if( classValue == null)
throw new IllegalArgumentException("Error: null class value");
if( this.valueToIndex.get(classValue) == null)
throw new IllegalArgumentException("Error: state = " + classValue + " didn't fou... | 8 |
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!sender.hasPermission("under50.broadcast")) {
sender.sendMessage(ChatColor.RED + "No permission");
return true;
}
if (args.length == 0) {
sender.sendMessage("Try /bc... | 3 |
public boolean useTeleport() {
if (teleports > 0) {
teleports--;
return true;
} else {
return false;
}
} | 1 |
private OSCMessage convertMessage() {
OSCMessage message = new OSCMessage();
message.setAddress(readString());
char[] types = readTypes();
if (null == types) {
// we are done
return message;
}
moveToFourByteBoundry();
for (int i = 0; i < types.length; i++) {
if ('[' == types[i]) {
// we're lo... | 4 |
boolean canMoveTo(int inLocX, int inLocY,LivingThing thnStore)
{
int i;
LivingThing thnStore2;
DuskObject objStore=null;
Script scrStore;
boolean blnStore;
try
{
objStore = objEntities[inLocX][inLocY];
}catch(Exception e) {}
if (scrCanMoveThroughLivingThing != null)
{
while (objStore != null)... | 7 |
public boolean kickFromChannel(String chan, String msg) {
boolean success = true;
msg = addNewLines(msg);
String[] msgArr = msg.split("\n");
char ch;
for(int j=0;j<msgArr.length;j++) {
/*
* Meaning if one call to sendln returns false
* This entire function will return false
... | 2 |
private static int idchf(palString string) {
int ivec, ictab;
char c = ' ';
int nptr = string.getPos();
int digit = 0;
int l_string = string.length();
/* Character/vector tables */
TRACE("idchf");
final int NCREC = 20;
final char kctab[] =
... | 4 |
public World() {
try {
map = new TiledMap("res/map/map.tmx");
} catch (SlickException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
layerMap = new CustomLayerBasedMap(map, map.getLayerIndex("objects"), map.getLayerIndex("npc"));
} | 1 |
@Override
public String execute() {
ContactListHandler contactListHandler = new ContactListHandler();
contactListHandler.setContactDao(new ContactDao());
try {
contactListHandler.executeSearch();
int currentPage = getCurrentPage(commandParameter.getRequestParameter(COMMAND_PARAM), commandPara... | 4 |
@EventHandler
public void onEntityShootBow(EntityShootBowEvent event)
{
if (event.getEntity() instanceof Player)
{
ItemStack item = event.getBow();
if (item == null || !Config.isItemEnabled(plugin, item.getTypeId()))
{
return;
}
Weapon weapon = new Weapon(plugin, item);
int levelState = we... | 4 |
private void start(String props, String cluster_name,
long rpc_timeout, long caching_time, boolean migrate_data, boolean use_l1_cache,
int l1_max_entries, long l1_reaping_interval,
int l2_max_entries, long l2_reaping_interval) throws Exception {
... | 7 |
protected CasavaFastqParser(String id) {
Matcher m = Pattern.compile(REGEX).matcher(id);
// Last guard block
if (!m.matches())
return;
setAttribute(IdAttributes.FASTQ_TYPE, NAME);
for (IdAttributes a : regexAttributeMap.keySet()) {
String value = m.group(regexAttributeMap.get(a));
if (value != null)
... | 3 |
@Override
public int authorized(String email, String password)
{
int ret = -1;
/*
SELECT id, password, group_id
FROM b_user AS bu
RIGHT JOIN b_user_group AS bug ON bu.id = bug.user_id
WHERE login = ? AND group_id = 1 AND active = 'Y'
*/
String q =
"SELECT id, password, group_id\n" +
"FROM b_user AS bu\n" ... | 5 |
public void test_constructor() {
try {
new ScaledDurationField(null, DurationFieldType.minutes(), 10);
fail();
} catch (IllegalArgumentException ex) {}
try {
new ScaledDurationField(MillisDurationField.INSTANCE, null, 10);
fail();
} catch (... | 4 |
@Override
public String display() { //Displays assembly language program with line numbers
String displayString = " <Label>: <Instruction/Operand> <#Comment>\n\n";
if (leadingComments.size() > 0) { //Display leading comments, if there are any
for (int i = 0; i < leadingComments.size(); i++) {
displ... | 4 |
private static BitSet fromByteArray(byte[] bytes) {
BitSet bits = new BitSet();
for (int i=0; i<bytes.length*8; i++) {
if ((bytes[bytes.length-i/8-1]&(1<<(i%8))) > 0) {
bits.set(i);
}
}
return bits;
} | 2 |
public AlphaMerger(int[] alpha) {
this.alpha = alpha;
} | 0 |
public String setMidiOut(int id)
{
if(_synthesizer != null)
{
_synthesizer.close();
_synthesizer = null;
_midiDevices.setSynthesizer(_synthesizer);
}
if(id > _midiDevices.getNumberOfDevices())
{
return "<midi-out>" + id + "</mi... | 8 |
public int compare(boolean[] class_list, int datapoint) throws BoostingAlgorithmException{
int c;
int class_index = -1;
int classification = -1;
//determine what class in the classlist the datapoint has
for (c = 0; c < classes; c++) {
if (data.classes[datapoint].equals(data.classlist[c])) {
class_index... | 9 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(args.length != 3) {
printArgsError(args);
printHelp(sender, label);
return true;
}
String target = findTarget(args[1]);
int chargeId = -1;
try {
chargeId = Integer.valueOf(args[2]);
} catc... | 9 |
@Before
public void setUp() {
a = new DynamicArray();
} | 0 |
public void addAnnouncementToDB() {
try {
String statement = new String("INSERT INTO " + DBTable
+ " (title, content, time)"
+ " VALUES (?, ?, NOW())");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement, new String[] {"aid"});
stmt.setString(1, title);
stmt.setString(2, cont... | 1 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=profi... | 7 |
private void verifyResource(String attributeName, String nameRes, String resType) {
if (nameRes == null || !nameRes.startsWith("@"+resType+"/"))
throw new InvalidPackConfiguration(mFileName, "Node "+mNodeName+" has an invalid "+attributeName+" "+resType+" resource !");
} | 2 |
public void testFactory_parseWeeks_String() {
assertEquals(0, Weeks.parseWeeks((String) null).getWeeks());
assertEquals(0, Weeks.parseWeeks("P0W").getWeeks());
assertEquals(1, Weeks.parseWeeks("P1W").getWeeks());
assertEquals(-3, Weeks.parseWeeks("P-3W").getWeeks());
assertEquals... | 2 |
public static void verify(FastaFile obj1, FastaFile obj2)
{
boolean equal=true;
if(obj1.getDataBase().size()!=obj2.getDataBase().size())
{
equal=false;
}
for(int i=0;i<obj1.getDataBase().size();i++)
{
for(int j=0;j<obj1.getDataBase().get(i).getFoundPositionList().size();j++)
if((obj1.getDataBase()... | 5 |
public Player cPlayer(){
Player player = new Player();
return player;
} | 0 |
private int adjustedHandStrength(int rawHandStrength) {
int ahs = 0;
for(int j = 0; j < 15; j++) {
if(rawHandStrength < boundaries[j]) {
ahs = j;
break;
} else if(j == 14) {
ahs = j;
break;
} else {
rawHandStrength -= boundaries[j];
}
}
return Math.min(ahs, 15);
} | 3 |
private void getResultCategorization(CategoryPOJO spreadCategory) {
// verifica a maior tipo de ocorrencia e diz o tipo de categoria correspondente
Object[] keyCount = count.keySet().toArray();
for (int j = 0; j < keyCount.length; j++) {
// adiciona 1 na linha, pois o DDex comeca com zero e a planilha com 1
... | 4 |
public void setDecisionAnswer(ArrayList<String> answ, ArrayList<String> numbers) {
questAnswer=answ;
goToList=numbers;
} | 0 |
@Override
/** Questo è il listener per la menuBar */
public void actionPerformed(ActionEvent arg0) {
/** Per salvare prende la lista di locazioni e la salva */
if (arg0.getSource().equals(save)) {
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.showSaveDial... | 7 |
@Override
public boolean move(int row, int col) {
if (this.row == row && this.col != col) {
this.col = col;
return true;
} else if (this.row != row && this.col == col) {
this.row = row;
return true;
}
return false;
} | 4 |
protected boolean validate()
{
m_file = new File(m_fileCombo.getText());
if (!m_file.exists() || !m_file.isFile()) {
m_errorMsg = "File not found:\n" + m_fileCombo.getText();
return false;
}
if (!m_file.canRead()) {
m_errorMsg = "Cannot read file:\n" + m_fileCombo.getText();
return false;
}
try... | 8 |
public ArrayList<String> getList()
{
String line;
try {
while((line=reader.readLine())!=null)
{
list.add(line);
}
} catch (IOException e) {
e.printStackTrace();
}
return list;
} | 2 |
public TreeNode<Integer> findNext(TreeNode<Integer> n) {
if (n == null)
return null;
if (n.right != null) {
TreeNode<Integer> p = n.right;
while (p.left != null) {
p = p.left;
}
return p;
} else {
TreeNode<Integer> p = n.parent;
while (p.parent != null) {
if (p == p.parent.left)
... | 5 |
private String postResult(String URL){
StringBuffer sb= new StringBuffer();
try {
String finalUrl="";
String[] parsedUrl=URL.split("\\?");
String params=URLEncoder.encode(parsedUrl[1], "UTF-8").replace("%3D","=").replace("%26","&");
URL url= new... | 7 |
protected void tallennaActionPerformed() {
String kurssinNimi = kurssinNimiField.getText().trim();
if (kurssinNimi.equals("")) {
JOptionPane.showMessageDialog(this, "Kurssin nimi ei voi olla tyhjä!", "Virhe! Kurssilta puuttuu nimi.", JOptionPane.ERROR_MESSAGE);
return;
... | 3 |
public boolean epoch(Player p){
if (noimprove < noimprove_max){
noimprove++;
//Update our average EPOCH statistics
if (!new_model){
//Update the "noimprove" and DL_max/DL_min variables
if (p.MODEL_allmoves-min_allmoves+EPSILON < 0){
min_allmoves = p.MODEL_allmoves;
noimprove = 0;
}
... | 5 |
public static void main(String[] args){
//create instance of "Class"
Class<?> c = null;
try{
c=Class.forName("Foo");
}catch(Exception e){
e.printStackTrace();
}
//create instance of "Foo"
Foo f = null;
try {
f = (Foo) c.newInstance();
} catch (Exception e) {
e.printStackTrace();
}
... | 3 |
public static int[][] openMatrixfile(String filename) throws FileNotFoundException {
File inputFile = new File("src" + File.separator + "gol" + File.separator + filename);
if(!inputFile.exists()){
return null;
}
Scanner lengthScanner = new Scanner(inputFile);
int arrayLength =1;
String linje ... | 5 |
@Override
public Map<String, ?> resourceMap( DrawingContext context )
throws MojoExecutionException
{
for ( String range : StringUtils.split( ranges, ',' ) )
{
try
{
String[] members = StringUtils.split( range, '-' );
if ( ArrayUti... | 8 |
public static void disposeImages() {
// dispose loaded images
{
for (Image image : m_imageMap.values()) {
image.dispose();
}
m_imageMap.clear();
}
// dispose decorated images
for (int i = 0; i < m_decoratedImageMap.length; i++) {
Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decora... | 5 |
@Override
public boolean equals(Object o)
{
if (o == null)
return false;
if (o == this)
return true;
if (o.getClass() != this.getClass())
return false;
Vector3D other = (Vector3D)o;
return x == other.x && y == other.y &... | 5 |
public int getSelection()
{
if(selectionOvalY == 94) return 1;
else if(selectionOvalY == 114) return 2;
else if(selectionOvalY == 134) return 3;
else if(selectionOvalY == 154) return 4;
else if(selectionOvalY == 174) return 5;
return 0;
} | 5 |
public void init(int mode, byte[] key, byte[] iv) throws Exception{
String pad="NoPadding";
byte[] tmp;
if(iv.length>ivsize){
tmp=new byte[ivsize];
System.arraycopy(iv, 0, tmp, 0, tmp.length);
iv=tmp;
}
if(key.length>bsize){
tmp=new byte[bsize];
System.arraycopy(k... | 4 |
public final boolean matchesSub(Identifier ident, String name) {
if (ident instanceof PackageIdentifier)
return true;
if (ident instanceof ClassIdentifier) {
ClassIdentifier clazz = (ClassIdentifier) ident;
return (clazz.isSerializable() && (!onlySUID || clazz.hasSUID()));
}
return false;
} | 4 |
private void updateChangesFull(DnBData data, Node changes) throws ParseException
{
// changes = <MON_PROD_RS>
for(int i=0;i<changes.getChildNodes().getLength();i++) // this should be length 1, should I check ?
{
Node changeNode = changes.getChildNodes().item(i); // this is <ArrayOfMON_PROD_RSItem>, if anyone'... | 7 |
public boolean deplaceSoldat(Position pos, Soldat soldat){
Position posSoldat = soldat.getPos();
Element depart = getElement(posSoldat.getX(), posSoldat.getY());
Element arrivee = getElement(pos);
if (!arrivee.estLibre() || soldat.aJoue()) // Si le t... | 2 |
public void setMarkedAccessible(boolean markedAccessible) {
if(this.e.getType() != BackgroundEnum.water || (!this.e.estLibre() && this.e.getSoldat() instanceof Heros))
this.markedAccessible = markedAccessible;
} | 3 |
protected void resetQueue()
{
queueNode trc;
queueNode trcPrev = null;
//Delete expired nodes
trc = jHead;
while(trc!=null)
{
if(trc.getExpired())
{
if(trcPrev == null)
{
jHead = trc.getNext();
if(jHead == null)
jTail = null;
}
else if(trc.getNext()==null)
{
... | 8 |
public KeyInfoType getKeyInfo() {
return keyInfo;
} | 0 |
Space getForkSpace(Piece piece) {
Space[] oppSpaceArray = getSpacesWithPiece(piece);
Space[][] openSetsLast = getOpenSets(lastSpaceMoved);
for (Space oppSpace : oppSpaceArray) {
if (oppSpace != lastSpaceMoved) {
Space[][] openOppSets = getOpenSets(oppSpace);
for (Space[] oppSet : openOppSets) {
fo... | 6 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
int UserId = Main.DecodeInt();
Player Client = Environment.ClientManager.GetClient(UserId);
if(Client == null) return;
if((Client.Flags & Server.plrOnline) != Server.plrOnline) // Is Online?
{
... | 4 |
@Override
protected void done() {
try{
out = get();
System.out.println("done!");
}catch(Exception e){
e.printStackTrace();
}
} | 1 |
public boolean TryConnect(Configuration Config)
{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection = (new DatabasePool(Config)).GrabConnection();
Statement = Connection.createStatement();
return true;
}
catch (ClassNotFoundException C... | 2 |
private static BigDecimal processCoinEntry(int[] coin_totals, BigDecimal balance, Coin inserted_coin) {
// convert value to String
String insert_Coin_str = inserted_coin.getValue().toString();
switch (insert_Coin_str) {
case "1":
addCoinToCategoryTotal(coin_totals, ... | 4 |
public static void main(String[] args) throws IOException {
// On cherche le datastore enregistré précédemment.
String workingDir = System.getProperty("user.dir");
try {
BufferedReader br = new BufferedReader(new FileReader(workingDir + "/dataStoreLocation.loc"));
String sCurrentLine;
while ((sCurr... | 4 |
@EventHandler
public void GiantHarm(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getGiantConfig().getDouble("Giant.Harm.DodgeCha... | 6 |
private void readToken() {
while (true) {
prompt();
String token = _input.findWithinHorizon(TOKEN_PATN, 0);
if (token == null) {
token = "*EOF*";
} else if (token.startsWith("'")) {
if (token.length() == 1 || !token.endsWith("'")) {... | 9 |
public static void backTrack(Graph_ST<Vertex_ST, Edge_ST> gST, String esWFF) {
if (!gST.edgeSet().isEmpty()) {
for (Edge_ST e : gST.edgeSet()) {
// build up links between effect scenarios
if (gST.getEdgeTarget(e).esWFF.equals(esWFF)) {
a.e.println("Given an effect scenario, locate the task and effect... | 6 |
private void setUpVisibleRowOfCards(Card[][] cards) {
/*
* Stage 3 (4 Marks)
*/
for (Card tempCard : cards[2]) {
tempCard.setIsFaceUp(true);
}
} | 1 |
synchronized void getGuichet(Voyageurs voyageur) {
while (nbGuichetDispo == 0) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
nbGuichetDispo--;
voyageur.setAUnGuichet(true);
} | 2 |
@Override
public void onUpdate(float delta) {
percentComplete += 100 * delta / waitTime;
if (percentComplete > 100) {
percentComplete = 100;
Activity.stopCurrentActivity();
try {
level.load(null);
} catch (IOException e) {
e.printStackTrace();
}
Material material = new Material();
m... | 5 |
int computeColumnIntersect (int x, int startColumn) {
CTableColumn[] orderedColumns = getOrderedColumns ();
if (orderedColumns.length - 1 < startColumn) return -1;
int rightX = orderedColumns [startColumn].getX ();
for (int i = startColumn; i < orderedColumns.length; i++) {
rightX += orderedColumns [i].width;
i... | 3 |
private static Class[] getClasses(Object[] parameters){
Class[] classes = new Class[parameters.length];
for(int j = 0; j < parameters.length; j++){
classes[j] = parameters[j].getClass();
if(classes[j]==Integer.class)classes[j] = int.class;
else if(classes[j]==Double.class)classes[j] = double.class;
else... | 9 |
@Override
public int hashCode() {
int result = (int) (orderId ^ (orderId >>> 32));
result = 31 * result + (driverId != null ? driverId.hashCode() : 0);
result = 31 * result + (source != null ? source.hashCode() : 0);
result = 31 * result + (target != null ? target.hashCode() : 0);
... | 4 |
@Override
public boolean ActUpon() {
if(getArguments()!= null){
if(getArguments()[0].equalsIgnoreCase("Stop")){
if(hasPermission("cloud.server.stop")){
getPlayer().sendMessage(ChatColor.RED+"Tried Stopping The Service!");
ClientHandler.getCH().Stop();
return true;
}else{noPermissions(); re... | 8 |
public static TimeValue parseTimeValue(String sValue, TimeValue defaultValue) {
if (sValue == null) {
return defaultValue;
}
long millis;
if (sValue.endsWith("S")) {
millis = Long.parseLong(sValue.substring(0, sValue.length() - 1));
} else if (sValue.ends... | 9 |
public void stopMoving(Direction dir) {
boolean foundDir = false;
for(int i = 0; i < queuedMoveDirectionPreferences.length - 1; i++) {
if(!foundDir && queuedMoveDirectionPreferences[i] == dir)
foundDir = true;
if(foundDir)
queuedMoveDirectionPreferences[i] = queuedMoveDirectionPreferences[i + 1];
}
... | 4 |
public void gameSolo() throws IOException{
// Changement du titre
this.setTitle("Vous jouez à Tetra Word en Solo");
this.setPreferredSize(new Dimension(1024,768));
// Arrière plan
JPanel panel = setBackgroundImage(this, new File("src/f... | 7 |
@Override
public int play(){
//If we've gone so many moves without progress, do a random move
//This will hopefully prevent deadlock over a zugzwang situation
Model m = (++turns % no_progress) == 0 ? random : learner;
boolean fromDiscard = m.decideDraw(turns);
int drawn = game.deck.draw(fromDiscard),
pos ... | 2 |
public EvaluationResult evaluate(List inputs, EvaluationCtx context) {
// Evaluate the arguments
AttributeValue [] argValues = new AttributeValue[inputs.size()];
EvaluationResult evalResult = evalArgs(inputs, context, argValues);
if (evalResult != null)
return evalResult;
... | 7 |
public List<Cliente> buscar(Cliente filtro) {
try {
String sql = "select * from pessoa p join cliente c on p.IdPessoa = c.IdPessoa where ativo = 1 ";
String where = "";
if (filtro.getNome().length() > 0) {
if (where.length() > 0) {
where ... | 8 |
public boolean noChildren() {
if(propChildren == null)
return true;
else
return false;
} | 1 |
public static void main(String[] args) throws InterruptedException {
Thread.currentThread().sleep(20000l);
int row;
int col;
ArrayList<String> colNameList = new ArrayList();
Object[][] data;
String sql;
String[] colName;
// File f=new File("D:\\sqlite\\logs\\log.out");... | 9 |
public boolean receptionConfirmation() throws IOException
{
boolean conf = input.readBoolean();
String msg = input.readUTF();
if (conf)
System.out.println("OK : "+msg);
else
System.err.println("KO : "+msg);
return conf;
} | 1 |
private void configureDetails() {
if (details != null) {
details.setVisible(false);
}
if (details != null) {
details.addEventFilter(EventType.ROOT, new EventHandler<Event>() {
@Override
public void handle(Event event) {
... | 4 |
private static final void method702(int i) {
Widget class46 = AbstractFontRasterizer.getWidget(i);
if (class46 != null) {
int i_3_ = i >>> 16;
Widget[] class46s = Class369_Sub2.aClass46ArrayArray8584[i_3_];
if (class46s == null) {
Widget[] class46s_4_
= Class348_Sub40_Sub33.aClass46ArrayArray94... | 5 |
public static void main(String[] args){
Scanner cin = new Scanner(System.in);
str = cin.next();
int limit = cin.nextInt();
int steps;
for (steps = 0; steps < limit; steps ++){
//check if palindromic,break
boolean flag = true;
for (int j = 0, k = str.length() - 1; j < k; j ++, k --)
if (str.cha... | 7 |
private void callUserAction() {
try {
callAction(UserAction.getByActionCode(readUserActionCode()));
} catch (UnsupportedOperationException | InputMismatchException e) {
String excMsg = "entered an incorrect value!";
view.printExceptionMsg(excMsg);
logger.w... | 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.