text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void correctPosition(Positioned other)
{
if (collisionType(other)[0] == ApproachFrom.LEFT)
setPos(other.leftBorder() - getWidth(), Y());
if (collisionType(other)[0] == ApproachFrom.RIGHT)
setPos(other.rightBorder(), Y());
if (collisionType(other)[1] ==... | 4 |
@Test
public void function_test() {
try{
double a=5.0;
GaussCFunction gc= new GaussCFunction(a);
double result= gc.function(a);
double exp =3.593E-27;
Assert.assertEquals(exp,result,0.0001);
}
catch (Exception e) {
// TODO Auto-generated catch block
fail("Not yet implemented");
}
} | 1 |
public static int lookAhead(FlaggableCharacterString target, int start, int count, Condition condition) {
int index = start;
while(0 <= index && index < target.size() - 1 && !condition.applies(target.get(index))) {
index++;
}
// was index < target.size()
while(count > 0 && index < target.size() - 1) {
... | 7 |
private ArrayList<Actor> obtenerActores(ArrayList<String> listaIdActores){
ArrayList<Actor> actores = new ArrayList();
for (String idActor : listaIdActores) {
for (Actor actor : misActores) {
if (actor.obtenerNombre().equals(idActor))
actores.add(... | 3 |
private void foundTwoPair() {
rank = Rank.TWOPAIR;
Card.Rank firstPair = null;
Card.Rank secondPair = null;
int firstOrd = -1;
int secondOrd = -1;
for (int i = ranks.length - 1; i >= 0; i--) {
Card[] value = ranks[i];
if (value == null) continue;
... | 9 |
public void defaultBookList (LYNXsys system, int page) { // method to display all books in search list
displayedSearchResults.removeAll(displayedSearchResults); // don't know if I need this here...
for (int i = 0; i < system.getBooks().size(); i ++) { // loop through arraylist of books
// add each book as a sear... | 4 |
public int getMax(){
int res = 0;
for (int i = 0 ; i < taille; i++){
for (int j = 0 ; j < taille; j++){
res = ( res < getValue(i,j))? getValue(i,j) : res;
}
}
return res;
} | 3 |
public ThreadSynchronized1(Example e1) {
this.example = e1;
} | 0 |
public static List<Integer> getMstxAdsGpid(int id) {
ArrayList<Integer> result = new ArrayList<Integer>();
Connection con = DBUtil.getConnection();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = con.prepareStatement("select gpid from mstx_ads_image where gid=?");
pstmt.setInt(1, id);... | 8 |
private void writeAttributes(final DataOutputStream out) throws IOException {
out.writeShort(attrs.length);
for (int i = 0; i < attrs.length; i++) {
out.writeShort(attrs[i].nameIndex());
out.writeInt(attrs[i].length());
attrs[i].writeData(out);
}
} | 1 |
final int[][] method3047(int i, int i_3_) {
anInt9192++;
int[][] is = ((Class348_Sub40) this).aClass322_7033
.method2557(i_3_ ^ 0x5d41e287, i);
if (((Class322) ((Class348_Sub40) this).aClass322_7033).aBoolean4035) {
int[] is_4_ = this.method3048(i, 633706337, 0);
int[] is_5_ = is[0];
int[] is_6_ =... | 5 |
public String getDepartmentName() {
return departmentName;
} | 0 |
private static void runTool(String dataStr, String datasetStr, String output, int numPartitions) throws IOException {
Configuration conf = new Configuration();
Preconditions.checkArgument(numPartitions > 0, "numPartitions <= 0");
// make sure the output file does not exist
Path outputPath = new Pa... | 7 |
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
HttpSession session = request.getSession();
String userName=(String)session.getAttribute("USERNAME");
PrintWriter out = response.getWriter();
if (userName==null){
res... | 2 |
public synchronized void maj(String action) {
if (!mep) {
switch (action) {
case "B":
descendrePiece();
if(pieceCourante.isBloque())
{
int nb_lignes = grille.effacerLigne();
Ca... | 9 |
public void newGame() {
String s;
String name = "";
s = "Welcome to Ye Olde RPG!\n";
s += "\nChoose your difficulty: \n";
s += "\t1: Easy\n";
s += "\t2: Not so easy\n";
s += "\t3: Beowulf hath nothing on me. Bring it on.\n";
s += "Selection: ";
System.out.print( s );
difficulty = InputValidator.nextValidIn... | 6 |
public static void main(String[] args) throws Exception {
HamaConfiguration conf = new HamaConfiguration();
BSPJob bsp = new BSPJob(conf);
// Set the job name
bsp.setJobName("Standard Multiply");
bsp.setBspClass(MultiplyBSP.class);
bsp.setJar("multiply.jar");
if (args.length < 7 || args.length > 9) {
... | 4 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(mob.isInCombat())
return Ability.QUALITY_INDIFFERENT;
final Room R=mob.location();
if(R!=null)
{
if((R.domainType()&Room.INDOORS)>0)
return Ability.QUALITY_INDIFFERENT;
if((R.domainType()==Room.DOMAIN_O... | 8 |
protected void onSetPrivate(String channel, String sourceNick, String sourceLogin, String sourceHostname) {} | 0 |
@Override
public void run() {
while (!running) {
yield();
}
super.run();
} | 1 |
public void rebuild() {
cachedChildrens.clear();
TreeModelListener[] ls;
synchronized (listeners) {
ls = (TreeModelListener[]) listeners
.toArray(new TreeModelListener[listeners.size()]);
}
TreeModelEvent ev = new TreeModelEvent(this, new Object[] { root });
for (int i = 0; i < ls.length; i++)
ls... | 1 |
public static void clearConsole()
{
try
{
String os = System.getProperty("os.name");
if (os.contains("Windows"))
{
Runtime.getRuntime().exec("cls");
}
else
{
Runtime.getRuntime().exec("clear");
}
}
catch (Exce... | 2 |
public void run() {
while (true) {
if (animationEnabled()) {
repaint();
}
try {
Thread.sleep(FRAME_DELAY);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
} | 3 |
private Series <Target> sampleTargets(
Object key, Target t, World world, int limit, Series sampled
) {
for (int n = limit / 2 ; n-- > 0 ;) {
final Target v = randomMatchNear(key, t, -1) ;
if (v == t || v == null || v.flaggedWith() != null) continue ;
sampled.add(v) ;
v.flagWith(sample... | 8 |
public boolean isLowerTriagonal(){
boolean test = true;
for(int i=0; i<this.numberOfRows; i++){
for(int j=0; j<this.numberOfColumns; j++){
if(i>j && this.matrix[i][j]!=0.0D)test = false;
}
}
return test;
} | 4 |
private PointList getQuarter(final double minX, final double maxX, final double minY, final double maxY) {
final PointList result = new PointList(this.size(), minX, maxX, minY, maxY);
for (final float[] p : this.points) {
if (p[0] >= minX && p[0] < maxX && p[1] >= minY && p[1] < maxY) {
result.add(p[0], p[1]... | 5 |
public void addLevel(Level level){
foundLevels.put(level.id, level);
ArrayList<Entrance> awaiting =awaitingEntrances.get(level.id);
if(null != awaiting){
for(Entrance e : awaiting){
e.target = level;
}
awaitingEntrances.put(level.id, null);
... | 2 |
public void visit(final String name, final Object value) {
if (values == null) {
values = new ArrayList(this.desc != null ? 2 : 1);
}
if (this.desc != null) {
values.add(name);
}
values.add(value);
} | 3 |
public double getTicketPrice() {
return ticketPrice;
} | 0 |
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < getUserInfo().size(); i++) {
sb.append(i + 1).append(". ").append(getUserInfo().get(i)).append("\n");
}
return sb.length() > 0 ? sb.toString() : "No users known.\n";
} | 2 |
public boolean iterate()
{
List<Board> allBoards;
Iterator<Board> iter;
allBoards = new ArrayList<Board>(states.keySet()); // Can't use the keyset directly because of
iter = allBoards.iterator(); // ConcurrentModificationException!
while(iter.hasNext())
{
Board board = iter.next();
if(states.c... | 8 |
static void BuildIndex(String datafile, int mode) throws Throwable {
//init the index
for(int i = 0;i < num_ip; i++)
jclient.initServer(i, Index.BUILD);
BufferedReader buf = new BufferedReader(new InputStreamReader(new FileInputStream(datafile)));
String line;
int id = 0;
while ((line = buf.readLi... | 8 |
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(save)) {
/*System.out.println(getOutput());
} else{
/**/
int option = fc.showSaveDialog(this);
if (option == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
try {
FileWriter ot = new FileWriter(file.getA... | 3 |
public static JPanel createAboutPanel() {
if (ABOUT_PANEL_CLASS != null) {
try {
return ABOUT_PANEL_CLASS.newInstance();
} catch (Exception exception) {
exception.printStackTrace();
}
}
return null;
} | 2 |
public void startServerBroadcast() {
// send broadcast and start as response listener
if(running)
return;
running = true;
byte[] buffer = initCode.getBytes();
try {
start();
InetAddress broadcastAddress = InetAddress.getByName("255.25... | 2 |
@Override
public void visitBinaryExpression(JsBinaryOperation binaryOperation) {
JsBinaryOperator operator = binaryOperation.getOperator();
JsExpression arg1 = binaryOperation.getArg1();
boolean isExpressionEnclosed = parenPush(binaryOperation, arg1, !operator.isLeftAssociative());
... | 8 |
public next()
{
this.info = "get some notifications";
this.requireLogin = true;
} | 0 |
public void doCopy() throws SQLException
{
sourceCw = source.getConnectionWrapper();
ConnectionWrapper targetCw = target.getConnectionWrapper();
// find the number of objects in the source database
long count = getCount();
// find the smallest object id in the source
Long currentId = getSmallestId();
// ... | 4 |
private boolean updateBackup(boolean pic) {
StringBuilder sb = new StringBuilder();
LinkedList<String> help = null;
if (pic) {
help = new LinkedList<>(pictureList);
} else {
help = new LinkedList<>(currentData);
}
if (!pic) {
sb.append(... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
StrEntry strEntry = (StrEntry) o;
if (key != null ? !key.equals(strEntry.key) : strEntry.key != null) return false;
if (value != null ? !value.... | 7 |
@Override
public boolean equals(Object o)
{
if(o instanceof Context)
{
Item[][] p = ((Context) o).getPieces();
for(int i = 0; i < LARGURA; i++)
{
for(int j = 0; j < ALTURA; j++)
{
if(p[i][j] == null ^ pieces[i][j] == null)
return false;
else if(p[i][j] != null && pieces[i][j] != ... | 8 |
public String getMove() {
switch (this.directionToMove) {
case 0:
return " it was moved Up";
case 1:
return " it was moved Down";
case 2:
return " it was moved Left";
default:
return " it was moved Right";
}
} | 3 |
private static double[] gaussianElimination(double[][] A, double[] b) {
int n = b.length;
// set up permutation
int[] perm = new int[n];
for (int i = 0; i < n; ++i)
perm[i] = i;
// convert to upper triangular form
for (int i = 0; i < n; ++i) {
// pivot
for (int j = i + 1; j < n; ++j)
if (Math.a... | 9 |
public StatInfo generateStatistics(int id) {
ArrayList<Float> stats = new ArrayList<Float>();
for (Entry<Float, float[][]> ent : Database.DB_ARRAY.entrySet()) {
float[][] dats = ent.getValue();
for (float[] d : dats) {
stats.add(d[id]);
}
}
return new StatInfo(stats, id, StatInfo.DONT_SHOW);
} | 2 |
public void update() throws IOException {
// update position
getNextPosition();
checkTileMapCollision();
setPosition(xtemp, ytemp);
// check flinching
if (flinching) {
long elapsed = (System.nanoTime() - flinchTimer) / 1000000;
if (elapsed > 400) {
flinching = false;
}
}
// if it hits a w... | 6 |
@Override
public void run() {
// Simple selection
List<UIEvent> lastEvents = Model.getModel().getInteractionStack().getLastEvents(2);
if (lastEvents.get(1).getEventType() == EventType.MOUSE_BUTTON_DOWN
&& lastEvents.get(1).getButton() == 0
&& lastEvents.get(0).getEventType() == EventType.MOUSE_BUTTON_UP
... | 8 |
public boolean cast (Sorcerer sorcerer, Trigger trigger, Event event)
{
if (trigger.isInteractTriggered())
{
PlayerInteractEvent interactEvent = (PlayerInteractEvent) event;
interactEvent.setCancelled(true);
if (trigger == Trigger.LEFT_CLICK_BLOCK
... | 7 |
public void setInputs(int[] newInputs){
//
// !! Put in validation to check newInputs.length == inputs.length
//
int i;
for(i=0;i<inputs.length;i++){
inputs[i] = newInputs[i];
}
} | 1 |
private void turn() {
boolean p1, p2;
p1 = player1.getNextDecision();
p2 = player2.getNextDecision();
if (p1 ^ p2) {
if (p1) {
player1.addPoints(5);
} else {
player2.addPoints(5);
}
} else {
if (p1) {
player1.addPoints(2);
player2.addPoints(2);
} else {
player1.addPoints(5)... | 3 |
public T getData() { return this.data; } | 0 |
public String createTable(){
StringBuffer text = new StringBuffer();
text.append( headTable() );
for(int i=0; i<tasks.length; i++){
String row = contentTable(tasks[i].getTimer(), tasks[i].getName());
text.append( row );
}
text.append("</t... | 1 |
@Override
public int releaseAudioData(int dataId) {
if (dataId != 0) {
alDeleteBuffers(dataId);
}
return 0;
} | 1 |
public static char[] generateFrequencyAlphabet(int base,
String[] trainingData) {
//check input parameters
if(base<0)
return null;
if(base==0 || trainingData.length==0)
return new char[0];
int totalNumChars = 0;
Map<Char... | 7 |
@Override
@SuppressWarnings("unchecked")
public Configuration generateConfiguration(String[] commands) throws ClassNotFoundException {
Configuration configuration = new Configuration();
for (int i = 0; i < commands.length; i++) {
String command = commands[i];
if ("-c".equ... | 8 |
public static void main(String[] args) throws IOException{
Scanner in = null;
PrintWriter out = null;
String line = null;
String[] token = null;
int i = 0, lineNumber = 0, orderCount = 0;
int size, lengthA = 0, lengthB = 0;
if(args.length < 2){
System.out.println("Usage: FileIO infile outfil... | 9 |
@Override
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.setStroke(new BasicStroke(3));
g2.setColor(Color.BLACK);
... | 8 |
public void run() {
for (;;) {
Package pkg = null;
try {
pkg = packageQ.take();
} catch (Exception e) {
System.out.println(e);
}
// handle this package
XmlTag tag = pkg.getXmlTag();
String tagName = tag.getLocalName();
System.out.println("Processing a package of type: " + tagName);
... | 9 |
private void addIndex(Partition partition, String... attrs) {
// Index some attributes on the apache partition
HashSet<Index<?, ServerEntry>> indexedAttributes = new HashSet<Index<?, ServerEntry>>();
for (String attribute : attrs) {
indexedAttributes
.add(new JdbmIndex<String, ServerEntry>(attribute));
... | 3 |
static File constructFile(String basePath, String fileName) {
File file;
File absolute = null;
if (fileName != null) {
absolute = new File(fileName);
}
if (StrTry.isEmpty(basePath) ||
(absolute != null && absolute.isAbsolute())) {
file = new ... | 6 |
final int method3451(int i, float f) {
if (i == 0) {
float f_10_
= ((float) anIntArray4304[0]
+ (float) (anIntArray4304[1] - anIntArray4304[0]) * f);
f_10_ *= 0.0030517578F;
aFloat4305 = (float) Math.pow(0.1, (double) (f_10_ / 20.0F));
anInt4303 = (int) (aFloat4305 * 65536.0F);
}
if (((Cla... | 7 |
public static List<Method> getAllSettersIncludeSuperClass(final Class<?> clazz) {
List<Method> ls=new ArrayList<Method>();
for (Class<?> superClass = clazz;
superClass!=null&&superClass != Object.class;
superClass = superClass.getSuperclass()) {
Method[] methods=superClass.getDeclaredMethods();
fo... | 8 |
private void inserta(String nombreConsecuente, String etiquetaConsec, float min) throws IOException
{
RandomAccessFile raf = new RandomAccessFile(salDifusa, "rw");
char temp[] = new char[15];
String variable = null;
String etiqueta = null;
float valor = 0.0... | 5 |
private static Triple<List<Set<Integer>>, int[], int[]> searchTree(Graph g, List<Set<Integer>> partition,
Triple<List<Set<Integer>>, int[], int[]> soFar) {
if (discrete(partition)) {
int[] label = partitionToMatrix(partition, g.domainSize(), g);
// int[] label = partitionToLabel(partition, g.domainSize());
... | 9 |
public CmdLine(String [] args)
{
hashMap = new HashMap<String,Info>();
int len = args.length;
for(int i=0; i<len; i++)
{
if(args[i].startsWith("@"))
{
loadFile(args[i].substring(1));
continue;
}
}
... | 8 |
public static void main(String []args) {
try {
//System.out.println(args.length);
if (args.length < 3) {
System.out.println("Usage: script pathToXMLTaskFile pathToLogFolder System");
System.exit(0);
}
String taskFilePath = args [0];
String logFolderPath = args [1];
String system = args[2];
... | 8 |
public static double log2(double x) {
if (x == 0) { // To avoid inifinity
return 0;
}
return Math.log(x) / Math.log(2);
} | 1 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Pair<E, T> other = (Pair<E, T>) obj;
if (first == null) {
if (other.firs... | 9 |
private void parseParameterDefinitions(final String[] paramDefinitions) {
int paramIndex = 0;
parameterNames = new String[paramDefinitions.length];
allPossibleParameterValues = new double[paramDefinitions.length][];
for (final String parameterDefinition : paramDefinitions) {
... | 2 |
private void addPanelInit () {
addPanel = new JPanel();
//generates panels formatted layout of components
generator.createRigidSpace(addPanel, 40);
final JLabel testLabel = generator.createLabel(addPanel, "");
JLabel fNameLabel = generator.createLabel(addPanel, "First Name");
final JTextField fNameInput... | 8 |
protected boolean isFinished() {
return Robot.oi.getTilterAxis() != 0 || super.isFinished();
} | 1 |
public void mouseClicked(MouseEvent e) {
Point p = e.getPoint();
CPArtwork artwork = controller.getArtwork();
int layerIndex = getLayerNb(p);
if (e.getClickCount() == 2 && layerIndex >= 0 && layerIndex < artwork.getLayersNb() && p.x > eyeW) {
showRenameControl(layerIndex);
} else if (renameField.isV... | 5 |
private static void input(){
try {
Keyboard.create();
if(Keyboard.isKeyDown(Keyboard.KEY_D)){
player.moveRight();
player.setDirection(3);
}
if(Keyboard.isKeyDown(Keyboard.KEY_S)){
player.moveDown();
player.setDirection(2);
}
if(Keyboard.isKeyDown(Keyboard.KEY_A)){
player.mov... | 6 |
private void method46(int arg0, Stream stream) {
while (stream.bitOffset + 21 < arg0 * 8) {
int k = stream.getBits(14);
if (k == 16383) {
break;
}
if (localNpcs[k] == null) {
localNpcs[k] = new Npc();
}
Npc n... | 6 |
public static void selectAllElementsLike(JList list, Object listElement,
List<Integer> indexesOfDuplicates) {
DefaultListModel model = (DefaultListModel) list.getModel();
ListSelectionModel sm = list.getSelectionModel();
int lastIndex = 0;
for (Object element : model.toArray(... | 4 |
public void getPathGraph(mxAnalysisGraph aGraph, int numVertices)
{
if (numVertices < 0)
{
throw new IllegalArgumentException();
}
mxGraph graph = aGraph.getGraph();
Object parent = graph.getDefaultParent();
Object[] vertices = new Object[numVertices];
for (int i = 0; i < numVertices; i++)
{
... | 3 |
public void Reconnect(){
try
{
this.reconnect();
} catch (NickAlreadyInUseException e)
{
con.PrintMessage("Nick already in use");
} catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IrcException e)
{
// TODO Auto-generated catch block
e.printStack... | 5 |
public static void banPlayer( String bannedBy, String player, String reason ) throws SQLException {
BSPlayer p = PlayerManager.getPlayer( bannedBy );
BSPlayer t = PlayerManager.getSimilarPlayer( player );
if ( t != null ) {
player = t.getName();
}
if ( !PlayerManager.... | 6 |
public void propertyChange(PropertyChangeEvent e) {
String prop = e.getPropertyName();
if (isVisible()
&& (e.getSource() == optionPane)
&& (JOptionPane.VALUE_PROPERTY.equals(prop) || JOptionPane.INPUT_VALUE_PROPERTY
.equals(prop))) {
Object value = optionPane.getValue();
if (value == JOptionPa... | 9 |
public void readTable(Map table) {
if (parent != null)
setAlias((String) table.get(getFullName()));
for (Iterator i = loadedClasses.values().iterator(); i.hasNext();) {
Identifier ident = (Identifier) i.next();
if ((Main.stripping & Main.STRIP_UNREACH) == 0
|| ident.isReachable())
ident.readTable(... | 4 |
public ArrayList<String> getGoToList() {
return goToList;
} | 0 |
protected SharedFileInfo resolveFileSpec(File fileSpec) throws DBException
{
SharedFiles queryService = getQueryService();
SharedFileInfo fileInfo;
Cursor<SharedFileInfo> fileRecords = null;
log().info("Applying " + queryService.getEffectiveFilterSpec());
fileRecords = queryService.listAllFilesRelatedToPath(... | 7 |
public boolean check(int xMouse,int yMouse)
{
if((x <= xMouse && xMouse <= x + width) && (y <= yMouse && yMouse <= y + height))
{
//in = true;
return true;
}
else
{
//in = false;
return false;
}
//return in;
} | 4 |
public void execute()
{
FileDialog fd = new FileDialog(new Frame(),
(type == Action.EXPORT) ? "Save File" :
"Open File",
(type == Action.EXPORT) ? FileDialog.SAVE :
FileDialog.LOAD );
fd.setDirectory(directory);
fd.setVisible(true);
String file = fd.getFile();
String dir = fd.getDirectory();
if ( ... | 7 |
public bloque crearBloque(){
BloqueColor nuevoBloqueColor = new BloqueColor();
Random generador = new Random();
int r = generador.nextInt(5);
if(r == 0){
nuevoBloqueColor.color="R";
}
else if(r == 1){
nuevoBloqueColor.color="B";
}
else if(r == 2){
nuevoBloqueColor.color="O";
}
else if(r == ... | 5 |
public String getValue() {
return value;
} | 0 |
public Main(final File working_directory, final String[] args)
{
this.working_directory = working_directory;
this.args = args;
} | 0 |
public static final boolean isStaff(final MOB mob)
{
if(isASysOp(mob))
return true;
if(mob==null)
return false;
if((mob.playerStats()==null)
||((mob.soulMate()!=null)&&(!mob.soulMate().isAttributeSet(MOB.Attrib.SYSOPMSGS))))
return false;
if((mob.playerStats().getSecurityFlags().size()==0)
&&(mob.... | 7 |
protected static String processInnerURL(String text) {
int index = text.indexOf("|");
String url = text;
String label = text;
if (index != -1) {
url = text.substring(0, index);
label = text.substring(index + 1);
}
return "<a href=\"innerURL://" + u... | 1 |
public static int[] getSubset(int[] set, int sum) {
for (int i = 0; i < set.length; i++) {
for (int j = 0; j < set.length; j++) {
for (int k = 0; k < set.length; k++) {
if ((i != j && j != k && i != k) && (set[i] + set[j] + set[k] == sum)) {
return new int[]{set[i], set[j], set[k]};
}
}
... | 7 |
@Override
public void run() {
try {
while(receiving) {
try {
Object obj = in.readObject();
if (obj == null) {
return;
}
if(!(obj instanceof IPacket)) {
log.err("A class was received, but is not a packet!");
continue;
}
IPack... | 7 |
public static int getFontHeight(Font font) {
if (font == null) {
return 0;
}
FontMetrics fm = getFontMetrics(font);
return fm.getHeight();
} | 1 |
@Override
public void mouseMoved(MouseEvent e) {
int tx = mainMenuObj.getTx();
int ty = mainMenuObj.getTy();
int th = mainMenuObj.getTh();
int tw = mainMenuObj.getTw();
int gx = mainMenuObj.getGx();
int gy = mainMenuObj.getGy();
int gh = mainMenuObj.getGh();
... | 8 |
private Browser checkUserAgent(String agentString) {
if (this.isInUserAgentString(agentString)) {
if (this.children.size() > 0) {
for (Browser childBrowser : this.children) {
Browser match = childBrowser.checkUserAgent(agentString);
if (match != null) {
return match;
}
}
}
... | 5 |
private static void method232(int ai[], int ai1[], int ai2[],
byte abyte0[], int i, int j, int k) {
int l = 0;
for (int i1 = i; i1 <= j; i1++) {
for (int l2 = 0; l2 < k; l2++)
if (abyte0[l2] == i1) {
ai2[l] = l2;
l++;
}
}
for (int j1 = 0; j1 < 23; j1++)
ai1[j1] = 0;
for (int k1 =... | 9 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
plugin.toPlayer = args[0];
this.toPlayer = plugin.toPlayer;
String prefix = CreeperWarningMain.chat.getPlayerPrefix((Player) sender);
prefix = CreeperWarningMain.replaceChatColors(prefix);
BufferedReader br;
... | 3 |
public LoginResult(int status,String sharekey,String version,String spnum){
this.Status = status;
this.shareKey = sharekey;
this.serverVersion = version;
this.setSpNum(spnum);
} | 0 |
public void tick(Level level, int xt, int yt) {
int xn = xt;
int yn = yt;
if (random.nextBoolean())
xn += random.nextInt(2) * 2 - 1;
else
yn += random.nextInt(2) * 2 - 1;
if (level.getTile(xn, yn) == Tile.hole) {
level.setTile(xn, yn, this, 0);
}
} | 2 |
public void init(Map map) {
for (int i = 0; i < map.getBlocks().length; i++) {
buttons[i].setText("");
buttons[i].setBorder(new LineBorder(Color.lightGray, 1));
if (!map.getBlocks()[i].isVisible()) {
buttons[i].setBackground(Color.gray);
} else if... | 9 |
public static int updateProdBraQty(String pb_prod_id, String pb_bra_id, String prod_qty, String action){
ProdBra pb = new ProdBra();
ArrayList<QueryCriteria> qcSrcProdBra = new ArrayList<QueryCriteria>();
qcSrcProdBra.add(new QueryCriteria("pb_bra_id", pb_bra_id, QueryCriteria.Operand.E... | 3 |
protected void onIncomingChatRequest(DccChat chat) {} | 0 |
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.