text stringlengths 14 410k | label int32 0 9 |
|---|---|
public boolean pickAndExecuteAnAction() {
try {
//synchronized(Customers){
for(int i =0; i < Customers.size(); i++){
////print("" + Customers.get(i).s );
if(Customers.get(i).s == CustomerState.waiting){
seatCustomer(Customers.get(i));
return true;
}
}
//synchronized(Customers){
... | 9 |
public void parseFile() throws IOException{
try{
BufferedReader br = new BufferedReader(new FileReader(filePath));
LinkedList<String> messages = new LinkedList<String>();
sentences = new LinkedList<String[]>();
//Push each massage to messages
String tempString = br.readLine();
while(tempString != n... | 5 |
public Node getNode(Coordinate coordinate)
{
if (coordinate.getY() < 0 || coordinate.getY() >= nodeMatrix.size())
{
return null;
}
else if (coordinate.getX() < 0 ||
coordinate.getX() >= nodeMatrix.get(coordinate.getY()).size())
{
return null;
}
else
{
return this.nodeMatrix.get(coordinate... | 4 |
public Cookie() {
print("Cookie constructor");
} | 0 |
private void updateTileButtons(Turn turn) {
if (turn == null || turn instanceof Pass)
throw new IllegalArgumentException("Turn can't be null or a pass");
if (turn instanceof Flip) {
Flip flip = (Flip) turn;
TileButton flipped = tileButtons[flip.getX()][flip.getY()];
flipped.setIcon(flip... | 9 |
private void setCorrectLocationInfo(Attributes attrs) {
// loop through all attributes, setting appropriate values
for (int i = 0; i < attrs.getLength(); i++) {
if (attrs.getQName(i).equals("x"))
quizSlide.getCorrectStart().setX(
Integer.valueOf(attrs.getValue(i)));
else if (attrs.getQName(i).equals... | 9 |
public int getInitialValue() {
throw_exception();
if (test_index>=test_network.test_numProposers)
throw new Error("Non-proposers should not be asking for initial value");
if(init_logic==1)
return test_index*(-1);
if(init_logic==2)
return test_index-5;
if(init_logic==3)
return... | 6 |
protected final void readCRFDraftEntries () throws IOException {
String [] headersArr = null;
int cnt = 0;
String [] tempArr;
while ((tempArr = this.crfReader.readNext()) != null) {
this.OCContainer = new ModelContainer();
CRF OCCRF = new CRF ();
... | 8 |
@Override
public void executeTask() {
try {
String temp = "@@@" + DCServerTask.serverID + ":"
+ DCServerTask.numClients;
byte[] senddata = temp.getBytes(); // prepare valid client data for
// sending to server
System.out.println("blasting out to all servers!");
clientN = new DatagramSock... | 8 |
public void checkFloating(int rowStart, int col, int maxRow) {
if (Dime[rowStart][col] != null && Dime[rowStart][col].getBubbleColor() != null) {
if (Dime[rowStart][col].isFloating) {
Bubble.FloatCount++;
Dime[rowStart][col] = new Bubble('0');//borrar
}
... | 8 |
private MidiDevice getReceivingDevice() throws MidiUnavailableException {
for (MidiDevice.Info mdi: MidiSystem.getMidiDeviceInfo()) {
MidiDevice dev = MidiSystem.getMidiDevice(mdi);
if (dev.getMaxReceivers() != 0) {
//String lcName = StringUtils.defaultString(mdi.getName(... | 2 |
public Map<String, String> getExtra() {
return extra;
} | 0 |
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 |
@Override
public void nextIteration() {
if ( lastIterationResult == IterationResult.FINISHED_WITHOUT_RESULT) {
//minimum sigma reached, there's no point in continuation
return;
}
++iterationNo;
LOGGER.info("Iteration No. " + iterationNo);
//TODO: albo inaczej to przemyslec albo @SuppressWarnings... | 6 |
public static String filterForHTMLValue(String _sContent) {
if (_sContent == null) {
return "";
}
// _sContent = replaceStr(_sContent,"</script>","<//script>");
// _sContent = replaceStr(_sContent,"</SCRIPT>","<//SCRIPT>");
char[] srcBuff = _sContent.toCharArray();
int nLen = srcBuff.length;
if (nLen... | 9 |
private void findPlugins(boolean activateAll) {
File[] files = fileDir.listFiles(new FilenameFilter() {
public boolean accept(File dir, String name) {
return name.toLowerCase().endsWith(".json");
}
});
for( File f : files ) {
try{
Scanner s = new Scanner(... | 6 |
protected void paint(Event event, Object element) {
if (!isOwnerDrawEnabled())
return;
ViewerCell cell= getViewerCell(event, element);
boolean applyColors= useColors(event);
GC gc = event.gc;
// remember colors to restore the GC later
Color oldForeground = gc.getForeground();
Color oldBackground... | 9 |
@Override
public final boolean setDebug(boolean d) {
return (debug = d);
} | 0 |
@Override
public void deserialize(Buffer buf) {
dungeonId = buf.readShort();
if (dungeonId < 0)
throw new RuntimeException("Forbidden value on dungeonId = " + dungeonId + ", it doesn't respect the following condition : dungeonId < 0");
inviterId = buf.readInt();
if (invit... | 3 |
public void initialize() {
lastxpos = lastypos = 0;
cellRange = cellSize; cellSize = cellRange + 2*intpad;
jPlColHeader = new JPanel() {
private static final long serialVersionUID = -9098547751937467506L;
java.awt.Rectangle r;
public void paint(Graphics g) {
r = g.getCli... | 7 |
private static int[][] createRandomCoordinates(int n, Random random) {
int[][] coordinates = new int[n][2];
for (int i = 0; i < coordinates.length; i++) {
//we ignore the case that two cities have the same coordinates - it should work anyway?
coordinates[i][0] = Math.abs(random.nextInt()%MAP_SIZE);
... | 1 |
public void setPackgeName(String packgeName) {
this.packgeName = packgeName;
} | 0 |
private static String getImageThunb(Element work) throws Exception{
try{
Elements tmp = work.getElementsByClass("work_thumb");
if(tmp==null || tmp.size()==0) return "http://www.dlsite.com/images/web/home/no_img_sam.gif";
Element thumb = tmp.get(0).child(0);
Elements tmp1 = thumb.getElementsByTag("img");
... | 5 |
public void setFullScreen(DisplayMode dm){
JFrame f = new JFrame();
f.setUndecorated(true);
f.setIgnoreRepaint(true);
f.setResizable(false);
vc.setFullScreenWindow(f);
if(dm != null && vc.isDisplayChangeSupported()){
try{
vc.setDisplayMode(dm);
}catch(Exception ex){}
}
f.createBufferStrateg... | 3 |
private void collision(){
Rectangle r1 = pika1.getBounds();
Rectangle r2 = pikaBall.getBounds();
Rectangle r4 = pika2.getBounds();
Line2D.Double leftLine = new Line2D.Double(0, 600, 410, 600);
Line2D.Double rightLine = new Line2D.Double(410, 600, 800, 600);
Line2D.Double leftStickLine = new Line2D.Double(40... | 9 |
private Tree variableListPro(){
Tree variable = null;
VariableList variables = null;
if((variable = variablePro()) != null){
if(accept(Symbol.Id.PUNCTUATORS,",")!=null){
if((variables = (VariableList) variableListPro()) != null){
return new VariableList(variable, variables);
}
return null;
... | 3 |
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 fe... | 6 |
@Override
protected void onSubmitAction(ActionRequest request, ActionResponse response, Object command, BindException errors) throws Exception {
final String targetParentPath = StringUtils.defaultIfEmpty(request.getParameter("folderPath"), null);
final String targetEntryPath = StringUtils.defaultIfE... | 6 |
public void transfromHeadline()
{
if(this.hlDepth > 0)
return;
int level = 0;
final Line line = this.lines;
if(line.isEmpty)
return;
int start = line.leading;
while(start < line.value.length() && line.value.charAt(start) == '#')
{
... | 9 |
public double cos(int a){
//normalizing
if(a>360){
a %= 360;
}else if(a<0){
a %= 360;
a += 360;
}
//return
if(a <= 90){
return cos[a];
}else if(a <= 180){
return -cos[180 - a];
}else if(a <= 270){
return -cos[a - 180];
}else{
return cos[360 - a];
}
} | 5 |
int exp2RK(ExpDesc e) {
this.exp2val(e);
switch (e.k) {
case LexState.VKNUM:
case LexState.VTRUE:
case LexState.VFALSE:
case LexState.VNIL: {
if (this.nk <= MAXINDEXRK) { /* constant fit in RK operand? */
e.info = (e.k == LexState.VNIL) ? this.nilK()
: (e.k == LexState.VKNUM) ? this.numberK(e.n... | 9 |
public void writeTermsToFile(String strNumber,
Hashtable<String, Double> oTermVsTFIDF) throws IOException {
String strKey = null;
Double maxValue = Double.MIN_VALUE;
String strTerms = "";
int len = oTermVsTFIDF.size() < 5 ? oTermVsTFIDF.size() : 5;
for (int i = 0; i < len; ++i) {
for (Map.Entry<Strin... | 7 |
public static void testGeneticAlgorithmDouble()
{
IMyRandomDataFunction<Double> rFunc = new IMyRandomDataFunction()
{
private final Random r = new Random();
@Override
public Double getRandom()
{
return Math.random();... | 7 |
public void deal()
{
Random rand = new Random();
// array of cards that have been dealt
boolean[] dealt = new boolean[21];
int r = rand.nextInt(21);
// picks some random cards for the solution
int check = 0;
String person, weapon, room;
person = weapon = room = "";
while(check < 3)
{
Card soluti... | 9 |
@Override
public void exceptionCaught( ChannelHandlerContext ctx, Throwable cause ) throws Exception
{
if(!(cause.getCause() instanceof IllegalStateException))
cause.printStackTrace();
ctx.close();
} | 1 |
public Boardable[] canBoard(Boardable batch[]) {
final Batch <Boardable> CB = new Batch <Boardable> () ;
if (mainEntrance() != null) CB.add(mainEntrance()) ;
if (docking != null) CB.add(docking) ;
int i = 2 ; for (Mobile m : inside()) if (m instanceof Boardable) {
CB.add((Boardable) m) ;
}
... | 4 |
public void onCommand(CommandSender sender, ChunkyCommand command, String label, String[] args) {
String worldName = null;
if (args.length < 1) {
if (!(sender instanceof Player)) {
Language.IN_GAME_ONLY.bad(sender);
return;
}
worldName ... | 3 |
public boolean place(int x, int y) { //if all squares are free, place ship and placed == true. if not, return false
if (randomAlignment() == true) {
x = randomWithRange(0,8);
for (int i = x; i < x + 2; i++) {
if (!Grid.isSquareEmpty(i, y)) {
Grid.addTo... | 5 |
@Override
public ArrayList<DetectorHit> getHits(Path3D path) { // Initialize the hit list array
ArrayList<DetectorHit> hitList = new ArrayList<>();
if (path == null) {
return hitList;
}
// Create an intersect point object that will contain the line-face
/... | 9 |
private static int getDist(Class<?> superClass, Class<?> klass) {
if (klass.isArray()) {
if (superClass.isArray()) {
superClass = superClass.getComponentType();
klass = klass.getComponentType();
} else {
// superClass must be Object. An array fitting into an Object
// must be more general than a... | 9 |
private int[] getStyle(int index) {
if (m_styleOffsets==null || m_styles==null ||
index>=m_styleOffsets.length)
{
return null;
}
int offset=m_styleOffsets[index]/4;
int style[];
{
int count=0;
for (int i=offset;i<m_styles.length;++i) {
if (m_styles[i]==-1) {
break;
}
count+=1;
... | 9 |
public void destroy_socket(SocketBase socket_) {
slot_sync.lock ();
int tid;
// Free the associated thread slot.
try {
tid = socket_.get_tid ();
empty_slots.add (tid);
slots [tid].close();
slots [tid] = null;
// Remove t... | 2 |
public boolean matches( Class<?> clazz )
{
return this.pattern.matcher( clazz.getSimpleName() ).matches();
} | 1 |
@Override
protected void readAttributes(XMLStreamReader in)
throws XMLStreamException {
// @compat 0.9.x
if (in.getAttributeValue(null, ID_ATTRIBUTE_TAG) == null
&& "model.colony.colonyGoodsParty".equals(in.getAttributeValue(null, "source"))) {
setId("model.modifier.c... | 7 |
public void setStartTime(long startTime) {
if (this.startTime != 0) {
log.debug("請注意:進入點設了第二次:" + this.name);
}
this.startTime = startTime;
} | 1 |
public String toString() {
String s = "";
for (int y=0; y<height; y++) {
for (int x=0; x<width; x++) {
char symbol;
switch (mapxy[x][y]) {
case 0:
symbol = '.';
break;
def... | 3 |
public static void printXmlElementAttributes(OutputStream stream, Cons attributes) {
{ Stella_Object item = null;
Cons iter000 = attributes;
for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
item = iter000.value;
{ Surrogate testValue000 = Stella_Object.safePrimaryType(item);
... | 6 |
public void run() {
while (true) {
try {
_socket = _serverSocket.accept();
System.out.println("Master connected!");
_istream = _socket.getInputStream();
BufferedReader receiveRead = new BufferedReader(new InputStreamReader(_istream));
String receiveMessage;
String[] tokens;
wh... | 7 |
final public void selectUnionStmt() throws ParseException {
selectStmt();
label_8:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case UNION:
case UNION_ALL:
;
break;
default:
jj_la1[20] = jj_gen;
break label_8;
}
switch ((jj_ntk==-... | 7 |
public static void main(String[] args) throws IOException {
BufferedReader f = new BufferedReader(new FileReader("src/utilities/kdtree.in"));
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(
"src/utilities/kdtree.out")));
Scanner in = new Scanner(f);
// Scanner skp=new Scanner(System.in)... | 5 |
public void ticketSubMenu(int ticketID) {
while (true) {
String[] standardOptions = {
"1 - View ticket details",
"2 - Add entry", // DavidE
"q - Go Back"
};
String[] adminOptions = {
"1 - View ticket details",
... | 8 |
public int canWalk(String side, Hexpos pos){
// 0 someone there's 1 empty but cant 2 empty and can
State state = this;
if(side != "red" && side != "blue")
return -1;
if(state.owner(pos) != null)
return 0;
MyList walkArea = pos.neighbours();
for(Object tmp : walkArea){
if(state.owner((Hexpos)tmp) ==... | 5 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Node other = (Node) obj;
if (name != other.name)
return false;
if (visited != other.visited)
return false;
return true;
} | 5 |
public List<List<Integer>> sort(List<List<Integer>> listToSort) {
int listSize = listToSort.size();
boolean swapped;
do {
swapped = false;
for (int i = 0; i < listSize - 1; i++) {
int one = listToSort.get(i).get(1);
int two = listToSort.ge... | 3 |
private void printIECLines() {
System.out.print("IEC/F: ");
if ((iecLines & 0x10) == 0) {
System.out.print("A1");
} else {
System.out.print("A0");
}
// The c64 has id = 1
int sdata = ((iecLines & 0x40) == 0) ? 1 : 0;
System.out.print(" C" + sdata);
sdata = ((iecLines & 0x80)... | 7 |
protected static <K, V> K lookupKeyByValue(Map<K, V> map, V value) {
for (final Map.Entry<K, V> entry : map.entrySet()) {
if (value.equals(entry.getValue())) {
return entry.getKey();
}
}
return null;
} | 2 |
public static boolean allEqualTo(byte[] data, byte value) {
if (data == null || data.length == 0) {
return false;
}
for (byte b : data) {
if (b != value) {
return false;
}
}
return true;
} | 4 |
public String[] getMonthTable() {
setGregorian(gregorianYear, gregorianMonth, 1);
computeChineseFields();
computeSolarTerms();
String[] table = new String[8];
String title = null;
if (gregorianMonth < 11)
title = "";
else
title = "";
title = title + monthNames[gregorianMonth - 1] + "月" + "";
Str... | 7 |
public Value newValue(final Type type) {
if (type == null) {
return BasicValue.UNINITIALIZED_VALUE;
}
boolean isArray = type.getSort() == Type.ARRAY;
if (isArray) {
switch (type.getElementType().getSort()) {
case Type.BOOLEAN:
case... | 9 |
private void seeOnMap(int id){
/*
* emfanizei ton xarth me kedro thn topothesia tou oximatos
*/
JFrame mapFrame = new JFrame("Topothesia Oxhmatos");
String[] latLon=con.getLatLon(id);
String lat,lon;
if(latLon!=null){
lat=latLon[0];
lon=latLon[1];
try {
String imageUrl = "htt... | 4 |
public static boolean setGuildType(String[] args, CommandSender s){
//Various checks
if(Util.isBannedFromGuilds(s) == true){
//Checking if they are banned from the guilds system
s.sendMessage(ChatColor.RED + "You are currently banned from interacting with the Guilds system. Talk to your server admin if you... | 8 |
public SimpleStringProperty firstNameProperty() {
return firstName;
} | 0 |
public void addAccount() {
AddAccountDialog addaccount = new AddAccountDialog(this, "Add Account");
Point loc = getLocation();
addaccount.setLocation(loc.x + 50, loc.y + 50);
addaccount.setModal(true);
addaccount.setVisible(true);
if (!addaccount.canceled()) {
String number = null;
try {
number ... | 8 |
private static Move ForwardRightCaptureForWhite(int r, int c, Board board)
{
Move forwardRightCapture = null;
if(r<Board.rows-2 && c<Board.cols-2 &&
(
board.cell[r+1][c+1].equals(CellEntry.black)
|| board.cell[r+1][c+1].equals(CellEntr... | 5 |
public static final Dimension getPreferredSize(Font font, String text) {
int width = 0;
int height = 0;
int length = text.length();
if (length > 0) {
TIntIntHashMap map = getWidthMap(font);
int fHeight = getFontHeight(font);
char ch = 0;
int curWidth = 0;
for (int i = 0; i < length; i++) {
ch... | 7 |
public static void main(String[] args) {
if(args.length!=1){
System.out.println("Inappropriate arguement passed, please pass only 1 arguement");
return;
}
if(!readConfig(Constants.CONFIGFILE,Integer.parseInt(args[0]))){
return ;
}
if(!ConnectionManager.createConnections(currentNode,connecti... | 7 |
public BrezenhemLine(Excel ex1, Excel ex2) {
begin = ex1;
end = ex2;
setColoredExes();
} | 0 |
public void processGroups(LevelManager lm)
{
for (Group group: lm.modelManager.units.values())
{
//System.out.println(group.position);
if (group != null)
processEntities(group.entities);
}
for (Group group: lm.modelManager.improvements.values())
if (group != null)
processEntities(group.entitie... | 8 |
protected Background(
String name, String costumeTex, String portraitTex,
int standing, int guild, Object... args
) {
this.name = name ;
if (costumeTex == null) this.costume = null ;
else this.costume = Texture.loadTexture(COSTUME_DIR+costumeTex) ;
if (portraitTex == null) this.portrait = null... | 8 |
@Override
public void init (AbstractQueue<QueueElement> queue, Properties props)
throws MalformedURLException {
this.queue = queue;
this.props = props;
String strUrl = props.getProperty("destinationURL");
if (strUrl == null) {
throw new RuntimeExcept... | 2 |
public Console()
{
// create all components and add them
frame=new JFrame("Java Console");
Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize=new Dimension((int)(screenSize.width/2),(int)(screenSize.height/2));
... | 4 |
public void addToAll(String text) {
try {
text = "Announce: " + text;
Scanner scan = new Scanner(this);
File temp = new File("temp");
PrintWriter pw = new PrintWriter("temp");
while(scan.hasNextLine()) {
String line = scan.nextLine();
... | 6 |
@Basic
@Column(name = "SOL_TIPO_SOLICITUD")
public String getSolTipoSolicitud() {
return solTipoSolicitud;
} | 0 |
private void getTransitionsFromXML(Document doc, PetriNet pn) {
NodeList resourcesList = doc.getElementsByTagName("transition");
for (int i = 0; i < resourcesList.getLength(); i++) {
Node nNode = resourcesList.item(i);
if (nNode.getNodeType() == Node.ELEMENT_NODE) {
... | 8 |
public void stopSleeping() {
TimerTask isNotSleeping = new TimerTask() {
public void run() {
isSleeping = false;
GUI.println("sleeping stoped");
sendGameResults();
}
};
Timer time = new Timer();
time.schedule(isNotSleeping, 20000);
} | 0 |
protected void onPrivateMessage(String sender, String login, String hostname, String message) {} | 0 |
public final int partitionByCost(int lb, int ub) { // for an outline of how this works, see the partition method for name
Person pivotElement = allPersons[lb];
int max = logicalSize;
int left = lb, right = ub;
Person temp;
while (left < right) {
while ((allPersons[left].totalCostWeek() <= pivotElement.tot... | 8 |
@Override
public void pickUp(Player player) throws InvalidActionException {
if (isActive())
throw new InvalidActionException("You can't pick up a live grenade");
addItemToPlayersInventory(player);
} | 1 |
public DFS addByteArray(int address, int length, String label, int... format) {
if (label != null)
rom.label[address] = label;
for(int i = 0; i < length; i++) {
for (int f = 0; f < format.length; f++) {
int ca = address + format.length * i + f;
rom.type[ca] = ROM.DATA_BYTEARRAY;
... | 6 |
public Problem validate(final Object instance,
final LowerCase annotation, final Object target,
final CharSequence value)
{
if (value == null || value.length() < 1)
{
if (annotation.required())
{
return new Problem(instance, annotation, target, value);
}
return null;
}
for (... | 5 |
public ArrayList<Link> getParentsFromLink(ArrayList<Link> parents, Link link, Link parent) {
if (this == link) {
boolean found = false;
for (Link link1 : parents) {
if (parent == link1) {
found = true;
}
}
if (!f... | 5 |
protected void initProperties(){
properties = new HashSet();
//scan methods
for (Method method : c.getMethods()) {
String name = method.getName();
if (Modifier.isPublic(method.getModifiers()) && name.startsWith("get")) {
name = lowerFirstChar(name.substrin... | 8 |
@Test
public void testFields() {
try {
postModel.getField("fake_field");
fail("Non-existent field should have thrown exception on get");
} catch (IllegalStateException e) {
}
try {
postModel.setField("fake_field", null);
fail("Non-existent field should have thrown exception o... | 4 |
public static BufferedImage getDepthRender(Raycaster raycaster){
Screen screen = raycaster.getBuffer();
BufferedImage render = new BufferedImage(screen.getWidth(), screen.getHeight(), BufferedImage.TYPE_INT_ARGB);
int width = screen.getWidth();
int height = screen.getHeight();
... | 3 |
public long getSendTime() {
return sendTime;
} | 0 |
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 |
* @param phase
* @param MV_returnarray
* @return int
*/
public static int computeNextMoonPhase(int n, Keyword phase, Object [] MV_returnarray) {
{ int i = 0;
double am = 0.0;
double as = 0.0;
double c = 0.0;
double x = 0.0;
double x2 = 0.0;
double extra = 0.0;
do... | 9 |
@Override
protected void finalizeRecord(RecordConfig record) {
super.finalizeRecord(record);
boolean minSet = record.getMinLength() != null;
if (stream.isStrict()) {
if (record.getMinLength() == null) {
record.setMinLength(record.getMinSize());
... | 9 |
public int sqrt(int x) {
if (x <= 0)
return 0;
int k = 0;
int o = x;
int base = 5;
while (x >= 1) {
++k;
x /= base;
}
int p;
if((k & 1) == 1){
p = k / 2;
}else{
p = k/2 -1;
}
int q = k - p;
for (int i = pow(p,base); i <= pow(q,base); ++i) {
if (i * i <= o && (i + 1) * (i + 1) ... | 6 |
public boolean partidoSemiCompleto() {
return (listaJugadores.size()==10) && (listaJugadores.stream().anyMatch(j -> j.getModo() instanceof Solidario)|| listaJugadores.stream().anyMatch(j -> j.getModo() instanceof Condicional));
} | 2 |
void deleteDirectory(File dirPath) {
File files[] = dirPath.listFiles();
for (File file : files) {
if (file.isFile()) {
file.delete();
} else {
String ft[] = file.list();
if (ft.length == 0) {
file.delete();
} else {
this.deleteDirectory(file);
}
}
}
dirPath.delete();
} | 3 |
public void setColumnName(String columnName) {
this.columnName = columnName;
} | 0 |
@Override
public void mouseMove(MouseEvent e) {
if(this.getMouseListener() != null)
{
this.getMouseListener().MouseMove(this, e);
}
} | 1 |
public Object GetNextReady()
{
//holds first object in the ready queue
Object tmp = null;
//pickup priority Object
tmp = readyQueue.poll();
//return the object
return tmp;
} | 0 |
@Override
public int compare(String s1, String s2)
{
if (s1.equals(s2))
return 0;
if ((s1.compareTo("NIL") == 0) || (s2.compareTo("LIN") == 0))
return 1;
if ((s2.compareTo("NIL") == 0) || (s1.compareTo("LIN") == 0))
return -1;
if (s1.compareTo(s2) < 0)
return -1;
else retu... | 6 |
public int clamp(int num, int min, int max){
if(num <= min)
{
return min;
}
if(num >= max)
{
return max;
}
return num;
} | 2 |
public void eliminarUltimo(){
Nodo<T> q = this.p;
Nodo<T> t = new Nodo<T>();
if(q.getLiga() == null){
this.p = null;
}else{
while(q.getLiga() != null){
t = q;
q = q.getLiga();
}
t.setLiga(null);
}
} | 2 |
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final Pair other = (Pair) obj;
if (left == null) {
if (other.left != null)
return false;
} else if (!lef... | 9 |
private boolean isSame(DListNode node, short red, short green, short blue, byte direction){
Run test = new Run(1,red,green,blue);
if (direction == CURR){
return node.run.equalsIntensities(test);
}
else if (direction == NEXT && node.next.run != null){
return node.next.run.equalsIntensities(t... | 5 |
@Override
public void endDocument() throws SAXException {
System.out.println("end Document");
} | 0 |
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.