text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void moveLeft() {
Boolean ableToMove = true;
for (Block b : currentTetromino.getBlocks()) {
if ((b.getMapIndexX() == 0)
|| (tetrisMap[b.getMapIndexX() - 1][b.getMapIndexY()] == 1)) {
ableToMove = false;
}
}
if (ableToMove) {
for (Block b : currentTetromino.getBlocks()) {
tetrisMap... | 6 |
public void setStatic(final boolean flag) {
int modifiers = classInfo.modifiers();
if (flag) {
modifiers |= Modifiers.STATIC;
} else {
modifiers &= ~Modifiers.STATIC;
}
classInfo.setModifiers(modifiers);
this.setDirty(true);
} | 1 |
@SuppressWarnings("unchecked")
public static ValuesReader createValuesReader(ValuesEntry valuesEntry){
Properties unisensProperties = UnisensProperties.getInstance().getProperties();
String readerClassName = unisensProperties.getProperty(Constants.VALUES_READER.replaceAll("format", valuesEntry.getFileFormat().getF... | 9 |
public void setErrorLog(LogFile errorLog) {this.errorLog = errorLog;} | 0 |
private boolean setupSQL() {
if (config.getSQLValue().equalsIgnoreCase("MySQL")) {
dop = new MySQLOptions(config.getHostname(), config.getPort(), config.getDatabase(), config.getUsername(), config.getPassword());
}
else if (config.getSQLValue().equalsIgnoreCase("SQLite")) {
dop = new SQLiteOptions(new Fi... | 4 |
public static boolean scrapeInfo(String url) {
String[][] table = null;
int firstRealRow = 0;
boolean firstRealRowInitialized = false;
try {
Document doc = Jsoup.connect(url).get();
Elements tableElements = doc.select("table");
Elements tableRowElemen... | 9 |
public void setH(float h) {
this.h = h;
} | 0 |
public void addNewScore(Score newScore) {
int newScorePoints = newScore.getPoints();
// jesli ostatni wynik jest lepszy, na pewno nie dodajemy
if (!isHighScore(newScorePoints)) {
return;
}
// wynik na pewno wyzszy niz ostatni
int i = 0;
// znajdywanie pierwszego mniejszego wyniku
while (newScorePoin... | 2 |
public BildanalysGUI(final IARDrone drone)
{
super("YADrone Paper Chase");
this.imageAnalyser = new ImageAnalyser();
this.drone = drone;
setSize(TagAlignment.IMAGE_WIDTH, TagAlignment.IMAGE_HEIGHT);
setVisible(true);
addWindowListener(new Window... | 4 |
public MainWindow(int sizeX, int sizeY) throws Exception{
if(!frameCount){
this.sizeX = 3*sizeX;
this.sizeY = 3*sizeY;
frameCount = true;
}
else throw new Exception("Apllication is already started!");
} | 1 |
@Override
public void update(GameContainer gc, int d) throws SlickException {
for (TileMapLayer tileMapLayer : getLayersOrderedByImportance()) {
tileMapLayer.update(gc, d);
}
} | 1 |
public CompareToIntOperator(Type type, boolean greaterOnNaN) {
super(Type.tInt, 0);
compareType = type;
this.allowsNaN = (type == Type.tFloat || type == Type.tDouble);
this.greaterOnNaN = greaterOnNaN;
initOperands(2);
} | 1 |
public void buildClassifier(Instances data) throws Exception{
//heuristic to avoid cross-validating the number of LogitBoost iterations
//at every node: build standalone logistic model and take its optimum number
//of iteration everywhere in the tree.
if (m_fastRegression && (m_fixedNumIterations < 0)) m_fixedNum... | 8 |
public void newBoard() {
hlight = new boolean[8][8];
int[] back = {2, 3, 4, 6, 5, 4, 3, 2};
int[] pawns = {1, 1, 1, 1, 1, 1, 1, 1};
Piece[] wback, wpawns, bpawns, bback;
wback = new Piece[8];
wpawns = new Piece[8];
bpawns = new Piece[8];
bback = new Piece... | 4 |
private float getFloat(byte[] b) {
float sample = 0.0f;
int ret = 0;
int length = b.length;
for (int i = 0; i < b.length; i++, length--) {
ret |= ((int) (b[i] & 0xFF) << ((((bigEndian) ? length : (i + 1)) * 8) - 8));
}
switch (sampleSize) {
case 1:... | 9 |
@Override
protected void finalize() throws Throwable {
try {
this.stop();
}
catch (Exception exc) {
}
finally {
super.finalize();
}
} | 1 |
public void setPan( float p )
{
// Make sure there is a pan control
if( panControl == null )
return;
float pan = p;
// make sure the value is valid (between -1 and 1)
if( pan < -1.0f )
pan = -1.0f;
if( pan > 1.0f )
pan = 1.0f;
... | 3 |
protected void startRelease(){
while(true){
if(this.count > this.singleConfig.getMinConns()){
Conn conn = this.pool.poll();
if(conn.getCurrentMinis() !=null && this.singleConfig.getMaxFreeInterval() != null && (System.currentTimeMillis() - conn.getCurrentMinis() > this.singleConfig.getMaxFreeInterval()))... | 6 |
public Properties load() {
final Properties settings = new Properties();
FileReader fr = null;
try {
fr = new FileReader(settingsFile);
settings.load(fr);
} catch (FileNotFoundException ignored) {
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fr != null) {
try {
fr.clos... | 4 |
public Packet unpackPacket(SocketAddress address, short id, byte[] data) {
if (!packets.containsKey(id)) {
throw new IllegalArgumentException("Received unknown packet with id: " + id);
}
Class<? extends Packet> packetClass = packets.get(id);
Constructor<? extends Packet> con... | 5 |
protected static Ptg calcComplex( Ptg[] operands )
{
if( operands.length < 2 )
{
return new PtgErr( PtgErr.ERROR_NULL );
}
debugOperands( operands, "Complex" );
int real = operands[0].getIntVal();
int imaginary = operands[1].getIntVal();
String suffix = "i";
if( operands.length > 2 )
{
suffix =... | 9 |
@Override
public void add(String word) {
internalStorage.add(word);
} | 0 |
public InvalidBEncodingException(String message) {
super(message);
} | 0 |
@EventHandler
public void WitchHunger(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.getWitchConfig().getDouble("Witch.Hunger.Dodg... | 6 |
public static void main(String[] args) throws Exception
{
String tmp = "abcdef";
char[] ch = new char[tmp.length()];
tmp.getChars(0, tmp.length(), ch,0);
CharArrayReader input = new CharArrayReader(ch);
int i;
while (-1 != (i = input.read()))
{
System.out.println((char)i);
}
} | 1 |
public void Open() throws IOException {
BufferedReader br = new BufferedReader(new FileReader(file));
String line = null;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
} | 1 |
@RequestMapping(value = "/createEntity", method = RequestMethod.POST)
public ModelAndView saveEntity(
final HttpServletRequest request,
final HttpServletResponse response,
@Valid @ModelAttribute("entityForm") final EntityForm entityForm,
final BindingResult bindingRes... | 1 |
private void scanArchives() throws IOException {
for(File temp : LOLFOLDER.listFiles())
{
ArrayList<RAFFile> list = new ArrayList<RAFFile>();
for(File file : temp.listFiles())
{
if(file.getName().endsWith(".raf"))
{
... | 3 |
public SimpleThread() {
super(Integer.toString(++threadCount));
start();
} | 0 |
private void splitIrreducibleLoops() {
db(" Splitting irreducible loops");
final List removeEdges = new LinkedList();
Iterator iter = nodes().iterator();
// Iterate over all the blocks in this cfg. If a block could be
// the header of a reducible loop (i.e. it is the target of a
// "reducible backedge",... | 7 |
public boolean isCaveBG(int blockTypeId) {
boolean isCave = false;
if(blockTypeId > 0) {
BlockType bt = blockManager.getBlockTypeById((short)blockTypeId);
if(bt != null && bt.isBackground()) {
isCave = true;
}
}
return isCave;
} | 3 |
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((address == null) ? 0 : address.hashCode());
result = prime * result + ((age == null) ? 0 : age.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
} | 3 |
public double computePartialTruth(QueryIterator query) {
{ IncrementalPartialMatch self = this;
{ ControlFrame baseframe = query.baseControlFrame;
PartialMatchFrame partialmatchframe = query.partialMatchStrategy;
FloatWrapper minimumscore = ((FloatWrapper)(query.options.lookup(Logic.KWD_MINIM... | 7 |
public EasyDate beginOf(int field) {
switch (field) {
case Calendar.YEAR:
calendar.set(Calendar.MONTH, 0);
case Calendar.MONTH:
calendar.set(Calendar.DAY_OF_MONTH, 1);
case Calendar.DAY_OF_MONTH:
calendar.set(Calendar.HOUR_OF_DAY, 0);
case Calendar.HOUR_OF_DAY:
calendar.set(Calendar.MINUTE, 0);
... | 6 |
public static void loadSpawns() throws SQLException{
@SuppressWarnings("unused")
boolean newspawn = SpawnConfig.newspawn;
ResultSet res =SQLManager.sqlQuery("SELECT * FROM BungeeSpawns WHERE spawnname='ProxySpawn'");
while( res.next() ){
ProxySpawn = new Location(res.getString("server"), res.getString("world... | 2 |
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerDeath(PlayerDeathEvent event)
{
if(plugin.playerIsAffected(event.getEntity().getPlayer())) // TODO this will trigger, regardless of the death cause. Should be checking if player died from coldDamage!
{
... | 2 |
private void doCheckUser(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
String userName = StringUtil.toString(request.getParameter("userName"));
ObjectMapper mapper = new ObjectMapper();
Map result = new HashMap();
try {
User ... | 2 |
public static void setPointLight(PointLight[] pointLights)
{
if(pointLights.length > MAX_POINT_LIGHTS)
{
System.err.println("Error: You passed in too many point lights. Max allowed is " + MAX_POINT_LIGHTS + ", you passed in " + pointLights.length);
new Exception().printStackTrace();
System.exit(1);
}
... | 1 |
public static void main(String[] args) {
/* Set up configuration */
Utility.configure();
jobTrackerComm =
new Communication(Utility.JOBTRACKER.ipAddress, Utility.JOBTRACKER.port);
/* Register this task tracker */
System.out.println("Registering on job tracker...");
Message msg = new Message(Utility.TA... | 9 |
protected void handleSwitchEvent(SelectionKey key)
{
SocketChannel channel = (SocketChannel) key.channel();
OFSwitch sw = _channel2Switch.get(channel);
OFMessageAsyncStream stream = sw.getStream();
try
{
// read events from the switches
if(key.isReadab... | 9 |
private void btnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEliminarActionPerformed
try{
int numero = Integer.parseInt(txt1.getText());
if(numero>0){
Statement consulta = conexion();
try{
Resul... | 4 |
public void testgetPrefixWordsBadIndices() {
Lexicon lex = new Lexicon(true, false, false, false, false, 0.0, 0.0, null);
try {
lex.getPrefixWords(iUtt, -1);
fail("Should not allow negative indices");
}
catch (RuntimeException e) {}
try {
lex.getPrefixWords(iUtt, 1);
fail("Should not allow too hig... | 2 |
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
_hashCode += getBatchFileId();
_hashCode += getBatchId();
if (getContent() != null) {
for (int i=0;
i<java.lan... | 9 |
public void register(TravelTrip travelTrip){
em.persist(travelTrip);
return;
} | 0 |
public void CheckWildrange(int pcombat)
{
if(((combat + WildyLevel >= pcombat) && (pcombat >= combat)) || ((combat - WildyLevel <= pcombat) && (pcombat <= combat)))
{
InWildrange = true;
}
else
{
InWildrange = false;
}
} | 4 |
private void btn_calculateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_calculateActionPerformed
// declare the two main variables used in exponuntiation
float base = Float.parseFloat(txt_base.getText());
float exponent = Float.parseFloat(txt_exponent.getText());
txt_outpu... | 9 |
public getAvailableTimeSlot()
{
this.addParamConstraint("aUserId");
} | 0 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 7 |
private static String whoAmI(Registry registry) throws AccessException, RemoteException {
String name = null;
String[] boundServers = registry.list();
if (boundServers == null || boundServers.length == 0)
{
//Just return 1 if there are no other 0's
return String.valueOf(1);
}
ArrayList<Integer> ... | 8 |
public List<Integer> getRow(int rowIndex) {
if (rowIndex == 0) {
return Arrays.asList(1);
}
int[] odd = new int[rowIndex / 2 + 1];
int[] even = new int[rowIndex / 2 + 1];
odd[0] = 1;
even[0] = 1;
for (int i = 0; i < rowIndex / 2; i++) {
for (int j = 1; j < i + 1; j++) {
even[j] = odd[j - 1] + o... | 8 |
public boolean onCommand (CommandSender sender, Command cmd, String lable, String[] args)
{
Player p = (Player) sender;
PluginDescriptionFile pdf = this.getDescription();
try
{
if(sender instanceof Player)
{
if(lable.equalsIgnoreCase("gp"))
{
if (args[0].toLowerCase().equalsIgnoreCase("re... | 8 |
public static void testSet() {
SeqnoRange range=new SeqnoRange(10, 15);
range.set(11, 12, 13, 14);
System.out.println("range=" + print(range));
assert range.size() == 6;
assert range.getNumberOfReceivedMessages() == 4;
assert range.getNumberOfMissingMessages() == 2;
... | 7 |
public static boolean insertCurriculum(UserBean bean){
Statement stmt = null;
Curriculum curriculum=((AlumnoBean)bean).getCurriculum(); // OJO CON ESTA LINEA, DEBERIA FUNCIONAR
String query= "Insert into curriculums values ("+curriculum.getId()+","+bean.getRut()+",NOW())";
System.out.println(query);... | 9 |
private ArrayList<Integer> generateActions(LongBoard state) {
ArrayList<Integer> result = new ArrayList<Integer>();
int middle = x/2;
//TODO choose random when x is even
if (state.isPlayable(middle)) {
result.add(middle);
}
for (int i=1; i <= x/2; i++) {
... | 6 |
public Player(float x, float y,GBGame game, TiledMapTileLayer layer) {
this.game = game;
this.collisionLayer = layer;
// Load up the stuff
try {
currentSprite = new Sprite(Art.player[0][0]);
} catch (Exception e) {
System.out.println("SPRITE NOT LOADING! TRY AGAIN!");
}
bounds = new Rectangle();
... | 3 |
public DirectedEulerianCycle(Digraph G) {
// create local view of adjacency lists
Iterator<Integer>[] adj = (Iterator<Integer>[]) new Iterator[G.V()];
for (int v = 0; v < G.V(); v++)
adj[v] = G.adj(v).iterator();
// find vertex with nonzero degree as start of potential Eule... | 8 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final TabelOutletChain other = (TabelOutletChain) obj;
if (!Objects.equals(this.kodeChain, other.kodeChain)) {
... | 3 |
public static Object escape(Object original) {
if (original instanceof Character) {
char u = (char) ((Character)original);
int idx = "\b\t\n\f\r\"\'\\".indexOf(u);
if (idx >= 0)
return "\\"+"btnfr\"\'\\".charAt(idx);
if (u < 32)
re... | 8 |
@Override
public void broadcast(final FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
FacesContext context = getFacesContext();
if (!(event instanceof ActionEvent)) {
throw new IllegalArgumentException();
}
// OPEN QUESTION: should w... | 9 |
private int getStep() {
LayoutManager layout = getLayout();
if (layout instanceof ColumnLayout) {
return ((ColumnLayout) layout).getColumns();
} else if (layout instanceof FlexLayout && ((FlexLayout) layout).getRootCell() instanceof FlexGrid) {
int columns = ((FlexGrid) ((FlexLayout) layout).getRootCell()).... | 3 |
private StringBuilder getGallery() throws ClassNotFoundException, SQLException {
StringBuilder sb = new StringBuilder();
Reference r = References.createReference(this.id);
List<Gallery> galleries;
galleries = r.getGalleries();
if (galleries.size() > 0) {
sb.append("... | 8 |
private void showGezin(Gezin gezin) {
// todo opgave 3
if (gezin == null) {
clearTabGezin();
} else {
tfGezinNr.setText(gezin.getNr() + "");
tfOuder1.setText(gezin.getOuder1().standaardgegevens());
if(gezin.getOuder2() != null)
tfOu... | 4 |
private String chooseFile()
{
if (chooser.showDialog(org.analyse.main.Main.analyseFrame, null) == JFileChooser.APPROVE_OPTION) {
return chooser.getSelectedFile().getAbsolutePath();
}
return null;
} | 1 |
public void copySources(HashMap<String, Source> srcMap) {
if (srcMap == null)
return;
Set<String> keys = srcMap.keySet();
Iterator<String> iter = keys.iterator();
String sourcename;
Source srcData;
// remove any existing sources before starting:
sourceMap.clear();
// loop through and copy all the s... | 3 |
final boolean method810(int i, int i_2_, boolean bool, GraphicsToolkit graphicstoolkit) {
anInt11104++;
if (aNpcDefinition11122 == null || !method875(131072, true, graphicstoolkit)) {
return false;
}
Class336 class336 = graphicstoolkit.A();
int i_3_ = aClass99_10893.method1086(16383);
class336.method3860... | 9 |
public void setStartCity(String startCity) {
this.startCity = startCity;
} | 0 |
private void isCorner() {
if (localMap.getPosition().getCorridor(0).getWeight() == 1
&& (localMap.getPosition().getCorridor(1).getWeight() == 1 || localMap
.getPosition().getCorridor(3).getWeight() == 1)) {
corner = true;
}
else if (localMap.getPosition().getCorridor(2).getWeight() == 1
&& (loca... | 6 |
@Override
public void broadcast(String flName, TreeMap<Long, String> mapValues)
throws RemoteException {
if (!fileLock.containsKey(flName))
fileLock.put(flName, new ReentrantReadWriteLock());
// lock
fileLock.get(flName).writeLock().lock();
try {
System.out.println("Broadcasting to : " + replicaPath... | 3 |
public void run(double frac) {
TupleSet ts = m_vis.getFocusGroup(Visualization.FOCUS_ITEMS);
counter = (counter + 1) % 9;
if (ts.getTupleCount() == 0)
return;
if (counter == 8) {
int xbias = 0, ybias = 0;
switch (m_orientation) {
case Constants.ORIENT_LEFT_RIGHT:
xbias = m_bias;
... | 6 |
public void sendReplyFlooding(){ //Dispara o flooding das respostas dos nodos com papel BORDER e RELAY
if ((getRole() == NodeRoleOldBetEtx.BORDER) ||
(getRole() == NodeRoleOldBetEtx.RELAY)) {
this.setColor(Color.GRAY);
//Pack pkt = new Pack(this.hops, this.pathsToSink, this.ID, 1, this.sBet, TypeMessage.BOR... | 2 |
@Test
public void testReceiveMultipleWithBound() {
int noOfMessages = 5;
int queueSize = 2;
try {
consumer = new AbstractMessageConsumer(mockTopic, queueSize) {
};
assertNotNull(mockTopic.getTopicSubscriber());
HashSet<Message> messages = new HashSet<Message>();
for (int i = 0; i < noOfMessages; ... | 6 |
public void removeRestriction(String restrictionIdentifier)
{
for(Restriction r: restrictions){
if(r.getIdentifier().equals(identifier))
restrictions.remove(r);
}
} | 2 |
public static Color getColor(int c, int r) {
int x = (int) (firstPick.getX() + c * (cellWidth + cellPadding));
int y = (int) (firstPick.getY() - r * (cellWidth + cellPadding));
return Main.fenrir.getColor(x, y);
} | 0 |
@Override
public boolean equals(Object other) {
if (other == this) { return true; }
if (!(other instanceof Bearing)) { return false; }
return this.getBearingInDecimalDegrees().equals(((Bearing) other).getBearingInDecimalDegrees());
} | 2 |
public String getMsgID() {
return MsgID;
} | 0 |
public LocQueue() {
init();
} | 0 |
@Override
public void unInvoke()
{
if((trapType()==Trap.TRAP_PIT_BLADE)
&&(affected instanceof Exit)
&&(myPit!=null)
&&(canBeUninvoked())
&&(myPitUp!=null))
{
final Room R=myPitUp.getRoomInDir(Directions.UP);
if((R!=null)&&(R.getRoomInDir(Directions.DOWN)==myPitUp))
{
R.rawDoors()[Directions.... | 9 |
@Override
public Success<Import> parse(String s, int p) {
// Parse the "import" keyword.
Success<String> resImport = IdentifierParser.singleton.parse(s, p);
if (resImport == null || !resImport.value.equals("import"))
return null;
p = resImport.rem;
p = optWS(s, p)... | 7 |
private Status.TermVectorStatus testTermVectors(SegmentInfo info, SegmentReader reader, NumberFormat format) {
final Status.TermVectorStatus status = new Status.TermVectorStatus();
try {
if (infoStream != null) {
infoStream.print(" test: term vectors........");
}
for (int j = ... | 6 |
@Override
public boolean onCommand(final CommandSender sender, Command cmd, String label, String[] args) {
if (label.equalsIgnoreCase("oreevent")) {
if (sender instanceof Player) {
plugin.reloadConfig();
if (plugin.getConfig().getString("orex") == null) {
... | 9 |
public boolean move(Location from, Location to) {
if (to != Location.B3 && to != Location.R3) {
System.out.println("GAME: moving from " + from + " to " + to);
if ( from == loneRiderHere1 ) {
loneRiderHere1 = to;
} else if ( from == loneRiderHere2 ) {
loneRiderHere2 = to;
}... | 6 |
public Capteur(int date1, int id1, int taille1) {
super(date1, id1, taille1);
} | 0 |
public static String getSelectString(Dictionary dictionary, Class c){
StringBuilder stringBuilder = new StringBuilder();
ArrayList <Dictionary> dictionaries = null;
Field field;
Object val = new Object();
try {
field = c.getField("TABLE");
val = field.get(... | 5 |
private TreeNode successor(TreeNode predecessorNode) {
TreeNode successorNode = null;
if (predecessorNode.left != null) {
successorNode = predecessorNode.left;
while (successorNode.right != null) {
successorNode = successorNode.right;
}
} else {
successorNode = predecessorNode.parent;
while (s... | 4 |
protected SSLServerSocketFactory createFactory()
throws Exception
{
_keystore = System.getProperty( KEYSTORE_PROPERTY,_keystore);
log.info(KEYSTORE_PROPERTY+"="+_keystore);
if (_password==null)
_password = Password.getPassword(PASSWORD_PROPERTY,null,null);
... | 8 |
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
... | 6 |
* @param input
*/
public static void writeHtmlEscapingUrlSpecialCharacters(PrintableStringWriter stream, String input) {
{ char ch = Stella.NULL_CHARACTER;
String vector000 = input;
int index000 = 0;
int length000 = vector000.length();
for (;index000 < length000; index000 = index000 + ... | 8 |
public void addSettingsGuiListener(SettingsGuiListener listener_) {
settingsGuiListener.add(listener_);
} | 0 |
public static void buildGroup(ContactGroupEntry group,
List<String> parameters) {
for (String string : parameters) {
if (!string.startsWith("--")) {
throw new IllegalArgumentException("unknown argument: " + string);
}
String param = string.substring(2);
String params[] = param... | 4 |
public Link<T> getUnvisitedLink(Summit<T> summit) {
for (Link<T> link : links) {
if ( link.visited==false && link.start.label.equals(summit.label) ) {
link.visited=true;
return link;
}
}
return null;
} | 3 |
void checkNewVersion(Config config) {
// Download command checks for versions, no need to do it twice
if ((config != null) && !command.equalsIgnoreCase("download")) {
// Check if a new version is available
VersionCheck versionCheck = VersionCheck.version(SnpEff.SOFTWARE_NAME, SnpEff.VERSION_SHORT, config.getV... | 4 |
public FixtureBuilder() {
fileParser = new FileParser(KEYS);
List<File> files = FileUtils.getFiles("fixtures/");
for (File file : files) {
try {
Fixture fixture = buildFixture((FileUtils.readFile(file)));
String missingKey = FileValidator.isValid(fixture, REQUIRED_KEYS);
if (missingKey == null) {
... | 8 |
@Override
public void mouseClicked(MouseEvent e) {
if (PlayerTypes.values()[raceSelectionPointer].getColors() != null)
for (int i = 0; i < PlayerTypes.values()[raceSelectionPointer].getColors().length; i++)
if (new Rectangle(getWidth() / 2 - getWidth() / 8 + getWidth() / 32 + i % 2 * getWidth() / 8,
get... | 3 |
private boolean bfs() {
Queue<Integer> q = new ArrayDeque<Integer>();
//initialize distances
for(int i = 1; i < n; i++) {
if(match[i] == NIL) {
dist[i] = 0;
q.add(i);
} else
dist[i] = INF;
}
dist[NIL] = INF;
while(!q.isEmpty()) {
int u = q.poll();
if(DEBUG) System.out.format... | 8 |
private void onFirstStatChanged(Stat newStat) {
for (StatProcessorListener listener: listeners) {
listener.onFirstStat(newStat);
}
} | 1 |
@POST
@Path("/Login")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response Login (UserResponse data)
{
if (data == null
|| data.password == null
|| data.username == null)
return Response
.status(400) //... | 7 |
private int readAndCheckInput(int low, int high) throws IOException {
BufferedReader move = new BufferedReader(new InputStreamReader(System.in));
boolean bool;
int in = 0;
do {
try {
in = Integer.parseInt(move.readLine());
bool = false;
... | 4 |
public void addComponent(Component component, Location location){
switch(location){
case TOP:
add(component,BorderLayout.PAGE_START);
components.add("TopComponent", component);
break;
case BOTTOM:
if(components.get("TopComponent") != null){
remove(components.get("TopComponent"));
components... | 8 |
public void setStartUrl(String startUrl) {
this.startUrl = startUrl;
} | 0 |
static void test2()
{
try
{
Reader in = new StringReader(
"<INPUT TYPE=HIDDEN NAME=\"MfcISAPICommand\" VALUE = \"MailBox\">\n"+
"<applet code=\"htmlstreamer.class\" codebase=\"/classes/demo/parser\"\nalign=\"baseline\" width=\"500\" height=\"800\"\nid=\"htmlstreamer\">\n"+
"<!DOCTYPE HTML PUBLIC \"-... | 7 |
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.