text stringlengths 14 410k | label int32 0 9 |
|---|---|
public Network(Layer[] layers) {
// проверки
if (layers == null || layers.length == 0) throw new IllegalArgumentException();
// проверим детально
final int size = layers.length;
for (int i = 0; i < size; i++)
if (layers[i] == null || (i > 1 && layers[i].getInputSize()... | 6 |
public void draw(Graphics surface) {
// Draw the object
surface.setColor(color);
surface.fillRect(x - SIZE / 2, y - SIZE / 2, SIZE, SIZE);
surface.setColor(Color.BLACK);
((Graphics2D) surface).setStroke(new BasicStroke(3.0f));
surface.drawRect(x - SIZE / 2, y - SIZE / 2, SIZE, SIZE);
// Move the center o... | 8 |
public static Vault getPlayerVault(String player, int id)
{
if(hasCachedVault(player, id))
{
return getCachedVault(player, id);
}
Vault vault = new Vault(Config.getConfig().getInt("vault-rows"), player, id);
if(BackendType.equals(Backends.MySQL))
{
ResultSet results = sqlConnection.dbStm("SELECT * FR... | 9 |
@Override
public int count() {
return _source.length;
} | 0 |
private static void writeBestOrganism() throws Exception {
String path = "bestOrganism.txt";
EcritureTXTfichier toFile = new EcritureTXTfichier(path);
toFile.writeToFile(path);
List< List<Double>> answers_results = new ArrayList<>();
answers_results = neatANN.getBestOrganismAnsw... | 2 |
public void seeQuizScore(User user){
List<Quiz> quizes = new ArrayList<Quiz>();
// initialise quiz model
QuizModel quizM = new QuizModel();
// list of all user quizes
quizes = quizM.getUserList(user.getId());
int i = 1;
try{
if(quizes.get(0).getId()>0){
UserInputManager inpM = new UserInp... | 7 |
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("USAGE: wc file");
System.exit(1);
}
Reader reader = null;
try {
reader = new FileReader(args[0]);
int nl = 0, nw = 0, nc = 0;
int data;
boolean inWord = false;
while ((data = reader.read()) != -1)... | 9 |
private void updateKeys()
{
for (int key = 0; key < keys.length; key++)
{
lastKeys[key] = keys[key];
keys[key] = Keyboard.isKeyDown(key);
}
} | 1 |
private JList<FolderConfig> buildLeftSideList(final JPanel left) {
final DefaultListModel<FolderConfig> listModel = new DefaultListModel<FolderConfig>();
final JList<FolderConfig> list = new JList<>(listModel);
if (!GuiUtils.syncConfig.getConfigs().isEmpty()) {
for (final FolderConfig folder : GuiUtils.syncCo... | 4 |
private void doCloseCommand(CommandSender sender, Command cmd, String label, String[] args) {
if(sender instanceof Player) {
ItemStack item = ((Player) sender).getItemInHand();
BookMeta meta = null;
Matcher titleMatcher = null;
if(item.getType() == Material.WRITTEN_BOOK) {
meta = (BookMeta) item.getIt... | 7 |
void sortList(List<Integer> list, int k)
{
if(k == 0) return;
int val = list.get(0);
List<Integer> leftList = new ArrayList<Integer>();
List<Integer> rightList = new ArrayList<Integer>();
int left = 0;
int right = 0;
for(int i = 1; i<list.size(); i++){
if(list.get(i)<val){
leftList.add(list.get... | 7 |
public void putAll( Map<? extends K, ? extends Character> map ) {
Iterator<? extends Entry<? extends K,? extends Character>> it = map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends K,? extends Character> e = it.next();
this.put( e.getKey(), e.getVa... | 8 |
@Override
public String getElementAt(int index) {
if(getSize() <= 0 || getSize() <= index) {
return "Ups,not that many Entries!";
}
return FW.getObjectNames().get(index);
} | 2 |
public void startmaingame() {
if (k != 10 && k >= 1) {
k--;
}
else if (k == 0 && introduction == 0) {
k = 10;
getWorld().removeObjects(getWorld().getObjects(Blowfish.class));
getWorld().removeObjects(getWorld().getObjects(Jellyfish.clas... | 6 |
private void updateLists() {
for (int i = 0; i < spaceJunk.size(); i++) {
spaceJunk.get(i).update();
}
for (int i = 0; i < planets.size(); i++) {
planets.get(i).update();
}
for (int i = 0; i < bullets.size(); i++) {
bullets.get(i).update();
... | 6 |
public MessageBuilder build() {
for (String sender : this.senders) {
String message = this.message;
Config messages_config = this.message_config;
String finalmessage;
if (messages_config != null) {
if (messages_config.getFile().get(message) != null) {
finalmessage = (String) messages_conf... | 9 |
private void checkForPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
int tabNumber = pane.getUI().tabForCoordinate(pane, e.getX(), e.getY());
if (tabNumber >= 0) {//must be a tab
Component c = e.getComponent();
menu.setCurrentTab(tabNum... | 2 |
public static double frechetCDF(double mu, double sigma, double gamma, double lowerlimit, double upperlimit) {
double arg1 = (lowerlimit - mu) / sigma;
double arg2 = (upperlimit - mu) / sigma;
double term1 = 0.0D, term2 = 0.0D;
if (arg1 >= 0.0D) term1 = Math.exp(-Math.pow(arg1, -gamma));
if (arg2 >= 0.0D) ter... | 2 |
public void setSex(String sex) {
this.sex = sex;
} | 0 |
private boolean jj_3R_34() {
if (jj_3R_23()) return true;
return false;
} | 1 |
public void processEvent(AWTEvent paramAWTEvent)
{
super.processEvent(paramAWTEvent);
if (((paramAWTEvent instanceof MouseEvent)) && (this.EventTransparent))
{
MouseEvent localMouseEvent1 = (MouseEvent)paramAWTEvent;
Container localContainer = getParent();
Component[] arrayOfComponent ... | 8 |
public static String unescape(String in) {
StringBuilder out = new StringBuilder();
char last = 0;
for (char c : in.toCharArray()) {
if (c == ESC) {
if (last != 0 && last == ESC)
out.append(c);
}
else
out.ap... | 4 |
public void paintComponent(Graphics g)
{
// Get the Graphics2D version of the Graphics g by casting
Graphics2D g2 = (Graphics2D) g;
// Represents the width and the x coordinate of drawing the red and white
// rectangles in the panel. Initially set to the value of drawing the
// rectangles to the right of... | 8 |
public boolean createDirToLocal(String parentPath, String dirName) {
try {
String dirPath;
if (parentPath.length() == user.getUsername().length() + 1) { // username\
dirPath = parentPath + dirName;
} else { // username\***
dirPath = parentPath + "\\" + dirName;
}
//System.out.println(dirPath... | 9 |
protected static int toUByte(final byte b) {
return b < 0 ? b + 0x100 : b;
} | 1 |
void saveFile() {
if (fileName != null) {
FileWriter file = null;
try {
file = new FileWriter(fileName);
file.write(styledText.getText());
file.close();
} catch (IOException e) {
showError(getResourceString("Error"), e.getMessage());
} finally {
try {
... | 4 |
@Override
public void onPlayerCommandPreprocess (PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
String command = event.getMessage();
String[] split = command.split(" ");
if (!event.isCancelled() && split[0].equalsIgnoreCase("/backup")) {
event.se... | 8 |
public Boolean doubleRotation(privAVLNode r,int dir)
{
//Check valid inputs
if(!(dir == 1 || dir == 0))
return false;
if(r == null)
return false;
privAVLNode save1 = r.getChild(dir);
if(save1 == null)
return false;
privAVLNode save2 = save1.getChild((dir+1)%2);
if(save2 == null)
r... | 6 |
public String getOrdGroopString()
{
// Construct the groop string
Collection<String> main = getMainGroops();
Iterator<String> gIt = main.iterator();
StringBuffer groop = new StringBuffer("");
while (gIt.hasNext())
groop.append(gIt.next() + " & ");
// Remove the trailing ... | 2 |
public void run(){
if (!armChannel.getAnimationName().equals("ArmRun") && !hasSwung){
armChannel.setAnim("ArmRun");
}
if (!legChannel.getAnimationName().equals("LegRun")){
legChannel.setAnim("LegRun");
}
} | 3 |
public void scanFileCollection(File src){
if (src.isDirectory()){
for (File child: src.listFiles())
scanFileCollection(child);
}
else{
try {
//Deal with artist tag
String artist = MetadataParser.getArtist(src);
if(artist!=null){
int origSize=artistNames.size();
artist... | 9 |
private void logPage(){
logPane = new JPanel();
logPane.setBackground(SystemColor.activeCaption);
logPane.setLayout(null);
JLabel lblTreatmentLog = new JLabel("Treatment Log");
lblTreatmentLog.setHorizontalAlignment(SwingConstants.CENTER);
lblTreatmentLog.setFont(new Font("Arial", Font.BOLD, 30));
lblT... | 5 |
private void findNeighbors(BKTree<? extends T> root, List<? super T> neighbors) {
T rhs = root.getValue();
int crntDistance = distance.compare(center, rhs);
if (crntDistance < tolerance) {
neighbors.add(rhs);
}
for (int x = crntDistance - tolerance; x <= crntDistance... | 5 |
private void createAndShowTipWindow(final MouseEvent e, final String text) {
Window owner = SwingUtilities.getWindowAncestor(textArea);
tipWindow = new TipWindow(owner, this, text);
tipWindow.setHyperlinkListener(hyperlinkListener);
// Give apps a chance to decorate us with drop shadows, etc.
PopupWindowDec... | 6 |
public void decrementFood() {
if (this.food > 0) {
this.food--;
}
} | 1 |
public void testCopyRecursivelyFromJar() throws IOException {
Debug.println("fileio", " my tmpdir = " + tmpDir);
File targetFoo = null, targetBar = null,
newDestDir = null;
File jarFile = new File(tmpDir, "test.jar");
try {
JarOutputStream jf =
new JarOutputStream(new ... | 4 |
public void printAnalysisResultsEP() {
String string = "";
for (int i = 0; i < bestSequenceAlternativesEnergyPoint.size(); i++)
string += i + ": " + bestSequenceAlternativesEnergyPoint.get(i) + "CONSUMPTION:" + consumptionEnergyPoints[i] + "EP\n";
System.out.println(string);
} | 1 |
public static int phi(int num) {
if (num == 1)
return 1;
if (isPrime(num))
return num-1;
if (num % 2 == 0) { //using 2 identity
num /= 2;
return (num % 2 == 0 ? 2 : 1) * phi(num);
}
//this is the identity:... | 4 |
private int scanLongstring()
{int count = 0, countaux = 0;
//Neste ponto ja verificou que esta usando colchete e ja aceitou para diferenciar em scanToken() o =
while(currentChar == '=')
{
takeIt();
count++;
}
take('[');
while(currentChar != SourceFile.EOT) //A condicao de parada ... | 9 |
private FileWatcherService(List<String> watchedFiles,EventBus eventBus)
{
try
{
watcher = FileSystems.getDefault().newWatchService();
this.eventBus = eventBus;
register(watchedFiles);
INSTANCE = this;
}
catch (Exception e)... | 1 |
public void setColor(Color color) {
this.color = color;
} | 0 |
public void listenUsersHands() throws InvalidSubscriptionException,
IOException {
waitHandsSub = elvin.subscribe(NOT_TYPE + " == '" + BROADCAST_HAND
+ "' && " + GAME_ID + " == '" + gameHost.getID() + "'");
waitHandsSub.addListener(new NotificationListener() {
public void notificationReceived(Notificatio... | 3 |
@Basic
@Column(name = "PRP_ESTADO")
public String getPrpEstado() {
return prpEstado;
} | 0 |
public ServletManager(CWConfig config)
{
servlets = new Hashtable<String,Class<? extends SimpleServlet>>();
servletStats = new Hashtable<Class<? extends SimpleServlet>, RequestStats>();
servletInit = new Hashtable<Class<? extends SimpleServlet>, Boolean>();
for(final String context : config.getServlets().ke... | 8 |
public void addUnit(core.GroupOfUnits unit, List<core.GroupOfUnits> list, QListWidget widget)
{
boolean found = false;
int i=0;
for (core.GroupOfUnits u: list) {
if (u.type == unit.type) {
u.setNumber(u.getNumber() + unit.getNumber());
widget.item(i).setText(u.type.name + " ("+u.getNumber()+")");
... | 3 |
private boolean jj_3R_31() {
if (jj_3R_72()) return true;
return false;
} | 1 |
private void Update()
{
if(timeForNextFrame <= System.currentTimeMillis())
{
// Next frame.
currentFrameNumber++;
// If the animation is reached the end, we restart it by seting current frame to zero. If the animation isn't loop then we set that animation isn't a... | 3 |
private boolean camposCompletos (){
if((combo_tipo.getSelectedIndex()>=0)&&
(fecha.isFechaValida(field_desdee.getText()))&&
(fecha.isFechaValida(field_hasta.getText()))&&
(!field_tasa.getText().equals(""))&&
(!field_sobretasa.getText().equals(""))
){
... | 5 |
private void statementBlock()
{
expect(Token.Kind.OPEN_BRACE);
statementList();
expect(Token.Kind.CLOSE_BRACE);
} | 0 |
public static void DisplayLogin(Login login,ServerAccountConfig accountconfig){
System.out.println("--------------------------");
System.out.println("New Client Login");
System.out.println("--------------------------");
System.out.println("Account : " + login.Account);
System.out.println("SPNum : " + ac... | 0 |
public static void updateCommercial(int id, int idservice, int idville, String nom, String prenom, String adresse1, String adresse2) throws SQLException {
int result;
String query;
try {
query = "UPDATE COMMERCIAL set ID_VILLE=?,COMMNOM=?,COMMPRENOM=?,COMMADRESSE1=?,COMMADRESSE2=? wh... | 1 |
public boolean on( int x, int y )
{
return !(x < 0 || y < 0 || x >= width || y >= height) && (mask[y][x] == _);
} | 4 |
public void body()
{
// Gets the PE's rating for each Machine in the list.
// Assumed one Machine has same PE rating.
MachineList list = super.resource_.getMachineList();
int size = list.size();
machineRating_ = new int[size];
for (int i = 0; i < size; i++) {
... | 9 |
private void validerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_validerMouseClicked
// TODO add your handling code here:
if (jrbHel.isSelected()) {
choix = 0;
} else if (jrbSurt.isSelected()) {
choix = 1;
} else if (jrbJormungand.isSelected()) {... | 6 |
private int paethPredictor(byte[] line, byte[] previousLine, int x, int xp) {
int a = 0xFF & ((xp < 0) ? 0 : line[xp]);
int b = 0xFF & previousLine[x];
int c = 0xFF & ((xp < 0) ? 0 : previousLine[xp]);
int p = a + b - c;
int pa = (p >= a) ? (p - a) : -(p - a);
int pb = (p >= b) ? (p - b) : -(p - b);
int ... | 8 |
public static Stella_Object accessBacklinksIndexSlotValue(BacklinksIndex self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Logic.SYM_LOGIC_DEPENDENT_PROPOSITIONS_LIST) {
if (setvalueP) {
self.dependentPropositionsList = ((SequenceIndex)(value));
}
else {
... | 6 |
@Override
public boolean isMoveValid(int srcRow, int srcCol, int destRow, int destCol) {
// TODO Auto-generated method stub
boolean result = false;
if(
((destCol == (srcCol - (srcCol - destCol))) && (destRow == (srcRow + (srcCol - destCol)))) || // down left diagonal
((destCol == (srcCol + (destCol -... | 8 |
public void setSortByName(boolean sort) {
if (!sortByName) {
Collections.sort(listPhoneBook, new SortedByFirstName());
sortByName = true;
} else {
Collections.sort(listPhoneBook, Collections.reverseOrder(new SortedByFirstName()));
sortByName = false;
}
} | 1 |
public Account create() {
UUID accountId = UUID.randomUUID();
AccountImpl accountImpl = new AccountImpl(accountId);
Account newAccount = null;
try{
org.omg.CORBA.Object objRef = rootpoa.servant_to_reference(accountImpl);
newAccount = AccountHelper.narrow(objRef);
accounts.put(UUID.fromString(newAccount... | 1 |
@Override
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
if (Universal.testing)
return;
if (data == null) {
if (Script.holdExecution()) {
return;
}
data = new SkillData();
}
Queue<Skil... | 8 |
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 void searchMenu()
{
System.out.println("Search by what?");
System.out.println("1:Stock Number");
System.out.println("2:Category");
System.out.println("3:Manufactuer");
System.out.println("4:Model Number");
System.out.println("5:Description");
System.out.println("6:Accessory");
int input = scanne... | 8 |
public static void kill() {
runGC = false;
for (int i = 0; i < 200; i++) {} // Just wait a bit
gc.interrupt();
} | 1 |
@SuppressWarnings("unchecked")
public String loadEvents() {
PreparedStatement st = null;
ResultSet rs = null;
JSONArray json = new JSONArray();
try {
conn = dbconn.getConnection();
st = conn.prepareStatement("SELECT * FROM events");
rs = st.execute... | 5 |
public float getindiTakings(Date date, Movie movie) {
indiTakings = 0;
for(ShowTime st : movie.getShowTimes()) {
calendar.setTime(date);
int cDay = calendar.get(Calendar.DATE);
int cMonth = calendar.get(Calendar.MONTH);
int cYear = calendar.get(Calendar.YEAR);
calendar.setTime(st.getTime());
... | 6 |
public String toString()
{
String res = "";
for (int i = 0; i < this.hauteur; i++)
{// Parcours le premier tableau
for (int j = 0; j < this.largeur; j++)
{// Parcours le second tableau
switch (this.background[i][j])
{
case MUR : res = res +"M"; break;
case HERBE : res = res +"H"; break... | 9 |
private void startThread() throws Exception {
if (secureInstance.getInstance() != null) {
// Initialize a new Thread with a random ThreadGroup and a new Name
ownThread = new Thread(CodeSupSecurityManager.getInstance()
.getThreadGroup(securityKey), this,
secureInstance.getClassName() + "." + methodNa... | 7 |
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... | 7 |
@EventHandler
public void SpiderFastDigging(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getSpiderConfig().getDouble("Spider.Fas... | 6 |
private void init() {
if (titleStyle == null) {
titleStyle = page.addStyle(null, null);
StyleConstants.setBold(titleStyle, true);
StyleConstants.setFontSize(titleStyle, Page.getDefaultFontSize() + 10);
StyleConstants.setFontFamily(titleStyle, Page.getDefaultFontFamily());
}
if (subtitleStyle == null) ... | 7 |
public void initialize(boolean flag) {
int i;
int a, b, c, d, e, f, g, h;
a = b = c = d = e = f = g = h = RATIO;
for(i = 0; i < 4; ++i) {
a ^= b << 11;
d += a;
b += c;
b ^= c >>> 2;
e += b;
c += d;
c ^= d << 8;
f += c;
d += e;
d ^= e >>> 16;
g += d;
e += f;
e ^= f << 10;
... | 5 |
public StructuredBlock findCase(FlowBlock destination) {
for (int i = 0; i < caseBlocks.length; i++) {
if (caseBlocks[i].subBlock != null
&& caseBlocks[i].subBlock instanceof EmptyBlock
&& caseBlocks[i].subBlock.jump != null
&& caseBlocks[i].subBlock.jump.destination == destination)
return case... | 5 |
public Selector selector() {
return new SequenceSelector();
} | 0 |
public static String createNewNameMessage(String myNewName) {
JSONObject jsonMsg = new JSONObject()
.element( "code", "4" )
.element( "name", myNewName )
;
return jsonMsg.toString();
} | 0 |
public boolean contains(int[] cycle, int size, Main m){
boolean result = false;
for(int i=0; i<cycle.length; i++){
if(graphNodes.get(cycle[i]).getType()==_MOLECULE_){
if( m.getLibrary().get( graphNodes.get(cycle[i]).getID() ).getNumNodes() > size*10 ){
resu... | 3 |
@SuppressWarnings({ "rawtypes", "unchecked" })
public Object process(Object value) {
// we're processing things which are either PhpObjects or which could contain PhpObjects.
if (value instanceof PhpObject) {
PhpObject tmpPHP = (PhpObject) value;
value = tmpPHP.getRealObject();
} else if (value instanceof ... | 7 |
public ReportForeignAffairPanel(FreeColClient freeColClient, GUI gui) {
super(freeColClient, gui, Messages.message("reportForeignAction.name"));
// Display Panel
reportPanel.removeAll();
reportPanel.setLayout(new MigLayout("wrap 2", "[]push[]", "[align top]"));
for (Player ene... | 6 |
public void test_add_long_long() {
assertEquals(567L, iField.add(567L, 0L));
assertEquals(567L + 1234L * 90L, iField.add(567L, 1234L));
assertEquals(567L - 1234L * 90L, iField.add(567L, -1234L));
try {
iField.add(LONG_MAX, 1L);
fail();
} catch (ArithmeticE... | 2 |
protected void configConnection(HttpURLConnection conn) {
conn.setReadTimeout(DownloadUtils.READ_TIMEOUT);
conn.setConnectTimeout(DownloadUtils.CONNECT_TIMEOUT);
Set<Entry<String, String>> entrySet = DownloadUtils.ORIGIN_EXTRA_HEADER.entrySet();
for (Entry<String, String> entry : entrySet) {
conn.setRequestP... | 3 |
public Player(Point position, int baseSpeed, int baseForce, int healt,
int maxhealth, World currentWorld, String name, Color color,
int energy) {
super(position, baseSpeed, baseForce, healt, maxhealth, currentWorld,
name, color, energy);
} | 0 |
public void applyPreserveRule(IdentifierMatcher preserveRule) {
if (preserveRule.matches(this)) {
System.err.println("preserving: " + this);
setReachable();
Identifier ident = this;
while (ident != null) {
ident.setPreserved();
ident = ident.getParent();
}
}
for (Iterator i = getChilds(); i... | 3 |
public boolean jumpNeighbour(Hexpos other) {
if (jumpNeighbours().contains(other))
return true;
return false;
} | 1 |
public SimplexNoise2D(long seed) {
Random random = new Random(seed);
for (int i = 0; i < 256; i++) {
mTable[i + 256] = mTable[i] = random.nextInt(256);
mTableMod12[i + 256] = mTableMod12[i] = mTable[i] % 12;
}
} | 1 |
protected String replaceCallsToRgb(String line) {
if (line.contains("rgb(") && line.contains(")")) {
// simplify text like rgb(35,32,32)
int start = line.indexOf("rgb(") + 4;
int end = line.indexOf(")");
String sub = line.substring(start, end); // gets a string that looks like: 0,0,0
String comp[] = su... | 7 |
private static double getLambda(double clock) {
switch ((int) clock) {
case 0:
return 58.0;
case 1:
return 50.0;
case 2:
return 70.0;
case 3:
return 80.0;
case 4:
return 40.0;
case 5:
return 60.0;
case 6:
return 50.0;
case 7:
return 70.0;
default:
return 0;
}
} | 8 |
public void loadElev(Node node) throws ParseException {
Elev el = new Elev();
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node cNode = childNodes.item(i);
if (cNode instanceof Element) {
String content = cNode.getLastChild().getTextContent().trim();
... | 8 |
public void removeSelected()
{
layout.takeAt(selectedNo).widget().dispose();
objects.remove(selectedNo);
if (checkable) {
selectedNo = 0;
((WidgetChooserButton)(layout.itemAt(selectedNo).widget())).setChecked(true);
selected(objects.get(selectedNo));
}
} | 1 |
protected void drawHands(){
Card[] shelf = tm.getP1().getShelf();
for(int index=0; index<shelf.length; index++){
if(shelf[index]!=null){
shelf[index].drawCard(main, 50+index*50, 500);
}
}
Card[] flop = tm.getP1().getFlop();
for(int index=0; index<flop.length; index++){
if(flop[index]!=null){
... | 6 |
public synchronized void decisionMessage(int senderID, DecisionMessage dm) {
console.displayMessage(senderID + " voted for " + dm.getDecision());
if (dm.getVotingID() != id) {
console.displayMessage("Got decision message with invalid voting id. Dropping message...");
return;
}
System.out.println(123);
f... | 5 |
public void decodeAndRender(int id, String message) throws JSONException {
switch (id) {
case 100: // Chat message
Message chatMessage = enc.chattMessageDecode(message);
tg.chat.chatUpdate(chatMessage.message, chatMessage.user);
break;
case 201: // Move message
TiarUserMessage mess = enc.tiarUse... | 9 |
public static void main(String[] args) throws Exception {
String arffFile = "/home/abrari/Tesis/GP-Experiment/data/Gm01.arff";
CSVReader reader = new CSVReader(new FileReader(arffFile), ',', '\'', 21);
String[] line;
double[] d;
// 0 = true, 1 = false
int predicted;
... | 7 |
public boolean add(Order order)
{
Session s = sessionManager.getSession();
try
{
if (!s.executeNonQuery("insert into Orders (VendorID, BaseID, OrderTime, Amount) values(?, ?, ?, ?)"
, order.getVendor().getId(), order.getPizzaBase().getId(), order.getOrderTime().getTime(), ((Float)order.getAmount()).doub... | 5 |
protected AutomatonDrawer getDrawer() {
return drawer;
} | 0 |
public SystemLogger() {
super(fileOut);
System.setOut(this);
System.setErr(this);
} | 0 |
public static ConnectionManager Instance()
{
if (ConnectionManager.manager == null)
{
ConnectionManager.manager = init();
}
return ConnectionManager.manager;
} | 1 |
static void nativeLF() {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
String osName = System.getProperty("os.name");
if ((osName != null) && osName.toLowerCase().startsWith("lin")) {
UIManager.setLookAndFeel("com.sun.java.swing.pl... | 3 |
public boolean isVertical() {
return isVertical;
} | 0 |
@Override
public int compareTo(Element o) {
Integer size = this.value;
Integer osize = o.getValue();
return size.compareTo(osize);
} | 0 |
private int GetLogicActionSmrad(WumpusPolje[][] wumpusWorld){
if(tmpPolje.m_smrad){
//Down
if(tmpPolje.m_x + 1 < wumpusWorld.length && tmpPolje.m_y - 1 >= 0){
if(obiskanaPolja.contains(wumpusWorld[tmpPolje.m_x + 1][tmpPolje.m_y - 1]) && !wumpusWorld[tmpPolje.m_x + 1][tmpPolje.m_y - 1].m_smrad){
... | 9 |
public String getFeatureValue(String featureType) throws FeatureTypeNotFoundException {
String featureValue = "";
String[] singleFeatureTypes = featureType.split(Const.splitChar);
for (String singleFeatureType : singleFeatureTypes) {
if (features.containsKey(singleFeatureType)) {
if (featureValue.isEmpt... | 3 |
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.