text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public <T> T generate(Class<T> spec, DBObject dbObject) {
if(dbObject == null) return null;
Constructor constructor = getDefaultConstructor(spec);
Object entity = invoke(constructor);
for (Field field : spec.getDeclaredFields()) {
if (!dbObject.containsField(field.getName())) {
continue... | 9 |
public static void main(String[] args) {
User user = new User();
try {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValue(new File("D:\\Java SE\\src\\json\\object\\user.json"), user);
User user2 = objectMapper.readValue(new File("D:\\Java SE\\src\\json\\o... | 3 |
@Test(timeout = 200)
public void testReceiveTimeout_MessageArrivesAfterTime() {
try {
consumer = new AbstractMessageConsumer(mockTopic) {
};
} catch (DestinationClosedException e) {
fail("Unexpected exception on constructor");
}
assertNotNull(mockTopic.getTopicSubscriber());
try {
Message msg = n... | 3 |
public void rewindNbits(int N)
{
totbit -= N;
buf_byte_idx -= N;
if (buf_byte_idx<0)
buf_byte_idx += BUFSIZE;
} | 1 |
public void iTunes(String[] args) {
if(args.length < 2) {
bot.errorMessage(channel, sender, "incorrect parameters. !help for details");
return;
}
args = argsPrepare(args);
args[1] = platformAlias(args[1]);
String response;
// return both 32 and 64 bit urls for windows
if(args[1].toLowerCase().eq... | 7 |
@Override
public Boolean visitIf(IfTree node, Context p) {
IfTree currentTree = node;
StatementTree endingTree;
int count = 0;
while (true) {
if (currentTree.getElseStatement() == null) {
count++;
StatementTree thenTree = currentTree.getThenStatement();
if (thenTree insta... | 8 |
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int cases = 1;
while (true) {
// input
m = input.nextInt();
n = input.nextInt();
if (m + n == 0) return;
x1 = input.nextInt();
... | 4 |
public void register(final Region region) {
this.regions.add(region);
this.references.put(region, 0L);
if (!region.active) return;
// load region into applicable loaded chunk index entries
for (final ChunkCoordinates coords : region.chunks())
if (this.world.isChunkLo... | 3 |
public Serializable decode(File file, Map parameters) {
Serializable object = null;
try {
ObjectInputStream stream = new ObjectInputStream(
new BufferedInputStream(new FileInputStream(file)));
object = (Serializable) stream.readObject();
stream.close();
} catch (IOException e) {
throw new ParseEx... | 3 |
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 |
public static void dump_grammar() throws internal_error
{
System.err.println("===== Terminals =====");
for (int tidx=0, cnt=0; tidx < terminal.number(); tidx++, cnt++)
{
System.err.print("["+tidx+"]"+terminal.find(tidx).name()+" ");
if ((cnt+1) % 5 == 0) System.err.println();
}
System.err.... | 7 |
public void setItemId(int itemId) {
this.itemId = itemId;
} | 0 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final Physical target = mob.location();
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(mob,null,null,L("An Ice S... | 8 |
@Override
public void draw() {
if (hidden) {
return;
}
super.draw();
for (GUIComponent component : subComponents) {
component.draw();
}
} | 2 |
public Map<String, ArrayList<RowData>> getObjectsFromTable(
String tableName, String columnFamily, String startRange,
String endRange, String... retrieveColumns) throws IOException {
// Validate the tableName
if (!validateStringIfNullOrEmpty(tableName)) {
throw new IllegalArgumentException(
"Invalid ... | 8 |
public double simulateHandWithSharedCards(ArrayList<Card> holeCards, ArrayList<Card> sharedCards, int players) throws Exception {
if (sharedCards.size() < 3) {
throw new Exception("Less then 3 shared cards");
}
Deck deck = new Deck();
deck.removeCards(holeCards);
deck.removeCards(sharedCards);
ArrayLi... | 4 |
private boolean testLocation(XYLocation location) {
if (location.getXCoOrdinate()<0 || location.getXCoOrdinate()>rowBoard-1)
return false;
if (location.getYCoOrdinate()<0 || location.getYCoOrdinate()>colBoard-1)
return false;
return true;
} | 4 |
public static PGM difference(PGM img1, PGM img2){
try{
if (img1.getHauteur() != img2.getHauteur() || img1.getLargeur() != img2.getLargeur()){
throw (new DifferentSizeException());
}
} catch (Exception e){
System.out.println("Les deux images doivent êtr... | 4 |
private void drawString(Graphics2D g2d, String text, int startAngle, int angle){
double percent = (double) Math.round((double) angle/360*100*1000)/1000;
if(percent > 5 || text.equalsIgnoreCase("Other")){
g2d.setColor(Color.BLACK);
g2d.setFont(getFont().deriveFont(9.0f));
g2d.drawString(text, (float) Math.c... | 2 |
public void createPath() {
if (dir.exists()) {
return;
}
if (!dir.mkdir()) {
throw new DataBaseException("Cannot create directory!");
}
} | 2 |
private static String solve(char[][] x, int N) {
for (int i = 0; i < N; i++)
for (int j = 0; j < N; j++)
if (x[i][j] == '#') {
if (!remove(x, N, i, j)) return "NO";
if (!remove(x, N, i+1, j-1)) return "NO";
if (!remove(x... | 8 |
public void formatStringOne(char[] str, int length) {
boolean isWord = false;
int start = 0, end = 0, wordCount = 0;
for (int i = 0; i < length; i++) {
if (str[i] != ' ' && isWord == false) {
isWord = true;
start = i;
} else if (str[i] == ' ' && isWord == true) {
isWord = false;
end = i - 1;... | 7 |
@Override
public void Handle(byte[] message, Server server, IOClient p) {
Player player;
if (p instanceof Player) {
player = (Player)p;
}
else
return;
ByteBuffer bb = ByteBuffer.allocate(9);
bb.put(message);
//byte ID = bb.get(0);
short X = bb.getShort(1);
short Y = bb.getShort(3);
short Z = ... | 3 |
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
} | 0 |
public Product() {
} | 0 |
private void requestUpdatesPath() {
boolean valid = false;
File f;
while (!valid) {
String path = requestInput("SQL Updates Folder");
Path p = Paths.get(path);
f = p.toFile();
if (f.canRead() && f.isDirectory()) {
// path found
updatesfolder = p;
return;
} else {
console.printf("Pl... | 3 |
public static void normalizeNotProposition(Proposition self) {
{ Stella_Object argument = (self.arguments.theArray)[0];
Proposition proposition = null;
if (Logic.variableP(argument)) {
{ OutputStringStream stream000 = OutputStringStream.newOutputStringStream();
{ Object old$Printread... | 9 |
public String getString(String key) {
Object value = get(key);
return value != null ? value.toString() : ""; //$NON-NLS-1$
} | 1 |
private void generateLabelPositions() {
boolean addedCandidate = false;
// Start off with label that is in the middle of the line
LineTextParameter candidate = new LineTextParameter(use, 50);
try {
candidate.getGeometry();
addCandidate(candidate);
addedCandidate=true;
} catch (FalloffException e){
... | 7 |
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
handler.beforeStart();
if (method.getAnnotation(Sql.class) != null) {
return sql(method, args, method.getAnnotation(Sql.class));
}
return null;
} | 1 |
public void fileReader() {
try {
File fileComplete = getFile();
Scanner lineRead = new Scanner(fileComplete);
while (lineRead.hasNextLine() == true) {
String lineTemp = lineRead.nextLine();
// "Items:" = storeLine, "~" = itemLine, "=" = fusionL... | 5 |
@Override
public Command planNextMove(Info info) {
// you can NONE, MOVE_FORWARD, MOVE_BACK, TURN_LEFT, TURN_RIGHT, SHOOT
InfoDetail myInfo = new InfoDetail(info.getX(), info.getY(), info.getDirection());
if(info.getEnemies().isEmpty() && info.getGrenades().isEmpty()){
r... | 5 |
public static void main(String[] args) throws IOException {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Title frame = new Title();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} | 1 |
private void createJFinalConfig(String configClass) {
if (configClass == null) {
throw new RuntimeException("please set configClass in the web.xml");
}
try {
Object o = Class.forName(configClass).newInstance();
if (o instanceof JFinalConfig) {
jfinalConfig = (JFinalConfig) o;
}
else {
th... | 5 |
public Boolean loginUser(String login, String password){
PreparedStatement pStmt = null;
ResultSet rs = null;
Boolean returnLogin = false;
try {
pStmt = conn.prepareStatement("SELECT * FROM USER WHERE login = ? AND password = ?;");
pStmt.setString(1, login);
pStmt.setString(2, getMD5Hash(pass... | 2 |
public void load(){
synchronized(options){
try {
options.load(new FileInputStream("timers.conf"));
synchronized (timers){
timers.clear();
for(Object key : options.keySet()){
String str = key.toString();
if(str.indexOf("Name")>0){
continue;
}
String tmp[] = options.getProperty(st... | 5 |
static private final int jjMoveStringLiteralDfa3_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(1, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(2, active0);
return 3;
}
switch(curChar)
{
... | 9 |
private String signup(String[] msg) {
String ans =null;
user.User user = forumSystem.signup(msg[1], msg[2], msg[3],msg[4], msg[5]);
if (user!=null) {
this.user=user;
ans="SUCC_SIGNUP";
}
else ans="ERR_SIGNUP";
return ans;
} | 1 |
public void centerViewOnPoint(int index)
{
//MapGetter.getMapImage(MapGetter.createUrl(markerRect.getLongtitude(index), markerRect.getLatitude(index)));
//repaint();
} | 0 |
public static void main(String[] args) {
int i;
for ( i = 0; i < 10; i++)
switch(i) {
case 0:
System.out.println("i is zero");
break;
case 1:
System.out.println("i is one");
b... | 6 |
public void initializeKeySet()
{
int i1;
int j1;
int k1;
int l1;
int i2;
int j2;
int k2;
int l = i1 = j1 = k1 = l1 = i2 = j2 = k2 = 0x9e3779b9;
for(int i = 0; i < 4; i++)
{
l ^= i1 << 11;
k1 += l;
i1 ... | 3 |
public void run() {
try {
WebServer webServer = new WebServer(port);
XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
PropertyHandlerMapping phm = new PropertyHandlerMapping();
phm.addHandler( "StockProcedure", MyWebServer.class);
xmlRpcServer.setHandlerMapping(p... | 1 |
private static final int method2894
(int i, int i_16_, byte[] is, int[] is_17_, int i_18_, int i_19_,
int i_20_, int i_21_, int i_22_, int i_23_, int i_24_,
Class348_Sub16_Sub5 class348_sub16_sub5, int i_25_, int i_26_) {
if (i_25_ == 0
|| (i_22_ = i_19_ + (i_24_ + 256 - i_18_ + i_25_) / i_25_) > i_23_)
... | 6 |
public static void main(String[] args)
{
// Load GUI by default
boolean headless = false;
// Folder to log stuff to
String logFolderPath = System.getProperty("user.dir") + File.separator;
/*
* Parse arguments
*/
String arguments = "";
for(String string : args)
{
arguments += " " + ... | 6 |
protected void layoutChildren(Rectangle[] bounds) {
for (int i = 0; i < bounds.length; i++) {
mChildren.get(i).layout(bounds[i]);
}
} | 1 |
static String readFieldId(RandomAccessFile raf, int length, VorbisCommentBlock block) throws IOException {
StringBuilder fieldId = new StringBuilder();
char c;
while( (c=(char)MediaFileUtil.read_sure(raf))!= '=' ) {
fieldId.append(c);
}
return new String(fieldId);
... | 1 |
@Test
public void reTest7() {
userInput.add("hi");
userInput.add("my name is meng meng");
userInput.add("can you bring me something");
userInput.add("knife");
userInput.add("errorhandling");
userInput.add("errorhandling");
userInput.add("errorhandling");
userInput.add("errorhandling");
userInput.add(... | 7 |
public void readDB(String path, String styleYear){
// check to see if the style guide is in the DB already
dbPath = path;
styleFileName = "styleguide" + styleYear + ".xml";
File styleFile = new File(path, styleFileName);
if(styleFile != null && !styleFile.exists()){
Frame window = new Frame();
... | 3 |
public static void main(String[] args) throws IOException {
Socket sock = parseArgs(args);
if (sock == null)
return;
AI solver = new SimpleAI();
Game game = new Game(NAME, sock);
int gameResult = game.solve(solver);
if(gameResult == game.getID())
System.out.println("Congratz");
else if(gameRe... | 3 |
public boolean isAvailable(Date start, Date end) {
if(!start.before(end))
throw new IllegalArgumentException("Illegal given period");
for(Reservation reservation : reservations) {
if(reservation.getEndDate().before(start) || reservation.getStartDate().after(end))
... | 4 |
public void update(){
for(Map.Entry<Memorable,JLabel> entry:labels.entrySet()){
Memorable memorable = entry.getKey();
float hp = memorable.hasHistory();
Color color=new Color(hp,hp,hp);
if(hp==1){
boolean wasBetter=false;
float er=m... | 8 |
public void method357() {
if (imageWidth == libWidth && imageHeight == anInt1457)
return;
byte abyte0[] = new byte[libWidth * anInt1457];
int i = 0;
for (int j = 0; j < imageHeight; j++) {
for (int k = 0; k < imageWidth; k++)
abyte0[k + drawOffsetX + (j + drawOffsetY) * libWidth] = imagePixels[i++];
... | 4 |
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
ip = request.getHeader("Proxy-Client-IP");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnore... | 9 |
public Funcion(String nombre){
ArrayList<String> expresion;
ArrayList<Arbol> operandos;
puntos = new ArrayList<Punto>();
expresion = new ArrayList<String>();
operandos = new ArrayList<Arbol>();
LeerArchivo archivoIn = new LeerArchivo(nombre);
String [] linea;
try{
linea=archivoIn.readLine().split(" "... | 7 |
boolean isPalindorme(String s, int start, int end) {
for (int i = start, j = end; i < j; i++, j--)
if (s.charAt(i) != s.charAt(j))
return false;
return true;
} | 2 |
public void initialDeal(ArrayList<Player> players, Dealer dealer, int numPlayers){
for (int i=0;i<numPlayers;i++)
{//This loop goes through an array and deals initial cards to each player in the array
for (int j=0;j<2;j++)//this interior loop makes sure that 2 cards are dealt since this is initial hand
player... | 3 |
public Fruit(Player[] players, int bowlsize, int[] dist)
{
this.players = players;
this.bowlsize = bowlsize;
this.nfruits = bowlsize * players.length;
this.fruitDist = dist;
// generate the preference for each player
preference = new int[players.length][];
fo... | 2 |
public void test(String script)
throws EugeneException {
try {
// first, we need to parse the script
this.parse(script);
} catch(Exception e) {
throw new EugeneException(e.getMessage());
}
Map<String, List<CompositePredicate>> predicates =
this.parser.getPredicateRepository().getPredicat... | 3 |
private Thread searchThreadsInGroup(final String threadName, final ThreadGroup group, final int level) {
Thread thread = null;
Thread[] threads = new Thread[group.activeCount() * 2];
int numThreads = group.enumerate(threads, false);
for (int i = 0; i < numThreads; i++) {
if (threads[i].getName().equals(thr... | 3 |
private void checkType(Class<?> actual, Class<?> expected) {
if(expected==actual || expected.isAssignableFrom(actual))
return; // no problem
if( expected==JCodeModel.boxToPrimitive.get(actual) )
return; // no problem
throw new IllegalArgumentException("Expected "+expect... | 5 |
@Override
public void execute(CommandSender sender, String[] args) {
if (args.length < 2) {
sender.sendMessage(new TextComponent(ChatColor.RED + "Usage: /mode <channel> <mode ...>"));
return;
}
if (!IRC.sock.isConnected()) {
sender.sendMessage(new TextComp... | 4 |
protected void sendResponses() {
if(responses != null) {
Object obj;
for(int i=0; i < responses.length; i++) {
if(delay > 0)
Util.sleep(delay);
obj=responses[i];
if(obj == null) {
... | 7 |
private void persistResources(IArticle article) throws IOException {
for (IResource resource : article.getResources()) {
em.persist(resource);
}
} | 1 |
private boolean PlayerHidden(int posX, int poY)
{
for (Polygon p : ps)
{
if (p.contains(posX, poY))
return true;
}
return false;
} | 2 |
public static String reverseWords1(String s) {
if (s == null || s.length() == 0) {
return "";
}
String[] arrayStr = s.split(" ");
int length = arrayStr.length;
StringBuffer newStr = new StringBuffer();
for (int i = length - 1; i >= 0; i--) {
if (!arrayStr[i].trim().equals("")) {
newStr.append(... | 5 |
public static String getFilenameExtension(String path) {
if (path == null) {
return null;
}
int extIndex = path.lastIndexOf(EXTENSION_SEPARATOR);
if (extIndex == -1) {
return null;
}
int folderIndex = path.lastIndexOf(FOLDER_SEPARATOR);
if (folderIndex > extIndex) {
return null;
}
return path... | 3 |
public static BufferedImage getTexture(String texture) {
switch(texture) {
case "grass":
return grass;
case "grassLeft":
return grassLeft;
case "grassRight":
return grassRight;
case "dirt":
return dirt;
case "log":
return log;
case "tree":
return tree;
case "bigTree":
return bigTree... | 9 |
public boolean isEmpty() {
boolean retVal = false;
if (topPtr == CAPACITY) {
retVal = true;
}
return retVal;
} | 1 |
private void pivot(int p, int q) {
// everything but row p and column q
for (int i = 0; i <= M; i++)
for (int j = 0; j <= M + N; j++)
if (i != p && j != q) a[i][j] -= a[p][j] * a[i][q] / a[p][q];
// zero out column q
for (int i = 0; i <= M; i++)
... | 8 |
void receive() throws IOException {
if (this.closed) throw new SocketClosedException();
class Container {
public IOException exception = null;
public boolean isClosed = false;
}
final Container container = new Container();
this.listener.onData(new IBuff... | 5 |
public CardStack(String file, String name) throws StorageReaderException {
stack = new ArrayList<Card>();
top = 0;
Random random = new Random();
int index;
ArrayList<Card> temp = new CardCreator(file, name).cardArray();
while(!temp.isEmpty()) {
index = random.nextInt(temp.size());
index = index - (i... | 3 |
public void setTree(JoeTree tree) {this.tree = tree;} | 0 |
@Override
public boolean update() {
finishButton.update();
fundsTextbox.update();
boolean blockFinish = false;
for(PartySelectButton selector : partySelectors) {
selector.update();
if(selector.blockFinish) {
blockFinish = true;
}
}
if(!finishButton.isImpossible && (blockFinish || (numSelect... | 8 |
public void calculerVoisinage(Node current){
ArrayList<Node> voisins = findVoisin(current);
for(Node voisin : voisins){
if(voisin.getState() != BLOCK && !closedList.contains(voisin)){
voisin.setColor(Color.gray);
int newG = current.getG_movementCost() + COU... | 6 |
public Object clone() {
try {
VariableSet other = (VariableSet) super.clone();
if (count > 0) {
other.locals = new LocalInfo[count];
System.arraycopy(locals, 0, other.locals, 0, count);
}
return other;
} catch (CloneNotSupportedException ex) {
throw new jode.AssertError("Clone?");
}
} | 2 |
public void render(Screen screen) {
// Where the player is found on the spritesheet
int xTile = 0;
int yTile = 28;
int walkingSpeed = 3;
// Number between 0 and 1
// top part of the body
int flipTop = (numSteps >> walkingSpeed) & 1;
// bottom part of the body
int flipBottom = (numSteps >> walkingSpeed) & 1... | 9 |
private void printResults() {
for (int i = 0;i<VALUE_ITERATIONS_NUMBER;i++) {
System.out.println(results[i]);
}
} | 1 |
private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
// TODO add your handling code here:
if (saveMenuItemIsUsed == false)
{ int n = JOptionPane.showConfirmDialog(null,"Are you sure that you want to exit without saving\nAll unsav... | 2 |
private void paintScreen()
// use active rendering to put the buffered image on-screen
{
Graphics g;
try {
g = this.getGraphics();
if ((g != null) && (dbImage != null))
g.drawImage(dbImage, 0, 0, null);
// Sync the display on some systems.
// (on Linux, this fixes e... | 3 |
protected void buildClassifierWithWeights(Instances data)
throws Exception {
Instances trainData, training;
double epsilon, reweight;
Evaluation evaluation;
int numInstances = data.numInstances();
Random randomInstance = new Random(m_Seed);
// Initialize data
m_Betas = new double [m_C... | 8 |
public boolean getStudentIdByBookId(IssueBookVO issueBookVO)
throws LibraryManagementException {
boolean returnValue = true;
ConnectionFactory connectionFactory = new ConnectionFactory();
Connection connection;
try {
connection = connectionFactory.getConnection();
} catch (LibraryManagementException e)... | 6 |
public void setShutdownFontsize(int fontsize) {
if (fontsize <= 0) {
this.shutdownFontSize = UIFontInits.SHDBTN.getSize();
} else {
this.shutdownFontSize = fontsize;
}
somethingChanged();
} | 1 |
public AtomVerbs getVerbs(Movable player)
{
AtomVerbs rval = new AtomVerbs();
rval.atomUID = this.UID;
rval.verbs = new ArrayList<VerbSignature>();
// Check all the class' methods
for(Method m : this.getClass().getMethods())
{
// TODO: Check if this verb is accessible by the the player atom
... | 5 |
private boolean isDrawRound() {
if(drawRound) {
return true;
}
if(getColor().equals(Color.YELLOW)) {
return true;
}
return false;
} | 2 |
public void saveXml() {
if (!vermilionCascadeNotebook.getModified()) {
return;
}
File file = new File(VCNConstants.WORK_FILE_PATH);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = null;
try {
builder = factory.newDocumentBuilder();
Document xml =... | 2 |
@Override
public String toString() {
StringBuffer s = new StringBuffer("Graph mit " + vertexIndex.size() + " Knoten\n");
int i = 0;
for (V v : vertices) {
if (v != null) {
s.append(v + ": ");
for (E e : adjList.get(i)) {
s.append(e.getVertexB() + " ");
}
s.a... | 3 |
public void pauseDownload(final int gid) {
switch (downloads.get(gid).getStatus()) {
case ACTIVE:
case WAITING:
taskManager.pause(gid);
break;
default:
break;
}
} | 2 |
public float getTotalPrice() {
return totalPrice;
} | 0 |
public static Constants.ResponseType update(Client client, UpdateDataRequestMessage updateDataRequestMessage) {
boolean update = false;
Constants.ResponseType responseType = Constants.ResponseType.failed;
EntityManager entityManager = PersistenceManager.getInstance().getEntityManager();
... | 9 |
public MetricSet<E> search(E e, Metric<? super E> m) {
int leastDistance = Integer.MAX_VALUE;
for (E elem : this) {
leastDistance = Math.min(leastDistance, m.distance(elem, e));
}
MetricSet<E> newSet = new MetricSet<E>();
for (E elem : this) {
if (m.dis... | 4 |
public static void main(String args[]) {
int size = 4;
int[][][] cube = new int[size][size][size];
TicTacToe tictactoe = new TicTacToe(cube);
boolean gameOver = false;
int PLAYER=1;
List<Long> runTime = new LinkedList<Long>();
while (!gameOver) {
System.out
.println("Instruction:Layer1(bot)->Layer... | 9 |
@Override
public void configure(JobConf conf) {
try {
FileSystem hdfs = FileSystem.get(conf);
FileUtil.copyMerge(hdfs, new Path(IOInfo.TEMP_MOVIE_OUTPUT), hdfs, new Path(IOInfo.TEMP_MOVIE_MERGE)
, false, conf, null);
FileUtil.copyMerge(hdfs, new Path(IOInfo.TEMP_USER_OUTPUT), hdfs, new Path... | 7 |
@Override
public final void setModelStatus(ModelStatus modelStatus) {
CheckUtils.isNotNull(modelStatus);
if (!this.checkBeforeSet(this.getModelStatus(), modelStatus))
return;
if (this.modelStatus != null
&& this.modelStatus.equals(ModelStatus.DELETED)) {
throw new IllegalStateException(
"You... | 6 |
@SuppressWarnings("resource")
public Connection getConn() {
Statement stmt = null;
try {
Class.forName("org.sqlite.JDBC");
String databaseUrl = "jdbc:sqlite:mydatabase.db";
conn = DriverManager.getConnection(databaseUrl);
String sqlQuery = new Scanner(new File(CREATETABLES_SQL_PATH)).useDelim... | 5 |
public static List<Message> parseMessages(String resultString){
List<Message> messages = new ArrayList<Message>();
JSONObject base;
try {
base = new JSONObject(resultString);
int retcode = base.optInt("retcode",-1);
if (retcode == 0) {
JSONArray messageArray = base.optJSONArray("result");
for (in... | 8 |
public void setTable() {
// Centering the first two column's cell content
DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
centerRenderer.setHorizontalAlignment( JLabel.CENTER );
questionTable.getColumnModel().getColumn(0).setCellRenderer( centerRenderer );
... | 3 |
public void setCrs(Crs crs)
{
this.crs = crs;
} | 0 |
@Override
public void setIdleTimeout(long idleTimeout) {
this.idleTimeout = idleTimeout;
} | 0 |
public void neighborLightPropagationChanged(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
if (!this.worldProvider.hasNoSky || var1 != EnumSkyBlock.Sky) {
if (this.blockExists(var2, var3, var4)) {
if (var1 == EnumSkyBlock.Sky) {
if (this.canExistingB... | 8 |
public Iterator<Land> iterator() {
return laenderList.iterator();
} | 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.