method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
23f9b2f8-425b-4a05-987f-2a8194d643a0 | 1 | private QuitCommand() {
super(Platform.isMacintosh() ? QUIT : EXIT, CMD_QUIT, KeyEvent.VK_Q);
} |
f2c43502-4b9b-40d6-a5a7-2fcd6cbd9837 | 7 | private boolean updateStateKeywordJump(List<Keyword> keywords) {
if (keywords == null || keywords.isEmpty()) {
return false;
}
//Check if all keywords pointing to same state, in one of their references (takes first state, if more than one state)
else {
/* boolean sameRef = false;
Enum<?> refMax = null;
for (... |
da257340-b04e-4964-9988-9c962387e7e4 | 1 | public List<String> getValues() {
List<String> valuesArray = new ArrayList<String>();
iter = bucket.iterator();
while(iter.hasNext()) {
valuesArray.add(iter.next().getValue());
}
return valuesArray;
} |
24239eec-a1f2-4ffc-a2ca-703d7d0f1a2b | 4 | private static <T extends Comparable<? super T>> void insertionSortIterative(ArrayList<T> list, int start, int end)
{
int j;
for(int i = start; i <= end; i++){
T val = list.get(i);
for(j = i; j>start && val.compareTo(list.get(j-1)) < 0; j--){
list.set(j, list.get(j-1));
}
list.set(j, val);
}
} |
875e455a-ad8e-4f9c-9106-9c6568a5a2d3 | 7 | public int divide(int dividend, int divisor) {
int cnt = 0;
boolean dividendN = false, divisorN = false;
if (dividend < 0) {
dividendN = true;
dividend *= -1;
}
if (divisor < 0) {
divisorN = true;
divisor *= -1;
}
wh... |
9b1d9bef-eae7-485a-8f12-1f7043b662be | 5 | public static void setPlantAmount(int plantType, int amount)
throws Exception {
if (amount < 0) {
throw new Exception("The amount is not valid");
}
if (plantType == GREEN_PLANT) {
GREEN_PLANT_AMOUNT = amount;
}
if (plantType == RED_PLANT) {
RED_PLANT_AMOUNT = amount;
}
if (plantType == YELLOW_PL... |
dfa5947d-2125-4a0f-9cf5-7db519aa0cc6 | 3 | protected void fire() {
// While the Invaders themselves will not fire while the game is paused due to how their random firing
// implementation works, the cannon can still be fired unless we specifically disallow it here.
if(SpaceInvaders.paused) {
return;
}
if(timeS... |
792de983-82cf-4b58-a1a3-0debe5efc08c | 7 | protected String printState(int pCurrentState) {
switch (pCurrentState) {
case STATE_IDLE:
return "STATE_IDLE";
case STATE_WAIT_FOR_HELLO:
return "STATE_WAIT_FOR_HELLO";
case STATE_WAIT_FOR_COMMAND:
return "STATE_WAIT_FOR_COMMAN... |
a23fcd44-bcf8-4ff0-93fd-4f7b384fa2ea | 9 | @Override
public Message decodeMessage(final ByteBuffer buffer) {
int position = buffer.position();
if (buffer.get() == BINARY_MESSAGE_PREFIX) {
byte[] name = new byte[buffer.getShort()];
buffer.get(name);
String s = null;
try {
s = new String(name, "UTF-8");
} catch (UnsupportedEncodingExc... |
dc8cc81c-2278-4245-8a1a-07c75f471f64 | 2 | public Collection<Record> getRecordsFeaturingGroop(String groopName, int groopNumber)
throws SQLException
{
List<Record> featuring = new LinkedList<Record>();
String sql = "SELECT DISTINCT records.recordnumber from records,track,lineupset,lineup WHERE records.recordnumber = track.recordnumber A... |
30c85f4e-ef19-43b6-858f-302d513f229f | 8 | private BinaryNode<K> search2(K pk){
// System.out.println("Ahora aqui");
BinaryNode<K> current = this.root;
BinaryNode<K> previous = new BinaryNode<K>();
while(current.getData() != pk){
//Conditions of insert
if((Integer)pk > (Integer)current.getData() &&
cur... |
777d5555-eac8-4a0d-bef5-31538b8368ec | 1 | boolean isEven(){
if(value%2 == 0){
return true;
}
else{
return false;
}
} |
ff8b6578-d96a-4234-96ca-45672dfa38f5 | 7 | private int calculateScore(int prevLastWordIndex, int currentLastWordIndex) {
if (scores[prevLastWordIndex][currentLastWordIndex] != INVALID_SCORE)
return scores[prevLastWordIndex][currentLastWordIndex];
String prevWord = myWords[prevLastWordIndex];
String currentWord = myWords[currentLastWordIndex];
int sco... |
9300d291-1433-47a1-9780-1f07147a77cb | 7 | @Override
public final void sendDestroyData(final MapleClient client) {
if (target.getId() == client.getPlayer().getMapId() || owner == client.getPlayer() || owner.getParty() != null && owner.getParty().containsMembers(new MaplePartyCharacter(client.getPlayer()))) {
if (owner.getParty() != null && (owner == c... |
56b2bf57-ec41-4166-85f6-2255227a623b | 4 | @Override
public List<Ingredient> retrieveAllIngredients() throws DataStoreException {
if ( isIngredientCacheValid ){
return ingredientCache;
}
List<Ingredient> ingredients = new LinkedList<>();
try ( Connection conn = getConnection();
ResultSet rs = e... |
83f361be-8b81-42f4-9f5c-65a9c3b4a65c | 2 | @Override
public void parseArgs(String[] args) {
if (args.length < 5) usage(null);
int i = 0;
reactomeDir = args[i++];
geneIdsFile = args[i++];
gtexDir = args[i++];
gtexSamples = args[i++];
gtexData = args[i++];
if (args.length > i) nameMatch = args[i++];
} |
660260c5-6757-4cc6-955f-54327da04484 | 8 | static public int[] convolve(int[] bufferData ,int h ,int w,float[][] kernel){
int[] tempData = new int[bufferData.length];
int kh = kernel.length / 2;
int kw = kernel[0].length / 2;
int i=0,j=0,n=0,m=0;
for (i = 0; i < h; i++) {
for (j = 0; j < w; j++) {
int... |
bee56555-e06b-4acc-929e-4dd443ae0689 | 8 | @SuppressWarnings("unchecked")
private static Boolean runQueueProcessors(String fileName, int queueProcessorCount, String firstCity, String secondCity, Boolean displayTiming) {
List<FutureTask<Void>> futures = new ArrayList<>();
ExecutorService executor = Executors.newFixedThreadPool(queueProcessorCoun... |
2a8e27c0-2bb8-41f8-a208-f0f602a3c3f4 | 2 | public void visitOuterClass(final String owner, final String name,
final String desc) {
AttributesImpl att = new AttributesImpl();
att.addAttribute("", "owner", "owner", "", owner);
if (name != null) {
att.addAttribute("", "name", "name", "", name);
}
if (desc != null) {
att.addAttribute("", "desc", ... |
85171cc1-1452-4f9f-b3dd-2c73e4e18472 | 0 | public void setDescription(String description) {
this.description = description;
} |
499d0873-801a-4a5e-b931-2720b36c9852 | 6 | private static void QueueWithArrayMenu(QueueWithArray<Integer> QueueWithArray){
System.out.println("What do you want to do ?");
System.out.println("1) Dequeue");
System.out.println("2) Enqueue");
System.out.println("3) Print");
System.out.println("Enter your option");
try{
choose = in.nextInt();
swi... |
34bc3014-f7c0-4b92-99dd-0722c4edd619 | 8 | public static ChatPayload createPayload(PacketType type, byte[] packedPayload) {
// TODO: There may be a better way to do this...
switch (type) {
case CHAT_MESSAGE:
return new ChatMessage(packedPayload);
case MANIFEST:
return new ManifestMessage(packedPayload);
... |
1d845412-78fc-4b6f-9102-93c13c7832cb | 2 | public static void readStimuli() {
File stimFile = new File(Options.STIM_FILE);
stimStrings = new ArrayList<String[]>();
try {
BufferedReader fReader =
new BufferedReader(
new InputStreamReader(
new FileInputStream(stimFile), "UTF-8"));
String line = fReader.readLine(... |
983132c6-d643-44b1-8263-9d006463031c | 1 | private String getUniqueVariable() {
char[] ch = new char[1];
ch[0] = (char) ('A' + UNIQUE_ID);
UNIQUE_ID++;
if (('A' + UNIQUE_ID) == 'S')
UNIQUE_ID++;
return new String(ch);
} |
b861b4a5-0d2a-4f07-92f0-48de9b111829 | 7 | public static Item getSomething(MOB mob, boolean cursedOnly)
{
final Vector<Item> good=new Vector<Item>();
final Vector<Item> great=new Vector<Item>();
Item target=null;
for(int i=0;i<mob.numItems();i++)
{
final Item I=mob.getItem(i);
if((I.container()==null)&&((!cursedOnly)||(isCursed(I))))
if(I.a... |
1b695aae-befe-4dd9-b22b-fe6d82eef926 | 1 | public void moveAction(Direction moveDirection) throws InvalidActionException {
getActivePlayer().move(moveDirection);
getGrid().getEventManager().sendEvent(new Event(EventType.END_ACTION, getActivePlayer()));
if (getActivePlayer().getRemainingActions() <= 0)
activePlayerEndTurn();
} |
d8c26999-0333-4d2d-bfb2-b0025524bd1a | 4 | public void modifyCity(City cit) {
Connection con = null;
PreparedStatement pstmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
dbCo... |
663e28d3-2011-43f0-9fc7-57076e3779bf | 2 | public static int countTeamBlocksDestroyed(TeamMap team) {
int blocks = 0;
for (Session member : HyperPVP.getGameSessions().values()) {
if (member.getTeam() == team) {
blocks += member.getMonumentBlocks().size();
}
}
return blocks;
} |
84b94b0f-16ba-457c-9954-f31ccce0b1a1 | 3 | private void searchElement(K key) {
// The search variables
_searchHolder = null;
_searchInnerIndex = -1;
_searchBucketIndex = hash(key); // Here is magic
if (buckets.getElement(_searchBucketIndex) == null) {
// The key is not associated with any value
... |
5729ad4a-93a3-4c49-81a8-b87a61882c24 | 1 | public static void DisplayMoveSeq(Vector<Move> moveSeq){
for(Move m:moveSeq){
m.display();
System.out.print(", ");
}
System.out.println();
} |
abde380c-80c4-4a04-9f47-be2321f74399 | 8 | final r ba(r var_r) {
try {
anInt5562++;
if ((anInt5529 ^ 0xffffffff) == -1)
return null;
if (!aBoolean5527)
method692((byte) -123);
int i;
int i_165_;
if ((((OpenGlToolkit) aHa_Sub2_5598).anInt7772 ^ 0xffffffff) < -1) {
i = (-(aShort5629 * ((OpenGlToolkit) aHa_Sub2_5598).anInt7772
... |
0d1b7022-ebbf-46e0-bda2-037db7a78044 | 8 | public TypeBinding postConversionType(Scope scope) {
TypeBinding convertedType = this.resolvedType;
int runtimeType = (this.implicitConversion & TypeIds.IMPLICIT_CONVERSION_MASK) >> 4;
switch (runtimeType) {
case T_boolean :
convertedType = TypeBinding.BOOLEAN;
break;
case T_short :
convertedTyp... |
631e0a33-a169-469a-a17a-84b43d7e88f4 | 5 | private Reaction getSimmilarReaction(List<Reaction> reactionList, Reaction selectedReaction) {
Random randomGenerator = new Random();
Reaction reaction = null;
int i = 0;
do {
i++;
reaction = reactionList.get(randomGenerator.nextInt(reactionList.size()));
} while (!reaction.getPattern().isSimmilar(selec... |
7f9f5f35-18ed-4685-8ee3-11a9e6cb4db2 | 2 | public boolean login(String account_name, String password)
{
connection.sendTCP(new LoginRequest(account_name, password));
// Wait for an answer. If none arrives, return false.
long start = System.currentTimeMillis();
while(!loggedIn)
{
long waitedFor = System.currentTimeMillis()-start;
if(waitedFo... |
96445495-bc88-4145-8f28-060dcc88e947 | 2 | public void addAllNeighbors(Point current) {
for (Edge e : this.tree) {
if (e.contains(current)) {
this.toDo.add(e);
}
}
} |
6b075286-fd1c-4fde-a2ad-9f65402d1a7f | 9 | protected void oneTestRecall() {
System.out.println("Seq_ptr=" + this.seq_ptr);
curSeq.removeAllElements();
curPSeq.removeAllElements();
int selidx = ((Integer) seqStartIndexes.get(this.seq_ptr)).intValue();
int epiLen = ((Integer) seqLenIndexes.get(this.seq_ptr)).intValue();
... |
98990086-e0b7-4c3c-bd64-03d922dffc8e | 8 | public static void startupHttpServerImpl() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/HTTP/TOMCAT", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CON... |
44ef0ad7-b79f-44bd-be79-dc58816848d9 | 5 | public String toString()
{
StringBuilder html = new StringBuilder();
if ( sb.length() > 0 )
{
int len = sb.length();
if ( sb.charAt(0)==' ' )
sb.replace(0,1," ");
if ( sb.charAt(len-1)==' ' )
sb.replace(len-1,len," ... |
4bca69ee-12dd-4edd-916d-c6eececaba49 | 6 | private static <KEY, VALUE, C extends Collection<VALUE>> void removeFromMapValueCollection(
ConcurrentMap<KEY, C> map, KEY key, VALUE value,
CollectionFactory<VALUE, C> factory) {
while (true) {
C values = map.get(key);
if (values == null)
return;
C origCopy = factory.copy(... |
0f5a4da4-ec55-4e36-9682-71b0dde6984d | 1 | private JLabel getJLabel4() {
if (jLabel4 == null) {
jLabel4 = new JLabel();
jLabel4.setText("Characterset:");
}
return jLabel4;
} |
acb97aac-7b0b-45cf-953a-2114674147a4 | 0 | public void setGraphZ(int z) {
this.graphZ = z;
} |
14bdd11c-1774-4466-9f86-e6972bfd890f | 8 | public static void Init(JSONObject obj) throws JSONException {
Bugs = new LinkedList<Bug>();
Iterator<?> Types = obj.keys();
// Loop through each Type
while(Types.hasNext()){
String Type = (String) Types.next();
if(obj.get(Type) instanceof JSONObject){
JSONObject typeObj = obj.getJSONObject(Type);
... |
1b48cd12-b39a-4052-9ca6-a388efb91b11 | 9 | public Table() throws SQLException, ClassNotFoundException{
String datePattern="\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d,\\d\\d\\d";
String date="";
int i=0;
try {
s=new Scanner(f);
while (s.hasNextLine()) {
object = s.nextLine().trim();
if(object.contains("ERROR")){
reqString=object;
// Syst... |
353969f8-fbe7-436a-a654-bce49a56cc32 | 7 | public Object handleDownEvent(Event evt) {
Object retEvent = super.handleDownEvent(evt);
switch (evt.getType()) {
case Event.CONNECT:
case Event.CONNECT_WITH_STATE_TRANSFER:
case Event.CONNECT_USE_FLUSH:
case Event.CONNECT_WITH_STATE_TRANSFER_USE_FLUSH:
... |
86f1fb98-5a5b-4deb-9441-dd68ef4c4e6d | 8 | public int characterAt(int at) throws JSONException {
int c = get(at);
if ((c & 0x80) == 0) {
return c;
}
int character;
int c1 = get(at + 1);
if ((c1 & 0x80) == 0) {
character = ((c & 0x7F) << 7) | c1;
if (character > 0x7F) {
... |
6b585ce4-244b-4b26-bf46-c1a5cb9522d1 | 6 | public Searcher2(AIBatWindow w) {
window = w;
folderNames = new ArrayList<String>();
try {
sm = new SettingsManager();
songFolderLoc = new SettingsManager().getSongFolderLoc();
}
catch (Exception e) {
Util.errorSettings();
Util.errorException(e);
return;
}
if (songFolderLoc.length() == 0... |
e2484e57-4a74-49c1-b833-0001de80e331 | 9 | public int GetPop(String location){
int population = 0;
WAQuery query = engine.createQuery();
query.setInput(location);
try {
WAQueryResult queryResult = engine.performQuery(query);
if (queryResult.isError()) {
} else if (!queryResult.isSuccess()) {
} else {
... |
cbd2893a-e0e4-46c6-95de-c6f57e2f5ec9 | 3 | public static void main(String[] args) {
long start = System.nanoTime();
ArrayList<BigInteger> distinctPowers = new ArrayList<>();
//A simple brute force loop
for (int i = 2; i <= 100; i++) {
for (int k = 2; k <= 100; k++) {
BigInteger power = BigInteger.valueOf(i);
power.pow(k);
if (!distinct... |
e6be920a-cefb-40cd-b95e-4bd07224f8a4 | 8 | public void readIntest(InputStream in) {
try {
intest = new byte[54];
in.read(intest, 0, 54);
for (int i = 0; i < 2; i++) {bfType = bfType * 256 + intest[i];}
sbfType = (char)intest[0] + "" + (char)intest[1];
if (! sbfType.equals("BM")) { throw new RuntimeException("Input file is not a... |
dd32c611-5c6a-4ba0-8314-bcb6d980d102 | 1 | public synchronized void connect() throws SQLException {
if (connection == null)
connection = DriverManager.getConnection(jdbcUrl, username,
password);
} |
50f7b403-13fb-476e-987a-0fe7eedc499e | 7 | @SuppressWarnings({ "unchecked" })
public static <T extends Number> T div(T e1, T e2, Class<T> type, double eps) {
if (Math.abs((Double) e2) > eps) {
T result = ElementOpUtils.getNeutralMulElem(type);
switch (type.getSimpleName()) {
case "Byte":
return (T) (Byte) (byte) ((Byte) e1 / (Byte) e2);
... |
587e42d6-63ae-46f8-92d0-858e821b9266 | 2 | @Override
public List<Object> getAll(String type){
XStream xStream = new XStream(new DomDriver());
List<Object> model=new ArrayList<Object>();
Object temp=null;
Statement stmt=null;
try {
stmt = db.getConnection().createStatement();
ResultSet rs = stmt.executeQuery("SELECT command FROM NonMoveCommand w... |
d3969a8a-ced6-4be0-a679-1e1ac98368c9 | 5 | static double eval() {
double loss = 0;
@SuppressWarnings("rawtypes")
Iterator userIter = DataInfo.userTest.iterator();
@SuppressWarnings("rawtypes")
Iterator ItemIter = DataInfo.itemTest.iterator();
@SuppressWarnings("rawtypes")
Iterator rateIter = DataInfo.rateTest.iterator();
while(userIter.has... |
b8e674d9-63b1-4b11-baa5-54a14ea2da64 | 6 | public boolean equals(Object obj){
if(this == obj) return true;
if(!(obj instanceof Sequential || obj instanceof List))
return false;
ISeq ms = RT.seq(obj);
for(ISeq s = seq(); s != null; s = s.next(), ms = ms.next())
{
if(ms == null || !Util.equals(s.first(), ms.first()))
return false;
}
return ms == n... |
f276efbf-4301-42ab-9ded-3428938f2988 | 3 | public static boolean isAlphanumeric(String str)
{
if (str == null)
{
return false;
}
int sz = str.length();
for (int i = 0; i < sz; i++)
{
if (Character.isLetterOrDigit(str.charAt(i)) == false)
{
return false;
... |
189706f7-eaab-49d8-80b7-52087e142640 | 2 | public String printParkInfoForBoy() {
String text="";
if(getParkList().size() == 0) {
text="目前没有管理任何停车场!";
}
int emptyNum = 0;
int totalNum = 0;
text=text+"-----------------------------------------------" + "\n";
for(int i = 0; i < getParkList().size(); i ++) {
Park park = getParkList().get(i... |
2ad9579d-c4b2-467b-9a34-5fb9ad45f34d | 2 | public void updateSize()
{
String info;
int gw = fm.stringWidth(getName());
for (Iterator<String> e = informations.iterator(); e.hasNext();) {
info = (String) e.next();
gw = fm.stringWidth(info) < gw ? gw : fm.stringWidth(info);
}
int gh = (fm.getMax... |
9c2ffbbf-1013-4d87-b7f9-d6c8fc1dbfea | 8 | public TVDB(String apikey, DB db) throws ParserConfigurationException, SAXException, IOException
{
this.apikey = apikey;
this.db = db;
service = Client.create().resource("http://www.thetvdb.com/api");
String mirrorsXml = service.path(this.apikey + "/mirrors.xml").accept(MediaType.TEXT_XML).get(String.class);
... |
864fba4e-ae79-4c22-b39d-2db38f4a65c0 | 1 | public Xls_Reader(String path) {
this.path=path;
try {
fis = new FileInputStream(path);
workbook = new XSSFWorkbook(fis);
sheet = workbook.getSheetAt(0);
fis.close();
} catch (Exception e) {
e.printStackTrace();
}
} |
8ee607ef-a5fb-4038-980c-e1f11823ffc5 | 3 | public void setAnthill(String a) {
if(a.equals("red") || a.equals("black") || a.equals("none")){
anthill = a;
}else{
anthill = "none";
}
} |
301d1258-4710-4518-a089-2714bbd63c02 | 1 | public ResizingByteBuffer compact() {
if (this.index != this.buf.length)
this.buf = Arrays.copyOf(this.buf, this.index);
return this;
} |
5e9d00c6-4155-42d0-85c7-79f8807f8037 | 9 | public static int maxProfit(int[] prices){
if(prices.length == 0){
return 0;
}
//dpLeft[i] is the max profit of one transaction in range [0..i]
int[] dpLeft = new int[prices.length];
//dpRight[i] is the max profit of one transaction in range [i..n-1]
int[] dpR... |
e978f822-d38f-40bc-8847-678fd810fb06 | 5 | protected void action(){
if(!dead){
if(wallExistsRight()){
if(game.getCurrentLevel().blockAtPixelExists(x+(width)-1,y+(height/4))){
Block bl = game.getCurrentLevel().getBlockAtPixel(x+(width)-1,y+(height/4));
activateDoor(bl);
} else {
Block bl = game.getCurrentLevel().getBlockAtPixel(x+(wid... |
46461968-f2d2-4b7c-9210-2d757f351169 | 4 | public int divide(int x, int y) throws ArithmeticException {
if(y == 0)
throw new ArithmeticException("Divide by zero");
int diff = subtract(x, y);
if(diff < 0) {
return 0;
} else if(diff == 0) {
return 1;
}
int result = 0;
wh... |
4557b93a-4dbe-4e25-8ec4-7b6b7ce19b4f | 0 | public boolean isEnd() {
return isDataFileEnd;
} |
deba7378-70be-46ff-a549-ad95f8a96fda | 8 | private static void handleMoveType6(PGNMove move, String strippedMove, byte color, byte[][] board) throws PGNParseException {
byte piece = WHITE_PAWN;
int fromvPos = strippedMove.charAt(1) - '1';
int tohPos = getChessATOI(strippedMove.charAt(2));
int tovPos = strippedMove.charAt(3) - '1';
int fromhPos = -1;
... |
f2c6c143-8580-407c-af71-e94187cf5099 | 2 | public static void setErrorMessage(JComponent comp, String msg) {
Object old = comp.getClientProperty(ERROR_MESSAGE_KEY);
if (old == null ? msg != null : !old.equals(msg)) {
comp.putClientProperty(ERROR_MESSAGE_KEY, msg);
}
} |
eb36a796-5edb-4fcc-94ef-02fcd553b32d | 3 | public static String crearRespuesta(List<String> columnas,
List<String> valores) {
Map nombreColsJSON = new LinkedHashMap();
for (int i = 0; i < columnas.size(); i++)
nombreColsJSON.put(COLNAME + (i + 1), columnas.get(i));
Map titulosJSON = new LinkedHashMap();
titulosJSON.put(COLS, nombreColsJSON);
int... |
82f348e5-8bf7-49d9-8059-21b4deb9e4de | 5 | public static synchronized File getFileGivenNameOnParentDirectory(String directoryName){
// Proceed only if the directory name is not null and is not empty
if(directoryName != null && !directoryName.trim().isEmpty()){
// Get the current directory and list all its contents
File[] ... |
f04b1cce-233d-4f7a-9776-60cbaa4a0961 | 7 | static String depthInfo(int depth) {
Object[] args = {new Integer(depth), ""};
switch (depth) {
case 1:
args[1] = createMsg(bundle.getString("Multi_pixels"),
new Object[] {new Integer(8), " [01234567]"});
break;
case 2:
args[1] = createMsg(bundle.getString("Multi_pixels"),... |
7ddb23fa-5f6e-4a49-8289-ae7dd0486e61 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
EnrollmentForm other = (EnrollmentForm) obj;
if (sections == null) {
if (other.sections != null)
return false;
} else if (!sections.equa... |
1d61c4ff-7565-4723-a204-adf8c6c4e6ae | 1 | private int jj_ntk() {
if ((jj_nt=token.next) == null)
return (jj_ntk = (token.next=token_source.getNextToken()).kind);
else
return (jj_ntk = jj_nt.kind);
} |
6d3e487d-c7f4-4320-ac06-3a59d0fc8a97 | 0 | public void setDitem(DrawableItem ditem) {
this.ditem = ditem;
} |
d4bcd231-01bc-4629-a173-a8932031f0ea | 6 | static final int method2348(int i) {
anInt6353++;
if (i != -8454)
method2352(44, -11, 126);
int i_6_;
if (Class226.anInt2964 < 96) {
Class348_Sub40_Sub12.method3076(0, true);
i_6_ = 1;
} else {
int i_7_ = Class284.method2116(-26584);
if (i_7_ > 100) {
if ((i_7_ ^ 0xffffffff) >= -501) {
... |
e171578c-3175-46c5-8607-d325f1f7db00 | 8 | @Override
public void process(JCas aJCas) throws AnalysisEngineProcessException {
AnswerScore answer_score;
double score=0;
AnnotationIndex<Annotation> annot_ngrams =aJCas.getAnnotationIndex(NGram.type);
AnnotationIndex<Annotation> annot_ans = aJCas.getAnnotationIndex(Answer.type);
FSIterator<Annotation> ngr... |
11b63f4a-7f18-4dbc-a2db-ac90dda4529d | 8 | @Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o instanceof Hurricane) {
return true;
}
Hurricane hurricane = (Hurricane) o;
if (getYear() != hurricane.getYear()) {
return false;
}
... |
7b8d22b4-34d9-45a7-97ed-4683f9d91087 | 0 | public Neighbor(String id, InetAddress addr, int port, HashMap<String, Integer> dv) {
this.id = id;
this.addr = addr;
this.port = port;
this.dv = dv;
} |
8cd07c7f-db1b-4085-80b3-c8b330ea2f31 | 9 | protected MOB getRandAnyone(MOB monster, Object[] tmp, Room room)
{
if((tmp[SPECIAL_RANDANYONE]==null)||(tmp[SPECIAL_RANDANYONE]==monster))
{
MOB M=null;
if(room!=null)
{
final Vector<MOB> choices = new Vector<MOB>();
for(int p=0;p<room.numInhabitants();p++)
{
M=room.fetchInhabitant(p);
... |
adf4da26-ebec-4504-8d8c-1ccd4f7a0dcc | 1 | @Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
GradientPaint gradPaint = new GradientPaint(0, 0, getLowerColor(), 0, getHeight(), getUpperColor());
g2.setPaint(gradPaint);
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE... |
592f9f35-b348-43a0-a915-6c82dea52064 | 6 | public static void main(String argv[]) throws Exception
{
String fromclient;
String toclient;
ServerSocket Server = new ServerSocket (5000);
System.out.println ("TCPServer Waiting for client on port 5000");
/********************/
String toclient2... |
3b0fb934-ee83-46c4-8c98-0374228e9222 | 1 | protected void carregaTabelaEmails(List<Email> listaEmails){
this.modeloTabelaEmail = new DefaultTableModel();
modeloTabelaEmail.addColumn("Endereco");
for(Email e : listaEmails){
Vector v = new Vector();
v.add(0,e.getEndereco());
mo... |
c6544cf6-8d29-4745-afdb-5222cec505f7 | 6 | public static void startupSpecialists() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEXT$, ((... |
a0a417c3-027b-4f18-a793-c9f25778e086 | 3 | @Override
public void displaySingleVision(int Seer, int Target, byte Vision){
if(Target == 0){
// Do Nothing.
} else {
String role = null;
switch (Vision) {
case WolvesUI.VISION_INNO:
role = "INNOCENT";
break;
case WolvesUI.VISION_WOLF:
role = "WHEREWOLF";
break;
}
System.out.p... |
3bdebfc5-b42d-4ebe-a2a4-6997647fce5f | 6 | private void render()
{
long time1 = System.nanoTime();
BufferStrategy bs = getBufferStrategy();
if (bs == null)
{
createBufferStrategy(2);
bs = getBufferStrategy();
}
if (bs != null)
{
Graphics g = bs.getDrawGraphics();
if (rendering)
renderableObject... |
176de8d6-0a85-48bf-a92c-2c0c0718a313 | 4 | static public String capitalize(String orig) {
StringBuffer buf = new StringBuffer(orig);
for (int i = 0; i < orig.length(); i++ ) {
if (i == 0 || orig.charAt(i - 1) == ' ') {
if (Character.isLowerCase(orig.charAt(i))) {
buf.setCharAt(i, Character.toUpperCase(orig.charAt(i)));
}
}
}
Strin... |
7e2d150b-c2a7-44b8-997f-3932e3813a74 | 7 | private boolean anyTextNull(){
if(newEventObj.eventDate.getText() == null){
return true;
}
if(newEventObj.eventDisc.getText() == null){
return true;
}
if(newEventObj.eventLoc.getText() == null){
return true;
}
if(newEventObj.eventName.getText() == null){
return true;
}
if(newEventObj.check... |
3876486c-757d-4f5f-a19d-0533f24008df | 9 | public void insert(League league) throws NamingException
{
String INSERT_STMT="insert into League(year,season,title)values(?,?,?)"; // JDBC variables
DataSource ds = null;
Connection connection = null;
PreparedStatement insert_stmt = null;
try {
... |
b356673c-c7cd-4eb0-b906-8bce46284939 | 8 | private String toMatrixString(int[][] counts, int[] clusterTotals,
Instances inst) throws Exception {
StringBuffer ms = new StringBuffer();
int maxval = 0;
for (int i = 0; i < m_numClusters; i++) {
for (int j = 0; j < counts[i].length; j++) {
if (counts[i][j] > maxval) {
maxval = counts[i][j];
... |
2b166508-1ccb-4fd3-add1-e92811a3e14d | 4 | public static void write(String packet) {
try {
FileWriter writer = new FileWriter(FILENAME, true);
// check if file already exists / file empty, if so create header
File file = new File(FILENAME);
if (file.length() == 0) {
// create header
String[] packetOrder = UDP_Packet.getOrder();
... |
bfa49891-5960-4349-9937-d1393b62393a | 7 | public static String unicodeToHTMLUnicodeEntity(String text, boolean pPreserveNewlines) {
/*
* Heuristic reserve for expansion : factor 1.2
*/
StringBuffer result = new StringBuffer((int) (text.length() * 1.2));
int intValue;
char myChar;
for (int i = 0; i < text.length(); ... |
2257d725-f649-4f7d-92cb-c0341d562511 | 0 | public HBox initHeader(String titleText) {
HBox header = new HBox();
header.setAlignment(Pos.CENTER_LEFT);
header.getStyleClass().add("popUpHeader");
header.setPrefHeight(28);
Button closeBtn = new Button();
closeBtn.getStyleClass().add("close-button");
closeBtn.setPrefSize(16, 16);
closeBtn.setMinSize... |
ef1ed082-d598-41da-9174-40691fd36924 | 6 | private InputStream connect(String urlPath, String requestMethod, Object data) {
if (!isInitialized()) {
Logger.getLogger(Communicator.class.getName()).log(Level.SEVERE, "Communicator has not been initialized.");
}
Object result = null;
try {
// ... |
3dc65a2f-dbb7-4cf4-b7bb-f11d175ba50a | 5 | @Override
public FREObject call(FREContext c, final FREObject[] args) {
context = (InAppPurchaseExtensionContext) c;
context.executeWithService(new Runnable() {
@Override
public void run() {
String productId = null;
String payload = null;
Bundle buyIntentBundle = null;
// Retrie... |
6390401c-58cb-48e5-a743-fb0fe09f695a | 4 | public boolean equals(Object other) {
Item o = (Item) other;
return this.getAuthor().equals(o.getAuthor())
&& this.getTitle().equals(o.getTitle())
&& this.getGenre().equals(o.getGenre())
&& this.getRating() == o.getRating()
&& this.getLength() == o.getLength();
} |
6f4c6006-6d52-4122-9f83-d63ae3614f9a | 3 | @Override
public HandshakeState acceptHandshakeAsServer(Handshakedata handshakedata)
throws Exception {
// Sec-WebSocket-Origin is only required for browser clients
int v = readVersion(handshakedata);
if (v == 7 || v == 8)// g
return basicAccept(handshakedata) ? HandshakeState.MATCHED
: HandshakeState... |
f9a244a1-e42a-4466-bd2f-85f0ade91523 | 0 | @Override
public void changedMostRecentDocumentTouched(DocumentRepositoryEvent e) {
calculateEnabledState(e.getDocument());
} |
ec368d87-524e-48e6-9bf9-9af59ab2c0cf | 4 | public boolean canPlace() {
if (super.canPlace()) return true ;
I.say("Couldn't place normally!") ;
final Tile o = origin() ;
if (o == null || o.owner() == null) return false ;
if (o.owner().getClass() == this.getClass()) return true ;
return false ;
} |
c6c5d2b3-d2c5-4bee-8fa6-6173e37ae989 | 0 | public Car driverCar() {
return new Bmw();
} |
69c6d484-95e6-4f59-84ec-1e282229ccfa | 0 | private void zoomOut()
{
markerRect.cleanUp();
MapGetter.zoomOut();
MapGetter.getMapImage(MapGetter.createUrl(0, 0));
markerRect.changeZoom();
repaint();
} |
180a74f7-8ce4-40fc-89ea-034e669a6fe3 | 7 | public static void gear(GL2 gl,
float inner_radius,
float outer_radius,
float width,
int teeth,
float tooth_depth) {
int i;
float r0, r1, r2;
float angle, da;
float u, v, len;
r0 = inner_radius;
r1 = outer_radius - tooth_depth / 2.0f;
r2 = outer_r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.