text stringlengths 14 410k | label int32 0 9 |
|---|---|
static final void method1267(GraphicsToolkit graphicstoolkit, int i, int i_78_, int i_79_, int i_80_, int i_81_, int i_82_, boolean bool, boolean bool_83_) {
CacheNode_Sub18.aGraphicsToolkit9607 = graphicstoolkit;
Class22.anInt427 = i;
Class188_Sub2.aBoolean6868 = Class22.anInt427 > 1 && CacheNode_Sub18.aGraphics... | 9 |
public void setTileImages(Image[] paramArrayOfImage)
{
this.TileImages = paramArrayOfImage;
MediaTracker localMediaTracker = new MediaTracker(this);
for (int i = 0; i < paramArrayOfImage.length; i++)
localMediaTracker.addImage(paramArrayOfImage[i], 0); try {
localMediaTracker.waitForAll(); } ... | 3 |
@Override
public byte[] receiveBytes() {
try {
p.writeBytes(new byte[] { '*','r' } );
if (!readUntil((byte)'*',600) || !readUntil((byte)'r',600))
return null;
byte[] oneByte = p.readBytes(1, scaleTimeout(50));
if (oneByte.length != 1)
return null;
int length = (0xFF&(int)(oneByte[0]));
leng... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
UserAndWeight other = (UserAndWeight) obj;
if (user == null) {
if (other.user != null)
return false;
} else if (!user.equals(other.user)... | 7 |
protected boolean closed(Area A)
{
if(A==null)
return false;
for(final Room.VariationCode code : Room.VariationCode.values())
{
if(closedV.contains(code.toString()))
switch(code.c)
{
case 'W':
if(A.getClimateObj().weatherType(null)==code.num)
return true;
break;
case 'C':
... | 9 |
protected static void startReceiveMessage(InputStream in){
while(true){
try{
byte[] temBuffer = new byte[1024];
int count = in.read(temBuffer);
while(count > 0){
String msg = new String(temBuffer,"utf-8");
log.info("the count is:\r\n" + count + "\r\nthe message receive: \r\n" + msg);
t... | 3 |
private static void addImgPath(List<ResourceVO> list, Path img) {
if (img != null) {
int num = Integer.parseInt(img.getFileName().toString().split("\\.")[0]);
list.add(new ResourceVO(img, ResourceType.BITMAP, num));
}
} | 1 |
public void setFirstName(String firstName) {
this.firstName = firstName;
} | 0 |
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes)
throws SAXException {
super.startElement(uri, localName, qName, attributes);
if (qName.equals(mNodeName)) {
verifyNodeBasics(attributes);
verifyNode(attributes);
... | 1 |
public void setJournalId(Integer journalId) {
this.journalId = journalId;
} | 0 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 6 |
public void playGame() {
System.out.println("Please enter the boardSize you will be needing. It should be atleast 3 ");
int boardSize;
while (true) {
try{
boardSize = Integer.parseInt(scanner.nextLine());
if(boardSize<3){
System.out.pri... | 5 |
@Override
public void startOutline () {
// initialize the current node to the root node of the outline
this.currentNode = tree.getRootNode();
// clear out any existing children.
while (currentNode.numOfChildren() > 0) {
currentNode.removeChild(currentNode.getLastChild());
} // end while
// set the... | 1 |
public static boolean writePropertiesFile(String ipAddress, String user, String password, String filepath, String filename, String includeDate){
Properties prop = new Properties();
OutputStream output = null;
try {
output = new FileOutputStream("Auto-DDWRT-Backup.properties");
// set th... | 3 |
void stopTest()
{
log("Shutting down....");
if (m_responseQ != null)
{
if (m_responseQ != null)
{
log("Deactivating responseQ...");
m_responseQ.deactivate();
m_responseQ = null;
}
if (m_responseM... | 8 |
public String getAddress() {
return address;
} | 0 |
public void run () {
m_running = true;
while (m_running) {
synchronized(this) {
executeQuieries();
}
try {
Thread.sleep(m_updateTime * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
synchronized(this) {
executeQuieries();
}
} | 2 |
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
} | 0 |
@Override
public String toString() {
StringBuilder hex = new StringBuilder();
for(byte b : value) {
String hexDigits = Integer.toHexString(b).toUpperCase();
if(hexDigits.length() == 1) {
hex.append("0");
}
hex.append(hexDigits).append(" ");
}
return "TAG_Byte_Array: " + hex.toString();
} | 2 |
public void update() {
// update position
getNextPosition();
checkTileMapCollision();
setPosition(xtemp, ytemp);
// if it hits a wall, go other direction
if(right && dx == 0) {
right = false;
left = true;
facingRight = false;
}
else if(left && dx == 0) {
right = true;
left = fals... | 5 |
private Selector parseSelector() {
Pair<List<SimpleSelector>, PseudoElementSelector> simpleSelectors = parseSimpleSelectors();
CompoundSelector compoundSelector = CompoundSelector.of(simpleSelectors.first);
PseudoElementSelector pseudoElement = simpleSelectors.second;
while (pseudoElemen... | 9 |
public ListNode swapPairs(ListNode head) {
if(head == null)
return null;
if(head.next == null)
return head;
ListNode result = head.next;
ListNode p1 = head;
ListNode p2 = head.next;
while(p1 !=null && p2!=null){
... | 7 |
private void drawMaze(Graphics g) {
for (int y = 0; y < maze.getMazeRawData().length; y++) {
MazeField[] mazeRow = maze.getMazeRawData()[y];
for (int x = 0; x < mazeRow.length; x++) {
MazeField mazeField = mazeRow[x];
g.setColor((mazeField.toString().equals("E") ? Color.WHITE
: Color.BLACK));
... | 4 |
@Override
protected void setReaction(Message message) {
try {
String result;
String messageText = message.text.trim();
switch(reactionId) {
case 1: {
String movieSearch = messageText.substring(messageText.indexOf(" ") +1);
... | 5 |
public void getRules(){
try {
String messageFromServer = null;
out.println(PLAYER_NAME_PREFIX+";"+me.getName());
while(me.getSymbol() == null || boardSize == 0 || winningSymNr == 0){
messageFromServer = getMessageFromServer();
if(messageFromServ... | 8 |
public File getFile() {
Object gotValue=getValue();
if(gotValue==null)
return null;
if(!gotValue.getClass().isAssignableFrom(File.class)) {
throw new ClassCastException("don't know how to convert "
+gotValue.getClass().getName()+" to File");
}
... | 2 |
public void draw(Graphics graphics, FontDAO fontDAO, ImageDAO imageDAO, TextDAO textDAO, ApplicationState applicationState, Metronome metronome) throws Exception {
graphics.setColor(0x00000000);
graphics.fillRect(0, 0,width(), height());
switch (applicationState.getState()) {
... | 8 |
public void run() {
double sign = _negated ? -1 : 1;
double newSpeed = _controller.get() + sign*_rate * _period;
if(Math.abs(newSpeed) < 0.15 && ((sign*_rate < 0) != (newSpeed < 0))) {
_controller.set(0);
} else if (newSpeed < _minSpeed) {
... | 5 |
@Override
public synchronized void mark(int readlimit) {
this.mark = readlimit;
} | 0 |
public void setStudentId(int studentId) {
this.studentId = studentId;
} | 0 |
private void insertComplete () {
String completeString = "<Transform translation='0.0 0.0 0.0' rotation='0.0 0.0 0.0 0.0'>\n\t\t<Shape>\n\t\t\t<Box";
if (headerBlock.nameSelect.isSelected()) {
if ((!headerBlock.objectName.getText().equals("")) && (!xSize.getText().equals("")) && (!ySize.getT... | 9 |
private void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
if (rootFilter != null) {
rootFilter.doFilter(request, response);
}
RequestHelpe... | 1 |
@Override
public NodeVisitor child(String ns, String name) {
if (name == null || name.isEmpty()) {
System.err.println("Encountered a null or empty node name "
+ "in file " + layoutFile + ", skipping node...");
return null;
}
// Check for inclusions
String tn... | 7 |
public String getRNC() {
return RNC;
} | 0 |
public void addRule(String source, String dest, String kind,
Integer seqNum, Boolean duplicate, String action) {
this.rules.add(new Rule(source, dest, kind, seqNum, duplicate, action));
} | 0 |
public void setDateLength(long len) {
if (len < HAS_EXTEND_DATA) {
this.payloadLen = (byte) len;
this.payloadLenExtended = 0;
this.payloadLenExtendedContinued = 0;
} else if (len < 1 * Short.MAX_VALUE * 2) {// UNSIGNED
this.payloadLen = HAS_EXTEND_DATA;
this.payloadLenExtended = (short) len;
this.... | 2 |
public static List<DomElement> findAllDirectChildrenAndSelect(String html, String selector){
Matcher matcher = allTagFindPattern.matcher(html);
int sequenceIndex = 0;
Vector<Tag> tags = new Vector<Tag>();
while(matcher.find(sequenceIndex)){
Tag tag = new Tag();
tag.setTag(matcher.group(0));
tag.setTagN... | 8 |
public void buildToolbar(){
final JMenuBar menubar = new JMenuBar();
JMenu display_menu = new JMenu("Display Options");
final JCheckBoxMenuItem view = new JCheckBoxMenuItem("Show Critter views");
view.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent arg0) {
... | 2 |
@Override
public boolean isDefault() {
return defaultGroup;
} | 0 |
@Override
public float getCusto() {
// TODO Auto-generated method stub
float cus;
switch (marca) {
case AMD: cus = 300; break;
case INTEL: if(gab.getDescricao().contains("Intel")) cus = 288; else cus = 360; break;
default: cus = 0; break;
}
return cus + gab.getCusto();
} | 3 |
public void forceByteCaching() {
if (isCachingEnabled && !isCached) {
try {
// Create a writable file channel
if (tempFile == null) {
createTempFile();
}
// create output stream in needed
if (fileOutp... | 6 |
public void draw() {
background(0);
this.frame.setTitle("Beijing Bus");
this.frame.setIconImage(icon);
map.draw();
if (loadCnt > 0) {
fill(255);
rect(0, 0, width, height);
shape(busLogo, width / 2 - width / 16f, height / 2 - 1.225f * width
/ 16, width / 8f, 1.225f * width / 8);
loadCnt--;... | 8 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Physical target=mob.location();
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(L("This place is already a blessed hearth."));
return false;
}
if(... | 9 |
public void setRequestMethod(Method requestMethod) {
this.requestMethod = requestMethod;
} | 0 |
public void addEmails(String emails) {
if (this.emails == null) {
this.emails = new ArrayList<String>();
this.emails.add(emails);
} else {
this.emails.add(emails);
}
} | 1 |
public void LinkInCognitiveGraph(){
//0.找到激活强度最高和次高的节点的激活级别,分别记为high和low
//1.找到激活状态最高的节点,构建一个和它相同的GraphNode
//2.找到激活状态次高的节点,将刚刚完成的GraphNote连接到它的队尾
//3.构建一个和激活状态次高的节点相同的节点,连接它到激活状态最高的节点的后面
//0
int low=GetCurrentSecondHighActivatedNodeAL();
int high=GetCurrentMostHighActivatedNodeAL();
int GraphSize=C... | 6 |
private void setBaseEncoding(String baseencoding) {
if (baseencoding == null) {
encodingName = "none";
return;
} else if (baseencoding.equals("StandardEncoding")) {
encodingName = "StandardEncoding";
encoding = Encoding.getStandard();
} else if (ba... | 7 |
@SuppressWarnings("unused")
private void create() { //créé un villageois
/** if(this.compteur > (this.env.getLongueur() * this.env.getLargeur()) && this.compteur > 100) //la limite du compteur dépend de la taille du terrain, min 100
this.perdu = true; Tu veux faire perdre le forum s'il ne trouve pas de ressource? ... | 8 |
public boolean executeDBScripts(File file, Statement stmt) throws IOException,SQLException {
boolean isScriptExecuted = false;
try {
BufferedReader in = new BufferedReader(new FileReader(file));
String str;
StringBuffer sb = new StringBuffer();
while ((str = in.readLine()) != null) {
sb.append(str +... | 2 |
public static GsAlbum[] parseAlbums(String data,Gs parent) {
Pattern re=Pattern.compile("\\{result:\\[(.*)\\}");
Matcher m=re.matcher(data);
GsAlbum[] res=new GsAlbum[1];
if(!m.find()) {
res[0]=null;
return res;
}
String realData=m.group(1);
int size=0;
int pos=0;
for(;;) {
int start=realD... | 6 |
public static void checkAccuracyRealFFT_1D() {
System.out.println("Checking accuracy of 1D real FFT...");
for (int i = 0; i < sizes1D.length; i++) {
DoubleFFT_1D fft = new DoubleFFT_1D(sizes1D[i]);
double err = 0.0;
double[] a = new double[sizes1D[i]];
IOU... | 8 |
@Override
public boolean importData(TransferHandler.TransferSupport info)
{
GlobalLogger.getLogger().logp(Level.INFO, this.getClass().getName(),
"importData", "importData called.");
if (!info.isDrop())
{
return false;
}
// We need to get the drop location
DropLocation dl = info.getDropLocation();... | 9 |
void up(int velocity) {
} | 0 |
public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
if (key == KeyEvent.VK_LEFT) {
dx = -1;
}
if (key == KeyEvent.VK_RIGHT) {
dx = 1;
}
if (key == KeyEvent.VK_UP) {
dy = -1;
}
if (key == KeyEvent.VK_DOWN)... | 4 |
private boolean checkGuestForDoubleBooking(ArrayList<Booking> oldBookingList, Booking newBooking) {
boolean doubleBooking = false;
Date newCheckInDate = newBooking.getCheckInDate();
Date newCheckOutDate = newBooking.getCheckOutDate();
int i = 0;
while (doubleBooking == false && o... | 8 |
private void okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okActionPerformed
boolean t = false;
try {
service.startClient();
t = true;
}catch (Exception ex) {
ex.printStackTrace();
JOptionPane.showMessageDialog(this, "connex... | 3 |
private void sort() {
// skip sorting nonunique attributes
if(this.sorted || !this.getProperty().getIsUniqueAttribute())
return;
Collections.sort(this.results);
this.sorted=true;
} | 2 |
public double rank(Deck deck) {
// long startTime = System.currentTimeMillis();
// int count = 0;
int wins = 0;
int ties = 0;
int losses = 0;
for (int i = 0; i < deck.size(); ++i) {
for (int j = i + 1; j < deck.size(); ++j) {
for (int k = j + 1; k < deck.size(); ++k) {
for (int l = k + 1; l < deck... | 6 |
@Override
public void deleteMedType(MedTypeDTO medType) throws SQLException {
Session session = null;
try {
session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.delete(medType);
session.getTransaction().commit(... | 3 |
public EncryptableObject decrypt(Key key) throws Exception{
String Algrithem;
if(key instanceof PrivateKey){Algrithem = "RSA";}
else{Algrithem = "AES";}
if(encrypted == null) {System.out.println("NULL");return null;}
Cipher decrypt = Cipher.getInstance(Algrithem);
decrypt.init(Cipher.DECRYPT_MODE, key); ... | 3 |
private static final String escape(final String rawText) {
// defer initialization of a StringBuffer until we know we need one
StringBuffer buffer = null;
for (int i = 0; i < rawText.length(); i++) {
char c = rawText.charAt(i);
switch (c) {
case CommandManager.PARAMETER_START_CHAR:
case CommandMana... | 9 |
public static void main(String[] args) {
ApplicationContext ctx = new ClassPathXmlApplicationContext(
"context/aopContext.xml");
Service1 service = ctx.getBean(Service1.class);
service.doIt("hoge");
} | 0 |
private void renderInfos(){
if(!renderInfos)return;
Font.render("FPS: " + Game.FPS, x + Game.SCREEN_WIDTH - 80, y + Game.SCREEN_HEIGHT - 15);
Font.render("BGM: " + Options.BGVolume, x + Game.SCREEN_WIDTH - 80, y + Game.SCREEN_HEIGHT - 45);
Font.render("FXM: " + Options.FXVolume, x + Game.SCREEN_WIDTH - 80, y... | 1 |
@MCCommand(cmds = { "list" }, usage = PORT_LIST)
public boolean portList(Player p)
{
Collection<PlayerPort> ports = pc.getPlayerPortals(p);
if (ports == null || ports.isEmpty())
{
return sendMessage(p, "&eNo portals were found");
}
HashMap<World, List<PlayerPort>> wmap = new HashMap<World, List<PlayerPor... | 6 |
public void adjustmentValueChanged (AdjustmentEvent e)
{
if (e.getSource() == Vertical)
{
switch (e.getAdjustmentType())
{
case AdjustmentEvent.UNIT_INCREMENT:
TD.verticalUp();
break;
case AdjustmentEvent.UNIT_DECREMENT:
TD.verticalDown();
break;
case AdjustmentEvent.BLOCK_INC... | 6 |
public MimeConverter(CWConfig config)
{
converters = new Hashtable<MIMEType,Class<? extends HTTPOutputConverter>>();
requestStats = new Hashtable<Class<? extends HTTPOutputConverter>, RequestStats>();
for(final String mimeTypeName : config.getFileConverts().keySet())
{
final MIMEType mimeType=MIMEType.All.g... | 8 |
private ArrayList<Integer> generateActions(LongBoard state) {
ArrayList<Integer> result = new ArrayList<Integer>();
int middle = x/2;
//TODO choose random when x is even
if (state.isPlayable(middle)) {
result.add(middle);
}
for (int i=1; i <= x/2; i++) {
... | 6 |
private int parseAnswer(String line) {
int questionAnswer = Integer.parseInt(line);
if ((questionAnswer < 1) || (questionAnswer > 16)) {
throw new IllegalArgumentException();
}
return questionAnswer;
} | 2 |
public void activePlayerDoAction(Action actionToDo)
throws InvalidActionException {
if (actionToDo == null)
throw new IllegalArgumentException("Action can't be null!");
actionToDo.doAction(getActivePlayer());
if (actionToDo instanceof EndTurnAction)
activePlayerEndTurn();
else if (getActivePlayer().g... | 3 |
public static void print(TreeNode root) {
if (null != root) {
System.out.println(root.val + "[" + (null == root.left ? "null" : root.left.val) + "," + (null == root.right ? "null" : root.right.val) + "]");
print(root.left);
print(root.right);
}
} | 3 |
@Override
public void actionPerformed(ActionEvent a) {
if (a.getActionCommand().equals("close")) {
System.exit(0);
}
else if (automaton == null) {
setError("Es ist noch keine Simulation ausgewählt.");
return;
}
else if (a.getActionCommand().equals("step")) {
simulator.step();
}
else if (a.g... | 9 |
private boolean isClear(int direction) {
Coordinate c = getWallCoordinate(direction);
switch (direction) {
case Display.NORTH:
case Display.SOUTH:
return !WorldBackend.getCurrent()
.checkWall(c.x, c.y, Display.HORIZONTAL);
case Display.EAST:
case Display.WEST:
default:
return !Wor... | 4 |
private static long memusagerss() {
long rss = -1;
try {
Reader fr = new FileReader("/proc/self/status");
LineNumberReader lnr = new LineNumberReader(fr);
String line;
while ((line = lnr.readLine()) != null) {
int idx = line.indexOf(':');
if (idx < 0) continue;
St... | 6 |
public T openForRead() {
Transaction me = Transaction.getLocal();
switch (me.getStatus()) {
case ACTIVE:
Locator locator = this.locator.get();
if (me == locator.owner) {
return locator.current;
}
Locator newLocator = new Locator(me)... | 9 |
public ImportanceTest() {
Data d;
try {
d = Reader.getDataFromFile(new File("files/restaurant.arff"));
System.out.println("Importance function:");
System.out.println("B(0.99) = " + Importance.B(0.99));
System.out.println("Gain(Patrons) = "
+ Importance.importance("Pat", d.getExamples(),
d.ge... | 1 |
protected void sendContentLengthHeaderIfNotAlreadyPresent(PrintWriter pw, Map<String, String> header, int size) {
if (!headerAlreadySent(header, "content-length")) {
pw.print("Content-Length: "+ size +"\r\n");
}
} | 1 |
public static boolean performLogin(String uname, String pword) {
//Set username and password
if (uname != null) AccountName = uname;
if (pword != null) Password = pword;
//Initialize request and result objects
YggdrasilRequest request = new YggdrasilRequest(Acco... | 4 |
@Override
public Vector2D calculateGravity(double elapsedTime) {
LinkedList<Sprite>sprites = parent.getParent().parent.getMap().getSprites();
Vector2D force = new Vector2D(0,0);
for(int i = 0; i < sprites.size(); i++){ // Add all sprites that are planets
if(sprites.get(i) instanceof Planet){
Planet p = (P... | 5 |
public static String lihtneSundmus() {
String tekst = "";
if (Math.random() < lihtsaSundmuseVoimalus) {
int sundmus = random(0, lihtsadSundmused.length - 1);
tekst = lihtsadSundmused[sundmus][0];
String tyyp = lihtsadSundmused[sundmus][1];
int arv = Integer.parseInt(lihtsadSundmused[sundmus][2]);
arv... | 6 |
private static String getStringFromDocument(Document doc) {
try {
DOMSource domSource = new DOMSource(doc);
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
TransformerFactory tf = TransformerFactory.newInstance();
... | 1 |
private void updatePurchasableCards() {
for(Component component : purchasable.getComponents()) {
if(component instanceof PurchasableCardPanel) {
if(((PurchasableCardPanel) component).getData().isInMortgage()) {
((PurchasableCardPanel) component)
.setBorder(BorderFactory.createLineBorder(new Color(2... | 3 |
void telecharger(String ip, int port, String key, boolean [] masque) throws UnknownServiceException, CharConversionException {
int i = 0 , max;
String reponse = "", question = "";
List<String[]> reponse_partielle;
boolean bool;
Fichier file = (Fichier)_hash.get(key);
while (i < masque.length) {
reponse = ... | 6 |
public static void getBids(PlayerModel playerModel[], PlayerDecider player[], int dealerIndex, int redScore, int blueScore, MellowServerMiddleMan middleMan) {
int prevBids[] = new int[4];
int currentPreviousBid[];
int currentBid;
int indexPlayerAction;
int numChances = 0;
for(int i=0; i<4; i+... | 8 |
public static void cadastrarEvento() {
Evento evento = new Evento();
Secao secao = new Secao();
EventoService eventoservice = new EventoServiceImpl();
SecaoService secaoservice = new SecaoServiceImpl();
IngressoService ingressoservice = new IngressoServiceImpl();
... | 2 |
public static double points_for_enemy(int fieldID, int ID) {
if (BrickGame.bricks.size() == 1) {
return 0;
}
double points = 0;
for (int i = 0; i < BrickGame.bricks.size(); i++) {
if (i != ID) {
points = points
+ BrickGame.bricks.get(ID).distance_from_enemy
* getManhattanDistance(listFie... | 3 |
private void btnNewFolderActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnNewFolderActionPerformed
{//GEN-HEADEREND:event_btnNewFolderActionPerformed
String thename = JOptionPane.showInputDialog(this, "Enter the name of the new folder:", "WiiExplorer", JOptionPane.QUESTION_MESSAGE);
... | 8 |
@Override
public void run() {
InetAddress ia = null;
try {
ia = InetAddress.getByName("localhost");
} catch (UnknownHostException e2) {
e2.printStackTrace();
}
try (DatagramSocket dSocket = new DatagramSocket();) {
try {
String command = "Date:";
byte buffer[] = null;
buffer = command.... | 5 |
private void results()
{
if (p1.getHP() < 0)
{
p1.setHP(0);
}
if (p2.getHP() < 0)
{
p2.setHP(0);
}
game.updateP1(getPlayerStats(p1) + getPlayerSkills(p1));
game.updateP2(getPlayerStats(p2) + getPlayerSkills(p2));
game.removeSkills();
if (p1.isAlive())
{
states.setPlayerOneWin... | 4 |
private void addListeners() {
reciever.addListener("/input", new OSCListener() {
@Override
public void acceptMessage(Date time, OSCMessage message) {
System.out.println((String)message.getArguments()[0]);
}
});
reciever.addListener("/gridinput", new OSCListener() {
@Override
public void acceptM... | 5 |
public static void main(String[] args) {
new GUI();
} | 0 |
public void remove(int n) {
this.filled-=elements.get(n).getValue();
this.elements.remove(n);
} | 0 |
public AnnotationVisitor visitParameterAnnotation(
int parameter,
String desc,
boolean visible)
{
AnnotationVisitor av = mv.visitParameterAnnotation(parameter,
remapper.mapDesc(desc),
visible);
return av == null ? av : new RemappingAnnotationAd... | 1 |
static public String toHanyuPinyinString(String str,
HanyuPinyinOutputFormat outputFormat, String seperater)
throws BadHanyuPinyinOutputFormatCombination
{
StringBuffer resultPinyinStrBuf = new StringBuffer();
for (int i = 0; i < str.length(); i++)
{
Str... | 3 |
public void generateHelper(List<String> result, String s, int left, int right) {
if (left > right) {
return;
}
if (left == 0 && right == 0) {
result.add(s);
return;
}
if (left > 0) {
generateHelper(result, s + "(", left - 1, right... | 5 |
public void increasePrice(int percentage) {
List<Product> products = productDao.getProductList();
if (products != null) {
for (Product product : products) {
double newPrice = product.getPrice().doubleValue()
* (100 + percentage) / 100;
product.setPrice(newPrice);
productDao.saveProd... | 2 |
public void write(char[] b, int off, int len) throws IOException {
if (!initialized) {
area.setText("");
initialized = true;
}
// /#ifdef AWT10
// / area.appendText(new String(b, off, len));
// /#else
area.append(new String(b, off, len));
// /#endif
} | 1 |
@Override
public void run() {
while(countDown-- > 0) {
System.out.print(status());
Thread.yield();
}
} | 1 |
public static ArrayList <IngredientData> loadData() {
File load = new File("resources/files/IngredientData/");
Gson loader = new Gson();
ArrayList <IngredientData> res = new ArrayList <IngredientData>();
for (File f : load.listFiles()) {
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(... | 6 |
@EventHandler
public void closeTable(PlayerMoveEvent e) {
Player p = e.getPlayer();
String name = p.getName();
if (Casino.plugin.getDataHandler().getUserList().contains(name))
for (BlackjackTable t : Casino.plugin.getDataHandler().getTableList()) {
if ((!t.getInUse()) ||
(!t.getUser().equals(name)... | 5 |
public static void main(String[] args){
System.out.println(0xFFFF);
System.out.println(0_345_345);
System.out.println(0B1111_1111_1101);
int[][] arr = new int[4][4];
for(int i = 0; i<arr.length; i++)
for(int j = 0; j<arr[i].length; j++)
arr[i][j]= (i!=... | 7 |
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.