text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void acquireFocus() {
Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
Component content = getCurrentDockable();
while (focusOwner != null && focusOwner != content) {
focusOwner = focusOwner.getParent();
}
if (focusOwner == null) {
EventQueue.... | 3 |
public static void printMap(Map<? extends Object, ? extends Object> m) {
for (Object o : m.keySet()) {
System.out.println(o.toString() + ": " + m.get(o).toString());
}
} | 3 |
public String preCreateTopic() {
objectives = objModel.getAll();
boolean check = true;
if (objectives.isEmpty()) {
addFieldError("topic.objId", "Objective List is empty");
check = false;
}
if (check) {
for (ObjectiveObj objectiveObj : objecti... | 3 |
public void updatePosition() {
if (xPos < xDestination)
xPos+= 2;
else if (xPos > xDestination)
xPos-= 2;
if (yPos < yDestination)
yPos+= 2;
else if (yPos > yDestination)
yPos-= 2;
if (xPos == xDestination && yPos == yDestination) {
if (command==Command.GoToSeat) agent.msgAnimationFinishedGoT... | 9 |
public Game(Playmode playmode){
this.playmode = playmode;
this.upcomingMatches = new PriorityQueue<>();
this.finishedMatches = new PriorityQueue<>();
this.runningMatch = null;
this.alstLeftUser = new ArrayList<>();
ArrayList<User> alstUsers = new ArrayList<>();
for (Team team : playmode.getTeams()) {
... | 2 |
public void Faz_Tudo(String arq, int max)
{
Leitor le;
Celula[][] mapa_lido;
int[][] mundo_int = null;
int t = 0;
le = new Leitor();
try
{
mundo_int = le.LerArquivo(arq);
}
catch(Exception e)
{
e.printStackTrace();
}
l = le.Getl();
c = le.Getc();
mapa_lido = mIntTomCelula(mundo_int... | 7 |
public boolean getBoolean(String key) throws JSONException {
Object object = this.get(key);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String)object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.T... | 6 |
public boolean waitForMenuSelection(User user) {
int menuOptionSelected = -1;
Scanner reader = new Scanner(System.in);
if(!TESTRUN){
menuOptionSelected = reader.nextInt();
menuOptionSelected --;
}
else{
Random random = new Random();
... | 7 |
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 long parseLong( long bitMask, boolean signed ) throws IOException {
int sign = 1;
int c = nextNonWhitespace();
position(-1);
if( c == '+' ) {
// Unclear if whitespace is allowed here or not
c = read();
} else if( c == '-' ) {
... | 9 |
public void flatTire()
{
for (Police p : data.getLevel().getPolices())
{
if (p.containsPoint(x + INTERSECTION_RADIUS, y + INTERSECTION_RADIUS))
{
float oldVelocityX = p.getVx();
float oldVelocityY = p.getVy();
p.setVx(0);
... | 6 |
@Override
public void decreaseStock(int id, int amount) {
int stock = findProductStock(id) - amount;
String sql = "UPDATE product SET stock='" + stock
+ "' WHERE productid='" + id + "';";
Connection con = null;
try {
con = getConnection();
PreparedStatement statement = con.prepareStatement(sql... | 2 |
public void setSeqID(String seqID) {
this.seqID = seqID;
} | 0 |
private void AlarmSet(int prevmode)
{
if (prevmode != MODE_ASET) {
inputval = alarmtime;
}
if (bl && cursor < 5) {
cursor++;
} else if (br && cursor > 0) {
cursor--;
} else if (bu) {
inputval = IncTime(inputval, cursor);
} else if (bd) {
if (GetDigit(inputval, cursor) > 0) {
inputval = ... | 8 |
public Tempo diferencaEmTempo(Tempo t) {
int dif = diferencaEmSegundos(t);
int s = dif % 60;
dif = dif / 60;
int m = dif % 60;
int h = dif / 60;
return new Tempo(h, m, s);
} | 0 |
public int getValue(int place) {
ListElement current = head;
if (place <= count) {
for (int i = 1; i < place; i++) {
current = current.next;
}
return current.value;
} else {
return error;
}
} | 2 |
public Tile getTileLayer(Layer layer, int x, int y) {
int[] SelectedLayer = layer.tiles;
if(x < 0 || y < 0 || x >= width || y >= height) return VoidTile;
if(SelectedLayer[x + y * width] < TileIDS.size()) {
return TileIDS.get(SelectedLayer[x + y * width]);
} else {
return EmptyTile;
}
} | 5 |
private void hold() {
if (holdUsed) {
// TODO: Alert the user they can't switch again with perhaps a sound
return;
}
game.fallTimer.stop();
if (holdBlock != null) {
Block temp = gameBlock;
gameBlock = holdBlock;
holdBlock = temp;
gameBlock.freeGrid();
holdBlock.insert(holdGrid... | 4 |
@Override
public void deserialize(Buffer buf) {
messageId = buf.readShort();
if (messageId < 0)
throw new RuntimeException("Forbidden value on messageId = " + messageId + ", it doesn't respect the following condition : messageId < 0");
int limit = buf.readUShort();
dialog... | 3 |
public Object clone() {
final Expr[] p = new Expr[params.length];
for (int i = 0; i < params.length; i++) {
p[i] = (Expr) params[i].clone();
}
return copyInto(new CallMethodExpr(kind, (Expr) receiver.clone(), p,
method, type));
} | 1 |
private void printBufferState() {
for (int i = 0; i < buffer.length; ++i) {
System.out.print(buffer[i] + " ");
}
System.out.println();
} | 1 |
public static double longestCommonSubsequence(ArrayList<Node> pageNodes1,ArrayList<Node> pageNodes2){
int[][] num=new int[pageNodes1.size()+1][pageNodes2.size()+1];
//Iterator it1=pageNodes1.iterator();
//Iterator it2=pageNodes2.iterator();
for(int i=1;i<=pageNodes1.size();i++){
for(int j=1;j<=pageNodes2.si... | 7 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
public String readLine(){
if (lines.size() > 0){
return lines.remove(0);
}
return null;
} | 1 |
public void reset()throws TableException{
String createString;
java.sql.Statement stmt;
try{
createString = "drop table " + CUSTOMER_TABLE_NAME + ";";
stmt = sqlConn.createStatement();
stmt.executeUpdate(createString);
} catch (java... | 3 |
@EventHandler
public void serverInit(FMLServerStartedEvent event)
{
MCUtil.checkVersion(Side.SERVER);
} | 0 |
public JobSchedulerBuilder withJobGroup( String jobGroup )
{
this.jobGroup = jobGroup;
return this;
} | 0 |
public static void main(String[] args) {
//start loc
if (args.length > 0) {
try {
int startLocation = Integer.parseInt(args[0]);
//check for loc
if ( startLocation >= 0 && startLocation <= MAX_LOCALES) {
currentLocale = startLocation... | 9 |
public static void main(String[] args) {
try {
ObjectMapper objectMapper = new ObjectMapper();
Map<String,String> map = new HashMap<String,String>();
map.put("name", "sergii");
String json = objectMapper.writeValueAsString(map);
System.out.printl... | 1 |
private Meeting getSelectedData(){
selectedData = null;
int[] selectedRow = table.getSelectedRows();
int[] selectedColumns = table.getSelectedColumns();
System.out.println(table.getSelectedColumn());
//Fix for exeption når man trykker på kollonne 0
if(table.getSelecte... | 4 |
private String readUTF(int index, final int utfLen, final char[] buf) {
int endIndex = index + utfLen;
byte[] b = this.b;
int strLen = 0;
int c;
int st = 0;
char cc = 0;
while (index < endIndex) {
c = b[index++];
... | 7 |
void addAlmostSet( int offset, BitSet bs, BitSet missing, String frag )
{
this.versions.or(bs);
if ( this.offset == -1 )
this.offset = offset;
this.state = SectionState.almost;
for (int i = bs.nextSetBit(1); i>= 0;
i = bs.nextSetBit(i+1))
{
... | 5 |
private void push(JSONObject jo) throws JSONException {
if (this.top >= maxdepth) {
throw new JSONException("Nesting too deep.");
}
this.stack[this.top] = jo;
this.mode = jo == null ? 'a' : 'k';
this.top += 1;
} | 2 |
public void startTargets(int square, int steps) {
visitedMtx = new HashMap<Integer, Boolean>();
for(int i = 0; i < NUMBEROFSPACES; i++) {
visitedMtx.put(i, false);
}
visitedMtx.put(square, true);
calcTargets(square, steps);
} | 1 |
public synchronized double[][] getICVectors( )
{
if ( icVectors == null )
{
// calculate independent component vectors and readd the mean
icVectors = Matrix.mult(separatingMatrix, inVectors);
}
return(icVectors);
} | 1 |
public boolean addUser(ClientDB client) {
// TODO Auto-generated method stub
if (checkSpace()) {
if (checkDuplicate(client.getUserID())) {
for (int i = 0; i < clientObj.length; i++) {
if(clientObj[i]==null){
clientObj[i]=client;
return true;
}
}
}
else{
return false;
}
... | 4 |
private Temperature(int conversionFactor, String name) {
super(conversionFactor, name);
} | 0 |
public static void initializeFileInputStream(InputFileStream self) {
if (!(self.filename != null)) {
return;
}
{ String filename = Stella.translateLogicalPathname(self.filename);
{ Keyword testValue000 = self.ifNotExistsAction;
if ((testValue000 == Stella.KWD_ABORT) ||
(tes... | 8 |
@Override
public double evaluate(int[][] board) {
int x = -1, y = -1;
int max = -1;
int n = board.length;
int m = board[0].length;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (board[i][j] > max) {
max = board[... | 3 |
public static boolean parseBoolean(CharSequence chars) {
return (chars.length() == 4) &&
(chars.charAt(0) == 't' || chars.charAt(0) == 'T') &&
(chars.charAt(1) == 'r' || chars.charAt(1) == 'R') &&
(chars.charAt(2) == 'u' || chars.charAt(2) == 'U') &&
(chars.charAt... | 8 |
private Input sIB_ProcessInput() {
double valSum = 0.0;
for (int i = 0; i < m_numInstances; i++) {
valSum = 0.0;
for (int v = 0; v < m_data.instance(i).numValues(); v++) {
valSum += m_data.instance(i).valueSparse(v);
}
if (valSum <= 0) {
if(m_verbose){
System.out.format("Instance %s... | 9 |
protected void syncSpi() throws BackingStoreException
{
if (isRemoved()) return;
final File file = FilePreferencesFactory.getPreferencesFile();
if (!file.exists()) return;
synchronized (file) {
Properties p = new Properties();
try {
p.load(new FileInputStream(file));
StringBuilder sb = new Str... | 7 |
private String getDescription() {
String desc = "@MongoFind(value=[" + this.getParsedShell().getOriginalExpression() + "],batchSize=["
+ batchSize + "]),@MongoMapper(" + beanMapper.getClass() + ")";
if (skipIndex != -1) {
desc = ",@MongoSkip(" + skipIndex + ")";
}
if (limitIndex != -1) {
desc = ",@M... | 5 |
public Long open() {
Shell parent = getParent();
shell = new Shell(parent, SWT.TITLE | SWT.BORDER | SWT.APPLICATION_MODAL);
shell.setText("Modeling time input");
shell.setLayout(new GridLayout(2, true));
Label label = new Label(shell, SWT.NULL);
label.setText("Please enter new modeling time:")... | 6 |
private String readChars ( int ln )
{
byte[] b = new byte[ln];
try { fidx.read(b); } catch (IOException e) { e.printStackTrace(); }
String s = "";
for(int i=0;i<ln;i++) s+=(char)b[i];
return s;
} | 2 |
public Map<Integer, Integer> getGeneSpans(String text) {
Map<Integer, Integer> begin2end = new HashMap<Integer, Integer>();
Annotation document = new Annotation(text);
pipeline.annotate(document);
List<CoreMap> sentences = document.get(SentencesAnnotation.class);
for (CoreMap sentence : sentences) {... | 5 |
public BodypartSummaryPanel(BodyPart bodypart) {
super();
this.bodypart = bodypart;
} | 0 |
private Authentication parseAuthentication(XmlPullParser parser) throws Exception {
Authentication authentication = new Authentication();
boolean done = false;
while (!done) {
int eventType = parser.next();
if (eventType == XmlPullParser.START_TAG) {
if (p... | 8 |
static Tex makesh(Resource res) {
BufferedImage img = res.layer(Resource.imgc).img;
Coord sz = Utils.imgsz(img);
BufferedImage sh = new BufferedImage(sz.x, sz.y,
BufferedImage.TYPE_INT_ARGB);
for (int y = 0; y < sz.y; y++) {
for (int x = 0; x < sz.x; x++) {
long c = img.getRGB(x, y) & 0x00000000fffff... | 2 |
public List<Entity> getEntities() {
if (sim != null)
return Collections.synchronizedList(Collections.unmodifiableList(sim.getWorld().getEntities()));
else
return new ArrayList<Entity>();
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Position other = (Position) obj;
if (orientation != other.orientation)
return false;
if (point == null) {
if (other.point != null)
re... | 7 |
public ReferenceList getReferenceList() {
return referenceList;
} | 0 |
public void close() throws IOException {
reader.close();
} | 0 |
protected void checkErrors(String line, String caller) throws IOException, LoginException
{
// System.out.writeln(line);
// empty response from server
if (line.isEmpty())
// UnknownError...?? changed to IOException
throw new IOException("Received empty response from serv... | 9 |
@Override
public boolean onCommand(CommandSender sender, Command command, String sabel, String[] args) {
if (Utils.commandCheck(sender, command, "anima")) {
Player player = (Player) sender;
if (args.length == 0) {
int animaBarSize = 130;
int maxanima = MPlayer.getLevel(player) * 100;
int maxsuban... | 9 |
@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 Agenda)) {
return false;
}
Agenda other = (Agenda) object;
if ((this.agendaPK == null && other.agendaPK != null... | 5 |
private static void mergeMessageSetExtensionFromBytes(
ByteString rawBytes,
ExtensionRegistry.ExtensionInfo extension,
ExtensionRegistryLite extensionRegistry,
Message.Builder builder,
FieldSet<FieldDescriptor> extensions) throws IOException {
FieldDescriptor field = exten... | 5 |
@Override
public void processCas(CAS aCas) throws ResourceProcessException {
// TODO Auto-generated method stub
JCas jcas;
try {
jcas = aCas.getJCas();
} catch (CASException e) {
throw new ResourceProcessException(e);
}
FSIterator<org.apache.uima.jcas.tcas.Annotation> it = jcas.ge... | 6 |
private int playerPieceTypeRemaining(HantoPlayerColor player, HantoPieceType pieceType) {
if (player == HantoPlayerColor.BLUE) {
return bluePiecesLeft.get(pieceType);
}
else {
return redPiecesLeft.get(pieceType);
}
} | 1 |
public static void main(String[] args) {
int N = 12;
for (int i = 1; i <= N; i++)
System.out.println(i + ": " + fib(i));
} | 1 |
public double executaTorno()
{
double menorTempo = getTempoUniversal()+1;
ordenaPeloTempoDeSaidaT(maquinaTorno);
for(int i=maquinaTorno.size()-1 ; i>=0 && maquinaTorno.size()>0 && verificaMaquinaTorno(maquinaTorno) ; i--) //percorre a lista de maquina e verifica os status dos rolamentos
{
if(maquinaTo... | 8 |
public void update() {
growVillages();
chunksLock.readLock().lock();
try {
for (Chunk c : chunks)
{
if (c.update() && !toDraw.contains(c))
{
toDraw.add(c);
}
}
} finally {
chunksLock.readLock().unlock();
}
ArrayList<Village> villages = getVillages();
for (Village v : villag... | 4 |
private boolean findEntry() {
Cursor waitCursor = shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT);
shell.setCursor(waitCursor);
boolean matchCase = searchDialog.getMatchCase();
boolean matchWord = searchDialog.getMatchWord();
String searchString = searchDialog.getSearchString();
int column = searchDialog.ge... | 6 |
public boolean isAutarkic(IGroup g) {
if (g.zgetGroupType() == GroupType.PACKAGE) {
return false;
}
if (g.zgetGroupType() == GroupType.INNER_ACTIVITY) {
return true;
}
if (g.zgetGroupType() == GroupType.CONCURRENT_ACTIVITY) {
return true;
}
if (g.zgetGroupType() == GroupType.CONCURRENT_STATE) {
... | 9 |
@EventHandler(priority=EventPriority.LOW, ignoreCancelled = true)
final void onStructureGrow(StructureGrowEvent event){
if (panic){
event.setCancelled(true);
return;
}
if (!monitorStructureGrowth) return;
final List<Location> affected = new LinkedList<Location>();
for ( BlockState state : event.getBloc... | 7 |
public String toString() {
// only ZeroR model?
if (m_ZeroR != null) {
StringBuffer buf = new StringBuffer();
buf.append(this.getClass().getName().replaceAll(".*\\.", "") + "\n");
buf.append(this.getClass().getName().replaceAll(".*\\.", "").replaceAll(".", "=") + "\n\n");
buf.append("War... | 9 |
@Override
public IAttemptClientConnect getAttemptClientConnect() {
return attemptClientConnect;
} | 0 |
@Override
public Date deserialize (JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException {
if (!(json instanceof JsonPrimitive)) {
throw new JsonParseException("Date was not string: " + json);
}
if (type != Date.class) {
throw new ... | 5 |
public static String base64Encode(byte[] src) {
int unpadded = (src.length * 8 + 5) / 6;
int padding = 4 - (unpadded % 4);
int d = 0;
int e = 3;
long buffer = 0;
if (padding == 4)
padding = 0;
char[] encoded = new char[unpadded + padding];
whi... | 6 |
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 |
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String data = "";
response.setContentType("text/plain");
response.setCharacterEncoding("UTF-8");
PrintWriter writer = response.getWriter();
String dbDriver = "org.postgresql.Driver";
... | 5 |
private boolean getModinfoStringFromJAR(File jarfile)
{
StringBuilder builder = new StringBuilder();
String inputFile = "jar:file:/" + jarfile.getAbsolutePath() + "!/mcmod.info";
InputStream in = null;
try
{
URL inputURL = new URL(inputFile);
JarURLConnection conn = (JarURLConnection) inputURL.o... | 5 |
public boolean[][] createWallMap(TiledMap map) {
if (map == null)
return null;
int layer = map.getLayerIndex("Tile Layer 3");
boolean[][] wallMap = new boolean[32][24];
for (int j=0; j<wallMap[0].length; ++j)
for (int i=0; i<wallMap.length; ++i)
if (map.getTileId(i, j, layer) != 0)
wallMap[i][... | 4 |
public synchronized boolean setMaster(final CloudNode cloudNode) {
Objects.requireNonNull(cloudNode, "The given cloud node must not be null.");
final Lock lock = Holder.INSTANCE.getInstance().getLock("my-distributed-lock");
lock.lock();
try {
final NodeRecord masterRecord =... | 3 |
public void movement(VectorShape v) {
v.setX(v.getX() + v.getVelX());
v.setY(v.getY() + v.getVelY());
if (v.getX() > this.width) {
v.setX(0);
}
if (v.getX() < 0) {
v.setX(width);
}
if (v.getY() > this.height) {
v.setY(0);
... | 6 |
private void printGridletList(GridletList list, String name,
boolean detail, double gridletLatencyTime[])
{
int size = list.size();
Gridlet gridlet = null;
String indent = " ";
System.out.println();
System.out.println("============= OUTPU... | 3 |
static void Algoritmo(MatingPool Pool, int Repeticiones)
{
while(Repeticiones > 0)
{
ArrayList<Lista> NuevaPoblacion = new ArrayList<>();
NuevosCandidatos.clear();
System.out.println("\nNUEVOS CANDIDATOS BASADOS EN EL PORCENTAJE DE FITNES... | 6 |
public static <TElement, TCollection extends Collection<TElement>> TCollection addAllFlat(final TCollection target, final Iterable<? extends Iterable<? extends TElement>> sources) {
if (target != null && sources != null) {
for (Iterable<? extends TElement> source : sources) {
for (TE... | 7 |
@Override
public double getExpectation() throws ExpectationException {
if (nu > 2) {
return (double) 1 / (nu - 2);
} else {
throw new ExpectationException("InverseChiSquared expectation nu > 2.");
}
} | 1 |
public Network() throws Exception {
port=6740;
while(!portChosen){
if(checkPort(port))portChosen=true;
else if(port<6750){port+=1;}
}
localAddress = (Inet4Address)Inet4Address.getLocalHost();
sender = new Sender();
receiver = new Receiver(po... | 3 |
private boolean validate_otps(List<String> otps, NameCallback nameCb) throws LoginException {
boolean validated = false;
for (String otp : otps) {
log.trace("Checking OTP {}", otp);
VerificationResponse ykr;
try {
ykr = this.yc.verify(otp);
} catch (YubicoVerificationException e) {
log.warn("E... | 6 |
@Override
public int append(final NodeLike<Node<N, E>, E>[] out, final int pos) {
if(pos == 0) {
out[0] = this;
return 1;
}
@SuppressWarnings("unchecked")
final NodeLike<N, E>[] buffer = (NodeLike<N, E>[]) out;
final NodeLike<Node<N, E>, E> left = out[pos - 1];
if(left instanceof ... | 6 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=getTargetAnywhere(mob,commands,givenTarget,false,true,true);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final b... | 7 |
public Carte(){
map = new Element[LARGEUR_CARTE][HAUTEUR_CARTE];
// Génération de la map
for(int x = 0; x < LARGEUR_CARTE; x++){
for(int y = 0; y < HAUTEUR_CARTE; y++){
map[x][y] = new Element(new Position(x, y),BackgroundEnum.plain);
}
}
} | 2 |
protected void showPopup(MouseEvent event) {
// Should we show a popup menu?
if (event.isPopupTrigger()) {
Point p = getView().transformFromAutomatonToView(event.getPoint());
if (lastClickedState != null && shouldShowStatePopup()) {
stateMenu.show(lastClickedState, getView(), p);
} else {
emptyMenu... | 3 |
public static final boolean isAngleWallParallel(double angle) {
return Utils.isNear(angle, 0) ||
Utils.isNear(angle, HALF_PI) ||
Utils.isNear(angle, PI) ||
Utils.isNear(angle, ONE_HALF_PI) ||
Utils.isNear(angle, TWO_PI);
} | 4 |
public void update(){
if(!ctrl.isRunning()){
start();
}
checkEndConditions();
if(ctrl.isRunning()){
timer.addMillis((lastCount-ctrl.getEnemyShipCount())*500);
lastCount=ctrl.getEnemyShipCount();
if(ctrl.getEnemyShipCount()==0){ ... | 4 |
public static Node getOtherNode(Edge edge, Node node) {
for (Node n : edge.getAdjacent()) {
if (!n.equals(node)) {
return n;
}
}
return null;
} | 2 |
private void removePoints(int id) throws SQLException
{
/*
* Gets the number of group matches where the team id is playing or has played.
* The -1 is because the arraylist is not starting on 1 but 0, so 1 lower.
*/
int matches = matchmgr.showCountTeamGroup(id) - 1;
... | 8 |
public void decrement(int by) {
// if given value is negative, we have to increment
if (by < 0) {
decrement(Math.abs(by));
return;
}
// check if we would overflow
int space_down = value - min;
if (by > space_down) {
// we simply use min
value = min;
} else {
// no overflowing, this is easy... | 2 |
public double centerControl() {
if (getKingLocation(getPlayerToMove().toLowerCase())==null) return -10000000;
if (getKingLocation(getPlayerToMove() == "W"? KrakenColor.BLACK_ITEM:KrakenColor.WHITE_ITEM)==null) return 10000000;
int myPuntuation=0;
String itemColor = playerToMove == W ? KrakenColor.WHITE_ITEM:Kra... | 8 |
public String getEmployeeName() {
return employeeName;
} | 0 |
private Random getInstanceOfRandom(long seed) throws InitializationError
{
String randomClass = System.getProperty("jcheck.random");
if (randomClass != null) {
try {
Class<?> random = Class.forName(randomClass);
Constructor<?> randConst = random.getConstru... | 4 |
Template loadTemplate(String name, int[] array)
{
return new Template(name, loadArray(array));
} | 0 |
@Override
public Object getValueAt(int row, int col)
{
switch (col)
{
case COL_FULL_ACCT : return fullAccounts.get(row);
case COL_TANK_NUM : return tankNums.get(row);
case COL_SVC_NUM : return svcNums.get(row);
case COL_NAME : return names.get(row);
case COL_REF_NUM : retur... | 9 |
public void put(Object o)
{
stackList.add(o);
} | 0 |
private static HashMap<String, String> listTests(String dirPath, int level) {
HashMap<String, String> listoffiles = new HashMap<String,String>();
try{
File dir = new File(dirPath);
File[] firstLevelFiles = dir.listFiles();
if (firstLevelFiles != null && firstLevelFiles.length > 0) {
... | 5 |
public void train(Pattern p) {
// propagate; set activation Values
this.propagate(p, false);
// run over all Layers from the bottom to the top; Except the Input
// Layer
// Backpropagation
for (int i = neurons.size() - 1; i > 0; i--) {
for (int s = 0; s < neurons.get(i).size(); s++) {
Neuron neuro... | 7 |
public void showLine(int lineNumber) {
for (int i = 0; i < fieldSize; i++) {
showCell(i,lineNumber);
}
} | 1 |
public void mapTileDeckClicked()
{
if (((Window) getTopLevelAncestor()).getPlayer().isPlayersTurn())
{
if (GameHandler.instance.getCurrentState() == GameState.tilePlacement)
{
if (GameHandler.instance.getMap().getTempTile() == null)
{
MapTile tile = GameHandler.instance.getTileDeck().getNextCard... | 9 |
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.