text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void use(ArrayList<Choice> choices, Game game) {
Player p = game.getCurrentPlayer();
boolean found = false;
for (int i = 0; i < p.hand.size(); i++) {
if (p.hand.get(i) instanceof Wound && !found) {
p.hand.remove(i);
this.draw += 1;
for (int j = 0; j < game.getOpponents().size(); j++) {
... | 9 |
public void addID(MusicObject obj) {
if (!this.duplicateID.containsKey(obj.getUid())) {
duplicateID.put(obj.getUid(), obj);
}
} | 1 |
public void update(){
if (life.isOver()){
dead = true;
}
} | 1 |
public NoInterference() {
super(false);
if(firstTime && Configuration.interference && Configuration.showOptimizationHints) {
Main.warning("At least some nodes use the 'NoInterference' interfernce model. " +
"If you do not consider interference at all in your project, you can " +
"... | 3 |
@Test
public void string_test() {
try{
double []vec1= {1.0,2.0};
String result= Vector.toString(vec1);
String expected=" 1.0\n 2.0\n";
Assert.assertEquals(result,expected);
}
catch (Exception e) {
// TODO Auto-generated catch block
fail("Not yet implemen... | 1 |
public void onDisable() {
if (abm != null) {
abm.setGo(false);
}
if (fc != null) {
fc.setGo(false);
}
if (pg != null) {
pg.setGo(false);
}
if (ss != null) {
ss.setGo(false);
}
log.info(name + "DISABLED!");
} | 4 |
@Override
public void onStringInput(String input) {
System.out.println("Your name is: " + input);
} | 0 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Customer customer = (Customer) o;
if (zip != customer.zip) return false;
if (city != null ? !city.equals(customer.city) : customer.city != null... | 9 |
private static int extractReminder(int number, int divisor, ArrayList<Integer> resultByDigits, ArrayList<String> pseudographics) {
int integerDivision;
int reminder;
int subtrahend;
integerDivision = number / divisor;
resultByDigits.add(integerDivision);
subtrahend = integerDivision * divisor;
pseudograp... | 0 |
private Method findMethod(Object base, String name, Class<?>[] types, int paramCount) {
if (types != null) {
try {
return findAccessibleMethod(base.getClass().getMethod(name, types));
} catch (NoSuchMethodException e) {
return null;
}
}
Method varArgsMethod = null;
for (Method method : base.get... | 9 |
protected void updateCapabilitiesFilter(Capabilities filter) {
Instances tempInst;
Capabilities filterClass;
if (filter == null) {
m_ClustererEditor.setCapabilitiesFilter(new Capabilities(null));
return;
}
if (!ExplorerDefaults.getInitGenericObjectEditorFilter())
tempInst ... | 8 |
@RequestMapping(value = "addTask", method = RequestMethod.POST)
public @ResponseBody
TodoTask addTask(@RequestParam String title, @RequestParam String content,
@RequestParam String targetTime, @RequestParam Integer priority,
@RequestParam Integer list, WebRequest webReq... | 7 |
private boolean vaikuttaaOlevanOikeassaMestassa()
{
Tetrimino aave = aavetetrimino.tetrimino();
ArrayList<Palikka> palikat = new ArrayList<Palikka>( tetrimino.palikkakokoelma().palikat() );
Iterator<Palikka> alkuperaisesta = palikat.iterator();
for(Palikka aaveesta ... | 4 |
@Override
public void service(AgiRequest request, AgiChannel channel) throws AgiException {
try {
// Answer the channel...
this.answer();
// retrieve a non-existent filename
String fileName;
int name;
do {
name = Math.abs(this.random.nextInt());
fileName = EPursuit.properties.getProperty("... | 5 |
private boolean isInheritable(int mod, CtClass superclazz) {
if (Modifier.isPrivate(mod))
return false;
if (Modifier.isPackage(mod)) {
String pname = getPackageName();
String pname2 = superclazz.getPackageName();
if (pname == null)
return ... | 3 |
public void run() {
while (r != null && !this.isInterrupted()) {
try {
StringBuilder sb = new StringBuilder();
String pac = r.readUTF();
if (pac != null && pac.startsWith("pac")) {
sb.append(pac);
if (!pac.endsWith("ket")) {
String stack;
do {
stack = r.read... | 7 |
private String getTerm(ActivityType activity) {
switch(activity) {
case BREAK:
return termBreak;
case PLACE:
return termPlace;
case TRAVEL:
return termTravel;
case CHAT:
return termChat;
case ANIMAL:
return termAnimal;
case MONSTER:
return termMonster;
case PLAYER:
ret... | 7 |
private static int hexValue(char c)
{
if ((c >= '0') && (c <= '9'))
return (int) (c - '0');
if ((c >= 'A') && (c <= 'F'))
return ((int) (c - 'A')) + 0x0A;
throw new NumberFormatException();
} | 4 |
@SuppressWarnings("unchecked")
public static void writeLinesSorted(String file, ArrayList<?> uniWordMap,
ArrayList<?> uniWordMapCounts, int flag) {
// flag = 0 decreasing order otherwise increasing
HashMap map = new HashMap();
if (uniWordMap.size() != uniWordMapCounts.size()) {
System.err.println("Array si... | 4 |
private void renderItemList() {
for (int i = 0; i < items.size(); i++)
renderItemOption(i, items.get(i), new Position(10, 50 + (i * 60)));
} | 1 |
public String getNthSegment(int n){
if(n == 0){
return operator;
} else if(segments.size() < n){
return null;
} else {
return segments.get(n-1);
}
} | 2 |
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 static void cantPlace(String place) { System.out.printf("\"%s\"には置けません!\n", place); } | 0 |
public void setBranchLeaderList(final List<BranchLeader> branchLeaderList) {
this.branchLeaderList = branchLeaderList;
} | 0 |
public void testConstructor_int_int_int_int_int_int_int() throws Throwable {
LocalDateTime test = new LocalDateTime(2005, 6, 9, 10, 20, 30, 40);
assertEquals(ISO_UTC, test.getChronology());
assertEquals(2005, test.getYear());
assertEquals(6, test.getMonthOfYear());
assertEquals(9... | 7 |
public String[] getAvailableStyle() {
if (fontList != null) {
String[] availableStyles = new String[fontList.size()];
Iterator nameIterator = fontList.iterator();
Object[] fontData;
int decorations;
String style = "";
for (int i = 0; nameIt... | 6 |
public Node(String data){
this.data = data;
} | 0 |
public final void setWrapWidth(double wrapWidth) {
this.wrapWidth.set(wrapWidth);
} | 0 |
public String getDescription() {
return description;
} | 0 |
public int reverse(int x) {
int abs = x < 0 ? -x : x;
long result = 0;
while (abs > 0) {
result = result * 10 + abs % 10;
abs = abs / 10;
}
result = x < 0 ? result * -1 : result;
if (result > Integer.MAX_VALUE || result < Integer.MIN_VALUE) {
... | 5 |
private void showBoard(boolean activate) {
for (int row = 0; row < 8; row++)
for (int column = 0; column < 8; column++){
Position position = new Position(row,column);
if (board.isEmpty(position))
add(new EmptyTile((row+column)%2==0 ? Boar... | 5 |
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
// If the NamespaceManager state is already set up from the
// context of the task creator the current namespace will not
// be null. It's important to che... | 4 |
@Override
public void run() {
int fillPerLoop = 256;
for (int i=0; i<BUFFER_LENGTH; i+=fillPerLoop) {
mInput.read(backupBuffer, i, fillPerLoop);
}
double[] temp = new double[BUFFER_LENGTH];
for (int i=0; i<BUFFER_LENGTH; i++) {
temp[i] = backupBuffer[i];
}
FastFourierTransformer fft = new... | 7 |
public Gui(){
picLabel=new JLabel(new ImageIcon("img/bg.jpg"));
this.add(picLabel);
picLabel.setLayout(new GridBagLayout());
loginPanel = new JPanel(new GridBagLayout());
loginPanel.setPreferredSize(new java.awt.Dimension(800, 600));
GridBagConstraints c = new GridBagConstraints();
if (should... | 1 |
@EventHandler
public void onTagApi(PlayerReceiveNameTagEvent event){
Player player = event.getNamedPlayer();
String[] groups = ApiLayer.getGroups("world", CalculableType.USER, player.getName());
if(groups.length == 0){
return;
}
if(groups[0].equalsIgnoreCase("New")){
return;
}else if(groups[0].equ... | 6 |
public synchronized boolean add(Object obj) {
boolean retVal = false;
if (!isFull()) {
queue.addElement(obj);
retVal = true;
}
return retVal;
} | 1 |
public String toString() {
final StringBuffer buf;
Class<?> target;
buf = new StringBuffer();
buf.append(this.getClass().getName());
buf.append("\n");
target = this.getClass();
while (target != Object.class) {
Field[] fields;
int i;
... | 8 |
public void checkCbolOriginalDir() {
Path dir = Paths.get(CBOL_HOME);
//
//http://docs.oracle.com/javase/tutorial/essential/io/dirs.html
try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
for (Path file : stream) {
System.out.println(file.ge... | 2 |
public OSCByteArrayToJavaConverter() {
} | 0 |
public String toString()
{
//Print the Process ID and process state (READY, RUNNING, BLOCKED)
String result = "Process id " + processId + " ";
if (isBlocked())
{
result = result + "is BLOCKED for ";
//Print device, syscall and addre... | 7 |
public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5)
{
if (par3 >> 4 >= storageArrays.length || par3 >> 4 < 0)
{
return;
}
ExtendedBlockStorage var6 = this.storageArrays[par3 >> 4];
if (var6 == null)
{
... | 6 |
public static File findMinecraftFolder() {
final String os = System.getProperty("os.name").toLowerCase();
if (os.indexOf("win") >= 0) {
return new File(System.getenv("APPDATA"), ".minecraft");
} else if (os.indexOf("mac") >= 0) {
return new File(System.getProperty("user.home"),
"Library/Application Sup... | 5 |
private boolean r_mark_suffix_with_optional_n_consonant() {
int v_1;
int v_2;
int v_3;
int v_4;
int v_5;
int v_6;
int v_7;
// (, line 132
// or, line 134
lab0: do {
... | 9 |
protected void importInput(String section, Engine engine) throws Exception {
BufferedReader reader = new BufferedReader(new StringReader(section));
reader.readLine(); //ignore first line [InputX]
InputVariable inputVariable = new InputVariable();
engine.addInputVariable(inputVariable);
... | 7 |
@Test
public void testGetMessageNoUnexpectedMessages() {
try {
int noOfMessages = 2;
final String message = "TestMessage-testGetMessage_OneSubscriber";
final CountDownLatch gate = new CountDownLatch(1);
final AtomicInteger msgCount = new AtomicInteger(0);
final Message expected = new MockMessage(messa... | 4 |
public static String escape(String text, char escapeChar, char[] reserved) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
// Is the char reserved
boolean isReserved = false;
if (reserved != null) {
for (int j = 0; j < reserved.leng... | 6 |
public boolean contains(int index, int val) {
if (adj[index].contains(val)) { return true;}
else return false;
} | 1 |
private void checkForPrompt()
{
// Text has been entered, remove the prompt
if (document.getLength() > 0)
{
setVisible( false );
return;
}
// Prompt has already been shown once, remove it
if (showPromptOnce && focusLost > 0)
{
setVisible(false);
return;
}
// Check the Show property... | 8 |
public void setPcaSubgru(Integer pcaSubgru) {
this.pcaSubgru = pcaSubgru;
} | 0 |
public static boolean isMaskActive( InputMask mask )
{
switch ( mask )
{
case CONTROL_MASK:
return Keyboard.isKeyDown( Keyboard.KEY_LCONTROL ) || Keyboard.isKeyDown( Keyboard.KEY_RCONTROL );
case MENU_MASK:
return Keyboard.isKeyDown( Keyboar... | 8 |
public void testWithDurationBeforeEnd3() throws Throwable {
Duration dur = new Duration(-1);
Interval base = new Interval(TEST_TIME_NOW, TEST_TIME_NOW);
try {
base.withDurationBeforeEnd(dur);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
* @return
*/
public Condfmt createCondfmt( String location, WorkBookHandle wbh )
{
Condfmt cfx = (Condfmt) Condfmt.getPrototype();
int insertIdx = win2.getRecordIndex() + 1;
BiffRec rec = (BiffRec) SheetRecs.get( insertIdx );
while( (rec.getOpcode() != HLINK) &&
(rec.getOffset() != DVAL) &&
(rec.get... | 6 |
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile... | 8 |
private static void Mergeforcemethod(int i, int n) {
// TODO Auto-generated method stub
if((n-i)<100000){
int il=0;
int j=0;
for(il=i;il<n;il++){
for(j=il;j<n;j++){
if (array[il]>array[j]){
total++;
}
}
}
Arrays.sort(array, i, n);
}else{
Mergeforcemetho... | 4 |
@Test
public void transferInstrMOVE_testInvalidDestinationRegisterRef() { //Checks MOVE instr. not created with invalid register ref.
try {
instr = new TransferInstr(Opcode.MOVE, 5, -1);
}
catch (IllegalStateException e) {
System.out.println(e.getMessage());
}
assertNull(instr);
} | 1 |
private int one(String num)
{
switch(num)
{
case "one": return 1;
case "two": return 2;
case "three": return 3;
case "four": return 4;
case "five": return 5;
case "six": return 6;
case "seven": return 7;
case "eight": return 8;
case "nine": return 9;
default: return 0;
}
} | 9 |
public void addClientToDialog(String clientId, ClientDialog dialog)
{
System.out.println("Ajout d'un client a un dialog");
try
{
boolean alreadyKnow = false;
ClientServerData clientAdd = null;
System.out.println("On recherche le client");
for (ClientServerData client : this.getClients())
{
if ... | 8 |
private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
// TODO add your handling code here:
liceu.Administrator admin = new liceu.Administrator(usernameProfesor.getText(), parolaProfesor.getText(),ncProfesor.getText(),cnpProfesor.getText(),"Prof... | 5 |
private DeclarationList declaration_list(int fallbackLineNumber, int fallbackCharPosition) throws RequiredTokenException
{
enterRule(NonTerminal.DECLARATION_LIST);
ArrayList<Declaration> declarations = new ArrayList<Declaration>();
while(firstSetSatisfied(NonTerminal.DECLARATION))
{
declarations.add(declar... | 3 |
public int getIntValue() {
if (this.slider != null) {
return this.slider.getValue();
}
return ((Number) this.spinner.getValue()).intValue();
} | 1 |
public static int direction(int dx, int dy) {
if (dx < 0) {
if (dy < 0)
return 5;
else if (dy > 0)
return 0;
else
return 3;
} else if (dx > 0) {
if (dy < 0)
return 7;
else if (dy > 0)
return 2;
else
return 4;
} else {
if (dy < 0)
return 6;
else if (dy > 0)
r... | 8 |
private void halfFruits(int nfruits) {
int r;
int subset[] = new int[6];
boolean filled = false;
for(int i=0; i < 6; i++) {
boolean unique;
do {
unique = true;
r = (int)(Math.random()*12);
for(int j=0; j < i; j++) {
if(subset[j] == r)
... | 5 |
public byte getMemory(int address, boolean shouldNotify) {
if (shouldNotify && _readObserver != null) {
_readObserver.updateReadMemory(address);
}
if (isCPUMapped(address)) {
return getCPUMappedMemory(address);
} else if (_ppu.isReadMapped(address)) {
... | 7 |
public ArrayList<Integer> postorderTraversal(TreeNode root) {
ArrayList<Integer> result = new ArrayList<Integer>();
if (root == null)
return result;
Stack<TreeNode> stack = new Stack<TreeNode>();
stack.push(root);
TreeNode prev = null;
while (!stack.empty()) {
TreeNode curNode = sta... | 9 |
public DMatrix(int dim, int cls, int num){
samplenum = num;
dimension = dim;
groundcls = new int[samplenum];
knewcls = new int[samplenum];
nnnewcls = new int[samplenum];
test = new int[samplenum];
for(int i = 0; i < samplenum; i++){
groundcls[i] = cls;
knewcls[i] = -1;
nnnewcls[i] = -1;
test[i... | 2 |
public static void main(String[] args) {
interactInput();
new TwitterCrawler();
} | 0 |
static public Mantenimiento_Modulos instancia() {
if (UnicaInstancia == null) {
UnicaInstancia = new Mantenimiento_Modulos();
}
return UnicaInstancia;
} | 1 |
private void loadDates() {
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
HashMap<String, String> dates = new HashMap<>();
try {
String query = "select startdatum,releasedatum from spelprojekt where sid=" + selectedSpelprojekt;
dates = DB.fetchRow(query);
... | 3 |
public void run() {
if (list.isEmpty()) {
return;
}
Collection<ProxiedPlayer> players = ProxyServer.getInstance().getPlayers();
if (players.isEmpty()) {
return;
}
for(ProxiedPlayer player: players){
for ( String line : list.get(count).split( "\n" ) ) {
player.sendMessage(line)... | 5 |
@Override
public void addPoint(double distance, int index) {
if (distance >= worstDistance)
return;
if (count < capacity)
count++;
int i;
for (i = count-1; i > 0; i--) {
if (distanceIndexArray.get(i-1).distance > distance ||
(distanceIndexArray.get(i-1).distance == distance && distanceIndexArray... | 7 |
private boolean disjointSquare(MoveNode[][] b) {
for(int i = 0; i < boardSize; i++){
for(int j = 0; j < boardSize; j++){
if(!b[i][j].isVisited() && !b[i][j].anyUnvisitedNeghbours())
return true;
}
}
return false;
} | 4 |
private final long method1865(int i) {
long l = System.nanoTime();
long l_0_ = -aLong6169 + l;
if (i != 10)
return -56L;
aLong6169 = l;
if (4999999999L > (l_0_ ^ 0xffffffffffffffffL)
&& -5000000001L < (l_0_ ^ 0xffffffffffffffffL)) {
aLongArray6171[anInt6170] = l_0_;
if ((anInt6168 ^ 0xffffffff)... | 5 |
private void writeROM() {
DataOutputStream out = null; // Used to write out the data to the ROM file
try { out = new DataOutputStream( // Create output stream used to write the ROM file
new FileOutputStream(game)); }
catch (FileNotFoundException e) { Error.fatalError(1); } // 1 -- Cannot write to... | 5 |
public static void evalAUC(Dataset dataset)
{
double trainArea = 0, trainPosi = 0, trainRank = dataset.trainCount;
double testArea = 0, testPosi = 0, testRank = dataset.testCount;
double quizArea = 0, quizPosi = 0, quizRank = dataset.quizCount;
Collections.sort(dataset.data, new InstanceComparator());
for(In... | 9 |
static String demandeIntermediare(String ip, int port, String question, boolean attCrochets, int nombreMot, int nbIteration, int tmpAttente ) throws UnknownServiceException {
String reponse = "";
int tmp = 0;
while (tmp < nbIteration){
try { reponse = demanderQuestion(ip, port, question, attCrochets, nombreMot)... | 5 |
@Override
public void run() {
while((client.isConnected()) && !client.isLogged()) {
client.println(welcomeMessage);
String nick = client.readLine();
if ((nick != null) && (!farewellMessage.equals(nick))) {
if (client.setNick(nick)) {
qu... | 9 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
Connection cx = null;
cx = Conexion.getConexion();
if(cx != null){
JOptionPane.showMessageDialog(null , "exito");
}
... | 1 |
public double getData(String ticker) {
try {
URL interWebs = new URL(baseURL + ticker + baseURLend); // create a URL instance of the API
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("149.89.1.30", 3128)); // the proxy in the Stuy computer lab
URLConnection interwebConnect = interWebs... | 4 |
private void HandleLogin() throws IOException {
String line;
String[] parts;
while (true) {
line = in.readLine();
parts = line.split(" ");
if (parts[0].equals("USER")) {
uid = parts[1];
UserControl.addUserIfNotExist(uid);
... | 2 |
public Expression simplify() {
if (local.getExpression() != null)
return local.getExpression().simplify();
return super.simplify();
} | 1 |
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g... | 4 |
@Override
public void actionPerformed(ActionEvent arg0) {
if(arg0.getActionCommand().equals("file")){
JFileChooser chooser = new JFileChooser();
int retval = chooser.showOpenDialog(null);
if(retval == JFileChooser.APPROVE_OPTION){
chooser.setVisible(false);
fileDir = chooser.getSelected... | 8 |
public ArrayList<Company> getCompanies() {
return Companies;
} | 0 |
private void executeForwardJob(ForwardJob job) throws IOException,
JSchException {
updateable.send(new StatusUpdate("VM " + id + " Executing ForwardJob", id,
VMState.EXECUTING, JobType.FORWARD));
HashMap<Integer, String> files = new HashMap<Integer, String>();
String sessionName = job.getRemoteFileName()... | 3 |
void entityDestroyCheck(DownlinkState linkState) {
if(linkState != null) {
if(packetId == 0x1D && linkState.entityIds != null) {
Integer entityId = (Integer)fields[0].getValue();
linkState.entityIds.remove(entityId);
} else if (packetId == 0x32) {
Integer x = (Integer)fields[0].getValue();
Integ... | 9 |
public static boolean methodInlinableP(MethodSlot method) {
if (StandardObject.voidP(method.type()) ||
((method.methodReturnTypeSpecifiers().length() > 1) ||
((BooleanWrapper)(KeyValueList.dynamicSlotValue(method.dynamicSlots, Stella.SYM_STELLA_METHOD_VARIABLE_ARGUMENTSp, Stella.FALSE_WRAPPER))).wr... | 6 |
public String getValue() {
return _value;
} | 0 |
public int getPointFromPos(Double x, Double y) {
int point;
if (y > HEIGHT/2) {
// flip logic
point = 24 - (int) (x / baseUnit);
point += 2;
if (point > 18) {
point--;
}
} else {
point = (int) (x / baseUnit);
if (point > 6) {
point --;
}
}
return point;
} | 3 |
public static Router getRouter(String name, LinkedList routerList)
{
if (name == null || routerList == null || name.length() == 0) {
return null;
}
Router router = null;
try
{
Iterator it = routerList.iterator();
while ( it.hasNext() )
... | 6 |
@Override
public double bonusDefense(Territoire t, Peuple attaquant) {
if( t.has(SallePartiel.class) )
return 1.0;
return 0.0;
} | 1 |
public boolean hasError() {
if (value instanceof ErrorMessage == false) {
return false;
}
ErrorMessage probableError = (ErrorMessage) value;
switch (probableError) {
case EMPTY_STRUCTURE:
case INDEX_OUT_OF_BOUNDS:
case INVALID_ARGUMENT:
return true;
default:
return false;
}
} | 4 |
public LambdaPane(AutomatonPane ap) {
super(new BorderLayout());
add(ap, BorderLayout.CENTER);
add(new JLabel(Universe.curProfile.getEmptyString()+"-transitions are highlighted."),
BorderLayout.NORTH);
ArrowDisplayOnlyTool tool = new ArrowDisplayOnlyTool(ap, ap
.getDrawer());
ap.addMouseListene... | 0 |
public static void revalidateImmediately(Component comp) {
if (comp != null) {
RepaintManager mgr = RepaintManager.currentManager(comp);
mgr.validateInvalidComponents();
mgr.paintDirtyRegions();
}
} | 1 |
public static Boolean compareArgLists(Map<String, Object> args1, Map<String, Object> args2)
{
if (args1 == null && args2 == null)
return true;
if (args1 != null) {
for (Map.Entry<String, Object> arg : args1.entrySet()) {
if (args2 != null) {
if (!args2.containsKey(arg.getKey()))
return false... | 6 |
public Integer kthToLast(int k)
{
if (k <= 0 || head == null)
throw new IllegalArgumentException("There is no such element.");
Node runner = head;
Node pointer = head;
int counter = 1;
for (; runner.next != null && counter < k; counter++)
{
runner = runner.next;
}
if (counter < k && runner.next =... | 7 |
public void setIndirizzo(Address indirizzo) {
this.address = indirizzo;
} | 0 |
@Override
public String toString() {
StringBuilder info = new StringBuilder();
info.append("GameScreen :: ")
.append(getName())
.append("\n");
// Iterate over all of the registered game layers and append their
// toString values
for (GameLayer gameLayer : gameLayers.values()) {
info.append(gameLay... | 1 |
private void accept(SelectionKey key,Boolean isClusters) throws IOException {
// For an accept to be pending the channel must be a server socket channel.
ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel();
// Accept the connection and make it non-blocking
SocketChannel socketChannel ... | 2 |
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);
... | 7 |
private void saveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveActionPerformed
try{
if (nameOutlet.getText().isEmpty()
|| codeOutlet.getText().isEmpty()
|| priceAOutlet.getText().isEmpty()
|| priceBOutlet.getText().isEmpty()) {... | 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.