text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args) {
final int NOMBRE = 5;
findNumero();
String numero;
int i;
int j;
for(i = 0; i < NOMBRE; i++) {
numero = genNumero();
for(j = 0; j < TAILLE; j++) {
System.out.print(numero.charAt(j));
if(j == 2 || j == 5)
System.out.print(" ");
}
Sy... | 5 |
public void framerateManager()
{
if( lastFPS <=System.currentTimeMillis() )
{
fps=""+frames;
//System.out.println(fps);
lastFPS = System.currentTimeMillis() + 1000;
if(frames<80&&slp>0)
slp--;
else if(frames>110)
slp++;
frames=0;
}
} | 4 |
@Override
public int compareTo(PacketEntry that) {
// compare type first
if (this.underlyingPacket.getPacketType().getTypePriority() > that.underlyingPacket
.getPacketType().getTypePriority()) {
return -1;
} else if (this.underlyingPacket.getPacketType().getTypePriority() < that.underlyingPacket
... | 6 |
public static void decode(final String password, final String codeImagePath, final boolean useOTP, final String otpImagePath, final IDECoderInterface coderInterface) {
Thread t = new Thread() {
@Override
public void run() {
byte[] data = null;
String erro... | 5 |
public void padr()
{
if (("MI").indexOf(ftype)>=0) {/*do nothing */}
else if (("CLD").indexOf(ftype)>=0) addc(false," ");
else addc(false,"\0");
} | 2 |
@Override
public Object execute(Object obj, Object[] args) {
// 获取Mongo查询中需要用到的查询shell和参数
Method[] getterMethods = definition.getGetterMethods();
Integer[] parameterIndexes = definition.getParameterIndexes();
BeanMapper<?> beanMapper = definition.getBeanMapper();
int batchSize = definition.getBatchSize();
... | 9 |
public void insertDates() throws ParseException{
// http://docs.oracle.com/javase/tutorial/essential/io/file.html
// http://docs.oracle.com/javase/tutorial/java/data/manipstrings.html
//
Path file = Paths.get("/home/mark/0-prj/bible/bookchap-v3.csv");
Charse... | 2 |
public void applyPositionChange(Vector3d[] linearChange,
Vector3d[] angularChange, double max) {
double[] angularMove = new double[2];
double[] linearMove = new double[2];
double totalInertia = 0.0d;
double[] linearInertia = new double[2];
double[] angularInertia = new double[2];
for (int i =... | 9 |
public static String getMaxCategoryID(){
try {
ResultSet rs=DB.myConnection().createStatement().executeQuery("select max(CategoryID) from category");
while(rs.next()){
max_category_id=Integer.toString(rs.getInt(1)+1);
}
} c... | 3 |
private void calculate_amplitude() {
int envelope_volume, tremolo_volume, amplitude;
int envelope_panning, mixer_panning, panning_range;
Envelope envelope;
envelope_volume = 0;
if( instrument.volume_envelope_active ) {
envelope = instrument.get_volume_envelope();
envelope_volume = envelope.calculate_amp... | 7 |
public void visit_astore(final Instruction inst) {
final int index = ((LocalVariable) inst.operand()).index();
if (index + 1 > maxLocals) {
maxLocals = index + 1;
}
if (inst.useSlow()) {
if (index < 256) {
addOpcode(Opcode.opc_astore);
addByte(index);
} else {
addOpcode(Opcode.opc_wide);
... | 8 |
public void roll(int pinDown) {
System.out.println(currentFrame + "프레임 " + currentRoll + "번째 투구");
System.out.println("공을 굴립니다! 데구르르르....");
totalRoll++;
currentPin = currentPin - pinDown;
System.out.println(pinDown + "핀을 쳤습니다!");
if (currentRoll == 1 && pinDown == 10) {
System.out.println("대단해요! 스트라이크... | 9 |
@SuppressWarnings("unchecked")
@Override
public String displayQuestionWithAnswer(int position, Object userAnswer) {
String questionStr = (String) question;
ArrayList<String> answerList = (ArrayList<String>) answer;
String userAnswerStr = (String) userAnswer;
boolean correct = false;
if (getScore(userAnswer)... | 4 |
public static List<String> getStrings() {
ArrayList<String> strings = new ArrayList<>();
for (DataType dataType : DataType.values()) {
strings.add(dataType.toString());
}
return strings;
} | 1 |
public int neighbors(){
// Requires indexes of array
int countLiveNeighbors = 0;
for (int offsetY = -1; offsetY <= 1; offsetY++){
for(int offsetX = -1; offsetX <= 1; offsetX++){
if (0 != offsetX || 0 != offsetY) {
int altRow = mod(positionY+offsetY, this.height);
int altCol = mod(positionX+offset... | 5 |
public String run(File f) throws IOException, JAXBException{
if(isUniconvertoInstalled() && isImageMagickInstalled()){
List<String> command = new ArrayList<String>(Arrays.asList("identify", "-verbose",f.getPath()));
String identifyOutput = CommandLine.exec(command, null);
Result res = new Result();
re... | 9 |
public boolean blockCheck() {
for (int k = 0; k < blockX.size(); k++) {
for (int i = 0; i < cb.length; i++) {
for (int j = 0; j < cb.length; j++) {
if (cb[i][j] % 2 != 0 && cb[i][j] != 0) {
if (checkBlackAttack(cb, cb[i][j], j, ... | 9 |
@OnLoad
public void onLoad() {
UserModel user = DataStore.getUser(getParis_userId());
if(user!=null) this.paris_user = user;
ScheduleModel sched = DataStore.getSchedule(getParis_schedId());
if(sched!=null) this.paris_sched = sched;
} | 2 |
@Override
public void run(){
Exception invocationError = null;
setResponse(null);
try {
if (false) throw new Exception("");
// It's a synchronized sectiondue the fact is not guaranteed that the proxy object
// ... | 7 |
public static String[][] getLinks(String webpage) throws IOException, BadLocationException {
doc = new HTMLDocument();
InputStream in = new URL(webpage).openConnection().getInputStream();
InputStreamReader reader = new InputStreamReader(in,"ISO-8859-1");
String[][] matrix = new String[50][50];
int i = 0;
... | 3 |
public void setPrice(float price) {
this.price = price;
} | 0 |
@Override
public void init() {
/*
* 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. Fo... | 7 |
public void visitBaseType(final char descriptor) {
switch (descriptor) {
case 'V':
declaration.append("void");
break;
case 'B':
declaration.append("byte");
break;
case 'J':
declaration.append("lon... | 8 |
public void disableServiceMode(Player player)
{
if(null != player)
{
if(playersInSM.contains(player.getName()))
{
playersInSM.remove(player.getName());
if(player.isOnline())
{
player.sendMessage(ChatColor.RED + "Service-Modus AUS");
... | 3 |
private static void displaySchedules(ResultSet rs)throws SQLException{
StringBuffer bf = new StringBuffer();
while (rs.next()){
bf.append(rs.getDate("work_day")+", ");
bf.append(rs.getTime("work_from")+", ");
bf.append(rs.getTime("work_till")+", ");
bf.append(rs.getBigDecimal("hourly_rate")+", ");
... | 1 |
private void loginPage(){
loginPane = new JPanel();
loginPane.setBackground(SystemColor.activeCaption);
loginPane.setLayout(null);
//Title Image, CareMRS
ImageIcon image_title;
JLabel label1;
image_title = new ImageIcon(getClass().getResource("CareMRS.png"));
label1 = new JLabel(image_title);
label... | 0 |
private void setData( TLanguageFile langFile, TProject pProject )
{
project = pProject ;
if ( langFile != null )
{
mode = EDIT_MODE ;
filenameField.setText( langFile.getFileName() ) ;
String dummy = langFile.getLanguageCode() ;
if ( ( dummy != null ) && ( dummy.length() > 0 ) )
... | 5 |
public void draw() {
Graphics.setColour(192, 192, 255);
for (int i = 0; i < body.size(); i ++) {
Cell c = body.get(i);
if (i >= bullets) Graphics.setColour(255, 255, 255);
Graphics.rectangle(true, c.x * Map.TILE_SIZE, c.y * Map.TILE_SIZE, Map.TILE_SIZE, Map.TILE_SIZE);
}
for (Pellet p : pelletsEating) ... | 3 |
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event){
final Player p = event.getPlayer();
final String pname = p.getName();
if(plugin.getArena(p)!= null){
a = plugin.getArena(p);
plugin.Out.get(a).add(pname);
plugin.Playing.get(a).remove(pname);
plugin.getServer().getScheduler().scheduleSync... | 5 |
public final void setTeacher(final Unit newTeacher) {
Unit oldTeacher = this.teacher;
if(newTeacher == oldTeacher){
return;
}
if (newTeacher == null) {
this.teacher = null;
if(oldTeacher != null && oldTeacher.getStudent() == this){
old... | 9 |
public void paintComponent(Graphics g) {
setScale(); //makes the grid scale according to panel size
if(!background) {
g.drawImage(Player.getImage(), 25, 35, (cellWidth+1)*this.width+1, (cellHeight+1)*this.height+1, null);
background = trace;
}
g.setColor(Color.CYAN);
drawCells(g);
if(gui.getLose()) {... | 3 |
public void loadUsers(){
table=new DefaultTableModel();
table.addColumn("Usuarios");
table.addColumn("Contraseñas");
this.tableUsers.setModel(table);
String[][] user=con.leerDatos("usuarios","user,pass", null);
for(int i=0;i<user.length;i++){
String[] data=new... | 1 |
public void setPWResetFonttype(Fonttype fonttype) {
if (fonttype == null) {
this.pwResetFontType = UIFontInits.PWRESET.getType();
} else {
this.pwResetFontType = fonttype;
}
somethingChanged();
} | 1 |
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 String alignment(ErrorStream obostream) {
String str = "";
int i = 0;
for(WeightedError err : obostream) {
if (err.max() != null && i < size()) {
if(!(ignore_noerr && (err.max().getType() == ErrorTypes.UNC_NO_ERR ||
err.max().getType() == ErrorTypes.OBO_NOERR))) {
if (err.max().getIs() == ge... | 8 |
public void loadConfig(String config)
throws IOException
{
Properties properties = new Properties();
Resource resource=Resource.newResource(config);
properties.load(resource.getInputStream());
_jdbcDriver = properties.getProperty("jdbcdriver");
_url = propert... | 9 |
public static void main(String[] args) throws FileNotFoundException, IOException {
if(args.length < 2){
System.out.println("One or more argument(s) missing.");
System.out.println("EXAMPLE: java -jar JCEPIT.jar -R RabinExampleAutomata.txt");
System.out.println("EXAMPLE: java -jar JCEPIT.jar -B BuchiExample... | 7 |
public void setOptions(String[] options) throws Exception {
String tableString, inputString, tmpStr;
resetOptions();
tmpStr = Utils.getOption("url", options);
if (tmpStr.length() != 0)
setUrl(tmpStr);
tmpStr = Utils.getOption("user", options);
if (tmpStr.length() != 0)
... | 7 |
public static BufferedImage setBlackAndWhiteNonStrict(BufferedImage img) {
for (int i = 0; i < img.getWidth() - 1; i++) {
for (int j = 0; j < img.getHeight() - 1; j++) {
if (img.getRGB(i, j) != -1 && img.getRGB(i, j) != -16777216) {
img.setRGB(i, j, -1);
}
}
}
return img;
} | 4 |
public void actionPerformed(ActionEvent ae) {
if (((MenuItem)ae.getSource()).equals(aboutMenuItem)) {
textArea.setText(aboutText());
setVisible(true);
} else {
textArea.setText(helpText());
setVisible(true);
}
} | 1 |
public void drawNode(Graphics g) {
g.setColor(Color.BLACK);
if (start) {
// if user denotes node to be start
g.setColor(Color.RED);
g.fillRect(x, y, w, w);
} else if (dest) {
//user denoted destination
g.setColor(Color.BLUE);
g.fillRect(x, y, w, w);
} else if (inPath) {
//A* denotes part of... | 5 |
@Override
public void collide(Entity entity) {
if(entity instanceof Hero) {
Hero hero = (Hero)entity;
if(!hero.getTeam().equals(owner)) {
capture(hero.getTeam());
}
} else if(entity instanceof Explosion) {
if(entity != lastExplosion) {
takeDamage();
lastExplosion = (Explosion)entity;
}
... | 4 |
private DalcPlaylist() {
try {
mConnection = DBConnection.getConnection();
} catch (SQLServerException ex) {
}
} | 1 |
private static void blankField(Class<?> enumClass, String fieldName) throws Exception
{
for (final Field field : Class.class.getDeclaredFields())
if (field.getName().contains(fieldName))
{
field.setAccessible(true);
setFailsafeFieldValue(field, enumClass, null);
break;
}
} | 3 |
@EventHandler
public void GiantPoison(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.getGiantConfig().getDouble("Giant.Poison.Dodg... | 6 |
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Type)) {
return false;
}
Type t = (Type) o;
if (sort != t.sort) {
return false;
}
if (sort >= ARRAY) {
... | 7 |
@SuppressWarnings("unchecked")
public synchronized void init(Properties props)
throws BadRealmException, NoSuchRealmException {
super.init(props);
String jaasCtx = props.getProperty(IASRealm.JAAS_CONTEXT_PARAM);
String digestAlgorithm = props.getProperty(PARAM_DIGEST_ALGORITHM,
... | 7 |
@Override
public void setCity(String city) {
super.setCity(city);
} | 0 |
final int getNextChar() {
int next = -1;
if (writeIndex != readIndex) {
next = charQueue[readIndex];
readIndex = readIndex + 1 & 0x7f;
}
return next;
} | 1 |
public static Proposition findMatchingConceivedProposition(Proposition goal) {
{ Keyword testValue000 = goal.kind;
if ((testValue000 == Logic.KWD_PREDICATE) ||
((testValue000 == Logic.KWD_FUNCTION) ||
((testValue000 == Logic.KWD_ISA) ||
(testValue000 == Logic.KWD_EQUIVALENT))... | 8 |
public void addLine(double pXFrom, double pYFrom, double pXTo, double pYTo)
{
int lYFrom;
int lYTo;
// Do some rounding (but not in the way we expect it), limit values
if(pYFrom < pYTo)
{
// Round lYFrom (but .5 is handled oddly)
// 1.5001 - 2.5 -> 1.0001 - 2.0 -> 2
lYFrom = (in... | 9 |
@EventHandler(priority = EventPriority.LOW)
public void onDiabloMonsterDamageEvent(final EntityDamageEvent event) {
if (event.getEntity() instanceof Monster) {
if (plugin.getSetAPI().wearingSet((LivingEntity) event.getEntity())) {
String sName = plugin.getSetAPI().getNameOfSet(
(LivingEntity) event.getE... | 8 |
public void wearAsBackpack(Backpack b)
{
//Take off previous backpack
if(getBackpack() != null) {getBackpack().setWearer(null);}
//If putting on backpack
if(b != null)
{
if(b.getWearer() != null) {b.getWearer().wearAsBackpack(null);}
b.moveToCont... | 4 |
@Override
public void execute(TransitionEvent event) throws Exception {
if(this.out == null) {
this.out = this.bean.getOut();
}
if(!this.rxModeAck) {
send(Statics.RX_HELI_ACK);
this.rxModeAck = true;
}
if(this.sender == null) {
initializeDataSender();
}
if(Statics.ACK.equals(event.getI... | 6 |
@Override
public Order getOrderByID(final Integer id) {
Connection conn = null;
PreparedStatement stmt=null;
Order order=null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
stmt = conn.prepareStatement("SELECT ORDER_ID, ORDER_DATE, U... | 8 |
public DocumentManager(int sizeOfDocSet) {
// call on the ancestors
super();
// set up the data arrays
docOpenStates = new boolean[sizeOfDocSet] ;
docPaths = new String[sizeOfDocSet] ;
docAlfaOrder = new int[sizeOfDocSet] ;
Outliner.documents.addDocumentRepositoryListener(this);
} | 0 |
public String toString() {
String out = "";
for (int i = (height - 1); i >= 0; i--) {
for (int z = 0; z < width; z++) {
if (z == (width - 1)) {
if (board[z][i] == ' ') {
out = out + "*" + System.getProperty("line.separator");
... | 5 |
public void run(){
try {
Socket socket = new Socket(ip, Integer.parseInt(port));
output = socket.getOutputStream();
output.flush();
ooutput = new ObjectOutputStream(socket.getOutputStream());
if(command != null){
FileInputStream finput = new FileInputStream(command);
... | 6 |
public void go() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Being child = being.bear();
Supervisor.getSupervisor().registerBeing(child);
} | 0 |
@Override
public Object receiveData(final Identifiable data) {
Object result = GenericResponses.ILLEGAL_DATA;
if (data instanceof JobTask) {
result = GenericResponses.ILLEGAL_HEADER;
final JobTask jt = (JobTask) data;
final UUID id = jt.getJobId();
fin... | 6 |
public void markSolidOccupant(int x, int y, int width, int height,
int orientation, boolean impenetrable) {
int occupied = 256;
if (impenetrable)
occupied += 0x20000;
x -= insetX;
y -= insetY;
if (orientation == 1 || orientation == 3) {
int temp = width;
width = height;
height = temp;
}
for... | 9 |
public void addAccount(BankAccount account) throws IllegalArgumentException {
if (! canHaveAsAccount(account))
throw new IllegalArgumentException();
accounts.add(account);
} | 1 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
boolean verifie = true;
if(jTxtCreateNom.getText().equals("")){
jTxtCreateNom.setBackground(Color.gray);
verifie = false;
}
if(jTxtCreatePrenom.getText(... | 6 |
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner scanner = new Scanner(System.in);
int startRange = 0;
int endRange = 0;
try {
startRange = scanner.nextInt();
endRange = scanner.nextInt();
} catch (NumberFormatException nfex) {
System.err.println("Invalid input " + ... | 9 |
public static String get(HttpServletRequest request, String name) {
Cookie[] cookies = request.getCookies();
if (cookies == null) {
return null;
}
for (int i = 0; i < cookies.length; i++) {
Cookie cookie = cookies[i];
String cookieName = GetterUtil.getString(cookie.getName());
if (cookieName.equ... | 3 |
public static byte[] decrypt(byte[] data, String publicKey,
String privateKey) throws Exception {
// 生成本地密钥
SecretKey secretKey = getSecretKey(publicKey, privateKey);
// 数据解密
Cipher cipher = Cipher.getInstance(secretKey.getAlgorithm());
cipher.init(Cipher.DECRYPT_MODE, secretKey);
return cipher.doFinal... | 0 |
public Matrix times(Matrix B) {
Matrix A = this;
if (A.N != B.M) throw new RuntimeException("Illegal matrix dimensions.");
Matrix C = new Matrix(A.M, B.N);
for (int i = 0; i < C.M; i++)
for (int j = 0; j < C.N; j++)
for (int k = 0; k < A.N; k++)
... | 4 |
static String findFile(File root, String name) {
// Cleans the results list at the beginning
List<File> results = new ArrayList<File>();
if (!root.isDirectory()) {
throw new IllegalArgumentException("File root is not a directory");
}
File[] files = root.listFiles();
for (int i = 0; i < files.length; i+... | 5 |
public EasySolve solve()
{
EasySolve ret = null;
List<Row> solverows = new ArrayList<Row>();
solverows.addAll(rows);
debugRows("Initial rows", solverows, modulus);
for (int workrowindex = 0, maxindex = solverows.size(); workrowindex < maxindex; workrowindex++)
{
... | 5 |
public boolean accept(File pathName) {
try {
String path = pathName.getCanonicalPath();
if (path.endsWith(".tmx") || path.endsWith(".tsx") ||
path.endsWith(".tmx.gz")) {
return true;
}
} catch (IOException e) {}
return f... | 4 |
@Override
public void insertUpdate(DocumentEvent ev) {
if (ev.getLength() != 1)
return;
int pos = ev.getOffset();
String content = null;
try {
content = textField.getText(0, pos + 1);
} catch (BadLocationException e) {
e.printStackTrace();
}
//Find where the word starts
int w;
for (w = pos... | 8 |
public Set<Integer> getVisited() {
return visited;
} | 0 |
public String getTableFiledName() {
return tableFiledName;
} | 0 |
@Override
public Object getValueAt(final int rowIndex, int columnIndex) {
switch (columnIndex){
case 0: return sorok.get(rowIndex).tipus;
case 1: return sorok.get(rowIndex).sor;
case 2:
final JButton torlesGomb = new JButton(oszlopNevek[columnIndex]);
... | 8 |
public static SceneNode trace(SpaceRegion region, Vec3 position,
Vec3 direction) {
SceneNode returned;
if ( region instanceof SpaceRegion && collidesWithRegion( region, position, direction ) ) {
if ( region instanceof GroupSector ) {
for ( SceneNode sn : ((GroupSector)region).getSons()) {
if ( s... | 6 |
public void copyStateTo(RrdUpdater other) throws IOException, RrdException {
if(!(other instanceof Archive)) {
throw new RrdException(
"Cannot copy Archive object to " + other.getClass().getName());
}
Archive arc = (Archive) other;
if(!arc.consolFun.get().equals(consolFun.get())) {
throw new RrdExcept... | 5 |
public boolean getLinhaVenda(int id) throws ExceptionGerenteVendas {
if (atual.getLinhaVenda(id)) {
return true;
}
throw new ExceptionGerenteVendas("Nenhuma venda encontrada nesta data");
} | 1 |
private void newMethod(GameBoardMark playerMark, int[] tempRowForChecks, int sign, int foo, int bar, int baz) {
for (int b1 = 0; b1 < 5; b1++) {
for (int b2 = 0; b2 < 5; b2++) {
int positionB = b1 * GameBoard.SQUARES_PER_SIDE + b2;
if (gameBoard.hasEmptyValueAt(GameBo... | 9 |
public static <T extends NucleotideFasta>NCBI_Q_TBLASTN newDefaultInstance(List<T> query,
List<String> query_IDs) {
return new NCBI_Q_TBLASTN<T>(query, query_IDs) {
/**
* Combines the formQuery() sendBLASTRequest() extractRID() and
... | 8 |
private boolean checkValidPosition(int positionX, int positionY) {
boolean ret;
boolean xOutOfBounds = positionX > getPlatformSizeX() || positionX < 0;
boolean yOutOfBounds = positionY > getPlatformSizeY() || positionY < 0;
boolean collision = false;
ArrayList<Rover> otherRove... | 7 |
public static int binarySearch(int key, int[] list){//二分查找,返回key的索引。或者若无key,该key应该在位置(负数)
int low = 0;
int high = list.length - 1;
int middle = 0;
while(low <= high){
middle = low + (high - low)/2;
if(key < list[middle]) high = middle - 1;
else if(key > list[middle]) low = middle + 1;
else return mi... | 3 |
@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null
|| (object instanceof String && ((String) object).length() == 0)) {
return null;
}
if (object instanceof Usuario) {
Usuario o = (U... | 4 |
@Override
public void move(Excel start, Excel finish) {
for(Excel ex: coloredEx)
{
if (ex.getX() == start.getX() && ex.getY() == start.getY())
{
Dx += finish.getX() - start.getX();
Dy += finish.getY() - start.getY();
setColoredExes();
return;
}
}
} | 3 |
public void visitInstanceOfExpr(final InstanceOfExpr expr) {
if (previous == expr.expr()) {
previous = expr;
expr.parent.visit(this);
}
} | 1 |
@Override
public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args){
if(commandLabel.compareToIgnoreCase("gelplacement") == 0){
if(sender.hasPermission("portalgel.gelplacement")){
if(args.length == 1){
if(args[0].compareToIgnore... | 5 |
protected boolean disconnectInput(NeuralConnection i, int n) {
int loc = -1;
boolean removed = false;
do {
loc = -1;
for (int noa = 0; noa < m_numInputs; noa++) {
if (i == m_inputList[noa] && (n == -1 || n == m_inputNums[noa])) {
loc = noa;
break;
}
}
if (loc >= 0... | 8 |
protected void logRequest( Class<? extends HttpRequestBase> reqType, Request request) {
if (debugRequests) System.err.println(reqType.getSimpleName()+" "+request);
} | 2 |
public boolean checkAccusation(Card person, Card room, Card weapon){
ArrayList<Card> accusation = new ArrayList<Card>();
boolean personMatch = false, roomMatch = false, weaponMatch = false;
accusation.add(person);
accusation.add(room);
accusation.add(weapon);
for(Card temp : solution){
if(person.name... | 7 |
public <T extends ElementType<E>> boolean positiveLookaheadBefore(ElementType<E> before,
T... expected) {
E lookahead;
for (int i = 1; i <= elements.length; i++) {
lookahead = lookahead(i);
if (before.isMatchedBy(lookahead)) {
break;
}
for (ElementType<E> type : expected) {... | 4 |
protected void processKeyEvent(KeyEvent e) {
if (e.getID() == e.KEY_PRESSED) {
// if backspace is pressed, clear the map
if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE &&
inputManager.getMaps(action).size() > 0)
{
inputManager.clearMap(acti... | 3 |
public Atividade SelectATividadePorNome(String NomeAtividade) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
Atividade atividade = null;
try {
conexao = BancoDadosUtil.getConnection();
com... | 7 |
@Override
public void run() {
while(true){
// isIdle = false;
if (serverHandler!=null) {
serverHandler.run(); //core service
}
// isIdle = true;
thrdPlInst.returnThread(this);
synchronized(this) {
try {
this.wait();
} catch (InterruptedException e) {
// TODO A... | 3 |
public void rekenAf(Persoon pers){
hoeveelheidPersonen += 1;
double totaalPrijs=0.00;
boolean kkh=false; //kkh=kortingskaarthouder
double kortingspercentage=0.00;
boolean kortingMax=false;
double maxKorting=0.00;
double korting=0.00;
//als de persoon een k... | 8 |
public void move() {
if (!inPlay)
return;
pos.x += dx;
pos.y += dy;
if (pos.x < xrangemin) {
pos.x = xrangemin;
dx = -dx;
}
if (pos.x > xrangemax) {
pos.x = xrangemax;
dx = -dx;
}
if (pos.y < yrangemin) {
inPlay = false;
game.updateScore(0);
}
if (pos.y > yrangemax) {
i... | 5 |
*/
private void positionMap(Tile pos) {
Game gameData = freeColClient.getGame();
int x = pos.getX(),
y = pos.getY();
int leftColumns = getLeftColumns(),
rightColumns = getRightColumns();
/*
PART 1
======
Calculate: bottomRow, topRow, ... | 8 |
public static boolean listaHasonlo( LinkedList<Integer[]> lista, Integer[] parok )
{
for( Integer[] i : lista )
{
int j=0;
for( j=0; j<6; j++ )
{
if( i[j] != parok[j] )
break;
}
if(j == 6)
return true;
}
return false;
} | 4 |
static Map<String, Integer> getMethods(final String program) {
char[] chars = program.toCharArray();
Map<String, Integer> methodMap = new HashMap<String, Integer>();
int methodCount = 0;
for (int p = 0; p < chars.length; p++) {
char c = chars[p];
if (c == '[') {
... | 2 |
@Test
public void verifyMethodAnnotationsFound()
{
assert this.foundMethodAnnotation;
} | 0 |
public AbstractPlay get(int number) {
return everyPlay.get(number);
} | 0 |
public LinkedList<Node> allNeighbours(int x, int y) {
LinkedList<Node> neighbours = new LinkedList<Node>();
int thisX = x - 1;
int thisY = y - 1;
// Prevent Nodes on the edge of the map from being added as neighbours.
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (i == 1 && j == 1) {
... | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.