method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
4fe0e41c-c54e-4ef9-84ad-70a06e7b28dc | 6 | @Override
public void visitInsn(final int opcode) {
// adds the instruction to the bytecode of the method
code.putByte(opcode);
// update currentBlock
// Label currentBlock = this.currentBlock;
if (currentBlock != null) {
if (compute == FRAMES) {
c... |
100b57a2-5c99-4c34-a922-ed508bb2edb3 | 3 | private boolean invalidT(int t, int delta) {
return t > 255 || t < 0 || delta > 255 || delta < 1;
} |
a4aeb88c-6fce-4503-9cd0-65c8ac004d9c | 1 | public boolean operate(T t1, T t2) {
boolean isValid = true;
try {
ValidationHelper.validateValue(t1).against(t2)
.usingValidator(ValidationHelper.isGreaterThan());
} catch (IllegalStateException iSE) {
isValid = false;
}
return isValid;
} |
a55fe98c-0fb4-41a4-91bb-93e5bccdfc74 | 3 | private static void collapseToParent(OutlinerDocument doc) {
try {
if (doc.tree.getComponentFocus() == OutlineLayoutManager.TEXT) {
TextKeyListener.collapseToParent(doc.tree.getEditingNode());
} else if (doc.tree.getComponentFocus() == OutlineLayoutManager.ICON) {
IconKeyListener.collapseToParent(doc.tr... |
0c4b731f-173a-43c8-9af8-2cb716d42a5e | 2 | public Board(Player pl1, Player pl2, boolean show)
{
p1 = pl1;
p2 = pl2;
int dum = 0;
if(p1.isDum())
{
dum++;
}
if(p2.isDum())
{
dum++;
}
moveMax = 100 + 200 * dum;
showStuff = show;
} |
d8ddc176-42b1-4125-a9b3-f08c8ce32d2d | 4 | public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
ServerSocket ss = new ServerSocket(1337);
while (true) {
Socket client = ss.accept();
System.out.println(client.getInetAddress());
while (true) {
String input = new String();
char ch;
do {
ch ... |
cfcb151a-1045-4190-9307-2007e3d689a2 | 3 | private int recruitPay(Player player, UnitType unit)
{
float gold = player.getResource(core.ResourceType.GOLD)/(float)unit.cost.gold;
float wood = player.getResource(core.ResourceType.WOOD)/(float)unit.cost.wood;
float ore = player.getResource(core.ResourceType.ORE)/(float)unit.cost.ore;
float min = getAvailab... |
ce208162-cbcd-4c7a-89a0-76ae9ead8401 | 1 | public BoardCanvas(Shell shell, AbstractGame game) {
super(shell, SWT.NONE);
this.game = game;
int boardWidth = game.getBoardWidth();
int boardHeight = game.getBoardHeight();
cellSize = new CellSizeCalculator(shell).getPixelSize(boardWidth, boardHeight);
if (cellSize > 0)... |
e2445f4b-a51c-46f0-9bde-2614cab62156 | 5 | public static void publicationsDbImportWithCon() throws ClassNotFoundException, SQLException {
Class.forName("org.postgresql.Driver");
Connection c = DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres", "postgres", "qqkfq0513");
Statement stmt = c.createStatement();
S... |
048f8ef1-ce25-4747-b8d8-3605e04f095f | 1 | public Widget addEventWidget(){
VerticalPanel vp = new VerticalPanel();
Label title = new HTML("<h3>Ajouter un événement</h3>");
HorizontalPanel hp1 = new HorizontalPanel();
Label nameEventLabel = new Label("Nom et lieu :");
final TextBox nameEventTextBox = new TextBox();
hp1.add(nameEventLabel);
hp1.add... |
afefab18-d4b3-4f02-a756-e9777eb38cea | 2 | public boolean exits(String filename) {
Iterator<String> it = filetable.keySet().iterator();
while (it.hasNext()) {
Object me = it.next();
if (filename.equals(me)) {
return true;
}
}
return false;
} |
797ec2cb-2a18-426a-8853-1449fb9ac8d8 | 8 | public void optimaze(List<Point> set) {
Random random = new Random();
for (int i = 0; i < set.size(); i++) {
List<Point> emergInCircle = getEmergInCircle(set.get(i));
if (circleEmpty(set.get(i))) {
int rand = random.nextInt(incidents.size());
... |
7382a4d8-c461-4f0d-b195-5840564e55b3 | 3 | public void stopAnimation() {
if(interval < 0) {return;}
if(animation == null) {return;}
if(animation.isRunning()) {animation.stop();}
} |
a708aa0d-e1f8-4f6a-88db-6d519c234180 | 8 | private Vector3f[] calculatefacetNorms(GeometryInfo gi)
{
Point3f coordinates[] = gi.getCoordinates();
Vector3f[] facetNorms = new Vector3f[coordInds.length / 3];
Vector3f a = new Vector3f();
Vector3f b = new Vector3f();
if ((DEBUG & 1) != 0) System.out.println("Facet normals:");
if (gi.getOl... |
dac630ab-12eb-42a2-885d-8c8e6d4b6d8c | 8 | public static void gastkartenmischen() {
for(int j=0;j<2;j++){
for(Land land : Land.values()) {
int anzahl = 2;
if (land == Land.JOKER) {
anzahl = 1;
}
for(int i = 0; i < anzahl; i++) {
for(Geschlecht geschlecht : Gesc... |
6eb86761-86b4-4dd9-bb9f-057eb475c811 | 4 | public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
switch (opcode) {
case Opcodes.INVOKESPECIAL:
invokespecial(owner, name, desc);
break;
case Opcodes.INVOKEVIRTUAL:
invokevirtual(owner, name, desc);
break;
case Opcodes.INVOKESTATIC:
invok... |
584751f2-153c-4bea-a6ca-47be1016afe0 | 8 | private void write() throws IOException {
// port
if(auxport){
ServerSocket foo=new ServerSocket(0);
String snum=(new Integer(foo.getLocalPort())).toString();
byte[] array=snum.getBytes();
out.write(array, 0, array.length);
out.write(0);
out.flush();
auxsocket=foo.acc... |
11019ca3-b8af-4140-bbbd-b691345ca9bd | 5 | private static int[] greedyTour(UndirectedGraph ug){
int N= ug.vertices;
int[] tour = new int[N];
boolean[] used = new boolean[N];
tour[0]=0;
used[0]=true;
for(int i=1;i<N;i++){
int best= -1;
for(int j=0; j<N;j++){
if(!used[j]&&(best==-1 || ug.dist(tour[i-1], j) < ug.dist(tour[i-1],best))){
b... |
9fa2eaa9-07b7-4f25-a3fa-8686e675da42 | 5 | public void allocatePERanges(PERangeList selected,
double startTime, double finishTime) {
// If the time of the last entry is equals to finish time than another
// entry is not required. In this case we just increase the number of
// gridlets that rely on that entry to mark either its completion
// time ... |
3536f756-fa11-4985-b4b0-890c895103e0 | 1 | protected void displayAddonFailureIfIsSet(Exception e) {
if (e != null)
System.err.println( e.getMessage() );
} |
8b13dae6-3052-45bf-9572-3dc7193523da | 4 | private void drawInventory(Graphics g){
int count = 0;
Font itemfont = new Font("SansSerif", Font.BOLD, height/20);
g.setColor(Color.BLACK);
g.setFont(itemfont);
for(int i = 0; i < game.player.inventory.getSize(); i++){
if(count < game.player.inventory.getSize()/2){
if(game.player.inventory.whatsHere(c... |
1c975143-29ad-401c-ae57-88eb24213631 | 9 | @Override
public void render(Graphics g) {
if (type == 0) {
if (direction == 0) {
g.drawImage(tex.enemy[0], (int) x, (int) y, (int) width, (int) height + 12, null);
}
if (direction == 1) {
g.drawImage(tex.enemy[1], (int) x, (int) y, (int) w... |
d66deb67-2c88-4430-a5a8-5444768c2e2e | 5 | private void copyToClipboardWithHead() {
StringBuffer sb = new StringBuffer();
int[] rows = getSelectedRows();
int[] columns = getSelectedColumns();
//复制标题
for(int i = 0; i < columns.length; i++) {
String columnName = getColumnName(columns[i]);
sb.append(columnName);
if (i < columns.length - 1){
... |
3449fea8-c88c-43e1-ad3d-4176b926291f | 7 | private void findClosestDoor(final int target) {
final int doorLoc = Math.max(boardBuffer-1, 0);
final int doorLoc2 = boardSize + boardBuffer;
int possibleDoors[][] = { { board[boardCenter][doorLoc2], boardCenter, doorLoc2 },
{ board[doorLoc][boardCenter], doorLoc, boardCenter },
{ board[bo... |
b35e8214-9b6a-441e-b34b-9f29d380304f | 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() || xa >= width || ya < 0 || ya >= height) break;
if... |
6682b926-d4e4-413d-91b5-c0ca98100b47 | 9 | public String toString() {
String indent = " ";
StringBuffer buf = new StringBuffer();
buf.append(" \"").append(mName).append("\" {\n");
buf.append(indent).append("lastModified = ").append(
mDateFmt.format(new Date(mLastModified))).append("\n");
... |
887fb59a-bf0e-4e40-bd28-56031578298d | 5 | public void carregaGrafo() throws Exception {
BufferedReader br = null;
try {
String linha;
br = new BufferedReader(new FileReader("arquivo.txt"));
String[] value = new String[3];
int v1 = 0;
int v2 = 0;
int peso = 0;
while ((linha = br.readLine()) != null) {
value = linha.spli... |
b809521d-ef66-4b0c-8186-65518d800829 | 0 | public int getX() { return loc.x; } |
02c37bb7-c643-44e3-aad3-0f81c573078b | 5 | public boolean onCommand(CommandSender sender, Command cmd,
String commandLabel, String[] args) {
if (commandLabel.equalsIgnoreCase("checkban")) {
if (sender.hasPermission(SeruBans.CHECKBANPERM) || sender.isOp()
|| (!(sender instanceof Player))) {
Str... |
2a692f53-3d11-43ae-b574-ff2de391dfba | 9 | public boolean equals(Object object) {
if (this == object)
return true;
if (!(object instanceof AccessRuleSet))
return false;
AccessRuleSet otherRuleSet = (AccessRuleSet) object;
if (this.messageTemplates.length != MESSAGE_TEMPLATES_LENGTH ||
otherRuleSet.messageTemplates.length != MESSAGE_TEMPLATES_L... |
ee235178-c1da-41d0-b359-f90e30aabc2a | 6 | @Override
public void run() {
while(true){
beforeTime = System.nanoTime();
gameUpdate();
gameRender();
paintScreen();
afterTime = System.nanoTime();
diff = afterTime - beforeTime;
sleepTime = (period - diff) - overSleepTime;
if(sleepTime < period && sleepTime > 0){
tr... |
6d4eed3c-21d2-41dc-be41-5e297c88f58d | 6 | public void firstBreakCommit()
{
QueryWarehouse bank = new QueryWarehouse();
String query = "";
this.connect();
Statement stmt = null;
try
{
stmt = conn.createStatement();
}
catch(Exception e... |
30efd5c5-bdbc-47d2-a48f-7f1f0f939186 | 7 | @Override
public void initialize(URL url, ResourceBundle rb) {
listViewHelp.getSelectionModel().selectedItemProperty().addListener(
new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> ov, String t, String t1) ... |
926ce71c-b8d6-413f-b216-1a5220014993 | 1 | public T next() {
if(!hco)
throw(new NoSuchElementException());
T ret = co;
f();
return(ret);
} |
2685b13d-2766-4d27-a5ba-3933d7341b48 | 4 | private Map<String, String> parseQuery(String uri) {
Map<String, String> params = new HashMap<String, String>();
try {
for (String pair : uri.split("[?]")[1].split("&")) {
String[] keyval = pair.split("[=]", 2);
if (keyval.length == 1) {
params.put(keyval[0], null);
} else {
try {
pa... |
a4194014-6ae8-4dcc-86e4-bd3f72b4aaeb | 0 | public float getMaxSpeed() {
return 0.5f;
} |
afc4ff11-6890-4092-b73c-bd8970e56644 | 5 | @Override
public void update(long deltaMs) {
if(targetX < 0 || targetY < 0 || timeForNewTarget) {
getTarget();
}
if(targetX >= 0 && targetY >= 0) {
move();
}
} |
fdb9d7ee-b9c8-4d10-ac8e-d06b8cf20d0f | 8 | public String getSelectedPagesNumbersText() {
int[] nums = getSelPgsNumbers();
StringBuilder sb = new StringBuilder();
int num = Integer.MAX_VALUE;
int pnum = Integer.MAX_VALUE;
int s = Integer.MAX_VALUE;
int dif;
for (int i = 0; i < nums.length; i++) {
num = nums[i];
dif = num - pnum;
if (dif > ... |
1475ea9e-643a-4a3d-be51-d0e8dbf3e0e5 | 0 | public String getName() {
return name;
} |
416e9abf-a64b-4980-9adc-1675905aaffd | 9 | protected synchronized void success() {
if (debug) {
System.out.println(name + " success");
}
if (abort)
return;
count++;
Thread.yield();
boolean better = updateBest();
if (isOption(BETTER)) {
if (monitor != null) {
// monitor.addData(this, bestValue);
int value = solution.getObjectiveInt... |
68f6c652-549d-49de-9d95-50eb7c2e16e2 | 0 | @Override
public void print(String str) {
} |
8344a935-b0f6-4656-8599-8e8504d49875 | 1 | public void insert(String table, Map<String, Object> content) {
builder.append("INSERT INTO ").append(table);
values = new StringBuilder(32);
values.append(" VALUES(");
columns = new StringBuilder(128);
columns.append('(');
for (Map.Entry<String, Object> pair: content.entrySet()) {
columns.app... |
7e8a8144-c447-4ff7-996c-ba0d12f210a2 | 1 | @Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
} |
aac06b88-240b-4aa1-bebd-f483f98ca69c | 9 | public static Mob create(int unitClass, Player player) {
Mob unit = null;
if (unitClass == UNIT_POLAND) unit = new Poland(player);
if (unitClass == UNIT_GERMANY) unit = new Germany(player);
if (unitClass == UNIT_NETHERLANDS) unit = new Netherlands(player);
if (unitClass == UNIT_FRANCE) unit = new France(playe... |
2dec6561-fecc-43e7-b049-e21e752940b4 | 2 | private void declaration() {
if (first(f_var_decl)) {
var_decl();
}
else if (first(f_const_decl)) {
const_decl();
}
else
parse_error("oops -- declaration bad first");
} |
7b4ca25a-3631-466c-8f86-89226f952be9 | 7 | public void testPresent8() {
try {
TreeNode result = contains(new TreeNode(new String("node")), mkChain(new String[]{ new String("node") }));
assertTrue(null, "Failed to locate the only node of a leaf!",
result != null
&& result.getData() != null
... |
670823f9-d11c-4ce9-bdb0-91b04e2b256b | 7 | public int search(int[] A, int target) {
int left = 0, right = A.length - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (A[mid] == target) {
return mid;
} else {
if (A[mid] >= A[left]) {
if (target >= A[left] && target < A[mid]) {
right = mid - 1;
} else {
... |
5e12e969-765d-4836-8025-78614d5fb66c | 2 | public static void reset(String TableNum) //resets button when table is freed up
{
for(int x=0; x<9; x++) //loops until finds table#
{
if(((AbstractButton) panel.getComponent(x)).getText().equals(TableNum))
{
((AbstractButton) panel.getComponent(x)).setIcon(free); //changes icon back
... |
5b7cab8d-8e4f-484a-ae1e-4607f2f743d4 | 8 | public void parseCoach(Document doc, String url, Connection conexion) throws SQLException, ParseException{
String[] coachInfo = new String[7];
Integer id = Integer.valueOf(url.replaceAll("\\D+", ""));
//get the nickname
coachInfo[2] = doc.select("title").text().split(",")[0];
... |
3c3fd040-ff11-4959-848e-2b1b64595516 | 3 | @Override
public File nextOutputFolder() {
if (!basedir.exists()) {
basedir.mkdirs();
}
File[] files = basedir.listFiles(new FF());
int no = 0;
if (files != null && files.length > 0) {
Arrays.sort(files, new Comparator<File>() {
@Overr... |
f750220a-5c25-423b-bd57-6302b341fb8d | 3 | public static void main(String[] args) {
Funcion rectaNormal = new Funcion() {
@Override
public double f(double x) {
return x;
}
@Override
public double f(double x, double y) {
return 0;
}
@Over... |
7322382e-1800-43ba-9e90-09d57ab53b56 | 9 | public int[][] parseHCP() {
boolean success = false;
// Keep trying if file not found
while (!success) {
System.out.print("Enter filename (or 000 to exit): ");
this.file = in.nextLine();
if (file.trim().equals("000")) {
System.out.println("Program Terminated");
System.exit(0);
}
try {
... |
e971a775-5bc0-43fa-89be-aca439c11b0f | 8 | public void start() {
if (applet != null) {
applet.start();
return;
}
if (gameUpdaterStarted) return;
Thread t = new Thread() {
public void run() {
gameUpdater.run();
try {
if (!gameUpdater.fatalError)
replace(gameUpdater.createApplet());
... |
7f9bfe0c-be84-4ffa-a612-c7f60dd6296a | 1 | public PlayerInfo(Player p) {
if (p == null)
throw new IllegalArgumentException("The given Player is invalid!");
this.player = p;
} |
c0274f04-9b19-4ffd-86c8-07509ee59ff4 | 6 | public String dbgPrintBytesBefore() {
int l = 20;
int r = 20;
if (this.pos+r > this.length)
r = this.length - this.pos;
if (this.pos-l < 0)
l = this.pos;
int len = r + l;
byte[] chunk = new byte[len];
System.arraycopy(src, pos - l, chunk... |
8adacb47-d1b6-4d7e-890d-568d2b67633b | 6 | public static String concatPath(String base, String file) {
if (base == null
|| file.startsWith("/")
|| file.startsWith("\\")
|| (file.length() >= 2 && file.charAt(1) == ':')
|| isUrl(file))
return file;
int cut = Math.max(base.lastIndexOf('/'... |
9fdc280e-9b91-4d7b-874e-cf7e41cb9d43 | 0 | public int getHeight() {
return height;
} |
57daf91c-e46b-455e-a2ac-b721431ad593 | 5 | private void deleteBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteBtnActionPerformed
// TODO add your handling code here:
int index = paymentList.getSelectedIndex();
try {
String stuID = payingStudent.getStudentID();
String payID = listPay.get... |
cc7ab563-de85-4c4b-b8b4-b2be8db518a8 | 6 | @Override
public int attack(NPC npc, Entity target) {
final NPCCombatDefinitions defs = npc.getCombatDefinitions();
TormentedDemon torm = (TormentedDemon) npc;
int hit = 0;
int attackStyle = torm.getFixedAmount() == 0 ? Utils.getRandom(2)
: torm.getFixedCombatType();
if (torm.getFixedAmount() == 0)
to... |
9795da3d-0d1b-4cda-af48-761df2b1b30a | 0 | public void treeNodesChanged(TreeModelEvent e) {
invalidate();
} |
dc0e57dd-3dbc-4ec3-890e-fed551d39421 | 5 | private void checkAll() {
if( jText == null ) {
//the needed objects does not exists
return;
}
if( dictionary == null ) {
removeHighlights( jText );
return;
}
if( jText.getDocument().getLength() == 0 ){
// no text, no hi... |
dbbb163a-28b2-4db4-9de2-ef6a4f21c5a1 | 8 | boolean setTabGroupFocus(boolean next) {
if (isTabItem())
return setTabItemFocus(next);
boolean takeFocus = (style & SWT.NO_FOCUS) == 0;
if ((state & CANVAS) != 0)
takeFocus = hooksKeys();
if (socketHandle != 0)
takeFocus = true;
if (takeFocus && setTabItemFocus(next))
return true;
Control[] chi... |
e2d11874-349c-443c-bbee-91a9377ca7f8 | 2 | private PlayerInfo[] getPlayerInfoArray() {
List<Player> players = new ArrayList<Player>(presenter.getClientModel().getServerModel().getPlayers());
players.removeAll(Collections.singleton(null));
PlayerInfo[] playerInfoArray = new PlayerInfo[players.size()];
for (int i = 0; i < players.size(); i++) {
P... |
4ae24ae9-71cb-42b0-af6d-9c81cd48605e | 7 | public void test() {
int N = 1000;
// Test N times
// - Create a random gene transcript, exons
// - Change each base in the exon
// - Calculate effect
for (int i = 0; i < N; i++) {
initSnpEffPredictorRand();
if (debug) System.out.println("MNP Test iteration: " + i + "\nChromo:\t" + chromoSequence + ... |
e6aa601f-e83f-4215-abb0-cc025e9a6800 | 6 | public String longestCommonPrefix(String[] strs) {
if (strs == null || strs.length == 0)
return "";
int minL = Integer.MAX_VALUE;
for (String str : strs) {
minL = Math.min(minL, str.length());
}
StringBuilder result = new StringBuilder();
for (int i = 0; i < minL; i++) {
char c... |
31441513-cf98-45d1-a60b-4bb7158a920f | 2 | public static final void skipFully(InputStream in, long length) throws IOException {
long total = 0;
long skipped = 0;
while (total < length && (skipped = in.skip(length - total)) > 0) {
total += skipped;
}
} |
6a96ad99-5822-4d8c-8ee6-5ffcbd3d5867 | 4 | public static boolean isConsistent(int[] result, int N) {
for (int i=0; i<N; i++) {
if(result[N] == result[i]) return false;
if(result[N] - result[i] == N - i) return false;
if(result[N] - result[i] == i - N) return false;
}
return true;
} |
ae1776c4-97cb-4c46-874e-01721ab17849 | 8 | private List<SequenceAnnotation> getORFsForFrame(Sequence seq, int startSite) {
List<SequenceAnnotation> orfs = new ArrayList<SequenceAnnotation>();
StringBuilder codon = new StringBuilder();
boolean inORF = false;
int currentStart = 0;
//System.out.println("Starting at site: " + startSite + " base is : " ... |
9063bdc1-3226-45ec-910d-3803b2528af3 | 8 | private void cppCreateClientStubHeader() throws ClassNotFoundException
{
out.println("/* Generated with cppToJavaRpcStubGenerator by github.com/danfickle */");
out.println("#ifndef " + classNameWithUnderscores.toUpperCase());
out.println("#define " + classNameWithUnderscores.toUpperCase());
o... |
3e9aa475-64d3-48e4-876b-1e02ffc3a361 | 7 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected==null)||(!(affected instanceof MOB))||(target==null))
return super.okMessage(myHost,msg);
final MOB mob=(MOB)affected;
if(msg.amISource(mob)
&&(msg.amITarget(target))
&&(msg.targetMinor()==CMMsg.TYP_DAMAGE))
... |
97de50fe-9a8a-47f5-851c-dc7665c01770 | 9 | @Override
public Object execute(TransitionSystem ts, Unifier un, Term[] terms) throws Exception {
WorldModel model = ((MartianArch) ts.getUserAgArch()).getModel();
Vertex myPosition = model.getMyVertex();
List<Entity> opponents = model.getActiveOpponentsOnVertex(myPosition.getId());
if (!opponents.isEmpty()... |
114a2ca1-4e96-40ed-aa69-0540c0a75bfd | 0 | public Clock getTimeStamp(){
return this.timeStamp;
} |
fe113c39-d670-42a8-8bd9-67be6d3aa861 | 9 | public void addClientBehavior(String eventName, ClientBehavior behavior) {
assertClientBehaviorHolder();
// First, make sure that the event is supported. We don't want
// to bother attaching behaviors for unsupported events.
Collection<String> eventNames = getEventNames();
// ... |
6df78a00-6343-4dff-bbaa-9fd5468ec779 | 5 | public static byte[] decodeLines (String s) {
char[] buf = new char[s.length()];
int p = 0;
for (int ip = 0; ip < s.length(); ip++) {
char c = s.charAt(ip);
if (c != ' ' && c != '\r' && c != '\n' && c != '\t')
buf[p++] = c; }
return decode(buf, 0, p); } |
4effce7e-9175-4e83-90c3-0722b5fe40d1 | 6 | public static String[] splitByNonNestedChars(String s, char... c){
//get setup
int parDepth = 0;
String chars = new String(c);
ArrayList<String> parts = new ArrayList<String>();
//search for matches
for(int i = 0; i < s.length(); i++){
if(s.charAt(i) == '(') parDepth++;
else if(s.charAt(i) == ')') par... |
b2c6a1e0-8809-4c34-9ce3-1b81bd497441 | 6 | public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if(enabled){
if(command.getName().equals("tpall")){
if(sender instanceof Player){
Player p = (Player) sender;
if(p.hasPermission("tcl.tp.all")){
Location loc = p.getLocation();
for(Player pl ... |
e2792c90-82b9-4e98-a869-2cb5864d03ef | 6 | @Override
public int hashCode() {
int hash = 5;
hash = 59 * hash + (int) (this.id ^ (this.id >>> 32));
hash = 59 * hash + (this.datum != null ? this.datum.hashCode() : 0);
hash = 59 * hash + this.bewertung;
hash = 59 * hash + (this.titel != null ? this.titel.hashCode() : 0);
... |
b066c492-b4d0-4783-b59d-68716594a98a | 0 | public TransformRawDataTest() {
} |
2b1a84f5-fafb-4509-accb-6abee42d8c38 | 8 | public void serviceChanged(ServiceEvent event) {
synchronized (m_refList) {
// Add the new dictionary service to the service list.
if (event.getType() == ServiceEvent.REGISTERED) {
// Get the service object.
Object service = m_context.getService(event.getServiceReference());
// Make that the servic... |
57fc8044-a63e-4f91-bb73-104d97d1c628 | 3 | public static ArrayList<Innlegg> hentInnOrd(){
//Oppretter variabler av type String som senere blir tildelt verdi
String norskOrd, engelskOrd;
//Lager en Arraylist som sender til tilleggsklassen "Innlegg"
ArrayList<Innlegg> Innleggsliste = new ArrayList<Innlegg>();
//Oppretter variabler av type int som sen... |
27c8d622-6191-468a-9245-f77b621ad947 | 7 | @Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("giveleash") && args.length == 1) {
if (!(sender instanceof Player)) {
sender.sendMessage("This command can only be run by a player.");
} else {
@SuppressWarnings("dep... |
0129e7ab-b252-49a5-8adf-3fc1232c5266 | 9 | public void setFilter(weka.filters.Filter c) {
boolean loadImages = true;
if (c.getClass().getName().
compareTo(m_Filter.getClass().getName()) == 0) {
loadImages = false;
}
m_Filter = c;
String filterName = c.getClass().toString();
filterName = filterName.substring(filterName.
i... |
32bfc33a-e381-4087-b2b0-7e019f343827 | 6 | static final void method2062(byte i) {
if (Message.aClass338Array2034 != null) {
for (int i_3_ = 0;
(Class239_Sub26.anInt6115 ^ 0xffffffff) < (i_3_ ^ 0xffffffff);
i_3_++)
Message.aClass338Array2034[i_3_] = null;
Message.aClass338Array2034 = null;
}
anInt3480++;
if (Class318_Sub1_Sub3_Sub4.aClass33... |
574bf13a-5e5e-4395-a0cf-dfd82e933756 | 6 | @EventHandler
public void GiantFireResistance(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.getGiantConfig().getDouble("Giant.Fir... |
0385bbd1-9829-4401-9007-8ea51126b20f | 2 | public ProjectileManager(World world) {
bullets=new Bullet[MAX_BULLETS];
decals=new Decal[MAX_DECALS];
for (int i=0; i<MAX_BULLETS; i++) {
bullets[i]=new Bullet();
bullets[i].addToWorld(world);
}
for (int i=0; i<MAX_DECALS; i++) {
decals[i]=new Decal();
... |
e11a20ae-47af-4d22-949f-d5677d968c4a | 9 | public String selectBothParameter(String objectName,String parameter,String parameter2)
{
StringBuilder sb = new StringBuilder();
Object o= list.get(objectName);
if(o!=null){
if(o.getName()[0].equals(parameter)&&o.getName()[1].equals(parameter2))
{
sb.append("... |
38fb9630-5c9e-49bc-87b0-aa876e8f27e9 | 9 | private void popup (MouseEvent e) {
if (!e.isPopupTrigger()) {
return;
}
{
int r = rowAtPoint(e.getPoint());
int c = columnAtPoint(e.getPoint());
if (!(r >= 0 && c >= 0)) {
return;
}
if (!isCellSelected(r, c)) {
clearSelection();
addRowSelectionInterval(r, r);
addColumnSel... |
68f9d6f6-0e3f-457a-b48a-3c06edee83ec | 8 | public boolean stem() {
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 72
// do, line 74
v_1 = cursor;
lab0: do {
// call mark_regions, line 74
... |
5e17d6c6-1c3c-4e97-90ef-657c191d8fb9 | 3 | public VariableStack mapStackToLocal(VariableStack stack) {
VariableStack newStack;
int params = instr.getFreeOperandCount();
if (params > 0)
this.stack = stack.peek(params);
if (instr.getType() != Type.tVoid) {
pushedLocal = new LocalInfo();
pushedLocal.setType(instr.getType());
newStack = stack.p... |
c3af5100-8d63-4da4-bd45-fbe6f757cb7c | 9 | dxVertexLayout(DirectxToolkit class378, Class58[] class58s) {
VertexElementCollection vertexelementcollection
= new VertexElementCollection(((DirectxToolkit) class378).aHb9788);
int i = 0;
for (int i_0_ = 0;
(class58s.length ^ 0xffffffff) < (i_0_ ^ 0xffffffff); i_0_++) {
int i_1_ = 0;
Class58 cl... |
5c4f841a-5b30-4145-82ec-f75433b61860 | 7 | public void interact(ThePlayer p)
{
if (given == false)
{
p.getFFCharacter().giveItem(containedItem);
System.out.println("Thou hast obtained ye " + containedItem.toString());
given = true;
if (containedItem instanceof Weapon)
{
... |
70715bf1-1346-49f0-8e0d-ae6b881061b3 | 6 | public void getauthors(int layer,List<String>list)
{
if(layer>2)
{
return;
}else{
for(String id:list){
if(!totalpaper.contains(id)){
List<String>tmp=getAuthorList.getAuthors(Integer.parseInt(id));
for(String au:tmp){
if(!authors.contains(au))
authors.add(au);
}
List<Str... |
aca76b50-627e-42f3-a257-02812bbd38d3 | 0 | public NbrCostPair(Neighbor nbr, int cost) {
this.nbr = nbr;
this.cost = cost;
} |
ee3b68a0-f144-4bdc-b33d-bb321a379d9d | 3 | protected void splitSon(Object node){
int location= 0;
boolean found= false;
while (!found){ //locates the son that needs to be split
if (this.pointers.elementAt(location) == node)
found= true;
else
location++;
}
if (this.pointers.elementAt(location) instanceof Leaf) //calls for a help method to... |
655605d9-e4b5-46ed-9f3c-d0d8deada9c1 | 6 | public void solve() {
ArrayList<int[]> prePSemiFlows = getPSemiFlows();
ArrayList<int[]> finalPSemiFlows = new ArrayList<int[]>();
for (int i = 1; i < prePSemiFlows.size(); i++) {
Set<Set<int[]>> subSetSemiFlows = getCombinationsFor(prePSemiFlows, i);
for (Set<int[]> set ... |
7c58e525-33a8-4794-ba94-d360f539c207 | 2 | public static void main(String[] args) {
new Thread(new Runnable() {
@Override
public void run() {
while (!Thread.currentThread().isInterrupted()) {
shared();
}
}
}).start();
new Thread(new Runnable() {
@Override
public void run() {
while (!Thread.currentThread().isInterrup... |
55949991-3321-4aa8-bcf9-74bca1a7b94f | 0 | public void applyGravity() {
floorDistance = 0;
} |
6bba1a27-b9dc-41e6-8d86-7a1796a23be9 | 1 | public List<UserDTO> getDataToTable() {
try {
splashWindow = new SplashWindow(this, "359.gif");
List<UserDTO> usersList = requests.getAllUsers();
requests.crossPoint(splashWindow);
return usersList;
} catch (Exception except) {
JOptionPane.showMessageDialog(null,
"Sprawdz polaczenie z internete... |
0b0936f2-831a-45e9-8da4-4dac61e093cb | 2 | private void buildFinalFieldList() {
// set field values foreach ship which was placed
for (Ship s : ships) {
// Just call it once
ArrayList<Coordinates> coordinates = s.getCoordinates();
for (Coordinates c : coordinates) {
getFields()[c.getY()][c.ge... |
1a51397c-a260-45a5-9af5-834de86ff296 | 0 | public void setCountry(String country) {
this.country = country;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.