text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setZhishus(Iterator<Element>tempit,WeatherInfo tempweather){
Element tempElement,tempElement2;
Iterator<Element>tempit2;
Zhishu zhishu=new Zhishu();
int i=0,j;
while(tempit.hasNext()){
tempElement=tempit.next();
tempit2=tempElement.elementIterator();
j=0;
while(tempit2.hasNext()){
... | 5 |
public static void main(String[] args) {
// 利用抽象工厂,new一个具体工厂,获取具体的产品
Driver driver = new BenzDriver();
Car car = driver.driverCar();
// 利用抽象的产品,根据具体产品进行生产
car.driver();
} | 0 |
@Override
public boolean doSmall() {
if (!options.useOtherHouse.get() && script.houseTask.getHouseLocation() != HouseTask.HouseLocation.YANILLE) {
script.log.info("House not in yanille");
return false;
} else {
options.status = "Walking to yanille bank";
final Tile smallRandom = locationAttribute.getSm... | 5 |
public Level getLogLevel() {
return this.level;
} | 0 |
public String getName() {
return name;
} | 0 |
public void commit() throws IOException {
//write all uncommited free records
Iterator<Long> rowidIter = freeBlocksInTransactionRowid.iterator();
Iterator<Integer> sizeIter = freeBlocksInTransactionSize.iterator();
PageCursor curs = new PageCursor(_pageman, Magic.FREEPHYSIDS_PAGE);
//iterate over filled pag... | 9 |
public static InformationUsageEnum fromValue(String v) {
for (InformationUsageEnum c : InformationUsageEnum.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} | 2 |
public String compress(String toBeCompressed){
int length = toBeCompressed.length();
ArrayList<Tag> ret = new ArrayList<>();
Tag tempTag , charTag;
for(int i = 0 ; i < length; i++){//main loop ->
charTag = new Tag(0,0,toBeCompressed.charAt(i));
for(int j = i -1 ;... | 6 |
private static int findminimumgreedyscorefortailvertex(int tailvertex) {
// TODO Auto-generated method stub
int temp = 0;
for(int j = 0 ; j<graph.get(tailvertex).size();j++){
if(!(exploredarray.contains(graph.get(tailvertex).get(j)))){
temp = pathlength[tailvertex] + edgewieght[tailvertex][graph.ge... | 3 |
private static int findMedian(int[] a, int lo, int hi) {
int mid_ind = (hi + lo) / 2;
/*System.err.println("------------------");
for (int i = 0; i < a.length; i++) {
System.err.print(a[i] + " ");
}
System.err.println();
System.err.println(" {" + lo + " " + mid_ind + " " + hi + "}");*/
int re... | 8 |
public Fenetre(final ActionsClientMessagerie irc) {
this.irc = irc;
// Initialisation de la fenêtre
this.setTitle("Messagerie instantanée");
this.setSize(400, 700);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
panel.setBackground(C... | 5 |
private static void generateTestCases(){
firstNumbers = new ArrayList<int[]>();
secondNumbers = new ArrayList<int[]>();
bases = new ArrayList<Integer>();
// you can change the bases here
int [] basesArray = {2,10,17};
int [] firstNum;
int [] secondNum;
int [] zero = {0};
Random rand = new Random... | 7 |
@Override
public void start() {
if (this.mcApplet != null) {
this.mcApplet.start();
return;
}
} | 1 |
public boolean sign_in(String username, String password) {
BasicDBObject query = new BasicDBObject("username", username);
DBCursor the_row = getTable("User").find(query);
// System.out.println(the_row.toArray());
ArrayList row_list = (ArrayList) the_row.toArray();
if (row_list.isEmpty())
return false;
S... | 8 |
void handleWrite() {
if (queue.isEmpty() && outgoing == null) {
key.interestOps(SelectionKey.OP_READ);
return;
}
try {
if (outgoing == null) {
Queued b = (Queued) queue.pop();
ByteBuffer[] msg = b.getMsg();
... | 9 |
@SuppressWarnings("deprecation")
private void placeMushroomTree(World world, int x, int y, int z, Random rand)
{
boolean brownTree = rand.nextBoolean();
if(brownTree)
{
int height = rand.nextInt(3)+5;
for(int y2 = 0; y2 < height; y2++)
{
setBlockWithData(world, x, y+y2, z, Material.HUGE_MUSHROOM_1.... | 8 |
public EncryptionMethodType createEncryptionMethodType() {
return new EncryptionMethodType();
} | 0 |
void fireStart(ComponentAccess w) {
if (shouldFire) {
fire(Type.EXECUTING, new ComponentEvent(c, w.getComponent()));
}
} | 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 feel.
* For details see http://down... | 6 |
/* */ @EventHandler
/* */ public void onInventoryClose(InventoryCloseEvent event)
/* */ {
/* 319 */ if (!(event.getPlayer() instanceof Player))
/* */ {
/* 321 */ return;
/* */ }
/* */
/* 325 */ Player p = (Player)event.getPlayer();
/* */
/* 327 */ if (Main.g... | 3 |
public void positionAnywhereIn(GameObject go) {
if(this.getSize().width > go.getSize().width || this.getSize().height > go.getSize().height){
throw new IllegalArgumentException("GameObject is bigger than the passed GameObject");
}else{
Random generator = new Random();
int xOffset = generator.nextInt(go.get... | 2 |
@Test
public void test2() {
System.out.println("Test avec l'init avec 1 argument et tous les états possibles");
System.out.println("Tests de couverture des post-conditions d'init");
for(BlocType b : BlocType.values()) {
bloc2.init(b);
assertTrue("type initial Fail",bloc2.getType()==b);
assertTrue("power... | 3 |
public BinaryTime() {
setLayout(new BorderLayout(0, 0));
timer.start();
JButton btnBack = new JButton("BACK");
btnBack.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
MainFrame.cardLayout.show(getParent(), "startScreen");
}
});
add(btnBack, BorderLayout.SOUTH)... | 0 |
public boolean isValidFor(SeedNode node) {
if (node.x < Consts.SEED_RADIUS - Consts.EPSILON || node.x > width - (Consts.SEED_RADIUS - Consts.EPSILON) || node.y < Consts.SEED_RADIUS - Consts.EPSILON || node.y > height - (Consts.SEED_RADIUS - Consts.EPSILON))
return false;
for (Location tree : trees) {
if (L... | 9 |
public void testKeySetRemoveAllTCollection() {
int[] keys = {1138, 42, 86, 99, 101, 727, 117};
long[] vals = new long[keys.length];
TIntLongMap map = new TIntLongHashMap();
for ( int i = 0; i < keys.length; i++ ) {
vals[i] = keys[i] * 2;
map.put( keys[i], vals[i]... | 7 |
public void requestPlayCard(Card card) {
if (playRequest == null && this.canPlay(card)) {
playRequest = card;
}
} | 2 |
public void setSuccess(String success) {
this.success = success;
} | 0 |
public XMLMenu() {
JMenu menu;
JMenuItem item;
menu = new JMenu("Arquivo");
item = new JMenuItem("Criar");//arquivo
item.addMouseListener(new MouseAdapter() {
String nome_da_pasta = "Novo Arquivo";
@Override
public void mousePressed(MouseEve... | 4 |
@Override
public Class<?> getColumnClass(int index) {
return index == 0 ? Icon.class : String.class;
} | 2 |
private boolean checkValid20() {
if ((inChar8[0]==false)&&(inChar8[6]==true)&&(inChar8[7]==true)&&(bcount>=8)) return true;
else return false;
} | 4 |
protected String checkMap(int paramInt1, int paramInt2)
{
if (this.ImageMap != null)
{
Enumeration localEnumeration = this.ImageMap.keys();
Object localObject = null;
int i = 0;
while ((localEnumeration.hasMoreElements()) && (i == 0))
{
localObject = localEnumeration.next... | 8 |
@Override
public List<Consulta> listPorDate(Date data) {
Connection con = null;
PreparedStatement pstm = null;
ResultSet rs = null;
List<Consulta> consultas = new ArrayList<>();
try {
con = ConnectionFactory.getConnection();
pstm = con.prepareStateme... | 3 |
private static void buildFromScratch() {
for (int i = 2; i <= 365994; i++) {
lookup(i);
}
save();
} | 1 |
public static String[][] parse(String s) throws IOException {
if (s == null) {
throw new IllegalArgumentException("Null argument not allowed.");
}
String[][] result = (new CSVParser(new StringReader(s), CSVStrategy.DEFAULT_STRATEGY)).getAllValues();
if (result == null) {
... | 2 |
public String downloadUrl(String filename, String urlString) {
BufferedInputStream in = null;
FileOutputStream fout = null;
HttpURLConnection connection = null;
String md5 = "";
try {
URL url_ = new URL(urlString);
byte data[] = new byte[1024];
connection = (HttpURLConnection) url_.openConnec... | 8 |
public void setName(String name) {
this.name = name;
} | 0 |
@Test
public void test() {
Vote fetchedVote = (Vote) MongoHelper.fetch(vote, "votes");
if(fetchedVote == null)
TestHelper.failed("vote not found");
fetchedVote.setOptionID(new Integer(5));
if(!MongoHelper.save(fetchedVote, "votes")){
TestHelpe... | 2 |
public SHSMemberEntity() {
setId(System.nanoTime());
} | 0 |
public static double getSilhouette(Dataset trainingSet, ArrayList<ArrayList<Integer>> clusters, double[][] distance, int VERBOSE) {
int logFlag = Constants.LOG_SILHOUETTE;
/** initial phase **/
// build an inverted index of cluster assg, i.e., clusterAssignment[objectNo] = clusterId;
int[] clusterAssignment = n... | 6 |
public Shader(String name)
{
this.shader = ARBShaderObjects.glCreateProgramObjectARB();
if (this.shader != 0) {
this.vertShader = createVertShader("/shader/" + name + ".vert.txt");
this.fragShader = createFragShader("/shader/" + name + ".frag.txt");
} else {
this.useShader = false;
}... | 5 |
public static Class<? extends CTFSession> getSession(String name) {
for (Class<? extends CTFSession> cls : sessionTypes) {
if (cls.getSimpleName().equalsIgnoreCase(name)) {
return cls;
}
}
return null;
} | 4 |
@Override
public String getIpdbserver() {
return ipdbserver;
} | 0 |
public static String filter(String str) {
String output = "";
StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length(); i++) {
int asc = str.charAt(i);
if (asc != 10 && asc != 13) {
sb.append(str.subSequence(i, i + 1));
}
}
output = new String(sb);
return output;
} | 3 |
public void animateEntity(Entity entity, int x, int y)
{
// this.game.stroke(0, 0, 255);
// this.game.rect(x * this.game.c_tilesize, y * this.game.c_tilesize, this.game.c_tilesize,
// this.game.c_tilesize);
// moving
if (entity.busy > 0 && entity.center < 2)
{
entity.xold = x - entity.dx;
entity.yol... | 2 |
public static void avlToFile(AVL avl, Path file, Path origin) throws IOException {
FileOutputStream fos = new FileOutputStream(file.toFile());
avl.getGeometry().writeAVLData(fos);
fos.close();
String fileMassPath = file.toString().replace(".avl", ".mass");
File fileMass = new Fi... | 7 |
public AngleDR Ampqk(AngleDR ap, AMParams amprms) {
double gr2e; /* (grav rad Sun)*2/(Sun-Earth distance) */
double ab1; /* sqrt(1-v*v) where v=modulus of Earth vel */
double ehn[] = new double[3]; /* Earth position wrt Sun (unit vector, FK5) */
double abv[] = new double[3]; /* Earth vel... | 8 |
public void setPowered(boolean a){
powered = a;
} | 0 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
} | 1 |
public void checkCollision(){
if(player1.getArrX()[0]==player2.getArrX()[0] && player1.getArrY()[0]==player2.getArrY()[0]) {
snake1Alive=false;
snake2Alive=false;
}
else{
for(int i = 0; i<player2.getSize(); i++) {
if(player1.getArrX()[0]==player2.getArrX()[i] && player1.getArrY()[0]==player2.getArrY(... | 9 |
protected boolean orderConnections(NeuralNetwork neuralNetwork, Layer currentLayer, Set<Layer> calculatedLayers, Set<Layer> inProgressLayers, List<ConnectionCandidate> calculateCandidates) {
boolean result = false;
if (calculatedLayers.contains(currentLayer) || Util.isBias(currentLayer)) {
result = true;
} els... | 8 |
@Test
public void testRemoveAnt() throws IOException {
System.out.println("removeAnt");
Cell instance = new Cell(0,0);
AntBrain ab = new AntBrain("cleverbrain1.brain");
Ant ant = new Ant(ab, true, 0);
instance.setAnt(ant);
instance.removeAnt();
Ant e... | 0 |
public String getNextComponent(Identifier ident) {
String prefix = ident.getFullName();
if (prefix.length() > 0)
prefix += ".";
int lastDot = prefix.length();
if (!wildcard.startsWith(prefix))
return null;
int nextDot = wildcard.indexOf('.', lastDot);
if (nextDot > 0 && (nextDot <= firstStar || firs... | 6 |
@Override
public void handlePeerReady(SharingPeer peer) { /* Do nothing */ } | 0 |
IntIterator getReverse(int key) {
int bucket = key % buckets;
if(bucket < 0) {
bucket = -bucket;
}
int[] data = content[bucket];
if(data == null) {
return IntIterator.EMTPY_ITERATOR;
}
else {
//return new IntIterator(data, key);
iterator.data = data;
iterator.offset = data[0] * 2 + 1;
i... | 2 |
private static boolean method518(char c) {
return c < 'a' || c > 'z' || c == 'v' || c == 'x' || c == 'j'
|| c == 'q' || c == 'z';
} | 6 |
private void writeObjectDictionary(Dictionary obj) throws IOException {
logger.log(Level.FINER, "writeObjectDictionary() obj: {0}", obj);
if (obj == null)
throw new IllegalArgumentException("Object must be non-null");
Reference ref = obj.getPObjectReference();
logger.log(Lev... | 3 |
private static List<Appointment> findMonthlyByDaySpan(long uid,
long startDay, long endDay) throws SQLException {
List<Appointment> aAppt = new ArrayList<Appointment>();
PreparedStatement statement = null;
// select * from Appointment where frequency = $MONTHLY
// and startTime <= $(endDay + DateUtil.DAY_LEN... | 2 |
public void getSuggestions(ArrayList<ISuggestionWrapper> suggestions) {
ArrayList<SuggestionCacheWrapper<IDocument>> cachedSuggestions = queryPosition.getCachedSuggestions();
for (SuggestionCacheWrapper<IDocument> suggestion : cachedSuggestions){
double suggestionRank = suggestion.getRank() ... | 5 |
public Value pop() throws IndexOutOfBoundsException {
if (top == 0) {
throw new IndexOutOfBoundsException(
"Cannot pop operand off an empty stack.");
}
return values[--top + locals];
} | 1 |
private boolean needEvents(int count) {
int level = 0;
Iterator<Event> iter = events.iterator();
iter.next();
while (iter.hasNext()) {
Event event = iter.next();
if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
le... | 7 |
private final boolean prepareWriteBuffer(final MMOConnection<T> con)
{
boolean hasPending = false;
DIRECT_WRITE_BUFFER.clear();
// if there is pending content add it
if (con.hasPendingWriteBuffer())
{
con.movePendingWriteBufferTo(DIRECT_WRITE_BUFFER);
hasPending = true;
}
if ((DIRECT_WRITE_BU... | 7 |
public void insert(Symbol sy) throws ParseException {
if(containsLocal(sy)) {
throw new SemanticException(sy, "Symbol is already defined in scope " + identName);
}
switch(sy.kind) {
case constKind:
// is constant
nrOfConstants++;
break;
case funcKind:
// is function
nrOfFunctions++;
... | 8 |
public String getStateDescription(State state)
{
/*
* If the output has not been set i.e. this is a brand new state
* before the user has entered a state output, then an
* empty string shows up instead of lamba. It is purely cosmetic.
*/
if(myMap.get(state) == nul... | 2 |
static boolean matchStr(String str, String pat, String matches[]) {
int i = 0; // move through str
int j = 0; // move through matches
int pos = 0; // move through pat
// System.out.println("Inside matchStr :\n");
// System.out.print("Strlen of str,pat,match="+str.length... | 9 |
public Command getCommand(char currentOperator){
Command command;
switch (currentOperator){
case BrainFuckConstants.SHIFT_RIGHT: command = new ShiftRight();
break;
case BrainFuckConstants.SHIFT_LEFT: command = new ShiftLeft();
break;
c... | 7 |
public static byte[] decrypt(byte[] data, byte[] key) {
byte[] tmp = new byte[data.length];
byte[] bloc = new byte[16];
key = paddingKey(key);
S = generateSubkeys(key);
int i;
for(i=0;i<data.length;i++){
if(i>0 && i%16 == 0){
bloc = decryptBloc(bloc);
System.arraycopy(bloc, 0, tmp, i-16, bloc.le... | 4 |
public void create(Roles roles) throws PreexistingEntityException, RollbackFailureException, Exception {
if (roles.getEmpleadoCollection() == null) {
roles.setEmpleadoCollection(new ArrayList<Empleado>());
}
EntityManager em = null;
try {
em = getEntityManager();
... | 7 |
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... | 8 |
private String requestInput(String Prompt) {
String r = "";
while (r.isEmpty()) {
r = console.readLine("%s: ", Prompt);
if (r.isEmpty()) {
console.printf("%s", "Please provide an answer!\n");
}
}
return r;
} | 2 |
public void read(Reader reader, ParserHandler handler) throws IOException, ParseException {
StringBuffer buffer = new StringBuffer();
int c = reader.read();
while (c != -1) {
buffer.append((char) c);
if (c == separator) {
boolean shallContinue =
... | 3 |
@Override
protected boolean onCache(ByteBuffer buffer)
{
// If the buffer doesn't have the same buffer size or the buffer
// is not a DirectByteBuffer then return.
if (buffer.capacity() != maxSize || !buffer.isDirect()) {
return false;
}
stack.push(buffer);
return true;
} | 2 |
private void handlePointMovement(Point draggedPoint) {
if (selectedPoint != -1) {
selectedCurve.setPoint(selectedPoint, draggedPoint);
selectedCurve.updateBezierPoints();
Main.state = State.Drawing;
}
} | 1 |
private void writeTile(Tile tile, XMLWriter w) throws IOException {
w.startElement("tile");
w.writeAttribute("id", tile.getId());
writeProperties(tile.getProperties(), w);
if (tile instanceof AnimatedTile)
writeAnimation(((AnimatedTile)tile).getSprite(), w);
w.endE... | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Participant that = (Participant) o;
if (email != null ? !email.equals(that.email) : that.email != null) return false;
if (name != null ? !name.... | 7 |
public void decoder(int[] octets_data){
if (taille == 7){
//System.out.println("DEplacement1 cr��");
positionXhigh = octets_data[0];
positionXlow = octets_data[1];
positionX = ((positionXhigh<<8) + positionXlow);
positionYhigh = octets_data[2];
positionYlow = octets_data[4];
positionY... | 1 |
private void startGame(){
//starts the mechanics iterator
gameServer = new Server();
gameServer.run();
ObjectInputStream objInStream = null;
try{
//wait for the server to settle
Thread.sleep(1000);
//initialize tcp connection
sock = new Socket("localhost", 1337);
//set receive buffer siz... | 1 |
public int getId() {
return id;
} | 0 |
public boolean addCoefDecalage(String name, BigDecimal coefficient, BigDecimal gap) {
if (name != null && !name.equals("") && !this.existInList(name) && coefficient != BigDecimal.ZERO && this.coefficientList != null) {
Unit unit = new Unit(name, coefficient, gap, false);
this.coefficient... | 5 |
@Override
public void cadastarIntNota(ItensNota intensNot) throws ClassNotFoundException, SQLException,Exception {
dados.cadastarIntNota(intensNot);
if(intensNot.getQtdComprada()<=0){
throw new ItensNotaException("Quantidade Comprada nao pode ser menor ou igual zero");
}
if(intensN... | 3 |
private void setButtonMode (Integer bm) {
if (bm == 0) {
okButton.setEnabled(false);
cancelButton.setEnabled(false);
copyButton.setEnabled(true);
deleteButton.setEnabled (true);
editButton.setEnabled(true);
newButton.setEnabled(true);
}
if (bm == 1) {
okButton.setEnabled(true);
... | 2 |
public static boolean analysisNSMJ(AnalysisOutput o, List<AnalysisOutput> candidates) throws MorphException {
int idxVbSfix = VerbUtil.endsWithVerbSuffix(o.getStem());
if(idxVbSfix==-1) return false;
o.setVsfx(o.getStem().substring(idxVbSfix));
o.setStem(o.getStem().substring(0,idxVbSfix))... | 9 |
private final boolean cons(int i){
switch (b[i])
{
case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
}
} | 7 |
public static ByteToMessageDecoder createProtocolHandler(int protocolVersion)
{
if (protocolVersion == 4 || protocolVersion == 5)
return new MC1_7Handler();
if (protocolVersion == 47)
return new MC1_8Handler();
return null;
} | 3 |
private boolean _jspx_meth_c_choose_0(PageContext _jspx_page_context)
throws Throwable {
PageContext pageContext = _jspx_page_context;
JspWriter out = _jspx_page_context.getOut();
// c:choose
org.apache.taglibs.standard.tag.common.core.ChooseTag _jspx_th_c_choose_0 = (org.apache.taglibs.stand... | 6 |
Speed(long delay) {
this.delay = delay;
} | 0 |
@Override
public int compare(GenericEdge o1, GenericEdge o2) {
if(o1.getAttribute().getValue() < o2.getAttribute().getValue()){
return -1;
}
if(o1.getAttribute().getValue() > o2.getAttribute().getValue()){
return 1;
}
return 0;
} | 2 |
public static Method findMethod(Class target_class, String method_name, Object[] args) throws Exception {
int len=args != null? args.length : 0;
Method retval=null;
Method[] methods=getAllMethods(target_class);
for(int i=0; i < methods.length; i++) {
Method m=methods[i];
... | 9 |
public int escribir(String nombre, String rutaArchivo) {
InputStream entrada = null;
PreparedStatement pst = null;
int ingresados = 0;
try {
File archivo;
String insert;
z.con.setAutoCommit(false);
insert = "Insert into docu... | 7 |
protected void setDirection(String newDirection, int tape) {
if (!(newDirection.equals("L") || newDirection.equals("R") || newDirection
.equals("S")))
throw new IllegalArgumentException("Direction must be L, R, or S!");
direction.set(tape, newDirection);
} | 3 |
@Override
public void doLoopAction() {
if (hit) {
//super.ai();
}
if (changeAni) {
setAnimation();
changeAni = false;
}
} | 2 |
public final void run() {
anInt4553++;
for (;;) {
int i;
synchronized (this) {
for (;;) {
if (ioexception != null)
return;
if ((anInt4556 ^ 0xffffffff) != -1) {
if (anInt4556 < anInt4558)
i = -anInt4558 + bufferSize;
else
i = -1 + anInt4556 - anInt4558;
} else
i... | 9 |
public void confirmApplication(Application a) {
employs.base().incCredits(0 - a.hiringFee()) ;
final Actor works = a.applies ;
//
// TODO: Once you have incentives worked out, restore this-
//works.gear.incCredits(app.salary / 2) ;
//works.gear.taxDone() ;
works.setVocation(a.position) ;
... | 4 |
public void drawWave2Text(int x, String text, int effectSpeed, int y, int color) { // method387
if (text == null) {
return;
}
x -= getANTextWidth(text) / 2;
y -= trimHeight;
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c != ' ') {
drawChar(pixels[c], x + horizontalKernin... | 3 |
@Override
public void run() {
for (int i = this.nTimes + (this.nTimes == 0 ? 0 : 1); i != 1; i--) {
long t = (long) (Math.random() * thinkMillis);
System.out.println("Philosopher " + id + " thinks for " + t + " time units.");
try {
Thread.sleep(t);
... | 8 |
public String getName()
{
return nameLabel.getText();
} | 0 |
@Override
public void endElement( final String namespace_uri, final String local_name, final String qualified_name )
throws SAXException {
if ( ForesterUtil.isEmpty( namespace_uri ) || namespace_uri.startsWith( ForesterConstants.PHYLO_XML_LOCATION ) ) {
if ( local_name.equals( TolXml... | 9 |
public double lloydPlusPlus(int k, int n, int d, Point points[]) {
//System.out.println("starting kMeans++");
//choose random centres
this.tmpCentresStreamingCoreset = chooseRandomCentres(k, n, d, points);
double cost = targetFunctionValue(k, n, this.tmpCentresStreamingCoreset, points);
... | 9 |
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... | 6 |
public void setImage(File image) {
this.image = image;
} | 0 |
public void initTable() {
tableModel.addTableModelListener(deckTable);
deckTable.setRowSelectionAllowed(true);
deckTable.getTableHeader().setReorderingAllowed(false);
//deckTable.setRowSorter(sorter = new TableRowSorter<DeckTableModel>(tableModel));
//sorter.setSortsOnUpdates(tru... | 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.