text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void renderPlayerInventory(Graphics2D graphics){
int i = 0;
for (Item item: objectTron.getActivePlayer().getInventory()){
System.out.println("size: "+ objectTron.getActivePlayer().getInventory().size() + " i:" + i);
graphics.drawImage(lightgrenade, startPointXCoordinate + (i*40), + startPointYCoo... | 1 |
@Override
public boolean onCommand(CommandSender sender, Command arg1, String arg2,
String[] arg3) {
if (sender instanceof Player) {
Player player = (Player)sender;
if (!player.isOp()) {
return true;
}
Session session = HyperPVP.getSession(player);
if (HyperPVP.getMap().getType()... | 3 |
public ListWords(){
list = new HashSet<Word>();
} | 0 |
private void buttonBackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonBackActionPerformed
//Индексы названий и статуса заявки
final int indexColumnName = 0;
final int indexColumnStatus = 3;
//Определяем индекс выбранной строки в таблице
int selectedRowIn... | 5 |
public synchronized boolean write(final File file) {
if (file == null)
throw new IllegalArgumentException("null input file");
FileOutputStream out = null;
try {
out = new FileOutputStream(file);
}
catch (IOException e) {
e.printStackTrace();
}
if (out == null)
return false;
if (progressBa... | 8 |
private void degreejComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_degreejComboBoxActionPerformed
// TODO add your handling code here:
String itemText = (String)degreejComboBox.getSelectedItem( );
if(itemText.equals("Other")){
otherjLabel.setVisible(true);... | 1 |
public void justify(int x)
{
if(1 <= x && x <= 3)
myJustification = x;
} | 2 |
public byte[] encoder()
{
//Generates the type of client this is
char typ;
String hld;
if(baseCon != null)
typ = '1';
else if(remCon!= null)
typ = '2';
else
typ = '0';
//The state 1 client
if(state == 1)
{
hld = 1+";"+getName()+";"+typ+";"+getKey()+";"+getScreenChar()+";"+devCon();
}
... | 8 |
public void render(Graphics g){
// Draw History contents table
Font fnt0 = new Font("arial", Font.ITALIC, 10);
g.setFont(fnt0);
g.setColor(Color.green);
g.drawString("(LAST 15 GAMES)", (Cong.WIDTH * Cong.SCALE) / 2 - 45, start_y - 37);
Font fnt1 = new Font("arial", Font.B... | 2 |
private void jTextField1FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextField1FocusLost
// TODO add your handling code here:
try{
if(esCarga){
if((jTextField1==null)||(jTextField1.getText().equals("")))
jTextField1.requestFocus();
... | 6 |
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/plain");
PrintWriter out = response.getWriter();
String requestContent = readRequestContent(request);
String ids = retriveIdsFromJson(requestContent);
if (n... | 5 |
public void createOutline(Shape selected) {
selectedShape = selected;
if (selectedShape == null)
return;
if (selectedShape instanceof Square) {
createOutlineForSquare((Square) selectedShape);
}
else if (selectedShape instanceof Rectangle) {
createOutlineForRectangle((Rectangle)selectedShape);
}
e... | 7 |
public NumMatrix(int[][] matrix) {
this.matrix=matrix;
width=matrix[0].length;
height=matrix.length;
init();
} | 0 |
@Override
public void run() {
// TODO Auto-generated method stub
try {
System.out.println("Sleeping thread for " + timeLeftMs + " ms.");
Thread.sleep(timeLeftMs);
System.out.println("The auction has been expired!");
System.out.println("auctionId = " + auctionId);
} catch (Exception e) {
Sys... | 3 |
private void setLightSource() {
if (model.getLightSource().isOn()) {
ModelerUtilities.selectWithoutNotifyingListeners(lightSwitch, true);
boolean b1 = model.getLightSource().isMonochromatic();
ModelerUtilities.selectWithoutNotifyingListeners(monochromaticButton, b1);
ModelerUtilities.selectWithoutNotifyin... | 7 |
private static GameState weekLoop(GameState state)
{
for(int day = state.getDay(); day <= 5; day++)
{
state.setDay(day);
if(state.getTime() == Time.PICK_CARDS)
{
pickCards(state);
state.log("~DAY PHASE (" + (day+1) + ")~");
state.setTime(Time.DAY);
state.updateGUIs();
}
while... | 3 |
void handleCutCopy() {
// Save the cut/copied style info so that during paste we will maintain
// the style information. Cut/copied text is put in the clipboard in
// RTF format, but is not pasted in RTF format. The other way to
// handle the pasting of styles would be to access the Clipboard directly and
// p... | 5 |
* @param xxx
* @param yyy
* @param zzz
* @param attached Are we attached to the piston body?
* @param override_sticky If attached, are we a sticky piston or a regular piston?
*/
public void renderPistonHead(int textureId, int xxx, int yyy, int zzz, BlockType block, int tex_offset, boolean attached, boolean o... | 8 |
public static String[] allUpperCase(String... strings){
String[] tmp = new String[strings.length];
for(int idx=0;idx<strings.length;idx++){
if(strings[idx] != null){
tmp[idx] = strings[idx].toUpperCase();
}
}
return tmp;
} | 2 |
protected int getCorrectDirToOriginRoom(Room R, int v)
{
if(v<0)
return -1;
int dir=-1;
Room R2=null;
Exit E2=null;
int lowest=v;
for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)
{
R2=R.getRoomInDir(d);
E2=R.getExitInDir(d);
if((R2!=null)&&(E2!=null)&&(E2.isOpen()))
{
final int dx=com... | 7 |
@Override
public void setValueAt(Object value, int row, int column) {
Object obj = this.items.get(row);
if(this.columnNames.size() > column) {
ColumnDefinition col = this.columnNames.get(column);
if(col != null) {
if(obj != null) {
try {
this.items.set(row, col.getName(), value);
... | 5 |
public int getDiscId(String queryString) {
int i = 0;
for(String[] cd: this.cds) {
// queryString in den beiden ArrayElementen der CD suchen
if(cd[0]!=null && cd[1]!=null) {
if(cd[0].toLowerCase().indexOf(queryString.toLowerCase())!=-1 ||
cd[1].toLowerC... | 5 |
public static HashMap<String, String> loadSourceMap( String sourceFile){
Repository repo = new SailRepository(new MemoryStore());
HashMap<String, String> cacheNameToSourceMap = new HashMap<String, String>();
try {
repo.initialize();
RepositoryConnection conn = repo.getConnection();
con... | 2 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.TRUE)
|| (object instanceof String && ((Str... | 6 |
/**
* This function draw the circumscribed circle on the PPM object.
*
* @param PPM
*/
public void drawTo(PPMEC PPM) {
Vector v = new Vector(0, 0);
// Must scale x,y to final ppm dimensions
int c = (int) (xRatio * PPM.getWidth()); // get x-coord
int r = (int) (yRatio * PPM.getHeight()); // get y-coord... | 9 |
public String toString() {
if (root == null) {
return "There are no students registered";
}
StringBuilder sb = new StringBuilder();
/* inorder traverse the tree */
Stack<StudentNode> stack = new Stack<StudentNode>();
StudentNode currentNode = root;
while (true) {
/* push all the left child nodes t... | 6 |
public static String[] removeEmptyStrings(String[] data)
{
ArrayList<String> result = new ArrayList<String>();
for(int i = 0; i < data.length; i++)
if(!data[i].equals(""))
result.add(data[i]);
String[] res = new String[result.size()];
result.toArray(res);
return res;
} | 2 |
public void tick(Enemy enemy) {
super.tick(enemy);
attackData.resetEnemiesTowerHasShoot(); // reset enemies it has shot this frame.
if (attackData.canShootAtThisFrame()) {
if (enemy.isActive() && enemy.isAlive()) { // can only handle active and alive enemies
if (canS... | 7 |
public void trimToSize(int maxSize) {
while (true) {
K key;
V value;
synchronized (this) {
if (size < 0 || (map.isEmpty() && size != 0)) {
throw new IllegalStateException(getClass().getName()
+ ".sizeOf() is repo... | 6 |
public PossibleState contains(CommunityState cs) {
for (PossibleState ps : possibleStates)
if (ps.getCommunityState().equals(cs))
return ps;
return null;
} | 2 |
public void run() {
logger.fine("X-Plane receiver listening on port " + datagram_socket.getLocalPort());
DatagramPacket packet = null;
while (this.keep_running) {
try {
// wait for packet or time-out
packet = receiveXPlanePacket();
if ... | 7 |
public Document getDocument( String url, String encode ) {
Document doc = null;
try {
if ( encode.equals("UTF-8") ) {
doc = Jsoup.connect(url)
.timeout(50000)
.userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100... | 5 |
public static double ddot_f77 (int n, double dx[], int incx, double
dy[], int incy) {
double ddot;
int i,ix,iy,m;
ddot = 0.0;
if (n <= 0) return ddot;
if ((incx == 1) && (incy == 1)) {
// both increments equal to 1
m = n%5;
for (i = 1; i <= ... | 8 |
public static long mult(long flongOne, long flongTwo)
throws FixedPointLongException {
boolean negative = false;
long a = flongOne;
long b = flongTwo;
if (flongOne < 0) {
a = -a;
negative = !negative;
}
if (flongTwo < 0) {
b = -b;
negative = !negative;
}
long intmult = (a >> OFFSET) * (b ... | 5 |
public int threeSumClosest(int[] num, int target) {
assert num.length > 2:"the number of integers < 3!";
if (num.length == 3)
return num[0]+num[1]+num[2];
Arrays.sort(num);
if (num[0] >= target)
return num[0]+num[1]+num[2];
if (num[num.... | 5 |
public static void main(String[] args) {
// TODO code application logic here
// Cuenta martin = Actions.create("2321321321", "Martin", 1);
//
// Ingreso ing = new Ingreso("paga navidad", 700);
// martin.doMovement(ing);
//
//
// Cuenta andrea = Action... | 1 |
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Podaj ilość produktów: ");
int ilosc = scanner.nextInt();
double suma0 = 0, suma7 = 0, suma23 = 0;
for (int i = 1; i <= ilosc; i++) {
int kod = -1;
whi... | 7 |
public static String compact(String str) {
char[] array=str.toCharArray();
char lastChar='a';
String carrRtn="\\n";
String tabRtn="\\t";
int counter=0;
StringBuffer sb=new StringBuffer();
for (int i=0;i<array.length;i++) {
if (i==0 || array[i]!=lastChar) {
if (counter>1) {
sb.append(counter);
... | 8 |
public int getDirectionX(){
return directionX;
} | 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 |
@Override
public String execute() throws Exception {
try {
//camplist=(List<Dvddog>) myDao.getDbsession().createQuery("from Dvddog").list());
Map session = ActionContext.getContext().getSession();
Campaign camp = (Campaign) session.get("campa");
camplist = (L... | 3 |
@Override
public synchronized void activate()
{
if (m_lActive)
{
// Already active
return;
}
m_lActive = true;
// Starts the session running in it's own thread to handle it's own commands
Goliath.Threading.ThreadJob loThreadJob = new Thre... | 9 |
public void buildFactory(Map map, Cell c, Boolean aiMove) {
if (aiMove || Teams.comparePlayers(this.getOwner(),game.getCurrentPlayer())) {
if (game.getCurrentPlayer().canAfford(Factory.cost)) {
if (getBuildableCells(map).contains(c)) {
Factory f = new Factory(c, t... | 5 |
public void exportService(Class<T> serviceClass) {
Map<String, String> params = new HashMap<String, String>();
params.put("iface", serviceClass.getName());
tpURL.setParams(params);
// 对一个实际的执行对象进行包装,变身Invoker
Invoker<T> invoker = null;
try {
invoker = proxyFactory.createProxyInvoker(serviceClass.newInst... | 3 |
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 drawShapes(GraphicsContext gc) {
gc.setFill(Color.GREEN);
gc.setStroke(Color.BLUE);
gc.setLineWidth(1);
gc.fillText(tl.name, 40, 20);
int begin = tl.timelineEvents.firstEntry().getValue().getStartYear();
int end = tl.timelineEvents.lastEntry().getValue().getS... | 8 |
public void NotifyPluginUpdateReceived(PluginUpdate update) {
for (IPluginUpdateNotification ti : pluginUpdateNotificationListeners) {
ti.onPluginUpdate(update);
}
} | 1 |
public void visit_dup2(final Instruction inst) {
// If top two values are both category 1, dup them both.
// Otherwise, dup the one category 2 value.
final Set top = atDepth(0);
final int category = checkCategory(top);
if (category == 1) {
final Set top1 = atDepth(1);
checkCategory(top1, 1);
// Fo... | 1 |
public void testIterator8() {
List<Message> msgs=createMessages();
MessageBatch batch=new MessageBatch(msgs);
int index=0;
for(Iterator<Message> it=batch.iterator(); it.hasNext();) {
it.next();
if(index == 1 || index == 2 || index == 3 || index == 10 || index == m... | 7 |
private String getPlayer(AccountManager manager) {
Player[] bufferPlayer = manager.getAllPlayer();
String s = "";
int counter = 0;
if(bufferPlayer[bufferPlayer.length -1] != null&&bufferPlayer[bufferPlayer.length -1].name.contentEquals("Bot")){
counter = 1;
}
for... | 4 |
@Override
public void ejecutar(Stack<Valor> st, MemoriaDatos md, Cp cp)
throws Exception {
if (st.size() < 2)
throw new Exception("DISTINTO: faltan operandos");
Valor op1 = st.pop();
Valor op2 = st.pop();
if (op1 instanceof Booleano && op2 instanceof Booleano) {
st.push(new Booleano(((boolean) op1.... | 5 |
public static void main(String[] args) {
try {
Element company = new Element("company");
Document document = new Document();
document.setRootElement(company);
Element staff = new Element("staff");
staff.addContent(new Element("name").setText("Se... | 1 |
private void handleMouseMoved(int x, int y) {
x -= 50;
y -= 50;
x /= 16;
y /= 16;
if ((x < 0) || (y < 0) || (x >= map.getWidthInTiles()) || (y >= map.getHeightInTiles())) {
return;
}
if (selectedx != -1) {
if ((lastFindX != x) || (lastFindY != y)) {
lastFindX = x;
lastFindY = y;
path =... | 7 |
protected void checkRootDirectory() {
String rootText = selectRootText.getText();
if (rootText == null || rootText.isEmpty())
return;
root = new File(rootText);
if (root.exists() && root.isDirectory()) {
File projectDir = new File(root, "project");
Fil... | 8 |
protected void generatePackageFiles(ClassTree classtree) throws Exception {
PackageDoc[] packages = configuration.packages;
if (packages.length > 1) {
PackageIndexFrameWriter.generate(configuration);
}
PackageDoc prev = null, next;
for (int i = 0; i < packages.length;... | 9 |
public void entering(final String name, final Object o, String... args) {
// info(StringUtils.shortName(o.getClass()) + "-" + o.hashCode() + " entering " + name + "(" + StringUtils.join(args, ", ") + ")");
} | 0 |
public boolean replaceResponseLine( HTTPHeaderLine statusLine )
throws NullPointerException,
HeaderFormatException {
if( statusLine == null )
throw new NullPointerException( "Cannot replace the response status line with null line." );
if( statusLine.getKey() == null )
throw new HeaderFormatExce... | 4 |
@EventHandler
public void onInventoryClick(InventoryClickEvent e)
{
// If either item is null (caused by failure to immediately update inventories after cancelled events),
// return as to avoid big ugly errors in console that make me sad.
if(e.getCursor() == null)
return;
if(e.getCurrentItem() == null)
... | 8 |
protected synchronized CtClass get0(String classname, boolean useCache)
throws NotFoundException
{
CtClass clazz = null;
if (useCache) {
clazz = getCached(classname);
if (clazz != null)
return clazz;
}
if (!childFirstLookup && parent !... | 9 |
public static void main(String[] args) {
String line = "";
String message = "";
int c;
try {
while ((c = System.in.read()) >= 0) {
switch (c) {
case '\n':
if (line.equals("go")) {
PlanetWars pw = new PlanetWars(message);
DoTurn(pw);
pw.FinishTurn();
message = "";
} e... | 4 |
public static double[] lsolve(double[][] A, double[] b) {
int N = b.length;
for (int p = 0; p < N; p++) {
// find pivot row and swap
int max = p;
for (int i = p + 1; i < N; i++) {
if (Math.abs(A[i][p]) > Math.abs(A[max][p])) {
ma... | 8 |
public static ItemInfo itemByStack(ItemStack itemStack) {
if (itemStack == null) {
return null;
}
for (ItemInfo item : items) {
if (itemStack.getType().equals(item.getType()) && item.isDurable()) {
return item;
} else if (itemStack.getType().e... | 6 |
public String getId() {
return id;
} | 0 |
@Override
public boolean intersectsBounds(CollisionObject object) {
if (object instanceof PlaneObject) {
return false;
}
Vector3d min = new Vector3d();
Vector3d max = new Vector3d();
object.getBounds(min, max);
if (getLocalSignedDistance(position, rotation, min) < 0) {
return true;
}
if (getLoca... | 9 |
public static void main(String[] args) throws Exception
{
if( args.length != 5)
throw new Exception("Example d'appel : source <nom_DNS_du_destinataire> <numero_de_port_destination> <taille_de_fenetre> <fichier> <pourcentage_erreur_crc>");
// configurer le client
int port = Integer.parseInt(args[1]);
if (... | 6 |
public void setChallengeFormat(AlgorithmParametersType.ChallengeFormat value) {
this.challengeFormat = value;
} | 0 |
private Rectangle getDragRowInsertionMarkerBounds(Row parent, int insertAtIndex) {
int rowCount = mModel.getRowCount();
Rectangle bounds;
if (insertAtIndex < 0 || rowCount == 0) {
bounds = new Rectangle();
} else {
int insertAt = getAbsoluteInsertionIndex(parent, insertAtIndex);
int indent = parent !=... | 6 |
public Boolean connect()
{
try {
selectedPortIdentifier = CommPortIdentifier.getPortIdentifier( portname);
} catch (NoSuchPortException e1) {
setConnected(false);
error = "Port <"+portname+"> not found !";
trytolog(error);
return false;
}
//Required port found in system : We c... | 4 |
public Order getOrdine() {
return ordine;
} | 0 |
public static double getDamageModBash(WeaponMaterial type) {
switch (type) {
case COPPER:
return 1.25;
case BRONZE:
return 1.25;
case SILVER:
return 3;
case IRON:
return 1;
case STEEL:
... | 6 |
private boolean verifyResponse(byte[] peerHandshake, boolean newPeer)
{
if(peerHandshake == null)
{
return false;
}
else if(peerHandshake.length != 68)
{
return false;
}
// check bit torrent protocol and info hash
for (int i = 0; i < 48; i++)
{
// skip the 8 reserved bytes
if (i > 19 &... | 9 |
private void updateEntities(GameContext g) {
// UPDATE ALL ENTITIES
for (Mob m : dots) {
m.updateMob(g);
}
// for (Mob m : lines) {
// m.updateMob(g);
// }
for (Mob m : polygons) {
m.updateMob(g);
}
for (Mob m : explosions) {
m.updateMob(g);
}
} | 3 |
@Override
public Class getColumnClass(int indiceColonne){
//System.out.println("ModeleListeLocations::getColumnClass()") ;
switch(indiceColonne){
case 0 :
return String.class ;
case 1 :
return String.class ;
case 2 :
return String.class ;
case 3 :
return Date.class ;
case 4 :
r... | 7 |
@SuppressWarnings("unused")
private static void CollatzSequence(){
Scanner keyboard = new Scanner(System.in);
int n;
System.out.println("Starting number: ");
n = keyboard.nextInt();
int xPos = 0;
int steps = 0;
int largestValue = 0;
while(n > 1){
if(n > largestValue)
largestValue = n;
i... | 5 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final JPcodePK other = (JPcodePK) obj;
if (!Objects.equals(this.IdOrder, other.IdOrder)) {
return f... | 5 |
public static List<String> explodeToList(String delimiter, String string) {
if (delimiter == null || string == null)
throw new IllegalArgumentException("Null object");
ArrayList<String> v = new ArrayList<String>();
StringBuffer curToken = new StringBuffer();
StringBuffer delimReader = new StringBuffer()... | 9 |
public void buildHierarchy() {
String[] keys;
int ancestorCount;
YagoCategoryNodeOld node;
ArrayList<YagoCategoryNodeOld> nodeArray;
// order nodes by how many ancestors they have. Nodes with more ancestors MUST be at a lower level
// than those with less
keys = this.nodeMap.keySet().toArray(new S... | 9 |
private int getGroupPosition(String name, String fnmPrefix) {
ArrayList groupNames = (ArrayList) gNamesMap.get(name);
if (groupNames == null) {
EIError.debugMsg("No group names for " + name, EIError.ErrorLevel.Error);
return -1;
}
String nm;
for (int i = ... | 3 |
public static void main(String[] args) throws Exception {
playerNo = Integer.parseInt(args[0].trim());
int port = portOffset + playerNo;
Socket socket = new Socket("localhost", port);
BufferedReader in =
new BufferedReader(new InputStreamReader(socket.getInputStream()));
PrintWriter out =
new PrintWr... | 5 |
private void acao101(Token token) throws SemanticError {
try {
String nomePrograma = token.getLexeme();
IdentificadorPrograma idPrograma = new IdentificadorPrograma(
nomePrograma);
tabela.add(idPrograma, nivelAtual);
} catch (IdentificadorJaDefinidoException e) {
throw new SemanticError(e.getMessag... | 1 |
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
log.info("WANcostResummingServlet3h Got a GET...");
caches.reload();
link[][] linkArr = new link[caches.lSources.size()][caches.lDestinations.size()];
for (int i = 0; i < caches.lSources.size(); i++)
for (int j = ... | 9 |
@Override
public Status execute(String command) throws MenuException {
switch (command) {
case "I":
displayInstructions();
return HELP;
case "H":
displayHints();
return HELP;... | 3 |
@Override
public void start() {
System.out.println("start the car");
super.start();
} | 0 |
private void checkForIdenticalElements(){
boolean test = false;
for(int i=0; i<this.nItems; i++){
int sum = 0;
double check = this.scores0[i][0];
for(int j=0; j<this.nPersons; j++)if(this.scores0[i][j]==check)sum++;
if(sum==this.nPersons){
... | 9 |
public void listen() throws InvalidUIntException {
System.out.println("listening");
int available;
try {
Thread.sleep(2500);
while(true) {
while ((available = sis.available()) == 0)
{
Thread.sleep(100);
}
byte id = sis.readByte();
sVLQ payloadLength = new sVLQ(sis.readByte());
a... | 8 |
public void setwnd() {
GraphicsDevice dev = getGraphicsConfiguration().getDevice();
if (prefs == null)
return;
try {
dev.setDisplayMode(prefs);
dev.setFullScreenWindow(null);
setVisible(false);
dispose();
setUndecorated(false);
setVisible(true);
} catch (Exception e) {
throw (new Runtime... | 2 |
@SuppressWarnings("unchecked")
private ArrayList<String>[] partFile(String fichier, int nbNodes) {
try {
BufferedReader br = new BufferedReader(new FileReader(new File(fichier)));
String line = null;
ArrayList<String> parts[] = new ArrayList[nbNodes];
for(int i=0; i<nbNodes; i++)
parts[i] = new Array... | 8 |
public static void main(String argv[]) {
try {
File fXmlFile = new File("D:\\Java SE\\src\\xml\\staff.xml");
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();... | 3 |
private void addRowToTable(List<QuestDTO> usersList) {
for (QuestDTO quest : usersList) {
tableModel.addRow(quest.toArray());
}
} | 1 |
private boolean checkwalls(Location loc)
{
Location north = loc.add(0, -1);
Location east = loc.add(1, 0);
Location south = loc.add(0, 1);
Location west = loc.add(-1, 0);
int yes = 0;
if (north.getY() >= 0 && map[north.getX()][north.getY()] == nonWall)
yes++;
if (east.getX() < xSize && map[east.getX(... | 8 |
@Override
public boolean blocked(Node n) {
if (n == null || !walkable(n)) {
return true;
}
if (n.getPrev() == null) {
return false;
}
if (!walkable(n.getPrev())) {
return true;
}
final Node p = n.getPrev();
return checkBlocked(n, p) || checkBlocked(p, n);
} | 5 |
public FirstTask(List<Float> randomNumbers) throws IOException {
String choice = "";
while (!choice.equals("back")) {
printMenu();
randomNumbers.clear();
choice = reader.readLine();
if (choice.equals("1")) {
System.out.print("Равномерное ... | 8 |
private void deleteSession()
{
System.out.println("Deleting a complete session ...");
// ---------------------------------------------------
// get list of features FESVo IDs:
int [] ids = this.loader.getFeaturesIDs();
// convert into array of Integ... | 7 |
public String getBacklink(String name) throws IOException {
String namelist = WakeBackends.namelist;
if (namelist.split(name.split("[ __]")[0] + ",").length == 2) {
if (namelist.split(name.split("[ __]")[0] + ",")[1].split(",")[0]
.equals("&i=1"))
; // ここ注意 &i=1を読み飛ばしている うかつに消さないように
else if (!namelis... | 8 |
public LocationHeader(String rawHeader) throws MalformedHeaderException {
String[] data = rawHeader.split(" ");
if (!data[0].equals("GET")) {
throw new MalformedHeaderException("Expected get header, received " + data[0]);
}
if (!data[2].matches("HTTP/1.[0-1]")) {
throw new MalformedHeaderException("... | 3 |
private boolean checkforLinearity(Production[] p)
{
int count=0;
for (int i=0; i<p.length; i++)
{
if (ProductionChecker.isRightLinear(p[i]))
count++;
}
if (count==p.length)
{
JOptionPane.showMessageDialog(environment.getComponent(0), "This is a right-linear Grammar (Regular Grammar and Context-F... | 6 |
private static void updateInnerEntry(int mod, String name, CtClass clazz, boolean outer) {
ClassFile cf = clazz.getClassFile2();
InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute(
InnerClassesAttribute.tag);
if (ica == null)
... | 6 |
void connectToServerActionPerformed(ActionEvent e) {
boolean allOk = true;
client.setHost(serverName.getText());
addHistoryItem(oldServers, "serverNameHistory.txt", serverName.getText());
if (!(client.loadGame(theGameClass.getText()))) {
allOk = false;
} else {
client.setProtocolName(t... | 5 |
public boolean isPossibleBreakpoint() {
return possibleBreakpoint;
} | 0 |
@Test
public void testGetS2() {
System.out.println("getS2");
Move instance = new Move(6,9);
int expResult = 9;
int result = instance.getS2();
assertEquals(expResult, result);
} | 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.