text stringlengths 14 410k | label int32 0 9 |
|---|---|
public synchronized void beginXmit() {
active = true;
} | 0 |
public boolean sendCarToNextSeg(double requestedPostion) {
//check if this road has a next segment set.
if (this.getCurrentRoad().getNextSeg(this) != null) {
VehicleAcceptor next = this.getCurrentRoad().getNextSeg(this);
//now make sure there is space for it and that is will accept it
//Syste... | 4 |
public void setSaleid(String saleid) {
this.saleid = saleid;
} | 0 |
@Override
public List<String> recvMakeOffer(String serviceName, String seller, String price) {
loggerGui.info("[ " + user.getUsername() + "] received make offer packet for service " +
serviceName + " from seller " + seller);
// update buyer's status (add price to status)
String newStatus = StatusMessages.... | 3 |
public void updateAsScheduled(int numUpdates) {
super.updateAsScheduled(numUpdates) ;
updateLandingStrip() ;
if (! structure.intact()) return ;
final Batch <Venue> depots = Deliveries.nearbyDepots(this, world) ;
for (Service type : ALL_COMMODITIES) {
final int level = exportLevel(type) ;
... | 4 |
public static AbstractTableModel get2DBounded(final CSProperties p, final String pname) throws ParseException {
String m = p.getInfo(pname).get("bound");
String[] dims = m.split(",");
final int rows = DataIO.getInt(p, dims[0].trim());
final int cols = DataIO.getInt(p, dims[1].trim());
... | 1 |
public void loadFile(String path) throws IOException {
String thisLine; // variable to read each line.
BufferedReader myInput = null;
try {
FileInputStream fin = new FileInputStream(new File(path));
myInput = new BufferedReader(new InputStreamReader(fin));
// for each line until the end of the file
in... | 7 |
private void collectInput(final String input) {
String n, s;
StringTokenizer st = new StringTokenizer(input,"-");
n = st.nextToken();
s = st.nextToken();
if (students.containsKey(n)) {
students.get(n).addScore(s);
} else {
Student student = new Student(n);
student.addScore(s);
studen... | 1 |
public static boolean isZip(final File file) {
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
final byte[] m = new byte[4];
fis.read(m);
fis.close();
return (m[0] << 24 | m[1] << 16 | m[2] << 8 | m[3]) == 0x504b0304;
} catch (final IOException ignored) {
} finally {
if (fis... | 3 |
public ResultSet callCommandGetRow(PreparedStatement _sqlCommand, Connection _con)
{
//Benchmark time start
ThreadMXBean threadmxbean = ManagementFactory.getThreadMXBean();
long startTime;
long finishTime;
if (_enableSqlMonitor)
startTime = threadmxbean.getCurre... | 4 |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (!(obj instanceof WaterfallBarRenderer)) {
return false;
}
WaterfallBarRenderer that = (WaterfallBarRend... | 7 |
private boolean crossingInternal(Point2DInt direction1, Point2DInt direction2) {
if (angles.size() < 2) {
return false;
}
final double angle1 = convertAngle(new LineSegmentInt(center, direction1).getAngle());
final double angle2 = convertAngle(new LineSegmentInt(center, direction2).getAngle());
Double las... | 9 |
private final FloatControl getVolumeControl() {
Mixer.Info[] mixerInfo = AudioSystem.getMixerInfo();
Port.Info speakerInfo = Port.Info.SPEAKER;
mixerInfoLoop: for (Mixer.Info info : mixerInfo) {
Mixer mixer = AudioSystem.getMixer(info);
if (AudioSystem.getMixer(info).isLineSupported(speakerInfo)) {
Por... | 6 |
public Deck( Set<DefaultRank> usedRanks, Set<? extends Suit> usedSuits, int numberOfJokers )
{
List<Card> deck = new ArrayList<Card>();
for ( Suit suit : usedSuits )
{
for ( DefaultRank rank : usedRanks )
{
deck.add( new Card( rank, suit ) );
... | 4 |
public void body()
{
// wait for a little while
// This to give a time for GridResource entities to register their
// services to GIS (GridInformationService) entity.
super.gridSimHold(GridSim.PAUSE);
LinkedList resList = super.getGridResourceList();
// initialises a... | 5 |
public static String callgraphAlgorithmToString(CallgraphAlgorithm algorihm) {
switch (algorihm) {
case AutomaticSelection:
return "AUTO";
case VTA:
return "VTA";
case RTA:
return "RTA";
default:
return "unknown";
}
} | 3 |
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String palin;
boolean isPalin = true;
System.out.println("Please enter a text that may or may not be a palindrome: ");
palin = s.nextLine();
for(int i = 0; i <= palin.l... | 3 |
public static void main(String[] args) {
// Instantiating New Objects
Rectangle rectangle = new Rectangle(50, 75);
System.out.println(rectangle.getWidth());
} | 0 |
public boolean lastrun(byte col) {
/* the board is checked to see if the player
* with color 'col' is in lastrun mode.
* (the gathering phase of the game)
*/
boolean lastrun = true;
if(col==W) {
for(int j=0; j<19; j++) {
if(positions[j].getCol()==W && positions[j].getNum()>0) {
lastrun = f... | 8 |
public Juego() {
setTitle("Deep in the shadows");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setSize(800, 600); //tamaño del jframe
addKeyListener(this);
addMouseListener(this);
fontPuntajes = new Font("Cambria", 0, 34);
cont = 0;//contador de tiempo d... | 3 |
@Override
public void main(String pushedMessages) {
try {
instructionsToModel.put(name + "-" + pushedMessages);
} catch (InterruptedException e) {
e.printStackTrace();
}
} | 1 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed"
// desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jTextArea1 = new javax.swing.JTextArea();
setDefaultCloseOperation(javax.swi... | 5 |
@Override
public boolean contains(long element) {
if (layout.length == 0) {
return false;
}
int currentPos = 0;
while (currentPos >= 0) {
int rightChildPointer = getRightChildPointer(currentPos);
int leftChildPointer = getLeftChildPointer(currentPo... | 5 |
public ConnectOnServerEvent(Object server, ISocketServerConnection clientConnection) {
super(server);
this.clientConnection = clientConnection;
} | 0 |
public Grub(Animation left, Animation right,
Animation deadLeft, Animation deadRight, Animation standingLeft, Animation standingRight,
Animation jumpingLeft, Animation jumpingRight)
{
super(left, right, deadLeft, deadRight, standingLeft, standingRight, jumpingLeft, jumpingRight);
th... | 0 |
private List<TagNode> findMatchingTagNodes(ITagNodeCondition condition, boolean isRecursive){
List<TagNode> result = new LinkedList<TagNode>();
if (condition == null) {
return result;
}
for (Object item : children) {
if (item instanceof TagNode) {
... | 7 |
private static Cell construct(Sequence s1, Sequence s2, float[][] matrix,
float o, float e, byte[] pointers, short[] sizesOfVerticalGaps,
short[] sizesOfHorizontalGaps) {
logger.info("Started...");
long start = System.currentTimeMillis();
char[] a1 = s1.toArray();
char[] a2 = s2.toArray();
int m = s1.... | 9 |
public int compareTo(BinaryTreeNode n) {
int diff = this.key - n.key;
if (diff > 0) return 1;
if (diff == 0) return 0;
return -1;
} | 2 |
public static boolean isBlank(String text) {
if (isEmpty(text)) {
return true;
}
int length = text.length();
for (int i = 0; i < length; i++) {
if (!Character.isWhitespace(text.charAt(i))) {
return false;
}
}
return true;
} | 3 |
@Override
public int getRowCount() {
return pu == null ? 0 : pu.size();
} | 1 |
public void update(long deltaMs) {
if(!sequence.isEmpty()) {
sequence.peekFirst().update(deltaMs);
if(sequence.peekFirst().finished()) {
sequence.pollFirst();
}
}
} | 2 |
public static Boolean findPlugins(){
File dir = new File(System.getProperty("user.dir") + File.separator + pluginDirectory);
ClassLoader cl = new PluginClassLoader(dir);
if (dir.exists()) {
if(dir.isDirectory()){
String[] files = dir.list();
for (int i=0; i<files.length; i++) {
try {
if (! f... | 9 |
public ModifierMatcher forbidAccess(int accessModif, boolean andAbove) {
if (andAbove) {
if (accessModif == Modifier.PRIVATE)
// This forbids all access.
return denyAll;
if (accessModif == 0)
return this.and(Modifier.PRIVATE, Modifier.PRIVATE);
if (accessModif == Modifier.PROTECTED)
return th... | 6 |
private static char recLetter(int[][] pixels, int leftCol, int rightCol, char expChar) {
int[][] matrix = new int[LETTER_HEIGHT][LETTER_WIDTH];
for (int row = 0; row < pixels.length; row++) {
for (int col = leftCol; col < rightCol; col++) {
if(pixels[row][col] > 0) {... | 9 |
@Override
public int behavior(int num)
{
int roll1 = (int) (Math.random() * 6 + 1);
int roll2 = (int) (Math.random() * 6 + 1);
String message = ECRB.get("DontThinkTheyreDead.player") + (getTargetPlayer().getNumber() + 1) + ECRB.get("DontThinkTheyreDead.message_1") //$NON-NLS-1$ //$NON-NLS-2$
+ roll1 + ECRB.... | 9 |
private ArrayList<ArrayList<String>> getPath(HashMap<String, HashSet<String>> reverseLinks) {
ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();
if(startWord.endsWith(endWord)){
ArrayList<String> tmp = new ArrayList<String>();
tmp.add(endWord);
... | 5 |
public Stardata Fk524(Stardata j2000) {
/* Miscellaneous */
double r, d, ur, ud, px, rv;
double sr, cr, sd, cd, x, y, z, w;
double v1[] = new double[6], v2[] = new double[6];
double xd, yd, zd;
double rxyz, wd, rxysq, rxy;
int i, j;
/* Radians per year t... | 7 |
@Override
public void add(Client element) {
//Добавляем запись в список
getList().add(element);
Statement statement = null;
ResultSet result = null;
try {
//Создаем изменяемую выборку
statement = getConnection().createStatement(ResultSet.TYPE_SCROLL_S... | 2 |
public void sort(int [] arrs)
{
sort2(arrs,0,arrs.length-1);
} | 0 |
public void setAgents(Vector agents) {
this.agents = agents;
// Recalculate the graph space angle incase we need it,
// and adjust the number of Agents where appropriate.
if (numberOfAgents != agents.size()) {
numberOfAgents = agents.size();
... | 6 |
public void setOptions(String[] options) throws Exception {
String tmpStr;
String[] spec;
String classname;
tmpStr = Utils.getOption('W', options);
if (tmpStr.length() > 0) {
spec = Utils.splitOptions(tmpStr);
if (spec.length == 0)
throw new IllegalArgumentException... | 8 |
public String chessCoordinates(){
String fileValue;
switch (file) {
case 0:
fileValue = "A";
break;
case 1:
fileValue = "B";
break;
case 2:
fileValue = "C";
break;
case 3:
fileValue = "D";
break;
case 4:
fileValue = "E";
break;
case 5:
fileValue = "F";
break;
case 6... | 8 |
public static void main(String[] args) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... | 6 |
public void setRegExes(String[] regexes) {this.regexes = regexes;} | 0 |
public void protect(xAuthPlayer xp) {
Player p = xp.getPlayer();
if (p == null)
return;
plugin.getPlyrDtHndlr().storeData(xp, p);
xp.setCreative(p.getGameMode().equals(GameMode.CREATIVE));
if (xp.isCreativeMode())
p.setGameMode(GameMode.SURVIVAL);
xp.setLastNotifyTime(new Timestamp(System.currentTi... | 4 |
private void registerPermission(Permission permission)
{
if (permission != null)
{
try
{
this.pm.addPermission(permission);
}
catch(IllegalArgumentException e)
{}
}
} | 2 |
@Override
public int compareTo(NewId other) {
if (_a != other._a)
return (_a < other._a) ? -1 : 1;
if (_b != other._b)
return (_b < other._b) ? -1 : 1;
if (_c != other._c)
return (_c < other._c) ? -1 : 1;
if (_d != other._d)
return (_d < other._d) ? -1 : 1;
return 0;
} | 8 |
private Item unfoldSCC(Item i, Item from, Map<Item, Set<Item>> scc, Set<Item> current) {
if (i instanceof EndItem) {
return i;
}
Pair<Item, Item> p = new Pair<Item, Item>(i, from);
Item clone = unfolds.get(p);
if (clone != null) {
return clone;
}
if (from == null) {
clone = i;
} else {
... | 7 |
public static void main(String args[]) {
Scanner file1 = null, file2 = null;
try {
// Create a scanner to read the file, file name is parameter
file1 = new Scanner(new File(System.getProperty("user.dir") + "/src/Files/prg404a1.dat"));
file2 = new Scanner(new File(System.getProperty("user.dir") + "/src/File... | 9 |
public int find(Person friend)
{
for (int i = 0; i < friends.size(); i++)
{
if (friends.get(i).equals(friend))
{
return i;
}
}
// If the person is not found by the end of the friends list
return -1;
} | 2 |
public boolean equalsContent( Variant other )
{
if ( this.mvd != other.mvd
|| this.data.length != other.data.length )
return false;
else
{
for ( int i=0;i<data.length;i++ )
{
if ( this.data[i] != other.data[i] )
return false;
}
return true;
}
} | 4 |
private static void populateExecutors(Configuration configuration,
Document factory) {
NodeList nodeList=factory.getElementsByTagName("executors");
if(nodeList!=null && nodeList.getLength()==1){
Element element=(Element)nodeList.item(0);
NodeList executors=element.getElementsByTagName("executor");
if(ex... | 8 |
public Coordinate discoverAndPrintRoute(int locX, int locY){
boolean[][] visitedMatrix = new boolean[sizeX][sizeY];
Stack<Coordinate> route = new Stack<Coordinate>();
route.push(new Coordinate(locX, locY));
Coordinate ePoint = discoverEndPoint(locX, locY, visitedMatrix, route);
System.out.println("\n\nRoute :... | 6 |
private boolean checkHealth1(Node node) {
boolean ok = false;
java.net.Socket socket = null;
try {
socket = new java.net.Socket(node.getHostname(), node.getPort());
if (!node.isOptionsEnabled()) {
ok = true;
} else {
OutputStream os = socket.getOutputStream();
os.write(getRequest(no... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
PlayerState other = (PlayerState) obj;
if (own ==... | 6 |
@Override
protected Pizza createPizza(String type)
{
Pizza pizza = null;
PizzaIngredientFactory ingredientFactory =
new NYPizzaIngredientFactory();
if (type.equals("cheese"))
{
pizza = new CheesePizza(ingredientFactory);
pizza.setNam... | 4 |
public static void main (String[] args)
{
int combos = 0;
for (int a = 0; a <2; a++)
for (int b = 0; b <=4; b++)
for (int c = 0; c <= 10; c++)
for (int d = 0; d <= 20; d++)
for (int e = 0; e <= 40; e++)
... | 8 |
public List<String> getModuleKeys(String module) {
ArrayList<String> keys = new ArrayList<>();
Enumeration<Object> keyEnum = mPrefs.keys();
while (keyEnum.hasMoreElements()) {
String key = (String) keyEnum.nextElement();
if (key.startsWith(module)) {
key = key.substring(key.indexOf('.') + 1);
if (... | 4 |
@Override
public void deserialize(Buffer buf) {
int limit = buf.readUShort();
quantities = new int[limit];
for (int i = 0; i < limit; i++) {
quantities[i] = buf.readInt();
}
limit = buf.readUShort();
types = new int[limit];
for (int i = 0; i < limi... | 5 |
public static Locale parseLocaleString(String localeString) {
String[] parts = tokenizeToStringArray(localeString, "_ ", false, false);
String language = (parts.length > 0 ? parts[0] : "");
String country = (parts.length > 1 ? parts[1] : "");
validateLocalePart(language);
validateLocalePart(country);
String... | 5 |
public SyntheticAnalyzer(MethodInfo method, boolean checkName) {
this.method = method;
if (method.getBytecode() == null)
return;
if (!checkName || method.getName().equals("class$"))
if (checkGetClass())
return;
if (!checkName || method.getName().startsWith("access$"))
if (checkAccess())
return;... | 9 |
ValueGrid( GridRange gr, double low, double up, ValueAxisUnit vAxis, double base ) throws RrdException
{
double grLower = Double.MAX_VALUE;
double grUpper = Double.MIN_VALUE;
if ( gr != null )
{
this.rigid = gr.isRigid();
grLower = gr.getLowerValue();
grUpper = gr.getUpperValue();
}
thi... | 7 |
private void btnenvoyerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnenvoyerActionPerformed
if (jTextNom1.getText().isEmpty() || jTextAdresse.getText().isEmpty()
|| jTextAdresseCP.getText().isEmpty() ||
jTextAdresseV.getText().isEmpty() || ... | 8 |
@Override
public boolean equals(Object other){
if(other instanceof HttpHeaderResponse){
HttpHeaderResponse otherHeader = (HttpHeaderResponse) other;
return serverInformation.equals(otherHeader.serverInformation) &&
date.equals(otherHeader.date) &&
... | 5 |
public Room prison()
{
if((prisonRoom!=null)&&(!prisonRoom.amDestroyed()))
return prisonRoom;
Room myPrison=null;
int x=0;
if((text().length()>0)&&((x=text().indexOf("<P>"))>0))
myPrison=CMLib.map().getRoom(text().substring(0,x));
if(myPrison != null)
{
prisonRoom = (Room) myPrison.copyOf();
}
... | 8 |
public void updateBlockPaint(Graphics g){
Graphics2D g2d = (Graphics2D) g;
// Parcous la table des coordonnées du jeu
for(int x=0; x < coordonneJeu.getNombreColonne(); x++)
for(int y=0; y < coordonneJeu.getNombreRangee(); y++)
// Si un Tetrominoe est présent on le pai... | 3 |
public void update(){
if (walking){
anim++;
}
if (anim > anim_wait * 4){
anim = 0;
}
int xa=0, ya=0;
if (input.up){ ya--; }
if (input.down){ ya++; }
if (input.left){ xa--; }
if (input.right){ xa++; }
if (xa != 0 || ya != 0){
move (xa, ya);
walking = true;
} else {
walking = false... | 8 |
public void put(Key key, Value val) {
if (val == null) { delete(key); return; }
for (Node x = first; x != null; x = x.next)
if (key.equals(x.key)) { x.val = val; return; }
first = new Node(key, val, first);
N++;
} | 3 |
public void listLogradouros() {
facesContext = FacesContext.getCurrentInstance();
requestContext = RequestContext.getCurrentInstance();
logradouro.setLog_bairro_id(bairro);
try {
listaLogradouro = genericDAO.searchObject(Logradouro.class,"logradouro",
null, null,
... | 3 |
public void playGame() {
playerNumber = 0;
playerLocation = 0;
int increment = 1; // used for skipping a player if they do a suggestion
boolean humanPlayer = false;
//System.out.println("in playGame");
Card roomCard, personCard, weaponCard;
while(true) {
if(gameControlPanel.getNextButton()) { ... | 9 |
@Override
public boolean createTable(String query) {
Statement statement = null;
try {
if (query.equals("") || query == null) {
this.writeError("SQL Create Table query empty.", true);
return false;
}
statement = this.connection.cre... | 3 |
private CreditCardReceipt updateRecurringPurchaseHelper(
PeriodicPurchaseInfo periodicPurchaseInfo, CreditCard creditCard,
String storageTokenId, VerificationRequest verificationRequest,
PurchaseCardRequest purchaseCard) {
if (periodicPurchaseInfo.getPeriodicTransactionId() ... | 6 |
public synchronized void update(long elapsedTime) {
if (frames.size() > 1) {
animTime += elapsedTime;
if (animTime >= totalDuration) {
animTime = animTime % totalDuration;
currFrameIndex = 0;
}
while (animTime > getFrame(currFrame... | 3 |
public void run() {
long start = System.currentTimeMillis();
long sleepTil = start;
while(System.currentTimeMillis() - start < duration && !stop) {
sleepTil += interval;
try {
sleep(sleepTil - System.currentTimeMillis());
} catch (InterruptedException e) {
e.printStackTrace();
}
if (!st... | 5 |
public JButton getjButtonSauvegarder() {
return jButtonSauvegarder;
} | 0 |
boolean EvaluateVote()
{
int sum = 0;
for(int i : votes)
{
sum += i;
}
boolean resultVotation = sum > 0;
return resultVotation;
} | 1 |
public void testGJCutover() {
DateTime dt = new DateTime("1582-10-04", GJChronology.getInstanceUTC());
try {
dt.dayOfMonth().setCopy(5);
fail();
} catch (IllegalFieldValueException e) {
assertEquals(DateTimeFieldType.dayOfMonth(), e.getDateTimeFieldType());
... | 2 |
public String BuildString(World world, int x, int y, int z) {
if (world.getBlockAt(x, y, z).getState() instanceof Sign) {
if (string.length() > 0) {
string.delete(0, string.length());
}
string.append(world.getName());
string.append(":");
... | 2 |
public boolean containsValue( Object val ) {
byte[] states = _states;
V[] vals = _values;
// special case null values so that we don't have to
// perform null checks before every call to equals()
if ( null == val ) {
for ( int i = vals.length; i-- > 0; ) {
... | 8 |
@Override
public boolean onMouseDown(int mX, int mY, int button) {
Iterator<IGameScreen> it = screens.iterator();
while(it.hasNext()) {
IGameScreen screen = it.next();
if(screen.onMouseDown(mX, mY, button)) {
return true;
}
}
... | 3 |
public void setIsWaiting(boolean isWaiting) {
synchronized (gpm.getThreadStates()) {
gpm.setThreadState(id, isWaiting);
gpm.getThreadStates().notify();
}
} | 0 |
public static void xmlToHtml(File xmlFile, File xslFile, File htmlFile, Vector params) {
InputHandler inputHandler = new InputHandler(xmlFile, xslFile, params);
try {
if (!htmlFile.exists()) {
// htmlFile.getParentFile().mkdirs();
if(htmlFile.createNewFile()){
... | 3 |
private GameText(String string, String string_7_, String string_8_,
String string_9_) {
try {
languageText
= new String[] { string, string_7_, string_8_, string_9_ };
} catch (RuntimeException runtimeexception) {
throw Class348_Sub17.method2929
(runtimeexception,
("va.<init>(" + (s... | 5 |
private void handleGameInput() {
while (Keyboard.next()) {
if (Keyboard.getEventKeyState()) {
if (Keyboard.getEventKey() == KeyPress.PAUSE.getKeyID()) {
GameState.pauseUnpause();
} else if (Keyboard.getEventKey() == KeyPress.FIRE.getKeyID()) {
Vector direction = this.getMousePositionInGame(... | 8 |
public void insertPath(Tree<FileNode> t, QueueList<String> filePathQueue) throws InvalidOperationException{
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Implement this method. Hint: You will need to use
// recursion, at each step dequeuing the next path and then
// searching to see if the directory ... | 5 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... | 7 |
public void BasicSpaceReasoning(int changeX, int changeY){
//功能:
//找到当前激活强度最高和次高的节点,然后将激活强度最高的节点的位置属性值根据次高节点的位置属性值进行修改
//找到激活强度最高和次高的节点的激活强度
int low;
int high;
//先找high
int imagespacesize=imagespace.size();
high=imagespace.get(0).ActivatedLevel;
low=imagespace.get(0).ActivatedLevel;
for(int i=0;i... | 9 |
public boolean similar(Object other) {
if (!(other instanceof JSONArray)) {
return false;
}
int len = this.length();
if (len != ((JSONArray)other).length()) {
return false;
}
for (int i = 0; i < len; i += 1) {
Object valueThis = this.ge... | 8 |
public boolean shipHitAsteroid() {
for (MoveableObject asteroid : asteroids) {
if (asteroid.contains(ship.position)) {
return true;
}
}
return false;
} | 2 |
public Symbol insert(String name) throws RedeclarationError
{
if (table.containsKey(name))
{
throw new RedeclarationError(new Symbol(name));
}
Symbol symbol = new Symbol(name);
table.put(name, symbol);
return symbol;
} | 1 |
public int[][] makeMove(Player player, Position startPos, Position destPos)
throws PlayerNotActiveException, IllegalPieceMovementException,
GameNotRunningException {
if (state != RUNNING) {
throw new GameNotRunningException();
}
if (player != activePlayer) {... | 8 |
public String getDescription() {
return description;
} | 0 |
public void setSoundPaths(ArrayList<String> soundPaths) {
SoundPaths = soundPaths;
} | 0 |
public static ArrayList<QuizCreatedRecord> getCreatedQuizByUserID(int userID) {
ArrayList<QuizCreatedRecord> records = new ArrayList<QuizCreatedRecord>();
String statement = new String("SELECT * FROM " + DBTable + " WHERE userid = ?");
PreparedStatement stmt;
try {
stmt = DBConnection.con.prepareStatement(st... | 2 |
public AnnotatedWithType( Class<? extends Annotation> annotationType )
{
this.annotationType = annotationType;
} | 1 |
public Production[] revealObjectProductions(Object object) {
Production[] p = (Production[]) objectToProduction.get(object);
if (p == null || p.length == 0) {
// There are no productions!
JOptionPane.showMessageDialog(convertPane,
"There are no productions for that object!");
return null;
}
if (al... | 3 |
public NumericViewer(Setting s) throws Exception {
super(s);
if (s.getType().isInteger()) {
int val = s.getValue().getInt();
int min = Integer.MIN_VALUE;
int max = Integer.MAX_VALUE;
if (s.getMax() != null) {
max = s.getMax().getInt();
}
if (s.getMin() != null) {
min = s.getMin().getInt();... | 5 |
private void expression(){
simple();
while( is(TK.EQ) || is(TK.LT) || is(TK.GT) ||
is(TK.NE) || is(TK.LE) || is(TK.GE)) {
if( is(TK.EQ) ) gcprint("==");
else if( is(TK.NE) ) gcprint("!=");
else gcprint(tok.string);
scan();
simple... | 8 |
private Set<String> getLockingPids(String mountpoint) {
List<String> lines = new ArrayList<>();
ProcessBuilder task = new ProcessBuilder(new String[] { "lsof", "-F", "p", "+D", mountpoint });
task.redirectErrorStream(true); // Channel errors to stdOut.
task.redirectInput(Redirect.INHERIT);
try {
Proc... | 7 |
public IntDataType getTimeInterval() {
return timeInterval;
} | 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.