text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static QuestionGeneration[] general() throws Exception {
int[] categoryID = randomGeneration("categories");
String[] category = new String[10];
DatabaseResult db;
int[] quesID = new int[10];
for (int i = 0; i < 10; i++) {
db = new DatabaseResult("categories")... | 9 |
public void keyPressed(KeyEvent e) {
int x = e.getKeyCode();
// Exit if the user hit <ESC>
if (x == KeyEvent.VK_ESCAPE) {
System.exit(0);
}
int prevDir = game.pacman.getDirection();
// Movement controls
if (x == KeyEvent.VK_LEFT) {
... | 6 |
public static void inv( DenseMatrix64F mat , DenseMatrix64F inv ) {
double max = Math.abs(mat.data[0]);
int N = mat.getNumElements();
for( int i = 1; i < N; i++ ) {
double a = Math.abs(mat.data[i]);
if( a > max ) max = a;
}
if( mat.numRows == 2 )... | 6 |
@Override
public int match(String[] argsToTest) {
for (String testArg : argsToTest) {
if (isCommandArg(testArg)) {
boolean argIsOK = false;
for (String allowedElem : allowed) {
if (testArg.equals(allowedElem)) {
argIsOK = true;
}
}
if (!argIsOK) {
addMismatch(testArg);
}... | 6 |
public static void main(String[] args) {
NullPlumbus nullPlumbus = new NullPlumbus(); // standard null plumbus created as such
IPlumbus nameBrandPlumbus = new NameBrandPlumbus("The Original Plumbus", 5.99); // plumbus interface created as a NameBrandPlumbus
NullPlumbus offBrandPlumbus = new OffB... | 4 |
private int searchrow(int[][] matrix,int target,int b,int e)
{
if (b >= e) return -1;
if (b == e-1 ) return b;
int mid = (b + e) /2;
if (matrix[mid][0] <= target && target <= matrix[mid][matrix[mid].length -1] ) return mid;
if (matrix[mid][0] > target ) return searchrow(matrix,target,b, mid);
return searc... | 5 |
@Override
public String toString() {
return "[someStrArray=" + Arrays.deepToString(someStrArray)
+ ", someObjArray=" + Arrays.deepToString(someObjArray)
+ ", someList=" + someList + ", someMap=" + someMap + "]";
} | 0 |
@SuppressWarnings("unchecked")
protected ResourceBag() {
Type t = this.getClass().getGenericSuperclass();
Type param = ((ParameterizedType) t).getActualTypeArguments()[0];
if (!(param instanceof Class)) {
throw new IllegalArgumentException("Field to detect our type!");
}
... | 1 |
public void tallennaOsaamistasonTunniste() {
if (tokaTekstikentta.getText().equals("melkein")){
osaamistasonTunniste = "\tMELKEIN";
} else if (tokaTekstikentta.getText().equals("ei")){
osaamistasonTunniste = "\tEI";
} else {
osaamistasonTunniste = ""; //jos kä... | 2 |
public static void writeToStream(String text, Buffer stream) {
if (text.length() > 80)
text = text.substring(0, 80);
text = text.toLowerCase();
int i = -1;
for (int c = 0; c < text.length(); c++) {
char character = text.charAt(c);
int characterCode = 0;
for (int l = 0; l < validChars.length; l++) {
... | 9 |
public boolean checkUserData() {
if (logView.getUsername().equals("")
&& logView.getPassword().equals("")) {
JOptionPane
.showMessageDialog(
logView,
"Bitte korrigieren Sie Ihren Kundennamen und Ihr Kundenpasswort!",
"Kein Kundennamen und Passwort angegeben",
JOptionPane.ERROR_... | 8 |
@EventHandler
public void EndermanSlow(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEndermanConfig().getDouble("Enderman.Slow... | 6 |
public void forwardSelect(boolean withReplacement, Instances instances,
int metric) throws Exception {
double bestPerformance = -1.0;
int bestIndex = -1;
double tempPredictions[][];
for (int i = 0; i < m_bagSize; ++i) {
// For each model in the bag
if ((m_timesChosen[i] == 0) || w... | 7 |
protected Rectangle getAutomatonBounds() {
Rectangle rect = drawer.getBounds();
if (rect == null)
return new Rectangle(getSize());
return rect;
} | 1 |
public static void main(String[] args) {
ArrayList<WeightedItem<String>> itemList = new ArrayList<WeightedItem<String>>();
itemList.add(new WeightedItem<String>("A", 30));
itemList.add(new WeightedItem<String>("B", 45));
itemList.add(new WeightedItem<String>("C", 5));
itemList.add(new WeightedItem<String>("D"... | 6 |
public int setNeighbourNull(TetrahedronElt3D element, ScalarOperator sop) {
TetrahedronElt3D neighbour = this.getNeighbour(0);
if (neighbour != null && neighbour.isGeometryEquivalent(element, sop)) {
this.eltZero = null;
return 0;
}
neighbour = this.getNeighbour(1);
if (neighbour != null && neighbour... | 8 |
public int getColumnCount() {
return terminals.length + 2;
} | 0 |
public void undo()
{
if (DEBUG) log("Attempting to undo TaskEdit");
if (taskViewsToUpdate != null)
{
if (DEBUG) log("currentState Completed? " + currentState.isCompleted());
if (DEBUG) log("previousState Completed? " + previousState.isCompleted());
if (DEBUG) log("Revert task to previous... | 8 |
@EventHandler
public void BlazeInvisibility(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getBlazeConfig().getDouble("Blaze.Invis... | 6 |
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 void load() {
cookieslap.chat.log("Loading map " + this.name + ".");
usable = false;
this.file = new File(cookieslap.getDataFolder(), this.name + ".yml");
try {
if (!this.file.exists())
this.file.createNewFile();
} catch (IOException e) {
}
this.setConfig(YamlConfiguration.loadConfigura... | 5 |
public void loadTowerTypes(){
int x = 1;
try {
while(true){
InputStream is = Main.class.getResourceAsStream(RES_DIR + "towers/" + x + ".cfg");
if(is==null){break;}
byte[] b = new byte[Main.class.getResource(RES_DIR + "towers/" + x + ".cfg").openConnection().getContentLength()];
is.read(b);
is... | 9 |
private void flipVertical() {
switch(direction)
{
case EAST:
case WEST:
break;
case NORTH:
setDirection(Direction.SOUTH);
break;
case SOUTH:
setDirection(Direction.NORTH);
break;
case NORTHEAST:
setDirection(Direction.SOUTHEAST);
break;
case NORTHWEST:
setDirection(Direction.SOUT... | 8 |
public Frame() {
container = this.getContentPane();
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
int screenWidth = (int) dim.getWidth() / 3;
int screenHeight = (int) dim.getHeight() / 3;
container.setLayout(new BoxLayout(container, BoxLa... | 0 |
public void addHunterListListener(final HunterListListener listener) {
if (listener != null && !listenersHunter.contains(listener)) {
this.listenersHunter.add(listener);
}
} | 2 |
void updateMyMovement(Player player, Stream outStream) {
synchronized (player) {
if (player.mapRegionChanged) {
sendMapRegion();
}
if (player.playerTeleported) {
outStream.createFrameVarSizeWord(81);
outStream.initBitAccess();
outStream.writeBits(1, 1);
outStream.writeBits(2, 3);
outS... | 8 |
public void print(Object... objects) {
System.out.print(String.format("%-30s: ", this.getClass()
.getSimpleName()));
if (objects != null) {
for (Object obj : objects) {
System.out.print(obj);
System.out.print(" ");
}
System.out.println();
}
} | 2 |
@Around("demo.spring.aop.DemoIntercepter.anyPublicOperation()")
public Object aroundTest(ProceedingJoinPoint target ) {
try {
Object[] args = target.getArgs();
System.out.println("mae[" + array2Str(args) + "]");
Object result = target.proceed(args);
System.out.println("ato[" + result + "]");
... | 1 |
@Override
public void handleEvent(Event event) {
if (event.getType().equals(StateUpdateEvent.TYPE)) {
handleStateEvent((StateUpdateEvent) event);
}
} | 1 |
public void addCity() {
int max=getPreference(WORLD.map[0][0]);
ArrayList<Point> best=new ArrayList<Point>();
best.add(WORLD.map[0][0]);
for (int y=0;y<WORLD.HEIGHT;y++)
for (int x=0;x<WORLD.WIDTH;x++)
if (WORLD.map[x][y].owner==null)
if (getPreference(WORLD.map[x][y])>max) {
best.clear();
... | 7 |
@Override
public CommandResponse executeCommand(RequestType requestType, List<Pair<String,String>> headers, String commandName, Object commandParameters, Class<?> responseCastClass){
CommandResponse result;
if(requestType.name().toLowerCase().equals("get")) {
result = doGet(commandName, headers, commandParamete... | 2 |
public Move AlphaBetaSearch(Board board, GamePlay game, int color,
int alpha, int beta, int depthLimit, int depth) {
game.setColor(color);
if ((depthLimit <= depth) || (game.isGameOver())) {
int[] scores = game.getScores();
Move m = new Move(color, false, new Point(0, 0));
m.setScore(scores[2]);
re... | 8 |
public Entiteetti luoEntiteetti(EntiteettiTyyppi tyyppi, int x, int y) {
switch (tyyppi) {
case PALLO:
return luoPallo(x, y);
case PELAAJA_MAILA:
return luoPelaajanMaila(x, y);
case TEKOALY_MAILA:
return luoTekoalyMaila(x, y);
... | 5 |
public ChartPanel getChartPanel(){
//створюємо панель для графіка
final ChartPanel chartPanel = new ChartPanel(getChart());
//встановлюємо розмір діаграми (можна також скористатись методами JFreeChart цього)
chartPanel.setPreferredSize(new java.awt.Dimension(380, 350));
//дода... | 0 |
public Vasara() {
} | 0 |
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockFromTo(BlockFromToEvent e) {
CBlock conBlock = parent.getControllerBlockFor(null, e.getToBlock()
.getLocation(), null, Boolean.valueOf(true));
if (conBlock == null) {
return;
}
if (conBlock.isBeingEdited()) {
i... | 5 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)))
{
switch(msg.sourceMinor())
{
case CMMsg.TYP_ADVANCE:
unInvoke();
break;
}
}
else
if((msg.amITarget(affected))
&&(msg.ta... | 7 |
public void render(Screen screen){
for(Button b : buttons) b.render(font, screen);
for(TextField tf : textFields) tf.render(screen);
for(Label l : labels) l.render(screen);
if(error != "") font.render(error, 10, 10, 0xffff0000, 1, true, screen);
} | 4 |
@Override
public void visitFieldInsn(final int opcode, final String owner,
final String name, final String desc) {
mv.visitFieldInsn(opcode, owner, name, desc);
if (constructor) {
char c = desc.charAt(0);
boolean longOrDouble = c == 'J' || c == 'D';
sw... | 9 |
public String getOutput()
{
return ((MooreMachine) (to.getAutomaton())).getOutput(to);
} | 0 |
public void open() {
Display display = Display.getDefault();
createContents();
shlNewPolicy.open();
shlNewPolicy.layout();
while (!shlNewPolicy.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
} | 2 |
public String getDownloadPath(){
if (prop.getProperty("downloadPath").isEmpty()) return System.getProperty ("user.dir");
return prop.getProperty("downloadPath", System.getProperty ("user.dir"));
} | 1 |
@Override
public void map(LongWritable key, Text value, OutputCollector<UserIdPairWritable, UserRatingPairWritable> output, Reporter reporter) throws IOException {
StringTokenizer tokenizer = new StringTokenizer(value.toString(), ";");
Vector<Integer> vec = new Vector<Integer>();
int i, j, x, y;
// Loop over ... | 6 |
@Override
public Grid generateGrid() {
playerFactory.generate();
// Give the players some items to start
for (Player player : grid.getAllPlayersOnGrid()) {
final LightGrenade item1 = new LightGrenade(grid);
player.getInventory().add(item1);
final IdentityDisc item2 = new IdentityDisc(grid);
player.... | 2 |
public static double effectiveSampleNumberConjugateCalcn(Complex[] ww) {
Complex[] weight = Conv.copy(ww);
if (Stat.weightingOptionS) {
ArrayMaths am = new ArrayMaths(ww);
am = am.pow(2);
am = am.invert();
weight = am.array_as_Complex();
}
int n = weight.length;
double nEff = Double.NaN;
if (St... | 3 |
@Override
public boolean isDisconnect() {
return disconnect;
} | 0 |
public ArrayList<Pair<String, Color>> getSectionColors(String section, String pref) {
ArrayList<Pair<String, Color>> buf = new ArrayList<Pair<String, Color>>();
for (String j : map.keySet()) {
String[] val = j.split("\\.");
if (val[0].equals(section)) {
buf.add(new Pair<String, Color>(pref + val[1], Color... | 2 |
@Override
public void draw(Graphics g, int x, int y, int side) {
Graphics2D g2d = (Graphics2D) g;
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .35f));
g.drawImage(ResourceManager.getImage("shadow"), x, y, side, side, null);
g2d.setComposite(AlphaComposite.getI... | 8 |
public boolean write(aos.apib.OutStream out, aos.apib.Base o) {
AuthenticationResult v = (AuthenticationResult)o;
int i = -1;
while ((i = out.nextField(i, this)) >= 0) {
switch (i) {
case 0:
out.putBool(v.authentication, i, __def.authentication, this);
break;
case 1:
out.putOther(v... | 6 |
private void tramsformToHtml(Transformer transformer, File xmlFile) {
if (transformer != null) {
File html = new File("logs/html/" + xmlFile.getName() + ".html");
if (!html.exists()) {
boolean success;
try {
success = html.createNewFile... | 5 |
public JTextField getjTextFieldVilleNom() {
return jTextFieldVilleNom;
} | 0 |
public void actionPerformed(ActionEvent e){
//When the upload button is pressed
if (e.getSource()==generateButton) {
treasureModel.clear();
if((Integer) levelSpinner.getValue() > 30 || (Integer) levelSpinner.getValue() < 1){
JOptionPane.showMessageDialog(
RunGenerator.this,
... | 6 |
@Override
public void setProgress(int i) {
// Need to sleep since NT4.0 doesn't share so well with threads, and it's likely that this dialog
// is running in a different thread from the process updating things. Note: when setProgress is
// called it is executing in the thread from the process calling the method... | 5 |
public boolean isEqual(LiteralLabel value1, LiteralLabel value2) {
if (value1.getDatatype() instanceof XSDDouble && value2.getDatatype() instanceof XSDDouble) {
Double n1, n2;
n1 = null;
n2 = null;
Object v1 = value1.getLexicalForm();
Object v2 = value2.getLexicalForm();
boolean v1... | 8 |
protected void processWindowEvent(
WindowEvent event )
{
if (event.getID() == WindowEvent.WINDOW_CLOSING)
{
actionCancel();
}
super.processWindowEvent(event);
} | 1 |
public List<Ant> placeAnts(AntBrain blackBrain, AntBrain redBrain) {
List<Ant> list = new ArrayList<>();
int id = 0;
for (int[] cell : anthillCells) {
if (getCell(cell).anthill.equalsIgnoreCase("black")) {
Ant black = new Ant(blackBrain, true, id++);
b... | 3 |
public LED(int port) {
_led = new PWM(port);
} | 0 |
public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{
// Draws the "You're dead" message on the screen.
g.drawString(dead, 50, 50);
// Draws the name TextField on the screen and instructions.
if (addScore && !added){
g.drawString("Enter your name and hit enter", 50, 3... | 4 |
private static void loadExecutionPlansForSQLStatements(List<DeltaSQLStatementSnapshot> sqlStatementsToLoad) {
Connection connection = null;
try {
connection = ConnectionPoolUtils.getConnectionFromPool();
PreparedStatement sqlExecutionPlansStatement = connection
... | 5 |
@Override
public void rotationPiece()
{
if(largeur==2 && matrice[0][0]!=null)
{
positionX--;
positionY++;
}
else if(largeur==3 && matrice[0][0]!=null){
positionY--;
}
else if(largeur==3 && matrice[0][0]==null){
... | 6 |
public void load(String fileName){
try{
Scanner input = new Scanner(new File(fileName));
shapeList.clear();
selindex = -1;
int count = Integer.parseInt(input.nextLine());
while(input.hasNext()){
String line = input.nextLine();
String [] params = line.split(":");
int x = Integer.par... | 8 |
boolean isValidMessage(String identifier) {
return "cantPick".equals(identifier) ||
"cantTraverse".equals(identifier) ||
"cantDo".equals(identifier) ||
"didntUnderstand".equals(identifier) ||
"pickedUp".equals(identifier) ||
"emptyInventory".equals(identifier) ||
"changedLocation".equals(iden... | 7 |
public Book createBook(int bookNum) {
Book b = null;
Card d0 = new Card(bookNum, 'h');
Card d1 = new Card(bookNum, 'c');
Card d2 = new Card(bookNum, 's');
Card d3 = new Card(bookNum, 'd');
if (checkBook()) {
b = new Book(bookNum);
Card[] bookCards = b.getCards();
Card c = null;
try {
bookCar... | 2 |
public static String readString() {
if (isEmpty()) throw new RuntimeException("Reading from empty input stream");
StringBuilder sb = new StringBuilder();
while (!isEmpty()) {
char c = readChar();
sb.append(c);
}
return sb.toString();
} | 2 |
float getRadius() {
/*
* cloud radius is a function of it's age.
* here's the model...
*
* volume of rising air, dv ~ constant.
* decay ~ surface area.
* dynamic equilibrium, dv = decay, at maturity.
* dv = 0 at old age.
*/
float f... | 5 |
public boolean isNewer (String onlineVersion, String storedVersion) {
if (storedVersion == null || storedVersion.isEmpty())
return true;
String[] oV = onlineVersion.split("[._-]");
String[] sV = storedVersion.split("[._-]");
Logger.logInfo(onlineVersion + " " + storedVersion)... | 6 |
public void testGetInstantMillisInvalid() {
try {
StringConverter.INSTANCE.getInstantMillis("", (Chronology) null);
fail();
} catch (IllegalArgumentException ex) {}
try {
StringConverter.INSTANCE.getInstantMillis("X", (Chronology) null);
fail();
... | 2 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof MeetingImpl)) return false;
MeetingImpl meeting = (MeetingImpl) o;
if (meetingID != meeting.meetingID) return false;
if (!meetingAttendees.equals(meeting.meetingAttendees)) return fal... | 5 |
public void putLabelConfiguration( ConnectionLabelConfiguration name, DefaultConnectionLabelConfiguration config ) {
if( config == null ) {
labelConfigurations.remove( name );
} else {
labelConfigurations.put( name, config );
}
} | 1 |
private void updateScreen(Player player, boolean ifFriendly) {
if (!ifFriendly) {
sendInventory(player);
stake.clear();
stake2.clear();
}
player.getPackets().sendItems(134, false, stake);
player.getPackets().sendItems(134, true, stake2);
player.getPackets().sendItems(94, false,
player.getInventor... | 6 |
public static void main(String[] paramArrayOfString) {
try {
MyProxyLogon localMyProxyLogon = new MyProxyLogon();
String str = null;
logger.setLevel(Level.ALL);
System.out
.println("Warning: terminal will echo passphrase as you type.");
... | 5 |
public void rMayusCentrosLocal(double paramDistancia,double paramRadio)
{
Iterator elemFuente;
Elemento entrada,salida;
Iterator elemDestino = destino.listaElementos();
double sumaDistancias,sumaValores,distancia,ponderacion,rMayor;
double dist[];
int count;
... | 6 |
public static long getDateTime(String buffer) {
if (buffer != null) {
buffer = buffer.trim();
for (int i = DateFormat.FULL; i <= DateFormat.SHORT; i++) {
for (int j = DateFormat.FULL; j <= DateFormat.SHORT; j++) {
try {
return DateFormat.getDateTimeInstance(i, j).parse(buffer).getTime();
} c... | 4 |
public Boolean close() {
try {
this.con.close();
return true;
} catch (SQLException e) {
log.severe("Couldn't close Connection: ");
LogHandler.writeStackTrace(log, e, Level.SEVERE);
return false;
}
} | 1 |
public void setPlainValue(String value) {
this.plainValue = value;
} | 0 |
@Override
public Event next() {
String input = null;
try {
input = br.readLine();
} catch (IOException e) {
}
if(input == null || input.equals("")){
return new DefaultState(as);
}
else{
return new UserHomeState(as, input);
}
} | 3 |
@Override
public void update(MiniGame game)
{
if (calculateDistanceToTarget() < INTERSECTION_RADIUS)
{
stopMovingToTarget();
if (pathIndex < path.size() - 1 && !movingBackToFirst && currentIntersection.open)
{
... | 9 |
public List<Node> getPublicDialogList() {
List<Claim> claimList = claimDao.getClaimList();
List<Claim> counterclaimList = null;
List<Claim> subclaimList = null;
List<Evidence> evidenceList = null;
List<Evidence> counterevidenceList = null;
List<BipolarQuestion> bipolarQuestionList = null;
List<BipolarQues... | 9 |
public void setName(String name)
{
nameLabel.setText(name);
} | 0 |
public void visitTryCatchBlock(final Label start, final Label end,
final Label handler, final String type) {
if (type != null) {
cp.newClass(type);
}
mv.visitTryCatchBlock(start, end, handler, type);
} | 1 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... | 7 |
public ComplexMatrix getPropagationMatrix(int index, double energy) {
ComplexMatrix mx = ComplexMatrix.identityMatrix(2);
for (int i = index; i < intervals.size() - 1; i++) {
try {
mx = mx.multiply(getLocalPropagationMatrix(i, energy));
if (VERBOSE) {
... | 4 |
public String toStringSummary() {
String result;
String titles;
int resultsetLength;
int i;
int j;
if (m_NonSigWins == null)
return "-summary data not set-";
result = "";
titles = "";
resultsetLength = 1 + Math.max((int)(Math.log(getColCo... | 8 |
public static void main(String[] args) throws Exception {
Globals.lockManager = new LockManager();
Globals.bufferManager = new BufferManager(Globals.PAGES + 3);
Globals.index = new BPlus(1); // xactionId whatever you want
Globals.threads = new HashMap<Long, Thread>();
Globals.threadResults = new HashMap<Long,... | 9 |
public static void main(String[] args) {
ResourceConsumer consumer0 = new ResourceConsumer();
// usage of consumer0
// ...
consumer0.clean();
consumer0 = null;
ResourceConsumer consumer1 = new ResourceConsumer();
consumer1 = null;
new ResourceConsumer();
System.gc();
try {
Thread.sl... | 1 |
public float[] center()
{
if (parts.size() <= 0) return null;
float minX = parts.get(0).posX,
maxX = parts.get(0).posX,
minY = parts.get(0).posY,
maxY = parts.get(0).posY,
minZ = parts.get(0).posZ,
maxZ = parts.get(0).posZ;
for (int i = 0; i < parts.size(); i++)
{
if (parts.get(i).p... | 8 |
@Override
public void mouseDragged(MouseEvent e) {
mouseDown = true;
GCThread.increaseGCFlag(5);
if (SwingUtilities.isLeftMouseButton(e) && !e.isShiftDown()) {
x2 = e.getX();
y2 = e.getY();
double newUpperLeftX = upperLeftX-((x2-x1)*(75/factor));
double newUpperLeftY = upperLeftY+((y2-y1)*(... | 7 |
public void COME(int bet) {
if (money > 0 && bet <= money && bet >= 0 && count != 0) {
if (combinedRoll == 7 || combinedRoll == 11) {
player.addMoney(bet);
info.updateMoney();
} else {
player.loseMoney(bet);
info.updateMoney();
}
}
} | 6 |
public Edge getFirstEdgeAtPosition(int x, int y, Node n) {
for(Edge e : n.outgoingConnections) {
if(e.isInside(x, y, pt)) {
Edge opposEdge = e.getOppositeEdge();
if(opposEdge != null){
//find out which one we want to delete.
pt.translateToGUIPosition(e.endNode.getPosition());
Position oneEnd... | 4 |
private ArrayList<String> getFilesNamesFromFolderWithJPG(){
ArrayList<String> filesNames = new ArrayList<String>();
File folderWithJPG = new File(this.folderWithJPG);
File[] files = folderWithJPG.listFiles();
for(File f:files){
if(f.isFile()){
filesNames.add(getFileNameWithoutExtension(f));
System.ou... | 2 |
public void parseParameters(String paramstring) throws MaltChainedException {
if (paramstring == null) {
return;
}
final String[] argv;
String allowedFlags = "sceB";
try {
argv = paramstring.split("[_\\p{Blank}]");
} catch (PatternSyntaxException e) {
throw new LiblinearException("Could not split t... | 9 |
private final void method1025
(int[] is, int[] is_404_, int i, int i_405_, int i_406_, float f,
float f_407_, float f_408_, float f_409_, float f_410_, float f_411_,
float f_412_, float f_413_, float f_414_, float f_415_, float f_416_,
float f_417_, float f_418_, float f_419_, float f_420_, float f_421_,
float... | 7 |
@XmlElement
public void setAge(int age) {
this.age = age;
} | 0 |
public void zoomIn() {
if (tileSize + TILE_SIZE_STEP > TILE_MAX_SIZE)
return;
int oldSize = tileSize;
Container c = GraphicPanel.this.getParent();
int newX, newY;
tileSize += TILE_SIZE_STEP;
revalidateScroll();
if (c instanceof JViewport) {
JViewport jv = (JViewport) c;
Point pos = jv... | 2 |
public void newNPCDrop(int npcType, int dropType, int Items[], int ItemsN[]) {
// first, search for a free slot
int slot = -1;
for (int i = 0; i < maxNPCDrops; i++) {
if (NpcDrops[i] == null) {
slot = i;
break;
}
}
if(slot == -1) return; // no free slot found
NPCDrops newNPCDrop = new NPCDr... | 3 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Float.floatToIntBits(x);
result = prime * result + Float.floatToIntBits(y);
result = prime * result + Float.floatToIntBits(z);
return result;
} | 0 |
public void moveClouds(){
// Move the clouds
for(int i=0; i<clouds.size(); i++){
Cloud cld2 = clouds.get(i);
if(cld2.getDone()){
clouds.remove(cld2);
clouds.add(new Cloud());
}
else{
cld2.move();
... | 2 |
public String toString() {
return "" + id + ", " + firstName + ", " + lastName + ", " + age;
} | 0 |
private void updateAddDragObject(String name) {
CategoryType actCategory = guiBuilder.getDragObjectByName(name)
.getCategory();
if (actCategory == CategoryType.BASS) {
this.animationCountArray[0] += 1;
this.animationArray[0] = true;
} else if (actCategory == CategoryType.BEATS) {
this.animationCountA... | 5 |
private boolean kingInCheck(PlayerNum playerNum, int x, int y) {
if (!inBounds(x, y)) {
return false;
}
//Iterates through the board and check each pieces movesets
for (int i = 0; i < board.length; ++i) {
for (int j = 0; j < board[0].length; ++j) {
if (!inBounds(i, j)) {
continue;
}
boole... | 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.