text stringlengths 14 410k | label int32 0 9 |
|---|---|
public int getAge() {
return age;
} | 0 |
public int getNumBuffers() {
return numBuffers;
} // end getNumBuffers() | 0 |
public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... | 7 |
public static int findNumInRotatedArray(int[] array, int num) {
int low = 0;
int high = array.length - 1;
int mid;
while (low <= high) {
mid = (low + high) / 2;
if (array[mid] == num) {
return mid;
} else if (array[mid] > num) {
if ((array[low] > array[mid])
|| (array[low] < array[mid]... | 9 |
private static int play() {
/**
* Get a new deck of cards, and store a reference to it
* in the variable <code>deck</code>
*/
Deck deck = new Deck();
/**
* @param currentCard the current card, which user sees
*/
Card currentCard;
... | 9 |
public static boolean wordBreak(String s, Set<String> dict){
if(s==null||s.length() == 0){
return true;
}
boolean[][] resultHash = new boolean[s.length()][s.length()];
for(int len = 0;len<s.length();len++){
for(int i=0;i<s.length();i++){
if(i+len<s... | 9 |
@Override
public boolean init(List<String> argumentList, DebuggerVirtualMachine dvm) {
variablesWithOffsets = new LinkedHashMap<String, Integer>();
variablesWithNewValues = new HashMap<String, Integer>();
variableValues = new ArrayList<Integer>();
if (argumentList.size() % 2 != 0) {... | 9 |
@Test
public void testLastVisitedSelection() throws BadConfigFormatException {
// 3 possible targets one step from 5,8
ComputerPlayer player = new ComputerPlayer("test","yellow",board.getCellAt(board.calcIndex(5, 8)));
player.setLastVisited('m');
// Pick a location with last visited room in target, just three ... | 4 |
public boolean isEatable() {
return true;
} | 0 |
public static void main(String[] args) {
Locale.setDefault(Locale.US);
Scanner s = new Scanner(System.in);
String op = s.nextLine();
double sum = 0;
for(int i = 0; i <= 5; i++){
for(int j = 0; j < 12-i; j++){
s.nextDouble();
}
... | 7 |
@Override
public boolean isValid(LoginCredential loginCredential)
{
try
{
CryptedInputStream cryptedInputStream = new CryptedInputStream(new FileReader("crypted_" + loginCredential.getUserName() + ".txt"));
int character;
String cryptedPassword = "";
while ((character = cryptedInputStream.r... | 3 |
public int getLineCountOffset() {return this.lineCountOffset;} | 0 |
public void test_05_fastqReader() {
String fastqFileName = "tests/fastq_test.fastq";
String txtFileName = "tests/fastq_test.txt";
// Read fastq file
StringBuilder sb = new StringBuilder();
for( Fastq fq : new FastqFileIterator(fastqFileName, FastqVariant.FASTQ_ILLUMINA) )
sb.append(fq.getSequence() + "\t"... | 3 |
public static void combinationsCounter(int n, int k, int[] indexes, int d) {
int i, iMin;
if (d < k) {
if (d == 0) {
iMin = 1;
} else {
iMin = indexes[d-1];
}
for (i = iMin; i < n; i++) {
indexes[d] = i;
... | 5 |
public SignatureVisitor visitExceptionType() {
if (state != RETURN) {
throw new IllegalStateException();
}
SignatureVisitor v = sv == null ? null : sv.visitExceptionType();
return new CheckSignatureAdapter(TYPE_SIGNATURE, v);
} | 2 |
public void maskRect(int x, int y, int w, int h, byte[] pix, byte[] mask) {
int maskBytesPerRow = (w + 7) / 8;
int stride = getStride();
for (int j = 0; j < h; j++) {
int cy = y + j;
if (cy >= 0 && cy < height_) {
for (int i = 0; i < w; i++) {
int cx = x + i;
if (cx >... | 7 |
public void setToZeroPosition(){
for (int i = 0; i < beings.size(); i++){
beings.get(i).setPosition(zeroBeings.get(i).getX(), zeroBeings.get(i).getY());
}
} | 1 |
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this,ToStringStyle.MULTI_LINE_STYLE);
} | 0 |
public ByteVector putByte(final int b) {
int length = this.length;
if (length + 1 > data.length) {
enlarge(1);
}
data[length++] = (byte) b;
this.length = length;
return this;
} | 1 |
public int calculateRangeAttack() {
int attackLevel = c.playerLevel[4];
attackLevel *= c.specAccuracy;
if (c.fullVoidRange())
attackLevel += c.getLevelForXP(c.playerXP[c.playerRanged]) * 0.1;
if (c.prayerActive[3])
attackLevel *= 1.05;
else if (c.prayerActive[11])
attackLevel *= 1.10;
... | 6 |
public void InsertarAudio(ArrayList datos)
{
// Cambiamos todos los datos, que se puedan cambiar, a minúsculas
for(int i = 0 ; i < datos.size() ; i++)
{
try{datos.set(i, datos.get(i).toString().toLowerCase());}
catch(Exception e){}
}
biblioteca.inserta... | 2 |
private void initUI() {
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
questions[0] = new Question("File name for text file?", false);
questions[1] = new Question("File name for tilesheet to use?", false);
questions[1].GetTextField().setEditable(false);
questions[1].GetTextField().setText(box.getSelectedNa... | 3 |
public void run() {
Long time = System.currentTimeMillis();
Long sleep = System.currentTimeMillis() - (time+broadcastDelay);
Long threshold;
Set<Byte> keys;
Iterator<Byte> i;
Byte key;
while (true) {
// broadcast
try {
time = System.currentTimeMillis();
// -> networking.Networ... | 7 |
public void setProducts(ArrayList<Product> products, Basket basket) {
if (basket != null) {
for (Product product : products) {
product.setInBasket(basket.isInBasket(product.getId()));
}
}
this.products = products;
removeSoldOutProducts();
} | 2 |
private boolean loadEntities(String pathName, String productFile, String userFile){
boolean rtn = false;
String productPath = confPath + productFileName;
String userPath = confPath + userFileName;
if(pathName != null && pathName.length() != 0){
if(productFile != null && productFile.length() != 0){
produc... | 7 |
protected void processKeyPressed(KeyEvent e) {
if (!editable)
return;
if (selectedElement == null)
return;
int key = e.getKeyCode();
switch (key) {
case KeyEvent.VK_UP:
selectedElement.translateBy(0, -1);
break;
case KeyEvent.VK_DOWN:
selectedElement.translateBy(0, 1);
break;
case KeyEve... | 9 |
private void updateQuadTree() {
q.clear();
for (Mob m : dots) {
q.insert((Collidable)m);
}
// for (Mob m : lines) {
// q.insert((Collidable)m);
// }
for (Mob m : polygons) {
q.insert((Collidable)m);
}
} | 2 |
@Override
//Este metodo permite la eliminacion de un producto de la BBDD
public boolean bajaProducto(int id)
{
boolean correcto=false;
TransactionManager.obtenerInstanacia().nuevaTransaccion();
try
{
//Iniciamos la transsacion y bloqueamos la tabla a mod... | 6 |
private static void displayParams(long[] longValues, double[] doubleValues,
int[] intValues) {
System.out.println("Settings:");
System.out.println(" s: " + longValues[0]);
System.out.println(" t: " + longValues[1]);
System.out.println(" c1: " + doubleValues[0]);
Sy... | 0 |
private BitSet selectImages(String str) {
int n = view.getNumberOfInstances(ImageComponent.class);
if (n == 0)
return null;
BitSet bs = new BitSet(n);
if ("selected".equalsIgnoreCase(str)) {
for (int i = 0; i < n; i++) {
if (view.getImage(i).isSelected())
bs.set(i);
}
return bs;
}
if (s... | 8 |
public Tile getTile(int x, int y) {
if (x < 0 || y < 0 || x >= width || y >= height) return Tile.voidTile;
if (tiles[x + y * width] == Tile.col_spawn_floor) return Tile.spawn_floor;
if (tiles[x + y * width] == Tile.col_spawn_grass) return Tile.spawn_grass;
if (tiles[x + y * width] == Tile.col_spawn_hedge) retur... | 9 |
public byte[] getNextFrame(int length) {
byte[] output = new byte[length];
for (int i = 0; i < length; i++) {
//convert the phase to an index by rounding
int index = Math.round((WaveTable.TABLE_LENGTH - 1) * (phase / TWO_PI));
switch (mode) {
case SI... | 7 |
private static LinkedList createNetworkFlow(BufferedReader buf)
throws Exception
{
if (buf == null) {
return null;
}
// create the Router objects first
LinkedList routerList = createRouter(buf, NetworkReader.FLOW_ROUTER);
... | 6 |
public void construct(int[] treeNodes){
BinaryTree<Integer> root = null;
if(treeNodes[0] != -1) {
root = new BinaryTree<Integer>(treeNodes[0]);
}
Queue<BinaryTree> queue = new LinkedList<BinaryTree>();
queue.add(root);
for(int i = 1; i < treeNodes.length;) {
... | 8 |
public void colorBlack() {
myColor = BLACK;
} | 0 |
@EventHandler(priority = EventPriority.NORMAL)
public void onEntityDamagedDebug(EntityDamageEvent evt)
{
if( !(evt.getEntity() instanceof Player) )
{
return;
}
Player jugador = (Player) evt.getEntity();
SpyAroundHere.logInfo("Entity attacked");
ItemMet... | 4 |
@SuppressWarnings("unchecked")
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// tarkistetaan onko sessioon lisättynä tilausriveja ja haetaan ne
ArrayList<Tilausrivi> tilausrivit = null;
if (request.getSession().getAttribute("tilausriv... | 4 |
protected void drawHorizontal(Graphics2D g2, Rectangle2D area) {
Rectangle2D titleArea = (Rectangle2D) area.clone();
g2.setFont(this.font);
g2.setPaint(this.paint);
TextBlockAnchor anchor = null;
float x = 0.0f;
HorizontalAlignment horizontalAlignment = getHorizontalAlign... | 8 |
public LocalFileSystemFileProtocol() {} | 0 |
protected String getName() {
return name == null ? getClass().getSimpleName() : name;
} | 1 |
private void checkSettings() {
// Check Region Size
Integer regionSize = (Integer)regionSizeComboBox.getSelectedItem();
if(regionSize == null || regionSize == 0){
setError("Region Size cannot be null or zero!");
}
// Build topology
String[] intStrings = topologyField.getText().split("[, ]");
int[] i... | 7 |
@Override
public void keyPressed(Keys key)
{
switch (key)
{
case KEY_LEFT:
player.getVelocity().x = -1;
break;
case KEY_RIGHT:
player.getVelocity().x = 1;
break;
case KEY_UP:
player.getVelocity().y = -1;
break;
case KEY_DOWN:
player.getVelocity().y = 1;
break;
case K... | 9 |
public JSONObject increment(String key) throws JSONException {
Object value = this.opt(key);
if (value == null) {
this.put(key, 1);
} else if (value instanceof Integer) {
this.put(key, ((Integer) value).intValue() + 1);
} else if (value instanceof Long) {
... | 5 |
private static String removeTenantRoot(String tenantRoot, String path) {
if (tenantRoot != null && tenantRoot.length() > 1 && path != null && path.startsWith(tenantRoot) && !path.startsWith(PUBLIC_ROOT)) {
path = path.substring(tenantRoot.length());
if (path == null || path.isEmpty()) {
path = "/";
}
}... | 7 |
public Vector2 calculate() {
if(behaviors.size() == 0)
return new Vector2(0f, 0f);
steeringForce = new Vector2(0f, 0f);
for(IBehavior b : behaviors) {
steeringForce.add(b.calculate(target));
}
steeringForce = steeringForce.divideBy(behaviors.size()); //average
return steeringForce;
} | 2 |
public static Image getRightImage(int number) {
if (number == 1) {
return around;
} else if (number == 2) {
return unknown;
} else if (number == 3) {
return free;
} else if (number == 4) {
return nxt;
} else if (number == 5) {
return arrow_right;
} else if (number == 6) {
return arrow_dow... | 8 |
private void parseInputToMaze(ArrayList<String> temp) {
for (int y = 0; y < temp.size(); y++) {
String line = temp.get(y);
for (int x = 0; x < line.length(); x++) {
if (line.substring(x, x + 1).equals("E")) {
maze[y][x] = new MazeField(MazeField.FieldType.EMPTY);
} else if (line.substring(x, x + 1)... | 6 |
public static void main(String[] args) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException {
// 日,一,二,三,四,五,六
String[] strCal = new String[42];
String[] destCal = new String[35];
// 只需要保存第一行的Calendar对象就可以了。
Calendar[] calArr = new Calendar[7];
Calendar ca... | 9 |
public double[] do200baudFSKHalfSymbolBinRequest (CircularDataBuffer circBuf,int start,int bin0,int bin1) {
double vals[]=new double[2];
// Get the data from the circular buffer
double samData[]=circBuf.extractDataDouble(start,20);
double datar[]=new double[FFT_64_SIZE];
// Run the data through a Blackman win... | 3 |
private void tuRevertSame(final Character[] orig, final Character[] dest) {
final TreeMap<Character,Character> origMap =
new TreeMap<Character,Character>();
final TreeMap<Character,Character> destMap =
new TreeMap<Character,Character>();
for (int i = 0; i < orig.length || i < dest.length;... | 8 |
public void showSide(boolean showSideB) {
showingSideB = showSideB;
colorBar.setBackground(showingSideB ? colorB : colorA);
String text = showingSideB ? sideB : sideA;
contentLabel.setText(text);
contentLabel.setFont(findBestFontSize(FONT, text));
} | 2 |
static String urlize(String s, int length) {
char[] charArray = s.toCharArray();
int start_strip = 0;
for (int i = 0; i<s.length(); i++) {
if (charArray[i] == ' ') {
start_strip += 1;
} else {
break;
}
}
int spa... | 6 |
private Group readGroup(Class<? extends Group> type, List<ParsedParameter> params)
{
try
{
Group group = type.newInstance();
for (ParsedParameter param : params)
{
Field field = param.getParameter().getProperty(Properties.FIELD_HOLDER);
... | 3 |
void writeClassfile(String classname, OutputStream out)
throws NotFoundException, IOException, CannotCompileException
{
InputStream fin = openClassfile(classname);
if (fin == null)
throw new NotFoundException(classname);
try {
copyStream(fin, out);
}
... | 1 |
private boolean isTargetKeyword(Token cur) {
if (!cur.isKeyword())
return false;
for (Keyword target: targetKeywords) {
if (target.equals(cur.getKeyword()))
return true;
}
return false;
} | 3 |
@Override
public String getTypeDescription(File f) {
String extension = Utils.getExtension(f);
String type = null;
if (extension != null) {
if (extension.equals(Utils.jpeg) ||
extension.equals(Utils.jpg)) {
type = "JPEG Image";
} else ... | 7 |
void iniciarJuego() {
snake.inicializar();
while (!gameOver) {
try {
while (pausa) {
Thread.sleep(10);
}
Thread.sleep(150);
} catch (InterruptedException ex) {
}
snake.mover();
... | 3 |
private Object optimizeFieldMethodProperty(Object ctx, String property, Class<?> cls, Member member)
throws IllegalAccessException
{
Object o = ((Field) member).get(ctx);
if (((member.getModifiers() & STATIC) != 0)) {
// Check if the static field reference is a constant and a primitive.
i... | 9 |
private void updateRowColumnSizes(FlexGridData data) {
if (data.mRowSpan == 1) {
updateSizes(data.mRow, data.mSize.height, mRowHeights, data.mMinSize.height, mMinRowHeights, data.mMaxSize.height, mMaxRowHeights);
}
if (data.mColumnSpan == 1) {
updateSizes(data.mColumn, data.mSize.width, mColumnWidths, data.... | 2 |
private Sentence splitSentenceByWordsAndPunctuation(String sourceString) {
ResourceBundle bundle;
bundle = ResourceBundle.getBundle(ApplicationValue.BUNDLE_LOCATION);
Pattern wordPattern = Pattern.compile(bundle.getString(ApplicationValue.WORD_PUNCUATION));
Matcher wordMatcher = wordPatt... | 2 |
private InfoNode SplitLeaf(String key, Integer value, Node node) {
node.add(key, value);
LeafNode sibling = new LeafNode();
int mid = (node.getSize()+1)/2;
int loopTo = node.getSize();
for(int i = mid; i < loopTo;i++){
sibling.add(node.getKey(i), node.getValue(i));
}
for(int i = mid; i < loopTo;i++){
... | 2 |
private void refreshRecursively(Object comp, boolean forceRefresh) {
if (comp instanceof YIComponent) {
YController controller = YUIToolkit.getController((YIComponent) comp);
if (controller != null) {
if (forceRefresh ||
(controller.getRefreshHelper()... | 7 |
public void draw(Graphics2D g2,int xOffset, int yOffset){
g2.setColor(Color.blue);
if(skin==1){
g2.drawImage(Tile.zombie1[dire][timeVar],getX_Point()-xOffset, getY_Point()+yOffset,null);
}else if (skin==2){
g2.drawImage(Tile.zombie2[dire][timeVar],getX_Point()-xOffset, getY_Point()+yOffset,null);
}else if... | 3 |
public EndDisplay(Game game) {
boolean test = false;
if (test || m_test) {
System.out.println("EndDisplay :: EndDisplay() BEGIN");
}
final int YESGRIDX = 0;
final int YESGRIDY = 0;
final int YESPADY = 0;
final double STATP1WEIGHTX = 0.5;
... | 6 |
@Override
public int compareTo(Product o) {
int res = 0;
if (o.getProductCode()>this.getProductCode()) {
res = 1;
}
if (o.getProductCode()<this.getProductCode()) {
res=-1;
}
return res;
} | 2 |
private void jButtonCommandeClientEntrepriseMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonCommandeClientEntrepriseMousePressed
if (!(jTextFieldCmdDate.getText().trim().isEmpty()) )
{
Entreprise entreprise = (Entreprise) this.jComboBoxCommandeClientEntrepri... | 1 |
String anonymizeString(String input,String nameToBeAnonymized)
{
//extract name terms
String nameTerms[] = nameToBeAnonymized.split(" ");
String textTerms[] = input.split(" ");
String output = null;
//go through input, replace name term sequences with substitute
boolean lastTermWasName = false;
for(int ... | 8 |
public String toString() {
String x = "";
if (handlers != null) {
for (int i = 0; i < handlers.length; i++) {
x += "\n " + handlers[i];
}
}
/*
* for (int i = 0; i < attrs.length; i++) { x += "\n " + attrs[i]; }
*/
return "(code " + maxStack + " " + maxLocals + " " + code.length + x
... | 2 |
public Copyable getVersion(Transaction me, ContentionManager manager) {
while (true) {
if (me != null && me.getStatus() == Status.ABORTED) {
throw new AbortedException();
}
switch (writer.getStatus()) {
case ACTIVE:
if (manager == null) {
throw new PanicExcept... | 7 |
public void loadFile() {
JFileChooser chooser = new JFileChooser(executableDir);
FileNameExtensionFilter filter = new FileNameExtensionFilter(
"Pippin Executable Files", "pexe");
chooser.setFileFilter(filter);
// CODE TO LOAD DESIRED FILE
int openOK = chooser.show... | 4 |
public boolean getSimplicityofPN() throws BadLocationException {
dialog.addMessageToLogger("Checking simplicity of a PN", 1);
boolean simplicity = true;
for (Arc a : getPn().getListOfArcs()) {
if (!(a.getOutElement() instanceof Resource) && !(a.getInElement() instanceof Resource) && ... | 5 |
public void solve() throws SolvingInitialisiationException, WrongOptimisationOrderException{
if (possibleDecisions.isEmpty()) throw new SolvingInitialisiationException("DP decisions have not been initialized in "+this);
Iterator<DPLotSizingDecision> it = possibleDecisions.iterator();
//Start of with the fir... | 5 |
@Override
public void run() {
int buffersize=size;
double datasize=30*buffersize*1024;
byte toSend[] = new byte[buffersize];
byte toReceive[] = new byte[buffersize];
for (int i=0; i<buffersize; i++){
toSend[i] = (byte)2;
}// TODO Auto-generated method stub
DatagramPacket recivePacket;
Da... | 4 |
public void extractConfig(final String resource, final boolean replace) {
final File config = new File(this.getDataFolder(), resource);
if (config.exists() && !replace) return;
this.getLogger().log(Level.FINE, "Extracting configuration file {1} {0} as {2}", new Object[] { resource, CustomPlugin... | 4 |
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... | 9 |
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int k= in.nextInt();
int q= in.nextInt();
i... | 3 |
public long getIdConnection() {
return idConnection;
} | 0 |
public Class<? extends Command> getCls() {
return cls;
} | 1 |
public void testConstructor_int_int_int_int_Chronology() throws Throwable {
LocalTime test = new LocalTime(10, 20, 30, 40, JULIAN_LONDON);
assertEquals(JULIAN_UTC, test.getChronology());
assertEquals(10, test.getHourOfDay());
assertEquals(20, test.getMinuteOfHour());
assertEquals... | 8 |
public void run() {
//Guarda el tiempo actual del sistema
tiempoActual = System.currentTimeMillis();
//Ciclo principal del JFrame. Actualiza y despliega en pantalla hasta que se acaben las vidas
while (vidas > 0) {
//si esta pausado no actualizas ni checas colision
... | 3 |
public int getxattrsize(ByteBuffer path, ByteBuffer name, FuseSizeSetter sizeSetter) {
if (xattrSupport == null) {
return handleErrno(Errno.ENOTSUPP);
}
String pathStr = cs.decode(path).toString();
String nameStr = cs.decode(name).toString();
if (log != null && log.... | 4 |
public void suljeLohko() throws IllegalStateException {
this.nykyinenLohko().paataLohko();
if (!this.eiAvoimiaLohkoja()) {
lohkot.remove(lohkot.size() - 1);
}
} | 1 |
public void appendModifier(String type, String value) {
for(TextSegment s : segments) {
s.modifier.addModifier(type, value);
}
} | 1 |
public void setComputerBoard() {
int boardIter = shipSize;
if (shipSize == 1) {
boardIter = 3;
}
// System.out.println("BoardIter:" + boardIter);
if (horizontal == false) {
int yCoor = ship.getY();
while (boardIter > 0) {
computerBoard[ship.getX()][yCoor] = shipSize;
boardIter--;
yCoor++... | 8 |
private ArrayList<Method> getAnnotatedMethodsRecursively(Class<?> klass) {
if (klass == null || klass.equals(Class.class)) {
annotatedMethodsByClass.put(klass, null);
return null;
}
if (annotatedMethodsByClass.containsKey(klass)) {
return annotatedMethodsByClass.get(klass);
}
ArrayList<Method> result... | 8 |
public Blog getBlogDetail(long pBlogId){
return blogModelBS.getBlogDetail(pBlogId);
} | 0 |
public static void main(String[] args) throws IOException, ClassNotFoundException {
URLClassLoader urlClassLoader=new URLClassLoader(new URL[]{new URL("file:/tmp/")});
urlClassLoader.loadClass("Bulbs");
File file=new File("/tmp");
file.toURI().toURL();
FileChannel fcin=new Fil... | 2 |
public static <T extends DC> Set<Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>>> despatch(Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>> pair,
Set<Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>>> sets)
{ if(pair==null)
... | 3 |
public String toString() {
StringBuilder s = new StringBuilder();
for (Item item : this)
s.append(item + " ");
return s.toString();
} | 1 |
public static String firstName(byte fn, byte ln, boolean gender) {
int[] N = {Calc.squeezeByte(fn, 0, SYL1.length),Calc.squeezeByte(ln, 0, SYL2.length)};
String p1 = SYL1[N[0]], p2 = SYL2[N[1]].get(gender);
String suffix = "";
if (gender == Misc.FEMALE) {
switch ((fn * ln) % 3) {
case 0: suffix += "a"... | 6 |
protected void onMessage(String channel, String sender, String login, String hostname, String message) {} | 0 |
@Override
public Set<T> next(){
if(!hasNext()){
throw new NoSuchElementException();
}
if(current == null){
current = new TreeSet<Integer>();
}
else{
if(current.size() == 0){
current.add(1);
}
else{
part:{{
int iterations = 0;
int tempIndex = curr... | 7 |
public ArrayList<Flight> cancelFlightsCorrectly(String airport) {
ArrayList<Flight> temp = deepCopy(flights);
for (int i = temp.size() - 1; i >= 0; i--) {
if (temp.get(i).getDepartureAirport().equals(airport)
|| temp.get(i).getArrivalAirport().equals(airport)) {
/* find the flight ID which is canceled ... | 5 |
private static void expandMoveRecursivelyForBlack(Board board, Vector<Vector<Move>> outerVector, Vector<Move> innerVector, int r, int c){
Vector<Move> forcedMoves = Black.ObtainForcedMovesForBlack(r, c, board);
if(forcedMoves.isEmpty()){
Vector<Move> innerCopy = (Vector<Mov... | 2 |
public boolean setSerialProbability(int jobType, double prob) {
if(jobType > BATCH_JOBS || jobType < INTERACTIVE_JOBS) {
return false;
}
if(useJobType_) {
serialProb[jobType] = prob;
} else {
serialProb[INTERACTIVE_JOBS] = serialProb[BATCH_JOBS] = prob;
}
ret... | 3 |
public K findKey (Object value, boolean identity) {
V[] valueTable = this.valueTable;
if (value == null) {
K[] keyTable = this.keyTable;
for (int i = capacity + stashSize; i-- > 0;)
if (keyTable[i] != null && valueTable[i] == null) return keyTable[i];
} else if (identity) {
for (int i = capacity + st... | 9 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
String codforn, codpedido, data;
int qtd;
codforn = txt_codforn.getText();
codpedido = txt_codpedido.getText();
da... | 4 |
private void checkIfBuildable(int sizeX, int sizeY) {
for (int i = 0; i < sizeX; i++) {
for (int j = 0; j < sizeY; j++) {
try {
if (map.getTile(mouseTileCoords.x + i, mouseTileCoords.y + j) == null
|| !map.getTile(mouseTileCoords.x + i,... | 6 |
protected void btnRemoverEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoverEmailActionPerformed
if(JOptionPane.showConfirmDialog(rootPane, "Você tem certeza que deseja"
+ " Remover o item ? ","",JOptionPane.OK_CANCEL_OPTION) == 0){
this.listaEmail.remove... | 1 |
private Vector[] buildHeaders(JPanel panel, ColumnSet set, boolean blankOut, Vector[] refLabels) {
int numParents = set.getNumParents();
int numChildren = getNumChildren(set);
Vector[] headers = new Vector[2];
headers[0] = new Vector();
for (int i=0; i<set.getNu... | 7 |
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.