text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Map getLocation(String ip) {
country = ipSeeker.getCountry(ip).replace("CZ88.NET", "").replace("错误的IP数据库文件", "").replace("局域网", "");
area = ipSeeker.getArea(ip).replace("CZ88.NET", "").replace("错误的IP数据库文件", "").replace("对方和您在同一内部网", "");
boolean isChina = false;
if (country != nul... | 7 |
public static RequestLine parseRequest(byte[] requestData) throws IllegalArgumentException, FileNotFoundException {
if (requestData.length == 0) {
throw new IllegalArgumentException("Empty request-line.");
}
String request;
try {
request = new String(requestData, "US-ASCII");
} catch (UnsupportedEncodin... | 4 |
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
java.security.cert.X509Certificate[] chain = null;
try {
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
KeyStore tks = KeyStore.getInstance("JKS");
tks.load(this.getClas... | 1 |
public URL find(String classname) {
String cname = classname.replace('.', '/') + ".class";
ClassLoader cl = (ClassLoader)clref.get();
if (cl == null)
return null; // not found
else
return cl.getResource(cname);
} | 1 |
private void tryToSave(KDNode node, double[] target) {
if(node == null){
return;
}
double distance = distance(target, node.values);
if(resultKNN.size() == k && resultKNN.maximum().distance < distance){
return;
}
KNNPoint point = new KNNPoint(node.values, distance);
if(resultKNN.contains(point))... | 5 |
private ArrayList<ArrayList<Integer>> twoSumInternal(int[] numbers, int target, int startpos) {
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
if(numbers.length<2) return result;
HashMap<Integer, Integer> maps = new HashMap<Integer, Integer>();
int lastUniqe = numbers[0]... | 7 |
public String trapHere(MOB mob, Room R)
{
final StringBuffer msg=new StringBuffer("");
if(CMLib.flags().canBeSeenBy(R,mob))
msg.append(trapCheck(R));
for(int d=0;d<Directions.NUM_DIRECTIONS();d++)
{
final Exit E=R.getExitInDir(d);
final Room R2=R.getRoomInDir(d);
if((R2!=null)
&&(E!=null)
&&(... | 9 |
public State iterate(SimpleNode root) throws ParseException
{
SimpleNode nodeChild = null;
StateQueue cur = stateQueue.element();
if( cur == null )
return null;
for(int i=0;i<root.jjtGetNumChildren();i++)
{
nodeChild = (SimpleNode) root.jjtGetChild(i);
if( nodeChild == null )
con... | 9 |
public void createControlPanel(Composite parent) {
super.createControlPanel(parent);
if (nextNumber < 1)
nextNumber = startNumber;
// add selection listener to reset nextNumber after
// the sequence has completed
playItem.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event)... | 5 |
int insertKeyRehash(int val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look un... | 9 |
private int calcActualFreq(int freq) {
if (mMaxCount < freq)
freq = mMaxCount;
return 1+(int)((64*1024 - 1) * (((double)freq)/((double)mMaxCount)));
} | 1 |
public void binarySearch(int key, int start, int end, List array){
System.out.println("key: "+key);
System.out.println("start: "+start);
System.out.println("end: "+end+"\n");
int position;
int comparisonCount = 0;
position = (start + end) / 2;
while(list.get(position) != key && start <= end){
... | 5 |
void printZigZagBT(BTnode root)
{
BTnode tmpNode;
Stack<BTnode> tmpStack;
if(root == null)
return;
currentLevel.push(root);
while(!currentLevel.empty())
{
tmpNode = currentLevel.pop();
if(tmpNode != null)
{
if(leftToRight){
System.out.println(tmpNode.data);
nextLevel.add... | 6 |
public void setEntries(List<CommsLogEntry> entries)
{
if(entries == null || entries.size() == 0)
{
this.entries = new ArrayList<CommsLogEntry>();
this.entries.add(new CommsLogEntry(CatanColor.WHITE, "No messages"));
}
else
{
this.entries = entries;
}
if (this.getWidth() > 0) {
updateSize... | 3 |
private boolean isError(int winner, String date, DBService dbService) {
try {
String qTore = "CREATE OR REPLACE VIEW tore AS SELECT goalshome AS goals, mdate FROM blmatch WHERE home_team = " + winner + " AND mdate < \'" + date + "\' UNION SELECT goalsguest AS goals, mdate FROM blmatch WHERE guest_te... | 3 |
public void generate(JFormatter f) {
f.p("/**").nl();
// prints the main body
format(f," * ");
for (Map.Entry<String,JCommentPart> e : atParams.entrySet()) {
f.p(" * @param ").p(e.getKey()).nl();
e.getValue().format(f,INDENT);
}
if( atReturn != null... | 7 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... | 7 |
public void updateSubTypes() {
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0)
GlobalOptions.err.println("setType of " + local.getName() + ": "
+ local.getType());
local.setType(type);
} | 1 |
public static void loadFile(File file, FileConfiguration fileConfig) {
try {
fileConfig.load(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
} | 3 |
public void rotateBlock()
{
boolean rotatable = true;
int counter = 0, adjust = 0;
int newPose, newWidth, newHeight;
int[] newx = new int[4];
int[] newy = new int[4];
newPose = (currentBlock.brickPose + 1) % NumPoses;
newWidth = bricks[currentBlock.brickType][newPose].w;
newHeight = bricks[currentBl... | 8 |
public String getFrench() // Plural?
{
if (gender != Gender.NEUTRAL)
{
if (startsWithVowel(french))
{
return "l'" + french;
}
return (gender == Gender.MASCULINE ? "le " : "la ") + french;
}
return french;
} | 3 |
public String value() {
return value;
} | 0 |
public void setContestId(Integer contestId) {
this.contestId = contestId;
} | 0 |
@SuppressWarnings("rawtypes")
public void processStimulus(Enumeration criteria) {
// Copy physics into scene graph
for (Iterator<RigidBodyContainer> it = rigidBodies.iterator(); it
.hasNext();) {
RigidBodyContainer container = (RigidBodyContainer) it.next();
container.transformGroup.setTransform(containe... | 6 |
int getFreePositions()
{
int count = 0;
for(int i=0;i<sudokuSize;i++) {
for(int j=0;j<sudokuSize;j++) {
if(cells[i][j].valueState == 0)
count++;
}
}
return count;
} | 3 |
@EventHandler
public void WitchJump(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.getWitchConfig().getDouble("Witch.Jump.DodgeCha... | 6 |
public static void setMaxAge(int newMAX_AGE)
{
MAX_AGE = newMAX_AGE;
} | 0 |
public void uninitializeService() throws Exception
{
EventObject e = new EventObject(this);
for(IServiceListener listener : this._listeners)
{
listener.serviceUninitialized(e);
}
} | 1 |
@Override
protected void multiplyAttribute(EntityAttribute attribute, double totalMultiplier) {
switch (attribute) {
case HEALTH_REGEN:
healthRegenCooldown = (int) ((double) baseHealthRegenCooldown / totalMultiplier);
notifyListenersAttributeChanged(attribute, healthRegenCooldown);
break;
case MANA_REGE... | 4 |
private InputStream nextLine() throws IOException {
try {
String line = null;
while (lines != null && line == null) {
line = lines.poll(1L, TimeUnit.SECONDS);
}
if (line != null) {
return new ByteArrayInputStream((line.endsWith("\n") ? line : line + '\n').getBytes());
} else {
return new By... | 5 |
public List<OrderLine> getLineeOrdine() {
return lineeOrdine;
} | 0 |
public void redistributeVotes(int quota, Seat[] seats) {
if (votes() >= quota) {
status = Status.WON;
double transferable = 0;
for (WeightedVote v : votes)
if (v.lookNext() != -1)
transferable += v.getWeight();
double factor = (votes() - quota) / transferable;
for (WeightedVote v : votes)
... | 8 |
private void makeLoginMenu(){
mnLogged.setText("Logged in as: "+user.result.username);
mnGroove.remove(mntmLogin);
try {
playlists = JGroovex.userGetPlaylists(user.result.userID).result.Playlists;
} catch (IOException e) {
e.printStackTrace();
}
if (playlists.length == 0)
mnPlaylist.add(new JMen... | 3 |
public boolean moveUnit(Position from, Position to) {
// Units teleport (no check of allowed path)
if (!getUnitAt(from).getOwner().equals(player)) {
return false;
}
if (!validPosition(to)) {
return false;
}
if (getUnitAt(to) != null) {
if (battleStrat.battle(from, to, this)) {
// From wins ba... | 5 |
public void leeArchivo() throws IOException {
BufferedReader fileIn;
try {
fileIn = new BufferedReader(new FileReader(nombreArchivo));
} catch (FileNotFoundException e){
File puntos = new File(nombreArchivo);
PrintWriter... | 4 |
static void stack(String str) {
System.out.println(str + "\n");
char[] byteString = str.toCharArray();
int size = byteString.length;
Stack<Character> stack = new Stack<Character>();
for(int i = 0; i < size; ++i) {
switch(byteString[i]) {
case '+':
... | 4 |
public List<Planet> MyPlanets() {
List<Planet> r = new ArrayList<Planet>();
for (Planet p : planets) {
if (p.Owner() == 1) {
r.add(p);
}
}
return r;
} | 2 |
@Override
public void openSelection() {
if (mOpenableProxy != null && !mSelectedRows.isEmpty()) {
mOpenableProxy.openSelection();
}
} | 2 |
public static void resizeAll(float aScaleFactor){
// Check whether the current slide is a quiz slide
if (null != currentQuizSlide){
if (correctnessTextPlayer != null)
correctnessTextPlayer.resize(aScaleFactor);
// Resize quiz elements
scoreTextPlayer.resize(aScaleFactor);
answerBoxA.resize(aScaleF... | 6 |
public void run() {
try {
while(s.isConnected() && in != null) {
Serializable data = null;
try {
data = (Serializable) in.readObject();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
... | 9 |
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 |
@Override
public Seat getResearvedSeat(Passenger passenger) {
for (int i = 0; i < passengerList.size(); i++) {
List<Passenger> _rowIteretor = passengerList.get(i);
for (int j = 0; j < _rowIteretor.size(); j++) {
Passenger _passenger = _rowIteretor.get(j);
... | 3 |
public void setConnection(Connection connection) {
this.connection = connection;
} | 0 |
private Config() {
//TODO: IMPORTANT! Catch all exceptions of Preferences
try {
Preferences root = Preferences.userRoot();
preferences = root.node("arietta");
interfaceWindowConfig = new UI.WindowConfig();
fetchPreferences();
} catch (SecurityExc... | 3 |
public static String legacyPingMOTD(boolean colours)
{
String message = pingMOTD;
if(message.contains("\n"))
message = message.substring(0, message.indexOf("\n"));
if(!colours && message.contains("§"))
{
Matcher m = mStripPattern.matcher(message);
message = m.replaceAll("");
message = message.re... | 3 |
private void updateResidueMap(String structure) {
String model = structureToModelMap.get(getStructure(structure));
String chain = getChain(structure);
String spec = " #"+model+":."+chain;
Map<Integer, String> sequenceNumberMap = new HashMap<Integer, String>();
// This requires Java 7
/* Pattern p = Pattern.... | 8 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((departamento == null) ? 0 : departamento.hashCode());
result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime * result + ((funcao == null) ? 0 : funcao.hashCode());
result = pr... | 7 |
public void testPlayCalmLoop() throws Exception {
System.out.println("playCalmLoop");
MusicController instance = new MusicController();
instance.playCalmLoop();
for(int i=0;i<30;i++){
System.out.print(i+" Seconds passed");
Thread.sleep(1000);
}
... | 1 |
public void wipeSavesAfter(String option) {
//
// Delete any subsequent time-stamp entries.
boolean matched = false ; for (String stamp : timeStamps) {
if (matched) {
timeStamps.remove(stamp) ;
final File f = new File(fullSavePath(savesPrefix, stamp)) ;
if (f.exists()) f.delet... | 5 |
public final char nextClean() throws JSONException {
for (;;) {
char c = next();
if (c == 0 || c > ' ') {
return c;
}
}
} | 3 |
public static Object toObject(byte[] bytes) throws IOException, ClassNotFoundException {
Object obj = null;
ByteArrayInputStream bis = null;
ObjectInputStream ois = null;
try {
bis = new ByteArrayInputStream(bytes);
ois = new ObjectInputStream(bis);
ob... | 2 |
public static void main(String[] args) throws Exception
{
//add your code here
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i=0; i<20; i++) list.add(Integer.parseInt(reader.readLine()));
... | 6 |
public WallDecoration getWallDecoration(int i, int k, int l) {
GroundTile groundTile = groundTiles[l][i][k];
if (groundTile == null) {
return null;
} else {
return groundTile.wallDecoration;
}
} | 1 |
static String getNextIP() {
int high, low;
synchronized(counter) {
do{
do {
high = (counter>>8) & 0x00FF;
if(high < 10 || high > 200) {
counter += 256;
}
} while(high < 10);
low = counter & 0x00FF;
counter ++;
} while ( high < 10 || high > 200 || low < 10 || low > 200... | 7 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(CMLib.flags().hasAControlledFollower(mob, this))
{
mob.tell(L("You can only control one golem."));
return false;
}
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return fal... | 8 |
public boolean execute(){
if (deque == null) {
throw new IllegalStateException("You must parse the code before executing.");
}
if (!canExecute) {
throw new IllegalStateException("Cannot execute code now. Not compiled, or"
+ " execution reached error, or execution reached end.");
}
if(deque.isEmpty... | 9 |
public double calcTotal(){
double result = 0.0;
double lineTotal = 0.0;
int lineCount = 0;
String filePath = "/Users/andrewho/Documents/Programming/Week16/Temperatures.csv";
File file = new File(filePath);
BufferedReader in = null;
try {
if(!file.exist... | 6 |
public boolean method577(int i)
{
if(anIntArray776 == null)
{
if(anIntArray773 == null)
return true;
if(i != 10)
return true;
boolean flag1 = true;
for(int k = 0; k < anIntArray773.length; k++)
flag1 &= Model.method463(anIntArray773[k] & 0xffff);
return flag1;
}
for(int j = 0; j < a... | 6 |
@Override
public void run()
{
while(true)
{
if (in.hasNext())
{
String temp = in.nextLine();
for (ServerCommands c : ServerCommands.values())
{
if ((temp.toLowerCase()).contains(c.getValue().getCommandText()))
{
c.getValue().execute(temp);
}
}
}
}
} | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Veiculo other = (Veiculo) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
... | 6 |
public boolean release(long id) {
if(enemyID == id) {
enemyID = NO_ENEMY;
return true;
}
else {
return false;
}
} | 1 |
public SecuredMessageTriggerBean execute(SecuredMessageTriggerBean message) throws GranException {
List<SecuredMessageBean> allMessages = message.getTask().getMessages();
// List<String> users = KernelManager.getStep().getHandlerList(message.getMstatusId(), message.getTaskId());
String fi... | 7 |
void loadSchematics() {
schematicsList.put(schematicsList.size(), "BasicHouse");
schematicsList.put(schematicsList.size(), "Temple-Japonais");
for (int o = 0; o < schematicsList.size(); o++) {
InputStream input = getClass().getResourceAsStream(
"/resources/Schematics/" + schematicsList.get(o)
+ ".s... | 9 |
public static void main( String[] args )
throws Exception
{
BufferedReader reader = new BufferedReader( new InputStreamReader( System.in ) );
String stdin;
while( true )
{
stdin = reader.readLine();
if( stdin == null )
{
return;
}
final byte[] buf = new byte[ 1024 * 20 ]; //20KB
String fileContent = new Stri... | 7 |
int insertKeyRehash(short val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look until FREE slot or we start to loop... | 9 |
private static String checkLabelName(CompileInfo ci, String name){
name = name.trim();
if(name.isEmpty()){
makeDiagnostic(ci, Kind.ERROR, "empty.label", name);//$NON-NLS-1$
return "!error!";
}
for(int i=0; i<name.length(); i++){
char c = name.charAt(i);
if(!((c>='A' && c<='Z') || (c>='a' && c<='z') ... | 9 |
public boolean isWaiting()
{
return waiting;
} | 0 |
protected void paintRaisedBevel(Component c, Graphics g, int x, int y, int width, int height) {
Color oldColor = g.getColor();
int h = height;
int w = width;
g.translate(x, y);
g.setColor(getHighlightOuterColor(c));
if (hidenSide != BorderLayout.WEST)
g.drawLine(0, 0, 0, h - 2);
if (hidenSide != Bor... | 8 |
private static void writeBytes(BufferedWriter bw, byte[] tab) throws IOException {
for (int i = 0; i < tab.length; i++) {
String val = Integer.toHexString(0x000000FF & tab[i]);
if (val.length() < 2) {
val = "0" + val;
}
bw.append(val);
}
... | 2 |
@Override
public List<Double> transform(List<Double> in) {
if (in.size() != inputMins.size()) {
throw new MLException(String.format(
"Unexpected in-vector size. Expected: %d, Got: %d", inputMins.size(), in.size()));
}
List<Double> out = new ArrayList<Double>()... | 4 |
public JKeeperXML2JTree(Document document) {
treeModel = new JKeeperTreeModel();
Node root = document.getDocumentElement();
int whattoshow = NodeFilter.SHOW_ALL;
NodeFilter nodefilter = null;
boolean expandreferences = false;
DocumentTraversal traversal = (Docum... | 8 |
public int aggregateResults() {
if(!baseDir.toFile().exists() || !baseDir.toFile().isDirectory()){
System.out.println("The specified path does not point to a directory");
return -1;
}
File[] projectFolders = baseDir.toFile().listFiles(new FileFilter() {
@Override
public boolean accept(File arg0) ... | 8 |
public TableView<Share> setTableView(final AccountManager account){
TableView<Share> table = new TableView<Share>();
List<Share> namelist = new ArrayList<Share>();
for (Share share : account.getPriceProvider().getAvailableShare()) {
namelist.add(share);
}
ObservableList<Share> data = FXCollections.obs... | 3 |
public static List findAll(Element tree, String path)
{
if(tree==null || path==null)
return new ArrayList(); //防止产生Null异常
if(path.charAt(0)=='/')
path = path.substring( path.indexOf('/', 1)+1);
String[] paths = path.split("/");
for(int i=0; i<paths.length-1; i++) {
tree = tree.getChild(paths[i]);
... | 7 |
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
String action = request.getParameter("act");
if(action != null) {
try {
RequestContext context = new RequestContext(request);
if(context.isLogged(... | 6 |
public String labelData(String srcfile,String statusFile) throws IOException{
HashMap<String,Integer> statusMap = new HashMap<String, Integer>();
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(statusFile), "GBK"));
String line;
String[] arr;
while((line = br.readLi... | 9 |
public static final TCache instance(Properties p){
TCache cache = null;
CacheType cacheType = null;
if(p == null || !p.containsKey(TCache.CACHE_TYPE_KEY)) {
cacheType = CacheType.CACHE;
}else{
String tmp = p.getProperty(TCache.CACHE_TYPE_KEY);
if(tmp.equals(CacheType.STORE.toString())){
cacheType ... | 8 |
public static void printInfo() {
System.out.println("FileToPNG conversion tool");
System.out.println("\"Core Version\": "+((int)VERSION & 0xFF));
System.out.println("USAGE:");
System.out.println("java -jar filetopng.jar [input file] [direction] [output] [deflate]");
System.out.println();
System.out.println(... | 0 |
public static double abs_max(double var0, double var2) {
if(var0 < 0.0D) {
var0 = -var0;
}
if(var2 < 0.0D) {
var2 = -var2;
}
return var0 > var2?var0:var2;
} | 3 |
public void imbue()
{
} | 0 |
public void keyReleased(KeyEvent ke)
{
int kc = ke.getKeyCode();
if(kc == KeyEvent.VK_RIGHT || kc == 68)
p.input.remKey(Input.RIGHT);
if(kc == KeyEvent.VK_LEFT || kc == 65)
p.input.remKey(Input.LEFT);
if(kc == KeyEvent.VK_UP || kc == 87)
p.input.remKey(Input.UP);
if(kc ... | 8 |
public Object invoke() {
try {
return method.invoke(self, parameters);
} catch (Exception ex) {
throw new PatternException("Exception during invocation of `" + self.getClass() + "#" + method.getName() + "`", ex);
}
} | 1 |
private void getJob() {
System.out.println( client.getRemoteSocketAddress() + " has requested a job");
Job job = queue.getNextJob();
if(job == null){
// Tell them that we have no job
out.println(Command.NO_JOB);
}else{
out.println(Command.HAVE_JOB);
... | 2 |
private static double oper(double a, double b, Operation op){
if (a == -1 || b == -1)
return -1;
switch (op){
case ADD:
return a+b;
case SUB:
return a-b;
case MULT:
return a*b;
case DIV:
... | 7 |
@Override
public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
StyledText styledText = viewer.getTextWidget();
if (styledText == null) {
return;
}
final Shell browserShell = new Shell(shell, SWT.APPLICATION_MODAL);
browserShell.setLayout(new FillLayout());
final Browser... | 9 |
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 setMaxLitterSize(int newMAX_LITTER_SIZE)
{
MAX_LITTER_SIZE = newMAX_LITTER_SIZE;
} | 0 |
public void enviarAModulo(){
int modulo = usuarioInstancia.getUsuarioIngresado().getIdModulo();
if(modulo == 1){
tpPrincipal.getTabs().add(getTabPrincipalMesero());
}else if(modulo == 2){
tpPrincipal.getTabs().add(this.getTabPrincipalChef());
}else if(modulo == 3){
tpPrincipal.getTabs().add(this.g... | 3 |
public Explosion(int x, int y) {
this.y = y;
this.x = x;
width = 30;
height = 30;
try {
BufferedImage spritesheet = ImageIO.read(getClass().getResourceAsStream("/Sprites/Enemies/explosion.gif"));
sprites = new BufferedImage[6];
for (int i = 0; i < sprites.length; i++) {
sprites[i] = spritesheet... | 2 |
public void actionPerformed(ActionEvent e)
{
// handles assign referees button being pressed
if (e.getSource() == assignRefereesButton)
assignReferees();
} | 1 |
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int cases=scanner.nextInt();
while (cases-->0){
int r=scanner.nextInt(),c=scanner.nextInt();
init(r,c);
for(int i=0;i<r;++i){
for(int j=0;j<c;++j){
... | 3 |
public static String editPasswd(Display display,
final Map<String,String> m,
final String name)
{
final Shell shell = new Shell(display);
shell.setText ("Edit password");
shell.setLayout (new FormLayout());
hack_string = null;
Control tname;
final Text tname_text;
if (nam... | 9 |
public PasswdDialog(String title, boolean userDisabled,
String userName, boolean passwdDisabled) {
super(true);
setResizable(false);
setTitle(title);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
endDialog();
}
});
J... | 3 |
private String readString() throws JSONException {
Kim kim;
int from = 0;
int thru = 0;
int previousFrom = none;
int previousThru = 0;
if (bit()) {
return getAndTick(this.stringkeep, this.bitreader).toString();
}
byte[] bytes = new byte[65536];... | 9 |
public Supplier getSupplierByName(String supplierName){
for(Person person : supplierList){
if(person.getName().equalsIgnoreCase(supplierName)){
return (Supplier)person;
}
}
return null;
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Group other = (Group) obj;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.... | 9 |
public ArrayList<Node> readFromAdjacencyList(String file){
ArrayList<Node> network = new ArrayList<Node>();
boolean start = false;
try
{
BufferedReader in = new BufferedReader(new FileReader(file));
String line;
int s;
int d;
S... | 6 |
@Override
public void updateState(eBattleFieldMode state) {
switch (state) {
case Design:
playerGrid.setMode(eBattleFieldMode.Playable);
oponentGrid.setMode(eBattleFieldMode.Displaying);
break;
// this means its players turn
... | 3 |
@Override
public String getDesc() {
return "Resurrection";
} | 0 |
public JoeException(int exceptionSelector) {
super ((String) exceptionMessages.get(new Integer(exceptionSelector))) ;
} // end constructor JoeException | 0 |
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.