text stringlengths 14 410k | label int32 0 9 |
|---|---|
protected void updateLabeling(double slack) {
for (int w = 0; w < dim; w++) {
if (committedWorkers[w]) {
labelByWorker[w] += slack;
}
}
for (int j = 0; j < dim; j++) {
if (parentWorkerByCommittedJob[j] != -1) {
labelByJob[j] -= slack;
} else {
minSlackValueByJ... | 4 |
public URL getAlias()
{
if (__checkAliases && !_aliasChecked)
{
try
{
String abs=_file.getAbsolutePath();
String can=_file.getCanonicalPath();
if (abs.length()!=can.length() || !abs.equals(can))
... | 7 |
private static void createZip(File set) {
ZipOutputStream outputStream = null;
InputStream inputStream = null;
try {
ArrayList cards = new ArrayList();
for (final File card : set.listFiles()) {
cards.add(card);
}
File zipDir = new File(DeckFileHandler.getDatabaseFilePath() + "zips");
output... | 8 |
@Override
public void mouseClicked(final MouseEvent e) {
for (Map.Entry<Button.TYPE, Button> entry : buttons.entrySet()) {
if (entry.getValue().contains(e.getPoint())) {
processMouseClick(entry.getKey());
}
}
if (discardPlayer != null) {
C... | 8 |
public void generateSubSectorMeshForSector(GroupSector sector) {
clearMeshesOn(sector);
TriangleMesh mesh = new TriangleMesh("_mesh");
MeshNode meshDataNode = new MeshNode("_mesh", mesh);
sector.addChild(meshDataNode);
GeneralTriangle[] isfs;
boolean generated;
for (Direction d : Direction.values()) {
... | 8 |
public int linearRegLookback( int optInTimePeriod )
{
if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) )
optInTimePeriod = 14;
else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) )
return -1;
return optInTimePeriod-1;
} | 3 |
private Boolean checkAndSyncSchema(Class<?> c, Connection connection) throws SQLException{
if(!alreadyChecked.contains(c)){
try {
makeCreateTable(c, connection);
} catch (SQLException e) {
if(e.getMessage().indexOf("already exists") != -1){
makeAlterTable(c, connection);
}else{
throw e;... | 4 |
public static void Info(String s){ log.info("[AprilonIRC] " + s);} | 0 |
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
try {
ClienteDao_Mysql oClienteDAO = new ClienteDao_Mysql(Conexion.getConection());
ClienteBean oCliente = new ClienteBean();
Gson gson = new Gson();
... | 2 |
public void getCompleteBipartiteGraph(mxAnalysisGraph aGraph, int numVerticesGroup1, int numVerticesGroup2)
{
if (numVerticesGroup1 < 0 || numVerticesGroup2 < 0)
{
throw new IllegalArgumentException();
}
int numVertices = numVerticesGroup1 + numVerticesGroup2;
mxGraph graph = aGraph.getGraph();
Object ... | 5 |
public void cargarEmpleados(){
try {
Connection conn = Conexion.GetConnection();
try {
st = conn.createStatement();
emp = st.executeQuery("SELECT * FROM Empleados");
} catch (SQLException e) {
JOptionPane.showMessag... | 3 |
@Override
public byte[] getBytes() {
byte[] b = Util.getBytes(n);
byte[] varInt;
if (n < 0xfd && n >= 0) {
varInt = new byte[] { b[7] };
} else if (n < 0xffff && n >= 0) {
varInt = new byte[] { (byte) 0xfd, b[6], b[7] };
} else if (n < 0xffff_ffffL && n >= 0) {
varInt = new byte[] { (byte) 0xfe, b[... | 6 |
public void setEditValue(int n, EditInfo ei) {
if (n == 0 && ei.value > 0) {
triggerI = ei.value;
}
if (n == 1 && ei.value > 0) {
holdingI = ei.value;
}
if (n == 2 && ei.value > 0) {
cresistance = ei.value;
}
} | 6 |
@Test
public void delMinHeapIsEmptyAfterLastEntryCalled() {
h.insert(v);
h.delMin();
assertTrue(h.isEmpty());
} | 0 |
public void WheelDown()
{
switch(Main.Screen)
{
case "inGame":
Main.inGameManager.WheelDown();
break;
}
} | 1 |
public static Binding getDirectBinding(Expression someExpression) {
if ((someExpression.bits & ASTNode.IgnoreNoEffectAssignCheck) != 0) {
return null;
}
if (someExpression instanceof SingleNameReference) {
return ((SingleNameReference)someExpression).binding;
} else if (someExpression instanceof FieldReference)... | 8 |
public static CommandType getCommandType(String command){
if(command.equals(GET_JOB))
return CommandType.GET_JOB;
else if(command.equals(CHECKOUT_JOB))
return CommandType.CHECKOUT_JOB;
else if(command.equals(COMPLETE_JOB))
return CommandType.COMPLETE_JOB;
... | 4 |
@Override
public void setSocialId(final Long socialId) {
this.socialId = socialId;
} | 0 |
public boolean handleEnter(String line) {
line = line.trim();
int delim = line.indexOf(' ');
final String baseCommand;
final String[] args;
if (delim < 0) {
baseCommand = line;
args = NO_ARGS;
} else {
baseCommand = line.substring(0, delim);
args = line.substring(delim + 1).split(" ", 2);
}
... | 3 |
public boolean peutModifierCategorie(Utilisateur utilisateur) {
return (
utilisateur != null
&& (
utilisateur.getRole().getValeur() >= Role.Administrateur.getValeur()
|| (
utilisateur.getRole().getValeur() >= Role.Moderateur.getValeur()... | 6 |
public Component getComponentBefore(Container container, Component component) {
return cycle(component, -1);
} | 0 |
@Test
public void forEachToimii() {
Hakemisto<Integer, String> hakemisto = new Hakemisto<Integer, String> ();
hakemisto.put(7, "moikka");
hakemisto.put(4, "heippa");
hakemisto.put(65, "maara");
hakemisto.put(-8, "joku juttu");
for (Vektori<Integer,String> ve... | 6 |
public static void t(CanFight x) {
x.fight();
} | 0 |
public Object clone()
{
try
{
return super.clone();
}
catch (CloneNotSupportedException ex)
{
throw new InternalError(this+": "+ex);
}
} | 1 |
private StringBuffer Get10kSearchPage(String urlStr)
{
/** the length of input stream */
int chByte = 0;
URL url = null;
/** HTTP connection */
HttpURLConnection httpConn = null;
InputStream in = null;
StringBuffer sb = new ... | 4 |
public static ArrayList<String> readDomains(String filename){
ArrayList<String> list = new ArrayList<>();
try {
BufferedReader reader = new BufferedReader(new FileReader(new File(filename)));
while (true) {
String mail = reader.readLine();
... | 4 |
private void addCubeFace(IntPoint p1, IntPoint shift) {
IntPoint p2 = p1.add(shift);
int value1, value2, orientation;
if(shift.equals(IntPoint.UP) || shift.equals(IntPoint.DOWN)) {
orientation = CubeFace.Z_AXIS;
} else if(shift.equals(IntPoint.LEFT) || shift.equals(IntPoint.RIGHT)) {
orientation = Cube... | 8 |
public static int getExpRate(MapleCharacter noob){
if(noob.getGMSMode() > 0 && !noob.isJounin()){
return 0;
}
double expRate = Village.getExpRate(noob.getVillage());
if(Modes.getInstance(noob).hasKyubi()){
if(noob.getVillage() != 5) {
expRate *= 2;... | 7 |
public static String addResourcePathToPackagePath(Class<?> clazz,
String resourceName) {
Assert.notNull(resourceName, "Resource name must not be null");
if (!resourceName.startsWith("/")) {
return classPackageAsResourcePath(clazz) + "/" + resourceName;
}
return classPackageAsResourcePath(clazz) + resource... | 2 |
public static double logGamma(double x) {
double xcopy = x;
double fg = 0.0D;
double first = x + lgfGamma + 0.5;
double second = lgfCoeff[0];
if (x >= 0.0) {
first -= (x + 0.5) * Math.log(first);
for (int i = 1; i <= lgfN; i++)
second += lgfCoeff[i] / ++xcopy;
fg = Math.log(Math.sqrt(2.0 * Math.... | 5 |
protected String getMethodHeader(ArrayList<JXScriptArgument<?>> arguments)
{
String methodHeader = "var obj = new Object();\n"
+ "obj.calc = function(";
if( arguments != null )
{
for( int i=0; i<arguments.size(); i++ )
{
methodHeader += arguments.get(i).getName();
if( i < (arguments.size()-1... | 4 |
private List<Header> getExpandedHeaders(final Request request) {
final List<Header> headers = request.getHeaders();
final List<Variable> contextVariables = workflow.getContext().getVariables();
for (final Header header : headers) {
final String newValue = VariableHelper.substituteVariables(header.getValue(),... | 3 |
final public CycVariable sentenceDenotingMetaVariable(boolean requireEOF) throws ParseException {
CycVariable val = null;
val = metaVariable(false);
eof(requireEOF);
{if (true) return val;}
throw new Error("Missing return statement in function");
} | 1 |
public boolean equals(Object obj)
{
boolean isEqual = false;
if (obj != null && obj.getClass() == this.getClass()) {
TestRunInfo testRunInfo = (TestRunInfo) obj;
if (testRunInfo != null) {
isEqual = (this.toString().equals(testRunInfo.toString()));
}
}
r... | 3 |
public GUI3() {
Dimension screenSize = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getSize();
try {
INGRESS_FONT = Font.createFont(Font.TRUETYPE_FONT, new FileInputStream("Coda.ttf"));
} catch(Exception e) {
INGRESS_FONT = new Font("Courier ... | 3 |
public static void main( String args[])
{
int opcao;
int vezes;
int intervalo =0;
do
{
opcao = interacao.lerInt("1. Random Int\n2.Random Float\n3.Random Double\n0.Sair");
if(opcao <0 || opcao > 3)
{
interacao.mensagem("Seu idiota! Escolha valor no intervalo!");
}
}while( opcao < 0 || opc... | 9 |
public Integer getProblemId() {
return this.problemId;
} | 0 |
public String getTableName() {
return tableName;
} | 0 |
public SymbolTable()
{
parent = null;
table = new LinkedHashMap<String, Symbol>();
} | 0 |
public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11)
{
for (int var13 = 0; var13 < 6; ++var13)
{
if ((double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par5 + (double)thi... | 9 |
public List<String> findItinerary(String[][] tickets) {
Map<String,PriorityQueue<String>> ticketMap=new HashMap<String, PriorityQueue<String>>();
for(String[] ticket : tickets){
// ticketMap.computeIfAbsent(ticket[0],k->new PriorityQueue<String>()).add(ticket[1]);
}
List<Strin... | 1 |
public void setDisAppearLine(List<Integer> fulledLines, TScoreManager scoreMng) {
//remove squares in the fulled line
int cnt = fulledLines.size();
for (TBlock blk: blks) {
List<TSquare> sqRemove = new ArrayList<TSquare>();
TSquare[] sqs = blk.getSquares();
for (TSquare sq: sqs) {
int x = (int)sq.get... | 8 |
public Account lookup (String id){
UUID searchAccountId = UUID.fromString(id);
Account searchAccount = null;
if(accounts.containsKey(searchAccountId))
searchAccount = accounts.get(searchAccountId);
return searchAccount;
} | 1 |
public boolean isPrintMouseCoords() {
if(frame == null) buildGUI();
return printMouseCoords.isSelected();
} | 1 |
public void partialTreeAlignment(PriorityQueue<Tree<String>> sQ) {
Tree<String> ts = sQ.poll();
boolean flag = false;
PriorityQueue<Tree<String>> rQ = new PriorityQueue<Tree<String>>();
boolean i = false;// all unaligned items inserted
while (!sQ.isEmpty()) {
Tree<Str... | 7 |
public void paintComponent(Graphics g)
{
super.paintComponent(g);
int h = this.getHeight();
int w = this.getWidth();
g.setColor(background);
g.fillRect(0, 0, w, h);
if (this.image != null)
{
int wb = (w - this.image.getWidth()) / 2;
in... | 1 |
private JPanel buildWhatsnewPane()
{
JPanel panel = new JPanel(new BorderLayout());
try {
JEditorPane editor = new JEditorPane( Main.class.getResource("help/whatsnew.html") );
editor.setEditable(false);
panel.setBorder(BorderFactory.createEmptyBorder(8, ... | 1 |
public Node findIdNode(String id, String scopeName) {
String nodetype = "I";
for (Scope scope : (LexParser.symtab).scopestack.subList(0, (LexParser.symtab).scopestack.size())) {
if(scope.Scopetype.equalsIgnoreCase(scopeName)) {
Symbol sym = scope.symbolMap.get(id);
... | 9 |
public static String getDay(int i)
{
switch(i){
case 1: return "Sunday";
case 2: return "Monday";
case 3: return "Tuesday";
case 4: return "Wednesday";
case 5: return "Thursday";
case 6: return "Friday";
case 7: return "Saturday";
}
return "";
} | 7 |
public void save()
{
//create a buffered writer stream
FileOutputStream fileOutputStream = null;
OutputStreamWriter outputStreamWriter = null;
BufferedWriter out = null;
try{
fileOutputStream = new FileOutputStream(filename);
outputStreamWriter =
new Out... | 8 |
private void loadRiverCrossings(Path baseDir) throws IOException{
Path mapImagePath = getFilePath(MapFile.RIVERS, baseDir);
try(InputStream stream = new FileInputStream(mapImagePath.toString())) {
BufferedImage mapImage = ImageIO.read(stream);
int[] rgbValues = mapImage.getRGB(0... | 7 |
private void setParsedResults(String[] prasedText) {
if (jcbSortOutput.isSelected()) {
Arrays.sort(prasedText);
}
DefaultListModel listModel = (DefaultListModel) jlOutputText.getModel();
cleanOutputs();
int parsedLinesCount = 0;
for (String line : prasedText) ... | 3 |
public ArrayList viewBookingPayment() {
ArrayList temp = new ArrayList();
Query q = em.createQuery("SELECT t from BookingEntity t");
for (Object o : q.getResultList()) {
BookingEntity p = (BookingEntity) o;
if (p.getAccount().getId() == userId) {
temp.add... | 2 |
public static void main(String[] args)
{
long startTime = System.currentTimeMillis();
if(args.length == 0){
System.out.println("Please provide the location of the workload file!");
System.exit(-1);
}
try {
String fileName = args[0];
... | 3 |
private void readDatatypeArray(int type, Document document, String key) {
ValueList tempList = valueList.getNextList();
if (tempList == null) {
document.put(key,null);
return;
}
int len = tempList.length();
Object[] array = null;
if (type == Eleme... | 9 |
@EventHandler
public void EnderDragonPoison(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.getEnderDragonConfig().getDouble("Ender... | 6 |
public int uniquePaths(int m, int n) {
if (n == 1)
return 1;
if (m == 1)
return 1;
int[] arr = new int[n];
Arrays.fill(arr, 1);
for (int j = 1; j < m; j++) {
for (int i = 1; i < n; i++) {
arr[i] = arr[i - 1] + arr[i];
... | 4 |
void dds() {
int ini_fevals = Math.max(5, (int) Math.round(0.005 * maxiter));
int ileft = maxiter - ini_fevals;
double fvalue = 0;
double Ftest;
for (int i = 0; i < ini_fevals; i++) {
// sample an initial solution candidate (uniform random sampling):
fo... | 9 |
public static void MakeFramesNotEnable(Boolean state)
{
for(int i =0;i<callFrameList.size();i++)
callFrameList.get(i).setEnabled(state);
} | 1 |
* @return the meeting with the requested ID, or null if it there is none.
* @throws IllegalArgumentException if there is a meeting with that ID happening in the past
*/
public FutureMeeting getFutureMeeting(int id) throws IllegalArgumentException
{
Meeting m = getMeeting(id);
if(m == null)
{
return (Futu... | 3 |
public void setOpenEncoding(String openEncoding) {
this.openEncoding = openEncoding;
} | 0 |
public static boolean getKey(int key)
{
return (key < keys.length) ? keys[key] : false;
} | 1 |
public void setDefaultCommandHistory() {
// Insert default tools into command history for convenience.
File file = new File(".");
File files[] = file.listFiles();
for (int i = 0; i < files.length; ++i) {
String name = files[i].getName();
if (name.endsWith(".java")... | 6 |
public boolean mapword(String word1, String word2){
if(word1 == null || word2 == null || word1.length() != word2.length())
return false;
HashMap<Character, Character> map = new HashMap<Character, Character>();
for(int i=0 ; i<word1.length(); i++){
char c = word2.charAt(i);
if(map.containsKey(c)){
... | 6 |
private int getPoints(GeneralPath path, float[] mypoints) {
int count = 0;
float x = 0;
float y = 0;
float startx = 0;
float starty = 0;
float[] coords = new float[6];
PathIterator pi = path.getPathIterator(new AffineTransform());
while (!pi.isDone()) {
... | 7 |
public boolean isCellEditable(int row, int col){
if (isEnabled && col == 1 && dataFormat != Format.BIN_FORMAT &&
(endEnabling == -1 || (row>= startEnabling && row <= endEnabling)))
return true;
else
return false;
} | 6 |
public void walkUp() {
face = 0;
if (!(y == 0) && !walkblockactive)
if (!Collision.check(new Position(x, y), face)) {
y -= walkspeed;
setWalkBlock(walkblocktick);
}
} | 3 |
private void writeFieldsToFile(HashMap <String,String> fields) {
// What is the write method going to do
// Well, it can read the old file
// Replace / Add valuues to it
// And then re-write it
// Let's save it as plain-text for now, maybe look at zipping it after
// Firstly, read the old values and re... | 7 |
private void autosave_game () {
Game game = freeColClient.getGame();
if (game == null) return;
// unconditional save per round (fix file "last-turn")
String autosave_text
= Messages.message("clientOptions.savegames.autosave.fileprefix");
String filename = autosave_te... | 6 |
private static void sendStatus(Status status, String date, boolean publicStatus){
try{
for (int i = 0; i < Friends.friendList.size(); i++){
Friends friend = Friends.friendList.get(i);
if(publicStatus){
Message.postStatus(Main.userName + "##"+ date + "##" + status.getContent(), InetAddress.getByName(fr... | 4 |
public void fromByteArray(byte[] array) throws Exception {
int i = -1;
while (array[++i] != -1 )
namensfeld = new String(new byte[] { array[i] }, "UTF-8") + namensfeld;
String sZahl = "";
while (array[++i] != -1 )
sZahl = new String(new byte[] { array[i] }, "UTF-8") + sZahl;
zahl = Integer.p... | 3 |
public static void main(String[] args) {
// TODO Auto-generated method stub
try{
String currentPath = new java.io.File( "." ).getCanonicalPath();
if(Utility.DBG)
System.out.println("Current dir:"+currentPath);
BufferedReader br = Utility.openFileToRead(currentPath+"\\src\\Input\\Problem1");
String... | 6 |
public static void main(String[] args) {
//Primitives
boolean aBoolean = true;
char aChar = 'x';
byte aByte = 0;
short aShort = 0;
int anInt = 0;
long aLong = 0L;
float aFloat = 0.0F;
double aDouble = 0.0D;
//Boxing
Boolean aBoolea... | 0 |
public static String encode(String str) {
byte[] buffer = str.getBytes();
int a = 0, i = 0, size = buffer.length;
char[] ch = new char[((size + 2) / 3) * 4];
while (i < size) {
byte b01 = buffer[i++];
byte b12 = i < size ? buffer[i++] : 0;
byte b23 = i < size ? buffer[i++] : 0;
int mask = 0x3F;
c... | 5 |
public boolean hasPathSum(TreeNode root, int sum){
if(root == null) return false;
LinkedList<TreeNode> nodes = new LinkedList<TreeNode>();
LinkedList<Integer> sumValu = new LinkedList<Integer>();
nodes.add(root);
sumValu.add(root.val);
while(!nodes.isEmpty()){
TreeNode current... | 7 |
public static void main (String agrs[])
{
try
{
droneControl = new CustomDroneControl();
}
catch(Exception e)
{
if(droneControl != null)
droneControl.Abort(e);
else
... | 5 |
public static byte[] compressData(String zipEntryName, byte[] data) throws IOException {
if (Utils.isCompressedPath(zipEntryName)) {
throw new IllegalArgumentException("Zip entry name must have an uncompressed file extention");
}
ByteArrayInputStream inputStream = new ByteAr... | 1 |
@EventHandler
public void onJoin(PlayerJoinEvent event) {
Player p = event.getPlayer();
if (FileUtil.checkPlayerDat(p)) {
event.setJoinMessage("NEW PLAYER!");
}
PlayerUtil pu = new PlayerUtil(p);
pu.updateName();
} | 1 |
protected void paintTabBackground(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) {
Polygon shape = new Polygon();
shape.addPoint(x - (h / 4), y + h);
shape.addPoint(x + (h / 4), y);
shape.addPoint(x + w - (h / 4), y);
if (isSelected ... | 3 |
public void decrementNutrientLevels(boolean slow) {
for (Nutrient nutrient : nutrientLevels.keySet()) {
int level = nutrientLevels.get(nutrient);
if (level > (double)Config.maxNutrientLevel / 2.0 && slow)
return;
else if (level <= (double)Config.maxNutrientLevel / 2.0 && !slow)
return;
add... | 5 |
public void processRoute(ArrayList<String> rout, String fileName, boolean draw,
boolean writeToFile,
Filter filter) throws IOException {
ArrayList<Point> prout = new ArrayList<Point>();
double sumKm = 0;
for (int i = 1;i < rout.size();i++) {
double y = Math.abs(points.get(rout.get(i)).lon -
... | 8 |
private void optimize(int i) {
// look to see if there is overlap like this:
// t: <---i>
// t: <----->
if (i == size - 1) {
return;
}
int j = i + 1;
while (j < size && ranges[j] <= ranges[i]) {
j += 1;
}
if (j == size) {
size = i + 1;
} else {
int d = j - i - 1;
if (d % 2 == 0) ... | 7 |
public void formatStringTwo(char[] str, int length) {
boolean isWord = false;
int wordCount = 0;
for (int i = 0; i < length; i++) {
if (str[i] != ' ' && isWord == false) {
isWord = true;
if (wordCount > 0) {
System.out.print(' ');
}
wordCount++;
System.out.print(str[i]);
} else if (... | 8 |
@Override
public void action() {
RConsole.println("Ball Has been detected");
// TODO Auto-generated method stub
int increased = 0;
Color colorSensed = Sputnik.colorSensor.getColor();
int blue = colorSensed.getBlue();
int red = colorSensed.getRed();
while (blue > 80 || red > 80) {
PathFollowing.ball = ... | 6 |
public static ArrayList<Song> download(long time, String userName, ArrayList<Song> songs)
{
ArrayList<Song> allSongs=songs;
ArrayList<String> dates= new ArrayList<String>();
ArrayList<String> names= new ArrayList<String>();
ArrayList<String> artists = new ArrayList<String>();
Elements dateList;
Elements na... | 5 |
@Override
public boolean delete(String question) {
// Man skal have valgt et spil for at kunne tilføje et spørgsmål
if (currentgame == null)
{
return false;
}
for (int i = 0; i < currentgame.getQuestions().size(); i++) {
if (question.... | 3 |
public static void main(String[] args) throws InterruptedException {
//creating Random numbers
Random random = new Random();
for (int i = 0; i < 10; i++) {
System.out.println("Integer random is: " + random.nextInt(10));
}
//semaphore , number of permits
Semaph... | 1 |
private Link generateRandomizedGameLink(EntityManager em, Player player) {
Link outputLink = new Link("", "");
ArrayList<Long> friendIDs = player.getFriendList();
// You need at least 5 friends to play and generate a valid link
if (friendIDs.size() <= 4) {
outputLink.setHref("index.html");
outputLink
... | 3 |
@Override
public void detectRelationships(Obituary obit) throws Exception {
List<List<Term>> sentences = extractor.tagEntities(obit);
for (List<Term> sentence : sentences) {
sentence = EntityUtils.combineEntities(sentence);
chunker.addBIOChunks(sentence);
List<String> lines = new ArrayList<String>();
L... | 9 |
public static void main(String[] args) throws IOException
{
BufferedInputStream bis = new BufferedInputStream(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = readInt(bis);
int r = 0;
TreeSet<Integer> a = new TreeSet<>();
for (int i = 0 ; i < n ; i++... | 5 |
protected boolean isFinished() {
return false;
} | 0 |
public String getState()
{
if(type == 0 && hasFood)
{
return "<state>"+x+" "+y+" food hasFood</state>";
}
if(type == 2 && !doorOpen)
{
return "<state>"+x+" "+y+" door doorClosed</state>";
}
if((type == 0 || type == 2) && ant != null)
{
return "<state>"+x+" "+y+" antId "+ant.getId()+"</st... | 7 |
static final public void NonNewArrayExpr() throws ParseException {
if (jj_2_7(3)) {
Literal();
NonNewArrayExpr2();
} else if (jj_2_8(3)) {
jj_consume_token(THIS);
NonNewArrayExpr2();
} else if (jj_2_9(3)) {
jj_consume_token(LP);
Expression();
jj_consume_token(RP);
... | 8 |
private void draw()
{
Plot2DPanel plot = new Plot2DPanel();
Color[] couleurs = new Color[]{Color.red,Color.blue,Color.ORANGE,Color.green,Color.yellow};
plot.removePlotToolBar();
plot.addLegend("SOUTH");
plot.ge... | 7 |
protected void loadCatalystActivity() {
String name = "CatalystActivity";
String fileName = dirName + name + ".txt";
if (verbose) Timer.showStdErr("Loading " + name + " from '" + fileName + "'");
int i = 1;
for (String line : Gpr.readFile(fileName).split("\n")) {
// Parse line
String rec[] = line.split... | 7 |
public boolean sendMessageToServer(String message) {
InetAddress serverAddr;
try {
serverAddr = InetAddress.getByName(getStrServerAddress());
Socket sendSocket = new Socket();
sendSocket.connect(new InetSocketAddress(serverAddr, getIntServerPort()), TIMEOUT);
ObjectOutputStream oos = new ObjectOutputStr... | 7 |
public List<Double> getVarianceList() {
List<Double> result= new ArrayList<Double>();
double[] values= this.getVarianceArray();
for (int i= 0; i< values.length; ++i) {
result.add(Double.valueOf(values[i]));
}
return result;
} | 1 |
public void setId(long id) {
this.id = id;
} | 0 |
public void tick() {
Street end1 = streets.get(streets.size()-1);
for(Vehicle vdel:end1.getVehicles()) {
end1.leaveStreet(vdel);
vehicles.remove(vdel);
System.out.println("VEhicle removed: " + vdel);
}
for(Intersection i: intersections) {
... | 8 |
public Alignment getAlignmentScore() {
int maxScore = Integer.MIN_VALUE;
int xMax = 0;
int yMax = 0;
for (int i = 0; i < matrixA.length; i++) {
if (matrixA[i][matrixA[i].length - 1] > maxScore) {
maxScore = matrixA[i][matrixA[i].length - 1];
xMax = i;
yMax = matrixA[i].length-1;
}
}
for (i... | 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.