text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void editLink(String classOneName, String classTwoName){
for (int i=0;i<components.size();i++){
if (components.get(i).name.equals(classOneName)){
for (int j = 0; j<components.get(i).links.size(); j++){
if (components.get(i).links.get(j).classTwoName.equals(classTwoName)){
//blank icon b... | 7 |
@RequestMapping("multiDel")
public String multiDel(String[] ids,String flag){
if(ids ==null ||ids.equals("")){
if(flag =="listAll" || flag.trim().equals("listAll")){
return "forward:/rescue/getAllMess";
}else{
//request.setAttribute("status",flag);
return "forward:/rescue/getStatusMess?status="+ f... | 6 |
public static List<Object[]> generateBatchQueryArguments(Object[] args, BatchDefinition batchDefinition) {
// 获取批量SQL/Shell的批数,即@BatchParam对应的几个数组的最小length
int batchSize = -1;
Integer[] batchParamIndexes = batchDefinition.getBatchParamIndexes();
for (int i = 0; i < batchParamIndexes.length; i++) {
int index ... | 4 |
public void save(String fileName) {
try {
OutputStream file = new FileOutputStream(fileName);
OutputStream buffer = new BufferedOutputStream(file);
ObjectOutput output = new ObjectOutputStream(buffer);
output.writeObject(map.getData());
output.close();
buffer.close();
file.close();
} catch... | 2 |
public static String findLongest(String input) {
//maintain this to record
boolean [][]isPalindrome = new boolean[input.length()][input.length()];
int maxLength = Integer.MIN_VALUE;
int start = -1;
//first find single length palindromes
for( int i = 0; i< input.length();... | 8 |
public boolean collectTypeInfo() {
typeInfo.clear();
for (int i = 0; i < moduleNum; i++) {
int rowPoint = 0;
while (true) {
String line = "";
for (int j = 0; j < 5; j++) {
String cell = null;
if (typeTable[i].getValueAt(rowPoint, j) != null) {
cell = (String) typeTable[i].getValueAt(ro... | 5 |
public void run() {
try {
while (!isInterrupted()) {
int msg = is.read();
if(msg == -1) return;
switch (msg) {
case OpCodes.DISCONNECT:
return;
case OpCodes.SET_IDLE: {
monitor.setMovieMode(false);
break;
}
case OpCodes.SET_MOVIE: {
monitor.setMovieMode(true);
b... | 8 |
private void handleMessage(RoomMessage room_message)
{
if (!changing_room )
{
if ( bot_data.enablePlusPlus )
{
//TODO maybe I can make a special type of command that can get all text instead of matching on command?
//can use to run standup and plusplusbot?
handlePlusPlusBot(room_message);
... | 9 |
public static void graphDepthFirstTraversal(String[][] edgeList){
if(edgeList.length == 0){
return;
}else{
ArrayList<String> discovered = new ArrayList<String>();
timeStamp = 0;
for(String[] edge : edgeList){
String node1 = edge[0];
String node2 = edge[1];
if(!dis... | 4 |
public void reducePlayerHealth(String userName){
try {
cs = con.prepareCall("{call reducePlayerHealth(?)}");
cs.setString(1, userName);
cs.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
} | 1 |
public double[] nextDoubles(int n) throws IOException {
double[] res = new double[n];
for (int i = 0; i < n; ++i) {
res[i] = nextDouble();
}
return res;
} | 1 |
public Abrir() {
initComponents();
} | 0 |
public void placePieceOnBoard(Position myFreeposition, List<Position> freePositions) {
freePositions.remove(myFreeposition);
int x = myFreeposition.getX();
int y = myFreeposition.getY();
Position tmp = new Position(x, y);
for (int xx = x, yy = y; xx < did.getN() && yy < did.getM(... | 8 |
@SuppressWarnings("unchecked")
public Map<String, Object> readDaily(String file) {
Map<String, Object> result = new LinkedHashMap<String, Object>();
try{
// Open the file
FileInputStream fstream = new FileInputStream(file);
// Get the object of DataInputStream
... | 9 |
@Override
public void actionPerformed(ActionEvent e)
{
if(e.getActionCommand().equals("Terminate Scouting"))
{
//Terminate Scouting Button was Pressed
//Check if Good Quit or not
if(MainGUI.numConnected == numFinished)
{
//Nullify Communication Threads
for(int k = 0;k<=5;k++)
{
... | 5 |
@Override
public Set<String> getEntities() throws DataLoadFailedException {
return getList("entities", "name");
} | 0 |
public void actionPerformed(ActionEvent event)
{
if(event.getSource() == humanButton) {
isHuman = true;
isElf = false;
isDwarf = false;
}
else if(event.getSource() == elfButton) {
isHuman = false;
isElf = true;
isDwarf = false;
}
else if(event... | 9 |
@Override
public void setPhone(String phone) {
super.setPhone(phone);
} | 0 |
public HashMap<String, Integer> fillFoldersWithFiles(int minFileSize, int maxFileSize) throws FoldersNotCreated, IOException {
if (!this.foldersCreated) {
throw new FoldersNotCreated();
}
FileWriter fstream = new FileWriter(this.fsFolder + files_created);
BufferedWriter out = new BufferedWriter(fstream);
... | 4 |
@Override
public String execute() throws Exception {
if (!this.userService.verifyLeader(cid, this.userService.getCurrentUser().getUid()))
return LOGIN;
System.out.println("-------------------- cid:" + cid + " account:" + account + " oldJob:" + oldJob + " newJob:" + newJob + " -------------------- ");
if... | 7 |
private Node getNext(Node u)
{
if (u.right == null)
{
Node n = u;
do {
u = n;
n = n.parent;
if (n == null) return null;
} while (u == n.right); //got nullpointer
return n;
}
Node n = u.ri... | 4 |
@Override
public void actionPerformed(ActionEvent e) {
// CLEAR ALL THE LISTS!
DefaultListModel<ImageIcon> listModel = (DefaultListModel<ImageIcon>)imageSlider.iconList.getModel();
listModel.removeAllElements();
listModel.clear();
imageSlider.imageList.clear();
// Get the results depending o... | 5 |
@Override
public void executeCommand(CommandSender sender, Command cmd, String[] args){
CommandHelper helper = new CommandHelper(sender, cmd);
Player player = (Player) sender;
//Usage: /ghostsquadron map <create/delete> <name>
if(args.length == 3){
if(args[0].equalsIgnoreCase("map")){
if(args[1].e... | 7 |
public void enter(Miner miner){
//if the miner is not already located at the goldmine, he must
//change location to the gold mine
if (miner.getLocation() != Location.goldmine)
{
System.out.println(miner.getName() + " Walkin' to the goldmine");
miner.changeLocation(Location.goldmine);
}
... | 1 |
public void parseCards() {
for (String msg : read) {
for (CardData list : CardData.values()) {
if (list.name.toLowerCase().equals(msg.toLowerCase())) {
cards.add(processedCard(list));
}
}
}
} | 3 |
public int[] searchRange(int[] A, int target) {
int[] out = {-1, -1};
if (A == null || A.length == 0)
return out;
int start = 0;
int end = A.length - 1;
while (start <= end) {
int mid = start + (end - start)/2;
if (A[mid] < target)
... | 9 |
private static int hexToBinNibble(char c) {
int result = -1;
if ((c >= '0') && (c <= '9'))
result = (c - '0');
else {
if ((c >= 'a') && (c <= 'f'))
result = (c - 'a') + 10;
else {
if ((c >= 'A') && (c <= 'F'))
... | 6 |
public static int sumScores(Scores obj)
{
int total = 0;
// total up all the stored scoreds in the paramter object
for (int i = 0; i< obj.grades.length; i++)
{
total = total + obj.grades[i];
}
return total;
} | 1 |
@Override
public void gerer(Commande commandRyan, Commande commandAlex) {
HashMap<String, Boolean> estGele_atPre = new HashMap<>();
estGele_atPre.put(ryan().nom(), super.estGele(ryan().nom()));
estGele_atPre.put(alex().nom(), super.estGele(alex().nom()));
estGele_atPre.put(slick().nom(), super.estGele(slick()... | 9 |
private Collection<? extends Node> getDropNodes(BlockType type, int x, int lowestY, DropDirection dd) {
ArrayList<Node> result = new ArrayList<Node>();
switch(dd){
case UP:
if(type==BlockType.Corner){
result.add(Node.getNode(Coordinate.getCoordinate(x, lowestY)));
result.add(Node.getNode(Coordinate.get... | 9 |
private boolean evaluatePairing ()
{
int toprank = 0;
int botrank = 0;
int topind = 0;
int botind = 0;
for (int i=Rank.NUM_RANK-1; i>=0; i--)
{
//int rankhashi = _rankhash[i];
int rankhashi = (int)((_Rankhash>>(4*i)) & 0xF);
if (rankhashi > toprank)
{
botrank = toprank;
... | 8 |
private boolean addPosition(KrakenState state, XYLocation kingLocation,XYLocation location,
ArrayList<KrakenMove> list,XYLocation finalLocation){
if (state.distance(kingLocation, location, finalLocation)){
if (state.isEmpty(finalLocation)){
list.add(new KrakenMove(location, finalLocation));
return fa... | 5 |
public static byte[] createChecksum(String filename) throws FileNotFoundException
{
InputStream fis = new FileInputStream(filename);
try
{
byte[] buffer = new byte[1024];
MessageDigest complete = MessageDigest.getInstance("MD5");
int numRead;
... | 5 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
int[] nm = readInts(in.readLine());
int n = nm[0], m = nm[1];
Dijkstra G = new Dijkstra(n + 1);
G.init(n + 1);
int[] cost = readInt... | 4 |
public String getDate() {
return date;
} | 0 |
private Integer score(String name) {
int sum=0;
for(byte b:name.getBytes()){
sum+=b-'A'+1;
}
return sum;
} | 1 |
private boolean isPower(int n) {
if (n == 0 || n == 1) return true;
HashMap<Integer, Integer> frequencyMap = new HashMap<>();
for (int i = 2; i <= n; i++) {
while (n % i == 0) {
if (frequencyMap.get(i) == null)
frequencyM... | 9 |
private static boolean newAngleBeforeOldAngle(AngleInterval newAngle, AngleInterval oldAngle)
{
return newAngle != null &&
(oldAngle == null ||
((oldAngle.leftAngle < oldAngle.rightAngle && newAngle.leftAngle < oldAngle.rightAngle) ||
oldAngle.leftAngle > old... | 4 |
public String toString() {
try {
java.io.StringWriter strw = new java.io.StringWriter();
TabbedPrintWriter writer = new TabbedPrintWriter(strw);
writer.println(super.toString() + ": " + addr + "-"
+ (addr + length));
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_INOUT) != 0) {
writer.pr... | 5 |
public static void main(String[] args) {
// AucBuyout.start();
String login = null;
String action = null;
if(args.length == 2 && args[1] == "gui") {
new Gui();
} else if (args.length == 3) {
login = args[1];
action = args[2];
}
while(login == null) {
login = select_login();
}
S... | 5 |
@Override
public int combine(MDDManager ddmanager, int first, int other) {
// NOTE: all operations do not return a node when merging it with itself (stable states, xor, ...)
NodeRelation status = ddmanager.getRelation(first, other);
MergeAction action = t[status.ordinal()];
if (action == MergeAction.ASKME) {
... | 9 |
public void Play(){
if(Hero.x != x)
if(Hero.x > x){
if(!Terrain.checkOccupance(x+width+deltax, y+(height/2)+deltay))
x+=deltax;
} else {
if(!Terrain.checkOccupance(x-deltax, y+(height/2)))
x-= deltax;
}
if(Hero.y != y)
if(Hero.y > y){
if(!Terrain.checkOccupance(x+(width/2), y+height+deltay... | 8 |
public void info(String... msg) {
if (!open)
throw new RuntimeException("Cannot log new items: the log has closed!");
if (parent != null)
parent.info(msg);
else {
Object[] args = new Object[msg.length - 1];
System.arraycopy(msg, 1, args, 0, msg.length - 1);
logQueue.offer(new LogItem(Level.INFO, St... | 2 |
@Override
public void mouseClicked(MouseEvent e) {} | 0 |
public void itemStateChanged(ItemEvent evt) {
if (evt.getSource() == chb_alarmon) {
clkinput.alarmOn = evt.getStateChange() == ItemEvent.SELECTED;
clkinput.getSemaphoreInstance().give();
clkcanvas.repaint();
}
} | 1 |
public void validate() throws FtpWorkflowException, FtpIOException {
if (this.getLines().size() <= 0)
throw new FtpIOException("000", "Did not receive any reply!");
if (ReplyCode.isPermanentNegativeCompletionReply(this)) {
if (getReplyCode().intern() == ReplyCode.REPLY_530.intern()... | 5 |
private void knightBottomBottomRightPossibleMove(Piece piece, Position position)
{
int x1 = position.getPositionX();
int y1 = position.getPositionY();
if((x1 >= 0 && y1 >= 2) && (x1 <= 6 && y1 < maxHeight))
{
if(board.getChessBoardSquare(x1+1, y1-2).getPiece().getPieceType() != board.getBlankPiece().getP... | 6 |
private void parseLine(int vertexCount) {
String[] rawFaces = null;
int currentValue;
vertices = new Vertex[vertexCount];
for (int i = 1; i <= vertexCount; i++) {
rawFaces = words[i].split("/");
// v
currentValue = Integer.parseInt(rawFaces[0]);
vertices[i - 1] = object.getVertices().get(currentVal... | 5 |
public Expression bind(StructuredQName functionName, Expression[] arguments, StaticContext env)
throws XPathException {
final String uri = functionName.getNamespaceURI();
final String localName = functionName.getLocalName();
String targetURI = uri;
boolean builtInNamespace = ... | 9 |
private Color getColor(Edge edge) {
if (edge == null) {
return Color.WHITE;
} else if (edge.getEdgeState() == EdgeState.BURNED) {
return Color.GREEN;
} else if (edge.getEdgeState() == EdgeState.CLOSED) {
return Color.BLUE;
} else {
return Color.BLACK;
}
} | 3 |
public Rectangle computeScaledBounds(final int zoom, final Dimension size) {
final double sDPI = dpi;
double width = sWidth * sDPI;
double height = sHeight * sDPI;
switch (zoom) {
case FIT_WIDTH: // FIT_WIDTH
{
double sw = ((double) size.width) / w... | 9 |
public ArrayList<AlumneVo> llistarAlumnes() {
//crea ArrayList de persones per guardarles
ArrayList<AlumneVo> alumnes= new ArrayList< AlumneVo>();
//connexio amb la bd
DbConnection conex= new DbConnection();
try {
PreparedStatement consulta = conex.getConnection().prepareStatemen... | 2 |
private static String infix2postfix(String[] tokens) throws CalcException {
double c;
String token;
postfix = new StringBuilder();
opStack = new Stack<Operator>();
brStack = new Stack<Bracket>();
intStack = new Stack<Integer>();
Operator op;
Bracket... | 7 |
void removeAwaitingResume(DccFileTransfer transfer) {
_awaitingResume.removeElement(transfer);
} | 0 |
public void startElement(String uri, String sname, String qname, Attributes atts) {
Object context = null;
if (!_contextStack.isEmpty()){
context = _contextStack.peek();
}
String attrName = atts.getValue(_attribute_name);
String attrLabel = atts.getValue(_attribute_label);
String attrDesc = atts... | 8 |
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
ServletPrinter sp = null;
PreparedStatement stmt = null;
Connection conn = null;
sp = new ServletPrinter(response, "RegisterUser");
String categoryName, nickname, f... | 8 |
public static void jarviz() {
jButton1.setEnabled(false);
jButton2.setEnabled(false);
for (Shapes.Point point : points) {
copyArray.add(point);
}
bestPoints = new ArrayList<Shapes.Point>();
Shapes.Point cP = points.get(closestPoint());
bestPoints.ad... | 8 |
protected static List<CCNode> processNodes(final List<String> nodeNameData,
final List<String> nodePositionData, final CCModel model)
throws Exception {
ArrayList<CCNode> nodes = new ArrayList<>();
/**
* Verifiy and add nodes *
*/
if (nodeNameData.size... | 2 |
public String translate(String code, Object... args) {
if(translations.containsKey(code))
return String.format(translations.get(code), args);
if(code == null || code.equals(""))
return "";
if(translations.containsKey("translation.missing"))
System.err.println(translate("translation.missing", code));
... | 5 |
*/
private static void initMap(DataRetriever data) {
for (int i = 0; i < data.generateFlights().length; i++) {
map.put(data.flights[i].toString(), new HashSet());
}
} | 1 |
public char skipTo(char to) throws JSONException {
char c;
try {
int startIndex = this.index;
int startCharacter = this.character;
int startLine = this.line;
reader.mark(Integer.MAX_VALUE);
do {
c = next();
if (c... | 3 |
public boolean isRotation(String s1, String s2){
if(s1.length()!=s2.length()){
return false;
}
s1 = s1+s1;
for(int i=0; i<s1.length()/2; i++){
if(s1.substring(i, s2.length()+i).equals(s2)){
return true;
}
}
return false;... | 3 |
@EventHandler
public void PlayerInvisibility(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.getPlayerConfig().getDouble("Player.In... | 6 |
public void renderPlatformScore(int yp, Sprite sprite) {
for(int y = 0; y < sprite.SIZE; y++) {
int ya = y + yp;
for(int x = 0; x < sprite.SIZE; x++) {
int xa = x + (Game.WIDTH/2);
if(xa < -sprite.SIZE || xa >= width || ya < 0 || ya >= height) break;
if(xa < 0) xa = 0;
int col = sprite... | 8 |
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... | 8 |
public ArrayList<Restaurant> getAllRestaurants() throws IOException {
Document doc;
String url;
ArrayList<Restaurant> rList = new ArrayList<>();
Set<String> names = new HashSet<>();
int prevSize = -1;
for (int i = 1; i <= pages; i++) {
if (names.size() == ... | 9 |
public String getRepositoryForDirectory(final String directory, final String repository) throws IOException {
// if there is no "CVS/Repository" file, try to search up the file-
// hierarchy
File repositoryFile = null;
String repositoryDirs = ""; // NOI18N
File dirFile = new File... | 9 |
public static Boolean get(IntBuffer array, int index) {
int value = array.get(index >>> 4) >> ((index & 15) << 1);
switch (value & 3) {
case 0:
return false;
case 1:
return true;
case 2:
return null;
default:
throw new AssertionError();
}
} | 3 |
private boolean isValid(int[][] puzzle, int number, int row, int col){
//if the number is 0 it means it will be an empty box, so no need to check it.
if(number == 0 || number > 9){
return true;
}
//check the column
for(int k=0; k<9; k++){
if(puzzle[row][k] == number)
return false;
... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
// Handle open button action.
if (e.getSource() == view.getOpenButton()) {
int returnVal = fc.showOpenDialog(view);
if (returnVal == JFileChooser.APPROVE_OPTION) {
file = fc.getSelectedFile();
// This is where a real application would open the f... | 6 |
private void clearColumnDividerHighlight() {
if (mMouseOverColumnDivider != -1) {
repaintDivider(mMouseOverColumnDivider);
mMouseOverColumnDivider = -1;
}
setCursor(Cursor.getDefaultCursor());
} | 1 |
* @return true if it worked.
*/
private boolean viEndWord(int count) throws IOException {
int pos = buf.cursor;
int end = buf.buffer.length();
for (int i = 0; pos < end && i < count; i++) {
if (pos < (end-1)
&& !isDelimiter(buf.buffer.charAt(pos))
... | 9 |
protected int handleInput(Automaton automaton, AutomatonSimulator simulator, Configuration[] configs,
Object initialInput, List associatedConfigurations) {
JFrame frame = Universe.frameForEnvironment(getEnvironment());
// How many configurations have we had?
int numberGenerated = 0;
// When should the nex... | 6 |
public void resetSounds()
{
startClip.stop();
startClip.setMicrosecondPosition(0);
warnClip.stop();
warnClip.setMicrosecondPosition(0);
overClip.stop();
overClip.setMicrosecondPosition(0);
} | 0 |
public static void main(String[] args) throws Exception{
int repeated = 0;
/*
不断提交MapReduce作业直到相邻两次迭代聚类中心的距离小于阈值或到达设定的迭代次数
*/
do {
Configuration conf = new Configuration();
String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
... | 4 |
public void method210()
{
for(int i = 0; i < anInt292; i++)
{
for(int j = 0; j < anInt293; j++)
if(i == 0 || j == 0 || i == anInt292 - 1 || j == anInt293 - 1)
anIntArrayArray294[i][j] = 0xffffff;
else
anIntArrayArray294[i][j] = 0x1000000;
}
} | 6 |
@Override
public String toString()
{
if (isEmpty()) return "empty";
String result = "";
Queue<Node> q = new Queue<>();
q.enqueue(root);
Node firstOnLevel = null;
while (!q.isEmpty())
{
Node u = q.dequeue();
if (u == firstOnLevel)
... | 9 |
private void borrowerSearch(){
boolean quit;
String keyword;
//BorrowerModel b = new BorrowerModel();
Class c = b.getClass();
ArrayList<Match> books = new ArrayList<Match>();
Object tempBooks;
quit = false;
//RETURN TYPES
try{
while (!quit){
System.out.println("En... | 9 |
private void loadPatientInformation(String patientID) {
ResultSet rs = dbQuery.Patient_GetPatientInformation(patientID);
if (rs != null) {
System.out.println("Patient Information Loaded Successfully.");
try {
while(rs.next()){
txt_PatientID.setText(rs.getObject("PatientID").toString());
txt_P... | 4 |
public void sendMessageWrapper(String recipient, String nick, String message) {
// Split the string first into mutliple lines
StringTokenizer token = new StringTokenizer(message, " ");
StringBuilder chunk = new StringBuilder(MAXMSGLENGTH);
ArrayList<String> lines = new ArrayList<String>(... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Parameter other = (Parameter) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return fals... | 9 |
public void teleport(Player p){
for (GameObject object : World.backgroundTiles) {
if(object.getClass() == this.getClass()){
Portal portal = (Portal) object;
if(portal.getId() == targetId){
p.setPosition(portal.getX(), portal.getY());
}
}
}
} | 3 |
public WindowAdapter(JFrame frame) {
this.frame = frame;
} | 0 |
public boolean moveLine(int x0,int y0,int x1,int y1)//让块按照直线走,走完返回true
{
int x=this.getX();
int y=this.getY();
if(x0==x1&&y0==y1)//not line
return true;
if(x0==x1)//horizen line
{
if(y0>y1)
y-=5;
else
y+=5;
... | 8 |
@Test
public void generic() {
ArrayList<Unit<Integer, String>> haystack = new ArrayList<Unit<Integer, String>>();
int count = 100;
for (int i = 0; i < count; i++) {
if (i % 3 == 0) {
continue;
}
haystack.add(new Unit<Integer, String>(i, Str... | 6 |
@Inject
public MarshallerPool(@Named("marshalContext") JAXBContext context) {
this.context = context;
} | 0 |
@SuppressWarnings("unchecked")
public ArrayList<T> list() {
Cursor c = null;
ArrayList<T> r = new ArrayList<T>();
c = getSQLCursor();
if (c.moveToFirst()) {
do {
try {
r.add((T) Model.load(mDB.mContext, E, c));
} catch ... | 3 |
public static String assign(Person person) {
String job = "";
// logic goes here
String currentJob =
person.getJobArray().get(person.getJobArray().size() - 1);
String previousJob =
person.getJobArray().get(person.getJobArray().size() - 2);
if (person.getDishes()) {
if (currentJob.eq... | 8 |
public synchronized Queue<String> getUnsearchList(){
return this.unsearchSitesList;
} | 0 |
public static boolean isCheckedException(Throwable ex) {
return !(ex instanceof RuntimeException || ex instanceof Error);
} | 1 |
public static Graph perform( Graph g )
{
List< Set<Vertex> > sets = new LinkedList<>();
Edge [] edges = g.edges();
List<Edge> finalEdges = new LinkedList<>();
Queue<Edge> edgeQueue = new PriorityQueue<>(edges.length, new Comparator<Edge>()
{
public int compare(Edg... | 8 |
public static void main(String[] args) throws MalformedURLException {
for (int i = 0; i < 2000; i++) {
for (int j = 0; j < 1000; j++) {
URL url = new URL("http://www.gamestar.de/_misc/betatest/betatest.cfm?pk=" + i + "&pid=" + j);
if(verifyLink(url)){
... | 7 |
public static void addPlayerMove()
{
do
{
System.out.println("Please enter the coordinates of your move. (ex. B1)");
Scanner keyboard = new Scanner(System.in);
move = keyboard.nextLine();
switch(move.substring(0,1))
{
case "A":
case "a":
row = 0;
break;
case "B":
ca... | 7 |
@Override
public void serialize(Buffer buf) {
buf.writeUShort(aliases.length);
for (String entry : aliases) {
buf.writeString(entry);
}
buf.writeUShort(arguments.length);
for (String entry : arguments) {
buf.writeString(entry);
}
buf.wr... | 3 |
public int reverse(int x) {
boolean negative = false;
if (x == Integer.MIN_VALUE)
return 0;
if (x != Math.abs(x)) {
negative = true;
x = Math.abs(x);
}
int result = 0;
while (x != 0) {
if (result > Integer.MAX_VALUE / 10) {
return 0;
} else if (result == Int... | 7 |
public void showMainInstructions(final int pageIndex) {
removeActionListeners(nextButton);
removeActionListeners(previousButton);
if (pageIndex < Text.TEXT_INSTRUCTIONS.length) {
//not last page
nextButton.setText(Text.BTN_NEXT);
nextButton.setVisible(true);
nextButton.addActionListener(new Action... | 3 |
public void setCanEditFollow(boolean canEdit) {
canEditColumn[2] = canEdit;
} | 0 |
public static boolean isCommand(String command, String message)
{
String cmd = message.split(" ")[0];
//System.out.println("Len: " + cmd.replace("!", "").replace("/", "").length() + " vs. " + command.length());
if (cmd.replace("!", "").replace("/", "").length() != command.length())
... | 3 |
private void removeReturnLocal(ReturnBlock ret) {
StructuredBlock pred = getPredecessor(ret);
if (!(pred instanceof InstructionBlock))
return;
Expression instr = ((InstructionBlock) pred).getInstruction();
if (!(instr instanceof StoreInstruction))
return;
Expression retInstr = ret.getInstruction();
i... | 4 |
private void startGenerating() {
// check if number CAN be sorted
boolean sortCheck = Lib.checkInput(gui.getTextFields(), gui.getRingNumber());
// if number not sortable throws errorMsg
if (sortCheck) {
// divide fighters
int[] sortingFacts = Lib.PoolDivide(gui.getTextFields(), gui.getRingNumber(... | 5 |
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.