text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void obtenirFormes() {
final String serverAddress[] = JOptionPane.showInputDialog("Quel est le nom d'h�te et le port du serveur de formes?").split(":");
final Socket srvCnx;
final PrintWriter srvOutput;
final BufferedReader srvInput;
final String hostName = serverAddress[0];
final int portNumber... | 2 |
final public CycObject existExactForm(boolean requireEOF) throws ParseException, java.io.IOException, UnsupportedVocabularyException {
CycVariable var = null;
CycObject sent = null;
CycList val = new CycList();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case THEREEXISTEXACTLY_CONSTANT:
jj_consume_token... | 4 |
public static StockStorage getInstance() {
if (theOne == null) {
theOne = new StockStorage();
}
return theOne;
} | 1 |
private synchronized void checkGridletCompletion()
{
ResGridlet obj = null;
int i = 0;
// NOTE: This one should stay as it is since gridletFinish()
// will modify the content of this list if a Gridlet has finished.
// Can't use iterator since it will cause an exception
... | 3 |
public static void main(String[] args) throws SQLException {
ShowAllEmployeesOOP command = new ShowAllEmployeesOOP();
Collection<ShowAllEmployeesBasicInfo> allEmployeesBasicInformation = command
.getAllEmployeesBasicInformation();
if (allEmployeesBasicInformation == null
|| allEmployeesBasicInformation.is... | 3 |
public static String getFilenameExtension(String path) {
if (path == null) {
return null;
}
int sepIndex = path.lastIndexOf(EXTENSION_SEPARATOR);
return (sepIndex != -1 ? path.substring(sepIndex + 1) : null);
} | 2 |
public SampleResult runTest(JavaSamplerContext context) {
SampleResult sampleResult = new SampleResult();
sampleResult.sampleStart();
String key = String.valueOf(String.valueOf(new Random().nextInt(keyNumLength)).hashCode());
try {
if (methedType.equals("put")) {
put = new Put(Bytes.toBytes(key));
... | 5 |
public Sprite create(Owner owner, Resource res, Message sdt) {
GaussianPlant spr = new GaussianPlant(owner, res);
spr.addnegative();
Random rnd = owner.mkrandoom();
for(int i = 0; i < num; i++) {
Coord c = neg.bc.add(rnd.nextInt(neg.bs.x), rnd.nextInt(neg.bs.y));
Tex s = strands[rnd.nextInt(stra... | 1 |
public static void main(String[] args)
{
URL url = null; // create url Object
InputStream is = null;
HttpURLConnection connection = null;
try
{
url = new URL("http://www.bankisrael.gov.il/currency.xml");
is = url.openConnection().getInputStream(); ... | 8 |
private static void call(GameException exception) {
HandlerList handlers = exception.getHandlers();
RegisteredListener[] listeners = handlers.getRegisteredListeners();
for (RegisteredListener registration : listeners) {
if (!registration.getPlugin().isEnabled()) {
c... | 6 |
public final GalaxyXPreprocessorParser.assignment_operator_return assignment_operator() throws RecognitionException {
GalaxyXPreprocessorParser.assignment_operator_return retval = new GalaxyXPreprocessorParser.assignment_operator_return();
retval.start = input.LT(1);
int assignment_operator_Star... | 9 |
public void move(int xa, int ya) {
System.out.println("Size: " + level.getProjectiles().size());
if (xa != 0 && ya !=0) {
move(xa, 0);
move(0, ya);
return;
}
//right
if (xa > 0) dir =1;
//left
if (xa < 0) dir =3;
//down
if (ya > 0) dir =2;
//up
if (ya < 0) dir =0;
if (!collision(xa... | 7 |
public void run() {
while(true){
System.out.println("input q to quit, input d to download");
String c = input.next();
c = c.toLowerCase();
switch(c){
case "d": download();break;
case "q": gracefulExit();break;
case "t": System.out.println("I like Scarves");break;
}
}
... | 4 |
@Override
public void run()
{
try
{
while (!isInterrupted() && run)
{
final String message = getNextMessageFromQueue();
sendMessageToClient(message + "\n");
Log.d("ClientSender", "run()" + message);
}
}
catch (final Exception e)
{
// erreur silencieuse...
}
clientInfo.getClientRe... | 3 |
public String loadGames(String profileId, String parameters) throws Exception {
String url = "http://steamcommunity.com/";
if (containsOnlyDigits(profileId))
url += "profiles/";
else
url += "id/";
url += profileId + "/" + parameters;
WebPage page = WebPage... | 2 |
public void preOrder() {
// 1 Konten selber, 2 Linker Knoten , 3 Rechter Knoten
print();
if (left != null) {
left.preOrder();
}
if (right != null) {
right.preOrder();
}
} | 2 |
private int convertToDirection(String s)
{
if(s.equals("w")) {return Location.NORTH;}
if(s.equals("a")) {return Location.WEST;}
if(s.equals("s")) {return Location.SOUTH;}
if(s.equals("d")) {return Location.EAST;}
return -1;
} | 4 |
@Override
public void actionPerformed(ActionEvent e) {
suljeEdellinenKortti();
if (e.getSource().equals(kertaus)){
ui.kertausmaatti();
}else if (e.getSource().equals(ajastus)){
ui.ajastinmaatti();
} else if (e.getSource().equals(tilastot)){
ui.tila... | 3 |
public String value() {
String result = "";
// If a number card.
if (value >= 2 && value <= 10) {
result = Integer.toString(value);
}
// If a face card.
else if (value >= 11 && value <= 14) {
if (value == 11) {
result = "J";
} else if (value == 12) {
result = "Q";
} else if (value ... | 8 |
protected void cleanup(JComponent c, boolean remove) {
if (!cleaned && remove && indices != null) {
source = (JList) c;
DefaultListModel model = (DefaultListModel) source.getModel();
//If we are moving items around in the same list, we
//need to adjust the indices accordingly, since those
//after the i... | 8 |
public boolean conflicts(String name, int usageType) {
if (usageType == AMBIGUOUSNAME || usageType == LOCALNAME)
return findLocal(name) != null;
if (usageType == AMBIGUOUSNAME || usageType == CLASSNAME)
return findAnonClass(name) != null;
return false;
} | 4 |
protected static Element createElement(Document document, String tagname,
Map attributes, String text) {
// Create the new element.
Element element = document.createElement(tagname);
// Add the text element.
if (text != null)
element.appendChild(document.createTextNode(text));
return element;
} | 1 |
public NXNode<?> resolvePath(String s) {
String[] e = (s.startsWith("/") ? s.substring(1) : s).split(Pattern.quote("/"));
NXNode<?> r = _baseNode;
for (String f : e) {
if (f.equals(".")) continue;
else if (f.equals("..")) r = _baseNode._parent;
else r = r.getC... | 7 |
private void buildTree(JsonNode root, JsonNode parent){
if(root.isArray()){
for(JsonNode n : root){
buildTree(n, parent);
}
return;
}
if(root.isContainerNode()){
String name = getNodeName(root);
String parentName = getNodeName(parent);
JsonNode value = root.findValue(name);
treeIns... | 4 |
private Set<Card> foursFullWithTwoJacksAndTwoKings() {
return convertToCardSet("KD,4S,4C,KS,JD,4H,JH");
} | 0 |
public void CreateAANakedTorsoAlternativeTexturesFemalesOld() throws Exception {
NumberFormat formatter = new DecimalFormat("000");
for (int bodies = 1; bodies < RBS_Main.amountBodyTypes; bodies++) {
String s_bodies = formatter.format(bodies);
for (ARMA sourceAA : SkyProcStarter.... | 5 |
private void jTextFieldCmdCliQte8FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldCmdCliQte8FocusLost
mondecimal = new DecimalFormat("#######.00");
if (!(jTextFieldCmdCliQte8.getText().equals(""))) {
int qte = Integer.parseInt(jTextFieldCmdCliQte8.getText().trim... | 1 |
int alphaBetaMin(int alpha, int beta, int depthleft) {
if (depthleft == 0) {
return -eval(mPieces, oPieces);
}
for (Piece a : oPieces) {
Move[] possible = a.getMoves(board);
System.out.println("min, white : " + a.white + ", # nodes " + possible.len... | 5 |
public SegmentTreeMinCntSegAdd(int[] array){
int n = array.length, i;
for(d=1; d<n; d<<=1);
t = new int[d<<1];
add = new int[d<<1];
cntMin = new int[d<<1];
for(i=d; i<n+d; ++i){ t[i] = array[i-d]; cntMin[i] = 1; }
for(i=n+d; i<d+d; ++i)... | 7 |
private static Term eval(Term term, HashMap<String, Term> env) throws ParseException {
if (Util.getOperators().contains(term.getPred())) {
Integer a = Integer.parseInt(eval(term.getArgs().get(0), env).getPred());
Integer b = Integer.parseInt(eval(term.getArgs().get(1), env).getPred());
... | 9 |
@Override
public Integer doInPreparedStatement(PreparedStatement ps) throws SQLException {
// 执行PreparedStatement
int rows = ps.executeUpdate();
// 根据是否存在KeyHolder判断是否需要从PreparedStatement中提取生成的主键
if (generatedKeyHolder != null) {
List<Map<String, Object>> generatedKeys = generatedKeyHolder.getKeyList();
... | 3 |
protected synchronized boolean reduceMemoryWithDelegates(boolean aggressively) {
int reductionPolicy = aggressively ? MemoryManagerDelegate.REDUCE_AGGRESSIVELY
: MemoryManagerDelegate.REDUCE_SOMEWHAT;
boolean anyReduced = false;
for (MemoryManagerDelegate mmd : delegates) {
... | 3 |
public void run() {
try {
//Generate the image for the Fractal
f.generateImage();
//If we should perform filtering make sure the Fractal is not sparse
if (PERFORM_FILTERING) {
//Counts how many times the current Fractal has... | 6 |
public String[] getTerminalsOnRHS() {
ProductionChecker pc = new ProductionChecker();
ArrayList list = new ArrayList();
for (int i = 0; i < myRHS.length(); i++) {
char c = myRHS.charAt(i);
if (ProductionChecker.isTerminal(c))
list.add(myRHS.substring(i, i + 1));
}
return (String[]) list.toArray(new ... | 2 |
public void LineSwap() {
if (caret.row == sel.row) {
if (caret.row == 0) {
return;
}
UndoPatch up = new UndoPatch(caret.row - 1, caret.row);
StringBuilder swb = code.getsb(caret.row - 1);
code.get(caret.row - 1).sbuild = code.get(caret.row).sbuild;
code.get(caret.row).sbu... | 5 |
@Test
public void testAstarGraph() throws IOException{
HashMap<String,String[]> fromTo = new HashMap<String,String[]>();
fromTo.put("results_wolfeb_178816527_178816525_1_astar.txt", new String[]{"178816527", "178816525"});
fromTo.put("results_wolfeb_330767681_178817851_1_astar.txt", new String[]{"330767681", "1... | 6 |
private void updateObject(Object changedObject){
String table = changedObject.getClass().getSimpleName();
switch(table){
case "User":
User user = (User) changedObject;
dataStorage.users().updateUser(user);
break;
case "Group":
... | 8 |
private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 70
replab0: while (true) {
v_1 = cursor;
lab1: do {
// (, line 70
// [, line 72
bra = cursor;
// substring, line 72
among_var = find_among(a_1, 3);
if (among_var == 0) {
break lab1;
}
// ], line 72
... | 8 |
@Test
public void persistenceTest() throws Exception
{
PartitionedHashMap map = (PartitionedHashMap) getMapInstance( 16 );
long totalSize = 0;
int amount = 0;
for ( long i = -456; i < 1029; i++ )
{
amount++;
totalSize += Long.toString( i ).length()... | 8 |
public void add(){
OptionView temp=null;
SavedEntityState selected=null;
temp=((GrandView)getSuperview()).getOptions();
for(int i=0;i<getScrollables().size();i++)
if(getScrollables().get(i).getSelected())
selected=((SelectableLabel)getScrollables().get(i)).get... | 6 |
private static void annotateSuperRegions(BotState state) {
for (SuperRegion superRegion : state.getVisibleMap().getSuperRegions()) {
boolean canSuperRegionBeTaken = canSuperRegionBeTaken(state, superRegion);
boolean canSuperRegionBeTakenByOpponent = canSuperRegionBeTakenByOpponent(state, superRegion);
boolea... | 5 |
@Override
public void execute() {
final SceneObject cutRoot = SceneEntities.getNearest(Settings.CUT_CURL_FILTER);
if(cutRoot != null) {
doAction("Collect", cutRoot);
} else {
final SceneObject uncutRoot = SceneEntities.getNearest(Constants.CURLY_ROOT_ID);
if(uncutRoot != null) {
doAction("Chop", unc... | 2 |
public void checkAssignmentCorrect()
{
boolean checkAssign = true;
for(Integer m: this.Assignment.keySet())
{
Integer t = this.Assignment.get(m);
for(Integer cm: this.getConnectedMeetings(m))
{
if(t == this.Assignment.get(cm))
{
checkAssign = false;
break;
}
}
}
if(checkAssi... | 9 |
private void jComboBox1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBox1ItemStateChanged
//getting values from jCombo box
//if the value dosn't change use the default values from the global variables
int selection = jComboBox1.getSelectedIndex();
swit... | 7 |
@EventHandler(priority = EventPriority.LOW)
public void onBlockPlace(BlockPlaceEvent E)
{
Block B = E.getBlockPlaced();
if (B == null)
return;
//Alert the player when they create a printing press.
//If a base block is placed, check for the piston -
else if (B.getType() == M.conf.PressBlock)
{
Pis... | 4 |
private static boolean[] primeBoolArray(int limit) {
boolean[] nums = new boolean[limit];
for (int i = 2; i < nums.length; i++)
nums[i] = true;
int nextPrime = 2;
while (nextPrime < nums.length / 2) {
int i = nextPrime;
for (; i < nums.length; i += nextPrime)
nums[i] = false;
nums[nextPrime] = t... | 5 |
private boolean isBinaryOp(String string)
{
if(string.equals("add") || string.equals("sub") || string.equals("mult") || string.equals("div") || string.equals("and") || string.equals("or"))
return true;
else
return false;
} | 6 |
@Override
public void actionPerformed(ActionEvent e) {
DocUtils.buttonDoClick(e);
String txt = wordProcessor.area1.getText().replaceAll("\r\n", "\n");
String find = wordProcessor.findFld.getText();
if (find == null || find.isEmpty()) {
wordProcessor.findMsg.setText("Enter a term to find");
return;
... | 8 |
ParticipantItf deserializeFromJson(String json) {
AutoBean<ParticipantItf> bean = AutoBeanCodex.decode(factory, ParticipantItf.class, json);
return bean.as();
} | 0 |
public void getList(int rep,String searchText)
{
String tempQuery = "";
if(rep == 0) {
tempQuery = DEFAULT_QUERY;
}
else if(rep == 1) {
searchText = searchText.toUpperCase();
tempQuery = "select * from (Select compid,compname,contactperson,contactn... | 6 |
public static void main(String[] args){
if("SrcODS-Upload".matches("(?i)src-reset|srcOds|srcOds-upload")){
Log.Print("Ok");
}
try {
Class gsos=Class.forName("com.luxe.tools.util.MyReflection");
Class type=Class.forName("java.lang.String");
Const... | 5 |
private boolean checkNumber(int number, int[] numberCounter) {
if (number == 2 || number == 12 || number == 7) { // Si le nombre aux des est 2, 12 ou 7 (<=> les nombres presents qu'une fois sur la carte). Remarque : le 7 a deja ete place et son compteur deja incremente via la methode placeDesert(), il est necessaire ... | 5 |
public ArrayList<Block> getPredecessors() {
ArrayList<Block> predecessor = new ArrayList<Block>();
if (normalPre != null) {
predecessor.add(normalPre);
}
if (thenPre != null) {
predecessor.add(thenPre);
}
if (elsePre != null) {
predecessor.add(elsePre);
}
if (loopBack != null) {
predecessor.... | 4 |
public Predicate parsePredicate(String input) throws ParseException {
Matcher matcher = predicatePattern.matcher(input);
if (!matcher.matches()) {
throw new ParseException(
"The given input '" + input + "' is not a valid predicate.");
}
List<Term> arguments =... | 6 |
public JPanel getUsertilePWFieldMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.usermenuPWFieldMenu;
} | 1 |
public static void readHash(String type_map, HashMap<String, String> typeMap) {
ArrayList<String> types = new ArrayList<String>();
ArrayList<String> tokens = new ArrayList<String>();
if (type_map != null) {
FileUtil.readLines(type_map, types);
for (int i = 0; i < types.size(); i++) {
if (!types.get(i)... | 7 |
private static Hand isPair(Card[] allCards) {
Hand h = new Hand();
int cardsALike = 0;
ArrayList<Card> pair = new ArrayList<>();
boolean found = false;
for (int j = 0; j < allCards.length; j++) {
Card firstCard = allCards[j];
if (!found) {
... | 9 |
public void updateStat(){
int value = 0;
Iterator<Village> it = list.iterator();
List<Village> temp = new ArrayList<Village>();
Village v;
while(it.hasNext()){
v = it.next();
value += v.getPopulation();
v.updateHealth();
v.updateBaby();
if(v.getPopulation() == 0){
temp.add(v);
}
... | 8 |
@Override
public void caseAEstrCaso(AEstrCaso node)
{
inAEstrCaso(node);
{
List<PComando> copy = new ArrayList<PComando>(node.getComando());
Collections.reverse(copy);
for(PComando e : copy)
{
e.apply(this);
}
}
... | 3 |
public long getReminderAhead(long uid) throws SQLException {
Reminder reminder = Reminder.findByApptAndUser(this.getId(), uid);
return reminder == null ? 0 : reminder.reminderAhead;
} | 1 |
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
int hScroll = mHSB.getValue();
if (mHeaderBounds.height > 0) {
Graphics2D gc = (Graphics2D) g.create();
try {
gc.clipRect(mHeaderBounds.x, mHeaderBounds.y, mHeaderBounds.width, mHeaderBounds.height);
gc.translate(mHeader... | 1 |
public static Schematic loadSchematic(File file) throws IOException {
FileInputStream stream = new FileInputStream(file);
@SuppressWarnings("resource")
NBTInputStream nbtStream = new NBTInputStream(stream);
CompoundTag schematicTag = (CompoundTag) nbtStream.readTag();
if (!schematicTag.getName().equals("Schem... | 6 |
public void getCollidingBoundingBoxes(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, ArrayList par6ArrayList)
{
int var7 = par1World.getBlockMetadata(par2, par3, par4);
switch (getDirectionMeta(var7))
{
case 0:
this.setBlockBounds... | 6 |
public static String getAbstractSynCat(String synCat) throws Exception {
if (!abstractSynCat.containsKey(synCat))
throw new Exception("synCat " + synCat + " is unknown");
return abstractSynCat.get(synCat);
} | 1 |
public void setUseDocumentSettings(boolean useDocumentSettings) {this.useDocumentSettings = useDocumentSettings;} | 0 |
public String getContent(String urlString) throws MalformedURLException {
URL url = createURL(urlString);
URLConnection connection = createConnection(url);
if(connection == null) return "";
String content = "";
BufferedReader reader;
try {
reader = new Buf... | 5 |
protected void openFiles(String indexDirectory_p) throws Exception{
// RandomAccessFile offsetFile=null;
// RandomAccessFile databaseFile=null;
//With persistent buffers
File offset_f=new File(indexDirectory+"/offsets.dat");
File database_f=new File(indexDirectory+"/database.dat");... | 3 |
private void merge(int left, int middle1, int middle2, int right)
{
int leftIndex= left;
int rightIndex = middle2;
int combIndex= left;
int[] combArray= new int[array.length];
// output two subarrays before merging
// System.out.println( "merge: " + subarray( left, middle1 ) );
// System.out.... | 7 |
public static void main(String[] args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String sNumber1 = reader.readLine();
String sNumber2 = reader.readLine();
String sNumber3 = reader.readLine();
int n1 = Integer.parseInt(... | 4 |
public AnimationTimer(int from, int to) {
loopCoef = 0;
toX = to;
fromX = from;
movex = 0 + MARGIN;
// 目的拡大率を算出
double xs = (getWidth() - 2.0d * MARGIN) / massRange;
tmpMassStart = massStart + ((toX - MARGIN) / xs);
tmpMassRange = 10 * (fromX / (10 * xs));
if (tmpMassRange < MASS_RAN... | 5 |
public static void main(String[] args) {
// メッセージダイアログ表示
JOptionPane.showMessageDialog(null, "ハロー!");
} | 0 |
@Override
public void replace(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException {
Document doc = fb.getDocument();
Element root = doc.getDefaultRootElement();
int count = root.getElementCount();
int index = root.getElementIndex(offset);
El... | 4 |
public static int getPlayerIDFromName(String inName) throws WrongNameException{
int n = 0;
boolean success = false;
for(int i = 0; i < NumPlayers; i++){
if(Players[i].equals(inName)){
n = i+1;
success = true;
break;
}
}
if(!success) throw new WrongNameException();
return (n);
} | 3 |
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g... | 4 |
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... | 8 |
public static void println(String string, int l) {
if (check(l)) {
toTerminal(string + "\n", l);
}
} | 1 |
public static void drawMap()
{
for (int x=0;x<Square.xAmt();++x)
{
for (int y=0;y<Square.yAmt();++y)
{
if (Square.get(x,y).isFree())
{
int r=120-map.value[x][y]/10;
int b=map.value[x][y]/25;
... | 7 |
public void start() {
ObjectName serverName = null;
HtmlAdaptorServer adaptor = null;
try {
serverName = new ObjectName("Http:name=HttpAdaptor");
adaptor = new HtmlAdaptorServer();
domain.registerMBean(adaptor, serverName);
} catch (MalformedObjectName... | 9 |
public void setLocation(double latitude, double longitude) {
putMergeVar("mc_location", new Location(latitude, longitude));
} | 0 |
public PrimitiveOperator combineLeftNLeft(PrimitiveOperator other) {
boolean[] newTruthTable = new boolean[4];
// the other gate is on the left side - on the LSB
newTruthTable[0] = truthTable[((other.truthTable[0]) ? 1 : 0) | 0]; //00
newTruthTable[1] = truthTable[((other.truthTable[1]) ? 1 : 0) | 0]; ... | 4 |
public PlayerStatsSummaryListDto getStatsBySummonerId(Region region, long summonerId, Season season) { //only one data set per queue type
String addon = (season == Settings.CURRENT_SEASON) ? "?api_key=" : ("?season=" + season.toString() + "&api_key=");
String requestURL = Settings.API_BASE_URL + region.toString().t... | 1 |
@EventHandler
public void ZombieWeakness(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.getZombieConfig().getDouble("Zombie.Weakne... | 6 |
public void setAutomaton(Automaton newAuto) {
if (newAuto == null) {
//System.out.println("Setting automaton null");
return;
}
automaton = newAuto;
this.invalidate();
} | 1 |
public void setUsers(User[] users) {
usersModel.clear();
Runnable adder = new Runnable () {
@Override
public void run () {
usersModel.add( usersQueue.poll() );
}
};
try {
for (User user : users) {
usersQueu... | 3 |
public static File isCommandPathViable(String path, File extraBinDir) {
if (path != null) {
File file = new File(path);
if (file.isFile()) {
return file;
}
if (path.indexOf(File.separatorChar) == -1) {
if (extraBinDir != null) {
file = new File(extraBinDir, path);
if (file.isFile()) {
... | 8 |
public static Method getMethod(Class<?> cl, String method) {
for (Method m : cl.getMethods()) if (m.getName().equals(method)) return m;
return null;
} | 3 |
public ChannelMenu(String host, String pass, String nick, String user, String real) throws IOException {
super(host);
main = new IRCMain(host, new int[] {1024, 2048, 6667, 6669} , pass, nick, user, real);
main.addIRCEventListener(internalList);
//main.addIRCEventListener(new IRCLocalListener());
setBounds(100... | 4 |
@EventHandler(priority = EventPriority.NORMAL)
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (event.isCancelled())
return;
if (event.getEntity().getType() == EntityType.PLAYER) {
Player player = (Player) event.getEntity();
if (plugin.playerProtections.containsKey(player.getNam... | 6 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Tuple3 tuple3 = (Tuple3) o;
if (item != null ? !item.equals(tuple3.item) : tuple3.item != null) return false;
if (item2 != null ? !item2.equals... | 9 |
@Before
public void setUp() {
TestHelper.signon(this);
MongoHelper.setDB("fote");
MongoHelper.getCollection("suggestions").drop();
for(Suggestion suggestion : suggestions) {
if (!MongoHelper.save(suggestion, "suggestions")) {
TestHelper.failed("sa... | 2 |
public Bag getDiscsWithGlide(int glide) {
LOGGER.log(Level.INFO, "Getting discs with glide " + glide);
Bag discBag = new Bag();
for (int i = 0; i < discs.size(); i++) {
if (discs.get(i).getGlide() == glide) {
discBag.addDisc(discs.get(i));
}
}
... | 2 |
public int motorUse(String[] prices, String[] purchases) {
int running = 0;
// Convert input prices
int cols = prices.length;
mInventory = new Inventory(prices.length);
for (int i=0; i<cols; i++) {
String temp[] = prices[i].split(" ");
int shelves = temp.length;
mInventory.columns[i] = new Colu... | 9 |
private static void testColorValueRange(int r, int g, int b, int a) {
boolean rangeError = false;
String badComponentString = "";
if (a < 0 || a > 255) {
rangeError = true;
badComponentString = badComponentString + " Alpha";
}
if (r < 0 || r > 255) {
rangeError = true;
badComponentString = badCom... | 9 |
public final int fetchBinaryUInt(int size) throws EParseError {
if ((size == 0) || (pos + size > length))
throw new EParseError("Out of range"); // TODO: special exception
int r = 0;
int b;
b = src[pos++];
r = (b & 0xFF);
if (size == 1) return r;
b ... | 6 |
public boolean clickedSign(Player player, Sign state) {
for (Animation a : animations) {
if (player.equals(a.CurrentEditor)
&& state.getLine(0).endsWith("SUPERFRAME")) {
if (a.WaitingToAddFrame) {
a.WaitingToAddFrame = false;
state.setLine(0, ChatColor.DARK_AQUA + "SUPERFRAME");
state.setLi... | 7 |
private void updateStateTellOrigin(List<Keyword> keywords, List<String> terms) {
//Check if new Recipe was also passed as a keyword
if (keywords != null && !keywords.isEmpty()) {
for (Keyword kw : keywords) {
if (kw.getKeywordData().getType() == KeywordType.RECIPE) {
currRecipe = new Recipe((RecipeData)kw.ge... | 9 |
public void clear() {
for (int i = 0; i < size; i++) {
data[i] = null;
}
size = 0;
} | 1 |
public SoundUtil() {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
try {
for (int i = 0; i < fileNames.length; i++) {
String name = fileNames[i];
URL url = classLoader.getResource("resources/" + name);
File audioFile = new File(url.toURI());
AudioInputStream audioStrea... | 5 |
public int getStudentId() {
return studentId;
} | 0 |
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() > 0 && e.getKeyCode() < 256) {
keys[e.getKeyCode()] = true;
}
} | 2 |
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.