method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
fe5452c7-a15f-4752-8e20-b96ffa4468c3 | 6 | @Override
void run() {
time = System.nanoTime();
heap = new FibonacciHeap();
entryMap = new HashMap<HeapNode, Entry>();
HeapNode root = null;
for (int i = 0; i < geoRefs.size(); i++) {
GeoRef point = geoRefs.get(i);
HeapNode node;
if (i =... |
b72a23a3-7aa2-4f38-9951-4fae32096f86 | 2 | public boolean equals(Money targetMoney){
if(this.Dollars == targetMoney.Dollars && this.Cents == targetMoney.Cents){
return true;
}
else{
return false;
}
} |
159ff7c8-35d9-42dd-8cb1-57514690ba7c | 5 | public void fillTableMonthAhead() {
int currentYear = new GregorianCalendar().get(Calendar.YEAR);
this.monthsAhead++;
int showMonth = new GregorianCalendar().get(Calendar.MONTH)
+ this.monthsAhead + 1;
this.yearsAhead = 0;
while (showMonth > 12) {
currentYear++;
showMonth -= 12;
this.yearsAhead++... |
1750161f-22b4-4254-adac-1e1b5a06e20f | 5 | private ArrayList<String> words(String line, String stopwordsFileLocation){
if(stopwords.size() == 0)
addStopwords(stopwordsFileLocation);
ArrayList<String> result = new ArrayList<String>();
String[] words = line.split("[ \t\n,\\.\"!?$~()\\[\\]\\{\\}:;/\\\\<>+=%*]");
for(int i=0; i < words.length; i++){
... |
aeb42e24-bae2-4b6d-90cd-f94b7720a8ca | 4 | private HttpRequest getHttp(HttpMethod httpMethod, StringEntity entity) {
if (HttpMethod.post.equals(httpMethod)) {
HttpPost http = new HttpPost();
http.setEntity(entity);
return http;
} else if (HttpMethod.put.equals(httpMethod)) {
HttpPut http = new HttpPut();... |
c9ec69b3-6a52-4d7f-8909-08a8895c2d4c | 5 | private void mapToDisk() {
diskSamples = new ArrayList<Vector2>(samples.size());
float r;
float phi;
for (Vector2 sample : samples) {
Vector2 sp = new Vector2(2 * sample.getX() - 1.0f, 2 * sample.getY() - 1.0f);
if (sp.getX() > -sp.getY()) { //Sect... |
a0b9fd17-eded-4e92-971c-52f72e4de872 | 0 | public AncientNordicPickaxe() {
this.name = Constants.ANCIENT_NORDIC_PICKAXE;
this.attackScore = 5;
this.attackSpeed = 10;
this.money = 500;
} |
ed8e8f48-cfea-45d6-8d19-796887b410d3 | 2 | private List<Nave> selectNaves(Juego juego){
List<Nave> listNaves = new ArrayList<>();
ForeignCollection<Nave> naves = juego.getNaves();
CloseableIterator<Nave> itNaves = naves.closeableIterator();
// Map<String,Object> map = new HashMap<>();
// map.put(Nave.JUEGO_ID, juego.getId... |
3b08dac1-9827-4569-aed2-ed52627cca91 | 6 | public Object getParameter(String param) {
if (param.equals(ScriptEngine.ENGINE)) {
return getEngineName();
}
if (param.equals(ScriptEngine.ENGINE_VERSION)) {
return getEngineVersion();
}
if (param.equals(ScriptEngine.NAME)) {
return getEngineName();
}
if (param.equals(ScriptEngine.LANGUAGE)) {
... |
7ddd9d60-fcdf-4f4a-a8a1-d9164cbda730 | 1 | public OpenFileFormat getOpenFormat(String formatName) {
int index = indexOfName(formatName, openerNames);
if (index >= 0) {
return (OpenFileFormat) openers.get(index);
}
return null;
} |
f12cc7a8-610f-4254-b572-0e62ac5dc89d | 4 | public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
Boolean isremoved = false;
Products category = new Products();
String itemName = (String) request.getParameter("itemName");
String userName = (String) request.getParameter("us... |
66da7766-a053-4cb9-b0d1-40d48c00358b | 3 | public static String getFileSizeString(long bytes) {
bytes = bytes / 1024;
Double d = (double)bytes;
if (bytes < 1024) {
return bytes + " KiB";
} else {
bytes = bytes / 1024;
if (bytes < 1024) {
return bytes + " MiB";
... |
1abb8716-4e50-4dda-9668-749575f9f4d0 | 9 | public static BufferedReader createReader( final Object source ) throws IOException, FileNotFoundException {
BufferedReader reader = null;
if ( ( source instanceof File ) || ( source instanceof String ) ) {
File f = null;
if ( source instanceof File ) {
f = ( File... |
fc177af1-2d16-4685-8041-93b2b9823d25 | 2 | public static String percent(double p1, double p2) {
String str;
if (p1 == 0.0) {
return "0.00";
}
double p3 = p1 / p2;
DecimalFormat df1 = new DecimalFormat(".00");
if (p3 * 100 < 1) {
df1 = new DecimalFormat("0.00");
}
str = df1.f... |
79be9f4c-7ff5-4bf0-9bf5-b2822d3c56cc | 0 | public String showList(){
size = 5;
List<Problem> list = problemDAO.findPage(page, size);
problemList = new ProblemList();
problemList.setList(list);
return SUCCESS;
} |
2886debf-49df-40b6-93be-95e6edf05df8 | 6 | public void updateTrajectory(Trajectory t ,char x,char y){
if(x != '0' ){
if(x==('+')){
t.setX(t.getX()+1);
}
if(x==('-')){
t.setX(t.getX()-1);
}
}
t.setX( Math.max(Math.min(1, t.getX()), -1 ) );
if(y !='0' ){
if(y==('+')){
t.setY(t.getY()+1);
}
if(y==('-')){
t.setY(t.... |
8be8234e-0d49-453c-b3ac-40adcfd9c7c5 | 2 | public TemplateGUI() {
JPanel nothPanel = new JPanel();
nothPanel.setLayout(new FlowLayout());
//f.add(nothPanel);
String [] message = {"I am Busy!","Talk to you later!","At a Meeting","On phone! Catch you later","Good Morning","Good Night","Get Well Soon!"};
JLabel labName = new JLabel();
labName.set... |
d3ecfc2c-66c7-4d3b-b4c6-3a13503bdd5c | 4 | private Menu ferLogin(String dni, String password) throws Exception
{
usuari = loginService.verificarUsuari(dni, password);
if ( usuari != null )
{
System.out.println(String.format("\nBenvingut, %s [Rol: %s]\n", usuari.getNom(), usuari.getRol()));
... |
975729ef-39f3-4866-9335-39f86e472407 | 0 | @Override
public void clearAppenders() {
appenders.clear();
} |
3c4454fd-05e5-4676-bdea-27e206b20de3 | 1 | public void visitMultiANewArrayInsn(final String desc, final int dims) {
if (mv != null) {
mv.visitMultiANewArrayInsn(desc, dims);
}
execute(Opcodes.MULTIANEWARRAY, dims, desc);
} |
c0f55054-d666-4638-901c-aaf680eb8494 | 7 | public void parseFile(String pathToFile) {
try {
BufferedReader br = new BufferedReader(new FileReader(pathToFile));
String line = br.readLine();
int lineCounter = 1;
while (lineCounter < 5) {
lineCounter++;
line = br.readLine();
... |
16ac0d91-19e7-4792-9382-189ab55c660b | 9 | @Override
public void actionPerformed(ActionEvent e) {
JButton current = (JButton) e.getSource();
if ( e.getSource() == checkOutToolsButton ) {
switchContentPanel(new CheckoutToolsPanel());
isCheckingOutTools = true;
current.setBackground(orange);
} else if ( e.getSource() == selectMachinesButton... |
d376d503-3814-4ab2-90a4-0fddeb614e05 | 3 | public void registerEvents(Listener l) {
for (Map.Entry<Class<? extends Event>, Set<RegisteredListener>> entry : addMuffins(l).entrySet()) {
try {
getEventListeners(getRegistrationClass(entry.getKey())).registerAll(entry.getValue());
} catch (IllegalAccessException e) {
server.Log("==!EVENT ERR... |
dcff5e4a-a376-4da0-ab00-3395616f1cf3 | 3 | public static List<String> getAddresses() {
List<String> result = new ArrayList<String>();
try {
Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();
for (NetworkInterface netint : Collections.list(nets)) {
Enumeration<InetAddress> inetAddresses = netint.getInetAddresses();
fo... |
dc2f57d5-e1e4-4261-9592-5e89b086f4ad | 2 | Component getGameComponent() {
if (Signlink.mainapp != null) {
return Signlink.mainapp;
}
if (super.frame != null) {
return super.frame;
} else {
return this;
}
} |
a632fb0f-4dce-41b1-bba0-511e7a9f2cc6 | 5 | @Override
public void run() {
String name;
short size;
while(true)
{
switch (Cmd.CmdsToWorld.GetCmdByString(ReadStringLn()))
{
case exit:
WriteLn("Console thread finishing...");
return;
... |
95476092-d547-43a0-af2f-9ef42b3bd375 | 8 | public void updateHash(byte[] input, int pos, int end) {
// WINDOW_MASK
int hPos = pos & 0x7FFF;
int val = this.val;
val = ((val << 5) ^ (pos + 2 < end ? input[pos + 2] & 0xFF : 0)) & 0x7FFF;
hashVal[hPos] = val;
int tmp = head[val];
prev[hPos] = (tmp != -1 && hashVal[tmp] == val) ? tmp : ... |
8e310000-2f25-477f-baca-6ca355a53a5e | 1 | public Vector2 getShooterMount() {
if (side != null) {
return side.getShooterMount(game.getBoardSize());
} else {
return null;
}
} |
921a6b22-eacb-4b8a-96bb-1d18ee874cf2 | 1 | public static boolean verifyEmail(String email){
final Pattern rfc2822 = Pattern.compile(
"^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"
);
if (rfc2822.matcher(email).matches())
return true;
return false... |
0b41ff1c-6200-4e94-a543-14d22c4035ad | 0 | public GraphCanvas(GraphDrawer drawer) {
super.setBackground(Color.WHITE);
this.drawer = drawer;
} |
d3f9568d-818e-477a-ac0c-e9a84d748d41 | 8 | public void OnReceive(Integer from, DtPacket packet){
switch(packet.MessageType){
case Enlist:
OnEnlist(from, packet);
break;
case Abort:
OnAbort(packet);
break;
case Commit:
OnCommit(packet);
break;
case CommitResponse:
// TODO garbage collect the list of coordinated transacti... |
1c547ce5-eb8b-4082-a9b7-0e6389bb2495 | 4 | public void setMap(GameMap gm) throws Exception {
if(gm.getXSize() != x || gm.getYSize() != y) {
throw new Exception("Old map size and new map size not equals.");
}
for(int i = 0; i < x; i++) {
for(int j = 0; j < y; j++) {
buttons[i][j].setStatus(... |
aa45fc70-aba5-4e85-afef-4f1cbf0521b5 | 1 | public static float arraySum(float[] ls){
float total = 0;
for(int i=0; i<ls.length; i++){
total+=ls[i];
}
return total;
} |
09446000-c0c9-4c44-b2ee-629f360fd70e | 6 | public void makeTower(Board board, char type, Point position) {
int price, priority, dmg, range, rOF, multiShots;
Dimension dimension;
switch(type){
case 'A':
price = 10;
priority = 1;
dmg = 5;
range = 100;
... |
fbaea0e9-7f4e-43e3-abf8-8553c1f80e93 | 8 | public void renderProjectile(int xp, int yp, Projectile p) {
xp -= xOffset;
yp -= yOffset;
for(int y = 0; y < p.getSpriteSize(); y++) {
int ya = y + yp;
for(int x = 0; x < p.getSpriteSize(); x++) {
int xa = x + xp;
if(xa < -p.getSpriteSize(... |
73c3846a-1f4a-4946-8b96-02d7820a4f05 | 0 | public IterativeSolution(Peg x, Peg y, Peg z, int diskCount) {
this.x = x;
this.y = y;
this.z = z;
this.diskCount = diskCount;
pegs = new Stack<IPaintable>();
pegs.push(new Cycle(x, y, z, diskCount % 2));
} |
7ddf827e-d053-48b7-b7c5-32a882b37909 | 4 | public static byte[][] createAndValidateSkyMap(int w, int h) {
int attempt = 0;
do {
byte[][] result = createSkyMap(w, h);
int[] count = new int[256];
for (int i = 0; i < w * h; i++) {
count[result[0][i] & 0xff]++;
}
if (count[Tile.cloud.id & 0xff] < 2000) continue;
if (count[Tile.stairsDown... |
f8e888fb-0423-42cf-9e7f-4818ece4557e | 5 | public synchronized static String deleteGame(String ip) {
String msg = "DELETE_GAME FAILURE";
boolean flag = true;
// get node
Element g = getGameElement(ip);
if (g != null) {
// move players
NodeList players = getPlayersFromGame(g);
for (int i = 0; i < players.getLength(); i++) {
Element myEl =... |
8d0e08b2-c292-405c-b445-2e119d678a67 | 1 | public Iterator<Integer> compareStates(BoardState stateOne, BoardState stateTwo){
ArrayList<Integer> rowDifferences = new ArrayList<Integer>();
for(int i = 0; i < rowDifferences.size(); i++){
rowDifferences.add(stateOne.checkRow(i + 1) - stateTwo.checkRow(i + 1));
}
return rowDifferences.iterator();
} |
5369becb-b4c1-4e82-aa23-aeb662d698d0 | 6 | public static Rectangle intersection(Rectangle first, Rectangle second) {
if (first.width < 1 || first.height < 1 || second.width < 1 || second.height < 1) {
return new Rectangle();
}
int x = Math.max(first.x, second.x);
int y = Math.max(first.y, second.y);
int w = Math.min(first.x + first.width, second.x ... |
f2862ebb-6065-4b13-9b30-307e016657c1 | 6 | @Override
public void focusGained(FocusEvent e) {
if(e.getSource() == frame.name && frame.name.getText().equals("Логин")) frame.name.setText("");
else if(e.getSource() == frame.password && new String(frame.password.getPassword()).equals("Пароль")) frame.password.setText("");
else if(e.getSou... |
df887b55-f3f5-4ba1-b65b-66e71571d03b | 9 | private Automata<String> computeValidAutomata(String rowState, String columnExperiment, Automata<String> guessedAutomata) {
//if (columnExperiment.equals("-1") && rowState.length() == 1) continue;
String stateSequence = rowState + columnExperiment;
stateSequence = stateSequence.replaceAll("-1", "");
if... |
171906bb-a933-4d6b-8452-32a03132661f | 9 | public void loadGame()
{
try
{
// PrivilegeManager.enablePrivilege("UniversalFileAccess");
// PrivilegeManager.enablePrivilege("UniversalPropertyRead");
// PolicyEngine.assertPermission(PermissionID.FILEIO);
//}
//catch (ForbiddenTargetException localForbiddenTargetException)
//{
... |
92926d80-90d8-433c-b169-ba5839f2d7df | 5 | public static Model3D chargerModel(String fichier) {
try {
InputStream ips = new FileInputStream(fichier);
InputStreamReader ipsr = new InputStreamReader(ips);
BufferedReader in = new BufferedReader(ipsr);
String ligne = in.readLine();
System.out.println(fichier);
int nbpoint = 0;
int nbsegment =... |
21dd29ee-a81a-453f-96b4-903204f829b7 | 6 | @EventHandler(priority = EventPriority.LOWEST)
public void e2(EntityDamageEvent es) {
if (!es.getEntityType().equals(EntityType.PLAYER)) return;
try {
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) es;
if (e.getDamager() instanceof Player && e.getEntity() instanceof Player) {
Player mainplayer... |
164149e7-8822-4513-807e-5290001a5824 | 9 | public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner scan = new Scanner(System.in);
String userInput = scan.nextLine();
Pattern regex = Pattern.compile("[\\dAJQK]+");
Matcher match = regex.matcher(userInput);
ArrayList<Integer> cardsValues = new ArrayList<>();
while (... |
12bfa7d0-fdd6-46b7-bdfd-06d9e9843383 | 7 | @Test
public void findWhichNearbySpotIsFree2()
{
Positioned p = new Positioned(64,64,1,1);
list.addEntity(p);
list.addEntity(new Positioned(48,48,32,32));
p.findNearestFreeSpot();
assertTrue( (p.X() == 82 && p.Y() == 64) ||
(p.X() == 64 && p.Y() == 82)... |
e715f896-1f6b-4998-aa2d-f6fb5e2ad6d2 | 0 | public SuppliersComboBox() {
setupItems();
setupHandler();
} |
28c22888-f1ef-4ae2-8bfb-13e25b76330a | 2 | public void setStatus(int s) {
this.status = s;
if (s != ERROR)
errorMessage = null;
if (overviewItem != null) {
overviewItem.refreshStatus();
overviewItem.repaint();
}
} |
15954eb7-fe75-466a-a5a6-90b6d5d6506d | 0 | public Person(String name) { super(name); } |
4d8a407f-7fad-4ab3-a584-529452e031c7 | 1 | public void CheckStream() throws ClassNotFoundException, IOException
{
while (true)
{
Receive();
}
} |
e85328d0-3d3f-4d6f-8dec-7cff11e95d36 | 6 | public static OPERATING_SYSTEM getOperatingSystem() {
String OS = System.getProperty("os.name").toLowerCase();
if (OS.contains("win")) {
return OPERATING_SYSTEM.WINDOWS;
} else if (OS.contains("mac")) {
return OPERATING_SYSTEM.OSX;
} else if (OS.contains("nix") || OS.contains("nux") || OS.co... |
e89429b1-a395-4469-a27d-15a5123afb93 | 2 | public Object getDefault(Class<?> defaultProvider, CommandInvocation invocation)
{
DefaultValue def = this.defaults.get(defaultProvider);
if (def != null)
{
return def.getDefault(invocation);
}
return null;
} |
e7753567-ab8b-47f1-8d22-e57f59aa17c4 | 3 | String tryLogUserIn(String userName) {
String response = "";
try {
clientSocket = new Socket(serverHostAddress, SERVER_PORT);
/* Socket-Basisstreams durch spezielle Streams filtern */
outToServer = new DataOutputStream(clientSocket.getOutputStream());
inFromServer = new BufferedReader(new InputStreamRe... |
b91afab7-b237-4cbe-8fe8-18b355fb36ad | 4 | public static boolean startsWithIgnoreCase(String str, String prefix) {
if (str == null || prefix == null) {
return false;
}
if (str.startsWith(prefix)) {
return true;
}
if (str.length() < prefix.length()) {
return false;
}
String lcStr = str.substring(0, prefix.length()).toLowerCase();
String ... |
04895f3f-7648-46f0-9b27-4ad37cdac0eb | 1 | private boolean haveValueDifferenceOfOne(Card userCard, Card selectedCard) {
int userValue = userCard.getValue();
int selectedValue = selectedCard.getValue();
int diff = Math.abs(userValue - selectedValue);
return diff == 1 || diff == 12;
} |
fc0b7d77-6620-4b1c-be02-3a102cf4e0a7 | 9 | public WinMineSweeper() {
super();
try {
robot = new Robot();
screensize = Toolkit.getDefaultToolkit().getScreenSize();
smiley = loadSmiley();
addType("unknown", unknown);
addType("empty", empty);
addType("1", one);
addType("2", two);
addType("3", three);
ad... |
0d293e22-b02b-4740-b80a-34025fee1671 | 5 | final public Stat ExprStat() throws ParseException {
Exp.PrimaryExp p;
Stat s = null;
long i = LineInfo();
p = PrimaryExp();
switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
case 71:
case 72:
s = Assign(assertvarexp(p));
break;
default:
jj_la1[12] = jj_gen;
;
}
if (s == null) {
s = Stat.... |
f6920093-1bb0-44e8-9d80-ef7e1cecedef | 9 | private boolean checkPosition(Ship s) {
boolean add = true;
boolean horizon = Character.toUpperCase(s.shipOrientation) == 'H';
// Horizontal ship
if(horizon) {
int i = s.shipPosition_x;
while(i <s.shipPosition_x + s.shipSize && add) {
char res = this.returnCharacter(s.shipPosition_y,i);
if(res !=... |
569e0011-9480-42e4-b1c5-89415169c7dc | 9 | static final int method1128(int i, Class68 class68) {
anInt1896++;
if (Class68.aClass68_1179 != class68) {
if (class68 != Class68.aClass68_1181) {
if (class68 == Class68.aClass68_1182)
return 5124;
if (Class68.aClass68_1183 != class68) {
if (class68 != Class68.aClass68_1184) {
if (class68 == C... |
6e0ceaf0-40d5-4ab0-8326-9a65e55a6214 | 5 | public List<HistoryLink> getChain(LinkDigest linkDigest, boolean stopAtEnd) {
throwIfNullOrNullDigest(linkDigest);
//System.out.println("Starting: " + linkDigest + " stopAtEnd:" + stopAtEnd);
ArrayList<HistoryLink> links = new ArrayList<HistoryLink>();
HistoryLink link = new His... |
0bedbb97-c010-4053-99d6-8ea046f13f69 | 4 | @Override
protected Void doInBackground() {
publish(new RuleTaskState(0, "[*] Checking " + rule.toString()));
String htmlPage = "";
try {
htmlPage = HttpDownloader.getString(rule.getRuleURL());
} catch(MalformedURLException ex) {
publish(new... |
50fc1fe2-9cc1-424e-8ce2-8b5de01ea233 | 8 | @Override public void iterate(){
matcount += 1;
if(matcount >= mat){matcount = 0;
calculate(); }
if(ages){ if(active){ if(age == 0){age = 1;} else{age += 1;}}else{ age = 0;}
if(fades){ if( age >= fade){ purgeState(); age = 0;}}
if( age > 1023){ age = 1023; }state = agify(age);}
else{if(ac... |
52e29f9e-e570-4f07-8cbe-9cea5b008a90 | 7 | public static String escapeXml(String source) {
if (source == null) {
return null;
}
StringBuffer result = new StringBuffer(source.length() * 2);
for (int i = 0; i < source.length(); ++i) {
char ch = source.charAt(i);
switch (ch) {
cas... |
c043d1d7-740b-4181-8c3c-14e6e2fcabdd | 8 | private static boolean
classMatcher(REGlobalData gData, RECharSet charSet, char ch)
{
if (!charSet.converted) {
processCharSet(gData, charSet);
}
int byteIndex = ch / 8;
if (charSet.sense) {
if ((charSet.length == 0) ||
( (ch > charSet.le... |
0b2b1de3-fd7c-4465-9b5b-e650e4e2c2ad | 0 | @Before
public void init() {
board = mock(Board.class);
pawn = new Pawn(letter, posX, posY, board);
board.addPawn(pawn);
} |
9e5b96b4-3001-4ca7-ac11-cbc1fa8c6c42 | 7 | public List<FusionGene> generate(int nFusions, int genesPerFusion) {
List<FusionGene> list = new ArrayList<FusionGene>();
//XXX ignoring filters for now..
List<TranscriptRecord> transcripts = selector.select();
if(transcripts.size() < genesPerFusion) return list;
Collections.so... |
670ebdea-668a-4c24-92d1-028a6e010599 | 8 | public static void main(String[] args) {
int size = 3;
boolean[] bArray = new boolean[size];
byte[] byArray = new byte[size];
char[] cArray = new char[size];
double[] dArray = new double[size];
float[] fArray = new float[size];
int[] iArray = new int[size];
... |
76a81783-0b03-43b4-b3f6-b792b5b742ba | 0 | @Basic
@Column(name = "fecha")
public int getFecha() {
return fecha;
} |
832aa602-436c-4498-afc0-b28f9227b0f9 | 8 | public void eleccionTabu()
{
String url = "jdbc:derby://localhost:1527/PDPIVP";
String selectdatos="SELECT * FROM Balam.Tiempo";
int cambios_var=0;
int indice_var=0;
int soluciontabu=0;
int valor_min=0;
int resultado=0;
int tabu_var=0;
PDPTabu obj=new PDPTabu();
try{
Clas... |
7932aba8-62d7-4d20-b143-a7b2992f5499 | 3 | private void reloadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reloadButtonActionPerformed
new Thread() {
@Override
public void run() {
setName("Reload Android Tasks Thread");
while (reloadButton.isSelected()) {
... |
c7228cca-5165-4edd-a271-42a197fcbca1 | 1 | public String toString() {
StringBuffer sbuf = new StringBuffer();
String cname = this.getClass().getName();
int i = cname.lastIndexOf('.');
sbuf.append(i < 0 ? cname : cname.substring(i + 1));
sbuf.append("[");
toString2(sbuf);
sbuf.append("]");
return sb... |
94fa8a08-44a7-4e2b-b74e-2eaecdc17687 | 1 | public Player() {
try {
this.idleImage = new Image("res/shark.png");
this.animation.add(idleImage);
this.animation.add(new Image("res/shark1.png"));
this.animation.add(new Image("res/shark2.png"));
this.animation.add(new Image("res/shark3.png"));
this.animation.add(new Image("res/shark4.png"));... |
68aa9a39-0832-408f-9c64-33d896a35904 | 1 | public static void main(String[] args)
{
ArrayList<Person> personList = new ArrayList<Person>();
personList.add(new Person(9, "zhangsan", 20));
personList.add(new Person(2, "lisi", 21));
personList.add(new Person(3, "wangwu", 25));
personList.add(new Person(8, "zhaoliu", 26));
personList.... |
d95e47d9-c2d6-471a-815c-6946fefc27b6 | 1 | public static String getElementType(String typeSig) {
if (typeSig.charAt(0) != '[')
throw new IllegalArgumentException();
return typeSig.substring(1);
} |
6965d773-dfa2-48a0-9d28-b1f0bccfd0ac | 7 | public UIInventory(EntityPlayer p)
{
super(p, 44);
for(int i = 0 ; i < 10 ; i++)
{
this.slots[i] = new UIInventorySlot(BlockyMain.width / 2 - 16 - (32 * 4) - 12 + i * 32 + i + 3, BlockyMain.height / 2 - 32 - 3 - 32 - 20);
}
for(int i = 0 ; i < 10 ; i++)
{
this.slots[i + 10] = new UIInventorySlo... |
14a74c13-6a3b-4bb9-86e6-ca1eb96df335 | 4 | @Override
public void update(Vector2F velocity, Vector2F location, Vector2F acceleration, Rotation rotation, Map<Keys, Boolean> keys)
{
if (controllable && keys.containsKey(Keys.KEY_U) && keys.get(Keys.KEY_U) || !controllable)
{
velocity.addLocal(rotation.add(90).toVector2F().mult(thrust / 10000F));
}
} |
d631847a-f9ab-4b40-9260-50ea2296349d | 6 | public Set<Map.Entry<K,Long>> entrySet() {
return new AbstractSet<Map.Entry<K,Long>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TObjectLongMapDecorator.this.isEmpty();
}
public bool... |
04bb6936-95be-4224-a295-3c222a9478f8 | 9 | public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null || !(obj instanceof Mietvertrag))
return false;
Mietvertrag other = (Mietvertrag)obj;
if(other.getVertragsnummer() != getVertragsnummer() ||
!Helper.compareObjects(this.getDatum(), other.getDatum()) ||
!Helper... |
6fbf4807-2c56-4956-aebd-3d6b8cdb9166 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TermDocIdWritable other = (TermDocIdWritable) obj;
if (docId == null) {
if (other.docId != null)
return false;
} else if (!docId.equals(... |
8eba3d4f-efb4-46ec-9d5e-f9e5c2e35dca | 0 | @Override
public String toString() {
return "TypePraticien{" + "code=" + code + ", libelle=" + libelle + ", lieu=" + lieu + '}';
} |
558caab1-b7b3-42a2-8159-2e3dffd1993f | 3 | private void getTabletInfo() {
if (tabletOK) {
try {
if (((Boolean) mPoll.invoke(tablet, (Object[]) null)).booleanValue()) {
pressure = ((Integer) mGetPressure.invoke(tablet, (Object[]) null)).intValue();
pressureExtent = ((Integer) mGetPressureExtent.invoke(tablet, (Object[]) null)).intValue();
... |
a22b36e9-1bd9-4938-8491-8f3d1f4d4c6c | 6 | private void fileLog(LogType logType) {
if (isFileLogEnabled) {
switch (logType) {
case FULL:
writeToFile(generateFinalMessage());
break;
case SEMI:
writeToFile(generateSemiFinalMessage());
break;
case TYRS:
writeToFile(generateTryMessage());
break;
case BEGIN:
if (isBeginEn... |
7d378a86-7b66-46d4-8693-83756ca668de | 3 | public int eliminarProspecto(String DNI){
int condicion = 0;
tablaDeProspectos();
for(int i = 0; i < datos.size();i++){
String valorEliminar = datos.get(i).getDNI();
if(valorEliminar.equals(DNI)){
System.out.println("El r... |
b6444dc4-4d44-45ea-9436-3e90d1096a75 | 7 | private void syncTable(Connection scon, Connection dcon, Table srcTable, Table dstTable,
Map<String, List<Object>> filters, boolean delete) throws Exception {
Table lcd = findLcd(srcTable, dstTable);
String sql = lcd.writeHashedQuery(filters);
//int i = 0; // TO... |
24c9bbcb-f876-4633-8070-eb8c2e347478 | 5 | public void createAccount(String fn, String ln, int empID, String un, String pass, int type)
{
Account a;
if(type == 1){
a = new SystemAdmin(fn, ln, empID, un, pass);
}else if(type == 2){
a = new AcademicAdmin(fn, ln, empID, un, pass);
}else if(type == 3){
... |
db8c0a4f-39a3-410f-a16d-8fde723c567b | 4 | public static Logger newLogger(int dstType, String... dstName) {
switch (dstType) {
case CONSOLE:
return new Console(dstName.length == 0 ? null : dstName[0]);
case FILE:
return new File(dstName.length == 0 ? null : dstName[0]);
default:
return null;
}
} |
85f7d85f-03b8-4c40-b0bd-108c9a860424 | 7 | public static void goingTheDistance(String str1, String str2) {
String commonStr;
int indexOfCommonStr;
for (int i = str2.length(); i > 0; i--)
for (int j = 0; i < str2.length(); j++) {
commonStr = str2.substring(j, i);
indexOfCommonStr = str1.indexOf(commonStr);
if (indexOfCommonStr != -1) {
... |
ad04f410-a519-44fc-98a5-082f44d2aada | 5 | public void debug(final String debug) {
switch(debug) {
case "Player":
System.out.println(cl.getLocal().getName());
break;
case "Privilege" :
cl.setPrivilege();
break;
case "Open interface" :
fi... |
391a6f51-92fb-4373-98d3-146ff689c56b | 6 | public boolean isSuicide(Case pos, Joueur j){
Groupe g = new Groupe(this);
g.addPierre(pos);
for(Groupe g1 : pos.getGroupesAdjacents()){
if(((ArrayList<Case>)g1.getPierres()).get(0).getJoueur().equals(j)){
(g.getPierres()).addAll(g1.getPierres());
}
... |
26b0b02d-452b-4dc5-adb2-f0ecb22723c8 | 9 | public void wordsBeginningWithVowelSortedByFirstConsonantLetter(String resultFilePath)
throws IOException{
if(text == null) return;
ArrayList<Word> words = text.toWordsList();
for(int i = 0; i < words.size(); i++){
if(!words.get(i).getLeter(0).isVowel()){
... |
a4c19c00-dab5-4bf3-a251-b6c692bd9583 | 8 | public int binarySearch(int begin, int end, int[] A, int target, boolean isLeft) {
if (begin > end) {
return -1;
}
int mid = (begin + end) >> 1;
if (A[mid] == target) {
if (isLeft) {
int left = binarySearch(begin, mid - 1, A, target, isLeft);
return left == -1? mid : mid < left ? mid : left;
} ... |
0b5ca0e1-e44f-46f9-8992-0474f147f69d | 1 | public boolean contains(SootMethod m) {
// TODO Auto-generated method stub
if(route.contains(m))
return true;
return false;
} |
7fb11004-5f15-4dfa-bd63-d9ded8af5545 | 7 | public static Response buildResponseFromWrapper(ResponseWrapper wrapper,
ClientController controller) {
Response response = null;
System.out.println(wrapper.toString());
switch (wrapper.getType()) {
case "LOGIN":
response = new LoginResponse(wrapper.getState(), controller);
break;
case "SENDPLAYER":... |
078bc037-0060-43b4-bbea-15b1eec6dd70 | 8 | private void InitPanel0() { //MAIN MENU
gamePanel[0].setLayout(new GridBagLayout());
/*ImagePanel g = new ImagePanel("C:/Users/user/Desktop/tesSaboteur.png");
//gamePanel[0].add(g, BorderLayout.CENTER);
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 5;
//c.g... |
746cb01f-a46f-486d-b365-08217231a4f8 | 6 | private String id2name(int key) {
switch (key) {
case 0:
return "head";
case 1:
return "body";
case 2:
return "legleft";
case 3:
return "legright";
case 4:
return "armleft";
case 5:
return "armright";
}
return "";
} |
55c87e7a-a39f-425a-a732-e06ad4a4cb9e | 3 | public boolean equals(Object o)
{
if (o == null)
return false;
if (o == this)
return true;
else
{
Vector temp = (Vector) o;
return ((this.getX() == temp.getX()) && (this.getY() == temp.getY()));
}
} |
1dc584a5-e802-405f-b17a-af0d47d3ae97 | 2 | public double getDouble(int index) throws JSONException {
Object object = this.get(index);
try {
return object instanceof Number ? ((Number) object).doubleValue()
: Double.parseDouble((String) object);
} catch (Exception e) {
throw new JSONException("J... |
268ca578-6437-4790-b9f0-dd568caa5128 | 4 | public ArrayList<NewInfWeather> parseString (String str) {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = null;
try {
parser = factory.newSAXParser();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (S... |
f53e5284-1b1a-49b6-9376-6b21ae2d2ece | 1 | private void displayFirst() {
try {
refresh(ekd.first());
} catch (NoEmailKontaktFoundException e) {
refresh(null);
e.printStackTrace();
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.