text stringlengths 14 410k | label int32 0 9 |
|---|---|
private boolean checkValidCodeInput(String code){
int CL = (Integer)this.state.get(CODELENGTH);
if (code.length() != CL) {
return false;
}
int maxDigit = (Integer)this.state.get(MAXDIGIT);
for (char c: code.toCharArray()){
if (c <'0' || c > '0' + maxDigit) {
return false;
}... | 4 |
final public void filterExpression() throws ParseException {
/*@bgen(jjtree) filterExpression */
SimpleNode jjtn000 = new SimpleNode(JJTFILTEREXPRESSION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
compareEquation();
... | 8 |
public static Connection getcon() {
Connection con = null;
try {
Class.forName("org.postgresql.Driver").newInstance();
con = DriverManager.getConnection(url, username, password);
} catch (Exception e) {
System.out.println(e);
}
return con;
... | 1 |
public void reiniciar() {
// TODO Auto-generated method stub
textFieldName.setText("");
textFieldLastName.setText("");
textField_7.setText("");
textField_8.setText("");
textField_9.setText("");
textField_10.setText("");
textField_11.setText("");
textField_12.setText("");
textFiel... | 0 |
@Override
public void drop(DropTargetDropEvent dtde) {
if (mDragDockable != null && mDragInsertIndex != -1) {
getDockContainer().stack(mDragDockable, mDragInsertIndex);
dtde.acceptDrop(DnDConstants.ACTION_MOVE);
dtde.dropComplete(true);
} else {
dtde.rejectDrop();
dtde.dropComplete(false);
}
cle... | 2 |
public final void addElements(ElementGraph[][] E){
for(int x = 0; x< IConfig.LARGEUR_CARTE;x++ ){
for(int y = 0; y< IConfig.HAUTEUR_CARTE;y++ ){
this.add(E[x][y],E[x][y].getGridConstraint());
}
}
} | 2 |
public ArrayList<Integer> sortIntegers(ArrayList<Integer> list, int maxDigits) {
int nextPosToSort = 1;
final int base = 10;
int exp = 1;
// Step 1: Perform the sort operation for each digit.
while (nextPosToSort <= maxDigits) {
// Step 1.A: Create buckets for each digit.
ArrayLi... | 5 |
public void changeDirection(String instruction) {
Set<String> instructions = new HashSet<String>(Arrays.asList(new String[]{ "L", "R" }));
if (instruction == null) {
throw new IllegalArgumentException("Instruction can't be NULL");
} else if (!instructions.contains(instruction)) {
throw new Illeg... | 4 |
@AfterTest
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
} | 1 |
public static String stRetValDes (int expVal,int actVal,String functionName,String flow,HashMap<String, String> data)
{
String status;
status=null;
try {
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.n... | 7 |
private void createAndShowGUI() {
//Create and set up the window.
try {
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
... | 3 |
public static String longestCommonSubsequence(String str1, String str2) {
int[][] lcsMap = new int[str1.length() + 1][str2.length() + 1];
for(int i = 0; i <= str1.length(); i++) {
lcsMap[i][0] = 0;
}
for(int j = 0; j <= str2.length(); j++) {
lcsMap[0][j] = 0;
}
for(int i = 1; i <= str1.length... | 9 |
public ParticipantItf makeParticipant() {
// Construct the AutoBean
AutoBean<ParticipantItf> car = factory.part();
// Return the Book interface shim
return car.as();
} | 0 |
private static int findLength(Node h){
int l = 0;
while(h!=null){
l++;
h=h.next;
}
return l;
} | 1 |
void buildInstances(Document doc, String sName) throws Exception {
NodeList nodelist;
// Get the name of the network
nodelist = selectAllNames(doc);
if (nodelist.getLength() > 0) {
sName = ((CharacterData) (nodelist.item(0).getFirstChild())).getData();
}
// Process va... | 8 |
public void move(int newx, int newy, int newz) {
if (_level == null)
return;
_level.setTile(Block.getBlock((byte)0), _x, _y, _z, _server);
Player.GlobalBlockChange((short)_x, (short)_y, (short)_z, Block.getBlock((byte)0), _level, _server, false);
setPos(newx, newy, newz);
_level.setTile(this, _x, _y, _z, ... | 1 |
public Map<Integer, String> getBaseURLs() {
if (baseURLs != null && baseURLs.size() > 0) {
return baseURLs;
}
BufferedReader reader = null;
baseURLs = new HashMap<Integer, String>();
try {
reader = new BufferedReader(new InputStreamReader(new URL(BASE_URL_INFO).openStream()));
String line = null;
... | 9 |
public SimpleSpectralAccessInputParameters(final DataSetApplication datasetAppVal, final Request requestVal, final Context contextVal, final ResourceModel resourceModelVal) {
this.datasetApp = datasetAppVal;
this.context = contextVal;
this.request = requestVal;
this.resourceModel = resourceModelVal;
... | 4 |
private void isGreaterThanInteger(Integer param, Object value) {
if (value instanceof Integer) {
if (!(param > (Integer) value)) {
throw new IllegalStateException("Integer is not greater than supplied value.");
}
} else {
throw new IllegalArgumentException();
}
} | 2 |
public String getDisplayString(Class retType, String name,
Class[] paramTypes)
{
StringBuffer b = new StringBuffer();
b.append("<html>");
if (retType != null)
appendTypeName(b, retType.getName());
b.append(" <font color='blue'>");
... | 3 |
public ApiHandler() {
this.addRtnCode(200, "ok");
} | 0 |
void startAnimationTimer() {
final Display display = parent.getDisplay();
display.timerExec(TIMER, new Runnable() {
public void run() {
if (canvas.isDisposed()) return;
int timeout = TIMER;
GraphicsTab tab = getTab();
if (tab instanceof AnimatedGraphicsTab) {
AnimatedGraphicsTab animTab = (AnimatedG... | 4 |
@Override
protected JPanel createButtonPanel() {
JButton cancel = new JButton("Storno");
cancel.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
actionCancel();
}
});
JButton save = n... | 1 |
public String convert(String s, int nRows) {
if (s == null || s.length() == 0 || nRows <= 0)
return "";
if (nRows == 1)
return s;
StringBuilder res = new StringBuilder();
int size = 2 * nRows - 2;
for (int i = 0; i < nRows; i++) {
for (int j = i; j < s.length(); j += size) {
res.append(s.charAt(j... | 9 |
private void paintReverse(Graphics g,
int clipx, int clipy, int clipwidth, int clipheight,
Object component, boolean enabled) {
if (component != null) {
Rectangle bounds = getRectangle(component, "bounds");
if ((clipx < bounds.x) ||
(clipx + clipwidth > bounds.x + bounds.width) ||
(clipy < bound... | 5 |
private GatewayDevice parseMSearchReply(byte[] reply) {
GatewayDevice device = new GatewayDevice();
String replyString = new String(reply);
StringTokenizer st = new StringTokenizer(replyString, "\n");
while (st.hasMoreTokens()) {
String line = st.nextToken().trim();
... | 8 |
@RequestMapping(value = "/room-event-video-list/{roomEventId}", method = RequestMethod.GET)
@ResponseBody
public CreativeMaterialListResponse roomEventVideoList(
@PathVariable(value = "roomEventId") final String roomEventIdStr
) {
return typedCreativeMaterialList(roomEventIdStr, Creative... | 0 |
@Override
public boolean add(Object item) {
conn = new SQLconnect().getConnection();
if(item instanceof Timenode)
{
Timenode newitem = new Timenode();
newitem = (Timenode)item;
try {
String sql = String.format("INSERT INTO Timenodes(time_weight, time_description, time_owner, display)" +
... | 2 |
public void connectToServer() throws IOException{
try {
this.conn.initConnection();
String pingString = this.receiveMessage();
this.send(pingString);
} catch (IOException e) {
throw(e);
}
} | 1 |
private Transaction openRead(Transaction me) {
// not in a transaction
if (me == null) { // restore object if latest writer aborted
if (writer.isAborted()) {
restore();
version++;
writer = Transaction.COMMITTED;
}
return null;
}
// Am I still active?
if (!me... | 7 |
public GameRunner(Integer personCount, Integer[] scoreSequence) {
bowlingGame = new Game(personCount);
PinCount pinCount;
for(Integer score : scoreSequence) {
try {
pinCount = new PinCount(score);
bowlingGame.roll(pinCount);
} catch (Exception e) {
e.printStackTrace();
}
}
} | 2 |
public BTPosition<T> lowestCommonAncestor(Position<T> root, T a, T b)
throws InvalidPositionException {
BTPosition<T> BTroot = checkPosition(root);
while (BTroot != null) {
T currentV = BTroot.element();
if (comp.compare(currentV, a) > 1 && comp.compare(currentV, b) > 1) {
BTroot = BTroot.getLeft();
... | 5 |
private List<MazeCell> getNNodesNoDiagonal(MazeCell node) {
ArrayList<MazeCell> nbrs = new ArrayList<>();
int x = node.getX();
int y = node.getY();
int xmin = x;
int xmax = x;
int ymin = y;
int ymax = y;
if (x - 1 >= 0) {
xmin = x - 1;
... | 8 |
public static void main(String[] args) throws IOException, ClassNotFoundException, SQLException {
ClienteDAO teste = new ClienteDAO();
Connection c = ConfigurarDB.ConectarComBanco();
Cliente novo = new Cliente(100, "allan", "rock");
teste.ConectarComBanco(c);
... | 1 |
public static ListNode rotateRight(ListNode head, int n) {
int len = 1;
if(head == null) {
return null;
}
ListNode cur = head;
while(cur.next != null) {
len++;
cur = cur.next;
}
n = n % len;
if(len == 1 || n == 0) {
return head;
}
Lis... | 6 |
public void save(DataOutputStream out) throws IOException {
out.writeShort(JPEGImage.DHT);// DHT标志
int len = 16+mPairs.size();
byte[] bytes = new byte[len];
out.writeShort(2 + 1 + len);// 写入段长度
out.write( mType<<4 | mID );// 写入Huffman树类型、ID。
ArrayList< ArrayList<Integer> ... | 4 |
@Override
public boolean hasNext() {
if (this.doNext == ProcessStages.ProcessParent) {
this.next = this.treeNode;
this.doNext = ProcessStages.ProcessChildCurNode;
return true;
}
if (this.doNext == ProcessStages.ProcessChildCurNode) {
if (chil... | 5 |
private long removeRefContact(long lIndex) {
//
// loop through the elements in the actual container, in order to find the one
// at lIndex. Once it is found, then loop through the reference list and remove
// the corresponding reference for that element.
//
Contact refActualElement = GetContact(lIndex);
if (r... | 5 |
public static String getReturnData(String urlString) throws UnsupportedEncodingException {
String res = "";
try {
URL url = new URL(urlString);
//System.out.println(urlString);
java.net.HttpURLConnection conn = (java.net.HttpURLConnection)url.openConnection();
... | 9 |
public static List<Question> getRandomQuestions(int count, Type type)
{
List<Question> questionList = new ArrayList<Question>(count);
try
{
PreparedStatement getRandomQuestionsStatement = getQuestionsFromDatabaseStrategy.getStatement();
getRandomQuestionsStatement.s... | 3 |
private void initGame(GameContainer gc) throws SlickException
{
app.setMouseGrabbed(false);
state = GameState.inGame;
Image img_perso = null;
Image img_fight = null;
Image img_floor = null;
Image img_wall = null;
Image img_light = null;
try
{
img_fight = new Image("images/hit.png");
img_perso... | 1 |
@Override
public void Consultar() throws SQLException
{
try
{
Conexion.GetInstancia().Conectar();
ResultSet rs = Conexion.GetInstancia().EjecutarConsulta("SELECT Nombre, Direccion, Cupo FROM cliente WHERE Cedula = '"+cliente.getCedula()+"';");
w... | 2 |
@Override
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MethodStatistics other = (MethodStatistics) obj;
if (currentMethod == null) {
if (other.currentMethod != null)
return false;
} els... | 7 |
@Override
public boolean canMove(Board board, Field currentField, Field emptyField) {
if (this.validSetupForMove(currentField, emptyField) && emptyField.inSameFileAs(currentField)) {
if (emptyField.distanceBetweenRank(currentField) == this.forwardDistance(1)) {
return true;
} else if (this.isFirstMove() &&... | 5 |
private void abandonAndBuildNewNest(double pa, int N) {
if (Math.random() <= pa)
nests.set(nests.size() - 1, new Nest(new Egg(N)));
} | 1 |
public double[] standardizedItemMaxima(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.standardizedItemMaxima;
} | 2 |
public static Tile shortToTile(short i, Level l, int x, int y) {
Tile tile = new FloorTile();
try {
Class<? extends Tile> class1 = shortToTileMap.get(i);
if (class1 == UnbreakableRailTile.class) {
tile = (Tile) class1.getConstructor(new Class[] { Tile.class })
.newInstance(new Object[] { new FloorTi... | 4 |
@Override
public void handleEmptyEventQueue() {
// TODO Auto-generated method stub
super.handleEmptyEventQueue();
if (exec1xTraffic) {
TrafficExportImport.changeReabilityModel();
TrafficExportImport.readEvents("./Traffic/" + id_execution + "_traffic_"+ Tools.getNodeList().size() + ".txt");
//Tr... | 2 |
private String loginUser(String name, String cmd,String pass) throws InterruptedException, IOException {
readUntil(GosLink.prps("puser"));
write(name);
readUntil(GosLink.prps("ppass"));
write(pass+"\r\n");
readUntil(GosLink.prps("pmenu"));
if (ghost == 1){
write("=x\n");
ghost=0;
return "reload";
... | 1 |
public String next() {
long between = end.getTime() - start.getTime();
Date result = new Date(start.getTime() + (long) Math.floor(Math.random() * between));
return String.format("'%s'", sdf.format(result));
} | 0 |
private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 75
replab0:
while (true) {
v_1 = cursor;
lab1:
do {
// (, line 75
// [, line 77
bra = cursor;
// substring, l... | 8 |
private static void hideEmptySuper(ClassWrapper wrapper) {
for (MethodWrapper method : wrapper.getMethods()) {
if (CodeConstants.INIT_NAME.equals(method.methodStruct.getName()) && method.root != null) {
Statement firstData = Statements.findFirstData(method.root);
if (firstData == null || first... | 8 |
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
int res=JOptionPane.showConfirmDialog(this,"Do you want to save this before quiting ?","New",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
if(res==JOptionPane.NO_OPTION){
JFil... | 9 |
private boolean readFeed() {
try {
// Set header values intial to the empty string
String title = "";
String link = "";
// First create a new XMLInputFactory
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
// Setup a new eventReader
InputStream in = read();
if (in != null) {
... | 8 |
public void panelWelcome() throws IOException {
GridBagConstraints layoutConstraints = new GridBagConstraints();
JLabel icon = new JLabel(getImage("resources/icon.png", 200));
JLabel title = new JLabel("Welcome to JImageViewer!");
title.setFont(new Font("Droid Sans", Font.BOLD, 54));
title.setH... | 9 |
public void filledCircle(double x, double y, double r) {
if (r < 0) throw new RuntimeException("circle radius can't be negative");
double xs = scaleX(x);
double ys = scaleY(y);
double ws = factorX(2*r);
double hs = factorY(2*r);
if (ws <= 1 && hs <= 1) pixel(x, y);
... | 3 |
public void visitEnum(final String name, final String desc,
final String value) {
++size;
if (named) {
bv.putShort(cw.newUTF8(name));
}
bv.put12('e', cw.newUTF8(desc)).putShort(cw.newUTF8(value));
} | 1 |
public UpdateRunnable(LogOre plugin, Choice choice, int id, String file) {
super(plugin, choice, id, file);
this.result = Result.NO_UPDATE;
this.VERSION_URL = "https://api.curseforge.com/servermods/files?projectIds=" + id;
} | 0 |
private boolean isStable(Board board, Location move, int identifier) {
// create copy of board to sim
// this.simBoard = Board.copy(board);
int oppID = (identifier % 2) + 1;
Location attempt;
// this.simBoard.getTile(move.getHorizontal(),
// move.getVertical()).setColor(identifier);
for (int i = 0; i < ... | 7 |
private static void extractSearch(String commandInfo) {
if(commandInfo == null || commandInfo.equals("")) {
dataPacket[LOCATION_COMMAND_ID] = ERROR_WRONG_PARAM;
} else if(TimeParser.checkDate(commandInfo)) {
try {
String searchDate = TimeParser.getDate(commandInfo);
dataPacket[LOCATION_COMMAND_ID] = I... | 9 |
public int getSelectedIndex() {
if (type != MULTIPLE) {
/*
if (type == IMPLICIT) {
for (int i = 0; i < size(); i++)
if (getLabel(i).hasFocus()){
setSelectedIndex(i, true);
return i;
}
}*/
for (int i = 0; i < size(); i++)
if (isSelected(i))
... | 3 |
public List<River> getAllRivers (boolean getAll) {
if (getAll)
return rivers;
List <River> filteredRivers;
filteredRivers = new ArrayList<River>();
for (River r: rivers) {
if (r.getIsFavoured()) {
filteredRivers.add(r);
}
}
return filteredRivers;
} | 3 |
public CounterParties(Accounting accounting){
addSearchKey(ACCOUNTNUMBER);
setName(COUNTERPARTIES);
try {
accounting.addBusinessObject(this);
} catch (EmptyNameException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Temp... | 2 |
public void setTopLeft(int x, int y)
{
topLeft[0] = x;
topLeft[1] = y;
} | 0 |
public FlashShot(String getColour,boolean fade)
{
style = fade;
if (fade)
{
transparency = 255;
}
if (getColour.equals("Black"))
{
flashScreen.setColor(Color.BLACK);
}
else if (getColour.equals("White"))
{
fl... | 4 |
private void doDrawing(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
BufferedImage img = null;
img = createImage();
/* try {
img = ImageIO.read(new File("image.jpg"));
} catch (IOException e) {
}*/
img.flush();
... | 2 |
private void validarLogin(){
FuncionarioController fc = new FuncionarioController();
String senha = txSenha.getText();
String login = txLogin.getText();
boolean retorno = fc.autenticarLogin(login, senha);
if(retorno == true){
... | 5 |
@Override
public String convertToString(Character[] array) {
if (array.length == 0) {
return "";
}
StringBuilder buf = new StringBuilder(array.length * 8);
for (int i = 0; i < array.length; i++) {
if (arr... | 4 |
public int searchIndexGraphNode(GraphNode nodo){//searches the position of the node in the list.
for(int i=0;i<graph_nodes.getLength();i++){
if(nodo.equals(graph_nodes.get(i)))
return i;
}
return -1;
} | 2 |
private int setStartedAllready(int x) {
Boolean mediaStarted = false;
mediaStarted = mediaPlayer.isPlaying();
if(mediaStarted) {
startedAllreadyGlobal = true;
theTimer.stop();
}
x = x + 200;
if(x > 5000 && mediaStarted == false){
Syst... | 3 |
public void merge(int[]a, int begin, int end){
if(begin >= end)return;
int center = (begin + end)/2;
merge(a, begin, center);
merge(a, center + 1, end);
int lbegin = begin;
int rbegin = center + 1;
int[] temp = new int[a.length];
int i = begin;
while(lbegin <= center && rbegin <= end){
if(a[lbegin]... | 7 |
@Override
public ContainerRequest filter(ContainerRequest containerRequest)
throws WebApplicationException {
// GET, POST, PUT, DELETE, ...
String method = containerRequest.getMethod();
// /tasks for example
String path = containerRequest.getPath(true);
System.out.println(path);
// We allow login lo... | 7 |
private static int arrayHashCode(Object object)
{
if (object == null)
return 0;
int result = 1;
Object[] array = (Object[]) object;
for (int i = 0; i < array.length; ++i) {
int elementHashCode = 0;
if (array[i] != null)
elementHashCo... | 3 |
public static Double calcDateValue( String dateString )
{
String[] formats = {
"MM/dd/yyyy HH:mm:ss",
"MM/dd/yy HH:mm:ss",
"MM/dd/yy",
"MM/dd/yyyy",
"MM/d/yyyy HH:mm:ss",
"MM/d/yy HH:mm:ss",
"yy-M-d hh:mm:ss a",
"yy-M-d HH:mm:ss",
"yy-M-d hh:mm a",
"yy-M-d HH:mm",
"dd-M-yy... | 5 |
public void testFactory_fromDateFields_null() throws Exception {
try {
LocalDateTime.fromDateFields((Date) null);
fail();
} catch (IllegalArgumentException ex) {}
} | 1 |
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null || this.getClass() != obj.getClass())
{
return false;
}
Project other = (Project) obj;
/*
* Omit expandType to allow manually-assembled projects to still equal
* auto-expanded ones, if all els... | 3 |
public void applyPermissions() {
if (this.group.equals(GroupType.MANAGER)) {
permissions.put("Dashboard", true);
permissions.put("Products", true);
permissions.put("Statistics", true);
permissions.put("Create Trays", true);
permissions.put("Logout", true);
permissions.put("Create Stock", true);
p... | 2 |
public void paintBorder(Component component, Graphics g, int x, int y, int w, int h) {
g.setColor(Color.black);
g.drawRect(x + dist / 2, y + dist / 2, w - dist, h - dist);
if (component.hasFocus()) {
for (int i = 0; i < locations.length; i++) {
Rectangle rect = getRectangle(x, y, w, h, locations[i]);
... | 2 |
private void RodLogic(MouseEvent e){
if(e.getButton() == 1){
Point t1 = getMouseLocationOnComp();
AttachmentPoint tPoint = GetAttachmentPoint(t1);
if(tPoint == null){
double[] t2 = {t1.getX(), t1.getY()};
tPoint = new AttachmentPoint(.5, t2);
attachPoints.add(tPoint);
... | 3 |
private int fixOrphans()
{
//For each orphanned label reference...
for(Label o : m_orphans)
{
boolean bFound = false; // was this orphan's label found?
if (m_verbose)
System.out.print("Searching for orphan label: " + o.name + " among: ");
... | 7 |
protected boolean isConflictRules(Rule r1, Rule r2) throws TheoryNormalizerException {
logMessage(Level.FINER, 1, "verify conflict rules", r1.getLabel(), r2.getLabel());
boolean isConflictRule = false;
List<Literal> r1Heads = r1.getHeadLiterals();
List<Literal> r2Heads = r2.getHeadLiterals();
for (int j = 0; ... | 5 |
public boolean isBattleWon() {
if (enemy[0].isAlive() == false && enemy[1].isAlive() == false
&& enemy[2].isAlive() == false) {
return true;
}
else {
return false;
}
} | 3 |
public String createPopulation(ArrayList<String[]> ped) {
individual = new ArrayList<Individual>();
founderAlleleCount=0;
int iCount = ped.size();
for (int i=0; i<iCount; i++) {
//System.out.println(i+": "+ped.get(i)[0]+" "+ped.get(i)[1]+" "+ped.get(i)[2]);
if (pe... | 5 |
public String[] splitToWords(String text)
{
String[] result = null;
text = text.replaceAll("\n", "\n ");
result = text.split("[ \t\f\r]");
return result;
} | 0 |
void SetInfo(String info) {
StringBuffer user, desc, conn, mail, share;
int index = 0;
user = new StringBuffer();
while (info.charAt(index) != ' ') {
user.append(info.charAt(index));
index++;
}
String strUser = user.toString();
if (strUser.equalsIgnoreCase(_bot.botname()))
return;
index++;
d... | 9 |
public Collection<WordOccurences> getAllTerms() {
try {
List<String> terms = myStem.lemmatize(path);
Map<String, WordOccurences> occurences = new HashMap<>();
for (int i = 0; i < terms.size(); ++i) {
String term = terms.get(i);
if (occurences.c... | 3 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Townshippolicestation)) {
return false;
}
Townshippolicestation other = (Townshippolicestation) object;
if ((th... | 5 |
public static byte[] getCommand(String command, startGui GUI, int Tabid) {
byte[] returnArr = null;
String commands[] = command.split(" ", 2);
if (commands[0].equalsIgnoreCase("§nick")) {
if (commands.length > 1) {
returnArr = Message.changeNick(commands[1]);
... | 8 |
protected Cellule laplusproche(List<Cellule> ressource){
Cellule cel = ressource.get(0);
int plusproche = ressource.get(0).coord.distance(this.curent.coord);
for (int i =1 ; i<ressource.size() ; i++){
if(ressource.get(i).coord.distance(this.curent.coord)< plusproche){
cel = ressource.get(i);
plusproche... | 2 |
private static void findLinks(URL url, Integer counter) {
/*
* now we construct the first html body
*/
HtmlBody htmlBody;
/*
* now we actually create the html body
*/
try {
/*
* we have to create a new http client for every request because
* the sockets are use once-only
... | 7 |
public static boolean belongsInProductionWithUsefulVariableSet(
Production production, Set usefulVariableSet) {
if (isValidProduction(production, usefulVariableSet)) {
return true;
}
return false;
} | 1 |
public LvlReader(String str){
Properties prop= new Properties();
String str2 = "/res/"+str;
try{
InputStream in = getClass().getResourceAsStream(str2);
prop.load(in);
Level.xMax =Integer.parseInt(prop.getProperty("xMax"));
Level.widthMu =Integer.parseInt(prop.getProperty("widthMu"));
Level.dxMu =In... | 2 |
@Override
public void run() {
int varA = 1;
detenethilo = false;
while (true) {
if (detenethilo) {
break;
}
int x = Juego.jFlappy.getLocation().x;
if (!isSaltar()) {
int y = Juego.jFlappy.getLocation().y;
... | 7 |
public String updateUsuario() {
boolean transaccionCorrecta = false;
try {
rolUsu = rolUsu.charAt(0) == '1' ? "ADMINISTRADOR" : rolUsu;
rolUsu = rolUsu.charAt(0) == '2' ? "SECRETARIA" : rolUsu;
rolUsu = rolUsu.charAt(0) == '3' ? "CHOFER" : rolUsu;
... | 8 |
public static void printlnWithColor(String color, String message){
try{
Colores col = Colores.valueOf(color.toUpperCase());
System.out.println("\033[" + col.cod + "m" + message + "\033[30m");
}catch (IllegalArgumentException e){
System.out.println("\033\tError: " + e.... | 1 |
public Map create(String name, Tile[][] map) throws MapNotRectangularException, MapAlreadyExistsException{
if(!mapMap.containsKey(name)){
return new Map(name, map);
}
else {
throw new MapAlreadyExistsException();
}
} | 1 |
public int getInt() throws IOException {
String s = "";
while ( (c != '\n') && Character.isSpaceChar(c) )
getChar();
while ( (c != '\n') && !Character.isSpaceChar(c) ) {
s = s + c;
getChar();
}
return Integer.parseInt(s);
} | 4 |
private void setImgCoords() {
switch(type) {
case DIG:
imgX1 = 2*BLOCKSIZE + (depth/4)*BLOCKSIZE;
imgY1 = (depth % 4) * BLOCKSIZE;
break;
case DIRT:
imgX1 = 0;
imgY1 = 0;
break;
ca... | 9 |
@Override
public int getPreferenceListSize() {
return prefs.size();
} | 0 |
public JStackMeta process() {
try {
FileInputStream inputStream;
inputStream = new FileInputStream(_file);
BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
boolean finishedHeader = false;
JStackEntry currentEntry = new JSta... | 8 |
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.