public static String prettyPrintSequenceRecords(SAMSequenceDictionary sequenceDictionary) { String[] sequenceRecordNames = new String[sequenceDictionary.size()]; int sequenceRecordIndex = 0; for (SAMSequenceRecord sequenceRecord : sequenceDictionary.getSequences()) sequenceRecordNames[sequenceRecordIndex++] = sequenceRecord.getSequenceName(); return Arrays.deepToString(sequenceRecordNames); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append("{firstBound=").append(firstBound()); sb.append(", interfaceBounds=").append(Arrays.deepToString(interfaceBounds())); sb.append('}'); return sb.toString(); }
public static void main(String[] args) { Random rand = new Random(47); // 3-D array with varied-length vectors: int[][][] a = new int[rand.nextInt(7)][][]; for (int i = 0; i < a.length; i++) { a[i] = new int[rand.nextInt(5)][]; for (int j = 0; j < a[i].length; j++) a[i][j] = new int[rand.nextInt(5)]; } System.out.println(Arrays.deepToString(a)); }
public static void applyShape( IShape shape, EntityPlayer player, ArrayList<NBTTagCompound> blockDataNbtList, byte baseRotation) { try { ArrayList<BlockData> blockDataList = new ArrayList<>(); for (NBTTagCompound compound : blockDataNbtList) { BlockData blockData = new BlockData(compound); for (int i = 0; i <= blockData.weight; i++) blockDataList.add(blockData); } int x = Helper.round(player.posX), y = Helper.round(player.posY + 1), z = Helper.round(player.posZ); Collection<PointI> points = shape .rotate(baseRotation) .rotate(baseRotation == -1 ? -1 : Helper.getHeading(player)) .move(x, y, z) .getPoints(); for (PointI p : points) { if (!shape.getReplaceableOnly() || player .worldObj .getBlock(p.getX(), p.getY(), p.getZ()) .isReplaceable(player.worldObj, p.getX(), p.getY(), p.getZ())) { BlockData block = blockDataList.size() == 1 ? blockDataList.get(0) : Helper.getRandomFromSet(blockDataList); Block block1 = Block.getBlockById(block.id); player.worldObj.setBlock(p.getX(), p.getY(), p.getZ(), block1, block.meta, 2); if (block.te != null) { TileEntity tileEntity = TileEntity.createAndLoadEntity(block.te); tileEntity.setWorldObj(player.worldObj); tileEntity.xCoord = p.getX(); tileEntity.yCoord = p.getY(); tileEntity.zCoord = p.getZ(); player.worldObj.setTileEntity(p.getX(), p.getY(), p.getZ(), tileEntity); } } } } catch (BlockData.BannedBlockException e) { ((EntityPlayerMP) player).playerNetServerHandler.kickPlayerFromServer(e.getMessage()); } catch (Exception e) { e.printStackTrace(); Pay2Spawn.getLogger().warn("Error spawning in shape."); Pay2Spawn.getLogger().warn("Shape: " + shape.toString()); Pay2Spawn.getLogger().warn("Player: " + player); Pay2Spawn.getLogger() .warn("BlockData array: " + Arrays.deepToString(blockDataNbtList.toArray())); } }
public String[] authenticate(final String username, final char[] password) { log(FINEST, "Authenticating user {0}", username); final boolean authenticated = hasValidCredentials(username, password); final String[] groups = authenticated ? convertToArray(getGroups(username)) : null; log( FINEST, "User {0}, authenticated {1} has groups {2}", username, authenticated, Arrays.deepToString(groups)); return groups; }
public static void main(String[] args) { BerylliumSphere[][] spheres = { {new BerylliumSphere(), new BerylliumSphere()}, { new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere() }, { new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere(), new BerylliumSphere() }, }; System.out.println(Arrays.deepToString(spheres)); }
public DLDFSolver( int[] s, int[] learning_startfactors, boolean singleThreaded, boolean useBacktracking) { log_info("Heuristic weights: %s", Arrays.deepToString(choicefactors)); log_info("Reported number of processors: %d", Runtime.getRuntime().availableProcessors()); nThreads = (singleThreaded || THREAD_COUNT == 1) ? 1 : THREAD_COUNT; log_info("No. of threads to be used: %d\n", nThreads); this.useBacktracking = useBacktracking; log_info("Use backtracking?: %s", useBacktracking ? "Yes" : "No"); this.tileSequence = new int[s.length]; System.arraycopy(s, 0, this.tileSequence, 0, s.length); if (learning_startfactors != null) { if (learning_startfactors.length != learning_starts.length) { throw new IllegalArgumentException("Invalid learning factor size"); } System.arraycopy(learning_startfactors, 0, learning_starts, 0, learning_starts.length); } }
public static void load(String libDir, String mainClass, String[] args) throws Exception { Iterable<File> it = new FileIterator(libDir); List<URL> jars = new ArrayList<URL>(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); for (File f : it) { if (f.isDirectory()) { continue; } if (f.getName().toLowerCase().endsWith(".jar")) { System.out.println( "add " + f.getAbsolutePath() + " \t " + sdf.format(new Date(f.lastModified()))); jars.add(f.toURI().toURL()); } } System.out.println( "jar cnt=" + jars.size() + " run " + mainClass + " " + Arrays.deepToString(args)); new URLClassLoader(jars.toArray(new URL[jars.size()]), Loader.class.getClassLoader()) .loadClass(mainClass) .getMethod("main", new Class[] {String[].class}) .invoke(null, new Object[] {args}); }
private void debug(Object... os) { System.out.println(Arrays.deepToString(os)); }
static void debug(Object... os) { if (!DEBUG) { return; } System.err.printf("%.65536s\n", Arrays.deepToString(os)); }
void pr(Object... ob) { if (!oj) System.out.println(Arrays.deepToString(ob).replace("],", "],\n")); }
static void debug(Object... os) { System.err.printf("%.65536s\n", Arrays.deepToString(os)); }
static void trace(Object... o) { System.out.println(Arrays.deepToString(o)); }
private static void print(Object... rs) { System.err.println(Arrays.deepToString(rs).replace("]", "]\n")); }
static void dump(Object... o) { if (debug) System.err.println(Arrays.deepToString(o)); }
void debug(Object... os) { System.err.println(Arrays.deepToString(os)); }
public void debug(Object... o) { System.err.println(Arrays.deepToString(o)); }
public static void px(Object... l1) { System.out.println(Arrays.deepToString(l1)); }
public static void main(String[] args) { // 3-D array with fixed length: int[][][] a = new int[2][2][4]; System.out.println(Arrays.deepToString(a)); }