text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int getHeight() {
return height;
} | 0 |
private boolean jj_3_36() {
if (jj_3R_53()) return true;
if (jj_3R_54()) return true;
return false;
} | 2 |
private static boolean isPrimitiveOrString(Object target) {
if (target instanceof String) {
return true;
}
Class<?> classOfPrimitive = target.getClass();
for (Class<?> standardPrimitive : PRIMITIVE_TYPES) {
if (standardPrimitive.isAssignableFrom(classOfPrimitive)) {
return true;
... | 5 |
void ChangeSwitchTexture(line_t line, boolean useAgain) {
int texTop;
int texMid;
int texBot;
int i;
int sound;
if (!useAgain)
line.special = 0;
texTop = LL.sides[line.sidenum[0]].toptexture;
texMid = LL.si... | 9 |
public void draw(Graphics2D g){
for(int h = 0; h < tiles.length; h++){
for(int w = 0; w < tiles[0].length; w++){
if(tiles[h][w] != null){
tiles[h][w].draw(g);
}
}
}
if(character != null){
character.draw(g);
character.getFeetHitbox().draw(g);
}
for(Bullet b: bullets){
b.draw(g... | 5 |
public static List <String> savedFiles(String prefix) {
final List <String> allSaved = new List <String> () ;
final File savesDir = new File("saves/") ;
for (File saved : savesDir.listFiles()) {
final String name = saved.getName() ;
if (! name.endsWith(".rep")) continue ;
if (prefix =... | 5 |
private void connect() {
if(server!=null) {
stop();
return;
}
String ip=ipField.getText();
String port=portField.getText();
if(ip==null || ip.equals("")) {
JOptionPane.showMessageDialog(SocketTestServer.this,
"No IP Address.... | 9 |
public int[] _getChildInformation(int key) throws RegistryErrorException
{
try
{
return (int[])queryInfoKey.invoke(null, new Object[] {new Integer(key)});
}
catch (InvocationTargetException ex)
{
throw new RegistryErrorException(ex.getMessage());
}
catch (IllegalArgumentExcepti... | 3 |
protected Icon getIcon() {
java.net.URL url = getClass().getResource("/ICON/expand_group.gif");
return new ImageIcon(url);
} | 0 |
public void updateEvt(){
xfond-=1;
if(keysPressed[KeyEvent.VK_UP])
p.setDeplacement(Player.SAUT);
p.update();
for(int i=0;i<plateformes.size();i++){
if(p.boundingBox.intersects(plateformes.get(i))){
switch(plateformes.get(i).PositionRelative(p)){... | 9 |
static private int jjMoveStringLiteralDfa7_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(5, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(6, active0);
return 7;
}
switch(curChar)
{
cas... | 4 |
public void testPresent1() {
try {
TreeNode result = contains(new TreeNode("node"), mkChain(new String[]{ "node" }));
assertTrue(null, "Failed to locate the only node of a leaf!",
result != null
&& result.getData() != null
&& result.getDat... | 7 |
public void schreibeLevelRaeume(List<Raum> raumListe)
{
readRaeume();
//ID Liste der vorhandenen Räume
List<Integer> idSammlung = new ArrayList<Integer>();
for(Raum raum : _sammlParser.getSammlung())
{
idSammlung.add(raum.getId());
}
// komplett neue Räume hinzufügen
for(Raum raum : raumListe)
{... | 6 |
private static TreePath findPath(JTree tree, TreePath root, String[] nodes, int depth) {
GenomeTreeNode node = (GenomeTreeNode)root.getLastPathComponent();
GenomeTreeNode child = null;
TreePath parent = root;
TreePath node_path = null;
String cur_node_name = nodes[depth].trim().replaceAll... | 9 |
public List<Contato> buscaDocumentos(String condicao) {
List<Contato> listaContatos = new ArrayList<Contato>();
JSONObject json, documento, dadosContato;
JSONArray arrayDocumentos;
String url = getHost() + ":" + getPorta() + "/" + getNomebanco() + "/"
+ getLocalBusca();
/*
* Verifica a url usada para ... | 9 |
public void testGetPartialConverter() {
PartialConverter c = ConverterManager.getInstance().getPartialConverter(new Long(0L));
assertEquals(Long.class, c.getSupportedType());
c = ConverterManager.getInstance().getPartialConverter(new TimeOfDay());
assertEquals(ReadablePartial.cl... | 1 |
public static void main(String[] args) {
try {
final Class<?> clazz = Class.forName("com.effectivejava.rtti.PrivateClass");
showPrivateFields(clazz);
callPrivateMethods(clazz);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (Secu... | 8 |
public void gamble()
{
} | 0 |
@Override
public String toString() {
String result = getName() + ", average=" + getAverage()
+ ", " + getProgram() + ", Undergrad, ";
if (this.universityOne != null)
result += this.universityOne + "-" + (this.universityOneAccept ? "admitted" : "rejected") ;
if (this.universityTwo != null)
result... | 6 |
protected void addHandled(Handled h)
{
// Handled must be of the supported class
if (!getSupportedClass().isInstance(h))
return;
if (h != null && !this.handleds.contains(h))
{
this.handleds.add(h);
// Also starts the handler if it wasn't already
if (!this.started)
this.started = true;
... | 4 |
public void kanondoda()
{
for(int i = 0;i < feedback.size();i++)
{
for(int j = 0;j < kp.size();j++)
{
for(int k = 0;k < robotar.size();k++)
{
if(kp.get(j).touches(robotar.get(k)) && kp.get(j).getID() != robotar.get(k).getID(... | 5 |
public ResultSet preencherTabelaATividadeGESTAO(String codDepartamento) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
ResultSet resultado = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStat... | 6 |
public Transferable createTransferable(JComponent comp) {
TreePath[] paths = cardTree.getSelectionPaths();
if (paths != null) {
ArrayList<DefaultMutableTreeNode> copies = new ArrayList<DefaultMutableTreeNode>();
DefaultMutableTreeNode node = (DefaultMutableTreeNode) paths[0].getLastPathComponent();
Default... | 4 |
@Test
public void testLoadPeople() {
//set up test variables
HumanPlayer human = game.getHuman();
boolean equal = false;
java.awt.Point testLocation;
java.awt.Color testColor;
ArrayList<ComputerPlayer> computers = game.getComputer();
ComputerPlayer testComp;
//test human player
//set to human name... | 6 |
private String urlEncode(Map<String, String> map) {
StringBuilder sb = new StringBuilder();
for (String key : map.keySet()) {
if (sb.length() > 0) {
sb.append("&");
}
sb.append(key);
String value = map.get(key);
if (value != nul... | 4 |
public static void filledEllipse(double x, double y, double semiMajorAxis, double semiMinorAxis) {
if (semiMajorAxis < 0) throw new RuntimeException("ellipse semimajor axis can't be negative");
if (semiMinorAxis < 0) throw new RuntimeException("ellipse semiminor axis can't be negative");
double ... | 4 |
public static void delete(JoeTree tree, OutlineLayoutManager layout, boolean deleteMode) {
Node youngestNode = tree.getYoungestInSelection();
if (youngestNode == null) {
return;
}
Node parent = youngestNode.getParent();
CompoundUndoableReplace undoable = new CompoundUndoableReplace(parent, deleteMode... | 7 |
protected synchronized void showCatPage(int page) {
int pageStart = page * tabPageSize;
if (pageStart > tabButtons.size()) {
throw new IllegalArgumentException("Illegal tab page number: " + page);
}
int p = 0;
for (GenericButton b : tabButtons) {
if (p >= pageStart && p < pageStart + tabPageSize) {
... | 8 |
static private int jjMoveStringLiteralDfa15_0(long old0, long active0)
{
if (((active0 &= old0)) == 0L)
return jjStartNfa_0(13, old0);
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(14, active0);
return 15;
}
switch(curChar)
{
... | 3 |
public boolean isValid(String s) {
Stack<Character> stack = new Stack<Character>();
HashMap<Character, Character> hm = new HashMap<Character, Character>();
hm.put('(', ')');
hm.put('[', ']');
hm.put('{', '}');
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (... | 7 |
public void loseHealth(double damage){
headArmorSlot.reduceDamage(damage);
bodyArmorSlot.reduceDamage(damage);
hero.applyDamage(damage);
} | 0 |
public Vector searchWidth(int id){
int visitados[][] = new int [thisVert.size()][2];
Vector<Integer> fila = new Vector<Integer>();
Vector<Integer> adjacents = new Vector<Integer> ();
Vector<Integer> ordem = new Vector<Integer> ();
int v;
int aux = -1;
for (int i=0;i<thisVert.size();i++)
{
if(thisVert... | 7 |
public static long[] radixSort2(long[] a) {
int w = 64;
int d = 1;
long[] b = null;
for (int p = 0; p < w/d; p++) {
long c[] = new long[1<<d];
// the next three for loops implement counting-sort
b = new long[a.length];
for (int i = 0; i < a.len... | 4 |
protected void readSampleData()
{
boolean read_ready = false;
boolean write_ready = false;
int mode = header.mode();
int i;
do
{
for (i = 0; i < num_subbands; ++i)
read_ready = subbands[i].read_sampledata(stream);
do
{
for (i = 0; i < num_subbands; ++i)
write_ready... | 6 |
public static CellHandle[] getCellHandlesFromSheet( String strRange, WorkSheetHandle sheet )
{
CellHandle[] retCells;
StringTokenizer cellTokenizer = new StringTokenizer( strRange, "," );
ArrayList cells = new ArrayList();
do
{
String element = (String) cellTokenizer.nextElement();
if( element.contains... | 4 |
public ArrayList<ArrayList<Course>> removeConflicts(ArrayList<ArrayList<Course>> list)
{
boolean[] switches = new boolean[list.size()];
int boolCounter = 0;
boolean done = false;
for(ArrayList<Course> temp: list)
{
for(int k = 0; k < temp.size() && done == fa... | 9 |
@Override
public String getOutput(int id) {
switch (direction) {
case "n":
return "solid\n"
+ " {\n"
+ " \"id\" \" " + id++ + "\"\n"
+ " side\n"
+ " {\n"
+ "... | 4 |
public void writePlayers(String key, Iterable<? extends Player> players) throws KeyNotUpdatedException, KeyNotFoundException {
List<? extends Player> sortedPlayers = Lists.newArrayList(players);
Collections.sort(sortedPlayers, this.ordering);
target.writePlayers(key,sortedPlayers);
} | 2 |
public static final synchronized BundleInfo getDefault() {
if (DEFAULT == null) {
DEFAULT = new BundleInfo(BundleInfo.class);
}
return DEFAULT;
} | 1 |
public static void agentmain(String agentArgs, Instrumentation inst) throws ClassNotFoundException,
UnmodifiableClassException, InterruptedException {
Class<?>[] allLoadedClasses = inst.getAllLoadedClasses();
inst.addTransformer(new HiroTransformer(), true);
for (Class<?> clazz : allLoadedClasses) {
try {
... | 6 |
public void buildMainPanel(List<MyFile> filesList) {
if (filesList.isEmpty()) {
buildInfoPanel("Le répertoire est vide");
} else {
if (infoLabel != null) {
infoLabel.setVisible(false);
}
tableau = new JTable(new MyJTableModel(filesList));
mainPanel.add(tableau.getTableHeader(), BorderLayout.N... | 2 |
@Override
public void saveArrayToFile(String path, List<Integer> list) {
// checking input parameter for null
if (path == null || list == null) {
throw new IllegalArgumentException("ERROR: url is not specified!");
}
try {
File file = new File(path);
... | 5 |
public String toString() {
switch(this) {
case HUMAN: return "Human";
case ELF: return "Elf";
case DWARROW: return "Dwarrow";
case GOBLIN: return "Goblin";
case ANCIENT: return "Ancient";
case CULTIST: return "Cultist";
case CRONK: return "Cronk";
case SORCEROR: return "Sorcero... | 9 |
public void obfuscateProject() {
String obfuscatedContent;
int totalSizeTransfert = 0;
int numberOfFiles = 0;
int fileSizeTransfert;
createDestinationDirectories();
for (FileObfuscationStructure structure : projectFileObfuscationStructureList) {
File obfuscatedFile = new File(destinationDir + "\\... | 5 |
private Element verifyLicense(HttpServletRequest request, Element elResult) {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Element elResponse = new Element ("response");
long now = (new Date()).getTime();
String method = request.getMethod();
logger.info("connection method is " + me... | 8 |
@Override
public void draw(Graphics page)
{
BulletImage.drawImage(page, xLocation, yLocation);//Draws the plane on the component
//Draws the collision Border
if(this.getBorderVisibility())
{
drawCollisionBorder(page,xLocation,yLocation,BulletImage.getWidth(),BulletImage.getHeight());
}
} | 1 |
@Override
public SeekStatus seekCeil(BytesRef text)
throws IOException {
if (ord < numTerms && ord >= 0) {
final int cmp = term().compareTo(text);
if (cmp == 0) {
return SeekStatus.FOUND;
} else if (cmp > 0) {
reset();
}
}
// linear scan
... | 8 |
@Override
public int read() throws IOException {
// We still have data left from before
if(currentIndex < inflatedBytes) {
// convert signed byte to unsigned int
int val = o[currentIndex] < 0 ? o[currentIndex] + 256 : o[currentIndex];
currentIndex++;
... | 7 |
@Override
public void handle(HttpExchange exchange) throws IOException {
System.out.println("In build city handler");
String responseMessage = "";
if(exchange.getRequestMethod().toLowerCase().equals("post")) {
try {
//TODO verify cookie method
String unvalidatedCookie = exchange.getRequestHeade... | 4 |
public void setjButtonQuitter(JButton jButtonQuitter) {
this.jButtonQuitter = jButtonQuitter;
} | 0 |
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
getStageManager().setStatge(StageManager.STAGE_MENUE, null);
}
} | 1 |
public void draw() {
for(int x = 0; x<downfall.size(); x++) {
downfall.get(x).draw();
}
} | 1 |
public static ArrayList<Media> checkMediaReservation(ArrayList<MediaCopy> mediaList) {
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayLi... | 6 |
public static ArrayList<User> getUsers() {
ArrayList<User> users = new ArrayList<User>();
File f = new File("users.txt");
try {
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String s = "";
while ((s = br.readLine()) != null) {
if (s.trim().length() > 5) {
... | 3 |
private void save() {
String path="";
try {
path = SBStringUtils.getAppPath("data");
File file = new File(path, fileName);
CSVWriter writer = new CSVWriter(new FileWriter(file));
for (int i=0;i<defaults.size();i++){
ArrayList<String> d = defaults.get(i);
for (int j=0;j<d.size();j++)
wri... | 3 |
public void printLevelOrder(Node x) {
if (x != null) {
LinkedList list = new LinkedList(x);
Node nykyinen = list.getHeadNode();
while (list.getSize() != 0) {
System.out.println(list.getHeadKey());
// Jos jonon päällä on vasen lapsi, laitetaan s... | 4 |
public void acceptTrainingSet(final TrainingSetEvent e) {
if (e.isStructureOnly()) {
// no need to build a classifier, instead just generate a dummy
// BatchClassifierEvent in order to pass on instance structure to
// any listeners - eg. PredictionAppender can use it to determine
// the... | 9 |
public String purchaseOrderAdd(double total, int vendorno, ArrayList<PurchaseOrderLineItemDTO> items, DataSource ds) {
PreparedStatement pstmt;
Connection con = null;
String msg = "";
Date date = new Date();
java.sql.Date sDate = new java.sql.Date(date.getTime());
int poN... | 7 |
public void clean(){
List<String> unuseds = new ArrayList<String>();
for(String path : expanded.keySet()){
if(! new File(ProjectMgr.getAssetsPath(), path).exists()){
unuseds.add(path);
}
}
for(String unused : unuseds){
... | 3 |
public void render(Graphics g) {
g.setFont(new Font("Tahoma", Font.BOLD, 8));
level.render(g);
for (Entity e : entities) {
e.render(g);
}
player.render(g);
inv.render(g);
if (paused) {
g.setColor(new Color(0, 0, 0, 155));
g.fillRect(0, 0, Main.getDrawableWidth(), Main.getDrawableHeight());
... | 2 |
@Override
public void setValueAt(Object uusi, int rivi, int sarake) {
if (sarake >= 0 && sarake < sarakeNimet.length)
{
elokuvalista.paivita(uusi, rivi, sarake);
// ilmoittaa datan muutoksesta JTable-komponentille
fireTableCellUpdated(rivi, sarake);
... | 2 |
public void actionPerformed(ActionEvent arg0) {
//find our super parent frame -- needed for dialogs
Component c = this;
while (null != c.getParent())
c = c.getParent();
if(arg0.getActionCommand().equalsIgnoreCase("SAVE")){
chooser.setCurrentDirectory(new File("boards"));
int returnVal = chooser.sh... | 9 |
@Basic
@Column(name = "CTR_MOA_TIPO")
public String getCtrMoaTipo() {
return ctrMoaTipo;
} | 0 |
@Test
public void test_static_replacer() throws Exception {
stop_tunnel_in(1000);
final String lipsum = StringUtils.lipsum(20);
final long start = System.currentTimeMillis();
new StringTrafficker(getInt("static_replacer_local_port"),
getInt("static... | 0 |
@Test
public void testGroupWithEmptyDataCanBeCreated() throws Exception {
GroupObject emptyDataGroup = new GroupObject("", "", "");
createGroup(emptyDataGroup);
} | 0 |
public synchronized void gridletResume(int gridletId, int userId, boolean ack)
{
boolean status = false;
// finds the Gridlet in the execution list first
int found = gridletPausedList_.indexOf(gridletId, userId);
if (found >= 0)
{
// removes the Gridlet
... | 4 |
private void getEvidenceList(String actionType) {
titleDLM.removeAllElements();
evidenceResultList = evidence.getEvideceList(fileName, actionType, teamType);
if (evidenceResultList.size() != 0) {
for (int i = 0; i < evidenceResultList.size(); i++) {
titleDLM.addElement(evidenceResultList.get(i).getTitle())... | 7 |
protected void handleMouseClick(MouseEvent paramMouseEvent)
{
if (this.clear)
{
Position localPosition = getPosition();
getEnvironment().removeObject(this);
if (this.state != null)
{
Robot localRobot = new Robot(GameApplet.thisApplet);
try
{
localRobo... | 8 |
private void updateViews() {
// make sure our view of the model is up-to-date:
for(Actor actor : model.actors) {
if (!actorToView.containsKey(actor)) {
actorToView.put(actor, new ActorView(actor));
}
}
for(Node node : model.nodes) {
if (!nodeToView.containsKey(node)) {
// TODO: come up with a h... | 6 |
public static String convertToRepresentationString(BigInteger irepresentation,char[] alfabet){
String out = null;
StringBuilder sb = new StringBuilder();
BigInteger leftNumber = irepresentation;
BigInteger base = BigInteger.valueOf(alfabet.length);
whil... | 1 |
public void laskeVaikeustasoa(){
if (this.alkutaso <= 1){
return;
}
this.alkutaso--;
laskeTaso();
paivitaPisteetJaTaso();
} | 1 |
@Test
public void testPartyStats() {
TreeMap<String, PartyStat> partyStats = new TreeMap<>();
// setup parties
determineParties(partyStats);
// loop on all bills, including resolutions
for ( String id: Bills.keySet() ) {
Bill bill = Bills.get(id);
if ( determinePassed(bill) ) {
String legislatorId ... | 7 |
@Override
public void createSomeObjects() {
this.addUser(new User("worker", "password", GroupType.WORKER));
this.addUser(new User("Gumby", "MyBrainHurts", GroupType.WORKER));
this.addUser(new User("manager", "password", GroupType.MANAGER));
ProductType pt = new ProductType("Skumbananer"), pt2 = new ProductType... | 7 |
public NewAttributeDialog() {
super(Outliner.outliner, NEW_ATTRIBUTE, true);
OK = GUITreeLoader.reg.getText("ok");
CANCEL = GUITreeLoader.reg.getText("cancel");
NEW_ATTRIBUTE = GUITreeLoader.reg.getText("new_attribute");
ATTRIBUTE = GUITreeLoader.reg.getText("attribute");
VALUE = GUITreeLoader.reg.getTex... | 0 |
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
while (true) {
String num = input.next();
if (num.equals("0")) return;
int answer = 0;
int pow = 2;
for (int i = num.length() - 1; i >= 0; --i) {
answer += (num.charAt(i) - '0') * (pow - 1);
pow *= 2;
}
... | 3 |
private static final byte[] encodeString(ByteBuffer string)
{
int length = string.array().length;
int num_digits = 1;
while((length /= 10) > 0)
{
num_digits++;
}
byte[] bencoded_string = new byte[length+num_digits+1];
bencoded_string[num_digits] = ... | 2 |
public void write(String summaryOutputFile, String detailsOutputDirectory,
List<CalendarObject> myCalendarObjects) throws IOException {
mainHTML = new Html();
summaryPageHeader = new Head();
summaryPageBody = new Body();
dayToEventMap = new HashMap<String, ArrayList<Div>>();... | 3 |
public void reset() {
for (JTextArea valueArea : wrappedLabelMap.values())
valueArea.setText("");
for (JLabel valueLbl : labelMap.values())
valueLbl.setText("");
for (JTextField valueField : stringMap.values())
valueField.setText("");
for (JTextField valueField : intMap.values())
valueField.setTe... | 8 |
@Override
public boolean run() {
// Load config
if (config == null) loadConfig();
// Load Db
loadDb();
// Build db
if (verbose) Timer.showStdErr("Building interval forest...");
snpEffectPredictor = config.getSnpEffectPredictor();
snpEffectPredictor.buildForest();
if (verbose) Timer.showStdErr("done... | 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://download.oracle.com/ja... | 6 |
public final void setShip(Ship ship) {
this.ship = ship;
if(ship != null)
{
setFieldState(eFieldState.Filled);
ship.setFieldReference(this);
}
else
setFieldState(eFieldState.Empty);
} | 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 fe... | 6 |
private void quickSort0(int[] a, int low, int high) { //the valid elements of the list are [low, high]
if (high - low <= 1)
return;
if (high - low == 2) { //efficient!
if (a[low] > a[low + 1])
swap(low, low + 1);
return;
}
// if (high... | 9 |
public void receive(IPInterfaceAdapter iface, Datagram msg)
throws Exception {
// Raw listeners are called for any (IP) protocol, even if
// the datagram's destination is not this node
for (IPInterfaceListener l: rawListeners)
l.receive(iface, msg);
// Datagrams addressed to this node
if (hasAddress(ms... | 6 |
@Override
public int getPages(int intRegsPerPag, ArrayList<FilterBean> hmFilter, HashMap<String, String> hmOrder) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getPages("usuario", intRegsPerPag, hmFilter, hmOrder);
oMysql.de... | 1 |
private void load() {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
pixels[x + y * width] = spritesheet.getPixel((this.x + x) + (this.y + y) * spritesheet.getSize());
}
}
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
DimensionLevelPair other = (DimensionLevelPair) obj;
if (dimensionOrderNo != other.di... | 4 |
public void insert( double addVal )
{
if ( leftHeap.size() == 0 || addVal < leftHeap.peekMax() )
leftHeap.add( addVal );
else
rightHeap.add( addVal );
//balance heaps if sizes differ by >1 element
if ( leftHeap.size()-rightHeap.size() > 1 )
rightHe... | 4 |
private void splitAndFill(String[] trackPropertiesValues) {
int valuesRead = 0;
for (String propertyValue : trackPropertiesValues) {
String[] trackValue = propertyValue.split("=");
switch (trackValue[0].trim()) {
case ("RaceLaps"):
this.laps... | 6 |
public static void main(String[] args) throws IOException {
Scanner in = new Scanner(new File("wormhole.in"));
PrintWriter out = new PrintWriter(new FileWriter("wormhole.out"));
N = in.nextInt();
wormholes = new point[N + 1];
next_on_right = new int[N + 1];
wormholes[0] ... | 7 |
public static List<String> unpackTIPP(String tippFile, String outputFolder) throws IOException {
List<String> fileList = new ArrayList<String>();
byte[] buffer = new byte[1024];
try {
//create output directory is not exists
File folder = new File(OUTPUT_FOLDER);
... | 6 |
private static final BigInteger RSADP(final RSAPrivateKey K, BigInteger c) {
// 1. If the representative c is not between 0 and n - 1, output
// "representative out of range" and stop.
final BigInteger n = K.getModulus();
if (c.compareTo(ZERO) < 0 || c.compareTo(n.subtract(ONE)) > 0) {
... | 5 |
public boolean addBuddy(String user, String buddy, int sentBy) {
boolean retVal = db.addBuddies(user, buddy);
if((sentBy == ServerInterface.CLIENT) && (backupServer != null) && (retVal == true)) {
try {
backupServer.ping();
backupServer.addBuddy(user, buddy, ServerInterface.SERVER);
} catch(Excepti... | 4 |
@SuppressWarnings("deprecation")
@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(sender instanceof ConsoleCommandSender) {
sender.sendMessage("§cThis command can only be run in game!");
return true;
}
if(args.length==1)
return false;
else... | 6 |
protected static boolean isUSASummer(int date) throws Exception {
int[] USADSTSequence = {20070101, 20070311, 20071104, 20080309, 20081102, 20090308, 20091101, 20100314, 20101107, 20110313, 20111106, 20120311, 20121104, 20130310, 20131103, 20140309, 20141102, 20150308, 20151101, 20160313, 20161106, 20170312, 20171105... | 4 |
public boolean getPasteEnabled() {
return this instanceof ClipboardInterface && pasteEnabled;
} | 1 |
public boolean equals(final Object ref)
{
if(ref instanceof GRect)
{
final GRect r = (GRect)ref;
final boolean isempty1 = isEmpty();
final boolean isempty2 = r.isEmpty();
return ((isempty1 || isempty2) && isempty1 && isempty2)
|| ((xmin == r.xmin) && (xmax == r.xmax) &&... | 8 |
public static PeerSession newSession (PeerConnection conn, ExecutorService eventExec, ExecutorService connExec) {
boolean shutdownEvent = false;
ExecutorService ee = eventExec;
ExecutorService ce = connExec;
if (ee == null) {
ee = Executors.newSingleThreadExecutor();
... | 2 |
@Override
public void mouseReleased(MouseEvent event) {
mouseDragged(event);
mShowBorder = mPressed;
mInMouseDown = false;
MouseCapture.stop(this);
if (mPressed) {
mPressed = false;
click();
}
repaint();
} | 1 |
@SuppressWarnings("unchecked")
public void load() {
//Load markets, revenue and deliveries
//If they cannot be loaded set them to null and they can be constructed by onEnable
//Load markets
try {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(Conf.dataFolder + "markets.bin"));
Objec... | 6 |
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.