text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static Dip getDipByName(String name)
{
for (int i = 0; i < dips.length; i++)
{
if (dips[i].getName().equals(name))
{
return dips[i];
}
}
return null;
} | 2 |
public URL getURL() {
if (this.url == null) {
// Check if the file is online or inside the JAR:
if (this.filename.matches(SoundSystemConfig.PREFIX_URL)) {
// Online
try {
this.url = new URL(this.filename);
} catch (Exception e) {
this.logger.err("FilenameURL", "Unable to access online URL"... | 3 |
@Override
public boolean equals(Object o)
{
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
InaccurateTime inaccurateTime = (InaccurateTime) o;
return hour == inaccurateTime.hour && minute == inaccurateTime.minute;
} | 4 |
public static void main(String[] args) throws InterruptedException {
final Processor processor = new Processor();
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
try {
processor.produce();
} catch (Interrup... | 2 |
public void parseMsg(String msg){
String delims = "[,]";
String[] tokens = msg.split(delims);
if (tokens[0].equals("EXIT")){
try {
close();
} catch (IOException ex) {
Logger.getLogger(ServeurSVG.class.getName()).log(Level.SEVERE, null, ex);
}
}
else if (tokens[0].equals("REAL")){
dessin... | 6 |
public Vector<Doctor> getDoctorList(ResultSet rs) {
Vector<Doctor> doctors = new Vector<Doctor>();
try {
while (rs.next()) {
Doctor doctor = new Doctor();
doctor.setHealth_care_no(rs.getInt("health_care_no"));
doctor.setClinic_address(rs.getString("clinic_address"));
doctor.setEmergency_phone(rs.... | 2 |
@Override
public void run()
{
while (true) {
int id = 0;
for (final SingeErratique singe : this.getSingesErratiques()) {
singe.deplacerSinge();
for (final BandeDeSingesErratiquesEcouteur bandeEcouteur : this.bandeSingesEcouteurs
.getListeners(BandeDeSingesErratiquesEcouteur.class)) {
bandeE... | 4 |
protected int fetchUnmatchedWorker() {
int w;
for (w = 0; w < dim; w++) {
if (matchJobByWorker[w] == -1) {
break;
}
}
return w;
} | 2 |
private static String reverseStringAdditionalSpace(String input)
{
StringBuilder output = new StringBuilder();
char [] inputStrArray = input.toCharArray();
for (int count = inputStrArray.length - 1; count >= 0; count--)
{
output.append(inputStrArray[count]);
}
... | 1 |
@Override
public void screenStarted() {
MainMenuOption option = select();
switch (option) {
case Play:
startGame(false);
break;
case PlayDebug:
startGame(true);
break;
case Exit:
getGUI().exit();
}
} | 3 |
public boolean isWin() {
if(isThreeInARow(rowOne) || isThreeInARow(rowTwo) || isThreeInARow(rowThree)){
return true;
}
else if(isThreeInARow(columnOne) || isThreeInARow(columnTwo) || isThreeInARow(columnThree)){
return true;
}
else if(isThreeInARow(diagona... | 8 |
public synchronized void applyUpdates()
{
//apply all new updates in the buffer
while (nextSlotToDisplay != nextSlotAvailable){
Font lFont;
//if the label pointer is not null, then that label needs to be updated
if (updateInfos[nextSlotToDisplay].label != null){
//only u... | 4 |
public boolean actionPlant(Actor actor, Tile t) {
final Flora f = new Flora(t.habitat()) ;
f.setPosition(t.x, t.y, t.world) ;
if (! f.canPlace()) {
stage = STAGE_RETURN ;
return false ;
}
float growStage = -0.5f ;
for (Item seed : actor.gear.matches(seedMatch())) {
growSta... | 5 |
public MethodAccessBenchmark () throws Exception {
int count = 100000;
Object[] dontCompileMeAway = new Object[count];
Object[] args = new Object[0];
MethodAccess access = MethodAccess.get(SomeClass.class);
SomeClass someObject = new SomeClass();
int index = access.getIndex("getName");
Method method = S... | 7 |
public void setComments(String comments)
{
this.comments = comments;
} | 0 |
public void buildTree( double[][] matrix, String[] taxa )
{
set slooper;
numSpecies = matrix.length;
D = matrix;
for ( int i=0;i<taxa.length;i++ )
{
node v = new node( taxa[i], null, -1 );
v.index2 = i;
if ( species == null )
species = new set( v );
else
species.addToSet( v );
}
initD... | 6 |
final void aa(short s, short s_633_) {
anInt5901++;
d var_d = anAbstractToolkit5916.aD1543;
for (int i = 0; i < anInt5813; i++) {
if ((aShortArray5862[i] ^ 0xffffffff) == (s ^ 0xffffffff)) {
aShortArray5862[i] = s_633_;
}
}
byte b = 0;
byte b_634_ = 0;
if (s != -1) {
Class91 class91 = var_d.m... | 9 |
public boolean check_dates(Date date1) {
// Bouml preserved body begin 0001F582
if (this.year < date1.year) return true;
else if(this.year > date1.year) return false;
else
if(this.month < date1.month) return true;
else if (this.month > date1.month) return false;
else
if(this.day ... | 6 |
public void incCount(E data) {
if (overallRoot == null) {
overallRoot = new BSTNode(data);
return;
}
BSTNode currentNode = overallRoot;
while (true) {
// compare the new data with the data at the current node
int cmp = comparator.compare... | 6 |
public static void SaveFile(String fileName, byte[][] map) {
try {
file = new File("" + fileName + ".jps");
writer = new BufferedWriter(new FileWriter(file));
writer.write("javapowder-save\n");
// writer.write("version:" + var.versionID + "\n");
write... | 5 |
private void btnCalculateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalculateActionPerformed
// TODO add your handling code here:
//test if input is a float
//validation for number entry; resets form if entry is not a numerical value
boolean numberTest... | 6 |
@Override
public boolean equals( Object other )
{
if( this == other )
return true;
if( other instanceof EntityType )
{
EntityType otherType = (EntityType)other;
if( otherType.entityKind == entityKind &&
otherType.domain == domain &&
otherType.country == country &&
otherType.category == c... | 9 |
@Override
public T next() {
if(!hasNext()){
return null;
}else{
if(!isFirst){
current =current.getNext();
}else{
current=this.linkedList.getHead();
isFirst=false;
}
return current.getData();
}
} | 2 |
protected int[] strToArray(String str) {
//return str.split(",")*.toInteger()
String[] splits = str.split(",");
int[] numbers = new int[splits.length];
for (int n=0; n<splits.length; n++) {
numbers[n] = Integer.parseInt(splits[n]);
}
return n... | 1 |
public boolean initGame() {
boolean init = true;
if(getBoardSize().getHeight() == 0 || getBoardSize().getWidth() == 0) {
System.out.println("ERROR: Board not defined");
init = false;
} else {
if(!checkStart()) {
init = false;
System.out.println("ERROR: Start not defined");
}
if(!c... | 6 |
public void addQuest() throws Exception {
List<FormID> achrFormList = new ArrayList<>();
List<ModListing> ModList;
FormID[] form;
SPProgressBarPlug.setStatus("Getting ACHRs");
FLST formList = new FLST("form1");
Set<FormID> formSetACHR = new HashSet<>();
S... | 5 |
public static Image substract(Image img1, Image img2) {
if (img1 == null || img2 == null) {
return null;
}
Image img = img1.shallowClone();
double min = 0, max = 255;
for (int x = 0; x < img1.getWidth(); x++) {
for (int y = 0; y < img1.getHeight(); y++) {
double red = img1.getPixel(x, y, RED)
... | 4 |
private void makeFrame()
{
//frame = new JFrame("Map of Denmark");
try {
myPicture = ImageIO.read(new File("assets/Icon48.png"));
krakLogo = ImageIO.read(new File ("assets/krak.gif"));
osmLogo = ImageIO.read(new File ("assets/osm.png"));
... | 1 |
private void drawCrag(int[][] currentBlockArray, String group, int paintRadius, int x, int z, int minX, int maxX, int minZ, int maxZ) {
if(x > minX && x < maxX) {
if(gound[x] <= z + paintRadius + 10) {
z -= paintRadius * 2;
}
if(gound[x] > z + paintRadius + 10... | 5 |
private void ushortLoop(RasterAccessor src, RasterAccessor dst) {
int dwidth = dst.getWidth();
int dheight = dst.getHeight();
int dnumBands = dst.getNumBands();
int dstBandOffsets[] = dst.getBandOffsets();
int dstPixelStride = dst.getPixelStride();
int dstSca... | 9 |
private Chunk func_542_c(int var1, int var2) {
if(this.chunkLoader == null) {
return this.blankChunk;
} else {
try {
Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, var1, var2);
if(var3 != null) {
var3.lastSaveTime = this.worldObj.getWorldTime(... | 3 |
public double[][] getWaveFunction(double energy) {
// Number of dots in the whole MatterStack
int numberOfDots = (int) (getWidth() * X_POINTS_DENSITY * 1000000000L);
// TODO try-catch or think on long-or-int problem
double[] waveFunction = new double[numberOfDots];
double[] xAx... | 2 |
static Drawable getDraw(){
switch(currentState){
case CreateGameScreen:
return myCreateGameScreen;
case ExitGameDialog:
return myExitGameDialog;
case JoinGameScreen:
return myJoinGameScreen;
case MainMenu:
return myMainMenu;
case NetworkGameMenu:
return myNetworkMenu;
case NewGameMenu:
r... | 7 |
private void removeRowsAndDrop(List<Integer> rowsToRemove) {
// NB: iterating from bottom to top
for (int y = TANK_HEIGHT - 1; y >= 0; y--) {
if (rowsToRemove.contains(y)) {
for (int x = 0; x < TANK_WIDTH; x++) {
tank[x][y] = null;
}
... | 5 |
public static void main(String[] args) {
int[] test={2,2,3,3,3,2};
System.out.println(new OJ335().isSelfCrossing(test));
} | 0 |
@Test
public void mapperTest(){
String[] ext = {"ttl", "rdf", "as", "nt", "n3"};
String[] format = {"TURTLE", "RDF/XML", "as", "N-TRIPLE", "N3"};
String[] cot = {"application/x-turtle", "application/rdf+xml",
"as", "text/plain", "text/rdf+n3"};
String ct, ex1, ex2, fo, fo2;
for(int i=0; i<ext.length;i+... | 7 |
public void loadMap(int parts){
int whichMap;
String tempLine = "";
try{
File newMap = new File("some.txt");
BufferedWriter bw = new BufferedWriter(new FileWriter(newMap));
BufferedReader br;
for(int i = 1; i < parts + 1; i++){
Random r = new Random();
whichMap = r.nextInt(PIECES_AMOUNT) + 1;... | 6 |
@Override
public Animation getAnimation() {
Animation animation = super.getAnimation(0);
for (int i=0; i<animation.getFrameCount(); ++i) {
if(animation.getImage(i) == null) continue;
if (getFacing() == UP) {
animation.getImage(i).setRotation(180);
} else if (getFacing() == DOWN) {
anima... | 6 |
public Array<String> parse(LanguageController languageController) {
Array<String> words = new Array<String>();
FileHandle file = Gdx.files.internal(languageController.getLanguage().getDictionaryPath());
String stringa = file.readString();// read the string
String[] splits = stringa.split("\n");
for (int i = 0... | 1 |
public synchronized boolean setItem(FieldItem I, Position pos) {
if (pos.getX() >= rows || pos.getX() < 0 || pos.getY() <= columns || pos.getY() < 0) {
return false;
}
if (hunt[pos.getX()][pos.getY()] != null) {
return false;
}
int i = 0;
int j = 0... | 8 |
public CheckResultMessage checkJ03(int day) {
return checkReport.checkJ03(day);
} | 0 |
public double getScore()
{
return result.Score;
} | 0 |
private int getIdentityDiscCoverage() {
int nrSquaresDisc = 0;
for (Element e : grid.getElementsOnGrid()) {
if (e instanceof IdentityDisc) nrSquaresDisc++;
}
return (nrSquaresDisc * 100 / grid.gridSize());
} | 2 |
public static void updateMetadonnees(String oldnom, String nom,
String auteur, int note) {
try {
Connection connexion;
java.sql.Statement requete;
Class.forName("org.sqlite.JDBC");
connexion = DriverManager.getConnection("jdbc:sqlite:dbged");
requete = connexion.createStatement();
requete.exec... | 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 |
public static int calcQueueTurnsInt(City citySelected, String name)
{
int[] t = citySelected.quickEval();
float[] cost = EntityData.getCost(name);
//Division by zero errors
if ((t[0] == 0 && cost[0] > 0) || (t[2] == 0 && cost[2] > 0) || (t[0] == 0 && t[2] == 0))
return -1;
else
{
//System.out.println... | 8 |
public ChunkyCommand(String name, ChunkyCommandExecutor executor, ChunkyCommand parentCommand) {
this.name = name.toLowerCase();
this.executor = executor;
this.parent = parentCommand;
this.fullName = name;
ChunkyCommand currentParent = parentCommand;
while (true) {
... | 4 |
@Override
public boolean equals(Object other) {
if ( (this == other ) ) return true;
if ( (other == null ) ) return false;
if ( !(other instanceof HabitacioId) ) return false;
HabitacioId castOther = ( HabitacioId ) other;
return ( (this.getNomHotel()==castOther.getNomHotel()) || ( t... | 7 |
public static final void add(Outline outline) {
synchronized (OUTLINES) {
OUTLINES.add(outline);
if (!PENDING) {
PENDING = true;
EventQueue.invokeLater(INSTANCE);
}
}
} | 1 |
private Object paseExpression() {
Object result = null;
outer:
while (true) {
switch (args.charAt(currentIndex)) {
case ' ':
break;
case '{':
currentIndex++;
result = parseList();... | 8 |
public static void main(String[] args) throws IOException {
StaticDynamicUncertaintyULHSolver solverWithoutADI = new StaticDynamicUncertaintyULHSolver();
StaticDynamicUncertaintyWithADIULHSolver solverWithADI = new StaticDynamicUncertaintyWithADIULHSolver();
ConstantNormalDistributedProblemGenerator problemGenera... | 1 |
public void buildPartB() {
System.out.println("build partB");
partB = new PartB();
} | 0 |
private void setThePieces(){
for(int i = 0; i<HEIGHT;i++){
for(int j = 0; j<WIDTH;j++){
if(piecesToSwap[i][j]==null){
}else{
m_Pieces[i][j]=piecesToSwap[i][j];
}
... | 3 |
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 |
public void cadastrar(Paciente paciente) throws Exception{
if(paciente.getNome().isEmpty()){
throw new Exception("Nome inválido!");
}else{
this.verificaNome(paciente.getNome());
}
if(paciente.getCpf().equals(" . . - ")){
throw new Exception("CPF... | 4 |
@Override
public TIPO_OBJETO set(TIPO_OBJETO oBean) throws Exception {
Class<TIPO_OBJETO> tipo = (Class<TIPO_OBJETO>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
Method metodo_getId = tipo.getMethod("getId");
Method metodo_setId = tipo.getMethod("setI... | 8 |
private void hitEnemy(Player player, Enemy[][] enemys){
for(int i = 0; i < enemys.length; i++) {
for(int j = 0; j < enemys[i].length; j++) {
for(int k = 0; k < player.getProjectiles().length; k++) {
if(player.getProjectiles()[k].getCollider() != null) {
if(enemys[i][j].getCollider().overlaps(player.... | 7 |
public void markMine(int x, int y) {
final Cell cell = cells[x][y];
final Cell.Type type = cell.getType();
// dont allow opened tiles to be flagged
if (cell.getState() == Cell.State.OPEN)
return;
// unflag the cell if its already marked
if (type == Cell.Type... | 5 |
private void setDefaultLead() {
DefaultComboBoxModel<Anstalld> dcbm = (DefaultComboBoxModel<Anstalld>) cbLead.getModel();
Anstalld lead = null;
try {
String query = "select projektledare.aid from projektledare"
+ " join spelprojekt on spelprojekt.aid=projektledare... | 6 |
public Integer getTotalShifts() {
if (listOfShifts == null)
return 0;
return listOfShifts.size();
} | 1 |
public void put(int index, int value) {
if (index < 0 || index >= size)
throw new IndexOutOfBoundsException();
$.putInt(address + index * SIZE_OF_INT, value);
} | 2 |
private void increaseScore() {
//тут в зависимости от сложности начисляются очки
if (state.getDifficulty().equals("Легко")) {
state.setScore(Integer.parseInt(state.getScore()) + 400);
} else if (state.getDifficulty().equals("Средне")) {
state.setScore(Integer.parseInt(sta... | 2 |
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
new Game();
Game.currentFrame.init("Village Defense");
Game.currentFrame.setFullscreen();
Game.currentFrame.updater = new UpdateThr... | 2 |
public void maxSkills(boolean shit) {
if (GMSMode > 0 && !isJounin()) {
maxJobSkills(shit);
return;
}
if (job < 911 || isJounin()) {
maxAdventurerSkills(shit);
}
if (job > 910 || isJounin()) {
maxKOCSkills(shit);
}
i... | 8 |
private void initLoadingstatusMenu(Color bg) {
this.loadingstatusMenu = new JPanel();
this.loadingstatusMenu.setBackground(bg);
this.loadingstatusMenu.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
this.loadingstatusMenu.add(new ImageField(this.skin.getImgPathLoadingStatusBg(), ... | 6 |
public int getHandValue(Hand hand) {
// return 0 if hand is null
if (hand == null) {
return 0;
}
// value of hand and number of aces
int value = 0;
int aces = 0;
// go through all cards, add the values and count the aces
for (Card c : hand) {
... | 5 |
public void sendAllStreamData() throws InterruptedException {
// In welchem Modus werden die Pakete versandt (jeder Stream verschickt nr ein Paket und reiht sich dann erneut ein, oder
// jeder Stream verschickt soviele Pakete wie er darf).
boolean singlePacketMode;
// Solange es Streams gibt, die Senden dürfe... | 8 |
protected int getKnownAttributeCount() {
int count = 0;
if (sourceFile != null)
count++;
if (innerClasses != null || outerClasses != null
|| extraClasses != null)
count++;
return count;
} | 4 |
@Override
public void incrementKillCount(String player_name) {
PreparedStatement pst = null;
int player_id = getPlayerId(player_name);
int killcount = getKillCount(player_id);
try {
pst = conn.prepareStatement("UPDATE ffa_leaderboards SET killcount=? WHERE player_id=?");
pst.setInt(1, killcount + 1);
... | 3 |
private String randomItemName(){
int random = (int) Math.floor(Math.random()*3);
switch (random){
case 0 : return "heart";
case 1 : return "sword";
case 2 : {random = (int) Math.floor(Math.random()*6); //To lower the odds of having boots,
if(random==0){return "boots";} //and increasing the odds to get a... | 5 |
public JButton getOthelloButton() {
boolean test = false;
if (test || m_test) {
System.out.println("GameSelecter :: getOthelloButton() BEGIN");
}
if (test || m_test) {
System.out.println("GameSelecter :: getOthelloButton() END");
}
return m_othello... | 4 |
private void ApplySinglePayloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ApplySinglePayloadButtonActionPerformed
String HTTPRequest = "", output = "";
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
int VULNERABILITY_INJECTION_RESULTS_ID;
... | 4 |
private Map<Variable, Term> substituteResult(
List<UnificationPair> mgu, Map<Variable, Term> substitutions) {
for (UnificationPair termPair : mgu) {
for (Map.Entry<Variable, Term> substitution : substitutions.entrySet()) {
substitution.setValue(substitution.getValue().sub... | 2 |
private static List<Cards> choose3(Cards cards) {
// Given a list of cards, give me back a list of the
// complete list of subsets of size num
int size = cards.size();
List<Cards> subsets = new ArrayList<Cards>();
for (int i1 = 0; i1 < size - 2; i1++) {
Cards subset1 ... | 3 |
protected XYDataset createDataset() {
// System.out.println("Create Dataset of" + textX);
final XYSeries seriesR = new XYSeries(title[1]);
final XYSeries seriesG = new XYSeries(title[2]);
final XYSeries seriesB = new XYSeries(title[3]);
Integer countPixel[] = new Integer[256];
... | 9 |
public SqlUpdater(Connection connetion) {
this.connetion = connetion;
} | 0 |
public static MatchingQuestion getQuestionByQuestionID(int questionID) {
try {
String statement = new String("SELECT * FROM " + DBTable + " WHERE questionid = ?");
PreparedStatement stmt = DBConnection.con.prepareStatement(statement);
stmt.setInt(1, questionID);
ResultSet rs = stmt.executeQuery();
rs.n... | 1 |
@Override
public synchronized ResultMessage addGoods(GoodsPO goodsPO) {
if(goodsPO.getName().equals("") || goodsPO.getModel().equals("")) return ResultMessage.add_failure;
gIter = goodsList.iterator();
GoodsPO g = null;
while(gIter.hasNext()) {
g = gIter.next();
if(g.getName().equals(goodsPO.getName()) &... | 6 |
public boolean HasAirStaff()
{
if (playerEquipment[playerWeapon] == 1381) return true;//Staff_of_air
if (playerEquipment[playerWeapon] == 1397) return true;//Air_battlestaff
if (playerEquipment[playerWeapon] == 1405) return true;//Mystic_air_staff
return false;
} | 3 |
@Override
public void clearCache()
{
if (!clearLocalCacheOnly)
{
for (Painter<T> p : painters)
{
if (p instanceof AbstractPainter)
{
AbstractPainter<?> ap = (AbstractPainter<?>) p;
ap.clearCache();
}
}
}
super.clearCache();
} | 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://downl... | 6 |
public boolean moveToNext(){
System.out.println("Increasing waypoint number");
System.out.println("Total waypoints: " + points.size());
if(points.size() -1 > nextWaypointNumber){
nextWaypointNumber++;
System.out.println("WP number now: " + nextWaypointNumber);
return true;
}else{
//System.out.printl... | 1 |
public void setLogFileName(String logFileName)
throws FileNotFoundException
{
if (logFileName != null)
{
logFileName = logFileName.replace("logTime", "" + new SimpleDateFormat("yyyyMMdd_hhmmssSSS").format(new Date()));
setOutputStream(new FileOutputStream(logFileName));
}
} | 1 |
public void flushBits() throws IOException {
//
// If the buffer has fewer than 8 bits, need to shift the bits
// left to align them with the left end of the byte before
// writing out.
// NOTE: when you read in the bits, there may be some
// extra 0 bits dangling at ... | 1 |
public void tableChanged( TableModelEvent e )
{
// If we're not sorting by anything, just pass the event along.
if ( !isSorting() )
{
clearSortingState() ;
fireTableChanged( e ) ;
return ;
}
// If the table structure has changed, cancel the sorting; the
/... | 6 |
@Override
public void receiveAlert(AIAlert alert, float urgency, Hostility hostility) {
switch(alert) {
case THREATENED:
case ATTACKED:
priority = 1f;
break;
}
} | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final User other = (User) obj;
if ((this.uid == null) ? (other.uid != null) : !this.uid.equals(other.uid)) {
... | 9 |
private void updateStateAskPreference(List<Keyword> keywords, List<String> terms, List<String> approval) {
if (keywords.isEmpty()) {
//Didn't get any keyword for preference
DialogManager.giveDialogManager().setInErrorState(true);
}
else {
LocalDate date = LocalDate.now();
int dateShift = 0; //0 for to... | 6 |
public static void Seed(SudokuBoard board) {
switch (board.size) {
case 2:
Seedby2(board);
break;
case 3:
Seedby3(board);
break;
case 4:
Seedby4(board);
break;
case 5:
Seedby5(board);
break;
default:
System.out.println("Improper program path");
System.exit(0);
break;
}
... | 4 |
@Override
public void run() {
plugin.debug("Beginning Custom data sending");
mt.addCustomData(plugin, new Metrics.Plotter() {
@Override
public int getValue() {
try {
return cm.getCoupons().size();
} catch (SQLException e) {
e.printStackTrace();
}
return 0;
}
@Override
... | 8 |
public void sendUnicast(Serializable content, Address to) throws IOException {
ObjectOutputStream out = unicastStreams.get(to);
// create output stream if necessary
if (out == null) {
// create socket
Socket tcpClientSocket = new Socket(to.getIpAddress(), to.getTcpPort());
// build a stream to write obje... | 3 |
@SuppressWarnings("unchecked")
public Provider createProvider(String token, HashMap<String, Object> provider){
this.ID = "1000"+token;
if(provider.containsKey("contact")) this.setContact((String)provider.get("contact"));
if(provider.containsKey("name")) this.setName((String)provider.get("name"));
if(provide... | 6 |
public Vector4i abs() {
if(x < 0) x = -x;
if(y < 0) y = -y;
if(z < 0) z = -z;
if(w < 0) w = -w;
return this;
} | 4 |
protected void checkReg(int reg_code, int val) {
for (int i = 0; i < 8; i++) {
switch (reg_code) {
case 7:
assertTrue(cu.getRegAValue(i)==((val & 1<<i) == 1<<i));
break;
case 0:
assertTrue(cu.getRegBValue(i)==((val & 1<<i) == 1<<i));
break;
case 1:
assertTrue(cu.getRegCValue(i)... | 8 |
@Override
public void run() {
while(!Thread.currentThread().isInterrupted()) {
int i = new Random().nextInt(10);
String s = robj.call(i);
System.out.println("res=" + s + ", i=" + i);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.print... | 2 |
public void run() {
boolean stop = false;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(!stop) {
this.printMenu();
System.out.print("command> ");
String command = "";
try {
command = br.readLine();
} catch (IOException e) {
// TODO Auto-generat... | 6 |
public void setPoints() {
super.setPoints();
// 0-15 = top curve, 16 = right, 17-32=bottom curve,
// 33-37 = left curve
Point triPoints[] = newPointArray(38);
if (this instanceof XorGateElm) {
linePoints = new Point[5];
}
int i;
for (i = 0; i != ... | 6 |
private void moveCurrentlySelectedPiece(ChessSpaceButton clickedButton)
{
assert pieceIsSelected;
final int selectedRow = currentlySelectedButton.getRow();
final int selectedColumn = currentlySelectedButton.getColumn();
final int clickedRow = clickedButton.getRow();
final int... | 8 |
private static void calcNoOfNodes(Node node) {
if (node instanceof Parent) {
if (((Parent) node).getChildrenUnmodifiable().size() != 0) {
ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable();
noOfNodes += tempChildren.size();
f... | 3 |
public int findNearestTBondIndex(int x, int y) {
TBonds tbonds = ((ExtendedFrameRenderer) repaintManager.frameRenderer).tbonds;
if (tbonds == null || tbonds.isEmpty())
return -1;
initHighlightTBond();
tbonds.removeTBond(highlightTBond);
int zmin = Integer.MAX_VALUE;
TBond tbond = null;
TBond tbondFound... | 9 |
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.