text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void run() {
BufferedReader is;
try {
is = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
String response=is.readLine();
String[] parts=response.split(":");
String action=parts[0];
String[] contents=parts[1].split("/");
PrintWriter os=new PrintW... | 6 |
@Override
public List<Point> startPathfinder(boolean diagonalAllowed) {
ArrayList<MazeCell> closedSet = new ArrayList<>();
ArrayList<MazeCell> openSet = new ArrayList<>();
openSet.add(start);
ArrayList<MazeCell> pathMap = new ArrayList<>();
while (!openSet.isEmpty()) {
... | 7 |
private void writeDoubleArray(Object value, int type) {
writeList.clear();
int len = Array.getLength(value);
if (len > 0) {
if (type == ElementType.TYPE_DOUBLE_ARRAY) {
for (int i=0;i<len;i++) {
writeList.append(Array.getDouble(value,i));
... | 5 |
public static String[] split(String eff) {
int idxBr = eff.indexOf('[');
int idxParen = eff.indexOf('(');
String eff0 = null;
if ((idxBr >= 0) && (idxBr < idxParen)) {
int idxRbr = eff.indexOf(']');
eff0 = eff.substring(0, idxRbr + 1);
eff = eff.substring(idxRbr);
}
eff = eff.replace('(', '\t'); ... | 3 |
public boolean empty() {
for (int i = 0; i < tileArray.length; i++) {
for (int j = 0; j < tileArray[0].length; j++) {
for (int k = 0; k < tileArray[0][0].length; k++) {
if (tileArray[i][j][k] != 0) {
return false;
}
... | 4 |
LenDecoder() {
} | 0 |
public Character SwapHero(Character willBeSwappedHero) {
Character temp = null;
try{
temp = hero;
hero = null;
//hero = CharacterFactory.getCharacter(Constants.CHARACTER_RANDOM);
hero = willBeSwappedHero;
}catch(Exception e){
hero = temp;
temp = null;
}
return temp;
} | 1 |
public String mode_string()
{
switch (h_mode)
{
case STEREO:
return "Stereo";
case JOINT_STEREO:
return "Joint stereo";
case DUAL_CHANNEL:
return "Dual channel";
case SINGLE_CHANNEL:
return "Single channel";
}
return null;
} | 4 |
public static void main(String[] args) {
prepareMenu();
printMenu();
supplyBeverage(inputCustomerChoice());
} | 0 |
@Override
public void buildTopping() { pizza.setTopping("pepperoni+salami"); } | 0 |
public void fireBundleEvent(BundleEvent event)
{
// Take a snapshot of the listener array.
Map<BundleContext, List<ListenerInfo>> listeners = null;
Map<BundleContext, List<ListenerInfo>> syncListeners = null;
synchronized (this)
{
listeners = m_bndlListeners;
... | 8 |
public String getID(double x, double y) {
if (nw == null) return this.id;
if (nw.canZoom(x, y)) return nw.getID(x, y);
if (ne.canZoom(x, y)) return ne.getID(x, y);
if (sw.canZoom(x, y)) return sw.getID(x, y);
if (se.canZoom(x, y)) return se.getID(x, y);
return id;
} | 5 |
@Override
public Parameter getParameter(final int parameterIndex) {
Parameter parameter;
switch (parameterIndex) {
case 0:
case 1:
parameter = super.getParameter(parameterIndex);
break;
case 2:
parameter = rate;
... | 8 |
public String getUsers(){
StringBuffer ret = new StringBuffer(threads.size()*10+12);
ret.append("Users in room: [");
for (ChatServerThread thread : threads){
if (thread!=null && thread.isLoggedIn() && thread.isAlive())
ret.append(""+thread.getUserName()+", ");
}
... | 4 |
public void fireMissiles(){
int checker = rd.nextInt(400);
if(checker < 10){
if(!shoudlGenerateExtremeMissiles){
for(int i = 0; i < missiles.length; i++){
if(missiles[i] == null){
missiles[i] = new Missile(this, settings.missileColor, settings.missileSpeed,
rd.nextInt(Math.abs(settings... | 6 |
@EventHandler (priority = EventPriority.MONITOR, ignoreCancelled = true)
public void damageDealt(EntityDamageByEntityEvent event) {
if(event.getDamager() instanceof Player) {
Player damager = (Player) event.getDamager();
if (event.getEntity() instanceof Player) {
plugin.getASPlayer(damag... | 4 |
private static Boolean checkInterval(int intervalSeconds) {
if ((intervalSeconds < MIN_SECONDS) || (intervalSeconds > MAX_SECONDS)) {
return false;
}
return true;
} | 2 |
public NondeterminismDetector() {
} | 0 |
public Word get(Word word){
int index = base.indexOf(word);
if(index == -1) return null;
return base.get(index);
} | 1 |
public FieldImpl(int width, int height) throws WrongArgumentException {
if(width < 1 || height < 1){
throw new WrongArgumentException("Слишком маленькие размеры поля");
}
if(width > MAX_ALLOWED_FIELD_SIDE_SIZE || height > MAX_ALLOWED_FIELD_SIDE_SIZE){
throw new WrongArgumentException("Слишком большие размер... | 4 |
public void sendAFile( Peer a_recipient, File a_file ) throws UnknownHostException, IOException
{
Socket l_cliSock = new Socket( a_recipient.addr, this.ctrl_fileTransfertPort);
ctrl_uploader.ReSet( l_cliSock, a_file.getAbsolutePath() );
ctrl_uploader.enableProgress( this.ctrl_mainwindow.getFileProgressBar());
... | 4 |
public static void disposeImages() {
// dispose loaded images
{
for (Image image : m_imageMap.values()) {
image.dispose();
}
m_imageMap.clear();
}
// dispose decorated images
for (int i = 0; i < m_decoratedImageMap.length; i++) {
Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decora... | 5 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// 1. 实例化一个硬盘文件工厂,用来配置上传组件ServletFileUpload
DiskFileItemFactory factory = new DiskFileItemFactory();
// 设置上传文件时用于临时存放文件的内存大小,这里是2K.多于的部分将临时存在硬盘
//factory.set... | 5 |
boolean chooseFile() {
folderChooser = ModelerUtilities.folderChooser;
folderChooser.setDialogType(JFileChooser.SAVE_DIALOG);
String s = Modeler.getInternationalText("Download");
folderChooser.setDialogTitle(s != null ? s : "Download");
folderChooser.setApproveButtonText(s);
folderChooser.setApproveButtonTo... | 8 |
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
ChatColor yellow = ChatColor.YELLOW;
ChatColor red = ChatColor.RED;
if(args.length < 1) {
if(sender instanceof Player) {
Player player = (Player) sender;
if(player.hasPermission("CrazyFeet.crazysmoke... | 8 |
private static final boolean isDigit(char ch) {
return ch >= '0' && ch <= '9';
} | 1 |
public boolean fieldEmpty() {
String met = MetSearch.getText();
String con = ConSearch.getText();
String pop = PopSearch.getText();
return (met.equals("") || con.equals("") || pop.equals(""));
} | 2 |
public TurnTest() {
} | 0 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
@Override
public void acceptButtonActionPerformed() {
String selectedNames[] = ds.getSelectedData();
if(selectedNames.length == 3 || selectedNames.length == 4){
DataFrame df = mainApplication.getActiveDataFrame();
boolean[] selection = getValidComposition(df, selectedNames);
... | 9 |
private JPanel createCanvas() {
return new JPanel() {
@Override
protected void paintComponent( Graphics g ) {
super.paintComponent( g );
for( GraphPaintable paintable : paintables ) {
Graphics2D g2 = (Graphics2D) g.create();
paintable.paint( g2 );
g2.dispose();
}
}
};
} | 1 |
public void dispose(){
for (GUI gui:guiLayer){
Input.inputBus.unregister(gui);
}
} | 1 |
private void handleHttpRequests(ChannelHandlerContext ctx, HttpRequest req) {
if (req.getMethod() != HttpMethod.GET){
log.info("Detected POST request - FORBIDDEN");
sendHttpResponse(ctx, req, new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.FORBIDDEN));
}
switch (req.getUri()){
case "/"... | 8 |
public void getAction(GameState gs, int time_limit) {
//MAXSIMULATIONTIME = time_limit;
PlayerActionGenerator pag;
pag = new PlayerActionGenerator(gs);
if (pag.choices.size() > 0) {
List<PlayerAction> l = new LinkedList<PlayerAction>();
{
PlayerAction pa = null;
... | 7 |
public Contents contents() {
return new PContents();
} | 0 |
int[][] IteracionesBusquedaSoluciones(int f, int c) {
int[][] resp = new int[8][2];
int pos = 0;
if(ValidacionSolucion(f-2,c-1))
{ resp[pos][0]=f-2; resp[pos++][1]=c-1; }
if(ValidacionSolucion(f-2,c+1))
{ resp[pos][0]=f-2; resp[pos++][1]=c+1; }
if(ValidacionS... | 9 |
public void init() {
Client.nodeID = Integer.parseInt(getParameter("nodeid"));
Client.portOff = Integer.parseInt(getParameter("portoff"));
String s = getParameter("lowmem");
if (s != null && s.equals("1")) {
Client.setLowMem();
} else {
Client.setHighMem()... | 3 |
public static <GItem extends Comparable<? super GItem>> GItem minItem(final Iterable<? extends GItem> items) {
final Iterator<? extends GItem> iterator = Iterators.iterator(items);
if (!iterator.hasNext()) return null;
GItem result = iterator.next();
while (iterator.hasNext()) {
final GItem item = iterator.n... | 6 |
public void initCards(Random gen, boolean playerOne) {
isPlayerOne = playerOne;
// Generate Player One's deck
for (int i = 0; i < 50; i++) {
int rand = gen.nextInt(10);
if (rand < 4)
playerOneCards.addToDeck(new Monster(CardInstance.MONSTER,
CardType.ATTACK));
else if (rand >= 4 && rand < 8)
... | 8 |
@Override
public String getColumnName(int column) {
switch (column) {
case 0:
return "SUBP";
case 1:
return "URL";
case 2:
return "Drajver";
case 3:
return "Username";
case 4:
... | 5 |
public boolean render(Level level, int x, int y, int z, ShapeRenderer shapeRenderer) {
boolean rendered = false;
float var7 = 0.5F;
float var8 = 0.8F;
float var9 = 0.6F;
ColorCache colorCache;
if (canRenderSide(level, x, y - 1, z, 0)) {
colorCache = getBrightn... | 6 |
@Override
public Program mutate(Program program) throws InvalidProgramException {
if (!(program instanceof ProgramImpl)) {
throw new InvalidProgramException();
}
Random randomGenerator = new Random();
ProgramImpl program1 = (ProgramImpl) program.clone();
List<Reaction> reactions = program1.getReactions();... | 3 |
private boolean shortCircuit()
{
boolean shortCirc = false;
Circuit copy = new Circuit(this);
for (int i = copy.getComponents().size() - 1; i >= 0; i--)
{
Component c = copy.getComponents().get(i);
{
if (c instanceof Resistor)
{... | 6 |
public static void loadDAS4InfoFromConfig() throws IOException{
Properties prop = new Properties();
FileInputStream fis = new FileInputStream("config.txt");
prop.load(fis);
if (!prop.containsKey("username"))
throw new IOException("Missing username entry for config.txt! (key=username)");
if (!prop.conta... | 6 |
/** @return The header panel for this table. */
public OutlineHeader getHeaderPanel() {
if (mHeaderPanel == null) {
mHeaderPanel = new OutlineHeader(this);
}
return mHeaderPanel;
} | 1 |
public void draw(Graphics g)
{
for (int i = 0; i < 64; i++)
{
for (int j = 0; j < 64; j++)
{
tiles[i][j].setType(Scheme.tiles[i][j]);
if (Scheme.labels[i][j]!="")
{
tiles[i][j].makeTextTile(Scheme.labels[i][j]... | 3 |
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
// Set System L&F
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Unsuppor... | 5 |
public void usunOsobe(Osoba osoba) {
osoba = em.find(Osoba.class, osoba.getId());
em.remove(osoba);
} | 0 |
public void setVerbose(boolean verbose) {
this.verbose = verbose;
} | 0 |
private int forward(int obj) {
// There are three cases that you will need to handle here.
// 1) If obj is not a pointer (i.e., if it is greater than
// or equal to zero), then you should just return obj
// directly.
// 2) If obj is a pointer, but the length field of the object
// that ... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof Variable))
return false;
Variable other = (Variable)obj;
if (this.getValue() == null && other.getValue() == null)
return true;
if (this.getValue() != null && other.getValue() != null)
return this.getValue().equals(other.... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
JAgoraNodeID other = (JAgoraNodeID) obj;
if (localID == null) {
if (other.localID != null)
return false;
} ... | 9 |
@Override
public List<Member> getListOfMembers() {
List<Member> member = null;
try {
member = (List<Member>) deserializeXMLToObject("Member.xml");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return member;
} | 1 |
private JPanel createParamLine(int i) {
JPanel paramLine = new JPanel();
paramLine.setLayout(new GridLayout(1, 2));
if(i == 0){
JTextArea originXTA = new JTextArea("Origine en X :");
originXTA.setEditable(false);
originX = new JTextField("" + currentDrawable.getOriginX());
originXTA.setPreferredSiz... | 4 |
@Override
public String getChoix(String p) {
if(p.equals(player1)) {
return this.choise1;
} else if (p.equals(player2)) {
return this.choise2;
}
return "aucun";
} | 2 |
static final void method2383(AbstractToolkit var_ha, int i, Widget class46) {
do {
try {
if (i != -2)
method2383(null, -63, null);
anInt6385++;
boolean bool
= ((ToolkitException.itemLoader.method1941
(((Widget) class46).anInt672, (byte) -74,
((Widget) class46).itemId,
((Widget) class4... | 7 |
public boolean sideCollision(ArrayList<Double> xArray,
ArrayList<Double> yArray)
{
for (Block block : blockArray)
{
for (int i = 0; i < xArray.size(); i++)
{
if ((xArray.get(i) == block.getXValue())
&& (yArray.get(i) == (block.getYValue())))
{
return true;
}
}
}
return false... | 4 |
@Override
public void onSuccessfulStarted() {
System.out.println("onSuccessfulStarted!");
if(!errorsWhileStarting) {
setChanged();
notifyObservers(ModelNotification.CONNECTION_ESTABLISHED);
}
} | 1 |
@Override
public void editElection(Date openNominations, Date start, Date end,
String electoratelectionID) {
if (context.getCurrentUser() != null
&& context.getCurrentUser().isElectionManager()) {
context.getAdminTools().editElection(context.getCurrentUser(),
context.getCurrentElectionID(), openNomina... | 2 |
@Override
public String execute() throws Exception {
try{
Map session =ActionContext.getContext().getSession();
setUser((User) session.get("User"));
setSitelist((List<Publish>) getMyDao().getDbsession().create... | 3 |
private VariablePrecisionTime getVorbisRecordingDate() {
return vorbisDate(true);
} | 0 |
public void encrypt(InputStream in, OutputStream out) throws Exception {
// Symmetrically Encrypted Data Packet
byte version = 4;
int block_size = ecipher.getBlockSize();
int len = 0;
byte[] buf = new byte[184];
int add = 0;
int packet_len;
byte[] padded_b... | 3 |
public List<String> fullJustify(String[] words, int L) {
if(words == null || words.length == 0) return new ArrayList<String>();
List<String> result = new ArrayList<String>();
int lineCount = 0;
List<String> line = new ArrayList<String>();
for(int i=0; i<words.length; i++){
lineCount += words[i].... | 7 |
public void makeNewBlock(int x, int y, int length){
x = x + 8;
Prefab prefab = new Prefab(0, 0, 0, 0);
RoadGenerator roadGen = new RoadGenerator();
int xStart = x - 8;
int xFar = x + (length * 24) + 8;
int yFar = y + ((2 * 8) + (24 * 2));
roadGen.layRoad(xStart, y, xStart, yFar);
roadGen.layRo... | 3 |
public Component getComponentAfter(Container container, Component component) {
return cycle(component, 1);
} | 0 |
private void collectCategoryChanges(CourseModel courseModel,
ArrayList<Change> changes) {
// TODO: category names are long, and they are mapped to numeric codes
// in facets. Something to use in description?
for (String c : categories) {
String code = makeIdSafe(c);
if (courseModel.getCategory(Source.EDX... | 5 |
private void afficherInfos(String path, String fichier)
{
File f = new File(maConf.getRacine() + "\\" +path + "\\" + fichier);
Date date = new Date(f.lastModified());
if(!path.equalsIgnoreCase("/") && !path.equalsIgnoreCase("\\") )
{
path += "/";
}
writer.... | 3 |
@Override
public void run() {
while(running) {
System.out.print("eva < ");
if(scanner.hasNextLine()) {
String input = scanner.nextLine();
emit(new Event(EventType.INPUT, this, input));
}
}
} | 2 |
public DoorTile(Sprite sprite, String id){
super(sprite, id);
} | 0 |
public boolean SetChartType(int type) {
if ((type>=0) && (type<NUMOFCHARTS)) {
m_chartType = type;
return(true);
} else {
return(false);
}
} | 2 |
public int largestRectangleArea(int[] height) {
int result = 0;
Stack<Integer> s = new Stack<Integer>();
for (int i=0; i<height.length; i++) {
if (s.isEmpty() || height[s.peek()] < height[i]) {
s.push(i);
} else {
while (!s.isEmpty() && height[s.peek()] > height[i]) {
in... | 9 |
public E remove(Position<E> p) throws IllegalArgumentException {
Node<E> node = validate(p);
if (numChildren(p) == 2)
throw new IllegalArgumentException("p has two children");
Node<E> child = (node.getLeft() != null ? node.getLeft() : node.getRight() );
if (child != null)
child.setParent(nod... | 5 |
private static EasyPostResponse makeURLConnectionRequest(EasyPostResource.RequestMethod method, String url, String query, String apiKey) throws EasyPostException {
javax.net.ssl.HttpsURLConnection conn = null;
try {
switch (method) {
case GET:
conn = createGetConnection(url, query, apiKey);
break;
... | 9 |
public static void main(String[] args) throws Throwable {
ServerSocket serverSocket = null;
int port = 10009;
try {
serverSocket = new ServerSocket(port);
} catch (IOException e) {
System.err.println("Le serveur ne peut écouter sur le port : " + port);
System.exit(1);
}
Socket clientSocket = null;... | 6 |
public ArrayList<Ball> getBalls() {
return this.balls;
} | 0 |
void Translations() {
if (lang == "Eng") {
file = "File";
help = "Help";
image = "Image";
new1 = "New";
open = "Open";
save = "Save";
exit = "Exit";
about = "About GraphicEditor " + Constants.ver + "";
clear = "Clear";
colourChooser = "ColorChooser";
color = "Color";
fone = "Fo... | 2 |
public void writeUntil(final int end, final CodedOutputStream output)
throws IOException {
while (next != null && next.getKey().getNumber() < end) {
FieldDescriptor descriptor = next.getKey();
if (messageSetWireFormat && descriptor.getLiteJavaType() ==
... | 9 |
public void shutdown() {
shuttingDown = true;
Logger.log("Shutdown was called.");
if(ownsSocket) {
Logger.log("Closing socket.");
socket.close();
} else {
Logger.log("Note: not closing socket!");
}
runningLock.unlock();
} | 1 |
private void openCoreLocationWindow() {
JFileChooser coreFolderSelect = new JFileChooser();
coreFolderSelect.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
coreFolderSelect.setDialogTitle("Select NGECore2 folder");
int success = coreFolderSelect.showOpenDialog(contentPanel);
if (success == JFileChoos... | 6 |
private void processMoveToHand(MouseEvent e) {
List<Card> hand = game.getHand().getList();
if (hand.size() > 0) {
final double handXGap = handXGap(hand.size());
int indexTo = (int) ((e.getX() - handXStart()) / (handXGap + CARD_WIDTH));
activeMove.cardReleased(indexT... | 1 |
@Override
public String toString() {
StringBuilder string = new StringBuilder();
string.append("Citation type: ").append(this.citationType).append("\n");
if (authors != null) {
string.append("Authors: ");
for (Author author : this.authors) {
string.a... | 9 |
@Override
public boolean execute(Player player) {
if (!this.hasSecondWord()) {
GameEngine.gui.println("Test what?");
return false;
}
Scanner vScanner;
try
{
vScanner = new Scanner(new File("./" + this.getSecondWord()));
while... | 3 |
@Override
public Token parse() {
Token test = first.getNext();
if (!test.isOperator(Operator.BRACKET_LEFT))
throw new RuntimeException("Expected '(' after IF, found: " + test.toString());
testExpression = new BooleanExpression(test.getNext(), scope);
test = testExpression.parse();
if (!test.isOpe... | 5 |
private void register(){
int max = deck.cards;
for (int i=0; i<player_count; i++){
Rack r = new Rack(rack_size, this);
players[i].register(this, r);
}
} | 1 |
public PickUp(int state1, int state2) {
this.state1 = state1;
this.state2 = state2;
} | 0 |
protected void fireConnect(ConnectEvent evt) {
//..
} | 0 |
public static void main(String[] args) {
Map<Integer, Integer> p = new HashMap<>();
TreeMap<Integer, Integer> sorted = new TreeMap<>(new ValueComparator(p));
for (int a = 1; a < 999; a++) {
for (int b = 1; b < 999; b++) {
for (int c = 1; c <= 1000; c++) {
... | 6 |
private String cipher_digraph(String pl,HashMap<Character,Pair<Integer> > h1, HashMap<Character,Pair<Integer>> h2)
{
assert(pl.length()==2);
StringBuilder sb=new StringBuilder();
char c1=pl.charAt(0);
char c2=pl.charAt(1);
if(c1=='J')
{
c1='I';
}
if(c2=='J')
{
c2='I';
}
if(!h1... | 5 |
public Vector<Vector<Object>> notesTable() {
try {
String[] keys = {"eventID", "cbsEventID", "noteID", "text", "active"};
crs = qb.selectFrom(keys, "notes").all().executeQuery();
data.clear();
while(crs.next()) {
Vector<Object> row = new Vector<Object>();
ResultSetMetaData metadata = crs.getMet... | 4 |
private double[] sort_intervals(double[] unsorted_intervals) {
int i, length;
double min = unsorted_intervals[0];
double max = unsorted_intervals[0];
double[] sorted_intervals = new double[unsorted_intervals.length];
double[] intervals;
for (i=0; i < unsorted_intervals.length; i++) {
if (max<unsorted_int... | 9 |
public boolean equals(Object o) {
if (o == null) {
return false;
}
if (o == this) {
return true;
}
if (!(o instanceof KeyedObjects)) {
return false;
}
KeyedObjects kos = (KeyedObjects) o;
int count = getItemCount();
... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Comentario other = (Comentario) obj;
if (this.idComentario != other... | 9 |
public Iterable<Work<TI>> iterableWork() {
final Master<TI, TO> master = this;
return new Iterable<Work<TI>>() {
@Override
public Iterator<Work<TI>> iterator() {
return new Iterator<Work<TI>>() {
@Override
public boolean hasNext() {
return master.hasNext();
}
@SuppressWarning... | 4 |
public void playAnimation(){
for(BufferedImage bi : images) {
ActionListener animate = new ActionListener() {
private int index = 0;
@Override
public void actionPerformed(ActionEvent e) {
if (index<images.length-1) {
... | 3 |
public static boolean shouldBuild() {
int factories = UnitCounter.getNumberOfUnits(TerranFactory.getBuildingType());
int armories = getNumberOfUnits();
boolean weAreBuilding = Constructing.weAreBuilding(buildingType);
if (armories == 0
&& (factories >= 2 && !weAreBuilding
&& !TechnologyManager.isSieg... | 8 |
public static int getNowPage() {
String nowPage = getHttpServletRequest().getParameter("nowPage");
if (StringUtils.isNull(nowPage)) {
return 0;
} else {
return Integer.parseInt(nowPage);
}
} | 1 |
private boolean backupSystem() {
new Thread() {
@Override
public void run() {
ProcessBuilder process = null;
Process pr = null;
BufferedReader reader = null;
String line = null;
List<String> args = null;
... | 5 |
public static void main(String [] args) {
try {
PairedStats ps = new PairedStats(0.05);
java.io.LineNumberReader r = new java.io.LineNumberReader(
new java.io.InputStreamReader(System.in));
String line;
while ((line = r.readLine()) != null) {
line = line.trim();
if (l... | 9 |
public double getStrength() {
return strength;
} | 0 |
private void phaser() {
int count = 4;
final Phaser phaser = new Phaser();
phaser.register();
for (int i = 0; i < count; i++) {
phaser.register();
final int localCount = i;
new Thread(new Runnable() {
public void run() {
... | 2 |
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.