text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void play(){
try{
pause = false;
stop = false;
int bytesPerFrame = audioInput.getFormat().getFrameSize();
int numBytes = 256 * bytesPerFrame;
byte[] tableau = new byte[numBytes];
AudioFormat audioFormat = audioInput.getFormat();
DataLine.Info Info = new DataLine.Info(SourceDataLine.class... | 5 |
protected JPanel initInputPanel() {
JPanel bigger = new JPanel(new BorderLayout());
JPanel panel = new JPanel();
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
panel.setLayout(gridbag);
c.fill = GridBagConstraints.BOTH;
c.weightx = 0.0;
panel.add(new JLab... | 0 |
public boolean Close()
{
try{
out.close();
return true;
}catch(Exception e){}
return false;
} | 1 |
public static ArrayList getPlayerList() {
ArrayList names = new ArrayList();
for (int i = 0; i < players.size(); i++) {
Player p = players.get(i);
if (p != null) {
names.add(p.getName());
} else {
names.add("");
}
}... | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TabelOutletType other = (TabelOutletType) obj;
if (!Objects.equals(this.kodeType, other.kodeType)) {
... | 3 |
private StateSequence<Double> createScaledBackward() {
ArrayList<Double> scales = new ArrayList<Double>();
StateSequence<Double> stateProbs = new StateSequence<Double>(hmm.getStates());
for (String state : hmm.getStates()) {
for (int i = 0; i < hmm.getEmissionSequence().size(); i++) {
stateProbs.add(stat... | 8 |
private boolean csCompleteWork(Random random, ChangeSet cs) {
setWorkLeft(-1);
if (getLocation() instanceof HighSeas) {
ServerPlayer owner = (ServerPlayer)getOwner();
Europe europe = owner.getEurope();
Map map = getGame().getMap();
Location dst = getDesti... | 8 |
static private boolean jj_3R_8() {
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3R_19()) { jj_scanpos = xsp; break; }
}
if (jj_3R_20()) return true;
if (jj_scan_token(ID)) return true;
if (jj_scan_token(LP)) return true;
if (jj_3R_21()) return true;
if (jj_scan_token(RP... | 8 |
public Type getSubType() {
if (elementType instanceof IntegerType)
return this;
else
return tArray(elementType.getSubType());
} | 1 |
private static Set findInitial(Automaton a) {
Set initialized = new HashSet();
initialized.add(a.getInitialState());
boolean added = true;
Transition[] t = a.getTransitions();
while (added) {
added = false;
for (int i = 0; i < t.length; i++)
if (initialized.contains(t[i].getFromState()))
added ... | 4 |
public void alimenterContainerCENTER(){
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
RechercheReservation metierPlanning = new RechercheReservation();
JLabel horaire;
int horaireCourant=9;
int etatCourant=0;
if(jdDateChooser.getDate()==null){
JOptionPane.showMessageDialog(this, "Date ... | 7 |
private void setMass(double[] m) {
this.mass = m.clone();
} | 0 |
public Map<String, Double> findTermFrequency(ArrayList<String> tokens){
Map<String, Integer> map = new HashMap<String, Integer>();
String[] StopWords = DEFAULT_STOPWORDS.split(" ");
ArrayList<String> stopArrayList = new ArrayList<String>(Arrays.asList(StopWords));
for(String word: tokens){
int i=0;
if(!... | 4 |
private static double[] getResistPoints(int curvePoints,int lineNumber, double[] highPrices) {
double[] rPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 0;
for(int j=-curvePoints;j<=0;j++){
if((i+j>=0) && (i+j<lineNumber-1) && hig... | 5 |
public void showRecentWinners(CommandSender sender, int pageNumber){
reloadConfig();
List<String> raw = getConfig().getStringList("winners");
if(raw == null || raw.size() <= 0){
sender.sendMessage(prefix() + ChatColor.AQUA + "No one has recently won! Be the first, buy a ticket with /lottery buy");
}else{
... | 5 |
public void addCompleteListener(ActionListener listener){
completeListeners.add(listener);
} | 0 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
DefaultFunctionExecutorContext<?> other = (DefaultFuncti... | 8 |
private static boolean votingPhase(Registry registry, LogItem logItem)
{
boolean success = true;
try
{
boolean failedServer = false;
ICoreServer primary = null;
for (String serverName : registry.list())
{
//For every server, check it is alright to commit, and pass it the log
try {
I... | 9 |
@Override
public void mouseDragged(MouseEvent e)
{
if (graphComponent.isEnabled() && isEnabled())
{
Iterator<mxCellHandler> it = handlers.values().iterator();
while (it.hasNext() && !e.isConsumed())
{
it.next().mouseDragged(e);
}
}
} | 4 |
public void addUserPoint(int points) {
if(points<0 && -points>this.user_point) points = -this.user_point;
this.user_point += points;
} | 2 |
private Pair<EdgeType, VertexType>
getNewEdgeForSpanningTree(Vector<VertexType> vertices, Vector<EdgeType> edges) {
ArrayList<EdgeType> tempEdgeArray = new ArrayList<EdgeType>();
try {
while (true) {
EdgeType edge = pq.poll();
if (edge == null)
... | 8 |
private double getSpecialAccuracyModifier(Player player) {
Item weapon = player.getEquipment().getItem(Equipment.SLOT_WEAPON);
if (weapon == null)
return 1;
String name = weapon.getDefinitions().getName().toLowerCase();
if (name.contains("whip") || name.contains("dragon longsword")
|| name.contains("drag... | 9 |
@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 Businessvendor)) {
return false;
}
Businessvendor other = (Businessvendor) object;
if ((this.businessVendorID =... | 5 |
static void getDifficulty()
{
String m = r.Difficulty;
if (m.equalsIgnoreCase("Hard"))
{
diff = hard;
}
else if (m.equalsIgnoreCase("Normal"))
{
diff = normal;
}
else if (m.equalsIgnoreCase("Easy"))
{
diff =... | 3 |
private void parseForeignKeys( Token token ) {
String thisTable = table.getDomName();
String thisField = token.getValue();
if ( !getNextToken().getValue().equals( "constrainsTo" ) )
throwException( "Expecting keywords 'constrainsTo" );
String other[] = getNextToken().getValu... | 1 |
@Test
public void TestaaOikealtaVasemmalleEste() {
rakentaja = new Kartanrakentaja(10, 6);
rakentaja.asetaEste(5, 3);
rakentaja.asetaEste(4, 3);
rakentaja.asetaEste(6, 3);
char[][] kartta = rakentaja.getKartta();
Solmu aloitus = new Solmu(5, 5);
Solmu maali = ... | 5 |
protected void addSpinnerListeners(){
final JFormattedTextField textField = getTextField( spinner );
final int minValue = this.min;
final int maxValue = this.max;
textField.addKeyListener( new KeyAdapter() {
@Override
public void keyReleased( final KeyEvent e ) {
... | 6 |
public ArrayList<Integer> findLegalMoves(int startIndex, int player, ArrayList<Integer> moves) {
for (int offset : getOffsets()) {
int move = findMove(startIndex, offset, player);
if (move != INVALIDMOVE && !adjacentMove(startIndex, offset, move) && !moves.contains(move))
... | 4 |
public int getFirstAddr() {
int minAddr = Integer.MAX_VALUE;
Enumeration enum_ = usingInstrs.elements();
while (enum_.hasMoreElements()) {
InstrInfo info = (InstrInfo) enum_.nextElement();
if (info.instr.getAddr() < minAddr)
minAddr = info.instr.getAddr();
}
return minAddr;
} | 2 |
public static synchronized Factory getInstance(){
if (instance == null){
instance = new Factory();
}
return instance;
} | 1 |
public FutureMeeting getFutureMeeting(int id)
{
MeetingImpl tempM = null;
try
{
FutureMeeting result = (FutureMeeting) this.getMeeting(id);
if(result.equals(null))
{
return null;
}else{
if(inPast(tempM.meetingDate))
{
throw new IllegalArgumentException();
}else{
return resu... | 3 |
private boolean scroll(final Item item, Item destination) {
if (!ctx.bank.opened()) {
return false;
}
final Component bankContainer = ctx.widgets.component(Constants.BANK_WIDGET, Constants.BANK_ITEMS);
int tries = 0;
while (tries < 100) {
if (!ctx.bank.opened()) {
return false;
}
if (!bankCo... | 5 |
@Override
public void run() {
if (!locationAttribute.isInLargeArea(ctx)) {
//ctx.log.info("large");
doLarge();
} else if (!locationAttribute.isInSmallArea(ctx)) {
//ctx.log.info("small");
final Tile destination = ctx.movement.destination();
double distance = IMovement.Euclidean(ctx.players.local().t... | 5 |
public void hashOutput() {
for (int i = 0; i < length; i++) {
if (!hashTable[i].isEmpty()) {
hashTable[i].output();
}
}
} | 2 |
public void visitLdcInsn(final Object cst) {
if (cst instanceof Long || cst instanceof Double) {
minSize += 3;
maxSize += 3;
} else {
minSize += 2;
maxSize += 3;
}
if (mv != null) {
mv.visitLdcInsn(cst);
}
} | 3 |
public void decorateChunk(WorldChunk chunk, World w, Random rand)
{
for(int gen = 0 ; gen < genLoops ; gen++)
{
int width = rand.nextInt(16);
int height = rand.nextInt(maxHeight-minHeight)+minHeight;
for(int i = 0 ; i < rand.nextInt(size) ; i++)
{... | 7 |
public Item select(String itemCode) {
String sql = "SELECT * FROM Item where ItemCode = ?;";
return getPersist().read(Item.class, sql, itemCode);
} | 0 |
public void notifyWorldModelListeners() {
for (final WorldModelListener listener : this.listenersWorld) {
notifyWorldModelListener(listener);
}
} | 1 |
public int checkbannedusers()
{
try
{
BufferedReader in = new BufferedReader(new FileReader("./data/bannedusers.txt"));
String data = null;
while ((data = in.readLine()) != null)
{
if (playerName.equalsIgnoreCase(data))
{
return 5;
}
}
}
catch (IOException e)
{
System.out.p... | 3 |
private static int decode4to3(byte[] source, int srcOffset, byte[] destination, int destOffset,
int options) {
// Lots of error checking and exception throwing
if (source == null) {
throw new NullPointerException("Source array was null.");
} // end if
if (destina... | 8 |
public static String executeCommand(UserNChatThread user, String command){
if(command.equals("/stop")){
user.parentServer.stopServer = true;
return "Stopping server...";
}else if(command.equals("/leave")){
user.stopThread = true;
return "";
}else{
return "Invalid command.";
}
} | 2 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
final int x = 6;
final int y = 6;
final int width = getWidth() - 12;
final int height = getHeight() - 12;
final FontMetrics fontMetrics = getFontMetrics(font);
final int charWidth = fontMetrics.getWidths()[0];
final int ch... | 2 |
public boolean hasMaxBypassPermission() {
return this.maxByPassPermission != null && !this.maxByPassPermission.equals("*") && !this.maxByPassPermission.equals("");
} | 2 |
public boolean playerExists(String playerName) {
boolean exists = false;
String query = "";
Connection connection = getSQLConnection();
PreparedStatement statement = null;
if ( tableExists(TableType.PLAYER) ) {
query = "SELECT COUNT(*) AS `playercount` FROM `" + TableName(TableType.PLAYER) + "` WHERE `p... | 3 |
public List<Roster> getRosterList() {
ArrayList<Roster> tripRosters = new ArrayList<Roster> ();
for (Integer i: rosters) {
tripRosters.add(MainWindow.rosterDB.getRosterByID(i));
}
return tripRosters;
} | 1 |
public void testBasicUsage() {
// create a couple of events...
EntityManager entityManager = entityManagerFactory.createEntityManager();
entityManager.getTransaction().begin();
//entityManager.persist(new Post("Our very first Post!", "Post content here", new Date()));
//entityManager.persist(new Post("Our sec... | 1 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Test test = (Test) o;
if (id != null ? !id.equals(test.id) : test.id != null) return false;
return age != null ? age.equals(test.age) : test.age == null;
} | 6 |
public void runUpdate(String queryIn)
{
try{
if(!con.isValid(1000)){//check if connection is still available
interrupted = true;
startConnection();
}
//create an SQL statement
st = con.createStatement();
//Run the update
st.executeUpdate(queryIn);
}
catch(SQLException e)
{
e.printS... | 3 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
if(st.equalsIgnoreCase("Mas")){
if(jList1.getSelectedValue() != null){
for(int i = 0; i < meses.size();i++){
... | 7 |
public void loadLang() {
final File lang = new File(getDataFolder(), "messages.yml");
if (!lang.exists()) {
try {
getDataFolder().mkdir();
lang.createNewFile();
final InputStream defConfigStream = getResource("messages.yml");
if... | 6 |
private void tickBackwards(){
time--;
if(time % 60 == 0) second--;
if(second == 0){
minute--;
second = 60;
}
if(time == 0) finished = true;
} | 3 |
public static void makeGrid(Container parent,
int rows, int cols,
int initialX, int initialY,
int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout)parent.getLayout();
} ... | 6 |
static ArrayList<Quote> getQuotes(WebPage page) {
ArrayList<Quote> quotes = new ArrayList<>();
Element container = Jsoup.parse( page.getContent() ).getElementsByAttribute("valign").first();
Elements headers = container.getElementsByClass("quote");
Elements bodies = container.getElementsB... | 1 |
public static void main(String [] args) throws Throwable {
if (args.length < 2) {
usage();
return;
}
Class stemClass = Class.forName("org.tartarus.snowball.ext." +
args[0] + "Stemmer");
SnowballStemmer stemmer = (SnowballStemmer) stemClass.newInstance();
Reader reader;
... | 9 |
static final void method3178(IndexLoader class45, int i, int[] is,
IndexLoader class45_15_) {
try {
anInt9506++;
if (is != null)
Class348_Sub1.anIntArray6547 = is;
s.fontIndexLoader = class45;
if (i >= -6)
method3177(-36, true);
Class39.spriteIndexLoader = class45_15_;
} catch (Runti... | 6 |
String[] getAllKeyParts(String begin, String end) {
if (begin == null) return new String[0];
if (end == null) return new String[0];
Properties allKeys = getAllKeyValuesByBeginAndEnd(begin,end);
String[] keys = new String[0];
if (unique == false) { keys = new String[allKeys.size()]; };
Properties uni... | 9 |
public static String[] sortStrings(String[] strings, String sens) {
String temp;
if(sens == "asc" || sens == "desc") {
for(int i1 = 0; i1 < strings.length; i1++) {
for(int i2 = 0; i2 < strings.length; i2++) {
switch(sens) {
... | 8 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Request request = (Request) o;
if (entered != request.entered) return false;
if (query != null ? !query.equals(request.query) : request.query !... | 6 |
private void showLine() {
for(int i = 0; i < getMessage().length();i++)
out.print(symbol);
out.println();
} | 1 |
private void preencherJTableData(Date dataInfo) {
carregarJTable();
final int I = 0;
ConsultaController uc = new ConsultaController();
modelo.setRowCount(I);
PainelRolagem.setViewportView(tabela);
System.out.println("getRowCount ");
tabela.updateUI();
Pai... | 4 |
public ResultSet retornarResultSet(String pSQL)throws Exception{
Connection con = null;
try {
abrirConexao();
}
catch (Exception ex) {
throw ex;
}
try {
Statement stmt = (Statement)conbco.createStatement();
Re... | 3 |
public TheWorld() throws HeadlessException {
super("This is the world, and God syas ...");
p = new Panel();
p.setBackground(Color.black);
add(p);
btnLand = new LetThereBeLandCommand("Let there be land", p);
btnLight = new LetThereBeLightCommand("Let there be light", p);
p.add(btnLand);
... | 0 |
public void visitMultiANewArrayInsn(final String desc, final int dims) {
Item i = cw.newClassItem(desc);
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
if (compute == FRAMES) {
currentBlock.frame.execute(Opcodes.MULTIANEWARRAY, dims, cw, i);
} else {
// updates current stack ... | 2 |
@Override
public Iterable<V> values() {
ArrayList<V> values = new ArrayList<>();// return container
for (int i = 0; i < capacity; i++) {
if ((bucket[i] != null) && (bucket[i] != available))
values.add(bucket[i].getValue());
}
return values;
} | 3 |
public void movePegsHere() {
movePegsHorizontally(x, y, z);
x.centerY = centerY + height/2 - vertMargin;
z.centerY = centerY + height/2 - vertMargin;
y.centerY = centerY + height/2 - vertMargin;
} | 0 |
private void BtonremActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtonremActionPerformed
vtexto = Ctexto.getText();
DefaultTableModel tr = (DefaultTableModel)tabla.getModel();
try
{
Statement s = cone.getMiConexion().createStatement();
String... | 8 |
public String getFreemindBaseDir() {
if (baseDir == null) {
try {
File file;
String dir = System.getProperty("freemind.base.dir");
if (dir == null) {
// Property isn't set, we try to find the
// base directory ou... | 7 |
public static void newMappingSession() {
long newSession = System.currentTimeMillis();
String date = Utils.sessdate(newSession);
try {
if(Config.autoSaveMinimaps){
(new File("map/" + date)).mkdirs();
Writer currentSessionFile = new FileWriter("map/currentsession.js");
currentSessionFile.write("var cur... | 2 |
@Override
public void action() {
for(PlayerInterface PlayerInterface :GameModel.getPlayers()){
Player player=PlayerInterface.getPlayer();
if(hypetunusan(x,y,player.getPosX(),player.getPosY())<400){
double vinkeln=Math.atan2((x-player.getPosX()), (y-player.getPosY()+1));
int diffX=(int) (Math.s... | 7 |
public void readCounts() throws IOException{
System.out.println("started processing " + dirName);
TextFile in = null;
String line = "";
String[] splLine;
int index = 0;
//all genes from bed12, sorted
//allTranscr = getAllTranscripts();
getAllGenes();
... | 5 |
public void setUrl(String url) {
this.url = url;
} | 0 |
@Override
public String toString() {
return "LOAD " + new Integer(offset).toString() + " " + identifier
+ " <load " + identifier
+ ">";
} | 0 |
public void print_extraction_method_XML(Hashtable<String, LinkedList<Triple<String,String,String>>> relations) throws IOException {
w.write("<?xml version=\"1.0\"?>\n<rdf:RDF\nxmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n");
LinkedList<Tuple<String, LinkedList<Triple<String,String,String>>>> relation... | 2 |
public byte[] getMessage(int offset) {
int l = PAYLOAD_SIZE - offset;
byte[] message = new byte[l];
for(int i = 0; i < l; i++) {
message[i] = payload[i + offset];
}
return message;
} | 1 |
@SuppressWarnings("unchecked")
public static <T extends Annotation> T getAnnotation(AnnotatedElement elem, Class<T> annType) {
T result = null;
for(Annotation annot : getAllAnnotations(elem, annType)) {
if(annType.isAssignableFrom(annot.getClass())) {
result = (T) annot;
break;
}
}
return resul... | 2 |
public boolean tarkistaRivit(int kuka) {
int vierekkaiset = 0;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
if (poyta[i][j] == kuka) {
vierekkaiset++;
}
}
if (vierekkaiset == 3) {
retu... | 4 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
System.out.println("leitura");
try {
Leitor leitor = new Leitor(this.arqentrada.getText());
System.out.println("Carregamento");
Objeto obj =... | 5 |
public int GetTestCount(){
int result = 0;
Connection conn = null;
PreparedStatement st = null;
ResultSet rs = null;
try {
// ConnectionManager.GetComboPooledDataSource() is an instance of c3p0's ComboPooledDataSource
conn = ConnectionManager.GetComboPooledDataSource().getConnection();
... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
synchronized (accountConfig) {
ExecutorService threadsPool = accountConfig.executorService;
List<Future<?>> jobs = new ArrayList<>();
for (final AccountVO accountVO : accountList) {
System.out.println(... | 9 |
public double unwrapFloatingPoint() {
if (!isFloatingPoint) { //If not floating point, return intOperand as floating point value (fraction will be 0).
double castFloatingPointOperand = (double) intOperand;
return castFloatingPointOperand;
}
return floatingPointOperand;
} | 1 |
public boolean determineIfFinished () {
int i = 0, j = 0;
/* Checks the size */
if (size.equals("9x9")) {
/* Uses nested for loops and if statements to check if the game is finished based on all places being full or more errors remaining */
for (i = 0; i < 9; i++) {
for (j = 0; j < 9; j++... | 7 |
public static int getTypeTag(Class type)
{
if (type == ScriptRuntime.StringClass)
return JAVA_STRING_TYPE;
if (type == ScriptRuntime.IntegerClass || type == Integer.TYPE)
return JAVA_INT_TYPE;
if (type == ScriptRuntime.BooleanClass || type == Boolean.TYPE)
... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Token other = (Token) obj;
if (end != other.end)
return false;
if (start != other.start)
return false;
if (text == null) {
if (other... | 9 |
private boolean camposCompletos (){
if((!field_codigo.getText().equals(""))&&
(!field_nombre.getText().equals(""))&&
(!field_apellido.getText().equals(""))&&
(!field_localidad.getText().equals(""))&&
(!field_direccion.getText().equals(""))&&
(!field_sit_fre... | 6 |
public boolean isInside(LonLat l) {
return l.getLon() >= leftTop.getLon()
&& l.getLon() <= rightBottom.getLon()
&& l.getLat() >= rightBottom.getLat()
&& l.getLat() <= leftTop.getLat();
} | 3 |
public Direction getEdgeDirection(Edge edge) {
for (Map.Entry<Direction, Edge> e : edges.entrySet()){
if (e.getValue() == edge){
return e.getKey();
}
}
throw new IllegalArgumentException("Edge is not set on this Tile");
} | 2 |
private void printSheetContent(Sheet sheet) {
/* skip column heads */
//printColumnHeads();
out.format("<tbody>%n");
Iterator<Row> rows = sheet.rowIterator();
while (rows.hasNext()) {
Row row = rows.next();
out.format(" <tr>%n");
/* skip fir... | 7 |
public boolean before(Temps t)
{
boolean egal= ((this.heures==t.heures) &&( this.minutes==t.minutes) && ( this.secondes==t.secondes));
return (t.after(this) && !egal) ;
} | 3 |
public SingleTreeNode egreedy() {
SingleTreeNode selected = null;
if(m_rnd.nextDouble() < egreedyEpsilon)
{
//Choose randomly
int selectedIdx = m_rnd.nextInt(children.length);
selected = this.children[selectedIdx];
}else{
//pick the bes... | 4 |
public void putAll( Map<? extends K, ? extends Double> map ) {
Iterator<? extends Entry<? extends K,? extends Double>> it = map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends K,? extends Double> e = it.next();
this.put( e.getKey(), e.getValue() );
... | 8 |
public double getEffMult() {
return effectivenessMultiplier;
} | 0 |
@Override
public void execute(CommandSender sender, String worldName, List<String> args) {
this.sender = sender;
if (worldName == null) {
error("No world given.");
reply("Usage: /gworld delete <worldname>");
} else if (!hasWorld(worldName)) {
reply("World not found: " + worldName);
} else {
if (... | 4 |
private void initComponents() {
mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout());
outerSplitPane = new javax.swing.JSplitPane();
rightSplitPane = new javax.swing.JSplitPane();
defaultDisplayPane = new DisplayPane();
// Create the outer split pane, which houses the file tr... | 7 |
public void setTarget(String target) {
this.target = target;
} | 0 |
public double getDeviation()
{
double deviation=0;
for (int i = 0; i < NFRUIT; i++)
{
deviation += (mExpDistrib[i] * mPreferences[i] * mPreferences[i]);
}
return Math.sqrt(deviation);
} | 1 |
@Override
public List<ChessPosition> getPosCanMove(ChessPosition current) {
List<ChessPosition> pos = new ArrayList<ChessPosition>();
ChessPosition CpTemp;
int x, y, upBound, lowBound, leftBound, rightBound, value;
int dx[] = { 0, 1, 1, -1, -1 };
int dy[] = { 0, 1, -1, 1, -1 };
// khoi tao gioi han di chuy... | 9 |
public static List<Feed> parseExportedFile(File ExportedFile) {
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
try {
Reader fileReader = new FileReader(ExportedFile);
XMLEventReader reader = inputFactory.createXMLEventReader(fileReader);
feeds = new ArrayList<Feed>();
while (reader.hasN... | 6 |
public static void main(String[] args) {
double[] projectScores;
int nStudents;
double aScore;
double average = 0;
double stdDeviation = 0;
//
// Creates a sScanner object
//
Scanner keyboard = new Scanner(System.in);
//
// Prompt the user for the number of students
//
System.out.prin... | 7 |
@Override
public void move(GameBoard b) {
initOtherPlayer(b);
MoveNode root = new MoveNode(b);
addChildren(root);
//ok now we have a full map.
scoreTree(root);
//and we know, for each move, the number of wins, losses, and ties possible.
//first, try to avoid losses.
MoveNode bestNode = new Mov... | 6 |
Type(int id) {
this.id = id;
} | 0 |
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.