text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void awaitAsyncExecution(Future<?> async) throws ProcessExecutionException {
try {
async.get();
} catch (ExecutionException ex) {
// thread returned an exception
if (ex.getCause() instanceof ProcessExecutionException) {
throw (ProcessExecutionException) ex.getCause();
}
} catch (Exception... | 4 |
@Override
public void mouseDown(EventMouse eventMouse) {
if (eventMouse.getPosition().getY() > getPosition().getY() + getScale().getY() - topBarHeight){
drag = true;
pressPosition = eventMouse.getPosition().sub(getPosition().getXY());
}
if (active){
event... | 5 |
@Override
public boolean preprocessCommand(JissModel jissModel, String orig, StringBuffer cmd) {
final String c = cmd.toString();
if(c.equals("::langs")) {
cmd.setLength(0);
printLangs(jissModel, cmd);
} else if (c.equals("::lang")) {
cmd.setLength(0);
printCurrentLang(jissModel, cmd);
} else if(c.... | 9 |
private boolean nodesConnectedHelper(Node parent, Node from, Node to) {
if (from == to)
return true;
for (Node n : from.adjNodes()) {
if (n != parent && nodesConnectedHelper(from, n, to))
return true;
}
return false;
} | 4 |
public static StaffRank getNextBest(StaffRank sr) throws NoNextRankException {
switch(sr) {
case NONE:
return HELPER;
case HELPER:
return CHATMOD;
case CHATMOD:
return MOD;
case MOD:
return SRMOD;
case SRMOD:
return ADMIN;
case ADMIN:
return OWNER;
case OWNER:
throw new NoNextRankEx... | 7 |
@Override
public void execute(DebuggerVirtualMachine dvm) {
} | 0 |
public void startGame() throws InterruptedException {
canvas.createBufferStrategy(2);
Graphics2D g = (Graphics2D)canvas.getBufferStrategy().getDrawGraphics();
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
long start = 0L;
long sleepDuration = 0L;
while(true... | 3 |
final public void Function_body() throws ParseException {
/*@bgen(jjtree) Function_body */
SimpleNode jjtn000 = new SimpleNode(JJTFUNCTION_BODY);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
Function_variable_declarations();
... | 8 |
public void setModel(TreeModel model) {
tree = model;
invalidate();
} | 0 |
public void setCinema(Cinema cinema) {
if (cinema == null) {
throw new IllegalArgumentException("Cinema object should not be set NULL.");
}
if (this.cinema != null) {
this.cinema.removeCashOffice(this);
}
if ( !cinema.existCashOffice(this)) {
cinema.addCashOffice(this);
}
t... | 3 |
@Override public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Card other = (Card) obj;
if (face == null) {
if (other.face != null)
return false;
} else if (!face.equals(other.face))
return false;
... | 7 |
public static double min(double[] flag) {
double min = flag[0];
for(int i = 1; i < flag.length; i++) {
if(flag[i] < min)
min = flag[i];
}
return min;
} | 2 |
public void agregarNavesRandom(){
Hashtable<TipoNave, Integer> navesDefault = (Hashtable<TipoNave, Integer>) Config.getObject("navesDefault");
Enumeration<TipoNave> e = navesDefault.keys();
while(e.hasMoreElements()){
TipoNave tipo = e.nextElement();
int number = navesDefault.get(tipo);
while((number--)... | 9 |
public void ejecutar() {
try {
// Creamos un servidor de Socket
ServerSocket server = new ServerSocket(port);
System.out.println("Servidor iniciado...");
while (true) {
Socket cliente = server.accept();
// Crear los canales de lectu... | 6 |
public String addTitleEps(String eps) throws IOException {
if (text == null || text.size() == 0) {
return eps;
}
final int idx = eps.indexOf("%%BoundingBox:");
if (idx == -1) {
throw new IllegalArgumentException();
}
final StringTokenizer st = new StringTokenizer(eps.substring(idx + "%%BoundingBox:".... | 8 |
public void hit() {
health--;
if (health <= 0) {
dead = true;
}
} | 1 |
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
for(ListIterator<PExpLogica> i = this._expLogica_.listIterator(); i.hasNext();)
{
if(i.next() == oldChild)
{
if(new... | 3 |
public void playSound(Matching type) {
if (type == Matching.Reveal && RevealSound != null) {
RevealSound.play();
}
else if (type == Matching.Match && MatchSound != null) {
MatchSound.play();
}
else if (type == Matching.MisMatch && MisMatchSound != null) {
MisMatchSound.play();
}
} | 6 |
public void stop() throws InterruptedException {
es.shutdown();
while (loadingNow() > 0) {
Thread.sleep(500);
}
} | 1 |
public static void browse (String url) {
try {
if (Desktop.isDesktopSupported()) {
Desktop.getDesktop().browse(new URI(url));
} else if (getCurrentOS() == OS.UNIX && (new File("/usr/bin/xdg-open").exists() || new File("/usr/local/bin/xdg-open").exists())) {
... | 5 |
public Enumeration<String> elements() {
Iterator<String> iter;
Vector<String> list;
iter = m_Words.iterator();
list = new Vector<String>();
while (iter.hasNext())
list.add(iter.next());
// sort list
Collections.sort(list);
return list.elements();
} | 1 |
private Statement arrayStatment(String varName, Vector<Expression> expressions,
Vector<Integer> lengths, OperationExpression rhs) {
int[] indexes = new int[lengths.size()];
for (int i = 0; i < lengths.size(); i++)
indexes[i] = 0;
BlockStatement statement = new BlockStatement(... | 5 |
public static int longestConsecutive(int[] num) {
if (num.length == 0)
return 0;
// LongestConsecutiveSequence instance = new
// LongestConsecutiveSequence();
// Queue<Integer> queue = new
// PriorityQueue<Integer>(num.length+1,instance.new MyComparator());
Queue<Integer> queue = new PriorityQueue<Intege... | 6 |
public void putAll( Map<? extends Short, ? extends Double> map ) {
Iterator<? extends Entry<? extends Short,? extends Double>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Short,? extends Double> e = it.next();
this.put( e.get... | 8 |
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int arr[] = new int[n];
for(int arr_i=0; arr_i < n; arr_i++){
arr[arr_i] = in.nextInt();
}
double[] fractions=findPercentageNumbers(arr);
... | 1 |
public static List<Pledge> readAllFrequencyunit(Connection connection, Enum_version version, Pledge.Enum_frequency_unit frequency_unit) {
PreparedStatement statement;
ResultSet resultset;
List<Pledge> pledgelist = new ArrayList();
Calendar calendar = Calendar.getInstance();
Strin... | 9 |
public void setProtocoleJdbc(String protocoleJdbc) {
this.protocoleJdbc = protocoleJdbc;
} | 0 |
private About() {
// JFormDesigner - Action initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
putValue(NAME, "Acerca de...");
putValue(SHORT_DESCRIPTION, "Acerca de...");
putValue(LONG_DESCRIPTION, "Acerca de...");
putValue(SMALL_ICON, new ImageIcon(g... | 0 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
try {
TilastointiService service = new TilastointiService();
ArrayList<Toppizzat> pizzatop = service.haeToppizzat();
// lisätään requestiin
r... | 2 |
protected static double dpow_default(double a, double b) {
if (b < 0)
return 1 / dpow_default(a, -b);
double p = 1;
int whole = (int) b;
for (double v = a; whole > 0; whole >>= 1, v *= v)
if ((whole & 1) != 0)
p *= v;
if ((b -= whole) > 0) {
int frac = (int) (0x10000 * b);
for (; (frac & 0xfff... | 6 |
public int count() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
javax.persistence.criteria.Root<T> rt = cq.from(entityClass);
cq.select(getEntityManager().getCriteriaBuilder().count(rt));
javax.persistence.Query q = getEntityManag... | 0 |
public void draw(Graphics g) {
if (InputHandler.MouseX > x
&& InputHandler.MouseX < x + imageOff.getWidth()
&& InputHandler.MouseY > y
&& InputHandler.MouseY < y + imageOff.getHeight()) {
g.drawImage(imageOn, x, y, null);
if (!isClicked || selectedButton == this) {
g.drawImage(sword_sele... | 7 |
public Graphics drawGridGraphics(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
g2d.setColor(new Color(99, 209, 62, 255));
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//Draws the rhombuses on the screen in a grid like fashion
int rhombus_width = 40;
int rhombu... | 5 |
public int patientsLengthRecursively() {
if (nextPatient == null) {
return 1;
} else {
return 1 + nextPatient.patientsLengthRecursively();
}
} | 1 |
private boolean setGame(Game game) {
boolean test = false;
if (test || m_test) {
System.out.println("GameWindow :: setGame() BEGIN");
}
m_gameControl = game;
if (test || m_test) {
System.out.println("GameWindow :: setGame() END");
}
return true;
} | 4 |
private void readPossibleCharData(/*Element element*/
) throws ParseException, IOException {
int i = 0;
while (!isChar('<') && !isChar('&') && !isSymbol(END_CDATA)) {
tmpBuf_[i] = readChar();
//convert DOS line endings to UNIX
if (tmpBuf_[i] == '\r' && peekChar() == '\n') tmpBuf_[i] = read... | 7 |
public Poly reshape() {
double[] t;
int index = p.length - 1;
for (int i = 0; i < p.length; i++) {
if (Math.abs(p[i]) > epsilon) {
index = i;
break;
}
}
t = new double[p.length - index];
for (int i = 0; i < t.length; i++)
t[i] = p[i + index];
Poly tt = new Poly(t);
return tt;
} | 3 |
private boolean r_perfective_gerund() {
int among_var;
int v_1;
// (, line 71
// [, line 72
ket = cursor;
// substring, line 72
among_var = find_among_b(a_0, 9);
if (among_var == 0) {
return false;
}
// ], line 72
bra = cursor;
switch (among_var) {
case 0:
return false;
case 1:
// (... | 8 |
public static void ApplyGaussianFilter(ComparableGrid2D<Double> grid, int kernel_size)
{
int kernel_rows = kernel_size;
int kernel_cols = kernel_size;
// define kernel here (double loop), these are the 1/16, 2/16, etc...
// values that you're multiplying the image pixels by
double[][] kernel = new double[ke... | 9 |
public synchronized InputStream getInputStream(final short fid) {
try {
InputStream in = null;
byte[] file = filesBytes.get(fid);
if (file != null) {
/* Already completely read this file. */
in = new ByteArrayInputStream(file);
in.mark(file.length + 1);
} else {
/* Maybe partially read? Us... | 5 |
public void setSourceText(String sourceText) {
if( !sourceText.equals(AlchemyAPI_ConceptParams.CLEANED) && !sourceText.equals(AlchemyAPI_ConceptParams.CLEANED_OR_RAW)
&& !sourceText.equals(AlchemyAPI_ConceptParams.RAW) && !sourceText.equals(AlchemyAPI_ConceptParams.CQUERY)
&& !sourceText.equals(AlchemyAPI... | 5 |
public QueryResult search(ArrayList<BusStop> locations, ArrayList<Line> lines, Location departure, Location destination)
{
/** YOUR SEARCH ALGORITHM WILL GO HERE */
//Iterate through lines - find smallest distance
double minDistance = Double.MAX_VALUE;
Line minLineFromDep = lines.get(0);
... | 6 |
public void handleMove(HttpServletRequest request, HttpServletResponse response, String pathInContext, Resource resource) throws ServletException, IOException
{
if (!resource.exists() || !passConditionalHeaders(request, response, resource))
return;
String newPath = URI.canonicalPath(req... | 7 |
private void generateAlchemicalItem(){
int test = rollDie(1, 100);
if (test <= 12){
room.append("Alchemist's fire (" + rollDie(1, 4) + " flasks, 20gp each)\n");
} else if (test <= 24){
room.append("Acid (" + rollDie(2, 4) + " flasks, 10gp each)\n");
} else if (test <= 36){
room.append("Smokesticks (... | 7 |
@Override
public void ParseIn(Connection Main, Server Environment)
{
Environment.InitPacket(451, Main.ClientMessage);
Environment.Append(0, Main.ClientMessage);
Environment.Append(Integer.toString(5), Main.ClientMessage);
Room[] Rooms = new Room[Main.Data.OwnRooms.size()];
... | 5 |
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (!plugin.hasPerm(sender, "who", true)) {
sender.sendMessage(ChatColor.YELLOW
+ "You do not have permission to use /" + label);
return true;
}
if (args.length == 1) {
UserTable ut = plugin.getDatabas... | 7 |
public static Map getInstance(int size) {
if (Map.instance == null||!(Map.instance instanceof HazardousMap)) {
instance = new HazardousMap(size);
}
return Map.instance;
} | 2 |
public static void main(String[] args)
{
Generic1<Integer> a = new Generic1<Integer>();
Integer[] integerA = {10,1,20};
Integer[] integerB = null;
a.setFooArray(integerA);
integerB = a.getFooArray();
for(int i = 0; i < a.getFooArray().length; i++)
{
System.out.println(integerB[i]);
}
} | 1 |
public void doTransformations() {
if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_FLOW) != 0)
GlobalOptions.err.println("before Transformation: " + this);
while (lastModified instanceof SequentialBlock) {
if (lastModified.getSubBlocks()[0].doTransformations())
continue;
lastModified = lastModi... | 5 |
public void close()
{
try
{
if(myStatement!=null)
myStatement.close();
}
catch (final SQLException e)
{
if(CMSecurity.isDebugging(CMSecurity.DbgFlag.SQLERRORS))
Log.errOut("DBConnection",e);
}
try
{
if(myPreparedStatement!=null)
myPreparedStatement.close();
}
catch (final SQLEx... | 9 |
private String getNewIntervalString(Interval<?> interval, String name, boolean empty, boolean entire) {
String declaration = "";
String inputType = currentTypeTranslation_.get(interval.getTypeClass())[0];
if (empty) {
if (currentEmptyIntervalTranslation_.length == 2) {
declaration += currentEmptyInterval... | 9 |
public void run(String args[]) {
LOG.info("SaveTVDownloadManager Version: " + VERSION + " is starting");
try {
Parameter.initialize(args);
if(Parameter.parameterOk()){
DownloadManager dl;
if(Parameter.isProxySet())
dl = new DownloadManager(Parameter.getProxyH... | 3 |
public void removeOldImagesIfDatabaseIsFull() {
if (isMaxAllowedSpaceInUse()) {
mongoImageTemplate.findAndRemove(new Query().limit(MAX_DELETE_LIMIT), Image.class);
}
} | 1 |
public String toString() {
StringBuffer sbuf = new StringBuffer();
sbuf.append("(<Pair> ");
sbuf.append(left == null ? "<null>" : left.toString());
sbuf.append(" . ");
sbuf.append(right == null ? "<null>" : right.toString());
sbuf.append(')');
return sbuf.toString... | 2 |
private void Remover_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Remover_ButtonActionPerformed
try {
if (NomeJogador_TextField.getText().equals("")) {
JOptionPane.showMessageDialog(null, "Selecione um jogador para remover!", "Alerta!", JOptionPane.WARNING... | 2 |
public String getRandomGeslacht() {
Random rn = new Random();
switch (rn.nextInt(4)) {
case 0:
return "man";
case 1:
return "vrouw";
case 2:
return "onbepaald";
case 3:
return "onbekend";
default:
return "onbekend";
}
} | 4 |
public static Number[][] largestTriangleThreeBuckets(Number[][] data, Integer threshold) {
Number[][] sampled = new Number[threshold][];
if (data == null) {
throw new NullPointerException("Cannot cope with a null data input array.");
}
if (threshold <= 2) {
throw new RuntimeException("What am I supposed t... | 9 |
@Override
public GameState choose(Player player, GameState[] states, Card card) {
for(GameState s : states)
{
s = findSetToTrue(s,card);
}
//If there's only one choice, we have no choice but to do it
if(states.length == 1)
{
return states[0];
}
int alpha = Integer.MIN_VALUE;
int beta =... | 4 |
public byte[] loadBytecode(StructMethod mt, int codeFullLength) {
String className = mt.getClassStruct().qualifiedName;
try (DataInputFullStream in = getClassStream(className)) {
if (in != null) {
in.discard(8);
ConstantPool pool = mt.getClassStruct().getPool();
if (pool == null)... | 9 |
public void use() {
if (!valid())
throw new IllegalStateException("trying to enable a program that is not valid");
GL20.glUseProgram(program);
} | 1 |
public Battlefield loadMonster(ArrayList<Monster> monsters){
for(int i = 0 ; i < monsters.size();i++){
monsterSlots.add(new MonsterSlots(monsters.get(i)));
monsterTurn.add(monsterSlots.get(i));
}
return battleField;
} | 1 |
private void addToMap(Type t, Set<Unit> value) {
// TODO Auto-generated method stub
if(newExpr_cmplt == null){
newExpr_cmplt = new HashMap<Type, Set<Unit>>();
}
if(!newExpr_cmplt.containsKey(t)){
Set<Unit> set = new HashSet<Unit>();
newExpr_cmplt.put(t, set);
}
newExpr_cmplt.get(t).addAll(value)... | 2 |
@Override
public void paintComponent(Graphics g) {
if (image == null)
initialise();
g.drawImage(image, 0, 0, null);
} | 1 |
public void show(Component invoker, int x, int y) {
if (atom == null)
return;
if (!atom.isNucleotide())
return;
if (!((MolecularModel) atom.getHostModel()).changeApprovedByRecorder())
return;
String s = atom.getName();
if (s.equals("A"))
miA.setSelected(true);
else if (s.equals("C"))
miC.setS... | 8 |
public void setSelected(boolean selected)
{
this.selected = selected;
repaint();
} | 0 |
public void update(boolean performed_action, double ap_from_action) {
//TODO Fix/Create actor turn system
if (performed_action) {
if (run_turn) {
for (int c = 0; c < active_actors.size(); c++) {
Actor a = active_actors.get(c);
if (a.act... | 4 |
private JPanel createSettings()
{
JPanel panel = new JPanel(new BorderLayout());
setIconImage(new ImageIcon("res/icon.png").getImage());
// Create the options panel
JPanel optionsPanel = new JPanel(new GridLayout(4, 1));
// Trim panel
JPanel trimPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
JLab... | 5 |
public void setName(String name) {
Name = name;
} | 0 |
public int getWordPoints(String word) {
int pointValue = 0;
int wordLength = word.length();
switch (wordLength) {
case 1:
case 2:
pointValue = 0;
break;
case 3:
pointValue = 1;
break;
case 4:
pointValue = 2;
break;
case 5:
pointValue = 3;
break;
case 6:
pointValue = 4;
... | 8 |
@EventHandler
public void SlimeNightVision(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getSlimeConfig().getDouble("Slime.NightV... | 6 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final DeviceObjectReference other = (DeviceObjectReference) obj;
if (deviceIdentifier... | 9 |
public void driver(String ... args) {
// get instance of MilliTimer() for benchmarking
MilliTimer timer = new MilliTimer();
this.validateArgs(args);
ApplicationWindow.clearData();
// Open Database Connection
try {
Database.getInstance()... | 6 |
@Override
public ByteBuffer getData() {
int cols = (int) colorsUsed;
if (cols == 0) {
cols = 1 << bitsPerPixel;
}
int rowsize = (int) width / 8;
if ((rowsize % 4) > 0) {
rowsize += 4 - (rowsize % 4);
}
ByteBuffer buf = ByteBuffer.allo... | 8 |
private Collection<URL> buildAritfactDependencies(ExpressionEvaluator expressionEvaluator) throws ComponentConfigurationException {
MavenProject project;
try {
project = (MavenProject) expressionEvaluator.evaluate("${project}");
} catch (ExpressionEvaluationException ... | 3 |
private boolean indiceValido(int ren, int col) {
if ((ren >= 0) && (ren < renglones) && (col >= 0)
&& (col < columnas)) {
switch (tipocod) {
case 1:
return (ren <= col); // sd
case 2:
return (ren < col); // sn
case 3:
return (re... | 9 |
public static SaveResults getSaveResults() {
if (miSaveResults == null)
miSaveResults = new SaveResults();
return miSaveResults;
} | 1 |
public static int encodingNum(String name) {
if (name.equalsIgnoreCase("Raw")) return encodingRaw;
if (name.equalsIgnoreCase("CopyRect")) return encodingCopyRect;
if (name.equalsIgnoreCase("RRE")) return encodingRRE;
if (name.equalsIgnoreCase("CoRRE")) return encodingCoRRE;
if (name.equ... | 7 |
void checkNotFrozen(String classname) throws RuntimeException {
CtClass clazz = getCached(classname);
if (clazz == null) {
if (!childFirstLookup && parent != null) {
try {
clazz = parent.get0(classname, true);
}
catch (NotFo... | 6 |
@Override
protected void logBindInfo(Method method) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("绑定" + getDescription() + "到方法[" + method + "]成功");
}
} | 1 |
public void testNoLineBreaks() {
// loop down all delimiter qualifier pairs to test
for (final char[] element : DELIM_QUAL_PAIR) {
final char d = element[0];
final char q = element[1];
final String txtToParse = UnitTestUtils.buildDelimString(DELIMITED_DATA_NO_BREAKS,... | 3 |
public PlayerPanel() {
super(new User());
setName("Player_Panel");
setLayout(new BorderLayout(5, 5));
// ////////////////////////////
// Top Panel:
// ////////////////////////////
labelName = new JLabel("Name:");
tfFirstName = new JTextField();
tfLastName = new JTextField();
labelID = new JLab... | 5 |
@SuppressWarnings("unchecked")
public List<Order> getAllOrders() {
return (List<Order>)this.em.createNamedQuery("findAllOrders").getResultList();
} | 0 |
public static void main(String[] args) {
RandomSearchInitialisation starter = new RandomSearchInitialisation();
starter.initLanguage(new char[] { '0', '1' }, 20, "(0|101|11(01)*(1|00)1|(100|11(01)*(1|00)0)(1|0(01)*(1|00)0)*0(01)*(1|00)1)*");
int solutionFoundCounter = 0;
int noSolutionFound = 0;
List<Long> c... | 8 |
public static void writeResults( File outFile, HashMap<String, HashMap<String, Integer>> outerMap ) throws Exception
{
HashSet<String> samples = new HashSet<String>();
List<Holder> nodes = new ArrayList<Holder>();
for( String s : outerMap.keySet() )
{
Holder h= new Holder();
h.nodeName = s;
samples... | 7 |
public void setUniqueWords() {
for (String x : totalWords) {
if (!uniqueWords.contains(x.toLowerCase())) {
uniqueWords.add(x.toLowerCase());
}
}
while (uniqueWords.contains("-")) {
uniqueWords.remove("-");
}
} | 3 |
@Override
public TLValue evaluate() {
TLValue a = lhs.evaluate();
TLValue b = rhs.evaluate();
// number + number
if(a.isNumber() && b.isNumber()) {
return new TLValue(a.asDouble() + b.asDouble());
}
// list + any
if(a.isList()) {
List<TLValue> list = a.asList();
list.a... | 5 |
public IntegerAggregationPanel(IntegerColorLibrary converter)
{
this.colorPicker = converter;
converter.addListener(this);
addMouseMotionListener(new MouseMotionListener()
{
@Override
public void mouseDragged(MouseEvent e)
{
// do nothing
}
@Override
public... | 2 |
@Override
public ResultMessage addGoodsClass(GoodsClassPO goodsClassPO) {
if(goodsClassPO.goodsClassName.equals("")) return ResultMessage.add_failure;
boolean hasFather = false;
gcIter = goodsClassList.iterator();
GoodsClassPO gcp;
System.out.println(goodsClassPO.fatherGoodsClassNum);
if(goodsClassPO.fathe... | 7 |
public static Game instantiante(String briscaGameFactory,
Object[] parameters) {
if (briscaGameFactory.contains(VANILLA_BRISCA_GAME)) {
return new BriscaGame();
} else if (briscaGameFactory.contains(TOURNAMENT_GAME)) {
return new TournamentBrisca((BriscaGame) parameters[0]);
} // else
return null;
} | 2 |
public Piece(boolean isWhite, ImageIcon img) {
this.isWhite = isWhite;
this.imgIcon = img;
} | 0 |
@XmlElementDecl(namespace = "http://www.rsasecurity.com/rsalabs/pkcs/schemas/pkcs-5v2-0#", name = "PBMAC1-params")
public JAXBElement<PBMAC1ParameterType> createPBMAC1Params(PBMAC1ParameterType value) {
return new JAXBElement<PBMAC1ParameterType>(_PBMAC1Params_QNAME, PBMAC1ParameterType.class, null, value);... | 0 |
public static void main(String[] args)
{
BigComplex one = new BigComplex(BigDecimal.valueOf(-3),BigDecimal.valueOf(-4));
BigComplex two = new BigComplex(BigDecimal.valueOf(-3),BigDecimal.valueOf(4));
BigComplex three = new BigComplex(BigDecimal.valueOf(2.003),BigDecimal.valueOf(0));
... | 0 |
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
this.setVisible(false);
if (fc != null) {
fc.setVisible(true);
}else
if (fp != null) {
fp.setVisible(true);
}
} | 2 |
static void scoreAll(LeafCollector collector, DocIdSetIterator iterator, TwoPhaseIterator twoPhase, Bits acceptDocs) throws IOException {
if (twoPhase == null) {
for (int doc = iterator.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iterator.nextDoc()) {
if (acceptDocs == null || acceptD... | 8 |
private boolean jj_2_55(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_55(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(54, xla); }
} | 1 |
protected void writeExtendedFeatures (DependencyInstance instance, ObjectOutputStream out)
throws IOException {
final int instanceLength = instance.length();
for(int w1 = 0; w1 < instanceLength; w1++) {
for(int w2 = w1; w2 < instanceLength; w2++) {
for(int w3 = w2+1; w3 < instanceLength; w3++) {
Feat... | 9 |
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._var_ == oldChild)
{
setVar((PVar) newChild);
return;
}
if(this._aDe_ == oldChild)
{
s... | 7 |
public int[] merge(int[] leftSortedArray, int[] rightSortedArray) {
if (leftSortedArray == null)
return rightSortedArray;
else if (rightSortedArray == null)
return leftSortedArray;
int p = 0;
int q = 0;
int r = 0;
int combinedSize = leftSortedArray... | 8 |
public static HashSet<Player> getTeamFriends(Teams team) {
if (team == Teams.BLUE) {
return blueFriends;
} else if (team == Teams.GREEN) {
return greenFriends;
} else if (team == Teams.ORANGE) {
return orangeFriends;
} else if (team == Teams.RED) {
return redFriends;
} else {
return null;
}
... | 4 |
private Integer valid(float[] weeksPrices) {
int v = 0;
for (float f : weeksPrices) {
if (f == f)
v++;
}
return v;
} | 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.