text stringlengths 14 410k | label int32 0 9 |
|---|---|
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 Area getArea(int absLeft, int absTop, int offset) {
if (isOverElement(absLeft, absTop)) {
if (absLeft < (m_left + 10)) {
// left border
if (absTop < (m_top + offset)) {
// top left corner
return Area.CORNER_TOP_LEFT;
... | 9 |
public static int[] bilinear(int[] pixs, int iw, int ih, int ow, int oh, float p) {
int[] opix = new int[ow * oh];
for (int i = 0; i < oh-1; i++) {
float dy = i/p;
int iy = (int)dy;
if(iy>ih-2)iy = ih-2;
float d_y = dy-iy;
for (int j = 0; j < ow-1; j++) {
int g;
float dx = j/p;
int i... | 4 |
static void next_move(int posr, int posc, String[] board) {
char[][] chars = new char[board.length][board[0].length()];
for (int i = 0; i < board.length; i++) {
chars[i] = board[i].toCharArray();
}
String ret = null;
if (chars[posr][posc] == 'd') {
ret = ... | 8 |
private boolean vertical(int row, int column)
{
Color currentColor = boardArray[row][column].getColor();
if (row > GameConstants.NUM_ROWS - GameConstants.SEQ_LENGTH)
{
return false;
}
for (int i = 1; i < GameConstants.SEQ_LENGTH; i++)
{
if (boardArray[row + i][column].getColor() != currentColor)
... | 4 |
public static void main(String[] args) throws Exception {
String[] args1 = new String[1];
args1[0] = SITOOLS_MAIN_CLASS;
args = args1;
if (args.length != 1) {
System.err.println("Sitools Main class is not set");
System.exit(1);
}
Class[]... | 5 |
public void test_02() {
Random rand = new Random(20121221);
GenotypeVector gv = new GenotypeVector(1000);
// Create random codes
int codes[] = new int[gv.size()];
for (int i = 0; i < gv.size(); i++) {
int code = rand.nextInt(4);
codes[i] = code;
gv.set(i, code);
}
// Check that codes are stored... | 2 |
private ArrayList<AntBrain> declareWinner() {
ArrayList<AntBrain> winningBrains = new ArrayList(); // ALEX: Again wasn't compiling due to error, reinitialised as ArrayList seemed to fix
int highestScore = 0;
String winnerString = "Winners:\n";
//need to do this separately to just findin... | 4 |
@SuppressWarnings("unchecked")
public static void printMap(Map map, int depth)
{
final Iterator i = map.keySet().iterator();
Object key = null;
for (int k = 0; k < depth; k++)
System.out.print(" ");
System.out.println("Dictionary:");
while (i.hasNext() && (key =... | 5 |
public Integer getStat() throws Exception {
try {
return dir.list().length;
}
catch (Exception e) {
return 0;
}
} | 1 |
@RequestMapping("/form")
public String form(User user, BindingResult result, Model model) {
return "users/form";
} | 0 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
... | 9 |
@Override
public TexInfo getTexInfo(int metadata){
switch(metadata){
default:
case 0:
return normal;
case 1:
return open;
}
} | 2 |
private synchronized void parseMessage(Message2 m)
{
if(m.isRequest()) {
switch(state)
{
case IN_CS: // if they are going in the same direction send ack, else queue the request
if(direction == m.getDirection())
sendAckTo(m.sender());
else
pending[m.sender()] = true;
break;
... | 8 |
public String convertImg(String srcUrl,String width,String height,String IP_PORT,String apiKey){
String name = upLoad(srcUrl, IP_PORT, apiKey);
String ext = getFileHouzhui(name);
String id = name.replace(ext,"");
String destination = "http://"+IP_PORT+"/cms/api/convertImage?id="+id+"&e... | 3 |
public boolean CheckFunctionProtoType(String name, TypeInfo ret_type, ArrayList type_infos) {
for (Object o : protos) {
FunctionInfo fpinfo = (FunctionInfo) o;
if (fpinfo._name.equals(name)) {
if (fpinfo._ret_value == ret_type) {
if (type_infos.size() ... | 6 |
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 void insertTag(Tag tag, int index) {
if (type != Type.TAG_List && type != Type.TAG_Compound)
throw new RuntimeException();
Tag[] subtags = (Tag[]) value;
if (subtags.length > 0)
if (type == Type.TAG_List && tag.getType() != getListType())
throw new IllegalArgumentException();
if (index > subtag... | 6 |
protected static void run(Parameters p) throws IOException {
AbstractPointDistribution dist = new ZeroOriginDistribution(p);
FixationTimeWriter ftw = new FixationTimeWriter(p);
IteratedSimulationWriter isw;
if (!p.getOutput().equalsIgnoreCase("MINIMAL"))
isw = new IteratedSimulationWriter(p);
else
... | 7 |
public MyCell getCell(int x, int y){
if(cycle){
if(x<0 || x >= columns) x = (x % columns + columns) % columns;
if(y<0 || y >= rows) y = (y % rows + rows) % rows;
}else if(x<0 || x>= columns || y < 0 || y >= rows) return null;
return matrix[y][x];
} | 9 |
public void setSelectedFontFamily(String name)
{
String[] names = getFontFamilies();
for (int i = 0; i < names.length; i++)
{
if (names[i].toLowerCase().equals(name.toLowerCase()))
{
getFontFamilyList().setSelectedIndex(i);
break;
... | 2 |
public static void main(String[] args) throws ParseException {
System.out.println("-----------RE-IMPLEMENTATION----------");
CurrentDate CurrDate = new CurrentDate();
Date date = CurrDate.input();
//Date date = CurrDate.system();
System.out.println("Date: "+date);
Calen... | 5 |
@SuppressWarnings("deprecation")
public void convertBook(Player player) {
// PUT THIS INTO EVERY METHOD
PluginDescriptionFile pdfFile = plugin.getDescription();
String cmdFormat = "[" + pdfFile.getName() + "] ";
// --------------------------
// This function will check if the player
// holds a book, and t... | 9 |
MapPanel(Map map){
requestFocus();
setBackground(Color.BLACK);
this.map=map;
this.map.setPanel(this);
setPreferredSize(new Dimension(img[0].getWidth(),img[0].getHeight()));
g2d[0] = img[0].createGraphics();
g2d[1] = img[1].createGraphics();
addKeyListener(new KeyAdapter() {
@Override
public void keyP... | 9 |
public static Command processTags(String[] args, Command.Commands type) {
String outFile = args[args.length - 1];
String inFile = outFile;
if (args.length % 2 == 1 ) {
inFile = args[args.length - 2];
}
System.out.println("Source file: " + inFile);
System.out.... | 4 |
public static void main(String[] args) {
Collection<Integer> collection = new ArrayList<Integer>(Arrays.asList(
1, 2, 3, 4, 5));
Integer[] moreInts = { 6, 7, 8, 9, 10 };
collection.addAll(Arrays.asList(moreInts));
// Runs significantly faster, but you can't
// construct a Collection this way:
C... | 0 |
@Override
public void paint(Graphics g) {
Graphics graph = io.getGraphics();
for (int x = 0; x < array.length; x++)
for (int y = 0; y < array[x].length; y++) {
if (array[x][y] == 0.0)
continue;
// graph.setColor(array[x][y].getColor());
Color c = moduleColor[x][y];
if (c == null) {
int... | 6 |
public boolean checkUser(String user, String password){
Statement st;
ResultSet rs;
String query;
try {
st = conn.createStatement();
query="SELECT * from people WHERE name='"+user+"' AND password='"+password+"'";
rs = st.executeQuery(query);
if (rs.next()){
return true;
}
else{
retu... | 2 |
public Mc_IrcBotCommands(AprilonIrc plugin){ Parent = plugin; } | 0 |
public int getComboBox6 () {
if (jComboBox6.getSelectedIndex() == 0) return 10;
else if (jComboBox6.getSelectedIndex() == 1) return 50;
else if (jComboBox6.getSelectedIndex() == 2) return 100;
else if (jComboBox6.getSelectedIndex() == 3) return 250;
else if (jComboBox6.getSelec... | 6 |
@Override
public int calculatePreferredWidth(TreeRow row) {
int width = TextDrawing.getPreferredSize(getFont(row), getText(row)).width;
StdImage icon = getIcon(row);
if (icon != null) {
width += icon.getWidth() + ICON_GAP;
}
return HMARGIN + width + HMARGIN;
} | 1 |
private void readChunkUnzip(Inflater inflater, byte[] buffer, int offset, int length) throws IOException {
assert (buffer != this.buffer);
try {
do {
int read = inflater.inflate(buffer, offset, length);
if (read <= 0) {
if (inflater.finishe... | 5 |
protected void fireReceiveData(ReceiveDataEvent evt) {
//..here receive all calls from server
try {
Object object = SerializeUtils.deserializeFromBytes(evt.getData());
if (!(object instanceof IRemoteCallObject)) {
throw new IllegalArgumentException("Data isn't instanceof IRemoteCallObject");... | 2 |
@Basic
@Column(name = "customer_id")
public Integer getCustomerId() {
return customerId;
} | 0 |
private void analyseOperandFormat(String line) throws AssemblerException {
line = line.trim();
String[] mnemFormatSplit = line.split("\\s+");
ArrayList<String> mnemFormatList = new ArrayList<String>();
for (String formatTerm : mnemFormatSplit) {
formatTerm = formatTerm.replaceAll("^,+", "");
formatTer... | 5 |
@Override
public void execute(String args)
{
String userToKick = args.split(" ")[1];
String reason;
try
{
@SuppressWarnings("unused")
String ignored = args.split(" ")[2];
reason = args.replace(args.split(" ")[1], "");
reason = reason.replace(args.split(" ")[0], "");
}
catch (Index... | 6 |
public int getCellRowNum(String sheetName,String colName,String cellValue){
for(int i=2;i<=getRowCount(sheetName);i++){
if(getCellData(sheetName,colName , i).equalsIgnoreCase(cellValue)){
return i;
}
}
return -1;
} | 2 |
public boolean isArrayType(String group, String key) {
int type = getType(group, key);
switch (type) {
case Registry.TYPE_STRING_ARRAY:
case Registry.TYPE_OBJECT_ARRAY:
case Registry.TYPE_BYTE_ARRAY:
case Registry.TYPE_CHAR_ARRAY:
case Registry.TYPE_INT_ARRAY:
return true;
default:... | 5 |
private static void renderEditSkill(int windowX, int windowY){
renderElements(windowX, windowY);
renderTypes(windowX, windowY);
renderEffects(windowX, windowY);
//Bottom Buttons
for(int i = 0; i < 2; i++){
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(0.5f, 0.5f, 0.5f);
GL11.glBegin(GL11.G... | 3 |
public void makeDeclaration(Set done) {
if (instr != null)
instr.makeDeclaration(done);
super.makeDeclaration(done);
} | 1 |
public boolean checkNumber(BigInteger number) {
if (getDigits(number).equals(getDigits(number.multiply(new BigInteger("2")))) &&
getDigits(number.multiply(new BigInteger("3"))).equals(getDigits(number.multiply(new BigInteger("4")))) &&
getDigits(number.multiply(new BigInteger("5"... | 5 |
private void packtiles(Collection<Tile> tiles, Coord tsz) {
int min = -1, minw = -1, minh = -1;
int nt = tiles.size();
for (int i = 1; i <= nt; i++) {
int w = Tex.nextp2(tsz.x * i);
int h;
if ((nt % i) == 0)
h = nt / i;
else
h = (nt / i) + 1;
h = Tex.nextp2(tsz.y * h);
int a =... | 7 |
@Override
public void endDocument () {} | 0 |
private static String[][] unify(String sen1, String sen2, String[][] currentSub){
//System.out.println("Unifying " + sen1 + " and " + sen2);
if(currentSub[0][0] != null && currentSub[0][0].equals("failure")){
return currentSub;
}
else if(sen1.equals(sen2)){
return currentSub;
}
else if(isVariable(sen1... | 9 |
public void setDepartment(String department) {
this.department = department;
setDirty();
} | 0 |
public void messageReceived(MessageEvent event) {
if (event.getId() == 2 && isMe(event.getSender())) {
if (event.getMessage().contains("Hey well done"))
Paint.Caught++;
if (event.getMessage().contains("Go on"))
Paint.Attempts++;
}
if (event.getId() == 0 && event.getMessage().contains("The rat manage... | 8 |
public boolean isLegalMove(double newBearing) {
// because 0 and 360 are the same, this makes things a little easier
if (newBearing == 360) newBearing = 0;
// make sure it's in bounds
if (newBearing < -2 || newBearing > 360) {
System.err.println("ERROR! " + newBearing + " is not a legal bearing");
retu... | 9 |
private SuggestEngineResult executeUmlCommand() throws IOException {
systemFactory.init(startLine);
while (hasNext()) {
final String s = next();
if (StartUtils.isArobaseEndDiagram(s)) {
return SuggestEngineResult.SYNTAX_OK;
}
final SuggestEngineResult check = checkAndCorrect(s);
if (check.getStat... | 7 |
public String multiply(String num1, String num2) {
int[] result = new int[num1.length() + num2.length()-1];
for(int i=num1.length()-1; i>=0; i--){
for(int j=num2.length()-1; j>=0; j--){
result[i+j] += (num1.charAt(i)-'0') * (num2.charAt(j)-'0');
}
}
String num = "";
for(int i=result.leng... | 7 |
private String getLeftStringResult(String step, int pos, char value) {
String result = "";
pos--; // the initial position is already taken care of
for (; pos >= 0; pos--) {
if (step.charAt(pos) != '0' && step.charAt(pos) != '1') {
break;
}
result += value;
}
return result;
} | 3 |
public void testMinus_int() {
Months test2 = Months.months(2);
Months result = test2.minus(3);
assertEquals(2, test2.getMonths());
assertEquals(-1, result.getMonths());
assertEquals(1, Months.ONE.minus(0).getMonths());
try {
Months.MIN_VALUE.... | 1 |
public OptParam(Param p) {
parameter = p;
double min = p.getLower();
double max = p.getUpper();
// Compute the parameter mean.
// double[] val_f = p.getVal_f();
double[] val = Util.getVals(p);
mean = 0.0;
for (int i = 0; i <... | 2 |
public LinkedList<ImageIcon> getSavedImages(SolrDocumentList docs) {
LinkedList<ImageIcon> pictures = null;
// long time=0;
pictures = new LinkedList<ImageIcon>();
for (SolrDocument doc : docs) {
String pictureURL = (String) doc.getFieldValue(PICTURE_URL);
// long tic = System.currentTimeMi... | 3 |
int getContentWidth (int columnIndex) {
int width = textWidths [columnIndex] + 2 * MARGIN_TEXT;
if (columnIndex == 0) {
width += parent.col0ImageWidth;
if (parent.col0ImageWidth > 0) width += CTable.MARGIN_IMAGE;
} else {
Image image = getImage (columnIndex, false);
if (image != null) {
width += image.get... | 3 |
public static void setUtilizationThreshold(int value) {
if (value >= 0 && value <= 100) {
utilization_threshold = value;
}
} | 2 |
public static String getPassword(final String prompt) {
try {
// password holder
final StringBuffer password = new StringBuffer();
final PasswordHidingThread maskingthread = new PasswordHidingThread(prompt);
final Thread thread = new Thread(maskingthread);
... | 5 |
private static String escapeJSON(String text) {
StringBuilder builder = new StringBuilder();
builder.append('"');
for (int index = 0; index < text.length(); index++) {
char chr = text.charAt(index);
switch (chr) {
case '"':
case '\\':
... | 8 |
private Map<Integer, IMappedPage[]> testAndGetSharedMap(IMappedPageFactory pageFactory, int threadNum, int pageNumLimit) {
// init shared map
Map<Integer, IMappedPage[]> sharedMap = new ConcurrentHashMap<Integer, IMappedPage[]>();
for(int i = 0; i < threadNum; i++) {
IMappedPage[] pageArray = new IMappedPag... | 7 |
private void loadProperties(){
Properties prop = new Properties();
InputStream input = null;
try {
input = new FileInputStream("config/config.properties");
prop.load(input);
Tele_Sync = (prop.getProperty("Sync"));
Tele_Sync_start = (prop.getProperty("Sync_Start"));
Tele_Sync_end = (prop.get... | 3 |
public List<LocationDTO> getLocationDTO() {
if (locationDTO == null) {
locationDTO = new ArrayList<LocationDTO>();
}
return this.locationDTO;
} | 1 |
public void drawShortestPath(Graphics g)
{
TreeMap<Vertex, Vertex> previousPoint =
Dijkstra.getShortestPaths(vertices.endA, vertices.endB, vertices.getVertices().toLinkedList());
if (previousPoint == null) return;
TreeMap<Vertex, Vertex> shortestPath = new TreeMap(... | 6 |
private static void output() throws FileNotFoundException, IOException {
OutputStream out = new FileOutputStream("/tmp/file_out.txt");
out.write(1);
out.close();
} | 0 |
private boolean movementButtonIsPressed(Input input) {
return input.isKeyDown(Input.KEY_UP) || input.isKeyDown(Input.KEY_DOWN) || input.isKeyDown(Input.KEY_LEFT) || input.isKeyDown(Input.KEY_RIGHT);
} | 3 |
public static Pearson getPearsonFor(int userId1, int userId2, Map<Integer, Map<Integer, Pearson>> pearsons) {
if (userId1 < userId2 && pearsons.containsKey(userId1)) {
Map<Integer, Pearson> map = pearsons.get(userId1);
if (map.containsKey(userId2)) {
return map.get(userId2);
}
} else if (userId1 > user... | 6 |
public int attackSpecial(Character opponent){
int damage;
System.out.println(_name+" swings at you with his suspenders!");
damage = suspenders(opponent);
if ( damage < 0 )
damage = 0;
opponent.lowerHP( damage );
return damage;} | 1 |
public SplashScreen(URL filename) {
// Get Image
MediaTracker mt = new MediaTracker(this);
image = Toolkit.getDefaultToolkit().getImage(filename);
mt.addImage(image,0);
try {
mt.waitForID(0);
} catch(InterruptedException ie){}
// Set size of image
setSize(image.getWidth(null),image.getHeight(null));... | 1 |
@Override
public <T> List<String> config(Class<T> clazz) throws NoConfigException {
if (this.configed) {
if (null == this.config) {
throw new NoConfigException("Actually Not Configed yet OR Config missing.");
} else {
return this.config.get(clazz);
... | 3 |
public Process deQueue() // Remove from the head.
{
Process temp = peek(); // temp stores head
head = head.next;
return temp;
} | 0 |
private void checkCompleteTask(String input) throws IOException {
Task mostRecentTask = new Task();
ArrayList<Task> tasksToBeCompleted = new ArrayList<Task>();
tasksToBeCompleted = searchForTask(input);
if (tasksToBeCompleted.size() == 0) {
UIHandler.getInstance().printToDisplayRed(MESSAGE_NO_ENTRY);
} e... | 7 |
public void collectAll(Iterable<? extends Player> allPlayers) {
for(Player p : allPlayers) {
this.collect(p);
}
} | 2 |
public void run() {
try {
while (true) { // Loop forever
// If this server thread is paired
if (this.pairedServerThread != null) {
while ((inputLine = this.inFromClient.readLine()) != null) { // Read line
System.out.println("Server sending: " + inputLine);
this.paired... | 5 |
public String readTextFile(String fileName) {
String returnValue = "";
FileReader file = null;
String line = "";
try {
file = new FileReader(fileName);
BufferedReader reader = new BufferedReader(file);
while ((line = reader.readLine()) != null) {
... | 5 |
public mxRectangle getBoundsForCells(Object[] cells, boolean includeEdges,
boolean includeDescendants, boolean boundingBox)
{
mxRectangle result = null;
if (cells != null && cells.length > 0)
{
for (int i = 0; i < cells.length; i++)
{
mxRectangle tmp = getCellBounds(cells[i], includeEdges,
in... | 5 |
private void layoutVertical(int top, int bottom, int left, int right) {
int topY = paddingTop;
int width = right - left;
int childRight = width - paddingRight;
int availableWidth = width - paddingLeft - paddingRight;
for (int i = 0; i < getChildCount(); i++) {
View ... | 6 |
public static void run(String title, int width, int height, Consumer<ApplicationContext> applicationCode) {
Objects.requireNonNull(title);
if (width < 0 || height < 0) {
throw new IllegalArgumentException("invalid size");
}
Objects.requireNonNull(applicationCode);
final BufferedImage buff... | 9 |
protected void fitLogistic(Instances insts, int cl1, int cl2,
int numFolds, Random random)
throws Exception {
// Create header of instances object
FastVector atts = new FastVector(2);
atts.addElement(new Attribute("pred"));
FastVector attVals = new FastVector(2);
attVals.ad... | 7 |
void setReturnType(String desc) throws CompileError {
int i = desc.indexOf(')');
if (i < 0)
badMethod();
char c = desc.charAt(++i);
int dim = 0;
while (c == '[') {
++dim;
c = desc.charAt(++i);
}
arrayDim = dim;
if (c =... | 4 |
public Main( ) {
/**
* Add action listeners for buttons
*/
// Get available actions
// and add listeners for these action buttons
for( int i = 0 ; i < actionButtons.length ; ++i ) {
final Action action = actionFactory.get(i) ;
JButton button = new JButton( ... | 7 |
public void setId(Integer id) {
this.id = id;
} | 0 |
public ResumeDownloadView(){
this.mangaUrlTF = new JTextField();
this.chapterTF = new JTextField();
this.pathTF = new JTextField();
this.pathFC = new JFileChooser();
this.pathFC.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
this.startBT = new JButton("Start");
this.stopBT = new JButton("Stop");
... | 8 |
public LocalInfo findLocal(String name) {
Enumeration enum_ = allLocals.elements();
while (enum_.hasMoreElements()) {
LocalInfo li = (LocalInfo) enum_.nextElement();
if (li.getName().equals(name))
return li;
}
return null;
} | 2 |
@Override
public int compareTo(WeightedEdge that)
{
if (this.weight < that.weight)
return -1;
if (this.weight > that.weight)
return +1;
else
return 0;
} | 2 |
public String buscarGrupoEstudioPorEstado(String estado) {
ArrayList<GrupoEstudio> geResult= new ArrayList<GrupoEstudio>();
ArrayList<GrupoEstudio> dbGE = tablaGrupoEstudio();
String result="";
try{
for (int i = 0; i < dbGE.size() ; i++){
if(dbGE.get(i).getEstado().eq... | 5 |
public int compare(Key o1, Key o2) {
if ((o1.getParentPath() == null && o2.getParentPath() != null) ||
(o1.getParentPath() != null && o2.getParentPath() == null)) {
throw new RuntimeException(CAN_T_COMPARE_KEYS_FROM_DIFFERENT_DIMENSIONS);
}
if (o1.getParentPath() == null && o2.getParentPath() == null) {
... | 9 |
public static ArrayList<ArrayList<Position>> isTherePolygon(List<Position> pos, Polygon p, double GIVENAPROX)
{
ArrayList<ArrayList<Position>> result = new ArrayList<ArrayList<Position>>();
//TODO (fix) Revoir la proportion
//For each point in the list
for(int i = 0; i < pos.size(); i++)
{
//List of point... | 7 |
@Override
public boolean initDecrypt(String password) {
if (password == null || password.length() < 1) {
Application.getController().displayError(
Application.getResourceBundle().getString("password_not_null_title"),
Application.getResourceBundle().getString("password_not_null_message"));
return fal... | 6 |
public void printGrammar(Grammar grammar) {
int emptyRules = 0, injections = 0;
for (Production p : grammar.productions) {
if (p.reachable) {
if (p.isEmpty()) {
++emptyRules;
} else if (p.isInjection()) {
++injections;
}
}
}
monitor.println("Empty production rules: " + emptyRules)... | 8 |
public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... | 7 |
private int left(int i) {
i += 1;
return 2 * i - 1;
} | 0 |
protected String getResponseFromJSON(WebPage entry) throws ParseException {
String[] p = entry.getContent().split("\",");
return ( p[2].split("\"").length > 1 ) ? "Asi incorrect syntax nebo co." : p[0].split("\"")[1] + " = " + p[1].split("\"")[1];
} | 1 |
final void method1140(Stream stream, Class81 class81) {
int i = stream.readUByte();
anIntArray2040[0] = i >> 4;
anIntArray2040[1] = i & 0xf;
if (i != 0) {
anIntArray2042[0] = stream.readUShort();
anIntArray2042[1] = stream.readUShort();
int j = stream.... | 8 |
private void commit() {
for (ClassNode c : classes) {
for (MethodNode m : c.methods()) {
m.releaseGraph();
m.editor().commit();
}
c.editor.commit();
c.info.commit();
}
} | 2 |
public void setTicketUrl(String ticketUrl) {
this.ticketUrl = ticketUrl;
} | 0 |
public void closeQuery(){
try {
currentResult.close();
} catch (SQLException e){
if( debug ) System.out.println("Error in DataBaseConnection.closeQuery(): "+e.getMessage());
}
try {
ps.close();
} catch (SQLException e){
if( debug ) System.out.println("Error in DataBaseConnection.closeQuery(): "+e.... | 4 |
public static void main(String args[] ) throws Exception {
/*
* Read input from stdin and provide input before running
*/
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
char[] palindrom = line.toCharArray();
boolea... | 9 |
public static Complex laguerre(Complex estx, Complex[] pcoeff, int m){
double eps = 1e-7; // estimated fractional round-off error
int mr = 8; // number of fractional values in Adam's method of breaking a limit cycle
int mt = 1000; // number of st... | 7 |
private String getFormat(MainClass mainClass, ChannelType ch, World w, Player p, String message) {
String channel = mainClass.channelPrefixes.get(ch);
String world = mainClass.defaultWorldPrefix;
File file = new File("plugins/Nostalgia/Chat.yml");
FileConfiguration f = YamlConfiguration.loadConfiguration(file);... | 1 |
public void closeModal()
{
assert overlayStack.size() > 0;
assert window.getGlassPane() == overlayStack.peek().getOverlayPanel();
if(overlayStack.size() > 0)
{
overlayStack.pop().getOverlayPanel().setVisible(false);
if(overlayStack.size() > 0)
{
window.setGlassPane(overlayStack.... | 2 |
@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) {
return null;
}
return this.ejbFacade.find(getKey(value));
} | 3 |
public Map(String name, String author, String version, String url, String logo, String image, String compatible, String mcversion, String mapname, String info, int idx)
throws NoSuchAlgorithmException, IOException {
index = idx;
this.name = name;
this.author = author;
this.ve... | 5 |
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.