text stringlengths 14 410k | label int32 0 9 |
|---|---|
private InputStream getFileFromJar(String jarFilename, String entryFilename) throws IOException
{
JarFile jarfile = new JarFile(jarFilename);
try {
Enumeration<JarEntry> entries = jarfile.entries();
if(entries != null) {
while(entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
... | 4 |
@Override
public void deserialize(Buffer buf) {
int limit = buf.readUShort();
aliases = new String[limit];
for (int i = 0; i < limit; i++) {
aliases[i] = buf.readString();
}
limit = buf.readUShort();
arguments = new String[limit];
for (int i = 0; i... | 3 |
String show(Genome genome) {
StringBuilder sb = new StringBuilder();
// Genome
sb.append(genome.getVersion() + "\n");
// Chromosomes
for (Chromosome chr : genome)
sb.append(chr + "\n");
// Genes
ArrayList<Gene> genes = new ArrayList<Gene>();
for (Gene gene : genome.getGenes())
// Sort genes
... | 4 |
@Override
public Object getTeleportPacket(Location loc) {
Class<?> PacketPlayOutEntityTeleport = Util.getCraftClass("PacketPlayOutEntityTeleport");
Object packet = null;
try {
packet = PacketPlayOutEntityTeleport
.getConstructor(new Class<?>[] { int.class, int.class, int.class, int.cl... | 8 |
private void fileprojectNameComboBoxActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int index = fileprojectNameComboBox.getSelectedIndex();
if (index != -1) {
String projID = projectTableController.get... | 1 |
private boolean checkRoyalStraight(int player) {
TreeSet<Integer> set = new TreeSet<Integer>();
for (int card : players[player].cards) {
set.add(card % 13);
}
int[] hand = new int[5];
int i = 0;
for (int card : set) {
hand[i++] = card;
}
// Royal Straight: Ace, King, Queen, Jack, 10
if (ha... | 7 |
public static void processInput(){
Console con = System.console();
if (con != null){
con.printf(todoEEHeader);
boolean useTodo = true;
while(useTodo){
String readIn = con.readLine(prompt).trim();
if(readIn.equals("")) continue;
String readKeywords[] = readIn.split("\\s");
String... | 7 |
public static UpdateFlags swigToEnum(int swigValue) {
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
return swigValues[swigValue];
for (int i = 0; i < swigValues.length; i++)
if (swigValues[i].swigValue == swigValue)
return swigValues[i];... | 5 |
private JTextField getJTextFieldOutputfilename() {
if (jTextFieldOutputfilename == null) {
jTextFieldOutputfilename = new JTextField();
}
return jTextFieldOutputfilename;
} | 1 |
@Override
protected void controlUpdate(float tpf) {
if(GameStarted.gameStart){
if(!init){
// initAssetManager();
BitmapFont font = GameStarted.assetManager.loadFont("Interface/Fonts/Default.fnt"); //<-- AssetReference
// BitmapFont font = assetManage... | 8 |
public static String arrayToDelimitedString(Object[] arr, String delim) {
if (ObjectUtils.isEmpty(arr)) {
return "";
}
if (arr.length == 1) {
return ObjectUtils.nullSafeToString(arr[0]);
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < arr.length; i++) ... | 4 |
public Descriptor descriptorFor(String ident) {
// built-in types
if (("integer").equalsIgnoreCase(ident)) {
return new SimpleTypeDescriptor(Type.INTEGER);
}else if(("string").equalsIgnoreCase(ident)){
return new SimpleTypeDescriptor(Type.STRING);
}else if(("boolean").equalsIgnoreC... | 6 |
private void createData() {
try {
outStream = new ByteArrayOutputStream();
DataOutputStream writer = new DataOutputStream(outStream);
for (int i = 0; i < 10; i++) {
Trade lastTrade = new Trade(i);
writer.writeInt(lastTrade.scripCode);
writer.write(lastTrade.time);
writer.writeDouble(lastTrad... | 2 |
private void saveCurrentTickers() {
try {
FileUtils.copyURLToFile(new URL(qTickerDownloadSite), new File(
REPORTS_ROOT + fileTitle("NASDAq")));
FileUtils.copyURLToFile(new URL(yTickerDownloadSite), new File(
REPORTS_ROOT + fileTitle("NySE")));
} catch (MalformedURLException e) {
// TODO Auto-gen... | 2 |
public boolean buyBuildingOrRequired(Player player, CastleBuilding b)
{
if (!buildings.contains(b)) {
if (buildings.containsAll(Arrays.asList(b.requires))) {
return buyBuildingSpecific(player, b);
} else {
List<CastleBuilding> req = Arrays.asList(b.requires);
req.removeAll(buildings);
for ... | 4 |
public void resume_ingress() {
synchronized (ingress_paused) {
if (!ingress_paused) {
get_logger().warn("resuming ingress but ingress not paused");
}
ingress_paused = false;
}
} | 1 |
private void RfechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RfechaActionPerformed
vtexto = Ctexto.getText();
DefaultTableModel tr = (DefaultTableModel)tabla.getModel();
try
{
Statement s = cone.getMiConexion()... | 8 |
public String addOffline(Product p) {
try {
String sql = "INSERT INTO stock (productName,count,price,feature) VALUES (?, ?, ?, ?)";
PreparedStatement ps = StatusController.connection.prepareStatement(sql);
ps.setString(1, p.getpName());
ps.setInt(2, p.getAmount());
ps.setDouble(3, p.getPrice());
p... | 1 |
public void addinterval(String str) {
if (str == null || str.equals("")) {
return;
}
String[] interval = str.split(",");
if (interval.length > 0) {
for (String item : interval) {
String[] mm = item.split("-");
if (mm.length > 0) {
lst.add(new Interval(Long.valueOf(mm[0]), Long.valueOf(mm[1]),... | 5 |
public static void removeFlag(Cuboid c, String player, Flag flag) {
if (c == null || player == null || flag == null) return;
if (!c.getFlags().get(flag).contains(player)) return;
c.getFlags().get(flag).remove(player);
} | 4 |
public static BigInteger sqrt(BigInteger n) {
BigInteger g = new BigInteger((n.shiftRight((n.bitLength() + 1) / 2)).toString());
BigInteger LastG = null;
BigInteger One = new BigInteger("1");
while (true) {
LastG = g;
g = n.divide(g).add(g).shiftRight(1);
int i = g.compareTo(LastG);
if (i == 0)
... | 9 |
public static void toLayer2(RoutinePacket pkt){
Random rn = new Random();
float timestamp = lastime + 2 * (rn.nextFloat() % 1);
boolean directConnected[][] = new boolean[4][4];
//Verificando na layer2 quem está conectado diretamente a quen
//Conectividade do nó 0 para os... | 7 |
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 ArrayList<Integer> getStringAsIntegerList(String name)
{
List<String> value_list = strings_map.get(name);
ArrayList<Integer> result = new ArrayList<Integer>();
if(value_list == null)
{
return result;
}
for(String val:value_list)
{
try
{
result.add(Inte... | 3 |
public void receiveShippingNotice(String shipID, String manu, ArrayList<Item> items)
{
// This will have information to populate the Products Depot table, specifically, the
// replenishment amount.
// If a new product, have to insert all values. Otherwise, only need to update replenishment.
for (i... | 6 |
public int countPlayers(final boolean mustBeIn,
final boolean mustNotFolded, final boolean mustNotAllIn) {
int count = 0;
for (Player player : players) {
if ((!mustBeIn || !player.isOut())
&& (!mustNotFolded || !player.hasFolded())
... | 7 |
public static void move(String command)
{
String[] moveTo = command.split(" ", 2);
if(!LocationHelper.getLocationFromName(moveTo[1]).container)
{
Parasite.thePlayer.move(LocationHelper.getLocationFromName(moveTo[1]));
Parasite.theTime.incrementTime(10);
}
... | 2 |
public static int Flail(Pokemon attacker) {
int p = (int) (48.0 * attacker.getCurrHp()) / attacker.getMaxHp();
if (p > 32) {
return 20;
} else if (p <= 32 && p >= 17) {
return 40;
} else if (p <= 16 && p >= 10) {
return 80;
} else if (p <= 9 && p >= 5) {
return 100;
} else if (p <= 4 && p >= ... | 9 |
public void setup(Context context) {
// read distributed catch file
try {
Path[] localFiles = DistributedCache.getLocalCacheFiles(context.getConfiguration());
COUNT_OF_TABLE = readLocalFile(localFiles[1]).size();
// init
TABLE_KEY = new ArrayList[COUNT_OF_TABLE];
TABLE_VALUE = new ArrayList[COUNT_O... | 5 |
private Map findExclusiveDeclaredInterfaces(Type type, CtClass exclude) {
Map typeMap = getDeclaredInterfaces(type.clazz, null);
Map thisMap = getDeclaredInterfaces(this.clazz, null);
Map excludeMap = getAllInterfaces(exclude, null);
Iterator i = excludeMap.keySet().iterator();
... | 1 |
@EventHandler
public void onMovement(PlayerMoveEvent evt){
if(evt.getTo().getBlock() != evt.getFrom().getBlock()){
if(ArenaManager.getManager().PIG.contains(evt.getPlayer().getName())){
if(evt.getPlayer().getLocation().getBlock().getRelative(BlockFace.DOWN).getType().equals(Material.SAND)
|| evt.getFro... | 7 |
@SuppressWarnings("unchecked")
@Override
public String displayQuestion(int position) {
ArrayList<String> questionList = (ArrayList<String>) question;
String questionStr = questionList.get(0);
StringBuilder sb = new StringBuilder();
sb.append("<span class=\"dominant_text\">" + position + ".</span>\n");
sb.... | 1 |
public Writer write(Writer writer) throws JSONException {
try {
boolean b = false;
int len = length();
writer.write('[');
for (int i = 0; i < len; i += 1) {
if (b) {
writer.write(',');
}
Obj... | 5 |
@Override
public void setValue(int row, int col, double value) throws MatrixIndexOutOfBoundsException {
if ((row < 0) || (col < 0) || (row >= mas.length) || (col >= mas[0].length)) {
throw new MatrixIndexOutOfBoundsException("Inadmissible value of an index.");
}
mas[row][col] = v... | 4 |
@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 TaxonObservationAttribute)) {
return false;
}
TaxonObservationAttribute other = (TaxonObservationAttribute) object;
... | 5 |
@Override
public void run()
{
log.info("working");
Map<String, Object> data = new HashMap<>();
boolean redirect = false;
String target = "/orders";
String token = rx.cookieValue("CPA");
int authorizedAs = -1;
if(rx.method().equals("POST"))
{
String login = rx.postParam("inputEmail");
... | 6 |
private void examineNode(Node node, boolean attributesOnly) {
NamedNodeMap attributes = node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node attribute = attributes.item(i);
storeAttribute((Attr) attribute);
}
if (!attributesOnly) {
... | 4 |
public Map<String, List<String>> getTypeGroup() {
final String[] baseGroup = { "ESI", "EI", "Others" };
String[] instTypes = getTypeAll();
int num = baseGroup.length;
List<String>[] listInstType = new ArrayList[num];
for ( int i = 0; i < num; i++ ) {
listInstType[i] = new ArrayList<String>();
}
for ( ... | 7 |
public Sequence getComplement(int start, int end) {
StringBuilder newStr = new StringBuilder();
for(int i=start; i<end; i++) {
char compBase = '-';
char theBase = this.at(i);
switch(theBase) {
case 'A' : compBase = 'T'; break;
case 'G' : compBase = 'C'; break;
case 'C... | 7 |
@Override
public boolean abort(long txnID) throws RemoteException {
if (fileNameTransaction.containsKey(txnID)) {
String fileName = fileNameTransaction.remove(txnID);
cache.remove(fileName);
fileLock.get(fileName).release();
return true;
}
return false;
} | 1 |
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
org.omg.CORBA.portable.InputStream in,
org.omg.CORBA.portable.ResponseHandler $rh)
{
org.omg.CORBA.portable.OutputStream out = null;
java.lang.Integer __method = (java.lang.Integ... | 8 |
private void initializeResultsFile()
{
if (trace_flag == false) {
return;
}
// Initialize the results file
FileWriter fwriter = null;
try
{
fwriter = new FileWriter(super.get_name(), true);
} catch (Exception ex)
{
... | 4 |
private void checkForAnnouncement() {
try {
int clientAnnouncement = Integer.parseInt(announcementId);
int latestAnnouncement = Integer.parseInt(announcementCode);
if(clientAnnouncement < latestAnnouncement || latestAnnouncement == -1) {
hasAnnouncement = true;
if(latestAnnouncement ... | 4 |
@Test
public void testGetS1() {
System.out.println("getS1");
Drop instance = new Drop(3);
int expResult = 3;
int result = instance.getS1();
assertEquals(expResult, result);
} | 0 |
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 detail... | 6 |
ListeCombinaison(Parametre param){
listeCouleur = param.getListeCouleur();
if(param.getNbCouleurs() > listeCouleur.length){
throw new ArrayIndexOutOfBoundsException("Erreur : Le nombre de couleurs est trop grand.");
}
else{
listeCombi = new ArrayList(); // On rése... | 6 |
protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < ... | 9 |
@Test
public void emptyListReturnsCorrectValues() {
assertNull(l.min());
assertNull(l.max());
assertNull(l.pred(a));
assertNull(l.succ(a));
assertFalse(l.contains(a));
} | 0 |
@Override
public void setEmail(String email) {
this.email = email;
} | 0 |
public void draw() {
if(frame != null) {
frame.draw(getBoundsAsRect());
}
if(Theater.debug) {
DrawUtils.setColor(new Vector3f(1, 0, 0));
DrawUtils.drawRect(getBounds());
}
} | 2 |
public List<String> stringToPolish(String function){
List<String> polishList = new ArrayList<String>();
List<String> elements = split(function);
for (String s: elements) {
if (isOperator(s)) {
if (s.equals("(")) {
operations.push(s);
... | 9 |
public static boolean isPredominantlyRNA(final CharSequence sequenceString, int maximumNonGapsToLookAt) {
int length = sequenceString.length();
int tCount = 0;
int uCount = 0;
if (maximumNonGapsToLookAt==-1) maximumNonGapsToLookAt=Integer.MAX_VALUE;
for (int i = 0; i < length && ... | 8 |
public void movePieceDown(){
ListIterator<Tetromino> iterator = currentPieces.listIterator();
Tetromino currentPiece;
//test all active pieces for collision
while(iterator.hasNext()){
currentPiece = iterator.next();
if(!board.collision(currentPiece.getFallTet())){
currentPiece.moveDown();
} else... | 8 |
public void updateGUI(Player player, boolean type_of_vote) {
Player[] active_player_array = player.getWorld().getPlayers().toArray(new Player[0]);
for (int i = 0; i < active_player_array.length; i++) {
//SpoutPlayer spoutplayer = (SpoutPlayer) active_player_array[i];
SpoutPlayer spoutplayer = SpoutManag... | 6 |
public void landedOn(Player p)
{
guests.add(p);
updateGraphics();
if (owner == null)
{
Object [] options = {"Buy", "Pass"};
int response = JOptionPane.showOptionDialog(
null,
"Do you want to buy "+name+" for $"+price+"?",
name,
JOptio... | 4 |
public void add(String gram) {
if (name == null || gram == null) return; // Illegal
int len = gram.length();
if (len < 1 || len > NGram.N_GRAM) return; // Illegal
++n_words[len - 1];
if (freq.containsKey(gram)) {
freq.put(gram, freq.get(gram) + 1);
} else {... | 5 |
public void showMainMenu(){
mainMenu.show();
} | 0 |
public void mouseEntered(MouseEvent arg0) {} | 0 |
private boolean insideObject(int eX, int eY, int level, Shape shape) {
AffineTransform inv = null;
Point2D p;
double x = 0;
double y = 0;
if(level == 4 || level == 5){
// System.out.println("angleSpoon: " + angleSpoon + " angleSoonCont: " + angleSpoonCont);
Point2D p2 = new Point2D.D... | 9 |
public boolean verifyExpiration(CashCard currentCustomer)
{
if(Database.doesCardExist(currentCustomer.getCardId()))
{
if(Database.getCustomer(
currentCustomer.getCardId()).getExpirationYear() >
Calendar.getInstance().get(Calendar.YEAR))
{
... | 4 |
public void addGeneralRoom() {
if (current_x == min_width &&
(current_y < 2 || current_boss_chamber.getConnectionInDirection(RoomSide.NORTH) != null)) {
if (!is_new_row_started) {
startNewRow();
}
else {
addFirstBossChamberInRow();
}
}
else {
if (cur... | 9 |
void freeResources() {
if (images != null) {
for (int i = 0; i < images.length; ++i) {
final Image image = images[i];
if (image != null) image.dispose();
}
images = null;
}
} | 3 |
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args)
{
Player toPrint = null;
if (args.length == 1)
{
toPrint = plugin.getServer().getPlayerExact(args[0]);
// player not found
if (toPrint == null)
{
OfflinePlayer offlinePlayer = Bukkit.getOfflin... | 5 |
public DocumentSettingsView() {
super(false, false, true, INITIAL_WIDTH, INITIAL_HEIGHT, MINIMUM_WIDTH, MINIMUM_HEIGHT);
} | 0 |
protected int getKnownAttributeCount() {
int count = 0;
if (lvt != null)
count++;
if (lnt != null)
count++;
return count;
} | 2 |
public void test_pixel(Pixel p, Image image, Region region){
region.addPixel(p); //On attribut le pixel à sa région
//Si le pixel n'est pas en haut
if(p.getI() != 0){
if(image.getPixel(p.getI() - 1, p.getJ()).getAttribut() == -1){
liste.add(image.getPixel(p.getI() - 1... | 8 |
public double getThrottle(int which) {
switch(which){
case 1:
return leftDriveJoy.getZ();
case 2:
return rightDriveJoy.getZ();
case 3:
return leftJoy.getZ();
case 4:
return rightJoy.getThrottle();
... | 4 |
private static boolean parseArgs(String[] args, BOMFactory bomFactory, PrintStream printStream) throws Exception {
int urlCount = 0;
boolean ok = false;
for (int i=1; i<args.length; i++) {
String arg = args[i];
if ("-u".equals(arg)) {
if (i+1 >= args.length) {
throw new RuntimeException("Ex... | 9 |
public static void write_binarysort(int[] array, int searched){
//int []sorted = new int[array.length];
boolean found = false;
int low = 0;
int high = array.length-1;
int curr = 0;
while(low<=high){ //true now, becomes false // basically WHILE TRUE. DO>
curr... | 4 |
public int minCut(String s) {
isPal = new boolean[s.length()][s.length()];
this.s = s;
minCut = Integer.MAX_VALUE;
currentCut = 0;
isPal[0][0] = true;
for (int i = 1; i < s.length(); i++) {
isPal[i][i] = true;
isPal[i - 1][i] = s.charAt(i - 1) ==... | 4 |
public void newlotcreatorforl2(int lotno){
boolean val = true;
while(val){
int what=0;
System.out.println("what do you want to do?");
System.out.println("1)Add new car");
System.out.println("2)add new car at some specific position");
System.out.println("3)remove car");
System.out.println("4)get number o... | 8 |
@Override
public boolean onCommand(CommandEvent e)
{
if(e.getCommand().getName().equalsIgnoreCase("login") && e.getSender().getName().equalsIgnoreCase(logingPlayer.getName()))
{
if(e.getArgs().length > 1)
{
LanguageManager.sendText(PlayerManager.getPlayer(logingPlayer.getName()), "LoginManager_Login_NoS... | 5 |
public static String trimFileExtension(String fileNameString) {
// local vars
String resultString = fileNameString ;
int dotPoint = fileNameString.length() - 4;
// if we have a dot 3 chars in from right side ...
if (fileNameString.charAt(dotPoint) == '.') {
// trim last 4 chars
resultString = ... | 1 |
@Override
public void roomAffectFully(CMMsg msg, Room room, int dirCode)
{
room.send(msg.source(),msg);
if((msg.target()==null)||(!(msg.target() instanceof Exit)))
return;
if(dirCode<0)
{
for(int d=Directions.NUM_DIRECTIONS()-1;d>=0;d--)
{
if (room.getExitInDir(d) == msg.target())
{
dirC... | 9 |
public JelLibrarySupport(TableModel model) {
this.model = model;
try {
lib.markStateDependent("random", null);
lib.markStateDependent("random", new Class[]{double.class, double.class});
lib.markStateDependent("ramp", new Class[]{double.class, double.class});
... | 1 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jSplitPane1 = new javax.swing.JSplitPane();
jPanelTitre = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jSepar... | 0 |
@Override
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
final String acceptEncoding;
if (request instanceof HttpServletRequest) {
final HttpServletRequest req = (HttpServletRequest)request;
final String contentEncoding = ... | 9 |
private static void showHelp() {
System.out.println("Uso: java Lab09 -i [interface] [-h | -? | -help] [-f archivo_de_destinos]");
System.exit(1);
} | 0 |
public void fighting (Scanner console, Horde currentHorde) {
//Create an array to represent a d6 die, an array to represent a d20 die, and an ArrayList to contain the players' Dodge values.
ArrayList<Integer> sixSide = new ArrayList<Integer>();
for (int s = 1; s < 7; s++) {
sixSide.add(s);
}
ArrayList<I... | 6 |
public String getCode(){
if(type.compareTo("break")==0){
return this.printLineNumber(true) +"goto := " + loop.labelLast + "\n";
}
else{
return this.printLineNumber(true) +"goto := " + loop.labelFirst + "\n";
}
} | 1 |
public static byte[] decodeFromFile( String filename )
{
byte[] decodedData = null;
Base64.InputStream bis = null;
try
{
// Set up some useful variables
java.io.File file = new java.io.File( filename );
byte[] buffer = null;
int length ... | 5 |
public Object[] vertices() {
return verticesToPoints.keySet().toArray();
} | 0 |
private void listCompanyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listCompanyMouseClicked
try
{
try
{
int select = listCompany.getSelectedIndex();
listCompany.setSelectedIndex(select);
String compid = compID.g... | 5 |
@Override
public void run() {
Checker.regenCheck = false;
if (GlobalParams.health < GlobalParams.maxHP) {
while (GlobalParams.health < GlobalParams.maxHP) {
try {
if (!GlobalParams.inBattle) {
GlobalParams.health++;
System.out
.println("Востановленна 1 единица здоровья. У вас "
... | 5 |
public static int selectPort(int excludePort){
//we'll randomly pick one of the server that was not selected previously
int selectedPort = excludePort;
//to avoid getting stuck in the while forever
if (selectedPort == 0){
selectedPort = port[new Random().nextInt(port.length)];
... | 6 |
@Override
public void run() {
System.out.println("Client worker thread (thread id="+Thread.currentThread().getId()+") started");
try {
Random rand = new Random();
// connect to the server
Socket socket = new Socket(BananaBankBenchmark.SERVER_ADDRESS, BananaBankBenchmark.PORT);
System.out.println("C... | 6 |
private void reAllign(int deletedRow)
{
// Navigate through the columns
for (int i = 0; i < GRID_WIDTH; i++)
{
// Navigate through the rows starting at the bottom
for (int j = deletedRow - 1; j > -1; j--)
{
if (grid[i][j] != null)
{
grid[i][j+1].setColor(grid[i][j].getColor());... | 3 |
public void run()
{
if (m_bUpdatesReadyOnAllClients == false)
{
m_bUpdatesReadyOnAllClients = true;
for (int i = 1; i <= m_sessionCount; i++)
{
m_bUpdatesReadyOnAllClients = ((ConsumerClient)m_consumerClientList.get(i - ... | 7 |
public void testCode() {
int count = 0;
do {
count++;
TaskManager.DoTask(new SimpleAbstractTask("MESSAGE TASK") {
/**
*
*/
private static final long serialVersionUID = -354957472036892394L;
@Override
public synchronized void executeTask() {
for (int i = 0; i < 1; i++) {
... | 7 |
private void doAesthetics() {
setSize(new Dimension(800, 800));
setResizable(false);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setLayout(new BorderLayout());
doMenubar();
mainPanel.setLayout(new BorderLayout());
... | 0 |
void writeTable(String name) {
PrintStream output;
output = null;
try {
String sep;
sep = "";
output = new PrintStream(name + ".db");
for (int i = 0; i < _columnTitles.length - 1; i++) {
output.append(_columnTitles[i]).append(",");
... | 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 |
protected void setLabel(String label) {
myLabel = label;
} | 0 |
public ArrayList<Kamprapport> lavSpillePlan(ArrayList<Klub> holdListe) {
kampe = new ArrayList<>();
ArrayList<Kamprapport> frieKampe = new ArrayList<>();
for (int i = 0; i < holdListe.size(); i++) {
for (int j = i + 1; j < holdListe.size(); j++) {
frieKampe.add(new K... | 7 |
public static String lonToPrintable(Double lon) {
if (lon == null) {
return "N/A";
}
String ns = "E";
if (lon < 0) {
ns = "W";
lon *= -1;
}
int hours = (int)lon.doubleValue();
lon -= hours;
lon *= 60;
String lonStr = String.format(Locale.US, "%3.3f", lon);
while (lonStr.indexOf('.') < 2) ... | 3 |
@Override
public Object getTransferData(final java.awt.datatransfer.DataFlavor flavor)
throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException {
// Native object
if (flavor.equals(DATA_FLAVOR))
return fetcher == null ? data : fetcher.g... | 4 |
public BufferedImage readImage() {
Logger.getLogger(ImageReader.class.getName()).entering(ImageReader.class.getName(), "readImage");
Logger.getLogger(ImageReader.class.getName()).log(Level.FINE, "Searching imageObject type : {0}", imageObject.getClass().getName());
if (image != null) {
... | 9 |
public Boolean comingFrom(int position) {
int firstAfter = transcript.isStrandPlus() ? transcript.firstExonPositionAfter(position) : transcript.lastExonPositionBefore(position);
int lastBefore = transcript.isStrandPlus() ? transcript.lastExonPositionBefore(position) : transcript.firstExonPositionAfter(p... | 2 |
public int tLineCode(){
int count = item.tLineCount() + 1;
ArgumentListExpression itemsList = this.items;
if(itemsList != null)
count += itemsList.tLineCode();
return count;
} | 1 |
public static boolean isTypeDate(Class<?> type) {
return (java.util.Date.class.isAssignableFrom(type) && !(java.sql.Date.class.isAssignableFrom(type)
|| java.sql.Time.class.isAssignableFrom(type) || java.sql.Timestamp.class.isAssignableFrom(type)));
} | 4 |
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.