text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void set(int index, Attributes attributeList) {
RangeCheck(index);
attributeLists[index] = attributeList;
} | 0 |
public static void creadXml() {
File file = new File(xml);
if (file.exists()) {
System.out.println("product.xml已存在");
} else {
Document document = DocumentHelper.createDocument();
Element rootElement1 = document.addElement(ENFINITY);
Element offerElement1 = rootElement1.addElement(OFFER);
offerElem... | 2 |
public boolean hayLugarEnPlan (int id_padre, String codigo_plan_padre){
boolean haylugar = false;
try {
r_con.Connection();
ResultSet rs = r_con.Consultar("select COUNT(*) from "+nameTable+" where pc_id_padre="+id_padre);
rs.next();
int futuroHijo = rs.getI... | 6 |
public static boolean hasConstructor(Class<?> clazz, Class<?>... paramTypes) {
return (getConstructorIfAvailable(clazz, paramTypes) != null);
} | 2 |
private void packFlac() throws IOException {
// get output file
File outFile = getOutputFile();
if (outFile == null) return;
BitOutputStream os = null;
FileOutputStream fos;
try {
fos = new FileOutputStream(outFile);
os = new BitOutputStream(fos);
... | 8 |
public boolean nameEnumeratorResponse(Interest interest) throws IOException {
boolean result = false;
ContentName neRequestPrefix = interest.name().cut(CommandMarker.COMMAND_MARKER_BASIC_ENUMERATION.getBytes());
File directoryToEnumerate = NDNNameToFilePath(neRequestPrefix);
if (!directoryToEnumerate.e... | 9 |
public Reader_factory get_reader(int id) {
Reader_factory reader = null;
if(readers == null) return null;
List listreaders = readers.getChildren();
if (listreaders != null){
Iterator i = listreaders.iterator();
while(i.hasNext()){
Element current = (Element)i.next();
int currid = I... | 5 |
@Override
public T decode(byte[] data) throws ConverterException {
byte[] decompressedData;
if (data[0] == 120) {
decompressedData = decompress(data);
} else {
decompressedData = data;
}
Map<Integer, QualifiedValue<?>> idxLookup = new HashMap<>();
... | 8 |
public void visitRCExpr(final RCExpr expr) {
print("rc(");
if (expr.expr() != null) {
expr.expr().visit(this);
}
print(")");
} | 1 |
public ArrayList<Integer> getNeighbours(int node, int size) {
ArrayList<Integer> neighbours = new ArrayList<Integer>();
if(node == 0) { //Top-left
neighbours.add(node+1);
neighbours.add(node+size);
}
else if (node == size-1) { //Top-right
neighbours.add(node-1);
neighbours.add(node+size);
}
... | 8 |
public void setNewEmail(String newEmail) {
putMergeVar("new-email", newEmail);
} | 0 |
public static JSONObject toJSONObject(String string) throws JSONException {
String name;
JSONObject jo = new JSONObject();
Object value;
JSONTokener x = new JSONTokener(string);
jo.put("name", x.nextTo('='));
x.next('=');
jo.put("value", x.nextTo(';'));
x.... | 3 |
public void run() {
// Continuous file read
try {
while(true) {
while((line = file.readLine()) != null) {
if(line.matches(".*[Xx][Aa][Mm][Xx][Ee].*")) {
this.server.sendMessage(-1, "Someone is requesting Xamxe", CMD_SRV_MSG);
this.server.sendMessage(-1, "Content: " + line, CMD... | 5 |
public boolean alreadyVoted(int userId, int formId) {
try {
String q1 = "select count(*) from formresponse where userid = ? and formid = ?;";
PreparedStatement st1 = conn.prepareStatement(q1);
st1.setInt(1, userId);
st1.setInt(2, formId);
ResultSet rs ... | 2 |
public int getG() {
return this.g;
} | 0 |
public PosFuncionarios getFuncionario(long cedula){
return (PosFuncionarios) getHibernateTemplate().get(PosFuncionarios.class, cedula);
} | 0 |
public IautosSellerInfo getNewSeller() {
return newSeller;
} | 0 |
private void drawArea(Graphics g, Automaton automaton, State state,
Point point, Color color) {
// Draw the basic background of the state.
drawBackground(g, state, point, color);
// What about the text label?
g.setColor(Color.black);
int dx = ((int) g.getFontMetrics().getStringBounds(state.getName(), g)
... | 2 |
public static void main(String[] args)
{
BaseSetting bs = new BaseSetting();
Wording w = new Wording("Je suis un énoncé", new Object[10]);
if (w != null) {System.out.println("WORDING NOT NULL");}
// INSERTION WORDING
w.insert(bs);
i... | 5 |
public int getTotal() {
calculateTotal();
if (total > 21) {
changeAce();
calculateTotal();
}
return total;
} | 1 |
private void sendQuickLaunchFile(int index){
File f = quick_launch_files[index];
if(f==null) return;
QLUpdate ql = new QLUpdate();
ql.itemIndex = index;
ql.fileName = f.getName();
// Generate the png's to send to android
FileSystemView fsv = FileSystemView.getFileSystemView();
Icon ico = ... | 3 |
static void resetRuns(BitStream outb, G4State state) throws IOException {
//System.err.println("EOL! "+state.a0);
state.white = true;
addRun(0, state, outb);
if (state.a0 != state.width) {
//System.out.println( (state.a0 < state.width ? "Premature EOL" : "Line length mismatch... | 8 |
@Override
public Class<?> getColumnClass(int columnIndex) {
if (columnIndex == NUMBER) {
return Integer.class;
} else if (columnIndex == TYPE) {
return String.class;
} else if (columnIndex == MODEL) {
return String.class;
} else if (columnIndex == ... | 5 |
@SuppressWarnings("unchecked")
public static EventReader createEventReader(EventEntry eventEntry){
Properties unisensProperties = UnisensProperties.getInstance().getProperties();
String readerClassName = unisensProperties.getProperty(Constants.EVENT_READER.replaceAll("format", eventEntry.getFileFormat().getFileFor... | 9 |
private static Image getImage(String filename) {
// to read from file
ImageIcon icon = new ImageIcon(filename);
// try to read from URL
if ((icon == null) || (icon.getImageLoadStatus() != MediaTracker.COMPLETE)) {
try {
URL url = new URL(filename);
... | 6 |
public boolean isEmpty() {
return size == 0;
} | 0 |
@Override
public void run() {
while (crawler.pageDone == false || crawler.contentUrls.size() > 0) {
if (crawler.contentUrls.size() != 0) {
saveAsText(crawler.contentUrls.remove());
} else {
try {
sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
} | 4 |
public void fill(int x0, int y0, int x1, int y1, int color) {
x0 += xOffs;
y0 += yOffs;
x1 += xOffs;
y1 += yOffs;
if (x0 < 0) x0 = 0;
if (y0 < 0) y0 = 0;
if (x1 >= w) x1 = w - 1;
if (y1 >= h) y1 = h - 1;
for (int y = y0; y <= y1; y++) {
for (int x = x0; x <= x1; x++) {
pixels[x + y * w] = colo... | 6 |
@Override
public SetMultimap<Position, Position> getAllAvailableMoves(Player activePlayer, Board board) {
SetMultimap<Position, Position> allMoves = getAllAvailableCaptures(activePlayer, board);
if (!allMoves.isEmpty()) {
return allMoves;
}
for (int i = 1; i < board.getS... | 9 |
private void scrapeSearchResults(String siteText) {
Document doc = Jsoup.parse(siteText);
if (doc.select("td:containsOwn(No results returned)").size() == 1) {
return;
}
Elements rows = doc.select("table").get(1).select("tr");
rows.remove(0);
ArrayList<People... | 2 |
public boolean execute(CommandSender sender, String[] args) {
String groupName = args[0];
GroupManager groupManager = Citadel.getGroupManager();
Faction group = groupManager.getGroup(groupName);
if(group == null){
sendMessage(sender, ChatColor.RED, "Group doesn't exist");
return true;
}
String playerN... | 8 |
public void updateElement() {
for (Projectile projectile : projectileScope) {
boolean tmpFlagNotUsed = true;
if (projectile.getProjectileType() == PROJECTILE_FIRST) {
for (int i = heroZonesArray.length - 1; i > -1; i--) {
Hero tmphero=FAiF.gameScreen.heroStock.getHeroByZoneId(heroZonesArray[i].zoneId);... | 9 |
public void setAroundBounds()
{
if(x < punkt2X)
{
dx = x;
dwidth = punkt2X - x;
}
if(x > punkt2X)
{
dx = punkt2X;
dwidth = x - punkt2X;
}
if(y < punkt2Y)
{
dy = y;
dheight = punkt2Y - y;
}
if(y > punkt2Y)
{
dy = punkt2Y;
dheight = y - punkt2Y;
}
} | 4 |
protected static String getFieldValue(HttpServletRequest request, String fieldName) {
String value = request.getParameter(fieldName);
if(value == null || value.trim().length() == 0) {
return null;
} else {
return value;
}
} | 2 |
@Before
public void setUp() {
this.p = new Piste(0, 0);
} | 0 |
public void llenarCombobox() {
String to = System.getProperty("user.dir"); // recupero el directorio del proyecto
String separator = System.getProperty("file.separator"); //recupero el separador ex: Windows= '\' , Linux='/'
to = to + separator + "src" + separator + "src" + separator; // concaten... | 2 |
public int numTrees(int n) {
long a = 1;
long b = 1;
for(int i = 2*n;i> n+1;i--)
a*= i;
for(int i=n;i>0;i--)
b *= i;
return (int) (a/b);
} | 2 |
protected Rules processRules(Element element,RuleDefinitionInterface currentRuleDefn){
Rules rules=(Rules)Factory.getFactory().getDataObject(Factory.ObjectTypes.Rules);
rules.setName(element.getAttribute("name"));
rules.setChange(Change.getInstance(element.getAttribute("change")));
rules.setOnType(SchemaType... | 6 |
public boolean isDestroyed() {
return carPhysics.isDestroyed();
} | 0 |
@EventHandler
public void onBlockBreakEvent(BlockBreakEvent event) {
if (!event.isCancelled()) {
Player player = event.getPlayer();
if (Cloning.contains(player)) {
if (Cloning.isEnabled(player)) {
if (event.getBlock().getState().getData() instanceo... | 5 |
private Method getGetterMethod(Class boClass, String fieldName, Class fieldType) throws DataException {
String getterName = "get" + fieldName.substring(0, 1).toUpperCase();
if (fieldType == Boolean.class || fieldType == boolean.class) {
getterName = "is" + fieldName.substring(0, 1).toUpperCase();
}
... | 5 |
private byte[] createByteArray(InputStream in) throws IOException {
final int bufferSize = 2048;
byte result[] = new byte[bufferSize];
ByteArrayOutputStream out = new ByteArrayOutputStream();
int len = 0;
while ((len = in.read(result)) != -1) out.write(result, 0, len);
... | 1 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Area)) {
return false;
}
Area other = (Area) object;
if ((this.areidArea == null && other.areidArea != null) ||... | 5 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(
(CMLib.flags().isWateryRoom(mob.location()))
||(mob.location().domainType()==Room.DOMAIN_OUTDOORS_AIR)
||(mob.location().domainType()==Room.DOMAIN_INDOORS_AIR)
)
{
mob.tell(L("Thi... | 9 |
public static Connection getConnection() {
if (connectionList == null) {
connectionList = new Connection[maxConnections];
connectionInUse = new boolean[maxConnections];
for (int i = 0; i < maxConnections; i++) {
connectionInUse[i] = false;
}
}
boolean allInUse = true;
int empty = -1;
for (int ... | 8 |
public Password(String pass) {
try {
this.setKey();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
try {
this.setupCipher();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {... | 4 |
Instruction get0(int index) {
Instruction instr = borderInstr;
if (index < instructionCount / 2) {
for (int i = 0; i <= index; i++)
instr = instr.nextByAddr;
} else {
for (int i = instructionCount; i > index; i--)
instr = instr.prevByAddr;
}
return instr;
} | 3 |
protected void readChild(XMLStreamReader in) throws XMLStreamException {
String childName = in.getLocalName();
if (Ability.getXMLElementTagName().equals(childName)) {
if (getAttribute(in, "delete", false)) {
String id = in.getAttributeValue(null, ID_ATTRIBUTE_TAG);
... | 9 |
@Override
public void paintComponent(Graphics g)
{
Graphics2D g2d = (Graphics2D)g;
FontMetrics fontMetrics = null;
if (isLoading)
{
g2d.setColor(loadingBgColor);
}
else if (isSelected())
{
g2d.setColor(selectedBgColor);
}
... | 8 |
public void recompute()
{
// Here we check for the tree subdivision.
if( isLeaf() )
{
assert population == particles.size() : "Discepancy in population count of "+id+" ? (population="+population+" p.size="+particles.size()+")";
if( depth < tree.depthmax && population > tree.pmax )
{
mitosis(... | 9 |
public synchronized void init() {
if (inited) {
return;
}
inited = true;
InputStream in = null;
try {
stream.init();
in = stream.getInputStreamForDecodedStreamBytes();
if (logger.isLoggable(Level.FINEST)) {
String co... | 7 |
public boolean isElectricBrakes() {
return electricBrakes;
} | 0 |
public void setHead(Items head) {
this.head = head;
} | 0 |
protected void event(MouseEvent paramMouseEvent)
{
String str = "";
if (this.VerboseEvents) {
if (paramMouseEvent.getID() == 501)
str = "P:";
else if (paramMouseEvent.getID() == 502) {
str = "R:";
}
}
processActionEvent(new ActionEvent(this, 1001, str + this.ActionCo... | 3 |
private final void add(final SongDataEntry songdata) {
final Path path = songdata.getPath();
final DirTree t = walkTo(path.getParent());
if (t == null) {
return;
}
synchronized (t) {
final SongDataEntry sd = t.files.get(path.getFilename());
if (sd == null) {
t.files.put(path.getFilename(), songda... | 4 |
public void positionRelativeTo(GameObject go, int xOffset, int yOffset){
this.setViewDegree(go.getViewDegree());
switch (xOffset) {
case X_OFFSET_LEFT:
this.setX((int)(go.getLocation().getX() - this.getSize().width - 4));
break;
case X_OFFSET_MIDDLE:
this.setX(go.getX());
break;
case X_OFFSET_RIGH... | 6 |
public bloque crearBloque(){
BloqueComodin nuevoBloqueComodin = new BloqueComodin();
Random generador = new Random();
int r = generador.nextInt(2);
if(r == 0){
nuevoBloqueComodin.imagen = new ImageIcon(getClass().getResource("c1.jpg"));
nuevoBloqueComodin.tipoBloque="c1";
}
else if(r == 1){
nuevoBl... | 2 |
public static String readLineFromTokenizerBuffer(InputStream stream) {
{ OutputStringStream buffer = OutputStringStream.newOutputStringStream();
String line = null;
char ch = Stella.NULL_CHARACTER;
char ch2 = Stella.NULL_CHARACTER;
boolean eofP = false;
char newline = Stella.EOL_STRING... | 8 |
public static void main(String[] args) {
int nGramLength = 4;
for (int i = 0; i < args.length; i += 2) {
if (args[i].equals("n-gram")) {
nGramLength = Integer.parseInt(args[i + 1]);
}
}
for(int n = 3; n <= 7; n++) {
System.gc();
... | 8 |
public King (boolean color){
super(color);
} | 0 |
private void selectComponent(int code)
{
if (code == SELECT_DOWN) buttonSelectedIdx++;
else if (code == SELECT_UP) buttonSelectedIdx--;
if (buttonSelectedIdx < 0) buttonSelectedIdx = BUTTON_COUNT - 1;
else if (buttonSelectedIdx >= BUTTON_COUNT) buttonSelectedIdx = 0;
edit_userName.setVisible(fal... | 9 |
public LibraryBean[] showByData(LanguageTypeEnum language, String tags) {
String[] tagsArray = DataController.parseTags(tags);
SearchDAO searchDAO = new SearchDAO(Connector.getInstance());
if (language != LanguageTypeEnum.UNDEFINED && tags.length() > 0) {
return searchDAO.showByLanguageAndTags(language, tagsA... | 6 |
public static int compareSkylinePosition(int[] attributes1, int[] attributes2) {
boolean inf = true, sup = true;
int ret = 0;
for (int i = 0; i < attributes1.length; i++) {
if (attributes1[i] < attributes2[i]) {
sup = false;
} else if (attributes1[i] > att... | 9 |
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 boolean isStringInContext(String pattern,String context, int foundPatternAt) {
int patternSize = pattern.length();
String compareString = "";
while(patternSize > 0) { compareString += context.charAt(foundPatternAt); foundPatternAt++; patternSize--;}
return this.compareTwoStrings(pattern, compareString);
... | 1 |
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerJoin(PlayerJoinEvent event) {
if (Attunements.defaultAttunement != null) {
String playerName = event.getPlayer().getName();
String worldName = plugin.getServer().getWorlds().get(0).getName();
if ((new File(worldName + "/players/" + playerNa... | 2 |
@Override
public boolean isValid() {
boolean isValid = true;
for(Part part : parts)
if (!part.isValid())
isValid = false;
return isValid;
} | 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.... | 6 |
public void insert(Node newNode){
if(root==null){
root=newNode;
root.key=root.hashcode(500); //set root key as 500 by call method
}
else { // if not root
Node curnt=root;
Node parnt;
while (true) { //travese trough the tree to find correct place and joint to tree
parnt=curnt;
if(n... | 5 |
@Override
public void processStimulus(Enumeration criteria) {
WakeupCriterion wakeup;
AWTEvent[] events;
MouseEvent evt;
while (criteria.hasMoreElements()) {
wakeup = (WakeupCriterion) criteria.nextElement();
if (wakeup instanceof WakeupOnAWTEvent) {
events = ((WakeupOnAWTEvent)wakeup).getAWTEvent(... | 9 |
private void setLongitude(double longitude) {
double lng = LatLngTool.normalizeLongitude(longitude);
if (Double.isNaN(lng))
throw new IllegalArgumentException("Invalid longitude given.");
this.longitude = lng;
this.longitudeInternal = doubleToLong(lng);
} | 1 |
public void updateLists(ArrayList newList, String player)
{
if(player.equalsIgnoreCase("player"))
{
playerCards.subList(0, playerCards.size()).clear();
playerCards.addAll(newList);
}
else if(player.equalsIgnoreCase("dealer"))
{
dealerCards.addAll(newList);
}
else if(player.equalsIgnoreCase("de... | 4 |
public void resetStream() throws IOException {
if (this.audioInputStream != null) {
this.audioInputStream.reset();
}
} | 1 |
public Wave24(){
super();
MobBuilder m = super.mobBuilder;
for(int i = 0; i < 700; i++){
if(i % 5 == 0)
add(m.buildMob(MobID.ODDISH));
else if(i % 4 == 0)
add(m.buildMob(MobID.BELLSPROUT));
else if(i % 3 == 0)
add(m.buildMob(MobID.MEOWTH));
else if(i % 2 == 0)
add(m.buildMob(MobID.MANK... | 5 |
private boolean _jspx_meth_c_when_0(javax.servlet.jsp.tagext.JspTag _jspx_th_c_choose_0, PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:when
org.apache.taglibs.standard.tag.rt.core.WhenTag _jsp... | 4 |
private Image findGameElementImage(Element element) {
if (element instanceof Wall) {
return wall;
} else if (element instanceof IdentityDisc) {
IdentityDisc disc = (IdentityDisc) element;
if (disc.charged)
return chargedIdentityDisc;
else
return identitydisc;
} else if (element instanceof Ligh... | 9 |
private void deobfuscateAndDecompile(String... args) throws IOException {
if(!PERFORM_DEOBFUSCATION_AND_DECOMPILE)
return;
Renamer.main(args);
Runtime.getRuntime().exec("cmd /c start decompile.bat");
} | 1 |
public static final boolean cyclicEqual(int[] arr, int[] brr) {
final int len = arr.length;
if (len != brr.length) return false;
if (len == 0) return true;
if (len == 1) return arr[0] == brr[0];
int bstart;
int bincr;
for (bstart = 0; bstart < len; ++bstart) if (brr[bstart] == arr[0]) break;
if (bsta... | 9 |
public void calculateAllMarignals(){
double[] x = new double[_m];
double[] h = new double[_n];
int[] nh1 = new int[_n]; // counts h==1
for (int j=0; j<_n; j++)
nh1[j] = 0;
// initialize first x
for (int i = 0; i<_m; i++)
x[i] = (i+1)%2==0 ? 1 : 0;
for (int t=0; t<this._num_samples; t++){
... | 8 |
public void setAdditionalFields(GameFont gameFont, Map<String, String> data) {
if (data.containsKey("charSpacing")) {
gameFont.setCharSpacing(Integer.parseInt(data.get("charSpacing")));
}
if (data.containsKey("verticalSpacing")) {
gameFont.setVerticalSpacing(Integer.parseInt(data.get("verticalSpacing")));
... | 2 |
@Override
public Double call() throws Exception {
double result = 0.0;
int arg = 0;
for (arg = startValue; arg <= endValue; arg += step) {
result += Math.sin(arg);
}
return result;
} | 1 |
@Override
public boolean equals(Object v) {
boolean retVal = false;
if (v instanceof Conditional){
Conditional a = (Conditional) v;
retVal = a.fact == this.fact && a.NotFlag == this.NotFlag;
}
return retVal;
} | 2 |
public static BufferedImage rotatePicture(BufferedImage originalImage, int rotationDegree) {
Logger.getLogger(ImageReader.class.getName()).entering(ImageReader.class.getName(), "rotatePicture", new Object[] {originalImage, rotationDegree});
if (originalImage != null) {
BufferedImage rotatedB... | 8 |
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.isBlockNormalCube(var2 - 1, var3, var4)?true:(var1.isBlockNormalCube(var2 + 1, var3, var4)?true:(var1.isBlockNormalCube(var2, var3, var4 - 1)?true:var1.isBlockNormalCube(var2, var3, var4 + 1)));
} | 3 |
public synchronized void averageImages() {
if (history.size() < 1) {
textArea.append("No images!\n");
return;
}
int[] smallest = smallestIndices();
int xSize = smallest[0];
int ySize = smallest[1];
int size = history.size();
BufferedImage result = new BufferedImage(xSize, ySize,
BufferedImage.TY... | 4 |
public HashMap<Integer, Double> constructLMSpVct(String[] tokens){
int lmIndex = 0;
double lmValue = 0;
HashMap<Integer, Double> lmVct = new HashMap<Integer, Double>();//Collect the index and counts of projected features.
// We assume we always have the features loaded beforehand.
for(int i = 0; i < tokens.... | 4 |
@Override
public final synchronized Class getIFunctionClassDefinition(final Object targetObject, final Method targetMethod ) throws JFKException{
try {
// check params
if( ClassLoaderStatus.BUSY.equals( status ) )
throw new JFKException("The classloader is busy!");
if( (targetObject == null) || (... | 8 |
public PlayerUi(final Player player, List<String> buttonLabels,
final PrintWriter printToServer, final BufferedReader inFromServer){
super();
this.player = player;
this.printToServer = printToServer;
this.setX(0);
this.setY(0);
int sceneR = randomColorVal();
int sceneG = randomColorVal();
int ... | 4 |
public void setLines(){
//w, h es el punto de origen
CoordenadasCasa = new int [aristas*2][3];
int fila = 0;
while(vertices.size() > 1 ){
double vf = vertices.pop();
double vi = vertices.pop();
// System.out.println("Va de "+v... | 7 |
public boolean wasReleased() {
return wasDown && !isDown;
} | 1 |
public String insertarEstudiante(String codigo, String nombre, String sexo, String programa) {
//<editor-fold defaultstate="collapsed" desc="insertarEstudiante()">
if (!nombre.isEmpty() && !codigo.isEmpty() && !sexo.equals(" ") && !programa.equals(" ")) {
Estudiante estudiante = new Estudian... | 5 |
private void initButtons() {
filterButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
String targetClassName = searchField.getText();
if ( targetClassName.isEmpty() ) {
return;
}
root.removeAllChildr... | 8 |
@Override
public void update()
{
if(Game.instance.input.escape.down)
Game.instance.stopThread();
int i = rand.nextInt(100);
if(i > 90)
{
boolean j = rand.nextBoolean();
if(j)
addParticle(0, 0);
}
super.update();
} | 3 |
void countDown() {
synchronized (lock) {
if (--count <= 0) {
lock.notify();
}
}
} | 1 |
@Override
public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
final TermEnum enumerator = query.getEnum(reader);
try {
// if current term in enum is null, the enum is empty -> shortcut
if (enumerator.term() == null)
return DocIdSet.EMPTY_DOCIDSET;
// else fill into a... | 6 |
public void rejeuPartie()
{
this.E = this.eDepart;
if (this.getCoupSuivant() < this.mesPositions.size())
{
for(int i = 0; i < this.getCoupSuivant(); i++)
{
this.E.deplacerPiece(this.E.getTableau()[this.mesPositions.elementAt(i).getI()][this.mesPositions.elementAt(i).getJ()], this.mesDestinations.ele... | 2 |
protected boolean[] incrementingEquality(AttrTypes attrTypes,
int classType) {
print("incremental training produces the same results"
+ " as batch training");
printAttributeSummary(attrTypes, classType);
print("...");
int numTrain = getNumInstances(), numTest = getNumInstances(),
... | 7 |
public AngelHeadArmor() {
this.name = Constants.ANGEL_HEAD_ARMOR;
this.defenseScore = 11;
this.money = 350;
} | 0 |
private void unTouchAllChipsOfColor(int col){
for (int i=0; i<8; i++) {
for (int j=0; j<8; j++) {
if(board[i][j].returnColor() == col)
board[i][j].untouch();
}
}
} | 3 |
@Test
public void RandomGrid() {
//Make two identical models but one parallel and one sequential
AbstractModel paraModel=DataSetLoader.getRandomGrid(100, 800, 40, new ModelParallel());
AbstractModel seqModel=DataSetLoader.getRandomGrid(100, 800, 40, new Model());
//Step through each model stepNumber
stepMod... | 3 |
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.