text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.black);
g2.fillRect(0, 0, WIDTH, HEIGHT);
if(menu==null){
if(story==null){
lvl.draw(g2);
}else{
story.draw(g2);
}
}else{
menu.draw(g2);
}
} | 2 |
public static ArrayList<Book> getAllBooks() {
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<Book> bookList = new ArrayList<Book>()... | 5 |
static private boolean jj_3R_15() {
if (jj_scan_token(ON)) return true;
if (jj_3R_18()) return true;
if (jj_scan_token(LBRACE)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_8()) { jj_scanpos = xsp; break; }
}
while (true) {
xsp = jj_scanpos;
if (j... | 9 |
@Override
public boolean equals( Object that ) {
if ( this == that )
return true;
if ( that == null || !getClass().equals( that.getClass() ) )
return false;
OptionSet other = (OptionSet) that;
Map<AbstractOptionSpec<?>, List<String>> thisOptionsToArguments =... | 8 |
public static void setVals(double[] val, Param p) {
Object o = p.getValue();
if (o.getClass() == double[].class) {
p.setValue(val);
} else if (o.getClass() == Double.class) {
p.setValue(val[0]);
}
throw new IllegalArgumentException(p.toString());
} | 2 |
@After
public void tearDown() throws Exception {
this.terminal=null;
} | 0 |
public int[][] zeroSet(int[][] matrix){
int m = matrix.length;
int n = matrix[0].length;
HashSet<Integer> column=new HashSet<Integer>();
HashSet<Integer> row=new HashSet<Integer>();
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
if(matrix[i][j]==0){
column.add(i);
row.add(j);
}
}
}... | 7 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
private boolean checkDownRight(int _row, int _column, int _player)
{
boolean keepGoing = true;
int nbAligned = 0;
while (keepGoing == true && nbAligned < nbToAlign)
{
if (_row + nbAligned >= row || _column + nbAligned >= column)
{
keepGoing = false;
}
else if (gameGrid[_row + nbAligned][_c... | 5 |
public T getInternal() {
return internal;
} | 0 |
private static void configureGrid() {
String rejilla = configuration.getProperty("NadgridsPath");
if (StringUtils.isBlank(rejilla)){
rejilla = "auto:peninsula";
}
if (!rejilla.startsWith("auto")){
return;
}
File homeDir = new File(System.getProperty("user.home") + File.separator + ".cat2osm");
File ... | 7 |
public static boolean reverseByteOrder(Class<?> libraryClass) {
if (libraryClass == null) {
errorMessage("Parameter 'libraryClass' null in method"
+ "'reverseByteOrder'");
return false;
}
if (!Library.class.isAssignableFrom(libraryClass)) {
errorMessage("The specified class does not extend class "
... | 4 |
public void wordMakeSets(){
System.out.println(">> AGRUPANDO PALAVRAS POR SEMELHANCA... AGUARDE.");
TreeMap<Integer, ArrayList<String>> tree = new TreeMap<Integer, ArrayList<String>>();
for (Map.Entry<String, DisjointSet> entry : this.entrySet()) {
if (tree.get(entry.getKey().length(... | 9 |
public int mac() {
long ac = -1;
// Do we have it annotated as AF or MAF?
if (hasField("MAC")) return (int) getInfoInt("MAC");
else if (hasField("AC")) ac = getInfoInt("AC");
else {
// No annotations, we have to calculate
ac = 0;
for (VcfGenotype gen : this) {
int genCode = gen.getGenotypeCode()... | 7 |
public double[] sweepPseudoRehearsalSerialLearning(double[][] baseinputs, double[][] baseoutputs,
double[][] serialinputs, double[][] serialoutputs, double maxerror, int popSize, int bufferSize, boolean reals, double minrange, double maxrange) {
double[] outputs = new double[serialinputs.length + 1];// new double... | 9 |
public void setTimeout(int millis) {
if (socket != null)
try {
socket.setSoTimeout(millis);
} catch (IOException exc) {
exc.printStackTrace();
}
timeout = millis;
} | 2 |
public String getThumbnailImageURI() {
String tumbImage = "";
if(getImagesList() != null && getImagesList().get(0) !=null ){
tumbImage = getImagesList().get(0).getImgURL();
}
return tumbImage ;
} | 2 |
@Override
public int getBorderCount()
{
int bcnt = 0;
if (hasTopBorder()) bcnt++;
if (hasBottomBorder()) bcnt++;
if (hasLeftBorder()) bcnt++;
if (hasRightBorder()) bcnt++;
return bcnt;
} | 4 |
private void initialize(Header header)
throws DecoderException
{
// REVIEW: allow customizable scale factor
float scalefactor = 32700.0f;
int mode = header.mode();
int layer = header.layer();
int channels = mode==Header.SINGLE_CHANNEL ? 1 : 2;
// set up output buffer if not set up by client.... | 3 |
private void SqueezeWrap() {
double total = 0;
for (int i = 1; i < HistogramWidth; i++)
total += bins[i];
int a = 1;
int b = HistogramWidth;
int n = 0;
while (true){
n++;
a++;
int subtotal_a = 0;
for (int i = a; i < b; i++)
subtotal_a += bins[i];
a--;
b--... | 9 |
@FXML
protected void login(ActionEvent event) {
loginButton.setDisable(true);
progressIndicator.setVisible(true);
progressIndicator.setProgress(ProgressIndicator.INDETERMINATE_PROGRESS);
LoginService loginService = new LoginService();
loginService.setOnSuc... | 2 |
public RealDistribution openDemand(int t, int k) throws ConvolutionNotDefinedException{
//check if k is lower or equal than t-l_max, then all orders will be open
if (k <= t-getMaxOrderLeadTime()) return totalDemand();
//check if k is bigger than t, then all orders will be realised
if (k > t) return new RealS... | 3 |
public CMemLruCache(int maxSize) {
super(maxSize);
} | 0 |
private static void playAgainstSelfOnServer(int gameId) {
PlayChess whiteTeam = new PlayChess(Board.white, gameId, 1, "32c68cae");
PlayChess blackTeam = new PlayChess(Board.black, gameId, 2, "1a77594c");
while (true) {
System.out.println("POLLING AND MOVING FOR WHITE");
Response r = whiteTeam.poll();
Sys... | 9 |
public void cargarPedHas() {
String sql = "SELECT t1.productos_idproductos, t2.nombre_producto, t2.proveedor, t1.cantidad_pedido,t2.precio * t1.cantidad_pedido "
+ "FROM productos_has_pedidos AS t1, productos AS t2 "
+ "WHERE t1.Productos_idProductos = t2.idProductos "
... | 3 |
public boolean hasBusyDoc(){
for(boolean b : this.docStates_IsBusy)
if(b)
return true;
return false;
} | 2 |
public void checkOperation (String operation, org.omg.CORBA.Any[] args) throws RTT.corba.CNoSuchNameException, RTT.corba.CWrongNumbArgException, RTT.corba.CWrongTypeArgException
{
org.omg.CORBA.portable.InputStream $in = null;
try {
org.omg.CORBA.portable.OutputStream $out = _r... | 5 |
public static void setNativesLocation() {
String libraryPath;
if (new File("lib").exists()) {
if(System.getProperty("os.name").toLowerCase().contains("linux")) {
libraryPath = new File("lib").getAbsolutePath() + File.separator + "linux";
}
else if(Sys... | 6 |
public String toString() {
StringBuffer sbuf = new StringBuffer();
sbuf.append("(<");
sbuf.append(getTag());
sbuf.append('>');
ASTList list = this;
while (list != null) {
sbuf.append(' ');
ASTree a = list.left;
sbuf.append(a == null ? "... | 2 |
public void run() {
int numChanged = 0;
boolean examineAll = true;
while (numChanged > 0 || examineAll) {
numChanged = 0;
if (examineAll) {
// loop I over all training examples
for (int i = 0; i < model.getLength(); i++) {
numChanged += examineExample(i);
}
} else {
// loop I over ex... | 9 |
private void reconcileStates(Connection conn) {
PointList points1 = (PointList) Animation.getInitialState(this, conn);
PointList points2 = (PointList) Animation.getFinalState(this, conn);
if (points1 != null && points1.size() != points2.size()) {
Point p = new Point(), q = new Point();
int size1 = points1... | 8 |
public static void main(String[] args) {
System.out.println(true); // true
System.out.println(false); // false
System.out.println(1 < 2); // true
System.out.println('A' == 'B'); // false
} | 0 |
public boolean isEmpty() {
boolean retVal = false;
if (backPtr == -1) {
retVal = true;
}
return retVal;
} | 1 |
@Override
public void update()
{
super.update();
if(this.moveTime == 0)
{
this.x = this.nx;
this.y = this.ny;
if((this.world.player.x-this.x)*(this.world.player.x-this.x)+(this.world.player.y-this.y)*(this.world.player.y-this.y) > 3*3)
{
if(this.looking)
{
this.world.player.h... | 5 |
private static TwitterResponseWrapper sendRequestAppAuthPost(String baseUrl, Hashtable<String, String> httpParams, String authHeader) {
HttpURLConnection conn = null;
InputStream is = null;
TwitterResponseWrapper response = new TwitterResponseWrapper();
try {
String stringifiedParams = httpParams.size(... | 8 |
public void rainHard() throws RainedOut {
} | 0 |
public static void encode(Object object, ByteBuffer enc) {
if (object == null) {
enc.put((byte) 0x00);
return;
}
if (object.getClass().isArray()) {
enc.put((byte) 0x03);
enc.putInt(Array.getLength(object));
for (int i = 0; i < Array.getLength(object); i++) {
encode(Array.get(object, i), enc);
... | 7 |
public void mouseClicked(MouseEvent e)
{
x = e.getX();
y = e.getY();
boolean interactableClicked = false;
for(Interactable i: ScreenManager.getInstance().getCurrentScreen().getInteractables())
{
if(i.contains(x, y))
{
i.onClick();
ScreenManager.getInstance().getCurrentScreen().onClicked(i);
... | 6 |
private static boolean updateJoinCardinality(Join j,
Map<String, Integer> tableAliasToId,
Map<String, TableStats> tableStats) {
DbIterator[] children = j.getChildren();
DbIterator child1 = children[0];
DbIterator child2 = children[1];
int child1Card = 1;
... | 9 |
static public void action(final Player p, final Main Main)
{
String act = Main.getConfig().getString("action");
if (act.equals("warn")) {
p.sendMessage("" + ChatColor.LIGHT_PURPLE + Lang.PREFIX + ChatColor.YELLOW + " " + Main.getConfig().getString("warn-msg"));
Main.... | 5 |
public void render(Graphics g) {
if (World.gameMode == World.GameMode.CLASSIC) {
g.setFont(font);
g.setColor(Color.BLACK);
g.drawString("SCORE: " + World.SCORE, 15, 45);
g.drawString("HIGHSCORE: " + World.HIGHSCORE, 15, 65);
} else if (World.gameMode != World.GameMode.CLASSIC) {
for (int i = 0; i < W... | 8 |
private void paivitaMinX(){
double minX = Double.POSITIVE_INFINITY;
for (KentallaOlija osa : osat){
if (osa.getMinX() < minX){
minX = osa.getMinX();
}
}
if (getSuojakilpi()){
if (getX()-getSuojakilvenHalkaisija()/2 < m... | 4 |
private void analyzeTextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_analyzeTextButtonActionPerformed
// TODO add your handling code here:
JFileChooser fileChooser = new JFileChooser();
javax.swing.filechooser.FileFilter textFilter = new javax.swing.filechooser.FileFi... | 6 |
@Override
public void setKey(String key) throws Exception {
byte[] keyB = key.getBytes();
if (keyB == null) {
throw new RuntimeException("Invalid key: Key was null");
}
if (keyB.length < 16) {
throw new RuntimeException("Invalid key: Length was less than 16 ... | 3 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals(FILE_EXIT)) {
System.exit(0);
} else if(e.getActionCommand().equals(VIEW_PLAYERS)){
AllPlayersGui playerGui = new AllPlayersGui("Players", "Players", desktop);
playerGui.setVisible(true);
desktop.add(playerGui);
}... | 9 |
public CaseVue(int idCase) {
super();
switch (idCase) {
case 0:
setBackground(Color.white);
break;
case 1:
setBackground(Color.cyan);
break;
case 2:
setBackground(Color.yellow);
... | 8 |
public void onAnalog(String name, float value, float tpf) {
if(InputBitArray.AXIS_X_POS.equalsIgnoreCase(name)) {
player.yaw(value*player.getMouseSensitivity()*tpf);
return;
}
if(InputBitArray.AXIS_X_NEG.equalsIgnoreCase(name)) {
player.yaw(-value*player.getMo... | 4 |
public ClassNode getClass(String name) {
if (name == null) {
return null;
}
ClassNode c = getClasses().get(name);
if (c == null) {
c = cachedExternalClasses.get(new ID(name));
if (c == null) {
c = new ClassNode();
ClassReader cr;
try {
cr = new ClassReader(name);
} catch (IOExcep... | 4 |
public static void main(String[] args) {
if (args.length != 9) {
System.out.println("{͂Ă");
System.exit(1);
} else {
File datFile = new File(ConstansBook.DAT_URL);
File oldFile = new File(ConstansBook.OLD_DAT_URL);
// oldt@ĈȂĂB
if (oldFile.exists()) {
OldBookDeleter del = new OldBookDele... | 8 |
public void log(int verbosity, String... args)
{
if (frame != null)
frame.log(verbosity, args);
if (( verbosity == 0 ) && !silent )
{
String message = new String();
for (int i = 0; i < args.length; i++)
{
if(i == 0) continue;
... | 6 |
private void deleteRoom(JSONObject obj) {
RoomInfo roomInfo = roomMap.remove(obj.get("id_room"));
if(roomInfo!=null)
{
for(Team team : roomInfo.getTeams().values())
{
for(User user : team.getMembers())
{
clientMap.remove(user.getId());
}
}
}
} | 3 |
private static Map<Character, String> toCharacterKey(Map<String, Character> inMap) {
Map<Character, String> outMap = new HashMap<Character, String>();
for (Map.Entry<String, Character> entry: inMap.entrySet()) {
Character character = entry.getValue();
String name = entry.getKey()... | 3 |
public void paintComponent(Graphics g) {
super.paintComponent(g);
if(rectangles != null && process_repaint) {
ModelInstance model = ModelInstance.getInstance();
Iterator<Map.Entry<Integer, Point>> it = rectangles.entrySet().iterator();
while(it.hasNext()) {
Map.Entry<Integer, Point> entry = it.next();
... | 5 |
private void fixedPointSimplestCaseNonCyclicFillRaster(int[] pixels,
int off,
int adjust,
int x, int y,
... | 6 |
public static int partition(Comparable[] a, int lo, int hi) {
Comparable v = a[lo];
int i = lo;
int j = hi + 1;
while (true) {
while (less(a[++i], v)) {
if (i == hi) {
break;
}
}
while (less(v, a[--j])) {
if (j == lo) {
break;
}
}
if (i >= j) {
break;
}
exch(a,... | 6 |
public String getExpressionString()
{
if( ((expression == null) || (expression.size() == 0)) && (getCachedOOXMLExpression() != null) )
{
return "=" + getCachedOOXMLExpression();
}
if( expression != null )
{
return FormulaParser.getExpressionString( expression );
}
return "=";
} | 4 |
@Override
public void execute(CommandExecutor player, String[] args)
{
if(args.length == 1){
if(BanHandler.isBanned(args[0]))
{
BanHandler.unban(args[0]);
player.sendMessage("You unbanned " + args[0]);
}else{
player.sendMessage(args[0] + " is not banned.");
}
}else{
help(player);
}
} | 2 |
private void initGrid(){
gridPanel = new JPanel(new GridLayout(4, 4,1,1));
gridPanel.setBackground(Color.WHITE);
gridPanel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 10));
gridPanel.add(new JLabel("Name:"));
gridPanel.add(new JLabel(character.getName()));
gridPane... | 9 |
public static void load() {
scripts.clear();
File file = new File("./scripts/");
try {
URLClassLoader loader = new URLClassLoader(new URL[] { file.toURI().toURL() });
for(String s : file.list()) {
if(s.contains(".class")) {
Class<?> clazz = loader.loadClass(s.replace(".class", ""));
if(clazz.g... | 9 |
protected void processVotingResult(String data) {
String[] splits = data.split(" ");
Integer nodeId = Integer.parseInt(splits[0]);
String operation = splits[1];
String resource = splits[2];
if(operation.compareTo("LOCK") == 0){
if(resources.containsKey(resource)){
ResourceState resState = resources.... | 7 |
public void run(){
BufferedImage img = new BufferedImage(f.getContentPane().getWidth(),f.getContentPane().getHeight(),BufferedImage.TYPE_INT_RGB);
Graphics g = img.getGraphics();
f.getContentPane().printAll(g);
try {
FTPConfig config = FTPConfig.getConfig();
ImageIO.write(img,"png"... | 2 |
public int getSize() {
/*
* maxStack: 2 maxLocals: 2 code: 4 + codeLength exc count: 2
* exceptions: n * 8 attributes: lvt_name: 2 lvt_length: 4 lvt_count: 2
* lvt_entries: n * 10 attributes: lnt_name: 2 lnt_length: 4 lnt_count:
* 2 lnt_entries: n * 4
*/
int size = 0;
if (lvt != null)
size += 8 ... | 2 |
public void layout() {
if (table == null || table.isDisposed())
return;
if (item == null || item.isDisposed())
return;
int columnCount = table.getColumnCount();
if (columnCount == 0 && column != 0)
return;
if (columnCount > 0 && (column < 0 || column >= columnCount))
return;
super.layout();
} | 9 |
public void draw(Game game, Graphics2D g2d) {
// Gets Actual screen dimensions.
Dimension res = game.getSize();
// Fill it black.
g2d.setBackground(COLORS[0]);
g2d.setColor(COLORS[0]);
g2d.fillRect(0,0,res.width,res.height);
// Virtual Screen dimensions. (This will always be 16:9 ratio... | 5 |
public Stmt Statement() throws ParseException {
Stmt s;
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case LOCAL:
s = LocalDecl();
break;
case IF:
s = IfStatement();
break;
default:
jj_la1... | 8 |
public void setLid(Lid lid) {
this.lid = lid;
} | 0 |
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < getFileServerInfo().size(); i++) {
sb.append(i + 1).append(". ").append(getFileServerInfo().get(i)).append("\n");
}
return sb.length() > 0 ? sb.toString() : "No file servers connected\n";
} | 2 |
@Override
public Ticket in(Car car, List<Park> parkList) {
int no = -1;
int num = -1;
for(int i = 0; i < parkList.size(); i ++) {
Park park = parkList.get(i);
if(park.isFull()) {
continue;
}
if(num < 0) {
num = park.getTotal... | 5 |
public static void main(String[] args) throws FileNotFoundException {
final String USERFILE = "userItineraries.txt";
final String FLIGHTFILE = "allFlights.txt";
boolean done = false;
//Initialize USERFILE for first time user
try {
getPassengers(USERFILE);
}
catch (FileNotFoundException except) {
... | 8 |
@Override
public Object parseClass(Class<?> c, Object o, MainView view) {
Method methods[] = c.getMethods();
for(int i = 0; i < methods.length; i++){
try{
if(methods[i].isAnnotationPresent(GetDatabase.class)){
if(o == null){
o = c.newInstance();
Log.getLogger().log(Level.INFO, "Initializing... | 6 |
public float [][] calcEnergy(InputStream is, int fStart, int fEnd){
Manager manager = new Manager(is);
int cont = 0;
int bytes = 0;
final int opt = Constants.DEQUANTIZED_DOMAIN;
float [][] E = new float [2][fEnd - fStart];
float [][] energy = {{0f, ... | 8 |
private void t5CaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_t5CaretUpdate
jScrollPane1.setVisible(false);
jScrollPane2.setVisible(true);
DefaultTableModel model1 = (DefaultTableModel) jTable2.getModel();
int bookcode = 0;
int n = 0;
String query;
... | 5 |
@Override
public int run(String[] args) throws Exception {
if (args.length != 4) {
System.err.println("Usage: PageRank <input path> <output path> <iterations> <tolerance>") ;
return -1 ;
}
FileSystem fs = FileSystem.get(getConf()) ;
String input = args[1] + File.separator + "previous-pageranks";
Str... | 8 |
private void jBAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBAddActionPerformed
JDNuevaTarea jdnt = new JDNuevaTarea(this, true);
jdnt.setVisible(true);
//Si ha pulsado aceptar se añadirá la tarea creada al estado actual
if (jdnt.haPulsadoAceptar()) {
... | 4 |
private void jackpot(String msg, String ttl) {
if (JOptionPane.showConfirmDialog(this, msg, ttl,
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
reset();
else {
parent.dispose();
System.exit(0);
}
} | 1 |
public boolean Update() {
//System.out.println("Running Control Update");
//run the sweepers through CParams::iNumTicks amount of cycles. During
//this loop each sweepers NN is constantly updated with the appropriate
//information from its surroundings. The output from the NN is obtained
//and the sweep... | 9 |
private SharingPeer getOrCreatePeer(byte[] peerId, String ip, int port) {
Peer search = new Peer(ip, port,
(peerId != null ? ByteBuffer.wrap(peerId) : (ByteBuffer)null));
SharingPeer peer = null;
synchronized (this.peers) {
peer = this.peers.get(search.hasPeerId()
? search.getHexPeerId()
: sea... | 6 |
public synchronized void addPoints(MapleClient c, int points, long expiration, String reason) {
// if (c.getPlayer().isJounin()) return;
int acc = c.getPlayer().getAccountID();
List<String> reasonList;
if (this.points.containsKey(acc)) {
if (this.points.get(acc) >= AUTOBAN_POINTS) return;
this.points.put(... | 6 |
public int getChildCount() {
return canHaveChildren() ? mChildren.size() : 0;
} | 1 |
@Override
public boolean equals(Object y) {
if (y == null)
return false;
if (y.getClass() != this.getClass()) {
return false;
}
Board that = (Board) y;
if (this.N != that.N)
return false;
if (this.io != that.io || this.jo != that.jo)
return false;
for (int i = 0; i < N; i++)
for (int ... | 9 |
private Object handlePrimitive(JsonPrimitive json) {
if (json.isBoolean()) {
return json.getAsBoolean();
} else if (json.isString()) {
return json.getAsString();
} else {
BigDecimal bigDec = json.getAsBigDecimal();
// Fi... | 4 |
static byte[] unpackArchive(byte[] is, int i) {
anInt7046++;
ByteBuffer class348_sub49 = new ByteBuffer(is);
int i_37_ = class348_sub49.getUByte();
if (i > -74)
method3156(true, null);
int i_38_ = class348_sub49.getDword();
if (i_38_ < 0
|| (HandshakePacket.anInt401 != 0
&& (HandshakePacket.anInt401 ^... | 9 |
public boolean checkParticipant(String Participant) { // TODO: Clean up
if (victim.getPilot().getCharacterName().equalsIgnoreCase(Participant)) {
return true;
}
if (attackers != null) {
for (ShipAndChar attacker : attackers) {
try {
if (attacker.getPilot().getCharacterName()
.equalsIgnoreCas... | 5 |
public Partner findPartnerById(final Long id) {
return new Partner();
} | 0 |
public static Config readFile(String path) {
Config result = new Config();
try {
FileReader fr = new FileReader(path);
BufferedReader br = new BufferedReader(null);
String line = br.readLine();
KeyValue kv = null;
while(line != null) {
kv = KeyValueFactory.fromString(line);
... | 3 |
public ControlPanel(SelectTreeDrawer treeDrawer,
MinimizeController controller) {
super();
this.treeDrawer = treeDrawer;
this.controller = controller;
initView();
} | 0 |
public Game()
{
addKeyListener(new KeyInput(this));
setFocusable(true);
setDoubleBuffered(true);
requestFocusInWindow();
magnus = new Magnus();
platform = new Platform();
//Game Timer
timer = new Timer(5, this);
timer.start();
... | 2 |
public Tool(types type, String path) {
this.path = path;
switch(type) {
case CHALCEUS:
duration = 25;
path += "Chalceus.png";
break;
case ARGNTUM:
duration = 40;
path += "Argentum.png";
break;
case AURAIRUS:
duration = 60;
path += "Aurairus.png";
break;
case AETHERIUM:
dura... | 5 |
public void updateID() {
if(ID == 0) {
int x = 1;
while(Spell.validID(x)) {
x++;
}
IDText.setText(x + "");
}
} | 2 |
public static void setGrid() {
Color color;
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 4; x++) {
color = getColor(x, y);
for (int c = 0; c < 12; c++) {
if (colors[c].equals(color)) {
Calculate.scenarios[0].gri... | 4 |
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// CHANGE: The EJB is instantiated automatically
// CourseModel model = CourseModelImpl.getInstance();
String path = request.getServletPath();
if (path.equ... | 8 |
@Override
public double findCustomersBalance(int id) {
double customersBalance = 0;
String sql = "SELECT balance FROM customer WHERE customer_id='" + id + "';";
Connection con = null;
try {
con = getConnection();
PreparedStatement statement = con.prepareStatement(sql);
ResultSet resultSet = stat... | 3 |
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... | 8 |
@Override
public void keyPressed(KeyEvent e)
{
if(selectedIndex != -1)
{
String chr = KeyEvent.getKeyText(e.getKeyCode());
if(frame.buttons[selectedIndex].getText().indexOf(chr+" + ") == -1)
frame.buttons[selectedIndex].setText(frame.buttons[selectedIndex].getText()+chr+" + ");
if(e.getKeyCode() ... | 4 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(targ... | 9 |
private void func_31010_a(float var1, float var2) {
if(!this.extending) {
--var1;
} else {
var1 = 1.0F - var1;
}
AxisAlignedBB var3 = Block.pistonMoving.func_31035_a(this.worldObj, this.xCoord, this.yCoord, this.zCoord, this.storedBlockID, var1, this.storedOrientation);
... | 4 |
private void groupBySourceAndAnalyze(Walk[] paths) {
int curSource = -1;
ArrayList<Walk> curSet = new ArrayList<Walk>();
for(int j=0; j < paths.length; j++) {
Walk w = paths[j];
if (w.getSource() != curSource) {
if (curSource != -1) processWalksFromSource(... | 3 |
public Collection<LineUp> getLineUps()
{
if (lineUps == null || lineUps.size() == 0)
fillLineUp();
return lineUps;
} | 2 |
public void moveStep() {
switch(dir){
case EAST: this.x++;
break;
case NORTH: this.y--;
break;
case SOUTH: this.y++;
break;
case WEST: this.x--;
break;
default:
break;
}
} | 4 |
public Bittorrent(Object bo) {
Logger.getInstance().debug("Creating Bittorrent with Obj: " + bo.toString());
try {
HashMap<String, Object> raw = (HashMap<String, Object>) bo;
if (raw.containsKey("announceList")) {
Object[] announceArray = (Obj... | 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.