text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetc... | 8 |
@After
public void tearDown() {
} | 0 |
public String getFirstPropertyValue(String name){
Property<String> prop = getFirstProperty(name);
if(prop == null){
return null;
}
if(prop.getValue() == null){
return null;
}
return prop.getValue();
} | 2 |
public void setup(Sprite.Drawer d, Coord cc, Coord off) {
init();
if (spr != null)
spr.setup(d, cc, off);
} | 1 |
@RequestMapping(value = {"/MovimientosBancarios"}, method = RequestMethod.GET)
public void readAll(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse) {
try {
ObjectMapper jackson = new ObjectMapper();
String json = jackson.writeValueAsString(movimientoBancarioD... | 2 |
protected static SuperString findWordAndPos(String s, int caretPos) {
caretPos--;
if (s.length() != 0 && containsSeparator(s, caretPos)) {
caretPos--;
} else if (caretPos > 0) {
int front;
int end;
do {
front = caretPos--;
} while (caretPos != -1 && !containsSeparator(s, caretPos));
do {
... | 7 |
public void recordRep(long zobrist) {
// TODO: Make this smoother with a better looking for empty places
int hashkey = (int) (zobrist % HASHSIZE);
if (hashtable[hashkey] == 0 || hashtable[hashkey] == zobrist) {
hashtable[hashkey] = zobrist;
return;
}
for (int i = 1; i < HASHSIZE; i++) {
if (hashtab... | 4 |
@Override
public void refresh(RefreshEvent event) {
Class eventClass = event.getClass();
if (eventClass == LocalGameRefreshEvent.class) {
mainPanel.refreshGrid(event);
} else if (eventClass == TotalGameRefreshEvent.class) {
mainPanel.refreshRemainingMines(event);
... | 5 |
public static List<Map<String,String>> getValueAsMapList(String headerLine, List<String> followingLines, MassBankRecordLine recordLine) {
List<Map<String, String>> result = new ArrayList<Map<String,String>>();
String headerValue = getValueAsString(headerLine, recordLine);
String[] headerValues = headerValue.split... | 5 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Book other = (Book) obj;
if (!Objects.equals(this.id, other.id)) {
return false;
}
... | 9 |
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
return DATA_FLAVOR.equals(flavor) || DataFlavor.stringFlavor.equals(flavor);
} | 1 |
private void SetState(int state) {
if (state == token_source.curLexState)
return;
Token root = new Token(), last=root;
root.next = null;
// First, we build a list of tokens to push back, in backwards order
while (t... | 7 |
public List formatResults(){
List results = new ArrayList();
Iterator i = searchResults.iterator();
String lastSampleId = "";
String preSampleId = "";
String preAssay = "";
List oneSampleRows = new ArrayList();
int dupResult = 0;
boolean newSample = false;
while(i.hasNext()){
Result r = (Result)i.n... | 9 |
public void setPassCriteria(String passCriteria)
{
this.passCriteria = passCriteria;
} | 0 |
protected void progressTask()
{
if(getTask().equals("eat"))
{
attemptToEat();
return;
}
if(getTask().equals("reproduce"))
{
attemptToReproduce();
return;
}
if(getTask().equals("wear backpack"))
{
attemptToWearBackpack();
r... | 3 |
public void testMany () throws IOException {
Server server = new Server();
Kryo serverKryo = server.getKryo();
register(serverKryo);
startEndPoint(server);
server.bind(tcpPort);
final TestObjectImpl serverTestObject = new TestObjectImpl(4321);
final ObjectSpace serverObjectSpace = new ObjectSpace();
... | 7 |
final void method1348(int i, Object object, Interface14 interface14) {
do {
try {
anInt2318++;
method1341(object, interface14, -114, 1);
if (i > 62)
break;
aClass107_2316 = null;
} catch (RuntimeException runtimeexception) {
throw Class348_Sub17.method2929(runtimeexception,
("pq.K(" + i... | 5 |
@Override
public void keyTyped(KeyEvent e)
{
if (e.getSource() == textWidth || e.getSource() == textHeight)
{
if (e.getKeyChar() > '9' || e.getKeyChar() < '0')
{
e.consume();
}
else if (Integer.parseInt(((JTextField) e.getSource()).getText()
+ e.getKeyChar()) > 254)
{
((JTextField) e.get... | 6 |
public JPanelRender(JFrame window, final EventosDoTeclado evt, EventosDoRender imgevt){
this.window = window;
this.imgEvt = imgevt;
this.evt = evt;
window.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent e) {
... | 9 |
public void randomColor() {
int randomInt = (new Random().nextInt(6) + 1);
switch (randomInt) {
case 1:
robot.setBodyColor(Color.GREEN);
robot.setBulletColor(Color.GREEN);
break;
case 2:
robot.setBodyColor(Color.GR... | 7 |
public int searchInsert(int[] A, int target) {
int sta = 0;
int end = A.length;
while (sta <= end){
int mid = (sta + end)/2;
if(A[mid] == target)
return mid;
else if(A[mid] < target)
sta = mid +1;
else
... | 3 |
private void render(byte input[], int inputPosition, int inputWidth,
int output[], int outputPosition, int outputWidth,
int width, int height, int colour) {
int _width = -(width >> 2);
width = -(width & 3);
/*
* Iterate through the pixels.
*/
for (int row = -height; row < 0; row++) {
for (int... | 8 |
private void actionDelete( )
{
DefaultMutableTreeNode
selNd = getSelectedNode();
if ( selNd != null )
{
int[] selIdxs = getNodeIndexList(selNd);
if ( selIdxs.length == 1 )
{
audioVectors.remove(selIdxs[0]);
dataRootNd.remove(selIdxs[0]);
dataTr.updateUI();
}
else
{
((DefaultMutableTreeNo... | 2 |
void setTotalForce(SimpleVector totalForce) {
this.totalForce = totalForce;
} | 0 |
public void agregarLinea(int p1,int p2,Color pColor,int pStroke)
{ int i=nConexiones;
if(p1>=nVertices||p2>=nVertices) return;
if(i>=MAXConexiones) if(aConexiones==null)
{ MAXConexiones=100;
aConexiones=new int[MAXConexiones];
aColores=new Color[MAXConexiones];
aStrokes... | 9 |
@Override
public void startSetup(Attributes atts) {
table.setModel(model);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setPreferredScrollableViewportSize(new Dimension(100,100));
// Get Column Labels
ArrayList colLabels = new ArrayList();
String colLabelsString = atts.getValu... | 2 |
@Override
public void addcomment(User user, Book book, MediadComment comment) {
// TODO Auto-generated method stub
for (Book book1 : fdb.getBooks()) {
if (book1==book){
book1.addComment(comment);
break;
}
}
} | 2 |
private void toggleControls(){
String[] controls = new String[]{"Dir", "Orient", "Reflect", "XFact"};
boolean[] constate = new boolean[controls.length];
for(int abc = 0; abc < controls.length; abc++){
constate[abc] = gonzo.getControls(controls[abc]);}
bdlabel.setVisible(false);
for(int def = 0... | 9 |
private Object[] getNewAndArgs(Node nodeTest, List<Node> predResult,
String op) {
// TODO Auto-generated method stub
NodeTest[] args = ((NodeTest) nodeTest).getFunctionCalls().get(op);
List<NodeTest> newArgs = new ArrayList<>();
List<Node> predResultBackList = new ArrayList<>();
for (NodeTest arg : args) {... | 9 |
public static void sendPlayerToNewPlayerSpawn(BSPlayer player, boolean silent) {
if(!doesNewPlayerSpawnExist()){
player.sendMessage(Messages.SPAWN_DOES_NOT_EXIST);
return;
}
if(player==null){
return;
}
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new Dat... | 4 |
public Graphics2D getGraphics(){
Window w = vc.getFullScreenWindow();
if(w != null){
BufferStrategy s = w.getBufferStrategy();
return (Graphics2D)s.getDrawGraphics();
}else{
return null;
}
} | 1 |
public boolean checkUserId(int uid) {
for(int i=1;i<=3;i++)
if( new User().checkUserId(uid))
{
return true;
}
return false;
} | 2 |
public static void abrirURL(String url) {
try {
URI uri = new URI(url);
Desktop desktop = null;
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
}
if (desktop != null) {
desktop.browse(uri);
... | 3 |
public ListNode mergeTwoLists(ListNode l1, ListNode l2) {
if (l1 == null) {
return l2;
}
if (l2 == null) {
return l1;
}
ListNode head = null;
ListNode cur = null;
while (l1 != null || l2 != null) {
if (l1 == null) {
ListNode nc = new ListNode(l2.val);
cur.next = nc;
cur = nc;
l2 ... | 9 |
@Override
public void unInvoke()
{
final Physical affected=this.affected;
super.unInvoke();
if((affected instanceof Room)&&(this.unInvoked))
{
final Room R=(Room)affected;
final Room downR=R.getRoomInDir(Directions.DOWN);
if((downR!=null)
&&(R.roomID().length()==0)
&&(downR.roomID().length()>0)... | 8 |
public static Object getPrimaryKeyValue(Field f, Object obj)
{
try
{
if ( Proxy.isProxyClass (obj.getClass()))
{
try
{
return ((DeferedLoadMethodInterceptor) Proxy.getInvocationHandler(obj)).getpKey();
} catc... | 4 |
public void save(PrintWriter writer, String modifier)
{
try
{
if(parentAnimation == null)
{
writer.println(modifier + "Animation " + name);
writer.println(modifier + "Duration: " + duration + " frames");
}
else
{
writer.println(modifier + "Add Animation " + name + " at frame " + (frame =... | 7 |
public void removeEdge( Vertex<T> v1, Vertex<T> v2 ) {
v1Pos = getVerticesIndexFor( v1 );
v2Pos = getVerticesIndexFor( v2 );
if ( v1Pos == -1 || v2Pos == -1 ) {
throw new IllegalArgumentException( "vertex not found" );
}
if ( this.adjMatrix[v1Pos][v2Pos] == 1 ) {
this.adjMatrix[v1Pos][v... | 3 |
public static void main(String[] args) throws Exception {
File indir = new File("/srv/haven/errors");
File outdir = new File("/srv/www/haven/errors");
Map<File, Report> reports = new HashMap<File, Report>();
Map<File, Exception> failed = new HashMap<File, Exception>();
for(File f : indir.listFiles()) {
if(f... | 4 |
public VueMenu(CtrlAbstrait ctrlA) {
super(ctrlA);
initComponents();
VueAbstrait vueA = null;
this.ctrlM = new CtrlMenu(this, vueA);
} | 0 |
public RegImmInd(RegImmIndOp operation, Register sourceOperand, long immediateOffset, Register baseOperand) {
switch(sourceOperand.width()) {
case Byte:
if(immediateOffset < Byte.MIN_VALUE || immediateOffset > Byte.MAX_VALUE) {
throw new IllegalArgumentException("immediate operand does not fit into byte"... | 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 |
private void disableVoteButtons(JButton confirmButton) {
voteList.removeAll();
confirmButton.setVisible(false);
Enumeration<AbstractButton> allButtons = buttonGroup.getElements();
while (allButtons.hasMoreElements()) {
allButtons.nextElement().setVisible(false);
}
... | 1 |
public void marcarBoton(int numboton, Ficha ficha)
{
if(numboton==1)b1.setLabel(Character.toString(ficha.getFicha()));
if(numboton==2)b2.setLabel(Character.toString(ficha.getFicha()));
if(numboton==3)b3.setLabel(Character.toString(ficha.getFicha()));
if(numboton==4)b4.setLabel(Character.toString... | 9 |
Tree decisionTreeLearning(List<List<Integer>> examples, List<Integer> attributes,
List<List<Integer>> parentExamples, boolean randImp) {
Tree tree;
// if examples is empty then return PLURALITY-VALUE(parent examples)
if (examples == null || examples.size() == 0) return new Tree(pl... | 9 |
protected void endGameTimer() {
if (colorChanged == true) {
gameOverColor = Color.BLUE;
colorChanged = false;
} else {
gameOverColor = Color.RED;
colorChanged = true;
}
Graphics g = this.getGraphics();
drawSomebodyWon(g);
} | 1 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Sexo other = (Sexo) obj;
if (this.idSexo != other.idSexo && (this.idSexo == null || !this.idSexo.equals(o... | 5 |
public static void println(String str) {
memo.append(str);
memo.append("\n");
} | 0 |
private double kernel(FeatureNode [] x, FeatureNode [] z) {
double ret = 0;
switch (model.params.kernel) {
case 0: //user defined
break;
case 1: //linear
ret = Kernel.kLinear(x, z);
br... | 5 |
public void visitPhiJoinStmt(final PhiJoinStmt stmt) {
if (stmt.target == from) {
stmt.target = (VarExpr) to;
((VarExpr) to).setParent(stmt);
} else {
final Iterator e = stmt.operands.keySet().iterator();
while (e.hasNext()) {
final Block block = (Block) e.next();
if (stmt.operandAt(block) == ... | 3 |
public static void main(String[] args) {
rosterDB = readCSV ("/home/arno/workspace/CampPlaner/data/roster.csv");
System.out.println (rosterDB);
try {
System.out.println ("saving...");
rosterDB.write ("rosterdb.xml");
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace(... | 2 |
public boolean init()
{
// dump command line arguments
ExampleUtil.dumpCommandArgs();
// read config
boolean debug = CommandLine.booleanVariable("debug");
if (debug)
{
// Enable debug logging
Logger logger = Logger.getLogger("com.reuters.rfa")... | 7 |
public String generate(List<String> joinTables, List<String> joinTableIds)
{
StringBuilder sb = new StringBuilder();
List<String> added = new ArrayList<String>();
for (int x = 0; x < joinTables.size(); x++)
{
if (!added.contains(joinTableIds.get(x)))
{
added.add(joinTableIds.get(x));
if (sb.leng... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final UsuarioMapeo other = (UsuarioMapeo) obj;
if ((this.login == null) ? (other.login != null) : !this.login.e... | 9 |
public RobbEffect(BattlePvP battle, boolean defender) {
super(battle, defender);
if(defender){
//suppress the siege machines of the battle looser
battle.getAttTroops()[3]=0;
// if there is no more troops, don't do anything
if(battle.getAttTroops()[0]>0 || battle.getAttTroops()[1]>0 || battle.getAttTroop... | 6 |
@Override
public boolean isValidClassDivider(MOB killer, MOB killed, MOB mob, Set<MOB> followers)
{
if((mob!=null)
&&(mob!=killed)
&&(!mob.amDead())
&&((!mob.isMonster())||(!mob.charStats().getMyRace().racialCategory().endsWith("Elemental")))
&&((mob.getVictim()==killed)
||(followers.contains(mob))
||... | 8 |
@Override
public Tipo validarSemantica() throws Exception {
Tipo izq,der;
izq=izquierdo.validarSemantica();
der=derecho.validarSemantica();
if (izq instanceof TipoInt || der instanceof TipoFloat){
if (der instanceof TipoInt || der instanceof TipoFloat ){
r... | 4 |
public BufferedImage parseUserSkin(BufferedImage var1) {
if(var1 == null) {
return null;
} else {
this.imageWidth = 64;
this.imageHeight = 32;
BufferedImage var2 = new BufferedImage(this.imageWidth, this.imageHeight, 2);
Graphics var3 = var2.getGraphics();
... | 8 |
public void auto()
{
switch(nivel)
{
case 1:
break;
case 2:
if( defesa() ) return;
break;
case 3:
if( defesa() ) return;
if( ataque() ) return;
break;
default:
break;
}
random();
} | 6 |
public int increaseHandicap(int minX, int minY, int ex, int ey) {
if (ex > 90 && ex < 90 + minX) {
if (ey > 210 && ey < 210 + minY) {
if (handicap < 9) {
handicap++;
return handicap;
}
}
}
return hand... | 5 |
public static long countSplitInversionsAndMerge(int start, int end, int leftStart, int leftEnd, int rightStart, int rightEnd) {
int subArray1[] = new int[leftEnd - leftStart + 1];
int subArray2[] = new int[rightEnd - rightStart + 1];
int count = 0;
for (int i = leftStart; i <= leftEnd; i++) {
subArray1[co... | 8 |
public void run() {
if (client_socket != null && os != null && is != null) {
try {
String responseLine;
while ((responseLine = is.readLine()) != null) {
System.out.println(responseLine);
if (client_socket.isClosed())
... | 6 |
@Override
public String toString() {
String result = "Student [name=" + getName() + ", average=" + getAverage()
+ ", program=" + getProgram() + ", universities=[";
if (this.universityOne != null)
result += this.universityOne + ": " + (this.universityOneAccept ? "accepted" : "rejected") ;
if (this... | 6 |
public void handleDamage(EnemyClass enem)
{
if(enem.getWeapon().size() > 0)
{
for(int i = 0; i < enem.getWeapon().size(); i++)
{
if(enem.getGun().getBulletSize() == 0)
{
//do Nothing
}
else
... | 4 |
public static ListNode rotateRight(ListNode head, int n) {
if (head == null)
return null;
if (n == 0)
return head;
int length = 1;
ListNode countLength = head;
while (countLength.next != null) {
length++;
countLength = countLength.next;
}
if (n % length == 0)
return head;
int newHeadPos =... | 9 |
public PagePanel(Page page) {
this.page = page;
setLayout(null);
if (page.getFile() != null) {
try {
Scanner scanner = new Scanner(page.getFile());
StringBuilder contentBuilder = new StringBuilder();
while (scanner.hasNextLine()) {
contentBuilder.append(scanner.nextLine());
contentBuilder... | 6 |
public void mmousedown(Coord mc, int button) {
Coord tc = mc.div(MCache.tileSize);
if(ol != null)
ol.destroy();
ol = map.new Overlay(tc, tc, 1 << 17);
sc = tc;
dm = true;
ui.grabmouse(ui.mapview);
} | 1 |
public static boolean hasCycle(ListNode head) {
if(null==head) return false;
ListNode pointerOne=head.next;
if(null==pointerOne) return false;
ListNode pointerTwo=head.next.next;
while (pointerOne!=null&&pointerTwo!=null&&pointerOne!=pointerTwo){
pointerOne=pointerOne... | 9 |
public String nextCDATA() throws JSONException {
char c;
int i;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
if (end()) {
throw syntaxError("Unclosed CDATA");
}
sb.append(c);
i = ... | 6 |
public void setUpText(String text, MinuetoFont font, MinuetoColor color, boolean antiAliased) {
/* The hardest part of build the image with the text string is
* figuring out the size of the string itself. **/
if (text == null) new NullPointerException();
if (font == null) new NullPointerException();
if... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
AbstractQualifiedMetadata other = (AbstractQualifiedMetadata) obj;
if (qualifiedName == null) {
if (other.qualifiedName != null)
return fa... | 6 |
public void computeSALSA(int nIterations) {
for(int iter=0; iter < nIterations; iter++) {
// Hubs: sum of authority-neighbors values divided by their degree
for(SalsaVertex hub: hubs.values()) {
double nbSum = 0.0;
// Update the degree because not all auth... | 8 |
void damagePlayer(int hitpoints, AIConnection dealingPlayer){
if(health <= 0){
Debug.warn("Player is already dead.");
return;
}
Debug.stub("'" + this.username + "' received " + hitpoints
+ " damage from '" + dealingPlayer.username + "'!");
health -= hitpoints;
if(!(dealingPlayer.username.equals(th... | 4 |
public void visit_l2f(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} | 1 |
public CtrlComptesRendus getCtrl() {
return ctrlCR;
} | 0 |
public void mouseEntered(MouseEvent mouseEvent) {
Iterator<PComponent> it = components.iterator();
while (it.hasNext()) {
PComponent comp = it.next();
if (shouldHandleMouse) {
if (comp.shouldHandleMouse())
comp.mouseEntered(mouseEvent);
... | 7 |
public void setField(Field f) {
if (neighbours == null)
neighbours=new ArrayList<Road>();
if (closeNeighbours == null)
closeNeighbours=new ArrayList<Road>();
this.field = f;
field.setTower(this);
for (Tile tl : field.getNeighbours()) {
if (tl.getClass() == Road.class) {
neighbours.add((Road... | 6 |
public void testMinus_int() {
Days test2 = Days.days(2);
Days result = test2.minus(3);
assertEquals(2, test2.getDays());
assertEquals(-1, result.getDays());
assertEquals(1, Days.ONE.minus(0).getDays());
try {
Days.MIN_VALUE.minus(1);
... | 1 |
public String[] resolveColumns(String[] columns) throws SQLException {
String[] cols;
if (columns.length == 1 && columns[0].equals("*")) {
cols = new String[fields.length];
for (int i=0;i<fields.length;i++) {
cols[i] = fields[i].name();
}
} else {
cols = new String[columns.length];
for (int i=0... | 5 |
private void copySelectedText() {
Point selection = editor.getSelection();
System.out.println("copy-" + (System.currentTimeMillis() - lastClipboardTime));
if (selection.x < selection.y && System.currentTimeMillis() - lastClipboardTime > 400) {
lastClipboardText = (String)clipboard.getContents(TextTransfe... | 2 |
public static void warWithTwoCardsLeft(Hand p1, Hand p2, Hand extras)
{
int flag = 0;
// draw facedown cards
Card p1_facedown = p1.drawCard();
Card p2_facedown = p2.drawCard();
// add facedown cards to extras pile
extras.addCard(p1_facedown);
extras.addCard(p2_facedown);
Card p1_battleCard = p1.draw... | 7 |
private void changeRanges() {
boolean flag = false;
try {
int x = Integer.parseInt(a.getText());
if (x <= 0)
throw new IllegalArgumentException();
flag = true;
int y = Integer.parseInt(b.getText());
if (y <= 0)
throw new IllegalArgumentException();
if (x != drawingPanel.getXRange()... | 7 |
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g... | 4 |
public void avaliarCodigoFonte() {
try {
//Compilação do código-fonte
String nameCommand = "gcc " + nameTestFile + ".c" + " -lcunit -o " + nameTestFile;
Process process = Runtime.getRuntime().exec(nameCommand);
BufferedReader entrada = new BufferedReader(new Inpu... | 5 |
public String getMergedfile(SmartlingKeyEntry updateEntry) throws IOException, JSONException {
// for each locale (for the specific project) , get translated file from smartling
updateEntry.setLocale("es");
String responseHtml = SmartlingRequestApi.getFileFromSmartling(updateEntry.getFileUri()... | 9 |
public void GetInput() {
if (Keyboard.isKeyDown(Keyboard.KEY_W))
Move(0, -4);
if (Keyboard.isKeyDown(Keyboard.KEY_S))
Move(0, 4);
if (Keyboard.isKeyDown(Keyboard.KEY_D))
Move(-4, 0);
if (Keyboard.isKeyDown(Keyboard.KEY_A))
Move(4, 0);
} | 4 |
public Wave18(){
super();
MobBuilder m = super.mobBuilder;
for(int i = 0; i < 330; i++){
if(i % 17 == 0)
add(m.buildMob(MobID.JIGGLYPUFF));
else if(i % 27 == 0)
add(m.buildMob(MobID.KADABRA));
else if(i % 5 == 0)
add(m.buildMob(MobID.PIDGEY));
else if (i % 4 == 0)
add(m.buildMob(MobID.... | 7 |
public MultipartFile getFile() {
return file;
} | 0 |
private short parseTLVLength(byte[] data, short dataOffset, short[] result) {
if (data[dataOffset] == (byte) 0x81) {
result[0] = data[(short) (dataOffset + 1)];
return (short) (dataOffset + 2);
}
else {
if (data[dataOffset] == (byte) 0x82) {
re... | 2 |
public static void main(String[] args) {
Motor testMotor = new Motor();
boolean goON = true;
while (goON) {
System.out
.println("Input RPM (1=49 2=50 ...) or simply Return to continue");
int read = 0;
try {
read = System.in.read();
/** lol at flush */
System.in.skip(System.in.availabl... | 3 |
private void selectPiece(Point p)
{
chosenPiece=null;
possibleMoves=null;
if(!myBoard.isOnBoard(p))//it isn't on the board
{
return;//chosenPiece and possible moves should be null
}
Piece thePiece = myBoard.getPiece(p);
if(thePiece==null)
{
return;//if the point doesn't have any piece in it, t... | 6 |
public static void insertUtilisateur(int idfonction, int idville, String nom, String prenom, String identifiant, String password) throws SQLException {
String query;
try {
query = "INSERT INTO UTILISATEUR (ID_FONCTION,ID_VILLE,UTILNOM,UTILPRENOM,IDENTIFIANT,PASSWORD) VALUES (?,?,?,?,?,?) ... | 1 |
private boolean isRepeatSubmit(HttpServletRequest request) {
String serverToken = (String) request.getSession(false).getAttribute(SUBMIT_TOKEN_NAME);
if (serverToken == null) {
return true;
}
String clinetToken = request.getParameter(SUBMIT_TOKEN_NAME);
if (clinetToke... | 3 |
@Override
public void paint( Graphics2D g ) {
if( selection != null && selection.isSelected() ) {
g.setColor( color );
Rectangle bounds = item.getBoundaries();
int x = bounds.x-1;
int y = bounds.y-1;
int w = bounds.width+1;
int h = bounds.height+1;
for(int i = 0; i < thickness; i++ ){
... | 3 |
public TiarUserMessage tiarUserMessageDecode(String enc)
throws JSONException {
JSONObject obj = new JSONObject(enc);
TiarUserMessage TiarMessage = new TiarUserMessage();
JSONArray JArray = obj.getJSONArray(("GameBoard"));
int[] array = new int[9];
for (int i = 0; i < array.length; i++) {
array[i] = J... | 1 |
private void startClientMonitor(){
while(noStopRequested){
try {
if(this.timeOut > 0){// 超时阀值
Iterator<Object> it = clients.keySet().iterator();
while(it.hasNext()){
Object key = it.next();
Client client = clients.get(key);
if(!client.isReadDataFlag()){// 超时没有收到数据
clie... | 5 |
public void update(double deltaTime){
if(animate){
// Perform sprite animation:
currentTime+=deltaTime;
// If the time has passed time for next frame:
if(currentTime > frameTime){
// Find out how many frames have passed in this time:
float frameAdvance = (float) Math.floor(currentTime/frameTim... | 9 |
public void updateType(int id, String string) {
type = string;
if(string == "Blank") {
updateImage(Database_Tiles.tiles[id], ImageLoader.blank);
}
if(string == "Field") {
updateImage(Database_Tiles.tiles[id], ImageLoader.field);
}
if(string == "Forest") {
updateImage(Database_Tiles.tiles[id], Im... | 6 |
private void updateStateTellCreator(List<Keyword> keywords, List<String> terms) {
//We should have come here by a keyword jump and the recipe shouldve been passed or set
if (keywords != null && !keywords.isEmpty()) {
for (Keyword kw : keywords) {
if (kw.getKeywordData().getType() == KeywordType.RECIPE) {
cur... | 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.