text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String toString() {
String str = "";
switch (align) {
case TOP: str = ",align=top"; break;
case CENTER: str = ",align=center"; break;
case BOTTOM: str = ",align=bottom"; break;
case LEADING: str = ",align=leading"; break;
... | 5 |
public static void main(String[] args) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String currentTime = df.format(new Date());
try {
Date d1 = df.parse("2014-04-11 09:26");
Date d2 = df.parse(currentTime);
long l=24*60*60*1000-(d2.getTime()-d1.getTime());
System.out.println(l);
lo... | 3 |
private void setState() {
if (bittorrent != null) {
type = Type.TORRENT;
} else {
type = Type.HTTP;
}
if (type.equals(Type.TORRENT)) {
if (bittorrent.info.get("name") != null) {
name = bittorrent.info.get("name");
} else {... | 5 |
public LinkedHandlerBuilder ifMatches( final Filter filter )
{
if ( filter == null )
{
throw new IllegalArgumentException( "Filter must not be null" );
}
return new LinkedHandlerBuilder()
{
public void handleWith( final ClassPathEntryHandler... entry... | 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 Delivery)) {
return false;
}
Delivery other = (Delivery) object;
if ((this.deliveryPK == null && other.delivery... | 5 |
@Override
public void setDefaultActions() {
this.addAction(new ActionInitial("look") {
@Override
public Result execute(Actor actor) {
this.incrementCount();
// no limit on how many times this can be executed
return new ResultGeneric(true, ItemGeneric.this.look());
}
}
);
this... | 7 |
public DataFrame<MultiClassLabel> processInput(Iterable<String> input, boolean train) throws IOException {
int readNFirstRows = train? readFirstNTrainRows : readFirstNTestRows;
int row = 0;
OffHeapSparseMatrix words = new OffHeapSparseMatrix(readNFirstRows>0?readNFirstRows:6000000, 100000);
// ... | 9 |
public boolean hasTwoSamePlayerRoads(int activePlayer) {
int player = -1;
for (Road r: roadNeighbours) {
if (r.isBuilt()) {
if (r.getPlayer() != activePlayer) {
if (player == -1) {
player = r.getPlayer();
} else {
if (player == r.getPlayer()) return true;
}
}
}
}
return... | 5 |
static ROM Generate ()
{
final int length = 2;
final int width = 69;
final int height = 3;
final int currentLife = 15;
Block temp;
ROM template = new ROM (height, width, length); //This is tileable 60 times in X. Indexed YZX
temp = new Air (); //Filling in space.
for (int Y = 0; Y < height; Y++)
... | 5 |
public List<Task> merge(List<Task> left, List<Task> right) {
if (left.isEmpty()) {
return right;
} else {
if (right.isEmpty()) {
return left;
} else {
int contFirstArray = 0;
int contSecondArray = 0;
List<Task> arrayToReturn = new ArrayList<Task>();
int total = left.size() + right.size();
... | 8 |
public void remove(Comparable rowKey, Comparable columnKey) {
// defer null argument checks
int r = getRowIndex(rowKey);
int c = getColumnIndex(columnKey);
this.data.removeObject(rowKey, columnKey);
// if this cell held a maximum and/or minimum value, we'll need to
// up... | 8 |
protected Object invokeMethod(String methodName, Object[] args, Class<?>[] argsType)
throws UnknownHostException, IOException, RemoteException440, Exception {
InvokeMessage message = new InvokeMessage(ror, methodName, args, argsType);
String inetAddr = ror.getIP();
int port = ror.getPort();
Socket c... | 6 |
public static void stackSort (Stack<Integer> s) {
Stack<Integer> helper = new Stack<>();
// follow the rountine of bubble sort,
// smaller elements go down and bigger elements go up
int size = s.size();
for (int i=0 ; i != size-1; ++i ) {
Integer min = s.pop();
for (int j = size-i-1; j >0 ; j-- ... | 4 |
@Override
public void handle(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
//Get the correct DynmapServer
for (DynmapServer dynmapServer : Main.getDynmapServers()) {
AbstractFile file = dynmapServer.getFile(request.getUri());
if (file.exists()) {
... | 8 |
public void run()
{
try
{
GuiConnecting.setNetClientHandler(this.connectingGui, new NetClientHandler(this.mc, this.ip, this.port));
if (GuiConnecting.isCancelled(this.connectingGui))
{
return;
}
GuiConnecting.getNetClientH... | 7 |
public boolean isConnected(){
try {
if (xmlRpcClient!=null){
xmlRpcClient.execute("LookUpTableHandler.getVersion", new Vector());
return true;
} else {
return false;
}
} catch (XmlRpcException e){
return false;
}
} | 2 |
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par1World.isRemote)
{
return true;
}
else
{
ItemStack var6 = par5EntityPlayer.inventory.getCurrentItem();
if (var6 == null)
... | 9 |
public Map<PersonalInfo, String> getAllUserInfo() {
if(info != null) {
return info;
} else {
try {
String query = "SELECT COUNT(*) FROM datingsite.UserData WHERE UserID = ?";
ResultSet rs = executeQueryWithParams(query, userID);
rs.next();
int count = rs.getInt(1);
if(count < 1) {... | 7 |
public void delete(String whereString){
StringBuffer sql = new StringBuffer("");
sql.append("Delete from `Section`");
if (whereString.trim() != "") {
sql.append(" where " + whereString);
}
SQLHelper sQLHelper = new SQLHelper();
sQLHelper.sqlConnect();
... | 1 |
public static ErrorLogs DAOController(Generator generator,
TransactionSet transactionSet, RuleSet ruleSet) {
System.out.println("Starting DAO Controller");
ErrorLogs errorLogs = new ErrorLogs();
VendorPersistenceController vpc = new VendorPersistenceController();
TransactionPersistenceController tpc = new Tr... | 9 |
private static Rectangle determineCropRect(BufferedImage image)
{
// Loop through all the pixels, ignoring transparent ones.
Rectangle rect = null;
for (int y = 0; y < image.getHeight(); y++) {
for (int x = 0; x < image.getWidth(); x++) {
int color = image.getRGB... | 5 |
private static void addToSpanMap(int span, TreeMap<Integer, ArrayList<FlexGridData>> map, FlexGridData data) {
if (span > 1) {
Integer key = new Integer(span);
ArrayList<FlexGridData> set = map.get(key);
if (set == null) {
set = new ArrayList<>();
map.put(key, set);
}
set.add(data);
}
} | 2 |
public Behaviour jobFor(Actor actor) {
if ((! structure.intact()) || (! personnel.onShift(actor))) return null ;
I.sayAbout(actor, "GETTING NEXT EXCAVATION TASK") ;
final Delivery d = Deliveries.nextDeliveryFor(
actor, this, services(), 5, world
) ;
if (d != null) return d ;
fina... | 6 |
final protected synchronized void setup() throws SQLException {
Statement st = null;
try {
st = conn.createStatement();
st.executeUpdate("CREATE TABLE IF NOT EXISTS `ffa_leaderboards` ("
+ "`player_id` int(11) NOT NULL AUTO_INCREMENT,"
+ "`player_name` varchar(255) NOT NULL,"
+ "`killcount` int... | 2 |
private void foundFullHouse() {
rank = Rank.FULLHOUSE;
Card.Rank tripRank = null;
// Find the biggest trips
for (int i = ranks.length - 1; i >= 0; i--) {
Card[] value = ranks[i];
if (value == null) continue;
if (numRanks[i] == 3) {
trip... | 8 |
public String convert(Pos p){
switch (p) {
case EARTH:
return ".";
case ROBOT:
return "R";
case LIFT_O:
return "O";
case LIFT_C:
return "C";
case WALL:
return "#";
case DIAMOND:
return "x";
case EMPTY:
return " ";
case ROCK:
return "*";
default:
break;
}
return "?";
} | 8 |
public EvaluationResult evaluate(List inputs, EvaluationCtx context) {
// Evaluate the arguments
AttributeValue [] argValues = new AttributeValue[inputs.size()];
EvaluationResult result = evalArgs(inputs, context, argValues);
if (result != null)
return result;
// No... | 5 |
@Override
public void validate() {
if("".equals(username)) //Empty username
this.addFieldError("username", "Username required");
else { //Username is good
if("".equals(account)) //Empty account
this.addFieldError("account", "You Must Input A Account");
else{ //Account is not empty
if(service.findU... | 8 |
@Override
public boolean isWebDriverType(String type)
{
return StringUtils.equalsIgnoreCase("chrome", type);
} | 0 |
public void setVue(VueConnexion vue) {
this.vue = vue;
} | 0 |
public void actionPerformed(ActionEvent ae){
if (ae.getSource() == addEmp){
for (int i = 0; i < 6; i++){
int n = 0;
int x = 0;
int y = 0;
if (i == 0){
n = 5;
x = 0;
y = 2;
newTextField = new JTextField(n);
g.anchor = GridBa... | 8 |
@Override
public boolean tick() {
if (input.pressed(KeyEvent.VK_LEFT))
pos.x -= speed;
if (input.pressed(KeyEvent.VK_RIGHT))
pos.x += speed;
if (input.pressed(KeyEvent.VK_UP))
pos.y -= speed;
if (input.pressed(KeyEvent.VK_DOWN))
pos.y += speed;
return isAlive();
} | 4 |
private String msgchk(String chk, String msg) throws InterruptedException, FileNotFoundException, UnsupportedEncodingException{
String broken[];
if (chk.endsWith(ghosts)){
ghost=1;
}
if (chk.endsWith(nonstop)){
if (cnt == 0){
dataOut.print("n\... | 8 |
public List children(final Node node) {
final ArrayList c = new ArrayList();
if (node instanceof StoreExpr) {
final StoreExpr store = (StoreExpr) node;
// Add the grand children of RHS. The RHS is equivalent to
// this node.
store.expr().visitChildren(new TreeVisitor() {
public void visitNode(fina... | 3 |
public static String deleteWhitespace(CharSequence str) {
StringBuilder sb = new StringBuilder(str.length());
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (i > 0 && Character.isWhitespace(c) && Character.isWhitespace(str.charAt(i-1))) continue;
if ... | 6 |
public static ArrayList<Kill> getKillMails(int charID) {
InputSource data;
ArrayList<Kill> downloaded = new ArrayList<Kill>();
ArrayList<Kill> totalBoard = new ArrayList<Kill>();
data = Download.getFromHTTPS(formURL(charID, 1));
downloaded = XMLParser.Killboard(data);
totalBoard.addAll(downloaded);
int ... | 2 |
public boolean hasBust() {
return getScore() > BLACKJACK;
} | 0 |
public static void DoTurn(SimulatedPlanetWars simpw) {
//Retrieve environment characteristics
//Are there characteristics you want to use instead, or are there more you'd like to use? Try it out!
// int neutralPlanets = pw.NeutralPlanets().size();
// int totalPlanetSize = 0;
// for (Planet p : pw.Neutral... | 8 |
private void cli(){
Scanner input = new Scanner(System.in);
ArrayList<String> commands = new ArrayList<String>(Arrays.asList("route","view_best_path","show_network","help","reload_network","modify_link"));
while (true){
System.out.println("\navailable commands: route, view_best_path, show_... | 9 |
public List<Object> getX509IssuerSerialOrX509SKIOrX509SubjectName() {
if (x509IssuerSerialOrX509SKIOrX509SubjectName == null) {
x509IssuerSerialOrX509SKIOrX509SubjectName = new ArrayList<Object>();
}
return this.x509IssuerSerialOrX509SKIOrX509SubjectName;
} | 1 |
public void mutateScope(){
if(( bulb_bar && bulb_scope) || scope_bar)
{
j += di;
int t= j*DELAY1/(100*scope.getTimeScale()), volt= (int)(10*Math.sin((double)(j*DELAY1))/scope.getCh1Scale());
if (volt<= -((scope.getDispHeight()/2)- scope.getPlotSize())|| volt>=(sc... | 9 |
private void paintInternal(Graphics2D g) {
if (smoothPosition != null) {
{
Point position = getMapPosition();
Painter painter = new Painter(this, getZoom());
painter.paint(g, position, null);
}
Point position = new Point(smooth... | 9 |
@Override
public BayesNode getNode(BayesNode sourceBayesNode, Object[] parents) {
Object nodeType = sourceBayesNode.type;
ArrayList<Object> allItems = new ArrayList<Object>(Arrays.asList(parents));
allItems.add(0, parents);
// generate a truth table as per http://stackoverflow.com/a/10761325/2130838
... | 9 |
public static void main(String[] args) {
// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
"databaseName=AdventureWorks;integratedSecurity=true;";
// Declare the JDBC objects.
Connection con = null;
Statement stmt ... | 7 |
private void checkThreeConsecLetters(String number){
int[] consecLetters = new int[8];
for(char c:number.toCharArray()){
consecLetters[getIndex(c)]++;
if(consecLetters[getIndex(c)]>3){
System.err.println("The syntax of the roman number is not valid: you c... | 2 |
public int newLocal(final Type type) {
Object t;
switch (type.getSort()) {
case Type.BOOLEAN:
case Type.CHAR:
case Type.BYTE:
case Type.SHORT:
case Type.INT:
t = Opcodes.INTEGER;
break;
case Type.FLOAT:
t = Opcodes.FLOAT... | 9 |
public void run() {
//// Preconditions
assert listeners != null : "listeners must not be null";
assert cycAccess != null : "cycAccess must not be null";
/*
try {
Thread.currentThread().sleep(Long.MAX_VALUE);
} catch (InterruptedException ie) {
} finally {
if (true) {
return;
... | 9 |
private boolean _equals(Complex value) {
if (Complex.isNaN(this) && Complex.isNaN(value))
return true;
if (Complex.isInfinite(this) && Complex.isInfinite(value))
return true;
return this._real == value._real && this._imaginary == value._imaginary;
} | 5 |
public static boolean esCorrecta(int d, int m, int a){
int diasDelMes[]={31,29,31,30,31,30,31,31,30,31,30,31};
if(a<=0) {
return false;
}
if(d<=0 || d>31) {
return false;
}
if(m<=0 || m>12) {
return false;
}
if(... | 9 |
public static void setGrassCreationProbability(double GRASS_CREATION_PROBABILITY)
{
if (GRASS_CREATION_PROBABILITY >= 0)
Simulator.GRASS_CREATION_PROBABILITY = GRASS_CREATION_PROBABILITY;
} | 1 |
public boolean isSeen(int index) {
State s = data.get(index);
if (s == State.seen || s == State.caught) {
return true;
}
return false;
} | 2 |
public Path<DirectedGraphNode>
search(final DirectedGraphNode source,
final DirectedGraphNode target,
final WeightFunction<DirectedGraphNode> w) {
OPEN.clear();
GSCORE.clear();
PARENT.clear();
CLOSED.clear();
OPEN.add(source, 0.0);
... | 9 |
public TileMap(int width, int height) {
tiles = new Image[width][height];
sprites = new LinkedList();
} | 0 |
public UserModel modifyAccount(HttpServletRequest request, String userId) {
String pseudo = getFieldValue(request, FIELD_PSEUDO);
UserModel user = DataStore.getUser(userId);
boolean noError = true;
try {
pseudo = pseudo.replaceAll("\\W","");
checkPseudo(pseudo);
... | 3 |
protected static Ptg calcTBillEq( Ptg[] operands )
{
if( operands.length < 3 )
{
PtgErr perr = new PtgErr( PtgErr.ERROR_NULL );
return perr;
}
debugOperands( operands, "calcTBILLEQ" );
GregorianCalendar sDate = (GregorianCalendar) DateConverter.getCalendarFromNumber( operands[0].getValue() );
Gregor... | 5 |
public synchronized void setEnabled(boolean enabled) {
if(!enabled) {
set(0);
}
_enabled = enabled;
} | 1 |
public ArrayList< XmlStructure > read(){
XmlStructure xml = null;
try{
File xmlFile;
if(from.matches("highscores.xml")){
log.info("Reading from " + from + " file.");
String home=System.getProperty("user.home");
File prop = new File(home, ".roulettegame");
xmlFile= new File(prop,from);
}
... | 6 |
@Override
public String getName() {
String name = super.getName();
if (name == null) {
return DEFAULT_NAME;
} else {
return name;
}
} | 1 |
@Override
public boolean hasNext()
{
if ( maxLines > 0 && maxLines <= linesRead ) {
return false;
}
return nextline != null;
} | 2 |
public void setId(int id) {
if(id > 1) {
this.id = id;
}
} | 1 |
public static int[] getRangeCoords( String range )
{
int numrows;
int numcols;
int numcells;
int[] coords = new int[5];
String temprange = range;
// figure out the sheet bounds using the range string
temprange = stripSheetNameFromRange( temprange )[1];
String startcell;
String endcell;
int lastcolo... | 8 |
private int read() throws IOException {
int result = nextChar;
while (result == NL || result == ENTER) {
++lineNumber;
charPosition = 0;
result = reader.read();
}
nextChar = reader.read();
++charPosition;
return result;
} | 2 |
public static boolean isWindowsPlatform()
{
String os = System.getProperty("os.name");
if (os != null && os.startsWith(WIN_ID))
{
return true;
}
else
{
return false;
}
} | 2 |
public boolean canAddItem(Item newItem) {
//is a valid item
if(newItem == null) {
return false;
} else if(newItem.getProduct() == null) { //Product Must be non-empty.
return false;
} else if(!newItem.getBarCode().isValid()) { // Have a valid barcode
return false;
} else if(!newItem.hasValidEntryDate(... | 8 |
@Override
public Object getValueAt(int rowIndex, int columnIndex)
{
PluginWrapper pluginWrapper = plugins.get(rowIndex);
switch (columnIndex)
{
case 0:
return pluginWrapper.getPluginName();
case 1:
return pluginWrapper.getPluginDescription();
case 2... | 7 |
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException, FileNotFoundException {
AutoTotaalDienst atd = (AutoTotaalDienst) getServletContext()
.getAttribute("atdRef");
String press = req.getParameter("press");
String v1 = (String) req.getParameter("veld... | 6 |
private void writeOut(String ownerName, byte[] owner, byte[] key,
String prvOrPub) throws IOException {
DataOutputStream osPrv = null;
switch (prvOrPub) {
case "prv":
osPrv = new DataOutputStream(new FileOutputStream(ownerName
+ ".prv"));
case "pub":
osPrv = new DataOutputStream(new FileOutputStre... | 2 |
void suoritaHeittely() {
vihollisnopat = luola.getVihollisnopat() + pelaaja.getViholliskorttimuutokset();
heittele(vihollisnopat);
if (!pelaaja.getClass().equals(Npc.class)){
heittelyraami = peli.getUi().luoHeittelyraami(this);
odota();
}
tallennaVihollise... | 5 |
public Object remove(int index) {
return index >= 0 && index < this.length()
? this.myArrayList.remove(index)
: null;
} | 2 |
public static void getDirectories(String folderNameIn) {
//File folder = new File(ROOT_FOLDER + folderNameIn);
File folder = new File("C:\\Users\\Brandon194\\AppData\\Roaming\\Brandon194\\WorkCalculator");
File[] listOfFiles = folder.listFiles();
for (File file : listOfFiles){
... | 2 |
public int GetBusStopNumber()
{
//get bus stop number
return busStopNumber;
} | 0 |
public static ObjectDef getObjectDef(int i)
{
for(int j = 0; j < 20; j++)
if(cache[j].type == i)
return cache[j];
cacheIndex = (cacheIndex + 1) % 20;
ObjectDef class46 = cache[cacheIndex];
class46.type = i;
class46.setDefaults();
byte[] bu... | 4 |
@SuppressWarnings("unchecked")
public final void HandlePacket(APacket aPacket, IIOHandler sender) {
log.finer("Handling Packet \n"+aPacket.getClass().toString());
Method m = null;
try {
m = getClass().getDeclaredMethod("handlePacket", aPacket.getClass(), IIOHandler.class);
m.invoke(this, aPacket, sender... | 2 |
public void describeBehaviour(Description d) {
if (! prey.health.alive()) {
if (type == TYPE_FEEDS) {
d.append("Scavenging meat from ") ;
d.append(prey) ;
}
if (type == TYPE_HARVEST || type == TYPE_PROCESS) {
if (! prey.destroyed()) {
d.append("Harvesting meat fro... | 5 |
public void testAdd()
{
System.out.println("hello world !");
} | 0 |
public boolean deleteElement(int x, int y) {
Element element = (Element) getLocationElement(x, y);
if (element == null) {
return false;
}
// Place
if (element instanceof Place) {
((PetriNet) graph).deletePlace(((Place) element).getName());
}
... | 5 |
public InheritanceChangeDescription calculateDescription()
{
InheritanceChangeDescription res = new InheritanceChangeDescription();
findDeleted(res, fromStack.getActual());
findAdded(res, toStack.getActual());
// check if any field has moved from one superclass to another
List<String> fieldNames = fromStac... | 4 |
private double triLerp(double x, double y, double z, double q000, double q001, double q010, double q011, double q100, double q101, double q110, double q111, double x1, double y1, double z1, double x2, double y2, double z2) {
if (x < x1) {
throw new IllegalArgumentException("x must not be less than x1");
}
if (... | 6 |
public boolean isNull(int index) {
return JSONObject.NULL.equals(this.opt(index));
} | 0 |
public void setOptions(String[] options) throws Exception {
String tmpStr;
tmpStr = Utils.getOption("mean-prec", options);
if (tmpStr.length() > 0)
setMeanPrec(Integer.parseInt(tmpStr));
else
setMeanPrec(getDefaultMeanPrec());
tmpStr = Utils.getOption("stddev-prec", options);
... | 8 |
public void run() {
while(true) {
if (isUpPressed)
translate(0.0, -0.1);
if (isDownPressed)
translate(0.0, 0.1);
if (isLeftPressed)
translate(-0.1, 0.0);
if (isRightPressed)
translate(0.1, 0.0);
... | 8 |
public void generate( String fileName, DBParams schema_params ) throws SQLException, IOException, ParserConfigurationException, ClassNotFoundException {
// Получим информацию о таблицах. Эта информация будет хранится в структуре типа Info
// Будет выполнено соединение со схемой и от туда считана информ... | 5 |
public static boolean isDiscrete(String attributeName, Set<? extends Attributable> items) {
// First collect the set of all attribute values
Set<Object> values = new HashSet<Object>();
for (Attributable item : items) {
Object value = item.getAttribute(attributeName);
if (value != null) {
values.add(valu... | 8 |
public void setjLabelChercher(JLabel jLabelChercher) {
this.jLabelChercher = jLabelChercher;
} | 0 |
public void addSprite(Sprite sprite) {
sprites.add(sprite);
} | 0 |
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected) {
int x2 = x + (w);
int y2 = y + (h);
switch (tabPlacement) {
case LEFT:
paintLeftTabBorder(tabIndex, g, x, y, x2, y2, isSelected);
... | 6 |
@Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(mob.isInCombat())
return Ability.QUALITY_INDIFFERENT;
if(target instanceof MOB)
{
if(((MOB)target).charStats().getCurrentClass().baseClass().equals("Cleric"))
return Ability.QUALITY_INDIFFERENT;
if(CMLib.f... | 7 |
public static Headers readHeaders(InputStream in) throws IOException {
Headers headers = new Headers();
String line;
String prevLine = "";
int count = 0;
while ((line = readLine(in)).length() > 0) {
int first;
for (first = 0; first < line.length() &&
... | 8 |
protected void setSinglePreserved() {
if (parent != null)
parent.setPreserved();
} | 1 |
public String correctItem(MOB mob)
{
for(int i=0;i<mob.numItems();i++)
{
final Item I=mob.getItem(i);
if((I!=null)
&&(CMLib.flags().canBeSeenBy(I,mob))
&&(I.amWearingAt(Wearable.IN_INVENTORY))
&&(!((((I instanceof Armor)&&(I.basePhyStats().armor()>1))
||((I instanceof Weapon)&&(I.basePhyStats().... | 8 |
public static Professor addProfessors(Professor prof) {
boolean exist = false;
int pos = 0;
if (prof == null)
return null;
for (int i = 0; i < FileReadService.profList.size(); i++) {
if (FileReadService.profList.get(i).equals(prof)) {
exist = true;
pos = i;
}
}
if (!exist) {
FileReadServ... | 4 |
private void string(String value) throws IOException {
String[] replacements = htmlSafe ? HTML_SAFE_REPLACEMENT_CHARS : REPLACEMENT_CHARS;
out.write("\"");
int last = 0;
int length = value.length();
for (int i = 0; i < length; i++) {
char c = value.charAt(i);
String replacement;
if... | 8 |
public String getValue(){
return this.value;
} | 0 |
private PickVO getList45PVO(PickVO pvo, ArrayList<LineAnaVO> list45) {
if (list45.size() > 4) {
LineAnaVO v = getGap(0, list45);
if (v != null) {
pvo.add(v.getBnu());
}
v = getGap(1, list45);
if (v != null) {
pvo.add(v.getBnu());
}
v = getGap(2, list45);
... | 8 |
public void loadAllPermissions() {
ResultSet data = query(QueryGen.selectAllPermissions());
while (iterateData(data)) {
HashMap<PermissionFlag, Boolean> flags = new HashMap<PermissionFlag, Boolean>();
String permId = getString(data, "PermissibleId");
String permType =... | 3 |
protected List<Object> addEmptyRow() {
List<Object> row = new ArrayList<Object>();
rs.add(row);
for (int i = 0, size = columnNames.size(); i < size; i++) {
row.add(null);
}
return row;
} | 1 |
public boolean contains(Point p) {
return ((this.from.x == p.x) && (this.from.y == p.y)) ||
((this.to.x == p.x) && (this.to.y == p.y));
} | 3 |
public void afficher(){
for(char elem : ligne){
System.out.print(elem + " ");
}
} | 1 |
private TreeMap<Float, Float> makeListFromPricePair(
TreeMap<Float, Point2D.Float> priceByDate, int id) {
TreeMap<Float, Float> pts = new TreeMap<Float, Float>();
for (Entry<Float, Point2D.Float> prices : priceByDate.entrySet()) {
switch (id) {
case 0:
pts.put(prices.getKey(), prices.getValue().x);
... | 4 |
private void leerClientes(){
ArrayList<String> list = disco.leerArchivo("clientes/clientes");
String[] aux;
for(int i=0; i<list.size(); ++i){
aux = list.get(i).split("\t");
String o = new String();
ArrayList<String> ob = disco.leerArchivo("clientes/" + aux[0])... | 3 |
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.