text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void sendData(ObjectOutputStream[] streams, double time){
for(int i=0;i<streams.length;i++){
if(streams[i] == null) continue;
try {
streams[i].writeDouble(time);
streams[i].writeInt(GameState.period);
streams[i].writeInt(GameState.state);
streams[i].writeObject(playerArray);
//write ... | 6 |
@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=pro... | 9 |
public void CraftRunesRift(String runeName, int lvlReq, int XPamount, int rune, int runeAmount, int delay, int emote) {
if(RCTimer == 0) {
if(playerLevel[20] >= lvlReq) {
setAnimation(emote);
sendMessage("You craft "+runeAmount+" "+runeName+" runes.");
addSkillXP(XPamount, 20);
addItem(rune, runeAmount);
... | 3 |
private void convertInstanceNumeric(Instance instance) {
double [] vals = new double [outputFormatPeek().numAttributes()];
int attSoFar = 0;
for(int j = 0; j < getInputFormat().numAttributes(); j++) {
Attribute att = getInputFormat().attribute(j);
if ((!att.isNominal()) || (j == getInputFormat... | 8 |
private VideoListVO addActionMessageToVO(VideoListVO videoListVO, Locale locale, String actionMessageKey, Object[] args){
if(StringUtils.isEmpty(actionMessageKey)){
return videoListVO;
}
videoListVO.setActionMessage(messageSource.getMessage(actionMessageKey, args, null, locale));
return videoListVO;
... | 1 |
public int yOf(int x) throws IllegalArgumentException {
//trivial rejections
if (x < this.lefterVertex().centerX()
|| x > this.righterVertex().centerX()) {
throw new IllegalArgumentException("x out of range: "
+ x);
}
if (this.isVertical())... | 9 |
public void send ()
{
int nbytes = 0;
ByteBuffer dummy = ByteBuffer.allocate(1);
dummy.limit(1);
while (true) {
try {
nbytes = w.write(dummy);
} catch (IOException e) {
throw new ZError.IOException(e);
}
... | 3 |
public String getHighlightMode() {
Object possibleName = getObject(HIGHLIGHT_MODE_KEY);
if (possibleName instanceof Name) {
Name name = (Name) possibleName;
if (name.getName().equalsIgnoreCase(HIGHLIGHT_NONE)) {
return HIGHLIGHT_NONE;
} else if (name.g... | 4 |
public void assign(String parameter, String expression) {
parametersToNumbers.put(parameter, valueOf(expression));
} | 0 |
public static Algorithm getAlgorithm() {
return algorithm;
} | 0 |
public void testPlus_int() {
Days test2 = Days.days(2);
Days result = test2.plus(3);
assertEquals(2, test2.getDays());
assertEquals(5, result.getDays());
assertEquals(1, Days.ONE.plus(0).getDays());
try {
Days.MAX_VALUE.plus(1);
f... | 1 |
public void getReporter() {
networkController.SendMessage("getPromotion#" + clientId + "," + clientType + "," + userBugReporter + "," + userName);
clientType = userBugReporter;
reporter = true;
cleanLabels();
if(observer)
getObserver.setVisible(true);
if(contributor)
getContributor.setVisible(tru... | 7 |
public void checkSideCollision(Rectangle rleft, Rectangle rright,
Rectangle leftfoot, Rectangle rightfoot) {
if (type != 5 && type != 2 && type !=0){
if (rleft.intersects(r)) {
robot.setCenterX(tileX + 102);
robot.setSpeedX(0);
} else if (leftfoot.intersects(r)){
robot.setCenterX(tileX+85);
r... | 7 |
public void afficherCompteRendu(RapportVisite leRapportViste){
this.vue.getjTextFieldNumRapport().setText(leRapportViste.getNumero_rap()+"");
this.vue.getjComboBoxPraticien().setSelectedItem(leRapportViste.getNumero().getNom()+" "+leRapportViste.getNumero().getPrenom());
// on crée l'ob... | 1 |
public void writeTODB(String CallingPeerAddress, String CalledPeerAddress,
String SetupTime, String STMS, String ConnectTime, String CTMS,
String DisconnectTime, String DTMS, boolean IsMissed, int TypeAppel) throws Exception {
try {
// this will load the MySQL driver, each DB... | 1 |
private static int add() {
int index; // contient l'index d'un élève
int matricule; // contient la matricule du nouvelle élève
String input; // contient la valeur renvoyé par la fonction getNumber()
// trouver de la place libre dans le tableau
index = getStudent(999, false)... | 8 |
@Override
public boolean isAnsweredCorrectly() {
if(answer1RadioButton.isSelected() && choices[0].getIsCorrect())
return true;
if(answer2RadioButton.isSelected() && choices[1].getIsCorrect())
return true;
if(answer3RadioButton.isSelected() && choices... | 8 |
@Override
public IAttemptClientConnect getAttemptClientConnect() {
return this.attemptClientConnect;
} | 0 |
private JPanel setupSourceImageControlsPanel() {
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT));
panel.setBorder(new TitledBorder("Source Image Layout"));
JPanel scalePanel = new JPanel();
scalePanel.setLayout(new GridLayout(2, 2));
scalePanel.setBorder(new TitledBorder("Scal... | 8 |
public static ConnectionManager getInstance() {
if (instance == null) {
instance = new ConnectionManager();
}
return instance;
} | 1 |
@Override
public void draw(Graphics g) {
Color tileTypeColor = Color.black;
for (int i = 0; i < tile.length; i++) {
for (int j = 0; j < tile[i].length; j++) {
if (tile[i][j] != null) {
switch (tile[i][j]) {
case CLOISTER:
tileTypeColor = red;
break;
case CITY:
tileTypeC... | 8 |
public void testFactory_Zone_long_int() {
GJChronology chrono = GJChronology.getInstance(TOKYO, 0L, 2);
assertEquals(TOKYO, chrono.getZone());
assertEquals(new Instant(0L), chrono.getGregorianCutover());
assertEquals(2, chrono.getMinimumDaysInFirstWeek());
assertSame(GJChronology... | 2 |
public UserControlParseAction(GrammarEnvironment environment) {
super("User Control Parse", null);
this.environment = environment;
this.frame = Universe.frameForEnvironment(environment);
} | 0 |
protected void mark(int originPosition,int positionToMark,Cell[] cellBoard)
throws IllegalMark{
if (cellBoard[positionToMark] == Cell.DEFAULT_EMPTY_CELL){
cellBoard[positionToMark] = Cell.DEFAULT_TAKEN_CELL;
}
else{
if(cellBoard[positionToMark] == Cell.DEFAULT... | 2 |
public void process()
{
Parser.Events event = Parser.Events.ev_TAG;
try {
outXmlFd.write("<mediawiki>");
} catch (IOException e) {
e.printStackTrace();
}
while (Parser.Events.ev_NONE != event)
{
event = this.p.parse();
... | 8 |
public static void main(String[] args) {
Queue<Integer> queue = new LinkedList<Integer>();
Random rand = new Random(47);
for (int i = 0; i < 10; i++)
queue.offer(rand.nextInt(i + 10));
printQ(queue);
Queue<Character> qc = new LinkedList<Character>();
for (char c : "Brontosaurus".toCharArray())
qc.offe... | 2 |
public DockHeader(DockContainer dc) {
super.setLayout(this);
setOpaque(true);
setBackground(DockColors.BACKGROUND);
setBorder(new CompoundBorder(new SelectiveLineBorder(DockColors.SHADOW, 0, 0, 1, 0), new EmptyBorder(0, 4, 0, 4)));
for (Dockable dockable : dc.getDockables()) {
add(new DockTab(dockable));
... | 1 |
public void testPropertyCompareToDayOfWeek() {
DateTime test1 = new DateTime(TEST_TIME1);
DateTime test2 = new DateTime(TEST_TIME2);
assertEquals(true, test2.dayOfWeek().compareTo(test1) < 0);
assertEquals(true, test1.dayOfWeek().compareTo(test2) > 0);
assertEquals(true, test1.da... | 2 |
public void newfocusable(Widget w) {
if (focusctl) {
if (focused == null)
setfocus(w);
} else {
parent.newfocusable(w);
}
} | 2 |
public ArrayList<ArrayList<Integer>> fourSum(int[] num, int target) {
ArrayList<ArrayList<Integer>> results = new ArrayList<ArrayList<Integer>>();
Arrays.sort(num);
for(int i=0; i<num.length-3; i++)
{
int a = num[i];
for (int j=i+1; j<num.length-2; j++)
... | 8 |
public void print(){
System.out.println("GAMEBOARD ::: ");
for (int i = 0; i < 8; i++){
for(int j = 0; j < 8; j++){
if(gameBoard[i][j] == PieceType.WHITE){
System.out.print("("+i+","+j+")"+"W ");
}else if(gameBoard[i][j] == PieceType.BLACK){
System.out.print("("+i+","+j+")"+"B ");... | 5 |
private ServerSideJob pickJob(final Communicator comm) {
ServerSideJob result = null;
// traverse job, check complexity and cancel time
List<JobAction> actionList;
Calendar cal;
synchronized (jobQueue) {
for (ServerSideJob job : jobQueue) {
final int ... | 6 |
public void handle(final IRCChannel c, final Player player,
final String message) {
if (c.getChatType() == ChatType.TOWNYCHAT) {
if (Bukkit.getServer().getPluginManager().getPlugin("mcMMO") != null) {
if (Users.getProfile(player.getName()).getAdminChatMode()) {
... | 4 |
public List<Runway> getRecentRunway()
{
try{
List<Runway> runways = DatabaseDataObjectUtilities.getRunways();
List<Runway> recentRunwayList = new ArrayList<Runway>();
if(instance == null)
{
return null;
}
else
... | 7 |
public void execute(String message) throws Exception {
while (true) {
try {
this.currency = CurrencySet.getInstance().search(readCurrency(reader, message));
break;
} catch (CurrencySet.CurrencyNotFoundException ex) {
System.out.println(ex.g... | 4 |
public void runSimulation() throws VehicleException, SimulationException,
IOException {
this.log.initialEntry(this.carPark, this.sim);
for (int time = 0; time <= Constants.CLOSING_TIME; time++) {
// queue elements exceed max waiting time
if (!this.carPark.queueEmpty()) {
this.carPark.archiveQueueFailur... | 5 |
public Object getInstance(Class<?> clazz) {
try {
Constructor<?> ctr = clazz.getConstructor(argClasses);
ctr.setAccessible(true);
return ctr.newInstance(args);
} catch (NoSuchMethodException e) {
logger.severe("Error initializing commands class " + clazz + ": ");
e.printSta... | 6 |
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (!(npc instanceof L2Attackable))
return null;
if (event.equalsIgnoreCase("skill"))
{
int playableCounter = 0;
for (L2Playable playable : npc.getKnownList().getKnownTypeInRadius(L2Playable.class, npc.getAggroRange()... | 6 |
public static void teleportPlayerToLocation( BSPlayer p, Location t ) {
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream( b );
try {
out.writeUTF( "TeleportToLocation" );
out.writeUTF( p.getName() );
out.write... | 2 |
public static void calculateDistanceToBorder(BotState state) {
Map visibleMap = state.getVisibleMap();
for (Region region : visibleMap.getRegions()) {
if (region.getPlayerName().equals(state.getMyPlayerName())) {
// 1000 as initialization
region.setDistanceToBorder(1000);
} else {
region.setDistan... | 6 |
@Test
public void shouldSortElement() throws Exception {
Integer[] array = new Integer[]{81, 94, 11, 96, 12, 35, 17, 95, 28, 58, 41, 75, 15};
sort.sort(array);
for(int i:array){
System.out.println(i);
}
} | 1 |
public void setBounds(int x, int y, int w, int h)
{
this.x = x;
this.y = y;
this.w = w;
this.h = h;
} | 0 |
public void setChargeTermid(String chargeTermid) {
ChargeTermid = chargeTermid;
} | 0 |
public static void dealWithAmPm(Stella_Object formValue, DecodedDateTime parsedValues) {
{ int hour = parsedValues.dateTimeHour;
if (formValue == Stella.SYM_STELLA_AM) {
if (hour == 12) {
parsedValues.dateTimeHour = 0;
}
else if (!((0 <= hour) &&
(hour <= 12))) {... | 8 |
public Genre getGenre() {
return genre;
} | 0 |
public Player findPlayer() {
for (Cell[] c : grid) {
for (Cell cell : c) {
if (cell.contains(Player.class)) {
try {
return (Player)cell.getOccupant();
} catch (Exception e) {
System.err.println("Player not found.");
}
}
}
}
return null;
} | 4 |
public static ModInstance convertString(String line)
{
String[] modString = line.split(";");
fileType type = fileType.General;
downloadType dType = downloadType.URL;
try
{
int var2 = Integer.parseInt(modString[1]);
type = fileType.values()[var2];
... | 8 |
public int checkCOS()
{
if(cornerMap.get("C").equals("C")
&& cornerMap.get("O").equals("O")
&& cornerMap.get("S").equals("S"))
{
return SOLVED;
}
if(cornerMap.get("C").equals("O")
&& cornerMap.get("O").equals("S")
&& cornerMap.get("S").equals("C"))
{
return CW;
}
if(cornerMap.get("C... | 9 |
public boolean accept(File file) {
if (file.isDirectory()) {
return true;
}
int count = extensions.length;
String path = file.getAbsolutePath();
for (int i = 0; i < count; i++) {
String ext = extensions[i];
if (path.endsWith(ext)
&& (path.charAt(path.len... | 4 |
static final boolean method1089(int i, char c) {
anInt1807++;
if (i >= -107)
aBooleanArray1806 = null;
if ((c ^ 0xffffffff) < -1 && c < 128
|| (c ^ 0xffffffff) <= -161 && (c ^ 0xffffffff) >= -256)
return true;
if ((c ^ 0xffffffff) != -1) {
char[] cs = Class44.aCharArray625;
for (int i_11_ =... | 8 |
public void testIsConditionalSentence() {
System.out.println("\n*** testIsConditionalSentence ***");
try {
CycFormulaSentence sentence = getCyc().makeCycSentence("(#$likesAsFriend ?X ?Y)");
boolean conditional = sentence.isConditionalSentence();
assertEquals(conditional, false);
sentence... | 1 |
public void run() {
try {
ObjectOutputStream out = new ObjectOutputStream(server.getOutputStream());
ObjectInputStream in = new ObjectInputStream(server.getInputStream());
// --Mutil User but can't parallel
String [] arr= (String[]) in.readObject();
System.out.println(arr[0]+arr[1]);
switch (arr[0])... | 6 |
private void fileIOOrError(File file, boolean result, boolean create) {
if (!result) {
plugin.getLogger().severe("The updater could not " + (create ? "create" : "delete") + " file at: " + file.getAbsolutePath());
}
} | 2 |
private boolean save() {
if (dic == null) {
return false;
}
File f;
if (defaultFile == null) {
CostumFileChooser chooser = new CostumFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter(Localization.getInstance().get("dictionaryFiletypeFilterName"), "dict");
chooser.setFileFil... | 4 |
public synchronized boolean updateCheck ()
{
Scanner s = null;
try
{
s = new Scanner(versionUrl.openStream());
remoteVersion = s.nextLine();
if (this.compareVersions())
{
upToDate.set(false);
s.close();
... | 5 |
public void map(LongWritable lineid, Text nodetxt,
OutputCollector<Text, Text> output, Reporter reporter)
throws IOException
{
Node node = new Node();
node.fromNodeMsg(nodetxt.toString());
output.collect(new Text(node.getNodeId()), new Text(node.toNodeMsg()));
reporter.incrCounter("Brush", "nodes",... | 8 |
public void okButtonActionPerformed(java.awt.event.ActionEvent e)
{
try
{
if(rotateRadio.isSelected())
{
float degrees = Float.parseFloat(rotateTextField.getText());
if(radianRadio.isSelected())
{
... | 5 |
public boolean equals(Object o) {
SignatureKey target = (SignatureKey) o;
if (types == null)
return target.types == null;
if (clas != target.clas)
return false;
if (!methodName.equals(target.methodName))
return false;
if (types.length != target.types.length)
return false;
for (int i = ... | 8 |
public void setPort(int port){ this.Port = port; } | 0 |
public int canCompleteCircuit(int[] gas, int[] cost) {
if(gas.length==1) return gas[0]>=cost[0]?0:-1;
this.gas = gas;
this.cost = cost;
N = gas.length;
int i = 0;
int c= 0;
while(c<N)
{
remain = 0;
first = true;
int temp = T(i,i);
if(!first && temp==i) return i;
if(temp<i) ... | 7 |
public static void useLands(Deck d, double r){
if(!d.repeated){
System.out.println("Uselands does not support decks without repetition");
return;
}
int cards = 0;
int lands = 0;
int uniqueBasics = 0;
for(int i=0; i<d.cards.size(); i++){
cards += d.quantity.get(i);
String s = d.cards.get(i);
... | 6 |
@SuppressWarnings("unchecked")
public static float[][] restore2D(String findFromFile) {
float[][] dataSet = null;
try {
FileInputStream filein = new FileInputStream(findFromFile);
ObjectInputStream objin = new ObjectInputStream(filein);
try {
dataSet = ( float[][]) objin.readObject();
} catch... | 2 |
private void fetchCluster(Direction direction) {
BoundingBox boundingBox;
if (direction == Direction.CENTER) {
// only called once at initialization!
if (initialized) {
throw new RuntimeException("fetchCluster for " + direction
+ " called twice. this should never happen!");
}
initialized = tru... | 6 |
@ManagedOperation
public V get(K key) {
if(l1_cache != null) {
V val=l1_cache.get(key);
if(val != null) {
if(log.isTraceEnabled())
log.trace("returned value " + val + " for " + key + " from L1 cache");
return val;
}
... | 9 |
public static String Hirschberg(int m, int n, String A, String B) {
String result = "";
if (n == 0 || m == 0)
return result;
if (m == 1) {
char zero_index = A.charAt(0);
for (int i = 0; i < n; i++) {
if (zero_index == B.charAt(i)) {
result = String.valueOf(zero_index);
break;
}
}
... | 7 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public MusicFileLoader() {
File home = new File(START_DIR);
for (File dir : home.listFiles()) {
if (dir.isDirectory()) {
if (!categories.contains(dir.getName()))
categories.add(dir.getName());
for (File music : dir.listFiles()) {
if (music.isFile()
&& music_type.contains(new MimetypesFil... | 7 |
public int getmin(String[] colormap){
int n = colormap.length;
int[][] d = new int[n][n];
for(int i=0; i<n; i++){
int count=0;
for(int j=0; j<n; j++){
if(colormap[i].charAt(j) == 'Y'){
d[i][j]=count;
count++;
... | 9 |
AbstractNode statement() {
AbstractNode node = null;
if (test(IF)) {
node = ifStatement();
} else if (test(PRINT)) {
read(PRINT, "PRINT");
node = new PrintNode(expr());
} else if (test(WHILE)) {
node = whileStatement();
} else if (test(REPEAT)) {
node = repeatStatement();
} else if (test(IDE... | 6 |
public String onPump(BufferedReader rdr, Server server) throws IOException {
String url = "";
String line = "";
try {
while (line != null) {
line = rdr.readLine();
if (line != null)
url = line;
}
} catch (Exception e) {
e.printStackTrace();
} finally {
rdr.close();
}
return url;
... | 3 |
@Override
public Color getForeground() {
if (foregroundColor == null) {
return super.getForeground();
}
return foregroundColor;
} | 1 |
public LauncherDestroyer findDestroyerById(int destroyerId) {
LauncherDestroyer user_destroyer = null;
for (LauncherDestroyer launcher_destroyer : getWarLauncherDestroyer()) {
if (launcher_destroyer.getLauncherId() == destroyerId) {
user_destroyer = launcher_destroyer;
break;
}
}
if (user_destroye... | 3 |
public Boolean getIsSelected() {
return isSelected;
} | 0 |
public static void loadPlayer(Registry registry) {
Player p = (Player) getPlayers().get(player);
if (p != null) {
p.setTransient(registry);
}
GameController gc = registry.getGameController();
registry.getPlayerManager().clearPlayers();
registry.getPlayerManag... | 2 |
@Override
public void actionOffered() {
while(Actions.hasActions()) {
Action a = Actions.take();
String aMsg = "[" + a.getType().toString() + " => t :: 0x" + Long.toHexString(a.getTime()) + " => aId :: 0x" + Integer.toHexString(a.getId()) + "]" +
" " + a.getMessage();
if(a.getType() == Actions.ActionTy... | 5 |
public static boolean deleteSpawnPoint(String name) {
if (FearTheReaper.SpawnPointList.containsKey(name)) {
Spawn point = FearTheReaper.SpawnPointList.remove(name);
if (FearTheReaper.markers != null) {
ReaperMarkers.deleteMarker(point);
}
File poin... | 3 |
public void checkObject () {
Object object = (Object)getOneIntersectingObject(Object.class);
if( object != null ) {
if ( object instanceof CharPlayer ) {
CharBot.setSlowSpeed(4);
destroy();
}
else if ( object instanceof CharBot ) {
... | 4 |
@Override
public boolean execute(final CommandSender sender, final String[] split) {
if (sender instanceof Player) {
if (MonsterIRC.getHandleManager().getPermissionsHandler() != null) {
if (!MonsterIRC.getHandleManager().getPermissionsHandler()
.hasCommand... | 8 |
public URI rewrite(URI uri) throws URISyntaxException {
if (editor.matches(uri)) {
try {
return new URI(editor.populate(uri));
}
catch (IllegalArgumentException e)
{
throw new URISyntaxException( uri.toString(), e.getMessage() );
}
}
return uri;
} | 2 |
public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof TextOutputCallback) {
// display the message according to the specified type
TextOutputCallback toc = (TextOutputCallback)callb... | 7 |
@Override
public final Configuration readConfiguration() throws ReaderException {
try {
Configuration config = new Configuration();
File configFile = new File(this.filePath);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder;
dBuilder = dbFactory.newDocu... | 1 |
public GeneralPath getGrid(int states) {
int[] bars = new int[2];
for (int count = states; count < 51; count++) {
if (layout[count][0] > 0) {
bars = layout[count];
break;
}
}
int maxCols = Math.max(bars[0], bars[1]);
int rows = 2;
int sum = bars[0] + bars[1];
while (su... | 7 |
@Override
public void keyReleased(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if(keyCode == 65 || keyCode == 68 || keyCode == 83 || keyCode == 87){
if(getPressedMovementKeys().contains(keyCode) == true){
this.pressedMovementKeys.remove((Integer)keyCode);
}
}
eventsProccessed++;
} | 5 |
public EditInfo getEditInfo(int n) {
if (n == 0) {
return new EditInfo("Inductance (H)", inductance, 0, 0);
}
if (n == 1) {
return new EditInfo("On Resistance (ohms)", r_on, 0, 0);
}
if (n == 2) {
return new EditInfo("Off Resistance (ohms)", r_... | 7 |
public NodeDrawer getNodeDrawer() {
return nodeDrawer;
} | 0 |
@Test
public void testRemoveCard(){
Pile pile = new Pile();
Card card = new Card(Card.CARD_SUIT.SPADES, Card.FACE_VALUE.KING);
pile.addCard(card);
assertEquals("Asserting the card was removed", card, pile.removeCard(0));
Pile pile2 = new Pile();
Card card2 = new Card(Card.CARD_SUIT.DIAMONDS, Card.FACE_V... | 3 |
public void moveTowards(Cockroach target) {
m += Math.round(Math.signum(target.m - m) * random.nextFloat() * swarmStepSize);
if (m < 1) {
m = 1;
} else if (m > N) {
m = N;
}
} | 2 |
@Override
public void mouseDragged(MouseEvent e) {
System.out.println("Mouse dragged");
int currX = e.getX();
int currY = e.getY();
System.out.println("Start X: " + startX + "CurrX: " + e.getX());
System.out.println("startX - currX = " + (startX-e... | 5 |
public void dropInfo(int howMuch) {
if ((howMuch & KNOWNATTRIBS) != 0) {
lvt = null;
lnt = null;
}
super.dropInfo(howMuch);
} | 1 |
public static void main(String[] args) throws Exception
{
Client client = new Client("146.232.50.251", 3003 );
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
SendHandler sf = new SendHandler(client);
Message msg = new Message();
while (true) {
String userName = br.read... | 7 |
private boolean isAlphabet(char chr) {
int asciiChar = chr;
return (asciiChar >= 65 && asciiChar <= 90)
|| (asciiChar >= 97 && asciiChar <= 122);
} | 3 |
public static void openURI(String URIString) {
Logger.getLogger(OSBasics.class.getName()).entering(OSBasics.class.getName(), "openURI", URIString);
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.BROWSE)) {
... | 3 |
public ArrayList<EntradaBean> getPage(int intRegsPerPag, int intPage, ArrayList<FilterBean> alFilter, HashMap<String, String> hmOrder) throws Exception {
ArrayList<Integer> arrId;
ArrayList<EntradaBean> arrEntrada = new ArrayList<>();
try {
oMysql.conexion(enumTipoConexion);
... | 2 |
private void continueSpawnLogic1(final Player p, final PlayerData data){
System.out.println("PLAYER " + p.getName() + " LOADED SPAWN LOGIC 1");
final TeamPref teamPref = data.getTeamPref();
if(teamPref == TeamPref.NOTCHOSEN || teamPref == null){
SchedulerManager.registerSingleTicks(1, new Runnable(){
publi... | 4 |
public static int getTotalUsers() {
int totalUsers = 0;
try {
String statement = new String("SELECT COUNT(userid) FROM " + DBTable);
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
ResultSet rs = stmt.executeQuery();
if (rs.next())
totalUsers = rs.getInt("COUNT(userid)");
r... | 2 |
public static String qnameFor(Resource resource) {
Graph graph = resource.getModel().getGraph();
if(graph instanceof MultiUnion) {
String uri = resource.getURI();
int split = Util.splitNamespace(uri);
String local = uri.substring(split);
if (local.length() == 0) {
return null... | 7 |
public void restart()
{
timer.stop();
timeManager.setTime(0);
warnPlayed = false;
} | 0 |
public void update(ByteBuffer buffer) {
length += buffer.remaining();
//Save current position to leave given buffer unchanged
int position = buffer.position();
//Complete the final buffer if needed
completeFinalBuffer(buffer);
if(!buffer.hasArray() || buffer.isDirect())
{
if(cacheBlock == null) // on... | 7 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 7 |
private void stepStars(Graphics2D graphics) {
for (Star star : stars) {
if (paused || quitRequested) {
star.draw(graphics);
continue;
}
star.step();
if (star.y >= screen.getHeight()) {
star.y = 0;
sta... | 4 |
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.