text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static Interlocuteur selectByIdCommercial(int id) throws SQLException {
String query = null;
Interlocuteur interlocuteur1 = new Interlocuteur();
ResultSet resultat;
try {
query = "SELECT * from INTERLOCUTEUR where ID_COMMERCIAL =? ";
PreparedStatement pS... | 2 |
public String toString(){
String toString = "";
if(pointGuard1 != null){
toString = "PG: "+ pointGuard1.getName();
}
else {toString = toString+"PG: None ";}
if(pointGuard2 != null){
toString = toString + " PG: "+pointGuard2.getName();
}
else {toString = toString+" PG: None ";}
if(shootingGuar... | 9 |
public void ping()
{
if(camera != null && timer.milliTime() > PING_TIME)
{
int x = 0;
int y = 0;
if(getX() > camera.getX() + camera.getWidth())
x = camera.getX() + camera.getWidth();
else if(getX() < camera.getX())
x = camera.getX();
else
x = getX();
if(getY() > camera.getY() ... | 8 |
public boolean isSym(TreeNode n1,TreeNode n2){
if(n1==null&&n2==null){
return true;
}else if((n1==null&&n2!=null) || (n1!=null&&n2==null)){
return false;
}else{
if(n1.val==n2.val&&isSym(n1.left, n2.right)&&isSym(n1.right,n2.left)){
return true;
}
return false;
}
} | 9 |
public static boolean haveConversation(Option... options) {
final TimedCondition stop = new TimedCondition(20000) {
@Override
public boolean isDone() {
return !isOpen() && !Widgets.canContinue();
}
};
while (stop.isRunning()) {
if (Widgets.canContinue()) {
final WidgetChild cont = Widgets.getC... | 6 |
public void setCountry(String country) {
this.country.set(country);
} | 0 |
boolean contains( Fragment f )
{
for ( int i=0;i<rows.size();i++ )
{
Row r = rows.get(i);
if ( r.cells.size()==1 )
{
FragList fl = r.cells.get( 0 );
if ( fl.fragments.size()==1 )
{
Atom a = fl.fra... | 6 |
@XmlElementDecl(namespace = "http://www.w3.org/2001/04/xmlenc#", name = "DataReference", scope = ReferenceList.class)
public JAXBElement<ReferenceType> createReferenceListDataReference(ReferenceType value) {
return new JAXBElement<ReferenceType>(_ReferenceListDataReference_QNAME, ReferenceType.class, Refere... | 0 |
@EventHandler
public void GiantJump(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.getGiantConfig().getDouble("Giant.Jump.DodgeCha... | 6 |
public void addArmForce(int armForce) {
this.armForce += armForce;
} | 0 |
public void triangulate (FaceList newFaces, double minArea)
{
HalfEdge hedge;
if (numVertices() < 4)
{ return;
}
Vertex v0 = he0.head();
Face prevFace = null;
hedge = he0.next;
HalfEdge oppPrev = hedge.opposite;
Face face0 = null;
for (hedge=hedge.next; hedge!=he0.prev; ... | 4 |
private void checkColors() {
for (int i = 1; i < 7; i++) {
switch (labels[i].getText()) {
case "2771":
labels[i].setBackground(Color.DARK_GRAY);
break;
case "":
labels[i].setBackground(Color.BLACK);
... | 4 |
@EventHandler(ignoreCancelled = true)
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
// hide any hidden players from them
// but only if they can't see everyone anyway
if(PermissionsManager.playerHasPermission(player, "vanish.seeall")) {
return;
}
// get all our onl... | 3 |
@Override
protected Point2D calculateControl(GObject target, Context context) {
// Create variables to check for horizontal and vertical movement.
int horizontal = 0;
int vertical = 0;
// Check the context for relevant keys.
for (Integer i : context.getKeyCodesPressed()) {
// Check the code.
if (i.eq... | 9 |
public float getFloat( String name ){
XAttribute attribute = getAttribute( name );
if( attribute == null )
throw new XException( "no attribute known with name: " + name );
return attribute.getFloat();
} | 1 |
private BufferedImage createTile(int tile){
int sheetWidth = sheet.getWidth()/width;
int yOrigin = tile / sheetWidth;
int xOrigin = tile % sheetWidth;
if(xOrigin<sheet.getWidth()&&yOrigin<sheet.getHeight()){
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
for (int x = ... | 6 |
@Override
public void documentRemoved(DocumentRepositoryEvent e) {} | 0 |
public List<Mapping> getMappings(Literal selectLiteral) {
List<Mapping> result = new ArrayList<>();
//for(Literal literal: view.literals){
int[] positions = viewPositions.get(selectLiteral.id);
if(positions==null)
return result;
for (int i = positions[0]; i < position... | 3 |
@Override
public Connection crearConexion() {
try {
InitialContext initialContext=new InitialContext();
DataSource dataSource=(DataSource) initialContext.lookup("java:comp/env/jdbc/" + Conexion.getDatabaseName());
Connection connection=dataSource.getConnection();
... | 1 |
public void insertPlace() {
ServletContext context = getServletContext();
InputStream is = context.getResourceAsStream("/WEB-INF/places-sample.csv");
BufferedReader br;
try {
String l="";
boolean isHeader = true;
br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
while((l=br.readL... | 3 |
public String request_from_api(String data){
try {
if(this.debug){
this.MCAC.logger.log("Sending request!");
}
final URL url = new URL("http://api.crashcraft.co.uk/" + this.MCAC.APIKey);
final URLConnection conn = url.openConnection();
conn.setConnectTimeout(5000);
conn.setRead... | 6 |
private boolean r_verb_suffix() {
int among_var;
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 175
// setlimit, line 176
v_1 = limit - cursor;
// tomark, line 176
... | 8 |
public static LinkedList<Integer[]> listaTorol( LinkedList<Integer[]> lista, Integer[] parok )
{
LinkedList<Integer[]> ujLista = new LinkedList<Integer[]>();
for( Integer[] i : lista )
{
int j=0;
for( j=0; j<6; j++ )
{
if( i[j] != parok[j] )
break;
}
if(j == 6)
ujLista.add(i);
}... | 5 |
private static IParameters parseParameters(String[] args) throws IOException {
IParameters parameters;
if (args.length != 0) {
parameters = new ConsoleParameters(args);
} else {
String currentDir = System.getProperty("user.dir") + "\\";
File propertiesFile = n... | 1 |
private static byte[] scanKeyFile(CryptobyConsole console) {
scanner = new Scanner(System.in);
byte[] tempKey = null;
do {
System.out.println("\nAllowed Key Sizes 128,192 and 256 Bit.");
System.out.println("Enter Path to Key File (Type '" + quit + "' to Escape):");
... | 6 |
public List validate() {
String error;
if(!isNameValidate()) {
error = "Name is not valid.";
validateErrors.add(error);
}
if(!isSurnameValidate()) {
error = "Surname is not valid.";
validateErrors.add(error);
}
if(!isBirt... | 6 |
private void setLinear() throws Exception {
//then set default behaviour for node.
//set linear regression combined with attribute filter
//find the attributes used for splitting.
boolean[] attributeList = new boolean[m_training.numAttributes()];
for (int noa = 0; noa < m_training.n... | 8 |
@Override
public void sourceConfInit(FlowProcess<JobConf> flowProcess,
Tap<JobConf, RecordReader, OutputCollector> tap, JobConf conf) {
conf.setInputFormat(AccumuloInputFormat.class);
setFields(TapType.SOURCE);
AccumuloTap accumuloTap = (AccumuloTap) tap;
if (false == ... | 8 |
public void update(GameContainer gc, int delta, BlockMap bmap)throws SlickException
{
Vector2f trans = new Vector2f(0,0);
Input input = gc.getInput();
if(input.isKeyDown(Input.KEY_W))
{
trans.y -= 0.5f * delta;
}
if(input.isKeyDo... | 6 |
public void setVar(PVar node)
{
if(this._var_ != null)
{
this._var_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
... | 3 |
public void adaptSegments(boolean positiveReinforcement){
//NO WAY to remove synapses added to segment
//find a method to replace low perm synapses with new comer
if(segmentUpdateList.size()>0){
for(SegmentUpdate sUpdate : segmentUpdateList){
//System.out.print(sUpdate.updateSegment.synapses.size()+"-"+sUp... | 8 |
public static void main(String[] args)
{
Frame frame = new Frame();
frame.setSize(width, height);
frame.setDefaultCloseOperation(3); //3 = Exit_ON_CLOSE
frame.setLocationRelativeTo(null);
frame.setResizable(false);
// frame.setUndecorated(true);
frame.setVisible(true);
frame.makscreen();
long ... | 2 |
@Override
public void mousePressed(MouseEvent e) {
cancelDrag = false;
if (e.getComponent() == map) {
xPress = e.getX()* map.getResizeConstant();
yPress = e.getY()* map.getResizeConstant();
xPressLocal = map.getPress().x + (map.getRelease().x - map.getPress().x)*x... | 3 |
public var_type mod(var_type rhs) throws SyntaxError{
var_type v = new var_type();
keyword returnType = getPromotionForBinaryOp(v_type, rhs.v_type);
if(isNumber() && rhs.isNumber()){
if(returnType == keyword.DOUBLE || returnType == keyword.FLOAT){
sntx_err("mod uses integral types only");
}
if(rhs.va... | 7 |
public static void main(String args[]){
if (args[0].equals("-r")){
int cycles = Integer.parseInt(args[1]);
int rounds = args.length == 3 ? ROUNDS : Integer.parseInt(args[2]);
int actLen = args.length == 3 ? Integer.parseInt(args[2]) : Integer.parseInt(args[3]);
runRandom(cycles, rounds, actLen);
}
els... | 9 |
public Case choixCase(){
Case c;
Scanner console = new Scanner(System.in);
System.out.println("Entrez l'abscisse de la case");
int a,b;
try{
a = Integer.parseInt(console.nextLine());
} catch (NumberFormatException e) {
a = -1;
}
Sys... | 5 |
private int readTypeSpecTable
(ResTable_TypeSpec typeSpecTable,
byte[] data,
int offset) throws IOException {
typeSpecTable.id = readUInt8(data, offset);
offset += 1;
typeSpecTable.res0 = readUInt8(data, offset);
offset += 1;
if (typeSpecTable.res0 != 0)
throw new RuntimeException("File format ... | 2 |
private int maxValue(int[][] grid, int depth, int alpha, int beta)
{
//check if the board is in a terminal (winning) state and
//return the maximum or minimum utility value (255 - depth or
//0 + depth) if the max player or min player is winning.
int winner = checkForWinner(grid);
if ( winner != GV.PLAYER_EM... | 8 |
@Override
public Balance Accesscreate() {
return Balance.create();
} | 0 |
public String commandTOP(String arguments) {
// Splits the input down to the message number and number of lines.
String[] argSplit = (arguments + " ").split(" ", 2);
String msgs = (argSplit[0].toUpperCase()).trim();
String ns = (argSplit[1]).trim();
int msg = convertStrToInt(ms... | 8 |
public void addMethod(CtMethod m) throws CannotCompileException {
checkModify();
if (m.getDeclaringClass() != this)
throw new CannotCompileException("bad declaring class");
int mod = m.getModifiers();
if ((getModifiers() & Modifier.INTERFACE) != 0) {
m.setModifie... | 4 |
private static double[] getSupportPoints(int curvePoints,int lineNumber, double[] lowPrices) {
double[] sPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 999999999;
for(int j=-(curvePoints);j<=0;j++){
if((i+j>=0) && (i+j<lineNum... | 5 |
private Collection<ITask> getRemoverTasks(Collection<ITask> availableTasks, Person person, SimulationMap map) {
Collection<ITask> removers = new ArrayList<>();
Set<String> states = person.getState();
for(ITask t: availableTasks){
if(t.getType().equals("Cleanup") && t.itemsExist(perso... | 6 |
public Object get(String atrName) {
Object ret = null;
if (atrName.equals(LABEL)) {
ret = v.getLabel();
} else if (atrName.equals(SHAPE)) {
ret = v.getShape();
} else if (atrName.equals(BORDER)) {
ret = v.getShapeStroke();
} else if (atrName.eq... | 9 |
@Test
public void testCheckTutChoices(){
//Initialize a boolean saying there are no students who have no first choices and aren't flagged.
boolean startEmptyFirstChoices = true;
//For each student
for(Student s: students){
//If a student has no first choices and isn't flagged
if(s.getFirstChoiceTuts().is... | 8 |
public void setZoom(float zoom) {
if (zoom > this.max_zoom || zoom < this.min_zoom)
return;
if (this.zoomElement) {
this.taille_noeud = taille_noeud / this.zoom * zoom;
this.decalage_passage = decalage_passage / this.zoom * zoom;
this.largeur_chausse = largeur_chausse / this.zoom * zoom;
this.larg_pa... | 3 |
public Object getJsonFromFile(Class<?> type) throws IOException {
Gson gson = new Gson();
Object jsonObject = null;
InputStream stream = this.getClass().getClassLoader()
.getResourceAsStream(getPath());
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(stream));
... | 2 |
protected String read_zigzag(char[][] block, int[] num_key,boolean row)
{
StringBuilder sb=new StringBuilder();
if(row)
{
for(int i=1;i<=num_key.length;i++)
{
int pos=Generic_Func.search_index(num_key, i, 0);
for(int j=0;j<block[pos].length;j++)
{
if(block[pos][j]!='\0')
sb.append(bl... | 7 |
public int storeAnnotation(Annotation anno) {
int result = 0;
ResultSet rs = null;
PreparedStatement statement = null;
try {
statement = conn.prepareStatement("insert into Annotations (TicketID_FK, WorkerID_FK, Annotation, CreatedOn) values (?,?,?,?)", Statement.RETURN_GENERATED_KEYS);
statement.se... | 5 |
private Parameter createGroup(int contextParameter, List<Type> types, List<Annotation[]> annotationsList, List<Field> fields,
Class groupType, Method methodType)
{
List<Parameter> parameters = new ArrayList<>();
int posList = 0;
for (int i = contextParamete... | 2 |
private Move_Two processInput(String xmlString) {
//goal is to convert XML representation, embedded
//in xmlString, to instance of move object. Ideally
//this could be done auto-magically, but these technologies
//are heavyweight and not particularly robust. A nice
//compromise i... | 2 |
public static void bubbleSortImproved(int[] a){
System.out.println("Array before sorting");
for(int i:a)
System.out.print(i+" ");
System.out.println();
System.out.println("Sorting sequences after each iteration");
int n=a.length;
boolean swapped=true;
for(int i=0;i<n&&sw... | 7 |
public void test_LocalDate_toDateMidnight_Turk() {
LocalDate date = new LocalDate(2007, 4, 1);
try {
date.toDateMidnight(MOCK_TURK);
fail();
} catch (IllegalInstantException ex) {
assertEquals(true, ex.getMessage().startsWith("Illegal instant due to time zone ... | 1 |
public static String decrypt (String str) {
byte[] keyMac = OSUtils.getMacAddress();
byte[] keyHardware = OSUtils.getHardwareID();
String s;
try {
Cipher aes = Cipher.getInstance("AES");
if (keyHardware != null && keyHardware.length > 0) {
try {
... | 8 |
private void nextLevel() {
resetLevel();
if(nextLevel.startsWith("b")){
getKarpfenGame().setLvl(new BossLevel(nextLevel, getKarpfenGame()));
}else if(nextLevel.startsWith("s")){
getKarpfenGame().setStory(new Storyline(nextLevel, getKarpfenGame()));
}else{
getKarpfenGame().setLvl(new Level(nextLevel, karp... | 2 |
public static int[] heapSort(int[] array) {
if(array == null || array.length <= 1) {
return array;
}
buildMaxHeap(array);
for(int heapSize = array.length; heapSize > 1; heapSize--) {
swap(array, 0, heapSize - 1);
maxHeapify(array, 0, heapSize - 1);
}
return array;
} | 3 |
public MethodVisitor visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
cp.newUTF8("Synthetic");
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
cp.newUTF8("Deprecated");
}
cp.newUTF8(na... | 5 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public static IXMLFormatter getXMLFormatter(Class toClass)
{
if (g_oFormatters == null)
{
g_oFormatters = new HashTable<Class, IXMLFormatter>();
}
if (g_oFormatters.containsKey(toClass))
{
return g_oFormatters.get(toClass);
}
// Need ... | 9 |
public Puzzle findSolution()
{
iterativeLogicSolve();
printPuzzle();
if(getTruthState()==1)
{
return this;
}
else if(getTruthState()==-1)
{
return null;
}
else
{
Cell c = this.getChoice();
... | 4 |
public void setTempFileManagerFactory(TempFileManagerFactory tempFileManagerFactory) {
this.tempFileManagerFactory = tempFileManagerFactory;
} | 0 |
private boolean r_Step_4() {
int among_var;
int v_1;
// (, line 91
// [, line 92
ket = cursor;
// substring, line 92
among_var = find_among_b(a_5, 19);
if (among_var == 0)
... | 9 |
public static int partition(int[] a, int low, int high)
{
int i = low;
int j = high + 1;
int point = a[low];
while(true)
{
while( less(a[++i], point) )
{
if(i == high)
break;
}
while( less(point, a[--j]) )
{
if(j == low)
break;
}
if(i >= j)
break;
exc... | 6 |
public void assignBehaviour(Behaviour behaviour) {
if (behaviour == null) I.complain("CANNOT ASSIGN NULL BEHAVIOUR.") ;
if (updatesVerbose) I.sayAbout(actor, "Assigning behaviour "+behaviour) ;
actor.assignAction(null) ;
final Behaviour replaced = rootBehaviour() ;
cancelBehaviour(replaced) ;
pu... | 5 |
public static void Unread(String hostmask)
{
for(String s : Prefixes){ if(s.split(" ")[0].equalsIgnoreCase(hostmask)) Prefixes.remove(s); }
for(String s : Suffixes){ if(s.split(" ")[0].equalsIgnoreCase(hostmask)) Suffixes.remove(s); }
} | 4 |
public void startListening() {
listening = true;
Thread thread = new Thread(this);
thread.start();
} | 0 |
public void readBdn(File inFile, File outFile) {
boolean pngToBmp = true;
long lasting = System.currentTimeMillis();
File inParentDirectory = inFile.getParentFile();
File outParentDirectory = outFile.getParentFile();
if (!inParentDirectory.isDirectory()) {
System.out.println("inParentDirectory: " + inPare... | 7 |
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyChar() == KeyEvent.VK_ESCAPE) {
getStageManager().close();
}
} | 1 |
@Override
public void separateOperands() {
operandArray = new ArrayList<String>();
instructionArray = new ArrayList<String>();
for (int i = 0; i < programString.size(); i++) {
if (programString.get(i).contains("DATA")) { //Only operand declarations contain this String sequence
operandArray.add(pro... | 3 |
private void calcWindow()
{
// get current dims
width = getWidth();
height = getHeight();
// do some checks to see if we need a new draw buffer
if(buf == null
|| width < buf.getWidth() - 40
|| width > buf.getWidth()
|| height < buf.getHeight() - 40
|| height > buf.getHeight()
){
buf = new... | 9 |
@Override
public void actionPerformed(ActionEvent ae)
{
for (Updatable u : updatables)
{
if (u == null)
continue;
//When game is paused only update PlayerInput
if (gameIsPaused && u.getClass() != PlayerInput.class)
continue;
... | 4 |
private void layTrack() {
int[] next = null;
switch (buildDir) {
case "N":
next = coaster.nextTrack(1);
break;
case "E":
next = coaster.nextTrack(2);
break;
case "S":
next = coaster.nextTr... | 7 |
public boolean bonusPeutAttaquer(Territoire from, Territoire to){
if( to.estEnBordure() )
return true;
return false;
} | 1 |
@Override
public void makeVisible(boolean v) {
for(IScreenItem item : screenItems) {
item.setVisible(v);
}
} | 1 |
public StringBuilder sub(StringBuilder aValue, String MaxForSub) {
while (aValue.length() > MaxForSub.length()) {
//fills up 0's if value got more numbers
MaxForSub = "0" + MaxForSub;
}
for (int i = aValue.length(); i >= 1; i--) {
if (MaxForSub.charAt(i - 1) > aValue.... | 7 |
public static void refreshNYMSList() {
System.out.println("IN refreshNYMSList");
((NYMTableModel) jTable_NymsList.getModel()).setValue(new NYM().loadNYM(), jTable_NymsList);
nymMap = new NYM().loadNYM();
String serverID = "ALL";
if (serverMap != null && serverMap.size() > 0 &... | 3 |
public float getDiscount() {
return discount;
} | 0 |
public void update(GoldRushApplet app, Mine m) {
if (Collision(m)) {
app.ir.goldcount += currentgold;
currentgold = 0;
x = ux;
y = uy;
if (!(lives - 1 < 0)) {
lives--;
}
if (lives == 0) {
... | 9 |
public static String stripWhitespace(String str) {
char[] from = str.toCharArray();
char[] to = new char[from.length];
int t = 0;
for (char c : from) {
if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) {
to[t++] = c;
}
}
retur... | 5 |
public HashMap<Integer, String[]> sort( File f ) throws IOException{
BufferedReader br = new BufferedReader( new FileReader(f) );
HashMap<Integer, String[]> out = new HashMap<Integer, String[]>();
int c;
int bracket = (int) '>';
int newline = (int) '\n';
int flag = 0;
... | 5 |
private static int outcode(double pX, double pY, double rectX, double rectY, double rectWidth, double rectHeight) {
int out = 0;
if (rectWidth <= 0) {
out |= OUT_LEFT | OUT_RIGHT;
} else if (pX < rectX) {
out |= OUT_LEFT;
} else if (pX > rectX + rectWidth) {
out |= OUT_RIGHT;
}
if (rectHeight <= 0)... | 6 |
public static void CLASS(){
double i = Math.random();
if (i < 0.33)
System.out.println("Even though Damon slept through class, he obtained notes from his good friends Nan, Kevin, and David.");
else if (i < 0.66)
System.out.println("Damon slept through the class, but he somehow feels like he reached an epiph... | 2 |
public static void main(String[] args)
{
System.out.println("------- Some testing --------\n");
Test.jExec();
System.out.println("Program is on.\n");
try {
listeningSocket = new ServerSocket(portNumber);
while(true){
System.out.println("Waiting for a new client...\n");
Socket interactiveSocket... | 3 |
private synchronized void processRequest(Packet packet) {
if(packet == null) {
sendToClient(Packet.getIncorrectCommandPacket());
} else {
String code = packet.getCode();
if(code.equals(Packet.PACKET_COD... | 5 |
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
} | 6 |
public void remove(IHudItem hudItem) {
if (!hudItemQueue.remove(hudItem)) {
logger.info("tried to remove a hud item that didn't exist");
}
} | 1 |
public void testNegated() {
Hours test = Hours.hours(12);
assertEquals(-12, test.negated().getHours());
assertEquals(12, test.getHours());
try {
Hours.MIN_VALUE.negated();
fail();
} catch (ArithmeticException ex) {
// expected
... | 1 |
@EventHandler(priority = EventPriority.HIGH)
public void onBlockBreak(BlockBreakEvent event) {
if (event.isCancelled())
return;
Block bl = event.getBlock();
Location loc = bl.getLocation();
if (bl.getType().equals(Material.ANVIL)) {
if (plugin.anvils.containsKey(loc)) {
ItemStack hand = event.getPl... | 7 |
public boolean handleReleased(Point clickPoint) {
HUDArea hudArea = null;
boolean ret = false;
if(!shouldRender) {
return false;
}
if (isInside(clickPoint)) {
//start from the top and work our way down to "layer" the huds
for (int i =... | 4 |
public static byte getPrecedence(byte t) {
switch (t) {
case WATER:
return WATER_PRECEDENCE;
case GRASS:
return GRASS_PRECEDENCE;
case SNOW:
return SNOW_PRECEDENCE;
case SAVANNAH:
return SAVANNAH_PRECEDENCE;
case SAND_DESERT:
return SAND_DESERT_PRECEDENCE;
default:
return (by... | 5 |
public void getInput() throws IOException {
String command;
Scanner inFile = new Scanner(System.in);
do {
this.display(); // display the menu
// get command entered
command = inFile.nextLine();
... | 5 |
protected static boolean withinGlobeQuandrant(double latitude, double longitude, double nLat, double sLat, double eLong, double wLong) {
return (latitude <= nLat && latitude >= sLat && longitude <= eLong && longitude >= wLong);
} | 3 |
public Label getLabel() {
if (label == null) {
label = new Label();
}
return label;
} | 1 |
public static List<String> split(String l, String sep, Boolean all) {
int nest = 0;
int lsep = sep.length();
ArrayList<String> returnValue = new ArrayList<String>();
if (l.equals("")) {
return returnValue;
}
for (int i = 0; i <= l.length() - lsep; i++) {
... | 9 |
public void testColumnNameCount() {
DataSet ds = null;
try {
final DelimitedColumnNamesInFile testDelimted = new DelimitedColumnNamesInFile();
ds = testDelimted.getDsForTest();
// check that we parsed in the right amount of column names
assertEquals(6, ... | 1 |
private double findStopFraction()
{
// We would like to walk the full length of centerToAff ...
double scale = 1;
stopper = -1;
// ... but one of the points in S might hinder us
for (int j = 0; j < size; ++j)
if (!support.isMember(j))
{
// Compute vector centerToPoint from cen... | 9 |
public void setProtocol(FileProtocol protocol) {
this.protocol = protocol;
setText(protocol.getName());
} | 0 |
public static List<Utterance> segUtterances(List<Utterance> goldUtterances,
boolean dropStress) {
List<Utterance> segUtterances = new LinkedList<Utterance>();
for (Utterance utt : goldUtterances) {
Utterance segUtt = new Utterance(utt, false);
if (dropStress) {
segUtt.reduceStresses();
}
segUtter... | 2 |
public void comandos(){
boolean sesion;
do{
sesion = false;
System.out.println(" ");
if(ManejadorAdministradores.getInstancia().getAdmin() != null){
System.out.print(ManejadorAdministradores.getInstancia().getAdmin().getNick()+">>");
sesion = true;
}else{
ManejadorMiembros.getInstancia().com... | 5 |
public ArrayList<Course> getUnfulfilledCourseRequests(HashMap<String, Course> cs) {
ArrayList<Course> unfulfilledRequests = new ArrayList<Course>();
for (String courseKey : taf.getProcessedCourses()) {
boolean unfulfilled = true;
Course course = cs.get(courseKey);
f... | 4 |
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.