text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void eventDispatched(AWTEvent event) {
if (MouseEvent.MOUSE_CLICKED == event.getID() && event.getSource() != button) {
Set<Component> components = getAllComponents(datePanel);
boolean clickInPopup = false;
for (Component component : components) {
... | 5 |
private Color getColor(SquareType square) {
if (square == null) {
return Color.WHITE;
} else {
switch (square) {
//I, L , J, T, O, S, Z, EMPTY, OUTSIDE;
case I:
return Color.BLUE;
case L:
retu... | 9 |
public void buildcountytable(List<Tuple> tups, StateProfile result) {
Iterator<Tuple> tupiter = tups.iterator();
while (tupiter.hasNext())
{
Tuple t = tupiter.next();
outputService.getCountyProfile(result.getStateInfo().getID(), t.getId(), new AsyncCallback<CountyProfile>() {
public void onFailure(Thro... | 4 |
public static void drawHerbsMinimap(GOut g, Coord tc, Coord hsz) {
if(UI.instance.minimap == null) return;
synchronized (UI.instance.minimap.hherbs) {
for (Pair<Coord, String> arg : UI.instance.minimap.hherbs) {
Coord ptc = arg.fst.div(tileSize).add(tc.inv())
.add(hsz.div(2));
g.chcolor(Color... | 2 |
@Override
public void paintComponent(Graphics g)
{
super.paintComponent(g);
try
{
g.drawImage(object.getSprite(), 5, 5, null);
}
catch(NullPointerException e) {}
} | 1 |
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 Map<UserType, Set<Session>> getMySessions(String email) {
Map<UserType, Set<Session>> mySessions = new HashMap<UserType, Set<Session>>();
Set<Session> adminSessions = new HashSet<Session>();
Set<Session> facilitatorSessions = new HashSet<Session>();
Set<Session> attendeeSessions = new HashSet<Session>();... | 9 |
public static int Dcalculation(Planet pA, Planet pB) { // Tested
// The next values are only relatives value to the global values of grothrates and number of ships
int hisLoss = 0;
int myLoss = 0;
int hisGrowth = 0;
int myGrowth = 0;
if (Helper.WillCapture(pA,pB)){
/* if A capture B */
myLoss = ... | 3 |
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String nextPage = request.getPathInfo();
if (nextPage != null) {
if (nextPage.substring(1).contentEquals("connexion")) {
connexion(request);
} else if (nextPage.substring(1).contentEqu... | 5 |
public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
case '"':
case '\'':
return nextString(c);
case '{':
back();
return new JSONObject(this);
case '[':
... | 8 |
public static boolean isSpecial(Pokemon.Type t)
{
switch(t)
{
case FIRE:
case WATER:
case ELECTRIC:
case GRASS:
case ICE:
case PSYCHIC:
case DRAGON:
return true;
default:
return false;
}
} | 7 |
@Override
public Object put(CycSymbol parameterName, Object value) {
// @Hack if the value is :UNKNOWN the parameter will not be set and it is assumed that
// Cyc uses its own default for that particular parameter
if (value instanceof CycSymbol && ((CycSymbol) value).toString().equals(":UNKNOWN")) {
... | 8 |
public void startAnimation(Graphics2D g){
if(timerRepeats>100 && timerRepeats<102){g.setColor(Color.blue);g.fill(screen);loadImage(g,"CyrusAntiVirus.png");}
if(timerRepeats>200 && timerRepeats<203){ g.setColor(Color.blue);g.fill(screen);loadImage(g,"CyrusAntiVirus.png");}
if(timerRepeats>300 && timerRepeats<304){... | 9 |
public Instances getDataSet() throws IOException {
Instances result;
double[] sparse;
double[] data;
int i;
if (m_sourceReader == null)
throw new IOException("No source has been specified");
if (getRetrieval() == INCREMENTAL)
throw new IOException("Cannot mix getting Instance... | 9 |
private static Method findSetScriptContextMethod(Class<?> clazz)
{
try
{
Method setCtxMethod = clazz.getMethod("setScriptContext", new Class[]
{
ScriptContext.class
});
int modifiers = setCtxMethod.getModifiers();
if (Modifier.isPublic(modifiers) && Modifier.isStatic(modifiers))
{
return ... | 4 |
public boolean containsPoint(Point p) {
if (p.x > getLeftEdge()) {
if (p.x < getRightEdge()) {
if (p.y > getTopEdge()) {
if (p.y < getBottomEdge()) {
return true;
}
}
}
}
retur... | 4 |
void addAwaitingResume(DccFileTransfer transfer) {
synchronized (_awaitingResume) {
_awaitingResume.addElement(transfer);
}
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Customer other = (Customer) obj;
if (!Objects.equals(this.id, other.id)) {
return false;
... | 9 |
public Object getValueAt(int rowIndex, int columnIndex) {
switch (columnIndex) {// parcour par colonne
case 0 :
return listClient.get(rowIndex).getId();
case 1://colonne type_vetement
return listClient.get(rowIndex).getNom();
cas... | 4 |
@Override
public void addBoats(ArrayList<Boat> boatList) throws SQLIntegrityConstraintViolationException, SQLException {
theConnection.open();
Connection conn = theConnection.getConn();
try {
int[] boatID = new int[boatList.size()];
conn.setAutoCommit(false);
... | 4 |
public int getIntInput(String promptMessage, String invalidInputMessage){
int userInput = 0;
boolean inputInvalid = true;
while (inputInvalid) {
System.out.print(promptMessage);
String response = Main.Scan.next();
Pattern digitPattern = Pattern.compile("([0-9]+)");
Matcher digitMatches = digitPattern.... | 2 |
public static void readStatement(String lexeme, SymbolTable currTable) throws IOException{
int[] offset = currTable.getOffsetByLexeme(lexeme);
String type = currTable.getTypeByLexeme(lexeme);
boolean byRef = false;
if(offset != null) {
//by copy
for (Symbol s: currTable.symbols) {
if(s.iden.equals(lex... | 9 |
public static void main(String[] args) throws Exception{
WebDriver driver = new FirefoxDriver();
driver.get("http://www.fifa.com/worldcup/matches/index.html"); // matches
PrintWriter writer = new PrintWriter("/u/jeremiah/MatchStats.txt");
// gotta get a list of the countries, but like with... | 4 |
public static Texture getDude(boolean flip, Gun gun){
if(!flip){
if(gun == Gun.PISTOL){
return fpistol;
}else if(gun == Gun.SMG){
return fsmg;
}else if(gun == Gun.GRENADE){
return fgre;
}else if(gun == Gun.NONE){
return fdude;
}
}else{
if(gun == Gun.PISTOL){
return pistol;
}... | 9 |
private void printTime(double time) {
System.out.println("Average time taken: " + time + " ms");
} | 0 |
protected int getKnownAttributeCount() {
int count = 0;
if (constant != null)
count++;
if (syntheticFlag)
count++;
if (deprecatedFlag)
count++;
return count;
} | 3 |
private void setLinearity(int linearity) {
myLinearity = linearity;
} | 0 |
private int getCharScore(char c) {
try {
return charScore[c - 97];
} catch (IndexOutOfBoundsException e) {
return 0;
}
} | 1 |
private void attackPlaceLeft(int position, char[] boardElements, int dimension) {
if (isPossibleToPlaceLeft(position, dimension)) {
if (isPossibleToPlaceOnNextLine(boardElements, position + dimension)
&& isBoardElementEmpty(boardElements[positionLeftBelow(position, dimension)])) ... | 5 |
private TerminologyManager() {
try {
// user configuration
File userFile = new File(TERMINOLOGIES_FILE);
if (!userFile.exists()) {
File dir = new File(System.getProperty("user.home")
+ System.getProperty("file.separator") + "odml");
if (!dir.exi... | 8 |
public int addToQueue(String channel, String message, int source)
{
if (source == 0)
{
acebotCore.printChannel(addHash(channel), "[" + BotCore.sdf.format(new Date()) + "] ", graphics.acebotsthree.TIMECOLOR);
acebotCore.printlnChannel(addHash(channel), message, new Color(230, ... | 1 |
public void isBlackJack() throws PlayerEndOfGameException{
if (player.isBlackJack() && !dealer.isBlackJack()){
player.playerBlackJack();
throw new PlayerEndOfGameException("/photos/blackJack.gif");
}
if (player.isBlackJack() && dealer.isBlackJack())
throw new PlayerEndOfGameException("/photos... | 4 |
private void loadLeaderboard(int currentPlayersPosition, int quantity) {
// TODO Auto-generated method stub
lobby.setStatus("Loading Leaderboards");
this.currentLeaderPosition = quantity;
String result = sendMessageToServer(GameSocketServer.GET_TOP_PLAYERS,
",startAt=" + currentPlayersPosition + ",quantity=... | 1 |
public ArrayList<Shape> getRunwayLightings(Runway runway, AffineTransform at, Graphics2D g){
double runwayLength = runway.getLength();
double runwayWidth = runway.getWidth();
double runwayX = runway.getX();
double runwayY = runway.getY();
double runwayCenterX = runway.getCenterX();
double runwayCenterY = r... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Student student = (Student) o;
if (!number.equals(student.number)) return false;
return true;
} | 4 |
public void actionPerformed(ActionEvent e) {
Object o = e.getSource();
Debug.print("Action performed on: " + o);
if(o == okButton) {
Debug.print("Checking Yeast...");
// create a new Yeast object
Yeast i = new Yeast();
i.setName(txtName.getText());
i.setCost(txtCost.getText());
i.setDe... | 6 |
public MultipleOutputSimulateAction(Automaton automaton,
Environment environment) {
super(automaton, environment);
putValue(NAME, "Multiple Run (Transducer)");
putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_T,
MAIN_MENU_MASK));
} | 0 |
public static void initScript(NativeFunction funObj, Scriptable thisObj,
Context cx, Scriptable scope,
boolean evalScript)
{
if (cx.topCallScope == null)
throw new IllegalStateException();
int varCount = funObj.getParam... | 7 |
@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.fetchEffect(ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> already <S... | 8 |
public static String extractDate(String fullTitle) {
if (!fullTitle.contains("_URL_"))
return "incompatible text";
String dateTitle = fullTitle.replaceAll(".html", "").split("_URL_")[1];
return dateTitle;
} | 1 |
private void doEquip(ItemStack item) {
ItemMeta meta = item.getItemMeta();
if (meta == null) return;
if (!meta.hasLore()) return;
for (String lore : meta.getLore()) {
String name = ENameParser.parseName(lore);
int level = ENameParser.parseLevel(lore);
... | 6 |
public int findShortestDistance(String[] words, String a, String b) {
Map<String, Integer> parityValueMap = new HashMap<String, Integer>();
parityValueMap.put(a, 0);
parityValueMap.put(b, 1);
Map<String, Integer> posMap = new HashMap<String, Integer>();
posMap.put(a, 0);
... | 6 |
public static <E> E[] map(E[] a, Function<E> func){
assert a != null;
assert func != null;
assert a.length > 0;
E[] b = (E[]) Array.newInstance(a[0].getClass(), a.length);
assert b != null;
assert b.length != 0;
assert b.length == a.length;
for(int n = 0; n < b.length; n++){
assert 0 <= n &&... | 6 |
public final void method44(int i, AbstractToolkit var_ha) {
anInt10008++;
Object object = null;
r var_r;
if (aR10036 != null || !aBoolean10003) {
var_r = aR10036;
aR10036 = null;
} else {
Class2 class2 = method2417(0, var_ha, 262144, true);
var_r = class2 != null ? ((Class2) class2).aR118 : nul... | 5 |
public boolean isScramble(String s1, String s2) {
if (s1.length() != s2.length())
return false;
if (!hasSameChars(s1, s2))
return false;
if (s1.equals(s2))
return true;
for (int mid1 = 1; mid1 < s1.length(); mid1++) {
int mid2 = s1.length() - mid1;
String sub11 = s1.substring(0, mid1);
String ... | 8 |
public boolean equals(Object obj) {
try {
if (!obj.getClass().equals(baseVideoClass.class)) {
throw new Exception();
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return (obj != null)
&& ((baseVideoClass) obj).getType().equals(this.type);
} | 3 |
public void moveDown() {
if(!win && !m.getMap(p.getTileX(), p.getTileY() + 1).matches(pattern) && p.getTileY() != Maze.gridSize-1) {
if(yOffset < Maze.gridSize - 20 && p.getTileY() == yOffset + 10) {
Board.yOffset++;
p.move(0, 1);
} else {
p.move(0, 1);
}
}
} | 5 |
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 |
@Override
public ByteBuf serialize(O_02_MultipleAddressCallInput ucpOperation) {
ByteBuf bb = Unpooled.buffer();
Serialization.serializeString(bb, ucpOperation.getNpl());
Serialization.serializeString(bb, ucpOperation.getRads());
Serialization.serializeString(bb, ucpOperation.getOadc());
Serialization.ser... | 2 |
public void attach(String word) {
if (word.length() > 1) {
if (this.isRoot()) {
Character key = Character.valueOf(word.charAt(0));
MTrieNode node = (MTrieNode) this.children.get(key);
if (node != null) {
node.attach(word);
} else {
this.children.pu... | 5 |
static public void remove(String name) {
if (states.containsKey(name)) {
states.remove(name);
}
} | 1 |
@Override
public void accept(Metadata metadata, InputStream content) throws IOException {
// handling of service type messages
if (metadata.getType() == Metadata.Type.SERVICE) {
List<MessageReceiver> receivers = new ArrayList<>();
synchronized (consumers) {
Ma... | 7 |
public void update(GameContainer gc, StateBasedGame sbg, int delta)throws SlickException
{
if(!isGameOver)
{
if(!isPause)
{
}
else
{
}
}
else
{
}
} | 2 |
public void mousePressed(MouseEvent event) {
State state = getDrawer().stateAtPoint(event.getPoint());
if (state == null)
return;
controller.expandState(state);
} | 1 |
public PDFObject getDictRef(String key) throws IOException {
if (type == INDIRECT) {
return dereference().getDictRef(key);
} else if (type == DICTIONARY || type == STREAM) {
key = key.intern();
HashMap h = (HashMap) value;
PDFObject obj = (PDFObject) h.get... | 3 |
private boolean validPlacement(int x, int y, Entity entity){
int width = entity.getWidthInTiles();
int height = entity.getHeightInTiles();
boolean validPlacement = true;
for(int i = 0; i < height; i++){
for(int c = 0; c < width; c++){
if(gameMap[c+x][y-i] != null && gameMap[c+x][y-i] != entity){
... | 4 |
private static int sortUtil(int[] array, int low, int high) {
int key = array[low];
while(low < high) {
while(high > low && array[high] >= key) {
high--;
}
array[low] = array[high];
while(low < high && array[low] <= key) {
low++;
}
array[high] = array[low];
... | 5 |
public void quickSort(int[] a, int begin, int end) {
int left = begin;
int right = end;
int temp = a[left];
while (left < right) {
while (left < right && a[right] >= temp)
right--;
if (left < right)
a[left] = a[right];
while (left < right && a[left] < temp)
left++;
if (left < right)
... | 9 |
@Override
public String execute() throws Exception {
PingjiaoService service = new PingjiaoService();
Map<String, Object> application = ActionContext.getContext()
.getApplication();
getSearchList(service, application);
// 设置表格第一行第一列的文本
firstTitle = "";
if (course == null && professionalName == null
... | 7 |
private void modifyExtensionAnnotatedRefset(RefexChronicleBI<?> memberChron) throws ContradictionException, InvalidCAB, IOException {
RefexVersionBI<?> mem = memberChron.getVersion(vc);
RefexCAB bp = mem.makeBlueprint(vc, IdDirective.PRESERVE, RefexDirective.INCLUDE);
if (bp.getMemberUUID() == null) {
bp.setM... | 4 |
@Override
public void run() {
try {
packet = receivePacket();
stdOut.writeln(TAG + " received packet is: " + packet);
} catch (Exception e) {
stdOut.printError(e.getMessage());
cancelOnReceiveError();
return;
}
if (initiat... | 4 |
@SuppressWarnings("unused")
private int getLayerFromIndex(final int index) {
int layer = 0;
while (index > Math.pow(2, layer) - 1) {
layer++;
}
return layer;
} | 1 |
public ArrayList<ExternalUser> getAllExternalUsersFromDatabase(){
ArrayList<ExternalUser> externalUsers = new ArrayList<>();
ArrayList<HashMap<String, String>> externalUsers_raw = mySQLQuery.getAllRows("ExternalUser");
for(HashMap<String, String> externalUser_raw : externalUsers_raw){
... | 3 |
public static Product buscarCod(String cod) throws IOException{
try {
ObjectInputStream dataIn=new ObjectInputStream(Files.newInputStream(path));
while(true ){
Product product=(Product) dataIn.readObject();
if(product.getCod().equalsIgnoreCase(cod)){
System.out.println("Este c... | 5 |
public SimpleStochasticLotSizingSolution(double totalSetupCosts, double totalInventoryCosts,
String amountVariableName, double[] amountVariableValues,
boolean[] setupPattern) {
//Check inputs
if (amountVariableValues.length != setupPattern.length) throw new IllegalArgumentException("Planning horizons did not ... | 1 |
public String cutToSize(String o, int limit) {
if(o.length() > limit) {
o = o.substring(0, limit);
}
else if (o.length() < limit) {
while (o.length() < limit) {
o += " ";
}
}
return o;
} | 3 |
@Override
public int willingnessToMoveHere(Hero hero, Player player, float distance,
int day) {
float moveRatio = hero.getMovePoints()/distance;
float result = 0;
Cost need = player.getBalancedBudget();
if (type == ResourceType.GOLD) {
result = 1.2f*(moveRatio + Math.min(3, need.gold/amount));
} els... | 3 |
private void drawAxis(int[] bits){
int pw = getPanelWidth();
int ph = getPanelHeight();
int xNull = getXnull();
int yNull = getYnull();
for (int i = 0; i < ph; i++){
bits[i*pw + xNull] = GUIStandarts.axisColor;
}
for (int i = 0; i < pw; i++){
... | 2 |
public void magicComplex(int screen) {
if (screen == 1) {
clearMenu();
menuLine("", "You can see what each of the spells", 6949, 0);
menuLine("", "does by selecting the spellbook icon on", 0, 1);
menuLine("", "your side interface. Move the mouse", 0, 2);
menuLine("", "over the icon of the spell you wan... | 6 |
public String getFranchiseAirportName(int ID)
throws UnauthorizedUserException, BadConnectionException, DoubleEntryException
{
/* Variable Section Start */
/* Database and Query Preperation */
PreparedStatement statment = null;
ResultSet results = null;
... | 8 |
public boolean Open(String path)
{
try
{
FileInputStream open_file = new FileInputStream(path);
byte fileheader[] = new byte[14];
byte infoheader[] = new byte[40];
open_file.read(fileheader);
open_file.read(infoheader);
if (file... | 9 |
public static void rectangle(double x, double y, double halfWidth, double halfHeight) {
if (halfWidth < 0) throw new RuntimeException("half width can't be negative");
if (halfHeight < 0) throw new RuntimeException("half height can't be negative");
double xs = scaleX(x);
double ys = scal... | 4 |
protected static void rechercheTrajetsParticipant(Membre m){
ArrayList<Trajet> resConducteur = dbT.getTrajetByConducteur(m);
ArrayList<Trajet> resPassager = dbT.getTrajetsWithPassager(m);
System.out.println();
if(resConducteur.size()==0 && resPassager.size()==0){
System.out.println("Vous ne participez enc... | 6 |
public final String getEmpty() {
return toSubstitute;
} | 0 |
public void setVisible(boolean visible) {
if(frame == null) {
frame = new JFrame("About YAMG");
mainPanel = new JPanel(new GridLayout(18, 2));
mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
addRow("Game Version", Configurables.GAME_VERSION);
addRow("Lead Programmer", "Daniel Glus")... | 3 |
private Ball getBall() {
if (networkGameType == NetworkGameType.MASTER)
return new Ball(100, 40, (int)(BALL_SCALE * width), (int)(BALL_SCALE * width));
else
return new Ball(width - 110, 40, (int)(BALL_SCALE * width), (int)(BALL_SCALE * width));
} | 1 |
private void addDependent(JSRTargetInfo result) {
if (dependent == null || dependent == result)
dependent = result;
else if (dependent instanceof JSRTargetInfo) {
Set newDeps = new HashSet();
newDeps.add(dependent);
newDeps.add(result);
} else if (dependent instanceof Collection) {
((Collec... | 4 |
@Override
public boolean shouldReact(Message message) {
String messageText = message.text.trim();
if (messageText.startsWith("movie") ||
messageText.startsWith("movies") ||
messageText.startsWith("vycsfdkuj") ||
messageText.startsWith("vyfilmuj")) {
... | 6 |
public static int[] mergeSort(int[] array)
{
if (array.length==1) return array;
int mid = (array.length) / 2;
int[] low = new int[mid];
int[] high = new int[array.length-mid];
for (int i=0;i<array.length;i++)
{
if (i<mid)
{
low[i]=array[i];
}
else
{
high[i-mid]=array[i];
... | 8 |
public void process(String tweet) throws IOException {
JSONParser jsonParser = new JSONParser();
String tweetText = null;
String tweetTimestamp = null;
String tweetId = null;
String tweetUserId = null;
String tweetInReplyToStatusId = null;
try {
JS... | 2 |
public static void loadFile()
{
Scanner in = null;
try{
in = new Scanner(new FileReader(fileName));
}
catch(Exception e){System.out.println("File Doesn't Exist");}
for(int i=0; i<151; i++)
seen[i] = in.nextBoolean();
for(int i=0; i<151; i++)
caught[i] = in.nextBoolean();
totalSeen = Integer.p... | 3 |
public void update() {
for(int y = 0; y < ySize; y++) {
for(int x = 0; x < ySize; x++) {
Site site = (Site)scape.grid[x][y];
JLabel label = labels[x][y];
Color background = new Color(255, 250, 205);
label.setBackground(background);
Agent a = site.getAgent();
if(a != ... | 5 |
public int getPositionInRefereeClassArray(String name)
{
int positionInList = 0;
for (int i = 0; i < elementsInArray; i++)
if (refereeClassArray[i] != null && refereeClassArray[i].getRefereeName().equals(name))
positionInList = i;
return positionInList;
} | 3 |
private void compute() {
if (computed) {
return;
}
float sum = 0;
int n = 0;
while (true) {
float val;
try {
val = floatVal(n);
} catch (ArrayIndexOutOfBoundsException e) {
break;
}
sum += val;
minVal = Float.isNaN(minVal) ? val : Math.min(mi... | 6 |
public boolean isClause(ArrayList<String> potentialClause, ArrayList<String> charIdentifier) {
for (int i = 0; i < this.subjectsOf(potentialClause, charIdentifier).size(); i++) {
if ((this.subjectsOf(potentialClause, charIdentifier).get(i).isEmpty())
|| (this.actionsOf(potentialC... | 3 |
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (!plugin.hasPerm(sender, "heal", false)) {
sender.sendMessage(ChatColor.YELLOW
+ "You do not have permission to use /" + label);
return true;
}
if (args.length == 0) {
if (plugin.isPlayer(sender)) {... | 5 |
private void calcCuboidsMinMax() {
if (!(frameRenderer instanceof ExtendedFrameRenderer))
return;
Cuboids c = ((ExtendedFrameRenderer) frameRenderer).cuboids;
if (c.isEmpty())
return;
Point3f min = c.getMin();
Point3f max = c.getMax();
if (min.x < minBoundBox.x)
minBoundBox.x = min.x;
if (min.y <... | 8 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SalesDetail other = (SalesDetail) obj;
if (idOrder == null) {
if (other.idOrder != null)
return false;
} else if (!idOrder.equals(other.... | 6 |
public String getTwoPair()
{
String stt = "0";
//same implementation idea as in isOnePair method.
//this time, when a pair is found, a second pair must be found too.
if (cards[0].getRank() == cards[1].getRank()) {
if (cards[2].getRank() == cards[3].getRank()) {
... | 5 |
public void loadAllFFmpegArguments(List<FFmpegArguments> list)
{
if (connection == null || list == null)
return;
list.clear();
Statement stat = null;
try {
stat = connection.createStatement();
ResultSet rs = stat.executeQuery(
"SELECT Name, Arguments, FileExtension FROM "
+ FFmpegArgu... | 6 |
public static <E> void reversedBFSWithLine(KAryTreeNode<E> root) {
if(root == null) {
return;
}
ArrayList<Integer> lineNodeCount = new ArrayList<Integer>();
Queue<KAryTreeNode<E>> queue = new LinkedList<KAryTreeNode<E>>();
Stack<KAryTreeNode<E>> stack = new Stack<KAryTreeNode<E>>();
queue.add(root);
l... | 7 |
private void jButtonEliminarBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEliminarBuscarActionPerformed
if (banco.longitud() == 0) {
mostrarOption("Error: No hay clientes registrados en el banco.\n Ingrese las cuentas antes de hacer esta operacion.", JOptionPane.ERR... | 6 |
public boolean inAreaCapturable(Player p)
{
int x = p.getLocation().getBlockX();
int z = p.getLocation().getBlockZ();
int y = p.getLocation().getBlockY();
//inner 1/2
int capRadius = AreaRadius / 2;
if(capRadius*2 <= 50)
capRadius = 25;
String worldname = p.getWorld().getName();
b... | 7 |
@Override
protected void onConnect() {
if(addons.isEmpty())
registerAddons();
} | 1 |
@Override
public void windowActivated(WindowEvent arg0)
{
} | 0 |
public int[][] getActualState()
{
int[][] gridState = new int[sudokuSize][sudokuSize];
for (int i = 0; i < sudokuSize; i++) {
for (int j = 0; j < sudokuSize; j++) {
gridState[i][j] = cells[i][j].valueState;
}
}
return gridState;
} | 2 |
public static void backup(){
String fileDate = "";
String fileExt = ".bin";
//get parameters from GUI
getParametersFromGUI();
//check if the path ends with "/" or "\" - if not, display a Popup
if (!(filepath.endsWith("/") || filepath.endsWith("\\")))
OptionPanes.notifyFilepath... | 5 |
public String createCalendar(String username, String calendar, boolean isPublic) {
try {
crs = qb.selectFrom("calendars").where("calendar", "=", calendar).executeQuery();
if(!crs.next()) {
if(isPublic)
{
String[] keys = {"calendar", "createdBy"};
String[] values = {calendar, username};
q... | 4 |
@Override
public void visitEnd() {
boolean hasDummy = dummyArgument != 0;
String callerMethodDescriptor = hasDummy ? methodDescriptor.replace("I)", ")") : methodDescriptor;
Type[] argumentTypes = Type.getArgumentTypes(methodDescriptor);
MethodVisitor methodVisitor = cv.visitMethod(Opcodes.ACC_PUBLIC, callerMeth... | 5 |
private void process() {
Scanner in = new Scanner(System.in);
int hotkeys = in.nextInt();
HashMap<String,ArrayList<String>> operationsPerKey = new HashMap<String,ArrayList<String>>();
ArrayList<String> possible = new ArrayList<String>();
in.nextLine();
for (int i = 0; i < hotkeys; i++) {
String keyLine ... | 9 |
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.