text stringlengths 14 410k | label int32 0 9 |
|---|---|
@EventHandler
public void PlayerFireResistance(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.getPlayerConfig().getDouble("Player.... | 6 |
public void load() {
try {
FileInputStream in = new FileInputStream(settingsFilePath);
properties.load(in);
in.close();
} catch (IOException e) {
//settings file not found - using defaults
}
} | 1 |
public RAFFile replaceRessource(String input) throws IOException {
RAFFile retVal = null;
outtaloop:
for(Map.Entry<String,ArrayList<RAFFile>> file : archives.entrySet())
{
for(RAFFile rafFile : file.getValue())
{
if(rafFile.searchForRessource(inpu... | 3 |
private static BeanstreamResponse fromJson(int httpStatusCode, String jsonPayload, MediaType responseType) {
JsonParser parser = new JsonParser();
JsonObject json = parser.parse(jsonPayload).getAsJsonObject();
BeanstreamResponseBuilder builder = new BeanstreamResponseBuilder();
builder... | 6 |
private static long getMinimaOfAND(long[] arr) {
int maxLen = 0;
String[] bin = new String[arr.length];
for (int i = 0; i < arr.length; i++) {
bin[i] = Long.toBinaryString(arr[i]);
if(bin[i].length() > maxLen) {
maxLen = bin[i].length();
}
... | 7 |
public static String splitLabel(String conceptRole) {
int indeX = 0;
String conceptName = "";
if (conceptRole.length() > 10) {
for (int i = 0; i < conceptRole.length(); i++) {
if (Character.isUpperCase(conceptRole.charAt(i))) {
indeX = i;
}
}
conceptName = conceptRole.substring(0, indeX);
... | 3 |
private Annotation addAnnotationValueHelper(String property, URI nameSpaceURI, boolean propertyIsRel) {
AnnotationImpl annotation = new AnnotationImpl(getDocument());
if ( null == property ) {
return null;
}
String[] curie = property.split(":");
if ( propertyIsRel ) {
... | 9 |
public AbstractCarriage(int id) throws CarriageException {
if (id >= 0)
this.ID = id;
else
throw new CarriageException("Id is under zero");
} | 1 |
@Override
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final NamingInfo other = (NamingInfo)obj;
i... | 7 |
public boolean isNumber() {
return !this.getContent().equals("#") || !this.getContent().equals("0");
} | 1 |
public boolean publishShpCollection(String workspace, String storeName, URI resource)
throws FileNotFoundException {
// Deduce upload method & mime type from resource syntax.
UploadMethod method = null;
String mime = null;
if (resource.getScheme().equals("file") || resource.... | 8 |
public ArrayList<MeetingInvite> getAllMeetingInvitesFromDatabase(){
ArrayList<MeetingInvite> meetingInvites = new ArrayList<>();
ArrayList<HashMap<String, String>> meetingInvites_raw = mySQLQuery.getAllRows("MeetingInvite");
for(HashMap<String, String> meetingInvite_raw : meetingInvites_raw){
... | 5 |
public void parseFile(String xmlFile, String dtdFile)
throws IOException {
BufferedReader br = new BufferedReader(new FileReader(path + xmlFile+".xml"));
BufferedReader br1 = new BufferedReader(new FileReader(path + dtdFile+".dtd"));
FileWriter fw = new FileWriter(path + "temp111.xml");
BufferedWriter bw = ... | 6 |
public static Obstacle[][] readConfCsv(int n){
String path = "conf/confLevel"+ n +".csv";
Obstacle[][] obs = new Obstacle[Obstacle.confLines][];
InputStreamReader isReader= new InputStreamReader(Obstacle.class.getClassLoader().getResourceAsStream(path));
try (BufferedReader reader = new BufferedReader(isRe... | 3 |
public LocalDate getDepartureDate() {
return this._departureDate;
} | 0 |
protected void setFieldValue(Object obj, String fieldname, Object value)
{
Field field = null;
try
{
field = getField(obj, fieldname);
if (field != null)
{
if (field.getType() == Boolean.class)
{
value = (value.equals("1") || String.valueOf(value)
.equalsIgnoreCase("true")) ? Boole... | 7 |
private Point getPointForLocation(int location) {
Point p = new Point();
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
switch (location) {
case TOP_LEFT:
p.x = 10;
p.y = 30;
break;
case TOP:
p.x = (screen.width - 270) / 2;
p.y = 30;
break;
case TOP_RIGHT:
p.x = screen.... | 9 |
public void Update(double timestamp, double duration, float[] magnitudes, float[] phases){
final GraphicsContext context = display.getGraphicsContext2D();
display.setWidth(width);
display.setHeight(height);
context.setFill(backgroundColor);
context.fillRect(0, 0, display.getWidth(), displa... | 6 |
public boolean isPushLambdaTransition(Transition transition) {
PDATransition trans = (PDATransition) transition;
String toPush = trans.getStringToPush();
if (toPush.length() != 0)
return false;
/*
* String input = trans.getInputToRead(); if(input.length() != 1) return
* false;
*/
String toPop = tr... | 2 |
protected boolean isValid(){
if (hasCharacter()){
if (!characterData.isValid()){
return false;
}
}
for (TileObjectDisplayData data : itemData){
if (!data.isValid()){
return false;
}
}
for (TileObjectDisplayData data : edgeData.values()){
if (!data.isValid()){
return false;
... | 6 |
public static boolean cancelDownload()
{
try
{
if(is != null) is.close();
if(os != null)
{
os.flush();
os.close();
}
return true;
}
catch(Exception e)
{
return false;
}
} | 3 |
protected static boolean isAList(String text) {
String arr[] = Util.splitByNewLineSign(text);
for (int i = 0; i < arr.length; i++) {
if (arr[i].length() != 0) {
if (isAListChar(arr[i].charAt(0)) == true) {
return true;
}
}
... | 3 |
public ConcordiaMembers searchMember(String firstName, String lastName, String concordiaID){
for(ConcordiaMembers member: concordiaMembers){
if(member!=null){
if(member.getFirstName().equals(firstName) && member.getLastName().equals(lastName) && member.getConcordiaID().equals(concordiaID)){
return member... | 5 |
public static boolean isOperator(String token) {
if ("+".equals(token) || "-".equals(token)
|| "*".equals(token) || "/".equals(token))
return true;
return false;
} | 4 |
public void checaProyectilChocaConBricks(){
for (Object lstCaja : lstCajas ){
Brick briCaja = (Brick) lstCaja;
if (briCaja.getEstado() < 3){
if (briCaja.colisionaAbajo(proBola)){
proyectilChocaArriba();
briCaja.setEstad... | 8 |
private Vector<Vector<String>> getWQLEventNode(String xml,String ParamAttValue)
{
if(xml==null){System.out.println("ERROR:SSAP_XMLTools:getWQLEventTriple: XML message is null");return null;}
Element parameters = getParameterElement(xml,"name", ParamAttValue);
if(parameters==null){System.out.println("ERROR:SSAP_... | 5 |
@SuppressWarnings("rawtypes")
public static void printMap(Map map, int depth)
{
final Iterator i = map.keySet().iterator();
Object key = null;
for (int k = 0; k < depth; k++)
System.out.print(" ");
System.out.println("Dictionary:");
while (i.hasNext() && (key = ... | 5 |
public List<Element> getElementsOnPosition(Position position) {
List<Element> posElements = new ArrayList<Element>();
for (Element element : elements) {
if (element.getPositions().contains(position))
posElements.add(element);
}
return posElements;
} | 2 |
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 static void quitter() {
System.exit(0);
} | 0 |
public void displayAccounts()
{
Hashtable<Integer, Customer> copy = Database.getCustomers();
Set<Integer> keys = copy.keySet();
System.out.println("Bank " + bankID + " Accounts:");
for(Integer key: keys)
{
System.out.println(copy.get(key));
}
} | 1 |
public fightermakerView(SingleFrameApplication app) {
super(app);
current_move=null;
current_sprite=null;
x=0;
y=0;
listOfMoves_main_file=null;
listOfMoves_sprites_file=null;
hitbox_color_selected="";
hitbox_inde... | 6 |
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 findTheUglyNumber(int n){
if(n==0){
return;
}
int count = 0;
int[] res = new int[n];
int t2=0,t3=0,t5=0;
res[count] = 1;
while(count < n-1){
while(res[t2] *2 <= res[count]){
t2 ++;
}
while(res[t3]*3 <= res[count]){
t3 ++;
}
while(res[t5]*5 <= res[count]){
t... | 5 |
private void loadImage(String path) {
try {
Image img = new Image(path);
img.setFilter(Image.FILTER_NEAREST);
spriteSheet = new SpriteSheet(img, x, y);
} catch (SlickException e) {
System.out.println("Cannot find Image for SpriteMap!...or maybe there's a ... | 1 |
@Override
public void run() {
HashSet<Outline> outlines;
synchronized (OUTLINES) {
PENDING = false;
outlines = new HashSet<>(OUTLINES);
OUTLINES.clear();
}
for (Outline outline : outlines) {
outline.sizeColumnsToFit();
outline.repaint();
}
} | 1 |
private String compute(String num1, String operation, String num2) {
double value1;
double value2;
double answer = 0;
if(num1.indexOf('e') >= 0) {
String[] parts = num1.split("e");
value1 = Math.pow(Double.parseDouble(parts[0]), Double.parseDouble(parts[0]));
}
else {
value1 = Double.parseDo... | 8 |
@Override
public void draw(Graphics g) {
g.setColor(new Color(0, 0, 0, 30));
g.fillRect(0, 0, width, height);
g.setColor(new Color(20, 20, 20));
for (int i = 0; i < width; i += 50) {
for (int j = 0; j < height; j += 50) {
g.fillRect(i, j, 5, 5);
... | 5 |
public ChatChannel createAndJoinChannel(ChatChannel chatChannel, User user){
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url = "jdbc:derby:" + DBName;
Connection connection = DriverManager.getConnection(url);
Statement statement = connection.createStatement();
String insertIntoC... | 2 |
final public double getConfidence() {
// should be 1.0 if this node supposedly represents a "fact", or 0 > n > 1 if it is known to be a guess
return 1.0;
} | 0 |
public ArrayList getUnsynchronizedComponents() {
YIComponent view = controller.getView();
Object model = controller.getModel();
ArrayList result = new ArrayList();
try {
ArrayList comps = YUIToolkit.getViewComponents(view);
Iterator it = comps.iterator... | 7 |
@Override
public void setPlayers(RobPlayerInfo[] candidateVictims) {
victims = candidateVictims;
int numberOfPlayers = 0;
if(candidateVictims != null)
numberOfPlayers = candidateVictims.length;
if(numberOfPlayers != 0){
this.remove(buttonPanel);
buttonPanel = new JPanel();
buttonPanel.setBord... | 3 |
public static int computeRawVarint64Size(final long value) {
if ((value & (0xffffffffffffffffL << 7)) == 0) return 1;
if ((value & (0xffffffffffffffffL << 14)) == 0) return 2;
if ((value & (0xffffffffffffffffL << 21)) == 0) return 3;
if ((value & (0xffffffffffffffffL << 28)) == 0) return 4;
if ((va... | 9 |
public void controlUpdate(float tpf){
super.update(tpf);
System.out.println("4444 works");
if(spatial != null && target != null) {
// Implement your custom control here ...
// Change scene graph, access and modify userdata in the spatial, etc
if(target.getUser... | 6 |
public double getOpacite() {
return opacite;
} | 0 |
public boolean equals(Object o)
{
try
{
return toString().equals(((Case)o).toString());
}
catch(ClassCastException e)
{
return false;
}
} | 1 |
public static Method getMethod(String name, Class<?> clazz, Class<?>... paramTypes) {
Class<?>[] t = toPrimitiveTypeArray(paramTypes);
for (Method m : clazz.getMethods()) {
Class<?>[] types = toPrimitiveTypeArray(m.getParameterTypes());
if (m.getName().equals(name) && equalsTypeArray(types, t))
return m;
... | 7 |
private void setListener() {
rBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
showCourseTable();
}
});
infoTable.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
int selectRowNum = infoTable.getSelectedRow();
int clic... | 8 |
private void updateEngine(double delta) {
//time related things must be multiplied by delta
//non time related ignore delta
//draws tiles
Tile[][] viewTiles = new Tile[20][15];
for (int x = 0; x < 20; x++) {
for (int y = 0; y < 15; y++) {
if ((x + (... | 9 |
protected Object convertNullSource(Class<?> sourceType, Class<?> targetType) {
return null;
} | 2 |
public JSONObject putOnce(String key, Object value) throws JSONException {
if (key != null && value != null) {
if (this.opt(key) != null) {
throw new JSONException("Duplicate key \"" + key + "\"");
}
this.put(key, value);
}
return this;
} | 3 |
public void run()
{
while(true)
{
try
{
if(this.task != 0)
{
System.out.println("Worker " + this.getId() + " Task left : " + this.task);
this.task--;
Thread.sleep(500);
}
else
{
notifyAll();
wait();
}
}
catch (InterruptedException e)
{
... | 3 |
public CycSOAPService() {
System.out.println("CycSoapService");
if (Log.current == null)
Log.makeLog("cyc-soap-service.log");
} | 1 |
public void run() {
for (int i = 1; i <= ConcurrentHashMapDemo.NUMBER; i++) {
map.get(key);
}
synchronized (lock) {
counter--;
}
} | 1 |
@Test
public void testDecrementFood() {
System.out.println("removeFood");
Cell instance = new Cell(0,0);
instance.setFood(100);
instance.decrementFood();
int expResult = 99;
int result = instance.getFood();
assertEquals(expResult, result);
ins... | 0 |
private static IProjectEventListener generateIProjectEventListener(final List<ExternalFinderItem> finderItems) {
return new IProjectEventListener() {
private final List<Component> menuItems = new ArrayList<Component>();
@Override
public void onProjectChanged(final IProjectEv... | 8 |
private String makeCookie(String id, HttpServletRequest request) {
Cookie cookies[] = request.getCookies();
String bookHistroy = null;
// System.out.println("length: "+cookies.length);
for(int i = 0; cookies != null && i < cookies.length; i++){
System.out.println("length_for: "+cookies.length);
if(cookie... | 7 |
public static Cons kifBiconditionalToTwoImplies(Cons tree) {
if (tree.length() > 3) {
{ OutputStringStream stream000 = OutputStringStream.newOutputStringStream();
{ Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();
try {
Native.setBooleanSpecial(Stella.$PRINTREADAB... | 8 |
public UsuarioBean get(UsuarioBean oUsuarioBean) throws Exception {
if (oUsuarioBean.getId() > 0) {
try {
oMysql.conexion(enumTipoConexion);
if (!oMysql.existsOne("usuario", oUsuarioBean.getId())) {
oUsuarioBean.setId(0);
} else {
... | 3 |
public String toString() {
try {
java.io.StringWriter strw = new java.io.StringWriter();
TabbedPrintWriter writer = new TabbedPrintWriter(strw);
writer.println(super.toString() + ": " + addr + "-"
+ (addr + length));
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_INOUT) != 0) {
writer.pr... | 5 |
private boolean askLevelPlayer(){
attempts = 0;
boolean LevelSelected = Boolean.FALSE;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(!LevelSelected){
try{
System.out.println("Welcome to play hangman of South American Countries");
System.out.println("Enter a number... | 9 |
@Override
public void run() {
int regen_marker = stamina;
while(true){
if(health >= 1){ //hunts
if(!hunt()){
wander();
}
}
else{
wander();
}
if(stamina > stamina_stat *2){ //reproduces
reproduce();
}
stamina--; //loses energy and h... | 8 |
public int tamanho()
{
return this.quantasContas;
} | 0 |
@Override
public boolean equals( Object o )
{
if( this == o )
return true;
if( o == null || getClass() != o.getClass() )
return false;
ComplexImmutableObject that = ( ComplexImmutableObject )o;
if( initialValue != that.initialValue )
return false;
if( strict != that.strict )
return false;
if... | 9 |
private void tick() {
mLat = mLat + mDY;
mLon = mLon + mDX;
sendPacket();
segTraveledDistance += distPerTick;
if (segTraveledDistance >= segDistance) {
// start next segment or end
if (!mPath.isEmpty()) {
Vertex v = mPath.get(0);
mPath.remove(0);
if (v instanceof Vertex) {
updateMoti... | 7 |
public static byte[] ElgamalEncrypt(String key, BigInteger y, BigInteger k, BigInteger p) throws Exception {
BigInteger m = new BigInteger(key, 16);
//encrypt c = (m + y^k)(mod p)
BigInteger c = m.add(y.modPow(k, p)).mod(p);
return Utilities.toBytes(c);
} | 0 |
public static Rank parseLine(Line line) {
if (line.equals("owner"))
return Owner;
else if (line.equals("admin"))
return Admin;
else if (line.equals("mod"))
return Mod;
else if (line.equals("friend"))
return Friend;
else if (line.equals("producer"))
return Producer;
else
return ... | 5 |
public void IniciarOtello()
{
q5 = new Query("consult", new Term[] {new Atom("C:/Users/Luan Cardoso/Documents/NetBeansProjects/Otello/eval.pl")});
System.out.println( "consult2 " + (q5.query() ? "succeeded" : "failed"));
q2 = new Query("consult", new Term[] {new Atom("C:/Use... | 4 |
private boolean hasAcceptableContenType() {
List<String> contentTypes = getAcceptableContentTypes();
if (contentTypes != null) {
if (contentTypes.isEmpty()) {
return true;
}
String currentContentType = getContentType();
if (currentContent... | 5 |
public void openFile() {
if(jfc.showOpenDialog(frame) == JFileChooser.APPROVE_OPTION) {
File newFile = jfc.getSelectedFile();
if(!newFile.exists()) {
JOptionPane.showMessageDialog(frame, newFile.getName() + " does not exist.");
return;
} else if(!newFile.equals(projFile)) {
int save = JOptionPane... | 8 |
public final byte getMetadata(){return (byte)((((char)(data << 12)) >>> 12));} | 0 |
public ForAllTestCases(final Xpp3Dom results) {
this.results = results;
} | 0 |
public static Level levelToJUL(org.apache.logging.log4j.Level lvl) {
switch (lvl) {
case OFF:
return Level.OFF;
case FATAL:
case ERROR:
return Level.SEVERE;
case WARN:
return Level.WARNING;
case INFO:
return Level.INFO;
... | 8 |
static public void DeleteObject (int ActiveObj, int ListTypeControl){
System.out.println("Deleting..");
if (ListTypeControl == 0){
// ## REBUILD ARRAY...
Customer[] ActiveCustomerArray = new Customer[Globals.ATA.CustomerArray.length-1];
// Everything before that object for deletion
... | 6 |
public static void main(final String[] args)
throws IOException {
File polyCmd;
File driverPath = null;
try {
driverPath = PointGroupsUtility.getPolymakeDriverPath();
}
catch (FileNotFoundException e) {
final String err =
"Standard set-up of project was changed!\n"
... | 7 |
public static PermissionRelationship getPermissions(ChunkyObject object, ChunkyObject permObject) {
if (!permissions.containsKey(object)) {
permissions.put(object, new HashMap<ChunkyObject, PermissionRelationship>());
}
HashMap<ChunkyObject, PermissionRelationship> perms = permission... | 2 |
public void run(){
try{
BufferedInputStream buf = new BufferedInputStream(is);
InputStreamReader inread = new InputStreamReader(buf);
BufferedReader bufferedreader = new BufferedReader(inread);
String line;
while ((line = bufferedreader.readLine()) != null) {
if(isErr){
... | 3 |
private void updatePath(float x, float y) {
closedPath = null;
if (path == null) {
path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
path.moveTo(x, y);
bounds = new Rectangle2D.Float(x, y, 0, 0);
} else {
path.lineTo(x, y);
float _xmax = (float)bounds.getMaxX... | 5 |
@Override
public void run ( )
{
while ( this.running && this.application.isRunning ( ) )
{
try
{
if ( ! this.application.isPaused ( ) )
{
String urlString = this.application.getLinkManager ( ).getNextUnvisitedLink ( ) ;
if ( urlString != null )
{
Document document = J... | 6 |
public int read(byte[] output, int maxReadLength)
{
// Make sure there are enough bytes to read, if not then pause until there are.
// Note: we don't have to worry about bytes in the middle of the range being false and reading those by accident
// The loop that reads bytes (see the synchroni... | 7 |
@Override
protected
void parseSelf(Document doc) throws ProblemsReadingDocumentException {
trackCounter = 0;
List<Element> imgList = queryXPathList("//pre:div[@id='tralbumArt']//pre:img", doc);
if (imgList.size() > 0) {
try {
coverUrl = resolveLink((imgList.get(0)).getAttributeValue("src"));
} catch... | 4 |
public boolean isSpare() {
if (first + second == 10 && first != 10)
return true;
else
return false;
} | 2 |
@Override
public void execute(double t) {
Matrix y = new ColumnMatrix(output.getDim());
if (pi.isConnected()) {
if (mi.isConnected()) {
y = mi.getInput().times(-1);
y = y.plus(pi.getInput());
} else
y = pi.getInput();
} else {
if (mi.isConnected())
y = mi.getInput().times(-1);
}
try ... | 4 |
public JSONObject accumulate(String key, Object value)
throws JSONException {
testValidity(value);
Object object = opt(key);
if (object == null) {
put(key, value instanceof JSONArray ?
new JSONArray().put(value) : value);
} else if (object inst... | 3 |
public boolean bufferKestrelGet(int index) {
assert _emitBuffer.size() == 0; // JTODO
KestrelClientInfo info = _kestrels.get(index);
long now = System.currentTimeMillis();
if(now > info.blacklistTillTimeMs) {
List<Item> items = null;
try {
items ... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Attribute other = (Attribute) obj;
if (!name.equals(other.name))
return false;
return true;
} | 4 |
public static void makeIndex(String fileName){
try {
BufferedReader br=new BufferedReader(new FileReader(fileName));
Pattern P = Pattern.compile("(<<<)(.*)(>>>)");
String tempLine = new String();
String url = new String();
List<String> wordsInPage = new LinkedList<String>();
int pageNumber ... | 8 |
public void updateTransformation(double[][] newTransf, boolean updateCenter) {
transformation = TransformationManager.matrixMultiplication(transformation, newTransf);
double[][] coord = center.getTransformedCoordinates();
double[][] t = TransformationManager.translation3D(-coord[0][0], -coord[0][1], -coord[0][2])... | 2 |
@Test
public void toString_test() {
try{
double [][]mat= {{1.0,2.0}, {3.0,1.0}};
String matStr = Matrix.toString(mat);
String expStr=(" 1.0 2.0\n"+
" 3.0 1.0\n");
Assert.assertNotSame(matStr, expStr);
}
catch... | 1 |
protected void backward(DatasetExample example) {
int size = example.size();
// Initialize the beta[size-1] values.
Vector<Double> last = beta.get(size - 1);
if (tagged[size - 1]) {
// Zero to every state.
for (int state = 0; state < numStates; ++state)
last.set(state, 0.0);
// Get the correct st... | 9 |
private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
/*Obtenemos el prov seleccionado de la tabla:*/
Proveedor proveedorQueSeEliminara = obtenerInformacionDeRenglonSelecccionado();
//checamos si se seleccionó algún prov de la tabl... | 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 |
@Override
public String toString() {
final StringBuffer buffer = new StringBuffer();
for (int i = 0; i < headers.length; i++)
buffer.append(headers[i] + "\t");
buffer.append("\n");
for (final SoldItem item : rows) {
buffer.append(item.getId() + "\t");
buffer.append(item.getName() + "\t");
buffer.... | 2 |
public void nouveauTour(){
for (int x=0; x<IConfig.LARGEUR_CARTE; x++){
for (int y=0; y<IConfig.HAUTEUR_CARTE; y++){
map[x][y].nouveauTour();
}
}
} | 2 |
public PreferencesFrame() {
super(false, false, false, INITIAL_WIDTH, INITIAL_HEIGHT, MINIMUM_WIDTH, MINIMUM_HEIGHT);
// Button Text and Other Copy
OK = GUITreeLoader.reg.getText("ok");
CANCEL = GUITreeLoader.reg.getText("cancel");
APPLY = GUITreeLoader.reg.getText("apply");
RESTORE_DEFAULTS = GUITreeLoade... | 0 |
public static Map<String,Object> stringToMap(String inComing){
Map<String,Object> result = new HashMap<String,Object>();
if(inComing == null) {
return null;
}
JsonReader jsonReader = Json.createReader(new StringReader(inComing));
JsonObject object = jsonReader.readO... | 9 |
private void openUriInBrowser(URI uri) {
if (uri != null) {
if (java.awt.Desktop.isDesktopSupported()) {
try {
java.awt.Desktop.getDesktop().browse(uri);
} catch (IOException ex) {
System.err.println(ex.getMessage());
... | 3 |
final void method620(Class101 class101) {
Class101_Sub1 class101_sub1 = (Class101_Sub1) class101;
if (aClass129Array5322 != null) {
for (int i = 0; i < aClass129Array5322.length; i++) {
Class129 class129 = aClass129Array5322[i];
Class129 class129_285_ = class129;
if (((Class129) class129).aClass129_1888 !=... | 7 |
public int addBlockToDB( ) throws MiniDB_Exception{
int newBlockID = (int)-1;
for (int i=0; i<MiniDB_Constants.DB_MAX_BLOCKS && newBlockID==-1; i++){
if( !dbBlockUsed[i] ){
newBlockID = (int)i;
dbBlockUsed[i] = true;
}
}
if( newBlockID == -1 ) throw new MiniDB_Exception( MiniDB_Exception... | 4 |
@Test
public void scale_test() {
try{
double []mat1= {1.0,2.0,3.0,1.0};
double factor= 2;
double[]result = Vector.scale(factor, mat1);
double exp[]={2.0,4.0,6.0,2.0};
Assert.assertArrayEquals(exp, result, 0);
}
catch (Exception e) {
// TODO Auto-generated catch block
fail("Not yet implemente... | 1 |
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.