text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void processLine(String line, int lineNumber) {
if (line.startsWith("//") || line.trim().length() == 0) return;
DeconstructedStringScroller sd = new DeconstructedStringScroller(line, " ");
if (type == null) {
if (sd.next().toLowerCase().equals("class")) try {
String className = sd.next();
type ... | 9 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Truck)) {
return false;
}
Truck other = (Truck) object;
if ((this.id == null && other.id != null) || (this.id !... | 5 |
public void setId(Integer id) {
this.id = id;
} | 0 |
public void stealDeadEquipment(Player pgive, Player pget){
String head = pgive.playerTag + "'s inventory";
String textBlock = "Enter a number to take an item from " + pgive.playerTag + " : ";
ArrayList<String> strList = new ArrayList<String>();
ArrayList<Card> eqInv = new ArrayList<Card>();
for(Card card: pgi... | 9 |
private Boolean checkOfFieldsOk() {
if ("".equals(txtDatabaseSettingName.getText())) {
txtDatabaseSettingName.setForeground(Color.red);
return false;
} else {
txtDatabaseSettingName.setBackground(Color.white);
}
if ("".equals(txtDatabaseAddres... | 5 |
private int parseLine(String line)
{
//preprocessing: remove extra whitespace, comments, lowercase
int commentPos = line.indexOf('#');
if (commentPos >= 0)
line = line.substring(0, commentPos);
line = line.trim().toUpperCase();
int i = 0; // Current position in t... | 5 |
public void bulkPut1( ByteChunk[] keys, ByteChunk[] values, int offset, int count ) {
long[] indexPos = new long[count];
for( int i=0; i<count; ++i ) {
indexPos[i] = indexPos(keys[i]);
}
FileLock fl = null;
synchronized( this ) {
try {
try {
if( fileChannel != null ) fl = fileChannel.lock(0... | 5 |
private void optimiseSelectorsAndHuffmanTables (final boolean storeSelectors) {
final char[] mtfBlock = this.mtfBlock;
final byte[] selectors = this.selectors;
final int[][] huffmanCodeLengths = this.huffmanCodeLengths;
final int mtfLength = this.mtfLength;
final int mtfAlphabetSize = this.mtfAlphabetSize;
... | 8 |
public boolean isNeighbour(GraphPoint p1, GraphPoint p2)
{
if (p1 == p2)
return false;
for (Point point : points)
{
if (point != p1 && point != p2 &&
p1.euclideanDistance2(p2) >
Math.max(p1.euclideanDistance2(point), p2.euclideanDistance2(point)))
{
return false;
}
}
return true;... | 5 |
public static void act(Unit facility) {
if (facility == null) {
return;
}
int[] buildingQueueDetails = Constructing.shouldBuildAnyBuilding();
int freeMinerals = xvr.getMinerals();
int freeGas = xvr.getGas();
if (buildingQueueDetails != null) {
freeMinerals -= buildingQueueDetails[0];
freeGas -= bu... | 6 |
public void setPassengers(List<Participant> passengers) {
this.passengers = passengers;
} | 0 |
@Override
public void collision(Engine engine, Entity v,boolean b) {
if(type==6)
{
boolean entitythere = false;
for(Entity q:engine.getWorld().getEntityList()){
if(entitythere)
continue;
if(q != null && (q.doesDamage()&&q.canDie()))
entitythere = true;
}
... | 7 |
public double readDouble(String pSection, String pKey, double pDefault)
{
//if the ini file was never loaded from memory, return the default
if (buffer == null) {return pDefault;}
Parameters params = new Parameters();
//get the value associated with pSection and PKey
String valueText = getValue(p... | 3 |
public void ancestorResized(HierarchyEvent e) {
if (GamePanel.getThis() != null) {
GamePanel.getThis().resizePanel();
}
} | 1 |
public void insert(E e)
{
int newPlace = heapSize;
while (newPlace > 0 &&
comparator.compare(e, array[getParent(newPlace)]) < 0)
{
array[newPlace] = array[getParent(newPlace)];
if (indexes != null)
indexes.put((E)array[newPlace], newPla... | 5 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int N = sc.nextInt();
if (N == 0) {
break;
}
Queue<Integer> q = new ArrayDeque<Integer>();
for (int i = 1; i <= N; i++) {
... | 8 |
public void write(int bits, int width) throws IOException {
if (bits == 0 && width == 0) {
return;
}
if (width <= 0 || width > 32) {
throw new IOException("Bad write width.");
}
while (width > 0) {
int actual = width;
if (actual > t... | 7 |
public String getCellSymbol() {
if (rock) {
return "#";
} else if (ant != null) {
return "a";
} else if (food != 0) {
return food + "";
} else {
switch (anthill) {
case "red":
return "+";
... | 5 |
public static byte[] readBytesFromFile(File file) throws IOException {
byte[] bytes;
try (InputStream is = new FileInputStream(file)) {
long length = file.length();
if (length > Integer.MAX_VALUE) {
throw new IOException("Could not completely read file " ... | 4 |
@Override
public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
String data;
try {
ArrayList<FilterBean> alFilter = new ArrayList<>();
if (request.getParameter("filter") != null) {
if (request.getParameter("filterop... | 7 |
public static final boolean AABB_point(Box b, Point p) {
return p.x >= b.x
&& p.x <= b.getMaxX()
&& p.y >= b.y
&& p.y <= b.getMaxY();
} | 3 |
private boolean isValidBlock(int[][] game, int x, int y, int testNumber) {
//declare variables referencing 3x3 block location in 9x9 grid
int blockX, blockY;
//determine row of 3x3 block being tested
if (x < 3)
blockX = 0; //rows 0, 1, 2
else if (x < 6)
... | 7 |
public void goToImage(int index){
if(index < 0 || index >= history.size()) return;
historyIndex = index;
imagePanel.updatePanel(history.get(historyIndex));
imagePanel.update(imagePanel.getGraphics());
} | 2 |
static private void load() {
Timestamp startDay = Timestamp.valueOf("2011-01-01 00:00:00.0");
Timestamp nextDay = new Timestamp(startDay.getTime() + oneDayLong);
//final Timestamp endDay = Timestamp.valueOf("2011-09-01 00:00:00.0"); // !!!!!!! the first 8 months
final Timestamp endDay = Timestamp.valueOf("20... | 9 |
private void dragDivider(MouseEvent event) {
if (mDividerDragLayout != null) {
if (!mDividerDragIsValid) {
mDividerDragIsValid = Math.abs(mDividerDragStartX - event.getX()) > DRAG_THRESHOLD || Math.abs(mDividerDragStartY - event.getY()) > DRAG_THRESHOLD || event.getWhen() - mDividerDragStartedAt > DRAG_DELAY;
... | 7 |
public static boolean computeCell(boolean[][] world, int col, int row)
{
// liveCell is true if the cell at position (col,row) in world is live
boolean liveCell = getCell(world, col, row);
// neighbours is the number of live neighbours to cell (col,row)
int neighbours = countNeighbours(world, col... | 8 |
@Override
public void run() {
if (state == GameState.Running) {
while (true) {
bg1.update();
bg2.update();
robot.update();
hb.update();
hb2.update();
if (robot.isJumped()) {
currentSprite = characterJumped;
}
else if (robot.isJumped() == false && robot.isDucked() == false) {... | 9 |
public static List<AstronomicalObject> sortByMass(List stm, int factor) {
List<AstronomicalObject> sorted = stm;
if (stm.size() > 0) {
if (factor < 0) {
Collections.sort(sorted, (B, A) -> MASS_COMPARATOR.compare(A, B));
log.info("SortedByMass descending :{}")... | 3 |
private boolean await0(long timeoutMillis, boolean interruptable) throws InterruptedException {
long startTime = timeoutMillis <= 0 ? 0 : System.currentTimeMillis();
long waitTime = timeoutMillis;
synchronized (lock) {
if (ready) {
return ready;
} else if... | 8 |
public void removeEffects(Character character) {
if (!character.getBuffs().isEmpty()) {
for (SkillEffect effect : character.getBuffs()) {
effect.endEffect();
}
character.getBuffs().clear();
}
if (!character.getDebuffs().isEmpty()) {... | 6 |
public byte[] pack() throws IOException {
byte[] footer = new byte[activeEntries * 10 + cSize + 2];
footer[0] = (byte) (activeEntries >> 8);
footer[1] = (byte) activeEntries;
int informationOffset = 2;
for(int i = 0; i < amountEntries; i++) {
if(archivePayloa... | 5 |
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
do {
line = in.readLine();
if (line == null || line.length() == 0)
break;
int[] nn = retInts(line);
Seg... | 9 |
public int getTeamSearchResult(String search){
PreparedStatement st = null;
ResultSet rs = null;
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT * FROM match_record_2013 where event_id = ? AND team_id = ?");
st.setInt(1, getSelectedEven... | 3 |
public static String removePrefix(String listenHostname, String hostname, boolean forward) {
if(hostname == null || listenHostname == null) {
return null;
}
listenHostname = listenHostname.trim();
hostname = hostname.trim();
if(hostname.startsWith(listenHostname)) {
hostname = hostname.substring(... | 5 |
@Override
public IRemoteCallObjectData getDataObject() {
return data;
} | 0 |
@GET
@Path("/v2.0/ports/{portId}")
@Produces({MediaType.APPLICATION_JSON, OpenstackNetProxyConstants.TYPE_RDF})
public Response showPort(@PathParam("portId") String portId, @HeaderParam("Accept") String accept) throws MalformedURLException, IOException{
if (accept.equals(OpenstackNetProxyConstants.TYPE_RDF)){
S... | 1 |
private String getActiveModels() {
String s = "";
int modelNumber = 0;
int num = 0;
while (modelNumber < models.size()) {
if (models.get(modelNumber).getIsComplex()) {
ComplexModel c = (ComplexModel) models.get(modelNumber);
for (int i = 0; i <... | 6 |
public int getPixelSize(int boardWidth, int boardHeight) {
Dimension maxCanvas = getMaxCanvas();
int pixelWidth = maxCanvas.width / boardWidth;
int pixelHeight = maxCanvas.height / boardHeight;
int pixelSize;
if (pixelWidth <= pixelHeight) {
pixelSize = pixelWidth;
... | 1 |
public SingleTreeNode treePolicy(StateObservationMulti state) {
SingleTreeNode cur = this;
while (!state.isGameOver() && cur.m_depth < ROLLOUT_DEPTH)
{
if (cur.notFullyExpanded()) {
return cur.expand(state);
} else {
SingleTreeNode next ... | 3 |
public static boolean isHydrophicChar( char inChar )
{
if ( inChar == 'A' || inChar == 'V' || inChar == 'L'
|| inChar == 'I' || inChar =='F' || inChar =='W'
|| inChar == 'M' || inChar == 'P')
return true;
return false;
} | 8 |
public static int getIntLE(final byte[] array, final int index, final int size) {
switch (size) {
case 0:
return 0;
case 1:
return Bytes.getInt1(array, index);
case 2:
return Bytes.getInt2LE(array, index);
case 3:
return Bytes.getInt3LE(array, index);
case 4:
return Bytes.getInt4LE(... | 5 |
public static List<String> cloneList(List<String> list) {
List<String> clone = new ArrayList<String>(list.size());
for(String item: list) clone.add(item);
return clone;
} | 1 |
public List<Tuple<Integer,Integer>> aStar ( Tuple<Integer,Integer> start, Tuple<Integer,Integer> goal) {
// Set closedSet = empty set
HashSet<Tuple<Integer,Integer>> closedSet = new HashSet<Tuple<Integer,Integer>>();
// The set of tentative nodes to be evaluated
HashSet<Tuple<Integer,Integer>> openSet = new Ha... | 8 |
public Production[] getProductionsToAddForProduction(Production production,
Set lambdaSet) {
// Stupid...
/*
* ProductionChecker pc = new ProductionChecker(); String[] variables =
* production.getVariablesOnRHS(); ArrayList list = new ArrayList();
* for(int k = 0; k < variables.length; k++) {
* if(is... | 6 |
public long evaluate_long(Object[] dl) throws Throwable {
if (Debug.enabled)
Debug.println("Wrong evaluateXXXX() method called,"+
" check value of getType().");
return 0L;
}; | 1 |
public void updateTitle(Dockable dockable) {
int index = mDockables.indexOf(dockable);
if (index != -1) {
mHeader.updateTitle(index);
}
} | 1 |
public PRFAlgorithmIdentifierType getPRF() {
return prf;
} | 0 |
private void writeFin(String user, int glID, String resName,
double cost, double cpu, double clock,
boolean header)
{
if (trace_flag == false) {
return;
}
// Write into a results file
FileWriter fwriter = null;
... | 5 |
protected Class loadClass(final String className) throws ClassNotFoundException {
try {
return (Class)AccessController.doPrivileged(new PrivilegedExceptionAction(){
public Object run() throws Exception{
ClassLoader cl = Thread.currentThread().getContextClassLoader... | 1 |
* @param colony The <code>Colony</code> to pillage.
* @param random A pseudo-random number source.
* @param cs A <code>ChangeSet</code> to update.
*/
private void csPillageColony(Unit attacker, Colony colony,
Random random, ChangeSet cs) {
ServerPlayer attacke... | 6 |
private ActionListener createInviteROListener() {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
PeerStatus status = LocalInfo.getPeerStatus();
if (!(status == PeerStatus.STARTER || status == PeerStatus.INVITEE)) {
... | 4 |
public static void method335(int i, int j, int k, int l, int i1, int k1)
{
if(k1 < topX)
{
k -= topX - k1;
k1 = topX;
}
if(j < topY)
{
l -= topY - j;
j = topY;
}
if(k1 + k > bottomX)
k = bottomX - k1;
if(j + l > bottomY)
l = bottomY - j;
int l1 = 256 - i1;
int i2 = (i >> 16 & 0xff... | 6 |
public String getLabel() {
return this.label;
} | 0 |
@Override
public boolean equals(Object object) {
if (object instanceof SearchTerm) {
SearchTerm test = (SearchTerm) object;
return test.isCaseSensitive() == caseSensitive &&
test.isWholeWord() == wholeWord &&
test.getTerm().equals(term);
... | 3 |
public static void loadScriptsFile(String name)
{
try {
File f = new File(name);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(f);
d... | 6 |
public static String decimalToBinary(int decimal) {
String binary = "";
while (decimal != 0) {
if (decimal % 2 == 0)
binary = "0" + binary;
else
binary = "1" + binary;
decimal = decimal / 2;
}
for (int i = binary.length(); i < 16; i++) {
binary = "0" + binary;
}
return binary;
} | 3 |
public void close() throws IOException
{
target.close();
listener.done();
} | 0 |
public String getCode(final K symbol) {
return this.symbols.get(symbol);
} | 0 |
public static byte menu(){
byte op=-1;
System.out.println("1.- Feu un programa en Java que demani el nombre de dades amb les quals es vol treballar (n), que les carregui en un array unidimensional real x i que:a) un cop introduïdes les dades les visualitzi per pantalla.b) calculi la mitjana, el valor més gran i el ... | 2 |
private boolean backupStorage() {
new Thread() {
@Override
public void run() {
ProcessBuilder process = null;
Process pr = null;
BufferedReader reader = null;
List<String> args = null;
String line = null;
... | 9 |
public static void main(String[] args) {
MessageConfig messageConfig=MessageConfig.parse(
XmlTest.class.getClassLoader().getResourceAsStream("demo.xml"));
System.out.println(messageConfig.toString());
for(Client client : messageConfig.getClient()){
System.out.println(... | 2 |
public void alert(PrepareItemEnchantEvent e) {
if (Settings.logging) {
writeLog(e.getEnchanter().getDisplayName() + " tried to enchant a "
+ e.getItem().getType().toString().toLowerCase());
}
if (Settings.alertz) {
for (Player p : e.getEnchanter().getServer().getOnlinePlayers()) {
if (PermissionHan... | 4 |
Instantiation(final Instantiation prev, final BitSet sub) {
previous = prev;
subroutine = sub;
for (Instantiation p = prev; p != null; p = p.previous) {
if (p.subroutine == sub) {
throw new RuntimeException("Recursive invocation of " + sub);
... | 7 |
public ExtDecimal ln(int scale, RoundingMode rm) {
if (type == Type.NUMBER) {
if (compareTo(ZERO) < 0) {
throw new ArithmeticException("Logarithm of a negative number in a real context");
} else if (compareTo(ZERO) == 0) {
throw new ArithmeticException("Lo... | 8 |
private String generateFirstScan()
{
String tmp = new String();
for(int i = 0; i != lstInfoSchemaPair.size(); i++)
{
String name = lstInfoSchemaPair.get(i).getFirst();
String type = lstInfoSchemaPair.get(i).getSecond();
String typeGetMethod = type.substring(0, 1).toUpperCase() + type.substring(1);
tm... | 6 |
@Override
public final ArrayList<Short> get(final Integer... a) {
final ArrayList<Short> r = new ArrayList<Short>();
for (final Integer i : a) { r.add(filter[i]); }
return r;
} | 1 |
public ImageIconCellEditor(JCheckBox checkBox, ImageIcon onIcon, ImageIcon offIcon) {
super(checkBox);
button = new JButton(offIcon);
button.setOpaque(true);
button.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
fireEd... | 0 |
@EventHandler
public void onInteract(PlayerInteractEvent e) {
if(e.getPlayer().getItemInHand().getType() == Material.FEATHER) {
if(e.getAction() == Action.LEFT_CLICK_BLOCK) {
PlayerSelections.pos1.put(e.getPlayer().getName(), e.getClickedBlock().getLocation());
e.getPlayer().sendMessage("Position 1 set!")... | 3 |
public void setFunFormaPago(String funFormaPago) {
this.funFormaPago = funFormaPago;
} | 0 |
public MethodInfo getMethod(String name) {
ArrayList list = methods;
int n = list.size();
for (int i = 0; i < n; ++i) {
MethodInfo minfo = (MethodInfo)list.get(i);
if (minfo.getName().equals(name))
return minfo;
}
return null;
} | 2 |
public void update(double tDelta) {
if (!stopped) {
double xUnclamped = curPos.getX() + tDelta * vX;
double yUnclamped = curPos.getY() + tDelta * vY;
curPos.setLocation(
vX > 0 ?
Math.min(xUnclamped, finalPos.getX())
:
Math.max(xUnclamped, finalPos.getX()),
vY > 0 ?
Math.min(... | 4 |
@Override
protected void paintComponent(Graphics oldG) {
super.paintComponent(oldG);
if (fullBoard == null) {
return;
}
//Calculate necessary cell width and height to fill panel
cellWidth = getWidth() / (fullBoard.getColumns() - (zoomFactor * 2));
cellHeig... | 4 |
public static String getDataReport(Table<Integer, String, Double> input) {
// check preconditions
Preconditions.checkNotNull(input);
Preconditions.checkArgument(input.column("N1").size() > 0, "expect a column N1 with data");
// header of the table
final StringBuilder result = new StringBu... | 5 |
private void ATTACK(Vector3f direction, float distance)
{
double time = (double)Time.getTime()/(double)(Time.SECOND);
double timeDecimals = time - (double)((int)time);
if(timeDecimals < 0.25)
{
material.setTexture(textures.get(4));
}
else if(timeDecimals... | 7 |
public static void main(String[] args) {
Watch.start();
int[] q = new int[N + 1];
for (int i = 0; i <= N; i++)
q[i] = i;
boolean[] primes = new boolean[N + 1];
Arrays.fill(primes, true);
primes[0] = primes[1] = false;
for (int i = 2; i <= N; i++)
... | 9 |
public CheckStatus() {
byte[] byteArray = new byte[100];
int msgSize;
loadNativeLibrary();
// eZioLib.openport("6");
byte[] usbId = new byte[100];
eZioLib.FindFirstUSB(usbId);
eZioLib.OpenUSB(usbId);
eZioLib.sendcommand("^XSET,ACTIVERESPONSE,1");
... | 3 |
private void checkWinCondition()
{
boolean allCellsFlagged = true;
for (int x = 0; x<boardSize; x++) { //iterate through board
for (int y = 0; y<boardSize; y++) {
if (cells[x][y].getMined() && !cells[x][y].getFlagged()) { //if a cell with a mine hasn't been flagged, then the game can't have been won
a... | 5 |
public void openLink(final String url) {
if (!java.awt.Desktop.isDesktopSupported()) {
System.err.println("Desktop is not supported (Can't open link)");
return;
}
java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
if (!desktop.isSupported(java.awt.Desktop.Action.BROWSE)) {
Syst... | 3 |
public void buildClusterer(Instances instances) throws Exception {
// can clusterer handle the data?
getCapabilities().testWithFail(instances);
resultVector = new FastVector();
long time_1 = System.currentTimeMillis();
numberOfGeneratedClusters = 0;
replaceMissingValue... | 8 |
public synchronized void put(T el) {
while (elements.size() == capacity){
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
elements.add(el);
notify();
} | 2 |
public int getCloseRandomPlayer(int i) {
ArrayList<Integer> players = new ArrayList<Integer>();
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
if (goodDistance(Server.playerHandler.players[j].absX, Server.playerHandler.players[j].absY, npcs[i].a... | 9 |
public int synthesis(Packet op){
Info vi=vd.vi;
// first things first. Make sure decode is ready
opb.readinit(op.packet_base, op.packet, op.bytes);
// Check the packet type
if(opb.read(1)!=0){
// Oops. This is not an audio data packet
return (-1);
}
// read our mode and pre/... | 9 |
public static int populateObjects(byte[] data, int offset, List dsftBinSpriteSetList, int entryCount, Class dsftBinSpriteClass)
{
Number recordSizeNumber = null;
try
{
Method getStaticRecordSizeMethod = dsftBinSpriteClass.getMethod("getStaticRecordSize", null);
record... | 6 |
private void drawGridlines(Graphics2D g2)
{
Rectangle curClip = g2.getClip().getBounds();
int top = getInsets().top, left = getInsets().left;
int miny = Math.max(0, (curClip.y - top) / (cellSize + 1)) * (cellSize + 1) + top;
int minx = Math.max(0, (curClip.x - left) / (cellSize + 1)... | 6 |
public static void checkJMeterVersion() {
String[] currentVersion = StringUtils.split(Utils.getJmeterVersion(), ".");
String[] baseVersion = StringUtils.split("2.5", ".");
if (currentVersion[0].equals(baseVersion[0])) {
if (Integer.valueOf(currentVersion[1]) < Integer.valueOf(baseVe... | 3 |
public void ignoreRecord(GedcomRecord rootRecord, GedcomReader reader)
throws IOException, GedcomReaderException {
int rootLevel = rootRecord.getLevel();
for (GedcomRecord record = reader.nextRecord(); record != null; record = reader
.nextRecord()) {
int level = record.getLevel();
if (level <= rootLe... | 2 |
protected void func_72612_a(boolean par1)
{
int i = 0;
Iterator iterator = field_72616_e.iterator();
do
{
if (!iterator.hasNext())
{
break;
}
DatagramSocket datagramsocket = (DatagramSocket)iterator.next();
... | 8 |
public void update(Level level, int x, int y, int z, Random rand) {
if(!level.growTrees) {
int var6 = level.getTile(x, y - 1, z);
if(!level.isLit(x, y, z) || var6 != Block.DIRT.id && var6 != Block.GRASS.id) {
level.setTile(x, y, z, 0);
}
}
} | 4 |
public void remove()
{
q.clear();
} | 0 |
private boolean isModifierKey(int key) {
switch(key) {
case Keyboard.KEY_LSHIFT:
case Keyboard.KEY_RSHIFT:
case Keyboard.KEY_RIGHT:
case Keyboard.KEY_LEFT:
case Keyboard.KEY_DOWN:
case Keyboard.KEY_UP:
case Keyboard.KEY_LCONTROL:
case Keyboard.KEY_RCONTROL:
return true;
default:
return false;
... | 8 |
public ArrayList<Query> getQueries(String queryFileName) {
ArrayList<Query> queryList = new ArrayList<Query>();
Query query = new Query();
FileReader fileReader;
try {
fileReader = new FileReader(queryFileName);
BufferedReader reader = new BufferedReader(fileReader);
String line;
try {
while ((... | 9 |
public JSONWriter key(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
stack[top - 1].putOnce(string, Boolean.TRUE);
if (this.comma) {
this... | 4 |
public void setY2Coordinate(double y)
{
y2Coordinate=y;
} | 0 |
public JSONWriter key(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
if (this.comma) {
... | 4 |
private void initDataLayout(File file) throws IOException {
if (file.exists()) { // Load the data formats from the file
byte[] buffer = new byte[32];
mappedByteBuffer.get(buffer);
ByteBuffer bbuffer = ByteBuffer.wrap(buffer);
int index;
if ((inde... | 7 |
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 |
@Override
public void actionPerformed(ActionEvent event) {
Duplicatable duplicatable = getTarget(Duplicatable.class);
if (duplicatable != null) {
duplicatable.duplicateSelection();
}
} | 1 |
@Override
public void startElement( String uri, String localName, String name,
Attributes attributes ) throws SAXException {
XElement element = new XElement( name );
if( this.element == null ){
this.element = element;
}
else{
... | 2 |
public ConfigurationHolder getExactRegion(String world, String name) {
for (ConfigurationHolder holder : this) {
if (holder.getType() == ConfigurationType.REGION)
if (holder.getWorld().equalsIgnoreCase(world))
if (holder.getName().equalsIgnoreCase(name))
return holder;
}
return null;
} | 4 |
private static List<List<Livraison>> kmeans(List<Livraison> livraisons, int k)
{
List<List<Livraison>> clusters = new ArrayList<List<Livraison>>();
for(int i = 0 ; i < k ; i++)
{
clusters.add(new ArrayList<Livraison>());
}
List<Double> centroidX = new ArrayList<Double>();
List<Double> centroidY = new Ar... | 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.