text stringlengths 14 410k | label int32 0 9 |
|---|---|
protected void initVerifiers(int currVerSet) {
int idx = 0 ;
int currVerifierSet ;
if (currVerSet >=0 && currVerSet < NO_OF_LANGUAGES ) {
currVerifierSet = currVerSet ;
}
else {
currVerifierSet = nsPSMDetector.ALL ;
}
mVerifier = null ;
mStatisticsData = null ;
if ( currVerifierSet == nsPSMD... | 8 |
private static FeatNode getNode(Long parentId, Long featId) {
if (containedFeats.contains(featId)) {
for (FeatNode n : nodes.values()) {
if (n.getFeat() == featId) {
nodes.get(n.getId()).getParents().add(parentId);
System.out.println("Node retu... | 3 |
private String randomResource(int i) {
String resource; // String ressource a retourner
// Affecte la string ressource au cas par cas en fonction de la valeur de l'entier.
switch (i) {
case 0:
resource = "bois";
break;
case 1:
resource = "mouton";
break;
case 2:
resource = "ble";
... | 5 |
public static String trimLeadingCharacter(String str, char leadingCharacter) {
if (!hasLength(str)) {
return str;
}
StringBuilder sb = new StringBuilder(str);
while (sb.length() > 0 && sb.charAt(0) == leadingCharacter) {
sb.deleteCharAt(0);
}
return sb.toString();
} | 3 |
public DetailedEditor(final Display display, final List<String> headerList,
final CSVRow row, String inCellDelimiter, String regexTableMarker) {
shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("Detailed CSV edition");
shell.setSize(800, 600);
// If there is more columns for ... | 5 |
static public boolean deleteDirectory(File path) {
if (path == null) return false;
try {
if( path.exists() ) {
Functions.clearDirectory(path);
}
return( path.delete() );
} catch (Throwable e) {
return false;
}
} | 3 |
public synchronized void run() {
// go over all complete messages and process them.
while (_tokenizer.hasMessage()) {
String msg = _tokenizer.nextMessage();
String response = this._protocol.processMessage(msg);
if (response != null) {
try {
ByteBuffer by... | 3 |
public boolean readFile(String filename, int k, BookmarkReader wikiReader, Integer minBookmarks, Integer maxBookmarks, Integer minResBookmarks, Integer maxResBookmarks) {
try {
this.filename = filename;
FileReader reader = new FileReader(new File("./data/results/" + filename + ".txt"));
BufferedReader br = n... | 8 |
public void testDividedBy_int() {
Years test = Years.years(12);
assertEquals(6, test.dividedBy(2).getYears());
assertEquals(12, test.getYears());
assertEquals(4, test.dividedBy(3).getYears());
assertEquals(3, test.dividedBy(4).getYears());
assertEquals(2, test.dividedBy(5... | 1 |
protected void toString2(StringBuffer sbuf) {
super.toString2(sbuf);
sbuf.append(",\n stack={");
printTypes(sbuf, stackTop, stackTypes);
sbuf.append("}, locals={");
printTypes(sbuf, numLocals, localsTypes);
sbuf.append("}, inputs={");
if (inputs != 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... | 8 |
public void actionPerformed(ActionEvent ev)
{
try
{
AreaFormacao objt = classeView();
if (obj == null)
{
long x = new AreaFormacaoDAO().inserir(objt);
objt.setId(x);
JOptionPane.showMessageDialog(null,
"Os dados foram inseridos com sucesso", "Sucesso", JOptionPane.INFORMATION_MESSAGE);
... | 3 |
@EventHandler
public void onItemSpawn(ItemSpawnEvent event)
{
SpoutBlock Block = (SpoutBlock) event.getLocation().getBlock();
Location loc = Block.getLocation();
loc.add(0, 1, 0);
SpoutBlock BlockAbove = (SpoutBlock) loc.getBlock();
CustomBlock CustomBlock = Block.getCustomBlock();
CustomBlock CustomBl... | 4 |
public void setLoadOnDemand() {
if (loadOnDemand)
return;
loadOnDemand = true;
if ((Main.stripping & Main.STRIP_UNREACH) == 0) {
String fullNamePrefix = (fullName.length() > 0) ? fullName + "."
: "";
// Load all classes and packages now, so they don't get stripped
Enumeration enum_ = ClassInfo.g... | 7 |
@Test
public void testOutputContacts() throws IOException {
cm.addFutureMeeting(contacts, new GregorianCalendar(2015,3,2));
cm.addNewPastMeeting(contacts, new GregorianCalendar(2013,5,3), "meeting");
cm.flush();
ObjectInputStream ois = new ObjectInputStream(new FileInputStream("contacts.txt"));
List inputDat... | 2 |
public void run() {
RUNNING = true;
try {
notifier.setTimeCounter(notifier.getTimeCounter() - 1);
if (notifier.getTimeCounter() <= 0 && notifier.getOutputQ().size() > 0) {
List<EventBean> batch = new ArrayList<EventBean>();
notifier.getOutputQ().... | 9 |
public void run() {
try {
while (this.dispatch()) {}
System.out.println("Finished queue");
} catch (IOException ex) {
Logger.getLogger(Queue.class.getName()).log(Level.SEVERE, null, ex);
}
} | 2 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((firstName == null) ? 0 : firstName.hashCode());
result = prime * result
+ ((lastName == null) ? 0 : lastName.hashCode());
result = prime * result
+ ((patronymic == null) ? 0 : patronymic.hashCode()... | 5 |
public StorageDevice(String device) throws DBusException {
this.device = device;
boolean isOpticalDisc = false;
String connectionInterface = null;
/*
* The Udisks2 interface "Drive" reports *all* USB drives as removable,
* even those where /sys/block/[device]/removable... | 9 |
public int GetBusCapacity()
{
//get the capacity of the bus
return busCapacity;
} | 0 |
public void sortColors(int[] nums) {
int red = 0, white = 0, blue = 0;
for (int i=0; i<nums.length; i++) {
int j = nums[i];
if (j == 0)
red = red+1;
if (j == 1)
white = white + 1;
if (j == 2)
blue = blue + 1;... | 7 |
public void addPatient(Patient newPatient){
if (this.nextPatient == null){
this.nextPatient = newPatient;
} else {
this.nextPatient.addPatient(newPatient);
}
} | 1 |
protected void moveMinecartOnRail(int i, int j, int k)
{
int id = worldObj.getBlockId(i, j, k);
if (!BlockRail.isRailBlock(id))
{
return;
}
float railMaxSpeed = ((BlockRail)Block.blocksList[id]).getRailMaxSpeed(worldObj, this, i, j, k);
double maxSpe... | 6 |
public String adding(String field, int min, int max)
{
String newField = "";
for(int i = 1; i <= field.length(); i++)
{
if(isNumber(field.substring(i - 1, i)))
{
newField = newField + field.substring(i - 1, i);
}
else
... | 8 |
public static void main(String[] args)
{
try {
PerlinGenerator perlin = new PerlinGenerator(new RNG(),100);
Display.setDisplayMode(new DisplayMode(1000,1000));
Display.create();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0, Display.getDisplayMode().getWidth(), Displa... | 5 |
public static void main(String args[]) {
try {
System.out.println("RS2 user client - release #" + 317);
if (args.length != 5) {
System.out.println("Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid");
return;
}
... | 6 |
public int getIntelligence(){
int value = 0;
for (Armor armor : armorList) {
if(armor != null) value += armor.getStats().getIntelligence();
}
return value;
} | 2 |
public void removeActionListener(ActionListener l) {
if(l == null) {
return;
}
actionListener = null;
} | 1 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public static IList<Integer> merge(IList<Integer> l1, IList<Integer> l2) {
// If one of the two lists is empty return the other one
if (l1.isempty())
return l2;
if (l2.isempty())
return l1;
IList<Integer> merged = new MLinkedList<Integer>();
// Get the first Node as node object from both lists
INode... | 7 |
public static void main(String[] args) {
if(true || true){
System.out.println(1);
}
if(true || false){
System.out.println(2);
}
if(false || true){
System.out.println(3);
}
if(false || false){
System.out.println(4);
}
} | 8 |
private int getNeighbours(int x, int y) {
int nNeighbours = 0;
for (int deltaX = -1; deltaX <= 1; deltaX++) {
int nextX = x + deltaX;
if (nextX == width) {
// nextX = 0;
continue;
} else if (nextX < 0) {
// nextX = width - 1;
continue;
}
for (int deltaY = -1; deltaY <= 1; deltaY++) {... | 9 |
public void testCoherence() {
LinkedElement<E> elemf = first;
LinkedElement<E> elemb = last;
for (int i = 1; i < total; i++) {
System.out.println(elemf + "\t| " + elemb);
elemf = elemf.getNext();
elemb = elemb.getPrev();
}
System.out.println(elemf + "\t| " + elemb);
System.out.println("LL Coheren... | 1 |
void prepareData() {
int numPoints = Math.min(MAX_DATA_POINTS, x.length);
if( x.length > numPoints ) subsample(numPoints);
// Find min & max values
minX = Double.MAX_VALUE;
maxX = Double.MIN_VALUE;
minY = Double.MAX_VALUE;
maxY = Double.MIN_VALUE;
for( int i = 0; (i < x.length) && (i < numPoints); i++... | 8 |
public static String getConstructorDescriptor(final Constructor<?> c) {
Class<?>[] parameters = c.getParameterTypes();
StringBuffer buf = new StringBuffer();
buf.append('(');
for (int i = 0; i < parameters.length; ++i) {
getDescriptor(buf, parameters[i]);
}
re... | 3 |
public byte read() {
int value = 0;
value |= pins[0].read() ? 1 << 0 : 0;
value |= pins[1].read() ? 1 << 1 : 0;
value |= pins[2].read() ? 1 << 2 : 0;
value |= pins[3].read() ? 1 << 3 : 0;
value |= pins[4].read() ? 1 << 4 : 0;
value |= p... | 8 |
private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
//Set window properties
this.setLocationRelativeTo(null);
this.setIconImage(Resources.getImageResource("icon.png").getImage());
popupDialog.setIconImage(Resources.getImageResource("icon.png"... | 6 |
@Override
public boolean equals(Object obj) {
if(obj == null || !(obj instanceof Triangle)) {
return false;
}
return this.side1.compareTo(((Triangle)obj).getSide1()) == 0
&& this.side2.compareTo(((Triangle)obj).getSide2()) == 0
&& this.side3.compareTo(((Triangle)obj).getSide3()) == 0;
} | 4 |
public static void main(String[] args) {
Config.load();
String driver = "com.mysql.jdbc.Driver";
try {
Class.forName(driver).newInstance();
conn = DriverManager.getConnection(Config.db_host+Config.db_db, Config.db_user, Config.db_password);
GameQu... | 4 |
protected boolean isLastSignMathExpression()
{
return lastCharacter().equals("*") || lastCharacter().equals("/")
|| lastCharacter().equals("+") || lastCharacter().equals("-")
|| lastCharacter().equals("^");
} | 4 |
public void destroy(String filename) throws Exception {
int fileDescriptorIndex = findIndexOfFileDescriptor(filename,true);
for(int i = 0; i < oft.index.length; i++) {
if (oft.index[i] == fileDescriptorIndex) {
System.out.println("Closing before destroying: " + i);
close(i);
}
}
FileDescripto... | 5 |
public ArrayList<Airport> searchAirport(String searchString) {
ArrayList<Airport> result = new ArrayList<Airport>();
for (Airport a : getAirports()) {
if (a.getCity().contains(searchString)) {
result.add(a);
} else if (a.getCountry().getCountry().contains(searchS... | 6 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public void play() {
long no = 1;
try {
while (true) {
if (1 == (no % 2)) {
JchessEntity jchess = new JchessEntity(data.generate(1));
Command cmd = player1.play(jchess);
if (cmd.isGiveup()) {
throw new CommandException(1, "܂B");
}
data.command(1, cmd);
} else {
Jches... | 5 |
public FieldAnalyzer(ClassAnalyzer cla, FieldInfo fd, ImportHandler i) {
clazz = cla;
imports = i;
modifiers = fd.getModifiers();
type = Type.tType(fd.getType());
fieldName = fd.getName();
constant = null;
this.isSynthetic = fd.isSynthetic();
this.isDeprecated = fd.isDeprecated();
if (fd.getConstant(... | 1 |
final void instrument(final Map<Integer, Set<Instrument>> instruments) {
int countTotal = 0;
for (final Set<Instrument> is : instruments.values()) {
for (final Instrument i : is) {
if (i.uniqueIdx()) {
final Integer countOld = this.countMap.get(i.type());
if (countOld == null) {
this.countMap... | 4 |
@Override
public String toString()
{
return "Item ID: \t" + iD + "\nName: \t\t" + name + "\nRange: \t\t" + minRange + "~" + maxRange + "\nAtt/M.Att: \t" + atk + "/" + mAtk + "\nAccuracy: \t" + acc + "\nCritical: \t" + crit + "\nSale Price: \t" + value;
} | 0 |
protected static String parseAsBooleanString(String[] args) {
return parseAsBoolean(args)? Argument.argTrue:Argument.argFalse;
} | 1 |
public static void readSort() {
try {
File file = new File("data/sort.txt");
if (file.isFile() && file.exists()) {
InputStreamReader read = new InputStreamReader(
new FileInputStream(file));
BufferedReader bufferedReader = new BufferedReader(read);
String lineTxt = null;
while ((lineTxt = ... | 4 |
public static int[] selection(int[] array) {
if(array==null || array.length==0) return array;
int minIndex;
int tmp;
int cnt=0;
for(int i=0;i<array.length;++i) {
minIndex = i;
for(int j=i;j<array.length;++j) {
cnt++;
if(array[minIndex]>array[j]) minIndex=j;
}
tmp = array[i];
array[i]=ar... | 5 |
public Prime(int n) {
max = n;
bitSet = new BitSet(max + 1);
if (max > 1){
bitSet.set(0, 2, false);
bitSet.set(2, max + 1, true);
for (long i = 2; i * i <= max; ++i) {
if (isPrime((int) i)) {
for (long j = i * i; j <= max; j += i) {
bitSet.set((int) j, false);... | 4 |
@Override
public Auction bid(String username, int itemId) {
searches.get(searches.get(itemId));
for(Auction auc : searches.values()){
if(searches.get(itemId) != null){
auc.setCurrentBid(auc.getCurrentBid()+1);
// auc.currentBid++;
auc.setOwner(username);
return auc;
}
}
return null;
} | 2 |
public CarBuilder setElectricBrakes(boolean electricBrakes) {
delegate.setElectricBrakes(electricBrakes);
return this;
} | 0 |
public static void main(String[] args) {
// Teste de repositorio
// Teste 1100912
} | 0 |
public Tile getTile(int i) {
try {
return tiles.get(i);
} catch (ArrayIndexOutOfBoundsException a) {}
return null;
} | 1 |
public Gameplay(AntBrain red, AntBrain black) {
this.world = new World();
this.random = new RandomInt();
this.rand = new Random();
this.redFood = 0;
this.blackFood = 0;
this.redAntBrain = red;
this.blackAntBrain = black;
this.ants = new ArrayList<>();
... | 0 |
public static String mksmiley(String str) {
synchronized (smileys) {
for (Pattern p : Config.smileys.keySet()) {
String res = Config.smileys.get(p);
str = p.matcher(str).replaceAll(res);
}
}
return str;
} | 1 |
private void scanContainer(DockEvent event, boolean drop) {
Point p = event.getMouseEvent().getPoint();
Rectangle compBounds = getBounds();
int distTop = p.y;
int distLeft = p.x;
int min = Math.min(distTop, distLeft);
int distRight = compBounds.width - p.x;
int distBottom = compBounds.height - p.y;
int ... | 7 |
public void run() {
updateScreen();
try {
while ((inputLine = in.readLine()) != null) {
if (inputLine.startsWith("DN")) {
// TODO
}
else if (inputLine.startsWith("D")) {
if (inputLine.equals("D"))
sim.setDisplayText("");
else
sim.setDisplayText(inputLine.substring(2, inp... | 9 |
public void removeImage(String name) {
if (IMAGE_URLS.containsKey(name)) IMAGE_URLS.remove(name);
if (IMAGES.containsKey(name)) IMAGES.remove(name);
} | 2 |
public JSONObject putOpt(String key, Object value) throws JSONException {
if (key != null && value != null) {
put(key, value);
}
return this;
} | 2 |
public Object getValueAt(int indiceLigne, int indiceColonne){
//System.out.println("ModeleListeVehicules::getValueAt()") ;
switch(indiceColonne){
case 0 :
return vehicules.get(indiceLigne).getImmatriculation() ;
case 1 :
return vehicules.get(indiceLigne).getModele() ;
case 2 :
return vehicule... | 5 |
public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int n = to.length();
char[] circle = new char[n];
/*
* First fill the circle buffer with as many characters as are in the
* to string. If we... | 9 |
public CallExpr(final Expr[] params, final MemberRef method, final Type type) {
super(type);
this.params = params;
this.method = method;
for (int i = 0; i < params.length; i++) {
params[i].setParent(this);
}
} | 1 |
public static void saveAs(Skin skin, String newName) {
if ((skin != null) && (model != null) && (newName != null) && !newName.equals("")) {
if (!model.saveAsSkinToDefaultDirectory(skin, newName)) {
showProblemMessage("Main.saveAs: Skin was not saved!");
}
} else {... | 5 |
protected static Ptg calcAnd( Ptg[] operands )
{
boolean b = true;
Ptg[] alloperands = PtgCalculator.getAllComponents( operands );
for( Ptg alloperand : alloperands )
{
if( alloperand instanceof PtgBool )
{
PtgBool bo = (PtgBool) alloperand;
Boolean bool = (Boolean) bo.getValue();
if( bool ==... | 4 |
public void addSlug(String slug) {
if (this.slugs == null) {
this.slugs = new ArrayList<String>();
this.slugs.add(slug);
} else {
this.slugs.add(slug);
}
} | 1 |
public void method390(int i, int j, String s, int k, int i1)
{
if(s == null)
return;
aRandom1498.setSeed(k);
int j1 = 192 + (aRandom1498.nextInt() & 0x1f);
i1 -= anInt1497;
for(int k1 = 0; k1 < s.length(); k1++)
if(s.charAt(k1) == '@' && k1 + 4 < s.length() && s.charAt(k1 + 4) == '@')
{
int l1 = getColorB... | 8 |
@SuppressWarnings({ "unchecked" })
private boolean load() {
log.info("Loading config file \"" + configDir.getPath(configPath) + "\"");
Object obj;
ObjectInputStream os = null;
try {
try {
os = new ObjectInputStream(configDir.readFile(configPath));
} catch (IOException e) {
log.err("... | 7 |
public Creature(int locx, int locy, String spriteFile) {
if(getSprite() == null){
try {
setSprite(ImageIO.read(new File(spriteFile)));
} catch (IOException e) {
e.printStackTrace();
}
}
x = locx;
y = locy;
stats = new Attributes(new int[]{5,5,5,5,5,5});
} | 2 |
public static boolean available(int port) {
ServerSocket ss = null;
try {
ss = new ServerSocket(port);
ss.setReuseAddress(true);
return true;
} catch (IOException e) {
} finally {
if (ss != null) {
try {
... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RecordSelectorNode other = (RecordSelectorNode) obj;
if (selector == null) {
... | 9 |
public boolean pawnCapturing(int x1, int y1, int x2, int y2, String color, Square newSquare)
{
boolean capture = false;
if(color == "White")
{
if( (((x2 == x1 + PAWN_MOVEMENT_RESTRICTION) || (x2 == x1 - PAWN_MOVEMENT_RESTRICTION)) && y2 == y1 + PAWN_MOVEMENT_RESTRICTION)
&& newSquare.getPiece().getPiec... | 9 |
private static void readFile() {
while (scanner.hasNext()) {
lines.insert(scanner.nextLine());
}
} | 1 |
public Boolean isDeleted() {
return isDeleted;
} | 0 |
public TotalPane() {
this.setLayout(new FlowLayout(FlowLayout.LEFT));
this.setBorder(new TitledBorder("总流量统计"));
container.setLayout(new GridLayout(3, 2));
container.add(totaltitle);
totalnum.setText("43349");
container.add(totalnum);
container.add(tcptitle);
... | 0 |
@Override
public String processCommand(String[] arguments)
throws SystemCommandException {
String electionID = arguments[0];
facade.setCurrentElection(electionID);
Election election = facade.getCurrentElection();
if (election == null || !election.getEID().equals(electionID)){
throw new Sy... | 2 |
@RequestMapping( ApplicationConstants.CREATE_USR)
@ResponseBody
public Object createUser(@RequestParam("name") String name,
@RequestParam("email") String email,
@RequestParam("password") String password) {
User user=new User();
Map<Object,String> errorMap=new HashMap<Object, String>();... | 7 |
public BufferedReader getBufferedReader() {
return _reader;
} | 0 |
private EndPoint getEndPoint() {
return endPoint;
} | 0 |
public int findMaxIndexDifferenceOrdering(int[] a) {
lMin = new int[a.length];
lMax = new int[a.length];
/* Keep track on MIN element until position i */
lMin[0] = a[0];
for (int i = 1; i < a.length; i++) {
if (a[i] < lMin[i - 1]) {
lMin[i] = a[i];
} else {
lMin[i] = lMin[i - 1];
}
}
/... | 8 |
public Transition transitionCreate(State from, State to) {
if (currentStep == TRANSITIONS_TO_SINGLE_FINAL) {
if (automaton.getFinalStates()[0] != to) {
JOptionPane.showMessageDialog(frame,
"Transitions must go to the new final state!",
"Bad Destination", JOptionPane.ERROR_MESSAGE);
return null;... | 6 |
public void solve(){
int timeoutCell = 40;
int timeoutGroup = 20;
ArrayList<Thread> allThreads = new ArrayList<Thread>();
for (int i=0; i < 81; i++){
int[] xy = indexToXY(i);
int x = xy[0];
int y = xy[1];
SudokuCellThread thread = ... | 9 |
private void startInputMonitor(){
while(noStopRequested){
try{
//this.processRegisteAndOps();// 处理通道监听注册和读取事件注册
int num = 0;
//this.selector.selectedKeys().clear();// 清除所有key
// Wait for an event one of the registered channels
num = this.selector.select(50);
//num = t... | 8 |
@Override
public void endTurn() {
if (cooldown > 0) {
cooldown--;
if (cooldown == 0) {
tile = startingPosition;
tile.addBomber(this);
}
//other end-of-turn actions not possible if still dead.
}
} | 2 |
private boolean jj_3R_73() {
if (jj_3R_49()) return true;
return false;
} | 1 |
private boolean handleWithoutQueueing(final DataTelegram telegram) {
if(_mode == HANDLE_CONFIG_RESPONCES_MODE) {
if(telegram.getType() == DataTelegram.APPLICATION_DATA_TELEGRAM_TYPE) {
ApplicationDataTelegram applicationDataTelegram = (ApplicationDataTelegram)telegram;
BaseSubscriptionInfo info = appli... | 7 |
public boolean meleeHitDetection(int enemyPosX, int enemyPosY){
double distance = Math.sqrt( (enemyPosX-posX)*(enemyPosX-posX) + (enemyPosY-posY)*(enemyPosY-posY) );
if(distance<50){//50=meleerange
return true;
}else{
return false;
}
} | 1 |
public static String getHost(String url){
if(url == null || url.length() == 0)
return "";
int doubleslash = url.indexOf("//");
if(doubleslash == -1)
doubleslash = 0;
else
doubleslash += 2;
int end = url.indexOf('/', doubleslash);
end = ... | 6 |
public Class getTypeClass() throws ClassNotFoundException {
if (topType.isClassType() || !bottomType.isValidType())
return topType.getTypeClass();
else
return bottomType.getTypeClass();
} | 2 |
public String getAlbumArtURL() {
String Albumarturl = null;
int length = getAlbumID().length();
switch (length) {
case 1:
Albumarturl = "http://image.melon.co.kr/cm/album/images/000/00/00" + getAlbumID().substring(0, 1) + "/" + getAlbumID() + "_500.jpg";
... | 7 |
public int getHandCount(){
int total=0;
for (int i=0;i<hand.size();i++)
total+=hand.get(i).getValue21();
return total;
} | 1 |
public static List<Element> mergeSort(List<Element> list) {
if (list.size() <= 1) {
return list;
}
// Make two arrays for range < pivot && range > pivot
List<Element> left = new ArrayList<Element>();
List<Element> right = new ArrayList<Element>();
int middle ... | 3 |
private void importFiles() {
TreeItem[] selection = tree.getSelection();
if (selection.length != 1)
return;
TreeItem cur = selection[0];
while (cur != null && !(cur.getData() instanceof Project))
cur = cur.getParentItem();
if (cur == null)
return;
Project proj = (Project) cur.getData();
FileD... | 9 |
public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception
{
HashMap<String, HashMap<String, Integer>> map =
new HashMap<String, HashMap<String,Integer>>();
BufferedReader reader = filePath.toLowerCase().endsWith("gz") ?
new BufferedReader(new InputStreamReader(
... | 6 |
public void spawnEnemies(){
int startPositionX = (rd.nextInt(Math.abs(settings.screenWidth - 40)));
int startPositionY = rd.nextInt(350);
int checker = rd.nextInt(2000);
if(checker < 10){
for(int i = 0; i < munchkins.length; i++){
if(munchkins[i] == null){
munchkins[i] = new Mun... | 6 |
public void keyReleased(KeyEvent e) {
} | 0 |
private void assignBlood(int x, int y){
if (x>9)
x = x-10;
else if (x<0)
x = 10+x;
if (y>9)
y = y-10;
else if (y<0)
y = 10+y;
if (grid[x][y]==RoomState.EMPTY)
grid[x][y] = RoomState.BLOOD;
else if (grid[x][y]==RoomState.SLIME)
grid[x][y] = RoomState.GOOP;
} | 6 |
public void parser() throws Exception {
Connection conn = JDBC.createConnection();
Ngram ngram;
int count = 0;
Token pre = new Token(null, null);
String preWordWithAttr = null;
// for (int i = 0; i < 10; i++)
// list = lexer.nextTokenList();
while (list != null) {
System.out.println("sss" + lis... | 7 |
synchronized public boolean accederAuTrain (Voyageurs voyageur, Train train) {
Iterator<Train> iteratrain = listeTrainQuai.iterator();
while (iteratrain.hasNext()) {
Train trainListe = iteratrain.next();
if (trainListe.equals(train)) {
train.embarquer(voyageur);... | 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.