text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void allocatePoints(Contestant c) {
Iterator<User> itr = allUsers.iterator();
User u;
while (itr.hasNext()) {
u = itr.next();
if (u.getWeeklyPick().equals(c)) {
if (this.isFinalWeek()) // final week
u.addPoints(40);
else // normal week
u.addPoints(20);
}
// if the end of... | 5 |
public UpdateQuery in(String... args) {
if (args.length == 1) {
for (String arg : args) {
if (arg.startsWith("(")) { // nested select
query.append(" IN ").append(arg);
} else { // just single value, same as below
query.append(" ... | 4 |
public ArrayList<Node> generateBridgedER(int n1,int n2, double p1, double p2, int b){
ArrayList<Node> c1 = generateConnectedER(n1,p1);
ArrayList<Node> c2 = generateConnectedER(n2,p2);
for(int i= 0;i<n2;i++)
{
c2.get(i).resetID(i+n1);
}
ArrayList<Node> nodes = ... | 6 |
protected void calculateCutPointsByEqualWidthBinning(int index) {
// Scan for max and min values
double max = 0, min = 1, currentVal;
Instance currentInstance;
for(int i = 0; i < getInputFormat().numInstances(); i++) {
currentInstance = getInputFormat().instance(i);
if (!currentInstance.isM... | 8 |
public static void main(String[] args) throws IOException {
String name = null,str = null;
int size = BUFSIZE,bufferSize = BUFSIZE;
for(int i = 0;i < args.length;i++){
switch(args[i]){
case "-s":
size = Integer.valueOf(args[++i]).intValue();
break;
case "-b":
bufferSize = Integer.valueOf(arg... | 8 |
public void addChromosome(Chromosome chrom) throws Exception {
if (chrom==null) {
throw new Exception("Error in addChromosome: chrom==null");
}
if ((ploidy==2 && chrom.getClass().equals(TetraploidChromosome.class)) ||
(ploidy>2 && !chrom.getClass().equals(TetraploidChromo... | 6 |
static public Var isMacro(Object op) throws Exception{
//no local macros for now
if(op instanceof Symbol && referenceLocal((Symbol) op) != null)
return null;
if(op instanceof Symbol || op instanceof Var)
{
Var v = (op instanceof Var) ? (Var) op : lookupVar((Symbol) op, false);
if(v != null && v.isMacro())
... | 9 |
public void enter(String sqlstatement, int type){
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url = "jdbc:derby:" + DBName;
Connection connection = DriverManager.getConnection(url);
Statement statement = connection.createStatement();
switch (type) {
case QUERY:
ResultS... | 3 |
@Override
public void removeProperty(String key) {
this.default_values.remove(key);
this.current_values.remove(key);
this.filter_chains.remove(key);
} | 0 |
private static int isKingKong(ArrayList<Card> list) {
assert(list.size() == EFFECTIVE_CARD_NUM);
int change = 0;
int changePos = 0;
for ( int i = 1; i < 5; i++ ){
if (list.get(i).getPoint() != list.get(i - 1).getPoint()){
change++;
changePos = i;
if ( change > 1 || (changePos != 1 && change... | 5 |
public static ComplexNumber parseComplex(String s)
{
s = s.replaceAll(" ","");
ComplexNumber parsed = null;
if(s.contains(String.valueOf("+")) || (s.contains(String.valueOf("-")) && s.lastIndexOf('-') > 0))
{
String re = "";
String im = "";
s = s.replaceAll("i","");
s = s.replaceAll("I","");
if(... | 7 |
private void removeFullLines(){
int numFullLines = 0;
for (int i = BoardHeight - 1; i >= 0; --i) {
boolean lineIsFull = true;
for (int j = 0; j < BoardWidth; ++j) {
if (shapeAt(j, i) == Tetrominoes.NoShape) {
lineIsFull = false;
... | 7 |
@Override
public void run() {
while (!SH.get(tcn).isInterrupted()){
try {
String rtn=Tclient(tcn);
if (rtn.equals("reload")){
TNH.get(tcn).loggedin=0;
SH.get(tcn).interrupt();
TNH.get(tcn).killme();
}
} catch (SocketException e) {
dw.append("Server "+tcn+" offline.");
... | 4 |
public Instance cleanse(Instance before) throws Exception{
Instances insts = before.relationalValue(1).stringFreeStructure();
Instance after = new DenseInstance(before.numAttributes());
after.setDataset(m_Attributes);
for(int g=0; g < before.relationalValue(1).numInstances(); g++){
Instance datu... | 8 |
public TextBox(String text, boolean fill) {
parseText(text);
if(fill) {
addTimeListener(new TimeListener() {
public void timeStep(TimeEvent e) {
textFill += e.getDelta() * fillSpeed;
if(textFill >= TextBox.this.getLength()) {
TextBox.this.removeTimeListener(this);
}
}
});... | 2 |
@EventHandler
public void onPlayerSpin(final PlayerInteractEvent event) {
final Block block = event.getClickedBlock();
if(block == null)
return;
if(FancyRoulette.instance.tableManager.isBlockSpinner(block)) {
if(! event.getPlayer().hasPermission("roulette.spin")) {
event.getPlayer().sendMessage(ChatCol... | 5 |
private void updateLabels(int dummy)
{
labelGold.setText(sliderGold.value()+"/"+player.getResource(core.ResourceType.GOLD));
labelWood.setText(sliderWood.value()+"/"+player.getResource(core.ResourceType.WOOD));
labelOre.setText(sliderOre.value()+"/"+player.getResource(core.ResourceType.ORE));
try {
amount =... | 1 |
public Object result() {
if (Protocol.Type.STRING == type) {
return StringUtils.toString(current, charset);
} else if (Protocol.Type.ERROR == type) {
return new RedisException(StringUtils.toString(current, charset));
} else if (Protocol.Type.INTEGER == type) {
return NumberUtils.toInt(StringUtils.toStrin... | 6 |
public Item peek() {
if (isEmpty()) throw new NoSuchElementException("Queue underflow");
return first.item;
} | 1 |
public MooreStateTool(AutomatonPane view, AutomatonDrawer drawer)
{
super(view, drawer);
} | 0 |
public void setRollValue(int rollValue) {
if(rollValue > 1 && rollValue < 13) {
this.rollValue = rollValue;
}
else {
//throw exception
}
} | 2 |
private void printToFile(List<Citation> citations) {
File newFile;
while (true) {
String filename = io.getString("Name the new BibTex file (.bib is added automatically): ");
newFile = new File(filename + ".bib");
if (newFile.exists()) {
io.println("A ... | 3 |
@Test
public void testFunctionality() {
GameConfiguration origConf = new GameConfiguration();
origConf.setAgentCount(1);
origConf.setFoodAmountIncrese(2);
origConf.setHiddenLayers(3);
origConf.setInitialFoodAmount(4);
origConf.setMutate(true);
origConf.setMutationAmount(5);
origConf.setMutationProb(0.3... | 7 |
@Override
public void method2() {
} | 0 |
public void getTipitPrice(final int... ids) {
try {
for(int id : ids) {
String price;
final URL url = new URL("http://www.tip.it/runescape/json/ge_single_item?item=" + id);
final URLConnection con = url.openConnection();
con.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS ... | 4 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Artist that = (Artist) o;
if (idArtist != that.idArtist) return false;
if (description != null ? !description.equals(that.description) : that.d... | 8 |
public boolean estDisponible(){
if(this.situation == DISPONIBLE){
return true ;
}
else {
return false ;
}
} | 1 |
private String col(String s, int width) {
if(s == null)
s = "";
if(s.length() >= width)
s = s.substring(0, width - 1);
while(s.length() < width)
s = s + " ";
return s;
} | 3 |
public boolean isOver() {
boolean over = false;
if (bLastMove == null || rLastMove == null) {
over = false;
} else if (this.bLastMove.isPass() && this.rLastMove.isPass()) {
over = true;
} else {
boolean neutral = false;
for (int row = 0; row < 5; row++) {
for (int col = 0; col < 5; col++) {
... | 9 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String leave = request.getParameter("user");
System.out.println("Bye " + leave);
UsersSingleton users = UsersSingleton.getInstance();
ArrayList <User> ... | 2 |
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int v = scn.nextInt();
int e = scn.nextInt();
while (v != 0 || e != 0) {
// Initialize no incoming set
TreeSet<Integer> noIncoming = new TreeSet<Integer>();
for (int i = 1; i <= v; i++) {
noIncoming.... | 8 |
public Production[] getItemSet(Set items, String message) {
restricted = items;
choiceTable.setModel(new ImmutableGrammarTableModel());
alreadyChosen = new HashSet();
while (true) {
int choice = JOptionPane.showConfirmDialog(parent, panel, message,
JOptionPane.OK_CANCEL_OPTION);
if (choice == JOption... | 5 |
public BeanSerializer (Kryo kryo, Class type) {
this.kryo = kryo;
BeanInfo info;
try {
info = Introspector.getBeanInfo(type);
} catch (IntrospectionException ex) {
throw new KryoException("Error getting bean info.", ex);
}
// Methods are sorted by alpha so the order of the data is known.
PropertyDe... | 8 |
public Line FindClosestEdge(Vector2 v)
{
double min = v.getDistance(new Vector2((edges[0].x0 + edges[0].x1) / 2, edges[0].y0));
int id = 0;
for (int i = 1; i < 4; i++)
{
double d = v.getDistance(new Vector2((edges[i].x0 + edges[i].x1) / 2, (edges[i].y0 + edges[i].y1) / 2));
if (d < min)
{
min = d;... | 2 |
@Override
public int backlog(double e, double s, double c) {
double L = e + s + c;
double n = s + 2*c;
double next = 0;
double previous = -1;
while(previous < next) {
double p1 = Math.pow(1 - (e/L), n);
double p2 = Math.pow((L-e-s) / (L-e), (n-s));
for(int i = 0; i < s; i++) {
... | 5 |
static void EscribirCacheAsociativa(int i, int v) {
int Etiqueta = Integer.parseInt(Integer.toBinaryString(0x1000 | i).substring(1).substring(0, 9));
int Palabra = Integer.parseInt(Integer.toBinaryString(0x1000 | i).substring(1).substring(9, 12), 2);
int Linea = leastRecentlyUsed.consult(Integer... | 7 |
public boolean pass(int[] bowl, int bowlId, int round,
boolean canPick,
boolean musTake) {
bowlSize=sumOfArray(bowl);
if (musTake || !canPick) {
modifyDistribution(bowl);
roundInit(1);
return true;
}
double expectedScore=getExpectedScore... | 9 |
public Boolean process() {
// Permissions
if(!plugin.permission.canCreate(player)) {
noPermission();
return true;
}
// Correct command format
if(args.length == 2) {
// Slot exists
if(plugin.slotData.isSlot(args[1])) {
SlotMachine slot = plugin.slotData.getSlot(args[1]);
// C... | 4 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Listing other = (Listing) obj;
if (!Objects.equals(this.value, other.value)) {
return false;
... | 3 |
private void loadGameObjectType(IGameObjectType type) {
if (!gameObjectTypeCache.containsKey(type)) {
try {
// type was not loaded yet -> load it
Ini iniFile = new Ini(this.getClass().getResource("/" + type.getIniFilePath()));
Section section = iniFile.get(type.getIniFileSection());
if (section !=... | 6 |
private Box nextEmptyBox(char[][] board, int row, int column) {
int i = row;
int j = column;
for (; i < 9; i++) {
for (; j < 9; j++) {
if (board[i][j] == '.')
return new Box(i, j);
}
j = 0;
}
return done;
... | 3 |
public Integer getTotalCoffers(Player player){
if(player==null)
return null;
Integer total = 0;
Iterator<OfflinePlayer> itr = coffers.values().iterator();
while(itr.hasNext()){
if(itr.next().equals(player))
total++;
}
return total;
} | 3 |
public boolean containsAll(AbstractOrderedItemset itemset2){
// first we check the size
if(size() < itemset2.size()){
return false;
}
// we will use this variable to remember where we are in this itemset
int i = 0;
// for each item in itemset2, we will try to find it in this itemset
for(int j =0;... | 7 |
public static <T extends DC> Equality getPhiEqu(Set<Pair<T,T>> done)
{ if(done!=null)
{ if(done.next!=null)
{ return new Equality(done.a.fst().delta(done.a.snd()).equa().getValue()&&getPhiEqu(done.next).getValue());
}
else
{ return new Equality(done.a.fst().delta(done.a.snd()).equa().getVa... | 3 |
private void doUpdateTrafficMask() {
if (trafficControllingSessions.isEmpty())
return;
for (;;) {
DatagramSessionImpl session = trafficControllingSessions.poll();
if (session == null)
break;
SelectionKey key = session.getSelectionKey();
... | 6 |
public void run() {
ThreadLocalRandom random = ThreadLocalRandom.current();
try {
latch.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
bank.transfer(accounts[random.nextInt(0, ACC... | 1 |
public double getEstimatedUtilityForDarkPlayer(CheckersSetup setup, boolean isDarkTurn) {
ArrayList<checkersSetup.Turn> turns = BasicCheckersAIFunctions.getAllPossiblePlayerOptionsFor1Turn(setup, isDarkTurn);
if(turns.size() == 0) {
if(isDarkTurn) {
return -BasicCheckersAIFunctions.DARK_WIN_UTILITY;
} els... | 8 |
@Test
public void cevTest1() {
userInput.add("hi");
userInput.add("my name is meng meng");
userInput.add("cavideria");
userInput.add("cavideria");
userInput.add("cavideria");
userInput.add("cavideria");
userInput.add("yes");
this.runMainActivityWithTestInput(userInput);
assertTrue((nlgResults.g... | 6 |
public void update(GameContainer gc, int delta) throws SlickException{
super.update(gc, delta);
move(gc.getInput());
executeStatusEffects(delta);
dt += delta;
if(dt > 1000) {
dt = 0;
float edx = enemy.dx;
float edy = enemy.dy;
float a = (edx * edx) + (edy * edy) - 25;
float b = ((enemy.x... | 2 |
protected void removeAnimal(Animal animal) {
for (int i = 0; i < grid.length; i++) {
for (int j = 0; i < grid[0].length; j++) {
if(grid[i][j].equals(animal)) {
grid[i][j] = null;
return;
}
}
}
} | 3 |
private boolean removeAllOnes() {
boolean happened = false;
for (final HashSet<MathsItem> hs : items) {
if (hs.size() < 2)
continue;
final HashSet<MathsItem> toremove = new HashSet<MathsItem>();
for (final MathsItem m : hs)
if (m.isOne())
toremove.add(m);
if (toremove.si... | 9 |
public void initHauptmenue() {
clearContent();
loadFont();
spielNeu = new JButton("Neues Spiel");
spielNeu.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
initGame();
}
}
});
spielNeu.setFont(gothic);
... | 4 |
protected void rootStored( File f, StoreResult sr ) {
if( sr.storedObjectCount > 0 && sr.fileInfo != null ) {
String message = LogUtil.formatStorageLogEntry(new Date(), sr.fileInfo.getFsObjectType(), sr.fileInfo.getPath(), sr.fileInfo.getUrn());
try {
FileOutputStream log = getIncomingLogStream();
log.w... | 9 |
public String grailFormat(){
String output = "Grail Transitions:\n";
for(State s: startStates){
output += "(START) |- "+s.getName()+"\n";
}
for(State s: states){
for(String symbol: alphabet){
output += s.getName() + " " + symbol + " ";
for(State q: s.transition(symbol))
output += q.getName();... | 5 |
public MemoryFrame(java.awt.Frame parent, final DCPU dcpu) {
super(parent, false);
initComponents();
this.ramTable.setModel(new DCPUMemoryTableModel(dcpu));
//disallow selection of column 0
this.ramTable.getColumnModel().setSelectionModel(new DefaultListSelectionModel() ... | 9 |
@Override
public final boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof InjectablePlugin)) {
return false;
}
return getName().e... | 3 |
public SQLconnection conn()
{
SQLconnection sql=new SQLconnection("127.0.0.1", "root", "anika", "dblp");
try {
sql.connectMySql();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackT... | 4 |
public String getCategoryName() {
return categoryName;
} | 0 |
public Widget find(int x, int y) {
Widget found = null;
// to augment height
int extraSpaceBetweenLines = 0;
if(numLines > 1){
extraSpaceBetweenLines = numLines - 1;
}
if (x >= this.x && x < this.x + W && y >= this.y && y < this.y + H * numLine... | 8 |
public static long differHowManyDays(Date arg0, Date arg1) {
long d1 = arg0.getTime();
long d2 = arg1.getTime();
return Math.abs(d1 - d2) / (60 * 60 * 24 * 1000);
} | 0 |
public void addListener(OutlineModelListener listener) {
if (!mListeners.contains(listener)) {
mListeners.add(listener);
}
} | 1 |
public static void saveChannels() {
File channelFolder = new File(System.getProperty("user.dir") + "\\channels");
File channelList = new File(channelFolder.getAbsolutePath() + "\\channels.txt");
if(categories.isEmpty()) {
channelList.delete();
}
try {
File... | 4 |
static void testRange(int first, int last) {
print("Testing range from " + first + " to last " + last + ".");
long start = 0,end = 0;
Range range = new Range(first,last);
long normalDuration = 0;
long rangeDuration = 0;
long waste = 0;
start = System.nanoTime();
for (int curr = first; curr <= last... | 4 |
private float calculatePositionValue(PositionType type, ROVector3f target, Coordinate currentCoordinate, Coordinate coordinate) {
float position = filterPosition(target, type);
boolean isInSameSystem = currentCoordinate.equals(coordinate);
if (hasParent() && !isInSameSystem) {
float parentValue = fil... | 4 |
private ContentManager(){
this.blockManager = new BlockManager() ;
this.packetManager = new PacketManager();
} | 0 |
public static void main(String[] args) {
long start = System.nanoTime();
int sum = 0;
for (Integer i = 1; i < 1000000; i++) {
BigInteger binaryVal = new BigInteger((Integer.toBinaryString(i)));
if (isPalindromic(BigInteger.valueOf(i))
&& isPalindromic(binaryVal)) {
sum += i;
}
}
System.out.p... | 3 |
private CollectionPerson() {
Persons = new ArrayList<Person>();
CantPerson = 0;
} | 0 |
private static ByteBuffer toByteBuffer(byte[] data, boolean isStereo,
boolean isBigEndian) {
ByteBuffer dest = ByteBuffer.allocateDirect(data.length);
dest.order(ByteOrder.nativeOrder());
ByteBuffer src = ByteBuffer.wrap(data);
src.order(isBigEndian ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN);
if (is... | 4 |
@SuppressWarnings("unchecked")
public E pop() {
if (empty) return null;
E ret = (E)VALUES[begin];
VALUES[begin] = null;
begin++;
if (begin==MAX) begin=0;
if(begin == end){
empty = true;
begin = end = 0;
}
return ret;
} | 3 |
@Override
public boolean installPackage(String path) {
boolean result = false;
do {
long now = System.currentTimeMillis();
File tmp = new File(TMPPRE + now);
if(!tmp.exists()) {
tmp.mkdirs();
}
String tmpPath;
try {
tmpPath = tmp.getCanonicalPath();
} catch (IOException e1) {
e1.pr... | 9 |
public static void main(String[] args)
{
System.out.println("Starting Test Cases");
try
{
// Parse the command line args
int policy = 0;
if ( args[0].equals("t") || args[0].equals("time") ) {
policy = ResourceCharacteristics.TIME_SHARED;
... | 7 |
public IMessage crypter(IMessage clair, String key) {
/*
* Lecture de la clef, puis encodage des caractres un par un par
* des oprations elementaires
*/
long d=new Date().getTime();
String keyAdaptee=this.adapter(key);
int k;
char[] c=new char[clair.taille()];
for(int i=0;i<clair.taille();i++) {
... | 5 |
public static void main(String[] args) {
double num = -1;
String in = scan.nextLine();
// parse in by spaces and go through and find the first string that
// parsesDouble to a double, if it errors then try next.
boolean foundNum = false;
String[] splitBySpace = in.split(" ");
for (int sb = 0; sb < splitBy... | 3 |
public static Automaton cleanAutomaton(Automaton a) {
Automaton ac = (Automaton) a.clone();
State[] s = ac.getStates();
Set useless = getUselessStates(ac);
for (int i = 0; i < s.length; i++) {
if (useless.contains(s[i]) && s[i] != ac.getInitialState())
ac.removeState(s[i]);
}
if (useless.contains(ac.... | 5 |
public void handleException(Throwable ex, Window window) {
if (ex instanceof YMethodNotFoundException) {
logger.info(ex.getMessage());
} else if (ex instanceof YInvalidMVCNameException ||
ex instanceof YCloneModelException ||
ex instanceof YEqualsModelException ||
ex instanceof YComponentValidatio... | 6 |
public void onPluginMessageReceived(String string, Player player, byte[] arg2) {
if (string.equals("5ZIG")) {
try {
String response = new String(arg2);
if (response.startsWith("/l/connect")) {
response = response.replace("/l/connect", "");
ModUserLoginEvent e = new ModUserLoginEvent(player);
... | 6 |
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.err.println(
"Usage: java RFS826_TcpClient <destination host> <destination port>");
System.exit(1);
}
// get the dest host + port from console
String dest_... | 1 |
public static boolean existsName(Usuarios usu){
String sql = " SELECT * FROM usuarios WHERE usuario = '"+usu.getUsuario()+"' ";
if(!BD.getInstance().sqlSelect(sql)){
return false;
}
if(!BD.getInstance().sqlFetch()){
return false;
}
return t... | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (!(obj instanceof InstanceList)) {
return false;
}
InstanceList<?> other = (InstanceList<?>) obj;
if (clazz == null) {
if (other.clazz != null) {
re... | 8 |
protected IRemoteCallObject responseData(long connectionId, final IRemoteCallObject callObj)
throws RemoteCallException, EndOfConnectionException {
//..handler answer from client (with error or not)
IRemoteCallObject response = callObj.getResponseRemoteCallObject();
if (callObj != null) {
if... | 6 |
public static String convert(String s, int nRows) {
if(nRows == 1 || s.length()<=nRows || s.equals(""))
return s;
String rs = "";
for(int i = 0; i < nRows; i++) {
//in these rows, only exists primary elements
if(i == 0 || i == (nRows-1)) {
int... | 9 |
public boolean kontroliertEuropa(Spieler s) {
boolean res = true;
if(!s.fraktion.equals(laenderGraph.getLaenderList().getLandByID(1).getOwner())) {
res = false;
}
return res;
} | 1 |
public void printStack(int stackId){
switch (stackId) {
case STACK_1:
System.out.print("\n\n\nPrinting STACK_1 Contents : [ ");
for(int i=0; i<head1; i++){
System.out.print(data[i*3]+",\t");
}
System.out.println("]");
break;
case STACK_2:
System.out.print("\n\n\nPrinting STACK_2 Contents ... | 6 |
private int getKthSmallestRecursion(int ai, int bi, int k)
{
printStatus(ai, bi, k);
if (k == 2) {
return get2ndSmallest(ai, bi);
}
int half_k = (k - 1) / 2;
int mid_ai = ai + half_k;
int mid_bi = bi + half_k;
int aval = a.get(mid_ai);
int bval = b.get(mid_bi);
if (aval == bval) {
//... | 9 |
public boolean insertAt(int index, E element) {
LinkedElement<E> oldElem = findElement(index);
if (index == total) {
addLast(element); // increments total
return true;
}
if (index == 0) {
addFirst(element); // increments total
return true;
}
if (oldElem != null) {
LinkedElement<E> new... | 3 |
@Override
public Buildable create(Object name, Object value) {
if (name.equals("model")) {
if (model != null) {
throw new IllegalArgumentException("Only one 'model' allowed.");
}
return model = new Model();
} else if (name.equals("output")) {
... | 3 |
public String getPath()
{
return path;
} | 0 |
public boolean serieValoradaVistaSeguida(Serie serie){
// Se comprueba si la serie es seguida por algún usuario.
for (UsuarioRegistrado usuario : misUsuarios) {
try{
Serie serieuser = usuario.buscarSerieSeguida(serie.obtenerTitulo());
}catch(Exception e){
... | 4 |
public static void openEditor(IWorkbenchPage page, ISelection selection,
int lineNumber) {
// Get the first element.
if (!(selection instanceof IStructuredSelection))
return;
Iterator<?> iter = ((IStructuredSelection) selection).iterator();
if (!iter.hasNext())
return;
Object elem ... | 9 |
public static List<TokenType> parse(CSVObject csv){
List<TokenType> types = new Vector<TokenType>();
types = new Vector<TokenType>();
String[][] data = csv.getData();
for(String[] line : data){
types.add(new TokenType(line[0], line[1], line[2]));
}
System.out.println("TokenType.parse() -> " + types + ";"... | 1 |
public void updateUserInfo() throws IOException {
if (config.isDebugOn())
System.err.println("Updating user info. "+"$MyINFO $ALL "+getUsername()+" "+config.getDescription()+"$ <++ V:0.673,M:P,H:0/1/0,S:2>$ $LAN(T3)0x31$"+config.getEmail()+"$1234$|");
//hubCommunicator.sendDataToHub("$Versio... | 1 |
public static LinkedHashMap<String,Object> array_change_key_case(Map<String,Object> hm, String upperLower) {
LinkedHashMap<String,Object> output = new LinkedHashMap<String,Object>();
if (hm == null) return output;
if (upperLower == null) upperLower = "LOWER";
for (Map.Entry<String,Object> entry : hm.entrySet())... | 5 |
private static void getAccessAndRefreshTokensFromAuthorizationCode(
TokenType t) {
flagAccessToken = false;
// builds POST parameters
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("client_id", clientId));
parameters.add(new BasicNameValuePair("clie... | 6 |
public Lemonade() {
this.setName("Lemonade");
this.setPrice(new BigDecimal(15));
} | 0 |
public boolean isLibre() {
if(controleur==null) return true;
else return false;
} | 1 |
private TileState stateFrom(boolean is_passable, boolean is_opaque) {
if (is_opaque) {
if (is_passable) {
return TileState.PASSABLE_OPAQUE;
}
return TileState.IMPASSABLE_OPAQUE;
} else {
if (is_passable) {
return TileState... | 3 |
private static void callRightMethod(CommandLine cli) throws FileNotFoundException, IOException
{
Mode mode = getMode(cli);
System.out.println("Starting with mode = " + mode);
final String sourceDirectory = cli.getOptionValue('s');
final String destDirectory = cli.getOptionValue('d')... | 3 |
@Override
public void actionPerformed(ActionEvent e) {
int dialogButton;
BmTestManager bmTestManager = BmTestManager.getInstance();
if ("start".equals(e.getActionCommand().toLowerCase())) {
if (bmTestManager.getUserKey().isEmpty()) {
JMeterUtils.reportErrorToUser(... | 4 |
public String init() {
user_dao.regisUser("kimapiwat","1234");
project_dao.saveProject("Assasin creed");
project_dao.saveProject("Call of Duty 4");
project_dao.saveProject("Battlefield");
project_dao.saveProject("Walking Dead");
project_dao.saveProject("Breaking Dawn");
project_dao.saveProject("Taylor... | 4 |
private String getPropertyValue(final Properties properties, final String propertyTag, final String defaultValue) {
String value = properties.getProperty(propertyTag);
if (value == null) {
value = defaultValue;
} else if (value.isEmpty()) {
value = defaultValue;
}
return value;
} | 2 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.