method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9560409c-c7bd-46f0-acee-ad4a900a97d2 | 4 | private int getMakeNextId() {
String text = ctx.widgets.component(WIDGET_INSTRUCTION, WIDGET_INSTRUCTION_CHILD).text();
if (text.equals("Helm")) {
return 20572 + options.ingotType.ordinal() - 1 + (20 * options.ingotGrade.ordinal());
} else if (text.equals("Boots")) {
return 20577 + options.ingotType.ordinal... |
9338f429-5bb5-4eec-aa85-5fc0b10c53da | 6 | public boolean getBoolean(int index) throws JSONException {
Object o = get(index);
if (o.equals(Boolean.FALSE) ||
(o instanceof String &&
((String)o).equalsIgnoreCase("false"))) {
return false;
} else if (o.equals(Boolean.TRUE) ||
(o in... |
67c28e50-b0ed-4a23-bf75-945ec5489f6d | 9 | protected static String processShortQuote(String text) {
StringBuilder output = new StringBuilder(400);
QuoteOrigin Origin = Processors.getOrigin(text);
text = RegEx.removeAll(text, SHORT_QUOTE_PATTERN);
String[] arr;
arr = text.split("\\|");
switch (Origin) {
... |
61f714d5-5c9b-4ad2-ae33-0c7bf3cc6118 | 5 | public Object nextEntity(char ampersand) throws JSONException {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (Character.isLetterOrDigit(c) || c == '#') {
sb.append(Character.toLowerCase(c));
} else if (c == ';') {
... |
8ba1ed0f-29db-43b7-968e-a124896b99f4 | 1 | public void switchBlockColor(int type) {
if(this.type != -1){
this.type = -1;
} else{
this.type = type;
}
} |
52ff456b-fee0-4933-93ab-8cce45e57f52 | 8 | public static Double[][] removeZeroCoefs(Double[][] a){
List<Double> coefs = new ArrayList<Double>();
List<Double> powers = new ArrayList<Double>();
for(int i = 0; i<a[0].length; i++){
if( a[0][i]!=null){
coefs.add(a[0][i]);
powers.add(a[1][i]==null?0... |
cc49dedb-63e6-432e-a39a-72100010d825 | 0 | @Override
public boolean supportsDocumentAttributes() {return true;} |
469418d0-fdfd-4cb6-8666-ec43700aba50 | 1 | public void renderButton(Graphics g, Rectangle r, String s)
{
if(r.contains(Main.mse))
{
g.drawImage(MenuRenderer.Button2, r.x, r.y, r.width, r.height, null);
}
else
{
g.drawImage(MenuRenderer.Button1, r.x, r.y, r.width, r.height, null);
}
g.setFont(new Font(Font.SANS_SERIF, 0, r.height/2));
g.dr... |
31904a90-5098-40a7-962b-73ce2001530f | 9 | private void genIfZeroStmt(final IfZeroStmt stmt) {
int opcode;
stmt.expr().visit(this);
genPostponed(stmt);
final int cmp = stmt.comparison();
if (stmt.expr().type().isReference()) {
switch (cmp) {
case IfStmt.EQ:
opcode = Opcode.opcx_ifnull;
break;
case IfStmt.NE:
opcode = Opcode.op... |
57e2ab55-b0e2-4a4c-9c20-9850bf7bf7b7 | 4 | public Type getComponent() {
if (this.clazz == null || !this.clazz.isArray())
return null;
CtClass component;
try {
component = this.clazz.getComponentType();
} catch (NotFoundException e) {
throw new RuntimeException(e);
}
Type type ... |
6964f71f-f4fc-4c43-8536-3c3046f42dee | 5 | public void attack(int attDir, int damage){
Rect weaponCollision = null;
if(attDir == 0) weaponCollision = new Rect(x + 13, y - 16, 7, 16);
if(attDir == 1) weaponCollision = new Rect(x + 29, y + 18, 22, 7);
if(attDir == 2) weaponCollision = new Rect(x + 13, y + 32, 7, 24);
if(attDir == 3) weaponCollision =... |
7916e569-c9e0-468b-8467-52415142b40a | 4 | public int interseca( GrupCaselles grupB )
{
int contador = 0;
ArrayList<Casella> CasellesB = grupB.getGrup();
for ( int i = 0; i < grup.size(); i++ )
{
if ( tauler.getEstatCasella( grup.get( i ) ) == EstatCasella.BUIDA )
{
for ( int j = 0; j < CasellesB.size(); j++ )
{
if ( grup.get( i ).eq... |
35b4728c-5eb3-400a-9bed-e12f329802fd | 6 | public static void merge(int[] array,int start,int mid,int end){
int[] left = new int[mid-start+1]; //need to add 1 ex: index is form 0 to 3 there are 4 elements;
int[] right = new int[end - mid];
for(int i=0; i<left.length;i++){
left[i] = array[start+i];
}
for(int i=0; i<right.length;i++){
right[i] ... |
76c2eef7-605f-4696-a2eb-5640cb26a82c | 4 | @SuppressWarnings("unchecked")
public QuizServer decodeData() throws RemoteException {
QuizServer serverState = null;
XMLDecoder decode = null;
if (!getSerializationFile().exists() || getSerializationFile().length() == 0) {
return new QuizServer();
}
try {
... |
6e44d859-e1fd-45ca-8c6d-e01ba52c981a | 9 | @Override
public void tick(int time) {
boolean inputChanged = false;
for (int i = 0; i < input.length; i++) {
if (events[i].isEmpty()) break;
while(events[i].peek().time < time) events[i].poll();
Event e = events[i].peek();
if (e.time == time) {
... |
1248a73a-2041-4c0b-86ee-7e15bb5d5f8b | 4 | private void getParameters(String inputFileName){
new GetComments();
//first the number of rows and columns is retrieved
String rowsN=TextIO.getWord();
//if(!rowsN.equals("Rows:")){
//throw new RuntimeException("The file format is not correct. Rows: keyword is absent");
//}
//System.out.pr... |
e5d1c167-b2df-4e1a-bad2-48b934256d46 | 2 | double[][] compf(double[][] D, int m) {
int s = D.length, r = 0;
if (s == 0) {
return null;
} else {
r = D[0].length;
}
double F[][] = new double[s][];
for (int i = 0; i < s; i++) {
F[i] = compob(D[i]);
}
return F;
} |
be047cd3-fbda-4b56-b064-dbd404f66cc9 | 8 | private void drawTooltip()
{
if(menuActionRow < 2 && itemSelected == 0 && spellSelected == 0)
return;
String s;
if(itemSelected == 1 && menuActionRow < 2)
s = "Use " + selectedItemName + " with...";
else
if(spellSelected == 1 && menuActionRow < 2)
s = spellTooltip + "...";
else
s = menuActionNa... |
5fcf7ff6-20f1-4c77-9be2-601eb5c937a7 | 7 | public void generateMaps() throws MaltChainedException {
for (String groupname : optionGroups.keySet()) {
OptionGroup og = optionGroups.get(groupname);
Collection<Option> options = og.getOptionList();
for (Option option : options) {
if (ambiguous.contains(option.ge... |
12576b2a-3cb8-4640-8e39-db68dcc91873 | 7 | private void initNameListFontMenu(Color bg) {
this.nametextListPanel = new JPanel();
this.nametextListPanel.setBackground(bg);
this.nametextListPanel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
String initFontTmp = this.skin.getNametextFont();
int initFontSizeTmp = th... |
abc5ffbe-076a-425a-b6b9-b88afd917897 | 0 | @Override public void finishPopulate()
{
} |
76391333-39e7-401c-a905-011c02c1b8f8 | 0 | public static String getServidor() {
return servidor;
} |
c59d6902-821a-4ac8-a1fe-dd42fd94d15a | 0 | public void add(String name, Object prototype) {
prototypes.put(name, prototype);
} |
b559f059-f359-4a04-a744-f6ed5847be2b | 9 | private MapperEstimatedJvmCost estimateBasedOnRules(JvmModel fMapPhaseMax, float fix, float eTempObj, boolean splitChanged) {
// estimate the Perm Generation
float ePermUsed = fMapPhaseMax.getPermUsed();
float ismb = newConf.getIo_sort_mb();
float eOU;
float eNGU;
float eHeapU = 0;
String reason;... |
2afd4371-41d5-4b83-b364-c626d24972ea | 6 | @Override
public void action() {
TreeMap<Integer, Integer> answer = notWantedColor(100, couleurNonVoulue);
String data = CentralIntelligenceAgency.treeToString(answer);
ACLMessage msg = new ACLMessage(ACLMessage.REQUEST);
msg.setContent(data);
msg.addReceiver( new AID( arbitre, AID.ISLOCALNAME) );
... |
93ec9c69-13ec-42ab-9bf9-5c692577ce09 | 6 | public static void main(String[] args){
int a = 0;
int b = 0;
int c = 0;
// range, die durchlaufen wird
int range = 10;
// durch die verschachtelte Schleifen werden alle
// Wertkombination in range
// durchlaufen und jeweils das maximum errechnet
while(a < range){
while(b < range){
while(... |
1f42b2fa-6f3d-4bf3-83af-4763970ad65f | 0 | public static List<Offrir> selectOneByRapNum(EntityManager em, int rap_num) throws PersistenceException {
List<Offrir> desOffrirs=null;
Query query = em.createQuery("select v from Offrir v where v.rap_num = :rap_num ");
query.setParameter("rap_num", rap_num);
desOffrirs=query.getResultLi... |
0c3132b1-a52e-4441-9226-9c1207acbc9f | 0 | public void setDataEvasione(Date dataEvasione) {
this.dataEvasione = dataEvasione;
} |
8a917aa4-17f4-4113-bbfd-d730c09e6e92 | 0 | public void setFunUsuario(String funUsuario) {
this.funUsuario = funUsuario;
} |
89a4e438-724a-4b5f-8e37-ad635b031784 | 7 | protected void genArmorCode(MOB mob, CharClass E, int showNumber, int showFlag, String FieldDisp, String Field)
throws IOException
{
if((showFlag>0)&&(showFlag!=showNumber))
return;
mob.tell(showNumber+". "+FieldDisp+": '"+CharClass.ARMOR_LONGDESC[CMath.s_int(E.getStat(Field))]+"'.");
if((showFlag!=showNumb... |
6ffe04b3-7bfb-4509-98e7-9fa771cb11f9 | 9 | private boolean buildFriendsListMenu(Interface component) {
int i = component.contentType;
if (i >= 1 && i <= 200 || i >= 701 && i <= 900) {
if (i >= 801) {
i -= 701;
} else if (i >= 701) {
i -= 601;
} else if (i >= 101) {
... |
66529879-b56f-4118-bcf3-5ece477a5c68 | 4 | public String toString() {
MyStack<E> temp = new ArrayStack<E>();
StringBuffer sb = new StringBuffer();
sb.append("front [ ");
/*print elements of out */
while(!out.isEmpty()){
sb.append(out.peek() + " ");
temp.push(out.pop());
}
sb.append("| ");
while(!temp.isEmpty()){
out.push(temp.... |
01aaaaa8-13a5-4c01-ac9b-de61cdcdc599 | 5 | private void sendSharesToOthers(ShamirShare shamir) throws IOException {
try {
otherServerIP = getOtherServerIP();
} catch (UnknownHostException e) {
System.out.println("Cannot get other server's IP.");
e.printStackTrace();
}
ArrayList<SendingThread> sendingThreads = new ArrayList<SendingThread>();
... |
8c53d5c6-0ec0-403b-97ed-6e2dffd6fd38 | 3 | public static void main(String[] args) {
// print all permutations method 1
generatePermutations(new int[3], 2);
// print all permutations method 2
int[] p = {0, 1, 2, 4};
int cnt = 0;
do {
System.out.println(Arrays.toString(p));
if (!Arrays.equal... |
9d1ee95d-125d-4990-b7f9-5550acfb77be | 1 | public Map<String, String> check() throws IOException {
IDGrabber grabber = new IDGrabber(link);
grabber.grab();
Map<String, String> updates = grabber.writeToFile();
if (updates.isEmpty()) {
System.out.println("Scanning......");
} else {
System.out.print... |
5c6ac356-2512-4d7b-9851-cb9c9151cd08 | 4 | @Test
public void testMonsterDiff(){
charTest.setPlayerLvl(2);
testMons.genMonster(charTest.getPlayerLvl());
if (testMons.getName().equalsIgnoreCase("Valefor")){
assertEquals(350, testMons.getHealth());
assertEquals(20, testMons.getDamage());
}
else if... |
1734750a-8be7-4a56-80a5-f8dc0abe21d9 | 8 | private void lookForVariableAccess(OptFunctionNode fn, Node n)
{
switch (n.getType()) {
case Token.DEC :
case Token.INC :
{
Node child = n.getFirstChild();
if (child.getType() == Token.GETVAR) {
int varIn... |
e01a9d62-ba32-4a89-8d43-7ecd4bd75a48 | 5 | private void stressDistribution(Node from, Node to, Dijkstra dijkstra)
{
for(Node n : graph.getNodes())
{
if( n.getId() == from.getId() || n.getId() == to.getId())
continue;
ArrayList<Integer> al = dijkstra.getPathTo(to);
if(al.contains(n.getId()))
{
Integer count = stressDistribution.get(... |
66d5954a-6b47-4d66-9ef7-e20d29e36f0f | 1 | @Override
public void run() {
Loader loader = new Loader();
try {
loader.setUrl(url);
loader.load();
System.out.println(i);
} catch (Exception e) {
e.printStackTrace();
}
} |
ac6d8f51-ffd7-4ec4-9734-b3e42cc4489a | 9 | public boolean equals(HPDAddressModel address) {
if (address == null) {
return false;
}
return StringUtils.equalsIgnoreCase(this.getAddressTypeId(), address.getAddressTypeId())
&& StringUtils.equalsIgnoreCase(this.getAddressLine1(), address.getAddressLine1())
... |
1f6d2984-3a71-4847-84ac-fc23d536d1d2 | 1 | public void testIsAfter_TOD() {
TimeOfDay test1 = new TimeOfDay(10, 20, 30, 40);
TimeOfDay test1a = new TimeOfDay(10, 20, 30, 40);
assertEquals(false, test1.isAfter(test1a));
assertEquals(false, test1a.isAfter(test1));
assertEquals(false, test1.isAfter(test1));
assertEqua... |
bbc299b6-0911-4412-8045-78a68add5488 | 4 | private void exit() {
switch (Server.getStatus()) {
case Server.PLAYERS_CONNECTED:
if (JOptionPane.showConfirmDialog(Main.this,
"The server is running and the game is in progress.\n"
+ "Do you want to exit anyway?", Main.TITLE_SHORT,
... |
2a228a05-2c0c-4895-952c-39a1e0d5ca56 | 1 | private void updateMouse() {
double mouseXBefore = getMouseX();
double mouseYBefore = getMouseY();
glfwGetCursorPos(inputSource, mouseX, mouseY);
if (hasBeenUpdated) {
mouseDeltaX = getMouseX() - mouseXBefore;
mouseDeltaY = getMouseY() - mouseYBefore;
}
hasBeenUpdated = true;
} |
1393e7fc-b8a0-4e0c-a5cb-1ca87a2aa742 | 8 | @Override
public String getColumnName(int column) {
String reply = "";
switch (column) {
case 0:
reply = "ID";
break;
case 1:
reply = "Name";
break;
case 2:
reply = "Demand";
break;
case 3:
reply = "Supply";
break;
case 4:
reply = "Max. Buy Price/Unit";
bre... |
7597382c-6cde-4262-9eb7-af4c0b1deaf8 | 9 | public PacketExtension parseExtension(XmlPullParser parser) throws Exception {
boolean done = false;
StringBuilder buffer = null;
DataForm dataForm = new DataForm(parser.getAttributeValue("", "type"));
while (!done) {
int eventType = parser.next();
if (eventType =... |
5ff0a9de-7aa9-4724-932e-edbd4a0865d6 | 8 | void showColorForPixel(int x, int y) {
if (x >= 0 && x < imageData.width && y >= 0 && y < imageData.height) {
int pixel = imageData.getPixel(x, y);
RGB rgb = imageData.palette.getRGB(pixel);
boolean hasAlpha = false;
int alphaValue = 0;
if (imageData.alphaData != null && imageData.alphaData.length > 0)... |
c015ccb6-11bb-4cc5-9ecc-7d5e93b59204 | 5 | public static ArrayList<Achievement> updateAchievement(User user) {
ArrayList<Achievement> records = AchievementRecord.getAchievementsByUserID(user.userID, QUIZ_CREATED_TYPE);
ArrayList<Achievement> newAchievements = new ArrayList<Achievement>();
int totalCreatedQuiz = QuizCreatedRecord.getCreatedQuizByUserID(use... |
56cae5af-01f6-470a-9fec-5eeebbdd9927 | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
da056690-f942-45d0-b847-bd70e351abcd | 4 | @Override
public void triggered( CapabilityName<?>... allowHandlersFor ) {
if( triggeredSite == null ){
triggeredSite = this;
for(CapabilityName<?> allowHandlerFor : allowHandlersFor ){
handlersAllowed.add( allowHandlerFor );
}
updateAllEnabled();
}
} |
a04de488-1ab7-4c3e-843c-df72976311fc | 1 | protected boolean isSplitable(JobContext context, Path file)
{
CompressionCodec codec = new CompressionCodecFactory(context.getConfiguration()).getCodec(file);
if (null == codec) {
return true;
}
return codec instanceof SplittableCompressionCodec;
} |
a51802d2-7559-484f-803d-4c62d8f6e460 | 7 | protected void done() {
double max = Double.NaN;
try {
max = Double.parseDouble( maxXField.getText());
}
catch (NumberFormatException nfe) {
}
double min = Double.NaN;
try {
min = Double.parseDouble( minXField.getText());
}
catch (NumberFormatException nfe) {
}
double tickSpaci... |
2c9cd26f-4d81-4881-be00-c644f5eecc54 | 4 | public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
... |
4000a1ba-95dd-4811-81b7-20fe14b54497 | 5 | public void autoFit()
{
// KSC: make more betta :)
double w = 0;
CellHandle[] cxt = getCells();
for( CellHandle aCxt : cxt )
{
String s = aCxt.getFormattedStringVal(); //StringVal();
FormatHandle fh = aCxt.getFormatHandle();
Font ef = fh.getFont();
int style = java.awt.Font.PLAIN;
if( ef.ge... |
eea7f530-acbf-41b1-b888-3686a4a2244d | 4 | public void addDiffFeature(){
HashMap<String, Double> difference = new HashMap<String, Double>();
for(Business b: businesses){
double truescore = b.stars;
//difference.put(b.id, b.stars);
for(Review r:reviews){
if(r.b_id.equals(b.id)){
difference.put(b.id, r.stars-truescore);
... |
46a80f45-e015-4da8-a9f5-c07cea18c133 | 4 | @Override
public int hashCode() {
int result = sessionId != null ? sessionId.hashCode() : 0;
result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0);
result = 31 * result + (userAgent != null ? userAgent.hashCode() : 0);
result = 31 * result + lastActivity;
resu... |
035c8003-0d58-4371-b992-8f70e34b458f | 1 | public static boolean isMurder(int s) {
if(s==32961)
return true;
return false;
} |
62d81013-83e7-4979-96b8-91be10b9490e | 4 | private void add() {
Integer option;
String s;
UI.printHeader();
System.out.println("Selecciona un agente a continuaciรณn:");
System.out.println("1) Snmp");
System.out.println("");
System.out.println("0) Atrรกs");
System.out.println("");
System.out.print("Introduce una opciรณn: ");
try {
BufferedR... |
3178c75c-64b9-4954-b125-deacf745a5a5 | 6 | public static void ZipPutLongIntoBuf(ByteBuffer _buff, long _num)
{
if(_num > Byte.MIN_VALUE && _num < Byte.MAX_VALUE)
{
//put the length
_buff.put((byte)1);
//put the value
_buff.put((byte)_num);
return ;
}
else if(_num > S... |
68d07b5d-30ca-4bf4-abab-574522091c36 | 5 | public Map.Entry<Long, E> getClosestEqual(Long timestamp) {
Map.Entry<Long, E> lower = getFrameEqualLower(timestamp);
Map.Entry<Long, E> higher = getFrameEqualHigher(timestamp);
if(lower == null && higher == null) {
return null;
} else if(lower == null) {
return higher;
} else if(higher == null) {
... |
d9e9807a-20b5-431f-8391-8d61cb7c00be | 1 | @Override
public Iterable<? extends Position<T>> children(Position<T> pos) {
return castPositionToNode(pos).getDirectChilren();
} |
aa1477ca-155d-4026-bf66-d6e349b3c33c | 6 | public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... |
410b5aab-f53b-4536-9674-5c23dc3a076d | 0 | public void addSearchedSites(String url){
/*
List<SqlParameter> sqlParamList = new LinkedList<SqlParameter>();
sqlParamList.add(new SqlParameter(Types.VARCHAR, url));
sqlParamList.add(new SqlParameter(Types.TIMESTAMP, new java.sql.Timestamp(new Date().getTime())));
final StringBuilder sql = new StringBuilder(... |
44886b0e-07d4-43d2-9a93-627dccfc9dcd | 6 | @Override
public void run() {
String [] hosts = execHosts.split(",");
int numHosts = hosts.length;
int currentHost = 0;
sgeExecHostsExampleScrollPane.setVisible(false);
validatingHostsLabel.setVisible(true);
sif.setNextEnabled(false);
sif.setBack... |
1d877fb3-7059-4766-afd4-1ceffce85f39 | 8 | @Override
public List<ExpertiseDefinition> myListableExpertises(MOB mob)
{
ExpertiseDefinition D=null;
final List<ExpertiseDefinition> V=new Vector<ExpertiseDefinition>();
for(final Enumeration<ExpertiseDefinition> e=definitions();e.hasMoreElements();)
{
D=e.nextElement();
if((D.compiledListMask()==null... |
a134b805-e9fa-497f-8085-218251b57bcd | 6 | private void substitute() {
ArrayList< Substitution> textAcc = new ArrayList<>();
text.add(new Substitution(original, original));
for (SubstitutionRule rule : rules) {
for (Substitution s : text) {
// there should be no substitutions in text already with subc... |
1489b2c5-3616-4783-990c-ec28d85b77e6 | 5 | public boolean login(String user, String pass) {
if (!player.isRegistered()) {
response = "login.error.registered";
return false;
} else if (player.isAuthenticated()) {
response = "login.error.authenticated";
return false;
} else if (!plugin.getPwdHndlr().checkPassword(player.getAccountId(), pass)) {
... |
773b119b-936b-46ce-a046-28142a910783 | 3 | protected synchronized GeneralPath getOutlineFromCMaps (char val,
float width) {
// find the cmaps
CmapTable cmap = (CmapTable) font.getTable ("cmap");
if (cmap == null) {
return null;
}
// try maps in requ... |
9d3ee05e-3126-4077-b864-d777616a86fe | 0 | @Override public Iterator<Feature> iterator()
{
return features.iterator();
} |
ea6fbdff-2f95-4309-a7c2-ef6939f04bca | 6 | private final synchronized Properties loadPropertyFile(final String file) {
// TODO optimize exception handling
File propertyFile = new File(file);
if(!propertyFile.exists()) {
URL fileURL = this.getClass().getResource(file);
if(fileURL != null) {
propertyFile = loadFileFromURL(fileURL);
}
}
... |
40dc1231-8a1e-4433-a4be-670e73949217 | 7 | public void infoDisplay(final LocalExpr expr) {
final UseInformation UI = (UseInformation) useInfoMap.get(expr);
final DefInformation DI = (DefInformation) defInfoMap.get(expr);
System.err.println(expr.toString());
System.err.println(expr.parent().toString() + "-"
+ expr.parent().parent().toString());
i... |
5bc181e4-fea8-4bc0-9a00-2a7c17bea00c | 8 | public void run() {
_debug.fine(
"UpdateRunnable wird gestartet fรผr " + _responseAspect + " " + _responseAtg
+ " Nachrichtentyp: DynamischeMengeAktualisierung/ObjektAktualisierung"
);
while(true) {
try {
Data data = _unboundedQueue.take();
if(data == null) {
_debug.fine("UpdateRun... |
0a93d81c-ec74-47d7-af7c-ec93f27b4370 | 9 | private boolean getsToLive(Cell cell) {
int x = cell.getX();
int y = cell.getY();
int liveNeighbours = 0;
liveNeighbours += isAlive(x - 1, y - 1);
liveNeighbours += isAlive(x - 1, y);
liveNeighbours += isAlive(x - 1, y + 1);
liveNeighbours += isAlive(x, y - 1);
... |
435a9273-2446-4e47-be54-aea682754f13 | 8 | private boolean initKeyExchange() {
if (type == CLIENT) {
try {
// get p
p = readBytes();
// ack p
sendBytes(p);
// get g
g = readBytes();
// ack g
sendBytes(g);
// calc A
crypto = new UMSM_Main_Crypto(p);
BigInteger A = crypto.calcA(g);
... |
0646284d-feac-4543-9a1a-fc979cdabb29 | 8 | public static void main(String[] args) throws Throwable{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuffer sb = new StringBuffer();
for (String ln; !(ln = in.readLine().trim()).equals("0");) {
StringTokenizer st = new StringTokenizer(ln);
TreeSet<Integer> arbol = new Tre... |
2d4ea8db-0503-431e-b56c-f8c09e3a703f | 3 | @Override
public void execute(VGDLSprite sprite1, VGDLSprite sprite2, Game game)
{
// Stop just in front of the wall, removing that velocity component, but possibly sliding along it.
//Keep in the list, for the current cycle, the sprites that have triggered this event.
int currentGameTi... |
0ab30035-4859-4a64-8b91-80df3912975e | 1 | @Override
public boolean removeAll(Collection<?> c) {
// TODO Auto-generated method stub
return false;
} |
7f1b4d5d-9294-457f-bdb7-de97f3426837 | 7 | public void delete(int data){
//to delete first node
if(head.getData() == data){
head = head.getNext();
}
else{
Node ptr = head.getNext();
Node preptr = head;
while(ptr.getNext() != null){
if(ptr.ge... |
a49c6775-7e60-4fc5-a0ac-0f6e3824e093 | 5 | @Override
protected void bindToModelModifications() {
dicSystemModel.addPropertyChangeListener(
dicSystemModel.getPropertyName(), new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (!lock)
paramsDicos.loadDicos((TagAndURISubModel[]) evt
... |
74699b04-e2e2-42ab-95df-720b2d8b3d1b | 3 | public void init(int startHappinessLevel)
{
currentHappinessLevel = startHappinessLevel;
yPos = -32 + GamePanel.HEIGHT/2;
xPos = GamePanel.WIDTH/4;
yVel = 0;
try
{
heartset = ImageIO.read(getClass().getResourceAsStream("/Heart/HeartSheet.png"));
for (int i = 0; i < numberHeartFrames; i++)
{
... |
7f145af2-53ce-41a7-9e22-a22d96b1a8d7 | 4 | public void removeServerFromLinkedList(Server server) {
logMessage(LOGLEVEL_DEBUG, "Removing server from linked list.");
if (servers == null || servers.isEmpty())
return;
ListIterator<Server> it = servers.listIterator();
while (it.hasNext()) {
// Check if they refer to the exact same object via reference,... |
13dcc039-4d6f-4c8c-b439-d8b430f35b1d | 9 | private JToolBar createUpperToolBar() {
JToolBar toolBar = new JToolBar();
toolBar.setFloatable(false);
final JButton start = new JButton("Inizio");
start.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
started = !started;
if (started) {
... |
f054150e-5aef-4735-9417-c29c8421d7b3 | 9 | private boolean isIndirectlyPowered(World par1World, int par2, int par3, int par4)
{
int var5 = par1World.getBlockMetadata(par2, par3, par4);
return var5 == 5 && par1World.isBlockIndirectlyProvidingPowerTo(par2, par3 - 1, par4, 0) ? true : (var5 == 3 && par1World.isBlockIndirectlyProvidingPowerTo(pa... |
f3fe60a9-eeca-4914-b2f0-f006d6a4cb39 | 2 | private boolean workAll(boolean undo) {
boolean result = true;
for (String taskId : taskIds) {
result = result && workOne(taskId, undo);
}
return result;
} |
0d448a90-0004-4246-9428-58cfc1cea38e | 5 | public Map(){
if (Empous.Gov.getStat("census")<=50000)
mapimg = Empous.LoadImage("/main/resources/images/map1.png");
else if (Empous.Gov.getStat("census")<=1000000)
mapimg = Empous.LoadImage("/main/resources/images/map2.png");
else if (Empous.Gov.getStat("census")<=300000000)
mapimg = Empous.LoadImage("/... |
b5f547b1-c8dc-4488-8532-6103ee8b3477 | 5 | @Override
public void move(Excel start, Excel finish) {
for(int i=0;i<allex.size();i++)
{
if (start.getX() == allex.get(i).getX() && start.getY() == allex.get(i).getY())
{
allex.remove(i);
allex.add(i, finish);
setColoredExes();
break;
}
}
for(Excel ex: coloredEx)
{
if (ex.equ... |
eb882fad-2e64-4893-9904-3c447fa55bb2 | 4 | public synchronized void shutdown(){
if(!shutdown)
shutdown = true;
//Poll the queue and release all objects left in the queue.
while(true){
Reference<?> ref = queue.poll();
if(ref != null){
Resource res = refs.get(ref);//Get the resource by the reference.
refs.remove(ref);//Remove the object ... |
45330084-7329-4ff9-a2b4-a7a6fe39c106 | 2 | public void testGet_DateTimeFieldType() {
LocalTime test = new LocalTime(10, 20, 30, 40);
assertEquals(10, test.get(DateTimeFieldType.hourOfDay()));
assertEquals(20, test.get(DateTimeFieldType.minuteOfHour()));
assertEquals(30, test.get(DateTimeFieldType.secondOfMinute()));
asser... |
84d4b502-4efb-4d83-8b58-a364f9f1a622 | 9 | public ParseNode getParseNode()
{
if (null == parseNode)
{
Item lParentItem = getParent();
ParseNode lParentParseNode = null;
if (null == lParentItem)
{
lParentParseNode = Processor.get().getPTree().getDocRoot();
}
... |
601d7275-3898-4384-9f12-adc0fe6dbf3b | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Option other = (Option) obj;
if (optionNr != other.optionNr)
return false;
if (value == null) {
if (other.value != null)
return false... |
da7e2a86-7cab-4888-af43-4d1d4903a36c | 5 | private Point chooseRandomLocation() {
Point randomLocation;
ArrayList<Point> listOfEmptyLocations = new ArrayList<>();
Player[][] locations = this.board.getBoardLocations();
for (int row = 0; row < locations.length; row++) {
Player[] rowLocations = locations[row];... |
3dac7aee-75fc-488d-b497-d7fca701cb06 | 9 | public int[] searchRange(int[] A, int target) {
int l = A == null ? 0 : A.length;
int[] bound = new int[2];
//search left half
int start = 0, end = l - 1;
while (start + 1 < end) {
int mid = start + (end - start) / 2;
if (A[mid] < target) {
... |
7aba3d77-dbb9-4aa1-aae0-03116be9a41a | 1 | public void enqueue(Object value, int priority) {
QueueElement current = new QueueElement(value, priority);
if (count == 0) {
head = current;
} else {
tail.connectNext(current);
}
tail = current;
count++;
} |
ac7083a6-8a94-40cd-96ba-dff16afbc20b | 6 | public void die() {
Item[] equipItems = player.getEquipment().getItems().getItems();
for (int slot = 0; slot < equipItems.length; slot++) {
if (equipItems[slot] != null && degradeCompletly(equipItems[slot]))
player.getEquipment().getItems().set(slot, null);
}
Item[] invItems = player.getInventory().getIt... |
22a865d7-546e-49cb-bfc1-ee8504250d54 | 5 | public void init(final boolean flag) {
int i;
int a, b, c, d, e, f, g, h;
a = b = c = d = e = f = g = h = RATIO;
for (i = 0; i < 4; ++i) {
a ^= b << 11;
d += a;
b += c;
b ^= c >>> 2;
e += b;
c += d;
c ^= d << 8;
f += c;
d += e;
d ^= e >>> 16;
g += d;
e += f;
e ^= f << 10;
... |
654612d8-b8f4-4e0b-a526-6760008fd218 | 0 | public Boolean getSex() {
return this.sex;
} |
fc6dfd91-d919-4bc2-994d-91e4bc0f92ab | 7 | @Override
public void receive(Object obj) {
Helper.log("GSCONNECTIONTOCLIENT: RECEIVING");
Event event = (Event) obj;
Helper.log("RECEIVED EVENT:\n" + event);
event.player = player;
switch(event.type) {
case "key event":
Helper.log("GSCONNECTION: RECEIEVED KEY EVENT");
gameServer.engine.eventQ.add... |
c25a5188-16d3-4cab-ace7-70440737bbe2 | 1 | public void show(T[] a, int[] perm) { // Print the array, on a
// single line.
for (int i = 0; i < a.length; i++)
System.out.print(a[perm[i]] + " ");
System.out.println();
} |
502a51d8-6667-4d61-a601-c3d6357d0f8b | 5 | public boolean readVersion(InStream is) {
done = false;
if (verStrPos >= 12) return false;
verStr = new StringBuilder(13);
while (is.checkNoWait(1) && verStrPos < 12) {
verStr.insert(verStrPos++, (char)is.readU8());
}
if (verStrPos < 12) {
done = false;
return true;
}
... |
57d547da-2602-4c5b-b642-79d08e3e69de | 3 | String normalizeForResourceLocation(String contextLocation){
boolean hasResource = contextLocation.startsWith("file")
|| contextLocation.startsWith("classpath")
|| contextLocation.startsWith("url");
if (!hasResource){
return String.format("%s:%s", DEFAULT_R... |
bc9935a0-d921-495b-abd2-7ceee40cd82a | 0 | @After
public void tearDown() throws Exception
{
// File datei1 = new File("/var/www/uploads/3.txt");
// File datei2 = new File("/var/www/uploads/4.txt");
// File datei3 = new File("/var/www/uploads/5.txt");
// File datei4 = new File("/var/www/uploads/6.txt");
// File datei5 = new File("/var/www/uploads/7.t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.