text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public synchronized void clearDebri(Room room, int taskCode)
{
TickableGroup almostTock=null;
TickClient C=null;
ItemTicker I=null;
Iterator<TickClient> roomSet;
MOB mob=null;
for(final Iterator<TickableGroup> e=tickGroups();e.hasNext();)
{
almostTock=e.next();
roomSet=almostTock.getLoc... | 7 |
public List<Byte> getByteListFromString(String xArg)
{
if (xArg == null || xArg.equalsIgnoreCase(""))
return null;
List<Byte> d = new ArrayList<Byte>();
char[] c = xArg.toCharArray();
int lastPos = 0;
for (int i = 0; i < c.length; i++)
{
if (c[i] == ',')
{
d.add(Byte.valueOf(returnMerged... | 4 |
@Override
public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
if (object == null
|| (object instanceof String && ((String) object).length() == 0)) {
return null;
}
if (object instanceof Cotizacion) {
Cotizacion ... | 4 |
public String [] getOptions() {
String [] options = new String [9];
int current = 0;
options[current++] = "-X"; options[current++] = "" + m_CVFolds;
if (m_evaluationMeasure != EVAL_DEFAULT) {
options[current++] = "-E";
switch (m_evaluationMeasure) {
case EVAL_ACCURACY:
options[curr... | 8 |
public void actionPerformed(ActionEvent event)
{
System.out.println("TitleScreen.actionPerformed()");
Object source = event.getSource();
if (source == button_start) advanceTutorial();
else if (source == button_exit) game.quit();
// else if (source == buttonList[BUTTON_CONFIG_IDX]) toggleUserPanel... | 4 |
public void parseRange(final BitSet bitSet, final int min, final int max, final String range, final int interval) {
if(range.equals("*")) {
setBits(bitSet, min, max, interval);
return;
}
String[] split = range.split("-");
if(split.length == 1) {
int val = parseInt(split[0]);
if(val < min) th... | 7 |
public Float getXMax() {
return xMax;
} | 0 |
public static void hypothesizeChomsky(GrammarEnvironment env, Grammar g) {
CNFConverter converter = null;
try {
converter = new CNFConverter(g);
} catch (IllegalArgumentException e) {
JOptionPane.showMessageDialog(env, e.getMessage(),
"Illegal Grammar", JOptionPane.ERROR_MESSAGE);
return;
}
Prod... | 3 |
public void deploy(Territory territ, boolean all) {
if (territ.owner != activePlayer)
return;
String placing = troopAmountCombo.getSelectedItem().toString();
int toPlace = (all || placing.equals("All")) ? deployNum : Math.min(Integer.parseInt(placing), deployNum);
territ.addUnits(toPlace);
deployNum -= toP... | 4 |
private void designator()
{
if (have(NonTerminal.DESIGNATOR))
{
tryResolveSymbol(current);
nextToken();
while (accept(Token.Kind.OPEN_BRACKET))
{
expression0();
expect(Token.Kind.CLOSE_BRACKET);
}
}
} | 2 |
public boolean isEnabled()
{
return comp.isEnabled()
&& comp.getSelectedText()!=null;
} | 2 |
public String toString()
{
checkInvariants();
int numBits = (wordsInUse > 128) ? cardinality() : wordsInUse
* BITS_PER_WORD;
StringBuilder b = new StringBuilder(6 * numBits + 2);
b.append('{');
int i = nextSetBit(0);
if (i != -1)
... | 4 |
public static int numberActionsApplicableInState(State currentState, GroundedAction action1, GroundedAction action2, boolean reverse)
{
GroundedAction firstAction = (reverse) ? action2 : action1;
GroundedAction secondAction = (reverse) ? action1 : action2;
int count = 0;
State nextState = currentState.copy(... | 8 |
public boolean comparePattern (Pattern tablePattern ){
boolean levelingOK = (tablePattern.lowestRank < this.lowestRank);
log.debug("tablePaTTERN lowest Rank"+ tablePattern.lowestRank+" this lowest Rank "+ this.lowestRank);
boolean patternMatch = false;
//__catch bombs___
if(this... | 9 |
private boolean doReturnedReading() {
if (this.ended) return false;
while (!this.returned.isEmpty()) {
IByteReader rest;
while (true) {
rest = this.returned.getFirst();
if (rest.isEnded()) this.returned.pollFirst();
else break;
... | 9 |
public void parserWithTokenByChar() throws Exception {
Ngram ngram;
int count = 0;
Token pre = new Token(null, null);
String preWordWithAttr = null;
for (int i = 0; i < 10; i++)
list = lexer.nextTokenList();
while (current != null) {
if (current.getKind() == Token.Kind.TOKEN_WORD) {
if (pre.getK... | 7 |
int classCount(RoomScheme r, int code){
int count = 0;
for (Subject[] room : r.rooms) {
for (int j = 0; j<r.rooms[0].length; j++) {
if (room[j].getCode() == code) {
count ++;
}
}
} return count;
} | 3 |
public static String getDnaSequenceFromFrame(String inSequence, int frame) throws Exception
{
if ( frame == 0 )
return inSequence;
if ( frame == 1 )
return inSequence.substring(1);
if ( frame == 2)
return inSequence.substring(2);
if ( frame == 3)
return reverseTranscribe(inSequence);... | 6 |
@Override
public void keyPressed(KeyEvent e) {
switch(e.getKeyCode()) {
case KeyEvent.VK_UP:
instance.level.getPlayer().move(0, -1);
break;
case KeyEvent.VK_RIGHT:
instance.level.getPlayer().move(1, 0);
break;
case KeyEvent.VK_DOWN:
instance.level.getPlayer().move(0, 1);
break;
case KeyEven... | 5 |
public PermClass getClassUnderPoint(int x, int y)
{
for(PermClass p : PermData.getData().classes)
{
if(x >= p.x && x <= p.x + 30 && y >= p.y && y <= p.y + 30)
{
cox = x - p.x;
coy = y - p.y;
return p;
}
}
return null;
} | 5 |
private boolean checkPackage() {
if (getBarPackage().getApkFile() == null
|| !getBarPackage().getApkFile().canRead()) {
getLog().error("APK file is not specified or cannot be read.");
return false;
}
String apkName = getBarPackage().getApkFile().getName()... | 8 |
private void writeInt(List<Byte> ret, int val)
{
if (val < 0 || val >= 0x200000)
{
ret.add((byte)(((val >> 22) & 0x7f) | 0x80));
ret.add((byte)(((val >> 15) & 0x7f) | 0x80));
ret.add((byte)(((val >> 8) & 0x7f) | 0x80));
ret.add((byte)(val & 0xff));
}
else
{
if (val >= 0x4000)
{
ret.add(... | 4 |
@SuppressWarnings("unchecked")
public String open(String message,Signature signature){
//System.out.println("\n---------------Open protocol--------------\n");
long start = System.currentTimeMillis();
// Check if the signature is valid
String result = "";
try{
// Check validity
// Catch the fields
El... | 7 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + cacheSize;
result = prime * result + frequency;
result = prime * result + numberOfCores;
result = prime * result + numberOfThreads;
result = prime * result + ((socket == null) ? 0 : socket.hashCode());
ret... | 1 |
public static String selectQuery(String queryString)
{
BasicConfigurator.configure();
//create an object Sparql Query from a parameter string
Query query = QueryFactory.create(queryString);
try
{
//it connects to the server with Parliament and execute the query
QueryExecution exec = QueryExecutionF... | 1 |
public void deconnexionServeur() throws IOException {
connexion.envoyer("QUIT");
try { Thread.sleep(2000); }
catch (InterruptedException e) { e.printStackTrace(); }
connexion.fermer();
} | 1 |
public static String validateArtist(String artist) {
HashMap<String,String> artists = DataManager.getArtistMap();
for(String artistFromMap : artists.keySet()) {
int levDist = StringUtils.getLevenshteinDistance(artistFromMap.toUpperCase(), artist.toUpperCase());
double ratio = (artistFromMap.length() - levDist... | 4 |
public void putAll(Map<? extends K, ? extends V> m) {
cache.putAll(m);
} | 2 |
static public String fixUrl(String inUrl)
{
int docLoc = inUrl.lastIndexOf('.');
int protLoc = inUrl.indexOf("://");
int slashLoc = -1;
if (protLoc > 0)
slashLoc = inUrl.indexOf('/', protLoc+3);
else
slashLoc = inUrl.indexOf('/');
if (slashLoc < 0 ||
(slashLoc > 0 && docLoc < slashLoc)) // non... | 4 |
@Override
public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException {
List paramList1 = new ArrayList<>();
List paramList2 = new ArrayList<>();
StringBuilder sb = new StringBuilder(UPDATE_QUERY);
String ... | 1 |
private static Schedule getSchedule(Schedule bean, PreparedStatement stmt, ResultSet rs) throws SQLException{
stmt.setDate(1, bean.getWorkDay());
stmt.setString(2, bean.getUsername());
rs = stmt.executeQuery();
if (rs.next()) {
Schedule newBean = new Schedule();
newBean.setWorkDay(rs.getDate("work_d... | 1 |
@Override
public void init(ServletConfig config) throws ServletException{
try {
// Create a JNDI Initial context to be able to lookup the DataSource
InitialContext ctx = new InitialContext();
// Lookup the DataSource, which will be backed by a pool
// that the application... | 2 |
public SimpleReplace(String args[]) {
// Get input from the console
String startingPath = ConsoleTools.getNonEmptyInput("Enter starting path: ");
String match = ConsoleTools.getNonEmptyInput("Enter string to match: ");
String replacement = ConsoleTools.getNonNullInput("Enter string to replace: ");
String[]... | 1 |
private static void parseTestNgResultCreateCsv(List<String> urlsOrFiles, String csvFileName) {
List<TestResultData> testNgResultData = parseTestNgResultFromFilesOrUrls(urlsOrFiles);
CsvResultFile csvResultFile = new CsvResultFile();
try {
System.out.println("Creating csv file...");
... | 1 |
public Archive.ArchiveData read(HistoryLinkMap linkMap, LinkDataFactory linkFactory) throws IOException {
Archive.ArchiveData data = readArchiveData(linkMap, linkFactory);
for (Archive.RootObject obj : data.mRootObjects) {
if (obj.mDigest.isNullDigest()) {
continue;
... | 6 |
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object controller) throws Exception {
String uri = request.getRequestURI();
if(uri.endsWith("/login/login") ||
uri.endsWith("/login/logar")||
uri.endsWith("/usuario") ||
uri.e... | 6 |
public void onStart(IContext context) throws JFException {
this.engine = context.getEngine();
this.indicators = context.getIndicators();
this.acount = context.getAccount();
this.rsizone = false;
try {
File file = new File("copyOfRsi_onBar2.csv");
printWriter = new PrintWriter(new BufferedWriter(new Fil... | 1 |
public int dUpdateReservation(Reservation res) throws UnauthorizedUserException, BadConnectionException {
PreparedStatement pStmnt = null;
// close a reservation and leave a comment
try {
pStmnt = con.prepareStatement(qs.update_res_d);
pStmnt.setString(1, res.get... | 8 |
public void removeKey(String var) {
Boolean changed = false;
if(this.props.containsKey(var)) {
this.props.remove(var);
changed = true;
}
for (int i = 0; i < this.lines.size(); i++) {
String line = this.lines.get(i);
if (line.trim().lengt... | 7 |
@Override
public void onMoveFile(String arg0, String arg1, boolean replace,
DokanFileInfo arg3) throws DokanOperationException {
try {
if (replace)
{
try {
EntityInfo inf = fileSystem.getFileMetaData(mapWinToUnixPath(arg1));
if (DirectoryInfo.class.isInstance(inf))
fileSystem.deleteDirec... | 7 |
@Override
public boolean canMove(int x, int y)
{
int diagnolY = 0, digonlX = 0,dx=1,dy=1;
isValid = false;
isOccupiedByOppsitPiece=true;
if (Math.abs(x-(locationX/Chess.sizeOfSquare)) == Math.abs(y-(locationY/Chess.sizeOfSquare)))
{
isValid=true;
if (x < (locationX/Chess.sizeOfSquare))
{
... | 9 |
public SkladnikiManagerFrame(){
super("Zarz�dzaj sk�adnikami");
setSize(szerokosc, wysokosc);
setAlwaysOnTop(true);
Toolkit kit = Toolkit.getDefaultToolkit();
Dimension screenSize = kit.getScreenSize();
setBounds((screenSize.width-szerokosc)/2, (screenSize.height-wysokosc)/2,szerokosc,wysokosc);
setRes... | 7 |
public ConfigurationSection getConfigurationSection(String path) {
Object val = get(path, null);
if (val != null) {
return (val instanceof ConfigurationSection) ? (ConfigurationSection) val : null;
}
val = get(path, getDefault(path));
return (val instanceof Configura... | 3 |
private StringManager(String packageName) {
String bundleName = packageName + ".LocalStrings";
try {
bundle = ResourceBundle.getBundle(bundleName);
return;
} catch( MissingResourceException ex ) {
// Try from the current loader ( that's the case for trusted ap... | 7 |
public static void convert(String kfDescPath, String textFilePath)
throws IOException, ParserConfigurationException, SAXException {
// Get the file descriptor from the XML file.
KFileDescriptor kfd = new KFileDescriptor(kfDescPath);
// Validate that keyed file and output text file ... | 9 |
public void removeAutoFilter()
{
removeFilterDatabase(); // remove the _FILTER_DATABASE name necessary for AutoFilters
int zz = getIndexOf( AUTOFILTER ); // remove all AutoFitler records
while( zz != -1 )
{
SheetRecs.remove( zz );
zz = getIndexOf( AUTOFILTER );
}
// remove the two unknown records
... | 4 |
public void run()
{
boolean done = false;
while (!done)
{
showMenu();
int option = getOption();
doAction(option);
if (option == EXIT_OPTION)
{
done = true;
}
}
} | 2 |
protected void genClosedText(MOB mob, Exit E, int showNumber, int showFlag)
throws IOException
{
if((showFlag>0)&&(showFlag!=showNumber))
return;
if(E instanceof Item)
mob.tell(L("@x1. Exit Closed Text: '@x2'.",""+showNumber,E.closedText()));
else
mob.tell(L("@x1. Closed Text: '@x2'.",""+showNumber,E.... | 7 |
public void extract(String getdata)
{
if (getdata.startsWith("GET"))
{
get = getdata;
url = (getdata.substring(getdata.indexOf("/"))).split(" ")[0];
try {
url = URLDecoder.decode(url, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace(... | 9 |
public void roundInit(int round)
{
if(debug)
print("Custom Initializing...");
firstInvocation=true;
passNumber=1;
timesCanPass=nplayers-1-getIndex();
if(round==1)
{
timesCanPass=nplayers-timesCanPass-1;
}
timesCanPassInitial=timesCanPass;
stoppingThreshold=(int)Math.floor(timesCanPa... | 2 |
public static void renderSVG(Card card, Graphics2D g) {
try {
SVGDiagram diagram;
if (card == null) {
diagram = universe.getDiagram(ImageManager.class.getResource(urlBase + "blank.svg").toURI());
} else {
diagram = universe.getDiagram(ImageMa... | 3 |
static final void method3514(byte i) {
anInt4465++;
for (Class348_Sub27 class348_sub27
= ((Class348_Sub27)
Class348_Sub42_Sub20.aClass262_9711.getFirst(4));
class348_sub27 != null;
class348_sub27
= (Class348_Sub27) Class348_Sub42_Sub20.aClass262_9711
.nextForward((byte) 57)) {
if (((... | 7 |
public void run() {
byte[] receiveData = new byte[20000];
while(true && !this.stop) {
try {
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
getServer().receive(receivePacket);
ByteArrayInputStream bis = new ByteArrayInputStream(receivePacket.getData());
ObjectI... | 7 |
public static String unescape(String string) {
int length = string.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; ++i) {
char c = string.charAt(i);
if (c == '+') {
c = ' ';
} else if (c == '%' && i + 2 < length) {
... | 6 |
@Override
public void setDisplay() {
switch (area.terrain) {
case PLAINE:
this.color = Color.yellow;
break;
case FORET:
this.color = Color.green;
break;
case DESERT:
this.color = Color.red;
break;
case MONTAGNE:
this.color = Color.cyan;
break;
case VILLE:
this.color = Color.pink;... | 5 |
void init() {
// Calculate pvalue cutoff
scoreCutOff = scoreCutOff();
//---
// Calculate Fisher parameters
//---
N = D = 0;
for (String geneId : geneSets.getGenes())
if (geneSets.hasValue(geneId)) {
N++;
if (isTopScore(geneId)) D++;
}
if (verbose) Timer.showStdErr("Fisher Exact test para... | 4 |
public static ClassInfo getClassInfo(String typeSig) {
if (typeSig.charAt(0) != 'L')
throw new IllegalArgumentException();
return ClassInfo.forName(typeSig.substring(1, typeSig.length() - 1)
.replace('/', '.'));
} | 1 |
private int clearArea(int zombiesAboutToEncouter) {
int zombiesKilled = 0;
List<Survivor> team = this.raidSettings.team;
for (int i = 0 ; i < zombiesAboutToEncouter ; i++) {
Survivor target = team.get(Math.abs(new Random().nextInt()) % team.size());
double zombieAttack = BitingDeathGame.getRandomProb... | 6 |
private final void parseChangeLog(String changelog) {
String lines[] = changelog.split("\\r?\\n");
String checkVersion = lines[0];
String currentVersion = Main.getVersion();
boolean updateNeeded = false;
String[] versions1 = checkVersion.split("\\.");
String[] versions2 = currentVersion.split("\\.");
int... | 9 |
public static String[] getFileNames(String version) throws IOException {
String s = OberienURL.get(version);
String[] fileNames = s.substring(s.indexOf("[files]")+7, s.indexOf("[/files]")).split("\n");
for (int i = 0; i < fileNames.length; i++) {
fileNames[i] = "Game/" + fileNames[i];
}
return fileNames;
... | 1 |
public static void main(String[] args) {
Fast fast = new Fast();
StdDraw.setXscale(0, 32768);
StdDraw.setYscale(0, 32768);
StdDraw.show(0);
String filename = args[0];
In in = new In(filename);
int N = in.readInt();
Point[] points = new Point[N];
... | 9 |
public Expression parseExpression(String methodName, boolean allowPrefix, Object... symbols) {
try {
Method method = Parser.getInstance().getClass().getDeclaredMethod(methodName);
method.setAccessible(true);
Binary binaryExpression = null;
Expression leftExpression;
if (allowPrefix && SyntacticValidat... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RepeatStatementNode other = (RepeatStatementNode) obj;
if (exp1 == null) {
if (other.exp1 != null)
return false;
} else if (!exp1.equals... | 9 |
public static void checkAndCreateSchema(Connection conn,PrintWriter pw) {
Statement stmt = null;
ResultSet rs = null;
try {
conn.setAutoCommit(true);
} catch (SQLException se) {
pw.println("[NsSampleWork] Error when setting autocommit on connection; exception thrown: ");
se.printStackTrace();
}
... | 7 |
public void setEnableExceptionTracking(boolean enableExceptions) {
this.enableExceptions = enableExceptions;
} | 0 |
public List<String> locateJDK() {
String JAVA_WINDOWS = "where javac";
String JAVA_LINUX = "readlink -f $(whereis javac)"; // readlink -f $(which java)
//String JAVA_MAC = "ls -l `which javac`";
String JAVA_MAC = "/usr/libexec/java_home -v 1.8";
String osName = System.getProperty... | 9 |
private void menor() throws Exception{
op2 = pila.pop();
if (op2.getValor().equals("null"))
throw new Exception("Una de las variables esta sin inicializar!");
op1 = pila.pop();
if (op1.getValor().equals("null"))
throw new Exception("Una de las variables esta sin inicializar!");
Elem resultado = new Ele... | 8 |
public long getBlogId() {
return blogId;
} | 0 |
public void addPosition(Position position) {
if(position == null)
throw new NullPointerException("null cannot be added as a Position");
System.out.println("TEST1: " + otherPositions.size());
otherPositions.add(position);
System.out.println("TEST2: " + otherPositions.size());
if (otherPositions.... | 2 |
public Card dealCard() {
if (cardsUsed == deck.length)
throw new IllegalStateException("No cards are left in the deck.");
cardsUsed++;
return deck[cardsUsed - 1];
// Programming note: Cards are not literally removed from the array
// that represents the deck. We just keep track ... | 1 |
private void AddAllAttributes(String shaderText)
{
final String ATTRIBUTE_KEYWORD = "attribute";
int attributeStartLocation = shaderText.indexOf(ATTRIBUTE_KEYWORD);
int attribNumber = 0;
while(attributeStartLocation != -1)
{
if(!(attributeStartLocation != 0
&& (Character.isWhitespace(shaderText.charAt... | 5 |
private Point getWorldCollision(Dynamic obj, Texture target) {
Rectangle r = obj.getCollisionBox();
Point lowerLeft = new Point(r.x, r.y);
Point upperRight = new Point(r.x + r.width - 1,
r.y + r.height - 1);
int cell = World.CELL_SIZE;
//If x is negative, offset... | 5 |
@Override
public int hashCode() {
return playerName != null ? playerName.hashCode() : 0;
} | 1 |
private void process() {
int picsize = source.length;
result = new int[picsize];
for (int i = 0; i < picsize; i++) {
int p = source[i];
int r = (p & 0xff0000) >> 16;
int g = (p & 0xff00) >> 8;
int b = p & 0xff;
result[i] = luminance(r, g, b);
}
} | 1 |
@Override
@SuppressWarnings("unchecked")
public List<Poll>[] getMyPollTypes(MOB mob, boolean login)
{
final Iterator<Poll> i=getPollList();
final List<Poll> list[]=new List[3];
for(int l=0;l<3;l++)
list[l]=new Vector<Poll>();
for(;i.hasNext();)
{
final Poll P = i.next();
if(loadPollIfNecessary(P))... | 8 |
@Column(name = "PCA_POS_ID")
@Id
public BigInteger getPcaPosId() {
return pcaPosId;
} | 0 |
public void removePush() {
if (stack != null)
instr = stack.mergeIntoExpression(instr);
trueBlock.removePush();
} | 1 |
private float[] staggeredLine(
int length, int initStep, float variation, boolean sub
) {
// NOTE: Length must be an exact power of 2, plus 1.
float line[] = new float[length] ;
int step = (initStep > 0) ? initStep : (length - 1) ;
while (step > 1) {
for (int i = 0 ; i < length - 1 ; i += ... | 4 |
@Override
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2 = (Graphics2D) g;
int size = Math.min(
MAX_SIZE,
Math.min(getWidth() - this.imagePadding.left - this.imagePadding.right, getHeight() - this.imagePadding.top
- this... | 5 |
@Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
if (arg1.length < 1) {
sender.sendMessage(ChatColor.RED + "/" + plugin.ipban + " (PlayerName/IP)");
return;
}
try ... | 6 |
public int diff_slFormat()
{
int size = Paid_SoLuongSP.size();
double dnum = 0.0;
double dnum1 = 0.0;
int return_val = 0;
int inum;
int diff;
for(int i = 0; i < size ; i++)
{
dnum = Paid_SoLuongSP.get(i);
inum = P... | 5 |
public List<MemberBean> getMemberList(int start, int end) {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
List<MemberBean> memberList = null;
String sql = "";
try {
conn = getConnection();
sql = "select a.* from (select ROWNUM as RNUM, b.* from (select * from member"
... | 9 |
public static String encodeParameters(PostParameter[] postParams) {
StringBuffer buf = new StringBuffer();
for (int j = 0; j < postParams.length; j++) {
if (j != 0) {
buf.append("&");
}
try {
buf.append(URLEncoder.encode(postParams[j].n... | 3 |
public void removeMangeable(Mangeable alimentation){
List<Nourriture> alimentationLoft = new ArrayList<Nourriture>();
//alimentation.setValeurEnergie(0);
alimentationLoft = this.getLoftCorrespondant().getAlimentation();
System.out.print("Liste Alimentation : \n");
for (int i = 0; i < alimentati... | 5 |
private boolean isNewerVersion(){
JSONObject obj = apiHome("imgurdl/version", "", "GET");
if(obj == null)return false;
JSONArray data = (JSONArray) obj.get("imgurdlVersion");
JSONObject item = (JSONObject) data.get(0);
String newestVer = (String)item.get("ver");
String newestLink = (String)item.get("link");... | 2 |
@Override
public void approveSelection(){
File f = getSelectedFile();
if(f.exists() && getDialogType() == SAVE_DIALOG){
int result = JOptionPane.showConfirmDialog(this, Localization.getInstance().get("messageConfirmOverwrite"), Localization.getInstance().get("messageConfirmOverwriteTitle"), JOptionP... | 6 |
public void receiveFirst() {
System.out.println("-- Bob --");
if (MitM) {
System.out.println("ACHTUNG: MitM aktiv!!!");
}
// fingerprint werte aus datei auslesen
fingerprint = new Fingerprint(new File("HashParameter"));
// bob bekommt p und g von alice
p = new BigInteger(Com.receive(... | 6 |
private String getShortValue(final Field field, final Object object) {
Object result = getRawValue(field, object);
if (result == null) {
result = "";
}
return result.toString();
} | 1 |
public boolean isEventHandledByState(final StateEnum state, final EventEnum event) {
for (Transition transition : transitions.getTransitions(state)) {
if (transition.getEvent() == event) return true;
}
return false;
} | 2 |
public void checking_bfs(char[][] board, int x, int y) {
Queue<Integer> que = new LinkedList<Integer>();
que.add(x * board[0].length + y);
int n;
while (!que.isEmpty()) {
n = que.remove();
x = n / board[0].length;
y = n % board[0].length;
board[x][y] = '+';
if (x > 0 && board[x - 1][y] == 'O')
... | 9 |
void drawShip(Ship ship, Coordinate sgc) {
final int x = (int) (sgc.x - 1);
final int y = (int) (sgc.y - 1);
final int diameter = 3;
if (Main.isFastBlinked) {
g.setStroke(new BasicStroke());
g.setColor(ship.meta.color);
g.fillOval(x, y, diameter, d... | 1 |
@Override
public void deserialize(Buffer buf) {
barType = buf.readByte();
if (barType < 0)
throw new RuntimeException("Forbidden value on barType = " + barType + ", it doesn't respect the following condition : barType < 0");
slot = buf.readInt();
if (slot < 0 || slot > 99... | 3 |
public void testPrint_bufferMethods() throws Exception {
Period p = new Period(1, 2, 3, 4, 5, 6, 7, 8);
StringBuffer buf = new StringBuffer();
f.printTo(buf, p);
assertEquals("P1Y2M3W4DT5H6M7.008S", buf.toString());
buf = new StringBuffer();
try {
f.p... | 1 |
protected NeuralOutputs(Element outputs, MiningSchema miningSchema) throws Exception {
m_classAttribute = miningSchema.getMiningSchemaAsInstances().classAttribute();
int vals = (m_classAttribute.isNumeric())
? 1
: m_classAttribute.numValues();
m_outputNeurons = new String... | 8 |
public void setBounds(Rectangle rect) {
int x = bounds.x, y = bounds.y;
boolean resize = (rect.width != bounds.width)
|| (rect.height != bounds.height), translate = (rect.x != x)
|| (rect.y != y);
if ((resize || translate) && isVisible())
erase();
if (translate) {
int dx = rect.x - x;
int dy ... | 8 |
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... | 7 |
public InnerClassInfo getOuterClassInfo(ClassInfo ci) {
if (ci != null) {
InnerClassInfo[] outers = ci.getOuterClasses();
if (outers != null)
return outers[0];
}
return null;
} | 2 |
private void btnOpenFileActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnOpenFileActionPerformed
{//GEN-HEADEREND:event_btnOpenFileActionPerformed
JFileChooser fc = new JFileChooser();
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle("Open something inte... | 7 |
public void setReturnNearestValue(boolean returnNearestValue) {
this.returnNearestValue = returnNearestValue;
} | 0 |
public boolean testMultJumps(){
// Boolean for whether or not it passed the test.
boolean multJumpTest = true;
/**
* A high number of moves must be made for this to be set up.
* A diagram was made to figure out this sequence. It is:
*
* For ... | 6 |
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.