text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String getB() {
return b;
} | 0 |
private void installTabContainer() {
if (JTattooUtilities.getJavaVersion() >= 1.6) {
for (int i = 0; i < tabPane.getTabCount(); i++) {
Component tabComponent = getTabComponentAt(i);
if (tabComponent != null) {
if (tabContainer == null) {
... | 6 |
@Test
public void testRemove() {
List<Integer> list1 = new ArrayList<Integer>(Arrays.asList(1, 2, 3, 4, 5));
List<String> list2 = new ArrayList<String>(Arrays.asList("1", "2", "3", "4", "5"));
for (int i=0; i<list1.size(); i++) {
System.out.println("size:" + list1.size() + " " + i + "->" + list1.get(i));
i... | 5 |
public static File chooseSaveFileCheckOverwrite(Component parent,
JFileChooser chooser, final String suffix,
Preferences prefs, String prefsKey)
{
String path = null;
String fname = null;
if (prefs != null) {
String sdir = prefs.get(prefsKey, null);
if (sdir != null) chooser.setCurrentDirectory(new File(sdir));
... | 7 |
public AbstractExpression LExpr(ProcedureBuilder pb) throws Exception {
Token l_token;
AbstractExpression RetValue = Expression(pb);
while (Current_Token == Token.TOK_GT
|| Current_Token == Token.TOK_LT
|| Current_Token == Token.TOK_GTE
|| Current_... | 6 |
public int compare(Object o1, Object o2) {
// we swap the parameters so that sorting goes largest to smallest
String v1 = ((AbstractPolicy)o2).getVersion();
String v2 = ((AbstractPolicy)o1).getVersion();
// do a quick check to see if the strings are equal (note that
... | 6 |
@Override
public void sort() {
// Create the heap
for (int i=1; i<this.arr.size(); i++) {
// i = right side of the heap
// Move the element upside
int moving = i;
int parent = (moving-1)/2;
while (parent>=0 && this.arr.getValue(moving).compareTo(this.arr.getValue(parent)) > 0) {
this.steps++;
... | 9 |
int readCorner1(int numRows, int numColumns) {
int currentByte = 0;
if (readModule(numRows - 1, 0, numRows, numColumns)) {
currentByte |= 1;
}
currentByte <<= 1;
if (readModule(numRows - 1, 1, numRows, numColumns)) {
currentByte |= 1;
}
currentByte <<= 1;
if (readModule(numRo... | 8 |
public void setAlgorithm(String value) {
this.algorithm = value;
} | 0 |
public void setComando(List<?> list)
{
for(PComando e : this._comando_)
{
e.parent(null);
}
this._comando_.clear();
for(Object obj_e : list)
{
PComando e = (PComando) obj_e;
if(e.parent() != null)
{
e.pa... | 4 |
public void undo(){
if(getCell(0, 0).getundoListSize() < 0){
for(int i = 0; i < model.getWidth(); i++){
for(int j = 0; j < model.getHeight(); j++){
getCell(i, j).undo();
}
}
}
else{
System.out.println("Não há... | 3 |
private final boolean initialiseFullScreen() {
graphicsDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
if (!graphicsDevice.isFullScreenSupported()) {
logger.error("Full screen not supported by graphics device");
return false;
}
graphicsDevice.setFullScreenWindow(this... | 2 |
public PastPane(Configuration last) {
setConfiguration(last);
} | 0 |
public int[] getStats(boolean recursive){
int[] stats=new int[6];
HashSet<String> blankNodes=new HashSet<String>();
HashSet<String> USUs=new HashSet<String>();
//Triples
if (!triples.isEmpty()){
int[] r=getStatsTripleList(triples,blankNodes,USUs);
for (int i=0; i<stats.length; i++){
stats[i]+=r[i];
... | 8 |
private void buildRightSideInfo(final JPanel right, final JList<FolderConfig> list) {
right.add(new JLabel("Artist URL"));
final JTextField artistUrlText = new JTextField();
if (GuiUtils.currentFolderConfig.getArtistUrl() != null) {
artistUrlText.setText(GuiUtils.currentFolderConfig.getArtistUrl());
}
arti... | 3 |
private int read1(char[] cbuf, int off, int len) throws IOException {
if (nextChar >= nChars) {
/* If the requested length is at least as large as the buffer, and
if there is no mark/reset activity, and if line feeds are not
being skipped, do not bother to copy the char... | 9 |
private void createDevicesSection() {
BasePanel deviceSection = new BasePanel();
deviceSection.setBorderSize(1);
deviceSection.setArc(10);
deviceSection.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
GridBagLayout deviceSectionLayout;
deviceSection.setLayout(deviceSectionLayout = new GridBagLayout... | 3 |
public void setX(int x)
{
for(int i=0;i<markers;i++)
{
if(marker[i].isSelectedDrag())
{
marker[i].setX(x);
// break;
}
}
} | 2 |
private static void saveMapToTextFile(String fileToSaveTo) {
FileWriter writeto = null;
try {
writeto = new FileWriter(fileToSaveTo, true);// true append
// text
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (writeto == null) {
System.out.pri... | 5 |
public Set<BankAccount> getAccountsSatisfying(Predicate<BankAccount> predicate) {
Set<BankAccount> result = new HashSet<>();
for (BankAccount account: accounts)
if (predicate.test(account))
result.add(account);
return result;
} | 2 |
public void gameRebounds() {
Collections.shuffle(rebounds);
for (int i = 0; i < 35; i++) {
Collections.shuffle(rebounds);
if(rebounds.get(0) == team.get(0).name) {
rebC++;
}
if(rebounds.get(0) == team.get(1).name) {
rebPF++;
}
if(rebounds.get(0) == team.get(2).name) {
rebSF++;
}
... | 6 |
public void createConstraints(Model m){
//Inventory balance
inventory= new QBnBconstr[psize][tsize];
for (int p = 0; p < psize; p++) {
for (int t = 0; t < tsize; t++) {
if(t==0){
QBnBLinExp le= new QBnBLinExp();
le.addTerm(1, Q[p][t]);
le.addTerm(-1, I[p][t]);
inventory[p][t]= new QBnBc... | 9 |
public void conectar(String AHC, String BHC){ //hashcode B y B
String Acode= null;
String Bcode= null;
for (Nodo<String> i = _ID_HASHCODE_IO.getHead(); i != null; i = i.getSiguiente()){
if(i.getDato().contains(AHC)){
Acode = i.getDato();
}
if(i... | 9 |
private void pop(char c) throws JSONException {
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m != c) {
throw new JSONException("Nesting error.");
}
this.top -= 1;
... | 5 |
public void zoomToBestFit(Set<GeoPosition> positions, double maxFraction)
{
if (positions.isEmpty())
return;
if (maxFraction <= 0 || maxFraction > 1)
throw new IllegalArgumentException("maxFraction must be between 0 and 1");
TileFactory tileFactory = getTileFactory();
TileFactoryInfo i... | 9 |
public void setId(int id) {
this.id = id;
} | 0 |
private int getStart(int offs) throws BadLocationException {
for (int i=offs;i>=0;i--){
if (endOfTokens.contains(getText(i, 1))){
return i+1;
}
}
return 0;
} | 2 |
public void setFunMm(BigInteger funMm) {
this.funMm = funMm;
} | 0 |
public void setRecordStatus(Integer recordStatus) {
this.recordStatus = recordStatus;
} | 0 |
static int mame_stats(int selected)
{
String buf="";
int sel, i;
sel = selected - 1;
if (dispensed_tickets!=0)
{
buf = "Tickets dispensed: " + sprintf("%d\n\n", dispensed_tickets);
}
for (i=0; i<COIN_COUNTERS; i++)
{
buf += sprintf("Coin %c... | 9 |
public void start() {
ticks=System.currentTimeMillis();
} | 0 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!super.okMessage(myHost, msg))
return false;
if((msg.tool()==this)
&&(msg.targetMinor()==CMMsg.TYP_DAMAGE)
&&(msg.value()>0)
&&(msg.target() !=null)
&&(msg.target() instanceof MOB)
&&(weaponClassification()==Weapon.C... | 7 |
public void connect(TreeLinkNode root) {
if(root == null){
return;
}
LinkedList<TreeLinkNode> queue = new LinkedList<TreeLinkNode>();
LinkedList<TreeLinkNode> childQueue = new LinkedList<TreeLinkNode>();
queue.add(root);
TreeLinkNode preNode = null;
wh... | 7 |
public ArrayList<Request> generateVirtualNetworks(int numberOfNetworks) {
ArrayList<Request> requests = new ArrayList<Request>();
int baseTime = 0;
int requestsPer100UnitsTime = randomizer.nextPoisson();
for(int idRequest = 0; idRequest < numberOfNetworks; idRequest++) {
HashMap<Integer,VirtualNod... | 8 |
@Override
public void nextStep() {
Resource res;
switch (this.step) {
case (0):
// Blokuotas, laukiam "Eilutė atmintyje" resurso
res = Core.resourceList.searchResource(ResourceType.LI_IN_MEM);
if (res != null) {
PrintDescriptor descriptor = (PrintDescriptor) res.getDescriptor();
res.setParent(th... | 9 |
@Override
public void paint(Graphics g) {
g.clearRect(0, 0, getWidth(), getHeight()); //clears the screen
int gridX = getWidth() / gridSizeX;
int gridY = getHeight() / gridSizeY;
int actual_grid_size = Math.min(gridX, gridY);
if (actual_grid_size == 0) {
return;
... | 8 |
public Condition getCondition(String inName)
{
String strStore="Error opening file";
try
{
RandomAccessFile rafConditionDef = new RandomAccessFile("defConditions/"+inName.toLowerCase(), "r");
Condition cndStore = new Condition();
cndStore.NAME = inName;
strStore = rafConditionDef.readLine();
while... | 9 |
final void removeImageFetcher(Canvas canvas) {
do {
try {
anInt7906++;
if (((NativeToolkit) this).aCanvas7925 == canvas)
throw new RuntimeException();
if (!aHashtable8014.containsKey(canvas))
break;
method3911(canvas, 1, aHashtable8014.get(canvas));
aHashtable8014.remove(canvas);
} catc... | 5 |
@Override
public void execute() {
try {
boolean newMember = false;
String membersList = controller.getConnection().get("members/list/?order=desc&sort=joindate");
Document doc = Jsoup.parse(membersList);
Elements links = doc.select("a.username");
Element link = links.first();
String username = lin... | 5 |
private void sendCommand(int level, String[] keywords, String hostname, String recipient) {
if (isAccountTypeOf(level, REGISTERED, MODERATOR, ADMIN)) {
if (keywords.length > 2) {
if (Functions.isNumeric(keywords[1])) {
int port = Integer.parseInt(keywords[1]);
String message = Functions.implode(Array... | 8 |
public WayOsm(List<Long> l){
if (l == null)
this.nodos = new ArrayList<Long>();
else
this.nodos = l;
shapes = new ArrayList<String>();
} | 1 |
public void connect() {
new Thread(new Runnable() {
@Override
public void run() {
if(isReconnectWorkerWorking()) {
reconnectWorker.shutdownNow();
}
preConnect();
sendNewInfo("Connecting to: " + host + ":" + port);
if(echoSocket == null) {
echoSocket = n... | 6 |
public ArrayList<String> loadBranch(){
ArrayList<String> branches = new ArrayList<String>();
int startLine = 0;
for(int lineNumber = 0;lineNumber < stringLines.size();lineNumber++){
String aString = stringLines.get(lineNumber);
if(aString.equals("branches:")){
startLine = lineNumber+1;
break;
}
... | 4 |
public void createComponents() {
nextOutput = new JButton("Next");
previousOutput = new JButton("Previous");
deleteButton = new JButton("Delete");
leftPanel = new JPanel();
rightPanel = new JPanel();
mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
m... | 8 |
private void checkMeetings() {
Meeting holder = null;
if(!pastMeetingList.isEmpty()){
holder = pastMeetingList.get(0);
}
System.out.println("There are past meetings");
for(int i = 0; i < pastMeetingList.size(); i++){
if(holder.getDate().getTime().after(theCalendar.getTime())){
PastMeeting... | 3 |
public static double countOnes(double[] nums) {
int count = 0;
for (double num : nums) {
if (num == 1.0) {
count += 1;
}
}
// Return the negation of the count so we can still choose a hypothesis
// by the max
return -count;
} | 2 |
public void turn(long deltaMs) {
float targetAngleDeg = MathUtil.radToDeg(targetAngle);
float currentAngleDeg = MathUtil.radToDeg(angleRad);
WeaponsComponent wc = (WeaponsComponent)owner.getComponent("WeaponsComponent");
if(currentAngleDeg < targetAngleDeg - 1f) {
fl... | 9 |
public Matrix _inverseSide() {
/**
* If the matrix has been augmented, solve so that the unaugmented
* portion is an identity matrix. Currently appears to be unable to
* handle zero entries - quite a problem if you ask me!
*/
if (augmented != null && rows == cols) {
Matrix matrix = duplicate();
fo... | 9 |
public void kirjoitaOikeanmuotoinenSisaltoTiedostolle(){
try {
PrintWriter kirjoitin = new PrintWriter(tiedosto);
kirjoitin.println("dog\t[dog]\tkoira\ttunniste1\tMELKEIN");
kirjoitin.println("cat\t[kät]\tkissa\ttunniste1\tEI");
kirjoitin.println("duck\t[dak]\tankka\t... | 1 |
protected String getPackage(String uri) {
if (uri == null || uri.indexOf("/") == -1)
return "";
return uri.substring(0, uri.lastIndexOf("/"));
} | 2 |
public void run() throws IOException
{
Route53Driver driver = new Route53Driver(awsAccessKey, awsPrivateKey);
Zone zone = driver.zoneDetails(route53ZoneId);
if (cleanZone)
{
List<ZoneUpdateAction> deletes = new ArrayList<ZoneUpdateAction>();
for (ZoneResource resource : driver.listZoneRecords(zone))
... | 7 |
public void testWithFieldAdded7() {
Partial test = createHourMinPartial(23, 59, ISO_UTC);
try {
test.withFieldAdded(DurationFieldType.minutes(), 1);
fail();
} catch (IllegalArgumentException ex) {
// expected
}
check(test, 23, 59);
... | 2 |
public Map(int width, int height, int current_x, int current_y, int heading) {
// System.out.println("Test1");
this.width = width;
this.heading = heading;
this.height = height;
mapNode = new Node[width][height];
for (int i = 0; i < this.width; i++) {// initilize nodes
for (int j = 0; j < this.height; j++... | 8 |
public long howMany(int size, int[] start, int[] end, int numMoves) {
long steps[][][] = new long[size][size][numMoves + 1];
steps[start[0]][start[1]][0] = 1;
for (int n = 1; n <= numMoves; n++) {
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
if (steps[i][j][n - 1... | 9 |
public void drawSquareCursor(int xc, int yc, byte size, Graphics bufferGraphics, int winZoom, int realZoom, int Zoom, int ScrollX, int ScrollY) {
for (int x = xc; x < xc + size; x++) {
if (x == xc || x == xc + size - 1)
{
for (int y = yc; y < yc + size; y++) {
drawCursorPoint(x, y, bufferGraphics, winZ... | 5 |
public Object makeKey(byte[] uk, int bs) throws InvalidKeyException {
if (bs != DEFAULT_BLOCK_SIZE) {
throw new IllegalArgumentException();
}
if (uk == null) {
throw new InvalidKeyException("Empty key");
}
int len = uk.length;
if (len < 5 || len > 16) {
thr... | 5 |
public boolean isIdentity() {
for (int x = 0; x < sizeX; ++x) {
for (int y = 0; y < sizeY; ++y) {
if (x == y) {
if ( Math.abs( values[ ( y * sizeX ) + x ] - 1.0f ) > 0.1f ) {
return false;
}
} else {
if (!Utils.eqFloat(0.0f, values[ ( y * sizeX ) + x ]))
return false;
... | 5 |
public static void loadLanguage(File file) {
String dirName = file.getParentFile().getName();
String fileName = file.getName();
String language = fileName.replace(Util.getFileExtension(fileName), "").replace(".", "");
if(!languages.containsKey(language)) {
languages.put(language, new Language(language));
}... | 6 |
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
Action a = event.getAction();
ItemStack item = event.getItem();
if((a == Action.PHYSICAL) || (item == null) || (item.getType() == Material.AIR)) {
return;
}
if (item.getType() == Material.FIREWORK_CHARGE) {
}
} | 4 |
private boolean matches(ProcessingEnvironment procEnv, boolean strict,
List<? extends TypeMirror> parameterTypes,
List<? extends TypeMirror> expectedParameterTypes) {
if (parameterTypes.size() != expectedParameterTypes.size()) {
return false;
}
if (strict) {
for (int i = 0; i < parameterTypes.size();... | 8 |
public void pidWrite(double output) {
set(output);
} | 0 |
private void swap(int[] array, int left, int right){
int temp = array[left];
array[left] = array[right];
array[right] = temp;
} | 0 |
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
data = stream.readObject();
} | 0 |
public void run ()
{
while (true)
{
try
{
CommandSender sender = queue.take().get();
if (sender == null)
break;
autoUpdater.updateCheck();
autoUpdater.downloadLatestVersion();
... | 3 |
public void addHero(core.Hero hero)
{
if (lockCount != 0) return;
WidgetChooserButton button;
if (heroesSelected != -1) {
try {
button = (WidgetChooserButton)(heroesInner.itemAt(heroesSelected).widget());
button.setChecked(false);
} catch (NullPointerException e) {}
}
button = new W... | 3 |
public static ArrayList<ArrayList<Integer>> Biparticao(Graph grafo) {
int[] Cor = new int[grafo.getNlc()];
for (int i = 0; i < grafo.getNlc(); i++) {
if (Cor[i] == 0) {
Cor[i] = 1;
if (!Biparticao_Visit(grafo, i, Cor, 2)) {
return null;
}
}
}
ArrayList<ArrayList<Integer>> resultado = ... | 5 |
public Node removeFirst()
{
if(root == null) return null;
Node retNode = root;
root.next.prev = null;
root = root.next;
items--;
return retNode;
} | 1 |
public void run(){
BufferedReader br = null;
InetAddress addr = null;
ServerSocket servSock = null;
Socket cliSock = null;
try{
addr = InetAddress.getLocalHost();
servSock = new ServerSocket(3110, 5, addr);
}
catch(Exception e){
System.out.println("Creation of ServerSocket failed.");
Sys... | 7 |
private void setupTopPanel() {
final Stage stage = view.getStage();
// File > Load File
view.topPanel.mItmLoadFile.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
FileChooser fileChooser = new FileChoos... | 7 |
public static int getDirNr(Direction i) {
if (i == null) {
return 0;
}
switch (i) {
case TOP_LEFT:
return 0;
case TOP:
return 1;
case TOP_RIGHT:
return 2;
case BOT_RIGHT:
r... | 7 |
public void criarProjeto(Projeto projeto) throws SQLException {
Connection conexao = null;
PreparedStatement comando = null;
try {
conexao = BancoDadosUtil.getConnection();
comando = conexao.prepareStatement(SQL_INSERT_PROJETO);
comando.setString(1, projeto... | 6 |
public static Document load(){
File folder = new File(SAVE_PATH);
System.out.println(folder.getAbsoluteFile());
File[] listOfFiles = folder.listFiles();
int count = 1;
ArrayList<String> files = new ArrayList<String>();
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) {
Syst... | 5 |
public ArrayList<Advogado> Consultar(String id){
ArrayList<Advogado> advogados = new ArrayList<>();
if(id.equals("")){
try {
ConsultarSQL("SELECT * FROM tb_advogado", true);
while (rs.next()) {
... | 5 |
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int cases = input.nextInt();
for (int q = 0; q < cases; ++q) {
int houses = input.nextInt();
int[] addresses = new int[houses];
for (int i = 0;... | 3 |
@Override
public boolean isOp() {
if(User.getOpChannels().contains(Message.getChannel())) return true;
else return false;
} | 1 |
public void getValues()
{
//Cost for printing
conf.printingCosts = new ArrayList<ItemStack>();
List<String> items = c.getStringList("PrintingCosts");
//Custom costs:
if (items != null)
for (String s : items)
conf.printingCosts.add(Utility.getItem(s));
//Default costs:
else
conf.printingCosts... | 9 |
private void resetPosition(Tile current, int row, int col) {
if(current == null)return;
int x = getTileX(col);
int y = getTileY(row);
int distX = current.getX() - x;
int distY = current.getY() - y;
if(Math.abs(distX) < Tile.SLIDE_SPEED){
current.setX(current.getX() - distX);
}
if(Math.abs... | 7 |
protected static void midpointDisplacement(final HeightField hf,
final int L, final int MX, final int MY, int range,
final float persist, final long seed) {
/*
* NOTE: A is (x1, y1) B is (x2, y2) A,B,C,D are the original "corner"
* points
*
* G
*
* B D
*
* H E I
*
* A C
*
... | 7 |
private Handler parseRequest(InputStream inputStream) throws IOException, ServerException
{
String commandString = StreamUtil.readLine(inputStream);
if ("echo".equalsIgnoreCase(commandString)) {
Handler handler = new EchoHandler();
return handler;
}
else if ("reverse".equalsIgnoreCase(commandString)) {
... | 8 |
private boolean searchDownForPrevIntersectionNode( Node node, K key, Object[] ret ) {
while( true ) {
int c = mComp.compareMinToMax( node.mKey, key );
if( c < 0 ) {
// Node does not occur completely after mKey.
// Check if right subtree might intersect mK... | 7 |
@Override
public void update(Observable obj, Object arg) {
if (arg instanceof IRemovable) {
if (((IRemovable) arg).needsRemoved()) {
// Stop observing this object as we no longer care about it
((IObservable) arg).deleteObserver(this);
remove(arg);
}
}
} | 2 |
public boolean deletePatient(Patient patient) {
if (nextPatient == null) {
return false;
} else if (nextPatient.name.equals(patient.name) && nextPatient.nextPatient != null) {
nextPatient = nextPatient.nextPatient;
nextPatient.previousPatient = this;
retur... | 5 |
public Validator<T> getValidatorLHS() {
return validatorLHS;
} | 0 |
public List<Booking> getBookingsByDate(Calendar date) {
List<Booking> b = new ArrayList<Booking>();
Iterator<Booking> iter;
iter = bookings.iterator();
while (iter.hasNext()) {
Booking booking = iter.next();
if ((booking.getDate().get(Calendar.DAY_OF_MONTH) == date
.get(Calendar.DAY_OF_MONTH))
&... | 4 |
private Language() {
supportedLanguages = new HashMap<String, Locale>();
supportedLanguages.put("language_english", Locale.ENGLISH);
supportedLanguages.put("language_german", Locale.GERMAN);
} | 0 |
static void checkAccess(final int access, final int possibleAccess) {
if ((access & ~possibleAccess) != 0) {
throw new IllegalArgumentException("Invalid access flags: "
+ access);
}
int pub = (access & Opcodes.ACC_PUBLIC) == 0 ? 0 : 1;
int pri = (access & Opcodes.ACC_PRIVATE) == 0 ? 0 : 1;
int pro = (... | 8 |
public void setMetricType (SelectedTag d) {
if (d.getTags() == TAGS_SELECTION) {
m_metricType = d.getSelectedTag().getID();
}
if (m_significanceLevel != -1 && m_metricType != CONFIDENCE) {
m_metricType = CONFIDENCE;
}
if (m_metricType == CONFIDENCE) {
setMinMetric(0.9);
... | 7 |
public ConnectionLogger get_logger() {
return new ConsoleConnectionLogger("bogus_route", 0);
//throw new RuntimeException("not implemented");
} | 0 |
@Override
public boolean run() {
open(); // Open files
// Split size
long size = file.length();
if (verbose) Timer.showStdErr("Splitting file '" + fastqFile + "' into " + numSplits + " parts. File size: " + fileSizeStr(size) + " ( " + size + " bytes).");
long step = size / numSplits;
if (step < 0) error("... | 5 |
public static void clearFolder(File folder){
if(folder.exists()) {
for(String file : folder.list()) {
if (new File(folder, file).isDirectory()){
//Logger.logInfo(new File(folder, file).toString());
clearFolder(new File(folder, file));
... | 9 |
public Location findNearestCorner(Location destination){
//TOP LEFT
if (destination.mX < 300 && destination.mY < 300) {
return ContactList.cPERSONCORNERS.get(0);
}
//TOP RIGHT
if (destination.mX > 300 && destination.mY < 300) {
return ContactList.cPERSONCORNERS.get(1);
}
//BOTTOM RIGHT
if (desti... | 8 |
public static RSInterface readHeaderChunk(JagexBuffer buffer) {
try {
int parentId = -1;
int interfaceId = buffer.getUnsignedShort();
if (interfaceId == 65535) {
parentId = buffer.getUnsignedShort();
interfaceId = buffer.getUnsignedShort();
}
RSInterface rsi = new RSInterface();
RSInterface.... | 8 |
public Point2D echarAdvance(final char ech) {
// create a glyph vector for the char
float advance;
float advanceY;
// check cache for existing layout
String text = String.valueOf(ech);
Point2D.Float echarAdvance = echarAdvanceCache.get(text);
// generate metric... | 7 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
SeviceStrategy service = new MenuService();
String action = null;//action being performed
String[] delete = null;//array of deleted entrees
Stri... | 7 |
public static List<String> generateAllSentencesWithFilteredDefinitions(GRESCTask task) {
List<String> pSentences = new ArrayList<String>();
List<GRESCOption> options = task.getOptions().get(0);
for (GRESCOption option : options) {
String sentence = task.getSentence().replaceAll("%s", "\\(%s\\)");
String for... | 9 |
ResultSetReference getResult(Connection conn, Parameter p) throws SQLException {
if (!p.has(1)) {
throw new UsageException(getUsage());
}
final String cmd = p.asString();
final String tableName = p.at(1);
final String option = p.at(2);
try {
Databa... | 7 |
public void mouseMoved(MouseEvent paramMouseEvent) {
if (ImageButton.this.Enabled)
{
if ((ImageButton.this.MouseOverImage != null) &&
(ImageButton.this.ImageMap != null))
{
if (ImageButton.this.checkMap(paramMouseEvent.getX(), paramMouseEvent.getY()) != null)
{... | 9 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Pessoa other = (Pessoa) obj;
if (this.idPessoa != other.idPessoa && (this.idPessoa == null || !this.idPes... | 5 |
public void laggTillFramfor(Punkt horn, String hornNamn)
{
Punkt[] h = new Punkt[this.horn.length + 1];
for(int i = 0, i2 = 0; i < this.horn.length; i++, i2++)
{
if(i == findPunkt(hornNamn))
{
h[i] = horn;
i++;
}
h[i] = this.horn[i2];
}
this.horn = h;
} | 2 |
public DrawableComponent drawData()
{
if (opaque)
{
RenderUtil.setRenderingMode(this, RenderUtil.NORMAL_MODE);
}
else if (!opaque && loadAsModel)
{
RenderUtil.setRenderingMode(this, RenderUtil.MODEL_MODE);
}
else
{
S... | 3 |
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.