text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public String toString() {
String result = "";
int prefixLength = SIDE_LENGTH - 1;
boolean reachedMiddleLine = false;
for (int r = 0; r < DIAMETER; r++) {
for (int i = 0; i < prefixLength; i++) {
result += " ";
}
if (!reachedMiddleLine) {
prefixLength--;
if (prefixLength == 0) {
... | 6 |
public void closeConnection() {
if (this.connection != null)
try {
this.connection.close();
} catch (SQLException ex) {
this.core.writeError("Error on Connection close: " + ex, true);
}
} | 2 |
@Override
public boolean skipTo(int target) throws IOException {
if (firstTime) {
firstTime = false;
for (int i = 0; i < subSpans.length; i++) {
if (! subSpans[i].skipTo(target)) {
more = false;
return false;
}
}
more = true;
} else if (more && (subS... | 7 |
public void clearLightnings()
{
Thread t = new Thread(new Runnable()
{
@Override
public void run()
{
boolean allLightningsWereAnimated = true;
while (!allLightningsWereAnimated)
{
for (Lightning l : lightnings)
{
if (!l.isDone())
{
allLightningsWereAnimated = fal... | 5 |
public SQLPermissionConsole() {
super("console");
} | 0 |
private int indexOfMax(int[] values) {
int max = 0;
for (int i=0; i<values.length; i++) {
if (values[i] > max) {
max = i;
}
}
return max;
} | 2 |
public final void invalidate() {
if (!displaying) {
return;
}
// TODO: This is sketchy. This attempts to prevent a View from invalidating until after its root has been invalidated, this cutting down on unnecessary and bug-creating
// calls to canvas.invalidate().
if ... | 7 |
public boolean storeXML(final File target) throws IOException {
boolean result = false;
try {
if (!target.exists() && !target.createNewFile()) {
throw new IOException("Could not create target file " + target.getAbsolutePath());
}
final DocumentBuilde... | 5 |
public void runCalculations(
JRadioButton radioButtonRectangle,
JRadioButton radioButtonCircle,
JRadioButton radioButtonSquare,
JRadioButton radioButtonParallelogram,
JRadioButton radioButtonEllipse,
JRadioButton radioButtonSector,
JRadioButton radioButtonTriangle,
JRadioButton radioButton... | 9 |
public static String tempban(String muter, String mutedPlayerName, double days){
// Initial message
String regex = RPSystem.chatConfig.getString("format.ban");
int realDays = 0;
// Token replacement
regex = regex.replaceAll("%t", Timestamp.NOW());
regex = regex.replaceAll("%banner", muter);
if(days >= ... | 6 |
protected Value findValue(String str, boolean sign) throws ParseException
{
try
{
Number number = new Number(str, sign);
length += number.length();
return number;
}
catch (ParseException e)
{
try
{
Br... | 8 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jMenu1 = new javax.swing.JMenu();
jLabel1 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu2 = new jav... | 0 |
private static void mergeWithoutCopy(int[] from, int[] to, int lo, int mid, int hi)
{
// DK: cannot just return if mid >= a.length, but must still copy remaining elements!
// DK: add two tests to first verify "mid" and "hi" are in range
if (mid > from.length) mid = from.length;
if (hi > from.... | 6 |
private void dumpVar(int dumpVarIndex) {
StringBuffer sb = new StringBuffer();
sb.append("dump(x"+ dumpVarIndex +"): \n");
for(int i: sitesHasVar(dumpVarIndex).keySet()) {
Site tmpsite = sitesHasVar(dumpVarIndex).get(i);
if(tmpsite.isVarWritten(dumpVarIndex)) {
sb.append("x"+dumpVarIndex+"."+tmpsite.get... | 2 |
public void run()
{
try
{
boolean done = false;
while (!done)
{
File file = queue.take();
if (file == FileEnumerationTask.DUMMY)
{
queue.put(file);
done = true;
}
else search(file);
... | 1 |
public static int javaLoadLib(int luaState, String className, String methodName)
throws LuaException
{
LuaState L = LuaStateFactory.getExistingState(luaState);
synchronized (L)
{
Class clazz;
try
{
clazz = Class.forName(className);
}
catch (ClassNotFoundExcept... | 4 |
public void setItem( ItemObject itemObject ) {
ImageIcon itemIcon;
String itemName, toolTip;
_itemObject = itemObject;
itemIcon = itemObject.getItemImage();
itemName = itemObject.getItemName();
if ( itemName == null || itemName.equals( Data.NO_ITEM_NAME ) ) {
itemName = "";
... | 3 |
public static ChessmenEntity getMyChessmen(final ChessBoardEntity aBoard, final PositionEntity p) {
ChessmenEntity result = null;
if (null != p) {
List<ChessmenEntity> chessmens = aBoard.getChessmens();
for (ChessmenEntity c : chessmens) {
if (c.isPlayer()) {
if (p.getX() == c.getPosition().getX() &&... | 5 |
public void setSSType(String arg) {
if(arg.equals("H") || arg.equals("S") || arg.equals("T")) {
sstype = arg;
}
else {
sstype = ""; //throw an exception
}
} | 3 |
static public void printOutGameStateTransition(String moveFilePath, String graphFilePath) {
} | 0 |
public Integer getId() {
return id;
} | 0 |
@Override
public String toString() {
try {
return new MyObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
} | 1 |
public Image getFlippedImage(Image image) {
return getScaledImage(image, 1, -1);
} | 0 |
private NetworkClient(INetwork network) {
PropertyConfigurator.configure("log4j.properties");
loggerNetworkClient.addAppender(GUI.customAppender.getFileAppender());
//PropertyConfigurator.configure("log4j.properties");
// set network IF NOT ALREADY SET
if (NetworkClient.network == null) {
NetworkClient.... | 3 |
public void setQuantity(int quantity) {
this.quantity = quantity;
} | 0 |
public String getCaptchaError() {
return captchaError;
} | 0 |
public Set getDeclarables() {
Set used = new SimpleSet();
if (object != null)
object.fillDeclarables(used);
else
used.add(local);
return used;
} | 1 |
public boolean validPosition(Position position) {
return position == null
|| (position.xCoordinate >= 0 && position.yCoordinate >= 0
&& position.xCoordinate < this.width && position.yCoordinate < this.height);
} | 4 |
private void loadError() {
try {
this.texture = load("error");
} catch (IOException e2) {
e2.printStackTrace();
System.err.println("Resources folder may be missing.");
}
} | 1 |
public int getID_Controleur(){
int val = 0;
int nb = ID_controleur.length;
boolean t = true;
for (int i = 0; i < nb && t; i++) {
if(ID_controleur[i]==false){
val=i;
ID_controleur[i]=true;
t=false;
break;
}
}
return val;
} | 3 |
public boolean runDataLoading() {
long ctime = 0;
System.out.println("-----------------------------");
System.out.println("----- DATA LOADING TEST -----");
System.out.println("-----------------------------");
if (!this.createDB("dbtest")) {
System.out.println("Creati... | 7 |
@Override
public void run() {
try {
InputStream is = socket.getInputStream();
while(true)
{
System.out.println("ServerInputThread 1");
BufferedReader buff = new BufferedReader(new InputStreamReader(is));
System.out.println("ServerInputThread 2");
//如果读取的内容没有的话,程序一直在readLine处等待
... | 2 |
private boolean isMultipart(final List<Header> headers) {
for (final Header header : headers) {
if (header.getName().equals("Content-Type") && header.getValue().startsWith("multipart/form-data")) {
return true;
}
}
return false;
} | 3 |
public void testIsNumberType() {
assertTrue(NumberUtils.isNumberType(int.class));
assertTrue(NumberUtils.isNumberType(Integer.class));
assertFalse(NumberUtils.isNumberType(String.class));
assertFalse(NumberUtils.isNumberType(boolean.class));
assertFalse(NumberUtils.isNumberType(char.class));
assertFalse(Num... | 0 |
public static String getHash (String hashThis)
{
String hashType = "MD5";
String encodingType = "UTF-8";
StringBuffer hexString = new StringBuffer ();
MessageDigest digester = null;
byte[] byteDigest = null;
byte[] bytesOfInput = null;
/** Set our digester type to MD5 */
try
{
digester = Messag... | 5 |
private void btnOpenLogoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOpenLogoActionPerformed
JFileChooser fl = new JFileChooser("C:/");
fl.setMultiSelectionEnabled(false);
fl.showOpenDialog(null);
if (fl.getSelectedFile() != null) {
txtLogo.setText(fl... | 2 |
public float useLevel(Trait type) {
final Level TL = levels.get(type) ;
float level = TL == null ? 0 : (TL.value + TL.bonus) ;
if (type.type == PHYSICAL) {
return level * actor.health.ageMultiple() ;
}
if (type.type == SKILL) {
final Skill skill = (Skill) type ;
if (skill... | 7 |
public void drawButton(Minecraft var1, int var2, int var3) {
if(this.enabled2) {
FontRenderer var4 = var1.fontRenderer;
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, var1.renderEngine.getTexture("/assets/gui/gui.png"));
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
boolean var5 = var2 >... | 6 |
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n=in.nextInt();
int s = in.nextInt();
int max = 0;
int sum = 0;
while(n-->0){
int a = in.nextInt();
sum+=a;
max=Math.max(max, a);
}
System.out.println(sum-max > s?"NO":"YES");
} | 2 |
public LinkedList<String[]> callProc(String procname, LinkedList<String> args) {
LinkedList<String[]> r = new LinkedList<String[]>();
System.out.println(procname);
try {
CallableStatement stmt = (CallableStatement) conn.prepareCall(procname);
// Step-4: register output parameters ...
if (args != n... | 6 |
public Product locateProductByCode(Character codeToSearch) {
return this.products.get(codeToSearch);
} | 0 |
private static Set<String> listAllFiles(Collection<String> paths) {
Set<String> set = new TreeSet<String>();
for (String path : paths) {
File file = new File(path);
if (!file.exists()) {
log.warn("File or directory does not exist: " + path);
continue;
}
if (!file.canRead()) {
log.warn("Cann... | 8 |
public static void Edit(){
FileReader pl=null;
String sCurrentLine="";
System.out.println("Input file:\n");
try{
//pl = new FileReader(f);
pl = new FileReader("src/data");
} catch (FileNotFoundException e) {
System.out.println("Opening file error!");
System.exit(1);
}
BufferedReader ... | 6 |
private static ApplianceDescriptor parseVS(Node n, ApplianceDescriptor parent) throws XPathExpressionException, MalformedOVFException
{
XPath xpath = XPathFactory.newInstance().newXPath();
// id
Node id = n.getAttributes().getNamedItem("ovf:id");
if (id == null)
{
throw new RuntimeException("id was not s... | 9 |
public static ArrayList getRepresentativeTags(Map imagesTags, int percentage) {
ArrayList representativeTags = new ArrayList<String>();
/*
1. Create Map "tagpool" tag => count (0)
2. Count all occurrences and add to tag pool
3. Choose "int count" REFERENCE_TAG_PERCE... | 6 |
public List<Location> getLocationsEnCours(){
System.out.println("ModeleLocations::getLocationsEnCours()") ;
List<Location> locationsEnCours = new ArrayList<Location>() ;
for(Location location : this.locations){
if(location.estEnCours()){
locationsEnCours.add(location) ;
}
}
return locationsEnCours ;... | 2 |
static final boolean method1581(int i, char c) {
anInt2838++;
if (i >= -18)
return false;
if (((c ^ 0xffffffff) > -66 || c > 90)
&& (c < 97 || (c ^ 0xffffffff) < -123))
return false;
return true;
} | 5 |
private void getOldMods(){
Patch_Controller.delete(new File(Strings.TEMPORARY_DATA_LOCATION_B));
UnZip.unZipIt(Strings.MODDEDZIP_LOCATION, Strings.TEMPORARY_DATA_LOCATION_B);
ArrayList<Integer> rows = new ArrayList<Integer>();
ArrayList<Integer> rows1 = new ArrayList<Integer>();
try {
ArrayList<String[]> ... | 7 |
public Player getCurrentPlayer(int currentTurnNumber) {
Player current;
if (currentTurnNumber > this.numPlayers) {
int mod = currentTurnNumber % this.numPlayers;
if (mod == 0) {
current = this.playerList[this.numPlayers - 1];
} else {
current = this.playerList[mod - 1];
}
} else {
current =... | 2 |
private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 2; i++) {
try {
JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
switch (i) {
case 0: jj_3_1(); break;
case 1: jj_3_2()... | 6 |
protected void create() throws DBException
{
File medium = getMedium();
File mpath = getMpath();
String path = null == mpath ? Manager.DB_NAMES[0] : mpath.getPath();
if (!medium.exists() && medium.mkdir())
log().info("Created directory \"" + medium + "\" to store the new bag.");
File location = new File(m... | 7 |
public void draw(Graphics g) {
Font f = new Font("SansSerif", Font.BOLD, 20);
g.setFont(f);
//g.setColor(needsHighlight() ? selectColor : lightGrayColor);
g.setColor(lightGrayColor);
String s = (volts[0] < threshold) ? "L" : "H";
if (isTernary()) {
if (volts[0... | 6 |
public GamePanel(){
super();
try{
handler = new FileHandler("Logging.txt");
} catch (IOException e){
handler = new ConsoleHandler();
}
log.addHandler(handler);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
this.setTitle("Legue of Numbers");
this.setDefaultCloseOperation(... | 6 |
public static boolean hasMultipleCharacterLabels(Automaton automaton) {
Transition[] transitions = automaton.getTransitions();
for (int k = 0; k < transitions.length; k++) {
FSATransition transition = (FSATransition) transitions[k];
String label = transition.getLabel();
if (label.length() > 1)
return t... | 2 |
public boolean InsertarPropiedad(Propiedad p){
if (p!=null) {
cx.Insertar(p);
return true;
}else {
return false;
}
} | 1 |
private void loadFile(String fileName) throws CWRCException {
childrenFound = false;
file = new File(fileName);
if (file.exists()) {
} else {
try {
FileOutputStream fileOut = new FileOutputStream(file);
XMLStreamWriter out = XMLOutputFactory.n... | 8 |
public void setT1(teacher t1) {
this.t1 = t1;
} | 0 |
public void run()
{
while ((this.Running) && (this.CurrentIndex < this.Indexes.length))
{
if (nextImage()) {
this.Running = false;
}
if (!this.Running) {
break;
}
if (this.Delays != null) {
try
{
Thread.currentThread(); Thread.sleep(this.... | 7 |
public LinkedList<interval> extractRelevantIntervals (Patient pat, SearchInterval searchint)
{
//System.out.println("Extrayendo Intervalos Relevantes Paciente " + pat.id);
LinkedList<interval> list = new LinkedList<interval>();
//System.out.println("Paciente " + pat.id + " tamaño intervals2: " ... | 9 |
public Klas getKlas(long klas_id) {
Klas klas = null;
try {
PreparedStatement klasStatement = manager
.prepareStatement("SELECT * FROM klassen WHERE id = ?");
klasStatement.setLong(1, klas_id);
ResultSet klasResult = klasStatement.executeQuery();
if (klasResult.next()) {
klas = new Klas(klasRe... | 4 |
public void setName(String value) {
this._name = value;
} | 0 |
public void setAAte(TNumeroInt node)
{
if(this._aAte_ != null)
{
this._aAte_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... | 3 |
public void run() {
// FIXME: Do not allow other players to be added.
/*
* [[ INITIALIZE GAME ]]
*/
map = MapImporter.getMap(); // get default map
setPlayerCredentials();
map.assignPlayersToBases(players.values(), getInitialShips()); // set bases
setGameConstants();
viz = new BCViz(players.values... | 7 |
public ScreenBuilder buildCritterScreen(){
setLayout(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
JLabel total = new JLabel("Total Points: ");
constraints.gridx = 0;
constraints.gridy = 0;
add(total,constraints);
text = new JTextArea(pool.toString());
constr... | 7 |
public void countFinished()
{
countsValid = true;
} | 0 |
public void delete(Node treeNode, int value) {
Node target = findNode(treeNode, value);
if(target == null){
// node is not in the tree
return;
}
// target has middleChild, so we delete the last of the middle child
if(target.middleChild != null){
while (target.middleChild != null){
target = ... | 7 |
public void move(long delta) {
// if we have reached the left hand side of the screen and
// are moving left then request a logic update
if ((dx < 0) && (x < 10)) {
game.updateLogic();
}
// and vice vesa, if we have reached the right hand side of
// the screen and are moving right, request a logic upda... | 4 |
public void setState(int state) {
this.state=state;
if (state==0) theApp.setStatusLabel("Setup");
else if (state==1) theApp.setStatusLabel("Signal Hunt");
else if (state==2) theApp.setStatusLabel("Msg Hunt");
} | 3 |
private JPanel createControlPanel() {
JPanel controlPanel = new JPanel();
controlPanel.setBorder(new EmptyBorder(4, 4, 4, 4));
controlPanel.setLayout(new BoxLayout(controlPanel, BoxLayout.X_AXIS));
btnPause = new JButton("Pause");
btnPause.addActionListener(new ActionListener() {
@Override
public void... | 3 |
public boolean equalsExpr(final Expr other) {
return (other instanceof RCExpr) && super.equalsExpr(other);
} | 1 |
private void climbWall(Player p)
{
Block b1 = p.getLocation().getBlock();
if (b1.getType() != Material.AIR)
return;
Block b2 = b1.getRelative(BlockFace.UP);
Location l = p.getLocation();
if (p.isSneaking() && (b1.getRelative(BlockFace.NORTH).getType() != Material.AIR
|| b1.getRelative(BlockFace.EA... | 8 |
public String codeToText(short code) throws AssemblerException {
StringBuffer command = new StringBuffer();
if (code != AssemblyTranslator.NOP) {
if ((code & 0x8000) == 0) {
command.append('@');
command.append(code);
}
else {
short exp = (short)(code & 0xffc0);
short dest = (short)(code & ... | 5 |
@Override
public void process(List<ProgressData> data)
{
if (isCancelled()) return;
StringBuilder b = new StringBuilder();
statusLine.setText("" + data.get(data.size() - 1).number);
for (ProgressData d : data)
{
b.append(d.line);
b.append(... | 2 |
public void spawnFruit() {
TileColor tile = null;
while(tile == null) {
int i = Util.getRandom(tiles.length -1);
TileColor newFruit = tiles[i];
if(newFruit != TileColor.SPACE)
continue;
tiles[i] = TileColor.ORANGE;
break;
}
tile = null;
while(tile == null) {
int i = Util.getRandom(tiles.... | 9 |
public static Stella_Object coerceIncompatibleValue(Stella_Object value, Surrogate type) {
{ Stella_Object substituteValue = null;
if (Logic.relationrefSpecializesRelationrefP(type, Logic.SGT_PL_KERNEL_KB_QUANTITY)) {
return (Logic.coerceQuantity(value, type));
}
else if (Logic.relationre... | 9 |
public CellElement getPointerWithPolicy(int policy) {
if (m_pointers.size() == 0) {
return null;
}
CellElement retCell = null;
switch (policy) {
case POINTER_POLICY_ANY:
retCell = (CellElement) m_pointers.firstElement();
break;
case POINTER... | 9 |
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int numOfCases = sc.nextInt();
for(int i = 0; i < numOfCases;i++)
{
// The first int on the line is the current highest polynomial
int highestDegree = sc.nextInt();
//It is easier to print while you are calculating
// in... | 3 |
private void swap(int[] array, int left, int right){
int temp = array[left];
array[left] = array[right];
array[right] = temp;
} | 0 |
public boolean hasStore() {
int headPointer = head;
while (headPointer <= tail) {
// check if not typo
if (tuples[headPointer].getType().equals("SW"))
return true;
headPointer = (headPointer + 1) % size;
}
return false;
} | 2 |
public void WriteToSocket(String s)
{
try {
writer.write(s);
writer.flush();
try {
if(!currentMessage.equals(oldMessage) && !currentMessage.equals(""))
{
DatabaseDataObjectUtilities.addMessageToBlackBox(listener.getCurre... | 4 |
private void loadPlattformar() {
ArrayList<String> altemp = new ArrayList<>();
ArrayList<Plattform> al = new ArrayList<>();
try {
String query = "select pid from plattform";
altemp = DB.fetchColumn(query);
} catch (InfException e) {
e.getMessage();
... | 3 |
public boolean beginGame (boolean force) {
boolean allPlayersReady = true;
if(!playing) {
for(Player t : players) {
if(!t.isReady()) {
allPlayersReady = false;
break;
}
}
if(allPlayersReady || force) { // end game
for(Bo... | 9 |
@Override
public void e(float sideMot, float forMot) {
if (this.passenger == null || !(this.passenger instanceof EntityHuman)) {
super.e(sideMot, forMot);
this.W = 0.5F; // Make sure the entity can walk over half slabs,
// instead of jumping
return;
}
EntityHuman human = (EntityHuman) this.passe... | 8 |
protected boolean advanceAfterCurrent() throws IOException {
do { // repeat until minimum nr of matchers
currentDoc = scorerDocQueue.topDoc();
currentScore = scorerDocQueue.topScore();
nrMatchers = 1;
do { // Until all subscorers are after currentDoc
if (!scorerDocQueue.topNextAndAdj... | 7 |
private void updateTableMembership() {
topTable.clear();
bottomTable.clear();
for ( String rowItem : topOfTableRow ) {
for ( String columnItem : columns) {
addToTopOfTable(rowItem, columnItem, issueMembershipQuery(rowItem, columnItem));
}
}
for ( String rowItem : bottomOfT... | 4 |
public static Packet readPacket(DataInputStream var0, boolean var1) throws IOException {
Packet var3 = null;
int var6;
try {
var6 = var0.read();
if(var6 == -1) {
return null;
}
if(var1 && !serverPacketIdList.contains(var6) || !var1 && !clientPacketIdLi... | 7 |
void dump(OutputStream out) throws IOException {
try{
HostKey hk;
synchronized(pool){
for(int i=0; i<pool.size(); i++){
hk=(HostKey)(pool.elementAt(i));
//hk.dump(out);
String host=hk.getHost();
String type=hk.getType();
if(type.equals("UNKNOWN")){
out.write(Util.str2byte(hos... | 3 |
public boolean accept(File f){
return f.getName().endsWith(".bmp");
} | 0 |
@Override
public Confirmation deliver(final Message message) {
int count = 0;
for (final Permissible permissible : Bukkit.getPluginManager().getPermissionSubscriptions(this.permission))
if (permissible instanceof CommandSender && permissible.hasPermission(this.permission)) {
... | 3 |
final private void addOperator(Operator anOperator)
{
//make sure the operator is valid
if (!anOperator.getRepresentation().equals(""))
{
int thisOperatorPriority = anOperator.getPriority();
int previousOperationPriority = -1;
Token previousOperation = this.m_operationsStack.peek();
if (previousOpera... | 7 |
public boolean moveCompatible(Territory t1, Territory t2){
if(!t1.hasConnection(t2) || t1.getOwner().getID() != t2.getOwner().getID() || (t1.getNbrOfUnits() < 2 && t2.getNbrOfUnits() < 2)){
return false;
}
return true;
} | 4 |
public QueryPlansResponse queryPlans(QueryPlansRequest request)
throws GongmingConnectionException, GongmingApplicationException {
URL path = _getPath(QUERY_PLANS);
QueryPlansResponse response = _GET(path, request, QueryPlansResponse.class);
if (response.code != GMResponseCode.COMMON_SUCCESS) {
... | 1 |
protected Option[] work(){
try{
openConnection(server,instruction);
Mission requestMission = new Mission(server,instruction,options);
send(requestMission);
Mission responseMission = receive();
return dealResponse(responseMission);
}catch(Exception e){
return ActionResult.makeFai... | 5 |
@Override
public void run() throws Exception {
// TODO Auto-generated method stub
try {
// Eclipse doesn't support System.console()
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
ConfigManager config = NetBase.theNetBase().config();
String server = config.getProperty("... | 9 |
public static void main(String[] args) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder( );
for(String line; (line =in.readLine() ) !=null;){
if(line.trim().equals("0")) break;
StringTokenizer st = new StringTokenizer(line);
... | 9 |
public Set<Box> getBoxes() {
Set<Box> boxes = new HashSet<>();
final Game game = getGame();
final int baseX = getX();
final int baseY = getY();
final int width = getWidth();
final int height = getHeight();
for(int x = 0; x < width; x++) {
for(int y = 0; y < height; y++) {
boxes.add(game.getBox(bas... | 2 |
private String calc(String input) {
//Person 1 put your implementation here
String output = input;
if (input.length() > 2) {
output = input.substring(2, input.length()) + input.substring(0,2);
}
return output;
} | 1 |
public List<Integer> picturesInAlbum(int albumId) {
PreparedStatement stmt = null;
Connection conn = null;
ResultSet rs = null;
List<Integer> picturesIds = new ArrayList<Integer>();
try {
conn = DbConnection.getConnection();
stmt = conn.prepareStatement(PICTURE_ALBUM_STMT);
stmt.setInt(1, albumId)... | 8 |
public boolean connect() {
System.out.println("Controller:connect() is working");
try {
String computername = InetAddress.getLocalHost().getHostName();
OtpErlangObject[] message = new OtpErlangObject[2];
message[0] = mbox.self();
message[1] = new OtpErlang... | 1 |
public boolean checkCommandTriggers(String command){
for(Trigger trigger : triggers){
if(trigger.used == false){
if(trigger.hasCommand() && trigger.commandMatch(command)){
if(trigger.checkConditionsTrue()){
trigger.used = true;
trigger.execute();
for(Trigger trigger2 : triggers){
... | 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.