text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setEspTitle(String title) {
this.espTitle.add(title);
} | 0 |
private void painaAlas(int paikka) {
int pieninLapsi;
//Käydään läpi niin kauan kun ei olla puun lehtitasolla
while (!onkoLehti(paikka)) {
//Vasemmalla on aina pienempi lapsi
pieninLapsi = vasenLapsi(paikka);
//
if ((pieninLapsi < koko) && (Taulu[pieninLap... | 4 |
@FXML
public void updateQ(ActionEvent evt)
{
try
{
String q = qEd.getText();
String a = aEd.getText();
String o1 = o1Ed.getText();
String o2 = o2Ed.getText();
String o3 = o3Ed.getText();
String o4 = o4Ed.getText();
... | 7 |
public void addInterface( Class<?> serviceInterface )
{
final RemoteInterface remoteInterface = serviceInterface.getAnnotation( RemoteInterface.class );
final int interfaceId = remoteInterface.id();
entries = ensureIndex( entries, interfaceId );
final int methodMax = getMaxRemoteMe... | 4 |
public Game createGame() {
Game newGame = gameGenerator.generate();
addGame(newGame);
return newGame;
} | 0 |
public static String toHankakuCase(String str)
{
int f = str.length();
char[] chars = {0xFF9E, 0xFF9F};
StringBuilder buffer = new StringBuilder();
for(int i=0;i<f;i++)
{
char c = str.charAt(i);
if(Z2H.containsKey(c)){
buffer.append(Z2H.get(c));
} else if(0x30AB <= c && c <= 0x30C9){
buffe... | 9 |
public void visitTree(final Tree tree) {
if (to instanceof Stmt) {
((Stmt) to).setParent(tree);
// The most common statement replacement is the last statement.
// so search from the end of the statement list.
final ListIterator iter = tree.stmts
.listIterator(tree.stmts.size());
while (iter.hasP... | 3 |
@Test
public void testGetAllAvailableCaptures() {
System.out.println("getAllAvailableCaptures");
Board board = new Board(8, 12);
RuleManager instance = new RuleManager();
SetMultimap<Position, Position> expResult = HashMultimap.create();
SetMultimap<Position, Position> result... | 2 |
public static ArrayList<String> parseStringToArray(String txt, String sep, int mode) {
String text = "";
txt = txt==null?"":txt;
if(mode==1) {
text = txt.toUpperCase();
}
else {
text = txt;
}
ArrayList<String> out = new A... | 9 |
public Movie(final String dataLine) {
final int startIndexYear = dataLine.indexOf('(') + 1;
final int endIndexYear = Math.min(dataLine.indexOf(')', startIndexYear), startIndexYear + 4);
final int startIndexActors = dataLine.indexOf('/');
this.title = dataLine.substring(0, startIndexYear ... | 3 |
public void addGetMethod(Field field, Method method) {
if(field == null) {
throw new IllegalArgumentException("Field cannot be null");
}
FieldStoreItem item = store.get(FieldStoreItem.createKey(field));
if(item != null) {
item.setGetMethod(method);
} else ... | 2 |
@Override
protected Void doInBackground() throws Exception {
try {
controlUnit.activate();
}
catch (NullPointerException e) {
JOptionPane.showMessageDialog(null, "Assembly program logic error! Please ensure program logic is sound.");
}
catch (ClassCastException e) {
JOptionPane.showMessage... | 2 |
public void Extract(Object oo) throws IOException {
//ID
if(oo instanceof ClientHandeler){
ClientHandeler client = (ClientHandeler)oo;
System.out.println(client.id + " Just Connected");
this.clients.add(client);
}
//IMAGEM
else if(oo instanceof ImageDto){
ImageDto image = (ImageDto)oo;
/... | 4 |
private void actionAdd(HttpServletRequest request, RequestData rd, Class clazz){
try{
Object obj;
obj = helper.addElement(clazz, request.getParameterMap());
if (obj == null) request.setAttribute("error", "Не удалось добавить объект");
}
catch (RuntimeExcep... | 2 |
private boolean r_other_endings() {
int among_var;
int v_1;
int v_2;
int v_3;
// (, line 141
// setlimit, line 142
v_1 = limit - cursor;
// tomark, line 142
if (cursor < I_... | 6 |
public String whoHasLargestArmy() {
// The current owner of the largest army keeps the largest army
// in the event of a tie
String defendingOwner = this.largestArmyOwner;
int defendingOwnerSize = this.largestArmySize;
String updatedLargestArmyPlayer = null;
... | 5 |
public void totalRun(HashSet<Long> completedUsers,
TreeMap<Long, Long> parent, TreeMap<Long, Integer> local,
TreeMap<Long, Integer> total) throws InterruptedException {
for (Entry<Long, Integer> e : total.entrySet()) {
if (!tr.containsKey(e.getKey()))
tr.put(e.getKey(), new UserNode());
UserNode... | 3 |
static int getCantidad(char[][] matG, char[][] matP){
int cant = 0;
for (int i = 0; i < matG.length; i++)
for (int j = 0; j < matG.length; j++) {
boolean ws = true;
for (int k = 0; k < matP.length && ws; k++)
for (int h = 0; h < matP.length && ws; h++)
ws = i+k<matG.length && j+h < matG.lengt... | 9 |
public static void execute(final Executable[] p_executables, final int p_threadCount) {
final ExecutorService executorService;
final Future<?>[] futures;
Contract.checkNotEmpty(p_executables, "no executables given");
Contract.check(p_threadCount > 0, "invalid thread count given");
executorService = Executor... | 5 |
private boolean isLegit(int col, int row, int currentPlayer)
{
return checkHorizontallyLeft2Right(col, row, currentPlayer) ||
checkHorizontallyRight2Left(col, row, currentPlayer) ||
checkVerticallyTop2Bottom(col, row, currentPlayer) ||
checkVerticallyBottom2Top(col, row, currentPlayer) ||
... | 7 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
/* Muestra los datos de las ventas realizadas filtradas segun el rut del cliente que realizó la compra,
* los datos son almacenados en un TableModel y mostrados en la tabla 2 de la clase administrado... | 4 |
@Override
public boolean move(int row, int col) {
//Vertical
if (this.col == col && this.row != row) {
this.row = row;
return true;
//Horizontal
} else if (this.row == row && this.col != col) {
this.col = col;
return true;
} else if (Math.abs(this.row - row) == Math.abs(this.col - col)) {
t... | 5 |
private JSONWriter append(String s) throws JSONException {
if (s == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write(',');
... | 7 |
public ArrayList<String> getOfflineUsers(String userItself) {
System.out.println("getOfflineUsers");
ArrayList<String> offlineUsers = new ArrayList();
File file = new File(userFilePath);
if (file.exists()) {
System.out.println("file exists");
try {
... | 4 |
@SuppressWarnings("unchecked")
@Override
public <T> T getRequiredService(Class<T> serviceType) throws Exception {
return (T) this.getRequiredService2(serviceType);
} | 0 |
private List<Hex> getRandomChits(List<Hex> defaultHexes) {
ArrayList<Hex> randomChits = new ArrayList<Hex>(defaultHexes);
List<Integer> randomValues = ModelDefaults.getDefaultNumbers();
randomizeList(randomValues);
int chitIndex = 0;
for(Hex hex : randomChits) {
if(hex.getResourceType() != null) {
hex.... | 2 |
@Override
public Boolean isPolinomeRepresentationValid(String input) {
if(input.isEmpty()) return false;
String[] allow = {"-", "+", "x", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
String aux;
int error_detector = 0;
for (int i = 0; i < input.length(); i++) {
... | 5 |
@Override
public void commitTransaction() throws SQLException {
try {
this.connection.commit();
} catch (SQLException e) {
try {
this.connection.rollback();
} catch (SQLException e2) {
throw new DBException("error rolling back tra... | 3 |
public HbaseConfModel getHbaseConfModel() {
HbaseConfModel hbaseConfModel = new HbaseConfModel();
JsonNode node = rootNode.get("HBase");
hbaseConfModel.setExecute(node.get("execute").getBooleanValue());
// resource
JsonNode resouceNode = node.get("resource");
List<String> resouceArray = new ArrayList<Str... | 1 |
public void setPosition(Point position) {
this.exactPostitionX = position.x;
this.exactPostitionY = position.y;
} | 0 |
public StructuredBlock getNextBlock(StructuredBlock subBlock) {
for (int i = 0; i < caseBlocks.length - 1; i++) {
if (subBlock == caseBlocks[i]) {
return caseBlocks[i + 1];
}
}
return getNextBlock();
} | 2 |
public static MarioData load()
{
MarioData marioData = null;
ObjectInputStream savedGame = null;
File a;
a = new File(System.getProperty("user.home") + "\\.Awesome Mario Remake\\MarioData.save");
try
{
if (!a.exists())
{
a.crea... | 4 |
public int[][] spawnCaves(int[][] currentBlockArray, int caves, int minX, int maxX, int minZ, int maxZ) {
ArrayList maxCaveSpots = new ArrayList();
for(int i = 0; i < caves*3; i++) {
int iMax = getMaxZCaveSpot();
int[] caveSpot = null;
if(iMax > -1) {
... | 6 |
private GSprite getSpriteForState(ButtonState buttonState)
throws IllegalArgumentException {
// Make sure the state is non-null.
if (buttonState == null) {
// The state is null.
throw new IllegalArgumentException("state == null");
}
// First, see what we've got.
GSprite i = sprites.get(buttonState);... | 5 |
public GUI(World w) {
hexgrid = new HexGrid(this);
hexgrid.createAndShowGUI();
} | 0 |
public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
String line = value.toString();
String[] segment = line.split("\t");// 原始数据为(实体编号+实体属性向量)
// 读取实体属性向量
char[] entityFeature = segment[1].toCharArray();
if (entityFeature.length != EntityDriver.DIMENSION) {
... | 9 |
private RegistrationNumber(char letterIdentifier, int numberIdentifier, String stringRepresentation){
Random randomLetterIdentifier = new Random();
this.letterIdentifier=(char)(randomLetterIdentifier.nextInt(26) + 'a');
if (Character.isDigit(letterIdentifier))
throw new IllegalArgumentException("That is not a... | 2 |
@Override
public void addTextBack() {
Element textBack = text.getOwnerDocument().createElement("path");
String d = "M";
for (Coordinate c : geometry.getCoordinates()) {
if(d.length()>1){
d=d+" L";
}
d = d + " " + c.x + "," + c.y;
}
textBack.setAttribute("d", d);
textBack.setAttribute("style", ... | 2 |
@SuppressWarnings("unchecked")
public static final byte[] encode(Object o) throws BencodingException
{
if(o instanceof HashMap)
return encodeDictionary((HashMap)o);
else if(o instanceof ArrayList)
return encodeList((ArrayList)o);
else if(o instanceof Integer)
... | 4 |
public int getManagerFirewallId() {
return managerFirewallId;
} | 0 |
public boolean isIn(String key, String value) {
String ligne;
String usr;
String psw;
try {
while ((ligne = _br.readLine()) != null) {
int a = 0;
while (ligne.charAt(a) != '@') {
a++;
}
usr =... | 5 |
@Override
public void mouseReleased(MouseEvent e) { // Called after a button is released
mx = e.getX();
my = e.getY();
if(!main.hasAbilitySelected()) {
if(e.getButton() == MouseEvent.BUTTON1) { // Left button released
LinkedList<ClickableObject> selection = new LinkedList<ClickableObject>();
int x = ... | 5 |
public Boolean executeStep(AbstractBuild build,
SkytapGlobalVariables globalVars) {
JenkinsLogger.defaultLogMessage("----------------------------------------");
JenkinsLogger.defaultLogMessage("Creating Template from Environment");
JenkinsLogger.defaultLogMessage("----------------------------------------");
... | 9 |
public void run() {
Scanner scn = new Scanner(System.in);
int testCount = scn.nextInt();
// Loop through all test cases.
for (int testItem = 1; testItem <= testCount; testItem++) {
int numVertices = scn.nextInt();
int numEdges = scn.nextInt();
// create adjacency Matrix
adjacen... | 7 |
public String getReplicaAddress() {
if (slaveAddresses.isEmpty()) {
return masterAddress;
} else {
// randomly give a slaveAdress back
int size = slaveAddresses.size();
int item = new Random().nextInt(size);
int i = 0;
for (String obj : slaveAddresses) {
if (i == item) {
return obj;
... | 3 |
protected boolean acceptable(ContentHeaderMap contentHeaderMap) {
if (allowedExtensions == null && allowedTypes == null)
return true;
if (allowedTypesSet != null && contentHeaderMap.getContentType() != null) {
if (allowedTypesSet.contains(contentHeaderMap.getContentType())) {
return true;
} else {
... | 9 |
public boolean addCoffer(OfflinePlayer player,Chest chest){
if(player==null || chest==null)
return false;
if(isStore(chest))
return false;
if(isCoffer(chest))
return false;
coffers.put(chest, player);
saveCoffers();
return true;
} | 4 |
@Test
public void testProxy() {
Person person = PersonImpl.personWithNameAndAge("test", 100);
Person proxyPerson = ObjectProxy.newInstance(person, new ObjectProxy.Interceptor() {
@Override
public Object around(Object result) {
System.out.println("Modifying 100... | 0 |
private void afficherFenMoreInfo(Match m) throws IOException, SQLException {
//Affichage joueurs
if (m != null) {
PlayerDao pdao = DaoFactory.getPlayerDao();
Player p1 = pdao.selectPlayer(m.getIdP1());
Player p2 = pdao.selectPlayer(m.getIdP2());
moreInfo_l... | 7 |
public void insertWord(int _internalId, int _dom, String _lemma, String _link, String _word, String _partOfSpeech, List<String> _properties,List<String> _propertiesValues, int _sentenceId){
try{
String generatedStatement = "INSERT INTO words (internalId, domid, lemma, link, word, partOfSpeech";
... | 5 |
public void detectCollision() {
for(int i=0; i<EntityManager.getEntityList().size(); ++i) {
if(EntityManager.getEntityList().get(i) instanceof GameBaseEntity) {
if(this.getGlobalBounds().intersection(EntityManager.getEntityList().get(i).getGlobalBounds()) != null) {
... | 3 |
private String createHashBase()
throws IOException {
if( !this.resource.isOpen() )
throw new IOException( "Cannot create an ETag from an un-opened resource!" );
StringBuffer buffer = new StringBuffer();
// Add the request path
// (better than the inode number, I think)
if( this.relativeURI != null ) {
... | 5 |
@Override
public void close() throws SQLException {
if(resultSet != null) {
resultSet.close();
resultSet = null;
}
if(statement != null) {
statement.close();
statement = null;
}
if(conn != null) {
conn.close();
conn = null;
}
} | 3 |
public void setBlogLabel(String blogLabel) {
this.blogLabel = blogLabel;
} | 0 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public YamlDataStorageImplementation(Decapitation plugin) throws IOException {
this.plugin = plugin;
this.configFile = new File(plugin.getDataFolder(), "bounties.yml");
if (!(configFile.exists() && !configFile.isDirectory())) {
configFile.createNewFile();
}
this.conf... | 7 |
public void setline(String line) {
String prev = this.line;
this.line = line;
if(point > line.length())
point = line.length();
if(!prev.equals(line))
changed();
} | 2 |
public static Opcode getByName(String name, Map<String, Integer> newNBOpcodes) {
Opcode opcode = BY_NAME.get(name);
if(opcode == null && newNBOpcodes != null) {
Integer number = newNBOpcodes.get(name);
if(number != null) {
opcode = new Opcode(name, number<<4, Opco... | 3 |
public void windowActivated(WindowEvent e) {
System.out.println("Die Anwendung wurde aktiviert...");
} | 0 |
public void invokeBusinessLogic(
org.apache.axis2.context.MessageContext msgContext,
org.apache.axis2.context.MessageContext newMsgContext)
throws org.apache.axis2.AxisFault {
try {
// get the implementation class for the Web Service
Object obj = getTheImplementationObject(msgContext);
WSManag... | 8 |
public int lengthOfLastWord(String s) {
if (s.length() == 0) {
return 0;
}
int length = 0;
boolean wordStart = false;
int i = s.length() - 1;
while (i >= 0) {
if (s.charAt(i) != ' ' && wordStart == false) {
length++;
wordStart = true;
} else if (wordStart == true && s.charAt(i) != ' ') {
... | 8 |
public static void main(String[] args)
{
Map<String, Integer> map = new HashMap<String, Integer>();
for (String element : args)
{
map.put(element, (null == map.get(element) ? 1
: map.get(element) + 1));
}
System.out.println(map);
} | 2 |
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
if (scheme_ != null) {
sb.append(scheme_);
sb.append(':');
}
if (location_ != null) {
sb.append("//");
sb.append(loc... | 6 |
public static String genServerStatus(String[] data) {
if ((data[0] == null) && (data[1] == null) && (data[2] == null)) return "Server is offline";
if ((data[1] != null) && (data[2] != null)) {
if (data[1].equals(data[2])) return "Server is full (Players: " + data[1] + " of " + data[2] + ")";... | 6 |
int decodevs(float[] a, int index, Buffer b, int step, int addmul) {
int entry = decode(b);
if (entry == -1) {
return (-1);
}
switch (addmul) {
case -1:
for (int i = 0, o = 0; i < dim; i++, o += step) {
a[index + o] = valuelist[... | 7 |
@Override
public boolean mutate(Mutation.Type type) {
switch (type) {
case COPY:
case COPY_TREE:
case CREATE_PARENT:
case REMOVE:
return false;
case SWAP:
return Mutation.swap2(rules);
case REPLICATE:
if (rules.isEmpty()) {
return false;
}
Rule replicate = Utils.randomlySelect(rules);
... | 7 |
public FSAConfigurationIcon(Configuration configuration) {
super(configuration);
} | 0 |
public String toString(){
String str = element.toString();
if(program != null)
str += ";" + program.toString();
return str;
} | 1 |
void TokenLexicalActions(Token matchedToken)
{
switch(jjmatchedKind)
{
case 20 :
image.append(jjstrLiteralImages[20]);
lengthOfMatch = jjstrLiteralImages[20].length();
nested.push(DEFAULT);
SwitchTo(nested.peek());
break;
case 21 :
image.append(jjstrLiteralImag... | 3 |
public String getValue() {
return _value;
} | 0 |
public BookLanguage getBookLanguage(long id) {
BookLanguage lng = null;
Connection con = null;
Statement stmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATA... | 5 |
final public void DoStatement() throws ParseException {
/*@bgen(jjtree) WhileStatement */
BSHWhileStatement jjtn000 = new BSHWhileStatement(JJTWHILESTATEMENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(DO);
Statement();
jj_... | 8 |
public void save(final FilterDTO filter)
throws DBException
{
class IdFiller extends PreparedStatementHandler
{
public IdFiller()
{
super(FilterDAO.this.mgr, ID_BYNAME_SQL);
}
@Override
protected void handleResults(ResultSet rs)
throws SQLException, DBException
{
// id or empty ... | 7 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
private void update_estimated_initial_distribution( int j, double[] bowl ) {
// initialization
if( 0 == j ) {
assign_belief_of_initial_distribution(smoothed_distribution_count);
}
// Calculate the smoothed count
if ( 0 == j ) {
for ( int i = 0; i < pref.le... | 5 |
private int getPort() {
int port = uri.getPort();
return port == -1 ? WebSocket.DEFAULT_PORT : port;
} | 1 |
public void deleteNonAxisFields ( Field checkVeld , String direction ) {
//System.out.println("Deleten niet-as velden...");
if (direction.equals("horizontal")) {
for (int i = 0 ; i < remainingFields.size() ; i++) {
Field v = remainingFields.get(i);
if (checkVeld.getX() != v.getX()) {
preferableField... | 5 |
@Override
public ArrayList<Integer[]> selection(ArrayList<Integer[]> population, int size) {
if (size > population.size()) {
return population;
}
ArrayList<Integer[]> parents = new ArrayList<>();
Collections.shuffle(population);
double[] grades = gradeEveryone(po... | 5 |
public void move(){
if(x < 0)
x = 600;
x -= 1;
} | 1 |
@Override
public int hashCode() {
//autogenerated by netbeans for me
//this is a really wierd hash
int hash = 7;
hash = 17 * hash + (this.value != null ? this.value.hashCode() : 0);
hash = 17 * hash + (this.name != null ? this.name.hashCode() : 0);
hash = 17 * hash + (this.readonly ? 1 : 0);
return hash;... | 3 |
public boolean connection(String userName,String password)
{
boolean response=false;
for(Member m : memberBean.getMembers() )
{
if(m.getUsername().equals(userName)&&m.getPassword().equals(password))
{
currentMember=m;
response=true;
}
}
return response;
} | 3 |
public synchronized void actualiza(long tiempoTranscurrido) {
if (cuadros.size() > 1) {
tiempoDeAnimacion += tiempoTranscurrido;
if (tiempoDeAnimacion >= duracionTotal) {
tiempoDeAnimacion = tiempoDeAnimacion % duracionTotal;
indiceCuadroActual = 0;
... | 3 |
@GET
@Path("/feeds/{repoName}.atom")
@Produces(MediaType.APPLICATION_ATOM_XML)
public String getRepositoryFeed(
@PathParam("repoName") String repoName,
@Context HttpServletRequest request) {
if (StringUtils.isEmpty(repoName)) {
throw new WebApplicationExc... | 4 |
public ArrayList<Product> Build(){
FileReader fr= null;
try{
fr = new FileReader("C:\\Users\\Canary\\Documents\\NetBeansProjects\\WebApplication1\\src\\java\\Files\\ListaProductos.txt");
BufferedReader bf = new BufferedReader(fr);
String sCadena;
String ve... | 7 |
@Override
public List<Scroll> selectPlays(GameState state) {
List<Scroll> plays = new ArrayList<Scroll>();
List<Scroll> hand = new ArrayList<Scroll>(state.getHand());
Collections.sort(hand, new Comparator<Scroll>() {
@Override
public int compare(Scroll lhs, Scroll rhs) {
//This fails for costs at th... | 4 |
boolean testLookAhead(TokenID token) {
Token afterNextSymbol = null;
try {
afterNextSymbol = scanner.yylex();
if (afterNextSymbol != null) {
scanner.yypushback(afterNextSymbol.text().length());
}
} catch (java.lang.Error e) {
// will be thrown when next symbol is EOF
// in this case null is a ... | 6 |
private boolean isValidPosition(Position newPos, int width, int height) {
return newPos.xCoordinate >= 0 && newPos.yCoordinate >= 0 && newPos.xCoordinate < width && newPos.yCoordinate < height;
} | 3 |
@Override
public <SM, TM, SR, TR> TR execute(final MapReduce<SM, TM, SR, TR> mapReduce, SM source) {
final Collection<TM> slices = mapReduce.getMapper().map(source);
TR result = null;
if (slices != null && !slices.isEmpty()) {
final List<Future<SR>> futures = Lists.newArrayList();
final CountDownLatch cou... | 8 |
protected void requestPlayerInput(Game game)
{
ElapsedCpuTimer ect = new ElapsedCpuTimer(CompetitionParameters.TIMER_TYPE);
ect.setMaxTimeMillis(CompetitionParameters.ACTION_TIME);
Types.ACTIONS action;
if (game.no_players > 1) {
action = this.player.act(game.getObservat... | 4 |
private void readEvalPrint() {
buffer = new BufferedReader(new InputStreamReader(System.in));
String arguments[] = null;
while (true) {
System.err.print("> ");
try {
arguments = inputParse(buffer.readLine());
/** invokes the name corresponding to command requested **/
if (arguments[0].equals(... | 8 |
public String lookup(int value, String type) {
String result = null;
Iterator it;
System.out.println("TYPE:" + type);
// this is where we look up rules defined in our two dimensional matrix,
// sorted by contextual type (i.e., temperature)
switch (type) {
... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RID other = (RID) obj;
if (id != other.id)
return false;
return true;
} | 4 |
public RODashboardData() {
lastPacketTime = -1;
lastUptime = -1;
robotState = -1;
lastFirmwareVer = -1;
validRxPackets = 0;
invalidRxPackets = 0;
bundles = new ArrayList<String>();
} | 0 |
void showIndicator(Label indicator) {
clearIndicator();
hboxIndicator.getChildren().add(indicator);
} | 0 |
public Grid createGrid() {
// Random random = new Random();
// Grid gg = new Grid(30 + random.nextInt(20), 30 + random.nextInt(20), 0, 0, 3, 3);
// CellIterator iterator = gg.getCellIterator();
// for (CellIterator ci = gg.getCellIterator(); ci.next();) {
// ci.setAliveInNextGeneration(random.nextBoolean... | 0 |
public void mouseReleased(MouseEvent e) {
if (currentElement == null) return;
else if (currentElement instanceof Spring) {
Point2D.Double p= new Point2D.Double(0,0);
MyWorldView.SPACE_INVERSE_TRANSFORM.transform(e.getPoint(),p);
Spring spring = (Spring) currentElement;
... | 4 |
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void handleBlockBurn(BlockBurnEvent event) {
if (!WorldManager.getInstance().isFireSpreadAllowed()) {
if (Cuboid.getCuboid(event.getBlock().getLocation()) == null) {
event.setCancelled(true);
} else {
Cub... | 5 |
void init_validation() {
try {
/* Run sharding (preprocessing) if the files do not exist yet */
sharder_validation = IO.createSharder(training + "e", 1);
if (!new File(ChiFilenames.getFilenameIntervals(training + "e", nShards)).exists() ||
!new File(training + "e.matrixinfo").exists()) {
... | 3 |
public void setPlayerTwoWin()
{
currentState = States.PlayerTwoWin;
} | 0 |
protected int diff_commonOverlap(String text1, String text2) {
// Cache the text lengths to prevent multiple calls.
int text1_length = text1.length();
int text2_length = text2.length();
// Eliminate the null case.
if (text1_length == 0 || text2_length == 0) {
return 0;
}
// Truncate th... | 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.