text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void selectionDidChange() {
if (mOwner != null) {
mOwner.selectionDidChange();
}
} | 1 |
public boolean getKilpi(Pelihahmo h){
if (h == h1){
return getNappaimenTila(KILPI1);
} else if (h == h2){
return getNappaimenTila(KILPI2);
} else {
return false;
}
} | 2 |
public static void cast() {
if (!Bank.isOpen()) {
if (Widgets.get(1370, 0).validate()) {
Widgets.get(1370, 20).click(true);
Task.sleep(700, 800);
Timer failSafe = new Timer(25000);
while ((Inventory.getCount(Variables.leatherUsing) > 1 ... | 7 |
@Override
protected List< ? extends Component> createBrickComponents() {
ArrayList<Component> components = new ArrayList<Component>();
String tooltip = getTooltip();
// label
if ( control.getLabel() != null ) {
label = new JLabel();
label.setName(getName()+"/label");
... | 9 |
public static String escapeJavaScriptString(String input) {
StringBuilder retVal = new StringBuilder(input.length() + 10);
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
switch (c) {
case '"':case '\\':
retVal.append('\\')... | 6 |
private void changePosition() {
float vSqrt = (float) (v * Math.sqrt(2));
if (BlinkTheGame.left) {
if (BlinkTheGame.up) {
setXY(x - v, y - v);
} else if (BlinkTheGame.down) {
setXY(x - v, y + v);
} else {
setXY(x - vSqrt, y);
}
} else if (BlinkTheGame.right) {
if (BlinkTheGame.up) {
... | 8 |
public void flipV() {
for (Connector c : connectors) {
if (c.getPosition() == Position.top)
c.setPosition(Component.Position.bottom);
else if (c.getPosition() == Position.bottom)
c.setPosition(Position.top);
}
} | 3 |
@Remove
public void remove() {
System.out.println("PersonAddressManagerBean:remove()");
} | 0 |
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
} | 0 |
synchronized void shutdown() {
try {
mServerSocket.close();
} catch (Exception exception) {
Log.error(exception);
}
} | 1 |
public ConvertiblePair(Class<?> sourceType, Class<?> targetType) {
if (sourceType == null) {
throw new IllegalArgumentException("Source type must not be null");
} else if (targetType == null) {
throw new IllegalArgumentException("Target type must not be null");
}
this.sourceType = sourceType;
this.targe... | 4 |
@Test
public void test() {
// Test insertion order
LRUCache<Integer, String> cache = new LRUCache<Integer, String>(10);
int i;
for (i = 0; i < keys.length; ++i) {
cache.put(keys[i], values[i]);
}
i = 0;
for (Iterator<Integer> iter = cache.keySet().iterator(); iter.hasNext();) {
... | 9 |
private void reduction(){
int gcd = getGCD(numerator, denominator);
numerator = numerator / gcd;
denominator = denominator / gcd;
} | 0 |
private static void creerTblRegion() {
if (!m_regInit) {
try (BufferedReader br = new BufferedReader(new FileReader(Constant.m_regionList))) {
String sCurrentLine;
m_lstRegNom.clear();
m_tblRegions.clear();
while ((sCurrentLine = br.rea... | 4 |
@Override
public HandshakeState acceptHandshakeAsServer( ClientHandshake handshakedata ) throws InvalidHandshakeException {
// Sec-WebSocket-Origin is only required for browser clients
int v = readVersion( handshakedata );
if( v == 7 || v == 8 )// g
return basicAccept( handshakedata ) ? HandshakeState.MATCHED... | 3 |
public ArrayList<ArrayList> allMoves() {
ArrayList<ArrayList> a = new ArrayList<ArrayList>();
for (int i = 0; i < pMoves().size(); i++) {
a.add(pMoves().get(i));
}
for (int i = 0; i < nMoves().size(); i++) {
a.add(nMoves().get(i));
}
for (int i = 0; i < bMoves().size(); i++) {
a.add(bMoves().get(i)... | 6 |
public void render()
{
Graphics g = screen.getGraphics();
g.setColor(Color.black);
g.fillRect(0, 0, pixel.width, pixel.height);
//show the black screen with countdown
if(swappingNow)
{
int secondsLeft = (int) ((timerPos / (1000/(tickTime*computerSpeed)) + 1));
String secString = " seconds";
if... | 2 |
public void validate(FacesContext context, UIComponent component,
Object toValidate) {
boolean isValid = true;
String value = null;
if ((context == null) || (component == null)) {
throw new NullPointerException();
}
if (!(component instanceof UIInput)) {
return;
}
if (null == toValidate) {
re... | 7 |
public boolean hasNext() {
// simple: check the current list for a successor
if (listHasNext()) {
return true;
}
// already reached the tree map iterator ?
if (_mapIterator != null) {
while (_mapIterator.hasNext()) {
_currentList = (PropertyList)_mapIterator.next... | 9 |
public void drawGameOption(Graphics g){
g.setFont(defaultFontSmall);//设置字体
for(int i = 0; i<gameOption.length; i++){
g.setColor(Colors.colorList[i]);
g.fillRect(820 , 100 + i * 80, 75, 30);
g.setColor(Color.white);
g.drawString(gameOption[i], 825 , 120 + i * 80);
if( i == this.gameOptionCursor){
... | 4 |
private Image createNoiseImage(final double WIDTH, final double HEIGHT, final Color DARK_COLOR, final Color BRIGHT_COLOR, final double ALPHA_VARIATION_IN_PERCENT) {
int width = WIDTH <= 0 ? (int) PREFERRED_WIDTH : (int) WIDTH;
int height = HEIGHT <= 0 ? (int) PREFERRED_HEIGHT : (int) HEIGHT;
do... | 5 |
public void Compile()
{
glLinkProgram(program);
if (glGetProgrami(program, GL_LINK_STATUS) == 0)
{
System.err.println(glGetProgramInfoLog(program, 1024));
System.exit(-1);
}
glValidateProgram(program);
if (glGetProgrami(program, GL_VALIDATE_STATUS) == 0)
{
System.err.println(glGetProgra... | 2 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String quizName = request.getParameter("Field1");
String quizCategory = request.getParameter("Field2");
String quizAuto = request.getParameter("Field3");
String quizOrder = request.getParameter... | 7 |
public static ArrayList<String> createListBody(String sender, String user_name, ResourceBundle domBundle) {
ArrayList<String> body = new ArrayList<String>();
String select_query = createSelectQuery(sender, user_name);
DatabaseDao dbdao = new DatabaseDaoImpl(domBundle);
ResultSet rs;
ArrayList<HashMap<String, ... | 5 |
static void P() {
int S1 = 0;
int S2 = 0;
int S3 = 0;
int SMax = 9;
int OMax = 0;
int OTemp = 0;
int OCounter = 0;
// code start
OTemp = S1+S2+S3;
// code end
OMax = OTemp;
OCounter = 1;
S3 = S3 + 1;
while (S1 <= SMax) {
S2=0;
while (S2 <= SMax) {
S3=0;
while (S3 <= SMa... | 8 |
private void nameChanged() {
joinButton.setEnabled(false);
joinChatPressed = false;
String text = nameField.getText().trim();
name = text;
if (text.compareTo("") == 0) {
nameStatus.setText("");
return;
}
String message = null;
if ((message = checkName(text)) == null) {
name = text;
nameStatu... | 2 |
@Test
public void computerSuggestion()
{
Player p = new ComputerPlayer();
p.seenAlmostEverything(1, game.getDeck());
ArrayList<String> ans = p.makeSuggestion(game.getDeck());
// Only one suggestion available
Assert.assertTrue(ans.contains("The Hacker") && ans.contains("SQL Injection") && ans.contains(... | 9 |
protected static ArrayList<String> getNeighbors(String course){
String[] courseParts = course.split(" ");
String detailedLevel = courseParts[courseParts.length - 1];
String courseName = "";
for (int i = 0; i < courseParts.length-1; i++){
courseName += courseParts[i];
if (i != cours... | 7 |
public List<Product> getProductsForPage() {
int firstProduct = (currentPage - 1) * NUM_PROD_PER_PAGE;
int lastProduct = firstProduct + NUM_PROD_PER_PAGE;
try {
return products.subList(firstProduct, lastProduct);
} catch (IndexOutOfBoundsException e) {
return products.subList(firstProduct, products.s... | 1 |
public int hashCode() {
return (name != null ? name.hashCode() : 0);
} | 1 |
public void coloringLadderByRandom(int startNum){
for(int i = 0; i < startNum; i++){
boolean leftColored = false, rightColored= false;
Random random = new Random();
int randomX = random.nextInt(startNum-2);//전체 개수-1(0에서 시작하니까) -1(마지막줄 그으면 안되니까)
int randomY = random.nextInt(startNum);
boolea... | 8 |
public void setPlayerFruit(Player p, int fruitId){
Fruit f = getFruitById(fruitId);
if(!fruits.containsKey(p.getName()))
{
fruits.put(p.getName(), fruitId);
applyPassiveFruitEffects(p,f);
}
else{
fruits.remove(p.getName());
fruits.put(p.getName(), fruitId);
applyPassiveFruitEffects(p,f);
}
} | 1 |
public void aproveTimesheetByTimesheetId(Time_Sheet t, ApprovalSheet approvalSheet) throws SQLServerException, SQLException {
Connection con = null;
con = getConnection();
con.setAutoCommit(false);
con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
try
{... | 5 |
public static void loadPlayersHomes( BSPlayer player ) throws SQLException {
ResultSet res = SQLManager.sqlQuery( "SELECT * FROM BungeeHomes WHERE player = '" + player.getName() + "'" );
while ( res.next() ) {
String server = res.getString( "server" );
Location l = new Location( ... | 2 |
public static APDU createAPDU(ServicesSupported services, ByteQueue queue) throws BACnetException {
// Get the first byte. The 4 high-order bits will tell us the type of PDU this is.
byte type = queue.peek(0);
type = (byte) ((type & 0xff) >> 4);
if (type == ConfirmedRequest.TYPE_ID)
... | 8 |
private int [] combinar(int []left, int right[], int[] lista){
int nleft=left.length;
int nright=right.length;
int l=0,r=0,li=0;
while(l<nleft && r<nright){
if(left[l]<=right[r]){
lista[li]=left[l];
l++;
}
else{
lista[li]=right[r];
r++;
}
li++;
}
while(l<nleft){
lista[li]=l... | 5 |
private void writeRow(Object[] values) {
Row row = sheet.getRow(rowIndex);
if (row == null) {
row = sheet.createRow(rowIndex);
}
rowIndex++;
Cell cell = null;
for (int cellIndex = 0; cellIndex < values.length ; cellIndex++) {
cell = row.g... | 7 |
* @param client the connecting client
* @param newCharacter is this a new character
*/
public void init_conn(final Player player, final Client client, final boolean newCharacter) {
if (player == null) {
debug("ERROR!!!: Player Object is NULL!");
return;
}
if (use_cnames) {
// generate generic name ... | 9 |
public Coordinate getPosition() {
return position;
} | 0 |
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 final void method3426(byte i) {
anInt7219++;
try {
Field[] fields = this.getClass().getDeclaredFields();
if (i != 36)
aClass199_7221 = null;
Field[] fields_5_ = fields;
for (int i_6_ = 0;
(i_6_ ^ 0xffffffff) > (fields_5_.length ^ 0xffffffff);
i_6_++) {
Field field = fields_5_[i_6... | 5 |
public NewDialog(Artistry artistry) {
this.artistry = artistry;
contentPane = new JPanel();
setLayout(null);
setSize(320, 240);
setTitle("New");
contentPane.setLayout(null);
JLabel widthLabel = new JLabel("Width: ");
widthLabel.setBounds(16, 16, 128, 24);
... | 5 |
public String extractBitSetasHex() {
int a;
StringBuilder out=new StringBuilder();
int idata[]=returnInts();
for (a=0;a<idata.length;a++) {
// Ensure the number consists of two characters
if (idata[a]<16) out.append("0");
out.append(Integer.toHexString(idata[a]));
if (a<idata.length-1) out.append(",... | 3 |
void menuComposeAlpha(int alpha_op) {
if (image == null) return;
animate = false; // stop any animation in progress
Cursor waitCursor = display.getSystemCursor(SWT.CURSOR_WAIT);
shell.setCursor(waitCursor);
imageCanvas.setCursor(waitCursor);
try {
if (alpha_op == ALPHA_CONSTANT) {
imageData.alpha = a... | 8 |
public ArrayList<Intersection> getNeighbors(Intersection intersection)
{
ArrayList<Intersection> neighbors = new ArrayList();
ArrayList<Road> roads = level.roads;
int x = intersection.x;
int y = intersection.y;
for (int i = 0; i < roads.size(); i++)
{
... | 5 |
public void setAddress(InetAddress address) {
if (address == null) {
this.address = null;
} else if (!(address instanceof Inet4Address)) {
throw new IllegalArgumentException("only IPv4 addresses accepted");
} else {
this.address = address;
}
} | 2 |
public void setType(String value) {
this.type = value;
} | 0 |
private static Alignment traceback(Sequence s1, Sequence s2, Matrix m,
byte[][] pointers, Cell cell) {
char[] array1 = s1.toArray();
char[] array2 = s2.toArray();
float[][] scores = m.getScores();
Alignment alignment = new Alignment();
alignment.setScore(cell.getScor... | 7 |
private void postProcessPlotInfo(FastVector plotSize) {
int maxpSize = 20;
double maxErr = Double.NEGATIVE_INFINITY;
double minErr = Double.POSITIVE_INFINITY;
double err;
for (int i = 0; i < plotSize.size(); i++) {
Double errd = (Double)plotSize.elementAt(i);
if (errd != null) {
er... | 7 |
public int listxattrsize(ByteBuffer path, FuseSizeSetter sizeSetter) {
if (xattrSupport == null) {
return handleErrno(Errno.ENOTSUPP);
}
String pathStr = cs.decode(path).toString();
if (log != null && log.isDebugEnabled()) {
log.debug("listxattrsize: path=" + pa... | 4 |
public void dispose() {
Iterator<Color> e = fColorTable.values().iterator();
while (e.hasNext())
((Color) e.next()).dispose();
} | 1 |
private static void Move(IHI_PathfinderValues values)
{
values.tiles[values.X[values.binaryHeap[1]]][values.Y[values.binaryHeap[1]]] = 2;
values.binaryHeap[1] = values.binaryHeap[values.count];
values.count--;
short location = 1;
while (true)
{
... | 7 |
public Token expr() throws ParentesiParsingException, OperazioneNonValidaException, ExtraTokenException, OperatoreMissingException, OperandoMissingException
{
Token x = andExpr();
if(!(point>text.size()-1))
{ while(peek().ritornaTipoToken().equals(Tok.OR))
{
consume();
Token y = andExpr();
boolean... | 4 |
public void insertTileArray(int pg, int index, int oam[], int wid, int hgt, CHRTile[] tiles) {
if ((index % 32 + wid) > 32) {
// adjust wid so we dont wrap around
wid -= ((index % 32 + wid) - 32);
}
if ((index + (32 * hgt) > (30 * 32))) {
// adjust hgt so we dont mess up
hgt -= ((index + (32 * hgt)) /... | 6 |
public static int getPrice(int basePrice, int goldenNumber) {
Random random = new Random();
int randomNumber = random.nextInt(85) + 1;
int priceModifyer = (basePrice * randomNumber) / 100;
int price = basePrice - priceModifyer;
int goldenPrice;
int goldenChance = random.n... | 6 |
@Override
public void onKeyPress(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_SPACE) {
player.jump();
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
player.duck();
}
} | 2 |
public boolean intersectsRect(Rectangle rect)
{
// To save CPU, we can test if the rectangle intersects the entire
// bounds of this label
if ( (labelBounds != null
&& (!labelBounds.getRectangle().intersects(rect)) )
|| labelGlyphs == null )
{
return false;
}
for (int i = 0; i < labelGlyphs.len... | 6 |
@Override
public void moveTowards(MapLocation mapLocation) {
Direction direction = rc.getLocation().directionTo(mapLocation);
if (canMakeProgress(direction)) {
moveToDirection(rc, direction);
stuck = false;
return ;
} else {
stuck = true;
stuckLocation = rc.getLocation();
}
if (stuck) {
... | 9 |
@Override
public void actOnInput(int key) {
switch(key) {
case '1':
this.activate(new PlaceLandTileController(this.game, this.view, this.gameController));
break;
case '2':
this.activate(new AddDeveloperController(this.game, this.view, t... | 9 |
public void loadLevel() {
SpriteSheet sprites = new SpriteSheet("/res/images/desk2.png", 1, 1);
Image desk = sprites.getSprite(0);
sprites = new SpriteSheet("/res/images/floorTile.png", 1, 1);
Image floor = sprites.getSprite(0);
for (int x = 0; x < WIDTH; x += 2)
for ... | 5 |
private void updatePlayers(int packetSize, Stream stream) {
localEntityCount = 0;
entityUpdateCount = 0;
updateLocalPlayerMovement(stream);
updatePlayerMovement(stream);
updatePlayerList(stream, packetSize); // method91
parsePlayerUpdateFlags(stream);
for (int id ... | 5 |
public OutlinerDocumentListener[] getOutlinerDocumentListeners() {
return (OutlinerDocumentListener[]) outlinerDocumentListeners.toArray();
} | 0 |
private void updateInputArea() {
String html;
if (currentState == MasterMindGraphic.FEEDBACK){
String b = this.input.length() > 0 ? this.input.substring(0, 1):" " ;
String w = this.input.length() > 1 ? this.input.substring(1, 2):" ";
html = "<div id = 'inputArea'> "+constants.Input()+": "
... | 3 |
public GridItem objectAt(int x, int y){
GridItem e = null;
if(x >= 0 && y >= 0 && x < size.width && y < size.height)
e= grid[x][y];
if(e == null)
for(Player p : players)
for(Bomb b : p.getBombs())
if((int)(b.getX()/ICON_SIZE) == x && (int)(b.getY()/ICON_SIZE) == y)
return b;
return e;
} | 9 |
public void paintComponent(Graphics g)
{
BufferedImage spriteSheet = null,Hull;
BufferedImageLoader loader = new BufferedImageLoader();
try {
spriteSheet = loader.loadImage("images/Ship_Shop/shipshopparts.png");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();... | 7 |
public void organizeCards() {
Tree<Card> organizedCards = new Tree<>();
for (int c = 0; c < this.getNumOrbitComponents(); c++) {
organizedCards.insert(((CardComponent)this.getSubComponent(c)).getCard(), true);
}
Iterator<Card> ci = organizedCards.iterator();
CardComp... | 2 |
public Iterator keys() {
return this.keySet().iterator();
} | 0 |
@SuppressWarnings("deprecation")
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
if(ut.tc.speedFlag!=0)
{
int resultFlag=JOptionPane.showConfirmDialog(null,"Ѿ"+ut.tc.speedFlag+"ΣҪ "+(80+ut.tc.speedFlag*160)+"ңܹǷ" , "̳Ϣ",JOptionPane.YES_NO_OPTION );
if(resultFlag==JOptionPane.YES_OP... | 8 |
private GameObjectDefinition getChildDefinition() {
int child = -1;
if (varBitId != -1) {
VarBit varBit = VarBit.cache[varBitId];
int configId = varBit.configId;
int lsb = varBit.leastSignificantBit;
int msb = varBit.mostSignificantBit;
int bit = Client.BITFIELD_MAX_VALUE[msb - lsb];
child = clien... | 5 |
public void validate() {
if (currentZoom != documentViewModel.getViewZoom() ||
currentRotation != documentViewModel.getViewRotation()) {
refreshDirtyBounds();
currentRotation = documentViewModel.getViewRotation();
currentZoom = documentViewModel.getViewZoom();... | 4 |
public static void main(String args[]) {
final SynchronousQueue<String> queue = new SynchronousQueue<String>();
new Thread(new Runnable() {
@Override
public void run() {
String event = "FOUR";
try {
queue.put(event); // thread w... | 2 |
@Override
public boolean registerBuilder(Class<? extends IPacketBuilder> builder) {
Object object = null;
try {
object = builder.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
BuildsPacket annotation = builder.ge... | 4 |
protected void doWrite(PrintWriter writer, String courseID, String nickname, String assignID) throws IOException {
DietjeDatabase database = null;
Connection connection = null;
Map<String, Object> feedback = new LinkedHashMap<String, Object>();
try {
database = new DietjeDa... | 7 |
private void jButton3ActionPerformed() {
String nameOfStreamer = JOptionPane.showInputDialog(null, "Enter the streamer's name: ");
if (nameOfStreamer == null || nameOfStreamer.isEmpty()) { return; }
TwitchStream.removeStream(nameOfStreamer);
TwitchStream.restartStreams();
} | 2 |
public static OrbitalElements getOrbitalElements(int elementIndex,
Calendar calendar) {
Calendar reference = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
reference.set(2000, 0, 1, 0, 0, 0);
reference.set(Calendar.MILLISECOND, 0);
double d = (calendar.getTimeInMillis() - reference.getTimeInMillis())
... | 9 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public final Group createGameBoard() {
flow = new Timeline();
Group group = new Group();
Image image = new Image(getClass().
getResourceAsStream("socialite.jpg"));
int colCount = (int) (image.getWidth()
/ SlidingPuzzlePiece.getPuzzleSize());
int... | 2 |
public static void getTraitStats(Tidy tidy, Document doc, Trait[] traits) {
try {
XPath xpath = XPathFactory.newInstance().newXPath();
XPathExpression expr = xpath.compile("//div[@id = 'bodyContent']/dl/dd/text() |" +
"//div[@id = 'bodyContent']/dl/dd/a/text()");
NodeList nodes = (Nod... | 3 |
private void table_ticketMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_table_ticketMouseClicked
if (evt.getClickCount() == 2) {
JTable target = (JTable) evt.getSource();
int row = target.getSelectedRow();
final DetalleRegistro a = new DetalleRegistro(tableTic... | 2 |
private String[] parseLocalNames() throws IOException, LexerException, ParserException {
Token token = this.nextToken();
if (!(token != null && token.getType()==TokenType.SEPARATOR && token.getValue().equals("|"))) {
this.pushToken(token);
return null;
}
List<String> names = new ArrayList<String>(... | 8 |
private void addVertices(Vertex[] vertices, int[] indices, boolean calcNormals)
{
if(calcNormals)
{
calcNormals(vertices, indices);
}
size = indices.length;
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, Util.createFlippedBuffer(vertices), GL_STATIC_DRAW);
glBindBuffer(GL_E... | 1 |
@SuppressWarnings("unchecked")
public String Write(String contents, String header, List<String> tags) throws Exception{
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(serverURL));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Ma... | 6 |
public BigInteger genPrime(int pBits){
BigInteger p;
do {
p = new BigInteger(pBits,rnd);
if (p.mod(BigInteger.valueOf(2)).equals(BigInteger.ZERO)) continue;
if (p.mod(BigInteger.valueOf(3)).equals(BigInteger.ZERO)) continue;
if (p.mod(BigInteger.valueOf(5)).equals(BigInteger.ZERO... | 5 |
public void mouseDragged(MouseEvent e) {
//NIVEL 1............................................
if(bNivel1) {
for(Object lnkProducto : lnkProductos1) {
Producto proObjeto = (Producto) lnkProducto;
if(proObjeto.getAgarrado()) {
mPosX = e.getX... | 9 |
private static byte[] splitInSextets(byte[] block) {
byte[] copy = block;
final int nbBits = copy.length * 8;
final int nbSextets = nbBits / 6;
byte[] sextets = new byte[nbSextets];
for(int i = 0; i < nbSextets; i++) {
// verplaats twee posities naar rechts en maak ... | 1 |
public void setId(String id) {
this.id = id;
} | 0 |
@Override
protected void onStart() {
for(int i = 0; i < Settings.serversCount; i++){
final int i2 = i;
MineOS.getDesktop().addLinkIcon(Resources.getImageIcon("mc.png"), Settings.serverNames[i], new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
try{
//Узнаем пут... | 2 |
public void drawString(String str,int x,int y,int type,float scale){
if(str==null){
return;
}
for(int i=0;i<(str.length());i++){
Texture t = map.get("A");
try {
t = map.get(str.charAt(i)+"");
t.bind();
} catch (Exception e) {
System.err.println("Image load crash on symbol \""+str.charAt(i... | 6 |
private float addModifier(Modifier modifier, UnitType unitType, float result) {
FreeColObject source = modifier.getSource();
String sourceName;
if (source == null) {
sourceName = "???";
} else {
sourceName = Messages.getName(source);
if (unitType != nu... | 7 |
@Override
public int attack(final NPC npc, final Entity target) {
final NPCCombatDefinitions defs = npc.getCombatDefinitions();
npc.setNextAnimation(new Animation(defs.getAttackEmote()));
switch (Utils.getRandom(5)) {
case 0:
npc.setNextForceTalk(new ForceTalk("Bwuk"));
break;
case 1:
npc.setNextFor... | 8 |
public static AbstractNearByPlacesFacade getFacade(String publisher, String contextPath,
int displaySize) throws CitysearchException {
if (publisher == null) {
throw new CitysearchException("NearByPlacesFacadeFactory", "getFacade",
"Invalid Publisher Code.");
... | 8 |
public int findPosNode(T x) {//return position of node
int pos=0;
Node<T> ele = _head;
while (ele != null) {
if (ele.getData().equals(x))
return pos;
else{
ele = ele.getNext();
pos+=1;
}
}
return -1;//nod... | 2 |
private void ParseOutElements(org.w3c.dom.Element parentElement) {
Node child = parentElement.getFirstChild();
while (child != null) {
if (! handleGeneralProperty(child)) {
String nodeName = child.getNodeName();
// Container specific properties: accept[ ], item[ ]
if (nodeName == "item") {
conta... | 5 |
public void setVisible(boolean visible) {
if(frame == null) buildGUI();
frame.setVisible(visible);
log.exiting(getClass().getSimpleName(), "setVisible(boolean)");
} | 1 |
public static String stringFor_cl_sampler_info(int n)
{
switch (n)
{
case CL_SAMPLER_REFERENCE_COUNT: return "CL_SAMPLER_REFERENCE_COUNT";
case CL_SAMPLER_CONTEXT: return "CL_SAMPLER_CONTEXT";
case CL_SAMPLER_NORMALIZED_COORDS: return "CL_SAMPLER_NORMALIZED_COORDS... | 8 |
public boolean saveSettings()
{
String line = null;
BufferedWriter ini_file;
try
{
//open file
ini_file = new BufferedWriter( new FileWriter( JIPT_INI_PATH + JIPT_INI_FILENAME ) );
//write show Splash screen info
ini_file.write( "SPLA... | 7 |
@Override
public boolean isAllowedToBorrow(Loan loan, StockController stockController) {
if (stockController.numberOfLoans(this) < 4) {
if (loan.getQuantity() < 25) {
if (CalendarController.differenceDate(loan.getStart(),
loan.getEnd()) < 8) {
... | 4 |
public static void compare(String dna1, String dna2) {
System.out.println("Difference = " + mss(dna1, dna2, true));
} | 0 |
public String createParsedURI (String searchTerm, String mediaType){
/*
* Given a search term return the KAT URI.
* example @param: "linkin park in the end/", "music"
*/
String baseURI = Constants.KAT_SEARCH_BASE;
String parsedQuery = "";
String URI;
if (mediaType.toLowerCase().equals("movie... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof TermStatus))
return false;
TermStatus other = (TermStatus) obj;
if (average == null) {
if (other.average != null)
return false;
} else if (!average.equals(other.av... | 8 |
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.