text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Object nextEntity(char ampersand) throws JSONException {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (Character.isLetterOrDigit(c) || c == '#') {
sb.append(Character.toLowerCase(c));
} else if (c == ';') {
... | 5 |
public void prevValue() {
value--;
if (value < 0) {
value = values.length -1;
}
} | 1 |
public Extracciones(String ruta)
{
this.BDextracciones = new BD(ruta);
this.idProyecto = new ArrayList<Integer>();
this.proyectos = new ArrayList<Extraccion>();
int[] totalExtracciones;
File bd = new File(ruta);
if(bd.length() > 2000)
{
tot... | 2 |
protected Map<String, Object> parseProperties( DataStructure parent ) throws IOException {
// Properties format:
//
// properties ::= '(' (key '=' value)* ')'
//
// the first ( has already been read by now
Map<String, Object> result = new LinkedHashMap<String, Obje... | 5 |
@Override
public void anyActionPerformed(AnyActionEvent ev) {
try {
if (ev.isAnyOf(referToOthers)) {
referToOtherConnectors();
} else if (ev.isAnyOf(searchFile)) {
chooseClasspath();
} else if (ev.isAnyOf(searchDriver)) {
ch... | 7 |
public static synchronized String createGame(String rules, User user) {
for (GameRoom room : briscaGames) {
// if(room==null)continue;
if (!room.isBeenPlayed()) {
String roomname = ((rules.split(GameSocketServer.ROOMNAMEKEY)[1])
.split(",")[0]);
roomname = ManagerSocketServer.sanitizeWord(roomname... | 2 |
private void drawNorth(Terrain[][] currentBoard,
Entities[][] currentObjects, Graphics g) {
Location playerDir = boardState.getPlayerCoords();
for (int i = 0; i < currentBoard.length; i++) {
for (int j = 0; j < currentBoard[0].length; j++) {
//Isometric formula for x, i *0.5 * Width - j * 0.5 * Width, inc... | 6 |
@Override
public List<LogProfile> getLogFileNames() throws RemoteException {
List<LogProfile> logs=new LinkedList<LogProfile>();
try {
Session session=this.conn.openSession();
String cmd="ls -l "+this.home+"/logs";
session.execCommand(cmd);
InputStream stdout=new StreamGobbler(session.getStdout());
... | 4 |
protected RawModel generateTerrain(Loader loader, String heightMap)
{
if (heightMap == null) return null;
BufferedImage image = null;
try {
image = ImageIO.read(new File("res/"+heightMap+".png"));
} catch (IOException e) {
e.printStackTrace();
}
int VERTEX_COUNT = image.getHeight();
int count... | 7 |
public void imprimir() {
for (int j = 0; j < ListToken.size(); j++) {//ahora imprimiremos las personas de nuestro ArrayList
System.out.println("============================================================");
Nodo persona = (Nodo) ListToken.get(j);
System.out.println("Lexico: ... | 1 |
public int[] getColumnInt(int colNum)
{
int nRows = 0;
int i = 0;
int[] ret;
if(colNum > 0){
try {
//get amount of rows
while(result.next()){
nRows ++;
}
//Check if there is more then 0 rows
if(nRows == 0)
return null;
ret = new int[nRows]; //create the Intarray with the no... | 5 |
public Args parse(String [] arguments) throws InvalidParameterException{
Args args = new Args();
if(arguments == null || arguments.length <= 0){
throw new InvalidParameterException("arguments is empty");
}
if(arguments.length < 2){
throw new InvalidParameterExcept... | 9 |
private static void displayMutualInformation (double[][] density, int numGridLines) {
double mutualInfo = 0.0;
// Calculate marginal probability in x1 direction
ArrayList<Double> x1MarginalProb = new ArrayList<Double> ();
for (int x1Ind = 0; x1Ind < numGridLines; x1Ind++) {
Double margProb = 0.0;
... | 7 |
private boolean tryInsertIntoChain(final int chainNumber, long key) {
int chainDisplacement = primaryIndex.getChainDisplacement(chainNumber);
//try to store record in main bucket
int pageToStore;
final int keySignature;
if (chainDisplacement > 253) {
return storeRecordInMainBucket(chainNumbe... | 9 |
@Test
public void testCodageNRZ() {
float min = 0;
float max = 4;
src = new SourceFixe("1");
ena = new EmetteurNumeriqueAnalogique(min, max, 4, TypeCodage.NRZ);
src.connecter(ena);
try {
src.emettre();
ena.emettre();
} catch (InformationNonConforme e) {
}
int i = 0;
while(i < ... | 6 |
public static int maxSum(int a[], int start, int end) {
int maxSum = 0;
// Trivial cases
if (start == end) {
return a[start];
} else if (start > end) {
return 0;
} else if (end - start == 1) {
return a[start] > a[end] ? a[start] : a[end];
} else if (start < 0) {
return 0;
} else if (end >= a.... | 8 |
public void inv_mdct(float[] in, float[] out, int block_type)
{
float[] win_bt;
int i;
float tmpf_0, tmpf_1, tmpf_2, tmpf_3, tmpf_4, tmpf_5, tmpf_6, tmpf_7, tmpf_8, tmpf_9;
float tmpf_10, tmpf_11, tmpf_12, tmpf_13, tmpf_14, tmpf_15, tmpf_16, tmpf_17;
tmpf_0 = tmpf_1 = tmpf_2 = tmpf_3 = tmpf_4 = tmpf... | 2 |
@Override
public void setState(IState state) {
if (this.state != null && this.state.equals("Rolling")){
this.state.getStatus();
this.state = state;
}
else
this.state = state;
} | 2 |
public static void duped(int[] array) {
Set<Integer> set = new HashSet<Integer>();
boolean noDuplicates = true;
for (int i = 0; i < array.length; i++)
if (!set.add(array[i])) {
System.out.println("duplicate");
noDuplicates = false;
break;
}
if (noDuplicates)
System.out.println("no duplicate... | 3 |
void test1()
{
try
{
Reader in = new StringReader(
"<p><UL><LI> left terms and list operators (leftward)</LI>\n"+
"<LI> left -></LI>\n"+
"<LI> nonassoc ++ --</LI>\n"+
"<LI> right **</LI>\n"+
"<LI> right ! ~ \\ and unary + and -</LI>\n"+
"<LI> left =~ !~ </LI>\n"+
"<... | 7 |
private Dimension layoutSize(Container target, boolean preferred)
{
synchronized (target.getTreeLock())
{
// Each row must fit with the width allocated to the containter.
// When the container width = 0, the preferred width of the container
// has not yet been calculated so lets ask for the maximum.
int ... | 7 |
public void setStepToVictim(Scanner scanner) {
this.stepToVictim = Input.getPositiveNumber(scanner, "Enter step of Victim");
} | 0 |
@Override
public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
if (args.length == 0) {
sender.sendMessage(ChatColor.BLUE
+ "-----------------------------------------------------");
sender.sendMessage(ChatColor.GOLD + "Developed by: "
+ ChatColor.GRAY +... | 6 |
public void tick(Map currentMap){
Random random = new Random();
double headM = (random.nextDouble()-.5)/10;
if(headM > .02 || headM < -.02){
heading += headM;
}
vel += (random.nextDouble()-.4)/100;
move(currentMap);
vel=vel%8;
stats.tick(0);
} | 2 |
private HashMap<Integer, Double> getSubFitness(int bottom, int top) {
HashMap<Integer, Double> result = new HashMap<Integer, Double>();
for(int i = 0; bottom < top; i++){
result.put(i, fitness.get(bottom));
bottom++;
}
return result;
} | 1 |
public boolean casesEqual(ContentCase... cases) {
ContentCase c0 = cases[0];
for (ContentCase c : cases) {
if (c.isEqual(c0)) {
c0 = c;
} else
return false;
}
return true;
} | 2 |
@Test
public void throwInvalidBudgetTypeExceptionWhenBudgetTypeIsNotEqualToAnnualOrMonthlyBudget() throws Exception {
try {
budgetFactory.requestBudgetByType("TEST");
fail("Budget Type is not valid.");
} catch (InvalidBudgetTypeException e) {
assertEquals("Invali... | 1 |
private ItemStack[] importEnderchest(CompoundTag tag)
{
ItemStack[] inv = new ItemStack[27];
for (Tag t : ((ListTag) tag.getValue().get("EnderItems")).getValue())
{
int slot = ((ByteTag) ((CompoundTag) t).getValue().get("Slot")).getValue();
if (slot < 36)
{
inv[slot] = CraftItemStack.asBukkitCopy... | 2 |
public static final int getBossRate(byte village) {
switch (village) {
case 0:
case 1:
case 2:
case 3:
return 10;
case 4:
return 20;
case 5:
return 12;
case 6:
retu... | 7 |
public ISound createSound(String path) {
if(getExtension(path).equals("wav")) {
return new SoundWAV(path);
}
else if (getExtension(path).equals("mid")){
return new SoundMidi(path);
}
else {
return null;
}
} | 2 |
public int getN() {
return n;
} | 0 |
public static String create(mxICell cell)
{
String result = "";
if (cell != null)
{
mxICell parent = cell.getParent();
while (parent != null)
{
int index = parent.getIndex(cell);
result = index + mxCellPath.PATH_SEPARATOR + result;
cell = parent;
parent = cell.getParent();
}
}
... | 3 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RoverPosition that = (RoverPosition) o;
return !(xPosition != null ? !xPosition.equals(that.xPosition) : that.xPosition != null) && !(yPosition != null... | 6 |
public Boolean equals(Gaussian that) {
return this.a == that.a && this.b == that.b;
} | 1 |
public void run()
{
try {
Socket socket = new Socket("localhost", 5100);
DataOutputStream out = new DataOutputStream(socket.getOutputStream());
DataInputStream in = new DataInputStream(socket.getInputStream());
String cmd = in.readUTF();
String name = cmd.split(":")[1];
System.out.println(cmd);
... | 7 |
private static boolean isLocalMax(double[] frequencyData, int i) {
if (i - 1 < 0 || i + 1 >= frequencyData.length)
return false;
double left = frequencyData[i - 1];
double mid = frequencyData[i];
double right = frequencyData[i + 1];
if (right < mid && mid > left)
return true;
return false;
} | 4 |
public static Method getMutator(Class<?> declaringClass, String mutatorName, Class<?> argument)
{
Method res = null;
if (declaringClass != null)
{
// check this class
try
{
res = declaringClass.getDeclaredMethod(mutatorName, argument);
}
catch (NoSuchMethodException e)
{
// do nothing, ... | 5 |
@Override
public int getID() {
// TODO Auto-generated method stub
return 0;
} | 0 |
public static void closeNew() {
DIALOG.dispose();
DIALOG = null;
} | 0 |
public Point getTileCollision(Sprite sprite,
float newX, float newY)
{
float fromX = Math.min(sprite.getX(), newX);
float fromY = Math.min(sprite.getY(), newY);
float toX = Math.max(sprite.getX(), newX);
float toY = Math.max(sprite.getY(), newY);
// get the tile loca... | 5 |
public static long addAddress(Address address, long sessionID) throws SessionException {
if (sessionID <= NO_SESSION_ID) {
throw new SessionException("A valid session ID is required to add an address",
SessionException.SESSION_ID_REQUIRED);
}
Contact contact = (Co... | 3 |
public static AsciiImage getHistogram(AsciiImage img) {
HashMap<Character,Integer> freqMap = new HashMap<Character, Integer>();
String oldCharset = img.getCharset();
String newCharset;
newCharset = oldCharset;
for(int i = 0; i<=9; i++) {
if (oldCharset.indexOf(i + '0... | 9 |
public SimpleEntry<URLConnection, String> GET(String url) throws IOException {
int redirects = 0;
SimpleEntry<URLConnection, String> r;
do {
r = cookies(LLHttpClient.GET(proxy(), url, connectTimeOut, readTimeOut, headers()));
url = check(r.getKey());
redirects++;
} while (follow && u... | 8 |
public MyRecord search(String name){
Node node=root;
MyRecord result=null;
//when node isn't leaf, find the record in the node, or find the right next level node to search
while(!node.isLeaf()){
int flag=0;
for(int i=0;i<node.getKeys().size();i++){
if(node.getKeys().get(i).getName().compareTo(name)==0... | 7 |
public ArrayList<Location> getValidAdjacentLocations(Location loc)
{
ArrayList<Location> locs = new ArrayList<Location>();
int d = Location.NORTH;
for (int i = 0; i < Location.FULL_CIRCLE / Location.HALF_RIGHT; i++)
{
Location neighborLoc = loc.getAdjacentLocation(d);
... | 2 |
@Override
public void mouseClicked(MouseEvent arg0) {
//System.out.println(arg0.getSource().toString());
if (status == VideoStatus.PLAYING){
pause();
}
int videoIndex = ((MyPanel)arg0.getSource()).videoIndex;
if(videoIndex != currentVideo){
currentVideo = videoIndex;
audio = new File(audio... | 7 |
public boolean isObstacle()
{
return lookid == 1 || lookid == 3;
} | 1 |
public void renderTileEntitySignAt(TileEntitySign par1TileEntitySign, double par2, double par4, double par6, float par8)
{
Block var9 = par1TileEntitySign.getBlockType();
GL11.glPushMatrix();
float var10 = 0.6666667F;
float var12;
if (var9 == Block.signPost)
{
... | 6 |
@Override
public void setAgility(int agi) {
if (agi >= 99) {// agility will be a % chance and must be < 100
this.agility = 99;
} else {
this.agility = agi;
}
} | 1 |
@Override
public Scanner scan(Lexer lexer) {
boolean terminated = false;
loop:
while (lexer.hasNext()) {
final char ch = lexer.next();
switch (ch) {
case '\\':
if (lexer.hasNext()) {
final char chn = lexer.ne... | 7 |
public int[][] paintImages(int[][] currentBlockArray, int xMin, int xMax, int zMin, int zMax) {
BufferedImage[] images = getPaintImages("Theme1");
int h = images[0].getHeight();
int w = images[0].getWidth();
int i = 0;
level = 0;
wipZMin = zMin;
wipHeight = h;
... | 5 |
protected boolean connect(){
LCD.clear();
LCD.drawString("Bluetooth:", 0, 0);
LCD.drawString("Connect -> Enter", 0, 1);
LCD.drawString("Don't -> Esc", 0, 2);
LCD.refresh();
while(true){
if ( Button.ENTER.isDown() ){
while(Button.ENTER.isDown()){try {
Thread.sleep(1);
} catch (Int... | 9 |
public List<SemestreDTO> getAllSemestres() {
List<SemestreDTO> semestres = new ArrayList<SemestreDTO>();
String sql = "select distinct(semestre) as semestre from calendario order by semestre desc";
PreparedStatement pst = null;
ResultSet rs = null;
Connection con =null;
try {
con = EscolarConnectionFacto... | 6 |
FiguresChain(Map<String, Integer> figureQuantityMap) {
if (Objects.isNull(figureQuantityMap)) {
throw new IllegalStateException("figureQuantity map is null, however should not be");
}
this.figureQuantityMap = figureQuantityMap;
} | 1 |
@Override
public void createPartControl(Composite composite) {
composite.setLayout(new GridLayout(11, false));
Label label = new Label(composite, SWT.NONE);
label.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
label.setText("文件");
fileText = new Text(composite, SWT.BORDER | SWT.REA... | 8 |
@Override
protected void _serialize(TagNode tagNode, Writer writer) throws IOException {
serializeOpenTag(tagNode, writer, false);
List<? extends BaseToken> tagChildren = tagNode.getAllChildren();
if ( !isMinimizedTagSyntax(tagNode) ) {
Iterator<? extends BaseToken> chil... | 7 |
public void run() {
System.out.println("run method running.");
while (true) {
String userCommand = this.readInputStream();
System.out.println("user command: " + userCommand);
String[] command = commandParser(userCommand.toLowerCase().trim());
if (!command[0].equals("close")) {
if (currentCommand.equ... | 8 |
@Override
public MessageResponse logout() throws IOException {
if(currentUser != null) {
currentUser.setOnline(false);
currentUser.getSubscriptions().clear();
currentUser = null;
return new MessageResponse("Successfully logged out.");
}
return new MessageResponse("You have to login first to perform t... | 1 |
private void buildBoard() throws GOLException, IOException {
initializeBoard();
int row = 0;
Scanner scanner = new Scanner(filePath);
while (scanner.hasNextLine()) {
fillBoardWithLine(scanner.nextLine(), row);
row++;
}
scanner.close();
} | 1 |
@Test
public void shouldThrowErrorWhenFileIsNotSelected() {
//when
try {
FileParser fileParser = new FileParser(null);
fileParser.parse();
} catch (GOLException e) {
//then
String msg = "Bitte Datei auswählen.";
assertEquals(msg, e.... | 1 |
private Token getNextToken() {
Token token = tokenizer.getToken();
if ( token == null ) {
return null;
}
else if ( token.isError() ) {
throwException( "Input contains syntax error" );
}
return token;
} | 2 |
private void setPolygon(boolean getPoly, Envelope env) throws JsonParseException, JsonMappingException, IOException{
@SuppressWarnings("unchecked")
//get json file paths for given extent
List<String> paths = jsonTree.query(env);
//reset/create new polygons array or new tree
if(getPoly)polygons = new Polygon[p... | 3 |
public void addLogger(final Logger logger) {
if (logger == null) {
throw new NullPointerException();
}
loggers.add(logger);
} | 1 |
private Link maybeSwitch(Link link){
Link secondLink = linkQueue.peek();
if(link != null && secondLink != null){
if(
link instanceof BackLink &&
link.getRank() == secondLink.getRank()&&
!(secondLink instanceof ShortcutLink)){
... | 7 |
@Override
public void removeUpdate(DocumentEvent e) {
if(progress.isVisible()) {
progress.setVisible(false);
} else if(correct.isVisible()) {
correct.setVisible(false);
} else if(error.isVisible()) {
error.setVisible(false);
}
} | 3 |
private int alphabetaScore(GameState state, Color faction)
{
state = state.getCounter().score(state, false);
int playerScore = 0;
Color maxPlayer = null;
int maxScore = Integer.MIN_VALUE;
for(Player p : state.getPlayerList())
{
//determine the player's score
if(p.getFaction().equals(faction))
{... | 8 |
static void split(BufferedReader br, String fileName, int count) {
int i = 0;
String line = null;
FileWriter fw = null;
BufferedWriter bw = null;
try {
fw = new FileWriter(fileName);
bw = new BufferedWriter(fw);
while ((line = br.readLine()) != null && i < count) {
line = line.substring(1, line.l... | 4 |
public boolean isWhiteWinner(){
boolean res = false;
if(this.blackPieces == 0){
res = true;
}
return res;
} | 1 |
private boolean isValidInput(final String s) {
return s.matches("[0-9]{1,}");
} | 0 |
public String encryption(String string, boolean decrypt,
SecurityManager securityManager) {
// get the security manager instance
if (securityManager != null && reference != null) {
// get the key
byte[] key = securityManager.getDecryptionK... | 3 |
protected double [] makeDistribution(Instances neighbours, double[] distances)
throws Exception {
double total = 0, weight;
double [] distribution = new double [m_NumClasses];
// Set up a correction to the estimator
if (m_ClassType == Attribute.NOMINAL) {
for(int i = 0; i < m_NumClasses;... | 9 |
public Tree(HuntField field) {
this.field = field;
this.type = 'T';
while (true) {
myPosition = field.randomPositionGenerator();
if (myPosition == null) {
field.setItem(this, myPosition);
break;
}
}
} | 2 |
public List<Message> page(final int index) {
if (this.pageSize < 1) {
if (index != 0) throw new IllegalArgumentException("page index not available: " + index);
return this.contents;
}
final int last = ((index + 1) * this.pageSize) - 1;
ret... | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
final Location other = (Location) obj;
if (this.level != other.level && (this.level == null || !this.level.equals(other.level))) return false;
if (thi... | 8 |
@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (args.length == 1 && args[0].equalsIgnoreCase("help")) {
showHelp(sender);
return true;
}
if (args.length == 1 && args[0].equalsIgnoreCase("reload")... | 4 |
public void interpretaComando(CoreComando comando, ServidorCliente cliente) {
switch (comando) {
case DIREITA:
cliente.getPosicao().setX(cliente.getPosicao().getX() + 5);
//setStateImg("");
break;
case ESQUERDA:
cliente.getPosicao().setX(cliente.getPosicao().getX() - 5);
//setStateImg("");
break... | 3 |
private boolean jj_3R_91() {
if (jj_3R_95()) return true;
return false;
} | 1 |
private void btn_Guardar_UsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_Guardar_UsuarioActionPerformed
try {
if (txtID_Usuario.getText().compareTo("") != 0 && txtpass_usuario.getPassword().toString().compareTo("") != 0
&& txtdni_usuario.getText().co... | 9 |
@Test
@Points(value = 5)
public void checkThatGridPackingConstructorIsDoingTheRightThingInternally()
{
// ************************************************************************************
// Note: This isn't a standard test case to run in industry, but is a great test case
// for students who will encounter... | 5 |
private void addWordRec(CharNode parent, String word, int charAt, int occur) {
CharNode child = null;
char data = word.charAt(charAt);
if (parent.children == null) {
parent.children = new ArrayList<>();
} else {
for (int i = 0; i < parent.children.size(); i++) {
... | 6 |
private void convertKosarak() throws IOException {
String thisLine; // variable to read a line
BufferedReader myInput = null;
try {
// Objects to read the file
FileInputStream fin = new FileInputStream(new File(input));
myInput = new BufferedReader(new InputStreamReader(fin));
int count = 0; // to... | 5 |
private void authenticationExchange() throws IOException {
// _console.writeline("authenticationExchange");
int scheme = readCard32();
if (scheme == 0) {
String reason = readString();
throw new VNCException("connection failed: " + reason);
... | 9 |
private void jButtonCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCheckActionPerformed
this.jTabbedPane.setSelectedComponent(this.jPanelTabQueue);
for (int i = 0; i < this.model.getRowCount(); i++) {
if (this.model.isSelected(i)) {
Signature... | 2 |
public int getLEShortA() { // method438
offset += 2;
int v = ((payload[offset - 1] & 0xff) << 8) + (payload[offset - 2] - 128 & 0xff);
if (v > 32767) {
v -= 0x10000;
}
return v;
} | 1 |
private static int[] stringToIntArray(String str) throws Exception
{
int slength=str.length();
int retval[] = new int[(int) Math.ceil(slength / 4.0)];
for (int i=0; i<retval.length; i++) {
// note little-endian encoding - endianness is irrelevant as long as
... | 5 |
public boolean matchByStateAndSymbol(String state, String symbol, Symbol symbolRef) throws Exception{
if(!this.state.equals(state))
return false;
if(this.symbol != null && !this.symbol.isEmpty())
return this.symbol.equals(symbol);
return matchSymbolbySym... | 3 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
public static void main(String[] args) throws Throwable{
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
char[][][] letras=new char[][][]{
{{'A'},".-".toCharArray()},{{'B'},"-...".toCharArray()},{{'C'},"-.-.".toCharArray()},{{'D'},"-..".toCharArray()},
{{'E'},".".toCharArray()},{{'F'... | 8 |
public void setNextByAddr(FlowBlock flow) {
/* nextByAddr can be set, when reordering block in transform exc */
// if (nextByAddr != null)
// throw new IllegalStateException("nextByAddr already set");
if (flow == END_OF_METHOD || flow == NEXT_BY_ADDR)
throw new IllegalArgumentException("nextByAddr mustn't be... | 5 |
public OSCPacketDispatcher() {
} | 0 |
private boolean setupCompleted() {
if (address.getText() == null || address.getText().trim().length() == 0) {
return false;
}
if (!loadGame) {
if (teamChoice.getSelection() == null) {
return false;
}
if (address.getText() == null
|| name.getText().trim().length() == 0) {
return false;
... | 6 |
public Builder temperature(int receivedTemperature) {
if (receivedTemperature > 25000) {
starClass = StellarClassification.O;
}
if (receivedTemperature <= 25000) {
starClass = StellarClassification.B;
}
if (receivedTemperature <... | 7 |
public static void main(String[] args) throws IOException {
ServerSocket server = new ServerSocket(2048);
while (!Thread.currentThread().isInterrupted()) {
Socket client = server.accept();
// new Thread(new ClientHanldler(client)).start();
service.execute(new ClientHanldler(client));
}
service.shutdo... | 1 |
public String toHtml(){
String ret=parentRow();
for(Object s:this.events){
ret+=((AuditEvent)s).toHtml();
}
return ret;
} | 1 |
void implementMap()
{
props.add(Defaults.MAP_PROPERTY_COL);
returnTypes.add(Object[].class);
// add a dummy mutator
setters.add(null);
getters.add(null);
if (this.object != null)
{
// this should work:
// Set<?> entrySet =((Map<?,?>)object).entrySet();
// values.add(entrySet.toArray());
// un... | 9 |
private void moveForward(Orientation orientation) throws MovementInvalidException{
//TODO check MarsRover space and throw exception
switch (orientation) {
case NORTH:
if(marsRover.getMaxCoordenateY() > getCoordenateY())
setCoordenateY(getCoordenateY() + 1);
else
throw new MovementInvalidExcept... | 8 |
protected void removeChild( GraphItem item ) {
children.remove( item );
if( site != null ) {
site.removeItem( item );
}
} | 1 |
@Override
public List<Packet> onContact(int selfID, Sprite interactor, int interactorID, List<Integer> dirtySprites, List<Integer> spritesPendingRemoveal, ChatBroadcaster chatter) {
if (interactor instanceof Player) {
if (!((Player) interactor).isAlive())
return new ArrayList<Pac... | 3 |
public Connection nearBaseStation() {
for (int i = 0; i < connections.getLength(); i++) {
Connection connection = connections.get(i);
if (connection.getType() != CoreType.BASESTATION)
return connection;
}
return null;
} | 2 |
public void setData(int[][][] data, int demeCount) {
if(data.length==0 || demeCount==1)
return;
assert data.length * 2 == (demeCount * (demeCount - 1));
// first set deme labels...
xlabs =new String[data.length];
ylabs =new String[data.length];
int counter =0;
for (int i =0; i < demeCount; i++) {
fo... | 7 |
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.