text stringlengths 14 410k | label int32 0 9 |
|---|---|
protected boolean isInterface(final Type t) {
if (currentClass != null && t.equals(currentClass)) {
return isInterface;
}
return getClass(t).isInterface();
} | 2 |
private void clearBarCode() {
initQuantity();
txtBarCode.clear();
txtBarCode.requestFocus();
} | 0 |
@SuppressWarnings("unchecked")
public static void loadOptions(File f) throws Exception{
if(!f.exists()){
f.createNewFile();
saveDefaultOptions(f);
}
YAMLFile data = new YAMLFile(true);
data.Load(f);
for(Option p : options){
if(p.getType().equals("int"))
p.value = data.getInt(p.key);
if(p.... | 5 |
@Override
public void mouseDragged(final MouseEvent e) {
if (this.draggedComponent == null) {
for (final Element el : getGraphicPanel().getSelectionManager().getSelectedElements()) {
if (el.getComponent().getHandlers().isHandlerAt(e.getPoint())) {
if (el insta... | 9 |
private String col(String s, int width) {
if(s == null)
s = "";
if(s.length() >= width)
s = s.substring(0, width - 1);
while(s.length() < width)
s = s + " ";
return s;
} | 3 |
private static boolean isNotPrimitiveOrString(Class<?> type) {
return !type.isPrimitive() && !type.isAssignableFrom(String.class);
} | 2 |
private void insertUser() {
if (Arrays.equals(jPasswordField1.getPassword(), jPasswordField2.getPassword())) {
if (newEmployeeName.getText().isEmpty() || newEmployeeUsername.getText().isEmpty()) {
JOptionPane.showMessageDialog(this, "Udfyld alle felterne!");
} else {
... | 4 |
public RemoteServerCall(String address, int port) {
super(address, port);
sync = new ConcurrentHashMap<Long, IRemoteCallObject>();
conns = new ConcurrentHashMap<Long, List<Long>>();
} | 0 |
@EventHandler
public void onHangingBlockPlace(HangingPlaceEvent event) {
Player player = event.getPlayer(); // get player
Hanging block = event.getEntity(); // get block placed
// check config
FileConfiguration config = plugin.getConfig();
String material = block.getType().toString();
// if deactivated, do... | 5 |
public void show(String title, String message, ButtonSet buttonSet) {
switch (buttonSet) {
case OK:
buttonOK.setVisible(true);
buttonCancel.setVisible(false);
break;
case CANCEL:
buttonOK.setVisible(false);
buttonCancel.setVisible(true... | 3 |
@SuppressWarnings("UseSpecificCatch")
public void readXMLfile() {
try {
File XmlFile = new File("temp_movie.xml");
DocumentBuilderFactory dfb = DocumentBuilderFactory
.newInstance();
DocumentBuilder dBuilder = dfb.newDocumentBuilder();
... | 1 |
private void handlePointSelection(Point clickedPoint) {
selectedCurve = null;
selectedPoint = -1;
List<Curve> curves = Main.getCurveManager().getCurves();
int i = curves.size() - 1;
boolean found = false;
while (i >= 0 && !found) {
selectedPoint = curves.get(i).checkMouseCollision(clickedPoint);
if (s... | 3 |
@EventHandler
public void SlimeWeakness(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.getSlimeConfig().getDouble("Slime.Weakness.... | 6 |
public void setTagValue(){
try {
File xmlFile = new File("graphs//saveLivingstone-complex.xml");
fstream = new FileWriter("graphs//saveLivingstone-complex.grs");
out = new BufferedWriter(fstream);
fileName="saveLivingstone-complex";
// obtain a parser that produces DOM object trees from XML documen... | 9 |
private boolean add( char[] chars, V newValue, int offset, int length ) {
if ( offset == length ) {
value = newValue;
boolean wasAlreadyAKey = key != null;
key = new String( chars );
return !wasAlreadyAKey;
}
char nextChar = chars[ offset ];
... | 5 |
public static Element e(Document document, String tagName, A...attributes) {
Element element = document.createElement(tagName);
for(A a : attributes) {
element.setAttribute(a.name, a.value);
}
return element;
} | 1 |
public User getUser(String username) {
Query query = sessionFactory.getCurrentSession().createQuery("from User where username = :username");
query.setParameter("username", username);
List<?> list = query.list();
if (list.size() == 0)
return null;
return (User) list.get(0);
} | 2 |
private int getStatIndex(String stat)
{
switch(stat.toLowerCase())
{
case "atk":
return 0;
case "def":
return 1;
case "satk":
case "spa":
return 2;
case "sdef":
case "spd":
return 3;
case "spe":
return 4;
case "evasion":
return 5;
case "accuracy":
return 6;
}
return 0;
... | 9 |
public boolean hasCrashed() {
return ex == null;
} | 0 |
public ChatChannel joinChannel(ChatChannel channel, User user, boolean channelExists){
try {
Socket socket = new Socket(SERVER_ADDRESS_CHAT, CHAT_PORT);
socket.setSoTimeout(TIMEOUT);
OutputStream outputStream = socket.getOutputStream();
ObjectOutputStream objectOutputStream = new ObjectOutputStrea... | 5 |
public boolean isComplete() {
if (from == null || from.length()==0) {
System.err.println("doSend: no FROM");
return false;
}
if (subject == null || subject.length()==0) {
System.err.println("doSend: no SUBJECT");
return false;
}
if (toList.size()==0) {
System.err.println("doSend: no recipien... | 9 |
private void fillTagFirst(Integer userID, List<Integer> tags, Long day) {
Map<Integer, Long> tagMap = userTagFirstMapping.get(userID);
if (tagMap == null){
tagMap = new HashMap<Integer, Long>();
}
for (Integer tag : tags) {
if( ! tagMap.containsKey(tag) || day < tagMap.get(tag)) {
tagMap.put(tag... | 4 |
private String chooseFile() {
if (chooser.showDialog(org.analyse.main.Main.analyseFrame, null) == JFileChooser.APPROVE_OPTION) {
return chooser.getSelectedFile().getAbsolutePath();
}
return null;
} | 1 |
private void pop(char c) throws JSONException {
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m != c) {
throw new JSONException("Nesting error.");
}
this.top -= 1;
... | 5 |
public static int listLength(IntNode head)
{
IntNode cursor;
int answer;
answer = 0;
for (cursor = head; cursor != null; cursor = cursor.link)
answer++;
return answer;
} | 1 |
public void schemeEditorAddElement() {
if(ce_element.getText().length() == 0 || ce_type.getSelectionIndex() == -1) return;
String elementName = ce_element.getText();
String elementType = ce_type.getText();
scheme.getElements().put(elementName, elementType);
Eleme... | 5 |
public final void list_for() throws RecognitionException {
try {
// Python.g:423:10: ( 'for' exprlist 'in' testlist ( list_iter )? )
// Python.g:423:12: 'for' exprlist 'in' testlist ( list_iter )?
{
match(input,82,FOLLOW_82_in_list_for3775); if (state.failed) return;
pushFollow(FOLLOW_exprlist_in_list_... | 9 |
@Override
Color getColor(String colorName) {
// Java 8 can use Strings in switch.
switch (colorName) {
case "RED":
return new Red();
case "GREEN":
return new Green();
case "BLUE":
return new Blue();
default:
return null;
}
} | 3 |
public MavenJarFile getMavenJarFileFromFolderWithArtifactId(File folder, String artifactId) throws IOException {
MavenJarFile mainJarFile = null;
for (File aFile : folder.listFiles()) {
if (aFile.isDirectory()) {
mainJarFile = getMavenJarFileFromFolderWithArtifactId(aFile, ar... | 5 |
public int[] getInts(int par1, int par2, int par3, int par4)
{
int var5 = par1 - 1;
int var6 = par2 - 1;
int var7 = par3 + 2;
int var8 = par4 + 2;
int[] var9 = this.parent.getInts(var5, var6, var7, var8);
int[] var10 = IntCache.getIntCache(par3 * par4);
for (... | 8 |
@SuppressWarnings("deprecation")
public void run(){
System.out.println("HEALTHY 2: " + model.character.health);
/*
* Create a new display, which all of the GL11 commands will be applied to.
*/
try {
Display.create();
} catch (Exception e2) {
e2.printStackTrace();
System.exit(0);
}
G... | 9 |
public LogFileMessageFormatterImpl() {} | 0 |
public double round( double num) {
if(num > -45 && num < 45){
return 0;
}
if(num > 45 && num < 135){
return 90;
}
if(num > 135 && num < 225){
return 180;
}
if(num > 225 && num < 315){
return 270;
}
return num;
} | 8 |
private int mapOp(boolean invert, int op) {
switch (op) {
case Expression.EQ:
return Expression.GE;
case Expression.GE:
if (!invert) {
return Expression.GE;
}
return Expression.LE;
case Expression.LE:
if (!invert) {
return Expression.LE;
}
return Expression.GE;
case Expression.LT... | 7 |
public boolean storeMessage(String sender, String receiver, String message){
PreparedStatement st;
Integer rs;
String query;
query="INSERT INTO messages(sender,receiver,message) VALUES('"+sender+"','"+receiver+"','"+message+"')";
try {
st = conn.prepareStatement(query);
rs = st.executeUpdate();
st.cl... | 1 |
@Override
public void run() {
s = new StartLogo(this);
p = new PlayField(input);
p.reset();
long lastTick = System.nanoTime();
double nsPerTick = 1000000000D / 40D;
long lastFrame = System.nanoTime();
double nsPerFrame = 1000000000D / 60D;
int ticksPS = 0;
int framesPS = 0;
long lastTimer = Sys... | 5 |
@Test
public void testIsOpenOutOfRange() {
Percolation p = new Percolation(10);
try {
p.isOpen(10 + 1, 5);
fail("Line above should throw exception");
} catch (IndexOutOfBoundsException e) {
/* Expected */
}
try {
p.isOpen(5, 10 + 1);
fail("Line above should throw ex... | 6 |
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 800, 600);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
imagePanel = new JPanel();
imagePanel.setBounds(10, 30, 293, 447);
frame.getContentPane().add(imagePanel);
imageLabel = n... | 1 |
public void passEigenValues(
double[] eigenValues,
double[][] eigenVectors )
{
if ( size() == 0 )
{
this.eigenValues = eigenValues;
this.eigenVectors = eigenVectors;
}
else
{
get(0).passEigenValues(eigenValues, eigenVectors);
for ( int i = 0; i < size() - 1; ++i )
get(i + 1).passEigenValues(get(i).get... | 2 |
public double[] distributionForInstance(Instance instance)
throws Exception {
if (!m_isLeaf) {
// value of split attribute is missing
if (instance.isMissing(m_Attribute)) {
double[] returnedDist = new double[m_ClassProbs.length];
for (int i = 0; i < m_Successors.length; i++) {
double[] help =
... | 8 |
public static void setPoints(Player p, double i){
warnLevel.remove(p);
warnLevel.put(p, i);
} | 0 |
@Override
public Integer validate(String fieldName, String value) throws ValidationException {
if (value == null) {
return null;
}
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new ValidationException(fieldName, value, "not a valid int", e);
}
... | 2 |
public static void main(String[] args) throws Throwable {
BufferedReader in = new BufferedReader( new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int caso = 1;
for(String line; (line = in.readLine())!=null;){
StringTokenizer st = new StringTokenizer(line.trim());
int n = Integer... | 9 |
public GameFrame() {
// set the title on the frame
super("Boat Game!!!");
// Builds the Frame and adds the Game Panel to it
buildFrame();
// infinite animation loop, program halts when window is closed.
while (true) {
pause();
... | 4 |
protected boolean wantBraces() {
StructuredBlock block = subBlock;
if (block == null)
return false;
for (;;) {
if (block.declare != null && !block.declare.isEmpty()) {
/* A declaration; we need braces. */
return true;
}
if (!(block instanceof SequentialBlock)) {
/*
* This was the las... | 9 |
public static Perturbation generate(String type, Molecule m,int resList[],BufferedReader br){//Generates a perturbation of the indicated type, affecting units in unitList
//(Basically a constructor wrapper)
Arrays.sort(resList);//We need the list of affected residues to be in ascending order
if... | 8 |
@Override
public void documentRemoved(DocumentRepositoryEvent e) {} | 0 |
protected Element createStateElement(Document document, State state,
Automaton container) {
// Start the creation of the state tag.
Element se = createElement(document, STATE_NAME, null, null);
se.setAttribute(STATE_ID_NAME, "" + state.getID());
// Encode position.
se.appendChild(createElement(document, ST... | 4 |
private void clearCaches() {
if ((priorityCache != null) && !priorityCache.isEmpty())
priorityCache.clear();
if ((structCache != null) && !structCache.isEmpty())
structCache.clear();
} | 4 |
public static double[] bubbleSort(double[] actualArraySort, String order) {
double temp=0;
for (int i = 0; i < actualArraySort.length; i++) {
for (int j = 1; j <(actualArraySort.length-1) ; j++) {
if(order.equalsIgnoreCase("asc") ? actualArraySort[i] > actualA... | 4 |
public boolean isAncestor(mxGraphHierarchyNode otherNode)
{
// Firstly, the hash code of this node needs to be shorter than the
// other node
if (otherNode != null && hashCode != null && otherNode.hashCode != null
&& hashCode.length < otherNode.hashCode.length)
{
if (hashCode == otherNode.hashCode)
{... | 9 |
public static void print (Object s){
if (setFind)
System.out.println(getFileName() +":" +getClassName() +":"+ getMethodName() +":"+ getLineNumber());
System.out.println(s);
} | 1 |
void simulate(ArrayList<Process> l)
{
int[] waitTime = new int[l.size()-1];
int[] turnAroundTime = new int[l.size()-1];
int timer = l.get(0).arrivalTime;
boolean flag = true;
for (int i = 0; i < l.size()-1; i++)
{
Process p = l.get(i);
char name ... | 8 |
public void setPlace(String place) {
this.place = place;
} | 0 |
void innerMessagesPerform(Request request) {
String message = request.getParams().get("Innermessage").get(0);
String data = (String) request.getData();
if (data == null) {
throw new NullPointerException("data == null");
}
if ("added_slave".equals(message)) {
... | 5 |
public void print_statusbar(int x, int n, int r, int w, String message)
{
if (!silent)
{
/* Calculuate the ratio of statusbar (will be 0.5 on 50%) */
double ratio = (double)x / (double)n;
/* Calculate the percentage of current status */
int pe... | 5 |
public static void main(String[] args) throws Exception {
AbstractVDKFileInfo fileInfo = null;
CTFileInfo ctFileInfo;
// AbstractVDKFileParser fileParser = AbstractVDKFileParser.getParser("C:\\Users\\Herestt\\Desktop\\OBJECT_CITY.VDK");
// fileInfo = fileParser.start();
// fileInfo.unpack("C:\\Users\... | 3 |
public boolean addPatternObject(String name, Object patternType) {
for (String a : genericPatterList.keySet()) {
if (name.equalsIgnoreCase(a)) {
return false;
}
}
genericPatterList.put(name, patternType);
return true;
} | 2 |
public void eat(WorldObject woEaten) {
try { // Nothing will eat its own type
if (woEaten.getWobID() != this.getWobID() ) woEaten.died("Killed");
} catch ( Exception e) { System.out.println("WorldObject.eat(): " + e); }
} | 2 |
@Override
public void close() {
switch (this.getState()) {
case LIFTOPEN:
this.setState(LiftState.LIFTCLOSE);
break;
case LIFTSTOP:
case LIFTRUNNING:
case LIFTCLOSE:
break;
}
} | 4 |
public void setSubExpressions(int i, Expression expr) {
int diff = expr.getFreeOperandCount()
- subExpressions[i].getFreeOperandCount();
subExpressions[i] = expr;
expr.parent = this;
for (Operator ce = this; ce != null; ce = (Operator) ce.parent)
ce.operandcount += diff;
updateType();
} | 1 |
public static void main(String[] args) throws IOException{
ServerSocketChannel channel = ServerSocketChannel.open();//获取ServerSocket通道
channel.socket().bind(new InetSocketAddress(8888));
channel.configureBlocking(false);//设置为非阻塞
Selector selector = Selector.open();//获得通道的多路复用器(通道管理器)
... | 9 |
public Venue getVenue() {
return venue;
} | 0 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical target, boolean auto, int asLevel)
{
if(target==null)
target=mob;
if(!(target instanceof MOB))
return false;
if(CMLib.flags().isGolem(target))
return false;
if(((MOB)target).phyStats().level()<CMProps.getIntVar(CMProps.Int.INJBL... | 8 |
public static Quiz getQuiz(int quizId)
{
try {
String query = String.format("SELECT * FROM QUIZ where quizid = %d", quizId);
ResultSet rs = getQueryResults(query);
Quiz q;
if (rs.next())
{
q = new Quiz(rs.getString("QUIZTITLE"), rs.getInt("QUIZID"));
... | 2 |
public String loadScriptResource(String filename, String charset)
{
BufferedReader br = null;
try
{
br = new BufferedReader(new InputStreamReader(
new FileInputStream(filename),
charset
));
} catch( IOException | NullPointerException e1 ) {
// no file found try to load from jar
try
... | 4 |
public String shortcutTag(int i, String s, int j, String s1, String s2, int k)
{
String s3 = "";
if(s.equals(""))
return "";
XMLNode xmlnode = new XMLNode();
xmlnode.XMLType = j;
xmlnode.XMLData = s;
xmlnode.XMLAttr = s1;
LinkedList linkedlist = ne... | 8 |
@Test
public void testSVD() {
SparseMatrix matrix = new SparseMatrix();
for(int i=0; i<5000; i++) {
for(int j=0; j<50; j++){
if (j % 2 == 0) {
matrix.set(i, j, (float) (Math.sin(i) + RND.nextDouble()*0.01));
} else {
... | 6 |
public static void find(int[] a,int target){
int m = 0;
int n = 0;
boolean flag = false;
for(int i = 0; i < a.length; i++){
for(int j = i+1; j < a.length; j++){
if(a[i] * 2 > target){
i = a.length;
j = a.length;
break;
}
int temp = a[i] + a[j];
if(temp > target){
break;
... | 7 |
public static final void execTransform(Body b) {
switch(b.getType()) {
case Reimu.type:
// 縺ァ縺��蛹�
synchronized(SimYukkuri.lock) {
Terrarium.bodyList.remove(b);
Body to = new Deibu(b.getX(), b.getY(), b.getZ(), b.getAgeState(), null, null);
YukkuriUtil.changeBody(to, b);
Terrarium.bodyL... | 6 |
public static void copyFromQueueToQueue(RabbitMQRequestParams rabbitMQRequestParams) throws Exception {
RabbitMQTopicQueueConsumer consumer = new RabbitMQTopicQueueConsumer(
rabbitMQRequestParams.getSourceHost(), rabbitMQRequestParams.getSourcePort()
, rabbitMQRequestParams.getSourceUsername(), rabbitMQReques... | 3 |
public boolean isDescendantOf(Row row) {
Row parent = mParent;
while (parent != null) {
if (parent == row) {
return true;
}
parent = parent.mParent;
}
return false;
} | 2 |
public static long factorial(int n) {
if (n < 2) {
return 1;
}
long ans = 1;
for (long i = 1; i <= n; i++) {
ans *= i;
}
return ans;
} | 2 |
private long cal(){
int length = subLength*2;
long[][][] dp = new long[length+1][subLength+1][subLength+1];
dp[0][0][0] = 1;
for(int k=1; k<=length; k++){
for(int i=0; i<=subLength; i++){
int j = k-i;
if(j<0) break;
if(j<=subLe... | 8 |
private void configureLogger() throws Exception {
if ((!new File(getDirectory()).exists()) && (!new File(getDirectory()).mkdirs()))
throw new Exception("Cann't create log-directory " + getDirectory());
if ((config.getResource() != null) &&
(!config.getResource().isEmpty()) &&
(new Fil... | 8 |
public void siirra(int xMuutos){
if (peli.onkoPause()){
return;
}
if (xMuutos < 0){
int vas = etsiVasenX();
if (vas + xMuutos < 0){
return;
}
}
if (xMuutos > 0){
int oik = etsiOikeaX();
if (oi... | 7 |
@Override
public void run() {
for(int i = 0 ; i < 100; i ++)
{
System.out.println("Thread Test !" + i);
}
} | 1 |
@Override
public void map(Object key, Text value, Context context) throws IOException, InterruptedException {
// 讀取一列轉換為欄位陣列
String[] columnValue = readRow(value, VERTICALBAR);
// 建立Key <primaryKey, tableIndex, joinCondition>
outputKey = new QuadTextPair(new IntWritable(Integer.parseInt(columnValue[0])), new... | 8 |
private Message(Type type, ByteBuffer data) {
this.type = type;
this.data = data;
this.data.rewind();
} | 0 |
public List<CreativeMaterial> findAllCreativeMaterialsByRoomEventId(final Long roomEventId) {
return new ArrayList<CreativeMaterial>();
} | 0 |
public int findNumberInString(String in){
int pos = 0;
int start = -1;
int stop = -1;
while(pos < in.length() )
{
if(isNumber(in.codePointAt(pos)))
{
if(start == -1)
{
start = pos;
}
... | 6 |
@Override
public void run() {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
char input = 'm';
try {
while (!player.canMove) {
input = (char) br.read();
}
while (player.canMove) {
if (input == 'w' || input == 'a' || input == 's' || input == 'd' || input == 'x'... | 8 |
public boolean matches( Class<?> clazz )
{
return this.a.matches( clazz ) ^ this.b.matches( clazz );
} | 1 |
private boolean checkTrapLocation(int x, int y){
for(Trap t : traps) if(t.getX() == x && t.getY() == y) return true;
return false;
} | 3 |
@Override
public int hashCode()
{
return (currencyPair.hashCode() * 17 + tenor.hashCode()) * 17 + (getRole() == null ? 0 : getRole().hashCode());
} | 1 |
public void accept(final MethodVisitor mv) {
mv.visitTryCatchBlock(start.getLabel(), end.getLabel(),
handler == null ? null : handler.getLabel(), type);
} | 1 |
protected void printHelp(CommandSender sender, String label) {
if(sender.hasPermission("rapsheet.lookup")) {
sender.sendMessage(ChatColor.GRAY + "/" + label + " lookup <player>");
sender.sendMessage(ChatColor.GRAY + "/" + label + " lookup <player> <charge#>");
}
if(sender.hasPermission("rapsheet.charge")) {... | 6 |
private void randomWalkAddPossibleCommandsForDirection(dir direction, ArrayList<Command> possibleCommands){
if (neighbourFree(this.atField,direction))
{
possibleCommands.add(new Command(direction));
}
else if (neighbourIsBoxOfSameColor(direction))
{
//Find possible pull commands
for (dir d : ... | 8 |
public void createIntro(ArrayList<String> imageList, ArrayList<String> descriptionList)
{
Element introElement = doc.createElement("intro");
gameModule.appendChild(introElement);
for(int i=0;i<imageList.size();i++)
{
Path path = Paths.get(imageList.get(i));
Element i... | 1 |
public void testPresent2() {
try {
TreeNode result = contains(new TreeNode("node"), mkChain(new String[]{ "node", "anothernode" }));
assertTrue(null, "Failed to ignore the subtrees branches when locating the only node of a leaf!",
result != null
&& result... | 7 |
public double getDouble(int index) throws JSONException {
Object o = get(index);
try {
return o instanceof Number ?
((Number)o).doubleValue() :
Double.valueOf((String)o).doubleValue();
} catch (Exception e) {
throw new JSONException("JSONAr... | 2 |
public double getDiscountedPrice(double originalPrice){
if(originalPrice <= 0) throw new IllegalArgumentException("The starting price cannot be 0 or below.");
double newPrice = 0;
switch(typeFlag){
case PERCENTAGE:
newPrice = originalPrice * (1 - discountValue);
break;
case ABSOLUTE:
newPri... | 3 |
public String listPlayerNames() {
String[][] playerArray = getConnectedPlayers();
String playerNames = "";
int processed = 0;
while(processed < playerArray.length) {
playerNames = playerNames + "," + playerArray[processed][0];
processed++;
}
return "PLAYERS " + playerNames;
} | 1 |
public static Stella_Object safeArgumentBoundTo(Stella_Object self) {
if (Surrogate.subtypeOfP(Stella_Object.safePrimaryType(self), Logic.SGT_LOGIC_PATTERN_VARIABLE)) {
{ PatternVariable self000 = ((PatternVariable)(self));
{ Stella_Object value = null;
if ((((QueryIterator)(Logic.$QUERYIT... | 6 |
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int m = Integer.parseInt(st.nextToken());
int d = ... | 9 |
public final GameTreeNode select(Random random) {
GameTreeNode node = root;
int me = root.board.currentPlayer;
while(node.children.size() > 0) {
if(random.nextDouble() < 0.1)
break;
if(node.board.currentPlayer == me) { // choose the most promising node for me
node = node.children.str... | 3 |
private static String getEmptyTempFile(String dir) {
Random r = new Random();
String name = null;
File f = null;
do {
name = (dir.equals("") ? "" : dir + "/") + "_temp_" + Math.abs(9272334 * r.nextInt());
f = new File(name);
} while(f.exists());
return name;
} | 2 |
@Override
public int getCounterwidth() {
// TODO Auto-generated method stub
return 0;
} | 0 |
final public void ExpPRT() throws ParseException {
/*@bgen(jjtree) PRT */
SimpleNode jjtn000 = new SimpleNode(JJTPRT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(OPEN_ROUND_BRACKET);
Expression();
SimpleNode jjtn001 = new S... | 9 |
private ArrayList caclPosIni(){
ArrayList<Integer> pos = new ArrayList();
// int canto = 2;
int t;
int canto = (int) (Math.random()*4);
switch (canto){
case 0:
t = (int) (Math.random()*Board.getWIDTH());
... | 4 |
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.