query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
required string ip = 1;
public boolean hasIp() { return ((bitField0_ & 0x00000001) == 0x00000001); }
[ "private void setIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n ip_ = value;\n }", "void setIP(String ip);", "public void setIp2(String ip2);", "public void setIp(String tmp) {\n this.ip = tmp;\n }", "public void setIpUser(String ip){\n \tthis.ipUser=ip;\n }", "public static void setIPAdd(String ip)\r\n\t{\r\n\t\tipAdd=ip;\r\n\t}", "public taotaole.avro.zz_yundb.Builder setIp(java.lang.CharSequence value) {\n validate(fields()[17], value);\n this.ip = value;\n fieldSetFlags()[17] = true;\n return this; \n }", "public void Init(String ip)\n\t{\n\n\t}", "private int getIP() {\n return IP;\n }", "public String myIpAddressEx();", "public void setIp(Ip ip){\n this.A = ip.getA();\n this.B = ip.getB();\n this.C = ip.getC();\n this.D = ip.getD();\n }", "int setMasterIP(String ipaddr);", "public void setIP(String ip) {\n if (ip == null) {\n this.ip = \"127.0.0.1\";\n } else {\n this.ip = ip;\n }\n }", "public Builder ip(String ip) {\n this.ip = ip;\n return this;\n }", "public static boolean checkIP(String IPString)\n{\n return checkIP(IPString, false);\n}", "private static void chkIp(String ip)throws IllegalArgumentException {\n String[] ipByte = ip.split(\"\\\\.\");\n\n // check that it is four numbers divided by dots.\n\n if(ipByte.length < 4 || ipByte.length > 4){\n throw new IllegalArgumentException();\n }\n\n for(int i = 0; i < ipByte.length; i++){\n\n //chk for letters\n if(chkNumerical(ipByte[i])){\n throw new IllegalArgumentException();\n }\n //chk for range\n if(chkRange(Integer.parseInt(ipByte[i]), 255,0)){\n throw new IllegalArgumentException();\n }\n }\n }", "public void setIpAddress(String tmp) {\n this.ipAddress = tmp;\n }", "public abstract String getIpAddr();", "public void setIp1(String ip1) {\r\n this.ip1 = ip1 == null ? null : ip1.trim();\r\n }", "public String getIp() {\n\t return ip;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Phuong thuc tra ve thoi thanh chay time
private JProgressBar getTime() { if (time == null) { time = new JProgressBar(); time.setBounds(200, 22, 500, 14); } return time; }
[ "private void laySoTrang() {\n tongTrang = TaiKhoanDAO.getInstance().layTongSoBanGhi();\n tongTrang = tongTrang % 15 == 0 ? tongTrang / 15 : tongTrang / 15 + 1;\n }", "@Override\r\n\tpublic long getTrongTai() {\r\n\t\treturn _qlvtXuLyBienHieuPhuongTien.getTrongTai();\r\n\t}", "private Phrase swingTime() {\n Phrase phr = new Phrase();\n int ride = 51;\n phr.addNote(new Note(ride, C,80));\n phr.addNote(new Note(ride, 0.67,80));\n phr.addNote(new Note(ride, 0.33,80));\n phr.addNote(new Note(ride, C,80));\n phr.addNote(new Note(ride, C,80));\n return phr;\n }", "public void time() {\n int j = Integer.parseInt(hM.getValue().toString());\n int m = Integer.parseInt(mM.getValue().toString());\n int d = Integer.parseInt(sM.getValue().toString());\n //mengambil nilai waktu 2\n int j1 = Integer.parseInt(hK.getValue().toString());\n int m1 = Integer.parseInt(mK.getValue().toString());\n int d1 = Integer.parseInt(sK.getValue().toString());\n\n int h = (j * 3600) + (m * 60) + d;\n int h1 = (j1 * 3600) + (m1 * 60) + d1;\n int sl = h1 - h;\n int det = sl % 3600;\n int det1 = det % 60;\n int men = det / 60;\n int jam = sl / 3600;\n\n if (j1 <= j) {\n JOptionPane.showMessageDialog(null, \"Jam keluar harus lebih besar dari jam keluar\");\n } else {\n tfjmljam.setText(String.valueOf(jam));\n }\n\n }", "public String getThongtin(){\r\n return \"Ten:\" + this.ten +\",tuoi:\"+this.tuoi+\",dia chi:\"+ this.diaChi\r\n +\",tien luong:\"+ this.tienLuong+\",tong gio lam:\"+ this.tongGioLam\r\n +\",tien thuong:\"+ this.tinhThuong();\r\n \r\n }", "private void setTime() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(Day());\n\t\tsb.append(\"第\");\n\t\tsb.append(start);\n\t\tif(num>1){\n\t\t\tsb.append(\"~\");\n\t\t\tsb.append(start+num-1);\n\t\t}\n\t\tsb.append(\"节\");\n\t\ttime = sb.toString();\t\n\t}", "public static void timCapSoGanNhauNhat() {\n\t\tint khoangCachMin = timKhoangCachMin();\n\t\tSystem.out.println(\"Cac cap gia tri gan nhau nhat la: \");\n\t\tfor (int i = 1; i < n; i++) {\n\t\t\tif (Math.abs(mang[i] - mang[i - 1]) == khoangCachMin) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(mang[i - 1] + \"(vi tri i = \" + (i - 1) + \") va \" + mang[i] + \"(vi tri i = \" + i + \")\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tvoid pleaca() {\n\t\tcal.getTime();\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tSystem.out.println( \"Ora la care s-a plecat: \" + sdf.format(cal.getTime()) );\n\t}", "void timeTest(String mm) {\n\t\tString curHour = mm;\n\t\t\n\t\t//오전 5시 하루에 한번 KOSPI.csv KOSDAQ.csv 파일을 갱신한다.\n\t\tif(curHour.equals(\"5\") && preHour.equals(\"4\")) \n\t\t\tSystem.out.println(\"success-1\");\n\n\t\t//주식가격 refresh by 크롤링 9시 ~ 18시까지 실행\n\t\tif(Integer.parseInt(curHour) >= 9 && Integer.parseInt(curHour) <= 19)\n\t\t\tSystem.out.println(\"success-2\");\n\t\t\t\n\t\t//18시 장종료후 19시에 주식데이터 갱신\n\t\tif(curHour.equals(\"19\") && preHour.equals(\"18\")) \n\t\t\tSystem.out.println(\"success-3\");\n\t\t\n\t\tif(curHour.equals(\"18\") && preHour.equals(\"17\")) {\n\t\t\tSystem.out.println(\"success-4\");\n\t\t\tservice.insertRecordAsset();\n\t\t}\n\t\tpreHour = curHour;\n\t}", "public void nhapCoHuu() {\n\t\tsuper.nhapGiangVien(); // goi toi phuong thuc nhap o lop cha de nhap nhung thuoc tinh ma no ke thua\n\t\ttry {\n\t\t\tScanner scanner = new Scanner(System.in);\n\t\t\tSystem.out.println(\"He so luong: \");\n\t\t\thsLuong= Float.parseFloat(scanner.nextLine()); // xu li troi lenh\n\t\t\tSystem.out.println(\"Nam bat dau cong tac\");\n\t\t\tnamBatDauCT= Integer.parseInt(scanner.nextLine());\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"Nhap sai du lieu!\");\n\t\t}\n\t}", "private void time() {\n\n\t}", "public void showTime() {\n\t\t\tSystem.out.println(\"Ceasul arata ora ... \");\n\t\t}", "@Override\r\n\tpublic String sayHai() {\n\t\tCalendar cal=null;\r\n\t\tint hour=0;\r\n\t\tString result=null;\r\n\t\tcal=Calendar.getInstance();\r\n\t\thour=cal.get(Calendar.HOUR_OF_DAY);\r\n\t\tif(hour>8) {\r\n\t\t\tresult= \"Good Morning\";\r\n\t\t}\r\n\t\telse if(hour>20) {\r\n\t\t\tresult= \"Good Afternoon\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public static String train() {\n // Бостон и Нью-Йорк находятся в одном часовом поясе\n LocalTime departureTime = LocalTime.parse(\"1:45 PM\", timeFormatter);\n LocalTime arrivalTime = LocalTime.parse(\"7:25 PM\", timeFormatter);\n return \"Train ride in minutes: \" + Duration.between(departureTime, arrivalTime).toMinutes() +\n \"\\nArrival if delayed: \" + arrivalTime.plusHours(1).plusMinutes(19).format(timeFormatter) +\n \"\\n\\n========\\n\\n\";\n }", "@Override\n\tpublic String calculatedString(int time) {\n\t\tif(time%2==0)\n\t\t\treturn \"Y\";\n\t\telse\n\t\t\treturn \"O\";\n\t}", "static String timeConversion(String s) {\n \t\t String complete = \"\";\n \t\t\tchar [] c_conversion = {};\n \t\t\tc_conversion = s.toCharArray();\n \t\t\tint size = c_conversion.length; \n \t\t\tchar [] receive = {c_conversion[size-2],c_conversion[size-1]};\n \t\t\tString pm = new String(receive);\n \n \n \t\tint counter = 0 ;\n \t\tint [] twelveForYou = new int[2];\n \t\tif(pm.equals(\"PM\")) {\t\t\t\n \t\t\tfor(int i = 0 ; i<2;i++) {\n \t\t\tcounter += Character.getNumericValue(c_conversion[i]); \n \t\t\ttwelveForYou[i] = Character.getNumericValue(c_conversion[i]); \n \t\t\tc_conversion[i] = ' ';\n \t\t\t}\n \t\t\t\n \t\t\tif(twelveForYou[0] != 1 ||twelveForYou[1] != 2) {\n \t\t\t\t\n \t\t\t\tif(twelveForYou[0] == 1 && twelveForYou[1] ==1) {\n \t\t\t\t\tcounter = 23;\n \t\t\t\t\tString appender = new String(c_conversion);\n \t\t\t\t\tappender = appender.replace(\" \",\"\");\n \t\t\t\t\tappender = appender.replace(\"PM\",\"\");\n \t\t\t\t\tcomplete = Integer.toString(counter) + appender; \t\n\n \t\t\t\t}else {\n \t\t\t\t//se != 1 e !=2\n \t\t\tcounter+=12;\n \t\t\tString append = new String(c_conversion);\n \t\t\tappend = append.replace(\" \",\"\");\n \t\t\tappend = append.replace(\"PM\",\"\");\n \t\t\tString number = Integer.toString(counter); \t\t\n \t\t\t complete = number + append;\n \t\t\t\t}}else {\n \t\t\t\tcomplete = s;\n \t\t\t\tcomplete = complete.replace(\"AM\",\"\");\n \t \t\t\tcomplete = complete.replace(\"PM\",\"\");\t\t\n \t\t\t}\n \t\t}else {\n \t\t\tcomplete = s;\n \t\t\tcomplete = complete.replace(\"AM\",\"\");\n \t\t\tcomplete = complete.replace(\"PM\",\"\");\n \t\t\tcomplete = complete.replace(\"12\",\"00\");\n \t\t\t\n \t\t\t}\n \t\t\n \t\treturn complete;\n\n }", "@Override\n\tpublic void nhap() {\n\t\tSystem.out.println(\"Nhap thong tin cong nhan FullTime: \");\n\t\tScanner sc = new Scanner(System.in);\n\n\t\tSystem.out.print(\"Nhap ID cua cong nhan: \");\n\t\tID = Integer.parseInt(sc.nextLine());\n\t\tSystem.out.print(\"Nhap ho ten cong nhan: \");\n\t\thoTen = sc.nextLine();\n\t\tSystem.out.print(\"Nhap luong cong nhan: \");\n\t\tluong = Float.parseFloat(sc.nextLine());\n\n\t\tSystem.out.print(\"Nhap thuong cong nhan: \");\n\t\tthuong = Float.parseFloat(sc.nextLine());\n\t\t\n\t}", "private static void HienThiTenTruong(String[] chuHo , int[] soDien) {\n\t\tfor(int i=0;i<chuHo.length;i++) {\n\t\t\tif(chuHo[i].compareToIgnoreCase(\"Truong\")==0) {\n\t\t\t\tXuat(chuHo[i],soDien[i]);\n\t\t\t}\n\t\t}\n\t}", "static String timeInWords(int h, int m) {\n \n String time[] = {\n \"o' clock\", \n \"one\",\n \"two\",\n \"three\",\n \"four\",\n \"five\",\n \"six\",\n \"seven\",\n \"eight\",\n \"nine\",\n \"ten\",\n \"eleven\",\n \"twelve\",\n \"thirteen\",\n \"fourteen\",\n \"quarter\",\n \"sixteen\",\n \"seventeen\",\n \"eighteen\",\n \"nineteen\",\n \"twenty\",\n \"twenty one\",\n \"twenty two\",\n \"twenty three\",\n \"twenty four\",\n \"twenty five\",\n \"twenty six\",\n \"twenty seven\",\n \"twenty eight\",\n \"twenty nine\",\n \"half\"\n };\n\n String w = \"\";\n if (m == 0)\n {\n w += time[h] + \" \" + time[0];\n }\n else if (m > 30)\n {\n w += time[60 - m];\n if (m != 45)\n {\n if (m == 59)\n {\n w += \" minute\";\n }\n else\n {\n w += \" minutes\";\n }\n }\n w += \" to \" + time[h + 1];\n }\n else\n {\n w += time[m];\n if (m != 15 && m != 30)\n {\n if (m == 1)\n {\n w += \" minute\";\n }\n else\n {\n w += \" minutes\";\n }\n }\n w += \" past \" + time[h];\n }\n return w;\n }", "private void showTime(){\n\t\tplayedTime = getPlayedTime();\n\t\ttimeResult = Long.toString(playedTime);\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert any object to a JSON string
public static String objectToJson(Object object) { ObjectMapper mapper = new ObjectMapper(); try { return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(object); } catch (JsonProcessingException e) { l.error(e.getMessage()); } return null; }
[ "private String convertToJSON(T obj) {\n try {\n if (!type.equals(obj.getClass())) {\n throw new RuntimeException(\"cannot convert different types\");\n }\n return objectMapper.writeValueAsString(obj);\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public String objectToJsonString(Object obj) throws JsonProcessingException;", "public static String toJson(Object object) {\r\n\t\treturn toJson(object, false, false);\r\n\t}", "protected <T> String convertObjectToJSON(final T object) throws IOException {\n return mapper.writeValueAsString(object);\n }", "public String marshal(Object object) throws JSONDataException;", "public static final String convertToJSON(Object object){\n\t\ttry {\n\t\t\treturn System.objectMapper.writeValueAsString(object);\n\t\t} catch (JsonProcessingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "public static String toJson(Object obj) {\n return Utils.gson.toJson(obj);\n }", "public static String toJson(Object object)\n\t{\n\t\treturn jsonSerializer.toJson(object);\n\t}", "public static String toJsonStr(Object obj) {\r\n\r\n Gson gson = new Gson();\r\n String jsonStr = gson.toJson(obj);\r\n\r\n return jsonStr;\r\n }", "String toJSON(Object model);", "public static String toJSONStr(Object obj) {\n try {\n return OBJECT_MAPPER.writeValueAsString(obj);\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n return null;\n }", "public static String convertObjectToJsonString(Object value) {\n Gson gson = getGsonInstance();\n return gson.toJson(value);\n }", "public static String obj2json(Object obj) {\r\n\t\tif(obj == null)\r\n\t\t\treturn null;\r\n\t\tGson gson = new Gson();\r\n\t\treturn gson.toJson(obj);\r\n\t}", "public String getJson(Object o) {\r\n\t\treturn new GsonBuilder().setPrettyPrinting().create().toJson(o);\r\n\t}", "public static String asJsonString(final Object obj) throws JsonProcessingException {\n \n \tif(obj == null)\n \t\tthrow new IllegalArgumentException();\n \t\n return new ObjectMapper().writeValueAsString(obj);\n }", "public static String getJson(Object o) {\n return new GsonBuilder().setPrettyPrinting().create().toJson(o);\n }", "public static String fromObjectToJson(Object pObject){\n return gson.toJson(pObject);\n }", "public String toJSON(Object obj) throws MarshallException {\r\n\t\tSerializerState state = new SerializerState();\r\n\r\n\t\t// todo: what do we do about fix ups here?\r\n\t\tObject json = marshall(state, null, obj, \"result\");\r\n\r\n\t\t// todo: fixups will be in state.getFixUps() if someone wants to do\r\n\t\t// something with them...\r\n\t\treturn json.toString();\r\n\t}", "public String toJSONString()\n\t{\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tString jsonString = \"\";\n\t\ttry {\n\t\t\tjsonString = mapper.writeValueAsString(this);\n\t\t} catch (JsonProcessingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn jsonString;\n\t}", "String toJson(Gson serializer);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate a new bitmap with all integers in [rangeStart,rangeEnd) added.
public static RoaringBitmap add(RoaringBitmap rb, final long rangeStart, final long rangeEnd) { rangeSanityCheck(rangeStart, rangeEnd); if (rangeStart >= rangeEnd) { return rb.clone(); // empty range } final int hbStart = (Util.highbits(rangeStart)); final int lbStart = (Util.lowbits(rangeStart)); final int hbLast = (Util.highbits(rangeEnd - 1)); final int lbLast = (Util.lowbits(rangeEnd - 1)); RoaringBitmap answer = new RoaringBitmap(); answer.highLowContainer.appendCopiesUntil(rb.highLowContainer, (char) hbStart); if (hbStart == hbLast) { final int i = rb.highLowContainer.getIndex((char) hbStart); final Container c = i >= 0 ? rb.highLowContainer.getContainerAtIndex(i).add(lbStart, lbLast + 1) : Container.rangeOfOnes(lbStart, lbLast + 1); answer.highLowContainer.append((char) hbStart, c); answer.highLowContainer.appendCopiesAfter(rb.highLowContainer, (char) hbLast); return answer; } int ifirst = rb.highLowContainer.getIndex((char) hbStart); int ilast = rb.highLowContainer.getIndex((char) hbLast); { final Container c = ifirst >= 0 ? rb.highLowContainer.getContainerAtIndex(ifirst).add(lbStart, Util.maxLowBitAsInteger() + 1) : Container.rangeOfOnes(lbStart, Util.maxLowBitAsInteger() + 1); answer.highLowContainer.append((char) hbStart, c); } for (int hb = hbStart + 1; hb < hbLast; ++hb) { Container c = Container.rangeOfOnes(0, Util.maxLowBitAsInteger() + 1); answer.highLowContainer.append((char) hb, c); } { final Container c = ilast >= 0 ? rb.highLowContainer.getContainerAtIndex(ilast).add(0, lbLast + 1) : Container.rangeOfOnes(0, lbLast + 1); answer.highLowContainer.append((char) hbLast, c); } answer.highLowContainer.appendCopiesAfter(rb.highLowContainer, (char) hbLast); return answer; }
[ "protected IntegerVector addRangeToSet(int start, int end,\n IntegerVector ivec) {\n if (ivec == null) {\n ivec = new IntegerVector((end - start) + 2);\n }\n for (int i = start; i <= end; ++i) {\n ivec.addInt(i);\n }\n return ivec;\n }", "public void addRange(int start, int end) {\n live.add(new Interval(start, end));\n }", "public static Range make(int start, int end) {\n Range range = new Range();\n range.start = start;\n range.end = end;\n return range;\n }", "public static MappingRegistry mapRange(int startInclusive, int endExclusive,\n Function<Integer, MappingRule> mappingRuleFunction) {\n return MappingRegistry.mappings(IntStream.range(startInclusive, endExclusive)\n .mapToObj(mappingRuleFunction::apply).toArray(MappingRule[]::new));\n }", "public Range(int start, int end) {\r\n this.start = start;\r\n this.end = end;\r\n }", "public static final Consumer<Builder> appendInts(int start, int end) {\n return appendInts(start, end, 1);\n }", "public Gen<Integer> between(final int startInclusive,\n final int endInclusive) {\n ArgumentAssertions.checkArguments(startInclusive <= endInclusive,\n \"There are no Integer values to be generated between (%s) and (%s)\",\n startInclusive, endInclusive);\n return Generate.range(startInclusive, endInclusive);\n }", "public void add(int start, int end) {\n if (start >= end) {\n return;\n }\n intervals.add(new Interval(start, end));\n }", "public static IntRange createInclusive(Integer minValue, Integer maxValue) {\r\n return new IntRange(minValue, maxValue, true);\r\n }", "private IntegerVector addRange(SelectableRange range, IntegerVector ivec) {\n int r1, r2;\n\n // Select the range specified.\n byte start_flag = range.getStartFlag();\n TObject start = range.getStart();\n byte end_flag = range.getEndFlag();\n TObject end = range.getEnd();\n\n r1 = positionOfRangePoint(start_flag, start);\n r2 = positionOfRangePoint(end_flag, end);\n\n if (r2 < r1) {\n return ivec;\n }\n\n // Add the range to the set\n return addRangeToSet(r1, r2, ivec);\n\n }", "public Shape<V> forRange(V lower, V upper, V inc) {\n\t\tList<Integer> scalarShape = new ArrayList<Integer>(2);\n\t\tscalarShape.add(1);\n\t\tscalarShape.add(1);\n\t\treturn new ShapeFactory<V>().newShapeFromIntegers(scalarShape);\n }", "private static ArrayList<Interval> createIntervalList(int length, int minStart, int maxEnd){\n ArrayList<Interval> intervalList = new ArrayList<>(length);\n\n Random generator = new Random(System.currentTimeMillis());\n for (int i = 0; i < length; i ++){\n int startTime = minStart + generator.nextInt(maxEnd - minStart);\n int endTime = startTime + generator.nextInt(maxEnd - startTime) + 1;\n\n intervalList.add(new Interval(i+1, startTime, endTime));\n }\n\n return intervalList;\n }", "private void addRange(Map<String, String> map, int start, int finish)\n\t{\n\t\taddRange(map, start, finish, false);\n\t}", "public static SirenNumericRangeQuery<Integer> newIntRange(final String field, final int precisionStep,\n\t Integer min, Integer max, final boolean minInclusive, final boolean maxInclusive\n\t ) {\n\t return new SirenNumericRangeQuery<Integer>(field, precisionStep, 32, min, max, minInclusive, maxInclusive);\n\t }", "public Range(int value) {\r\n this.start = value;\r\n this.end = value;\r\n }", "private int getRandomInteger(int rangeStart, int rangeEnd) {\n\t\tRandom rand = new Random(System.nanoTime() + System.currentTimeMillis());\n\t\tint randomInteger = rand.nextInt(rangeStart + rangeEnd);\n\t\t\n\t\treturn randomInteger;\n\t}", "public RangeBatch<H, R, V> newRangeBatch();", "private static IntervalsSet buildIntervalSet(Vector2D start, Vector2D end)\r\n/* 72: */ {\r\n/* 73:139 */ Line line = new Line(start, end);\r\n/* 74:140 */ return new IntervalsSet(line.toSubSpace(start).getX(), line.toSubSpace(end).getX());\r\n/* 75: */ }", "private int[] createArr(int start, int end, int[] oldArr) {\r\n\t\tint[] newArr = new int[end - start + 1];\r\n\t\tint index = 0;\r\n\t\t\r\n\t\tfor (int i = start; i <= end; i++) {\r\n\t\t\tnewArr[index] = oldArr[i];\r\n\t\t\tindex ++;\r\n\t\t}\r\n\t\treturn newArr;\r\n\t}", "@Override\n\tpublic List<Long> range(long begin, long end) {\n\n\t\tVerify.verify(end >= begin, \"end must > begin\");\n\n\t\tif (begin == end) {\n\t\t\treturn Lists.newArrayList();\n\t\t}\n\n\t\tlong new_begin = begin - new_ins.size();\n\t\tlong new_end = end - new_ins.size();\n\n\t\tList<Long> oflist = Lists.newArrayList();\n\t\tif (new_begin <= 0) {\n\t\t\tint begin_index = (int) begin;\n\n\t\t\tif (new_end <= 0) {\n\t\t\t\tint end_index = (int) end;\n\t\t\t\treturn Lists.newArrayList(new_ins.subList(begin_index,\n\t\t\t\t\t\tend_index));\n\t\t\t} else {\n\t\t\t\tint end_index = new_ins.size();\n\t\t\t\toflist.addAll(new_ins.subList(begin_index, end_index));\n\t\t\t\toflist.addAll(Ins.getLongRangeService().lloadRange(key, 0,\n\t\t\t\t\t\tnew_end));\n\t\t\t\treturn oflist;\n\t\t\t}\n\t\t} else {\n\t\t\treturn Ins.getLongRangeService()\n\t\t\t\t\t.lloadRange(key, new_begin, new_end);\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public boolean verify(String hostname, SSLSession session) { return true; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that returns the round the question was asked
public int getRound() { return round; }
[ "public long getRound() {\n return round;\n }", "public Round getRound() {return round; }", "public int getCurrentRound() {\n return currentRound;\n }", "public int roundNumber() {\n return roundNumber;\n }", "public Round getRound(){\n\t\treturn gameScreen.getRound();\n\t}", "public Round getRound() {\r\n\t\treturn this.round;\r\n\t}", "public int timeRound(){\n return this.round.getValue();\n }", "int getRoundLevel();", "boolean nextRound();", "public int getRoundWinner()\n {\n return roundWinner;\n }", "public int GetNumberInRound( int p_Round ){\n\n int numberInRound = m_sizeLayout;\n\n for(int roundItt = 1; roundItt < p_Round; roundItt++){\n\n numberInRound = numberInRound/2;\n }\n\n return numberInRound;\n\n }", "int getRoundGangedNum();", "public int getGameRound() {\n\t\treturn gameRound;\n\t}", "public int getRoundNum()\r\n {\r\n int roundNum = 0;\r\n if (this.m_labels.elementAt(0).equalsIgnoreCase(\"Round\"))\r\n {\r\n int index = 0;\r\n String sNum = m_statements.elementAt(index);\r\n int number = 0;\r\n number = Integer.parseInt(sNum);\r\n roundNum = (int)number;\r\n }\r\n else\r\n {\r\n System.out.println(\"Invalid format of Load File. Exiting Program!\");\r\n System.exit(1);\r\n }\r\n\r\n return roundNum;\r\n }", "public float getRounding() {\n\t\treturn rounding;\n\t}", "public void riseRound() { /* ... code ... */ }", "public String getRoundingMethod() {\n return interestbearing.getRoundingMethod();\n }", "java.lang.String getRoundName();", "public int getRoundCounter() {\n\t\treturn roundCounter;\n\t}", "public TimeSquared round(){\nreturn new TimeSquared(Math.round(this.getX()),this.getU(),this.getUnits());\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Anade, si no existia, la IP del cliente al registro de IPs de clientes
public void addIPcliente(Mensaje mensaje){ if (!clientes.contains(mensaje.ips.get(0))) clientes.add(mensaje.ips.get(0)); }
[ "public void saisirAdresse(){\n\t\tSystem.out.println(\"Saisir la nouvelle adresse du client : \");\n\t\tthis.adrClient = Lire.S();\n\t}", "default @org.jetbrains.annotations.Nullable imports.k8s.ClientIpConfig getClientIP() {\n return null;\n }", "public Clientes (String idCliente, String dirIP){\n this.idCliente = idCliente;\n this.dirIP = dirIP;\n mask = \"\";\n DNS = \"\";\n lease = 0;\n forzado = false;\n }", "public String getClientIP(){\r\n if(socket != null)\r\n return socket.getInetAddress().toString();\r\n return null;//there is no connected client\r\n }", "private static String getIpAddress() {\r\n\t\tlog.info(\"getIpAddress function is called.\");\r\n\t\ttry {\r\n\t\t\tInetAddress ipAddress = InetAddress.getLocalHost();\r\n\t\t\tlog.info(\"getIpAddress function is ended successfully. It returns the IP address of the host.\");\r\n\t\t\treturn ipAddress.getHostAddress();\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.warning(e.toString() + \" getIpAddress function couldn't found the IP address. It will return Null.\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public void setclientIP(InetAddress clientIP) {\n clientIP = clientIP;\n }", "private String extractClientIpAddress(HttpServletRequest request) {\n String ipAddress = request.getHeader(\"X-FORWARDED-FOR\");\n if (ipAddress == null) {\n ipAddress = request.getRemoteAddr();\n }\n return ipAddress;\n }", "private int getIP() {\n return IP;\n }", "public String getIP(Server server) throws SQLException;", "public IpAddrMatch getClientIp() {\n return clientIp;\n }", "public String getClientIpAddress() \n\t{\n\t\tString strGingerToolBoxIpAddress = null;\n\t\t\n\t\ttry \n\t\t{\n\t\t\tInetAddress inetAddress = InetAddress.getLocalHost();\n\t\t\tstrGingerToolBoxIpAddress = inetAddress.getHostAddress();\n\t\t} \n\t\tcatch (UnknownHostException e) \n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\t\n\t\treturn strGingerToolBoxIpAddress;\n\t}", "private void initIp() {\n\t\t\n\t\tfinal String Url=new Configs().new ServerInterface().GET_IP;\n\t\tnew Thread() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t \n\t\t\t\ttry {\n\t\t\t\t\t String ip=RequestUtil.getInstance().request(Url);\n\t\t\t\t\t Log.d(\"ip\",ip);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t boolean isIP = ip.length()>20?false:true; \n\t\t\t\t\t\n\t\t\t\t\t if(isIP){\n\t\t\t\t\t\t Ip=ip;\n//\t\t\t\t\t\t Log.d(\"ip\",Ip);\n\t\t\t\t\t\t mHandler.sendEmptyMessage(IP_INIT);\n\t\t\t\t\t }\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO: handle exception\n\t\t\t\t}\n\t\t\t \n\t\t\t \n\t\t\t}\n\t\t\t\n\t\t}.start();\n//\t\tfn.post(new Configs().new ServerInterface().GET_IP, new AjaxCallBack<Object>(){\n//\n//\t\t\t@Override\n//\t\t\tpublic void onSuccess(Object t) {\n//\t\t\t\t// TODO Auto-generated method stub\n//\t\t\t\t String ip=t.toString();\n//\t\t\t\t Log.d(\"debug\",ip);\n//\t\t\t\t boolean isIP = ip.length()>20?false:true; \n//\t\t\t\t\n//\t\t\t\t if(isIP){\n//\t\t\t\t\t mtv_ip.setText(ip);\n//\t\t\t\t }\n//\t\t\t}\n//\t\t\t \n//\t\t});\n\t}", "private static void insertClient() {\n\t String cpf = \"\",name = \"\",telefone = \"\",email = \"\";\n\t Client client = null;\n\t \n\t cpf = readCPF();\n\t try {\n\t\t client = cadClientes.searchByCPf(cpf);\n\t\t if(client != null){\n\t\t\t Console.printPrompt(\"We already have a client with this CPF\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch (SisVendaException e) {\n\t\t}\n\t\t \n\t name \t= readName();\n\t telefone = readString(\"Telefone(cannot be null):\");\n\t email = readEmail();\n\t \n\t client = new Client(cpf,name,telefone,email,\n\t\t\t new GregorianCalendar(),null);\n\t \n\t cadClientes.insertClient(client);\n\t saveData(Table.CLIENT);\n\t\n\t}", "public void saisirClient(){\n\t\tSystem.out.println(\"Saisir le nom du client :\");\n\t\tthis.nomClient = Lire.S();\n\t\tSystem.out.println(\"Saisir l'adresse de ce client :\");\n\t\tthis.adrClient = Lire.S();\n\t\tSystem.out.println(\"Saisir l'adresse mail du client :\");\n\t\tthis.adrEmail = Lire.S();\n\t\tSystem.out.println(\"Saisir le numéro de téléphone du client au format internationnal : \");\n\t\tthis.telClient = Lire.S();\n\t\tSystem.out.println(\"Saisir le numéro de fax du client au format internationnal : \");\n\t\tthis.faxClient = Lire.S();\n\t}", "public void setIpAddress(String tmp) {\n this.ipAddress = tmp;\n }", "private void ulozNajdeneInzeraty() {\n System.out.println(\"vsetci clienti skoncili, odstranujem duplikaty\");\r\n // deletneme potencionalne duplikatne inzeraty\r\n nacitajStromMien();\r\n\r\n // vytiahneme si vsetky sukromne inzeraty\r\n pockajNaDatabazu();\r\n List<Inzerat> sukromne = database.getSukromneInzeratyFrom(aktualnyPortal);\r\n System.out.println(\"inzertujem nove sukromne\");\r\n pockajNaDatabazu();\r\n // zisti ktore z tychto sukromnych su nove a insertni ich do db\r\n database.insertRemoteNoveSukromne(sukromne, aktualnyPortal);\r\n\r\n System.out.println(\"vsetky sukromne inzeraty inzertnute\");\r\n System.out.println(sdf.format(new Date(System.currentTimeMillis())) + \":\" + aktualnyPortal + \" UKONCENIE DOWNLOAD_ALL trvanie: \" + getElapsedTime(startTime));\r\n }", "public static String getIP() {\n return ip;\n }", "public static String getIpAddress() {\n try {\n \t//gets network interfaces \n for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {\n \t//take each network interface\n NetworkInterface intf = (NetworkInterface) en.nextElement();\n for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {\n InetAddress inetAddress = (InetAddress) enumIpAddr.nextElement();\n //makes sure that ip is not loopback and is the actual local ip \n if (!inetAddress.isLoopbackAddress()&&inetAddress instanceof Inet4Address) {\n String ipAddress=inetAddress.getHostAddress().toString();\n return ipAddress;\n }\n }\n }\n } catch (SocketException ex) {\n \t//this shouldn't happen\n \tSystem.out.println(\"UNEXPECTED ERROR GETTING IP\");\n }\n //if all else fails \n return null; \n\t}", "public Cliente getCliente (String nif) throws ClienteNoExiste {\r\n if ( clientes.containsKey( nif ) )\r\n return clientes.get(nif);\r\n else\r\n throw new ClienteNoExiste();\r\n }", "public abstract String getServerIP();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new NodeInitializer instance.
public NodesInitializer( final boolean isClassExistsTested, final char[] keyStorePassword, final BasicNodeRuntime nodeRuntime, final String keyStoreFilePath, final String containerConfigurationCertificateFilePath) { //Preconditions assert keyStorePassword != null : "keyStorePassword must not be null"; assert keyStorePassword.length > 0 : "keyStorePassword must not be empty"; assert nodeRuntime != null : "nodeRuntime must not be null"; assert StringUtils.isNonEmptyString(keyStoreFilePath) : "keyStoreFilePath must be a non-empty string"; assert StringUtils.isNonEmptyString(containerConfigurationCertificateFilePath) : "containerConfigurationCertificateFilePath must be a non-empty string"; this.isClassExistsTested = isClassExistsTested; this.keyStorePassword = keyStorePassword.clone(); this.nodeRuntime = nodeRuntime; this.keyStoreFilePath = keyStoreFilePath; this.configurationCertificateFilePath = containerConfigurationCertificateFilePath; containerName = nodeRuntime.getContainerName(); nodeAccess = nodeRuntime.getNodeAccess(); }
[ "ForInitializer createForInitializer();", "public Node() {\n }", "public ClusterChainGenerator() {\n logger.info(\"Initialized new ClusterChainGenerator instance\");\n }", "public Node()\n\t{\n\t\t// Defaults\n\t\tbounds = new Rectangle(0, 0);\n\t\tdepth = 0;\n\t\tmaxChildren = 5;\n\t\tmaxDepth = 5;\n\t\t\n\t\tmyBodies = new ArrayList<RigidBody>();\n\t\tsubNodes = new Node[4];\n\t}", "public NodeRepositoryTest() {\n LOG.debug(\"default constructor.\");\n }", "public NodeImplementationLauncherBootstrap(String compositeURI, ClassLoader contributionClassLoader) throws Exception {\n SCANodeFactory nodeFactory = SCANodeFactory.newInstance();\n node = new NodeFacade(nodeFactory.createSCANodeFromClassLoader(compositeURI, contributionClassLoader));\n }", "public BvhNode() {\n }", "public WorkerNode() {\n\n\t}", "void init(TreeNode node);", "public DynamicNode() {\n\n }", "public Node(int version, byte[] addr, long uniqueId) {\n this.addr = addr != null ? addr.clone() : null;\n this.uniqueId = uniqueId;\n this.version = version;\n\n LOGGER.debug(\"Created new node, addr: {}, version: {}, {}\", addr, version, NodeUtils\n .getUniqueIdAsString(uniqueId));\n }", "protected void setUp() {\n\n graphNode = createGraphNode(\n \"InitialNode\", \n new Point(100, 150), \n new Dimension(20, 20), \n \"000000\");\n \n properties = createProperties();\n\n node = new InitialNode(\n graphNode, \n properties, \n new Point(5, 5), \n new Rectangle(5, 5, 25, 25));\n }", "public TrieNode() {\n \n }", "public ANode(){\n\n\t}", "public NodeContainer() {\n }", "@BeforeClass\n public static void init() {\n try {\n for (int i = 0; i != nodes.length; ++i) {\n nodes[i] = new Node();\n }\n } catch (NoSuchAlgorithmException ignore) {\n fail();\n }\n }", "public NodeController() {\r\n\t\tsuper();\r\n\t\tZKServer.init();\r\n\t\tProperties defaultSettings = Settings.getProperties();\r\n\t\t\r\n\t\tString ZkServer = defaultSettings.getProperty(Settings.ZOOKEEPER_DEFAULT);\r\n\t\tnode = NodeLinker.init(ZkServer);\r\n\t\t\r\n\t\t/*InputStream in;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tin = this.getClass().getClassLoader()\r\n\t\t\t\t\t.getResourceAsStream(\"Nodeservice.properties\");\r\n\t\t\tproperty.load(in);\r\n\t\t\tin.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t\r\n\t\t}*/\r\n\t}", "public TrieNode() {\r\n\t\t\r\n\t}", "public LinkedListNode()\n {\n this(null, null, null);\n }", "public DNode()\n\t{\n\t\tthis(null, null);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check corectness of topological sort
@Test public void getTopologicalSort(){ Collection<Node> nodes = graph.getNodes(); List<String> sortedNodes = new LinkedList<String>(); for(Node node: nodes){ sortedNodes.add(node.getName()); } List<String> actualList = new LinkedList<String>(Arrays.asList("0","1","2", "3", "4", "5", "6", "7", "8", "9")); assertEquals(sortedNodes,actualList); }
[ "private static void ex22_4_1() {\n\t\tAdjacencyListGraph<TCPLVertex> g = new AdjacencyListGraph<TCPLVertex>(\n\t\t\t\ttrue, false);\n\t\tTestFigures.figure22_8_dag_alphabetically(g, TCPLVertex.class);\n\t\tg.print();\n\t\tList<TCPLVertex> list = null;\n\t\ttry {\n\t\t\tlist = GraphAlgorithm.topologicalSortByDFS(g);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(list);\n\t\tboolean flag = GraphAlgorithm.isTopologicalSorted(g, list);\n\t\tSystem.out.println(flag);\n\t\tAssert.assertTrue(flag);\n\t\tString[] array = new String[] { \"p\", \"n\", \"o\", \"s\", \"m\", \"r\", \"y\", \"v\",\n\t\t\t\t\"x\", \"w\", \"z\", \"u\", \"q\", \"t\" };\n\t\tif (list != null)\n\t\t\tfor (int i = 0; i < list.size(); ++i) {\n\t\t\t\tAssert.assertEquals(array[i], list.get(i).getName());\n\t\t\t}\n\t\tg.print();\n\n\t}", "@Override\n\tpublic void topologicalSort() {\n\t\tStack<Integer> stack = new Stack<Integer>();\n\t\t \n // Mark all the vertices as not visited\n boolean visited[] = new boolean[vertice];\n for(int i = 0; i < visited.length; i++) {\n \t\tif(!visited[i]) {\n \t\t\tdfSearch(i, visited, stack);\n \t\t}\n }\n }", "public void topologicalSort() {\n\t\tint[] indegree = new int[getNumVertices()];\n\n\t\t// Initialize the indegree array for the AdjListsMap\n\n\t\tfor (int vertex : adjListsMap.keySet()) {\n\n\t\t\tindegree[vertex] = getIndegree(vertex);\n\n\t\t}\n\n\t\t// Create a queue and enqueue all vertices with in-degree 0\n\t\tQueue<Integer> queue = new LinkedList<>();\n\n\t\tfor (int i = 0; i < indegree.length; i++) {\n\n\t\t\tif (indegree[i] == 0) {\n\t\t\t\tqueue.add(i);\n\t\t\t}\n\t\t}\n\n\t\t// initialize count of visited vertices\n\t\tint visited = 0;\n\t\t// create an arraylist to store toporder\n\t\tArrayList<Integer> toporder = new ArrayList<>();\n\n\t\twhile (!queue.isEmpty()) {\n\n\t\t\tint v = queue.poll();\n\t\t\ttoporder.add(v);\n\n\t\t\t// Iterate though v's neighbors and decrement their in-degrees by 1\n\t\t\tList<Integer> neighbors = getNeighbors(v);\n\n\t\t\tfor (int neighbor : neighbors) {\n\n\t\t\t\tindegree[neighbor]--;\n\t\t\t\tif (indegree[neighbor] == 0) {\n\t\t\t\t\tqueue.add(neighbor);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvisited++;\n\t\t}\n\n\t\tif (visited != getNumVertices()) {\n\t\t\tSystem.out.println(\"There was a cycle in the graph\");\n\t\t}\n\n\t\tSystem.out.println(\"Printing the topological order\");\n\t\ttoporder.stream().forEach(System.out::println);\n\t}", "static void topologicalSort() {\n int[] indegree = new int[graph.v];\n\n for (int idx = 0; idx < graph.v; idx++) {\n for (int node : graph.adj[idx]) {\n indegree[node]++;\n }\n }\n\n Queue<Integer> queue = new LinkedList<>();\n for (int idx = 0; idx < graph.v; idx++) {\n if (indegree[idx] == 0) queue.add(idx);\n }\n\n int countNode = 0;\n\n List<Integer> result = new ArrayList<>();\n while (!queue.isEmpty()) {\n int node = queue.remove();\n result.add(node);\n countNode++;\n\n for(int idx : graph.adj[node]) {\n indegree[idx]--;\n if (indegree[idx] == 0) queue.add(idx);\n }\n }\n\n // Check cycle\n if (countNode != graph.v) {\n System.out.println(\"There exists a cycle in the graph\");\n return;\n }\n\n System.out.println(result.toString());\n return;\n }", "private void Sort() {\n\t\t\n\t\tfor(int i = 0; i < vertices; i++) {\n\t\t\tSystem.out.println(i);\n\t\t\tif(!visited[i]) {\n\t\t\t\ttopoUtil(i, ordered);\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Test\n public void sortReachable1() {\n // comparator definition\n Comparator<TodoElement> c = (t1, t2) -> {\n return t2 == null ? 1 : t1.name.getValue().compareTo(t2.name.getValue());\n };\n\n // Initialize\n var v1 = graph.addVertex(t1);\n var v2 = graph.addVertex(t2);\n var v3 = graph.addVertex(t3);\n var v4 = graph.addVertex(t4);\n\n graph.addDirectedEdge(v1, v2);\n graph.addDirectedEdge(v1, v3);\n graph.addDirectedEdge(v1, v4);\n graph.sortReachable(c, v1);\n\n TodoElement prev = null;\n\n // Testing the sort within our root vertex adjacency list\n for (var v : graph.getOutVertices(v1)) {\n assertTrue(c.compare(v.getElement(), prev) >= 0);\n prev = v.getElement();\n }\n }", "private void topoSort(){\n\t\tthis.topList = new ArrayList<>();\n\t\tMap<Node, Integer> indegree = new HashMap<>();\n\t\tQueue<Node> queue = new LinkedList<>();\n\n\t\tfor(Node node : cpList.keySet()){\n\t\t\tindegree.put(node, cpList.get(node).size());\n\t\t\tif(cpList.get(node).size() == 0)\n\t\t\t\tqueue.add(node);\n\t\t}\n\n\t\twhile(!queue.isEmpty()){\n\t\t\tNode node = queue.remove();\n\t\t\tthis.topList.add(node);\n\n\t\t\tfor(Node cn : adj.get(node)){\n\t\t\t\tindegree.put(cn, indegree.get(cn) - 1);\n\t\t\t\tif(indegree.get(cn) <= 0)\n\t\t\t\t\tqueue.add(cn);\n\t\t\t}\n\t\t}\n\n\t}", "Vertex [] topologicalSort();", "public void topologicalSort(){\n Stack stack = new Stack();\n \n // Mark all the vertices as not visited\n boolean visitedTopo[] = new boolean[v];\n for (int i = 0; i < v; i++)\n visitedTopo[i] = false;\n \n // Call the recursive helper function to store\n // Topological Sort starting from all vertices\n // one by one\n for (int i = 0; i < v; i++)\n if (visitedTopo[i] == false)\n topologicalSortUtil(i, visitedTopo, stack);\n \n // Print contents of stack\n while (stack.empty()==false)\n System.out.print(stack.pop() + \" \");\n }", "public void dfsTopologicalSort() {\n HashMap<T, Boolean> visited = new HashMap<>();\n LinkedList<T> output = new LinkedList<>();\n\n for(Map.Entry<T, ArrayList<T>> entry : adjList.entrySet()) {\n if(!visited.containsKey(entry.getKey())) {\n dfsTopologicalSort(entry.getKey(), visited, output);\n }\n }\n\n for(T element : output) {\n System.out.print(element + \" -> \");\n }\n System.out.println();\n }", "private void topologicalSorting() {\n\n\t\t\tQueue<Character> bfs = new LinkedList<>();\n\t\t\tint[] indegree = this.indegree();\n\t\t\tfor(int i = 0; i < indegree.length; i++) {\n\t\t\t\tif(indegree[i] == 0) {\n\t\t\t\t\tbfs.add((char)(i + 'a'));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\twhile(!bfs.isEmpty()) {\n\t\t\t\tchar front = bfs.poll();\n\t\t\t\t\n\t\t\t\tSystem.out.print(front + \" \");\n\t\t\t\t\n\t\t\t\tfor(char neighbour : this.adjL.getOrDefault(front, new ArrayList<>())) {\n\t\t\t\t\tindegree[neighbour - 'a']--;\n\t\t\t\t\t\n\t\t\t\t\tif(indegree[neighbour - 'a'] == 0) {\n\t\t\t\t\t\tbfs.add(neighbour);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private void topologicalSortUtil(ComponentObject c, LinkedList<ComponentObject> queue) {\n\t\tif(c.isVisited())\n\t\t\treturn;\n\t\t\n\t\tc.setVisited(true);\n\t//\tSystem.out.println(c.getDependentVars());\n\t\tfor (String dependent : c.getDependentVars()) {\n\t\t\tComponentObject c1 = graphObjects.get(dependent);\n\t\t\t\n\t\t//\tSystem.out.println(c.getVarName() + \" dependent on \" + dependent + \" \" + c1.isVisited());\n\n\t\t\t\n\t\t\tif (c1 == null) {\n\t\t\t\t System.out.println(\"null:\" + dependent);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!c1.isVisited()) {\n\t\t\t\ttopologicalSortUtil(c1, queue);\n\t\t\t}\n\t\t}\n\t\tqueue.add(c);\n\t}", "int[] topologicalSort()\n {\n Stack<Integer> stack = new Stack<Integer>();\n\n // Mark all the vertices as not visited\n boolean[] visited = new boolean[V];\n\n // Call the recursive helper\n // function to store\n // Topological Sort starting\n // from all vertices one by one\n for (int i = 0; i < V; i++){\n if (!visited[i])\n topologicalSortUtil(i, visited, stack);\n }\n\n int[] order = new int[stack.size()];\n int i = 0;\n\n\n while (!stack.empty()){\n order[i] = stack.pop();\n i++;\n }\n\n return order;\n\n }", "public List<T> topologicalSort() throws CyclicDependencyException {\n long stamp = lock.readLock();\n try {\n ArrayList<T> result = new ArrayList<>();\n Deque<T> noIncomingEdges = new ArrayDeque<>();\n\n Map<T, Integer> temp = new HashMap<>();\n for (Map.Entry<T, Set<T>> incoming : incomingEdges.entrySet()) {\n int size = incoming.getValue().size();\n T key = incoming.getKey();\n temp.put(key, size);\n if (size == 0) {\n noIncomingEdges.add(key);\n }\n }\n\n while (!noIncomingEdges.isEmpty()) {\n T n = noIncomingEdges.poll();\n result.add(n);\n temp.remove(n);\n Set<T> elements = outgoingEdges.get(n);\n if (elements != null) {\n for (T m : elements) {\n Integer count = temp.get(m);\n temp.put(m, --count);\n if (count == 0) {\n noIncomingEdges.add(m);\n }\n }\n }\n }\n if (!temp.isEmpty()) {\n throw new CyclicDependencyException(\"Cycle detected\");\n } else {\n return result;\n }\n } finally {\n lock.unlockRead(stamp);\n }\n }", "public static void main(String[] args) {\r\n RevisionTopologicalSort ts=new RevisionTopologicalSort();\r\n \r\n // loading the graph \r\n int numVertex=6;\r\n Vertex V[]=new Vertex[numVertex+1];\r\n \r\n V[1]=new Vertex('1');\r\n V[2]=new Vertex('2');\r\n V[3]=new Vertex('3');\r\n V[4]=new Vertex('4');\r\n V[5]=new Vertex('5');\r\n V[6]=new Vertex('6');\r\n \r\n //connecting he nodes\r\n //1--> 2,3\r\n V[1].setOuts(V[2]);\r\n V[1].setOuts(V[3]);\r\n \r\n //2--> 3,4\r\n V[2].setOuts(V[3]);\r\n V[2].setOuts(V[4]);\r\n \r\n //3->5\r\n\t\tV[3].setOuts(V[5]);\r\n\t\t\r\n\t\t\r\n\t\t//4->6\r\n\t\tV[4].setOuts(V[6]);\r\n\t\t\r\n\t\t//5->4,6\r\n\t\tV[5].setOuts(V[6]);\r\n\t\tV[5].setOuts(V[4]);\r\n \r\n // Checking the graph that It is connected properly by visiting each vertex\r\n int j,k;\r\n for(j=1;j<=numVertex;j++) \r\n {\r\n System.out.print(V[j].getName()+\"==>\");\r\n \r\n for(k=1;k<=V[j].numOuts;k++) \r\n {\r\n System.out.print(V[j].getOuts(k).getName()+\" \");\r\n }\r\n System.out.println();\r\n }\r\n \r\n int i;\r\n for(i=1;i<=numVertex;i++) \r\n {\r\n if(!V[i].isVisited())\r\n ts.dfs(V[i]);\r\n }\r\n \r\n // Pop till the stack gets empty\r\n while(!ts.stk.isEmpty())\r\n {\r\n System.out.println(\"Vertex\"+((Vertex)ts.stk.pop()).getName()+\"is popped out\");\r\n }\r\n \r\n }", "@Test\r\n\tpublic void testTopographicalSortWithExampleGraph() {\r\n\t\t// This test should fail because the specified graph contains a cycle\r\n\t\texception.expect(UnsupportedOperationException.class);\r\n\t\tpath = GraphUtil.topologicalSort(\"src/assign8/Tests/ExampleTests/examplegraph.dot\");\r\n\t}", "private static <U> Multiset<U> computeGeneralTopSort(Multimap<U, U> edges, Set<U> roots) {\r\n\t\tMultiset<U> result = HashMultiset.create();\r\n\t\tSet<U> touched = Sets.newHashSet();\r\n\t\tList<Set<U>> components = stronglyConnected(edges);\r\n\r\n\t\twhile (edges.size() > 0 && roots.size() > 0) {\r\n\t\t\t// Peel back a well-ordered layer and append to our ordering\r\n\t\t\tint resultSize = result.elementSet().size();\r\n\t\t\tMultiset<U> peel = topSort(edges, roots);\r\n\t\t\tfor (U u : peel.elementSet()) { result.add(u, resultSize + peel.count(u)); }\r\n\r\n\t\t\t// Construct a new set of roots and edges for the next iteration\r\n\t\t\t// The new roots are the remaining children of the nodes we removed.\r\n\t\t\troots.clear();\r\n\t\t\ttouched.addAll(peel);\r\n\t\t\tIterables.addAll(roots, OtmUtil.valueIterable(edges, peel));\r\n\r\n\t\t\tfor (U node : peel.elementSet()) edges.removeAll(node);\r\n\t\t\troots.removeAll(touched);\r\n\r\n\t\t\t// If a strongly connected component has been reached,\r\n\t\t\t// induce an ordering over it and append to our ordering\r\n\t\t\tSet<U> exposed = Sets.newHashSet();\r\n\t\t\tfor (Set<U> component : components) {\r\n\t\t\t\tif (Colut.containsNone(component, roots)) continue;\r\n\r\n\t\t\t\tfor (U node : component) { result.add(node, 1 + result.entrySet().size()); }\r\n\t\t\t\ttouched.addAll(component);\r\n\r\n\t\t\t\tIterables.addAll(exposed, OtmUtil.valueIterable(edges, component));\r\n\t\t\t\texposed.removeAll(component);\r\n\t\t\t\troots.removeAll(component);\r\n\t\t\t}\r\n\r\n\t\t\t// Compute new roots if we had to remove components\r\n\t\t\tif (components.size() > 0) roots.addAll(exposed);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "private void topologicalSort(Queue<Vertex> q) {\n int counter = 0;\n while(!q.isEmpty()) {\n Vertex v = q.poll();\n \n v.topoNo = ++counter;\n for(int i=0;i<v.edgeList.size();i++) {\n int adjVertexNo = v.edgeList.get(i);\n Vertex adjVertex = (Vertex)graph.get(adjVertexNo);\n adjVertex.indegree--;\n if(adjVertex.indegree == 0) {\n q.add(adjVertex);\n }\n graph.put(adjVertex.id, adjVertex);\n\n }\n System.out.print(v.id + \" \");\n }\n System.out.println(\"\");\n\n if(counter != graph.size()) {\n System.err.println(\"Cycle detected\");\n System.exit(0);\n \n }\n }", "private boolean topologicalSort(List<List<Integer>> graph, int v, Stack<Integer> stack, int[] visited) {\n if (visited[v] == 1) return false;\n if (visited[v] == 2) return true;\n visited[v] = 1;\n for (Integer u : graph.get(v)) {\n if (!topologicalSort(graph, u, stack, visited)) return false;\n }\n visited[v] = 2;\n stack.push(v);\n return true;\n }", "private int[] topologySort(int numberOfNode, Map<Integer, List<Integer>> dag) {\n int[] referencedCount = new int[numberOfNode];\n for (int i = 0; i < numberOfNode; i++) {\n if (dag.containsKey(i)) {\n for (Integer neighbord : dag.get(i)) {\n referencedCount[neighbord]++;\n }\n }\n }\n\n int[] order = new int[numberOfNode];\n for (int i = 0; i < numberOfNode; i++) {\n int node = findNoReferenced(referencedCount);\n if (node == -1) {\n return IMPOSIBLE;\n }\n order[i] = node;\n referencedCount[node] = -1;\n\n if (dag.containsKey(node)) {\n for (Integer neighbord : dag.get(node)) {\n referencedCount[neighbord]--;\n }\n }\n }\n return order;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the maximum pressure of the hurricanes.
public int findMaxPressure( ) { int maxPressure=Integer.MIN_VALUE; for(int i=0;i<hurricanes.size();i++) { maxPressure=Math.max(maxPressure,hurricanes.get(i).getPressure()); } return maxPressure; }
[ "public double getMaxHR(){\n double max = 0;\n for (int i = 0; i < activityData.size(); i++){\n if (activityData.get(i).getHeartRate() >= max){\n max = activityData.get(i).getHeartRate();\n }\n }\n return max;\n }", "float getMaximumValue();", "public String getHighestPressureUnits() {\n return highestPressureUnits;\n }", "public int getHighValue()\r\n\t{\r\n\t\tif (temperatures.isEmpty())\r\n\t\t\t{\r\n\t\t\treturn 0;\r\n\t\t\t}\r\n\t\tint high = temperatures.get(0);\r\n\t\tfor (Integer currentTemp : temperatures)\r\n\t\t\t{\r\n\t\t\tif (currentTemp > high)\r\n\t\t\t\t{\r\n\t\t\t\thigh = currentTemp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn high;\r\n\t}", "double getMaxHeatStored();", "public final float max() {\n\t\tfloat p;\n\t\tfloat max = Short.MIN_VALUE;\n\t\tfor (int y = 0; y < Y; y++) {\n\t\t\tfor (int x = 0; x < X; x++) {\n\t\t\t\tp = data[y][x];\n\t\t\t\tif (p > max)\n\t\t\t\t\tmax = p;\n\t\t\t}\n\t\t}\n\t\treturn (float) max;\n\t}", "public int maxBarH() { return maxBarH(max_d); }", "private double findMax(double[] trace) {\n int traceLength = trace.length;\n double max = 0.0;\n \n for (int j = 0; j < traceLength; j++) {\n if (trace[j] > max) {\n max = trace[j];\n }\n }\n \n return max;\n \n }", "protected double getMaximumValue() {\n\t\treturn this.statistics.getMax();\n\t}", "double GetMaxTempF()\n {\n JSONObject temp = (JSONObject) this.Weather.get(\"main\");\n String temp2 = temp.get(\"temp_max\").toString();\n return (RoundDouble(9/5.0*(Double.parseDouble(temp2)-273.15)+32));\n }", "public abstract double max();", "public BigDecimal getHighestHumidity() {\n return highestHumidity;\n }", "Value findMax();", "public int returnMaximum()\n {\n return MAX_GUESS;\n }", "public void findMax() {\n if (array==null){\n System.out.println(\"Pyramide do not exist\");\n }\n else {\n Node root = getRoot();\n\n int pathLength = findMaxPath();\n if (!(pathLength == array.length)) {\n System.out.println( \"Max sum can't count, becouse way to the bottom of Pyramid don't exist\" );\n\n } else {\n long maxsum = findMaxUtil( root, pathLength );\n getPath( root, maxsum );\n System.out.println( \"Max sum is = \" + maxsum );\n printList();\n }\n }\n }", "public double getLongestRhythmValue() {\n double max = 0.0;\n Enumeration enumElem = getPartList().elements();\n\t\twhile(enumElem.hasMoreElements()){\n\t\t\tPart part = (Part) enumElem.nextElement();\n if(part.getLongestRhythmValue() > max) max = part.getLongestRhythmValue();\n }\n return max;\n }", "public double getPostMembranePressureMax() {\r\n return postMembranePressureMax;\r\n }", "public float getLargestArea() {\n\t\treturn Collections.max(peaks.values());\n\t}", "public int getMaxPH() {\n\t\treturn maxPH;\n\t}", "public double getMax() { return max; }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new object of class 'Role Attribute Setter'.
RoleAttributeSetter createRoleAttributeSetter();
[ "public abstract Builder setRole(String role);", "private void setRole() {\n\n\t}", "public void setRole(Role role){ this.role = role; }", "@Override\n public UserRole createRole(UserRole newRole) {\n UserRole savedUserRole = new UserRole();\n savedUserRole.setName(newRole.getName());\n\n return savedUserRole;\n }", "public Builder setRole(NodeRole value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n role_ = value.getNumber();\n onChanged();\n return this;\n }", "public final EObject ruleRoleAttributeSetter() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n EObject lv_attr_0_0 = null;\n\n EObject lv_value_2_0 = null;\n\n\n enterRule(); \n \n try {\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2365:28: ( ( ( (lv_attr_0_0= ruleRoleAttributeTypeReference ) ) otherlv_1= '=' ( (lv_value_2_0= ruleDataExpression ) ) ) )\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2366:1: ( ( (lv_attr_0_0= ruleRoleAttributeTypeReference ) ) otherlv_1= '=' ( (lv_value_2_0= ruleDataExpression ) ) )\n {\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2366:1: ( ( (lv_attr_0_0= ruleRoleAttributeTypeReference ) ) otherlv_1= '=' ( (lv_value_2_0= ruleDataExpression ) ) )\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2366:2: ( (lv_attr_0_0= ruleRoleAttributeTypeReference ) ) otherlv_1= '=' ( (lv_value_2_0= ruleDataExpression ) )\n {\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2366:2: ( (lv_attr_0_0= ruleRoleAttributeTypeReference ) )\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2367:1: (lv_attr_0_0= ruleRoleAttributeTypeReference )\n {\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2367:1: (lv_attr_0_0= ruleRoleAttributeTypeReference )\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2368:3: lv_attr_0_0= ruleRoleAttributeTypeReference\n {\n if ( state.backtracking==0 ) {\n \n \t newCompositeNode(grammarAccess.getRoleAttributeSetterAccess().getAttrRoleAttributeTypeReferenceParserRuleCall_0_0()); \n \t \n }\n pushFollow(FOLLOW_ruleRoleAttributeTypeReference_in_ruleRoleAttributeSetter5091);\n lv_attr_0_0=ruleRoleAttributeTypeReference();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getRoleAttributeSetterRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"attr\",\n \t\tlv_attr_0_0, \n \t\t\"RoleAttributeTypeReference\");\n \t afterParserOrEnumRuleCall();\n \t \n }\n\n }\n\n\n }\n\n otherlv_1=(Token)match(input,29,FOLLOW_29_in_ruleRoleAttributeSetter5103); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \tnewLeafNode(otherlv_1, grammarAccess.getRoleAttributeSetterAccess().getEqualsSignKeyword_1());\n \n }\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2388:1: ( (lv_value_2_0= ruleDataExpression ) )\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2389:1: (lv_value_2_0= ruleDataExpression )\n {\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2389:1: (lv_value_2_0= ruleDataExpression )\n // ../eu.ascens.helenaText/src-gen/eu/ascens/parser/antlr/internal/InternalHelenaText.g:2390:3: lv_value_2_0= ruleDataExpression\n {\n if ( state.backtracking==0 ) {\n \n \t newCompositeNode(grammarAccess.getRoleAttributeSetterAccess().getValueDataExpressionParserRuleCall_2_0()); \n \t \n }\n pushFollow(FOLLOW_ruleDataExpression_in_ruleRoleAttributeSetter5124);\n lv_value_2_0=ruleDataExpression();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \t if (current==null) {\n \t current = createModelElementForParent(grammarAccess.getRoleAttributeSetterRule());\n \t }\n \t\tset(\n \t\t\tcurrent, \n \t\t\t\"value\",\n \t\tlv_value_2_0, \n \t\t\"DataExpression\");\n \t afterParserOrEnumRuleCall();\n \t \n }\n\n }\n\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public Builder setRoleId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n roleId_ = value;\n onChanged();\n return this;\n }", "void setRole(final UserRoles role);", "public Builder setRole(proto.UserRoleEnum value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n role_ = value.getNumber();\n onChanged();\n return this;\n }", "private UserRole createUserRole() {\n UserRole userRole = userRoleRepository.findByName(\"ROLE_ADMIN\");\n if(userRole == null){\n userRole = new UserRole();\n userRole.setName(\"ROLE_ADMIN\");\n userRole = userRoleRepository.save(userRole);\n }\n return userRole;\n }", "public Builder setRoleValue(int value) {\n role_ = value;\n onChanged();\n return this;\n }", "public void assignRole() {\n\r\n\t}", "public Role getRole();", "public void setRole(org.hl7.rim.Role role) { /* throw new UnsupportedOperationException(); */ }", "@Test\n\tpublic void testSetRole_1()\n\t\tthrows Exception {\n\t\tEquipmentType fixture = new EquipmentType(\"\", new Specification());\n\t\tfixture.setRole(new Role(\"\", new Specification()));\n\t\tRole role = new Role(\"\", new Specification());\n\n\t\tfixture.setRole(role);\n\n\t\t// add additional test code here\n\t}", "Role(int level, String name) {\n this.level = level;\n this.name = name;\n }", "public static com.fretron.Model.Role.Builder newBuilder(com.fretron.Model.Role other) {\n return new com.fretron.Model.Role.Builder(other);\n }", "public Role getRole() {\n\t return super.role;\n }", "public Role getRole() {\n\treturn role;\n }", "public RoleInterface getTargetRole()\r\n \t{\r\n \t\treturn targetRole;\r\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loggedin user ID to impersonate instead of the user's ID.
public UpdateLeads setRequestMetadataUserOverridesUserId(java.lang.String requestMetadataUserOverridesUserId) { this.requestMetadataUserOverridesUserId = requestMetadataUserOverridesUserId; return this; }
[ "protected String getUserIdentifier() {\n return GlobalVariables.getUserSession().getPrincipalId();\n }", "String getCurrentUserID();", "String getIdUser();", "String getCurrentUserEntityID();", "public String getSessionUserId();", "public static String user_id() {\n\t\treturn moduleProvider.get().user_id;\n\t}", "public void setImpersonatorId(java.lang.CharSequence value) {\n this.impersonatorId = value;\n }", "public java.lang.CharSequence getImpersonatorId() {\n return impersonatorId;\n }", "public String getCurrentUserIdentifier() {\n return Optimobile.getCurrentUserIdentifier(context);\n }", "public Long getId() {\n\t\treturn getLoggedInUserDetails() != null ? getLoggedInUserDetails().getId() : null;\n\t}", "public String getLoginID()\r\n\t{\r\n\t\treturn identity;\r\n\t}", "User getCurrentLoggedInUser() throws Exception;", "public int getUserID() {\n return prvPref.getInt(\"USER_ID\", 0);\n }", "public abstract String getUserid();", "@Override\n protected UserInfo getLoginUser() {\n UserInfo ui = super.getLoginUser();\n if(ui == null){\n ui = userService.findOne(userId);\n }\n return ui;\n }", "int getUserId(String userLogin);", "public int getUserID(){\n return inode.getUserID();\n }", "private void getUserId() {\n\n // Check if there already is an id in the memory\n UserManager userManager = new UserManager(this);\n userId = userManager.getUserId();\n\n // If not, mark as new user (to be guided to create username in continueToApp())\n if (userId == null) {\n isNewUser = true;\n }\n\n taskCompleted();\n }", "public static int getUserId() {\n String userName = getCurrentUserName();\n return authBiz.getUserId(userName);\n }", "public String getUserId(final HttpServletRequest request) {\n Validate.notNull(request);\n String user;\n if (AppConfig.findBoolean(\"AwsVpnTelemetryHorizonte.use_midway\")) {\n user = request.getHeader(MidwayProxyDelegationFilter.MIDWAY_PROXY_AUTH_IDENTITY_HEADER);\n if (StringUtils.isBlank(user)) {\n user = DEFAULT_USER;\n }\n } else {\n user = DEFAULT_USER;\n }\n return user;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (mView != null) { ViewGroup parent = (ViewGroup) mView.getParent(); if (parent != null) parent.removeView(mView); } try { mView = inflater.inflate(R.layout.fragment_online_map, container, false); } catch (InflateException e) { /* map is already there, just return view as it is */ } ((MainActivity)getActivity()).isOnlineMap = true; googleMap = ((MapFragment) getActivity().getFragmentManager().findFragmentById(R.id.googleMapView)) .getMap(); googleMap.setMyLocationEnabled(true); MarkerOptions options = new MarkerOptions(); options.position(hospitalPosition); if (hospitalPosition.latitude != 0 || hospitalPosition.longitude != 0) googleMap.addMarker(options); googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(41.025232, 29.017080), 6.0f)); return mView; }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.movie_statistic_layout, parent, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.fragment_question, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_volley2, container, false);\n\n // link graphical items to variables\n temperature = (TextView) view.findViewById(R.id.temperature);\n description = (TextView) view.findViewById(R.id.description);\n weatherBackground = (ImageView) view.findViewById(R.id.weatherbackground);\n\n // Implementation\n implementation();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n final View view = inflater.inflate(getLayout(), container, false);\n\n setupLayout(view);\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.bookmark_band_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.manu, container, false);\n getXmlList();\n copyFileList();\n initView();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_emotion_packet, container, false);\n initView(rootView);\n initListener();\n return rootView;\n }", "@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_opportunity, null);\r\n\r\n\t\t// 设置右上角的图标\r\n\t\taddButton = (ImageView) getActivity().findViewById(R.id.addButton);\r\n\t\taddButton.setImageResource(R.drawable.back);\r\n\t\taddButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tFragment newFragment = new MainFragment(R.id.business);\r\n\t\t\t\tString title = getString(R.string.business);\r\n\t\t\t\tgetFragmentManager().beginTransaction().replace(R.id.content_frame, newFragment).commit();\r\n\t\t\t\tTextView topTextView = (TextView) getActivity().findViewById(R.id.topTv);\r\n\t\t\t\ttopTextView.setText(title);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn view;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qr_gen, container, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.fragment_fate, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance){\n\n return inflater.inflate(R.layout.fragment_scrapbook, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_home, container, false);\n rcv = view.findViewById(R.id.RCV);\n comment = view.findViewById(R.id.Comment);\n lottie = view.findViewById(R.id.Lottie);\n ConnectXML();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater,\n ViewGroup container, Bundle savedInstanceState) {\n initConfigAndView(inflater, container, R.layout.com_parse_ui_parse_login_help_fragment);\n\n mTxtInstructions = (TextView) mLayout.findViewById(R.id.login_help_instructions);\n mEdtEmailAddress = (EditText) mLayout.findViewById(R.id.login_help_email_input);\n mBtnSubmit = (Button) mLayout.findViewById(R.id.login_help_submit);\n\n mBtnSubmit.setOnClickListener(this);\n\n return mLayout;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bottom_sheet_details, container, false);\n // binding views\n boxMessage = view.findViewById(R.id.box_messages);\n boxResult = view.findViewById(R.id.box_result);\n htmlTextMessage = view.findViewById(R.id.html_text_message);\n progressLoading = view.findViewById(R.id.progress_loading_country);\n htmlTextNames = view.findViewById(R.id.text_country_names);\n htmlTextDetails = view.findViewById(R.id.text_country_details);\n imageFlag = view.findViewById(R.id.image_country_flag);\n // set loading message\n htmlTextMessage.setHtmlText(getString(R.string.html_message_loading_country, getArguments().getString(\"name\")));\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n\n return inflater.inflate(R.layout.fragment_account, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_guan_zhu, container, false);\n initView(inflate);\n initdata();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_whole_task, container, false);\n ButterKnife.bind(this, view);\n refreshLayout.setOnRefreshListener(this);\n refreshLayout.setOnLoadmoreListener(this);\n loadData();\n setAdapter();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_show_mult_att, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_timeline, parent, false);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indent this string as if it were written by a coder or eclipse, based on parenthesis.
public String indent(String s, String tab, HashSet<Character> openParens, HashSet<Character> closeParens){ StringBuilder result = new StringBuilder(); int depth = 0; int lineLength = 0; LinkedList<Character> stack = new LinkedList<Character>(); for(char c : s.toCharArray()){ stack.addLast(c); } while(!stack.isEmpty()){ char c = stack.pop(); if(openParens.contains(c)){ depth ++; result.append(c); //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } else if(closeParens.contains(c)){ depth --; //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } result.append(c); //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } else{ if(c == '\n'){ //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } else{ lineLength ++; if(lineLength > 70 && c == ' '){ //go to the last space in this chunk. // if the character after it isn't a newline, then // make this whole chunk of spaces into a newline. while(stack.peek() == ' '){ c = stack.pop(); } if(stack.peek() != '\n'){ //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } } result.append(c); } } } return result.toString(); }
[ "private String buildIndent()\n {\n return Strings.repeat(\" \", indent * 4);\n }", "public static String indent(String src) {\r\n\t\treturn indent(\" \", src);\r\n\t}", "private void doIndent() {\r\n\t\tfor (int i = 0; i < indent; i++) {\r\n\t\t\tresult.append(\" \");\r\n\t\t}\r\n\t}", "@Override\n\tpublic String translateIndentation(int tap) {\n\t\tString esp= \"\";\n\t\tfor(int i =0; i<tap;i++)esp+=\"\\t\";\n\t\treturn esp +this.translate();\n\t}", "private void doIndent() throws SAXException {\n/* 261 */ if (this.depth > 0) {\n/* 262 */ char[] ch = this.indentStep.toCharArray();\n/* 263 */ for (int i = 0; i < this.depth; i++) {\n/* 264 */ characters(ch, 0, ch.length);\n/* */ }\n/* */ } \n/* */ }", "private String buildIndent(int depth) {\n StringBuilder strBuilder = new StringBuilder();\n for (int i = 0; i < depth * INDENT_SIZE; i++) {\n strBuilder.append(SPACE);\n }\n return strBuilder.toString();\n }", "protected void writeIndent() throws IOException {}", "protected String getIndent(int iDepth) {\n\t\tString indent = \"\\n\";\n\t\tfor (int i=0; i<iDepth; ++i) {\n\t\t\tindent += \" \";\n\t\t}\n\t\treturn indent;\n\t}", "private String toIndentedString(Object o)\n/* */ {\n/* 164 */ if (o == null) {\n/* 165 */ return \"null\";\n/* */ }\n/* 167 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private String print_indent() {\n String ret_value = \"\";\n for (int i = 0; i < indentCounter; i++) {\n ret_value += \"\\t\";\n }\n return ret_value;\n }", "protected String indent(String string, int level) {\n String indent = StringUtils.repeat(\" \", level * INDENT_LENGTH);\n return indent + string;\n }", "private static String compressSpace(String s) {\n StringBuilder sb = new StringBuilder(s.length());\n boolean indentation = true;\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n switch (c) {\n case '\\n':\n indentation = true;\n break;\n case ' ':\n if (sb.length() > 0 && sb.charAt(sb.length() - 1) == '(') {\n continue;\n }\n if (!indentation) {\n // It is safe to look at the next char because the text ends with \\n.\n char nextC = s.charAt(i + 1);\n if (\" ,;)\".indexOf(nextC) >= 0) {\n continue;\n }\n }\n break;\n default:\n indentation = false;\n break;\n }\n sb.append(c);\n }\n return sb.toString();\n }", "private String toIndentedString(Object o)\n/* */ {\n/* 607 */ if (o == null) {\n/* 608 */ return \"null\";\n/* */ }\n/* 610 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }", "private static String getIndentation(int depth) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < depth; i++) {\n sb.append(\" \");\n }\n return sb.toString();\n }", "private void appendIndent(int indent) {\n for (int i = 0; i < indent; i++ ) {\n sb.append(\" \");\n }\n }", "private static String getIndent(int nbIndents) {\n\t\tString str = \"\";\n\t\tfor (int i = 0 ; i < nbIndents; i++) {\n\t\t\tstr += \" \";\n\t\t}\n\t\treturn str;\n\t}", "public int getIndent() {\n return indent;\n }", "private String getIndentation(int level){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString indentString = \"--->\";\n\t\tfor (int i=0; i<level; i++){\n\t\t\tsb.append(indentString);\n\t\t}\n\t\treturn sb.toString();\n\t}", "public @Override void prettyPrint() {\n\t\tMain.log.prettyPrint(name + \" = \");\n\t\tcon.prettyPrint();\n\t\tMain.log.prettyPrintLn(\";\");\n\t}", "private String getIndent(final int indent) {\n final StringBuffer buffer = new StringBuffer();\n for (int i=0; i<indent; i++) {\n buffer.append(\"----\");\n }\n return buffer.toString();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
private HashMap sku_map = new HashMap();
public List<String> getSku_map() { return sku_map; }
[ "public Cart() {\r\n myMap = new HashMap<Item, Integer>();\r\n }", "public ProductList(){\n products = new HashMap<>();\n }", "public void setSKU (String SKU);", "public Library(){\n this.inventory = new HashMap<>();\n }", "public ShoppingCart() {\n myCart = new HashMap<Item, ItemOrder>();\n }", "public abstract String sku();", "private void init() {\n map = new HashMap();\n }", "public SkuVO() {\n\n }", "public abstract HashMap<String, String> mo5571z();", "public static void create_map() {\n\t\t_hashmap.put(\"Isosceles Triangle\",\"isosceles-triangle\");\r\n\t\t_hashmap.put(\"Right Triangle\",\"right-triangle\");\r\n\t\t_hashmap.put(\"Trapezoid\",\"trapezoid\");\r\n\t\t_hashmap.put(\"Parallelogram\",\"parallelogram\");\r\n\t\t_hashmap.put(\"Diamond\",\"diamond\");\r\n\t\t_hashmap.put(\"Parallelogram\",\"pentagon1\");\r\n\t\t_hashmap.put(\"Cross\",\"cross\");\r\n//\t\t_hashmap.put(\"hexagon\",\"110.Hexagon\");\r\n//\t\t_hashmap.put(\"octagon\",\"16.Octagon\");\r\n\t\t_hashmap.put(\"Can\",\"can\");\r\n\t\t_hashmap.put(\"Cube\",\"cube\");\r\n\t\t_hashmap.put(\"Block Arc\",\"block-arc\");\r\n\t\t_hashmap.put(\"Donut\",\"ring\");\r\n\t\t_hashmap.put(\"Folded Corner\",\"paper\");\r\n\t\t_hashmap.put(\"Smile Face\",\"smiley\");\r\n\t\t_hashmap.put(\"Sun\",\"sun\");\r\n\t\t_hashmap.put(\"Moon\",\"moon\");\r\n\t\t_hashmap.put(\"Heart\",\"heart\");\r\n\t\t_hashmap.put(\"Lightning\",\"non-primitive\");\r\n\t\t_hashmap.put(\"\\\"No\\\" Symbol\",\"forbidden\");\r\n\t\t_hashmap.put(\"Double Bracket\",\"bracket-pair\");\r\n\t\t_hashmap.put(\"Left Bracket\",\"left-bracket\");\r\n\t\t_hashmap.put(\"Right Bracket\",\"right-bracket\");\r\n\t\t_hashmap.put(\"Double Brace\",\"brace-pair\");\r\n\t\t_hashmap.put(\"Left Brace\",\"left-brace\");\r\n\t\t_hashmap.put(\"Right Brace\",\"right-brace\");\r\n\t\t_hashmap.put(\"Bevel\",\"quad-bevel\");\r\n\t\t_hashmap.put(\"Left Arrow\",\"left-arrow\");\r\n\t\t_hashmap.put(\"Right Arrow\",\"right-arrow\");\r\n\t\t_hashmap.put(\"Up Arrow\",\"up-arrow\");\r\n\t\t_hashmap.put(\"Down Arrow\",\"down-arrow\");\r\n\t\t_hashmap.put(\"Left-Right Arrow\",\"left-right-arrow\");\r\n\t\t_hashmap.put(\"Up-Down Arrow\",\"up-down-arrow\");\r\n\t\t_hashmap.put(\"Quad Arrow\",\"quad-arrow\");\r\n\t\t_hashmap.put(\"Striped Right Arrow\",\"mso-spt100\");\r\n\t\t_hashmap.put(\"Notched Right Arrow\",\"notched-right-arrow\");\r\n\t\t_hashmap.put(\"Pentagon Arrow\",\"pentagon-right\");\r\n\t\t_hashmap.put(\"Chevron Arrow\",\"chevron\");\r\n\t\t_hashmap.put(\"Right Arrow Callout\",\"right-arrow-callout\");\r\n\t\t_hashmap.put(\"Left Arrow Callout\",\"left-arrow-callout\");\r\n\t\t_hashmap.put(\"Up Arrow Callout\",\"up-arrow-callout\");\r\n\t\t_hashmap.put(\"Down Arrow Callout\",\"down-arrow-callout\");\r\n\t\t_hashmap.put(\"Left-Right Arrow Calout\",\"left-right-arrow-callout\");\r\n\t\t_hashmap.put(\"Up-Down Arrow Callout\",\"up-down-arrow-callout\");\r\n\t\t_hashmap.put(\"Quad Arrow Callout\",\"quad-arrow-callou\");\r\n//\t\t_hashmap.put(\"pentagon\",\"112.Regual Pentagon\");\r\n\t\t_hashmap.put(\"\",\"\");\r\n\t\t_hashmap.put(\"\",\"\");\r\n\t\t_hashmap.put(\"\",\"\");\r\n\t\t_hashmap.put(\"\",\"\");\r\n\t\t_hashmap.put(\"\",\"\");\r\n\t}", "public MyHashMap3() {}", "public void setMap(){\n\n }", "private ShinryouAliasMap() {\n\n }", "public HashMap(Map m) { \n loadFactor = 0.0f; \n }", "public GameMap() {\n super();\n this.borders = new HashMap<>();\n this.fileSectionData = new ArrayList<>();\n this.countries = new HashMap<>();\n this.continents = new HashMap<>();\n this.fileName = \"\";\n }", "public HashMap getStudentsMap() { return students; }", "public TimeMap_my() {\n map = new HashMap<>();\n }", "java.util.Map<java.lang.Integer, test.Battle.Skill>\n getSkill();", "public ReportCard(){\n\n Grades = new HashMap<String,Float>();\n }", "public PlayerFactory(final HashMap<Integer, HashMap<String, ArrayList<Integer>>> map) {\n this.map = map;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter for the MaxQuant Score type
public MaxQuantScoreType getMaxQuantScoreType() { return iMaxQuantScoreType; }
[ "java.lang.String getPriceMax();", "public int getmaxscore(){\r\n \r\n return maximumScore;\r\n }", "public float getMaxScore() {\n return maxScore_;\n }", "public static int getMaxScore(){\n return maxScore;\n }", "public double getMax() {\n return _max;\n }", "public T getMaxValue() {\n return maxValue;\n }", "public float getMaxValue()\n {\n return rs.getMaxValue();\n }", "public double getMax() { return max; }", "public Float getValueMax() {\n return this.ValueMax;\n }", "public double getMaxValue() {\r\n return this.maxvalue;\r\n }", "public Long getMaxValue() {\r\n return getOwnMetaData().maxValue;\r\n }", "public int getMaxScore()\n\t{\n\t\treturn maxscore;\n\t}", "public BigDecimal getMaxValue() { return this.max_val; }", "public double getMaxValue() {\n return maxvalue;\n }", "@Override\n public DataValueDescriptor maxValue() {\n return quantilesSketch.getMaxValue();\n }", "public Measurable getMax()\n {\n\treturn max ;\n }", "public int Unit_getMax();", "io.dstore.values.IntegerValue getMaxQuantity();", "public double getMaxValue()\n\t{\n\t\treturn getValues()[0]; //m_totalTime;\n\t}", "public double getMax(){\r\n return MAX;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
After completing background task Dismiss the progress dialog
protected void onPostExecute(String file_url) { // dismiss the dialog after getting all products pDialog.dismiss(); }
[ "@Override\n public void onFinish() {\n dismissProgressDialog();\n }", "protected void onSwPostExecute() {\n\t\tif (mProgressBar != null)\n\t\t\tmProgressBar.stop();\n\t}", "@Override\r\n public void run() {\n progressDialog.dismiss();\r\n }", "private void dismissProgressDialog() {\n //Retrieving the Progress Bar Dialog Fragment\n ProgressDialogFragment progressDialogFragment = (ProgressDialogFragment) getFragmentManager().findFragmentByTag(ProgressDialogFragment.TAG_PROGRESS_DIALOG);\n if (progressDialogFragment != null) {\n //Dismissing the Progress Bar Dialog when active\n progressDialogFragment.dismiss();\n //Resuming the CountDownTimer\n if (mCountDownLatchFragment != null) {\n mCountDownLatchFragment.resumeTimer();\n }\n }\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\tm_progressDialog.dismiss();\r\n\t\t}", "@Override\n\t\tprotected void onPostExecute(Void result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\tprogress.dismiss();\n\t\t}", "public void dismissProgressDialogIfAround(){\r\n\t\tif (mProgressDialog != null && mProgressDialog.isShowing()) {\r\n\t\t\tdismissDialog(DIALOG_DOWNLOAD_PROGRESS);\r\n\t\t}\r\n\t}", "protected void dismissProgressDialog() {\n if (pDialog.isShowing())\n pDialog.dismiss();\n }", "@Override\r\n protected void onPreExecute() {\r\n// pDialog = showDialog();\r\n mpd = new ProgressDialog(SDActivity.getsActivity());\r\n mpd.setMessage(\"Please Wait for Few Seconds...\");\r\n mpd.setCancelable(false);\r\n mpd.setCanceledOnTouchOutside(false);\r\n mpd.show();\r\n // pDialogFile= showDialogFile();\r\n Log.d(\"TAG\", \" is cancelled \" + isCancelled());\r\n File prevFile = new File(unzipLocation);\r\n DeleteRecursive(prevFile);\r\n super.onPreExecute();\r\n\r\n }", "@Override\n\t\t\t\t\t\t\t\tprotected void onPostExecute(\n\t\t\t\t\t\t\t\t\t\tBoolean list) {\n\t\t\t\t\t\t\t\t\tsuper.onPostExecute(list);\n\t\t\t\t\t\t\t\t\tprogressDialog.dismiss();\n\t\t\t\t\t\t\t\t}", "@Override\n\t\tprotected void onPreExecute() {\n\t\t\tdialog = new ProgressDialog(DeleteItems.this);\n\t\t\tdialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n\t\t\tdialog.setMessage(\"Please Wait...\");\n\t\t\tdialog.show();\n\t\t}", "private void dismissProgress() {\n mProgress.setVisibility(View.GONE);\n }", "protected void onPostExecute(final Void unused) { \t \n\t\t\tif (this.dialog.isShowing()) {\n\t\t\t\tthis.dialog.dismiss();\n\t\t\t}\n\t\t\tsetResult(RESULT_OK);\n\t\t\tfinish();\n\t\t}", "@Override\n\t \t protected void onPostExecute(String result) {\n\t \t super.onPostExecute(result); \n\t \t progress.dismiss(); \n\t \t }", "@Override\n protected void onCancelled() {\n //mAuthTask = null;\n //progressDialog.dismiss();\n }", "public static void stop_progressbar() {\n if (mDialog != null && mDialog.isShowing()) {\n mDialog.dismiss();\n }\n }", "public void dismissProgress() {\n if (this.loadingDialog != null && this.activity != null && this.loadingDialog.isShowing() && !this.activity.isFinishing()) {\n try {\n this.loadingDialog.dismiss();\n } catch (Throwable e) {\n H5Log.e(TAG, \"[dismissProgress] Exception: \" + e.toString(), e);\n } finally {\n this.loadingDialog = null;\n }\n }\n }", "@Override\r\n protected void onPostExecute(Void result) {\n super.onPostExecute(result);\r\n if (dialog.isShowing())\r\n dialog.dismiss();\r\n\r\n }", "@Override\n \t protected void onPostExecute(String result) {\n \t super.onPostExecute(result); \n \t progress.dismiss(); \n \t }", "public void onFinish(){\n if(mProgressDialog != null){\n mProgressDialog.removeLoadingDialog();\n mProgressDialog = null;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will assign the DCA role.
private void assignRole(WorkListDisplayForm workListDisplayForm2, String roleName) { LOGGER.info("Entering Assinrole*****************"); if(WorkListDisplayConstants.DCA_ROLE.equalsIgnoreCase(roleName)){ LOGGER.info("inside the dca role role......"+roleName); workListDisplayForm2.setRoleEditable(WorkListDisplayConstants.YES_VALUE); workListDisplayForm2.setReadOnlyUser(WorkListDisplayConstants.NO_VALUE); //Set role details //Completion date edit start workListDisplayForm2.setRoleName(WorkListDisplayConstants.DCA_ROLE); //Completion date edit end } if(WorkListDisplayConstants.VENDOR.equalsIgnoreCase(roleName)){ LOGGER.info("inside the vendor role......"+roleName); workListDisplayForm2.setRoleEditable(WorkListDisplayConstants.YES_VALUE); workListDisplayForm2.setReadOnlyUser(WorkListDisplayConstants.NO_VALUE); workListDisplayForm2.setRoleName(WorkListDisplayConstants.VENDOR); } if(WorkListDisplayConstants.READ_ONLY_ROLE.equalsIgnoreCase(roleName)){ LOGGER.info("inside the read only role......"+roleName); workListDisplayForm2.setReadOnlyUser(WorkListDisplayConstants.YES_VALUE); workListDisplayForm2.setRoleName(WorkListDisplayConstants.READ_ONLY_ROLE); } }
[ "public void assignRole() {\n\r\n\t}", "private void setRole() {\n\n\t}", "public void setRole(Role role){ this.role = role; }", "@Override\r\n\tpublic void createRole(Role role) throws ERPException {\n\r\n\t}", "private void addRole() {\n\t\tRole role = new Role(\"ROLE_USER\", \"user role\", privilegeService.findAllPrevileges());\n\t\troleService.findOrCreate(role);\n\t}", "@PostMapping(\"/assingnee-role\")\n @ResponseStatus(HttpStatus.CREATED)\n public ResponseEntity<?> assingneeRole(@RequestParam(\"userId\") String userId, @RequestParam(\"role\") String role) throws Exception {\n keycloakService.assigneeRole(userId, role);\n return ResponseEntity.noContent().build();\n }", "void assignAuthResource(AuthRoleVO vo);", "String assignUserToRole(String userPrincipal, String existingRole,\n boolean isAdmin) throws IOException;", "void addRole(String username, String newRole);", "public void setRole(org.hl7.rim.Role role) { /* throw new UnsupportedOperationException(); */ }", "public void selectRole() {\n\t\twaitForElementVisibility(addRole, 1000);\n\t\taddRole.click();\n\t}", "public void setRole(java.lang.String role)\n {\n this._role = role;\n }", "void setRole(final UserRoles role);", "private void assignUsersToAdminRole() {\n \ttry {\n\t\t\tUser user = getUserService().findByUsername(\"admin\");\n\t\t\tuser.addRole(\n\t\t\t\t\tgetRoleService().findRoleByName(\"ADMIN\")\n\t\t\t);\n\t\t\tgetUserService().saveOrUpdate(user);\n\t\t} catch (UsernameNotFoundException e) {\n\t\t\tgetLog().warn(e.getMessage());\n\t\t} catch (NotFoundException e) {\n\t\t\tgetLog().warn(e.getMessage());\n\t\t}\n }", "RequiredRole createRequiredRole();", "public void setAssigningAuthorityCd(String aAssigningAuthorityCd)\n {\n assigningAuthorityCd = aAssigningAuthorityCd;\n }", "private void assignUsersToUserRole() {\n \ttry {\n\t\t\tUser user = getUserService().findByUsername(\"user\");\n\t\t\tuser.addRole(\n\t\t\t\t\tgetRoleService().findRoleByName(\"USER\")\n\t\t\t);\n\t\t\tgetUserService().saveOrUpdate(user);\n\t\t} catch (UsernameNotFoundException e) {\n\t\t\tgetLog().warn(e.getMessage());\n\t\t} catch (NotFoundException e) {\n\t\t\tgetLog().warn(e.getMessage());\n\t\t}\n }", "private void assignRolesTo(User user, UserDto userDto) {\n Optional<Role> optionalRole;\n if (userDto.getIsAdmin()) {\n optionalRole = roleRepository.findByName(\"ROLE_ADMIN\");\n } else {\n optionalRole = roleRepository.findByName(\"ROLE_PARTICIPANT\");\n }\n\n // if role is present in the Optional<Role> we get the role and assign it to the user\n if (optionalRole.isPresent()) {\n Role role = optionalRole.get();\n user.setRole(role);\n }\n }", "int updateRole(Role role);", "@Override\n public void verifyAndReAssignRole(final String assignedRole) {\n\n clickRoleTab();\n\n DriverConfig.setLogString(\"check if assigned roles element is displayed.\", true);\n DriverConfig.setLogString(\"Assigned Role \" + assignedRole, true);\n isDisplayedById(DriverConfig.getDriver(), userConfig.get(ASSIGNED_ROLES), MEDIUM_TIMEOUT);\n\n final Select select = new Select(DriverConfig.getDriver().findElement(\n By.id(userConfig.get(ASSIGNED_ROLES))));\n\n final List<WebElement> optionsList = select.getOptions();\n for (final WebElement webelement : optionsList) {\n if (webelement.getText().equalsIgnoreCase(assignedRole)) {\n Assert.assertTrue(true);\n DriverConfig.setLogString(\"Assigned role is verified, and the role is :\"\n + webelement.getText(), true);\n }\n\n }\n\n DriverConfig.setLogString(\"ReAssign the selected Role\", true);\n select.deselectAll();\n DriverConfig.setLogString(\"select required role \" + assignedRole, true);\n select.selectByVisibleText(assignedRole);\n DriverConfig.setLogString(\"click on remove button.\", true);\n DriverConfig.getDriver().findElement(By.id(\"remove\")).click();\n smallWait();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
repeated string tags = 4;
public com.google.protobuf.ByteString getTagsBytes(int index) { return tags_.getByteString(index); }
[ "@Test\n public void test3() {\n String input = \"<tagz/>\" + \n \"<tag ><x>элемент 1</x></tag >\" +\n \"<tag att1=\\\"test1\\\" att2=\\\"test2\\\"\\t/>\\n\" +\n \"<tag attrib=\\\"test\\\" />\";\n String output[] = {\n \"<tag ><x>элемент 1</x></tag >\",\n \"<tag att1=\\\"test1\\\" att2=\\\"test2\\\"\\t/>\",\n \"<tag attrib=\\\"test\\\" />\" \n };\n // It's important to test tags of varying lengths\n assertTrue(check(\"tag\", input, output));\n }", "public Iterator<String> getTags();", "public List<String> getTagValues( String str) {\n List<String> tagValues = new ArrayList<>();//dont change str in here\n Log.d(\"str\",str);\n\n\n Matcher matcher = TAG_REGEX.matcher(str);\n while (matcher.find()) {//==true\n tagValues.add(matcher.group(1));\n }\n\n\n return tagValues;\n }", "public int getTagVCount();", "private String grabTagged(String text){\n String[] textArray = text.split(\" \");\n StringBuilder sb = new StringBuilder();\n\n for (String word : textArray) {\n String tag = word.substring(word.lastIndexOf(\"_\")+1, word.length());\n if(tag.equals(\"NN\") || tag.equals(\"JJ\") || tag.equals(\"CD\") || tag.equals(\"RB\") || tag.equals(\"VBZ\")){\n sb.append(word).append(\" \");\n }\n }\n return sb.toString();\n }", "public String process(Tag[] tags);", "public void setTags(String tags) {\n this.tags = tags;\n }", "int getTagNameCount();", "int getTagValueCount();", "@Test\n public void testMultipleAddTag() {\n tagHandler.addTagToEmail(email, tagTwo);\n //Add same email and tag to see if they gets added twice\n tagHandler.addTagToEmail(email,tagTwo);\n tagHandler.addTagToEmail(email, tagOne);\n\n //Contains first added tag?\n assertTrue(tagHandler.getTagsWithEmail(email).contains(tagOne));\n //Contains tag nr 2?\n assertTrue(tagHandler.getTagsWithEmail(email).contains(tagTwo));\n //Correct size after adding same tag and email twice?\n assertTrue(tagHandler.getTagsWithEmail(email).size() == 2);\n }", "int getTagIdCount();", "private void makeTag(String tag, int n){\n String or = savednotes.getString(tag, null);\n SharedPreferences.Editor preferencesEditor = savednotes.edit();\n if (n == 1) {\n preferencesEditor.putString(\"tag\", tag);\n }else if (n == 2) {\n preferencesEditor.putString(\"tag2\", tag);\n }else if (n == 3) {\n preferencesEditor.putString(\"tag3\", tag);\n }else if (n == 4) {\n preferencesEditor.putString(\"tag4\", tag);\n }else if (n == 5) {\n preferencesEditor.putString(\"tag5\", tag);\n }else if (n == 6) {\n preferencesEditor.putString(\"tag6\", tag);\n }else if (n == 7) {\n preferencesEditor.putString(\"tag7\", tag);\n }else if (n == 8) {\n preferencesEditor.putString(\"tag8\", tag);\n }else if (n == 9) {\n preferencesEditor.putString(\"tag9\", tag);\n }else if (n == 10) {\n preferencesEditor.putString(\"tag10\", tag);\n }else if (n == 11) {\n preferencesEditor.putString(\"tag11\", tag);\n }else if (n == 12) {\n preferencesEditor.putString(\"tag12\", tag);\n }\n preferencesEditor.commit();\n }", "@Test\r\n\tpublic void testTags() {\n\t User bob = new User(\"[email protected]\", \"secret\", \"Bob\").save();\r\n\t \r\n\t // Create a new post\r\n\r\n\t Advice bobAdvice = new Advice(bob, \"My first post\", \"Hello world\").save();\r\n\t Advice anotherBobAdvice = new Advice(bob, \"Hop\", \"Hello world\").save();\r\n\r\n\t // Well\r\n\t assertEquals(0, Advice.findTaggedWith(\"Red\").size());\r\n\t \r\n\t // Tag it now\r\n\r\n\t bobAdvice.tagItWith(\"Red\").tagItWith(\"Blue\").save();\r\n\t anotherBobAdvice.tagItWith(\"Red\").tagItWith(\"Green\").save();\r\n\r\n\t \r\n\t // Check\r\n\t assertEquals(2, Advice.findTaggedWith(\"Red\").size());\r\n\t assertEquals(1, Advice.findTaggedWith(\"Blue\").size());\r\n\t assertEquals(1, Advice.findTaggedWith(\"Green\").size());\r\n\t assertEquals(1, Advice.findTaggedWith(\"Red\", \"Blue\").size());\r\n\t assertEquals(1, Advice.findTaggedWith(\"Red\", \"Green\").size());\r\n\t assertEquals(0, Advice.findTaggedWith(\"Red\", \"Green\", \"Blue\").size());\r\n\t assertEquals(0, Advice.findTaggedWith(\"Green\", \"Blue\").size());\r\n\t List<Map> cloud = Tag.getCloud();\r\n\t assertEquals(\r\n\t \"[{pound=1, tag=Blue}, {pound=1, tag=Green}, {pound=2, tag=Red}]\",\r\n\t cloud.toString()\r\n\t );\r\n\r\n\r\n\t}", "public void readTags() throws IOException{\r\n\t\tFile t = new File(\"tags.txt\");\r\n\t\tScanner scan = new Scanner(t);\r\n\t\tString stringToTags = scan.next();\r\n\t\twhile (stringToTags != null){\r\n\t\t\tSystem.out.println(stringToTags);\r\n\t\t\tnew Tag(stringToTags);\r\n\t\t\tif (scan.hasNext()){\r\n\t\t\t\tstringToTags = scan.next();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscan.close();\r\n\t}", "public void process(ArrayList<String> tags) {\n // get a count of tags\n for (String tag : tags) {\n int count = 1;\n if (tagDict.containsKey(tag)) {\n count = count + tagDict.get(tag);\n }\n tagDict.put(tag, count);\n }\n }", "@Test\n void getRepeatableAnnotation() {\n MyTag[] myTags = getClass().getDeclaredAnnotationsByType(MyTag.class);\n assertThat(Arrays.asList(myTags)).flatExtracting(MyTag::value).containsExactly(\"A\", \"B\");\n }", "private int[] bestSequenceNew(SequenceModel ts) {\n int length = ts.length();\n // How much we look to our left\n int leftWindow = ts.leftWindow();\n // how much we look to our right\n int rightWindow = ts.rightWindow();\n // padding <s> <s> </s> </s>\n int padLength = length + leftWindow + rightWindow;\n // tags[ind][tag] (all the possible tags\n int[][] tags = new int[padLength][];\n\n // tags that are actually seen in the beam\n ArrayList<HashSet<Integer>> beam_tags = new ArrayList<HashSet<Integer>>();\n //beam_tags.ensureCapacity(padLength);\n //int[][] beam_tags = new int[padLength][];\n\n // the number of available tags at each position\n int[] tagNum = new int[padLength];\n if (DEBUG) { System.err.println(\"Doing bestSequence length \" + length + \"; leftWin \" + leftWindow + \"; rightWin \" + rightWindow + \"; padLength \" + padLength); }\n \n // Fill in the possible tags at each position\n for (int pos = 0; pos < padLength; pos++) {\n beam_tags.add( new HashSet<Integer>());\n tags[pos] = ts.getPossibleValues(pos);\n tagNum[pos] = tags[pos].length;\n if (DEBUG) { System.err.println(\"There are \" + tagNum[pos] + \" values at position \" + pos + \": \" + Arrays.toString(tags[pos])); }\n }\n\n // The termporary tag decided at each position\n int[] tempTags = new int[padLength];\n\n // poducts?\n // Set up product space sizes\n int[] productSizes = new int[padLength];\n\n // products = nodes\n\n // This is going to be the size of our chart space\n int curProduct = 1;\n \n // Give spaces for the tags in the left and right window (just 1 likely)\n for (int i = 0; i < leftWindow + rightWindow; i++) {\n curProduct *= tagNum[i];\n }\n\n for (int pos = leftWindow + rightWindow; pos < padLength; pos++) {\n if (pos > leftWindow + rightWindow) {\n curProduct /= tagNum[pos - leftWindow - rightWindow - 1]; // shift off\n }\n // add in room for all the tags at this position\n curProduct *= tagNum[pos]; // shift on\n // save the size of all states up until this point\n productSizes[pos - rightWindow] = curProduct;\n }\n\n // Score all of each window's options\n\n double[][] windowScore = new double[padLength][];\n for (int pos = leftWindow; pos < leftWindow + length; pos++) {\n if (DEBUG) { System.err.println(\"scoring word \" + pos + \" / \" + (leftWindow + length) + \", productSizes = \" + productSizes[pos] + \", tagNum = \" + tagNum[pos] + \"...\"); }\n\n // score for each product in the pos\n windowScore[pos] = new double[productSizes[pos]];\n // let each tag be the 0,0 tag\n // blank out temptags\n Arrays.fill(tempTags, tags[0][0]);\n\n if (DEBUG) { System.err.println(\"windowScore[\" + pos + \"] has size (productSizes[pos]) \" + windowScore[pos].length); }\n\n // unmap a product to a window of tags\n for (int product = 0; product < productSizes[pos]; product++) {\n int p = product;\n int shift = 1;\n for (int curPos = pos + rightWindow; curPos >= pos - leftWindow; curPos--) {\n tempTags[curPos] = tags[curPos][p % tagNum[curPos]];\n p /= tagNum[curPos];\n if (curPos > pos) {\n shift *= tagNum[curPos];\n }\n }\n\n // Here now you get ts.scoresOf() for all classifications at a position at once, wwhereas the old code called ts.scoreOf() on each item.\n // CDM May 2007: The way this is done gives incorrect results if there are repeated values in the values of ts.getPossibleValues(pos) -- in particular if the first value of the array is repeated later. I tried replacing it with the modulo version, but that only worked for left-to-right, not bidirectional inference, but I still think that if you sorted things out, you should be able to do it with modulos and the result would be conceptually simpler and robust to repeated values. But in the meantime, I fixed the POS tagger to not give repeated values (which was a bug in the tagger).\n // if (product % tagNum[pos] == 0) {\n if (tempTags[pos] == tags[pos][0]) {\n // get all tags at once\n double[] scores = ts.scoresOf(tempTags, pos);\n if (DEBUG) { System.err.println(\"Matched at array index [product] \" + product + \"; tempTags[pos] == tags[pos][0] == \" + tempTags[pos]); }\n if (DEBUG) { System.err.println(\"For pos \" + pos + \" scores.length is \" + scores.length + \"; tagNum[pos] = \" + tagNum[pos] + \"; windowScore[pos].length = \" + windowScore[pos].length); }\n if (DEBUG) { System.err.println(\"scores: \" + Arrays.toString(scores)); }\n // fill in the relevant windowScores\n \n // set the scores for each tag at pos\n for (int t = 0; t < tagNum[pos]; t++) {\n if (DEBUG) { System.err.println(\"Setting value of windowScore[\" + pos + \"][\" + product + \"+\" + t + \"*\" + shift + \"] = \" + scores[t]); }\n windowScore[pos][product + t * shift] = scores[t];\n }\n }\n }\n }\n\n // Set up score and backtrace arrays\n double[][] score = new double[padLength][];\n int[][] trace = new int[padLength][];\n int[][] node_index = new int[padLength][];\n Boolean[][] in_beam = new Boolean[padLength][];\n for (int pos = 0; pos < padLength; pos++) {\n score[pos] = new double[productSizes[pos]];\n trace[pos] = new int[productSizes[pos]];\n node_index[pos] = new int[productSizes[pos]];\n in_beam[pos] = new Boolean[productSizes[pos]];\n \n }\n\n // Do forward Viterbi algorithm\n System.out.println(\"\");\n System.out.println(\"LATTICE: START\");\n int node_count = 0;\n\n\n // loop over the classification spot\n //System.err.println();\n System.out.println(\"LATTICE: NODE \"+node_count+\" START\");\n node_count++;\n for (int pos = leftWindow; pos < length + leftWindow; pos++) {\n\n double max_at_pos = Double.NEGATIVE_INFINITY;; \n // if (pos != leftWindow) {\n // for (int newTagNum = 0; newTagNum < tagNum[pos - leftWindow - 1]; newTagNum++) {\n // System.err.println(\"NODE \" + pos + \" \" + newTagNum); \n // }\n // }\n\n for (int product = 0; product < productSizes[pos]; product++) {\n //in_beam[pos][product] = (max_at_pos - score[pos][product]) < BEAM; \n in_beam[pos][product] = false;\n score[pos][product] = Double.NEGATIVE_INFINITY;\n \n\n }\n\n\n // all the states at the current point\n for (int product = 0; product < productSizes[pos]; product++) {\n int tag = tags[pos][product % tagNum[pos]];//tags[pos - leftWindow - 1][newTagNum];\n\n boolean has_seen = false;\n //+ \" \" + tags[pos - leftWindow - 1][newTagNum]\n // check for initial spot\n if (pos == leftWindow) {\n // no predecessor type\n score[pos][product] = windowScore[pos][product];\n trace[pos][product] = -1;\n \n if (!has_seen) {\n System.out.println(\"LATTICE: NODE \"+node_count+\" \" + (pos-2) + \":\" + product + \":\" + tag); \n node_index[pos][product] = node_count;\n node_count++;\n beam_tags.get(pos).add(tag);\n }\n has_seen = true;\n\n System.out.println(\"LATTICE: EDGE \" + (pos-3) + \":0:\" + (pos-2) + \":\" + product +\" 0 \"+node_index[pos][product]+\" \" + windowScore[pos][product]); \n \n } else {\n // loop over possible predecessor types\n score[pos][product] = Double.NEGATIVE_INFINITY;\n trace[pos][product] = -1;\n int sharedProduct = product / tagNum[pos + rightWindow];\n int factor = productSizes[pos] / tagNum[pos + rightWindow];\n \n // pos - leftWindow - 1\n for (int newTagNum = 0; newTagNum < tagNum[pos - leftWindow - 1]; newTagNum++) {\n \n // last node\n int predProduct = newTagNum * factor + sharedProduct;\n \n\n // edge score\n double edge_score = windowScore[pos][product];\n // new score\n double predScore = score[pos - 1][predProduct] + edge_score;\n\n // is prev node pruned or this node is pruned\n if (!in_beam[pos-1][predProduct]) {\n //System.out.println(\"DEBUG: was beamed \" + (pos-1) + \" \" + predProduct);\n continue;\n }\n if ((max_at_pos - predScore) > BEAM) { \n //System.out.println(\"DEBUG: will be beamed \" + (max_at_pos) + \" \" + predScore);\n continue;\n }\n //if (!in_beam[pos-1][predProduct]) continue;\n \n if (!has_seen) {\n System.out.println(\"LATTICE: NODE \"+node_count+\" \" + (pos-2) + \":\" + product + \":\" + tag); node_index[pos][product] = node_count;\n node_count++;\n beam_tags.get(pos).add(tag);\n }\n has_seen = true;\n\n System.out.println(\"LATTICE: EDGE \" + (pos-3) + \":\" + predProduct + \":\" + (pos-2) + \":\" + product +\" \"+node_index[pos-1][predProduct]+ \" \"+ node_index[pos][product]+\" \" + edge_score); \n if (predScore > score[pos][product]) {\n score[pos][product] = predScore;\n trace[pos][product] = predProduct;\n max_at_pos = Math.max(score[pos][product], max_at_pos);\n }\n }\n }\n }\n\n \n // delta beam\n for (int product = 0; product < productSizes[pos]; product++) {\n Boolean should_keep = (max_at_pos - score[pos][product]) < BEAM; \n in_beam[pos][product] = should_keep;\n if (!should_keep) {\n //System.out.println(\"DEBUG: Is beamed \" + max_at_pos + \" \" + score[pos][product] + \" \" + product);\n }\n }\n\n }\n\n\n\n // Project the actual tag sequence\n double bestFinalScore = Double.NEGATIVE_INFINITY;\n int bestCurrentProduct = -1;\n \n System.out.println(\"LATTICE: NODE \"+ node_count +\" final\");\n node_count++;\n for (int product = 0; product < productSizes[leftWindow + length - 1]; product++) {\n int lastpos = leftWindow + length - 1;\n if (!in_beam[lastpos][product]) continue;\n System.out.println(\"LATTICE: EDGE last \" + node_index[lastpos][product] + \" \" + (node_count -1) + \" 0.0\"); \n if (score[leftWindow + length - 1][product] > bestFinalScore) {\n bestCurrentProduct = product;\n bestFinalScore = score[leftWindow + length - 1][product];\n }\n }\n // the final product\n int lastProduct = bestCurrentProduct;\n for (int last = padLength - 1; last >= length - 1 && last >= 0; last--) {\n tempTags[last] = tags[last][lastProduct % tagNum[last]];\n lastProduct /= tagNum[last];\n }\n for (int pos = leftWindow + length - 2; pos >= leftWindow; pos--) {\n int bestNextProduct = bestCurrentProduct;\n bestCurrentProduct = trace[pos + 1][bestNextProduct];\n tempTags[pos - leftWindow] = tags[pos - leftWindow][bestCurrentProduct / (productSizes[pos] / tagNum[pos - leftWindow])];\n }\n \n\n System.out.println(\"LATTICE: END\"); \n System.out.println(\"BEAM: START\" );\n for (int pos = leftWindow; pos < length + leftWindow -1; pos++) {\n System.out.print(\"BEAM: \" + (pos-2) + \" \" );\n for (Integer tag: beam_tags.get(pos)) {\n System.out.print( tag + \" \" );\n }\n System.out.println();\n }\n System.out.println(\"BEAM: END\" );\n System.out.println(\"best final score \" + bestFinalScore); \n return tempTags;\n }", "public String getTagWords() {\n return tagWords;\n }", "List<String> getAssociatedTags(String tag);", "protocol.rpc.SymbolTag getTags(int index);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ updates the name of a branch
private void updateBranch() { int bid; String bname; PreparedStatement ps; try { ps = con.prepareStatement("UPDATE branch SET branch_name = ? WHERE branch_id = ?"); System.out.print("\nBranch ID: "); bid = Integer.parseInt(in.readLine()); ps.setInt(2, bid); System.out.print("\nBranch Name: "); bname = in.readLine(); ps.setString(1, bname); int rowCount = ps.executeUpdate(); if (rowCount == 0) { System.out.println("\nBranch " + bid + " does not exist!"); } con.commit(); ps.close(); } catch (IOException e) { System.out.println("IOException!"); } catch (SQLException ex) { System.out.println("Message: " + ex.getMessage()); try { con.rollback(); } catch (SQLException ex2) { System.out.println("Message: " + ex2.getMessage()); System.exit(-1); } } }
[ "public void changeName(String newName) {\n _branchName = newName;\n }", "public static void branch(String branchname) throws IOException {\n if(!FileStatus.branchExist(\"master\")){\n System.out.println(\"Not a valid object name: 'master'.\");\n return;\n }\n branch.Branch master = new branch.Branch(\"master\");\n branch.Branch branch = new branch.Branch(branchname, master.getCommitId());\n branch.writeBranch();\n }", "public void branch(String branchname) {\r\n\t\tif (map.getBranch(branchname) != null) {\r\n\t\t\tSystem.err.println(\"A branch with that name already exists.\");\r\n\t\t} else {\r\n\t\t\tmap.branch(branchname);\r\n\t\t}\r\n\t}", "public void branch(String branchName) {\n\t\tif (branches.containsKey(branchName)) {\n\t\t\tSystem.out.println(\"A branch of this name already exists.\");\n\t\t\treturn;\n\t\t}\n\t\tbranches.put(branchName, head.getID()); //create branch\n\t}", "public void branch(String branchname) {\n\n if (branches.containsKey(branchname)) {\n System.out.println(\"A branch with that name already exists.\");\n System.exit(0);\n }\n Branch br = new Branch(branchname, headCommit);\n branches.put(branchname, br);\n\n ArrayList<Branch> b = new ArrayList<>();\n b.add(currentBranch);\n b.add(br);\n\n splitPoint.put(headCommit, b);\n\n br.addAll(currentBranch);\n\n }", "public String getName() {\n return _branchName;\n }", "public void branch(String branchName) {\n\t\tif (pointers.containsKey(branchName)) {\n\t\t\tSystem.out.print(\"A branch with that name already exists.\");\n\t\t} else {\n\t\t\tpointers.put(branchName, activeTree);\n\t\t}\n\t}", "public void updateName();", "@Override\n public void setName(String name) {\n realBranchOffice.setName(name);\n }", "public void setBranch(String value){\n if(value.length() == 2){\n this.branch = value;\n }else{\n this.branch = \"00\";\n }\n this.execute();\n }", "public static void setActiveBranch(String branchName) {\n Repository.writeHeadPointer(branchName);\n }", "private void checkoutBranch(String str) {\n updateUntrack();\n if (_untrackedFiles.size() != 0) {\n Utils.message(\"There is an untracked file in the way;\"\n + \" delete it or add it first.\");\n System.exit(0);\n }\n String branchName = str;\n\n if (_head.equals(branchName)) {\n Utils.message(\"No need to check out the current branch.\");\n System.exit(0);\n }\n if (!_branches.keySet().contains(branchName)) {\n Utils.message(\"No such branch exists.\");\n System.exit(0);\n }\n\n List<String> allFiles = Utils.plainFilenamesIn(\n System.getProperty(\"user.dir\"));\n HashMap<String, String> filesInOldBranch = new HashMap<>();\n for (String fileName : allFiles) {\n File tmp = new File(fileName);\n if (!fileName.equals(\".DS_Store\")) {\n filesInOldBranch.put(fileName, getFileID(tmp));\n tmp.delete();\n }\n }\n _branches.get(_head).setAllFiles(filesInOldBranch);\n _branches.get(_head).setTracking(_trackingFileIds);\n _head = branchName;\n HashMap<String, String> filesInBranch;\n filesInBranch = _branches.get(_head).getAllFiles();\n if (filesInBranch != null) {\n for (String fileName : filesInBranch.keySet()) {\n File tmp = new File(fileName);\n File content = new File(\".gitlet/stage/\"\n + filesInBranch.get(fileName));\n Utils.writeContents(tmp, Utils.readContents(content));\n }\n }\n _trackingFileIds = _branches.get(_head).getTracking();\n }", "public void setHead(String branchName) {\n head = branchName;\n }", "public static void branch(String branchName) throws IOException {\n String currentBranch = Utils.readContentsAsString(Init.HEAD);\n String headSHA1 = Utils.readContentsAsString(\n new File(Init.BRANCHES, currentBranch));\n File current = new File(Init.BRANCHES, branchName);\n if (current.exists()) {\n System.out.println(\"A branch with that name already exists.\");\n } else {\n current.createNewFile();\n Utils.writeContents(current, headSHA1);\n }\n }", "public void setupBranch() throws RemoteException, SQLException{\n String query = \"SELECT Name From branch\";\n map = server.selectFromDb(query);\n if(!map.isEmpty()){\n for(int i=0 ; i<map.size(); i++){\n d_branch_name.addItem(map.get(i).get(\"Name\").toString());\n }\n } \n }", "@java.lang.Override\n public com.google.protobuf.ByteString getBranchNameBytes() {\n java.lang.Object ref = \"\";\n if (revisionCase_ == 3) {\n ref = revision_;\n }\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n if (revisionCase_ == 3) {\n revision_ = b;\n }\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public java.lang.String getBranchName() {\n java.lang.Object ref = \"\";\n if (revisionCase_ == 3) {\n ref = revision_;\n }\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (revisionCase_ == 3) {\n revision_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public void setName (String newValue){\n this.name = newValue;\n }", "@Override\n protected void addBranchImpl(String name) throws Exception {\n logger.debug(String.format(\"Adding new branch %s\", name));\n try{\n Ref result = git.branchCreate().setName(name).call();\n logger.debug(String.format(\"Created new branch %s\", result.toString()));\n }catch (GitAPIException e){\n logger.error(\"Exception thrown while creating branch\", e);\n throw e;\n }\n }", "public void rebase(String branchname) throws IOException{\n\t\t\n\t\tif (!branches.containsKey(branchname)) { //no branch exist, reject\n\t\t\tSystem.out.println(\"A branch with that name does not exist.\");\n\t\t\treturn;\n\t\t}\n\t\tif (branchname.equals(currentbranch)) { //rebase to current branch, reject\n\t\t\tSystem.out.println(\"Cannot rebase a branch onto itself.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tCommit splitpoint = splitpoint(branchname);\n\t\t\n\t\tif (head == splitpoint) { //head itself is split point\n\t\t\thead = commits.get(branches.get(branchname)); //checkout to that branch\n\t\t\tcurrentbranch = branchname;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (commits.get(branches.get(branchname)) == splitpoint) { //that branch is split point\n\t\t\tSystem.out.println(\"Already up-to-date.\"); //checkout this branch(do nothing)\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tCommit old_branch = commits.get(branches.get(currentbranch)); //the current branch\n\t\tCommit temp1 = new Commit(old_branch.getMessage(), commitId, -1, \n\t\t\t\told_branch.getFileTree().Copy()); //create a copy of the current branch [parent = -1]\n\t\t\n\t\tfor(String i: temp1.getFileTree().returnallfiles()){ //retrieve current branch's files\n\t\t\tif(temp1.getFileTree().getID(i) == splitpoint.getFileTree().getID(i)){\n\t\t\t\t// the file is the same in current branch and split point\n\t\t\t\tif(commits.get(branches.get(branchname)).getFileTree().getID(i) >= 0 && //that file also exist in given branch\n\t\t\t\t\t\tcommits.get(branches.get(branchname)).getFileTree().getID(i) != splitpoint.getFileTree().getID(i)) {\n\t\t\t\t\t\t//and it's not the same file (meaning from split point -> given branch, the file updated): \n\t\t\t\t\t\t//we adapt the version in given branch (newer version)\n\t\t\t\t\ttemp1.getFileTree().add(i, commits.get(branches.get(branchname)).getFileTree().getID(i));\n\t\t\t\t} else {\n\t\t\t\t\t// the file is untracked in the given branch, we remove\n\t\t\t\t\ttemp1.getFileTree().remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tCommit temp3;\n\t\tint idToReset = temp1.getID();\n\t\t\n\t\tcommits.add(temp1);//commit modified given branch\n\t\tcommitId++; //commitid ++\n\t\t\n\t\t// [old_branch]'s father is not split point\n\t\t// meaning travel from the current branch to the commit after split point\n\t\twhile (old_branch.previousCommit() != splitpoint.getID()) {\n\t\t\t// create new tempory commit from [old_branch]\n\t\t\ttemp3 = new Commit(old_branch.getMessage(), commitId, -1, old_branch.getFileTree().Copy());\n\t\t\tfor(String i: temp3.getFileTree().returnallfiles()){ //same thing here\n\t\t\t\tif(temp3.getFileTree().getID(i)==splitpoint.getFileTree().getID(i)){\n\t\t\t\t\tif(commits.get(branches.get(branchname)).getFileTree().getID(i)>=0 &&\n\t\t\t\t\t\t\tcommits.get(branches.get(branchname)).getFileTree().getID(i)\n\t\t\t\t\t\t\t!= splitpoint.getFileTree().getID(i)){\n\t\t\t\t\t\ttemp3.getFileTree().add(i, commits.get(branches.get(branchname)).getFileTree().getID(i));\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttemp3.getFileTree().remove(i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcommits.add(temp3); //commit\n\t\t\tcommitId++;\n\t\t\ttemp1.setprev(temp3.getID()); //...\n\t\t\told_branch = commits.get(old_branch.previousCommit());\n\t\t\ttemp1 = temp3;\n\t\t} //end of while\n\t\ttemp1.setprev(branches.get(branchname));\n\t\treset(idToReset); //move the branch pointer\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A comment by the usert has received a new reply.
@org.jetbrains.annotations.Nullable() public final java.lang.Integer component8() { return null; }
[ "java.lang.String getReplyNote();", "@Override\r\n\tpublic void getNoteReply() throws Throwable {\n\t\tif(trigger!=null){\r\n\t\t\ttrigger.triggerBusiness(null, null, NoteConstants.NOTE_REPLY, null);\r\n\t\t}\r\n\t}", "void receivedReply(AttachReply reply);", "@Override\n\t\t\t\t\tpublic void onResponse(CommentRequestData requestData) {\n\t\t\t\t\t\tint rsp_code = requestData.getRsp_code();\n\t\t\t\t\t\tLog.i(TAG, String.valueOf(rsp_code));\n\t\t\t\t\t\tif(rsp_code == MyServerMessage.SUCCESS){\n\t\t\t\t\t\t\tcomments = requestData.getComments();\n\t\t\t\t\t\t\tmAdapter.clearData();\n\t\t\t\t\t\t\tmAdapter.setData(comments);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmPullToRefreshAttacher.setRefreshComplete();\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tprotected void onSucceed() {\n\t\t\t\t\t\tif(flag){\n\t\t\t\t\t\t\tComment c = new Comment();\n\t\t\t\t\t\t\tc.setUserId(Utils.getID());\n\t\t\t\t\t\t\tc.setNickname(Utils.getName());\n\t\t\t\t\t\t\tc.setContent(content);\n\t\t\t\t\t\t\tc.setTime(Utils.getDetailTime());\n\t\t\t\t\t\t\tc.setStatus(\"1\");\n\t\t\t\t\t\t\tc.setAcceptId(list.get(innerPosition).getUserId());\n\t\t\t\t\t\t\tc.setTonickname(list.get(innerPosition).getNickname());\n\t\t\t\t\t\t\tc.setContentId(mumId);\n\t\t\t\t\t\t\tdbHelper.insertComment(c);\n\t\t\t\t\t\t\tList<Comment> reply = new ArrayList<Comment>();\n\t\t\t\t\t\t\treply.add(c);\n\t\t\t\t\t\t\tlist.add(c);\n\t\t\t\t\t\t\tadapter.addReply(reply);\n\t\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\t\teditWindow.dismiss();\n\t\t\t\t\t\t\t//Utils.setListViewHeightBasedOnChildren(listView);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tUtils.toast(\"评论失败,请重试\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "void receivedReply(ThreadCreatedReply reply);", "public void addNewResponse(@NonNull DiscussionComment response) {\n initialTimeStampMs = System.currentTimeMillis();\n int offset = 1 + discussionResponses.size();\n discussionResponses.add(response);\n incrementResponseCount();\n notifyItemInserted(offset);\n }", "void receivedReply(SearchReply reply);", "@Override\n\t\t\tpublic void onCommentDownload(int msg) {\n\t\t\t\tif(msg ==0){\n\t\t\t\t\tupdateUI();\n\t\t\t\t}else{\n\t\t\t\t\tmodelTips(msg);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "private static void addReplies()\n {\n String reply;\n \n System.out.print(\"Enter a new reply: \");\n reply = input.nextLine();\n \n m8.addReply(reply);\n displayReply(\"I added: \" + reply + \".\");\n }", "public void setCommentReply(String commentReply) {\n this.commentReply = commentReply == null ? null : commentReply.trim();\n }", "@Override\n\t\tpublic MessageReply replyOne(int rno) {\n\t\t\treturn messageDAO.replyOne(rno);\n\t\t}", "@Override\n\tpublic void onReplyReceived(ReplyBody arg0) {\n\t\t\n\t}", "@VTID(10)\n @UseDefaultValues(paramIndexMapping = {1}, optParamIndex = {0}, javaType = {java.lang.Object.class}, nativeType = {NativeType.VARIANT}, variantType = {Variant.Type.VT_ERROR}, literal = {\"80020004\"})\n @ReturnValue(index=1)\n com.exceljava.com4j.excel.CommentThreaded addReply();", "@Override\n\tpublic void ReplyUpdate(Reply reply) {\n\t\t\n\t}", "private void m90106q(Comment comment) {\n Sticker sticker;\n CommentEditorLayout commentEditorLayout = this.f62935w;\n if (commentEditorLayout != null) {\n sticker = commentEditorLayout.getSticker();\n this.f62935w.mo86543N();\n } else {\n sticker = null;\n }\n if (sticker != null) {\n CommentStickerRoomHelper.m89933b(getContext(), CommentUtils.m89736b(sticker));\n }\n mo86823C();\n if (comment != null) {\n CommentEvent commentEvent = new CommentEvent(this.f62926m, this.f62925l, comment, 1, getClass());\n Optional b = Optional.m150255b(m90076aj());\n commentEvent.getClass();\n b.mo131261a((AbstractC32235e) new AbstractC32235e() {\n /* class com.zhihu.android.comment.p1455ui.fragment.$$Lambda$MDKcab3XL3KxAv_ziJSrbBf0Jxg */\n\n @Override // java8.util.p2234b.AbstractC32235e\n public final void accept(Object obj) {\n CommentEvent.this.setReplyCommentId((String) obj);\n }\n });\n RxBus.m86979a().mo84367a(commentEvent);\n }\n }", "@Override\r\n\tpublic void sendComment(RemoteComment comment,\r\n\t\t\tCallBackListener callBackListener) throws Exception {\n\t\t\r\n\t}", "@Override\n public void onComplete(FBPostCommentResponse fbCommentResponse) {\n handlePostCommentSuccess(fbCommentResponse.getCommentId());\n // broadcast success\n broadcastPostCommentResponse(true);\n }", "@Override\r\n\tpublic void addrep(Reply reply) {\n\t\treplyServ.addrep(reply);\r\n\t}", "@Override\n\tpublic void setANSWER(String ANSWER) {\n\t\t_commentRegistration.setANSWER(ANSWER);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines the highest cards out of the given cards
private String highCards() { Card[] sorted = sortCardsDesc(Card.SortOrder.BY_RANK, false); String theValue = "0"; int i; for (i = 0; i < noOfCards && i < 5; i++) theValue += sorted[i].getRankInHex(); while(i < 5) { theValue += "0"; i++; } return theValue; }
[ "private int getHighestCardThreeFourKind(Poker[] cards)\n\t{\n\t\t// int counter = 0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor (int i=0; i<cards.length; i++){\n\t\t\tif (!map.containsKey(cards[i].getNumber())){\n\t\t\t\tmap.put(cards[i].getNumber(), 1);\t\t\t\t\n\t\t\t} else {\n\t\t\t\tint newValue = map.get(cards[i].getNumber()) + 1;\n\t\t\t\tmap.put(cards[i].getNumber(), newValue);\n\t\t\t}\n\t\t}\n\t\tfor (int i=0; i<cards.length; i++){\n\t\t\tif (map.get(cards[i].getNumber()) > 2){\n\t\t\t\treturn cards[i].getNumber();\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "@Override\n public int highestCard(List<Card> listCards) {\n int higestIndex = 0;\n List<Integer> listofValue = new ArrayList<Integer>();\n //if there is no trumpsuit\n if (!this.hasTrumpSuit(listCards)) {\n for (int i = 0; i < listCards.size(); i++) {\n if (listCards.get(i).getSuit() == CurrentSuit) {\n listofValue.add(listCards.get(i).getValue().getValue());\n } else listofValue.add(0);\n }\n\n }//end if\n // if there exist trumpsuit cards\n else {\n for (int i = 0; i < listCards.size(); i++) {\n if (listCards.get(i).getSuit() == TrumpSuit) {\n listofValue.add(listCards.get(i).getValue().getValue());\n } else listofValue.add(0);\n }\n }\n int highestvalue = Collections.max(listofValue);\n higestIndex = listofValue.indexOf(highestvalue);\n\n return higestIndex;\n }", "public int HighCard()\n\t{\t\t\t\n\t\tint highCard = hand[0].getNumericRank();\t\t// Set first card as high card\t\n\t\t\n\t\tfor (int i = 1; i < hand.length; i++)\t\t\t// Compare to each other card\n\t\t\tif (hand[i].getNumericRank() > highCard)\t// If higher rank set as new high card\n\t\t\t\thighCard = hand[i].getNumericRank();\n\t\n\t\treturn highCard; \n\t}", "public ArrayList<Card> CardWithMaxValue(ArrayList<Card> tempCards, int category){\n\t\t//1-Size 2-Speed 3-Range 4-Firepower 5-Cargo\n\n\t\tArrayList<Card> tempWinningCards = new ArrayList<>();\n\t\tint size = tempCards.size();\n\t\tif(size>1){\n\t\t\ttempWinningCards.clear();\n\t\t\tCard maxCard = tempCards.get(0);\n\t\t\ttempWinningCards.add(maxCard);\n\n\t\t\tfor(int i=1;i<size;i++){\n\t\t\t\tswitch (category){\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tif(maxCard.getSize()<tempCards.get(i).getSize()){\n\t\t\t\t\t\t\tmaxCard = tempCards.get(i);\n\t\t\t\t\t\t\ttempWinningCards.clear();\n\t\t\t\t\t\t\ttempWinningCards.add(maxCard);\n\t\t\t\t\t\t}else if(maxCard.getSize()==tempCards.get(i).getSize()){\n\t\t\t\t\t\t\ttempWinningCards.add(tempCards.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tif(maxCard.getSpeed()<tempCards.get(i).getSpeed()){\n\t\t\t\t\t\t\tmaxCard = tempCards.get(i);\n\t\t\t\t\t\t\ttempWinningCards.clear();\n\t\t\t\t\t\t\ttempWinningCards.add(maxCard);\n\t\t\t\t\t\t}else if(maxCard.getSpeed()==tempCards.get(i).getSpeed()){\n\t\t\t\t\t\t\ttempWinningCards.add(tempCards.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tif(maxCard.getRange()<tempCards.get(i).getRange()){\n\t\t\t\t\t\t\tmaxCard = tempCards.get(i);\n\t\t\t\t\t\t\ttempWinningCards.clear();\n\t\t\t\t\t\t\ttempWinningCards.add(maxCard);\n\t\t\t\t\t\t}else if(maxCard.getRange()==tempCards.get(i).getRange()){\n\t\t\t\t\t\t\ttempWinningCards.add(tempCards.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tif(maxCard.getFirepower()<tempCards.get(i).getFirepower()){\n\t\t\t\t\t\t\tmaxCard = tempCards.get(i);\n\t\t\t\t\t\t\ttempWinningCards.clear();\n\t\t\t\t\t\t\ttempWinningCards.add(maxCard);\n\t\t\t\t\t\t}else if(maxCard.getFirepower()==tempCards.get(i).getFirepower()){\n\t\t\t\t\t\t\ttempWinningCards.add(tempCards.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tif(maxCard.getCargo()<tempCards.get(i).getCargo()){\n\t\t\t\t\t\t\tmaxCard = tempCards.get(i);\n\t\t\t\t\t\t\ttempWinningCards.clear();\n\t\t\t\t\t\t\ttempWinningCards.add(maxCard);\n\t\t\t\t\t\t}else if(maxCard.getCargo()==tempCards.get(i).getCargo()){\n\t\t\t\t\t\t\ttempWinningCards.add(tempCards.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tempWinningCards;\n\t\t}else {\n\t\t\treturn null;\n\t\t}\n\n\t}", "public static List<Player> highCard(List<Player> players) {\n List<Player> winners = new ArrayList<>();\n int highestCardOfAllPlayers = 0;\n\n for (Player player : players) {\n if (highestCardOfAllPlayers < getHighestCard(player.getHand()))\n highestCardOfAllPlayers = getHighestCard(player.getHand());\n }\n\n int finalHighestCardOfAllPlayers = highestCardOfAllPlayers;\n winners.addAll(players.stream()\n .filter(player -> finalHighestCardOfAllPlayers == getHighestCard(player.getHand()))\n .collect(Collectors.toList()));\n\n return winners;\n }", "com.google.protobuf.ByteString getMaxWinCards(int index);", "public int findMaxSuitIndex(int whoseTurn, List<Card> cards) {\n int suits[] = new int[5];\n int maxSuitIndex = 0;\n\n for (Card c : cards) {\n // checks for 8s and jokers\n if (c.getValue() == C8Constants.EIGHT_CARD_NUMBER\n || c.getSuit() == Constants.SUIT_JOKER) {\n continue;\n }\n // this gets the number of cards of each suit\n suits[c.getSuit()]++;\n if (suits[c.getSuit()] > suits[maxSuitIndex]) {\n maxSuitIndex = c.getSuit();\n }\n }\n\n return maxSuitIndex;\n }", "public card bestCardToThrow(ArrayList<card> cards, card cardToCompareTo) {\n ranks = new ArrayList<>(Arrays.asList(\"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"J\", \"Q\", \"K\", \"A\"));\n\n //set the current max to the thrown card\n card maxCard = cardToCompareTo;\n //smallest card\n card minCard = cardToCompareTo;\n\n //check to see if card of same suit exists\n boolean sameSuitExists = hasSameSuit(cards, cardToCompareTo);\n\n //if we have a card of the same suit\n if (sameSuitExists) {\n String maxRank = cardToCompareTo.getRank();\n String minRank = cardToCompareTo.getRank();\n for (card Card : cards) {\n //if it's the same suit\n if (Card.getSuit() == cardToCompareTo.getSuit()) {\n //if the rank is higher than the max rank\n if (ranks.indexOf(Card.getRank()) > ranks.indexOf(maxRank)) {\n maxCard = Card;\n maxRank = Card.getRank();\n }\n //if the rank is lower than the lowest rank\n if (ranks.indexOf(Card.getRank()) < ranks.indexOf(minRank)) {\n minCard = Card;\n minRank = Card.getRank();\n }\n }\n }\n //if a card of higher rank exists\n if (!maxCard.getRank().equals(cardToCompareTo.getRank())) {\n return maxCard;\n } //else, return the card of the same suit with the lowest rank\n else {\n return minCard;\n }\n //return toReturn;\n } else {\n //set the min card to the first card in hand\n minCard = cards.get(0);\n //get it's rank\n String minRank = minCard.getRank();\n for (card Card : cards) {\n //if the rank is lower than the lowest rank\n if (ranks.indexOf(Card.getRank()) < ranks.indexOf(minRank)) {\n minCard = Card;\n minRank = Card.getRank();\n }\n\n }\n return minCard;\n }\n }", "public Card getTopCard() {\n\t\tint highestrank=-1;\n\t\tint index=0;\n\t\tfor (int i=0; i<5; i++) {\n\t\t\tint thisnewrank=this.getCard(i).rank;\n\t\t\t//Change the ranks of the card to fit BigTwo card game rules.\n\t\t\tif (thisnewrank==0) {\n\t\t\t\tthisnewrank=13;\n\t\t\t} else if (thisnewrank==1) {\n\t\t\t\tthisnewrank=14;\n\t\t\t}\n\t\t\tif (thisnewrank>highestrank) {\n\t\t\t\thighestrank=thisnewrank;\n\t\t\t\tindex=i;\n\t\t\t}\n\t\t}\n\t\treturn this.getCard(index);\n\t}", "public int getMaxCardinAt(int pos)\n\t{\n\t\treturn alMaxCard.get(pos);\n\t}", "public int getNbMaxCards() {\n return NB_MAX_CARDS;\n }", "public Card getTopCard() {\r\n\r\n\t\tthis.sort();\r\n\t\tif (this.getCard(0).getRank()== this.getCard(1).getRank() && this.getCard(1).getRank() != this.getCard(2).getRank() && this.getCard(2).getRank()== this.getCard(3).getRank() && this.getCard(3).getRank()== this.getCard(4).getRank()) {\r\n\t\t\treturn this.getCard(4);\r\n\t\t}\r\n\t\t//if (this.getCard(0).getRank()== this.getCard(1).getRank() && this.getCard(1).getRank() == this.getCard(2).getRank() && this.getCard(2).getRank()!= this.getCard(3).getRank() && this.getCard(3).getRank()== this.getCard(4).getRank()) {\r\n\t\t//\treturn this.getCard(4);\r\n\t\t//}\r\n\t\t\r\n\t\treturn this.getCard(1);\r\n\t\t\t\r\n\t}", "private boolean isHighCards(Poker[] cards)\n\t{\n\t\treturn true;\n\t}", "private CardCollection findHighCard() {\n Card[] toReturn = new Card[ONE_CARD_HAND];\n\n toReturn[0] = new Card(cardSet.get(0));\n\n return new CardCollection(toReturn, HandRank.HIGH_CARD);\n }", "public com.google.protobuf.ByteString getMaxWinCards(int index) {\n return maxWinCards_.get(index);\n }", "private Carte highCard(LinkedList<Carte> cartes){\r\n Collections.sort(cartes, Collections.reverseOrder());\r\n return cartes.getFirst();\r\n }", "public int getMaxcardsize() {\n return maxcardsize;\n }", "public int getResult(List<Card> cards) {\n int result = 0;\n int nCount = 0;\n for (int i = 0; i < cards.size(); i++) {\n int number = cards.get(i).getCardNumber() + 1;\n if (number >= 11) {//11= con tien\n nCount++;\n }\n }\n\n if (nCount == 3) { //ba tien\n return 10;\n } else {\n for (int i = 0; i < cards.size(); i++) {\n int number = cards.get(i).getCardNumber() + 1;\n if (number < 11) {//11= con tien\n result += number;\n }\n }\n if (result >= 10) {\n result = result%10;\n }\n }\n return result;\n }", "public int compareTo(Card card) {\n\t\t// Accounts for '2' as biggest\n\t\tif (this.rank == 1 && card.rank != 1) {\n\t\t\treturn 1;\n\t\t} else if (this.rank != 1 && card.rank == 1) {\n\t\t\treturn -1;\n\t\t}\n\t\t// Accounts for 'A' as second biggest\n\t\tif (this.rank == 0 && card.rank >= 2) {\n\t\t\treturn 1;\n\t\t} else if (this.rank >= 2 && card.rank == 0) {\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tif (this.rank > card.rank) {\n\t\t\treturn 1;\n\t\t} else if (this.rank < card.rank) {\n\t\t\treturn -1;\n\t\t} else if (this.suit > card.suit) {\n\t\t\treturn 1;\n\t\t} else if (this.suit < card.suit) {\n\t\t\treturn -1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "java.util.List<com.google.protobuf.ByteString> getMaxWinCardsList();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/The objective of this function is to reiterate the loop if user wants to roll dics again till 3 times. it also allow USer to change any specific dics index and roll its value again Argument taken: as Array that User entered
public void loopcheck(String [] arrInput){ inputloop=new Scanner(System.in); boolean run = true ; int num =0; int[] newindex = new int [5]; String [] replacecopy= null; /*The while loop will allow user to set position of the dics that he need ot change * the value for*/ while(run){ System.out.print("\nEnter position of dices that you want to REROLL. (,) seperated => "); Loop=new StringBuilder(inputloop.nextLine()); String []rollindex=Loop.toString().split(","); for(int i=0;i<rollindex.length;i++) { num=Integer.parseInt(rollindex[i]); newindex[i]= num; if(num<Main.MinValue || num>Main.Dices) { System.out.print("\nNumber should be in range of 1 to 5 Only"); }else{ run = false; } } } run = true; /*The while loop allow user to enter new value for old value * and validates it to be between 1 to 6*/ while(run){ System.out.print("Enter the replaced values(,) seperated:"); Loop=new StringBuilder(inputloop.nextLine()); String [] replace=Loop.toString().split(","); for(int i=0;i<replace.length;i++){ num=Integer.parseInt(replace[i]); if(num<Main.MinValue || num>Main.MaxValue){ System.out.print("\nNumber should be in range of 1 to 6 Only"); }else{ run = false; } } replacecopy = Arrays.copyOf(replace, replace.length); } for(int i=0;i<replacecopy.length;i++){ arrInput[newindex[i]-1]=replacecopy[i]; } System.out.print("\nDices values : "); /*This for loop run the new values for score and rule check*/ for(String str:arrInput){ System.out.print(str+" "); } if(validate(arrInput) == Main.valid ){ int rulevalue = rule(arrInput); System.out.print(Main.RuleCheck.get(rulevalue)); int scorevalue = score(rulevalue,arrInput); System.out.print("\nYour new score is :"+scorevalue); } else{ System.out.print("\nInvalid Input Entered"); } Attempt++; if(Attempt<2) { System.out.print("\nDo you want to REROLL again(y/n) ?"); Loop=new StringBuilder(inputloop.nextLine()); if(Loop.toString().contains("y") && (Loop.toString().trim().length()==1)) { loopcheck(arrInput); } } else { System.out.println("Maximum limit of 3 completed.."); } }
[ "private void reroll(){\n for(int i=0; i<2; i++){\n display.printMessage(\"Select the dice you wish to re-roll and click \\\"Roll Again\\\".\");\n display.waitForPlayerToSelectDice();\n for(int j=0; j<5; j++){\n if(display.isDieSelected(j)){\n rerollOneDie(j);\n }\n }\n display.displayDice(dice);\n }\n }", "public int[] rollDice(int numDubs) {\n \tint[] dice = new int[2];\n int d1 = (this.randNum.nextInt(6) + 1);\n int d2 = (this.randNum.nextInt(6) + 1);\n //jail check\n if(numDubs == 2 && d1 == d2) { //third double roll, go to jail\n\n dice[0] = -1;\n dice[1] = 0;\n }\n String sum = d1+\" + \"+d2;\n //rollDiceButton.setText(sum);\n dice[0] = d1;\n dice[1] = d2;\n return dice;\n\n }", "public void roll() {\n for (int i = 0; i < count; i++) {\n ds[i].roll();\n }\n }", "public void roll() {\n ArrayList<Integer> possibleValues = new ArrayList<>();\n for (Integer i = 1; i < 7; i++)\n possibleValues.add(i);\n Collections.shuffle(possibleValues);\n\n this.rolledValue = possibleValues.get(0);\n this.rolled = true;\n }", "private void rerollOneDie(int index){\n dice[index] = rgen.nextInt(1, 6);\n }", "public static void restart (int[] userarr, int[] drawarr) {\r\n \r\n userNumbers(userarr, drawarr);\r\n \r\n }", "@Override\n public void changeDiseasesPicked(int change){\n _numDiseasesPicked += change;\n if (_numDiseasesPicked == 1)\n _allDiseasesPicked = true;\n }", "private int[] rollSelectedDice(int[] dices){\n\t\tfor(int i = 0; i < N_DICE; i++){\n\t\t\t//check whether the index for a dice is selected\n\t\t\tif(display.isDieSelected(i)){\n\t\t\t\tdices[i] = rgen.nextInt(1,6);\n\t\t\t}\n\t\t}\n\t\treturn dices;\n\t}", "String Encrypt() {\n Integer[][] RotorArray = new Integer[8][];\n //for generating the rotors to be used, just use the rotor number that corresponds to the digit in the date.\n //e.g. 09/09/2009 would use Rotor0, Rotor9, Rotor0, Rotor9, Rotor2, Rotor0, Rotor0, Rotor9.\n //if the date is only 7 digits long then the first digit must have been a zero. Thus use an instance of rotor 0 for that spot.\n if (Date.toString().length()==7) {\n RotorArray[0] = Rotor0;\n String StringDate = Date.toString();\n Scanner StringDateReader = new Scanner(StringDate).useDelimiter(\"\");\n for (int q = 0; q < 7; q++) {\n int CurrentDigit = StringDateReader.nextInt();\n Integer[] NextRotor = null;\n switch (CurrentDigit) {\n case 0: NextRotor = Rotor0;\n break;\n case 1: NextRotor = Rotor1;\n break;\n case 2: NextRotor = Rotor2;\n break;\n case 3: NextRotor = Rotor3;\n break;\n case 4: NextRotor = Rotor4;\n break;\n case 5: NextRotor = Rotor5;\n break;\n case 6: NextRotor = Rotor6;\n break;\n case 7: NextRotor = Rotor7;\n break;\n case 8: NextRotor = Rotor8;\n break;\n case 9: NextRotor = Rotor9;\n break;\n }\n RotorArray[q+1] = NextRotor;\n }\n } else {\n String StringDate = Date.toString();\n Scanner StringDateReader = new Scanner(StringDate).useDelimiter(\"\");\n for (int q = 0; q < 8; q++) {\n int CurrentDigit = StringDateReader.nextInt();\n Integer[] NextRotor = null;\n switch (CurrentDigit) {\n case 0: NextRotor = Rotor0;\n break;\n case 1: NextRotor = Rotor1;\n break;\n case 2: NextRotor = Rotor2;\n break;\n case 3: NextRotor = Rotor3;\n break;\n case 4: NextRotor = Rotor4;\n break;\n case 5: NextRotor = Rotor5;\n break;\n case 6: NextRotor = Rotor6;\n break;\n case 7: NextRotor = Rotor7;\n break;\n case 8: NextRotor = Rotor8;\n break;\n case 9: NextRotor = Rotor9;\n break;\n }\n RotorArray[q] = NextRotor;\n }\n }\n StringBuilder Cyphertext = new StringBuilder();\n Scanner PlaintextReader = new Scanner(PlainText).useDelimiter(\"\");\n int FirstRotorIncrement = 0;\n int SecondRotorIncrement = 0;\n int ThirdRotorIncrement = 0;\n int FourthRotorIncrement = 0;\n int FifthRotorIncrement = 0;\n int SixthRotorIncrement = 0;\n int SeventhRotorIncrement = 0;\n int EighthRotorIncrement = 0;\n while (PlaintextReader.hasNext()) {\n String CurrentChar = PlaintextReader.next();\n int CurrentCharValue = CharToNumbersKey.get(CurrentChar);\n //Here's the actual encryption part: Starting with the integer value of the current character, it\n //puts it through the first rotor mapping, and takes the output and puts it through the second rotor, and\n //so on all the way through the 8th rotor.\n int EncryptingCharValue;\n assert RotorArray[0] != null;\n //Taking into account the rotor increments, and if it should wrap around the rotor the if statement\n //accomplishes that for each rotor.\n int RotorValue = CurrentCharValue + FirstRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[0][RotorValue];\n assert RotorArray[1] != null;\n RotorValue = EncryptingCharValue + SecondRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[1][RotorValue];\n RotorValue = EncryptingCharValue + ThirdRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[2][RotorValue];\n RotorValue = EncryptingCharValue + FourthRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[3][RotorValue];\n RotorValue = EncryptingCharValue + FifthRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[4][RotorValue];\n RotorValue = EncryptingCharValue + SixthRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[5][RotorValue];\n RotorValue = EncryptingCharValue + SeventhRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[6][RotorValue];\n RotorValue = EncryptingCharValue + EighthRotorIncrement;\n if (RotorValue>95) {\n RotorValue = RotorValue-95;\n }\n EncryptingCharValue = RotorArray[7][RotorValue];\n\n //we now have our final value for our encrypted character, so let's use the key to translate it back to our\n //standard ASCII alphabet, and append it to the cyphertext string. The -1 is for zero indexing\n Cyphertext.append(NumbersToCharKey[EncryptingCharValue-1]);\n //this part handles rotor iteration. If the first one cycles once, it increments the next one, and so on\n FirstRotorIncrement ++;\n if (FirstRotorIncrement > 95) {\n FirstRotorIncrement = 0;\n SecondRotorIncrement++;\n }\n if (SecondRotorIncrement > 95) {\n SecondRotorIncrement = 0;\n ThirdRotorIncrement ++;\n }\n if (ThirdRotorIncrement > 95) {\n ThirdRotorIncrement = 0;\n FourthRotorIncrement++;\n }\n if (FourthRotorIncrement > 95) {\n FourthRotorIncrement = 0;\n FifthRotorIncrement++;\n }\n if (FifthRotorIncrement > 95) {\n FifthRotorIncrement = 0;\n SixthRotorIncrement++;\n }\n if (SixthRotorIncrement > 95) {\n SixthRotorIncrement = 0;\n SeventhRotorIncrement++;\n }\n if (SeventhRotorIncrement > 95) {\n SeventhRotorIncrement = 0;\n EighthRotorIncrement++;\n }\n if (EighthRotorIncrement > 95) {\n EighthRotorIncrement = 0;\n }\n }\n return Cyphertext.toString();\n }", "public static void main(String[] args)\n {\n int[] dice = new int[5];\n Random r = new Random();\n Scanner in = new Scanner (System.in);\n String reroll = \"\";\n String godMode = \"\";\n \n System.out.println(\"Let's play some Yahtzee! Here's your first set of dice: \");\n \n //Generate the first 5 dice.\n for (int i = 0; i < 5; i++)\n {\n dice[i] = r.nextInt(6) + 1;\n }\n \n for (int i = 0; i < 5; i++)\n {\n System.out.print(dice[i] + \" \");\n }\n System.out.println();\n \n //Optional First Re-roll\n for (int i = 0; i < 5; i++)\n {\n System.out.println(\"Would you like to Re-roll die #\" + (i+1) + \"? (Y/N)\");\n reroll = in.nextLine();\n \n if (reroll.equalsIgnoreCase(\"y\"))\n {\n dice[i] = r.nextInt(6) + 1;\n }\n \n }\n \n for (int i = 0; i < 5; i++)\n {\n System.out.print(dice[i] + \" \");\n }\n System.out.println();\n \n //Optional Second Re-roll\n for (int i = 0; i < 5; i++)\n {\n System.out.println(\"Would you like to Re-roll die #\" + (i+1) + \"? (Y/N)\");\n reroll = in.nextLine();\n \n if (reroll.equalsIgnoreCase(\"y\"))\n {\n dice[i] = r.nextInt(6) + 1;\n }\n \n }\n \n for (int i = 0; i < 5; i++)\n {\n System.out.print(dice[i] + \" \");\n }\n System.out.println();\n \n //Allow the player to manually manipulate the dice in GOD MODE. BWAHAHA!\n System.out.println(\"Would you like to enter God-mode and override any dice? (Y/N)\");\n godMode = in.nextLine();\n \n if (godMode.equalsIgnoreCase(\"y\"))\n {\n for (int i = 0; i < 5; i++)\n {\n System.out.println(\"Please enter the new value for die #\" + (i+1) + \":\");\n dice[i] = in.nextInt();\n }\n }\n \n System.out.println(\"Your final dice show: \");\n for (int i = 0; i < 5; i++)\n {\n System.out.print(dice[i] + \" \");\n }\n System.out.println();\n \n //Create the arraylist to count the values of the dice.\n ArrayList<Integer> counts = new ArrayList<Integer>();\n for (int i = 0; i < 6; i++)\n {\n counts.add(0);\n }\n \n for (int i = 0; i < 5; i++)\n {\n int diceIndex = dice[i] -1;\n counts.set(diceIndex, (counts.get(diceIndex) +1));\n }\n \n //All the win/lose states possible based on the values of each dice.\n if (counts.contains(5))\n {\n System.out.println(\"Yahtzee!\");\n }\n else if (counts.contains(4))\n {\n System.out.println(\"You got a Four-of-a-Kind!\");\n }\n else if (counts.contains(3) && counts.contains(2))\n {\n System.out.println(\"That's a Full House!\");\n }\n else if (counts.contains(3) && !counts.contains(2))\n {\n System.out.println(\"You got Three-of-a-Kind!\");\n }\n else if (!counts.contains(2) && (counts.get(1) != 0) && (counts.get(2) != 0) && (counts.get(3) != 0) && (counts.get(4) != 0))\n {\n System.out.println(\"Large Straight! Nice Job!\");\n }\n else if (!counts.contains(2) && !counts.contains(3) && !counts.contains(4) && !counts.contains(5))\n {\n System.out.println(\"That's a Small Straight!\");\n }\n else\n {\n System.out.println(\"Looks like you didn't get a winning combo this time. Thanks for playing anyway!\");\n }\n \n System.out.println(\"Thanks for playing Yahtzee!\");\n \n \n //System.out.println();\n //for (int i = 0; i < 6; i++)\n //{\n //System.out.println(\"The number of \" + (i+1) + \"s is: \" + counts.get(i));\n //}\n \n }", "static void leftRotate(int arr[], int d, int n)\n {\n for (int i = 0; i < d; i++)\n leftRotatebyOne(arr, n);\n }", "private void repeatRevision(Ui ui, ArrayList<Card> cards, int count, Scanner scanner) {\n while (cards.size() != 0) {\n ArrayList<Card> repeatCards = new ArrayList<>();\n for (Card c : cards) {\n count = reviseCard(count, c, ui, repeatCards, scanner);\n }\n cards = new ArrayList<>(repeatCards);\n }\n }", "public void rollDice()\r\n\t{\r\n\t\tsod.rollDice();\r\n\t\tsod.printSet();\r\n\t\tSystem.out.println(\"You have 2 rerolls remaining\"); \r\n\t}", "public boolean rollASix(){\n\t\tint dice = rollDice();\n\t\twhile(dice != 6){\n\t\t\tdice = rollDice();\n\t\t\tif(dice == 3){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(dice == 6){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private void playerRoll() {\n //tracks the die we are currently at\n int i = 0;\n\n //checks to see what toggelbuttons are selected\n //selected togglebuttons are die we do not want to keep so that indice is set to false\n boolean[] choice = new boolean[game.getDieNum()];\n for (Node node : playerDiceButtons.getChildren()) {\n ToggleButton playerButton = (ToggleButton) node;\n if (playerButton.isSelected()) {\n choice[i] = false;\n } else {\n choice[i] = true;\n }\n i++;\n }\n\n //clears the toggles on our toggle buttons\n resetButtons();\n //roll the selected dice and generate new buttons to display the score\n currentPlayer.rollOnce(choice);\n gameDisplayController();\n generateScorecard();\n }", "public static void main(String[] args) {\n System.out.println(\"Enter 10 intgers: \");\n getInput();\n printArray(baseData);\n resizeArray();\n /*System.out.println(\"Enter 12 intgers: \");\n getInput();*/\n baseData[10]=67;\n baseData[11]=200;\n printArray(baseData);\n }", "private void rollAttack()\n {\n //Clears out all of the previous values in the AttackList and then refills out all of them\n //4 values for each attack in order: hit, damage, description, isCritical\n cleanTable(AttackList);\n String[][] attacksFromOneCreature;\n for (int i = 0; i < list.size(); i++) //For every creature,\n {\n attacksFromOneCreature = list.get(i).attack();\n for (String[] attacksFromOneCreature1 : attacksFromOneCreature) //For every attack each creature made\n {\n String attackRoll;\n if(attacksFromOneCreature1[Minions.ISCRITICALPLACE].equals(\"true\"))\n {\n if(Integer.parseInt(attacksFromOneCreature1[Minions.ATTACKROLLPLACE]) >= 20)\n attackRoll=\"nat 20\"; //If the attack resulted in a natural 20, then the attackroll inputed value is \"nat 20\" instead of the normal roll with its modifier to distinguish the two\n else\n attackRoll=\"nat 1\"; //If the attack resulted in a natural 1, then attackroll inputs it as \"nat 1\" instead to distinguish.\n }\n else\n attackRoll=attacksFromOneCreature1[Minions.ATTACKROLLPLACE];\n String[] info = {\"\" + (i+1),list.get(i).getName(), attackRoll, attacksFromOneCreature1[Minions.DAMAGEPLACE]}; //Values that get updated into table are: Minion spot, Minion name, attack roll, damage\n if (!attackNotes.contains(attacksFromOneCreature1[Minions.DESCRIPTIONPLACE])) {\n attackNotes.add(attacksFromOneCreature1[Minions.DESCRIPTIONPLACE]);\n numRepeatingAttackNotes.add(1);\n } else {\n int index = attackNotes.indexOf(attacksFromOneCreature1[Minions.DESCRIPTIONPLACE]);\n numRepeatingAttackNotes.add(index, numRepeatingAttackNotes.remove(index)+1);\n }\n updateAttackTableRow(info, Boolean.parseBoolean(attacksFromOneCreature1[Minions.ISCRITICALPLACE]));\n }\n }\n autoDetermineHit();\n }", "private void resetDice() {\n\t\tfor (int i = 0; i < dice.length; i++) {\n\t\t\tdice[i].resetDice();\n\t\t}\n\t}", "public void rollDice() {\r\n \r\n d1 = (int) (Math.random()*6) + 1;\r\n userBean.setFirstDice(d1);\r\n d2 = (int) (Math.random()*6) + 1;\r\n userBean.setSecondDice(d2);\r\n userBean.setResult(d2+d1);\r\n \r\n d1Rear = 7 - d1;\r\n int max1 = Math.max(d1, d1Rear);\r\n \r\n switch (max1) {\r\n case 4:\r\n d1Left = 5;\r\n d1Right = 2;\r\n d1Top = 1;\r\n d1Bottom = 6;\r\n break;\r\n case 5:\r\n d1Left = 3;\r\n d1Right = 4;\r\n d1Top = 1;\r\n d1Bottom = 6;\r\n break;\r\n default:\r\n d1Left = 3;\r\n d1Right = 4;\r\n d1Top = 5;\r\n d1Bottom = 2;\r\n break;\r\n }\r\n \r\n d2Rear = 7 - d2;\r\n int max2 = Math.max(d2, d2Rear);\r\n \r\n switch (max2) {\r\n case 4:\r\n d2Left = 5;\r\n d2Right = 2;\r\n d2Top = 1;\r\n d2Bottom = 6;\r\n break;\r\n case 5:\r\n d2Left = 3;\r\n d2Right = 4;\r\n d2Top = 1;\r\n d2Bottom = 6;\r\n break;\r\n default:\r\n d2Left = 3;\r\n d2Right = 4;\r\n d2Top = 5;\r\n d2Bottom = 2;\r\n break;\r\n }\r\n \r\n }", "public static void main(String[] args) {\n\t Scanner scan = new Scanner(System.in);\n\t int n = scan.nextInt();\n\t int d = scan.nextInt();\n\t int[] a = new int[n];\n\t for (int i = 0; i < n; i++) {\n\t a[i] = scan.nextInt();\n\t }\n\t \n\t while (d > 0) {\n\t int[] b = new int[n];\n\t for (int j = n-1; j > 0; j--) {\n\t b[n-1] = a[0];\n\t b[j-1] = a[j];\n\t }\n\t a = Arrays.copyOf(b, n);\n\t d--;\n\t \n\t }\n\t \n\t for (int k = 0; k< a.length; k++) {\n\t System.out.print(a[k]);\n\t System.out.print(\" \"); \n\t }\n\t }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public Object forceVersionIncrement(Serializable id, Object currentVersion, SessionImplementor session) throws HibernateException { return null; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
used by updateboard, movement find the gap, find how big it is add thread wait here
public void slideRows2() { int gapWid = 0; int leftIndex = 0; int startIndex; ArrayList<Integer> startIndexes = new ArrayList(); for (int i = 0; i <= width; i++) { if (gapWid > 0 && board[i][height] != 0) { leftIndex = i; i = width + 1; //end the check } else if (board[i][height] == 0) { gapWid++; } if (gapWid == 1) { startIndexes.add(i); } } startIndex = startIndexes.get(0); copyLeftOfGapOver(leftIndex, startIndex); fillRightGap(gapWid); checkForRemainingRowGap(); }
[ "public void run(){\r\n \t\twhile(true){\r\n \t\t\tboard.new_game();\r\n \t\t\t\r\n \t\t\twhile(!board.lost && !board.won){\r\n\t\t\t\t/*try {\r\n\t\t\t\t\tsleep(0);\r\n\t\t\t\t} catch (InterruptedException e) {}*/\r\n \t\t\t\tboolean made_a_move = false;\r\n \t\t\t\t\r\n \t\t\t\tfor(int x = 0; x<board.width; x++){\r\n \t\t\t\t\t//System.out.println(\"1\");\r\n \t\t\t\t\tfor(int y = 0; y<board.height; y++){\r\n \t\t\t\t\t\tif(board.view_cell(x, y) > 0){\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\tint surrounding_empty_spaces = board.total_arround_cell(x, y, \"uncovered?\", false);\r\n \t\t\t\t\t\t\t//int surrounding_flags = board.total_arround_cell(x, y, \"flagged?\");\r\n \t\t\t\t\t\t\t\r\n \t\t\t\t\t\t\tif (surrounding_empty_spaces == board.view_cell(x,y)){\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x-1, y-1) || made_a_move;\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x-1, y ) || made_a_move;\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x-1, y+1) || made_a_move;\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x , y+1) || made_a_move;\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x+1, y+1) || made_a_move;\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x+1, y ) || made_a_move;\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x+1, y-1) || made_a_move;\r\n \t\t\t\t\t\t\t\tmade_a_move = board.right_click(x , y-1) || made_a_move;\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n\t\t\t\tint total_clicks = 0;\r\n \t\t\t\tfor(int x = 0; x<board.width; x++){\r\n \t\t\t\t\t//System.out.println(\"2\");\r\n \t\t\t\t\tfor(int y = 0; y<board.height; y++){\r\n \t\t\t\t\t\tint surrounding_empty_spaces = board.total_arround_cell(x, y, \"uncovered?\", false);\r\n \t\t\t\t\t\tint surrounding_flags = board.total_arround_cell(x, y, \"flagged?\");\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\tif(surrounding_empty_spaces > 0 && \r\n \t\t\t\t\t\t surrounding_flags == board.view_cell(x, y) && \r\n\t\t\t\t\t\t (boolean) board.board[x][y].get(\"uncovered?\") &&\r\n\t\t\t\t\t\t total_clicks++ < 30){\r\n \t\t\t\t\t\t\t\tmade_a_move = board.middle_click(x, y) || made_a_move;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t}\r\n \t\t\t\twhile(!made_a_move){\r\n \t\t\t\t\tint x = (int) (Math.random() * board.width);\r\n \t\t\t\t\tint y = (int) (Math.random() * board.height);\r\n \t\t\t\t\t//System.out.println(\"guessing (\" +x+\",\"+y+\")\");\r\n \t\t\t\t\tmade_a_move = board.left_click(x, y);\r\n \t\t\t\t}\r\n \t\t\t\tif(board.won){\r\n \t\t\t\t\t//System.out.println(\"WON!\");\r\n \t\t\t\t\t//board.print_board();\r\n \t\t\t\t\t//while(true){}\r\n \t\t\t\t} else if(board.lost){\r\n \t\t\t\t\t//System.out.println(\"LOST!\");\r\n \t\t\t\t\t//board.print_board();\r\n \t\t\t\t\t//while(true){}\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public void getNextMove(Board board){\n Unit unit = getNearestUnitToActor(findPlayerFlag());\n\n double downDist = 999;\n double rightDist = 1000;\n double leftDist = 1001;\n\n Actor actor = findPlayerFlag();\n int actorY = actor.getCol();\n int actorX = actor.getRow();\n\n if(canMoveDown(unit)){\n downDist = Math.sqrt(Math.pow((actorX - unit.getRow()), 2) + Math.pow((actorY - unit.getCol() + 1), 2));\n downDist -= 1.5;\n }\n\n if(canMoveRight(unit)){\n rightDist = Math.sqrt(Math.pow((actorX - unit.getRow() + 1), 2) + Math.pow((actorY - unit.getCol()), 2));\n }\n\n if(canMoveLeft(unit)){\n leftDist = Math.sqrt(Math.pow((actorX - unit.getRow() - 1), 2) + Math.pow((actorY - unit.getCol()), 2));\n }\n\n //System.out.println(\"down: \" + downDist + \" right: \" + rightDist + \" left: \" + leftDist);\n\n if(Math.min(downDist, Math.min(rightDist, leftDist)) == downDist){\n if(GamePanel.board.getAtLocation(unit.getRow(), unit.getCol() + 1) == null){\n GamePanel.board.swapLocations(unit.getRow(), unit.getCol(), unit.getRow(), unit.getCol() + 1);\n }else if(GamePanel.board.getAtLocation(unit.getRow(), unit.getCol() + 1) instanceof Bomb){\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol() + 1);\n }else if(GamePanel.board.getAtLocation(unit.getRow(), unit.getCol() + 1) instanceof Flag){\n //System.out.println(\"Computer won!\");\n PlayingGame.computerReachedFlag = true;\n }else{\n //dealing player piece\n int playerPieceClass = ((Unit) GamePanel.board.getAtLocation(unit.getRow(), unit.getCol() + 1)).getUnitClass();\n if(playerPieceClass == unit.getUnitClass()){\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol() + 1);\n }else if(playerPieceClass > unit.getUnitClass()){\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol() + 1);\n GamePanel.board.swapLocations(unit.getRow(), unit.getCol(), unit.getRow(), unit.getCol() + 1);\n }else{\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n }\n }\n }else if(Math.min(downDist, Math.min(rightDist, leftDist)) == rightDist){\n if(GamePanel.board.getAtLocation(unit.getRow() + 1, unit.getCol()) == null){\n GamePanel.board.swapLocations(unit.getRow(), unit.getCol(), unit.getRow() + 1, unit.getCol());\n }else if(GamePanel.board.getAtLocation(unit.getRow() + 1, unit.getCol()) instanceof Bomb){\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n GamePanel.board.setLocationNull(unit.getRow() + 1, unit.getCol());\n }else if(GamePanel.board.getAtLocation(unit.getRow() + 1, unit.getCol()) instanceof Flag){\n //System.out.println(\"Computer won!\");\n PlayingGame.computerReachedFlag = true;\n }else{\n //dealing player piece\n int playerPieceClass = ((Unit) GamePanel.board.getAtLocation(unit.getRow() + 1, unit.getCol())).getUnitClass();\n if(playerPieceClass == unit.getUnitClass()){\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n GamePanel.board.getAtLocation(unit.getRow() + 1, unit.getCol());\n }else if(playerPieceClass > unit.getUnitClass()){\n GamePanel.board.getAtLocation(unit.getRow() + 1, unit.getCol());\n GamePanel.board.swapLocations(unit.getRow(), unit.getCol(), unit.getRow() + 1, unit.getCol());\n }else{\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n }\n }\n }else{\n if(GamePanel.board.getAtLocation(unit.getRow() - 1, unit.getCol()) == null){\n GamePanel.board.swapLocations(unit.getRow(), unit.getCol(), unit.getRow() - 1, unit.getCol());\n }else if(GamePanel.board.getAtLocation(unit.getRow() - 1, unit.getCol()) instanceof Bomb){\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n GamePanel.board.setLocationNull(unit.getRow() - 1, unit.getCol());\n }else if(GamePanel.board.getAtLocation(unit.getRow() - 1, unit.getCol()) instanceof Flag){\n //System.out.println(\"Computer won!\");\n PlayingGame.computerReachedFlag = true;\n }else{\n //dealing player piece\n int playerPieceClass = ((Unit) GamePanel.board.getAtLocation(unit.getRow() - 1, unit.getCol())).getUnitClass();\n if(playerPieceClass == unit.getUnitClass()){\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n GamePanel.board.getAtLocation(unit.getRow() - 1, unit.getCol());\n }else if(playerPieceClass > unit.getUnitClass()){\n GamePanel.board.getAtLocation(unit.getRow() - 1, unit.getCol());\n GamePanel.board.swapLocations(unit.getRow(), unit.getCol(), unit.getRow() - 1, unit.getCol());\n }else{\n GamePanel.board.setLocationNull(unit.getRow(), unit.getCol());\n }\n }\n }\n }", "public void threadStuff()\n { \n if (threadRun)\n {\n if (ready)\n if (gameOver.y > gameOver.finalY) \n gameOver.updateCord();\n \n if (showingHsScreen && !ready)\n {\n if (hsScreen.y > hsScreen.finalY)\n hsScreen.updateCord();\n if (hsScreen.submitted)\n {\n showingHsScreen = false;\n ready = true;\n moveOut = true;\n }\n }\n \n if (moveOut)\n if (hsScreen.x > hsScreen.finalX)\n hsScreen.updateCord2(); \n }\n }", "public void run()\n {\n int movesToLookAhead = 4;\n moveAmount = realSave.getSaveSize() + movesToLookAhead;\n \tSave save = new Save(1);\n \tScore alphaScore = new Score(Integer.MIN_VALUE, new Save(1));\n \tScore betaScore = new Score(Integer.MAX_VALUE, new Save(1));\n Score score = calculate(realBoard, movesToLookAhead, true, save, alphaScore, betaScore);\n ArrayList<Position> moves = score.getSave().getAllMoves();\n realBH = new BoardHelper(realBoard, isWhite, realSave, true, boardFlipped);\n realBH.move(moves.get(moves.size() - 2), moves.get(moves.size() - 1), true);\n System.out.println(score.getScore());\n board2.updateElementArray();\n moveSound.play();\n moveFinished = true;\n\n }", "public void run(){\r\n \r\n while(true){\r\n\r\n //Parte del codigo que averiguara la direccion de la pelota y como es que debe de moverse \r\n if(X.getX() + AnguloX < 0){\r\n AnguloX = 1;\r\n }else if(X.getX() + AnguloX > Drone.getWidth() - tam){\r\n AnguloX = -1;\r\n }else if(Y.getY() - AnguloY < 0){\r\n AnguloY = 1;\r\n }else if(Y.getY() - AnguloY > Drone.getHeight()- tam){\r\n AnguloY = -1;\r\n }\r\n\r\n X.setX(X.getX() + AnguloX);\r\n Y.setY(Y.getY() + AnguloY);\r\n Drone.setX(X);\r\n Drone.setY(Y);\r\n Drone.repaint();\r\n try { \r\n this.sleep( (long)(Math.random()*25) + 1 );\r\n \r\n \r\n }catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n \r\n }\r\n }", "private final void processMove( int time, int prevCol, int prevRow )\r\n {\r\n this.engine.processBombmanMovement( this, prevCol, prevRow );\r\n this.movingDirection = GameEngine.STOP;\r\n this.checkSpeed( time );\r\n }", "public void move(int x, int y) {\n RelativeLayout.LayoutParams alp = playingBall.getLayoutParams();\n int maxMovementX = Math.abs(x);\n int maxMovenentY = Math.abs(y);\n int stepsTakenX = 0;\n int stepsTakenY = 0;\n int a = alp.leftMargin;\n int b = alp.topMargin;\n\n\n\n //while steps have to be taken:\n while (maxMovementX > stepsTakenX || maxMovenentY > stepsTakenY) {\n //check all the walls\n for (int i = 0; i < wallNumber; i++) {\n intersectWall(playingBall, mazeWall[i]);\n }\n\n //checks all the powerups\n for(int i=0; i< powerUpCounter; i++){\n intersectPowerUp(playingBall, powerUps.get(i));\n }\n\n //this will run if there are steps left to be done in the x direction\n if (stepsTakenX < maxMovementX) {\n stepsTakenX = stepsTakenX + 1;\n if (x > 0 && allowedMovement[3]) {//right\n playingBall.setCenterX(playingBall.getCenterX() - 1);\n playingBall.setCorners();\n a = a - 1;\n }\n if (x < 0 && allowedMovement[2]) {//left\n playingBall.setCenterX(playingBall.getCenterX() + 1);\n playingBall.setCorners();\n a = a + 1;\n }\n }\n //this will run if there are steps left to be done in the y direction\n if (stepsTakenY < maxMovenentY) {\n stepsTakenY = stepsTakenY + 1;\n if (y > 0 && allowedMovement[1]) {//down\n playingBall.setCenterY(playingBall.getCenterY() - 1);\n playingBall.setCorners();\n b = b - 1;\n }\n if (y < 0 && allowedMovement[0]) {//up\n playingBall.setCenterY(playingBall.getCenterY() + 1);\n playingBall.setCorners();\n b = b + 1;\n }\n }\n }\n\n for (int i = 0; i < 4; i++) {\n allowedMovement[i] = true;\n }\n\n alp.leftMargin = a;\n alp.topMargin = b;\n playingBall.setLayoutParams(alp); //render layout\n }", "@Override\n public void run() {\n \n try {\n // espera 300 milisegundos despues de subir la nave\n Thread.sleep(600);\n \n } catch (InterruptedException ex) { }\n \n while (true) {\n try{\n // define el tiempo cada cuanto se baja una posicion \n Thread.sleep(10);\n this.mov = 1;\n \n }catch (InterruptedException e) { }\n // baja la nave una posicion en y cada 30 milisegundos, definidos en el sleep de arriba\n if (this.posy <= 415){\n this.posy += 1;\n \n \n setBounds(this.posx,this.posy , this.icon.getIconWidth(), this.icon.getIconHeight());\n }\n if (this.posy == 415)\n this.mov = 0; \n } \n }", "public void requestMove() {\n for (byte a = 0; a < 8; a++) {\n for (byte pos = (byte) (8 * a); pos < 7 * a + 8; pos++) {\n if (board.get(pos) == Board.FREE) {\n byte b = (byte) (pos % 8);\n boardButtons[a][b].setEnabled(true);\n \n int val = board.getHoleValue(pos);\n if (val > 0) {\n boardButtons[a][b].setText(Integer.toString(val));\n boardButtons[a][b].setForeground(MY_HOLE_FG_COLOR);\n } else if (val < 0) {\n boardButtons[a][b].setText(Integer.toString(-val));\n boardButtons[a][b].setForeground(OPP_HOLE_FG_COLOR);\n } else {\n boardButtons[a][b].setText(\"0\");\n boardButtons[a][b].setForeground(NEUTRAL_HOLE_FG_COLOR);\n }\n }\n }\n }\n\n setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));\n }", "public void run(){\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\tThread.sleep(20);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t\tx+=dx;\n\t\t\tboundaryCheck(dx);\n\t\t\tjump();\n\t\t}\n\t}", "public void move() {\n randSearch = new Random();\n int move = randSearch.nextInt(((4))+0); //generate a number between 0 - 3\n //LEFT\n if(move == 0) {\n //check if boundary exist, \n //if not, move left and record total steps\n if((agent.posY-1) >= 0) {\n agent.previousState = 0;\n agent.posY--;\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n //If boundary exist, increase total steps\n else {\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n }\n //RIGHT\n else if(move == 1) {\n //check if boundary exist\n //if not, move right and record total steps\n if((agent.posY+1) < agent.width) {\n agent.previousState = 1;\n agent.posY++;\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n //if boundary exist, increase total steps\n else {\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n }\n //UP\n else if(move == 2) {\n //check if boundary exist\n //if not, move up and record total steps\n if((agent.posX-1) >= 0) {\n agent.previousState = 2;\n agent.posX--;\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n //if boundary exist, increase total steps\n else {\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n }\n //DOWN\n else if(move == 3) {\n //check if boundary exist\n //if not, move down and record total steps\n if((agent.posX+1) < agent.length) {\n agent.previousState = 3;\n agent.posX++;\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n //if boundary exist, increase total steps\n else {\n agent.totalSteps++;\n agent.board[agent.posX][agent.posY].iAmHere = true;\n agent.holdObjectMovement();\n }\n }\n }", "private void game() throws InterruptedException\r\n\t{\r\n\t\tfor(int generation = 0; generation == generation; generation++)\t\t\r\n\t\t{\r\n\t\t\tgol.countNeighbors();\r\n\t\t\tThread.sleep(this.sleep);\r\n\t\t}\r\n\t}", "private final void finishMove( int time )\r\n {\r\n int mod = 0;\r\n switch( this.movingDirection ){\r\n case BombmanScreen.UP:\r\n mod = y % GameConfig.tileHeight;\r\n if( mod != 0 ){\r\n // target cell doesn't reached yet\r\n this.move( 0, -this.movingSpeed );\r\n if( mod == GameConfig.tileHeight / 2 )\r\n frameIndex = 2;\r\n }\r\n else{\r\n // bombman in target cell\r\n this.nextMovingDirection = BombmanScreen.UP;\r\n this.processMove( time, col, row + 1 );\r\n }\r\n break;\r\n\r\n case BombmanScreen.DOWN: // DOWN\r\n mod = y % GameConfig.tileHeight;\r\n if( mod != 0 ){\r\n // target cell doesn't reached yet\r\n this.move( 0, this.movingSpeed );\r\n if( mod == GameConfig.tileHeight / 2 )\r\n frameIndex = 5;\r\n }\r\n else{\r\n // bombman in target cell\r\n this.nextMovingDirection = BombmanScreen.DOWN;\r\n this.processMove( time, col, row - 1 );\r\n }\r\n break;\r\n\r\n case BombmanScreen.LEFT: // LEFT\r\n mod = x % GameConfig.tileWidth;\r\n if( mod != 0 ){\r\n // target cell doesn't reached yet\r\n this.move( -this.movingSpeed, 0 );\r\n if( mod == GameConfig.tileWidth / 2 )\r\n frameIndex = 8;\r\n }\r\n else{\r\n // bombman in target cell\r\n this.nextMovingDirection = BombmanScreen.LEFT;\r\n this.processMove( time, col + 1, row );\r\n }\r\n break;\r\n\r\n case BombmanScreen.RIGHT: // RIGHT\r\n mod = x % GameConfig.tileWidth;\r\n if( mod != 0 ){\r\n // target cell doesn't reached yet\r\n this.move( this.movingSpeed, 0 );\r\n if( mod == GameConfig.tileWidth / 2 )\r\n frameIndex = 11;\r\n }\r\n else{\r\n // bombman in target cell\r\n this.nextMovingDirection = BombmanScreen.RIGHT;\r\n this.processMove( time, col - 1, row );\r\n }\r\n break;\r\n }\r\n }", "private void instantDown(){\n for (int i = y;i <grid[0].length;i++){\n if (!moveDown()){\n break;\n }\n }\n }", "private void driveTillWallFound() {\n\n startUSVal = initCurrentUSSensorValue();\n\n while (true) {\n if (Thread.interrupted()) {\n BrickScreen.clearScreen();\n return;\n }\n\n regulateDirection();\n checkForColor();\n if (allColorsFound()) {\n return;\n }\n\n if (wallTouched()) {\n drive.stopMotors();\n return;\n }\n\n }\n\n }", "private void checkThread() throws InterruptedException {\n boolean flag = true;\n boolean first = false;\n while (flag) {\n Thread.sleep(50);\n //System.out.println(players.get(0).getName()+\" est en x: \"\n // +cCore.getIxCarPos()[players.get(0).getId()]+\" y: \"+cCore.getIyCarPos()[players.get(0).getId()]);\n for(int x=0;x<maxPlayers;x++){\n if(x<players.size()){\n PlayerData p = players.get(x);\n if(!cCore.getbGameInProgress()[p.getId()]){\n if(p.getScore()==0) {\n p.setScore(cCore.getScore());\n System.out.println(\"end game for: \" + p.getPseudo());\n }\n boolean[] check = cCore.getbGameInProgress();\n int nb = maxPlayers;\n for (boolean b : check) {\n if (!b) {\n nb--;\n }\n }\n //System.out.println(\"nb restants :\"+nb);\n if (nb == 0) {\n if(!first) {\n first = true;\n new Thread(() -> endgame(cCore.getsWinnerName())).start();\n System.out.println(\"game \" + name + \" is over.\");\n cCore.stop();\n flag = false;\n gameStarted = 2;\n playerID = 0;\n playersReady = 0;\n System.out.println(\"endgame close\");\n\n }\n }\n\n }\n }\n }\n\n\n }\n System.out.println(\"checkThread close\");\n }", "synchronized public void move() {\t//Synchronized so there is not multiple threads trying to move it at the same time\r\n\t\tif(destination == null || destination.equals(position)) {\r\n\t\t\tsetNewDestination();\r\n\t\t}\r\n\t\tVector2D nextPosition = getNextPosition();\r\n\t\tTile nextTile = Application.getTile(nextPosition);\r\n\t\tTile currentTile = Application.getTile(position);\r\n\t\t\r\n\t\t\r\n\t\tsynchronized(getFirst(nextPosition, position)) {\t//Lock both current position and next position according to an evaluation function (Same for everyone) -> solution to the dining philosophers\r\n\t\t\tsynchronized(getSecond(nextPosition, position)) {\r\n\t\t\t\t//We have the lock, we will try to move to this tile and set our old tile to empty\r\n\t\t\t\ttry {\r\n\t\t\t\t\tnextTile.setOccupant(this);\r\n\t\t\t\t\tposition = nextPosition;\r\n\t\t\t\t\tcurrentTile.clear();\t//This should not be a problem since no one will lock/modify a tile that is not empty\r\n\t\t\t\t\tmoveCount++;\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t//We were not able to move, unlock tile and cancel current destination\r\n\t\t\t\t\t//e.printStackTrace();\r\n\t\t\t\t\tdestination = null;\r\n\t\t\t\t}\r\n\t\t\t\t//System.out.println(Thread.currentThread().getName());\r\n\t\t\t\t//Application.printGrid();\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Here they may or may not have moved but in both case they need to wait the same amount\r\n\t\ttry {\r\n\t\t\tThread.sleep(speed*Application.k);\r\n\t\t} catch (InterruptedException e) {}\r\n\t}", "private void moveRobot(int distance, float bat) {\n\t\twhile(distance > 0) {\n\t\t\tint odo = this.getOdometerReading();\n\t\t\t//System.out.println(\"enter while\");\n\t\t\tthis.setBatteryLevel(bat + 1);\n\t\t\t//System.out.println(this.distanceToObstacle(Direction.FORWARD));\n\t\t\tif (this.distanceToObstacle(Direction.FORWARD) > 0 && batLev >= 5) {// checks to see if a move is possible\n\t\t\t\t//System.out.println(\"gets in\");\n\t\t\t\t// using the temp variable to set the battery level correctly\n\t\t\t\tthis.setBatteryLevel(bat - 5);\n\t\t\t\todometer++; // increase the odometer by 1\n\t\t\t\tcantMove = false;\n\t\t\t\t//assertFalse(this.getBatteryLevel() == bat); // this is too check that the battery is not the same after the movement\n\t\t\t\t//assertTrue(this.getBatteryLevel() == bat - 5); // this is to check that the battery is the exact level we want it to be\n\t\t\t\t//assertFalse(hasStopped());// making sure cantMove is false since the robot has not stopped\n\t\t\t\t//assertTrue(odo + 1 == this.getOdometerReading()); // making sure that the odometer is updated properly\n\t\t\t\tcontrol.keyDown(UserInput.Up, 0); // calls on the control to make the move\n\t\t\t\tdistance--;\n\t\t\t\t//System.out.println(this.isInsideRoom());\n\t\t\t\t//System.out.println(this.isAtExit());\n\t\t\t\t//System.out.println(this.distanceToObstacle(Direction.FORWARD));\n\n\t\t\t}\n\t\t\telse if (batLev < 5) {\n\t\t\t\tcantMove = true;\n\t\t\t\t//assertTrue(this.getBatteryLevel() == bat);// this is too make sure that no battery was lost due to a movement that was not possible\n\t\t\t\t//assertTrue(hasStopped());\n\t\t\t\t//assertTrue(odo == this.getOdometerReading()); // make sure the odometer was not incremented in any way\n\t\t\t\t//control.batErrorScreen();\n\t\t\t\t//batteryErrorScreen();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//this.setBatteryLevel(bat);// so the robot does not lose any battery when no move is made \n\t\t\t\tcantMove = true;\n\t\t\t\t//assertTrue(hasStopped());\n\t\t\t\t//assertTrue(odo == this.getOdometerReading());// make sure the odometer was not incremented in any way\n\t\t\t\t//assertTrue(this.getBatteryLevel() == bat); // this is too make sure that no battery was lost due to a movement that was not possible\n\t\t\t\tdistance--;\n\t\t\t}\n\t\t}\n\t}", "public int beacon(int row, int col)\n {\n int x2 = 0;\n int y2 = 0;\n\n int check = 0;\n\n switch(direction){\n\n case 'R': check = 1; break;\n case 'D': check = 2; break;\n case 'L': check = 3; break;\n case 'U': check = 4; break;\n default: break;\n }\n\n for(int x = 0; x < 4; x++)\n {\n\n int count = 0;\n if (check == 1)\n {\n x2 = x + UNIT_SIZE;\n y2 = y;\n }\n\n else if(check == 2)\n {\n x2 = x;\n y2 = y + UNIT_SIZE;\n\n }\n\n else if (check == 3)\n {\n x2 = x - UNIT_SIZE;\n y2 = y;\n\n }\n\n else if (check == 4)\n {\n\n x2 = x;\n y2 = y - UNIT_SIZE;\n\n }\n\n if(!checkCollision(x2,y2))\n {\n // check all four directions for first occurrence of any state aside from a blank tile\n if (check == 1)\n {\n for(int i = col + 1; i < n; i++)\n {\n count += 1;\n\n if(board.getBox(row,i).getState() == 'G')\n {\n return count;\n }\n\n if(board.getBox(row,i).getState() == 'P')\n return 0;\n\n }\n\n\n }\n\n else if(check == 2)\n {\n for(int i = row + 1; i < n; i++)\n {\n count += 1;\n if(board.getBox(i,col).getState() == 'G')\n return count;\n if(board.getBox(i,col).getState() == 'P')\n return 0;\n\n }\n\n }\n\n else if (check == 3)\n {\n for(int i = col - 1; i > n; i--)\n {\n count += 1;\n\n if(board.getBox(row,i).getState() == 'G')\n return count;\n if(board.getBox(row,i).getState() == 'P')\n return 0;\n\n }\n }\n\n else if (check == 4)\n {\n for(int i = row - 1; i > n; i--)\n {\n count += 1;\n if(board.getBox(i,col).getState() == 'G')\n return count;\n if(board.getBox(i,col).getState() == 'P')\n return 0;\n\n }\n\n\n }\n\n }\n\n if (check == 4)\n check = 0;\n\n\n check++;\n\n }\n\n\n return 0;\n\n\n }", "public void run() {\n\t\t\n\t\tArrayList<int[]> possibleMoves = this.possibleLocation(_opponent.getLoc(), \n\t\t\t\t_opponent.getPrevLoc(), 1);\n\t\t\tint Dist = 0;\n\t\t\tint[] target = new int[2];\n\t\t\ttarget = _main.getLoc(); \n\t\t\tint[] moveSquareCoor = new int[2];\n\t \t\tint moveSquareName = 0;\n\t\t\tfor (int i = 0; i < 1; i++) {\n\t\t\t\tDist = this.distanceBetween(possibleMoves.get(i), target);\n\t\t\t\tmoveSquareCoor = possibleMoves.get(i);\n\t\t\t\tmoveSquareName = i;\t\t\n\t \t\t}\n\t\t\t\tfor (int i = 1; i < possibleMoves.size(); i++) {\n\t\t\t\t\tint dist = this.distanceBetween(possibleMoves.get(i), target);\n\t\t\t\t\t\tif (dist > Dist) { \n\t\t\t\t\t\t\t\tDist = dist;\n\t\t\t\t\t\t\t\tmoveSquareCoor = possibleMoves.get(i);\n\t\t\t\t\t\t\t\tmoveSquareName = i;\t\t\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t//I have a directionNames list so that the movement methods in Shinobi are used\n\t\t\t//even when the Character is searching. The directionNames list is ordered corresponding \n\t\t\t//to the respected determined location\n\t\t\tswitch(_directionNames.get(moveSquareName)) {\n\t\t\t\n\t\t\tcase UP:\n\t\t\t\t_opponent.moveUp();\n\t\t\t\tbreak;\n\t\t\tcase DOWN:\n\t\t\t\t_opponent.moveDown();\n\t\t\t\tbreak;\n\t\t\tcase RIGHT:\n\t\t\t\t_opponent.moveRight();\n\t\t\t\tbreak;\n\t\t\tcase LEFT:\n\t\t\t\t_opponent.moveLeft();\n\t\t\t\tbreak;\n\t\t\tcase TOPLEFT:\n\t\t\t\t_opponent.topLeft();\n\t\t\t\tbreak;\n\t\t\tcase BOTTOMLEFT:\n\t\t\t\t_opponent.bottomLeft();\n\t\t\t\tbreak;\n\t\t\tcase TOPRIGHT:\n\t\t\t\t_opponent.topRight();\n\t\t\t\tbreak;\n\t\t\tcase BOTTOMRIGHT:\n\t\t\t\t_opponent.bottomRight();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t_directionNames.clear();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Query 1 for the customer menu
public void SearchandBuy() { ArrayList<String> CategoryList=Merchant.getCategoryList(); ArrayList<ArrayList<Item>> ItemCategoryList=Merchant.getItemCategoryList(); ArrayList<ArrayList<Integer>> MerchantIdList=Merchant.getMerchantIdList(); System.out.println("Please select category"); for(int j=0;j<CategoryList.size();j++) { System.out.println((j+1)+") "+CategoryList.get(j)); } int selection=in.nextInt(); selection=selection-1; if(selection>=CategoryList.size() && selection<0) System.out.println("Wrong category Selected"); else { int j; for( j=0;j<MerchantIdList.get(selection).size();j++) { ItemCategoryList.get(selection).get(j).display(); System.out.println(); } System.out.println(); System.out.println("Enter Item code"); int ItemCode=in.nextInt(); System.out.println("Enter Item quantity"); int quantity=in.nextInt(); for(j=0;j<MerchantIdList.get(selection).size();j++) { if(ItemCategoryList.get(selection).get(j).getUniqueCode()==ItemCode) { break; } } if(j==MerchantIdList.get(selection).size()) { System.out.println("Wrong Id chosen"); return; } Item itemtobuy=ItemCategoryList.get(selection).get(j); int MerchantId=MerchantIdList.get(selection).get(j); System.out.println("Choose method of transaction"); System.out.println("1) Buy item"); System.out.println("2) Add item to cart"); System.out.println("3) Exit"); selection=in.nextInt(); if(selection==1) { //buy item directly this.buydirectly(new BuyItem(ItemCode, quantity, itemtobuy,MerchantId)); } else if(selection==2) { //Add to cart if((itemtobuy.getOffer().toLowerCase().equals("Buy one Get One".toLowerCase()) && itemtobuy.getQuantity()<quantity) || (itemtobuy.getQuantity()<quantity)) { System.out.println("Not enough items in stock"); return; } Cart.add(new BuyItem(ItemCode,quantity,itemtobuy,MerchantId)); } else { //Exit this menu return; } } }
[ "@Override\n public void getMenuIdInside()\n {\n try\n {\n result1 = gatherResultSet(setStatement(inputQuery1,menu.getRestaurants_id(),menu.getMenu_name(), true,1,2));\n //System.out.println(result1);\n if(result1.next())\n {\n menu_id = result1.getInt(1);\n this.setMessage(\"menu found\");\n }\n else\n {\n this.setMessage(\"The menu id not found\");\n }\n }\n catch (SQLException e)\n {\n message = e.fillInStackTrace().toString();\n }\n }", "public void clickCustomerMenu() {\n menuCustomers.click();\n }", "public static void customerMenu() {\n Customer customer = (Customer) user;\n boolean logout = false;\n while(!logout) {\n System.out.println(\"====== Customer ======\");\n System.out.println(\"1- Check Shipment\");\n System.out.println(\"0- Logout\");\n int selection = sc.nextInt();\n\n int inputInt;\n boolean result = true;\n switch (selection) {\n case 1:\n System.out.print(\"Enter tracking number of the shipment: \");\n inputInt = sc.nextInt();\n\n Shipment shipment;\n shipment = customer.access.shipmentController.getByTrackingNumber(inputInt);\n if(shipment != null)\n System.out.println(shipment);\n else\n System.out.println(\"Shipment not found!\");\n break;\n case 0:\n logout = true;\n System.out.println(\"Goodbye \" + user.getUsername() + \".\");\n user = null;\n break;\n }\n\n if(result)\n System.out.println(\"Operation was successful!\\n\");\n else\n System.out.println(\"Operation was NOT successful!\\n\");\n }\n\n loginMenu();\n }", "public void customerMenu() {\n\t}", "public static void displayCustomer(String customer) {\r\n\r\n try {\r\n Connection connection = DriverManager.getConnection(\r\n \"jdbc:mysql://localhost/quickfooddb\",\r\n \"root\",\r\n \"root\");\r\n\r\n //pass connection into the menu method\r\n Statement statement = connection.createStatement();\r\n ResultSet results = statement.executeQuery(\"SELECT * FROM Customer WHERE Name='\" + customer + \"'\");\r\n\r\n ArrayList<String> user = new ArrayList<>();\r\n\r\n //print the entry of that given toy from the MySQL database\r\n while (results.next()) {\r\n\r\n user.add(results.getInt(\"CustomerID\") + \", \"\r\n + results.getString(\"Name\") + \", \"\r\n + results.getString(\"Phone\") + \", \"\r\n + results.getString(\"Street\") + \", \"\r\n + results.getString(\"Suburb\") + \", \"\r\n + results.getString(\"City\") + \"\\n\");\r\n }\r\n\r\n //close SQL connection\r\n connection.close();\r\n\r\n if (user.isEmpty()) {\r\n popUp(\"'\" + customer + \"' unfortunately doesn't exist in the Database\");\r\n } else {\r\n chooseId(user);\r\n }\r\n\r\n\r\n //error handling for connection to MySQL\r\n } catch (SQLException throwables) {\r\n throwables.printStackTrace();\r\n }\r\n }", "@GetMapping(\"/show-menu-list-customer\")\r\n\tpublic String showMenuItemListCustomer(ModelMap model) throws Exception {\r\n\t\tList<MenuItem> menuItemList = cust_serv.getMenuItemListCustomer();\r\n\t\tmodel.put(\"menuItemList\", menuItemList);\r\n\r\n\t\t// return repo.getMenuItemListCustomer();\r\n\t\treturn \"menu-item-list-customer\";\r\n\t}", "private void getSelectedCustomer() {\n List<Integer> customers = generalRepository.getActiveId(\"cust\");\n selectCustomerCombo = new UIComponents().customerComboBox(generalRepository,250,30);\n String selectedCustomer = parametersMap.get(\"customer\");\n if ((null != selectedCustomer) && (selectedCustomer.matches(\"\\\\d+\"))) {\n if (customers.contains(Integer.parseInt(selectedCustomer))) {\n selectCustomerCombo.setValue(Integer.parseInt(selectedCustomer));\n selectCustomerCombo.setEnabled(false);\n } else {\n selectCustomerCombo.setValue(0);\n }\n }\n resetSelectedSite();\n }", "public static void showCustomer() {\n bc.printAllCustomer();\n showMeny();\n\n }", "public By Accounts_Purchase_Al_Rabeh_Contextual_Menu() {\n\t\tBy ele = null;\n if(data.getData_Env().get(\"Device_Type\").equals(\"ANDROID_MOB\")) {\n// \tele = By.xpath(\"(//a[.='Purchase Al Rabeh Certificate'])[1]\");\n \tele = By.xpath(\"//div[@class='ACCOUNTS_CONTXT_SWS']//ul//a[.='Purchase Al Rabeh Certificate']\");\n \t\n }else if(data.getData_Env().get(\"Device_Type\").equals(\"IOS_MOB\")) {\n \n ele = By.xpath(\"\");\n }else if(data.getData_Env().get(\"Device_Type\").equals(\"IOS_TAB\")) {\n \n ele = By.xpath(\"\");\n }\n return ele;\n\t}", "@Override\n\tpublic MenuVO selectOne(MenuVO vo) throws Exception {\n\t\treturn sqlsession.selectOne(namespace+\".selectOne\",vo);\n\t}", "private static void printCustomerMenu(Statement stmt) throws SQLException {\r\n\t\tboolean exitRequested = false; // for the Customer Menu\r\n\t\tScanner in = new Scanner(System.in);\r\n\r\n\t\twhile (!exitRequested) {\r\n\t\t\tSystem.out.println(\"You are a customer.\\n\");\r\n\t\t\tSystem.out.println(\"What would you like to do today?\\n\"\r\n + \" 1. View top 5 rated items. \\n\" //\r\n + \" 2. View top 5 best selling items\\n\"\r\n\t\t\t\t\t+ \" 3. View my purchase history\\n\"\r\n + \" 4. Buy items\\n\"\r\n\t\t\t\t\t+ \" 5. Cancel a transaction\\n\"\r\n + \" 6. Logout (customer logout)\\n\");\r\n\t\t\tint customerOption = in.nextInt();\r\n\r\n\t\t\tswitch (customerOption) {\r\n\t\t\tcase 1:\r\n\t\t\t\tfunctionRequirement10(stmt);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tfunctionRequirement14(stmt);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tfunctionRequirement17(stmt);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t buyItem(stmt);\r\n\t\t\t break;\r\n\t\t\tcase 5:\r\n\t\t\t \tfunctionRequirement15(stmt);\r\n\t\t\tcase 6:\r\n\t\t\t\texitRequested = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@When(\"^User clicks the Customers option under Customer menu$\")\n\tpublic void user_clicks_the_Customers_option_under_Customer_menu() throws Throwable {\n\t try\n\t {\n\t \tdriver.findElement(By.xpath(\"//li[@id = 'menu-customer']\")).click();\n\t \tThread.sleep(1000);\n\t \tdriver.findElement(By.xpath(\"//li[@id = 'menu-customer']/ul/li/a[contains(text(),'Customers')]\")).click();\n\t }\n\t catch(Exception e)\n\t {\n\t \tSystem.out.println(\"Not able to click customer option\");\n\t \tSystem.out.println(e);\n\t \tAssert.fail();\n\t }\n\t}", "static void customerSubmenu() {\n\t\tSystem.out.println(\"1. Open an account\");\n\t\tSystem.out.println(\"2. Get total balances\");\n\t\tSystem.out.println(\"3. Change Address\");\n\t\tSystem.out.println(\"4. Close a account\");\n\t\tSystem.out.println(\"5. Get account balance\");\n\t\tSystem.out.println(\"6. Main menu\");\n\t}", "@Override\n public Customers find(Customers admin) {\n return getCurrentSession().find(Customers.class, admin.getCustomerId());\n }", "public List<MenuItem> getMenuItemsCustomer() {\n\t\treturn menuItemDao.getMenuItemListCustomer();\n\t}", "public void searchCreatedCustomer(String name, int index){\n Reporter.log(\"Select recently created customer to open account \"+ selectCustomer + \"<br>\");\n clickOnElement(selectCustomer);\n implicitWait(10);\n selectByIndexFromDropDown(selectCustomer,index);\n }", "public Customer viewSingleCustomer(int customerId) {\r\n\t\tString[][] list = QMCustomer.viewAllCustomers(database);\r\n\t\t\r\n\t\tfor(int i=0; i<list.length; i++){\r\n\t\t\tif (t.stringToInt(list[i][9])==1){\r\n\t\t\t\tint dbCustomerId = t.stringToInt(list[i][0]);\r\n\t\t\t\tif(customerId==dbCustomerId){\r\n\t\t\t\t\tint zipCode = t.stringToInt(list[i][6]);\r\n\t\t\t\t\tint zoneNr = t.stringToInt(list[i][7]);\r\n\t\t\t\t\treturn new Customer(customerId, list[i][2],list[i][1],list[i][3],list[i][4],list[i][5],zipCode,zoneNr,list[i][8],true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\r\n\tpublic List<Customerinfo> selectNo() {\n\t\tList<Customerinfo> list=customerdao.findAll();\r\n\t\treturn list;\r\n\t}", "private void cListAllCustomers(String instruction){\n String[][] cust = customers.getList();\n int choice = this.vListAllCustomers(cust, instruction);\n while(choice != -1){\n cCustomerDetail(Integer.parseInt(cust[choice][1]));\n choice = this.vListAllCustomers(cust, instruction);\n }\n \n }", "public Menu findByName(String name) {\r\n\t\treturn (Menu) this\r\n\t\t\t\t.getEntityManager()\r\n\t\t\t\t.createNamedQuery(Menu.NQ_FIND_BY_NAME)\r\n\t\t\t\t.setParameter(\"clientId\",\r\n\t\t\t\t\t\tSession.user.get().getClient().getId())\r\n\t\t\t\t.setParameter(\"name\", name).getSingleResult();\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an instance of DonationResponse given an JSON string
public static DonationResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DonationResponse.class); }
[ "public static PaymentVerificationResponse fromJson(String jsonString) throws JsonProcessingException {\n return JSON.getMapper().readValue(jsonString, PaymentVerificationResponse.class);\n }", "private RequestResponse createResponse(JSONObject o) {\r\n\t\treturn new RequestResponse(o.toJSONString());\r\n\t}", "private static DeductionRatesReportResponse createResponse() {\n\t\tDeductionRatesReportResponse response = new DeductionRatesReportResponse();\n\t\tHashMap<String, List<DeductionRatesReportResponseItem>> items = new HashMap<String, List<DeductionRatesReportResponseItem>>();\n\t\tArrayList<DeductionRatesReportResponseItem> rateItems1 = new ArrayList<DeductionRatesReportResponseItem>();\n\t\trateItems1.add(createItem());\n\t\trateItems1.add(createItem());\n\t\titems.put(\"Job 1\", rateItems1);\n\t\tArrayList<DeductionRatesReportResponseItem> rateItems2 = new ArrayList<DeductionRatesReportResponseItem>();\n\t\trateItems2.add(createItem());\n\t\trateItems2.add(createItem());\n\t\titems.put(\"Job 2\", rateItems2);\n\t\tresponse.setItems(items);\n\t\tresponse.setReportName(\"Service Credit Deduction Rates\");\n\t\tresponse.setReportGenerationDate(new Date());\n\t\treturn response;\n\t}", "protected <T> T fromJSON(final Response response, final Class<T> type) {\n return MarshallingWrapper.fromJSON(response.getText(), type);\n }", "public static Object decodeResponse(String responseJSON, Class<?> returnType) {\n return gson.fromJson(responseJSON, returnType);\n }", "public static RespArticles buildRespPOJO(String prettyJsonString) {\n\t\tGson gson = new Gson();\n\t\tRespArticles resp = gson.fromJson(prettyJsonString, RespArticles.class);\n\t\treturn resp;\n\t}", "public static AlipayUserAgreementTransferResponseModel fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, AlipayUserAgreementTransferResponseModel.class);\n }", "public PersonResponse(Person person){\n personID = person.getId();\n descendant = person.getDescendant();\n firstName = person.getFirstName();\n lastName = person.getLastName();\n gender = person.getGender();\n father = person.getFather();\n mother = person.getMother();\n spouse = person.getSpouse();\n\n }", "public static TakObject createFromJSON(String jsonStr) {\n Log.d(\"debug\",\"tak jsonStr=\"+jsonStr);\n TakObject takO = new TakObject();\n try {\n JSONObject tak = new JSONObject(jsonStr);\n\n // Get name, id, lat, and lng\n takO.setName(tak.getString(\"name\"));\n takO.setID(new TakID(tak.getString(\"id\")));\n takO.setLat(Double.parseDouble(tak.getString(\"lat\")));\n takO.setLng(Double.parseDouble(tak.getString(\"lng\")));\n\n // Get metadata by iterating over metadata array and creating the map\n JSONArray metadataArray = tak.getJSONArray(\"metadata\");\n Map<String, TakMetadata> metadata = new HashMap<String, TakMetadata>();\n for (int k = 0; k < metadataArray.length(); k++) {\n TakMetadata m = TakMetadata.createFromJSON(metadataArray.getJSONObject(k).toString());\n metadata.put(m.getKey(), m);\n }\n takO.setMetadata(metadata);\n\n } catch (JSONException e) {\n Log.d(MainActivity.LOG_TAG, \"TakObject.createFromJSON: Error in parsing JSON.\");\n e.printStackTrace();\n }\n\n return takO;\n }", "@Override\n\tprotected BaseResponse parseResponse(String content) {\n\t\tResponse customerModify = new Response();\n\n\t\ttry {\n\t\t\tJSONObject jsonObj = new JSONObject(content);\n\t\t\tcustomerModify.responseType = jsonObj.getString(JSON_RESPONSE_TYPE);\n\t\t\tcustomerModify.errorMessage = jsonObj.getString(JSON_ERROR_MESSAGE);\n\t\t\tcustomerModify.okey = true;\n\n\t\t\tcustomerModify.customerId = jsonObj.getInt(JSON_CUSTOMER_ID);\n\n\t\t} catch (JSONException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn customerModify;\n\t}", "@Override\n\tpublic JavaCommonResponse getOutputResponse(String json) {\n\t\tBuildRedBagResponse rs = new BuildRedBagResponse();\n\t\trs = JacksonUtil.readValue(json, BuildRedBagResponse.class);\n\t\treturn rs;\n\t}", "@Override\n public String convertJSONToData(String response) {\n return response;\n }", "public void testJsonConstructor () {\n \tJSONObject commandJson = JsonFileReader.readId(this.mContext, getCommandType(), getMessageType());\n \tassertNotNull(Test.NOT_NULL, commandJson);\n \t\n\t\ttry {\n\t\t\tHashtable<String, Object> hash = JsonRPCMarshaller.deserializeJSONObject(commandJson);\n\t\t\tReadDIDResponse cmd = new ReadDIDResponse(hash);\n\t\t\t\n\t\t\tJSONObject body = JsonUtils.readJsonObjectFromJsonObject(commandJson, getMessageType());\n\t\t\tassertNotNull(Test.NOT_NULL, body);\n\t\t\t\n\t\t\t// Test everything in the json body.\n\t\t\tassertEquals(Test.MATCH, JsonUtils.readStringFromJsonObject(body, RPCMessage.KEY_FUNCTION_NAME), cmd.getFunctionName());\n\t\t\tassertEquals(Test.MATCH, JsonUtils.readIntegerFromJsonObject(body, RPCMessage.KEY_CORRELATION_ID), cmd.getCorrelationID());\n\n\t\t\tJSONObject parameters = JsonUtils.readJsonObjectFromJsonObject(body, RPCMessage.KEY_PARAMETERS);\n\t\t\t\n\t\t\tJSONArray didResultArray = JsonUtils.readJsonArrayFromJsonObject(parameters, ReadDIDResponse.KEY_DID_RESULT);\n\t\t\tList<DIDResult> didResultList = new ArrayList<DIDResult>();\n\t\t\tfor (int index = 0; index < didResultArray.length(); index++) {\n\t\t\t\tDIDResult chunk = new DIDResult(JsonRPCMarshaller.deserializeJSONObject( (JSONObject)didResultArray.get(index)) );\n\t\t\t\tdidResultList.add(chunk);\n\t\t\t}\n\t\t\tassertTrue(Test.MATCH, Validator.validateDIDResults(didResultList, cmd.getDidResult()));\n\t\t} catch (JSONException e) {\n\t\t\te.printStackTrace();\n\t\t} \t\n }", "public static ConsentDetails fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, ConsentDetails.class);\n }", "private static RateData createRateData(String jsonString) {\n JSONObject obj = new JSONObject(jsonString);\n String date = obj.getString(\"date\");\n Double rate = obj.getJSONObject(\"rates\").getDouble(\"USD\");\n return new RateData(date, rate);\n }", "private Response populateResponseForBicycle() {\n\t\tResponse expectedResponse = new Response();\n\t\texpectedResponse.setBicyle(1);\n\t\texpectedResponse.setBigwheel(0);\n\t\texpectedResponse.setCar(0);\n\t\texpectedResponse.setHangGlider(0);\n\t\texpectedResponse.setMotorCyle(0);\n\t\tList<VehicleInfo> vehInfoList = new ArrayList<VehicleInfo>();\n\t\tVehicleInfo vehInfo1 = new VehicleInfo(\"vehicle 2\",\"Bicycle\");\n\t\tvehInfoList.add(vehInfo1);\n\t\texpectedResponse.setVehicleInfo(vehInfoList);\n\t\treturn expectedResponse;\n\t}", "public static IndirectLegalPersonInfo fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, IndirectLegalPersonInfo.class);\n }", "public static Mandate fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, Mandate.class);\n }", "@Override\n public NotificationMessageResponse convertJSONToData(String response) {\n return JSONParser.getNotificationMessagesResponse(response);\n }", "protected ApiResponse parseResponse(HttpResponse response, Class<?> c) throws IOException {\n ApiResponse res = null;\n InputStream in = response.getContent();\n\n if (in == null) {\n try {\n res = (ApiResponse)c.newInstance();\n } catch(ReflectiveOperationException e) {\n throw new RuntimeException(\"Cannot instantiate \" + c, e);\n }\n } else {\n try {\n JsonParser jsonParser = GsonFactory.getDefaultInstance().createJsonParser(in);\n res = (ApiResponse)jsonParser.parse(c);\n } finally {\n in.close();\n }\n }\n\n res.setHttpRequest(response.getRequest());\n res.setHttpResponse(response);\n\n return res;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensure the death occurred in the correct world
@EventHandler public void onEntityDeath(EntityDeathEvent event) { if (!event.getEntity().getWorld().getName().equals(this.getWorldName())) { return; } //Ensure the entity was a monster if (!(event.getEntity() instanceof Monster)) { return; } //Ensure the mob had a killer Monster mob = (Monster)event.getEntity(); if (mob.getKiller() == null) { return; } //Ensure the killer and entity are both in the data store Player player = mob.getKiller(); if (!dataStore.containsPlayer(player.getName()) || !dataStore.containsMob(mob.getEntityId())) { return; } //Fetch information from data store ZomboPlayerInfo playerInfo = dataStore.getPlayerByName(player.getName()); ZomboMobInfo entityInfo = dataStore.getMobById(mob.getEntityId()); //Update player information playerInfo.addKill(entityInfo.getType()); playerInfo.addXp(entityInfo.getXp()); dataStore.putPlayer(player.getName(), playerInfo); //Send message to the player mob.getKiller().sendMessage("Killed a " + mob.getType().getName() + " [+" + entityInfo.getXp() + " XP]"); //Disable vanilla drops event.setDroppedExp(0); event.getDrops().clear(); //Drop crafting items ArrayList<ZomboDropInfo> mobDrops = dataStore.getDropsByType(mob.getType()); Random rand = new Random(); if (mobDrops != null && !mobDrops.isEmpty()) { for (ZomboDropInfo dropInfo : mobDrops) { if (dropInfo.canDrop(rand)) { event.getDrops().add(new ItemStack(dropInfo.getType(), dropInfo.getAmount())); } } } //Stop tracking mob dataStore.removeMob(mob.getEntityId()); //If no mobs are left, advance to the next wave if (dataStore.getMobs().isEmpty()) { if (wave == 5) { //Give XP bonus to online players for (String playerName : dataStore.getPlayers().keySet()) { Player msgPlayer = getServer().getPlayerExact(playerName); ZomboPlayerInfo msgPlayerInfo = dataStore.getPlayerByName(playerName); if (msgPlayer == null) { continue; } msgPlayerInfo.addXp(roundXpBonus); msgPlayer.sendMessage("Round complete bonus! [+" + + roundXpBonus + " XP]"); } } if (this.isAutoAdvance()) { advanceWave(); } else { //Tell players to ready up messagePlayers("Wave complete! /zready to continue."); } } else if (dataStore.getMobs().size() <= 3) { //Tell players that the wave is almost over messagePlayers(dataStore.getMobs().size() + " mobs remaining"); } }
[ "public void deathCheck(){\n if (boxman.ceiling && boxman.grounded){\n boxman.dead = true;\n }\n else {\n boxman.ceiling = false;\n boxman.grounded = false;\n }\n }", "void checkDeath();", "void death();", "public void death() {\n disablePowerUpsOnDeath();\n this.visible = false;\n decrementLivesRemaining();\n this.deltaX = 0;\n this.deltaY = 0;\n }", "private void checkForDeath(){\n\t Iterator<Entity> iterator = players.iterator();\n\t boolean dead = false;\n\t Entity head = iterator.next();\n\t while (iterator.hasNext()&&!dead){\n\t\t Entity next = iterator.next();\n\t\t if (next.getTranslationX()==head.getTranslationX()&&next.getTranslationY()==head.getTranslationY()) dead=true;\n\t }\n\t if (dead) {\n\t\t gameState=GameState.GAME_OVER;\n\t\t textsLayer.setVisible(true);\n\t }\n }", "@Override\n\tpublic void eventOnDeath() {\n\t\tSystem.out.println(\"In case of death: \");\n\t}", "public void setDeath() {\n\t\tstate = State.DEATH;\n\t}", "@Override\r\n\tpublic void onDeath() {\n\t\tVector direction = loc.getDirection();\r\n\t\tdirection.setY(0);\r\n\t\tcaster.setVelocity(direction);\r\n\t\t\r\n\t\tLocation locate = caster.getEyeLocation();\r\n\t\tlocate.setY(locate.getY()-0.5);\r\n\t\t\r\n\t\t\r\n\t\tParUtils.parKreisDot(Particles.CLOUD, locate, 0.3, 0.0, 0.2, direction.multiply(-1));\r\n\t\t\r\n\t\t\r\n\t\tParUtils.parKreisDot(Particles.CLOUD, caster.getLocation(), 3, 0, 3, caster.getVelocity());\r\n\t\tif (refined) {\r\n\t\t\t\r\n\t\t\tnew ExplosionDamage(5, 5, caster, caster.getLocation(), name);\r\n\t\t\tnew RepulsionDirectional(5, 7, caster, caster.getLocation(), caster.getVelocity(), name);\r\n\t\t\tParUtils.parKreisDirSolid(Particles.CLOUD, caster.getLocation(), 3, 0, 1, caster.getVelocity(), caster.getVelocity());\r\n\t\t\t\r\n\t\t\tParUtils.parKreisDot(Particles.CLOUD, caster.getLocation(), 3, 0, 2, caster.getVelocity());\r\n\t\t\tParUtils.parKreisDot(Particles.CLOUD, caster.getLocation(), 3, 0, 1, caster.getVelocity());\r\n\t\t\tplaySound(Sound.ENTITY_WITCH_DEATH,caster.getLocation(),5,0.5F);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnew ExplosionDamage(5, 3, caster, caster.getLocation(), name);\r\n\t\t\tnew RepulsionDirectional(5, 3, caster, caster.getLocation(), caster.getVelocity(), name);\r\n\t\t}\r\n\t\tplaySound(Sound.ENTITY_DRAGON_FIREBALL_EXPLODE, loc, 1, 1);\r\n\t\t\r\n\t\tif (caster.isSneaking()) {\r\n\t\t\tcaster.setVelocity(caster.getLocation().getDirection().multiply(-1.7F));\r\n\t\t}\r\n\t\t\r\n\t}", "public void closerToDeath()\n {\n timeToLive--;\n }", "public void onDeath()\n\t{\n\t\t\n\t}", "protected abstract void deathblow(Creature opponent);", "@Override\r\n\tpublic void onDeath() {\n\t\r\n\t}", "private void endGameInDeath(String causeOfDeath) {\n removeListeners();\n paused = true;\n running = false;\n\n startPanel.remove(startLabel);\n startPanel.remove(highScoreLabel);\n startPanel.remove(howToPlayLabel);\n mainPanel.add(startPanel, JLayeredPane.MODAL_LAYER, Integer.valueOf(1));\n\n causeOfDeathLabel.setText(\"CAUSE OF DEATH: \" + causeOfDeath);\n\n GridBagConstraints c = new GridBagConstraints();\n c.ipady = 10;\n startPanel.add(gameOverLabel, c);\n c.gridy = 1;\n startPanel.add(causeOfDeathLabel, c);\n c.gridy = 2;\n startPanel.add(restartLabel, c);\n\n mainPanel.validate();\n mainPanel.repaint();\n }", "public void notifyDeath(){\n\t\tmessage = \"You have died! You just got blob-pied!\";\n\t\twaitingForStartButton = true;\n\t\tendGame = true;\n\t\tlose = true;\n\t\tentities.clear();\n\t\t//music();\n\n\t}", "public void onDeath(DeathEvent e) {\n\t\treward = -3;\n\t\tupdateStates();\n\t\tout.println(\"deadedadead\");\n\t}", "public void onDeath() {}", "public void onDeath()\n\t{\n\t}", "public void onDeath() {\n String message = String.format(\"%s died!\", user.getUsername());\n GameMove gameMove = new GameMove(this, null, null, GameMoveAction.DEATH, message);\n table.addGameMove(gameMove);\n\n Deck discardPile = table.getDiscardPile();\n // remove hand cards\n discardPile.addCards(hand.getPlayCards());\n hand.removeAllCards();\n // remove onFieldCards\n for (PlayCard card : onFieldCards.getOnFieldCards()) {\n discardPile.addCard(card);\n }\n\n onFieldCards.removeAllCards();\n determineWinner();\n if (table.getPlayerOnTurn().getId().equals(this.id)) {\n Player nextPlayer = rightNeighbor;\n while (nextPlayer.getBullets() == 0 && !nextPlayer.getId().equals(id)) {\n nextPlayer = nextPlayer.getRightNeighbor();\n\n }\n table.setPlayerOnTurn(nextPlayer);\n }\n }", "public static void worldTimeStep() {\n\t\tfor (Critter c : population) {\n\t\t\tc.doTimeStep();\n\t\t}\n\t\tdoEncounters();\n\t\tupdateRestEnergy();\n\t\tgenAlgae();\n\t\tpopulation.addAll(babies);\n\t\tbabies.clear();\n\t\tresetHasMoved();\n\n\t\tint i = 0;\n\t\twhile (i < population.size()) {\n\t\t\tif (population.get(i).energy <= 0) {\n//\t\t\t\tSystem.out.println(\"dead: \" +population.get(i) + \"coord \" + population.get(i).x_coord +\":\"+ population.get(i).y_coord);\n\t\t\t\tpopulation.remove(i);\n\t\t\t}\n\t\t\telse {\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\n\t\t// Complete this method.\n\t}", "@Override\n public int getDeathTime() {\n return 0;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies the Heckbert's mediancut algorithm to partition the color space into maxcubes cubes. The centroids of each cube are are used to create a color table.
public void medianCut(int expectedColorNum) { int k; int num, width; Cube cubeA, cubeB; // Creates the first color cube partition = new Cube[expectedColorNum]; int numCubes = 0; Cube cube = new Cube(); int numColors = 0; for (int i=0; i < histogramSize; i++) { if (counts[i] != 0) { numColors++; cube.count = cube.count + counts[i]; } } cube.lower = 0; cube.upper = numColors-1; cube.level = 0; shrinkCube(cube); partition[numCubes++] = cube; //Partition the cubes until the expected number of cubes are reached, or // cannot further partition while (numCubes < expectedColorNum) { // Search the list of cubes for next cube to split, the lowest level cube int level = 255; int splitableCube = -1; for (k=0; k < numCubes; k++) { if (partition[k].lower != partition[k].upper && partition[k].level < level) { level = partition[k].level; splitableCube = k; } } // no more cubes to split if (splitableCube == -1) break; // Find longest dimension of this cube: 0 - red, 1 - green, 2 - blue cube = partition[splitableCube]; level = cube.level; // Weigted with luminosities int lr = 77 * (cube.rmax - cube.rmin); int lg = 150 * (cube.gmax - cube.gmin); int lb = 29 * (cube.bmax - cube.bmin); int longDimMask = 0; if (lr >= lg && lr >= lb) longDimMask = 0xFF0000; if (lg >= lr && lg >= lb) longDimMask = 0xFF00; if (lb >= lr && lb >= lg) longDimMask = 0xFF; // Sort along "longdim" quickSort(colors, cube.lower, cube.upper, longDimMask); // Find median int count = 0; int median = cube.lower; for (; median <= cube.upper - 1; median++) { if (count >= cube.count/2) break; count = count + counts[median]; } // Now split "cube" at the median and add the two new // cubes to the list of cubes. cubeA = new Cube(); cubeA.lower = cube.lower; cubeA.upper = median-1; cubeA.count = count; cubeA.level = cube.level + 1; shrinkCube(cubeA); partition[splitableCube] = cubeA; // add in old slot cubeB = new Cube(); cubeB.lower = median; cubeB.upper = cube.upper; cubeB.count = cube.count - count; cubeB.level = cube.level + 1; shrinkCube(cubeB); partition[numCubes++] = cubeB; // add in new slot */ } // creates the lookup table and the inverse mapping createLUT(numCubes); }
[ "Cube splitChannel(int splitChannel, int c0, int c1) {\n/* 294 */ if (this.min[splitChannel] == this.max[splitChannel])\n/* */ {\n/* 296 */ return null;\n/* */ }\n/* */ \n/* 299 */ if (this.count == 0)\n/* */ {\n/* 301 */ return null;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 306 */ int half = this.count / 2;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 311 */ int[] counts = computeCounts(splitChannel, c0, c1);\n/* */ \n/* 313 */ int tcount = 0;\n/* 314 */ int lastAdd = -1;\n/* */ \n/* */ \n/* */ \n/* */ \n/* 319 */ int splitLo = this.min[splitChannel];\n/* 320 */ int splitHi = this.max[splitChannel];\n/* 321 */ for (int i = this.min[splitChannel]; i <= this.max[splitChannel]; i++) {\n/* 322 */ int c = counts[i];\n/* 323 */ if (c == 0) {\n/* */ \n/* 325 */ if (tcount == 0 && i < this.max[splitChannel]) {\n/* 326 */ this.min[splitChannel] = i + 1;\n/* */ \n/* */ }\n/* */ }\n/* 330 */ else if (tcount + c < half) {\n/* 331 */ lastAdd = i;\n/* 332 */ tcount += c;\n/* */ } else {\n/* */ \n/* 335 */ if (half - tcount <= tcount + c - half) {\n/* */ \n/* 337 */ if (lastAdd == -1) {\n/* */ \n/* 339 */ if (c == this.count) {\n/* */ \n/* */ \n/* 342 */ this.max[splitChannel] = i;\n/* 343 */ return null;\n/* */ } \n/* */ \n/* */ \n/* 347 */ splitLo = i;\n/* 348 */ splitHi = i + 1;\n/* 349 */ tcount += c;\n/* */ \n/* */ break;\n/* */ } \n/* 353 */ splitLo = lastAdd;\n/* 354 */ splitHi = i; break;\n/* */ } \n/* 356 */ if (i == this.max[splitChannel]) {\n/* 357 */ if (c == this.count)\n/* */ {\n/* */ \n/* 360 */ return null;\n/* */ }\n/* */ \n/* */ \n/* 364 */ splitLo = lastAdd;\n/* 365 */ splitHi = i;\n/* */ \n/* */ break;\n/* */ } \n/* */ \n/* 370 */ tcount += c;\n/* 371 */ splitLo = i;\n/* 372 */ splitHi = i + 1;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ break;\n/* */ } \n/* */ } \n/* */ \n/* */ \n/* */ \n/* 383 */ Cube ret = new Cube(this.colors, tcount);\n/* 384 */ this.count -= tcount;\n/* 385 */ ret.min[splitChannel] = this.min[splitChannel];\n/* 386 */ ret.max[splitChannel] = splitLo;\n/* 387 */ this.min[splitChannel] = splitHi;\n/* */ \n/* */ \n/* */ \n/* 391 */ ret.min[c0] = this.min[c0];\n/* 392 */ ret.max[c0] = this.max[c0];\n/* 393 */ ret.min[c1] = this.min[c1];\n/* 394 */ ret.max[c1] = this.max[c1];\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 408 */ normalize(splitChannel, counts);\n/* 409 */ ret.normalize(splitChannel, counts);\n/* */ \n/* 411 */ return ret;\n/* */ }", "ThreeDBox [] split(ThreeDBox box){\n\n int channel = biggestSide(box);//Bestimmt laengste Seite\n int depth = box.getDepth();\n\n AdvColor[] Colors = box.getColors();\n int sum = 0;\n\n for(int i = 0; i < Colors.length; i++ ){//Bestimmt Mittelwert der laengsten Kante\n AdvColor color = Colors[i];\n if(channel == 0){\n sum += color.getRed();\n }\n else if(channel == 1){\n sum += color.getGreen();\n }\n else{\n sum += color.getBlue();\n }\n\n }\n\n\n int median = sum / Colors.length;\n\n HashMap boxone = new HashMap();\n HashMap boxtwo = new HashMap();\n int val;\n\n for(int i = 0; i < Colors.length; i++){//Baut neue Boxen\n\n AdvColor color = Colors[i];\n\n if(channel == 0){//Benutzt laengste Seite\n val = color.getRed();\n }\n else if(channel == 1){\n val = color.getGreen();\n }\n else{\n val = color.getBlue();\n }\n\n if(val < median){//Prueft ob Wert in linker oder rechter Haelfte liegt\n boxone.put(color.getRGB(),color);\n }else{\n boxtwo.put(color.getRGB(),color);\n }\n }\n\n ThreeDBox [] boxes = new ThreeDBox[2];//Gibt beide Boxen zurueck\n boxes[0] = new ThreeDBox(depth + 1, boxone); //the 'level' has increased\n boxes[1] = new ThreeDBox(depth + 1, boxtwo);\n\n return boxes;\n\n }", "public int getL2EdgeCubeFromBottom(){\n int[] posn=new int[] {18,20,22,24};\n String[] centerFaces=new String[]{\"yellow\",\"orange\",\"white\",\"red\"};\n for(int currentPosn:posn){\n cubbis cube=new cubbis();\n cube=currentarray.get(currentPosn);\n// List<String> faces=Arrays.asList(cube.getfaces());\n List<String> faces = new LinkedList<String>(Arrays.asList(cube.getfaces()));\n if(!faces.contains(\"blue\")){\n faces.remove(5);\n for(int i=0;i<centerFaces.length;i++){\n String color=centerFaces[i];\n if(faces.contains(color)){\n int index=faces.indexOf(color);\n if(i==0 && index==1){ //yellow in left face\n domove(11);\n takeCubeL2(18);\n }else if(i==0 && index==2){ //yellow in right faces\n domove(12);\n takeCubeL2(18);\n }else if(i==0 && index==3){ //yellow in front faces\n domove(11);\n domove(11);\n takeCubeL2(18);\n }else if(i==0 && index==4){ //yellow in back faces\n takeCubeL2(18);\n }else if(i==1 && index==1){ //orange in left faces\n domove(11);\n domove(11);\n takeCubeL2(22);\n }else if(i==1 && index==3){ //orange in front faces\n domove(12);\n takeCubeL2(22);\n }else if(i==1 && index==4){\n domove(11);\n takeCubeL2(22);\n }else if(i==1 && index==2){ //orange in right faces\n takeCubeL2(22);\n }else if(i==2 && index==1){\n domove(12);\n takeCubeL2(24);\n }else if(i==2 && index==2){\n domove(11);\n takeCubeL2(24);\n }else if(i==2 && index==4){\n domove(11);\n domove(11);\n takeCubeL2(24);\n }else if(i==2 && index==3){ //white in front faces\n takeCubeL2(24);\n }else if(i==3 && index==2){\n domove(11);\n domove(11);\n takeCubeL2(20);\n }else if(i==3 && index==3){\n domove(11);\n takeCubeL2(20);\n }else if(i==3 && index==4){\n domove(12);\n takeCubeL2(20);\n }else if(i==3 && index==1){ //red in left faces\n takeCubeL2(20);\n }\n }\n }\n \n }\n }\n return 0;\n }", "private void rebuildClusters() {\n\t\tclusters = new Cluster[this.image.getNumOfClusters()];\n\t\t\n\t\t//[O(p) : p for # of pixels] time complexity, since iterating through all pixels\n\t\tfor (int i = 0; i < this.image.getPixelsHeight(); i++) {\n\t\t\tfor (int j = 0; j < this.image.getPixelsWidth(); j++) {\n\t\t\t\tint clusterIndex = this.image.getCluster()[i][j];\n\t\t\t\t\n\t\t\t\tif (clusters[clusterIndex] == null) {\n\t\t\t\t\tclusters[clusterIndex] = new Cluster(image);\n\t\t\t\t}\n\t\t\t\t// the order is switched because the x coordinate is i (width iteration) \n\t\t\t\t//and the y coordinate is j (height iteration)\n\t\t\t\tclusters[clusterIndex].addPoint(new Point(j, i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//[O(p*c) p for # of pixels and c for # of clusters] time complexity\n\t\tfor (int i = 0; i < clusters.length; i++) {\n\t\t\tif (clusters[i] == null)\n\t\t\t\tcontinue;\n\t\t\tclusters[i].updateCentroid();\n\t\t}\n\t}", "@Override\n\tpublic ArrayList<Centroid> chooseCentroids(int variant, IntArrayList dataset,int k, double cliqueAverage)\n\t\n\t{\n\t\n\t\n\t\tSystem.out.println(\"=========================================\");\n\t\tSystem.out.println(\" \" + getName());\n\t\tSystem.out.println(\"=========================================\");\n\n\t\tArrayList<Centroid> chosenCentroids = new ArrayList<Centroid>(k); \n\t\tIntArrayList allCentroids = new IntArrayList();\t\t // All distinct chosen centroids \n\t\tint totalPoints\t\t = dataset.size();\t\t\t// All users\n\t\tint seedID\t\t \t = 0;\t\t\t\t\t\t// Centroid\n\t\tfor(int p = 0; p < k; p++) \t\t\t\t\t//for total number of clusters \n\t\t{\n\t\t\n\t\t// Finding the \"Average pairwise Euclidean distance\" (d1)\n\t\tdouble d1 = 0;\n\t\tfor (int i=0;i<totalPoints-1;i++) {\n\t\t\tint user1 = i;\n\t\t\t\tfor (int j=i+1;j<totalPoints;j++) {\n\t\t\t\t\tint user2 = j;\n\t\t\t\t\td1 += findEucledianDistanceBetweenTwoEntities (user1, user2, true);\t\t\n\t\t\t}\n\t\t}\n\t\t// Avg pair wise Eucleadian distance\n\t\td1 = d1/(totalPoints * (totalPoints-1));\n\t\t\n\t\t// Choose the seeds\n\t\tOpenIntIntHashMap uidToDensityCount = new OpenIntIntHashMap();\n\t\tint user1 = 0;\n\t\tint user2 = 0;\n\t\tint count = 0;\n\t\t\t\n\t\t// The Ūrst seed is chosen as the point xi with the largest number of points within\n\t\t// a multidimensional sphere with radius d1 that is centered at xi \n\t\tfor(int i=0;i<totalPoints; i++) {\n\t\t\tuser1 = i;\n\t\t\tcount = 0;\n\t\t\t\n\t\t\tfor (int j=0;j<totalPoints;j++) {\n\t\t\t\tuser2 = j;\n\t\t\t\n\t\t\t\tif(i!=j) {\n\t\t\t\t\tdouble d = findEucledianDistanceBetweenTwoEntities (user1, user2, true);\n\t\t\t\t\tif (d <= d1) {\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // end of counting density for one user\n\t\t\t\n\t\t\tuidToDensityCount.put(user1, count);\t\t\n\t\t}\n\t\t\n\t\t// Sort weights in ascending order (So first element has the lowest density)\t\n\t\tIntArrayList myCandidateSeeds\t = uidToDensityCount.keys();\n\t\tIntArrayList myCandidateDensity = uidToDensityCount.values();\n\t\tuidToDensityCount.pairsSortedByValue(myCandidateSeeds, myCandidateDensity);\n\n\t\tint totalPossibleC = myCandidateSeeds.size();\n//\t\tchosenCentroids = addCentroids (allCentroids, \n//\t\t\t\t\t\t\t\t\t\tmyCandidateSeeds, \n//\t\t\t\t\t\t\t\t\t\tchosenCentroids, \n//\t\t\t\t\t\t\t\t\t\ttotalPossibleC, \n//\t\t\t\t\t\t\t\t\t\td1, \n//\t\t\t\t\t\t\t\t\t\tk,\n//\t\t\t\t\t\t\t\t\t\ttrue); // do we need to check condition\n//\t\t\t System.out.println(\"userssss\" + totalPossibleC);\n\t\t\n\t\t// Check if all K centroids have been chosen\n\t\t// if not, DONT check the condition and add the candidate \n\t\t// centroids into the chosen ones until all k centroids are found\n\t\tif(chosenCentroids.size() < k) {\t\t\n\t\t\tchosenCentroids = addCentroids (allCentroids, \n\t\t\t\t\t\t\t myCandidateSeeds, \n\t\t\t\t\t\t\t chosenCentroids, \n\t\t\t\t\t\t\t totalPossibleC, \n\t\t\t\t\t\t\t d1, \n\t\t\t\t\t\t\t k); // do we need to check condition\n\n\t\t} //end if\n\t\t}\n\t\tSystem.out.println(\"Size of the cluster is = \"+ chosenCentroids.size());\n\t\treturn chosenCentroids;\n\n\t}", "public void takeCornerCubeVerticallyUp(int c){\n if(c!=100){\n cubbis cube=new cubbis();\n cube=currentarray.get(c);\n List<String> faces=Arrays.asList(cube.getfaces());\n if(c==17){\n if(faces.indexOf(\"green\")==4){\n domove(11);\n domove(5);\n domove(12);\n domove(6);\n }else if(faces.indexOf(\"green\")==1){\n domove(12);\n domove(10);\n domove(11);\n domove(9);\n }\n }else if(c==19){\n if(faces.indexOf(\"green\")==2){\n domove(11);\n domove(9);\n domove(12);\n domove(10);\n }else if(faces.indexOf(\"green\")==4){\n domove(12);\n domove(3);\n domove(11);\n domove(4);\n }\n }else if(c==23){\n if(faces.indexOf(\"green\")==3){\n domove(12);\n domove(6);\n domove(11);\n domove(5);\n }else if(faces.indexOf(\"green\")==1){\n domove(11);\n domove(8);\n domove(12);\n domove(7);\n }\n }else if(c==25){\n if(faces.indexOf(\"green\")==3){\n domove(11);\n domove(4);\n domove(12);\n domove(3);\n }else if(faces.indexOf(\"green\")==2){\n domove(12);\n domove(7);\n domove(11);\n domove(8);\n }\n }\n }\n }", "int[][] median_filter(int pixell_2d[][])\n{\n\tint median_pix[][] = new int [h][w];\n\tint neighbour_array[] = new int[9];\n\tint median_val;\n\t\t\n\tfor(int i = 1;i<h-1;i++)\n\t{\n\t\tfor(int j =1;j<w-1;j++)\n\t\t{\n\t\t\t\n\t\t\tneighbour_array[0] = pixell_2d[i-1][j-1];\n\t\t\tneighbour_array[1] = pixell_2d[i-1][j];\n\t\t\tneighbour_array[2] = pixell_2d[i-1][j+1];\n\t\t\tneighbour_array[3] = pixell_2d[i][j-1];\n\t\t\tneighbour_array[4] = pixell_2d[i][j];\n\t\t\tneighbour_array[5] = pixell_2d[i][j+1];\n\t\t\tneighbour_array[6] = pixell_2d[i+1][j-1];\n\t\t\tneighbour_array[7] = pixell_2d[i+1][j];\n\t\t\tneighbour_array[8] = pixell_2d[i+1][j+1];\n\t\t\t\n\t\t\t\t\n\t\t\tmedian_val = sort(neighbour_array);\n\t\t\t\t\n\t\t\tmedian_pix[i][j] = median_val;\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t}\n\t\t\n\treturn median_pix;\n\t\t\n}", "public void recomputeCentroids()\n\t{\n\t\t//For each centroid, recompute its attributes.\n\t\tfor (int i=0; i<centers.size(); i++)\n\t\t{\n\t\t\t//Get the mean of the respective cluster.\n\t\t\t//Assign this mean data point as the new cluster center.\n\t\t\tcenters.set(i, getMean(i));\n\t\t}\n\n\t\t//-----Graduate level code only...\n\n\t\t//Okay lets think about this.\n\t\t//First, we need another copy of the sqerrors arraylist, from where we can choose\n\t\t//the highest points, and then remove them from there too, to get the next highest.\n\t\tArrayList<Double> temperrors = new ArrayList<Double>();\n\t\ttemperrors.addAll(sqerrors);\n\n\t\t//Check if any of the clusters are empty.\n\t\t//for (int a=0; a<centers.size();a++)\n\t\tfor (int a=0; a<clusterdata.size();a++)\n\t\t{\n\t\t\t//If so, then locate the point with the highest SSE, and make this point the center of the empty cluster.\n\t\t\tif (clusterdata.get(a).isEmpty())\n\t\t\t{\n\t\t\t\t//Locating the point in the alldata arraylist, based on the index of its sqerror in the sqerror arraylist.\n\t\t\t\t//Assigning the corresponding point as the center instead.\n\t\t\t\tcenters.set(a, alldata.get(findMaxError(temperrors)));\n\n\t\t\t\t//Then remove this highest value of the squared error from our temp error arraylist, so that\n\t\t\t\t//we can now find the next highest one if we need it.\n\t\t\t\t//Assign a value of 0 to the current highest sqerror, so that in the next iteration we find the second highest error.\n\t\t\t\ttemperrors.set(findMaxError(temperrors),0.0);\n\t\t\t}\n\t\t}\n\n\t}", "private static Cube createCube(CubeTypes ctype) {\n\n\t\tint rowfromIndex = 0, rowtoIndex = 0;\n\t\tint colfromIndex = 0, coltoIndex = 0;\n\n\t\tswitch (ctype) {\n\n\t\tcase TOPLEFT_11:\n\t\t\trowfromIndex = 0;\n\t\t\trowtoIndex = 3;\n\t\t\tcolfromIndex = 0;\n\t\t\tcoltoIndex = 3;\n\t\t\tbreak;\n\t\tcase TOPMIDDLE_12:\n\t\t\trowfromIndex = 0;\n\t\t\trowtoIndex = 3;\n\t\t\tcolfromIndex = 3;\n\t\t\tcoltoIndex = 6;\n\t\t\tbreak;\n\t\tcase TOPRIGHT_13:\n\t\t\trowfromIndex = 0;\n\t\t\trowtoIndex = 3;\n\t\t\tcolfromIndex = 6;\n\t\t\tcoltoIndex = 9;\n\t\t\tbreak;\n\n\t\tcase MIDDLELEFT_21:\n\t\t\trowfromIndex = 3;\n\t\t\trowtoIndex = 6;\n\t\t\tcolfromIndex = 0;\n\t\t\tcoltoIndex = 3;\n\t\t\tbreak;\n\t\tcase MIDDLEMIDDLE_22:\n\t\t\trowfromIndex = 3;\n\t\t\trowtoIndex = 6;\n\t\t\tcolfromIndex = 3;\n\t\t\tcoltoIndex = 6;\n\t\t\tbreak;\n\t\tcase MIDDLERIGHT_23:\n\t\t\trowfromIndex = 3;\n\t\t\trowtoIndex = 6;\n\t\t\tcolfromIndex = 6;\n\t\t\tcoltoIndex = 9;\n\t\t\tbreak;\n\n\t\tcase BOTTOMLEFT_31:\n\t\t\trowfromIndex = 6;\n\t\t\trowtoIndex = 9;\n\t\t\tcolfromIndex = 0;\n\t\t\tcoltoIndex = 3;\n\t\t\tbreak;\n\t\tcase BOTTOMMIDDLE_32:\n\t\t\trowfromIndex = 6;\n\t\t\trowtoIndex = 9;\n\t\t\tcolfromIndex = 3;\n\t\t\tcoltoIndex = 6;\n\t\t\tbreak;\n\t\tcase BOTTOMRIGHT_33:\n\t\t\trowfromIndex = 6;\n\t\t\trowtoIndex = 9;\n\t\t\tcolfromIndex = 6;\n\t\t\tcoltoIndex = 9;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t\tSet<Integer> h = new HashSet<Integer>();\n\n\t\tfor (int i = rowfromIndex; i < rowtoIndex; i++) {\n\t\t\tfor (int j = colfromIndex; j < coltoIndex; j++) {\n\t\t\t\t// System.out.println(\"Adding :\" +\n\t\t\t\t// uploadReceiver.getMatrix()[i][j]);\n\t\t\t\tif (uploadReceiver.getMatrix()[i][j] != 0) {\n\t\t\t\t\th.add(uploadReceiver.getMatrix()[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCube c = new Cube(h);\n\t\tc.setCubeName(ctype);\n\t\tc.setRowfromIndex(rowfromIndex);\n\t\tc.setRowtoIndex(rowtoIndex);\n\t\tc.setColfromIndex(colfromIndex);\n\t\tc.setColtoIndex(coltoIndex);\n\t\tc.cubeValuesNotGiven();\n\t\treturn c;\n\t}", "@Test\n\tpublic final void testRegionalMaxima_CubeGraph_C26() {\n\t\tImageStack image = createLeveledCubeGraphImage();\n\t\tint sizeX = image.getWidth();\n\t\tint sizeY = image.getHeight();\n\t\tint sizeZ = image.getSize();\n\t\t\n\t\t// create test image: add a band with value 127 in the middle\n\t\tint zMid = sizeZ / 2;\n\t\tfor (int y = 0; y < sizeY; y++) {\n\t\t\tfor (int x = 0; x < sizeX; x++) {\n\t\t\t\tdouble val = image.getVoxel(x, y, zMid);\n\t\t\t\tif (val == 255)\n\t\t\t\t\timage.setVoxel(x, y, zMid, 127);\n\t\t\t}\n\t\t}\n\t\t\n\t\tImageStack maxima = MinimaAndMaxima3D.regionalMaxima(image, 26);\n\t\t\n\t\tfor (int z = 0; z < sizeZ; z++) {\n\t\t\tfor (int y = 0; y < sizeY; y++) {\n\t\t\t\tfor (int x = 0; x < sizeX; x++) {\n\t\t\t\t\tint v0 = (int) image.getVoxel(x, y, z);\n\t\t\t\t\tint v = (int) maxima.getVoxel(x, y, z);\n\t\t\t\t\tif (v0 == 255)\n\t\t\t\t\t\tassertEquals(255, v);\n\t\t\t\t\telse\n\t\t\t\t\t\tassertEquals(0, v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n\tpublic final void testRegionalMinima_CubeGraph_C6() {\n\t\tImageStack image = createInvertedLeveledCubeGraphImage();\n\t\tint sizeX = image.getWidth();\n\t\tint sizeY = image.getHeight();\n\t\tint sizeZ = image.getSize();\n\t\t\n\t\t// create test image: add a band with value 127 in the middle\n\t\tint zMid = sizeZ / 2;\n\t\tfor (int y = 0; y < sizeY; y++) {\n\t\t\tfor (int x = 0; x < sizeX; x++) {\n\t\t\t\tdouble val = image.getVoxel(x, y, zMid);\n\t\t\t\tif (val == 255)\n\t\t\t\t\timage.setVoxel(x, y, zMid, 127);\n\t\t\t}\n\t\t}\n\t\t\n\t\tImageStack minima = MinimaAndMaxima3D.regionalMinima(image, 6);\n\t\t\n\t\tfor (int z = 0; z < sizeZ; z++) {\n\t\t\tfor (int y = 0; y < sizeY; y++) {\n\t\t\t\tfor (int x = 0; x < sizeX; x++) {\n\t\t\t\t\tint v0 = (int) image.getVoxel(x, y, z);\n\t\t\t\t\tint v = (int) minima.getVoxel(x, y, z);\n\t\t\t\t\tif (v0 == 0)\n\t\t\t\t\t\tassertEquals(255, v);\n\t\t\t\t\telse\n\t\t\t\t\t\tassertEquals(0, v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private long computeMedian(ArrayList<Long> window){\n\t\t\n\t\tArrayList<Long> tmpWindow = new ArrayList<Long>(window);\n\t\t//ArrayList<Long> tmpWindow = (ArrayList<Long>) window.clone();\n\t\tCollections.sort(tmpWindow);\n\t\tif (tmpWindow.size() % 2 == 1)\n\t\t\treturn tmpWindow.get((tmpWindow.size()+1)/2-1);\n\t\telse{\n\t\t \tlong lower = tmpWindow.get(tmpWindow.size()/2-1);\n\t\t \tlong upper = tmpWindow.get(tmpWindow.size()/2);\t \n\t\t \treturn (lower + upper) / 2;\n\t\t}\t\n\t}", "int _partition(Integer[] data, Integer start, Integer end){\n int p = start;\n int len = end - start + 1;\n Integer[] median_data = new Integer[len];\n for(int i = 0; i < len; i++) {\n median_data[i] = data[start+i];\n }\n int median = getMedian(median_data, 0, len-1);\n\n int wt_pos = start;\n int offset = rectangles.offset;\n for(int i = end; i >= start; i--) {\n //int index1 = rectangles.indexes[i];\n if (data[i] <= median) {\n //The rectangle is in the left side of the pivot\n for (; wt_pos < i; wt_pos++) {\n //int index2 = rectangles.indexes[wt_pos];\n if (data[wt_pos] > median) {\n break;\n }\n else {\n p = wt_pos;\n }\n }\n\n if (wt_pos >= i) {\n p = i;\n break;\n }\n\n //exchange data[i] and data[wt_pos]\n int tmp = data[i];\n data[i] = data[wt_pos];\n data[wt_pos] = tmp;\n\n //exchange rectangles.indexes[start+i] and rectangles.indexes[start+wt_pos]\n tmp = rectangles.indexes[offset+i];\n rectangles.indexes[offset+i] = rectangles.indexes[offset+wt_pos];\n rectangles.indexes[offset+wt_pos] = tmp;\n wt_pos++;\n }\n }\n\n if(data[p] != median) {\n for(int i = start; i < p; i++){\n if (data[i] == median) {\n //exchange data[i] and data[wt_pos]\n int tmp = data[i];\n data[i] = data[p];\n data[p] = tmp;\n\n //exchange rectangles.indexes[start+i] and rectangles.indexes[start+wt_pos]\n tmp = rectangles.indexes[offset+i];\n rectangles.indexes[offset+i] = rectangles.indexes[offset+p];\n rectangles.indexes[offset+p] = tmp;\n }\n }\n }\n\n return p;\n }", "public Cluster_Info KMedian_2(final Set<Integer> center,int trials) throws Exception\n\t{\n\t\tMap<Integer, Set<Integer>> t = new HashMap<Integer, Set<Integer>>();\n\t\tMap<Integer, Set<Integer>> to_update = new HashMap<Integer, Set<Integer>>();\t\n\t\tSet<Integer> all_key = new HashSet<Integer>(this.input_data.keySet());\n\t\tint k = center.size();\n\t\tint dimension = 0;\n\t\tif(k==0)\n\t\t\treturn null;\n\t\tMap<Integer, ArrayList<Double>> center_cord = new HashMap<Integer, ArrayList<Double>>();\n\t\t\n\t\t//initialize center\n\t\tfor(Integer c:center)\n\t\t{\n\t\t\tif(dimension==0)\n\t\t\t\tdimension = this.input_data.get(c).size();\n\t\t\tcenter_cord.put(c,this.input_data.get(c));\n\t\t\tSet<Integer> init = new HashSet<Integer>();\n\t\t\tinit.add(c);\n\t\t\tt.put(c, init);\n\t\t}\n\t\t\n\t\tint counter = 0;\n\t\twhile(!t.equals(to_update))\n\t\t{\t\t\n\t\t\tcounter++;\n\t\t\tto_update.clear();\n\t\t\t//save previous result\n\t\t\tfor(Integer center_name:t.keySet())\n\t\t\t{\n\t\t\t\tto_update.put(center_name, new HashSet<Integer>(t.get(center_name)));\n\t\t\t\tt.get(center_name).clear();\n\t\t\t}\n\t\t\tfor(Integer elmt:all_key)//all elements\n\t\t\t{\n\t\t\t\tDouble local_min = Double.MAX_VALUE;\n\t\t\t\tint belongto = 0; \n\t\t\t\tfor(Integer c_index:t.keySet())\n\t\t\t\t{\n\t\t\t\t\tDouble tmp_d = EuclideanD(center_cord.get(c_index), this.input_data.get(elmt));\n\t\t\t\t\tif(tmp_d < local_min) //find max distance between precious center and other elemt\n\t\t\t\t\t{\n\t\t\t\t\t\tlocal_min = tmp_d;\n\t\t\t\t\t\tbelongto = c_index;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tt.get(belongto).add(elmt);\n\t\t\t}\n\t\t\tfor(Integer c_index:t.keySet())\n\t\t\t{\n\t\t\t\tif(t.get(c_index).size()==0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Set is Empty!\");\n\t\t\t\t\tt.remove(c_index);\n\t\t\t\t\tcenter_cord.remove(c_index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tArrayList<Double> Median_cord = new ArrayList<Double>();\n\t\t\t\tfor(int dim=0;dim<dimension;dim++ )\n\t\t\t\t{\n\t\t\t\t\tMedian_cord.add(this.FindMedianofDim(t.get(c_index), dim));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcenter_cord.put(c_index, Median_cord);\n\t\t\t}\n\t\t\t\n\t\t\tif(t.size()<k )\n//\t\t\t\t\t|| counter > trials)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t//System.out.println(\"Takes \"+counter+\" runs to converge.\");\n\t\t\n//\t\tfor(Integer j:t.keySet())\n//\t\t{\n//\t\t\tSystem.out.print(\"cluster name:\"+j);\n//\t\t\tSystem.out.println(t.get(j).toString());\n//\t\t}\n\t\t\n\t\tCluster_Info info = new Cluster_Info(t.keySet(),this.Cost_1(t,center_cord));\n\t\tinfo.setClusters(t);\n\t\tinfo.setCenter_Cord(center_cord);\n\t\t\n\t\treturn info;\n\t}", "public static int[] EM(int [] rgb , int kk ){\n\tfor (int i = 0; i < rgb.length; i++) {\r\n\t\t\t\r\n\t\t\tdouble[]data_x = new double[3];\r\n\t\t\t\r\n\t\t\t\tdata_x[0]=(double) getRed(rgb[i]) ;\r\n\t\t\t\tdata_x[1]=(double) getGreen(rgb[i]) ;\r\n\t\t\t\tdata_x[2]=(double) getBlue(rgb[i]) ;\r\n\t\t\t\t\r\n\t\t\tpixels.add(data_x);\t\r\n\t}\r\n\t\r\n\t// new rgb table that we will return \r\n\tint []newr = new int[pixels.size()];\r\n\t// assignement of every pixel to every cluster \r\n\tint[] pixel_assignments = new int[pixels.size()];\r\n\t\tInitializeParameters3D(kk,rgb);\t \r\n\t//\tdouble \tChangeInLogLikelihood = 1;\r\n\t\t\r\n\t\tint ar=1;\r\n\t\tDouble changeinlikelihood =Double.MAX_VALUE;\r\n\t\twhile(ar<Threshold)\r\n\t\t{\r\n\t\t\t\r\n\t\r\n\t\t\t\r\n\t\t\t/*\r\n\t\t\tDouble loglikelihood =0.0 ;\r\n\t\t\tfor(int i=0 ; i<pixels.size();i++)\r\n\t\t\t{\r\n\t\t\t\tDouble x=0.0 ;\r\n\t\t\t\tfor(int j=0 ; j<kk;j++)\r\n\t\t\t\t{\r\n\t\t\t\t\tx=x+Pi_k[j]*GaussianFunction(pixels.get(i), mu.get(j), cov.get(j) );\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tloglikelihood = loglikelihood + log2(x);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"loglikelihood \"+loglikelihood); */\r\n\t\t\t\t// E- Step Calculating Responsibilities...\r\n\t\t\t\r\n\t\t Double[][] Rspb = new Double[pixels.size()][kk]; \r\n\t\t\t\tfor(int i=0; i< pixels.size(); i++){\r\n\t\t\t\t\tdouble max_resp = 0;\r\n\t\t\t\t\tint cluster_index = 0;\r\n\t\t\t\t\tdouble denominator = 0;\r\n\t\t\t\t\tfor(int l=0;l<kk;l++) denominator+=Pi_k[l]*GaussianFunction(pixels.get(i), mu.get(l), cov.get(l) );\r\n\t\t\t\t\t\r\n\t\t\t\t\tdouble s=0 ;\r\n\t\t\t\t\tfor(int j=0;j<kk;j++) {\r\n\t\t\t\t\t\tRspb[i][j]=0.0 ;\r\n\t\t\t\t\t\tdouble numerator =Pi_k[j]*GaussianFunction(pixels.get(i), mu.get(j), cov.get(j));\r\n\t\t\t\t\t\tRspb[i][j]=numerator/denominator;\r\n\t\t\t\t\t\t//System.out.println(j+\" \" +Rspb[i][j]);\r\n\t\t\t\t\t\tif(Rspb[i][j].isNaN()) {Rspb[i][j]=0.1;}\r\n\t\t\t\t\t//\ts=s+Rspb[i][j];\r\n\t\t\t\t\t\tif (Rspb[i][j] >=max_resp) {\r\n\t\t\t\t\t\t\tmax_resp = Rspb[i][j];\r\n\t\t\t\t// if the resp of a cluster is bigger than the previous max then change the cluster index\r\n\t\t\t\t\t\t\tcluster_index = j;\r\n\t\t\t\t\t\t\t//System.out.println(max_resp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t// System.out.println(s+\" \"+i);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Assign pixel to cluster\r\n\t\t\t\t\tpixel_assignments[i] = cluster_index;\r\n\t\t\t\t//\tif(i==3)break;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t// M-Step Re-estimating Parameters...\r\n\t\t\t\t\r\n\t\t\t\tdouble[] N_k = new double[kk];\r\n\t\t\t\t\r\n\t // calculating to total respo to use later\r\n\t\t\t\tfor(int k=0; k<kk; k++){ \r\n\t\t\t\t\tN_k[k]=0;// Calculating N_k's\r\n\t\t\t\t\tfor(int n=0; n< pixels.size(); n++){\r\n\t\t\t\t\t\tN_k[k] = N_k[k] + Rspb[n][k];\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t// Calculating new Pi_k's\r\n\t\t\t\t\r\n\t\t\t\tfor(int k=0; k<kk; k++){\r\n\t\t\t\t\tPi_k[k] = N_k[k]/pixels.size();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t// Calculating new Mu_k's\r\n\t\t\t\tmu.clear();//clear the arraylist\r\n\t\t\t\tfor(int k=0; k<kk; k++){ // for every cluster\r\n\t\t\t\t\t\r\n\t\t\t\t\tMu_k = new double[3];// create a new mu table\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i=0;i<3;i++) { // \r\n\t\t\t\t\t\tDouble m =(double) 0;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tfor(int n=0; n< pixels.size(); n++){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tm = m + Rspb[n][k]*pixels.get(n)[i];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tMu_k[i] = m/N_k[k] ;\r\n\t\t\t\t\t//\tSystem.out.print(\" mu[\"+i+\"] = \"+Mu_k[i]+\" \");\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t//System.out.println(\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tmu.add(Mu_k);\r\n\t\t\t\t}\r\n\t\t/*\t//\tSystem.out.println(\"\\n---------------mu after updates-------------------------------\");\r\n\t\t\t\tfor(int k=0; k<mu.size(); k++){\r\n\t\t\t\t\t//System.out.println();\r\n\t\t\t\t\tfor(int n=0; n< mu.get(k).length; n++){\r\n\t\t\t//\t\t\tSystem.out.print(\" \"+mu.get(k)[n]+\" \");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(\"\\n-----------------------------------------\");*/\r\n\t\t\t\t/////////////////////////////////\r\n\t\t\t\tcov.clear();\r\n\t\t\t\t\r\n\t\t\t\tfor(int k=0 ; k<kk;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tcov_k = new double[3][3];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int i=0;i<3;i++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor(int j=0;j<3;j++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdouble c=0;\r\n\t\t\t\t\t\t\tfor(int n=0; n< pixels.size(); n++){\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tc=c + Rspb[n][k]*(((double)pixels.get(n)[i]-mu.get(k)[i])*((double)pixels.get(n)[j]-mu.get(k)[j]));\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tDouble l =Math.sqrt(c/N_k[k]); \r\n\t\t\t\t\t\t\tif(l.isNaN())\r\n\t\t\t\t\t\t\t\tif(i>0)\r\n\t\t\t\t\t\t\t\t\tl=cov_k[i-1][j];\r\n\t\t\t\t\t\t\t else \r\n\t\t\t\t\t\t\t \t if(j>0) \r\n\t\t\t\t\t\t\t \t l=cov_k[1][j-1];\r\n\t\t\t\t\t\t\t \t else\r\n\t\t\t\t\t\t\t \t\t l=10.0;\r\n\t\t\t\t\t\t\tcov_k[i][j]=l;\r\n\t\t\t\t\t\t\t//System.out.print(\"cov_k[\"+i+\"][\"+j+\"] = \"+cov_k[i][j]+\" \");\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//System.out.println();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t//\tSystem.out.println();\r\n\t\t\t\t\tcov.add(cov_k);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t /* \r\n\t\t\t\tfor (int i=0;i<kk;i++) {\r\n\t\t\t\t\tSystem.out.println(\"pi: \"+Pi_k[i]);\r\n\t\t\t\t\tSystem.out.println(\"mu: \"+Mu_k[i]);\r\n\t\t\t\t\tSystem.out.println(\"sigma: \"+cov_k[i]);\r\n\t\t\t\t}*/\r\n\t\t\t\tar++;\r\n\t\t\t/*\t\r\n\t\t\t\tDouble newloglikelihood=0.0 ;\r\n\t\t\t\t\r\n\t\t\t\tfor(int i=0 ; i<pixels.size();i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tDouble x=0.0 ;\r\n\t\t\t\t\tfor(int j=0 ; j<kk;j++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tx=x+Pi_k[j]*GaussianFunction(pixels.get(i), mu.get(j), cov.get(j) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tnewloglikelihood = newloglikelihood + log2(x);\r\n\t\t\t\t}\r\n\t\t\t\tchangeinlikelihood=newloglikelihood-loglikelihood;\r\n\t\t\t\tSystem.out.println(\"change_loglikelihood \"+changeinlikelihood);*/\r\n\t\t\t\t\r\n\t\t}// While\t\r\n\t\t\r\n\t\tSystem.out.println(\"\\n---------------pi -------------------------------\");\r\n\t\t\r\n\t\tfor(int k=0; k<kk; k++){\r\n\t\t\tSystem.out.print(\"Pi_k[\"+k+\"] = \"+Pi_k[k]+\"\\t\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"\\n-----------------------------------------\");\r\n\t\t\r\n\t\t\r\n\t\tSystem.out.println(\"\\n---------------mu -------------------------------\");\r\n\t\tfor(int k=0; k<mu.size(); k++){\r\n\t\t\tSystem.out.println();\r\n\t\t\tfor(int n=0; n< mu.get(k).length; n++){\r\n\t\t\t\tSystem.out.print(\" \"+mu.get(k)[n]+\" \");\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\\n-----------------------------------------\");\r\n\t\tSystem.out.println(\"-------------------------------cov------------------------------\");\r\n\t\tfor(int k=0 ; k<kk;k++)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tfor (int i=0;i<3;i++)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tfor(int j=0;j<3;j++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tSystem.out.print(\"cov_k[\"+i+\"][\"+j+\"] = \"+cov.get(k)[i][j]+\" \");\r\n\t\t\t\t \r\n\t\t\t\t\t}\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"-------------------------------done------------------------------\");\r\n\t\tint [] colors = new int[kk];\r\n\t\tcolors = getcolors(kk) ; //get num of colors equal to num of clusters\r\n\t\tfor (int i = 0; i < pixels.size(); i++) {\r\n\t\t\tnewr[i] = colors[pixel_assignments[i]]; // based on pixel assignments , return an rgb color for every pixel\r\n\t\t}\r\n\treturn newr;\r\n }", "void cluster(Dataset dataset, int maxIterations);", "private void computeM() {\n // creer le cut tree\n Hashtable<Integer, Halfedge<Point_3>> cutTree;\n switch(this.cutTreeMethod){\n \tcase 1: cutTree = computeCutTree();break;\n \tcase 2: cutTree = computeCutTree();break;\n \tcase 3: cutTree = this.flatSpanning();break;\n \tcase 4: cutTree = this.minimumParameter();break;\n \t\n \tdefault: throw new Error(\"Wrong cut Tree method number\");\n \n }\n\n // couper le mesh et le mettre a plat\n this.cutMesh(cutTree);\n }", "private void HardCMeansUpdateClusters() {\n for(int i=0; i<cluster.length; i++) {\n\t for(int j=0; j<cluster[i].length; j++) cluster[i][j] = 0.0;\n\t int sum = 0;\n\t for(int k=0; k<degree.length; k++) if(degree[k][i] == 1.0) {\n\t\t sum++;\n\t\t for(int j=0; j<cluster[i].length; j++) cluster[i][j] += point[k][j];\n\t } \n\t if(sum != 0) {\n\t for(int j=0; j<cluster[i].length; j++) {\n\t\t cluster[i][j] = cluster[i][j]/sum;\n\t } \n\t } else {\n\t /// Instead using 0 and center, we place the \"empty\" cluster at the last point\n\t for(int j=0; j<cluster[i].length; j++) {\n\t\t cluster[i][j] = point[point.length-1][j];\n\t } \t\t\n\t }\n }\n }", "protected List<List<PowerVm>> MK(Set<? extends Host> excludedHosts,List<? extends Vm> vmsToMigrate) {\r\n\t\t//nombre initiale des clusters\r\n\t\tint k = find_numberof_cluster(excludedHosts,vmsToMigrate);\r\n\t\tSystem.out.println(\" find_numberof_cluster \");\r\n\t\t List<List<PowerVm>> Clusters = null ;\r\n\t\tSystem.out.println(\"Nombre des clusters ===== \"+k);\r\n\t\t\r\n\t\r\n\t\t\r\n\t\tif (k != -1) {\r\n\t\t}\r\n\t\t//centroide initial \r\n\t\t if (k > 2) {\r\n double centroidss[][]=new double[k][2];\r\n centroidss =find_init_centroids(vmsToMigrate,k); \r\n\t\tSystem.out.println(\"**************************************\");\r\n\t //\ttry {\r\n\t\t\tdouble[] mips = new double[vmsToMigrate.size()];\r\n\t\t\tdouble[] ram = new double[vmsToMigrate.size()];\r\n\t\t\tfor (int i = 0; i < vmsToMigrate.size(); i++) {\r\n\t\t\t\tmips[i]=(double) vmsToMigrate.get(i).getMips();\r\n\t\t\t\tram[i]=(double) vmsToMigrate.get(i).getRam();\r\n\t\t\t}\r\n\t\t\t \r\n\t\t\tfor (int i = 0; i < vmsToMigrate.size(); i++) {\r\n\t\t\t\tSystem.out.print(\" \"+vmsToMigrate.get(i).getMips()); \r\n\t\t\t\tSystem.out.print(\" \"+vmsToMigrate.get(i).getRam()); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t// visualiser les résultats dans un graphe\r\n\t\t//\t easyjcckit.QuickPlot.scatter(ram , mips ); \r\n\t\t\t// easyjcckit.QuickPlot.addScatter(ram, mips);\r\n\t\t//\tSystem.out.println(\"Press enter to exit\");\r\n\t\t//\tSystem.in.read();\r\n\t\t//} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\t//e.printStackTrace();\r\n\t\t//}\r\n\t\t\t// affichage des centroides \r\n\t\tSystem.out.println(\"**************************************\");\r\n\t \tfor (int i = 0; i < k; i++) {\r\n\t\t \tSystem.err.println(\"centroids : \"+centroidss[i][0] +\"centroids : \"+centroidss[i][1]); \r\n\t \t}\r\n\t \tSystem.out.println(\"***************************************\");\r\n\t try {\r\n\t\t\t\tThread.sleep(0);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t \tdouble Lastcentroidss[][]=new double[k][2];\r\n\t for (int U = 0; U < 10; U++) {\r\n\t\t System.out.println(\"// //// //// //// iter \"+U+1); \r\n\t\t Clusters =PowerVmList.returnCluster(vmsToMigrate,centroidss);\r\n\t\t Lastcentroidss = centroidss;\r\n\t \t\tcentroidss=getNewCentroids(Clusters);\r\n\t \t\tSystem.out.println(\"--------------------------------------\");\r\n\t\t \tfor (int i = 0; i < k; i++) {\r\n\t \t\t\t \tSystem.out.println(\"centroids : \"+centroidss[i][0] +\"centroids : \"+centroidss[i][1]); \r\n\t \t\t \t}\r\n\t \t\tSystem.out.println(\"--------------------------------------\");\r\n\t \t\t try {\r\n\t\t\t\t\tThread.sleep(0);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t \t\tif (egal(Lastcentroidss, centroidss)) {\r\n\t \t\t\tSystem.err.println(\"voila le resultats ===> \");\r\n\t \t\t\ttry {\r\n\t \t\t\t\tThread.sleep(0);\r\n\t \t\t\t} catch (InterruptedException e) {\r\n\t \t\t\t\t// TODO Auto-generated catch block\r\n\t \t\t\t\te.printStackTrace();\r\n\t \t\t\t}\r\n\t\t\t\tbreak;\t}}\r\n\t //while(true);\r\n\t }\t\r\n\t\t \r\n\t\t \r\n\t\t \r\n\treturn (List<List<PowerVm>>) Clusters;\r\n\t}", "private int[] blackWhiteRange(int fixedDimension, int maxWhiteRun, int minDim, int maxDim, boolean horizontal) {\n int end;\n int start;\n int center = (minDim + maxDim) >> 1;\n int start2 = center;\n while (true) {\n if (start2 < minDim) {\n break;\n }\n if (!horizontal) {\n start = start2;\n while (true) {\n start--;\n if (start < minDim) {\n }\n }\n int whiteRunSize = start2 - start;\n if (start < minDim) {\n break;\n }\n break;\n }\n start = start2;\n while (true) {\n start--;\n if (start < minDim) {\n break;\n } else if (horizontal) {\n if (this.image.get(start, fixedDimension)) {\n break;\n }\n } else if (this.image.get(fixedDimension, start)) {\n break;\n }\n }\n int whiteRunSize2 = start2 - start;\n if (start < minDim || whiteRunSize2 > maxWhiteRun) {\n } else {\n start2 = start;\n }\n start2--;\n }\n int start3 = start2 + 1;\n int end2 = center;\n while (true) {\n if (end2 >= maxDim) {\n break;\n }\n if (!horizontal) {\n end = end2;\n while (true) {\n end++;\n if (end >= maxDim) {\n }\n }\n int whiteRunSize3 = end - end2;\n if (end >= maxDim) {\n break;\n }\n break;\n }\n end = end2;\n while (true) {\n end++;\n if (end >= maxDim) {\n break;\n } else if (horizontal) {\n if (this.image.get(end, fixedDimension)) {\n break;\n }\n } else if (this.image.get(fixedDimension, end)) {\n break;\n }\n }\n int whiteRunSize32 = end - end2;\n if (end >= maxDim || whiteRunSize32 > maxWhiteRun) {\n } else {\n end2 = end;\n }\n end2++;\n }\n int end3 = end2 - 1;\n if (end3 <= start3) {\n return null;\n }\n return new int[]{start3, end3};\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EXIBE O MENU NA TELA
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return super.onCreateOptionsMenu(menu); }
[ "private static void irMenuEstoque() {\n\t\t\n\t}", "public static void VypisMenu () {\n\t\t\n\t\tSystem.out.println(\"Menu:\");\n\t\tSystem.out.println(\"1. Scitani\");\n\t\tSystem.out.println(\"2. Odecitani\");\n\t\tSystem.out.println(\"3. Nasobeni\");\n\t\tSystem.out.println(\"4. Deleni\");\n\t\t\t\t\n\t}", "private void actIdiomaMenu() {\n //botones del menu\n if (menuItems != null) {\n MenuItem itemAcercaDe = menuItems.findItem(R.id.action_acercade);\n MenuItem itemConfig = menuItems.findItem(R.id.action_settings);\n MenuItem itemExportar = menuItems.findItem(R.id.action_exportar);\n MenuItem itemLista = menuItems.findItem(R.id.action_listado);\n\n itemAcercaDe.setTitle(R.string.action_acercade);\n itemConfig.setTitle(R.string.action_settings);\n itemExportar.setTitle(R.string.action_exportar);\n itemLista.setTitle(R.string.action_listado);\n }\n\n }", "private static void pintarMenu() {\n\t\t\r\n\t\tSystem.out.println(\"COMPRA DE CLIENTE:\");\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"1. Añadir musica a la lista actual.\");\r\n\t\tSystem.out.println(\"2. Eliminar musica de la lista actual.\");\r\n\t\tSystem.out.println(\"3. CONFIRMAR VENTA\");\r\n\t\tSystem.out.println(\"4. CANCELAR VENTA\");\r\n\t\tSystem.out.println(\"\");\r\n\t\tSystem.out.println(\"Escriba el número de la opción elegida():\");\r\n\t\t\t\t\r\n\t}", "private static void tampilkanMenu() {\n int nomorItem = 1;\n for (Item item : menu) {\n System.out.println(nomorItem+ \". \" +item.showDetail());\n nomorItem++;\n }System.out.println(\"\");\n }", "public void opcionesMenu() {\n System.out.println(\"----- Menu -----\");\n System.out.println(\"1. Administrar clientes\");\n System.out.println(\"2. Administrar reservaciones\");\n System.out.println(\"3. Administrar paquetes\");\n System.out.println(\"4. Mantenimiento\");\n System.out.println(\"5. Configuraciones\");\n System.out.println(\"6. Salir\");\n }", "public void ordenaMenu(String tipoOrdenacao){\n\t\tthis.hotelController.ordenaMenu(tipoOrdenacao);\n\t}", "public static void afficherMenu() {\n\n\t\tSystem.out.println(\"\\t+-------------------+\");\n\t\tSystem.out.println(\"\\t| 1- Construire |\");\n\t\tSystem.out.println(\"\\t| 2- Demolir |\");\n\t\tSystem.out.println(\"\\t| 3- Passer le tour |\");\n\t\tSystem.out.println(\"\\t| 4- Quitter |\");\n\t\tSystem.out.println(\"\\t+-------------------+\");\n\t\t\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.nivel1_principal, menu);\n TextView label = (TextView) findViewById(R.id.txtnivel);\n switch (Num){\n case 1:\n label.setText(\"Onomatopeyas\");\n break;\n case 3:\n label.setText(\"Silabas & Palabras\");\n break;\n }\n return true;\n }", "public void iniciar(){\n menu();\n }", "public void MenuItem() {\n\n\n insertMenu.setText(\"درج\");\n insertMenu.setMnemonic('n');\n insertMenu.setDisplayedMnemonicIndex(0);\n insertMenu.setFont(new Font(\"IRCompset\", Font.PLAIN, 30));\n insertMenu.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n insertMenu.setMinimumSize(new Dimension(70, 50));\n insertMenu.setPreferredSize(new Dimension(70, 50));\n insertMenu.setMaximumSize(new Dimension(70, 50));\n insertMenu.revalidate();\n\n insertMenuPop.setText(\"درج\");\n insertMenuPop.setMnemonic('n');\n insertMenuPop.setDisplayedMnemonicIndex(0);\n insertMenuPop.setFont(new Font(\"IRCompset\", Font.PLAIN, 30));\n insertMenuPop.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n insertMenuPop.revalidate();\n\n editMenu.setText(\"ویرایش\");\n editMenu.setMnemonic(',');\n editMenu.setDisplayedMnemonicIndex(0);\n editMenu.setFont(new Font(\"IRCompset\", Font.PLAIN, 30));\n editMenu.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n editMenu.setMinimumSize(new Dimension(90, 50));\n editMenu.setPreferredSize(new Dimension(90, 50));\n editMenu.setMaximumSize(new Dimension(90, 50));\n editMenu.revalidate();\n\n editMenuPop.setText(\"ویرایش\");\n editMenuPop.setMnemonic(',');\n editMenuPop.setDisplayedMnemonicIndex(0);\n editMenuPop.setFont(new Font(\"IRCompset\", Font.PLAIN, 30));\n editMenuPop.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n editMenuPop.revalidate();\n\n newEventMenuItem = new JMenuItem(\"اضافه کردن رویداد\", SwingConstants.CENTER);\n newEventMenuItem.setMnemonic('v');\n newEventMenuItem.setDisplayedMnemonicIndex(11);\n newEventMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK));\n newEventMenuItem.setActionCommand(\"اضافه کردن رویداد\");\n newEventMenuItem.setFont(new Font(\"IRCompset\", Font.PLAIN, 25));\n newEventMenuItem.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n newEventMenuItem.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) {\n NewaddEvent();\n }\n });\n\n newNoteMenuItem = new JMenuItem(\"اضافه کردن یادداشت\", SwingConstants.CENTER);\n newNoteMenuItem.setMnemonic('d');\n newNoteMenuItem.setDisplayedMnemonicIndex(11);\n newNoteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_MASK));\n newNoteMenuItem.setActionCommand(\"اضافه کردن یادداشت\");\n newNoteMenuItem.setFont(new Font(\"IRCompset\", Font.PLAIN, 25));\n newNoteMenuItem.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n newNoteMenuItem.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) {\n NewaddNote();\n }\n });\n\n editEventNoteMenuItem = new JMenuItem(\"ویرایش رویدادها و یادداشت های روز مربوطه\"\n , SwingConstants.CENTER);\n editEventNoteMenuItem.setMnemonic(',');\n editEventNoteMenuItem.setDisplayedMnemonicIndex(0);\n editEventNoteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK));\n editEventNoteMenuItem.setActionCommand(\"ویرایش رویدادها و یادداشت های روز مربوطه\");\n editEventNoteMenuItem.setFont(new Font(\"IRCompset\", Font.PLAIN, 25));\n editEventNoteMenuItem.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n editEventNoteMenuItem.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) {\n editeFunction();\n }\n });\n\n copyEventNoteMenuItem = new JMenuItem(\"کپی کردن متن تاریخ روز انتخاب شده\"\n , SwingConstants.CENTER);\n copyEventNoteMenuItem.setMnemonic('j');\n copyEventNoteMenuItem.setDisplayedMnemonicIndex(13);\n copyEventNoteMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));\n copyEventNoteMenuItem.setActionCommand(\"کپی کردن متن تاریخ روز انتخاب شده\");\n copyEventNoteMenuItem.setFont(new Font(\"IRCompset\", Font.PLAIN, 25));\n copyEventNoteMenuItem.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n copyEventNoteMenuItem.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) {\n String myString = String.valueOf(focusCalendar.get(Calendar.DAY_OF_MONTH) + \" \" +\n monthsName[displayedCalendar.get(Calendar.MONTH)]) + \" \" + focusCalendar.get(Calendar.YEAR);\n StringSelection stringSelection = new StringSelection(myString);\n Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();\n clpbrd.setContents(stringSelection, null);\n }\n });\n\n copyCelebMenuItem = new JMenuItem(\"کپی کردن متن مناسبت روز انتخاب شده\"\n , SwingConstants.CENTER);\n copyCelebMenuItem.setMnemonic('l');\n copyCelebMenuItem.setDisplayedMnemonicIndex(13);\n copyCelebMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));\n copyCelebMenuItem.setActionCommand(\"کپی کردن متن مناسبت روز انتخاب شده\");\n copyCelebMenuItem.setFont(new Font(\"IRCompset\", Font.PLAIN, 25));\n copyCelebMenuItem.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);\n copyCelebMenuItem.addMouseListener(new MouseAdapter() {\n public void mousePressed(MouseEvent e) {\n String myString = txtCelebrate.getText();\n StringSelection stringSelection = new StringSelection(myString);\n Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();\n clpbrd.setContents(stringSelection, null);\n }\n });\n\n insertMenu.add(newEventMenuItem);\n insertMenu.addSeparator();\n insertMenu.add(newNoteMenuItem);\n editMenu.add(editEventNoteMenuItem);\n editMenu.addSeparator();\n editMenu.add(copyEventNoteMenuItem);\n editMenu.addSeparator();\n editMenu.add(copyCelebMenuItem);\n\n }", "public static void mostrarMenu() {\n System.out.println(\"\\n\\t---- Menu ----\");\n System.out.println(\"\\n1. Procesar imagen completa\");\n System.out.println(\"2. Procesar en 2 partes\");\n System.out.println(\"3. Procesar en 4 partes\");\n System.out.println(\"4. Procesar en 8 partes\");\n System.out.println(\"5. Procesar en 16 partes\");\n System.out.println(\"6. Procesar en 64 partes\");\n System.out.println(\"0. Salir\");\n System.out.print(\"\\t Opcion: \");\n }", "public MenuDosen() {\n initComponents();\n tampildosen();\n tampilpesan();\n setTitle(\"MENU DOSEN\");\n }", "private static MyMenu nuovoMenu(String funzione){\n switch (funzione){\n case Costanti.NUM_CITTA:\n String[] menu_citta = new String[6];\n menu_citta[0] = Costanti.CINQUE;\n menu_citta[1] = Costanti.DODICI;\n menu_citta[2] = Costanti.CINQUANTA;\n menu_citta[3] = Costanti.DUECENTO;\n menu_citta[4] = Costanti.DUEMILA;\n menu_citta[5] = Costanti.DIECIMILA;\n MyMenu menu_num_citta = new MyMenu(Costanti.NUM_CITTA,menu_citta);\n return menu_num_citta;\n default: break;\n }\n return null;\n }", "public static void actionMenu() {\n\t\t\tSystem.out.println(T33.decoration[7]\n\t\t\t\t\t+ \"\\nQue voulez vous faire faire à votre Tamago?\"\n\t\t\t\t\t+ T33.decoration[7]+\"\\n\");\n\t\t\tSystem.out.println(\"(1) ETAT\");\n\t\t\tSystem.out.println(\"(2) Le Nourir?\");\n\t\t\tSystem.out.println(\"(3) Le Laver?\");\n\t\t\tSystem.out.println(\"(4) Le Soigner?\");\n\t\t\tSystem.out.println(\"(5) Lui faire rencontrer des ami(e)s?\");\n\t\t\tSystem.out.println(\"(6) Qu'il se repose?\");\n\t\t\tSystem.out.println(\"(7) Lui faire faire du Sport?\");\n\t\t\tSystem.out.println(\"(8) Le tuer?\");\n\t\t\tSystem.out.println(\"(9) Lui teindre les poils?\");\n\t\t\tSystem.out.println(\"(10) Qu'il se detende?\");\n\n\t\t}", "public void menuProcesos()\n{\n cVista.generarMenuProceso(cModelo.getActSelConjuntoDatos().getTitulo());\n String val=leerLineaConsola();\n if(val.toLowerCase().equals(\"v\"))\t\t\n\t{\n\t MenuSelConjuntoDatos();\n\t}\n\t\n\telse if ( esEntero(val))\n\t{\n\t\tint valor= Integer.parseInt(val);\n\t\tswitch (valor)\n\t\t{\n\t\tcase 1:\n\t\t\t\n\t\t\tDouble media = cModelo.calcMedActSelConjuntoDatos();\n\t\t\tDouble dS= cModelo.calcDevStanActSelConjuntoDatos(media);\n\t\t\tcVista.MostrarMediayDesvEstandart(media, dS);\n\t\t\tmenuProcesos();\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tmenuEditar();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tmenuProcesos();\n\t\t\tbreak;\n\t\t}\n\t}\n\telse\n\t{\n\t\t\n\t\tmenuProcesos();\n\t}\n}", "public MenuUtama() {\n initComponents();\n jam();\n panelmenu();\n }", "public static void Menu(){\n\t\tSystem.out.println(\"Ingrese una opcion: \\n\"+\n\t\t\t\t\t\t \t\"1.-Capturar Nombre y calificaciones\\n\"+\n\t\t\t\t\t\t\t\"2.-Imprimir calificaciones y promedio de calificaciones\\n\"+\n\t\t\t\t\t\t\t\"3.-Imprimir calificaciones y calificacion mas baja\\n\"+\n\t\t\t\t\t\t\t\"4.-Imprimir calificaciones y calificacion mas alta\\n\"+\n\t\t\t\t\t\t\t\"5.-Salir\\n\");\n\t}", "@Override\n public void menu() {\n Visualizador.printString(\"MENU UTILIZADOR\");\n Visualizador.printString(\"1| Sign in.\");\n Visualizador.printString(\"2| Sing up.\");\n Visualizador.printString(\"3| Voltar ao menu.\");\n }", "public void generaMenu() {\r\n try {\r\n model = new DefaultMenuModel();\r\n for (SmeiMenuitems item : listaMenuItemsPorPerfil) {\r\n if (item.getSmeMeiCodigo() == null) {\r\n DefaultSubMenu firstSubmenu = DefaultSubMenu.builder().label(item.getMeiDescripcion()).build();\r\n\r\n for (SmeiMenuitems subItem : listaMenuItemsPorPerfil) {\r\n SmeiMenuitems subMenu = subItem;\r\n if (subMenu.getSmeMeiCodigo() != null) {\r\n if (subMenu.getSmeMeiCodigo().getMeiCodigo().equals(item.getMeiCodigo())) {\r\n DefaultMenuItem itemSub = DefaultMenuItem.builder()\r\n .value(subMenu.getMeiDescripcion())\r\n .icon(\"pi pi-external-link\")\r\n .ajax(false)\r\n .url(subMenu.getMeiUrl())\r\n .update(\"messages\")\r\n .build();\r\n firstSubmenu.getElements().add(itemSub);\r\n }\r\n\r\n }\r\n\r\n }\r\n model.getElements().add(firstSubmenu);\r\n }\r\n\r\n }\r\n } catch (Exception e) {\r\n System.err.println(\"Error al procesar generaMenu de \" + getClass().getName() + \". Causado por: \" + e.getMessage());\r\n }\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public void onAttach(Activity activity) { super.onAttach(activity); }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates page scroll synchronously after measure and layout child views.
public void updateScrollSynchronously() { // onMeasure is needed to update child's measured width which is used in scroll calculation, // in case TaskView sizes has changed when being focused/unfocused. onMeasure(makeMeasureSpec(getMeasuredWidth(), EXACTLY), makeMeasureSpec(getMeasuredHeight(), EXACTLY)); onLayout(false /* changed */, getLeft(), getTop(), getRight(), getBottom()); updateMinAndMaxScrollX(); }
[ "@Override\n\tpublic void computeScroll() {\n\t\tif (scroller.computeScrollOffset()) {\n\t\t\tscrollTo(scroller.getCurrX(), scroller.getCurrY());\n\t\t\tpostInvalidate();// 刷新\n\t\t}\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tint off = mLayout.getMeasuredHeight() - mScrollView.getHeight();\n\t\t\tif (off > 0) {\n\t\t\t\tmScrollView.scrollTo(0, off);\n\t\t\t}\n\t\t}", "@Override\n public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {\n View view = v.getChildAt(v.getChildCount() - 1);\n int diff = (view.getBottom() - (v.getHeight() + v.getScrollY()));\n int footerHeight = getFooter().llFooter.getHeight();\n boolean hasScrolledDown = scrollY - oldScrollY > 0;\n boolean hasReachedBottom = diff <= footerHeight;\n if (hasScrolledDown && hasReachedBottom) {\n if (mPagedStates.hasMoreToLoad()) {\n loadAsync(mPagedStates.getCur(), mItemCountPerLoad);\n }\n }\n }", "public interface ScrollLayout {\n\n /**\n * Starts new layout turn.\n *\n * @param deviate this param is used to layout view, {@code int} is enough\n */\n void start(int width, int height, float scale, float deviate, int interval);\n\n /**\n * Layout the anchor page.\n *\n * @param offset the offset of the page to the baseline.\n */\n void layoutAnchor(View page, float offset, float keep);\n\n /**\n * Returns {@code true} if a page can be layout after the current last page.\n *\n * @param last current last page\n * @param offset the offset to correct the baseline\n */\n boolean canLayoutNext(View last, float offset);\n\n /**\n * Layout the page as a next page.\n */\n void layoutNext(View page);\n\n /**\n * Returns the blank remains in next direction.\n *\n * @param last the last view\n */\n int getNextBlank(View last);\n\n /**\n * Returns {@code true} if a view can be layout after the first view.\n *\n * @param first current first view\n * @param offset the offset to correct the baseline\n */\n boolean canLayoutPrevious(View first, float offset);\n\n /**\n * Layout the page as a previous page.\n */\n void layoutPrevious(View page);\n\n /**\n * Returns the offset to baseline in previous direction.\n */\n int getPreviousOffset(View first);\n\n /**\n * Offset all pages.\n */\n void offsetPages(List<GalleryPage> pages, int offset);\n\n /**\n * Select anchor for next layout turn.\n */\n GalleryPage selectAnchor(List<GalleryPage> pages);\n\n /**\n * Return the offset ot the anchor.\n */\n int getAnchorOffset(View anchor);\n\n /**\n * Reset current layout state as the view.\n */\n void resetLayoutState(View view);\n\n /**\n * Apply scroll to current layout state.\n *\n * @param result a four-size array to store the new anchorOffset, the new pageDeviate,\n * the remained dx and the remained dy\n */\n void scrollBy(float anchorOffset, float pageDeviate, float dx, float dy,\n @Nullable View first, @Nullable View last, float[] result);\n\n /**\n * Apply scale to current layout state.\n *\n * @param result a four-size to store the new anchorIndex, the new anchorOffset,\n * the new anchorKeep and pageDeviate\n */\n void scaleBy(float anchorOffset, float pageDeviate, float x, float y, float factor,\n GalleryView gallery, int anchorIndex, float[] result);\n }", "@Override\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\t\tsuper.onMeasure(widthMeasureSpec, heightMeasureSpec);\n\t\tint width = getChildAt(curScreen).getWidth();\n\t\tfor (int i = 0; i < getChildCount(); i++) {\n\t\t\tgetChildAt(i).measure(widthMeasureSpec, heightMeasureSpec);\n\t\t\t// Log.e(\"\",\"onmeasure in for loop\");\n\t\t}\n\t\tscrollTo(curScreen * width, 0);\n\t\t// Log.e(\"\", \"onmeasure \" +curScreen * width);\n\t}", "protected void updateScrollPane()\n {\n invalidateSize();\n if (getParent() instanceof BScrollPane)\n getParent().layoutChildren();\n }", "@Override\r\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\r\n\t\tif (this.rotateLastView)\r\n\t\t\trotateLastViewInLayout();\r\n\t\tif (this.rotateFirstView)\r\n\t\t\trotateFirstViewInLayout();\r\n\t\tsuper.onMeasure(widthMeasureSpec, heightMeasureSpec);\r\n\t\tint i = View.MeasureSpec.getSize(heightMeasureSpec);\r\n\t\tint j = getChildCount();\r\n\t\tint k = 0;\r\n\t\twhile (true) {\r\n\t\t\tif (k >= j) {\r\n\t\t\t\tif (!this.mFirstLayout)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t// setHorizontalScrollBarEnabled(false);\r\n\t\t\t\tsetHorizontalScrollBarEnabled(false);\r\n\t\t\t\tint m = this.currentScreen * i;\r\n\t\t\t\tscrollTo(0, m);\r\n\t\t\t\tsetHorizontalScrollBarEnabled(true);\r\n\t\t\t\tthis.mFirstLayout = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tgetChildAt(k).measure(widthMeasureSpec, heightMeasureSpec);\r\n\t\t\tk += 1;\r\n\t\t}\r\n\t}", "public void scrollintrpage() {\n\t\tHelper.scrollDown();\n\t\t\n\t}", "@Override\r\n public void computeScroll()\r\n {\n final int scrollX = getScrollX();\r\n super.computeScroll();\r\n if (scroller.computeScrollOffset())\r\n {\r\n scrollTo(scroller.getCurrX(), getScrollY());\r\n }\r\n else\r\n {\r\n scrollTo(scrollX, getScrollY());\r\n }\r\n if (lastUpdateScrollByZoom != null)\r\n {\r\n updateScrollWhileZoom(lastUpdateScrollByZoom.newZoom, lastUpdateScrollByZoom.oldZoom, lastUpdateScrollByZoom.heightAccum, lastUpdateScrollByZoom.currentScrollY);\r\n lastUpdateScrollByZoom = null;\r\n }\r\n }", "private void updateUI() {\n mAdapter = new CampaignScrollAdapter(campaigns);\n mSimpleScrollRecyclerView.setAdapter(mAdapter);\n }", "public void updatePagination() {\n this.updatePageContents();\n this.updatePageItems();\n }", "@Override\n\tpublic void computeScroll() {\n\t\tsuper.computeScroll();\n\t\t\n\t\tLog.d(TAG, \"enter computeScroll\");\n\t\t\n\t\tif(mScroller.computeScrollOffset()){//判断是否滑动结束 true表示未结束。\n\t\t\n\t\t\tint curX = mScroller.getCurrX();\n\t\t\tLog.e(\"zzzzzzz\", \"curX = \"+curX);\n\t\t\tscrollTo(curX, 0); \n invalidate(); \n\t\t}\n\t\t\n\t}", "@Override\n public void onScrolled(RecyclerView recyclerView, int dx, int dy) {\n if (linearLayoutManager.findFirstCompletelyVisibleItemPosition() == 0) {\n swipeToRefreshAnnoucnements.setEnabled(true);\n } else {\n swipeToRefreshAnnoucnements.setEnabled(false);\n }\n int visibleItemCount = linearLayoutManager.getChildCount();\n// int totalItemCount = layoutManager.getItemCount();\n int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();\n\n int lastInScreen = firstVisibleItemPosition + visibleItemCount;\n if (lastInScreen == totalCount) {\n\n //here the section to increase the page number to get next 20 items\n totalCount += 10;\n pageNumber += 1;\n getAnnouncement(pageNumber);\n }\n }", "@Override\n public void onScrollChanged() {\n ((ScrollView)TVCardDialog.this.slaveView.findViewById(R.id.contentScrollView)).setScrollY(((TVScrollView)findViewById(R.id.contentScrollView)).getScrollY());\n }", "void scrollScreenPane() {\n try {\n this.output.getVerticalScrollBar().setValue(this.screen.getHeight() -\n this.screen.getVisibleRect().\n height);\n }\n catch (Exception ex) {\n //e.printStackTrace();\n }\n }", "public void ScrollViewpager(){\n final Handler handler = new Handler();\n final Runnable Update = new Runnable() {\n public void run() {\n if (currentPage == NUM_PAGES) {\n currentPage = 0;\n }\n viewPager.setCurrentItem(currentPage++, true);\n }\n };\n\n Timer timer = new Timer(); // This will create a new Thread\n timer.schedule(new TimerTask() { // task to be scheduled\n @Override\n public void run() {\n handler.post(Update);\n }\n }, DELAY_MS, PERIOD_MS);\n\n }", "void scroll_paint () {\n contig_start_view = hscroll.getValue();\r\n repaint();\r\n }", "@Override\n /**\n * i smarll item id\n * v 移动出去的比例\n */\n public void onPageScrolled(int i, float v, int i1) {\n }", "public void updatePageContents() {\n\n // Retrieving a SlotIterator to iterate through all the pageable slots.\n SlotIterator iterator = this.getPaginationIterator();\n\n PageableInventory<T> inventory = this.getInventory();\n\n // Retrieving the paginated objects.\n List<T> elements = inventory.getOpenedPage().getElements();\n\n int index = 0;\n while(iterator.hasNext()) {\n\n SlotIterator.Slot slot = iterator.next();\n\n ClickableItem item;\n\n // Index is lower than the number of elements of the page\n // so there is an item to add in the inventory.\n if(index < elements.size()) {\n\n T element = elements.get(index);\n\n item = inventory.getPageItem(element);\n\n } else item = null;\n\n super.setItem(slot.getSlot(), item);\n\n index++;\n }\n }", "@Override\n public void onPageScrollStateChanged(int state) {\n // Code goes here\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column OSOADATA.T_ACCEPTED_CUSTOMER_INFO.SECONDCONTACTTEL
public void setSecondcontacttel(String secondcontacttel) { this.secondcontacttel = secondcontacttel == null ? null : secondcontacttel.trim(); }
[ "public void setSecondarycontactphonenumber(java.lang.String param){\n \n this.localSecondarycontactphonenumber=param;\n \n\n }", "public void setSecondarycontactmobilenumber(java.lang.String param){\n \n this.localSecondarycontactmobilenumber=param;\n \n\n }", "public AccountContact setSecondaryPhone(String value) {\n this.secondaryPhone = value;\n return this;\n }", "public java.lang.String getSecondarycontactmobilenumber(){\n return localSecondarycontactmobilenumber;\n }", "public void setContactPhone2(java.lang.String contactPhone2) {\n this.contactPhone2 = contactPhone2;\n }", "@Override\r\n\tpublic void changeOtherContect(String otherContect) throws BaseException {\n\t\tif(otherContect==null || \"\".equals(otherContect))\r\n\t\t\tthrow new BaseException(\"联系方式不能为空\");\r\n\t\t\r\n\t\tSession session = HibernateUtil.getSession();\r\n\t\tTransaction transaction = session.beginTransaction();\r\n\t\tBeanUser_information u = (BeanUser_information)session.get(BeanUser_information.class, BeanUser_information.currentLoginUser.getUser_id());\r\n\t\tu.setOther_contact(otherContect);\r\n\t\tsession.update(u);\r\n\t\tBeanUser_information.currentLoginUser = (BeanUser_information)session.get(BeanUser_information.class, u.getUser_id());\r\n\t\ttransaction.commit();\r\n\t}", "public void setOTHER_TEL(String OTHER_TEL) {\r\n this.OTHER_TEL = OTHER_TEL == null ? null : OTHER_TEL.trim();\r\n }", "public String getContactNum2() {\n\t\treturn contactNum2;\n\t}", "public java.lang.String getSecondarycontactname(){\n return localSecondarycontactname;\n }", "public static void updateContact(int id, int secondid, int cellphoneNumber, String emailAddress, int id2)\r\n\t\t\tthrows SQLException {\r\n\t\tConnection database = DriverManager.getConnection(newPath, user, password);\r\n\t\tStatement stateMent = database.createStatement();\r\n\t\tPreparedStatement prepareStatement = database.prepareStatement(\r\n\t\t\t\t\"update contact_tb set id = ?, secondid = ?, cellphoneNumber = ?, emailaddress = ? where id = ? \");\r\n\t\tprepareStatement.setInt(1, id);\r\n\t\tprepareStatement.setInt(2, secondid);\r\n\t\tprepareStatement.setInt(3, cellphoneNumber);\r\n\t\tprepareStatement.setString(4, emailAddress);\r\n\t\tprepareStatement.setInt(5, id2);\r\n\r\n\t\tprepareStatement.executeUpdate();\r\n\r\n\t}", "public void setCustomer2(String customer2) {\n this.customer2 = customer2;\n }", "public void setPrimarycontactmobilenumber(java.lang.String param){\n \n this.localPrimarycontactmobilenumber=param;\n \n\n }", "@Test\r\n\tpublic void testSetSecondLocalNumber() {\r\n\t\tSystem.out.println(\"Executing testSetSecondLocalNumber\");\r\n\t\tphoneNumber.setSecondLocalNumber(\"5678\");\r\n\t\tassertEquals(\"5678\", phoneNumber.getSecondLocalNumber());\r\n\t}", "public void setPropietorContactNo(String value) {\n setAttributeInternal(PROPIETORCONTACTNO, value);\n }", "public String getCustomerContactTelphone() {\r\n return customerContactTelphone;\r\n }", "public void setCONTACTID(long value) {\r\n this.contactid = value;\r\n }", "public void setCustomerPhoneNumber(String userID, String phoneNumber) throws SQLException {\r\n if (phoneNumber == null || userID == null){\r\n System.out.println(\"Invalid ID or email!\");\r\n return;\r\n }\r\n if (userID.charAt(0) == 'C'){\r\n Customer temp = Company.getCustomer(userID);\r\n temp.setPhoneNumber(phoneNumber);\r\n Company.updateUser(temp);\r\n }\r\n else\r\n System.out.println(\"Invalid ID!\");\r\n }", "public void setRota_person_tel_2(String rota_person_tel_2) {\n this.rota_person_tel_2 = rota_person_tel_2 == null ? null : rota_person_tel_2.trim();\n }", "public void setTelephoneNo(String telephoneNo) {\n this.telephoneNo = telephoneNo;\n }", "public void setSecondaryCode(String secondaryCode) {\n this.secondaryCode = secondaryCode;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("EN-DE PROGRAM"); setBackground(new java.awt.Color(255, 204, 204)); jPanel1.setBackground(new java.awt.Color(255, 204, 204)); jRadioButton1.setText("Encrypt "); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton1ActionPerformed(evt); } }); jRadioButton2.setText("Decrypt "); jRadioButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton2ActionPerformed(evt); } }); jLabel2.setText("Enter Text:"); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jLabel1.setText("Choose (Encrypte OR Decrypt) :"); jLabel3.setText("Output:"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(36, 36, 36) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel2) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jRadioButton1) .addGap(107, 107, 107) .addComponent(jRadioButton2)) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 33, Short.MAX_VALUE)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(24, 24, 24) .addComponent(jLabel2) .addGap(18, 18, 18) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31) .addComponent(jLabel1) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jRadioButton1) .addComponent(jRadioButton2)) .addGap(23, 23, 23) .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(41, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }
[ "public StForm() {\n initComponents();\n }", "public CineForm() {\n initComponents();\n }", "public javaform() {\n initComponents();\n }", "public EditDemographicForm() {\n initComponents();\n }", "public FightForm() {\n initComponents();\n }", "public Form_Main() {\n initComponents();\n }", "public arithmuMainForm() {\n initComponents();\n }", "public FormVerTurma() {\n initComponents();\n }", "public Cusromer() {\n initComponents();\n }", "public GradeForm() {\n initComponents();\n setLocationRelativeTo(null);\n }", "public JFCargo() {\n initComponents();\n }", "public frmHeThongBaiTap() {\n initComponents();\n }", "public Form3() {\n initComponents();\n }", "public GolfGUI3() {\n initComponents();\n }", "public Anual() {\n initComponents();\n }", "public SolidsForm() {\n initComponents();\n initializeComponents();\n }", "public FormDni() {\n initComponents();\n }", "public FirstInputForm() {\n initComponents();\n }", "public Voranmeldung() {\r\n initComponents();\r\n \r\n }", "public E9() {\n initComponents();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.google.protobuf2.Any consensus_state = 2 [(.gogoproto.moretags) = "yaml:&92;"consensus_state&92;""];
public com.google.protobuf2.AnyOrBuilder getConsensusStateOrBuilder() { if (consensusStateBuilder_ != null) { return consensusStateBuilder_.getMessageOrBuilder(); } else { return consensusState_ == null ? com.google.protobuf2.Any.getDefaultInstance() : consensusState_; } }
[ "@SerializedName(\"state\")\n public abstract Optional<String> getState();", "@Test\n public void messageWithMultipleSpans_proto3() {\n messageWithMultipleSpans(SpanBytesEncoder.PROTO3);\n }", "com.google.protobuf.ByteString getStateMessageBytes();", "edu.kit.ipd.crowdcontrol.objectservice.proto.Experiment.State getState();", "private void setSemanticData(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n payloadCase_ = 7;\n payload_ = value;\n }", "proto2.bridge.MessageSet getConfig();", "com.google.protobuf2.AnyOrBuilder getEvidenceOrBuilder();", "protobuf.clazz.s2s.Club_ProxyProto.PlayerStatusOrBuilder getStatusOrBuilder();", "grpc.testing.Messages.BoolValueOrBuilder getResponseCompressedOrBuilder();", "io.envoyproxy.envoy.type.tracing.v3.CustomTag.LiteralOrBuilder getLiteralOrBuilder();", "grpc.testing.Messages.BoolValueOrBuilder getCompressedOrBuilder();", "@Test\n public void messageWithMultipleSpans_proto3() throws Exception {\n messageWithMultipleSpans(PROTO3);\n }", "sawtooth.sdk.protobuf.StateChange.Type getType();", "data.PersonProto.PersonOrBuilder getPersonOrBuilder();", "com.google.protobuf.ByteString getFirstBytes();", "com.google.cloud.rapidmigrationassessment.v1.Collector.State getState();", "public static void main(String[] args) {\n Schema.Parser parser = new Schema.Parser();\n Schema schema = parser.parse(\"{\\n\" +\n \" \\\"type\\\": \\\"record\\\",\\n\" +\n \" \\\"namespace\\\": \\\"com.github.scotts.avro\\\",\\n\" +\n \" \\\"name\\\": \\\"ClimbingGym\\\",\\n\" +\n \" \\\"doc\\\": \\\"Avro Schema for our Climbing Gym\\\",\\n\" +\n \" \\\"fields\\\": [\\n\" +\n \" { \\\"name\\\": \\\"gym_name\\\", \\\"type\\\": \\\"string\\\", \\\"doc\\\": \\\"Name of Climbing Gym\\\" },\\n\" +\n \" { \\\"name\\\": \\\"gym_nickname\\\", \\\"type\\\": \\\"string\\\", \\\"doc\\\": \\\"Nick Name of Climbing Gym\\\" },\\n\" +\n \" { \\\"name\\\": \\\"location\\\", \\\"type\\\": \\\"string\\\", \\\"doc\\\": \\\"Location of the Climbing Gym\\\" },\\n\" +\n \" { \\\"name\\\": \\\"hastopropeclimbing\\\", \\\"type\\\": \\\"boolean\\\", \\\"default\\\": true, \\\"doc\\\": \\\"Field indicating if the climbing gym offers top rope climbing\\\" },\\n\" +\n \" { \\\"name\\\": \\\"hasleadclimbing\\\", \\\"type\\\": \\\"boolean\\\", \\\"default\\\": false, \\\"doc\\\": \\\"Field indicating if the climbing gym offers lead climbing\\\" },\\n\" +\n \" { \\\"name\\\": \\\"hasbouldering\\\", \\\"type\\\": \\\"boolean\\\", \\\"default\\\": true, \\\"doc\\\": \\\"Field indicating if the climbing gym offers bouldering\\\" },\\n\" +\n \" { \\\"name\\\": \\\"hasspeedclimbing\\\", \\\"type\\\": \\\"boolean\\\", \\\"default\\\": false, \\\"doc\\\": \\\"Field indicating if the climbing gym offers speed climbing\\\" }\\n\" +\n \" ]\\n\" +\n \"}\");\n\n //let's create a generic record from our schema\n GenericRecordBuilder climbingGymBuilder = new GenericRecordBuilder(schema);\n climbingGymBuilder.set(\"gym_name\", \"Inner Peaks\");\n climbingGymBuilder.set(\"gym_nickname\", \"New Gym or South End\");\n climbingGymBuilder.set(\"location\", \"Charlotte, NC\");\n climbingGymBuilder.set(\"hasleadclimbing\", true);\n climbingGymBuilder.set(\"hasspeedclimbing\", true);\n GenericData.Record climbingGym = climbingGymBuilder.build();\n\n //let's create a file for that record\n final DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<>(schema);\n try (DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<>(datumWriter)) {\n dataFileWriter.create(climbingGym.getSchema(), new File(\"climbinggym.avro\"));\n dataFileWriter.append(climbingGym);\n System.out.println(\"Created file climbinggym.avro\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //let's read back that newly generated avro file, create a generic record and thumb through some fields\n final File file = new File(\"climbinggym.avro\");\n final DatumReader<GenericRecord> datumReader = new GenericDatumReader<>();\n GenericRecord customerRead;\n try (DataFileReader<GenericRecord> dataFileReader = new DataFileReader<>(file, datumReader)){\n customerRead = dataFileReader.next();\n System.out.println(\"Name of Climbing Gym: \" + customerRead.get(\"gym_name\"));\n System.out.println(\"Nick Name of Climbing Gym: \" + customerRead.get(\"gym_nickname\"));\n System.out.println(\"Location of the Climbing Gym: \" + customerRead.get(\"location\"));\n System.out.println(\"Gym offers top rope climbing?: \" + customerRead.get(\"hastopropeclimbing\"));\n System.out.println(\"Gym offers lead climbing: \" + customerRead.get(\"hasleadclimbing\"));\n System.out.println(\"Gym offers bouldering: \" + customerRead.get(\"hasbouldering\"));\n System.out.println(\"Gym offers speed climbing: \" + customerRead.get(\"hasspeedclimbing\"));\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n\n }", "com.google.protobuf.AnyOrBuilder getSnapshotOrBuilder();", "com.google.protobuf.ByteString getYson();", "grpc.testing.Messages.PayloadOrBuilder getPayloadOrBuilder();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get content type, eg: music,picture, vedio, vcard, etc.
public abstract int getType();
[ "public String getContentType() {\n try {\n URL url = getLocator().getURL();\n String urlFile = url.getFile();\n if (urlFile.endsWith(\".mov\")) return \"video.quicktime\"; else if (urlFile.endsWith(\".mpg\")) return \"video.mpeg\"; else if (urlFile.endsWith(\".avi\")) return \"video.x_msvideo\"; else return \"unknown\";\n } catch (MalformedURLException murle) {\n return \"unknown\";\n }\n }", "public String getContentType() {\n/* 143 */ if (this.contentType == null)\n/* 144 */ this.contentType = getHeaderField(\"content-type\"); \n/* 145 */ if (this.contentType == null) {\n/* 146 */ String str1 = null;\n/* */ try {\n/* 148 */ str1 = guessContentTypeFromStream(getInputStream());\n/* 149 */ } catch (IOException iOException) {}\n/* */ \n/* 151 */ String str2 = this.properties.findValue(\"content-encoding\");\n/* 152 */ if (str1 == null) {\n/* 153 */ str1 = this.properties.findValue(\"content-type\");\n/* */ \n/* 155 */ if (str1 == null) {\n/* 156 */ if (this.url.getFile().endsWith(\"/\")) {\n/* 157 */ str1 = \"text/html\";\n/* */ } else {\n/* 159 */ str1 = guessContentTypeFromName(this.url.getFile());\n/* */ } \n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 171 */ if (str1 == null || (str2 != null && \n/* 172 */ !str2.equalsIgnoreCase(\"7bit\") && \n/* 173 */ !str2.equalsIgnoreCase(\"8bit\") && \n/* 174 */ !str2.equalsIgnoreCase(\"binary\")))\n/* 175 */ str1 = \"content/unknown\"; \n/* 176 */ setContentType(str1);\n/* */ } \n/* 178 */ return this.contentType;\n/* */ }", "@Override\n public String getContentType() {\n String cType = guessContentTypeFromName(getEntryName());\n if (cType == null) {\n cType = \"content/unknown\";\n }\n return cType;\n }", "private static String get_content_type(String file_path) {\n int i = file_path.length() - 1;\n String suffix = null;\n\n for (; i > 0; i--)\n if (file_path.charAt(i) == '.')\n break;\n\n suffix = file_path.substring(i + 1);\n\n if (suffix != null && (suffix.equals(\"html\") || suffix.equals(\"hml\"))) {\n return \"text/html\";\n }\n else if (suffix != null && suffix.equals(\"pdf\")) {\n return \"application/pdf\";\n }\n else if (suffix != null && suffix.equals(\"png\")) {\n return \"image/png\";\n }\n else if (suffix != null && (suffix.equals(\"jpeg\") || suffix.endsWith(\"jpg\"))) {\n return \"image/jpeg\";\n }\n else\n return \"text/plain\";\n }", "public synchronized String getContentType(String paramString)\r\n/* 105: */ {\r\n/* 106:197 */ int i = paramString.lastIndexOf(\".\");\r\n/* 107:199 */ if (i < 0) {\r\n/* 108:200 */ return defaultType;\r\n/* 109: */ }\r\n/* 110:202 */ String str1 = paramString.substring(i + 1);\r\n/* 111:203 */ if (str1.length() == 0) {\r\n/* 112:204 */ return defaultType;\r\n/* 113: */ }\r\n/* 114:206 */ for (int j = 0; j < this.DB.length; j++) {\r\n/* 115:207 */ if (this.DB[j] != null)\r\n/* 116: */ {\r\n/* 117:209 */ String str2 = this.DB[j].getMIMETypeString(str1);\r\n/* 118:210 */ if (str2 != null) {\r\n/* 119:211 */ return str2;\r\n/* 120: */ }\r\n/* 121: */ }\r\n/* 122: */ }\r\n/* 123:213 */ return defaultType;\r\n/* 124: */ }", "protected abstract String getContentType(final String name);", "public static String getContentType_AsString(int type) {\r\n\t\tString mimeString = null;\r\n\t\tswitch (type) {\r\n\t\tcase EducationConstant.CONTENT_TYPE_JPEG:\r\n\t\t\tmimeString = \"JPEG File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_AVI:\r\n\t\t\tmimeString = \"AVI File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_DOC:\r\n\t\t\tmimeString = \"DOC File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_GIF:\r\n\t\t\tmimeString = \"GIF File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_MINDMAP:\r\n\t\t\tmimeString = \"MindMap File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_MPEG:\r\n\t\t\tmimeString = \"MPEG Viedo\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_PDF:\r\n\t\t\tmimeString = \"PDF File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_PPT:\r\n\t\t\tmimeString = \"PPT File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_TEXT:\r\n\t\t\tmimeString = \"Text File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_ZIP:\r\n\t\t\tmimeString = \"Zip File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_XLS:\r\n\t\t\tmimeString = \"XLS File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_DOCX:\r\n\t\t\tmimeString = \"DOCX File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_PPTX:\r\n\t\t\tmimeString = \"PPTX File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_XLSX:\r\n\t\t\tmimeString = \"XLSX File\";\r\n\t\t\tbreak;\r\n\t\tcase EducationConstant.CONTENT_TYPE_SWF:\r\n\t\t\tmimeString = \"Flash File\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tmimeString = null;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn mimeString;\r\n\t}", "public String getContentType(){\n return type;\n }", "private String getContentType(URL page) throws IOException\n\t{\n\t\tURLConnection conn = page.openConnection();\n\t\tString type = conn.getContentType();\n\n\t\t// need to disconnect http connections, because otherwise the\n\t\t// URL\n\t\t// would be cached somewhere... (dunno why)\n\t\tif (conn instanceof HttpURLConnection)\n\t\t\t((HttpURLConnection) conn).disconnect();\n\t\tconn = null;\n\n\t\treturn type;\n\t}", "private String getContentType(String fileRequested) {\n\t\tif (fileRequested.endsWith(\".htm\") || fileRequested.endsWith(\".html\"))\n\t\t\treturn \"text/html\";\n\t\telse\n\t\t\tif (fileRequested.endsWith(\".csv\") )\n\t\t\t\treturn \"text/csv\";\n\t\t\telse\n\t\t\t\tif (fileRequested.endsWith(\".xml\") )\n\t\t\t\t\treturn \"text/xml\";\n\t\t\t\telse\n\t\t\t\t\tif (fileRequested.endsWith(\".css\") )\n\t\t\t\t\t\treturn \"text/css\";\n\t\t\t\t\telse\n\t\t\t\t\t\tif (fileRequested.endsWith(\".mpeg\") )\n\t\t\t\t\t\t\treturn \"video/mpeg\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif (fileRequested.endsWith(\".mp4\") )\n\t\t\t\t\t\t\t\treturn \"video/mp4\";\n\t\t/*\n\t\t Video\tvideo/mpeg\nvideo/mp4\nvideo/quicktime\nvideo/x-ms-wmv\nvideo/x-msvideo\nvideo/x-flv\nvideo/webm*/\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t/*\nImage\t\nimage/gif\nimage/jpeg\nimage/png\nimage/tiff\nimage/vnd.microsoft.icon\nimage/x-icon\nimage/vnd.djvu\nimage/svg+xml\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (fileRequested.endsWith(\".gif\") )\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\treturn \"image/gif\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tif (fileRequested.endsWith(\".jpg\") || fileRequested.endsWith(\".jpeg\") )\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn \"image/jpeg\";\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tif (fileRequested.endsWith(\".png\") )\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\treturn \"image/png\";\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\tif (fileRequested.endsWith(\".tiff\") )\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\treturn \"image/tiff\";\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tif (fileRequested.endsWith(\".svg\") )\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\treturn \"image/svg+xml\";\n\telse\n\t\tif (fileRequested.endsWith(\".mpeg\") ||fileRequested.endsWith(\".mp3\") ||fileRequested.endsWith(\".mp2\") )\n\t\t\treturn \"audio/mpeg\";\n\t\telse\n\t\t\tif (fileRequested.endsWith(\".wma\") )\n\t\t\t\treturn \"audio/x-ms-wma\";\n\t\t\telse\n\t\t\t\t/*\n\t\t\t\t Application\tapplication/EDI-X12\napplication/EDIFACT\napplication/javascript\napplication/octet-stream\napplication/ogg\napplication/pdf\napplication/xhtml+xml\napplication/x-shockwave-flash\napplication/json\napplication/ld+json\napplication/xml\napplication/zip\napplication/x-www-form-urlencoded\n*/\t\t\t\t\t\t\n\t\t\t\tif (fileRequested.endsWith(\".js\") )\n\t\t\t\t\treturn \"application/javascript\";\n\t\t\t\telse\n\t\t\t\t\tif (fileRequested.endsWith(\".json\") )\n\t\t\t\t\t\treturn \"application/json\";\n\t\t\t\t\telse\n\t\t\t\t\t\tif (fileRequested.endsWith(\".pdf\") )\n\t\t\t\t\t\treturn \"application/pdf\";\n\t\t\t\t\telse\n\t\t\t\t\t\tif (fileRequested.endsWith(\".zip\") )\n\t\t\t\t\t\t\treturn \"application/zip\";\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\treturn \"text/plain\";\n\t\t\n\t}", "public String getContentType() \n {\n return contentType;\n }", "public String getType() {\r\n try {\r\n return getHeaderField(\"content-type\");\r\n } catch (IOException x) {\r\n return null;\r\n }\r\n\r\n }", "public int getContentType() {\n return contentType;\n }", "public String getContentType()\n {\n return contentType_;\n }", "public String getContentType()\n {\n return _contentType;\n }", "public String getContentType() {\n\t\tif(this.content_type != null) \n\t\t\treturn this.content_type;\n\t\treturn \"text/html\";\n\t}", "java.lang.String getHttpContentType();", "public String mimeType()\n \t{\n \t\tString result\t\t\t\t= this.mimeType;\n \t\tif ((result == null) && (urlConnection != null))\n \t\t{\n \t\t\tresult\t\t\t\t\t= urlConnection.getContentType();\n \t\t\tif (result != null)\n \t\t\t{\n \t\t\t\t// create the appropriate DocumentType object\n \t\t\t\t// lookout for mime types with charset appened\n \t\t\t\tint semicolonIndex\t= result.indexOf(';');\n \t\t\t\tif (semicolonIndex > 0)\n \t\t\t\t\tresult\t\t\t= result.substring(0, semicolonIndex);\n \t\t\t\tthis.mimeType\t\t= result;\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}", "@SuppressLint(\"DefaultLocale\")\n public static String getMimeType(String url) {\n String type;\n String extension = MimeTypeMap.getFileExtensionFromUrl(url);\n //\tLog.i(\"getMimeType\",\"extension=\"+extension);\n if (extension != null) {\n MimeTypeMap mime = MimeTypeMap.getSingleton();\n type = mime.getMimeTypeFromExtension(extension);\n if (type == null) {\n if (url.toLowerCase().endsWith(\"mp4\")) {\n type = \"video/*\";\n }\n if (url.toLowerCase().endsWith(\"mpg\")) {\n type = \"video/*\";\n }\n if (url.toLowerCase().endsWith(\"xls\")) {\n type = \"application/vnd.ms-excel\";\n }\n if (url.toLowerCase().endsWith(\"xlsx\")) {\n type = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\n }\n if (url.toLowerCase().endsWith(\"doc\")) {\n type = \"application/msword\";\n }\n if (url.toLowerCase().endsWith(\"docx\")) {\n type = \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\";\n }\n }\n return type;\n } else return \"*/*\";\n }", "public String getContentType()\n {\n return _contentType;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column user.update_time
public Date getUpdateTime() { return updateTime; }
[ "public java.sql.Timestamp getUpdateDate() {\n return dto.getUpdateDate();\n }", "public Date getLast_update_time() {\n return last_update_time;\n }", "public Timestamp getUpdateTimestamp() {\n return this.ojv_update_timestamp;\n }", "public Date getUpdatedTime() {\n return mUpdatedTime;\n }", "@Schema(example = \"1616131131\", required = true, description = \"The time of the latest update of transaction\")\n public Long getUpdatedAt() {\n return updatedAt;\n }", "public java.lang.String getUpdatetime() {\n java.lang.Object ref = updatetime_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n updatetime_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getUpdatetime() {\n java.lang.Object ref = updatetime_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n updatetime_ = s;\n return s;\n }\n }", "public Date getuUpdate() {\n return uUpdate;\n }", "public Date getLastUpdatedTime();", "public Date getUpdateDateTime() {\n\n return updateDateTime;\n }", "public Long getUpdateUserId() {\n return this.updateUserId;\n }", "public Timestamp getDateUpdate( )\n {\n return _dateUpdate;\n }", "public com.google.protobuf.ByteString\n getUpdatetimeBytes() {\n java.lang.Object ref = updatetime_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n updatetime_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public Date getUpdate() {\n return this.update;\n }", "public String getStatusUpdatedTime()\n {\n return this.manager.statusUpdatedTime;\n }", "@Schema(description = \"date the vat report was last updated\")\n public OffsetDateTime getUpdate() {\n return update;\n }", "public String getUpdate() {\n\t\tint user_id = 0;\n\t\tString identity_id = \"EWQGEFEAFDSA\";\n\t\tString last_update_time = \"2012:12:20\";\n\t\tif (TextUtils.isEmpty(last_update_time)) {\n\t\t\tlast_update_time = \"0000-00-00 00:00:00\";\n\t\t}\n\t\treturn getUpdate(user_id, identity_id, last_update_time);\n\t}", "public long getUpdateDate() { return this.updateDate; }", "public long getUpdatedOn() {\n return updatedOn;\n }", "@ApiModelProperty(value = \"The update time of the policy.\")\n public String getUpdateTime() {\n return updateTime;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes requests for both HTTP GET and POST methods.
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet eliminarPiezaServlet</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet eliminarPiezaServlet at " + request.getContextPath() + "</h1>"); out.println("</body>"); out.println("</html>"); } }
[ "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n Enumeration<String> parameterNames = request.getParameterNames(); //checking for unappropriate parameters\r\n if (parameterNames.hasMoreElements()) {\r\n processRequest(request, response);\r\n } else {\r\n doPost(request, response);\r\n }\r\n }", "@Override\n\tpublic void handle(String target, Request baseRequest, HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws IOException, ServletException {\n\n\t\tSystem.out.println(\"HTTP Request received\\n\" + baseRequest.getRemoteHost());\n\n\t\ttry {\n\n\t\t\t//Route GET requests\n\t\t\tif (baseRequest.getMethod().equals(\"GET\")) {\n\t\t\t\tbaseRequest.setHandled(true);\n\t\t\t\tprocessGETRequests(target, baseRequest, request, response);\n\t\t\t\t\n\t\t\t\t//Process POST requests\n\t\t\t}else if (baseRequest.getMethod().equals(\"POST\")) {\n\t\t\t\tbaseRequest.setHandled(true);\n\t\t\t\tprocessPOSTRequests(target, baseRequest, request, response);\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\n\t\t\t//TODO: Handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "@Override\n\tpublic String process(HttpServletRequest req, HttpServletResponse res) throws Exception {\n\t\tif (req.getMethod().equalsIgnoreCase(\"GET\")) {\n\t\t\treturn processForm(req, res);\n\t\t} else if (req.getMethod().equalsIgnoreCase(\"POST\")) {\n\t\t\treturn processSubmit(req, res);\n\t\t} else {\n\t\t\tres.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n\t\t\treturn null;\n\t\t}\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n processRequest(req, resp); // calling processRequest method\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // processRequest(request, response);\n doGet(request,response);\n }", "@Override\r\n\tprotected void service(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {\n\t\tString method = arg0.getMethod();\r\n\t\tif (\"GET\".equals(method)) {\r\n\t\t\tSystem.out.println(\"请求方法:GET\");\r\n\t\t\tdoGet(arg0, arg1);\r\n\t\t} else if (\"POST\".equals(method)) {\r\n\t\t\tSystem.out.println(\"请求方法:POST\");\r\n\t\t\tdoPost(arg0, arg1);\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"请求方法分辨失败!\");\r\n\t\t}\r\n\t}", "void processRequest(HttpServletRequest request, HttpServletResponse response) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request,\n HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n protected void doGet( HttpServletRequest request , HttpServletResponse response )\n throws ServletException ,\n IOException {\n processRequest( request , response );\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n doPost(request, response);\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n \n }", "RequestProcessingActions processRequest(ModifiableHttpRequest request);", "protected abstract RequestDispatcher processGetRequestForDispatcher(\n HttpServletRequest request);", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n String method = request.getParameter(\"method\");\r\n if (method != null) {\r\n switch (method.toLowerCase()) {\r\n case \"put\":\r\n put(request, response);\r\n break;\r\n case \"delete\":\r\n delete(request, response);\r\n break;\r\n default:\r\n error(response, HttpServletResponse.SC_BAD_REQUEST, \"Bad parameter 'method': \" + method);\r\n }\r\n } else {\r\n post(request, response);\r\n }\r\n } catch (Throwable e) {\r\n error(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, new Exception(e).getCause());\r\n }\r\n }", "@Override\r\n\tpublic void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tmanageRequest(req.getInputStream(), resp);\r\n\t}", "@Override\n\tprotected void doGet (HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tprocessRequest (request, response);\n\t}", "@Override\r\n\r\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\r\n\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n this.processRequest(request, response);\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n String target = parseURI(req);\n ObjectMapper mapper = new ObjectMapper();\n try{\n switch (target) {\n case \"purchase\":\n TicketPurchaseDTO ticketDTO = mapper.readValue(req.getInputStream(), TicketPurchaseDTO.class);\n resp.setStatus(ticketService.purchaseTicket(ticketDTO, conn));\n if(resp.getStatus() == 406) {\n resp.getWriter().println(\"Flight is sold out.\");\n } else {\n resp.getWriter().println(\"Ticket sold.\");\n }\n break;\n case \"createCustomer\":\n CustomerInfo customerDTO = mapper.readValue(req.getInputStream(), CustomerInfo.class);\n resp.setStatus(customerService.createCustomer(customerDTO, conn));\n break;\n case \"createFlight\":\n FlightDTO flightDTO = mapper.readValue(req.getInputStream(), FlightDTO.class);\n resp.setStatus(flightService.createFlight(flightDTO, conn));\n break;\n default:\n resp.setStatus(501);\n }\n } catch (Exception e) {\n FileLogger.getFileLogger().writeExceptionToFile(e);\n }\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse response) {\n\t\tdoGet(req, response);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to fetch the best price quote amongst a list of Service Providers for airlines
@RequestMapping(value = "/v1/air/") public ResponseEntity<Object> getAirlineQuotes(){ return ResponseEntity.ok().body( service.selectBestTripPlan(initializeAirlines(), "Dallas", "Miami")); }
[ "Product getLowestCurrentAvailablePrice(String productName);", "public interface PriceService {\n long getPrice(long orderId);\n\n List<String> getSupportedCurrencies();\n}", "double servicePrice();", "void getMarketPriceData();", "public static Product findMostExpensiveItem(Store store) {\r\n\t\t\r\n\t\t//follows the same process as findLeastExpensiveItem() except this one is for highest price\r\n\t\tArrayList<Product> items = new ArrayList<Product>();\r\n\t\titems = store.getItemsInStock();\r\n\t\titems.remove(0);\r\n\t\t\r\n\t\tArrayList<Double> prices = new ArrayList<Double>();\r\n\t\t\r\n\t\tfor(Product prod: items) {\r\n\t\t\tString sPrice = prod.getProductPrice();\r\n\t\t\tdouble num = Double.parseDouble(sPrice);\r\n\t\t\tprices.add(num);\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < prices.size()-1; i++){\r\n\t\t\tdouble x, y;\r\n\t\t\tx = prices.get(i);\r\n\t\t\ty = prices.get(i+1);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\tif(x > y) {\r\n\t\t\t\tprices.set(i, y);\r\n\t\t\t\tprices.set(i+1, x);\r\n\t\t\t\tint z = i;\r\n\t\t\t\twhile(z > 0) {\r\n\t\t\t\t\tdouble a = prices.get(z);\r\n\t\t\t\t\tdouble b = prices.get(z-1);\r\n\t\t\t\t\tif(a < b) {\r\n\t\t\t\t\t\tprices.set(z-1, a);\r\n\t\t\t\t\t\tprices.set(z, b);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tz--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tdouble mostPrice = prices.get(prices.size()-1);\r\n\t\tString sNewPrice = Double.toString(mostPrice);\r\n\t\t\r\n\t\tString name = \"n\";\r\n\t\tString price = \"p\";\r\n\t\tString type = \"t\";\r\n\t\t\r\n\t\tProduct mostExpProd = new Product(name, price, type);\r\n\t\tfor(Product prod: items) {\r\n\t\t\tif(sNewPrice.equals(prod.getProductPrice())) {\r\n\t\t\t\tmostExpProd = prod;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn mostExpProd;\r\n\t}", "public double getCheapestPrice()\r\n\t{\r\n\t\tif (prices != null)\r\n\t\t{\r\n\t\t\treturn prices[0];\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public static List<Price> getPrices() {\n\n List<Price> details = null;\n details = new ArrayList<Price>();\n\n try {\n URL url = new URL(\"http://35.190.169.87:9000/test/price\");\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));\n StringBuilder result = new StringBuilder();\n String line;\n\n while ((line = reader.readLine()) != null) {\n result.append(line);\n }\n\n urlConnection.disconnect();\n\n //https://stackoverflow.com/questions/26309773/deserialize-type-extending-abstract-class-in-gson\n Type targetClassType = new TypeToken<ArrayList<Price>>() {\n }.getType();\n ArrayList<Price> priceList = new Gson().fromJson(result.toString(), targetClassType);\n\n Iterator<Price> it = priceList.iterator();\n int i = 0;\n\n while (it.hasNext()) {\n Price p = it.next();\n Price item = new Price();\n ArrayList<String> selected = selectedItems;\n if (selectedItems.contains(p.itemId.name)) {\n item.id = p.id;\n item.itemId = p.itemId;\n item.note = p.note;\n item.price = p.price;\n item.storeId = p.storeId;\n details.add(item);\n i++;\n }\n }\n\n } catch (Exception ex) {\n\n } finally {\n\n }\n return details;\n }", "java.lang.String getPriceMax();", "protected final long getBestBuyPrice() {\n\t\tif (orderBuys == null || orderBuys.size() == 0) {\n\t\t\treturn stockPrice;\n\t\t}\n\t\treturn orderBuys.get(0).getLong(\"price\");\n\t}", "PriceAdapter getAdapter();", "public void getProductPriceAmazon() {\n\t\t\n\t}", "public Price getPricePerStockOption(ProductStockOption productStockOption) {\n\n SQLiteDatabase database = null;\n Cursor cursor = null;\n Price price = null;\n\n try {\n DatabaseHelper dbHelper = new DatabaseHelper(GlobalContext.getInstance());\n database = dbHelper.getReadableDatabase();\n String whereClause = PRICES.STOCK_OPTION_ID + \" = ?\";\n String[] whereArgs = {\"\" + productStockOption._id};\n cursor = database.query(PRICES.TABLE_NAME, null, whereClause, whereArgs, null, null, null);\n if (cursor.moveToFirst()) {\n\n price = new Price();\n\n price._id = getIntValue(cursor, PRICES._ID);\n price.stock_option_id = getStringValue(cursor, PRICES.STOCK_OPTION_ID);\n price.single_item_price = getStringValue(cursor, PRICES.SINGLE_ITEM_PRICE);\n price.one = getStringValue(cursor, PRICES.ONE);\n price.two = getStringValue(cursor, PRICES.TWO);\n price.three = getStringValue(cursor, PRICES.THREE);\n price.four = getStringValue(cursor, PRICES.FOUR);\n price.five = getStringValue(cursor, PRICES.FIVE);\n price.six = getStringValue(cursor, PRICES.SIX);\n price.seven = getStringValue(cursor, PRICES.SEVEN);\n price.eight = getStringValue(cursor, PRICES.EIGHT);\n price.nine = getStringValue(cursor, PRICES.NINE);\n price.ten = getStringValue(cursor, PRICES.TEN);\n price.eleven = getStringValue(cursor, PRICES.ELEVEN);\n price.twelve = getStringValue(cursor, PRICES.TWELVE);\n price.fifteen = getStringValue(cursor, PRICES.FIFTEEN);\n price.twenty = getStringValue(cursor, PRICES.TWENTY);\n price.thirty = getStringValue(cursor, PRICES.THIRTY);\n price.fifty = getStringValue(cursor, PRICES.FIFTY);\n price.hundred = getStringValue(cursor, PRICES.HUNDERED);\n price.hundred_fifty = getStringValue(cursor, PRICES.HUNDERED_FIFTY);\n price.two_hundred = getStringValue(cursor, PRICES.TWO_HUNDERED);\n price.five_hundred = getStringValue(cursor, PRICES.FIVE_HUNDERED);\n price.seven_hundred = getStringValue(cursor, PRICES.SEVEN_HUNDERED);\n price.thousand = getStringValue(cursor, PRICES.THOUSAND);\n price.two_thousand = getStringValue(cursor, PRICES.TWO_THOUSAND);\n price.five_thousand = getStringValue(cursor, PRICES.FIVE_THOUSAND);\n\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n if (database != null) {\n database.close();\n }\n if (cursor != null && !cursor.isClosed()) {\n cursor.close();\n }\n }\n\n\n return price;\n }", "public void searchByPrice()\n {\n System.out.print(\"Please enter the minimum price of cars you want \" +\n \"to search: \");\n String minimumPriceString = acceptUserInput();\n try\n {\n int minimumPrice = isValidPrice(minimumPriceString);\n\n System.out.print(\"Please enter the maximum price of cars you \" +\n \"want to search: \");\n String maximumPriceString = acceptUserInput();\n int maximumPrice = isValidMaximumPrice(minimumPrice, maximumPriceString);\n\n CarDatabase carsFound = carDatabase.getCarsByPrice\n (minimumPrice, maximumPrice);\n System.out.println(carsFound.getNumberOfCar() + \" car(s) found!\");\n carsFound.displayCars();\n }\n catch(IllegalArgumentException exception)\n {\n System.out.println(exception.getMessage());\n }\n }", "@Test\n void calculateTotalPriceAndTotalDepositAmountForQuote1() {\n requestedDates = new DateRange(LocalDate.of(2016, 1, 5), LocalDate.of(2016, 1, 8));\n defaultPricePolicy = new DefaultPricingPolicy();\n \n totalPriceforQuote = defaultPricePolicy.calculatePrice(bikeCollection1, requestedDates);\n for (Bike bike : bikeCollection1) {\n totalDepositAmountforQuote = totalDepositAmountforQuote.add(testQuote1.getProvider().getValuationPolicy()\n .calculateValue(bike, requestedDates.getStart()).multiply(testQuote1.getProvider().getDepositRate()));\n }\n totalDepositAmountforQuote = totalDepositAmountforQuote.setScale(2,RoundingMode.HALF_EVEN);\n testQuote1 = new Quote(bikeProvider1,bikeCollection1,totalPriceforQuote,totalDepositAmountforQuote);\n\n \n assertEquals(new BigDecimal(72),testQuote1.getTotalPrice());\n assertEquals(new BigDecimal(\"252.00\"),testQuote1.getTotalDepositAmount());\n \n }", "@Override\n public Double getTopBuyOrderPrice(ExchangePair currencyPair) {\n String url = this.BASE_URL + \"/markets/\" + formatExchangePair(currencyPair) + \"/orderbook?depth=1\";\n try {\n String jsonResponse = this.restService.getPostsPlainJSON(url);\n ObjectMapper objectMapper = new ObjectMapper();\n JsonNode jsonRootNode = objectMapper.readTree(jsonResponse);\n return jsonRootNode.get(\"result\").get(\"bids\").get(0).get(0).asDouble();\n } catch (RestClientException ex) {\n System.out.println(\"FTX Buy Fetch Failed\");\n } catch (IOException ex) {\n System.out.println(\"FTX Buy Fetch Failed\");\n }\n return null;\n }", "private void getPhonePrice() {\n int ram = Integer.parseInt(Constants.DEVICE_RAM);\n int storage = Integer.parseInt(Constants.DEVICE_STORAGE);\n connector = new HTTPConnector(TAG_CLASS, context, Constants.QUERY_URL,\n ParamsCreator.createParamsForPhonePrice(id, ram, storage), this);\n connector.makeQuery(TAG_CLASS);\n }", "public void fetchPrice(){\n setPrice(StockService.getPrice(ticker).doubleValue());\n }", "public double getPrice(IArticle article);", "private VOPricedOption getPricedOption(VOPriceModel retrievedPriceModel) {\n return retrievedPriceModel.getSelectedParameters().get(2)\n .getPricedOptions().get(0);\n }", "private List<QuoteSupportLookup> lookup(final ProvQuote quote, final Integer seats, final SupportType accessApi,\n\t\t\tfinal SupportType accessEmail, final SupportType accessChat, final SupportType accessPhone,\n\t\t\tfinal Rate level) {\n\t\tfinal var node = quote.getSubscription().getNode().getRefined().getId();\n\t\treturn spRepository.findAll(node).stream().filter(sp -> sp.getType().getSeats() == null || seats != null)\n\t\t\t\t.filter(sp -> filter(accessApi, sp.getType().getAccessApi()))\n\t\t\t\t.filter(sp -> filter(accessChat, sp.getType().getAccessChat()))\n\t\t\t\t.filter(sp -> filter(accessEmail, sp.getType().getAccessEmail()))\n\t\t\t\t.filter(sp -> filter(accessPhone, sp.getType().getAccessPhone()))\n\t\t\t\t.filter(sp -> filter(level, sp.getType().getLevel())).map(sp -> newPrice(quote, sp, seats))\n\t\t\t\t.sorted((p1, p2) -> (int) (p1.getCost() - p2.getCost())).toList();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form PartsInstalled
public ManageInstallParts() throws ParseException, SQLException { initComponents(); setModal(true); setTitle("Manage Install Parts"); this.installTable.setModel(TableModel); TableModel.loadInstalled(); custNames = TableModel.getAllCustomerNames(); vehicleRegs = TableModel.getAllVehicleRegs(); for(int i =0; i<vehicleRegs.size();i++){ v = Database.getInstance().getAllVehiclesForPartsInstalled(vehicleRegs.get(i)); this.VehicleDetailsTable.setModel(vTableModel); for (Vehicle vehicle : v){ vTableModel.addRow(vehicle); } } for(int i =0; i<custNames.size();i++){ c = Database.getInstance().getCustomersWithNameForParts(custNames.get(i)); this.CustomerDetailsTable.setModel(cTableModel); for (Customer customer : c) { cTableModel.addRow(customer); } } DefaultTableCellRenderer leftRenderer = new DefaultTableCellRenderer(); leftRenderer.setHorizontalAlignment(DefaultTableCellRenderer.LEFT); installTable.getColumn("ID").setCellRenderer(leftRenderer); installTable.getColumn("ID").setMaxWidth(40); installTable.getColumn("Booking ID").setCellRenderer(leftRenderer); installTable.getColumn("Booking ID").setPreferredWidth(30); installTable.getColumn("Date Booked").setCellRenderer(leftRenderer); installTable.getColumn("Vehicle Registration").setCellRenderer(leftRenderer); installTable.getColumn("Customer Name").setCellRenderer(leftRenderer); installTable.getColumn("Customer Name").setMinWidth(100); installTable.getColumn("Part Name").setCellRenderer(leftRenderer); installTable.getColumn("Part Name").setMinWidth(100); installTable.getColumn("Quantity").setCellRenderer(leftRenderer); installTable.getColumn("Quantity").setPreferredWidth(20); installTable.getColumn("Date Installed").setCellRenderer(leftRenderer); installTable.getColumn("Waranty Expiry Date").setCellRenderer(leftRenderer); CustomerDetailsTable.getColumn("ID").setCellRenderer(leftRenderer); CustomerDetailsTable.getColumn("ID").setMaxWidth(30); CustomerDetailsTable.getColumn("Full Name").setMinWidth(150); CustomerDetailsTable.getColumn("Email Address").setMinWidth(200); VehicleDetailsTable.getColumn("Engine Size").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("CustomerID").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("WarrantyID").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("Current Mileage").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("Model").setMaxWidth(50); VehicleDetailsTable.getColumn("Make").setMaxWidth(75); VehicleDetailsTable.getColumn("MOT Renewal Date").setMinWidth(100); VehicleDetailsTable.getColumn("Last Service Date").setMinWidth(100); VehicleDetailsTable.getColumn("Current Mileage").setMaxWidth(60); VehicleDetailsTable.getColumn("Registration No").setHeaderValue("Reg No."); VehicleDetailsTable.getColumn("Current Mileage").setHeaderValue("Mileage"); VehicleDetailsTable.getColumn("MOT Renewal Date").setHeaderValue("MOT Renew Date"); VehicleDetailsTable.getColumn("Last Service Date").setHeaderValue("Serviced Date"); }
[ "public void addNewPart(Part part) {\r\n\r\n part.setPartID(inventory.getCurrentPartID());\r\n inventory.iterateCurrentPartID();\r\n// partsTable.getItems().add(part);\r\n inventory.addPart(part);\r\n }", "@Override\n\tpublic abstract void createPartControl();", "private void addNewPart(Part part) {\n CardView view = part.createPartItemView(this);\n // Binding listener\n view.setOnClickListener(itemClickListener());\n view.setOnLongClickListener(itemLongClickListener());\n\n // add tag to view for identify it\n view.setTag(part.savePath);\n // add to container\n llMainContainer.addView(view);\n }", "@SuppressWarnings(\"unchecked\")\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\r\n private void initComponents() {\r\n\r\n bt_listParts = new javax.swing.JButton();\r\n bt_listPartsService = new javax.swing.JButton();\r\n bt_addParts = new javax.swing.JButton();\r\n\r\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r\n setTitle(\"GestRepair - Menu Peças\");\r\n setResizable(false);\r\n\r\n bt_listParts.setText(\"Lista de Peças\");\r\n\r\n bt_listPartsService.setText(\"Lista de Peças por Serviço\");\r\n\r\n bt_addParts.setText(\"Adicionar Peça\");\r\n\r\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\r\n getContentPane().setLayout(layout);\r\n layout.setHorizontalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addContainerGap()\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\r\n .addComponent(bt_listPartsService, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)\r\n .addComponent(bt_listParts, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addComponent(bt_addParts, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n );\r\n layout.setVerticalGroup(\r\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\r\n .addGroup(layout.createSequentialGroup()\r\n .addContainerGap()\r\n .addComponent(bt_listParts)\r\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\r\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\r\n .addComponent(bt_listPartsService)\r\n .addComponent(bt_addParts))\r\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\r\n );\r\n\r\n setSize(new java.awt.Dimension(542, 113));\r\n setLocationRelativeTo(null);\r\n }", "protected Part createPart(String aName) { return null; }", "PartOptions createPartOptions();", "public void createPartControl(Composite parent) {\n \t\tinitializeImages();\n \t\tsashForm = new SashForm(parent, SWT.VERTICAL);\n \t\tsashForm.setLayoutData(new GridData(GridData.FILL_BOTH));\n \t\ttableViewer = createTable(sashForm);\n \t\tinnerSashForm = new SashForm(sashForm, SWT.HORIZONTAL);\n \t\ttagViewer = createTagTable(innerSashForm);\n \t\ttextViewer = createText(innerSashForm);\n \t\tsashForm.setWeights(new int[] { 70, 30 });\n \t\tinnerSashForm.setWeights(new int[] { 50, 50 });\n \t\tcontributeActions();\n \t\tsetViewerVisibility();\n \t\t// set F1 help\n\t\tWorkbenchHelp.setHelp(tableViewer.getControl(), IHelpContextIds.RESOURCE_HISTORY_VIEW);\n \t\tinitDragAndDrop();\n \t}", "@FXML\r\n private void addBtnAction() {\r\n \r\n if (!partsTbl.getSelectionModel().isEmpty()) {\r\n Part part = partsTbl.getSelectionModel().getSelectedItem();\r\n associatedPartsTbl.getItems().add(part);\r\n updateAssociatedPartsTable(associatedPartsTbl.getItems());\r\n } else {\r\n displayMessage(\"You have to select a part to add.\");\r\n }\r\n }", "public void createPartControl(final Composite parent) {\n \t\tparent.setLayout(new FillLayout());\n \n \t\tfinal FormToolkit tempToolkit = new FormToolkit(parent.getDisplay());\n \n \t\tresultSuccessColor = new Color(Display.getCurrent(), 0, 94, 13);\n \t\tresultFailureColor = new Color(Display.getCurrent(), 190, 0, 0);\n \t\tresultNeutralColor = new Color(Display.getCurrent(), 0, 0, 0);\n \t\tresultExceptionColor = new Color(Display.getCurrent(), 204, 163, 0);\n \n \t\tresultSuccessIconImage = Activator.getImageDescriptor(\"icons/suite_success_big.png\").createImage();\n \t\tresultFailureIconImage = Activator.getImageDescriptor(\"icons/suite_failure_big.png\").createImage();\n \t\tresultExceptionIconImage = Activator.getImageDescriptor(\"icons/suite_exception_big.png\").createImage();\n \n \t\tsashForm = new SashForm(parent, SWT.HORIZONTAL | SWT.SMOOTH);\n \n \t\ttreeContainer = new Form(sashForm, SWT.NONE);\n \t\ttreeContainer.setText(\"Not connected\");\n \t\ttreeContainer.getBody().setLayout(new FormLayout());\n \t\ttreeContainer.setBackground(tempToolkit.getColors().getBackground());\n \t\ttreeContainer.setForeground(tempToolkit.getColors().getColor(IFormColors.TITLE));\n \t\ttreeContainer.setFont(JFaceResources.getHeaderFont());\n \t\ttempToolkit.decorateFormHeading(treeContainer);\n \n \t\texecutionProgress = new ProgressBar(treeContainer.getBody(), SWT.NONE);\n \t\tFormData tempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 0);\n \t\ttempFormData.right = new FormAttachment(100, 0);\n \t\ttempFormData.top = new FormAttachment(0, 0);\n \t\ttempFormData.bottom = new FormAttachment(0, 16);\n \t\texecutionProgress.setLayoutData(tempFormData);\n \n \t\ttreeViewer = new TreeViewer(treeContainer.getBody(), SWT.VIRTUAL | SWT.H_SCROLL | SWT.V_SCROLL);\n \t\ttreeViewer.setUseHashlookup(true);\n \t\ttreeViewer.setContentProvider(new TestTreeContentProvider(treeViewer));\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 0);\n \t\ttempFormData.right = new FormAttachment(100, 0);\n \t\ttempFormData.top = new FormAttachment(executionProgress, 0);\n \t\ttempFormData.bottom = new FormAttachment(100, 0);\n \t\ttreeViewer.getTree().setLayoutData(tempFormData);\n \n \t\tdetailsContainer = new Composite(sashForm, SWT.NONE);\n \t\tdetailsContainer.setLayout(new FillLayout());\n \n \t\tdetails = new ScrolledForm(detailsContainer, SWT.V_SCROLL | SWT.H_SCROLL);\n \t\tdetails.setExpandHorizontal(true);\n \t\tdetails.setExpandVertical(true);\n \t\tdetails.setBackground(tempToolkit.getColors().getBackground());\n \t\tdetails.setForeground(tempToolkit.getColors().getColor(IFormColors.TITLE));\n \t\tdetails.setFont(JFaceResources.getHeaderFont());\n \t\tdetails.getBody().setLayout(new FormLayout());\n \t\ttempToolkit.decorateFormHeading(details.getForm());\n \n \t\tfixtureLinkGroup = new HyperlinkGroup(parent.getDisplay());\n \t\tfixtureLink = new Hyperlink(details.getBody(), SWT.NONE);\n \t\tfixtureLink.setBackground(details.getBackground());\n \t\tfixtureLink.setText(\"\");\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(0, 3);\n \t\ttempFormData.height = 10;\n \t\tfixtureLink.setLayoutData(tempFormData);\n \t\tfixtureLink.addHyperlinkListener(new HyperlinkAdapter() {\n \t\t\tpublic void linkActivated(HyperlinkEvent e) {\n \t\t\t\tjumpToJavaMethod(e.getLabel());\n \t\t\t}\n \t\t});\n \t\tfixtureLinkGroup.add(fixtureLink);\n \n \t\tdetailGroups = new Composite(details.getBody(), SWT.NONE);\n \t\tdetailGroups.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));\n \t\tdetailGroups.setLayout(new FormLayout());\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(fixtureLink, 10);\n \t\ttempFormData.bottom = new FormAttachment(100, 0);\n \t\tdetailGroups.setLayoutData(tempFormData);\n \n \t\tresultSection = tempToolkit.createSection(detailGroups, Section.TITLE_BAR);\n \t\tresultSection.setText(\"Result\");\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(0, 10);\n \t\ttempFormData.bottom = new FormAttachment(0, 202);\n \t\tresultSection.setLayoutData(tempFormData);\n \t\tresultSection.setLayout(new FillLayout());\n \n \t\tresultComposite = tempToolkit.createComposite(resultSection);\n \t\ttempToolkit.paintBordersFor(resultComposite);\n \t\tresultSection.setClient(resultComposite);\n \t\tresultComposite.setLayout(new FormLayout());\n \n \t\tparameterSection = tempToolkit.createSection(detailGroups, Section.TITLE_BAR);\n \t\tparameterSection.setText(\"Parameters\");\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(resultSection, 10);\n \t\ttempFormData.bottom = new FormAttachment(resultSection, 140, SWT.BOTTOM);\n \t\tparameterSection.setLayoutData(tempFormData);\n \t\tparameterSection.setLayout(new FillLayout());\n \n \t\tparameterComposite = tempToolkit.createComposite(parameterSection);\n \t\ttempToolkit.paintBordersFor(parameterComposite);\n \t\tparameterSection.setClient(parameterComposite);\n \t\tparameterComposite.setLayout(new FillLayout());\n \n \t\tparameterTable = new TableViewer(parameterComposite);\n \t\tparameterTable.setContentProvider(new ArrayContentProvider());\n \t\tconfigureTable(parameterTable);\n \n \t\tvariableSection = tempToolkit.createSection(detailGroups, Section.TITLE_BAR);\n \t\tvariableSection.setText(\"Variable definitions\");\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(parameterSection, 10);\n \t\ttempFormData.bottom = new FormAttachment(parameterSection, 160, SWT.BOTTOM);\n \t\tvariableSection.setLayoutData(tempFormData);\n \t\tvariableSection.setLayout(new FillLayout());\n \n \t\tvariableComposite = tempToolkit.createComposite(variableSection);\n \t\ttempToolkit.paintBordersFor(variableComposite);\n \t\tvariableSection.setClient(variableComposite);\n \t\tvariableComposite.setLayout(new FillLayout());\n \n \t\tvariableTable = new TableViewer(variableComposite);\n \t\tvariableTable.setContentProvider(new ArrayContentProvider());\n \t\tconfigureTable(variableTable);\n \n \t\tresultComposite = tempToolkit.createComposite(resultSection);\n \t\ttempToolkit.paintBordersFor(resultComposite);\n \t\tresultSection.setClient(resultComposite);\n \t\tresultComposite.setLayout(new FormLayout());\n \n \t\tresultLine1Name = new Label(resultComposite, SWT.WRAP);\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(0, 4);\n \t\tresultLine1Name.setLayoutData(tempFormData);\n \n \t\tresultLine1Border = new Composite(resultComposite, SWT.NONE);\n \t\tresultLine1Border.setForeground(resultNeutralColor);\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(resultLine1Name, 2);\n \t\ttempFormData.bottom = new FormAttachment(resultLine1Name, 80);\n \t\tresultLine1Border.setLayoutData(tempFormData);\n \t\tFillLayout tempFill = new FillLayout();\n \t\ttempFill.marginHeight = 1;\n \t\ttempFill.marginWidth = 1;\n \t\tresultLine1Border.setLayout(tempFill);\n \t\tconfigureTextFieldBorder(resultLine1Border);\n \n \t\tresultLine1Text = new Text(resultLine1Border, SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);\n \t\tresultLine1Text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));\n \n \t\tresultLine2Name = new Label(resultComposite, SWT.WRAP);\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(resultLine1Border, 6);\n \t\tresultLine2Name.setLayoutData(tempFormData);\n \n \t\tresultLine2Border = new Composite(resultComposite, SWT.NONE);\n \t\tresultLine2Border.setForeground(resultNeutralColor);\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(0, 5);\n \t\ttempFormData.right = new FormAttachment(100, -5);\n \t\ttempFormData.top = new FormAttachment(resultLine2Name, 2);\n \t\ttempFormData.bottom = new FormAttachment(resultLine2Name, 80);\n \t\tresultLine2Border.setLayoutData(tempFormData);\n \t\ttempFill = new FillLayout();\n \t\ttempFill.marginHeight = 1;\n \t\ttempFill.marginWidth = 1;\n \t\tresultLine2Border.setLayout(tempFill);\n \t\tconfigureTextFieldBorder(resultLine2Border);\n \n \t\tresultLine2Text = new Text(resultLine2Border, SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL);\n \t\tresultLine2Text.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));\n \n \t\tresultFailureIcon = new Label(resultComposite, SWT.NONE);\n \t\tresultFailureIcon.setImage(resultFailureIconImage);\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(50, -24);\n \t\ttempFormData.top = new FormAttachment(0, 10);\n \t\ttempFormData.width = 48;\n \t\ttempFormData.height = 48;\n \t\tresultFailureIcon.setLayoutData(tempFormData);\n \n \t\tresultSuccessIcon = new Label(resultComposite, SWT.NONE);\n \t\tresultSuccessIcon.setImage(resultSuccessIconImage);\n \t\ttempFormData = new FormData();\n \t\ttempFormData.right = new FormAttachment(resultFailureIcon, -16);\n \t\ttempFormData.top = new FormAttachment(0, 10);\n \t\ttempFormData.width = 48;\n \t\ttempFormData.height = 48;\n \t\tresultSuccessIcon.setLayoutData(tempFormData);\n \n \t\tresultExceptionIcon = new Label(resultComposite, SWT.NONE);\n \t\tresultExceptionIcon.setImage(resultExceptionIconImage);\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(resultFailureIcon, 16);\n \t\ttempFormData.top = new FormAttachment(0, 10);\n \t\ttempFormData.width = 48;\n \t\ttempFormData.height = 48;\n \t\tresultExceptionIcon.setLayoutData(tempFormData);\n \n \t\tresultSuccessCountLabel = new Label(resultComposite, SWT.CENTER);\n \t\tresultSuccessCountLabel.setText(\"123\");\n \t\tresultSuccessCountLabel.setForeground(resultSuccessColor);\n \t\tFontData[] tempFontData = resultSuccessCountLabel.getFont().getFontData();\n \t\ttempFontData[0].setHeight(16);\n \t\ttempFontData[0].setStyle(SWT.BOLD);\n \t\tresultSuccessCountLabel.setFont(new Font(Display.getCurrent(), tempFontData[0]));\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(resultSuccessIcon, -32, SWT.CENTER);\n \t\ttempFormData.top = new FormAttachment(resultSuccessIcon, 4);\n \t\ttempFormData.width = 64;\n \t\ttempFormData.height = 24;\n \t\tresultSuccessCountLabel.setLayoutData(tempFormData);\n \n \t\tresultFailureCountLabel = new Label(resultComposite, SWT.CENTER);\n \t\tresultFailureCountLabel.setText(\"123\");\n \t\tresultFailureCountLabel.setForeground(resultFailureColor);\n \t\ttempFontData = resultFailureCountLabel.getFont().getFontData();\n \t\ttempFontData[0].setHeight(16);\n \t\ttempFontData[0].setStyle(SWT.BOLD);\n \t\tresultFailureCountLabel.setFont(new Font(Display.getCurrent(), tempFontData[0]));\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(resultFailureIcon, -32, SWT.CENTER);\n \t\ttempFormData.top = new FormAttachment(resultFailureIcon, 4);\n \t\ttempFormData.width = 64;\n \t\ttempFormData.height = 24;\n \t\tresultFailureCountLabel.setLayoutData(tempFormData);\n \n \t\tresultExceptionCountLabel = new Label(resultComposite, SWT.CENTER);\n \t\tresultExceptionCountLabel.setText(\"123\");\n \t\tresultExceptionCountLabel.setForeground(resultExceptionColor);\n \t\ttempFontData = resultExceptionCountLabel.getFont().getFontData();\n \t\ttempFontData[0].setHeight(16);\n \t\ttempFontData[0].setStyle(SWT.BOLD);\n \t\tresultExceptionCountLabel.setFont(new Font(Display.getCurrent(), tempFontData[0]));\n \t\ttempFormData = new FormData();\n \t\ttempFormData.left = new FormAttachment(resultExceptionIcon, -32, SWT.CENTER);\n \t\ttempFormData.top = new FormAttachment(resultExceptionIcon, 4);\n \t\ttempFormData.width = 64;\n \t\ttempFormData.height = 24;\n \t\tresultExceptionCountLabel.setLayoutData(tempFormData);\n \n \t\tPlatformUI.getWorkbench().getHelpSystem().setHelp(treeViewer.getControl(), \"de.integrity.eclipse.viewer\");\n \t\tattachTreeInteractionListeners();\n \t\tmakeActions();\n \t\thookContextMenu();\n \t\tcontributeToActionBars();\n \t\tupdateDetailPanel(null, null);\n \t}", "public void addPart(PartApplication part) {\n\t\tpartsModel.addElement(part);\n\t}", "public void addPartFieldsLine(View view) {\n int maxPartsLines = 10;\n if (currPartsLines < maxPartsLines) {\n LayoutInflater inflater = LayoutInflater.from(this);\n View pfView = inflater.inflate(R.layout.part_fields, (ViewGroup) view.getParent(), false);\n\n LinearLayout parentLayout = findViewById(R.id.info_fields_linear);\n int childIdx = parentLayout.indexOfChild(findViewById(R.id.button_add_part));\n parentLayout.addView(pfView, childIdx);\n\n partList.addPart(\n (EditText) ((ViewGroup) pfView).getChildAt(0),\n (EditText) ((ViewGroup) pfView).getChildAt(1),\n (EditText) ((ViewGroup) pfView).getChildAt(2)\n );\n\n currPartsLines += 1;\n } else {\n Toast.makeText(\n this,\n \"Max number of unique parts reached\",\n Toast.LENGTH_LONG\n ).show();\n }\n }", "protected abstract DeskComp make_deskPart();", "public Part createPart() {\n Part p = new Part();\n this.addPart(p);\n return p;\n }", "private boolean addProduct () {\n if (inputBoxesEmpty()) {\n return false;\n }\n name = nameField.getText();\n if (MainScreenController.getAddModify().equalsIgnoreCase(\"add\")){\n id = MainScreenController.getProductIDCount() + 1;\n }\n else {\n id = temporaryProduct.getId();\n }\n Product createdProduct = new Product(id,name,price,stock,min,max);\n for (Part currentPart : associatedParts) {\n createdProduct.addAssociatedPart(currentPart);\n }\n if (noParts() || minNotLessMax() || inventoryOutsideMinMax() ||\n priceLessPartPrice()) {\n return false;\n }\n Inventory.addProduct(createdProduct);\n return true;\n }", "public static void addPart(Part newPart) {\n\n }", "public void createPartControl(Composite parent)\n \t{\n \t\t// create our UI\n \t\t_myUI = new UISkeleton(parent, SWT.FILL);\n \n \t\t// let us accept dropped files\n \t\tconfigureFileDropSupport(_myUI);\n \n \t\t// fille in the menu bar(s)\n \t\tmakeActions();\n \t\tcontributeToActionBars();\n \n \t\t// declare fact that we can provide selections\n \t\tgetSite().setSelectionProvider(this);\n \t}", "@FXML\r\n void onActionAddPart(ActionEvent event) {\r\n tempAssocParts.addAssociatedPart(addPartTableview.getSelectionModel().getSelectedItem());\r\n deletePartTableview.setItems(tempAssocParts.getAllAssociatedParts());\r\n }", "public PartsComponent() {\n parts = new Gate[0];\n model = new PartsTableModel();\n partsTable = new JTable(model);\n jbInit();\n }", "protected void createInstall() {\r\n\t\tinstaller.setTitle(options.getString(\"InstallerTitle\"));\r\n\t\twelcomeStep();\r\n\t\tlicenseStep();\r\n\t\tinstallDirStep();\r\n\t\tproductDescriptionStep();\r\n\t\tchooseProductStep();\r\n\t\tchooseEclipseStep();\r\n\t\tshouldUseUpdateSiteStep();\r\n\t\tcheckEclipseRunning();\r\n\t\tcleanConfigStep();\r\n\t\tremoveEmbeddedInstallStep();\r\n\t\tverifyInstallStep();\r\n\t\tinstallCodeStep();\r\n\t\tcheckUnlinkedInstallsStep();\r\n\t\tcleanUnlinkedInstallsStep();\r\n\t\tinstallResultStep();\r\n\t\tinstallCompleteStep();\r\n\t}", "public CtrlPartida crearPartida(String user, String d, String id) {\n return CD.crearPartida(user,d, id);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trigger a DAG Run
@POST @Path("/dags/{dag_id}/dagRuns/{dag_run_id}") @Consumes({ "application/json" }) @Produces({ "application/json" }) public DAGRun createDagRun(@PathParam("dag_id") String dagId, @PathParam("dag_run_id") String dagRunId, DAGRun daGRun) throws ApiException, ProcessingException;
[ "@Test\n public void trigger_batch_task() {\n job.configure();\n addBatchTask(\"runit\");\n addBatchTask(\"dontrunit\");\n configureBatchTrigger(job,task(\"runit\"));\n job.save();\n\n job.startBuild().waitUntilFinished().shouldSucceed();\n task(\"runit\").shouldExist();\n task(\"dontrunit\").shouldNotExist();\n }", "@Override\n public void reRun(String jobId, Properties conf) throws OozieClientException {\n try {\n dagEngine.reRun(jobId, new XConfiguration(conf));\n }\n catch (DagEngineException ex) {\n throw new OozieClientException(ex.getErrorCode().toString(), ex);\n }\n }", "public boolean execute(TeamDiagram graphToExecuteCommandOn);", "public abstract void onRun();", "protected abstract boolean runTrigger(T event) throws ScriptException;", "public void executeTask(BigInteger taskid, BigInteger caseid) throws Exception {\n Timestamp ts = new Timestamp(System.currentTimeMillis());\n Date date = new Date(ts.getTime());\n DateFormat dateformat = new SimpleDateFormat(LogToXES.DATE_TIME_FORMAT_EXPECTED);\n String timestamp = dateformat.format(date);\n\n Tuple5<String, String, BigInteger, List<BigInteger>, BigInteger> task = contractCollaborationManager.getTaskById(taskid).send();\n\n EventFromTrigger e = new EventFromTrigger(caseid, taskid, task.component1(), timestamp, IOBPNoConditionValue );\n\n contractCollaborationManager.setTaskOnCompleted(e.caseId, e.taskId, e.taskName, e.timestamp, e.tokenValue).send();\n }", "private synchronized void triggerTask(TrcTaskMgr.TaskType taskType, TrcRobot.RunMode runMode)\n {\n if (input.isTriggered())\n {\n notifier.notifyEvent();\n }\n }", "public void run() {\n\t\t\t\tCloudSoftwareMarketplaceConfig.main(null);\n\t\t\t\t// showMessage(\"Action 1 executed\");\n\t\t\t}", "public void runSnippet() {\n run.doClick();\n }", "public void execute() {\n NslScheduler scheduler = system.getScheduler();\n scheduler.stepCycle();\n }", "@Override\r\n\tpublic void execute() {\r\n Object source = getDataSet();\r\n\r\n if (!(source instanceof RectangularDataSet)) {\r\n throw new IllegalArgumentException(\"Must be a rectangular data set.\");\r\n }\r\n\r\n RectangularDataSet dataSet = (RectangularDataSet) source;\r\n\r\n if (!(dataSet.isContinuous())) {\r\n throw new IllegalArgumentException(\"Must be continuous.\");\r\n }\r\n\r\n GraphWithParameters result = Shimizu2006SearchOld.lingamDiscovery_DAG(dataSet, 0.05);\r\n System.out.println(result);\r\n\r\n Graph graph = result.getGraph();\r\n\r\n setResultGraph(graph);\r\n }", "void sendRunToSubmissionInterface (Run run, RunFiles runFiles);", "void run(){\n executeUseCase(requestValues);\n }", "@Override\n public void autonomousPeriodic() {\n Scheduler.getInstance().run();\n //System.out.print(\"Checkpoint 3.0\");\n log();\n //System.out.print(\"Checkpoint 4.0\");\n \n }", "@Override\n public void run() {\n try {\n // write your task code here.\n System.out.println(\"Hello, this is the node executing a template JPPF task\");\n\n for (int i = 0; i < 10; i++) {\n System.out.println(i);\n try {\n Thread.sleep(1000);\n } catch (final Exception e) {\n System.out.println(e);\n }\n }\n // eventually set the execution results\n setResult(\"the execution was performed successfully\");\n } catch (final Exception e) {\n setThrowable(e);\n }\n }", "public void run() {\n\t\ttry {\n\t\t\tthis.environment.setStatus(FluxCompleteEnvironment.RUNNING_STATUS);\n\t\t\tthis.executionModel=\n\t\t\t\t\tFlowExecutorModelManager.generateExecutionModel(\n\t\t\t\t\t\t\tnew FlowExecutionModel(),\"\",this.activity.getElements(),this.activity.getConnectors(),this.environment);\n\t\t\tlog.info(\"ExecutionModel:\"+this.executionModel);\n\t\t\trunExecutors(this.executionModel);\n\t\t} catch (Exception e) {\n\t\t\tthis.environment.showMessage(\n\t\t\t\t\t\"0\", \n\t\t\t\t\t\"FluxRunner.run(): Finish run with errors:\"+\n\t\t\t\t\t\t\tthis.activity==null?\n\t\t\t\t\t\t\t\t\t\"null\":\n\t\t\t\t\t\t\t\t\tthis.activity.getName()+\" exception \"+e.getMessage()+\" \"+\n\t\t\t\t\t\t\t\t\te.getCause()!=null?e.getCause().toString():\"\");\n\t\t\tif (e.getCause()!=null) {\n\t\t\t\tthis.environment.getOutput().sendMessage(\"0\",e.getCause().toString());\n\t\t\t}\n\t\t\t// this.caller.stop(this.job.getName(),this.activity.getName());\n\t\t} finally {\n\t\t\tthis.environment.setStatus(FluxCompleteEnvironment.INACTIVE_STATUS);\n\t\t\t\n\t\t}\n\t}", "public static void main(String[] args) {\n WorkflowServiceStubs service = WorkflowServiceStubs.newInstance();\n // client that can be used to start and signal workflows\n WorkflowClient client = WorkflowClient.newInstance(service);\n\n // worker factory that can be used to create workers for specific task queues\n WorkerFactory factory = WorkerFactory.newInstance(client);\n\n // Worker C(ontroller) that listens on a task queue and hosts both workflow and activity\n // implementations.\n Worker workerC = factory.newWorker(TASK_QUEUE_CONTROLLER);\n // Workflows are stateful. So you need a type to create instances.\n workerC.registerWorkflowImplementationTypes(CronTabControllerWorkflowImpl.class);\n // Activities are stateless and thread safe. So a shared instance is used.\n\n try {\n // We need to create file system watcher service which will be used by\n // CronTabControllerWorkflow activities and also pass a path to the crontabs folder\n workerC.registerActivitiesImplementations(\n new CronTabControllerWorkflowActivitiesImpl(\n PATH_TO_CRONTABS, FileSystems.getDefault().newWatchService()));\n } catch (Exception e) {\n System.out.println(\"Exception occured: \" + e);\n }\n // Start listening to the workflow and activity task queues.\n\n // Worker J(obs) that listens on a task queue and hosts both workflow and activity\n // implementations.\n Worker workerJ = factory.newWorker(TASK_QUEUE_CRONTAB);\n // Workflows are stateful. So you need a type to create instances.\n workerJ.registerWorkflowImplementationTypes(CronTabWorkflowImpl.class);\n // Activities are stateless and thread safe. So a shared instance is used.\n workerJ.registerActivitiesImplementations(new CronTabWorkflowActivitiesImpl());\n // Start listening to the workflow and activity task queues.\n\n factory.start();\n\n try {\n /*\n */\n // Sets the cron schedule using the WorkflowOptions.\n // The cron format is parsed by \"https://github.com/robfig/cron\" library.\n // Besides the standard \"* * * * *\" format it supports @every and other extensions.\n // Note that unit testing framework doesn't support the extensions.\n // Use single fixed ID to ensure that there is at most one instance running. To run\n // multiple\n // instances set different IDs.\n\n WorkflowOptions workflowOptions =\n WorkflowOptions.newBuilder()\n .setWorkflowId(\"ControllerMain\")\n .setTaskQueue(TASK_QUEUE_CONTROLLER)\n // Execution timeout limits total time. Cron will stop executing after this\n // timeout. We can limit this crontab orchestrator to run for 100 years max for\n // example.\n // .setWorkflowExecutionTimeout(ChronoUnit.YEARS.getDuration().multipliedBy(100))\n // .setWorkflowRunTimeout(ChronoUnit.YEARS.getDuration().multipliedBy(3))\n // Run timeout limits\n // duration of\n // a\n // single workflow invocation.\n\n .build();\n\n CronTabControllerWorkflow workflow =\n client.newWorkflowStub(CronTabControllerWorkflow.class, workflowOptions);\n\n WorkflowExecution execution = WorkflowClient.start(workflow::run, PATH_TO_CRONTABS);\n\n System.out.println(\"Started \" + execution);\n } catch (io.temporal.client.WorkflowExecutionAlreadyStarted e) {\n System.out.println(\"Already running as \" + e.getExecution());\n }\n }", "@Override\n public void doRun() {\n if(shouldInternalTaskStop()){\n return;\n }\n setLastActionComment(\"doing ping\");\n if(datapowerLogger!=null){\n datapowerLogger.ping();\n }\n if(shouldInternalTaskStop()){\n return;\n }\n if(databaseLogger!=null){\n databaseLogger.ping();\n }\n }", "@Override\r\n public void onClick(View v) {\n if (mRun == null) {\r\n mRun = myDatabaseManager.startNewRun();\r\n } else {\r\n myDatabaseManager.startTrackingRun(mRun);\r\n }\r\n updateUI();\r\n }", "protected void execute() {\n \t((launchSub) launchsub).start();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Five parameters constructor to create a Survivor Object
public Survivor(String userName, int day, int hp, int energy, int food) { this.userName = userName; this.day = day; this.hp = hp; this.energy = energy; this.food = food; }
[ "public FourObjectContainer(Object object1, Object object2,Object object3, Object object4) {\r\n\tsuper();\r\n\t_object1 = object1;\r\n\t_object2 = object2;\r\n\t_object3 = object3;\r\n\t_object4 = object4;\r\n\t\r\n}", "public abstract T create(Object...params) throws VilException;", "public Burger(double price, String name, int numberOfPatties) {\n // calling the parent class constructor by using super.\n super(price, name);\n // object of that class created.\n this.numberOfPatties = numberOfPatties;\n // showing statement for parameterized constructor.\n System.out.println(\"Valid Burger \");\n }", "@Override\n protected District createInstance(String[] args) {\n if(args.length!=4 && !args[0].matches(\"\\\\d+\") && !args[2].matches(\"\\\\d+\") && !args[3].matches(\"\\\\d+\")){\n return null;\n }\n return new District(Integer.parseInt(args[0]), args[1], Integer.parseInt(args[2]), Integer.parseInt(args[3]));\n }", "public Paramecium(int x, int y){\r\n\t\t\r\n\t}", "protected GeometricObject() {\r\n\r\n\t}", "public VectorHeap(){\r\n info = new Vector<E>();\r\n }", "public Vendedor newVendedor();", "T create(Object... elements);", "public void removeSurvivor(Survivor member){\n }", "public Universe(int width, int height, int initialNumberOfPlanets)\n {\n this(width, height, initialNumberOfPlanets, Universe.minPlanetSeparation);\n }", "public PieceVide(int x, int y, int couleur) {\n \tsuper(x, y, couleur, null);\n }", "T newInstance(List<WordVector> vectors, String phrase, int score);", "Pair() {\n\n\t}", "E newInstance(N source, N destination);", "public static void main(String[] args) \n\t{\n\t\tParameterisedConstructor obj1=new ParameterisedConstructor(90);\n\t\tParameterisedConstructor obj2=new ParameterisedConstructor(190);\n\t\tParameterisedConstructor obj3=new ParameterisedConstructor();\n\t\t\n\n\t}", "public abstract O newInstance();", "public GenericObjects(float x , float y){ this.hitBox = new Rectangle(x, y, TILED_WIDTH, TILED_HEIGHT); }", "public DynamicGameObject (float x, float y, float width, float height) {\n super(x, y, width, height);\n velocity = new Vector2();\n accel = new Vector2();\n }", "public Visitor(Variable[] params) {\n this(params, null);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Criando a View e preenchendo a lista
@NonNull @Override public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) { View itemLista = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_produto, parent, false); return new MyViewHolder(itemLista); }
[ "public List <View> getItems() { return _items; }", "public abstract void mo3298a(View view, List<View> list);", "public GereVendasView() {\n this.opcoes = new ArrayList<String>();\n }", "private void initView()\n {\n mActiveGoodsViewAdapter.addItems((ArrayList<GoodsItem>) mMainDB.readAll(false));\n mActiveGoodsViewAdapter.notifyDataSetChanged();\n }", "public java.util.List getViewList()\r\n {\r\n return views;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n db = dbSqlHelper.getWritableDatabase();\n if (db != null) {\n cursorGuias = db.query(\n DataBaseSQLiteHelper.TABLE_GUIAS, //Nombre de la tabla\n null, //Lista de Columnas a consultar\n null, //Columnas para la clausula WHERE\n null, //Valores a comparar con las columnas del WHERE\n null, //Agrupar con GROUP BY\n null, //Condición HAVING para GROUP BY\n null //Clausula ORDER BY\n );\n }\n myGuiaCursorAdapter = new GuiaCursorAdapter(getActivity(), cursorGuias, CursorAdapter.FLAG_AUTO_REQUERY);\n\n View rootView = inflater.inflate(android.R.layout.list_content, container, false);\n ListView listView = (ListView) rootView.findViewById(android.R.id.list);\n\n // Lista de guias\n if (getArguments().getInt(ARG_SECTION_NUMBER) == 0) {\n //Utilizando un adapter\n// listView.setAdapter(myGuiaAdapter);\n //Utilizando un cursorAdapter\n listView.setAdapter(myGuiaCursorAdapter);\n }\n // Lista de compras\n else {\n myCompraAdapter = new CompraAdapter(getActivity(), compras);\n listView.setAdapter(myCompraAdapter);\n }\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_list_filme_ar, container, false);\n Fresco.initialize(getContext());\n cartaz = (SimpleDraweeView) view.findViewById(R.id.cartaz);\n nome = (TextView) view.findViewById(R.id.nome);\n horario = (TextView) view.findViewById(R.id.horario);\n\n listView = (ListView) view.findViewById(R.id.list);\n getFilmes();\n\n return view;\n }", "private VBox makeListView (ListView view, ObservableList list, String name) {\n VBox listViewBox = new VBox();\n listViewBox.setAlignment(Pos.CENTER);\n Label label = new Label(name);\n view.setItems(list);\n listViewBox.getChildren().addAll(label, view);\n return listViewBox;\n }", "public AltaArticulosView() {\n initComponents();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_classify, null);\n ButterKnife.bind(this, view);\n //得到数据\n ClassifyOne.ListBean info = (ClassifyOne.ListBean) getArguments().getSerializable(\"info\");\n\n getModel(info);\n return view;\n }", "public viewListarMaterias() {\n initComponents();\n }", "private void initViews() {\n\t\tcomicListView = (ListView) findViewById(R.id.comicListView);\n\t\t\n\t\t/* Bind adapter to ListView */\n\t\tadapter = new ComicAdapter();\n\t\tcomicListView.setAdapter(adapter);\n\t}", "public ViewClassificar() {\n initComponents();\n }", "public void initViews() {}", "void init(View view) {\n lv = (ListView) view.findViewById(R.id.lv_artists);\n ArrayList<ArtistModel> artists = manager.getAllArtistData(getContext()); //gets all the artist data\n adapter = new ArtistsTabAdapter(getContext(), artists); //creates a new adapter and gives it the list we want showing\n lv.setAdapter(adapter);\n\n }", "private void buildList() {\n TextView txtFacts = (TextView) findViewById(R.id.txtFacts);\n String strFacts = presenter.buildList();\n txtFacts.setText(strFacts);\n }", "private void init_views() {\r\n rv = findViewById(R.id.rv);\r\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());\r\n rv.setLayoutManager(layoutManager);\r\n RecyclerView.Adapter adapter = new MyAdapter(list);\r\n rv.setAdapter(adapter);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_listado, container, false);\n unbinder = ButterKnife.bind(this, view);\n presenter = new ListaFragmentPresenterImpl(this, getActivity());\n presenter.getDataCharacters();\n configureUI();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_recomendacion, container, false);\n recyclerView = (RecyclerView) view.findViewById(R.id.listPesos);\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());\n linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);\n recyclerView.setLayoutManager(linearLayoutManager);\n recyclerView.setAdapter(new HistorialAdapter(getContext(), lista));\n return view;\n }", "private void setupList(View view, Activity activity) {\n\n mListView = (ListView) view.findViewById(R.id.list);\n\n // создаем адаптер\n CustomPeopleArrayAdapter adapter = new CustomPeopleArrayAdapter(activity, mPeopleData);\n\n // присваиваем адаптер списку\n mListView.setAdapter(adapter);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the object contained at the index within the LinkedList
public E get(int index) { if (index > size) throw new IndexOutOfBoundsException("You cannot get the object contained at index " + index +" because the largest index is" + (size-1) + "."); else return getNode(index).getObject(); }
[ "@Override\r\n\tpublic Object retrieve(int index) throws IndexOutOfBoundsException {\r\n\t\tif (isEmpty()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tNode current = head;\r\n\t\tObject temp = null;\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < index; i++) {\r\n\t\t\t\tcurrent = current.getNext();\r\n\t\t\t\t//System.out.println(current.getElement().toString());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttemp = current.getElement();\r\n\t\t} catch (IndexOutOfBoundsException e) {\r\n\t\t\tSystem.out.println(\"-1\");\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t}\r\n\t\treturn temp;\r\n\t}", "public Object get(int index) // returns the element at the specified position in this list.\r\n {\r\n // index must be 1 or higher\r\n if (index < 0) {\r\n return null;\r\n }\r\n Node customCurrentNode = null;\r\n if (head != null) {\r\n customCurrentNode = head.getNext();\r\n\r\n for (int i = 0; i < index; i++) {\r\n if (customCurrentNode.getNext() == null) {\r\n return null;\r\n }\r\n\r\n customCurrentNode = customCurrentNode.getNext();\r\n }\r\n return customCurrentNode.getData();\r\n }\r\n return customCurrentNode;\r\n\r\n }", "public Object getElement(int index)\n {\n //create a listIterator\n\t ListIterator getIterator = listIterator(); // now you have access to the beginning of the list\n \t if(index < 0 || index > size())\n {\n \t\t throw new IndexOutOfBoundsException();\n }\n \t else\n \t {\n \t\t for(int i = 0; i < index; i++)\n \t\t {\n \t\t\t getIterator.next();\n \t\t }\n \t\t return getIterator.next();\n }\n }", "public Object get(int index) {\n\t\t\n\t\tNode current = head;\n\t\tfor (int i = 0 ; i<=index; i++) {\n\t\t\tcurrent = current.next;\n\t\t}\n\t\treturn current.data;\n\t}", "public Object get(int index) {\n\t\tif (index >= count || index < 0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Invalid index: \" + index);\n\t\t}\n\n\t\t// Find the element at the specified index\n\t\tint currentIndex = 0;\n\t\tNode currentNode = head;\n\t\twhile (currentIndex < index) {\n\t\t\tcurrentNode = currentNode.next;\n\t\t\tcurrentIndex++;\n\t\t}\n\n\t\treturn currentNode.element;\n\t}", "YourType getAt(int index){\n\t\tif( index > count )\n\t\t\treturn null;\n\t\t\n\t\tnode temp=head;\n\t\tint i=0;\n\t\twhile(temp.next!=null && i<index){\n\t\t\ttemp=temp.next;\n\t\t\ti++;\n\t\t}\n\t\t\n\t\treturn temp.data;\n\t}", "public ReturnObject get(int index){\n\t\tint curLoc = 0;\n\t\tReturnObject returnObject = null;\n\t\tboolean found = false;// dummy variable used to check if an object has been found or not.\n\t\tif(!isEmpty()){\n\t\t\tListNode temp = this.first;\n\t\t\twhile(temp != null && found != true){\n\t\t\t\tif(index == curLoc){\n\t\t\t\t\treturnObject = new ReturnObjectImpl(temp.getItem());\n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\tcurLoc++;\n\t\t\t\ttemp = temp.next;\n\t\t\t}\n\t\t\tif(!found){\n\t\t\t\treturnObject = new ReturnObjectImpl(ErrorMessage.INDEX_OUT_OF_BOUNDS);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturnObject = new ReturnObjectImpl(ErrorMessage.EMPTY_STRUCTURE);\n\t\t}\n\t\treturn returnObject;\n\t}", "public Object get(int index) {\n\t\tif (index < 0 || index > size - 1) throw new IndexOutOfBoundsException(\"Indeks mora biti izmedu 0 i size - 1.\");\n\t\t\n\t\tListNode temp;\n\t\t\n\t\tif (index < size / 2) {\n\t\t\ttemp = first;\n\t\t\tint i = 0;\n\t\t\twhile (i < index) {\n\t\t\t\ttemp = temp.next;\n\t\t\t\ti++;\n\t\t\t}\n\t\t} else {\n\t\t\ttemp = last;\n\t\t\tint i = size - 1;\n\t\t\twhile (i > index) {\n\t\t\t\ttemp = temp.prev;\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\treturn temp.value;\n\t}", "public T get(int index)\r\n\t{\r\n\t\tif(index >= size())\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\tListNode node = head;\r\n\t\tfor(int i = 0; i < index; i++)\r\n\t\t\tnode = node.getNext();\r\n\t\treturn node.getElement();\r\n\t}", "public E get(int index) \n\t{\n\t\t\n\t\tLLNode<E> get_node = head;\n\t\tint count = 0;\n\t\tif (index+1>this.size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"index larger than list\");\n\t\t}\n\t\tif (index<0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"index cannot be negative\");\n\t\t}\n\t\t\n\t\t\n\t\twhile (get_node.next.data != null) {\n\t\t\tget_node = get_node.next;\n\t\t\tif (count==index) {\n\t\t\t\treturn get_node.data;\n\t\t\t\t\n\t\t\t}\n\t\t\tcount+=1;\n\t\t\t\n\t\t}\n\t\tif (get_node.next.data == null) {\n\t\t\t\n\t\t\treturn get_node.data;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\n\t}", "public Item get(int index) {\r\n\t\tNode pointer = sentinel.next;\r\n\t\tif (index >= size) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\twhile(index > 0) {\r\n\t\t\tpointer = pointer.next;\r\n\t\t\tindex -= 1;\r\n\t\t}\r\n\t\treturn pointer.item;\r\n\t}", "public E get(int index) {\r\n\t\tif (index >= size || index < 0)\r\n\t\t\treturn null;\r\n\t\t\r\n\t\tint count = 0;\r\n\t\tNode cursor = head;\r\n\t\t\r\n\t\twhile (count < index) { // shuttle the cursor to the index node\r\n\t\t\tcursor = cursor.next;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\treturn cursor.data;\r\n\t}", "public E get(int index) {\n //Write logic for get method\n if (index >= 0 && index < size) {\n return list[index];\n }\n return null;\n }", "public E get(int index) {\r\n if (index < 0 || index >= size)\r\n throw new IndexOutOfBoundsException();\r\n Node<E> t = first.next;\r\n for (int i = 0; i < index; ++i)\r\n t = t.next;\r\n return t.data;\r\n }", "Object getElementAt(int index);", "public T get(int index)\n\t{\n\t\tif (index < 0 || index >= listLength)\n\t\t{\n\t\t\tthrow new IndexOutOfBoundsException(\"Error: Index out of Bounds. [index=\"+index+\"]\");\n\t\t}\n\n\t\tListNode<T> currentNode = rootNode;\n\t\tfor (int i = 0; i < index; i++)\n\t\t{\n\t\t\tcurrentNode = currentNode.getNextNode();\n\t\t}\n\t\treturn currentNode.getElement();\n\t}", "public T get(int index){\n\t\tif (index < 0 || index >= size())\n\t\t\tthrow new IndexOutOfBoundsException();\n\n\t\tLinkedListNode<T> temp = head;\n\t\tint count = 0;\n\t\twhile (count < index) {\n\t\t\ttemp = temp.getNext();\n\t\t\tcount++;\n\t\t}\n\t\treturn temp.getData();\n\t}", "public E get(int index) {\n Node<E> result = this.first;\n for (int i = 0; i < index; i++) {\n result = result.next;\n }\n return result.value;\n }", "public E get( int i )\n {\n SinglyLinkedListIterator<E> a = new SinglyLinkedListIterator<E>( head );\n int count = i;\n\n if ( i > this.size() )\n {\n throw new IndexOutOfBoundsException();\n }\n while ( a.hasNext() )\n {\n E obj = (E)a.next();\n if ( count == 0 )\n {\n return obj;\n }\n count--;\n }\n throw new IndexOutOfBoundsException();\n }", "public T get(int index){\r\n\t\tif(index < 0 || size() <= index){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tIterativeList<T> t = this;\r\n\t\tfor(int i = 0; i<index; i++){\r\n\t\t\tt = (IterativeList<T>)t.tail;\r\n\t\t}\r\n\t\treturn t.head;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test Name: test_run_1 Description: Verify that once the update_watchgods_after_TCP_connection() function is called if neither input_1hWatchog_timestamp_table nor input_24hWatchog_timestamp_table contain only true values, neither Global_1h_Watchdog nor Global_24h_Watchdog are kicked. Verify also that 1hWatchog_timestamp_table and 24hWatchog_timestamp_table are not updated External variables TBV: Global_24h_Watchdog.millisecondsLeftUntilExpiration, Global_1h_Watchdog.millisecondsLeftUntilExpiration, TCPserver._1hWatchog_timestamp_table TCPserver._24hWatchog_timestamp_table Exceptions thrown: IOException, InterruptedException
@Test public void test_run_1() throws IOException, InterruptedException { double input_watchdog = 100 * global_watchdog_scale_factor; double expected_1h_Global_watchdog_readout = input_watchdog; double expected_24h_Global_watchdog_readout = input_watchdog; TCPserver.setComputing_time(input_watchdog * 1.5); boolean[] input_1hWatchog_timestamp_table = {true, false, false, false, false}; boolean[] input_24hWatchog_timestamp_table = {true, false, false, false, false}; boolean[] expected_1hWatchog_timestamp_table = {true, false, false, false, false}; boolean[] expected_24hWatchog_timestamp_table = {true, false, false, false, false}; for (int i = 1; i <= sensor_coordinates_array.length; i++) { sensor = new SensorImpl(i, new Point2D.Float(sensor_coordinates_array[i-1][0], sensor_coordinates_array[i-1][1]), softwareImageID, TCPserver.getMeasurements_limit()); sensor.setSensorState(SensorState.OPERATIONAL); sensor.setSensor_watchdog_scale_factor(global_watchdog_scale_factor); TCPserver.Server_Sensors_LIST = TCPserver.processing_engine.updateServerSensorList(sensor); TCPserver.processing_engine.saveSensorInfo(sensor, "sensorINITIALIZATION"); TCPserver.set_1hWatchog_Timestamp_tableID_value(input_1hWatchog_timestamp_table[i-1], sensor.getSensorID()-1); TCPserver.set_24hWatchog_Timestamp_tableID_value(input_24hWatchog_timestamp_table[i-1], sensor.getSensorID()-1); } mockTCPserverTest.getServerSocket().bind(new java.net.InetSocketAddress(port_1)); mockTCPserverTest.startServer(mockTCPserverTest.getServerSocket()); mockServerThread.start(); tempClientSocket_1 = new Socket(serverHostName, port_1); when(mockTCPclient.getClientSocket()).thenReturn(tempClientSocket_1); obj_out_stream = new ObjectOutputStream(mockTCPclient.getClientSocket().getOutputStream()); when(mockClientManager.getOutputStream()).thenReturn(obj_out_stream); Thread.sleep(20); comp_engine_1 = new ComputeEngine_Runnable(mock_CER_ClientSocket, global_watchdog_scale_factor, true); Global_1h_Watchdog.getInstance().setTimeLeftBeforeExpiration(input_watchdog); Global_24h_Watchdog.getInstance().setTimeLeftBeforeExpiration(input_watchdog); Global_1h_Watchdog.getInstance().setEnabled(true); Global_24h_Watchdog.getInstance().setEnabled(true); comp_engine_1.update_watchgods_after_TCP_connection(input_1hWatchog_timestamp_table, input_24hWatchog_timestamp_table, sensor); assertEquals(expected_1h_Global_watchdog_readout, Global_1h_Watchdog.getInstance().getTimeLeftBeforeExpiration(), 0.1); assertEquals(expected_24h_Global_watchdog_readout, Global_24h_Watchdog.getInstance().getTimeLeftBeforeExpiration(), 0.1); for (int i = 0; i < input_1hWatchog_timestamp_table.length; i++) { assertEquals(expected_1hWatchog_timestamp_table[i], TCPserver.get_1hWatchog_timestamp_table().get()[i]); assertEquals(expected_24hWatchog_timestamp_table[i], TCPserver.get_24hWatchog_timestamp_table().get()[i]); } }
[ "@Test(timeout = 4000)\n public void test017() throws Throwable {\n FBConnectionProperties fBConnectionProperties0 = new FBConnectionProperties();\n assertNotNull(fBConnectionProperties0);\n assertNull(fBConnectionProperties0.getTpbMapping());\n assertNull(fBConnectionProperties0.getType());\n \n DelayQueue<Delayed> delayQueue0 = new DelayQueue<Delayed>();\n assertNotNull(delayQueue0);\n \n ScheduledThreadPoolExecutor scheduledThreadPoolExecutor0 = new ScheduledThreadPoolExecutor(39);\n assertNotNull(scheduledThreadPoolExecutor0);\n \n FileMonitor fileMonitor0 = new FileMonitor();\n assertNotNull(fileMonitor0);\n \n Thread thread0 = MockThread.currentThread();\n assertNotNull(thread0);\n assertFalse(thread0.isInterrupted());\n assertFalse(thread0.isDaemon());\n \n Thread thread1 = fileMonitor0.getDaemonThread(thread0, \"type\", true);\n assertNotNull(thread1);\n assertFalse(thread0.isInterrupted());\n assertFalse(thread0.isDaemon());\n assertTrue(thread1.isDaemon());\n assertFalse(thread1.isInterrupted());\n assertEquals(0, thread1.countStackFrames());\n \n TimeUnit timeUnit0 = TimeUnit.NANOSECONDS;\n ThreadGroup threadGroup0 = (ThreadGroup)thread1.getUncaughtExceptionHandler();\n assertNotNull(threadGroup0);\n assertFalse(thread0.isInterrupted());\n assertFalse(thread0.isDaemon());\n assertTrue(thread1.isDaemon());\n assertFalse(thread1.isInterrupted());\n assertEquals(0, thread1.countStackFrames());\n assertEquals(\"Test_Execution_Group\", threadGroup0.getName());\n \n thread1.setUncaughtExceptionHandler(threadGroup0);\n assertFalse(thread0.isInterrupted());\n assertFalse(thread0.isDaemon());\n assertTrue(thread1.isDaemon());\n assertFalse(thread1.isInterrupted());\n assertEquals(0, thread1.countStackFrames());\n assertEquals(\"Test_Execution_Group\", threadGroup0.getName());\n \n ScheduledFuture<?> scheduledFuture0 = scheduledThreadPoolExecutor0.scheduleAtFixedRate(thread1, 65535L, 65535L, timeUnit0);\n assertNotNull(scheduledFuture0);\n assertFalse(thread0.isInterrupted());\n assertFalse(thread0.isDaemon());\n assertTrue(thread1.isDaemon());\n assertFalse(thread1.isInterrupted());\n assertEquals(0, thread1.countStackFrames());\n \n boolean boolean0 = delayQueue0.add((Delayed) scheduledFuture0);\n assertFalse(thread0.isInterrupted());\n assertFalse(thread0.isDaemon());\n assertTrue(thread1.isDaemon());\n assertFalse(thread1.isInterrupted());\n assertEquals(0, thread1.countStackFrames());\n assertTrue(boolean0);\n \n TimeUnit timeUnit1 = TimeUnit.MILLISECONDS;\n Delayed delayed0 = delayQueue0.poll(2156L, timeUnit1);\n assertNotNull(delayed0);\n assertFalse(delayQueue0.contains(delayed0));\n assertFalse(timeUnit1.equals((Object)timeUnit0));\n \n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\"!,ii\");\n assertNotNull(defaultDBTable0);\n assertNull(defaultDBTable0.getDoc());\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n assertEquals(\"!,ii\", defaultDBTable0.getName());\n \n DefaultDBColumn defaultDBColumn0 = new DefaultDBColumn(\"aC4'_8u:%\", defaultDBTable0, 2853, \"roleName\");\n assertNotNull(defaultDBColumn0);\n assertNull(defaultDBTable0.getDoc());\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n assertEquals(\"!,ii\", defaultDBTable0.getName());\n assertEquals(\"aC4'_8u:%\", defaultDBColumn0.getName());\n assertNull(defaultDBColumn0.getDoc());\n assertTrue(defaultDBColumn0.isNullable());\n assertNull(defaultDBColumn0.getFractionDigits());\n assertFalse(defaultDBColumn0.isVersionColumn());\n assertEquals(\"column\", defaultDBColumn0.getObjectType());\n assertNull(defaultDBColumn0.getDefaultValue());\n assertNull(defaultDBColumn0.getSize());\n \n String string0 = SQLUtil.renderColumn(defaultDBColumn0);\n assertNotNull(string0);\n assertNull(defaultDBTable0.getDoc());\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n assertEquals(\"!,ii\", defaultDBTable0.getName());\n assertEquals(\"aC4'_8u:%\", defaultDBColumn0.getName());\n assertNull(defaultDBColumn0.getDoc());\n assertTrue(defaultDBColumn0.isNullable());\n assertNull(defaultDBColumn0.getFractionDigits());\n assertFalse(defaultDBColumn0.isVersionColumn());\n assertEquals(\"column\", defaultDBColumn0.getObjectType());\n assertNull(defaultDBColumn0.getDefaultValue());\n assertNull(defaultDBColumn0.getSize());\n assertEquals(\"aC4'_8u:% ROLENAME NULL\", string0);\n \n String[] stringArray0 = new String[4];\n stringArray0[0] = \"isolation\";\n stringArray0[1] = \"blobBufferSize\";\n stringArray0[2] = \"roleName\";\n stringArray0[3] = \"timestampUsesLocalTimezone\";\n DBPrimaryKeyConstraint dBPrimaryKeyConstraint0 = new DBPrimaryKeyConstraint(defaultDBTable0, \"database\", true, stringArray0);\n assertNotNull(dBPrimaryKeyConstraint0);\n assertEquals(4, stringArray0.length);\n assertEquals(\"database\", dBPrimaryKeyConstraint0.getName());\n assertEquals(\"unique constraint\", dBPrimaryKeyConstraint0.getObjectType());\n assertTrue(dBPrimaryKeyConstraint0.isNameDeterministic());\n assertNull(dBPrimaryKeyConstraint0.getDoc());\n assertNull(defaultDBTable0.getDoc());\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n assertEquals(\"!,ii\", defaultDBTable0.getName());\n \n NameSpec nameSpec0 = NameSpec.ALWAYS;\n String string1 = SQLUtil.constraintSpec(dBPrimaryKeyConstraint0, nameSpec0);\n assertNotNull(string1);\n assertEquals(4, stringArray0.length);\n assertEquals(\"database\", dBPrimaryKeyConstraint0.getName());\n assertEquals(\"unique constraint\", dBPrimaryKeyConstraint0.getObjectType());\n assertTrue(dBPrimaryKeyConstraint0.isNameDeterministic());\n assertNull(dBPrimaryKeyConstraint0.getDoc());\n assertNull(defaultDBTable0.getDoc());\n assertEquals(\"table\", defaultDBTable0.getObjectType());\n assertEquals(\"!,ii\", defaultDBTable0.getName());\n assertFalse(string1.equals((Object)string0));\n assertEquals(\"CONSTRAINT database PRIMARY KEY (isolation, blobBufferSize, roleName, timestampUsesLocalTimezone)\", string1);\n }", "@Test\n public void testHeartbeatTimeout() {\n\n new MyTestKit(5) {\n {\n BiFunction<ReplicaActor, Object, Boolean> crashCriteria0 = (me, msg) -> msg instanceof MasterSync;\n Timestamp crashTime0 = new Timestamp(0, 0);\n replicas[0].tell(new Messages.CrashPlan(crashTime0, crashCriteria0), null);\n sniffer.sendStartMsg();\n within(Duration.ofSeconds(10), () -> {\n sniffer.waitForFirstElectionToComplete();\n\n /*sniffer.expectMsgFrom(replicas[1], ReplicaElection.class, replicas[0]);\n sniffer.expectMsgFrom(replicas[1], MasterSync.class, replicas[0]);\n sniffer.expectMsgFrom(replicas[2], MasterSync.class, replicas[0]);*/\n\n sniffer.expectMsg(replicas[1], ReplicaElection.class);\n sniffer.expectMsg(replicas[1], MasterSync.class);\n return null;\n });\n }\n };\n }", "public void testWatchTheWatchdog() throws Exception\r\n\t{\n\t\tWatchdogAware tester= new WatchdogAware(100, 50);\t\t\r\n\t\tThread testerThread= new Thread(tester);\r\n\t\ttesterThread.start();\r\n\t\t// Wait until the thread is up ... \r\n\t\tsleep(10);\t\r\n\r\n\t\tIWatchdog wd= WatchdogRegistry.getTheRegistry().resolveWatchdogId(tester.getWatchdog().getId());\r\n\t\t\r\n\t\tTestCase.assertEquals(WatchdogRegistry.OK, WatchdogRegistry.getTheRegistry().getManagementWatchdogsState());\r\n\t\t\r\n\t\tWatchdogRegistry.getTheRegistry().shutdown();\r\n\t\t\r\n\t\tTestCase.assertFalse(WatchdogRegistry.OK.equals( WatchdogRegistry.getTheRegistry().getManagementWatchdogsState()));\r\n\r\n\t\t// Registry is shutdown and WD is stale (not existent anymore)\r\n\t\tTestCase.assertTrue(wd.isStale());\r\n\t\ttester.kill();\r\n\t\t\r\n\t\t\r\n\t\t// restart the system ....\r\n\t\tWatchdogRegistry.getTheRegistry().restart();\t\t\r\n\t\t\r\n\t\t// create new tester s...\r\n\t\ttester= new WatchdogAware(100, 50);\t\t\r\n\t\ttesterThread= new Thread(tester);\r\n\t\ttesterThread.start();\r\n\t\t// Wait until the thread is up ... \r\n\t\tsleep(10);\t\r\n\r\n\t\twd= WatchdogRegistry.getTheRegistry().resolveWatchdogId(tester.getWatchdog().getId());\t\t\r\n\t\tTestCase.assertTrue(wd.isAlive());\r\n\t\tTestCase.assertEquals(WatchdogRegistry.OK, WatchdogRegistry.getTheRegistry().getManagementWatchdogsState());\r\n\t\t\r\n\r\n\t\tlong mgmtInterval= WatchdogRegistry.getWatchdogManagementInterval();\r\n\t\tWatchdogRegistry.setWatchdogManagementInterval(mgmtInterval/4);\r\n\t\t\r\n\t\tTestCase.assertEquals(mgmtInterval/4, WatchdogRegistry.getWatchdogManagementInterval());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@Test(priority=6)\n\tpublic void testCase_verifyWiFiTagUDPPortValueEdit()throws InterruptedException, IOException{\n\t\tApp_Log.debug(\"Start-Ref-2.6_Verify WiFi Tag UDP Port edit\");\n\t\t//*****************************************************************\n\t\twifiUDPPortExp=CONFIG.getProperty(\"WiFiTagUDPPort\");\n\t\twifiEnableOID=SNMPOID.getProperty(\"WiFiTagEnableOID\");\n\t\twifiUDPPortOID=SNMPOID.getProperty(\"WiFiTagUDPPortOID\");\n\t\twifiTagChannelOID=SNMPOID.getProperty(\"WiFiTagChannel1OID\");\n\t\tekahauSrvrOID=SNMPOID.getProperty(\"WifiTagEkahauServerOID\");\n\t\tarrayIPadd=CONFIG.getProperty(\"ArrayIPAddress\");\n\t\tarrayHostName=CONFIG.getProperty(\"ArrayHostName\");\n\t\tcommunityStr=CONFIG.getProperty(\"community\");\n\t\txmsserverIP=CONFIG.getProperty(\"XMSServerIPAddress\");\n\t\txmsuser=CONFIG.getProperty(\"XMSUsername\");\n\t\txmspasswd=CONFIG.getProperty(\"XMSPassword\");\n\t\tmethodName=new Object(){}.getClass().getEnclosingMethod().getName();\n\t\ttestMethodResult=\"FAIL\";\n\t\t//*****************************************************************\n\t\ttry{\t\n\t\t\t//Navigate to Array Configuration\n\t\t\tnavigatelib.ConfigureAccesssPoint();\n\t\t\t//Navigate to Array Services Configuration\n\t\t\txmslocallib.clickLink(arrayHostName);\n\t\t\txmslocallib.setTimeout(10);\n\t\t\txmslocallib.clickLink(\"Configuration\");\n\t\t\txmslocallib.clickLink(\"Services\");\n\t\t\txmslocallib.clickLink(\"WiFi Tag\");\n\t\t\txmslocallib.selectRadioButton(\"Enable WiFi Tag Support\", 1);\n\t\t\txmslocallib.setText(\"WiFi Tag UDP Port\", wifiUDPPortExp);\n\t\t\txmslocallib.clickButton(\"Apply Config\");\n\t\t\txmslocallib.setTimeout(90);\n\t\t\t//message:-\"Done configuring Array\" PR-21595\n\t\t\tif (! xmslocallib.findText(\"Done Saving configuration to flash\")) {\n\t\t\t\tApp_Log.debug(\"Did not find an expected configuration message.\");\n\t\t\t\tthrow new InterruptedException(\"Did not find an expected configuration message.\");\n\t\t\t\t}\n\t\t}catch (InterruptedException e) {\n\t\t\tApp_Log.error(\"Error:-\"+e);\n\t\t\tscreencaptureFileName=\"SetupError-\"+this.getClass().getSimpleName()+\"_\"+methodName+\".png\";\n\t\t\txmslocallib.captureScreenshot(screencaptureFileName);\n\t\t}\n\t\t//Verification on WiFi Tag UDP Port paramters configured into Array by SNMP, CLI and GUI\n\t\t//Navigate to Array Configuration\n\t\tnavigatelib.ConfigureAccesssPoint();\n\t\t//Navigate to Array Services Configuration\n\t\txmslocallib.clickLink(arrayHostName);\n\t\txmslocallib.setTimeout(10);\n\t\txmslocallib.clickLink(\"Configuration\");\n\t\txmslocallib.clickLink(\"Services\");\n\t\txmslocallib.clickLink(\"WiFi Tag\");\n\t\t//Get Location URL value configured into array \n\t\twifiUDPPortGUI= xmslocallib.getText(\"WiFi Tag UDP Port\");\n\t\t//Verify WiFi Tag UDP Port configured into array by GUI\n\t\tApp_Log.debug(\"Ref-2.6_GUI-Verification:-Verify Services WiFi Tag UDP Port value in array\");\n\t\tboolean guiResult=xmslocallib.verifyStringequals(\"WiFiTagUDPPort\", this.getClass().getSimpleName(), methodName, wifiUDPPortGUI, wifiUDPPortExp);\n\t\t//Verify WiFi Tag UDP Port configured into array by SNMP\n\t\tApp_Log.debug(\"Ref-2.6_SNMP-Verification:-Verify Services WiFi Tag UDP Port value in array\");\n\t\twifiUDPPortSNMP=xmslocallib.getValueBySNMP(arrayIPadd, communityStr, wifiUDPPortOID);\n\t\tboolean snmpResult=xmslocallib.verifyStringequals(\"WiFiTagUDPPort\", this.getClass().getSimpleName(), methodName, wifiUDPPortSNMP, wifiUDPPortExp);\n\t\t//Verify WiFi Tag UDP Port Configured into array by CLI\n\t\tApp_Log.debug(\"Ref-2.6_CLI-Verification:-Verify Services WiFi Tag UDP Port value in array\");\n\t\twifiUDPPortCLI=xmslocallib.getValuebyCLI_WiFiTag(arrayIPadd, \"UDP Port\");\n\t\tboolean cliResult=xmslocallib.verifyStringequals(\"WiFiTagUDPPort\", this.getClass().getSimpleName(), methodName, wifiUDPPortCLI, wifiUDPPortExp);\n\t\t//If GUI, CLI and SNMP result are passed mark test method as passed.\n\t\tif(guiResult&&snmpResult&&cliResult)\n\t\t\ttestMethodResult=\"PASS\";\n\t\t//Report Test Result into Test Result file\n\t\ttestMethodResult=this.getClass().getSimpleName()+\"|\"+methodName+\"|\"+testMethodResult;\n\t\txmslocallib.postResults(testMethodResult);\t\n\t\tApp_Log.debug(\"End-Ref-2.6_Verify WiFi Tag UDP Port edit\");\n\t}", "@Test(priority=7)\n\tpublic void testCase_verifyWiFiTagChannelValueEdit()throws InterruptedException, IOException, InvocationTargetException{\n\t\tApp_Log.debug(\"Start-Ref-2.7_Verify WiFi Tag Channel edit\");\n\t\t//*****************************************************************\n\t\twifiTagChannelExp=CONFIG.getProperty(\"WiFiTagChannel\");\n\t\twifiEnableOID=SNMPOID.getProperty(\"WiFiTagEnableOID\");\n\t\twifiUDPPortOID=SNMPOID.getProperty(\"WiFiTagUDPPortOID\");\n\t\twifiTagChannelOID=SNMPOID.getProperty(\"WiFiTagChannel1OID\");\n\t\tekahauSrvrOID=SNMPOID.getProperty(\"WifiTagEkahauServerOID\");\n\t\tarrayIPadd=CONFIG.getProperty(\"ArrayIPAddress\");\n\t\tarrayHostName=CONFIG.getProperty(\"ArrayHostName\");\n\t\tcommunityStr=CONFIG.getProperty(\"community\");\n\t\txmsserverIP=CONFIG.getProperty(\"XMSServerIPAddress\");\n\t\txmsuser=CONFIG.getProperty(\"XMSUsername\");\n\t\txmspasswd=CONFIG.getProperty(\"XMSPassword\");\n\t\tmethodName=new Object(){}.getClass().getEnclosingMethod().getName();\n\t\ttestMethodResult=\"FAIL\";\n\t\t//*****************************************************************\n\t\ttry{\t\n\t\t\t//Navigate to Array Configuration\n\t\t\tnavigatelib.ConfigureAccesssPoint();\n\t\t\t//Navigate to Array Services Configuration\n\t\t\txmslocallib.clickLink(arrayHostName);\n\t\t\txmslocallib.setTimeout(10);\n\t\t\txmslocallib.clickLink(\"Configuration\");\n\t\t\txmslocallib.clickLink(\"Services\");\n\t\t\txmslocallib.clickLink(\"WiFi Tag\");\n\t\t\txmslocallib.selectRadioButton(\"Enable WiFi Tag Support\", 1);\n\t\t\txmslocallib.selectDropDown(\"WiFi Tag Channel\", wifiTagChannelExp);\n\t\t\txmslocallib.clickButton(\"Apply Config\");\n\t\t\txmslocallib.setTimeout(90);\n\t\t\t//message:-\"Done configuring Array\" PR-21595\n\t\t\tif (! xmslocallib.findText(\"Done Saving configuration to flash\")) {\n\t\t\t\tApp_Log.debug(\"Did not find an expected configuration message.\");\n\t\t\t\tthrow new InterruptedException(\"Did not find an expected configuration message.\");\n\t\t\t\t}\n\t\t}catch (InterruptedException e) {\n\t\t\tApp_Log.error(\"Error:-\"+e);\n\t\t\tscreencaptureFileName=\"SetupError-\"+this.getClass().getSimpleName()+\"_\"+methodName+\".png\";\n\t\t\txmslocallib.captureScreenshot(screencaptureFileName);\n\t\t}\n\t\t//Verification on WiFi Tag Channel paramters configured into Array by SNMP, CLI and GUI\n\t\t//Navigate to Array Configuration\n\t\tnavigatelib.ConfigureAccesssPoint();\n\t\t//Navigate to Array Services Configuration\n\t\txmslocallib.clickLink(arrayHostName);\n\t\txmslocallib.setTimeout(10);\n\t\txmslocallib.clickLink(\"Configuration\");\n\t\txmslocallib.clickLink(\"Services\");\n\t\txmslocallib.clickLink(\"WiFi Tag\");\n\t\t//Get Location URL value configured into array \n\t\twifiTagChannelGUI= xmslocallib.getDropDownText(\"WiFi Tag Channel\").toLowerCase();\n\t\t//Verify WiFi Tag Channel configured into array by GUI\n\t\tApp_Log.debug(\"Ref-2.7_GUI-Verification:-Verify Services WiFi Tag Channel default value in array\");\n\t\tboolean guiResult=xmslocallib.verifyStringequals(\"WiFiTagChannel\", this.getClass().getSimpleName(), methodName, wifiTagChannelGUI, wifiTagChannelExp);\n\t\t//Verify WiFi Tag Channel configured into array by SNMP\n\t\tApp_Log.debug(\"Ref-2.7_SNMP-Verification:-Verify Services WiFi Tag Channel default value in array\");\n\t\twifiTagChannelSNMP=xmslocallib.getValueBySNMP(arrayIPadd, communityStr, wifiTagChannelOID);\n\t\tboolean snmpResult=xmslocallib.verifyStringequals(\"WiFiTagChannel\", this.getClass().getSimpleName(), methodName, wifiTagChannelSNMP, wifiTagChannelExp);\n\t\t//Verify WiFi Tag Channel Configured into array by CLI\n\t\tApp_Log.debug(\"Ref-2.7_CLI-Verification:-Verify Services WiFi Tag Channel default value in array\");\n\t\twifiUDPPortCLI=xmslocallib.getValuebyCLI_WiFiTag(arrayIPadd, \"Tag Channel-bg\");\n\t\tboolean cliResult=xmslocallib.verifyStringequals(\"WiFiTagChannel\", this.getClass().getSimpleName(), methodName, wifiUDPPortCLI, wifiTagChannelExp);\n\t\t//If GUI, CLI and SNMP result are passed mark test method as passed.\n\t\tif(guiResult&&snmpResult&&cliResult)\n\t\t\ttestMethodResult=\"PASS\";\n\t\t//Report Test Result into Test Result file\n\t\ttestMethodResult=this.getClass().getSimpleName()+\"|\"+methodName+\"|\"+testMethodResult;\n\t\txmslocallib.postResults(testMethodResult);\t\n\t\tApp_Log.debug(\"End-Ref-2.7_Verify WiFi Tag Channel edit\");\n\t}", "@Test\n public void testSetElapsedTime1() throws RemoteException {\n StopWatch watch = new StopWatch(\"watch\");\n\n List<Long> expected = new ArrayList<Long>();\n checkData(expected, watch);\n\n for (int i = 0; i < 10; i++) {\n long value = Math.round(Math.random() * 100);\n watch.setElapsedTime(value);\n expected.add(value);\n checkData(expected, watch);\n }\n\n Utils.close(watch.getWatchDataSource());\n }", "public void testSchedbotFF() {\n\t}", "@Test(priority=5)\n\tpublic void testCase_verifyWiFiTagEnableState()throws InterruptedException, IOException{\n\t\tApp_Log.debug(\"Start-Ref-2.5_Verify Enable WiFi Tag Support status\");\n\t\t//*****************************************************************\n\t\twifiEnableExp=\"enabled\";\n\t\tekahauSrvrExp=CONFIG.getProperty(\"EkahauServer\");\n\t\twifiEnableOID=SNMPOID.getProperty(\"WiFiTagEnableOID\");\n\t\twifiUDPPortOID=SNMPOID.getProperty(\"WiFiTagUDPPortOID\");\n\t\twifiTagChannelOID=SNMPOID.getProperty(\"WiFiTagChannel1OID\");\n\t\tekahauSrvrOID=SNMPOID.getProperty(\"WifiTagEkahauServerOID\");\n\t\tarrayIPadd=CONFIG.getProperty(\"ArrayIPAddress\");\n\t\tarrayHostName=CONFIG.getProperty(\"ArrayHostName\");\n\t\tcommunityStr=CONFIG.getProperty(\"community\");\n\t\txmsserverIP=CONFIG.getProperty(\"XMSServerIPAddress\");\n\t\txmsuser=CONFIG.getProperty(\"XMSUsername\");\n\t\txmspasswd=CONFIG.getProperty(\"XMSPassword\");\n\t\tmethodName=new Object(){}.getClass().getEnclosingMethod().getName();\n\t\ttestMethodResult=\"FAIL\";\n\t\t//*****************************************************************\n\t\t\n\t\ttry{\t\n\t\t\t//Navigate to Array Configuration\n\t\t\tnavigatelib.ConfigureAccesssPoint();\n\t\t\t//Navigate to Array Services Configuration\n\t\t\txmslocallib.clickLink(arrayHostName);\n\t\t\txmslocallib.setTimeout(10);\n\t\t\txmslocallib.clickLink(\"Configuration\");\n\t\t\txmslocallib.clickLink(\"Services\");\n\t\t\txmslocallib.clickLink(\"WiFi Tag\");\n\t\t\txmslocallib.selectRadioButton(\"Enable WiFi Tag Support\", 1);\n\t\t\txmslocallib.setText(\"Ekahau Server\", ekahauSrvrExp);\n\t\t\txmslocallib.clickButton(\"Apply Config\");\n\t\t\txmslocallib.setTimeout(90);\n\t\t\t//message:-\"Done configuring Array\" PR-21595\n\t\t\tif (! xmslocallib.findText(\"Done Saving configuration to flash\")) {\n\t\t\t\tApp_Log.debug(\"Did not find an expected configuration message.\");\n\t\t\t\tthrow new InterruptedException(\"Did not find an expected configuration message.\");\n\t\t\t\t}\n\t\t}catch (InterruptedException e) {\n\t\t\tApp_Log.error(\"Error:-\"+e);\n\t\t\tscreencaptureFileName=\"SetupError-\"+this.getClass().getSimpleName()+\"_\"+methodName+\".png\";\n\t\t\txmslocallib.captureScreenshot(screencaptureFileName);\n\t\t}\n\t\t//Verification on Location reporting enable status configured into Array by SNMP, CLI and GUI\n\t\t//Navigate to Array Configuration\n\t\tnavigatelib.ConfigureAccesssPoint();\n\t\t//Navigate to Array Services Configuration\n\t\txmslocallib.clickLink(arrayHostName);\n\t\txmslocallib.setTimeout(10);\n\t\txmslocallib.clickLink(\"Configuration\");\n\t\txmslocallib.clickLink(\"Services\");\n\t\txmslocallib.clickLink(\"WiFi Tag\");\n\t\t//Get WiFi Tag Version value configured into array \n\t\tboolean wifiEnable=xmslocallib.isRadioButtonSelected(\"Enable WiFi Tag Support\",1); //WiFi Tag Enabled\n\t\tif(wifiEnable)\n\t\t\twifiEnableGUI=\"enabled\";\n\t\telse\n\t\t\twifiEnableGUI=\"NotMatch\";\n\t\t//Verify Wifi Tag enable status configured into array by GUI\n\t\tApp_Log.debug(\"Ref-2.5_GUI-Verification:-Verify Services WiFi Tag status value is enabled in array\");\n\t\tboolean guiResult=xmslocallib.verifyStringequals(\"WiFiTagEnableState\", this.getClass().getSimpleName(), methodName, wifiEnableGUI, wifiEnableExp);\n\t\t//Verify WiFi Tag enable status configured into array by SNMP\n\t\tApp_Log.debug(\"Ref-2.5_SNMP-Verification:-Verify Services WiFi Tag status value is enabled in array\");\n\t\twifiEnableSNMP=xmslocallib.getValueBySNMP(arrayIPadd, communityStr, wifiEnableOID);\n\t\tboolean snmpResult=xmslocallib.verifyStringequals(\"WiFiTagEnableState\", this.getClass().getSimpleName(), methodName, wifiEnableSNMP, \"1\");\n\t\t//Verify WiFi Tag enable status configured into array by CLI\n\t\tApp_Log.debug(\"Ref-2.5_CLI-Verification:-Verify Services WiFi Tag status value is enabled in array\");\n\t\twifiEnableCLI=xmslocallib.getValuebyCLI_WiFiTag(arrayIPadd, \"State\");\n\t\tboolean cliResult=xmslocallib.verifyStringequals(\"WiFiTagEnableState\", this.getClass().getSimpleName(), methodName, wifiEnableCLI, wifiEnableExp);\n\t\t//If GUI, CLI and SNMP result are passed mark test method as passed.\n\t\tif(guiResult&&snmpResult&&cliResult)\n\t\t\ttestMethodResult=\"PASS\";\n\t\t//Report Test Result into Test Result file\n\t\ttestMethodResult=this.getClass().getSimpleName()+\"|\"+methodName+\"|\"+testMethodResult;\n\t\txmslocallib.postResults(testMethodResult);\n\t\tApp_Log.debug(\"End-Ref-2.5_Verify Enable WiFi Tag Support status\");\n\t}", "@Test\n public void testSeverity() throws Exception {\n System.setProperty(\"config.resource\", \"/e2e/application-e2e.conf\");\n ConfigFactory.invalidateCaches();\n Config config = ConfigFactory.load();\n\n System.out.println(\"loading metadatas...\");\n Integration1.loadMetadatas(\"/e2e/\", config);\n System.out.println(\"loading metadatas done!\");\n\n // send sample sherlock data\n executors.submit(() -> {\n try {\n SampleClient3.main(args);\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n\n executors.submit(() -> {\n try {\n UnitTopologyMain.main(args);\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n\n Utils.sleep(1000 * 5l);\n while (true) {\n Integration1.proactive_schedule(config);\n\n Utils.sleep(1000 * 60l * 5);\n }\n }", "public void testConnectionTime() throws Exception{\n \t\tPrivilegedAccessor.setValue(Constants.class,\"MINUTE\",new Long(1));\n UDPCrawlerPing msgTimes = new UDPCrawlerPing(new GUID(GUID.makeGuid()),3,3,(byte)1);\n \t\tUDPCrawlerPong reply = crawlerPongFactory.createUDPCrawlerPong(msgTimes);\n byte[] payload = reply.getPayload();\n byte format = (byte) (payload[2] & UDPCrawlerPing.FEATURE_MASK);\n \t\tassertTrue((format & UDPCrawlerPing.CONNECTION_TIME)\n == UDPCrawlerPing.CONNECTION_TIME);\n \t\tassertFalse((format & UDPCrawlerPing.LOCALE_INFO)\n == UDPCrawlerPing.LOCALE_INFO);\n \t\t\n \t\t//see if the result we got had any uptime (it should!)\n \t\tshort uptime = ByteUtils.leb2short(payload,9);\n \t\tassertGreaterThan(0,uptime);\n \t}", "@Test\n public void testSetElapsedTime2() throws RemoteException {\n StopWatch watch = new StopWatch(\"watch\");\n\n List<Long> expectedValues = new ArrayList<Long>();\n List<Long> expectedStamps = new ArrayList<Long>();\n checkData(expectedValues, expectedStamps, watch);\n\n for (int i = 0; i < 10; i++) {\n long value = Math.round(Math.random() * 100);\n long stamp = Math.round(Math.random() * 100);\n watch.setElapsedTime(value, stamp);\n expectedValues.add(value);\n expectedStamps.add(stamp);\n checkData(expectedValues, expectedStamps, watch);\n }\n\n Utils.close(watch.getWatchDataSource());\n }", "@Test\n public void testDhcpRenewalMetrics() throws Exception {\n connect();\n injectDhcpFailure();\n mLooper.dispatchAll();\n\n verify(mWifiMetrics).incrementIpRenewalFailure();\n }", "@Test\n public void testStopTiming() throws RemoteException {\n StopWatch watch = new StopWatch(\"watch\");\n DataSourceMonitor mon = new DataSourceMonitor(watch);\n\n checkData(0, watch);\n\n for (int i = 0; i < 10; i++) {\n Utils.sleep(100);\n watch.stopTiming();\n mon.waitFor(i + 1);\n Calculable[] calcs = watch.getWatchDataSource().getCalculable();\n Assert.assertEquals(i + 1, calcs.length);\n Assert.assertTrue(calcs[0].getValue() > 0);\n for (int j = 1; j < calcs.length; j++) {\n Assert.assertTrue(calcs[j].getValue()\n >= calcs[j - 1].getValue());\n }\n }\n\n for (int i = 0; i < 10; i++) {\n watch.startTiming();\n Utils.sleep(100);\n watch.stopTiming();\n checkData(10 + i + 1, watch);\n }\n\n Utils.close(watch.getWatchDataSource());\n }", "@Test\n public void testRun() {\n\n Collection<String> topics = Arrays.asList(TOPIC_ONE);\n createTopicAndSendData(TOPIC_ONE);\n\n Random random = new Random();\n\n // Create test properties for kafka test JavaInputDStream.\n final Map<String, Object> kafkaParams = new HashMap<>();\n kafkaParams.put(BOOTSTRAP_SERVERS_CONFIG, kafkaTestUtils.brokerAddress());\n kafkaParams.put(AUTO_OFFSET_RESET_CONFIG, AUTO_OFFSET_RESET);\n kafkaParams.put(KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);\n kafkaParams.put(VALUE_DESERIALIZER_CLASS_CONFIG, KafkaJsonMonitoringRecordSerDe.class);\n kafkaParams.put(GROUP_ID_CONFIG,\n \"java-test-consumer-\" + random.nextInt() + \"-\" + System.currentTimeMillis());\n\n JavaInputDStream<ConsumerRecord<String, MonitoringRecord>> dStream =\n KafkaUtils.createDirectStream(\n ssc,\n LocationStrategies.PreferConsistent(),\n ConsumerStrategies.<String, MonitoringRecord>Subscribe(topics, kafkaParams)\n );\n\n // AnomalyDetector.processData(dStream, TOPIC_ONE);\n\n }", "@Test\n @Ignore\n public void instancesRunningButNoSystemTable() throws InterruptedException {\n\n }", "@Test(timeout = 10000)\n public void testFunctions() throws IOException, InterruptedException {\n TestUtil.startServer(true);\n\n // Avoid race where we try to connect to server too early\n Thread.sleep(100);\n\n try {\n Socket sock = TestUtil.connect();\n BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));\n PrintWriter out = new PrintWriter(sock.getOutputStream(), true);\n\n assertEquals(\"username User0\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"currentBoards \", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"newBoard default\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"userQuit User0\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"boardChanged default\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"userJoined User0\", TestUtil.nextNonEmptyLine(in));\n\n out.println(\"getUsername\");\n assertEquals(\"username User0\", TestUtil.nextNonEmptyLine(in));\n\n out.println(\"listBoards\");\n assertEquals(\"currentBoards default\", TestUtil.nextNonEmptyLine(in));\n\n out.println(\"setUsername TestUsername\");\n assertEquals(\"usernameChanged User0 TestUsername\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"userQuit User0\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"userJoined TestUsername\", TestUtil.nextNonEmptyLine(in));\n\n out.println(\"changeBoard testBoard\"); // Debug is true.\n assertEquals(\"newBoard testBoard\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"userQuit TestUsername\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"boardChanged default testBoard\", TestUtil.nextNonEmptyLine(in));\n assertEquals(\"userJoined TestUsername\", TestUtil.nextNonEmptyLine(in));\n\n out.println(\"exit\");\n sock.close();\n } catch (SocketTimeoutException e) {\n throw new RuntimeException(e);\n }\n }", "@Test(priority=3)\n\tpublic void testCase_verifyWiFiTagChannelDefaultValue()throws InterruptedException, IOException{\n\t\tApp_Log.debug(\"Start-Ref-2.3_Verify WiFi Tag Channel Default value\");\n\t\t//*****************************************************************\n\t\twifiTagChannelExp=\"none\";\n\t\twifiEnableOID=SNMPOID.getProperty(\"WiFiTagEnableOID\");\n\t\twifiUDPPortOID=SNMPOID.getProperty(\"WiFiTagUDPPortOID\");\n\t\twifiTagChannelOID=SNMPOID.getProperty(\"WiFiTagChannel1OID\");\n\t\tekahauSrvrOID=SNMPOID.getProperty(\"WifiTagEkahauServerOID\");\n\t\tarrayIPadd=CONFIG.getProperty(\"ArrayIPAddress\");\n\t\tarrayHostName=CONFIG.getProperty(\"ArrayHostName\");\n\t\tcommunityStr=CONFIG.getProperty(\"community\");\n\t\txmsserverIP=CONFIG.getProperty(\"XMSServerIPAddress\");\n\t\txmsuser=CONFIG.getProperty(\"XMSUsername\");\n\t\txmspasswd=CONFIG.getProperty(\"XMSPassword\");\n\t\tmethodName=new Object(){}.getClass().getEnclosingMethod().getName();\n\t\ttestMethodResult=\"FAIL\";\n\t\t//*****************************************************************\n\t\ttry{\t\n\t\t\t//Navigate to Array Configuration\n\t\t\tnavigatelib.ConfigureAccesssPoint();\n\t\t\t//Navigate to Array Services Configuration\n\t\t\txmslocallib.clickLink(arrayHostName);\n\t\t\txmslocallib.setTimeout(10);\n\t\t\txmslocallib.clickLink(\"Configuration\");\n\t\t\txmslocallib.clickLink(\"Services\");\n\t\t\txmslocallib.clickLink(\"WiFi Tag\");\n\n\t\t}catch (InterruptedException e) {\n\t\t\tApp_Log.error(\"Error:-\"+e);\n\t\t\tscreencaptureFileName=\"SetupError-\"+this.getClass().getSimpleName()+\"_\"+methodName+\".png\";\n\t\t\txmslocallib.captureScreenshot(screencaptureFileName);\n\t\t}\n\t\t//Verification on WiFi Tag Channel paramters configured into Array by SNMP, CLI and GUI\n\t\t//Get Location URL value configured into array \n\t\twifiTagChannelGUI= xmslocallib.getDropDownText(\"WiFi Tag Channel\").toLowerCase();\n\t\t//Verify WiFi Tag Channel configured into array by GUI\n\t\tApp_Log.debug(\"Ref-2.3_GUI-Verification:-Verify Services WiFi Tag Channel default value in array\");\n\t\tboolean guiResult=xmslocallib.verifyStringequals(\"WiFiTagChannel\", this.getClass().getSimpleName(), methodName, wifiTagChannelGUI, wifiTagChannelExp);\n\t\t//Verify WiFi Tag Channel configured into array by SNMP\n\t\tApp_Log.debug(\"Ref-2.3_SNMP-Verification:-Verify Services WiFi Tag Channel default value in array\");\n\t\twifiTagChannelSNMP=xmslocallib.getValueBySNMP(arrayIPadd, communityStr, wifiTagChannelOID);\n\t\tboolean snmpResult=xmslocallib.verifyStringequals(\"WiFiTagChannel\", this.getClass().getSimpleName(), methodName, wifiTagChannelSNMP, \"0\");\n\t\t//Verify WiFi Tag Channel Configured into array by CLI\n\t\tApp_Log.debug(\"Ref-2.3_CLI-Verification:-Verify Services WiFi Tag Channel default value in array\");\n\t\twifiUDPPortCLI=xmslocallib.getValuebyCLI_WiFiTag(arrayIPadd, \"Tag Channel-bg\");\n\t\tboolean cliResult=xmslocallib.verifyStringequals(\"WiFiTagChannel\", this.getClass().getSimpleName(), methodName, wifiUDPPortCLI, wifiTagChannelExp);\n\t\t//If GUI, CLI and SNMP result are passed mark test method as passed.\n\t\tif(guiResult&&snmpResult&&cliResult)\n\t\t\ttestMethodResult=\"PASS\";\n\t\t//Report Test Result into Test Result file\n\t\ttestMethodResult=this.getClass().getSimpleName()+\"|\"+methodName+\"|\"+testMethodResult;\n\t\txmslocallib.postResults(testMethodResult);\t\n\t\tApp_Log.debug(\"End-Ref-2.3_Verify WiFi Tag Channel Default value\");\n\t}", "@Test public void testCheckIncomingChangesDifferentUsersSameThread() throws Exception {\n\t\tif (Config.DEFAULT.isConfigured()) {\n\t\t\tRTCLoginInfo loginInfo = Config.DEFAULT.getLoginInfo();\n\t\t\t\n\t\t\tString testName = getUniqueName();\n\t\t\tString componentName = getComponentUniqueName();\n\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tMap<String, String> setupArtifacts = (Map<String, String>) getTestingFacade()\n\t\t\t\t\t.invoke(\"setupAcceptChanges\",\n\t\t\t\t\t\t\tnew Class[] { String.class, // serverURL,\n\t\t\t\t\t\t\t\t\tString.class, // userId,\n\t\t\t\t\t\t\t\t\tString.class, // password,\n\t\t\t\t\t\t\t\t\tint.class, // timeout,\n\t\t\t\t\t\t\t\t\tString.class, // name,\n\t\t\t\t\t\t\t\t\tString.class, // componentName\n\t\t\t\t\t\t\t\t\tboolean.class}, // create build definition\n\t\t\t\t\t\t\tloginInfo.getServerUri(),\n\t\t\t\t\t\t\tloginInfo.getUserId(),\n\t\t\t\t\t\t\tloginInfo.getPassword(),\n\t\t\t\t\t\t\tloginInfo.getTimeout(), testName,\n\t\t\t\t\t\t\tcomponentName, true);\n\t\t\t\n\t\t\tif (Config.DEFAULT.isSetUpOnly()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttry {\t\t\t\t\n\t\t\t\t// ensure that the incoming changes are detected\n\t\t\t\tBoolean changesIncoming = RTCFacadeFacade.incomingChangesUsingBuildDefinitionWithREST(\n\t \t\t\t\tConfig.DEFAULT.getToolkit(),\n\t\t\t\t\t\tloginInfo.getServerUri(),\n\t\t\t\t\t\tloginInfo.getUserId(),\n\t\t\t\t\t\tloginInfo.getPassword(),\n\t\t\t\t\t\tloginInfo.getTimeout(),\n\t\t\t\t\t\ttestName,\n\t\t\t\t\t\tnull, getTaskListener());\n\t\t\t\tAssert.assertTrue(changesIncoming.booleanValue());\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tchangesIncoming = RTCFacadeFacade.incomingChangesUsingBuildDefinitionWithREST(\n\t\t \t\t\t\tConfig.DEFAULT.getToolkit(),\n\t\t\t\t\t\t\tloginInfo.getServerUri(),\n\t\t\t\t\t\t\tConfig.DEFAULT.getUserIDForAuthenticationFailures(),\n\t\t\t\t\t\t\t\"BAD_PASSWORD\", //$NON-NLS-1$\n\t\t\t\t\t\t\tloginInfo.getTimeout(),\n\t\t\t\t\t\t\ttestName,\n\t\t\t\t\t\t\tnull, getTaskListener());\n\t\t\t\t\tfail(\"Invalid credentials ignored\");\n\t\t\t\t} catch (InvalidCredentialsException e) {\n\t\t\t\t\t// good\n\t\t\t\t}\n\t\t\t\t\n\t \t\t// ensure that good credentials are in place\n\t\t\t\tString message = RTCFacadeFacade.testConnection(\n\t \t\t\t\tConfig.DEFAULT.getToolkit(),\n\t\t\t\t\t\tloginInfo.getServerUri(),\n\t\t\t\t\t\tloginInfo.getUserId(),\n\t\t\t\t\t\tloginInfo.getPassword(),\n\t\t\t\t\t\tloginInfo.getTimeout(),\n\t\t\t\t\t\ttrue); // use rest\n\n\t\t\t\tAssert.assertNull(message);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tchangesIncoming = RTCFacadeFacade.incomingChangesUsingBuildDefinitionWithREST(\n\t\t \t\t\t\tConfig.DEFAULT.getToolkit(),\n\t\t\t\t\t\t\tloginInfo.getServerUri(),\n\t\t\t\t\t\t\tConfig.DEFAULT.getUserIDForAuthenticationFailures(),\n\t\t\t\t\t\t\t\"BAD_PASSWORD\", //$NON-NLS-1$\n\t\t\t\t\t\t\tloginInfo.getTimeout(),\n\t\t\t\t\t\t\ttestName,\n\t\t\t\t\t\t\tnull, getTaskListener());\n\t\t\t\t\tfail(\"Invalid credentials ignored\");\n\t\t\t\t} catch (InvalidCredentialsException e) {\n\t\t\t\t\t// good\n\t\t\t\t}\n\n\t\t\t} finally {\n\t\t\t\t// clean up\n\t\t\t\tgetTestingFacade().invoke(\n\t\t\t\t\t\t\"tearDown\",\n\t\t\t\t\t\tnew Class[] { String.class, // serverURL,\n\t\t\t\t\t\t\t\tString.class, // userId,\n\t\t\t\t\t\t\t\tString.class, // password,\n\t\t\t\t\t\t\t\tint.class, // timeout,\n\t\t\t\t\t\t\t\tMap.class}, // setupArtifacts\n\t\t\t\t\t\tloginInfo.getServerUri(),\n\t\t\t\t\t\tloginInfo.getUserId(),\n\t\t\t\t\t\tloginInfo.getPassword(),\n\t\t\t\t\t\tloginInfo.getTimeout(), setupArtifacts);\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void testDemoTryEnterIf() throws Exception {\n setUpThreadsForTestingMethod(\"demoTryEnterIf\");\n startAllThreadsForTest();\n waitForTestThreadsToFinish();\n int expectedTaskCount = 1;\n int expectedSkippedTasks = 9;\n assertThat(monitorExample.getTaskDoneCounter(), is(expectedTaskCount));\n assertThat(monitorExample.getTaskSkippedCounter(), is(expectedSkippedTasks));\n }", "@Test\n public void testStart() {\n MyPeriodicWatch watch = new MyPeriodicWatch(\"watch\");\n \n watch.setPeriod(500);\n watch.stop();\n watch.start();\n Utils.sleep(5000);\n watch.stop();\n Assert.assertTrue(watch.log().length() >= 8);\n Assert.assertTrue(watch.log().length() <= 12);\n watch.log().delete(0, watch.log().length());\n\n // start after stop\n watch.start();\n watch.stop();\n Utils.sleep(5000);\n Assert.assertTrue(watch.log().length() == 0);\n watch.start();\n Utils.sleep(5000);\n watch.stop();\n Assert.assertTrue(watch.log().length() >= 8);\n Assert.assertTrue(watch.log().length() <= 12);\n watch.log().delete(0, watch.log().length());\n\n // Check restart behavior\n for (int i = 0; i < 1000; i++) {\n watch.start();\n }\n for (int i = 0; i < 50; i++) {\n watch.start();\n Utils.sleep(100);\n }\n Assert.assertTrue(watch.log().length() == 0);\n Utils.sleep(5000);\n watch.stop();\n Assert.assertTrue(watch.log().length() >= 8);\n Assert.assertTrue(watch.log().length() <= 12);\n watch.log().delete(0, watch.log().length());\n\n Utils.close(watch.getWatchDataSource());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns true if RequiredDerivedKey element is present under SecureConversationToken
boolean isRequireDerivedKeys();
[ "boolean hasCorrelationKey();", "boolean hasPrivateKeyValidTo();", "boolean hasPrivateKeyValidFrom();", "boolean hasSenderIdAuthSecretV2();", "public boolean hasCorrelationKey() {\n\t\t\t\treturn ((bitField0_ & 0x00000400) != 0);\n\t\t\t}", "public boolean hasMyKey() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasPrivateKeyValidFrom() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "boolean hasAesSessionKey();", "public boolean isSetKeyMsg() {\n return this.keyMsg != null;\n }", "public boolean hasDualAuthPubKey() {\n return dualAuthPubKey_ != null;\n }", "public boolean hasContKey() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }", "public boolean hasContKey() {\n return ((bitField0_ & 0x00000008) == 0x00000008);\n }", "boolean hasSenderNonce();", "boolean hasAPkKey();", "boolean hasCaKeyId();", "public boolean hasKey() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "boolean hasAuthProto();", "public boolean hasKey() {\n return ((bitField0_ & 0x00000040) == 0x00000040);\n }", "public boolean hasStartKey() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean isSetKey() {\n return this.key != null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: a
public final void mo9277a(boolean z) { if (z) { C2624k.this.f8420c.mo106015a(C2624k.f8415a, false, r0); } else { C2624k.this.f8420c.mo106004a(C2624k.f8415a, r0); } }
[ "public interface C3511a {\n /* renamed from: a */\n void mo29057a(int i);\n }", "interface C4511c {\n /* renamed from: a */\n void mo29775a();\n }", "public interface ans {\n /* renamed from: a */\n void mo1174a();\n}", "public interface C24712af {\n /* renamed from: a */\n void mo64682a(List<Aweme> list);\n}", "public interface C11237e {\n /* renamed from: a */\n void mo39072a();\n}", "public interface C1837a {\n /* renamed from: a */\n void mo5414a(C1197a c1197a);\n }", "public interface C5635a {\n /* renamed from: a */\n void mo17734a(C5599a aVar);\n }", "public interface C21636a {\n /* renamed from: a */\n void mo57784a(String str);\n }", "interface cdw {\n /* renamed from: a */\n Object mo2685a(String str);\n}", "public interface C8405b<T> {\n /* renamed from: a */\n T mo21567a();\n}", "public interface aa extends ab {\r\n /* renamed from: a */\r\n void mo459a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo460a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo466b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo467b(int i) throws RemoteException;\r\n\r\n /* renamed from: h */\r\n float mo473h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n int mo474i() throws RemoteException;\r\n\r\n /* renamed from: l */\r\n int mo477l() throws RemoteException;\r\n\r\n /* renamed from: m */\r\n List<LatLng> mo478m() throws RemoteException;\r\n}", "interface C1026a {\n /* renamed from: a */\n void mo10282a(C1025el c1025el);\n\n /* renamed from: b */\n void mo10283b(C1025el c1025el);\n }", "public interface C4489a {\n /* renamed from: a */\n void mo12254a(int i);\n }", "public interface C40369ab {\n /* renamed from: a */\n void mo100344a();\n\n /* renamed from: a */\n void mo100345a(int i);\n}", "@Override // com.zhihu.android.base.widget.adapter.ZHRecyclerViewAdapter.ViewHolder\n /* renamed from: a */\n public void mo65331a(T t) {\n super.mo65331a((Object) t);\n mo82389n();\n }", "interface C0504b {\n /* renamed from: a */\n void mo7607a();\n }", "interface C17044s {\n /* renamed from: a */\n C17043r mo44275a(String str);\n}", "public interface C27423b {\n /* renamed from: a */\n C27422a mo70532a();\n\n /* renamed from: b */\n C27425d mo70533b();\n}", "public interface C11546e {\n /* renamed from: a */\n String mo29506a(Field field);\n}", "public interface C34109a {\n /* renamed from: a */\n RecommendList mo86759a();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: e
public abstract void mo951e(int i);
[ "@Override protected void process (int e) {\n\t\t}", "@Override\n\tpublic void eee() {\n\t\t\n\t}", "public void e() throws c {\n for (i a2 : this.f13971e) {\n a2.e();\n }\n }", "@Override\n\tpublic void visitEnemigo(Enemigo e) {\n\n\t}", "public int e() {\n return this.e;\n }", "void event(Event e)\n\t{\n\t\t\n\t}", "public void ec(){}", "@Override\r\n\t\t\tpublic void exceptionThrown(Exception e) {\n\t\t\t\tSystem.out.println(\"Exception thrown is - \" + e.toString());\r\n\t\t\t}", "public static void e(Exception e) {\r\n\r\n\t\te.printStackTrace();\r\n\r\n\t}", "@Override\n\tpublic void process(Entity e) {\n\t\t\n\t}", "@Override\n\tpublic void onException(Exception e) {\n\t\t\n\t}", "E getEvent();", "IS getE();", "private static String leggiEccezione(Throwable e) {\n\t\tStringBuilder sb = new StringBuilder(\" *** \");\n\t\tsb.append(e.getClass().getSimpleName());\n\t\tsb.append(\" *** \");\n\t\tsb.append(e.getMessage());\n\t\tfor(StackTraceElement se: e.getStackTrace()) {\n\t\t\tsb.append(\" @\");\n\t\t\tsb.append(se.getClassName());\n\t\t\tsb.append('#');\n\t\t\tsb.append(se.getLineNumber());\n\t\t}\n\t\tif(e.getCause()!=null) {\n\t\t\tsb.append(\" *** causa: \");\n\t\t\tsb.append(leggiEccezione(e.getCause()));\n\t\t}\n\t\treturn sb.toString();\n\t}", "public void e(String subject) {\n/* 84 */ this.e = subject;\n/* */ }", "@Override\n\tpublic void error(Exception e)\n\t{\n\t\t\n\t}", "public void setE(String e) {\n this.e = e;\n }", "public void captureEvents(Object e) {\r\n\t\treturn;\r\n\t}", "static /* synthetic */ void m256a(Throwable e) {\n Logger.getInstance().mo2140e(ErrorRequestListener.class.getName(), \"Erro por implementar\");\n e.printStackTrace();\n }", "@Override\n\t\t\tpublic void actionPerformed( ActionEvent e)\n\t\t\t{\n\t\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a linked list.
@Override public LinkedList<Type> getLinkedList(){ LinkedList<Type> tmpList = new LinkedList<>(); for(DoublyLinkedNode<Type> tmp = head ; tmp != null ; tmp = tmp.nextNode){ tmpList.add(tmp.data); } return tmpList; }
[ "public LinkedList getLinkedList(){\n\t\treturn linkedlist;\n\t}", "OneWayListNode<T> next();", "public LinkedList<LinearNode<Performance>> getLinkedList() {\n\t\treturn linkedList;\n\t}", "private static Node createList() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tNode head = null;\r\n\t\tNode previous = null;\r\n\t\tint number[] = {1,2,3,4,5,6,7,8};\r\n\t\tfor(int data: number){\r\n\t\t\tNode temp = new Node();\r\n\t\t\ttemp.data = data;\r\n\t\t\ttemp.next = null;\r\n\t\t\tif(head == null){\r\n\t\t\t\thead = temp;\r\n\t\t\t\tprevious = temp;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\tprevious.next = temp;\r\n\t\t\tprevious = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn head;\r\n\t}", "private static void testCreateLinkedList() {\n Node linkedList = createLinkedList(Arrays.asList());\n showLinkedList(linkedList);\n }", "ListNode head() {\n return head;\n }", "public ILinkedList<T> next(){\r\n return next;\r\n \r\n }", "public LinkedListIterator(){\n\t\t\tcurrent = new ListNode<T>(null, head);\n\t\t\t\n\t\t}", "public LinkedListNode next () {\n return myNext;\n }", "List copy(){\n List L = new List();\n Node N = this.front;\n while( N != null ){\n L.append(N.data);\n N = N.next;\n }\n return L;\n }", "interface ListNode {\r\n\t\tint getItem();\r\n\r\n\t\tListNode getNext();\r\n\r\n\t\tvoid setNext(ListNode next);\r\n\t}", "public SinglyLinkedList() {\n\t\t// constructs an initially empty list\n\t}", "public Doble_LinkedList() {\n \n head = new Node<T>(null);\n foot = new Node<T>(null);\n \n head.setNext(foot);//Asignamos como siguiente elemento\n foot.setPrev(head);//Creamos elemento anterior\n\n listCount = 0;\n }", "private static ListNode createList(int size) {\n\t\tListNode dummy = new ListNode();\r\n\t\tListNode iter = dummy;\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\t\t\titer.next = new ListNode(i + 1);\r\n\t\t\titer = iter.next;\r\n\t\t}\r\n\t\treturn dummy.next;\r\n\t}", "public String showLinkedList()\n {\n return Application.linkedList.toString();\n }", "LinkedList(LinkedList src) {\n\t\thead = null; //start with an empty list\n\n\t\tHelper hlpSrc = new Helper(null, src.head);\n\t\tHelper hlp = new Helper();\n\n\t\twhile (hlpSrc.curr != null) {\n\t\t\tNode newNode = new Node(hlpSrc.curr.getKey(), hlp.curr.getData());\n\t\t\thlpSrc.moveNext();\n\n\t\t\t//if the new node will become the first node\n\t\t\tif (head == null) {\n\t\t\t\thlp.set(null, newNode);\n\t\t\t\thead = newNode;\n\t\t\t} else {\n\t\t\t\thlp.curr.setNext(newNode);\n\t\t\t\thlp.moveNext();\n\t\t\t}\n\t\t}\n\t}", "private LinkedListImplementation() { }", "private IndexedUnorderedListADT<Integer> newList() {\r\n\t\tIndexedUnorderedListADT<Integer> listToUse;\r\n\t\tswitch (LIST_TO_USE) {\r\n//\t\tcase goodList:\r\n//\t\t\tlistToUse = new GoodList<Integer>();\r\n//\t\t\tbreak;\r\n//\t\tcase badList:\r\n//\t\t\tlistToUse = new BadList<Integer>();\r\n//\t\t\tbreak;\r\n//\t\tcase arrayList:\r\n//\t\t\tlistToUse = new ArrayList<Integer>();\r\n//\t\t\tbreak;\r\n//\t\t case singleLinkedList:\r\n//\t\t listToUse = new SingleLinkedList<Integer>();\r\n//\t\t break;\r\n\t\t case doubleLinkedList:\r\n\t\t listToUse = new DoubleLinkedList<Integer>();\r\n\t\t break;\r\n\t\tdefault:\r\n\t\t\tlistToUse = null;\r\n\t\t}\r\n\t\treturn listToUse;\r\n\t}", "@Override\n public Iterator<T> iterator() {\n return new LinkedListIterator(head);\n }", "public LinkedList(){\r\n\t\tsize = 0;\r\n\t\tstart = null;\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Factor__Group_1_0_1__1" $ANTLR start "rule__Factor__Group_1_0_1__1__Impl" InternalRestControllerGeneration.g:3156:1: rule__Factor__Group_1_0_1__1__Impl : ( () ) ;
public final void rule__Factor__Group_1_0_1__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalRestControllerGeneration.g:3160:1: ( ( () ) ) // InternalRestControllerGeneration.g:3161:1: ( () ) { // InternalRestControllerGeneration.g:3161:1: ( () ) // InternalRestControllerGeneration.g:3162:2: () { before(grammarAccess.getFactorAccess().getDivLeftAction_1_0_1_1()); // InternalRestControllerGeneration.g:3163:2: () // InternalRestControllerGeneration.g:3163:3: { } after(grammarAccess.getFactorAccess().getDivLeftAction_1_0_1_1()); } } } finally { restoreStackSize(stackSize); } return ; }
[ "public final void rule__GrammarRule__Group__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalLpp.g:2176:1: ( rule__GrammarRule__Group__1__Impl )\r\n // InternalLpp.g:2177:2: rule__GrammarRule__Group__1__Impl\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__GrammarRule__Group__1__Impl();\r\n\r\n state._fsp--;\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__Program__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMiniJava.g:802:1: ( rule__Program__Group__1__Impl )\n // InternalMiniJava.g:803:2: rule__Program__Group__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Program__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__ArithmeticFactor__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../jpaqldsl.ui/src-gen/jpaqldsl/ui/contentassist/antlr/internal/InternalJPAQLDsl.g:11938:1: ( rule__ArithmeticFactor__Group__1__Impl )\n // ../jpaqldsl.ui/src-gen/jpaqldsl/ui/contentassist/antlr/internal/InternalJPAQLDsl.g:11939:2: rule__ArithmeticFactor__Group__1__Impl\n {\n pushFollow(FOLLOW_rule__ArithmeticFactor__Group__1__Impl_in_rule__ArithmeticFactor__Group__125114);\n rule__ArithmeticFactor__Group__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Relational__Group_1_0_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // InternalArgument.g:3213:1: ( rule__Relational__Group_1_0_1__1__Impl )\n // InternalArgument.g:3214:2: rule__Relational__Group_1_0_1__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Relational__Group_1_0_1__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__TerminalExpression__Group_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // InternalArgument.g:4492:1: ( rule__TerminalExpression__Group_0__1__Impl )\n // InternalArgument.g:4493:2: rule__TerminalExpression__Group_0__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__TerminalExpression__Group_0__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__XRelationalExpression__Group_1_1_0_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalScripting.g:4480:1: ( rule__XRelationalExpression__Group_1_1_0_0__1__Impl )\n // InternalScripting.g:4481:2: rule__XRelationalExpression__Group_1_1_0_0__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__XRelationalExpression__Group_1_1_0_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Class__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../it.univaq.coevolution.emfmigrate.ui/src-gen/it/univaq/coevolution/emfmigrate/ui/contentassist/antlr/internal/InternalEmig.g:5987:1: ( rule__Class__Group__1__Impl )\n // ../it.univaq.coevolution.emfmigrate.ui/src-gen/it/univaq/coevolution/emfmigrate/ui/contentassist/antlr/internal/InternalEmig.g:5988:2: rule__Class__Group__1__Impl\n {\n pushFollow(FOLLOW_rule__Class__Group__1__Impl_in_rule__Class__Group__111930);\n rule__Class__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Rule__Group_4__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDSL.g:2923:1: ( rule__Rule__Group_4__1__Impl )\n // InternalDSL.g:2924:2: rule__Rule__Group_4__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Rule__Group_4__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Addition__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMiniJava.g:3232:1: ( rule__Addition__Group__1__Impl )\n // InternalMiniJava.g:3233:2: rule__Addition__Group__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Addition__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Expression__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMiniJava.g:3097:1: ( rule__Expression__Group__1__Impl )\n // InternalMiniJava.g:3098:2: rule__Expression__Group__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Expression__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__FQN__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalActivityArchitecture.g:1258:1: ( rule__FQN__Group__1__Impl )\n // InternalActivityArchitecture.g:1259:2: rule__FQN__Group__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__FQN__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Model__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.example.hellojvmtypes.ui/src-gen/org/xtext/example/hellojvmtypes/ui/contentassist/antlr/internal/InternalHelloJvmTypes.g:235:1: ( rule__Model__Group__1__Impl )\n // ../org.xtext.example.hellojvmtypes.ui/src-gen/org/xtext/example/hellojvmtypes/ui/contentassist/antlr/internal/InternalHelloJvmTypes.g:236:2: rule__Model__Group__1__Impl\n {\n pushFollow(FOLLOW_rule__Model__Group__1__Impl_in_rule__Model__Group__1429);\n rule__Model__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Model__Group__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDSL.g:1411:1: ( rule__Model__Group__1__Impl )\n // InternalDSL.g:1412:2: rule__Model__Group__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Model__Group__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Function__Group_3_0_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBotoLang.g:1796:1: ( rule__Function__Group_3_0_1__1__Impl )\n // InternalBotoLang.g:1797:2: rule__Function__Group_3_0_1__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Function__Group_3_0_1__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Method__Group_0__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalCrySL.g:5139:1: ( rule__Method__Group_0__1__Impl )\r\n // InternalCrySL.g:5140:2: rule__Method__Group_0__1__Impl\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__Method__Group_0__1__Impl();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__RelationalExpression__Group_1_1_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:11165:1: ( rule__RelationalExpression__Group_1_1_0__1__Impl )\n // InternalMyDsl.g:11166:2: rule__RelationalExpression__Group_1_1_0__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__RelationalExpression__Group_1_1_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__FQN__Group_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalSasDsl.g:9647:1: ( rule__FQN__Group_1__1__Impl )\n // InternalSasDsl.g:9648:2: rule__FQN__Group_1__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__FQN__Group_1__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__RelationalExpression__Group_1_0_0__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalMyDsl.g:11084:1: ( rule__RelationalExpression__Group_1_0_0__1__Impl )\n // InternalMyDsl.g:11085:2: rule__RelationalExpression__Group_1_0_0__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__RelationalExpression__Group_1_0_0__1__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__FQN__Group_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalDeployment.g:833:1: ( rule__FQN__Group_1__1__Impl )\n // InternalDeployment.g:834:2: rule__FQN__Group_1__1__Impl\n {\n pushFollow(FOLLOW_2);\n rule__FQN__Group_1__1__Impl();\n\n state._fsp--;\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }", "public final void rule__Strucdef__Group__6() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalOcelet.g:7269:1: ( rule__Strucdef__Group__6__Impl )\n // InternalOcelet.g:7270:2: rule__Strucdef__Group__6__Impl\n {\n pushFollow(FOLLOW_2);\n rule__Strucdef__Group__6__Impl();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Con anonymous inner class
@Override public void handle(ActionEvent event) { mensajeBt.setText("Hola " + textfield1.getText() + " " + textfield2.getText()); }
[ "public void makeInner(){\n\t\tMyInner in = new MyInner();\t\t\t// DNC if surrounding method is static \n\t\t\t\t\t\t\t\t\t\t\t// 19: error: non-static variable this cannot be referenced from a static context \n\t\tin.seeOuter();\n\t}", "@Override\n\tpublic void visitInnerClass(InnerClass obj) {\n\t\t\n\t}", "public void printinterface()\r\n {\n \r\n Abc obj = new Abc()// there is showing an suggestion that \r\n // this new Abc() anonymous will be lamda expresion\r\n {\r\n @Override\r\n public void into() {\r\n System.out.println(\"this method is from TestAnonymous class and override \");\r\n }\r\n \r\n };\r\n \r\n obj.into();\r\n \r\n }", "public Inner() {\n }", "public interface AnonymousClass18V {\n}", "@Override\n\tpublic void runInner() {\n\t}", "@Override\n\tpublic void visitInnerClasses(InnerClasses obj) {\n\t\t\n\t}", "@Override\n public void m1() {\n System.out.println(this.x);//here this will call the inner class x not the AnonymousTest class x.\n }", "public interface AnonymousClass0JB {\n void AFU();\n\n void AJr(C49502Qs v);\n}", "@com.exedio.cope.instrument.Generated\n\tprivate Inner(final com.exedio.cope.pattern.BlockActivationParameters ap){super(ap);}", "public interface AnonymousClass1GS {\n}", "public interface AnonymousClass0Dx extends AbstractC08541eo {\n}", "public static void main(String...a){\n\t\tOuterClass oc = new OuterClass();\n\t\toc.display(new Temp());\n\n\t\t//Another Way:\n\t\tOuterClass oc1 = new OuterClass();\n\t\toc1.display(\n\t\t\tnew My(){\n\t\t\t\tpublic void show(){\n\t\t\t\t\tSystem.out.println(\"From Anonymous Class Show\");\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\t//Also can do\n\t\tnew OuterClass().display(\n\t\t\tnew My(){\n\t\t\t\tpublic void show(){\n\t\t\t\t\tSystem.out.println(\"From Anonymous Class Show\");\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t\n\t}", "public static void main(String[] args) {\n AnonymousInnerClass anonymousInnerClass = new AnonymousInnerClass();\n\n //one may find it interesting: why it's possible to refer to an inner interface without an instance of the outer class\n //the answer is: inner interfaces are implicitly static\n anonymousInnerClass.rideMachine(new Machine() {\n @Override\n public void drive() {\n System.out.println(\"Wroom-wroom\");\n }\n });\n\n //Remember that inner classes must be explicitly bounded with an instance of the outer class\n anonymousInnerClass.rideMachine(new AnonymousInnerClass().new Motorcycle() {\n @Override\n public void drive() {\n System.out.println(\"Woom-woom\");\n }\n });\n }", "public interface AnonymousClass0HV {\n void AFo();\n\n void AHy(String str, String str2, byte[] bArr);\n}", "public void testInnerClass() {\n\n class Temp {\n public void doSomething() {\n System.out.println(\"Method class\");\n }\n }\n\n Temp temp = new Temp();\n temp.doSomething();\n }", "public interface AnonymousClass1LP {\n void AEr();\n}", "public interface AnonymousClass1O0 {\n}", "private PublishingSolution(){\n\t\t//eg1\n\t\ta = new Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}\n\t\t};\n\t\t\n\t\t//eg2\n\t\teventListener = new EventListener(){\n\t\t\t//some code here\n\t\t};\n\t}", "public static $constructor of( Object anonymousObjectContainingMethod ){\n StackTraceElement ste = Thread.currentThread().getStackTrace()[2];\n return of( ste, anonymousObjectContainingMethod);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inflate the layout for this fragment
@Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_records, container, false); ButterKnife.bind(this, view); List<Record> records = new ArrayList<>(); records.add(new Record("Patient Problem: Fever", "Hospital: AIIMS", "Department: Department of Pediatrics")); records.add(new Record("Patient Problem: Fever", "Hospital: AIIMS", "Department: Department of Pediatrics")); RecordsAdapter adapter = new RecordsAdapter(records); RecyclerView recyclerView = view.findViewById(R.id.recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerView.setAdapter(adapter); return view; }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.movie_statistic_layout, parent, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.fragment_question, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_volley2, container, false);\n\n // link graphical items to variables\n temperature = (TextView) view.findViewById(R.id.temperature);\n description = (TextView) view.findViewById(R.id.description);\n weatherBackground = (ImageView) view.findViewById(R.id.weatherbackground);\n\n // Implementation\n implementation();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n final View view = inflater.inflate(getLayout(), container, false);\n\n setupLayout(view);\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.bookmark_band_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.manu, container, false);\n getXmlList();\n copyFileList();\n initView();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_emotion_packet, container, false);\n initView(rootView);\n initListener();\n return rootView;\n }", "@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_opportunity, null);\r\n\r\n\t\t// 设置右上角的图标\r\n\t\taddButton = (ImageView) getActivity().findViewById(R.id.addButton);\r\n\t\taddButton.setImageResource(R.drawable.back);\r\n\t\taddButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tFragment newFragment = new MainFragment(R.id.business);\r\n\t\t\t\tString title = getString(R.string.business);\r\n\t\t\t\tgetFragmentManager().beginTransaction().replace(R.id.content_frame, newFragment).commit();\r\n\t\t\t\tTextView topTextView = (TextView) getActivity().findViewById(R.id.topTv);\r\n\t\t\t\ttopTextView.setText(title);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn view;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qr_gen, container, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.fragment_fate, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance){\n\n return inflater.inflate(R.layout.fragment_scrapbook, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_home, container, false);\n rcv = view.findViewById(R.id.RCV);\n comment = view.findViewById(R.id.Comment);\n lottie = view.findViewById(R.id.Lottie);\n ConnectXML();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater,\n ViewGroup container, Bundle savedInstanceState) {\n initConfigAndView(inflater, container, R.layout.com_parse_ui_parse_login_help_fragment);\n\n mTxtInstructions = (TextView) mLayout.findViewById(R.id.login_help_instructions);\n mEdtEmailAddress = (EditText) mLayout.findViewById(R.id.login_help_email_input);\n mBtnSubmit = (Button) mLayout.findViewById(R.id.login_help_submit);\n\n mBtnSubmit.setOnClickListener(this);\n\n return mLayout;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bottom_sheet_details, container, false);\n // binding views\n boxMessage = view.findViewById(R.id.box_messages);\n boxResult = view.findViewById(R.id.box_result);\n htmlTextMessage = view.findViewById(R.id.html_text_message);\n progressLoading = view.findViewById(R.id.progress_loading_country);\n htmlTextNames = view.findViewById(R.id.text_country_names);\n htmlTextDetails = view.findViewById(R.id.text_country_details);\n imageFlag = view.findViewById(R.id.image_country_flag);\n // set loading message\n htmlTextMessage.setHtmlText(getString(R.string.html_message_loading_country, getArguments().getString(\"name\")));\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n\n return inflater.inflate(R.layout.fragment_account, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_guan_zhu, container, false);\n initView(inflate);\n initdata();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_whole_task, container, false);\n ButterKnife.bind(this, view);\n refreshLayout.setOnRefreshListener(this);\n refreshLayout.setOnLoadmoreListener(this);\n loadData();\n setAdapter();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_show_mult_att, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_timeline, parent, false);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return all of the parameters passed in the request to the session
public static void addRequestParametersToSession(HttpSession sess, HttpServletRequest req, String name) { sess.setAttribute(name, req.getParameterMap() .entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, v -> v.getValue()[0]))); }
[ "@Override\n\tpublic Map<String, String[]> getParameterMap() {\n\t\treturn request.getParameterMap();\n\t}", "protected String[] getValuesFromRequest() \n\t{\n\t\treturn this.context.getRequest().getParameterValues(this.getUIID());\n\t}", "String getParameterValues();", "public Vector getRequestParameterNames()\n\t{\n\t\treturn this.requestParameterNames;\n\t}", "public List<RequestParameter> getRequestParameterList() {\n return Collections.unmodifiableList(requestParameters);\n }", "public synchronized java.util.Map getParameterMap()\r\n {\r\n if (formParameters == null)\r\n getParameterNames();\r\n return formParameters;\r\n }", "@Override\n protected Map<String, String> getParams() {\n return params;\n }", "@Override\n public String[] getParameterValues(String name) {\n // we *do* support in the fake environment to\n // have several values for the same request parameter\n return params.get(name);\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"token\", ((EnvironmentManager) (Services.GetService(EnvironmentManager.class))).GetServerSecurityToken());\n params.put(\"query\", query);\n\n return params;\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"user_email\", user_email);\n params.put(\"user_password\", user_password);\n\n return params;\n }", "public Map<String, String> getParameterMap() {\n List<String> names = Collections.list(this._req.getParameterNames());\n Map<String, String> parameters = new HashMap<>(names.size());\n for (String name : names) {\n String value = this._req.getParameter(name);\n if (value != null) {\n parameters.put(name, value);\n }\n }\n return parameters;\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"ktp\", ktp);\n params.put(\"token\", token);\n return params;\n }", "public Map<String, Object> getParams() {\n if (params == null) {\n params = new HashMap<String, Object>();\n }\n return params;\n }", "@Override\n\t\t\tprotected Map<String, String> getParams() {\n\t\t\t\t// Posting params to login url\n\t\t\t\tMap<String, String> params = new HashMap<>();\n\t\t\t\tparams.put(\"username\", username);\n\t\t\t\tparams.put(\"password\", password);\n\t\t\t\treturn params;\n\t\t\t}", "public Map<String, String> getParams() {\n return params;\n }", "protected Object[] getParameters()\n\t{\n\t\treturn parameters;\n\t}", "@Override\r\n\t\t\t\tprotected Map<String, String> getParams() throws AuthFailureError {\n\t\t\t\t\treturn requestParam;\r\n\t\t\t\t}", "Map<String, HttpReqParam> getPostParameters();", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<>();\n params.put(\"email\", email);\n params.put(\"password\", pass);\n return params;\n }", "public HashMap<String, Object> getParams() {\n return params;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the ith "initparam" element
public void removeInitParam(int i) { synchronized (monitor()) { check_orphaned(); get_store().remove_element(INITPARAM$10, i); } }
[ "@Override\r\n\tpublic void removeInitParameter(String paramString) {\n\t\t\r\n\t}", "public void removeInputParam(InputType it)\n {\n inputParams.remove(it.token);\n }", "public void removeSearchParam(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(SEARCHPARAM$10, i);\n }\n }", "void removeParam(String name);", "private void clearAllParams() {\n\t}", "public void clearParameters();", "@DISPID(18) //= 0x12. The runtime will prefer the VTID if present\n @VTID(24)\n void deleteIterationParams();", "public void removeParam(String o){\n parameters.remove(o);\n }", "public Builder clearParam() {\n if (paramBuilder_ == null) {\n param_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000001);\n onChanged();\n } else {\n paramBuilder_.clear();\n }\n return this;\n }", "public void clearParameters()\r\n\t{\r\n\t\tparameters.clear();\r\n\t}", "public Builder clearParam() {\n if (paramBuilder_ == null) {\n param_ = null;\n onChanged();\n } else {\n param_ = null;\n paramBuilder_ = null;\n }\n\n return this;\n }", "void removeInput( String privateParamName );", "public final void resetParameterPointer() {\n \tm_pos = PARAMWORDS;\n }", "public void clearExtendedParams();", "public Builder clearParameter() {\n bitField0_ = (bitField0_ & ~0x00000002);\n parameter_ = 0D;\n onChanged();\n return this;\n }", "private void clearBuilderParameter() {\n builderParameter_ = emptyProtobufList();\n }", "void removeParameter(Parameter parameter);", "public Builder clearParameter() {\n if (parameterBuilder_ == null) {\n parameter_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n } else {\n parameterBuilder_.clear();\n }\n return this;\n }", "public void unsetConstructorArg()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_attribute(CONSTRUCTORARG$8);\r\n }\r\n }", "public RequestBuilder<Result> removeParameter(String key) {\n webRequestBuilder.removeParam(key);\n return this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns collection of leasing after applying transaction.
public List<LeaseInfo> leases() { return leases; }
[ "public ArrayList<Lease> getLeases(){\r\n return leases;\r\n }", "public LinkedHashSet<Transaction> get_Transactions(){\n return this.transactions;\n }", "public List<Transaction> getValidatedOrphans() {\n return Collections.unmodifiableList(addedOrphans);\n }", "public static Transaction release(Transaction currentTrans)\n {\n List ItemsLocked=currentTrans.getItemsLocked();\n int index=0;\n Iterator it = ItemsLocked.iterator();\n //loop through the locked item list and unlock them from this transaction's hold\n while (it.hasNext()){\n Lock currentLock = lockHashMap.get((String) it.next());\n List transIdHoldingLock=currentLock.getTransIdHoldingLock();\n if (currentLock.getLockState() == LockState.WL) {\n currentLock.setLockState(LockState.UL);\n for(int i=0;i<transIdHoldingLock.size();i++)\n {\n if(transIdHoldingLock.get(i).toString().equals(currentTrans.getTransactionId()+\"\"))\n {\n index=i;\n }\n }\n transIdHoldingLock.remove(index);\n it.remove();\n }\n else if(currentLock.getLockState()==LockState.RL && currentLock.getTransIdHoldingLock().size()>1)\n {\n for(int i=0;i<transIdHoldingLock.size();i++)\n {\n if(transIdHoldingLock.get(i).toString().equals(currentTrans.getTransactionId()+\"\"))\n {\n index=i;\n }\n }\n transIdHoldingLock.remove(index);\n it.remove();\n }\n else\n {\n currentLock.setLockState(LockState.UL);\n for(int i=0;i<transIdHoldingLock.size();i++)\n {\n if(transIdHoldingLock.get(i).toString().equals(currentTrans.getTransactionId()+\"\"))\n {\n index=i;\n }\n }\n transIdHoldingLock.remove(index);\n it.remove();\n }\n currentLock.setTransIdHoldingLock(transIdHoldingLock);\n lockHashMap.put(currentLock.getItemName(),currentLock);\n }\n currentTrans.setItemsLocked(ItemsLocked);\n return currentTrans;\n\n }", "public List<Message> retrieveLeaves(BusinessDomain businessDomain, Transaction transaction, Date startDate,Date endDate, Set<Transaction> childTransactionsToIgnore);", "public Set<Hash> getTransactionHashSet() {\n LOGGER.fine(\"Transaction iterator creation requested.\");\n return transactionPool.getValidatedTransactionHashes();\n }", "@Override\n public Set<Transaction> getTransactions() {\n this.logger.finest(\"Transactions getter.\");\n return this.transactions;\n }", "public ArrayList<String> getOpenSubTransactions();", "List<Synchronization> handoverCompletions();", "public HashMap<String, Transaction> transactions() {\n return _transactions;\n }", "public List<Transaction> getTransactions() {\n return new LinkedList<>(this.transactions);\n }", "public List<Transaction> getTransactions()\n\t{\n\t\treturn Collections.unmodifiableList(transactions);\n\t}", "private ArrayList<MeetingLoanAccTransactions> populateLoanTransactions()\n {\n ArrayList<MeetingLoanAccTransactions> transactions = new ArrayList<MeetingLoanAccTransactions>();\n for (Member member : groupMembers)\n {\n LoanAccount nonEmergencyLoan = dbHandler.getMemberNonEmergencyActiveLoan(member.Id,null);\n LoanAccount emergencyLoan = dbHandler.getMemberEmergencyActiveLoan(member.Id, null);\n\n if(nonEmergencyLoan != null || emergencyLoan != null)\n {\n MeetingLoanAccTransactions transaction = new MeetingLoanAccTransactions(group, member, nonEmergencyLoan, emergencyLoan);\n transactions.add(transaction);\n }\n }\n return transactions;\n }", "public List<Transaction> transactions() {\n\t\treturn acctActivity.transactions() ;\n\t}", "public ArrayList<Transaction> getTransactions() {\n\t\treturn transactionList;\n\t}", "@Override\r\n public List<Transaction> getTransactions(Predicate p) {\r\n List<Transaction> return_list = new ArrayList<>();\r\n this.accounts.parallelStream().forEach(account -> return_list.addAll(account.getTransactions(p)));\r\n return return_list;\r\n }", "public List getTransactions();", "protected abstract Set<TargetObject> getActivatableThings() throws Throwable;", "public List<MaintenanceLock> generateMaintenanceLocks();", "void pruneLeases() {\n\t\tLOG.debug( \"---pruneLeases---\" );\n\t\tlease_pruner.reset();\n\n\t\tmap_lock.lock();\n\t\ttry {\n\t\t\tProxyWeakReference ref;\n\t\t\twhile( ( ref = ( ProxyWeakReference ) ref_queue.poll() ) != null ) {\n\t\t\t\tobject_to_id_map.remove( ref.delegate );\n\t\t\t\tid_to_object_map.remove( ref.object_id );\n\n\t\t\t\tLOG.debug( \"Removing object {}: {}\", Integer.valueOf( ref.object_id ),\n\t\t\t\t\tref.delegate_to_string );\n\n\t\t\t\tperformance_listeners.leasedObjectRemoved( vmid, ref.object_id );\n\t\t\t}\n\n\t\t\tid_to_object_map.forEachValue( lease_pruner );\n\t\t}\n\t\tfinally {\n\t\t\tmap_lock.unlock();\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens the birthday statistics.
@FXML private void handleShowBirthdayStatistics() { mainController.showBirthdayStatistics(); }
[ "public birthday() {\n initComponents();\n }", "public java.util.Date getBirthday() {\n\t\treturn _vFile.getBirthday();\n\t}", "public java.util.Calendar getBirthday() {\r\n return birthday;\r\n }", "public void testTotalBirths () {\n FileResource fr = new FileResource(\"data/yob2014.csv\");\n totalBirths(fr);\n }", "public Date getBirthDate(){\r\n\t\treturn birthDate;\r\n\t}", "public java.util.Calendar getBirthday() {\n return birthday;\n }", "public Date getBirthdate() {\n\t\treturn birthdate;\n\t}", "public LocalDate getBirthday() {\n\t\treturn birthday;\n\t}", "OpenFileStats(List<String> args) {\n super(args);\n }", "public Date getBirthDay() {\n\t\treturn this.birthDay;\n\t}", "@OnClick(R.id.tvBirthday)\n void onClickBirthday(){\n new DatePickerDialog(SignupActivity.this, date, myCalendar\n .get(Calendar.YEAR), myCalendar.get(Calendar.MONTH),\n myCalendar.get(Calendar.DAY_OF_MONTH)).show();\n }", "public static void main(String []args) {\n System.out.println(\"First name: Maxim\");\n System.out.println(\"Second name: Pedich\");\n\n /** create calendars */\n Calendar Birthday = Calendar.getInstance();\n Calendar CurrentDate = Calendar.getInstance();\n Calendar Difference = Calendar.getInstance();\n\n /** assign a date of birth */\n Birthday.set(1989,8,16);\n\n /** setting the date format */\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd.MM.yyyy\");\n\n /** print the current date*/\n System.out.println(\"Date of birth: \"+dateFormat.format(Birthday.getTime()));\n\n /** finding the difference between dates */\n Difference.set(Calendar.YEAR,CurrentDate.get(Calendar.YEAR)-Birthday.get(Calendar.YEAR));\n Difference.set(Calendar.MONTH,CurrentDate.get(Calendar.MONTH)-Birthday.get(Calendar.MONTH));\n Difference.set(Calendar.DATE,CurrentDate.get(Calendar.DATE)-Birthday.get(Calendar.DATE));\n\n if (CurrentDate.get(Calendar.YEAR)==Birthday.get(Calendar.YEAR)){\n System.out.println(\"Difference date: 0 y \"+Difference.get(Calendar.MONTH)+\" m \"+Difference.get(Calendar.DAY_OF_MONTH)+ \" d\");\n }\n else {\n System.out.println(\"Difference date: \"+Difference.get(Calendar.YEAR)+\" y \"+Difference.get(Calendar.MONTH)+\" m \"+Difference.get(Calendar.DAY_OF_MONTH)+ \" d\");\n }\n }", "int getBirthDay(){\n return birthDay;\n }", "public Date getPatientBirthday() {\n return patientBirthday;\n }", "public Date getBirthdate() {\n\t\treturn this.birthdate;\n\t}", "public Calendar getDateOfBirth()\n {\n return dateOfBirth;\n }", "public BFDRBirth() {\n \n }", "void setBirthDay(int day){\n birthYear = day;\n }", "public int[] birthday();", "public void open() {\r\n this.open(this.gates.length / 2);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
private void $$$setupUI$$$() { final JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(6, 3, new Insets(0, 0, 0, 0), -1, -1)); panel1.setBackground(new Color(-16777216)); panel2.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label1 = new JLabel(); label1.setForeground(new Color(-13575640)); label1.setText("Width:"); panel1.add(label1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label2 = new JLabel(); label2.setForeground(new Color(-13575640)); label2.setText("Heidth:"); panel1.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label3 = new JLabel(); label3.setForeground(new Color(-13575640)); label3.setText("Setting"); panel1.add(label3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); textField2 = new JTextField(); textField2.setBackground(new Color(-2695207)); textField2.setText(""); panel1.add(textField2, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final Spacer spacer1 = new Spacer(); panel1.add(spacer1, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); final Spacer spacer2 = new Spacer(); panel1.add(spacer2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); backButton = new JButton(); backButton.setBackground(new Color(-16777216)); backButton.setForeground(new Color(-13575640)); backButton.setText("Back"); panel1.add(backButton, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label4 = new JLabel(); label4.setForeground(new Color(-13575640)); label4.setText("Length snake:"); panel1.add(label4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); textField1 = new JTextField(); textField1.setBackground(new Color(-2695207)); panel1.add(textField1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); length = new JTextField(); length.setBackground(new Color(-2695207)); panel1.add(length, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); speedText = new JTextField(); speedText.setBackground(new Color(-2695207)); panel1.add(speedText, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); labelSpeed = new JLabel(); labelSpeed.setForeground(new Color(-13575640)); labelSpeed.setText("Speed snake:"); panel1.add(labelSpeed, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); }
[ "@Override\n\tprotected void UpdateUI() {\n\t}", "@Override\n\tprotected void onGuiEvent(GuiEvent arg0) {\n\t\t\n\t}", "@Override\n\t\t\tprotected void updateUI() {\n\t\t\t\tsuper.updateUI();\n\t\t\t}", "private void $$$setupUI$$$() {\n MyPanel = new JPanel();\n MyPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 3, new Insets(0, 0, 0, 0), -1, -1));\n result = new JLabel();\n result.setText(\"\");\n MyPanel.add(result, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n pseudo = new JTextArea();\n MyPanel.add(pseudo, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));\n usersList = new JList();\n usersList.setLayoutOrientation(0);\n MyPanel.add(usersList, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 3, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 0, false));\n button1 = new JButton();\n button1.setText(\"Change Pseudo\");\n MyPanel.add(button1, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(117, 50), null, 0, false));\n pseudoInput = new JTextField();\n pseudoInput.setDragEnabled(false);\n pseudoInput.setEditable(true);\n pseudoInput.setHorizontalAlignment(10);\n MyPanel.add(pseudoInput, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, 50), null, 0, false));\n PSEUDOTextArea = new JTextArea();\n PSEUDOTextArea.setLineWrap(false);\n PSEUDOTextArea.setText(\" PSEUDO\");\n MyPanel.add(PSEUDOTextArea, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_EAST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, new Dimension(150, 50), null, 1, false));\n }", "@Override\r\n public void drawGUI()\r\n {\n \r\n }", "private void insertGui() {\n\n int list;\n TableEntry element;\n\n list = 0;\n while (list < Driver.getNumberOf()) {\n element = Driver.getDriver(list);\n if (gui != null) gui.addDriver(element.getIndex(), element.getJavaCodeName());\n list++;\n }\n\n list = 0;\n while (list < Condition.getNumberOf()) {\n element = Condition.getCondition(list);\n if (gui != null) gui.addCondition(element.getIndex(), element.getJavaCodeName());\n list++;\n }\n\n if (gui != null)\n gui.setTriggersText(\"\");\n }", "private void updateGUI() {\n\t\tthis.beans = this.document.findBeansByType(this.typename);\n\t}", "private void $$$setupUI$$$() {\n rootPanel = new JPanel();\n rootPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1));\n final JLabel label1 = new JLabel();\n label1.setText(\"Description\");\n rootPanel.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n keywordsField = new JTextField();\n rootPanel.add(keywordsField, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n socialmediaLabel = new JLabel();\n socialmediaLabel.setText(\"Social media\");\n rootPanel.add(socialmediaLabel, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n socialmediaField = new JTextField();\n rootPanel.add(socialmediaField, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n priceLabel = new JLabel();\n priceLabel.setText(\"Price (max.)\");\n rootPanel.add(priceLabel, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n periodLable = new JLabel();\n periodLable.setText(\"Period (min.)\");\n rootPanel.add(periodLable, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n priceField = new JTextField();\n rootPanel.add(priceField, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n periodField = new JTextField();\n rootPanel.add(periodField, new com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n requestButton = new JButton();\n requestButton.setText(\"Request\");\n rootPanel.add(requestButton, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));\n contentPane.setBackground(new Color(-1182209));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));\n final JPanel panel2 = new JPanel();\n panel2.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n panel1.add(panel2, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n buttonOK = new JButton();\n buttonOK.setText(\"Select\");\n panel2.add(buttonOK, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n mainPanel = new JPanel();\n mainPanel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(5, 2, new Insets(0, 0, 0, 0), -1, -1));\n mainPanel.setBackground(new Color(-1115649));\n contentPane.add(mainPanel, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n mainPanel.setBorder(BorderFactory.createTitledBorder(null, \"\", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));\n sensorTypeLabel = new JLabel();\n sensorTypeLabel.setText(\"Sensor Type:\");\n mainPanel.add(sensorTypeLabel, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n mainPanel.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n motionSensorWithCameraRadioButton = new JRadioButton();\n motionSensorWithCameraRadioButton.setSelected(true);\n motionSensorWithCameraRadioButton.setText(\"Motion Sensor with Camera\");\n mainPanel.add(motionSensorWithCameraRadioButton, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n motionSensorWithoutCameraRadioButton = new JRadioButton();\n motionSensorWithoutCameraRadioButton.setText(\"Motion Sensor without Camera\");\n mainPanel.add(motionSensorWithoutCameraRadioButton, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"Trigger Notification Type:\");\n mainPanel.add(label1, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n phoneAlertRadioButton = new JRadioButton();\n phoneAlertRadioButton.setSelected(true);\n phoneAlertRadioButton.setText(\"Phone alert\");\n mainPanel.add(phoneAlertRadioButton, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n alarmAlertRadioButton = new JRadioButton();\n alarmAlertRadioButton.setText(\"Alarm alert\");\n mainPanel.add(alarmAlertRadioButton, new com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n }", "private void $$$setupUI$$$() {\n createUIComponents();\n panel = new JPanel();\n panel.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(8, 2, new Insets(0, 0, 0, 0), -1, -1));\n buttonToggleDirection = new JButton();\n buttonToggleDirection.setEnabled(true);\n buttonToggleDirection.setText(\"Toggle Direction\");\n panel.add(buttonToggleDirection, new com.intellij.uiDesigner.core.GridConstraints(6, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonConfigData = new JButton();\n buttonConfigData.setText(\"Show loks.cs2\");\n panel.add(buttonConfigData, new com.intellij.uiDesigner.core.GridConstraints(7, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n lightCheckBox = new JCheckBox();\n lightCheckBox.setEnabled(true);\n lightCheckBox.setText(\"Light\");\n panel.add(lightCheckBox, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"Velocity:\");\n panel.add(label1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final JPanel panel1 = new JPanel();\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 3, new Insets(0, 0, 0, 0), -1, -1));\n panel.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final JLabel label2 = new JLabel();\n label2.setText(\"Loc-ID:\");\n panel1.add(label2, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n comboBoxLocId = new JComboBox();\n comboBoxLocId.setEditable(true);\n panel1.add(comboBoxLocId, new com.intellij.uiDesigner.core.GridConstraints(0, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n radioButtonEthernet = new JRadioButton();\n radioButtonEthernet.setEnabled(true);\n radioButtonEthernet.setSelected(true);\n radioButtonEthernet.setText(\"Ethernet\");\n panel1.add(radioButtonEthernet, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n comboBoxSerialPort = new JComboBox();\n comboBoxSerialPort.setEnabled(false);\n panel1.add(comboBoxSerialPort, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n radioButtonSerialPort = new JRadioButton();\n radioButtonSerialPort.setEnabled(true);\n radioButtonSerialPort.setText(\"SerialPort\");\n panel1.add(radioButtonSerialPort, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n formattedTextFieldIpAddress.setEnabled(true);\n formattedTextFieldIpAddress.setText(\"\");\n panel1.add(formattedTextFieldIpAddress, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\n sliderVelocity = new JSlider();\n sliderVelocity.setEnabled(true);\n sliderVelocity.setInverted(false);\n sliderVelocity.setMajorTickSpacing(10);\n sliderVelocity.setMaximum(1000);\n sliderVelocity.setMinimum(0);\n sliderVelocity.setMinorTickSpacing(1);\n sliderVelocity.setOrientation(0);\n sliderVelocity.setPaintLabels(false);\n sliderVelocity.setPaintTicks(true);\n sliderVelocity.setPaintTrack(true);\n sliderVelocity.setSnapToTicks(false);\n sliderVelocity.setValue(0);\n panel.add(sliderVelocity, new com.intellij.uiDesigner.core.GridConstraints(1, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonBootloaderGo = new JButton();\n buttonBootloaderGo.setEnabled(true);\n buttonBootloaderGo.setText(\"Bootloader Go\");\n panel.add(buttonBootloaderGo, new com.intellij.uiDesigner.core.GridConstraints(3, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonStart = new JButton();\n buttonStart.setEnabled(true);\n buttonStart.setText(\"Start\");\n panel.add(buttonStart, new com.intellij.uiDesigner.core.GridConstraints(4, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n buttonStop = new JButton();\n buttonStop.setEnabled(true);\n buttonStop.setText(\"Stop\");\n panel.add(buttonStop, new com.intellij.uiDesigner.core.GridConstraints(5, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n label2.setLabelFor(comboBoxLocId);\n }", "private void $$$setupUI$$$() {\n MainWindow = new JPanel();\n MainWindow.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 4, new Insets(0, 0, 0, 0), -1, -1));\n equipButton = new JButton();\n equipButton.setText(\"Equip\");\n MainWindow.add(equipButton, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n dropButton = new JButton();\n dropButton.setText(\"Drop\");\n MainWindow.add(dropButton, new com.intellij.uiDesigner.core.GridConstraints(2, 2, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n IntroText = new JLabel();\n IntroText.setText(\"Equip or Drop the artifact!\");\n MainWindow.add(IntroText, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n ArtifactLabel = new JLabel();\n ArtifactLabel.setText(\"Artifact Stats:\");\n MainWindow.add(ArtifactLabel, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n ArtifactStats = new JLabel();\n ArtifactStats.setText(\"*STATS*\");\n MainWindow.add(ArtifactStats, new com.intellij.uiDesigner.core.GridConstraints(1, 2, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n MainWindow.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(2, 3, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n MainWindow.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\n }", "private void $$$setupUI$$$() {\n Portada = new JPanel();\n Portada.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(4, 2, new Insets(20, 20, 20, 20), -1, -1));\n a1JugadorButton = new JButton();\n a1JugadorButton.setText(\"1 Jugador\");\n Portada.add(a1JugadorButton, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n Portada.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 3, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, new Dimension(362, 11), null, 0, false));\n a2JugadoresButton = new JButton();\n a2JugadoresButton.setText(\"2 Jugadores\");\n Portada.add(a2JugadoresButton, new com.intellij.uiDesigner.core.GridConstraints(3, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer2 = new com.intellij.uiDesigner.core.Spacer();\n Portada.add(spacer2, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 2, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n final JLabel label1 = new JLabel();\n label1.setText(\"Bienvenido a SansaStone\");\n Portada.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, new Dimension(400, -1), null, null, 0, false));\n }", "private void $$$setupUI$$$() {\n contentPane = new JPanel();\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 1, new Insets(10, 10, 10, 10), -1, -1));\n final JLabel label1 = new JLabel();\n label1.setText(\"Genome distance threshold.\");\n contentPane.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\n distanceThreshold = new IntTextField();\n contentPane.add(distanceThreshold, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\n contentPane.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_VERTICAL, 1, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));\n }", "protected void setupUI()\r\n\t{\r\n\t}", "public void UI() {\n\n\t\tframe.setTitle(\"Insertion Sort\");\n\t\tframe.setSize(1200,1200);\n\t\tframe.setVisible(true);\n\t\tframe.getContentPane();\n\n\t\tLabel menu = new Label(\"Enter a list using CSV format\");\n\t\ttext.setSize(100, 100);\n\n\t\tpanel.add(menu);\n\t\tpanel.add(text);\n\t\tpanel.setSize(50, 50);\n\t\t\n\t\tframe.add(panel);\n\t}", "protected abstract void configUI();", "private void $$$setupUI$$$() {\r\n contentPane = new JPanel();\r\n contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));\r\n final JPanel panel1 = new JPanel();\r\n panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));\r\n contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));\r\n final com.intellij.uiDesigner.core.Spacer spacer1 = new com.intellij.uiDesigner.core.Spacer();\r\n panel1.add(spacer1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));\r\n final JPanel panel2 = new JPanel();\r\n panel2.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1, true, false));\r\n panel1.add(panel2, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\r\n buttonOK = new JButton();\r\n buttonOK.setText(\"OK\");\r\n panel2.add(buttonOK, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\r\n buttonCancel = new JButton();\r\n buttonCancel.setText(\"Cancel\");\r\n panel2.add(buttonCancel, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\r\n final JPanel panel3 = new JPanel();\r\n panel3.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));\r\n contentPane.add(panel3, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));\r\n final JLabel label1 = new JLabel();\r\n label1.setText(\"Выберите тип обучения:\");\r\n panel3.add(label1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\r\n comboBoxTypeLearn = new JComboBox();\r\n panel3.add(comboBoxTypeLearn, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\r\n labelTag = new JLabel();\r\n labelTag.setText(\"Укажите метку:\");\r\n panel3.add(labelTag, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));\r\n tagText = new JTextField();\r\n panel3.add(tagText, new com.intellij.uiDesigner.core.GridConstraints(2, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_HORIZONTAL, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_WANT_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false));\r\n }", "public GUI_Manual() {\n initComponents();\n }", "public void opprettGUI(){\n\t\tnew Sudoku(d, y, x, this, buffer);\n\t}", "public modify() {\n initComponents();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the Month component of the specified time instant. If the new month has less total days than the specified day of the month, this value is coerced to the nearest sane value. e.g. 0731 to month 6 = 0630 0331 to month 2 = 0228 or 0229 depending
public long set(long instant, int month) { FieldUtils.verifyValueBounds(this, month, MIN, iMax); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[74]++; CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[75]++; // int thisYear = iChronology.getYear(instant); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[76]++; // int thisDom = iChronology.getDayOfMonth(instant, thisYear); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[77]++; int maxDom = iChronology.getDaysInYearMonth(thisYear, month); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[78]++; int CodeCoverConditionCoverageHelper_C19; if ((((((CodeCoverConditionCoverageHelper_C19 = 0) == 0) || true) && ( (((CodeCoverConditionCoverageHelper_C19 |= (2)) == 0 || true) && ((thisDom > maxDom) && ((CodeCoverConditionCoverageHelper_C19 |= (1)) == 0 || true))) )) && (CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.conditionCounters[19].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C19, 1) || true)) || (CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.conditionCounters[19].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C19, 1) && false)) { CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.branches[35]++; // Quietly force DOM to nearest sane value. thisDom = maxDom; CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[79]++; } else { CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.branches[36]++;} // Return newly calculated millis value return iChronology.getYearMonthDayMillis(thisYear, month, thisDom) + iChronology.getMillisOfDay(instant); }
[ "public void setMonth (int month) {\n\tcheckWidget ();\n\tSYSTEMTIME systime = new SYSTEMTIME ();\n\tint msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_GETCURSEL : OS.DTM_GETSYSTEMTIME;\n\tOS.SendMessage (handle, msg, 0, systime);\n\tmsg = (style & SWT.CALENDAR) != 0 ? OS.MCM_SETCURSEL : OS.DTM_SETSYSTEMTIME;\n\tsystime.wMonth = (short)(month + 1);\n\tOS.SendMessage (handle, msg, 0, systime);\n\tlastSystemTime = null;\n}", "public void setMonth(int m);", "public Builder setMonth(int value) {\n bitField0_ |= 0x00000002;\n month_ = value;\n onChanged();\n return this;\n }", "public void setMonth(long month) {\n\t\tthis.month = (month>0)?month:this.month;\n\t\tthis.makeInGoodConditionAppend();\n\t}", "private void setMonth(int month) {\n\t\t\n\t\tthis.month = month;\n\t\t\n\t}", "public void setMonth (int setMonth) throws IllegalArgumentException{\r\n\t\tif(setMonth < 1 || setMonth > 12)\r\n\t\t\tthrow new IllegalArgumentException(\"Invalid month\");\r\n\t\tmonth = setMonth;\r\n\t}", "void setMonth(int m)\r\n {\r\n month = (byte)m;\r\n }", "public void setMonth(Month month)\n {\n this._month = month;\n }", "public static void setMonth(GregorianCalendar cal, String month)\n {\n try\n {\n DateInput.setMonth(cal, Integer.parseInt(month));\n }\n catch(java.lang.NumberFormatException ex)\n {\n DateInput.setMonth(cal, 0); // set to zero.\n }\n }", "public void setMonth(String month) { this.month = month; }", "public void setMonth(int month)\n\t{\n\t\tthis.month = month;\n\t}", "public Builder setDayInMonth(int value) {\n bitField0_ |= 0x00000004;\n dayInMonth_ = value;\n onChanged();\n return this;\n }", "public void switchToMonthView() {\n\t\tviewMode = Mode.MONTH;\n\t\tmonthButton.setVisible(false);\n\t\tcalendar.setTime(currentMonthsFirstDate);\n\t\tcalendarComponent.setStartDate(currentMonthsFirstDate);\n\t\tupdateCaptionLabel();\n\t\tcalendar.add(GregorianCalendar.MONTH, 1);\n\t\tcalendar.add(GregorianCalendar.DATE, -1);\n\t\tresetCalendarTime(true);\n\t}", "public void setMonth(int monthNumber)\n {\n if ((monthNumber <= 0) || (monthNumber > 12))\n {\n System.out.println(\"Fatal Error\");\n System.exit(0);\n }\n else\n month = monthString(monthNumber);\n }", "public Month(int aMonth)\n\t{\n\t\tmonth = aMonth - 1;\n\t\tlistOfMonths[0] = \"January\";\n\t\tlistOfMonths[1] = \"February\";\n\t\tlistOfMonths[2] = \"March\";\n\t\tlistOfMonths[3] = \"April\";\n\t\tlistOfMonths[4] = \"May\";\n\t\tlistOfMonths[5] = \"June\";\n\t\tlistOfMonths[6] = \"July\";\n\t\tlistOfMonths[7] = \"August\";\n\t\tlistOfMonths[8] = \"September\";\n\t\tlistOfMonths[9] = \"October\";\n\t\tlistOfMonths[10] = \"November\";\n\t\tlistOfMonths[11] = \"December\";\n\t}", "@Accessor(qualifier = \"month\", type = Accessor.Type.SETTER)\n\tpublic void setMonth(final Integer value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(MONTH, value);\n\t}", "public void setNextMonth() {\n if (this.cal_month.get(2) == this.cal_month.getActualMaximum(2)) {\n this.cal_month.set(this.cal_month.get(1) + 1, this.cal_month.getActualMinimum(2), 1);\n } else {\n this.cal_month.set(2, this.cal_month.get(2) + 1);\n }\n }", "@Test (expected = IllegalArgumentException.class)\n public void testSetMonth1() {\n GeoCountDownTimer s1 = new GeoCountDownTimer(2019, 5, 2);\n s1.setMonth(13);\n assertEquals(\"Wrong month outputted\", 3, s1.getMonth());\n }", "public void setMonth(final String month) {\n this.month = month;\n }", "public Builder setToMonth(io.dstore.values.IntegerValue value) {\n if (toMonthBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n toMonth_ = value;\n onChanged();\n } else {\n toMonthBuilder_.setMessage(value);\n }\n\n return this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method attempts to connect to/create a new database. Creates an initial table with 10 columns AJ after db connection.
public static void createDB(String dbName) { Connection conn = null; Statement stmt = null; //sql statement to create a table with 10 columns to match the csv. String sql = "CREATE TABLE records (" + "A TEXT NOT NULL," + "B TEXT NOT NULL," + "C TEXT NOT NULL," + "D TEXT NOT NULL," + "E TEXT NOT NULL," + "F TEXT NOT NULL," + "G TEXT NOT NULL," + "H TEXT NOT NULL," + "I TEXT NOT NULL," + "J TEXT NOT NULL)"; //if dbName isn't already a file if (!alreadyExists(dbName)) { //Check for driver try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException e) { e.printStackTrace(); } //connect to/create the db try{ //creates new db on first connection attempt conn = DriverManager.getConnection("jdbc:sqlite:" + dbName); System.out.println("Database Connection Successful"); //if the connection is established create the table if (conn != null) { try { stmt = conn.createStatement(); stmt.executeUpdate(sql); System.out.println("Table created"); } catch (SQLException sqlException) { sqlException.printStackTrace(); } finally { DbUtils.closeQuietly(stmt); DbUtils.closeQuietly(conn); } } } catch (Exception e) { System.err.println(e.getClass().getName() + ": " + e.getMessage()); System.exit(0); } } else { System.out.println("Database File Already Exists"); } }
[ "public void createDatabase() {\n\t\ttry {\n\t\t\tConnection con = DriverManager.getConnection(url);\n\t\t\tcon.setAutoCommit(false);\n\t\t\tStatement stm = con.createStatement();\n\t\t\tcreateUserTable(stm);\n\t\t\tcreateSignatureTable(stm);\n\t\t\tcreateUserSignatureTable(stm);\n\t\t\tcreateFieldTable(stm);\t\n\t\t\tcreateUserFieldTable(stm);\n\t\t\tcreateComputerTable(stm);\n\t\t\tstm.executeBatch();\n\t\t\tcon.close();\n\t\t} catch (SQLException e) {\n\t\t\tlog.error(\"Tables could not be created\", e);\n\t\t}\n\t}", "public void createNewDatabase() {\r\n try (Connection conn = DriverManager.getConnection(driverURL)) {\r\n if (conn != null) {\r\n DatabaseMetaData meta = conn.getMetaData();\r\n// System.out.println(\"Database database.db created.\");\r\n }\r\n } catch (Exception ex) {\r\n }\r\n }", "public static void initializeDB(){\n\t\tConnection conn = getConnection();\n\t\tcreateDB(conn);\n\t\tuseDB(conn);\n\t\tcreateTables(conn);\n\t}", "public void createDatabase() {\r\n\t\ttry (Connection conn = DriverManager.getConnection(this.url)) {\r\n if (conn != null) {\r\n DatabaseMetaData meta = conn.getMetaData();\r\n System.out.println(\"The driver name is \" + meta.getDriverName());\r\n System.out.println(\"A new database has been created, if not already existing.\");\r\n }\r\n } catch (SQLException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n\t}", "public SetUpDB()\n\t{\n\t\ttry\n\t\t{\n\t\t\tstatement = Connector.getConn().createStatement();\n\t\t\t\n\t\t\tsetUpAudioTracks();\n\t\t\tsetUpQueueList();\n\t\t\tsetUpHistory();\n\t\t\tsetUpSettings();\n\t\t\tsetUpWishList();\n\t\t\tsetUpAlbumCovers();\n\t\t\t\n\t\t\tstatement.close();\n\t\t}\n\t\tcatch (SQLException e)\n\t\t{\n\t\t\tSystem.out.println(\"Exception when trying to set up db\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void createDatabase() {\r\n\t\ttry {\r\n\t\t\t// This will load the MySQL driver, each DB has its own driver\r\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");// com.mysql.cj.jdbc.Driver\r\n\t\t\t// Setup the connection with the DB\r\n\t\t\tconnect = DriverManager.getConnection(dburl, user, pass);\r\n\t\t\tSystem.out.println(\"DB connection successful to: \" + dburl);\r\n\t\t\tSystem.out.println(\"Creating database...\");\r\n\t\t\tstatement = connect.createStatement();\r\n\t\t\tString sql = \"CREATE DATABASE IF NOT EXISTS u209758462_miskb \";\r\n\t\t\tstatement.executeUpdate(sql);\r\n\r\n\t\t\tSystem.out.println(\"Database created successfully...\");\r\n\t\t\tSystem.out.println(\"Databasen skapades hos: \" + dburl);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.printf(\"Something went wrong: \", e);\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tresultSet.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tSystem.out.printf(\"Something went wrong: \", e);\r\n\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tstatement.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tSystem.out.printf(\"Something went wrong: \", e);\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tconnect.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tSystem.out.printf(\"Something went wrong: \", e);\t\t\t}\r\n\t\t}\r\n\t}", "public void createDB() throws SQLException;", "public void setupDatabase() throws DatabaseNotConnectedException {\n if (!database.isConnected()) {\n throw new DatabaseNotConnectedException(\"Database is not connected\");\n }\n\n Task<Void> setupTask = new Task<Void>() {\n\n @Override\n protected Void call() throws Exception {\n database.setupSchema();\n return null;\n }\n };\n setupTask.setOnSucceeded((WorkerStateEvent event) -> {\n loggerReaper.log(Level.INFO, \"Database created\");\n });\n setupTask.setOnFailed((WorkerStateEvent event) -> {\n if (event.getSource().getException() != null) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n event.getSource().getException().printStackTrace(pw);\n loggerReaper.log(Level.SEVERE, sw.toString());\n }\n });\n new Thread(setupTask).start();\n }", "void createDB() throws SQLException;", "public DatabaseControl() throws SQLException\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tconnection = DriverManager.getConnection(connectionURL); //make a connection\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tcreateTable(\"PATRONS\", createPatronsTableCommand);\r\n\t\tcreateTable(\"BOOKS\", createBooksTableCommand);\r\n\t}", "private void createDB() {\n\t\tConnection con = null;\n\n\t\t// Generate the url to the PostgreSQL database\n\t\tString url = \"jdbc:postgresql:\" + postgresUrl;\n\t\ttry {\n\n\t\t\t// Get a connection to PostgreSQL\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tcon = DriverManager.getConnection(url, user, password);\n\n\t\t\tStatement st;\n\t\t\tst = con.createStatement();\n\n\t\t\t// Create SQL\n\t\t\tString sql = String.format(\"CREATE DATABASE %s;\", dbName);\n\t\t\tlogger.warn(String\n\t\t\t\t\t.format(\"Database %s does not exist in Postregres. A new one is going to be created: SQL request: %s\",\n\t\t\t\t\t\t\tdbName, sql));\n\t\t\t// Execute the SQL\n\t\t\tst.execute(sql);\n\n\t\t} catch (SQLException ex) {\n\t\t\tlogger.error(\"Error!! \", ex);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tlogger.error(\"Error!! \", e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\t// Close connection\n\t\t\t\tif (con != null) {\n\t\t\t\t\tcon.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlogger.error(\"Error!! \", e);\n\n\t\t\t}\n\t\t}\n\n\t}", "@Override\r\n public void initSQLEnv() {\n TSQLCatalog sqlCatalog = createSQLCatalog(\"master\");\r\n // add a new schema: dbo\r\n TSQLSchema sqlSchema = sqlCatalog.createSchema(\"dbo\");\r\n //add a new table: aTab\r\n TSQLTable aTab = sqlSchema.createTable(\"aTab\");\r\n aTab.addColumn(\"Quantity1\");\r\n\r\n //add a new table: bTab\r\n TSQLTable bTab = sqlSchema.createTable(\"bTab\");\r\n bTab.addColumn(\"Quantity2\");\r\n\r\n //add a new table: cTab\r\n TSQLTable cTab = sqlSchema.createTable(\"cTab\");\r\n cTab.addColumn(\"Quantity\");\r\n\r\n TSQLTable tab = sqlSchema.createTable(\"sysforeignkeys\");\r\n tab.addColumn(\"keyno\");\r\n\r\n tab = sqlSchema.createTable(\"employee\");\r\n tab.addColumn(\"max_lvl\");\r\n tab.addColumn(\"min_lvl\");\r\n\r\n }", "static void createTable() throws SQLException {\n\t\ttry (Connection conn = ConferenceDatabase.getConnectionDataBase().getConnection()) {\n\t\t\tconn.createStatement().execute(CREATETABLE);\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"The database could not be created or upgraded, there must be an old version on your computer, please execute the function Detete database\");\n\t\t\tthrow e;\n\t\t}\n\n\t}", "public void DBSetup() \n\t {\t\n\t\t System.out.println(\"DBBuilder starting in \" + framework + \" mode\");\n\n\t try\n\t {\n\t Properties props = new Properties(); // connection properties\n\t props.put(\"user\", \"user1\");\n\t props.put(\"password\", \"user1\");\n\t\n\t String dbName = \"DB\"; // the name of the database\n\t conn = DriverManager.getConnection(protocol+dbName+\";create=true;\",props); // Database already exists.\n\t s = conn.createStatement();\n\t System.out.println(\"Connected to database \" + dbName);\n\t }catch (SQLException sqle){printSQLException(sqle);}\n\t \n\t\t try{\n\t\t\t s.execute(\"create table missionary(missionary_id int NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1) primary key, name varchar(40))\");\n\t\t\t System.out.println(\"Missionary Table setup\");\n\t\t }catch(SQLException sqle) {printSQLException(sqle);}\n\t\t try{\n\t\t\t s.execute(\"create table donor(donor_id int primary key NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), name varchar(40))\");\n\t\t\t System.out.println(\"Donor Table setup\");\n\t\t }catch(SQLException sqle) {printSQLException(sqle);}\n\t\t \n\t\t try{\n\t\t\t s.execute(\"create table donation(donation_id int primary key NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), donor_id int, missionary_id int, amount double, donation_date varchar(20))\");\n\t\t\t System.out.println(\"Donation setup\");\n\t\t }catch(SQLException sqle) {printSQLException(sqle);}\n\t\t System.out.println(\"FLAG TABLE SETUP END\");\n\t\t disconnect();\n\t\t \n\t }", "private void MakeConn() throws SQLException{\n con = DriverManager.getConnection(conURL);\r\n MakeTable();\r\n }", "private void initializeDB() {\r\n try {\r\n Class.forName(\"org.sqlite.JDBC\").newInstance();\r\n conn = DriverManager.getConnection(\"jdbc:sqlite:phase2.db\");\r\n stmt = conn.createStatement();\r\n createTables();\r\n // For testing purposes.\r\n UUID adminID = UUID.fromString(\"37ce95a7-b11f-4bc1-938e-4ab8b5b5d225\");\r\n insertUser(adminID, \"DBAdmin\", \"DBAdmin\", \"o\");\r\n } catch (SQLException | IllegalAccessException | ClassNotFoundException | InstantiationException e) {\r\n System.out.println(\"Something went wrong on first time initialization of DB.\");\r\n e.printStackTrace();\r\n }\r\n }", "public void init() {\n\t try {\n\t Class.forName(\"org.postgresql.Driver\");\n\t this.connection = DriverManager.getConnection(\"jdbc:postgresql://localhost:5432/corentinhelyx\", \"postgres\", \"\");\n\n\t this.reset();\n\t this.createTables();\n\n\t } catch (Exception e) {\n\t e.printStackTrace();\n\t System.err.println(e.getClass().getName()+\": \"+e.getMessage());\n\t System.exit(0);\n\t }\n\t System.out.println(\"Opened database successfully\");\n }", "private void initDatabase() {\n dbConnection.open();\n\n // Close connection\n dbConnection.close();\n\n }", "public void setupDatabase(){\n\t\t\n\t\t\n\t\t\n\t}", "public void connectDataBase() throws SQLException, IOException {\n // Setting connection to database\n this.setDataBaseConnectionProperties();\n //Reading and executing sql create authors request\n this.readAndExecuteSqlScript(\"createAuthors.sql\");\n //Reading and executing sql create table request\n this.readAndExecuteSqlScript(\"createTable.sql\");\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers a mouse release on the gameboard
@Override public void mouseReleased(MouseEvent e) { // Mouse was released (user clicked) addPoint(e); }
[ "protected void mouseReleasedAction()\r\n\t{\r\n\t\t//Make a move described by the mouse movement between press and release\r\n\t\t//Not implemented in Connect 4, since only mouseDownX is required to play this.\r\n\t\t/*\r\n\t\tboard.makeMove(mouseDownX,mouseDownY,mouseUpX,mouseUpY,0,0,getSize().width,getSize().height);\r\n\t\t*/\r\n\t}", "@Override\n\tpublic void onMouseRelease(MouseEvent release) {\n\t\t\n\t}", "@Override\n\tpublic void onRelease(MouseEvent e) {\n\n\t}", "public void onRightReleased(int mouseX, int mouseY);", "public static void doMouseRelease(int x, int y)\n {\n\t\tcreateMouseEvent(x, y, \"MouseUp\");\n }", "void mouseReleased(Button b);", "@Override\n\tpublic void mouseReleased() {\n\t\t\n\t}", "public void releaseMouse() {\n\t\tMouseEvent released = new MouseEvent(canvas, MouseEvent.MOUSE_RELEASED,\n\t\t\t\tSystem.currentTimeMillis(), 0, (int) position.getX(),\n\t\t\t\t(int) position.getY(), 1, false);\n\t\tmouseListener.mouseReleased(released);\n\t}", "@Override\n \tpublic void mouseReleased(int arg0, int arg1, int arg2) {\n \n \t}", "@Override\r\n\tpublic void mouseReleased(MouseEvent e) {\n\t\tSystem.out.println(\"release\");\r\n\t}", "@Override\n public void mouseReleased(MouseEvent e) {}", "public void onMouseReleased() {\n\t\thh.draw();\n\t\thh.clear();\n\t\t//hsl2d.clear();\n\t\t\n\t}", "public void mouseReleased(java.awt.event.MouseEvent e) {\n }", "@Override\n public void release(Vector2f mousePosition)\n {\n // No background color to change so do nothing\n }", "@Override\n \t\t\tpublic void mouseReleased(MouseEvent e) {\n \n \t\t\t}", "public void onMouseReleased(int button) {\n\t\t\n\t}", "public void mouseReleased( PInputEvent event ) {\n _isDragging = false;\n }", "public void mouseReleased(MouseEvent e) {\r\n\r\n }", "public void mouseRightRelease()\r\n\t{\r\n\t\tif(this.mouseRight == 1)\r\n\t\t{\r\n\t\t\tthis.mouseLeft \t= 0;\r\n\t\t\tthis.mouseRight = 0;\r\n\t\t\tthis.mouseDrag\t= 0;\r\n\t\t\tthis.touch\t\t= new ArrayList<Integer>();\r\n\t\t\tthis.state.handle(this);\r\n\t\t}\r\n\t}", "@Override\n public void mouseReleased(MouseEvent m) {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new 'CompanyServiceBeanConfigurationException' instance with the given message.
public CompanyServiceBeanConfigurationException(String message) { super(message); }
[ "public SearchBuilderConfigurationException(String message) {\r\n super(message);\r\n }", "public LoggerConfigurationException(String message)\r\n {\r\n super(message);\r\n }", "public InvalidConfigurationException(String msg) {\r\n super(msg);\r\n }", "public InvalidConfigException(String message) {\n super(message);\n }", "private void throwConfigurationException(String message) throws ConfigurationException {\n\t\tthrowConfigurationException(message, null);\n\t}", "public static InternalException invalidConfiguration(String pMessage, Object... pArguments) {\r\n return new InternalException(pMessage, pArguments);\r\n }", "public ServiceException(String message)\r\n {\r\n super(message);\r\n }", "public InvalidConfigurationException() {\r\n }", "public IdentityServiceException(final String message) {\n\t\tsuper(message);\n\t}", "public BusinessException(String message, String messageKey) {\r\n\tsuper(message);\r\n\tthis.messageKey = messageKey;\r\n }", "public ExcelException(String message) {\n super(message);\n }", "public DuplicateTariffServiceException(String message) {\r\n\t\tsuper(message);\r\n\r\n\t}", "public ConfluenceManagementServiceConfigurationException() {\r\n super();\r\n }", "public BusinessException(final String message) {\r\n super(message);\r\n LOGGER.warn(getMessage());\r\n }", "public RepairServiceException(String message)\n {\n super(message);\n }", "public InvalidEmailException(String message)\n {\n super(message);\n }", "public WebServiceException(String message) {\n super(message);\n }", "public ValidationException(final String message) {\r\n super(message);\r\n }", "public BusinessException(String message) {\n\t\tsuper(message, ErrorCodes.BUSINESS_ERROR);\n\t}", "public BusinessException(String message) \n {\n super();\n errorCode = message;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ERROR HANDLING:nok DOC:nok TEST:nok
public void setArtistId(String key, String value) { Object obj = findEntry(this.currentEntryId); if(obj instanceof Artist) { ((Artist) obj).getArtistIdMap().put(key, value); calcResolvBaseMaps(key); } }
[ "@Override\n public void fail() {\n }", "private void fail(String out) {\r\n gui.trace(\"Fehler: \" + out);\r\n answer(ERROR);\r\n closeServer();\r\n }", "@Override\n public void fail(int err, String reason, String result) {\n\n }", "@Test(timeout = 4000)\n public void test04() throws Throwable {\n JSJshop jSJshop0 = new JSJshop();\n jSJshop0.sol();\n JSJshopVars.backquote = 0;\n JSJshopVars.plus = (-3477);\n jSJshop0.prob();\n jSJshop0.prob();\n JSJshopVars.coma = 44;\n jSJshop0.getDeleteList();\n // Undeclared exception!\n try { \n jSJshop0.testParser();\n fail(\"Expecting exception: System.SystemExitException\");\n \n } catch(System.SystemExitException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.evosuite.runtime.System\", e);\n }\n }", "@Test\n void should_prin_the_error_message() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n ParkingLot parkingLot = new ParkingLot();\n ParkingLotCenter parkingLotCenter = new ParkingLotCenter(Arrays.asList(parkingLot));\n ParkingBoy parkingBoy = new ParkingBoy(parkingLotCenter);\n ServiceManager serviceManager = new ServiceManager(parkingLotCenter);\n serviceManager.addParkingBoy(parkingBoy);\n serviceManager.orderToFetch(parkingBoy, null);\n assertEquals(\n \"Please provide your parking ticket.\"+System.getProperty(\"line.separator\"),\n outContent.toString());\n }", "@Test(timeout = 4000)\n public void test150() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n // Undeclared exception!\n try { \n errorPage0.message(\"ww#4r9$U1P%3$sh`lK5\");\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.components.StandaloneComponent\", e);\n }\n }", "@Test(timeout = 4000)\n public void test51() throws Throwable {\n // Undeclared exception!\n try { \n EWrapperMsgGenerator.deltaNeutralValidation(0, (UnderComp) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.ib.client.EWrapperMsgGenerator\", e);\n }\n }", "private void fail(String message)\r\n\t{\r\n\t\tSystem.err.println(message);\r\n\t\tSystem.exit(0);\r\n\t}", "@Test(timeout = 4000)\n public void test19() throws Throwable {\n ErrorHandler errorHandler0 = new ErrorHandler(\" :\");\n // Undeclared exception!\n try { \n DBUtil.runScript(\" :\", (Connection) null, false, errorHandler0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "@Override\n \t\t\tpublic void onFailure(Throwable arg0) {\n \t\t\t\tSystem.err.println(\"***failure:\" + arg0);\n \n \t\t\t}", "@Override\n\tpublic void erro() {\n\n\t}", "@Override\n\t\t\tpublic void onFailure(int reason) {\n\t\t\t\t\n\t\t\t}", "protected void ok() {\n }", "@Override\n protected void handleFailure(Throwable arg0) {\n \n }", "@Test(timeout = 4000)\n public void test080() throws Throwable {\n // Undeclared exception!\n try { \n EWrapperMsgGenerator.deltaNeutralValidation(0, (UnderComp) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"com.ib.client.EWrapperMsgGenerator\", e);\n }\n }", "private static void goodBye(String errorMsg)\n\t{\n\t\tSystem.out.println(\"Error: \" + errorMsg);\n\t\tgoodBye();\n\t}", "@Test(timeout = 4000)\n public void test113() throws Throwable {\n ErrorPage errorPage0 = new ErrorPage();\n // Undeclared exception!\n try { \n errorPage0.head();\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.components.StandaloneComponent\", e);\n }\n }", "@Test(timeout = 4000)\n public void test017() throws Throwable {\n ErrorHandler errorHandler0 = new ErrorHandler(\"--22013\");\n // Undeclared exception!\n try { \n DBUtil.runScript((String) null, '&', (Connection) null, true, errorHandler0);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"java.io.StringReader\", e);\n }\n }", "void fail(Object error);", "public boolean testFailing() {\n\treturn false;\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a single entitlement template Permissions Needed: TEMPLATE_ADMIN or ACHIEVEMENTS_ADMIN
public ItemTemplateResource getEntitlementTemplate(String id) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getEntitlementTemplate"); } // create path and map variables String localVarPath = "/entitlements/templates/{id}" .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); // query params List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "oauth2_client_credentials_grant", "oauth2_password_grant" }; GenericType<ItemTemplateResource> localVarReturnType = new GenericType<ItemTemplateResource>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); }
[ "public String GetContextRequiredPermission(String context);", "@Test\n public void testGetAllWithPermissionsForPriviligedUser() {\n List<VmTemplate> result = dao.getAll(PRIVILEGED_USER_ID, true, VmEntityType.TEMPLATE);\n\n assertNotNull(result);\n assertEquals(NUMBER_OF_TEMPLATES_FOR_PRIVELEGED_USER, result.size());\n assertEquals(result.iterator().next(), existingEntity);\n }", "protected List<KimPermissionInfo> findSecurityPermissionsByNameAndTemplate(String permissionName, String templateId) {\n PermissionService permissionService = SpringContext.getBean(PermissionService.class);\n\n // get all the permissions for the given name\n List<KimPermissionInfo> permissions = permissionService.getPermissionsByNameIncludingInactive(SecConstants.ACCESS_SECURITY_NAMESPACE_CODE, permissionName);\n\n List<KimPermissionInfo> templatePermissions = new ArrayList<KimPermissionInfo>();\n for (KimPermissionInfo permissionInfo : permissions) {\n if (StringUtils.equals(templateId, permissionInfo.getTemplateId())) {\n templatePermissions.add(permissionInfo);\n }\n }\n\n return templatePermissions;\n }", "public Permission getAdminPermission();", "yandex.cloud.api.marketplace.licensemanager.v1.TemplateOuterClass.Template getLicenseTemplate();", "@Test\n public void testGetWithPermissionsForPriviligedUser() {\n VmTemplate result = dao.get(FixturesTool.VM_TEMPLATE_RHEL5, PRIVILEGED_USER_ID, true);\n assertGetResult(result);\n }", "public abstract String getRequiredPermission();", "yandex.cloud.api.mdb.sqlserver.v1.PSU.Permission getPermission();", "public int getRequiredPermissionLevel() {\n/* 25 */ return 2;\n/* */ }", "public int getRequiredPermissionLevel() {\n/* 30 */ return 2;\n/* */ }", "app.onepass.apis.Permission getPermissionName();", "public String getVisiblePermission();", "Bank_AdministratorProvides getAdministratorProvides();", "int getOtherPermissions();", "public Integer getEmailTemplateSpecificToBuyer(Integer buyerId,Integer templateId);", "public String securityCheck() {\n\r\n ControllerContext controllerContext = ControllerContext.getInstance();\r\n Map<String, ActivitySecurity> activitySecurityMap = controllerContext.getSecurity().getActivity();\r\n Map<String, ActivitySecurity> permissionSecurityMap = controllerContext.getSecurity().getPermission();\r\n TaskFlowId taskFlowId = TaskFlowId.parse(\"/WEB-INF/dept-task-flow-definition.xml#dept-ask-flow-definition\");\r\n BindingPermission bindingPermission = controllerContext.getSecurity().getBindingPermission(taskFlowId);\r\n if (bindingPermission.hasPermission(\"view\")) {\r\n System.out.println(\"Access Deteced1\");\r\n }\r\n\r\n TaskFlowPermission taskFlowPermission =\r\n controllerContext.getSecurity().getPermission(taskFlowId, TaskFlowPermission.VIEW_ACTION);\r\n if (ADFContext.getCurrent().getSecurityContext().hasPermission(taskFlowPermission)) {\r\n System.out.println(\"Access Deteced2\");\r\n }\r\n RegionPermission perm =\r\n new RegionPermission(\"com.packtpub.adfguide.ch14.view.pageDefs.deptPageDef\", RegionPermission.VIEW_ACTION);\r\n if (ADFContext.getCurrent().getSecurityContext().hasPermission(perm)) {\r\n }\r\n return null;\r\n }", "public int getRequiredPermissionLevel() {\n/* 22 */ return 2;\n/* */ }", "Result getPermission(User user);", "yandex.cloud.api.marketplace.licensemanager.v1.TemplateOuterClass.TemplateOrBuilder getLicenseTemplateOrBuilder();", "SysAdminPermission selectByPrimaryKey(SysAdminPermissionKey key);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used when the statement is an 'if' statement.
R visitStmt(Stmt.If stmt);
[ "ifStmt getIfStatement();", "@Override\n\tpublic void enterIf_statement(BagelParser.If_statementContext ctx) {\n\n\t\tsuper.enterIf_statement(ctx);\n\t}", "private Conditional ifStatement () {\n match(If);\n match(RightParen);\n\n Expression e = expression();\n\n match(LeftParen);\n\n Statement s = statement();\n\n return new Conditional(e,s); // student exercise\n }", "private boolean if_statement() {\r\n\t\tif(inputTokens.firstElement() == TokenNames.If) {\r\n\t\t\tifstm=true;\r\n\t\t\tcurrentToken = inputTokens.remove(0); counter++;Normal_line.add( Scanner.tokenValues.get(counter).getValue().toString( ));\r\n\t\t\tif(inputTokens.firstElement() == TokenNames.left_parenthesis) {\r\n\t\t\t\tcurrentToken = inputTokens.remove(0); counter++;Normal_line.add( Scanner.tokenValues.get(counter).getValue().toString( ));\r\n\t\t\t\tif(condition_expression()) {\r\n\t\t\t\t\tif(inputTokens.firstElement() == TokenNames.right_parenthesis) {\r\n\t\t\t\t\t\tcurrentToken = inputTokens.remove(0); counter++;Normal_line.add( Scanner.tokenValues.get(counter).getValue().toString( ));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//System.out.println(\"Before block statements\");\r\n\t\t\t\t\t\tprintStack();\r\n\t\t\t\t\t\tresolveExp();\r\n\t\t\t\t\t\temptyStack();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tassign=false;\r\n\t\t\t\t\t\tlock_ex=false;\r\n\t\t\t\t\t\tsetLabel();\r\n\t\t\t\t\t\tNormal_line.add(\"\\ngoto \"+label[0]+\";\");\r\n\t\t\t\t\t\tNormal_line.add(\"\\ngoto \"+label[1]+\";\");\r\n\t\t\t\t\t\treturn block_statements();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private void analyseIfStmt() throws CompileError {\n\n expect(TokenType.IF_KW);\n analyseExpr();\n Instruction br1 = addInstruction(Operation.brfalse, 0);\n int offset1 = getInstructionOffset();\n\n analyseBlockStmt();\n Instruction br2 = addInstruction(Operation.br, 0);\n int offset2 = getInstructionOffset();\n br1.setX(offset2 - offset1);\n\n if (nextIf(TokenType.ELSE_KW) != null) {\n if (peek().getTokenType() == TokenType.L_BRACE) {\n analyseBlockStmt();\n } else if (peek().getTokenType() == TokenType.IF_KW) {\n analyseIfStmt();\n } else {\n throw new Error(\"If Statement not completed\");\n }\n }\n int offset3 = getInstructionOffset();\n br2.setX(offset3 - offset2);\n\n }", "@Override\n public Void visitIf(If ifExpression, ElmContext context) {\n return super.visitIf(ifExpression, context);\n }", "@Override\n\tpublic Object visit(IfStatement ifStatement, Object param) {\n\t\treturn null;\n\t}", "private void If(boolean b) {\n\t\t\n\t}", "private IfStatement if_statement(){\n //if(lookahead.getToken() == Tokenizer.RSVP_IF_N.getKey()){\n \t\n //prt(\"IF_STATEMENT\",1055);\n //System.out.println(\"<if_statement> -> if <boolean_expression> <statement_list> <else_statement> end\\n\");\n\n nextToken();\n BooleanExpression be = boolean_expression();\n IfStatement if_state = new IfStatement(be);\n\n //nextToken(); //new line\n //then();\n StatementList if_list = new StatementList();\n statement_list(if_list);\n \n else_statement();\n StatementList else_list = new StatementList();\n statement_list(else_list);\n endif(); \n \n if(be.evaluate()) {\n \tif_state.setStatementList(if_list);\n }\n else {\n \tif_state.setStatementList(else_list);\n }\n \n return if_state;\n// \n// }else{\n// line_exception();\n// }\n }", "@Override\r\n\tpublic Node visitIf(DecafParser.IfContext ctx){\r\n\t\t//System.out.println(\"visits if\");\r\n\t\t//System.out.println(ctx.expr().getText());\r\n\r\n\t\tNode ex = MyExp(ctx.expr());\r\n\r\n\t\t//ex.print(\"dudeee: \");\r\n\r\n\t\tTerminalNode iff = ctx.IF();\r\n\t\tNode ifNode = null;\r\n\t\tNode bl;\r\n\r\n\t\tTerminalNode els = ctx.ELSE();\r\n\t\tList<DecafParser.BlockContext> bloc = ctx.block();\r\n\r\n\t\tif((els != null) && (bloc.size() == 2)){\r\n\t\t\tSystem.out.println(\"works with else\");\r\n\t\t}else if((els == null) && (bloc.size() == 1)){\r\n\t\t\t//System.out.println(\"doesnt work with else\");\r\n\t\t\tbl = visitBlock1((DecafParser.Block1Context)bloc.get(0));\r\n\t\t\tifNode = new Statement(ex,bl);\r\n\t\t}\r\n\r\n\t\treturn ifNode; \r\n\t}", "private Stmt parseIfStmt() throws SyntaxError {\n Stmt ifStmt = null;\n SourcePosition position = newAndStart();\n\n accept();\n match(Token.LPAREN);\n Expr expr = parseExpr();\n match(Token.RPAREN);\n Stmt ifStmtStmt = parseStmt();\n if (Token.ELSE == currentToken.kind) {\n accept();\n Stmt elseStmt = parseStmt();\n ifStmt = new IfStmt(expr, ifStmtStmt, elseStmt, position);\n } else {\n ifStmt = new IfStmt(expr, ifStmtStmt, position);\n }\n\n finish(position);\n return ifStmt;\n }", "private static void If(boolean b) {\n\t\t\n\t}", "private Conditional ifStatement (Variable functName) {\n\t\tmatch(TokenType.If);\n\t\tmatch(TokenType.LeftParen);\n\t\tExpression test = expression();\n\t\tmatch(TokenType.RightParen);\n\t\tStatement thenbranch = statement(functName);\n\t\tif(token.type().equals(TokenType.Else)){\n\t\t\tmatch(TokenType.Else);\n\t\t\tStatement elsebranch = statement(functName);\n\t\t\treturn new Conditional(test, thenbranch, elsebranch);\n\t\t}\n\t\telse{\n\t\t\treturn new Conditional(test, thenbranch);\n\t\t}\n //return null; // student exercise\n }", "@Override\n\tpublic TypeDenoter visitIfStmt(IfStmt stmt, Object arg) {\n\t\tTypeDenoter conditionType;\n if (stmt.cond != null) {\n \tconditionType = stmt.cond.visit(this, arg);\n if (conditionType.typeKind != TypeKind.BOOLEAN) {\n reporter.reportError(\"\" + stmt.cond.posn.toString() + \"Type Checking Error: Condition is not of Boolean type\");\n }\n }\n \n stmt.thenStmt.visit(this, null);\n if(stmt.elseStmt != null) {\n \tstmt.elseStmt.visit(this, null);\n }\n\t\treturn null;\n\t}", "void if_else_foo(){\n if(true){}\n else{}\n }", "private boolean exitingIfStatement(Node node) {\n if (node instanceof IFNode) {\n return true;\n }\n return false;\n }", "void visitPyIfStatement(PsiElement node){\r\n boolean elifPart = false;\r\n for (PsiElement part : node.getChildren()) {\r\n if (part instanceof PyIfPartIfImpl) {\r\n visitPyIfPartIf(part);\r\n }\r\n else if (part instanceof PyIfPartElifImpl){\r\n elifPart = true;\r\n this.addTerminal(new TokenNode(\"else\"));\r\n this.addTerminal(new TokenNode(this.INDENT));\r\n visitPyIfPartIf(part);\r\n }\r\n else if (part instanceof PyElsePartImpl){\r\n this.addTerminal(new TokenNode(\"else\"));\r\n for (PsiElement child: part.getChildren()){\r\n visit(child);\r\n }\r\n }\r\n }\r\n if (elifPart) this.addTerminal(new TokenNode(this.DEDENT));\r\n }", "The else if Statement\n\nif (condition1) {\n}", "private ASTNODE ifStatement() {\n ASTNODE ifStatementAstNode = new ASTNODE();\n ifStatementAstNode.setAstNodeType(ASTNODE_TYPE.IfStatement);\n ifStatementAstNode.setValue(\"IfStatement\");\n\n // IfExpressionBlock\n {\n ASTNODE ifExpressionBlock = new ASTNODE();\n ifExpressionBlock.setAstNodeType(ASTNODE_TYPE.IfExpressionBlock);\n ifExpressionBlock.setValue(\"IfExpressionBlock\");\n\n curTok = lexer.getNextToken(); // eat RW_If\n if(TOKEN_TYPE.LParen != curTok.getToken_type()) { //check the LParen\n logger.error(\"IfExpressionBlock Expect the \\\"(\\\" , the type = \" + TOKEN_TYPE.LParen.toString());\n logger.error(\"\\tget the type = \" + curTok.getToken_type());\n System.exit(0);\n }\n curTok = lexer.getNextToken(); // eat LParen\n\n ASTNODE expressionAstNode = expression();\n ifExpressionBlock.insertChildrenNode(expressionAstNode);\n\n if(TOKEN_TYPE.RParen != curTok.getToken_type()) { //check the RParen\n logger.error(\"IfExpressionBlock Expect the \\\")\\\" , the type = \" + TOKEN_TYPE.RParen.toString());\n logger.error(\"\\tget the type = \" + curTok.getToken_type());\n System.exit(0);\n }\n curTok = lexer.getNextToken(); // eat RParen\n\n if(TOKEN_TYPE.LBrace != curTok.getToken_type()) { //block statement, check the LBrace\n logger.error(\"IfExpressionBlock Expect block, the first token type = \" + TOKEN_TYPE.LBrace.toString());\n logger.error(\"\\tget the type = \" + curTok.getToken_type());\n System.exit(0);\n }\n\n ASTNODE blockAstNode = block();\n ifExpressionBlock.insertChildrenNode(blockAstNode);\n\n ifStatementAstNode.insertChildrenNode(ifExpressionBlock);\n }\n\n //ElifExpressionBlock\n {\n while(TOKEN_TYPE.RW_Elif == curTok.getToken_type()) {\n ASTNODE elifExpressionBlock = new ASTNODE();\n elifExpressionBlock.setAstNodeType(ASTNODE_TYPE.ElifExpressionBlock);\n elifExpressionBlock.setValue(\"ElifExpressionBlock\");\n\n curTok = lexer.getNextToken(); // eat RW_Elif\n if(TOKEN_TYPE.LParen != curTok.getToken_type()) { //check the LParen\n logger.error(\"ElifExpressionBlock Expect the \\\"(\\\" , the type = \" + TOKEN_TYPE.LParen.toString());\n logger.error(\"\\tget the type = \" + curTok.getToken_type());\n System.exit(0);\n }\n curTok = lexer.getNextToken(); // eat LParen\n\n ASTNODE expressionAstNode = expression();\n elifExpressionBlock.insertChildrenNode(expressionAstNode);\n if(TOKEN_TYPE.RParen != curTok.getToken_type()) { //check the RParen\n logger.error(\"ElifExpressionBlock Expect the \\\")\\\" , the type = \" + TOKEN_TYPE.RParen.toString());\n logger.error(\"\\tget the type = \" + curTok.getToken_type());\n System.exit(0);\n }\n curTok = lexer.getNextToken(); // eat RParen\n\n if(TOKEN_TYPE.LBrace != curTok.getToken_type()) { //block statement, check the LBrace\n logger.error(\" ElifExpressionBlock Expect block, the first token type = \" + TOKEN_TYPE.LBrace.toString());\n logger.error(\"\\tget the type = \" + curTok.getToken_type());\n System.exit(0);\n }\n\n ASTNODE blockAstNode = block();\n elifExpressionBlock.insertChildrenNode(blockAstNode);\n\n ifStatementAstNode.insertChildrenNode(elifExpressionBlock);\n }\n }\n\n {\n if(TOKEN_TYPE.RW_Else == curTok.getToken_type()) {\n ASTNODE elseExpressionBlock = new ASTNODE();\n elseExpressionBlock.setAstNodeType(ASTNODE_TYPE.ElseExpressionBlock);\n elseExpressionBlock.setValue(\"ElseExpressionBlock\");\n\n curTok = lexer.getNextToken(); // eat RW_Else\n if(TOKEN_TYPE.LBrace != curTok.getToken_type()) { //block statement, check the LBrace\n logger.error(\" ElseExpressionBlock Expect block, the first token type = \" + TOKEN_TYPE.LBrace.toString());\n logger.error(\"\\tget the type = \" + curTok.getToken_type());\n System.exit(0);\n }\n\n ASTNODE blockAstNode = block();\n elseExpressionBlock.insertChildrenNode(blockAstNode);\n\n ifStatementAstNode.insertChildrenNode(elseExpressionBlock);\n }\n }\n\n return ifStatementAstNode;\n }", "protected void sequence_if_statement(EObject context, if_statement semanticObject) {\r\n\t\tgenericSequencer.createSequence(context, semanticObject);\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
doesn't need to do anything as of yet simply a static view
public interface AboutView { }
[ "public abstract View mo76895a();", "public abstract View mo24477a();", "private void intiViews() {\n }", "protected abstract ViewType createView();", "public void displayFirstView();", "private void viewApplication() {\n\t\t\r\n\t}", "protected void setupView() {}", "@GetMapping(\"/static\")\n public ModelAndView getStatic(){\n logger.info(\"STATIC\");\n return new ModelAndView(\"tile/static\", \"defaultMessage\", \"auth?\");\n }", "private IndexContentHelper() {}", "public abstract View c();", "public static void index() {\n\n\t\trender();\n\t}", "public abstract View a();", "public abstract View m16742OooO00o();", "protected abstract String getViewFileName();", "@Override\n\tpublic void dView() {\n\n\t}", "@Override\n\tprotected String getView() {\n\t\tSystem.out.println(\"Welcome getview method start\");\n\t\treturn ORSView.WELCOME_VIEW;\n\t}", "@Override\n\t\t\tpublic void atualizarView() {\n\t\t\t\t\n\t\t\t}", "void mo3737a(View view);", "private static String view(String viewPath) {\n return \"views/\" + viewPath;\n }", "@Override\n public String view() {\n super.view();\n OptBaseInfo optBaseInfo = optBaseInfoManager.getObjectById(object\n .getDjId());\n object.setOptBaseInfo(optBaseInfo);\n \n //动态加载意见\n writeIdeaModuleToRequestAttribute(object.getDjId(),false);\n return VIEW;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ access modifiers changed from: private
public /* synthetic */ void lambda$fileDidFailedLoad$6(String str, int i, int i2) { ImageLoader.this.fileDidFailedLoad(str, i); NotificationCenter.getInstance(i2).postNotificationName(NotificationCenter.fileLoadFailed, str, Integer.valueOf(i)); }
[ "@Override\n }", "protected void method_5557() {}", "@Override\n public void extornar() {\n \n }", "@Override\r\n public void publicando() {\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "private InternalReflect() {\n\t\t\t// do nothing\n\t\t}", "public void mo28221a() {\n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "private Propriedades() {\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "protected void mo4791d() {\n }", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "private B000066() {\r\n\r\n\t}", "private Helper() {\r\n\t}", "protected void method_2117() {\n }", "protected abstract void mo3493a();", "@Override\n protected void init()\n {\n\n }", "private O()\r\n {\r\n super();\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method ensures that aliquots that were shipped to the NA Lab are correctly indicated in Acquire.
public void migrateShippedStatus() { /* * Get the specimen labels for all the specimen/aliquots that have been * added to a shipment form. */ CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<String> criteria = cb.createQuery(String.class); Root<NaLabSample> root = criteria.from(NaLabSample.class); criteria.select(root.get(NaLabSample_.sampleId)); List<String> labels = em.createQuery(criteria).getResultList(); /* * Use the labels to get a list of caTissue specimenIds that correspond */ CriteriaBuilder caTissueCb = caTissueEm.getCriteriaBuilder(); CriteriaQuery<Long> specimenCriteria = caTissueCb.createQuery(Long.class); Root<Specimen> specimenRoot = specimenCriteria.from(Specimen.class); specimenCriteria.select(specimenRoot.<Long> get("id")); specimenCriteria.where(specimenRoot.<String> get("label").in(labels)); List<Long> caTissueIds = caTissueEm.createQuery(specimenCriteria).getResultList(); /* * Use the list of specimenIds to get the AliquotAnnotations that * correspond, using the EntityMap to make the connection */ CriteriaQuery<AliquotAnnotation> aliquotCriteria = cb.createQuery(AliquotAnnotation.class); Root<AliquotAnnotation> aliquotRoot = aliquotCriteria.from(AliquotAnnotation.class); Root<EntityMap> mapRoot = aliquotCriteria.from(EntityMap.class); aliquotCriteria.select(aliquotRoot); /* * Start building the Predicate by matching AliquotAnnotation with EntityMap */ Predicate where = cb.equal(mapRoot.get(EntityMap_.id), aliquotRoot.get(AliquotAnnotation_.entityId)); /* * Restrict to the EntityMap instances that represent the specimen in our * list */ Predicate mapWhere = cb.and(cb.equal(mapRoot.get(EntityMap_.entityName), "edu.wustl.catissuecore.domain.Specimen"), cb.equal( mapRoot.get(EntityMap_.caTissue), CaTissueInstance.TCRB), mapRoot .get(EntityMap_.entityId).in(caTissueIds)); /* * Add the combined restriction to the criteria */ aliquotCriteria.where(where, mapWhere); /* * Get the results */ List<AliquotAnnotation> aliquots = em.createQuery(aliquotCriteria).getResultList(); /* * Update the aliquots to mark them as shipped to NA Lab */ for (AliquotAnnotation annotation : aliquots) { annotation.getStatus().add(SpecimenStatus.SHIPPED_NA_LAB); } this.messages.info("Shipped to NA Lab migrated to aliquots"); }
[ "private void checkRep() {\n Set<BookCopy> intersection = new HashSet<>(inLibrary);\n intersection.retainAll(checkedOut);\n assert(intersection.isEmpty());\n }", "@Test\n public void requirementWithApplicabilityRangeIsNotInitializedAgainstNonApplicableInventory()\n throws Exception {\n\n final PartNoKey lAircraftPart = Domain.createPart();\n\n final AssemblyKey lAircraftAssembly =\n Domain.createAircraftAssembly( new DomainConfiguration<AircraftAssembly>() {\n\n @Override\n public void configure( AircraftAssembly aAircraftAssembly ) {\n aAircraftAssembly\n .setRootConfigurationSlot( new DomainConfiguration<ConfigurationSlot>() {\n\n @Override\n public void configure( ConfigurationSlot aConfigurationSlot ) {\n aConfigurationSlot\n .addPartGroup( new DomainConfiguration<PartGroup>() {\n\n @Override\n public void configure( PartGroup aPartGroup ) {\n aPartGroup.setInventoryClass( RefInvClassKey.ACFT );\n aPartGroup.addPart( lAircraftPart );\n }\n } );\n }\n } );\n }\n } );\n\n final InventoryKey lAircraft = Domain.createAircraft( new DomainConfiguration<Aircraft>() {\n\n @Override\n public void configure( Aircraft aAircraft ) {\n aAircraft.setAssembly( lAircraftAssembly );\n aAircraft.allowSynchronization();\n aAircraft.setPart( lAircraftPart );\n aAircraft.setApplicabilityCode( ACFT_APPLICABILITY_CODE_OUTSIDE_RANGE );\n }\n } );\n\n final ConfigSlotKey lAircraftRootConfigSlot = new ConfigSlotKey( lAircraftAssembly, 0 );\n\n // Given an activated one-time requirement definition.\n final TaskTaskKey lReqDefnKey =\n Domain.createRequirementDefinition( new DomainConfiguration<RequirementDefinition>() {\n\n @Override\n public void configure( RequirementDefinition aReqDefn ) {\n aReqDefn.againstConfigurationSlot( lAircraftRootConfigSlot );\n aReqDefn.setStatus( REVISION );\n aReqDefn.setApplicabilityRange( TASK_DEFN_APPLICABILITY_RANGE );\n }\n } );\n\n // When the requirement is activated.\n new TaskDefnService().activate( lReqDefnKey, new TaskDefnRevTO(), HR, true );\n\n // Emulate baseline sync processing of the inv_sync_queue rows\n // ( added by TaskDefnBean.activate() ).\n InventorySynchronizer lInvSynchronizer = new InventorySynchronizer();\n lInvSynchronizer.processInventory( lInvSynchronizer.getInventory() );\n\n List<TaskKey> lTasks =\n TaskDefnUtils.getActualTasks( lReqDefnKey, lAircraft, RefEventStatusKey.ACTV );\n\n Assert.assertTrue(\n \"Requirement was initialized on the inventory although the applicability code did not match\",\n lTasks.isEmpty() );\n }", "private void checkRep() {\n\t\tassert entries != null;\n\t\tassert locationString != null;\n\t\tassert table1 != null;\n\t\tassert table2 != null;\n\t}", "public boolean sunkCaptainsQuarters() {\n\t\tif (this.armor.getArmor() > 0) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "final boolean nonfairTryAcquire(int acquires) {\n // mask out readlocks if called from condition methods\n acquires = exclusiveCount(acquires);\n Thread current = Thread.currentThread();\n int c = getState();\n int w = exclusiveCount(c);\n if (w + acquires >= SHARED_UNIT)\n throw new Error(\"Maximum lock count exceeded\");\n if (c != 0 && (w == 0 || current != owner))\n return false;\n if (!compareAndSetState(c, c + acquires)) \n return false;\n owner = current;\n return true;\n }", "private void validazioneAggiornamentoNuovaQuota() {\n\t\tvalidazioneNuovaQuota(true);\n\t\tcheckCoerenzaTotaliQuoteAggiornamento();\n\t}", "public void verifyNoMatching(AcInternationalPostalCustomerInvoiceCn66MarketLine e)\n {\n }", "private static void calculateMissingIVs() {\n\t\t\n\t\t//Iterate torught issues\n\t\tfor (Entry<String, Issue> entry : issuesMap.entrySet()) {\n\t\t String key = entry.getKey();\n\t\t Issue value = entry.getValue();\n\t\t //Find issues with no IV\n\t\t if (value.getIntroVersion() == Issue.INTRO_DEF && value.getFixVersion() != Issue.FIX_DEF) {\n\t\t \t//Calculate with proportion\n\t\t \tint newIntroVers = Math.round(value.getFixVersion() - (value.getFixVersion() - value.getOpenVersion())*averages[value.getFixVersion()-1]);\n\t\t \t\n\t\t \t//Special cases\n\t\t \tif (newIntroVers <= 0)\n\t\t \t\tnewIntroVers = 1;\n\t\t \tif (newIntroVers > value.getOpenVersion())\n\t\t \t\tnewIntroVers = value.getOpenVersion();\n\t\t \t\n\t\t \t//Update map\n\t\t \tvalue.setIntroVersion(newIntroVers);\n\t\t \tissuesMap.put(key, value);\n\t\t }\n\t\t}\n\t\n\t}", "public void testACFTUSAGE_MANUFACT_NULL_VALIDATION() {\n\n System.out.println( \"=======Starting: \" + testName.getMethodName()\n + \" Validation========================\" );\n\n // AL_HISTORICAL_USAGE\n Map<String, String> lUsage = new LinkedHashMap<>();\n\n lUsage.put( \"SERIAL_NO_OEM\", \"\\'\" + iSN_ACFT + \"\\'\" );\n lUsage.put( \"PART_NO_OEM\", \"\\'\" + iPN_ACFT + \"\\'\" );\n // lUsage.put( \"MANUFACT_CD\", \"\\'\" + iMANUAL_ACFT + \"\\'\" );\n lUsage.put( \"DATA_TYPE_CD\", \"\\'\" + iDATA_TYPE_CD_1 + \"\\'\" );\n lUsage.put( \"USAGE_QT\", \"\\'\" + iUSAGE_QT_1 + \"\\'\" );\n lUsage.put( \"USAGE_DELTA_QT\", \"\\'\" + iUSAGE_DELTA_QT_1 + \"\\'\" );\n lUsage.put( \"USAGE_DESC\", \"\\'\" + iUSAGE_DESC_1 + \"\\'\" );\n\n // insert map\n runInsert( TableUtil.getInsertForTableByMap( TableUtil.AL_HISTORICAL_USAGE, lUsage ) );\n\n lUsage.clear();\n lUsage.put( \"SERIAL_NO_OEM\", \"\\'\" + iSN_ACFT + \"\\'\" );\n lUsage.put( \"PART_NO_OEM\", \"\\'\" + iPN_ACFT + \"\\'\" );\n // lUsage.put( \"MANUFACT_CD\", \"\\'\" + iMANUAL_ACFT + \"\\'\" );\n lUsage.put( \"DATA_TYPE_CD\", \"\\'\" + iDATA_TYPE_CD_1 + \"\\'\" );\n lUsage.put( \"USAGE_QT\", \"\\'\" + iUSAGE_QT_2 + \"\\'\" );\n lUsage.put( \"USAGE_DELTA_QT\", \"\\'\" + iUSAGE_DELTA_QT_2 + \"\\'\" );\n lUsage.put( \"USAGE_DESC\", \"\\'\" + iUSAGE_DESC_2 + \"\\'\" );\n\n runInsert( TableUtil.getInsertForTableByMap( TableUtil.AL_HISTORICAL_USAGE, lUsage ) );\n\n setCollectionDate( \"01/02/2017\", iUSAGE_DESC_1 );\n setCollectionDate( \"01/03/2016\", iUSAGE_DESC_2 );\n\n // run validation\n Assert.assertTrue( runValidationAndImport( true ) == 1 );\n\n }", "public static void checkAllDurability()\n {\n if(text.inventory.get(0).isBroken())\n {\n text.inventory.set(0, new Item(1, 1, 0, 100, \"Fist\", \"Common\"));\n }\n if(text.inventory.get(1).isBroken())\n {\n text.inventory.set(1, new Item(1, 1, 0, 100, \"Fist\", \"Common\"));\n }\n if(text.inventory.get(2).isBroken())\n {\n text.inventory.set(2, new Item(1, 1, 0, 100, \"Fist\", \"Common\"));\n }\n if(text.inventory.get(3).isBroken())\n {\n text.inventory.set(3, new Item(1, 1, 0, 100, \"Fist\", \"Common\"));\n }\n if(text.inventory.get(4).isBroken())\n {\n text.inventory.set(4, new Item(1, 1, 0, 100, \"Fist\", \"Common\"));\n }\n if(text.inventory.get(5).isBroken())\n {\n text.inventory.set(5, new Item(1, 1, 0, 100, \"Fist\", \"Common\"));\n }\n }", "private void qualityOfAnItemIsNeverNegative() {\n if (item.quality < 0) {\n item.quality = 0;\n }\n }", "public void verifyNoMatching(AcGlobalImpc e)\n {\n }", "private void checkRep() {\n if (DEBUG) {\n for (Point parent : campusGraph.listNodes()) {\n assert (parent != null) : \"Null node\";\n for (Point child : campusGraph.listChildren(parent)) {\n List<Double> labels = campusGraph.getLabels(parent, child);\n for (Double dist : labels) {\n assert (dist >= 0) : \"Distance is negative\";\n }\n }\n }\n for (String shortName : shortToBuilding.keySet()) {\n assert (shortName != null) : \"Null short name\";\n CampusBuilding shortBuilding = shortToBuilding.get(shortName);\n assert (shortBuilding != null) : \"Null building associated with short name\";\n assert (shortName.equals(shortBuilding.getShortName())) :\n \"Names do not match in shortToBuilding\";\n }\n }\n\n }", "@Test\n void checkResourcesForAcquisitionTest() {\n costTest.add(costCard1);\n costTest.add(costCard2);\n assertFalse(gamer.CheckResourcesForAcquisition(costTest));\n costTest.add(costCard1);\n costTest.add(costCard2);\n gamer.getWarehouse().addToRow(Yellow,1);\n gamer.getWarehouse().addToRow(Yellow,1);\n gamer.getWarehouse().addToRow(Blue,2);\n gamer.getWarehouse().addToRow(Blue,2);\n assertTrue(gamer.CheckResourcesForAcquisition(costTest));\n costTest.add(costCard3);\n assertFalse(gamer.CheckResourcesForAcquisition(costTest));\n }", "public void hasSaneValues() {\n\t\tif (aifirm == null || aiorg == null || aipwd == null || aipath == null || aiapi == null || aiuser == null || aiupwd == null || aihost == null || aiauur == null) {\n\t\t\tthrow new RuntimeException(\"Some, or all columns are null in FIRMALT!, record=\"+ReflectionToStringBuilder.toString(this));\n\t\t}\n\t\t\n\t}", "public void setAliquota(String aliquota) {\n this.aliquota = aliquota;\n }", "public void mustBeAlloced(int index) {\n if (isFree(index)) {\n throw new IllegalArgumentException(\"not alloced: \" + index);\n }\n }", "final boolean nonfairTryAcquire(int acquires) {\n final Thread current = Thread.currentThread();\n int c = getState();\n if (c == 0) {\n if (compareAndSetState(0, acquires)) {\n setExclusiveOwnerThread(current);\n return true;\n }\n }\n else if (current == getExclusiveOwnerThread()) {\n int nextc = c + acquires;\n if (nextc < 0) // overflow\n throw new Error(\"Maximum lock count exceeded\");\n setState(nextc);\n return true;\n }\n return false;\n }", "@Test\n\tpublic void lockingWhenNoAvailableSpaceTest(){\n\t\tSystem.out.println(\"locking when no available space test\");\n\t\tLot parkingLot = new Lot(0);\n\t\tEntry entry = new Entry(\"test\", parkingLot);\n\t\tArrayList<Entry> entries = new ArrayList<Entry>();\n\t\tentries.add(entry);\n\t\tparkingLot.setEntries(entries);\n\t\t\n\t\tparkingLot.checkForAvailableSpace();\n\t\tassertTrue(entry.isLocked());\n\t}", "@Test\n public void tasksAreNotInitializedOnInventoryNonApplicableToTheRule() throws Exception {\n\n final PartNoKey lAircraftPart = Domain.createPart();\n\n final AssemblyKey lAircraftAssembly =\n Domain.createAircraftAssembly( new DomainConfiguration<AircraftAssembly>() {\n\n @Override\n public void configure( AircraftAssembly aAircraftAssembly ) {\n aAircraftAssembly\n .setRootConfigurationSlot( new DomainConfiguration<ConfigurationSlot>() {\n\n @Override\n public void configure( ConfigurationSlot aConfigurationSlot ) {\n aConfigurationSlot\n .addPartGroup( new DomainConfiguration<PartGroup>() {\n\n @Override\n public void configure( PartGroup aPartGroup ) {\n aPartGroup.setInventoryClass( RefInvClassKey.ACFT );\n aPartGroup.addPart( lAircraftPart );\n }\n } );\n }\n } );\n }\n } );\n\n final InventoryKey lAircraft = Domain.createAircraft( new DomainConfiguration<Aircraft>() {\n\n @Override\n public void configure( Aircraft aAircraft ) {\n aAircraft.setAssembly( lAircraftAssembly );\n aAircraft.allowSynchronization();\n aAircraft.setPart( lAircraftPart );\n aAircraft.setSerialNumber( AIRCRAFT_SERIAL_NUMBER_THAT_DOES_NOT_MATCH_RULE );\n }\n } );\n\n final ConfigSlotKey lAircraftRootConfigSlot = new ConfigSlotKey( lAircraftAssembly, 0 );\n\n // Given an activated one-time requirement definition.\n final TaskTaskKey lReqDefnKey =\n Domain.createRequirementDefinition( new DomainConfiguration<RequirementDefinition>() {\n\n @Override\n public void configure( RequirementDefinition aReqDefn ) {\n aReqDefn.againstConfigurationSlot( lAircraftRootConfigSlot );\n aReqDefn.setStatus( REVISION );\n aReqDefn.setApplicabilityRule( TASK_DEFN_APPLICABILITY_RULE );\n }\n } );\n\n // When the requirement is activated.\n new TaskDefnService().activate( lReqDefnKey, new TaskDefnRevTO(), HR, true );\n\n // Emulate baseline sync processing of the inv_sync_queue rows\n // ( added by TaskDefnBean.activate() ).\n InventorySynchronizer lInvSynchronizer = new InventorySynchronizer();\n lInvSynchronizer.processInventory( lInvSynchronizer.getInventory() );\n\n List<TaskKey> lTasks =\n TaskDefnUtils.getActualTasks( lReqDefnKey, lAircraft, RefEventStatusKey.ACTV );\n\n Assert.assertTrue(\n \"Requirement was initialized on the inventory although the applicability code did not match\",\n lTasks.isEmpty() );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
lets us neatly enter a map from the overworld in a location that makes sense without storing data
public abstract void enterFromOverworld();
[ "public void setMapLocation(Point mapLocation);", "@Override\n\tpublic void enterMap() {\n\n\t}", "public void showInMap(){\n Utils.handleGeoCoordinates(this,\n new fr.free.nrw.commons.location.LatLng(cameraPosition.target.getLatitude(),\n cameraPosition.target.getLongitude(), 0.0f));\n }", "public void viewMap() {\n //display the Map\n Game game = new Game();\n Map theMap = new Map();\n Location loc = new Location();\n \n System.out.println(\"***Your Map***\");\n \n int matrix[][] = new int[5][5];\n \n for(int i = 0; i < matrix.length; i++)\n {\n for(int j = 0; j < matrix.length; j++)\n {\n matrix[i][j] = 5;\n }\n }\n \n for(int i = 0; i < matrix.length; i++)\n {\n for(int j = 0; j < matrix.length; j++)\n {\n System.out.print (matrix[i][j] + \"\");\n }\n System.out.println();\n }\n \n System.out.println(\"Key \\n\"\n + \"~~~ = river \\n\"\n + \"!!! = farmland \\n\"\n + \"___ = desert \\n\"\n + \"<><> = village \\n\");\n }", "void openMap(double lat, double lng, String namePlace,double userLat, double userLlng);", "private void updateLocalMap() {\n\t\tBag toUpdate = currentViewToLocalMapPos();\n\t\tfor (int i=0; i<toUpdate.size(); ++i) {\n\t\t\tInt2D localCoord = (Int2D)toUpdate.get(i);\n\t\t\tif (localMapGrid.getObjectsAtLocation(localCoord.x,localCoord.y) == null || ((Value)localMapGrid.getObjectsAtLocation(localCoord.x,localCoord.y).get(0)).get().equals(Terrain.POI)) { // check only if null or poi (could be vpoi now)\n\t\t\t\tboolean poi = containsPOI(localMapPosToPos(localCoord));\n\t\t\t\t//System.out.printf(\"%s POI at local position %d,%d.\\n\",(poi?\"There is a\":\"No\"),localCoord.x,localCoord.y);\n\t\t\t\t// A \"Value\"-object is needed because an Integer would be \"moved\" to the new coords but we need separate objects for each position\n\t\t\t\tif (poi) {\n\t\t\t\t\tif (localMapGrid.getObjectsAtLocation(localCoord.x,localCoord.y) == null) {\n\t\t\t\t\t\tboolean ok = localMapGrid.setObjectLocation(new Value(Terrain.POI), localCoord);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.printf(\"Detected POI within localMapCoord %d,%d. %s\\n\",localCoord.x,localCoord.y, ok);\n\t\t\t\t\t//Bag b = localMapGrid.getObjectsAtLocation(localCoord.x,localCoord.y);\n\t\t\t\t\t//System.out.printf(\"\\t--> %s\\n\",(b!=null?((Value)b.get(0)):\"NULL\"));\n\t\t\t\t} else {\n\t\t\t\t\tif (localMapGrid.getObjectsAtLocation(localCoord.x,localCoord.y) == null) {\n\t\t\t\t\t\tboolean ok = localMapGrid.setObjectLocation(new Value(Terrain.WAY), localCoord);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.printf(\"Nothing interesting at %d,%d. %s\\n\",localCoord.x,localCoord.y, ok);\n\t\t\t\t\t//Bag b = localMapGrid.getObjectsAtLocation(localCoord.x,localCoord.y);\n\t\t\t\t\t//System.out.printf(\"\\t--> %s\\n\",(b!=null?((Value)b.get(0)):\"NULL\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Int2D curPos = posToLocalMapPos(super.pos);\n\t\t//Bag curElem = localMapGrid.getObjectsAtLocation(curPos.x, curPos.y);\n\t\t//if (curElem == null) {\n\t\t//}\n\t}", "private void editMap() {\n //mapName = mapName.substring(0, mapName.length() - 4);\n mapObj = new Maps(mapName, 1);\n if (!mapObj.readMap().equals(\"true\")) {\n System.out.println(\"Input Map Not correct. Opening to edit for correct\");\n }\n System.out.println(\"Map Opened\");\n }", "private void doMap() {\n \t\tGoogleAnalyticsTracker.getInstance().trackEvent(AnalyticsUtils.EventCategories.TWUNCH_DETAILS,\n \t\t\t\tAnalyticsUtils.EventActions.SHOW_MAP, null, 1);\n \t\tfinal Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(\"http://maps.google.com/maps?q=\"\n \t\t\t\t+ mCursor.getDouble(TwunchDetailsQuery.LATITUDE) + \",\" + mCursor.getDouble(TwunchDetailsQuery.LONGITUDE)));\n \t\tstartActivity(myIntent);\n \t}", "private OceanMap() {\r\n\t\t this.dimensions = 40;\r\n\t\t this.islandCount = dimensions*4;\r\n\t\t createGrid();\r\n\t\t addBorder();\r\n\t\t placeIslands();\r\n\t }", "public OverworldState() {\n\n\t\ttry {\n\t\t\tmovMap.loadMap(\"ShrekHouse\");\n\t\t\tMapRetrevial.retiveLinks(links, \"ShrekHouse\");\n\t\t\t//MapRetrevial.readNPC(\"ShrekHouse\");\n\t\t\tMapRetrevial.readEncounter(\"World1\");\n\t\t\tmap = ImageIO.read(getClass().getResource(\"/map.png\"));\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//movMap.printMap();\n\t}", "private void updateMap() {\n\t\tContext context = ContextUtils.getContext(this);\n\t\tGrid grid = (Grid)context.getProjection(\"Grid\");\n\t\tGridPoint pt = grid.getLocation(this);\n\t\t\n\t\tfor(int i = 0; i < gridSize; i++) {\n\t\t\tfor(int j = 0; j < gridSize; j++) {\n\t\t\t\t// If considering locations in the local area or\n\t\t\t\t// if that location is a fixed one\n\t\t\t\tif ((Math.abs(i - pt.getX()) <= (edgeOfComm / 2) \n\t\t\t\t\t\t&& Math.abs(j - pt.getY()) <= (edgeOfComm / 2))\n\t\t\t\t\t\t|| ownMap[i][j] == 1 || ownMap[i][j] == 3) {\n\t\t\t\t\tmap[i][j] = ownMap[i][j];\n\t\t\t\t}\n\t\t\t\telse if (ownMap[i][j] == 2) {\n\t\t\t\t\tmap[i][j] = map[i][j] == 3 ? 3 : 2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void assignPokemonToLocations(Map map, Pokemon[] pokemon) {\n \n Location[][] locations = map.getMapLocations();\n \n// locations[0][0]. \n locations[0][1].setPokemon(pokemon[5]);\n// locations[0][2].\n// locations[0][3].\n// locations[0][4].\n// locations[1][0].\n// locations[1][1].\n locations[1][2].setPokemon(pokemon[4]);\n// locations[1][3].\n// locations[1][4].\n// locations[2][0].\n locations[2][1].setPokemon(pokemon[2]);\n// locations[2][2].\n// locations[2][3].\n// locations[2][4].\n// locations[3][0].\n// locations[3][1].\n locations[3][2].setPokemon(pokemon[1]);\n// locations[3][3].\n// locations[3][4].\n// locations[4][0].\n// locations[4][1].\n// locations[4][2].\n// locations[4][3].\n locations[4][4].setPokemon(pokemon[0]); \n }", "public void moveToNewLocation() {\n \n \n Player thePlayer = theGame.getPlayer(); \n int x;\n int y;\n System.out.println(\"Enter the coordinates of the location you want to move to\\n \"\n + \"Enter the x-coordinate:\\n \");\n x = keyboard.nextInt();\n \n System.out.println(\"Enter the y-coordinate:\\n \");\n y = keyboard.nextInt();\n \n \n //Setting new coordinates in the Player object.\n thePlayer.setRow(x);\n \n thePlayer.setColumn(y);\n \n //Bringing the player to the game\n theGame.setPlayer(thePlayer);\n System.out.println(\"something 1 \");\n \n //Updating the game with the new position of the player.\n CityOfAaron.setGame(theGame);\n System.out.println(\"Something 2\");\n \n //getting the map from th game \n Map theMap = theGame.getMap();\n System.out.println(\"Something 3\");\n \n //getting theLocation from theMap\n Location theLocation = theMap.getLocation(x, y);\n \n System.out.println(\"Something 4\");\n \n //gettind theDescription of the location.\n String theDescription = theLocation.getDescription();\n System.out.println(\"Something 5\");\n \n //theGame.getMap().getLocation(x, y).getDescription()\n \n //Display the description \n System.out.println(theDescription);\n \n }", "public static LocatedMapBundle getMapFromOpenStreetMap(Location thisloc) throws MalformedURLException,IOException {\r\n\t\t\r\n\t\tint xtile = (int)Math.floor( (thisloc.getLongitude() + 180) / 360 * (1<<16) ) ;\r\n\t\tint ytile = (int)Math.floor( (1 - Math.log(Math.tan(Math.toRadians(thisloc.getLatitude())) + 1 / Math.cos(Math.toRadians(thisloc.getLatitude()))) / Math.PI) / 2 * (1<<16) ) ;\r\n\r\n\t\t\r\n\t\t// The tiles should be cached!\t\t\r\n\t\tfinal URL aURL = new URL(\"http://tile.openstreetmap.org/16/\"+xtile+\"/\"+ytile+\".png\");\r\n\t\t\r\n\t\t\t \r\n\t try {\r\n\r\n\t \t \r\n\t \t \r\n\t final URLConnection conn = aURL.openConnection();\r\n\r\n\t conn.connect();\r\n\r\n\t final BufferedInputStream bis = new BufferedInputStream(conn.getInputStream());\r\n\r\n\t final Bitmap centerMapTile = BitmapFactory.decodeStream(bis);\r\n\t //because of the fixed-grid arrangement of tiles, we have to also work out the displacement of the tile from the current location;\r\n\t mapBordersBoundingBox currentmapBB = tile2boundingBox(xtile,ytile,16);\r\n\t \t \r\n\t \t \r\n\t \t \r\n\t \t //now we work out the displacement of this from the real location\r\n\t \t \r\n\t \t /*\r\n\t \t \r\n\t \t double disX = ARBlipUtilitys.getRelativeZLocation(currentmapBB.east, thisloc);\r\n\t \t double disY = ARBlipUtilitys.getRelativeXLocation(currentmapBB.north, thisloc);\r\n\t \t \r\n\t \t //returned distances are relative to the west north side of the map, and thus need to be changed to be center-relative\r\n\t \t \r\n\t \t int MapSize = 378;\t \t \r\n\t \t disX = (MapSize/2)-disX;\r\n\t \t disY = (MapSize/2)-disY;\r\n\t \t \r\n\t \t Log.i(\"dis\",\"loc:\"+aURL.getPath());\t \t \r\n\t \t \r\n\t \t Log.i(\"dis\",currentmapBB.east+\",\"+thisloc.getLongitude()+\"X= \"+disX);\r\n\t \t \r\n\t \t Log.i(\"dis\",currentmapBB.north+\",\"+thisloc.getLatitude()+\"Y= \"+disY);\r\n\t\t \t \r\n\t \t //work out quadrant the user is in relative to the tile\r\n\t \t if (disX>(MapSize/2))\t \t \t \r\n\t \t { \r\n\t \t \t Log.i(\"dis\",\"east\");\r\n\t \t \t \r\n\t \t \t //east\r\n\t \t \t if (disY>(MapSize/2))\r\n\t\t \t {\r\n\t \t \t\t //north east\r\n\t \t \t\t Log.i(\"dis\",\"north east\");\r\n\t \t \t\t \r\n\t\t \t } else {\r\n\t\t \t \t //north west *\r\n\t\t \t \t Log.i(\"dis\",\"north west\");\r\n\t \t \t\t \r\n\t\t \t }\r\n\t \t \t \t \t \t \r\n\t \t } else \r\n\t \t {\r\n\t \t \t Log.i(\"dis\",\"west\");\r\n\t \t \t //west\r\n\t \t \t if (disY>(MapSize/2))\t\t \t {\r\n\t \t \t\t //north west\r\n\t \t \t\t Log.i(\"dis\",\"south east\");\r\n\t \t \t\t \r\n\t\t \t } else {\r\n\t\t \t \t //south east *\r\n\t\t \t \t Log.i(\"dis\",\"south west\");\r\n\t \t \t\t \r\n\t\t \t }\r\n\t \t }\r\n\t \t \r\n\t \t //update tiles position based on this data (in future, we will have 9 tiles to cover this completely)\r\n\t \t */\r\n\t \t \r\n\t \t LocatedMapBundle newMap = new LocatedMapBundle();\r\n\t \t newMap.centerMap = centerMapTile;\r\n\t \t newMap.lon = (currentmapBB.east + currentmapBB.west)/2; //marks the centre point of the centre tile\r\n\t \t newMap.lat = (currentmapBB.north + currentmapBB.south)/2; \r\n\t \t \r\n\t \t // newMap.xDis =disY;\r\n\t \t // newMap.yDis = -disX;// ?? -? +?\r\n\t \t \r\n\t return newMap;\r\n\r\n\t } catch (IOException e) {\r\n\r\n\t Log.d(\"DEBUGTAG\", \"Oh noooz an error...\");\r\n\r\n\t }\r\n\t \r\n\t \r\n\t \r\n\r\n\t return null;\r\n\r\n\t \r\n\t}", "void fillMap(Map map, int id);", "@Override\n\tpublic void createMap() {\n\t\tmap = new MazeMap(new Random());\n\t}", "public void newMap() {\n \n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\r\n // Try to obtain the map from the SupportMapFragment.\r\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.event_map))\r\n .getMap();\r\n // Check if we were successful in obtaining the map.\r\n if (mMap != null) {\r\n //setUpMap();\r\n //mMap.setMyLocationEnabled(true);\r\n //mMap.setOnMyLocationButtonClickListener(this);\r\n LatLng singapore = new LatLng(oneEvent.getX(), oneEvent.getY());\r\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(singapore, 12));\r\n mMap.getUiSettings().setAllGesturesEnabled(false);\r\n mMap.addMarker(new MarkerOptions().position(new LatLng(oneEvent.getX(), oneEvent.getY())));\r\n mMap.getUiSettings().setZoomControlsEnabled(false);\r\n }\r\n }\r\n }", "private void setUpMapIfNeeded() {\n if (map == null) {\n map = getMap(); \n // Check if we were successful in obtaining the map.\n if (map != null) {\n \tmap.moveCamera(CameraUpdateFactory.newLatLngZoom(START_POINT, 16));\n \tmap.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n \tmap.setMyLocationEnabled(true);\n \t\n \ttry{\n \tpopulateTrailPoints();\n }\n catch(Exception e){}\n \tdrawTrails();\n }\n }\n }", "private void setUpMap(GoogleMap map) {\n MCLocationManager lm = MCLocationManager.getInstance();\n\n /* lastCoordinate is the location which the map will show, the default being San Francisco */\n LatLng lastCoordinate = new LatLng(Double.parseDouble(getResources().getString(R.string.default_latitude)),\n Double.parseDouble(getResources().getString(R.string.default_longitude)));\n\n /* Loops through the beacons and set them in the map */\n for (MCBeacon beacon : lm.getBeacons()) {\n map.addMarker(new MarkerOptions()\n .position(beacon.getCoordenates())\n .title(beacon.getName())\n .icon(BitmapDescriptorFactory.fromResource((R.drawable.tags))));\n map.addCircle(new CircleOptions()\n .center(beacon.getCoordenates())\n .radius(beacon.getRadius())\n .strokeColor(getResources().getColor(R.color.beaconOuterCircle))\n .fillColor(getResources().getColor(R.color.beaconInnerCircle)));\n lastCoordinate = beacon.getCoordenates();\n }\n\n /* Loops through the locations and set them in the map */\n for (MCGeofence location : lm.getGeofences()) {\n map.addMarker(new MarkerOptions().position(location.getCoordenates()).title(location.getName()));\n map.addCircle(new CircleOptions()\n .center(location.getCoordenates())\n .radius(location.getRadius())\n .strokeColor(getResources().getColor(R.color.geoLocationOuterCircle))\n .fillColor(getResources().getColor(R.color.geoLocationInnerCircle)));\n lastCoordinate = location.getCoordenates();\n }\n /* Centers the map in the last coordinate found and sets the zoom */\n CameraPosition cameraPosition = new CameraPosition.Builder()\n .target(lastCoordinate).zoom(getResources().getInteger(R.integer.map_zoom)).build();\n map.animateCamera(CameraUpdateFactory\n .newCameraPosition(cameraPosition));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inject the Main Controller to be able to call function on it when picking a guest
public void injectMainController(Controller controller) { this.controller = controller; }
[ "public MainController(){\n \n }", "private MainScreenController()\n {\n //instantiate the repo object's\n mLocalRepo = LocalRepository.getLocalRepository();\n mRemoteRepo = new RemoteRepository(this);\n }", "public void injectMainController(MainController mc) {\r\n\t\tthis.mainController = mc;\r\n\t}", "public MainController() {\n try {\n log.debug(\"Starting MainController\");\n transactionSql = new TransactionSqlRepository();\n categorySql = new CategorySqlRepository();\n classifier = new FuzzyClassifier();\n } catch (RepositoryConnectionException e) {\n log.error(\"Failed to initialise a controller\", e);\n System.exit(1);\n }\n }", "public static void main(String[] args) {new Controller();}", "interface MainPresenter {\n void requestHotMoviee();\n }", "public GuestController() {\n\t\tdispatcher = Dispatcher.getInstance();\n\t\tgson = new GsonBuilder().setDateFormat(\"yyyy-MM-dd\").create();\n\t}", "public void initControllers(){\n initTable();\n initMenu();\n initInventoryControllers();\n initReportControllers();\n\n adminView.getBackButton().setOnAction(e ->{\n //Saves all data\n StartupController startupController = new StartupController(shopData);\n startupController.saveAllData();\n //passes control\n passControl(startupController, e);\n });\n\n\n }", "MainPresenterImp(MainView mainView) {\n this.mainView = mainView;\n\n navDir = new NavigationDirector();\n navDir.register(GameID.GAME1, new Game1Command(mainView));\n navDir.register(GameID.GAME2, new Game2Command(mainView));\n navDir.register(GameID.GAME3, new Game3Command(mainView));\n\n menuDir = new MenuDirector();\n menuDir.register(MenuOptionID.SETTINGS, new SettingsMenuCommand(mainView));\n menuDir.register(MenuOptionID.STATISTICS, new StatisticsMenuCommand(mainView));\n menuDir.register(MenuOptionID.SIGN_OUT, new SignOutMenuCommand(this));\n menuDir.register(MenuOptionID.ACHIEVEMENTS, new AchievementsMenuCommand(mainView));\n\n this.mUserInteractor = IUsersInteractor.getInstance();\n this.mErrorHandler = ExceptionErrorHandler.getInstance();\n\n mUserInteractor\n .getUserObservable()\n .observe(\n mainView.getLifeCycleOwner(),\n iUser -> {\n mUser = iUser;\n if (iUser.isConnected()) {\n mainView.showNormalScreen();\n } else {\n mainView.showNoUserScreen();\n }\n });\n }", "public Controller()\n {\n screen = new Screen();\n logic = new Logic();\n screen.setVisible(true);\n\n currentUser = new User();\n }", "public Main()\n {\n setController(new SimulationController());\n }", "@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\tDelegator delegator = Delegator.getInstance();\n\t\t\t\tdelegator.mainController.Main();\n\t\t\t}", "public Controller() {\n blogService = new BlogService();\n homePage = new HomePage(this);\n }", "public void setController(Controller controller){this.controller = controller;}", "public void registerControllers(){\n vista.registerPass(this);\n }", "@Override\r\n public void start(Stage primaryStage) throws Exception{\r\n //fill inventory with test data\r\n fillTestInv();\r\n //bring up main screen view\r\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/mainScreenView.fxml\"));\r\n controller.MainScreenController controller = new controller.MainScreenController(inv);\r\n loader.setController(controller);\r\n Parent root = loader.load();\r\n Scene scene = new Scene(root);\r\n primaryStage.setTitle(\"Greg_Newby C482\");\r\n primaryStage.setScene(scene);\r\n primaryStage.setResizable(false);\r\n primaryStage.show();\r\n }", "public static void main(String[] args) {\n LoginView lgView = new LoginView();\r\n AcessoView acessView = new AcessoView();\r\n AlunoView view = new AlunoView();\r\n RegistroAlunosView autoView = new RegistroAlunosView();\r\n GuaritaView gView = new GuaritaView();\r\n EditarAlunoView editView = new EditarAlunoView();\r\n AdicionarAlunoView adView = new AdicionarAlunoView();\r\n RegistroAutorizacoes raView = new RegistroAutorizacoes();\r\n LoginCoordenadorView lgcView = new LoginCoordenadorView();\r\n EditCoordenadorView ecView = new EditCoordenadorView();\r\n AdicionarCoordenadorView acView = new AdicionarCoordenadorView();\r\n ListaCoordenadorView lcView = new ListaCoordenadorView();\r\n TurmaView tView = new TurmaView();\r\n AdicionarTurmaView atView = new AdicionarTurmaView();\r\n EditTurmaView etView = new EditTurmaView();\r\n ListAlunoController controller = new ListAlunoController(view, editView, adView, autoView);\r\n ListAutorizacaoController controller1 = new ListAutorizacaoController(autoView, raView, lgcView);\r\n ListGuaritaController controller2 = new ListGuaritaController(gView);\r\n ListAcessoController controller3 = new ListAcessoController(acessView, gView, view, raView, lgView, lgcView, lcView,tView);\r\n ListCoordenadorController controller4 = new ListCoordenadorController(lcView, ecView, acView, lgView, raView,\r\n lgcView, acessView);\r\n ListTurmaController controller5 = new ListTurmaController(atView,etView,tView);\r\n controller2.iniciar();\r\n controller.iniciar();\r\n controller1.iniciar();\r\n controller3.iniciar();\r\n controller4.iniciar();\r\n controller5.iniciar();\r\n }", "public AppController()\n\t{\n\t\tmyDataController = new DatabaseController(this);\n\n\t\tgraveyardPersons = new ArrayList<Person>();\n\t\tgraveMarkerList = new ArrayList<GraveMarker>();\n\n\t}", "private ClientController() {\r\n\r\n\t}", "public void setupController() {\n\t\tSystem.out.println(\"loading controller\");\n\n\t\t// controller = new SPController(character,\n\t\t// new ParameterizedLyingGenerator(),\n\t\t// FileUtils.readParameters(\"../SPParameters/dart.par\"));\n\t\tcontroller = new SPController(\n\t\t\t\tcharacter,\n\t\t\t\tnew WarpedLyingPatternGenerator(),\n\t\t\t\tFileUtils\n\t\t\t\t\t\t.readParameters(\"../SPParameters/warpedImprovement200.par\"));\n\t\t// setGroundAngle(-.19f);\n\t\t// controller = new SPController(character, new\n\t\t// LyingPatternGenerator());\n\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Empty constructor only used by JAXB.
private DefaultRecordType() { parent = null; name = null; memberTypes = Collections.emptyMap(); }
[ "private XML()\n {\n }", "private GxmlElement()\n {\n }", "private XmlUtil() {\n // do nothing\n }", "private RootElement() {\n\t}", "public ConstructorEmpty() {}", "private XmlPackage() {}", "private XMLSchemaValidator()\n {\n // Does nothing.\n }", "@SuppressWarnings(\"unused\")\n\tpublic\n\tSimpleStAXElement()\n\t{\n\t\tsuper();\n\n\t\tthis.initialize();\n\t}", "private JaxbString() {\n }", "public Element()\n {\n }", "public BPlusTree() {\n //Pedro -- I need an empty constructor to Jgroups deserialize the object\n }", "public XMLDocument() {\r\n\t}", "public XmlAdaptedProduct() {}", "public MultiMessage() {\n\t\t\t// EMPTY constructor for JAXB\n\t\t}", "public XmlBase() {\r\n\tsuper();\r\n}", "private XMLProvider() {\n super();\n }", "private XmlConstants() {\r\n super();\r\n }", "public TExtensibleElements() {\n }", "public PersistenceClassElement ()\n\t{\n\t\tthis(null);\n\t}", "public TbomSchema() {\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A SessionFactory is set up once for an application!
static void initialize() { final StandardServiceRegistry registry = new StandardServiceRegistryBuilder() .configure() // configures settings from hibernate.cfg.xml .build(); try { sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory(); } catch (Exception e) { System.out.println(sessionFactory); System.err.println("Exception "+e); StandardServiceRegistryBuilder.destroy( registry ); } }
[ "public void initSessionFactory(){\n if (sessionFactory == null) {\n // loads configuration and mappings\n Configuration configuration = new Configuration().configure();\n // builds a session factory from the service registry\n sessionFactory = configuration.buildSessionFactory();\n }\n }", "static void initializeSessionFactory() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\r\n .configure(\"hibernate.cfg.xml\") // configures settings from hibernate.cfg.xml\r\n .build();\r\n try {\r\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\r\n }\r\n catch (Exception e) {\r\n System.err.println(\"Exception \"+e);\r\n StandardServiceRegistryBuilder.destroy( registry );\r\n }\r\n }", "@Autowired\r\n\tpublic void setSessionFactory(SessionFactory sessionFactory) {\r\n\t\tsession = sessionFactory.openSession();\r\n\t}", "public static SessionFactory setup() {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure() // configures settings from hibernate.cfg.xml\n .build();\n try {\n sessionFactory = new MetadataSources(registry).buildMetadata().buildSessionFactory();\n } catch (Exception ex) {\n StandardServiceRegistryBuilder.destroy(registry);\n }\n Session session = sessionFactory.openSession();\n session.beginTransaction();\n return sessionFactory;\n }", "private static void initSessionFactoryFromEnv() {\n\t\t// Configure base details from hibernate.cfg.xml\n\t\tStandardServiceRegistryBuilder registryBuilder = new StandardServiceRegistryBuilder().configure();\n\n\t\t// Complete SessionFactory instantiation.\n\t\tMetadataSources sources = new MetadataSources(registryBuilder.build());\n\t\tMetadata metadata = sources.getMetadataBuilder().build();\n\t\tsessionFactory = metadata.getSessionFactoryBuilder().build();\n\t}", "private void initFactory() throws Exception {\n final StandardServiceRegistry registry = new StandardServiceRegistryBuilder()\n .configure() // configures settings from hibernate.cfg.xml\n .build();\n try {\n sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory();\n }\n catch (Exception e) {\n // The registry would be destroyed by the SessionFactory, but we had trouble building the SessionFactory\n // so destroy it manually.\n StandardServiceRegistryBuilder.destroy( registry );\n throw e;\n }\n }", "public void setSessionFactory( SessionFactory sessionFactory )\r\n {\r\n this.sessionFactory = sessionFactory;\r\n }", "private static synchronized SessionFactory getSessionFactory() {\n\ttry {\r\n\t\tConfiguration cfg=new Configuration();\r\n\t\tcfg.configure(\"hibernate.cfg.xml\");\r\n\t\tSessionFactory sessionFactory=cfg.buildSessionFactory();\r\n\tSystem.out.println(\"sessionFactory object created\");\r\n\t\treturn \t sessionFactory;\r\n\t} catch (Throwable ex) {\r\n\t\tSystem.out.println(\"initial sessionfactory creation failed\");\r\n\t\tthrow new ExceptionInInitializerError(ex);\r\n\t\t// TODO: handle exception\r\n\t\t\r\n\t}\r\n\t\r\n}", "@Autowired\r\n public void setSessionFactory(final SessionFactory sessionFactory) {\r\n this.sessionFactory = sessionFactory;\r\n }", "@Autowired\n\tpublic void setSessionFactory(SessionFactory sessionFactory) {\n\t\tthis.sessionFactory = sessionFactory;\n\t}", "public static SessionFactory getFactory()\n\t{\n\t\tStandardServiceRegistry ssr = null;\n\t\tMetadata md = null;\n\t\tSessionFactory sf = null;\n\t\t\n\t\t// Not using try..catch here because handling errors is generally usage-specific\n\t\t// I feel it should be handled in a controller, rather than here in border\n\t\tssr = new StandardServiceRegistryBuilder().configure(\"hibernate.cfg.xml\").build();\n\t\tmd = new MetadataSources(ssr).getMetadataBuilder().build();\n\t\tsf = md.getSessionFactoryBuilder().build();\n\t\t\n\t\treturn sf;\n\t}", "private static SessionFactory buildSessionFacotry(){\n\t\ttry {\n\t\t\t\n\t\t\n\t\t\tConfiguration cfg = new Configuration().configure(\"hibernate.cfg.xml\");\t\n\t\t\treturn cfg.configure().buildSessionFactory();\n\t\t} catch (Throwable ex) {\n\t\t\tSystem.err.println(\"Failed to create sessionFactory object.\" + ex);\n\t\t\tthrow new ExceptionInInitializerError(ex);\n\t\t}\t\t\n\t}", "@Bean\n public LocalSessionFactoryBean sessionFactory() {\n LocalSessionFactoryBean sessionFactoryBean = new LocalSessionFactoryBean();\n\n sessionFactoryBean.setDataSource(dataSource());\n sessionFactoryBean.setPackagesToScan(env.getProperty(\"hiberante.packagesToScan\"));\n sessionFactoryBean.setHibernateProperties(getHibernateProperties());\n\n return sessionFactoryBean;\n }", "public void setSessionFactory(SessionFactory sessionFactory){\n\t\tthis.sessionFactory = sessionFactory;\n\t}", "protected SessionFactory getSessionFactory() {\n\t\treturn sessionFactory;\n\t}", "private Session_Factory() {\n\t}", "Session makesesstions(){\n SessionFactory factory;\n try {\n\n factory = new Configuration().configure().buildSessionFactory();\n } catch (Throwable ex) {\n System.out.println(\"Failed to create sessionFactory object.\" + ex);\n throw new ExceptionInInitializerError(ex);\n }\n Session session = factory.openSession();\n return session;\n }", "@Bean\r\n\tpublic LocalSessionFactoryBean sessionFactory() {\r\n\t\tLocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();\r\n\t\tsessionFactory.setDataSource(dataSource());\r\n\t\tsessionFactory.setPackagesToScan(PACKAGES_TO_SCAN);\r\n\t\tProperties hibernateProperties = new Properties();\r\n\t\thibernateProperties.put(\"hibernate.dialect\", DIALECT);\r\n\t\thibernateProperties.put(\"hibernate.show_sql\", SHOW_SQL);\r\n\t\thibernateProperties.put(\"hibernate.hbm2ddl.auto\", HBM2DDL_AUTO);\r\n\t\tsessionFactory.setHibernateProperties(hibernateProperties);\r\n\r\n\t\treturn sessionFactory;\r\n\t}", "public static void setSessionFactory(SessionFactory sf) {\n\t\tfactory = sf;\n\t}", "@Autowired\r\n public void setSessionFactory(SessionFactory sessionFactory) {\r\n this.hibernateTemplate = new HibernateTemplate(sessionFactory);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
optional int32 class_fq_name = 2;
public boolean hasClassFqName() { return ((bitField0_ & 0x00000002) == 0x00000002); }
[ "public int getClassFqName() {\n return classFqName_;\n }", "Integer getClassIdexam();", "public static String abbrevFQClassname(String fqClassname)\r\n {\r\n int index = fqClassname.lastIndexOf('.') + 1;\r\n if (index < 0 || index >= fqClassname.length())\r\n {\r\n return fqClassname;\r\n }\r\n else\r\n { \r\n return fqClassname.substring(index);\r\n }\r\n }", "public int getFamilyClass() {\n/* 147 */ return this.sFamilyClass;\n/* */ }", "int getFieldClassId(String fieldName);", "public Integer getClassname() {\n return classname;\n }", "protected String getClassHint(Class cls) {\n String classHint = cls.getSimpleName();\n Xml annotation = (Xml) cls.getAnnotation(Xml.class);\n if (annotation != null) {\n classHint = annotation.value();\n }\n return classHint;\n }", "public String getClassification(){ return classification; }", "public MetaClass(String classname) {\n this.classname = classname;\n }", "@Override\n\tpublic int getClassID() {\n\t\treturn 9;\n\t}", "private static String getClassFieldName(Class<?> clazz) {\n return StringUtils\n .uncapitalize(clazz.getSimpleName().replaceAll(\"Jpa\", \"\"));\n }", "public void setClassID(String classID) {this.classID = classID;}", "private String getQueryClassName(Class<?> domainClass) {\n\n\t\tString simpleClassName = ClassUtils.getShortName(domainClass);\n\t\tString packageName = domainClass.getPackage().getName();\n\n\t\treturn String.format(\"%s%s.Q%s%s\", packageName, querySuffix, getClassBase(simpleClassName),\n\t\t\t\tdomainClass.getSimpleName());\n\t}", "int ll_getTypeClass(int typeCode);", "public abstract String getDefaultSuperClassFQN();", "private static String findClassName(Class<?> cls){\n\t\tString className=cls.getCanonicalName();\n\t\tif(className==null){\n\t\t\tclassName=findClassName(cls.getSuperclass());\n\t\t}\n\t\treturn className;\n\t}", "public String getParamSuppClassName() {\n\treturn this.paramSuppClassName;\n }", "public Class lookup( String clazz){\n\t\tClass res = lookup_(clazz) ;\n\t\tif( DEBUG ) System.out.println( \" [J] lookup( '\" + clazz + \"' ) = \" + (res == null ? \" \" : (\"'\" + res.getName() + \"'\" ) ) ) ;\n\t\treturn res ;\n\t}", "private static String getShortClassNameInGeneric(String argClassName) {\r\n\t\tStringBuffer result = new StringBuffer();\r\n\t\tgetShortClassNameInGeneric0(result, getClassesInGeneric(argClassName),\r\n\t\t\t\t0);\r\n\r\n\t\treturn result.toString();\r\n\t}", "public static String getClassname(String id) {\n\t\tOntModel model = MyOntModel.getInstance().getModel();\n\t\tString pre = model.getNsPrefixURI(\"\");\n\t\tString rdfPre = model.getNsPrefixURI(\"rdf\");\n\t\tIndividual individual = model.getIndividual(pre + id);\n\n\t\tif (individual == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tOntProperty op = model.getOntProperty(rdfPre + \"type\");\n\t\tString[] tmp = individual.getPropertyValue(op).toString().split(\"#\");\n\t\tif (tmp.length == 2) {\n\t\t\treturn tmp[1];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/I used the onWakeupWord() method as a test for the gaze aversion and other features. You can delete this if need be. Ese
@Override public void onWakeupWord(String wakeupWord, int direction) { face.changeGazeTo(Gaze.PERFORM_ALL); //END }
[ "private void computerTurn() {\n\n String wordFragment = ghostTextView.getText().toString();\n if( wordFragment.length() >= 4 && dictionary.isWord(wordFragment) ){\n USER_WON = false;\n endGame(\"You Looser :( [Valid Word]\");\n }\n else{\n Log.d(\"TAG\",\"Calling getGoodWord for Fast Dictionary\");\n String nextWord = dictionary.getGoodWordStartingWith(wordFragment);\n //Log.d(\"TAG\",\"Word found : \"+nextWord);\n if(nextWord == null){\n USER_WON = false;\n endGame(\"you can't bluff ME!\");\n }\n else{\n wordFragment = wordFragment + nextWord.charAt(wordFragment.length());\n ghostTextView.setText( (wordFragment) );\n //set userTurn True\n userTurn = true;\n gameStatus.setText(USER_TURN);\n }\n }\n }", "boolean getHotwordFired();", "public void m7308g() {\n if (m7315n() || !m7288v() || this.f5904u == C1911a.STATE_BACKGROUND_NOT_SUPPORT_INTENAL_SCREEN) {\n C1260i.m4445e(f5889g, \"-can not-startWakeUp--\");\n } else if (C1772k.m6480a().m6490d() == 2) {\n C2201w.m8371a((int) C0965R.string.voice_tips, 0);\n m7309h();\n } else {\n m7291y();\n this.f5902s.m10775o();\n }\n }", "boolean hasHotwordFired();", "static void look(boolean wakeup) {\n Player player = Human.instance;\n boolean DEBUG = false;\n if (DEBUG) {\n boolean done = false;\n\n if (done) {\n return;\n }\n done = true;\n } /* DEBUG */\n int passcount = 0;\n Room rp = player.getRoom();\n if (!Global.oldpos.equals(player.getPosition())) {\n erase_lamp(Global.oldpos, Global.oldrp);\n Global.oldpos = player.getPosition();\n Global.oldrp = rp;\n }\n int ey = player.getPositionY() + 1;\n int ex = player.getPositionX() + 1;\n int sx = player.getPositionX() - 1;\n int sy = player.getPositionY() - 1;\n int sumhero = 0;\n int diffhero = 0;\n if (Global.door_stop && !Global.firstmove && Global.running) {\n sumhero = player.getPositionY() + player.getPositionX();\n diffhero = player.getPositionY() - player.getPositionX();\n }\n Place pp = Util.getPlace(player.getPosition());\n ObjectType pch = pp.p_ch;\n int pfl = pp.p_flags;\n\n for (int y = sy; y <= ey; y++) {\n if (y > 0 && y < Const.NUMLINES - 1) {\n for (int x = sx; x <= ex; x++) {\n if (x < 0 || x >= Const.NUMCOLS) {\n continue;\n }\n AbstractCoordinate target = new Coordinate(x, y);\n if (!player.containsState(StateEnum.ISBLIND)) {\n if (player.getPosition().equals(target)) {\n continue;\n }\n }\n\n pp = Util.INDEX(y, x);\n ObjectType ch = pp.p_ch;\n if (ch.getValue() == ObjectType.Blank.getValue()) {\n /* nothing need be done with a ' ' */\n continue;\n }\n int fp = pp.p_flags;\n if (pch != ObjectType.DOOR && ch != ObjectType.DOOR) {\n if ((pfl & Const.F_PASS) != (fp & Const.F_PASS)) {\n continue;\n }\n }\n if (((fp & Const.F_PASS) != 0 || ch == ObjectType.DOOR) &&\n ((pfl & Const.F_PASS) != 0 || pch == ObjectType.DOOR)) {\n if (player.getPositionX() != x && player.getPositionY() != y &&\n !IOUtil.step_ok(Util.INDEX(y, player.getPositionX()).p_ch) &&\n !IOUtil.step_ok(Util.INDEX(player.getPositionY(), x).p_ch)) {\n continue;\n }\n }\n\n OriginalMonster tp;\n if ((tp = pp.p_monst) == null) {\n ch = trip_ch(target, ch);\n } else if (player.containsState(StateEnum.SEEMONST) && tp.containsState(StateEnum.ISINVIS)) {\n if (Global.door_stop && !Global.firstmove) {\n Global.running = false;\n }\n continue;\n } else {\n if (wakeup)\n Monst.wake_monster(y, x);\n if (Chase.see_monst(tp)) {\n if (player.containsState(StateEnum.ISHALU))\n ch = ObjectType.get((char) (Util.rnd(26) + 'A'));\n else\n ch = ObjectType.get((char) tp.getDisplayTile());\n }\n }\n if (player.containsState(StateEnum.ISBLIND) && (!player.getPosition().equals(target))) {\n continue;\n }\n\n Display.move(y, x);\n\n if (player.getRoom().containInfo(RoomInfoEnum.ISDARK) &&\n !Global.see_floor && ch == ObjectType.FLOOR) {\n ch = ObjectType.Blank;\n }\n\n if (tp != null || ch.getValue() != Util.CCHAR(Display.inch())) {\n Display.addch(ch.getValue());\n }\n\n if (Global.door_stop && !Global.firstmove && Global.running) {\n switch (Global.runch) {\n case 'h':\n if (x == ex) {\n continue;\n }\n break;\n case 'j':\n if (y == sy) {\n continue;\n }\n break;\n case 'k':\n if (y == ey) {\n continue;\n }\n break;\n case 'l':\n if (x == sx) {\n continue;\n }\n break;\n case 'y':\n if ((y + x) - sumhero >= 1) {\n continue;\n }\n break;\n case 'u':\n if ((y - x) - diffhero >= 1) {\n continue;\n }\n break;\n case 'n':\n if ((y + x) - sumhero <= -1) {\n continue;\n }\n break;\n case 'b':\n if ((y - x) - diffhero <= -1) {\n continue;\n }\n }\n switch (ch) {\n case DOOR:\n if (x == player.getPositionX() || y == player.getPositionY()) {\n Global.running = false;\n }\n break;\n case PASSAGE:\n if (x == player.getPositionX() || y == player.getPositionY()) {\n passcount++;\n }\n break;\n case FLOOR:\n case Vert:\n case Horizon:\n case Blank:\n break;\n default:\n Global.running = false;\n break;\n }\n }\n }\n }\n }\n if (Global.door_stop && !Global.firstmove && passcount > 1)\n Global.running = false;\n if (!Global.running || !Global.jump)\n Display.mvaddch(Global.player._t_pos, ObjectType.PLAYER.getValue());\n if (DEBUG) {\n boolean done = false;\n } /* DEBUG */\n }", "public void temiWakeWord(final boolean woke) {\n\n // change the UI\n runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n iv1.setImageURI(null);\n if (woke) {\n iv1.setImageResource(R.drawable.temi_face_01__listening);\n }\n else {\n iv1.setImageResource(R.drawable.temi_face_01__1_);\n }\n\n }\n });\n }", "boolean getExpectAsrAfterHotword();", "public abstract String wake();", "public void takeSword(){\n\t\thasSword = true;\n\t}", "boolean getWarnIfHotwordNotFound();", "private void updateGameWon() {\n // game is won if there are no more blanks\n gameWon = !wordBlanks.contains(\"_\");\n }", "boolean hasWarnIfHotwordNotFound();", "public interface WordZapConstants {\n\t/****** UI PARAMETERS ******/\n\tint DEFAULT_ORIENTATION = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;\n\t/***************************/\n\n\t/****** LEVEL INCREMENT/DECREMENT DURING HUMAN WIN/LOSS/DRAW ******/\n\tint HUMAN_LOSE_LEVELJUMP = -1;\n\tint HUMAN_WIN_LEVELJUMP = 1;\n\tint GAME_DRAW_LEVELJUMP = 0;\n\t/*************************************************************/\n\n\t/****** DIALOG BOXES IN THE USER INTERFACE *****/\n\tint HUMAN_WIN_DIALOG = 0;\n\tint HUMAN_LOSE_DIALOG = 1;\n\tint SHOW_LEVEL_DIALOG = 2;\n\tint DRAW_DIALOG = 3;\n\t/***********************************************/\n\n\t/****** IDENTIFIES HUMAN LOSS/WIN IN A LEVEL *****/\n\tint HUMAN_LOSS = 0;\n\tint HUMAN_WIN = 1;\n\tint DRAW = 2;\n\tint NONE=-1;\n\t/***********************************************/\n\n\t\n\t/****** KEY NAMES IN KEY-VALUE PAIRS ******/\n\tString GENWORD_MOVE_KEYNAME = \"genword_move\";\n\tString GENERATED_WORD_KEYNAME = \"genword\";\n\tString ZAP_MOVE_KEYNAME = \"zap_move\";\n\tString NEXT_LEVEL_PARAM_KEYNAME = \"next_level\";\n\tString DIFFICULTY_PARAM_KEYNAME = \"difficulty\";\n\tString TIMER_VALUE_KEYNAME = \"timer_value\";\n\tString GAME_STATUS = \"game_status\"; \n\t/******************************************/\n\n\t/****** OTHER PARAMETERS ******/\n\t// Default level with which the game starts\n\tint START_LEVEL = LevelGenerator.MIN_LEVEL;\n\t/******************************/\n\n\t/****** GAME SOUNDS *******/\n\tint BAD_WORD_BEEP = R.raw.bad_word_beep;\n\tint CANT_END_WORD_BEEP = R.raw.end_word_beep;\n\tint CANT_POP_LETTER_BEEP = R.raw.letter_pop_beep;\n\t// Beep sounds during special situations\n\tint CANT_PRESS_LETTER_BEEP = R.raw.letter_press_beep;\n\t/**************************/\n\n\t/****** VISUAL LETTER GRID CONSTANTS ******/\n\tint GRID_NUMCOLS = 5;\n\tint GRID_NUMROWS = 7;\n\t// Minimum word size allowed on the word zap screen\n\tint MIN_WORD_SIZE = 2;\n\t// Maximum word size allowed on the word zap screen\n\t// Same as the number of cols allowed in the letter grid\n\tint MAX_WORD_SIZE = GRID_NUMCOLS;\n\t/******************************************/\n\n\t/****** REFERENCE DICTIONARY (ENGLISH) ******/\n\t// English alphabet frequencies file\n\tint ALPHABETS_FREQ_FILE = R.raw.english_alphabets_frequencies;\n\t// English word lists file\n\tint WORD_LISTS_FILE = R.raw.word_list;\n\tint ALPHABETS_FREQ_FILE_DELIM = R.string.english_alphabets_frequencies_delim;\n\t/********************************************/\n\n\t//Number of milliseconds for which the human player can afford to sleep\n\tint HUMAN_SLEEP_CHECK = 30000;\n\n\t//Identifies the human player's visual grid\n\tint HUMAN_PLAYER_GRID = 0;\n\n\t//Identifies the coimputer player's visual grid\n\tint COMP_PLAYER_GRID = 1;\n\n\t\n\n\n\n\t\n\n}", "private void startNewWordEntry() {\n\t\tthis.currentMatches = new ArrayList<String>();\n\t\tthis.currentMatches.add(\"\");\n\t\tthis.currentSignature = \"\";\n\t\tthis.index = 0;\n\t}", "@Override\n\tpublic void game() {\n\t\tString currentLetter = \"\";\n\t\t/* deklarujemy zmienna do przetrzymywania ciagu zuzytych literek */\n\t\tString usedLetters = \"\";\n\t\t\n\t\t/* dopoki:\n\t\t * odgadniete slowo nie jest takie samo jak wylosowane */\n\t\twhile(!maskString(usedLetters).replace(\" \", \"\").equalsIgnoreCase(this.word)) {\n\t\t\t/* spytaj uzytkownika o literke */\n\t\t\tSystem.out.println(\"Twoje słowo to: \");\n\t\t\tSystem.out.println(\"\\t\" + maskString(usedLetters));\n\t\t\tSystem.out.println(\"Użyte literki: \" + usedLettersChain(usedLetters));\n\t\t\t/* pobierz i przypisz do zmiennej currentLetter nowa literke */\n\t\t\tcurrentLetter = getLetter();\n\t\t\t\n\t\t\t/* jezeli uzytkownik do tej pory nie podal takiej literki, to dodaj ja \n\t\t\t * do ciagu zuytych literek */\n\t\t\tif(!usedLetters.contains(currentLetter)) {\n\t\t\t\tusedLetters += currentLetter;\n\t\t\t}\n\t\t}\n\t\t/* poinformuj uzytkownika o koncu gry */\n\t\tSystem.out.println(\"*** KONIEC ***\");\n\t}", "public void gotograveyard() {\n\t}", "public void receiveNightmare() {\n hasNightmares = true;\n }", "public void wakeUp() {\n\t\tstatus = SleepStatus.Awake;\n\t}", "boolean hasHotwordFiringIndex();", "public void runTurnWord() {\r\n\t\t\r\n\t\tString temp, y;\r\n\t\t\r\n\t\ttemp = wordTextField.getText();\r\n\t\t\r\n\t\tif(wordChoice.indexOf(temp) == -1) {\r\n\t\t\tmessage = \"\";\r\n\t\t\tnumErrors++;\r\n\t\t\tif(numErrors == MAX_MISTAKES) {\r\n\t\t\t\tmessage = \"You Lose! The word was \" + wordChoice + \"!\";\r\n\t\t\t\tinfo = \"Click Restart to play again!\";\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tchar[] tempLetters = new char[temp.length()];\r\n\t\tfor(int i = 0; i < temp.length(); i++) {\r\n\t\t\ttempLetters[i] = temp.charAt(i);\r\n\t\t}\r\n\t\t\r\n\t\tif(!(wordChoice.indexOf(temp) == -1)) {\r\n\t\t\tfor(int i = 0; i < wordChoice.length(); i++) {\r\n\t\t\t\twordGuess.setCharAt(i, tempLetters[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ty = new String(wordGuess);\r\n\t\tif(y.indexOf('-') == -1) {\r\n\t\t\tmessage = \"You Win!\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tmessage = \"\";\r\n\t\t\r\n\t\trepaint();\r\n\t\t\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Crea el directorio o verifica que exita el mismo
private static void crearDirectorio(String dirc){ //Creacion del directorio y del achivo File dir = new File(dirc);//Primero creamos el directorio if (!dir.exists()) { dir.mkdirs(); } }
[ "public void createDir(){\n /**\n * Hace un Directorio LLamado LinkedDB en la misma ruta del Jar.\n * Para luego crear los directorios ahi mismo.\n * Si retorna valor true al hacer el Directorio envia unos mensajes.\n */\n new File(\"LinkedDB\").mkdir();\n File dir = new File(\"LinkedDB\\\\\"+this.name.toString());\n\n boolean successfull = dir.mkdir();\n\n if (successfull){\n System.out.println(\"¡Directorio creado con éxito!\");\n }else{\n System.out.println(\"No se creó el Directorio\");\n }\n\n }", "static public boolean createDirectory (java.io.File dir) { throw new RuntimeException(); }", "public void mkir() {\n mkdir=true;\n }", "private static void crearDirectorio(String directorio) {\n Path directory = Paths.get(directorio);\n try {\n Files.createDirectory(directory);\n } catch (IOException e) {\n System.out.println(\"Problema creando el directorio.\");\n System.out.println(e.toString());\n }\n\n }", "public void createDirectory(){\n //If directory exists just return else create an empty directory\n String basePath = new File(\"\").getAbsolutePath()+File.separator+File.separator+\"Saved_Files\";\n if(new File(basePath).exists()){\n return;\n }\n else{\n new File(basePath).mkdir();\n }\n }", "private void createDirectoryIfNotExists() throws IOException {\n try {\n Path path = Paths.get(System.getProperty(\"user.home\"), \"tdt4100-prosjekt-magnrod\", \"storage\");\n Files.createDirectories(path);\n } catch (IOException e) {\n throw new IOException(\"An error occurred when trying to create the directory: \" + path);\n }\n }", "private void makeDir() {\n\t\tSystem.out.println(\"请输入文件夹路径:\");\n\t\tScanner sin = new Scanner(System.in);\n\t\tString path = sin.nextLine();\n\t\tFile dir = new File(path);\n if (!dir.exists()) {// 判断目录是否存在 \n dir.mkdir();\n System.out.println(\"文件夹创建成功\");\n }\n else\n \tSystem.out.println(\"文件夹已存在!\");\n \n //sin.close();\n\t}", "@Override\n\tpublic boolean mkdir() {\n\t\treturn false;\n\t}", "public boolean createDirectory(String address) throws IOException {\n Path playPath = Paths.get(address);\n //create directory\n Files.createDirectory(playPath);\n if (Files.exists(playPath))\n System.out.println(playPath + \"Is Created\");\n return Files.exists(playPath);\n }", "public boolean mkdir() {\n return false;\n }", "private void createFileAndDirectory() {\n String directoryName = \"data\";\n String fileName = \"neo.txt\";\n File directory = new File(directoryName);\n if (!directory.exists()) {\n directory.mkdir();\n }\n File file = new File(directoryName + \"/\" + fileName);\n try {\n FileWriter writeFile = new FileWriter(file.getAbsoluteFile());\n writeFile.write(\"\");\n writeFile.close();\n Storage.commandResult = \"File not found, creating empty save file!\";\n } catch (IOException ioException) {\n Storage.commandResult = \"Oops! Something went wrong: \" + ioException.getMessage();\n }\n }", "public void crearDir() {\n directorio = new File(folder);\n directorio.mkdir();\n }", "private boolean createFolder(String pNewFolder)\r\n{\r\n\r\n try{\r\n\r\n Files.createDirectory(Paths.get(pNewFolder));\r\n\r\n }\r\n catch(FileAlreadyExistsException e){\r\n //okay if already exists -- existing folder will be used\r\n return(true);\r\n }\r\n catch(IOException e){\r\n success = false;\r\n errorMessage = e.getMessage() + \"; Cannot create folder: \" + pNewFolder;\r\n return(false); //error on any other exception\r\n }\r\n\r\n return(true);\r\n\r\n}", "public void createDirectory(){\n\t\tADJACENCY.startDirectoryCreation();\n\t}", "private void createDir(){\n timeLog = new SimpleDateFormat(\"ddMMyyyy_HHmmss\").format(Calendar.getInstance().getTime());\n imageDir = \"simulations/\" + timeLog + \"/\";\n statsDir = \"log/stats/\" + timeLog + \"/\";\n File imgDir = new File(imageDir);\n File stsDir = new File(statsDir);\n imgDir.mkdir();\n stsDir.mkdir();\n }", "public void createDirectory() {\n File folder = new File(this._fileName).getParentFile();\n folder.mkdirs();\n }", "private static void makeDir(File destPath) {\n System.out.println(\"creating directory: \" + destPath.getName());\r\n\t boolean result = false;\r\n try{\r\n\t \t destPath.mkdir();\r\n\t result = true;\r\n\t } \r\n\t catch(SecurityException se){\r\n\t //handle it\r\n\t se.printStackTrace();\r\n\t } \r\n\t if(result) { \r\n\t System.out.println(\"DIR created--->\" + destPath); \r\n\t }\r\n\t\t\r\n\t}", "public boolean criarDiretorio(String fullPath) {\n\t\ttry {\n\t\t\tFiles.createDirectory(Paths.get(fullPath));\n\t\t\treturn true;\n\t\t\n\t\t} catch (IOException e) {\n\t\t\tLog.setLogger(FileUtil.class, MSG_FALHA, Level.ERROR);\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean mkdir(String path) {\n return false;\n }", "private File createDir() {\n\n\t\tFile dir = new File(\"/\" + TARGET_FOLDER_NAME);\n\n\t\tif (!dir.exists()) dir.mkdir();\n\n\t\treturn dir;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Enregistrement de processus
public Processus[] registerProcessus(int ptr, Processus[] listeProcessus ,String nomProcessus , int dureeProcessus , int prioriteProcessus, int tempArrivee){ Processus p1 = new Processus (nomProcessus, tempArrivee ,dureeProcessus, prioriteProcessus); listeProcessus[ptr] = p1; ptr++; return listeProcessus; }
[ "public void registrarSalida(){\r\n \r\n }", "public void guar()\r\n {\r\n RequestContext ctx = RequestContext.getCurrentInstance(); //Capturo el contexto de la página\r\n try\r\n {\r\n this.objeTipoEsta.setEstaTipoEsta(1);\r\n FCDETipo.create(this.objeTipoEsta);\r\n this.listTipoEsta.add(this.objeTipoEsta);\r\n this.limpForm();\r\n ctx.execute(\"setMessage('MESS_SUCC', 'Atención', 'Datos guardados')\");\r\n log.info(\"Tipo Estado Guardado\");\r\n }\r\n catch(Exception ex)\r\n {\r\n ctx.execute(\"setMessage('MESS_ERRO', 'Atención', 'Error al guardar ')\");\r\n log.error(getRootCause(ex).getMessage());\r\n }\r\n finally\r\n {\r\n \r\n }\r\n }", "public void guarda() {\r\n Registro tmp = new Registro();\r\n try {\r\n tmp.setNombre(getNombre());\r\n tmp.setCorreo(getCorreo());\r\n tmp.setNombreusuario(getNombreusuario());\r\n tmp.setPassword(getContraseña());\r\n \r\n RegistroDaoHibernate registroDAO = new RegistroDaoHibernate();\r\n registroDAO.save(tmp);\r\n \r\n setMsn(\"El usuario se guardo exitosamente\");\r\n } catch (Exception e) {\r\n\r\n System.out.println(\" upss! Ocurrio un error. \" + e);\r\n }\r\n }", "public void registrarCocinero(){\r\n \r\n }", "com.banjiko.creditos.Credito addNewPrestamo();", "public void registrar() {\n direccion = vistaDireccion.ingresarDireccion();\n direccionDAO.create(direccion);\n }", "private void enregistrer() {\n String data = null;\n try {\n JSONArray jArray = new JSONArray();\n JSONObject json;\n for (int i : idsValider) {\n json = new JSONObject();\n json.put(Integer.toString(i), i);\n jArray.put(json);\n }\n data = \"idVal=\" + URLEncoder.encode(new JSONArray(idsValider).toString(), \"UTF-8\") +\n \"&\" + \"idSup=\" + URLEncoder.encode(new JSONArray(idsSuppr).toString(), \"UTF-8\");\n } catch (UnsupportedEncodingException | JSONException e) {\n e.printStackTrace();\n }\n loading.show();\n new SendToServerAsc(this, MainActivity.PREF_URL_VALUE + \"adminInfo.php\", FOA_ADMIN)\n .execute(data);\n }", "public void registrar() {\n usuario = vistaUsuario.registrarUsuario();\n UDao.create(usuario);\n }", "public void registrar(){\n AdminSQliteOpenHelper admin = new AdminSQliteOpenHelper(this, \"registro\", null, 1);\n SQLiteDatabase db = admin.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n\n values.put(bienvenida.CAMPO_ESTADO, \"1\");\n\n Long idResultante = db.insert(bienvenida.TABLA_BIENVENIDA, null, values);\n if (idResultante > 0) {\n\n Intent intent = new Intent(this, contacto.class);\n startActivity(intent);\n\n }\n }", "public void registrar(){\n FacesContext ctx = FacesContext.getCurrentInstance();\n //Crear mensaje\n String mensaje = \"Sus datos fueron registrados\";\n FacesMessage msgInfo;\n msgInfo = new FacesMessage(FacesMessage.SEVERITY_INFO, \"REGIST\", mensaje);\n ctx.addMessage(null, msgInfo);\n }", "private void registrarProfesor () {\n\t\t\tString [] inputs = {\n\t\t\t\t\tinputMatricula.getText(),\n\t\t\t\t\tinputDNI.getText(),\n\t\t\t\t\tinputCuil.getText(),\n\t\t\t\t\tinputNombre.getText(),\n\t\t\t\t\tinputApellido.getText(),\n\t\t\t\t\t(String) inputGenero.getSelectedItem()\n\t\t\t\t\t};\t\t\t\n\t\t\ttry \n\t\t\t{\n\t\t\t\tControladorProfesor.controlador().registrar(inputs);\n\t\t\t\tJOptionPane.showMessageDialog(this,\"Profesor registrado exitosamente\");\n\t\t\t\tactualizarTabla();\n\t\t\t} \n\t\t\tcatch (DBUpdateException ex)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(this, ex.getMessage(), \"Registro de un profesor\", JOptionPane.ERROR_MESSAGE);\n\t\t\t}\t\t\t\n\t\t\tdispose();\t\t\t\n\t\t}", "public void guardar() {\n Matcher matcher = patronNumericoEntero.matcher(nivelHerencia);// Validar que los niveles de herencia ingresados sea numerico entero\n if (!matcher.matches()) {\n // Mostrar mensaje localizado por tipo de parametro invalido\n ResourceBundle bundleGeneral = getBundle(NOMBRE_BUNDLE_PARAMETROS);\n getFacesContext()\n .addMessage(\n \"form-content:niveles\",\n new FacesMessage(FacesMessage.SEVERITY_ERROR, null, bundleGeneral\n .getString(\"msg_error_tipo_dato\")));\n } else {\n // Validar que la contraseņa y la confirmacion de la contraseņa son iguales\n if (!password.equals(confirmacionPassword)) {\n addErrorMessage(NOMBRE_BUNDLE_INSTALADOR, \"msg_confirmacion_pw\");\n } else {\n InstalacionDto instalacionDto = new InstalacionDto();\n instalacionDto.setNombresSuperAdmin(nombres);\n instalacionDto.setApellidosSuperAdmin(apellidos);\n instalacionDto.setPwSuperAdmin(password);\n instalacionDto.setEmailSuperAdmin(email);\n instalacionDto.setParametrosConfiguracion(resolverParametrosActualizar());\n try {\n catalogosEjb.guardarDatosInstalacion(instalacionDto);\n } catch (SeguridadException e) {\n SeguridadErrorHandler.handleException(e);\n }\n }\n }\n }", "public void guardarUbicacion(){\n\t\tfor(UbicacionPrd ubiSuc : instance.getUbicacionesPrd())\n\t\t\tif(ubiSuc.getNombre().toUpperCase().equals(nomUbicacion)) {\n\t\t\t\tFacesMessages.instance().add(Severity.WARN,\n\t\t\t\t\t\tsainv_messages.get(\"sucursalHome_error_ubiexi\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\tUbicacionPrd ubi = new UbicacionPrd();\n\t\tubi.setNombre(nomUbicacion);\n\t\tubi.setSucursal(instance);\n\t\ttry {\n\t\t\tgetEntityManager().persist(ubi);\n\t\t\tgetEntityManager().refresh(instance);\n\t\t\tFacesMessages.instance().add(Severity.INFO,\n\t\t\t\t\tsainv_messages.get(\"sucursalHome_msg_addedubi\"));\n\t\t} catch(Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tFacesMessages.instance().add(Severity.WARN,\n\t\t\t\t\tsainv_messages.get(\"sucursalHome_error_addubi\"));\n\t\t}\n\t}", "void registrarAcao(Historico historico);", "public void guardar(){\r\n Servicio servicioNuevo = new Servicio();\r\n servicioNuevo.setFechaServicios(fecha.getSelectedDate());\r\n servicioNuevo.setTipoServicios(txtTipoEmpleado.getText());\r\n servicioNuevo.setHoraServicio(txtHoraServicio.getText());\r\n servicioNuevo.setLugarSevicio(txtLugarServicio.getText());\r\n servicioNuevo.setTelefonoContacto(txtTelefonoContacto.getText());\r\n servicioNuevo.setEmpresas_codigoEmpresa(((Empresa)cbEmpresa.getSelectionModel().getSelectedItem()).getCodigoEmpresa());\r\n \r\n try{\r\n PreparedStatement sp = Conexion.getInstance().getConexion().prepareCall(\"{call sp_AgregarServicios(?,?,?,?,?,?)}\");\r\n sp.setDate(1, new java.sql.Date(servicioNuevo.getFechaServicios().getTime()));\r\n sp.setString(2,servicioNuevo.getTipoServicios());\r\n sp.setString(3,servicioNuevo.getHoraServicio());\r\n sp.setString(4,servicioNuevo.getLugarSevicio());\r\n sp.setString(5,servicioNuevo.getTelefonoContacto());\r\n sp.setInt(6,servicioNuevo.getEmpresas_codigoEmpresa());\r\n sp.execute();\r\n listaServicio.add(servicioNuevo); \r\n }catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "private void registrar(String estado){\n BBDD usdbh = new BBDD(this, null);\n SQLiteDatabase db = usdbh.getWritableDatabase();\n\n //Si hemos abierto correctamente la base de datos\n if(db != null){\n java.util.Date utilDate = new java.util.Date(); //fecha actual\n long lnMilisegundos = utilDate.getTime();\n java.sql.Timestamp sqlTimestamp = new java.sql.Timestamp(lnMilisegundos);\n //Insertamos los datos en la tabla Usuarios\n db.execSQL(\"INSERT INTO historial (estado, fecha) \" + \"VALUES ('\" + estado + \"', '\" + sqlTimestamp +\"')\");\n //Cerramos la base de datos\n db.close();\n }\n }", "public void guardar(){\n if(txtNombreProducto.getText().isEmpty() == true){\n JOptionPane.showMessageDialog(null, \"Por favor ingrese un nombre\", \"Agregar Producto\", JOptionPane.INFORMATION_MESSAGE);\n }else if(txtCantidad.getText().isEmpty() == true){\n JOptionPane.showMessageDialog(null, \"Por favot ingrese un cantidad\", \"Agregar Producto\", JOptionPane.INFORMATION_MESSAGE);\n }else{\n Productos registro = new Productos();\n registro.setNombreProducto(txtNombreProducto.getText());\n registro.setCantidad(Integer.parseInt(txtCantidad.getText()));\n\n try{\n PreparedStatement procedimiento = Conexion.getInstance().getConexion().prepareCall(\"{call sp_AgregarProducto(?,?)}\");\n procedimiento.setString(1,registro.getNombreProducto());\n procedimiento.setInt(2,registro.getCantidad());\n procedimiento.execute();\n ListaProductos.add(registro);\n cargarDatos();\n }catch(Exception e){\n e.printStackTrace();\n }\n }\n }", "public void registrar(View view){\n // creacion del helper\n AdminHelper admin = new AdminHelper(this,\"hortalizas\",null, VERSION);\n // creacion del objeto para base de datos\n SQLiteDatabase data = admin.getWritableDatabase();\n\n // Guardado de la informacion\n String id = edId.getText().toString();\n String variedad = edVariedad.getText().toString();\n String kilos = edKilos.getText().toString();\n String comentarios = edComentarios.getText().toString();\n\n // creacion del registro\n ContentValues cont;\n // comprobacion de los campos\n if(!id.isEmpty() && !variedad.isEmpty()\n && !kilos.isEmpty() && !comentarios.isEmpty()){\n cont = new ContentValues();\n // introduccion de valores\n cont.put(\"id\",id);\n cont.put(\"variedad\",variedad);\n cont.put(\"kilos\",kilos);\n cont.put(\"comentarios\",comentarios);\n\n // introduccion del registro\n data.insert(\"patatas\",null,cont);\n Toast.makeText(this, \"registro guardado\", Toast.LENGTH_SHORT).show();\n // vaciado de los campos\n edId.setText(\"\");\n edVariedad.setText(\"\");\n edComentarios.setText(\"\");\n edKilos.setText(\"\");\n }\n // caso que halla algun campo sin rellenar\n else{\n Toast.makeText(this, \"Faltan campos por rellenar\", Toast.LENGTH_SHORT).show();\n }\n data.close();\n\n }", "public void registrar(){\n \n salida = \"\\nSALIDA\\n matricula: \"+getMatricula()+\".\\n Plaza: \"\n +getPlazaOcupada()+\".\\n Fecha: \"+fechaSalida.getTime()+\".\"+\"\\n\";\n try {\n PrintWriter fOut = new PrintWriter(new BufferedWriter(\n new FileWriter(\"./movimientos.txt\", true)));\n fOut.write(salida);\n fOut.close();\n } catch (IOException e) {\n System.out.println(\"Fallo al guardar en un fichero\");\n }\n }", "public void registrarUsuario(){\n \n Connection con = this.cnx.getConexion(); \n //Connection con = cnx.conectar();\n //System.out.println(\"conexion registrarCliente Cliente--> \" + cnx.toString().hashCode());\n\n String sql =\"insert into usuario (nombre) values (?);\";\n try {\n // La ejecuto\n PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\n // El segundo parametro de usa cuando se tienen tablas que generan llaves primarias\n // es bueno cuando nuestra bd tiene las primarias autoincrementables\n ps.setString(1, this.nombre);\n\n \n int rows = ps.executeUpdate();\n\n // Cierro Conexion\n con.close();\n //cnx.desconectar();\n \n } catch (SQLException ex) {\n System.out.println(ex.getMessage());\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Nullable @Override protected Class<?>[] getRootConfigClasses() { return new Class[] {Application.class, JPAConfig.class}; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disables the button and attributes a point to the player
@Override public void actionPerformed(ActionEvent ae) { JButton button = (JButton) ae.getSource(); button.setEnabled(false); mGameInfo.mScore++; mGameInfo.updateInfo(); }
[ "public synchronized void disablePlayer() {\n _isActive = false;\n }", "public abstract void onDisable(Player p);", "public void disableButtons() {\n \tpokemon1.setDisable(true);\n \tpokemon2.setDisable(true);\n \tpokemon3.setDisable(true);\n \tpokemon4.setDisable(true);\n \tpokemon5.setDisable(true);\n \tpokemon6.setDisable(true);\n \tpokemon7.setDisable(true);\n \tpokemon8.setDisable(true);\n \tpokemon9.setDisable(true);\n \tpokemon10.setDisable(true);\n \tpokemon11.setDisable(true);\n \tpokemon12.setDisable(true);\n \tpokemon13.setDisable(true);\n \tpokemon14.setDisable(true);\n \tpokemon15.setDisable(true);\n \tpokemon16.setDisable(true);\n }", "public void ridingPlayerRightClick() {}", "private void restrictor(ButtonPanel buttonPanel) {\r\n if(!player.useStab()){\r\n buttonPanel.makeUnclickable(\"Stab\");\r\n }\r\n if(!player.useOverheadSwing()) {\r\n buttonPanel.makeUnclickable(\"Overhead Swing\");\r\n }\r\n if(!player.useSlash()){\r\n buttonPanel.makeUnclickable(\"Slash\");\r\n }\r\n }", "@Override \n public void mouseClicked(MouseEvent e) {\n Player.pause(); \n }", "public void disableAi(){\r\n\t\tClient.sound.soundFile2.play(); \r\n\t\tthis.aiDead = true;\r\n\t\tMap.setValue(this.currentP.x, this.currentP.y, EMPTY);\r\n\t}", "private void deshabilitarBotones(){\n btnMotor.setClickable(false);\n btnCilindros.setClickable(false);\n btnVelocidad.setClickable(false);\n btnPotencia.setClickable(false);\n btnConsumo.setClickable(false);\n btnRevoluciones.setClickable(false);\n btnSiguiente.setClickable(false);\n btnAtras.setClickable(false);\n }", "public void setDisableMenu() {\n addPlayer.setEnabled(false);\n removePlayer.setEnabled(false);\n }", "public void onPlayer1(View v) {\n handlePlayerButtons(0);\n }", "private void disableButtons () {\n mVisual.mNext.setEnabled(false);\n mVisual.mAll.setEnabled(false);\n \n }", "public void apagarBoton(){\n this.pista.setEnabled(false);\n }", "private void releasePlayBtnFromFreeze() {\n didUserAnswerCorrectly = true;\n playNoteFab.setAlpha(1f);\n }", "private void disableButtons() {\n\n for(Button b: buttonArray) {\n b.setClickable(false);\n }\n }", "public void stopEditing(UUID player) {\n\t}", "private void disableUnsupportedButtons() {\n if (mPlayer == null) {\n return;\n }\n \n try {\n if (mPauseButton != null && !mPlayer.canPause()) {\n mPauseButton.setEnabled(false);\n }\n if (mRewButton != null && !mPlayer.canSeekBackward()) {\n mRewButton.setEnabled(false);\n }\n if (mFfwdButton != null && !mPlayer.canSeekForward()) {\n mFfwdButton.setEnabled(false);\n }\n } catch (IncompatibleClassChangeError ex) {\n // We were given an old version of the interface, that doesn't have\n // the canPause/canSeekXYZ methods. This is OK, it just means we\n // assume the media can be paused and seeked, and so we don't disable\n // the buttons.\n }\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbutton_6.setEnabled(false);\r\n\t\t\t}", "public abstract void deactivatePlayer(int playerNumber);", "private void disablePlayback() {\n play.setImageResource(R.mipmap.play_without_glow);\n next.setImageResource(R.mipmap.next_without_glow);\n previous.setImageResource(R.mipmap.prev_without_glow);\n }", "public void onClick(View v) {\n \t\tif (PlayerMode == LIVE_MODE)\n \t\t{\n \t\t\tPlayerMode = PODCAST_MODE; \t\t\t\n \t\t}\n \t\telse\n \t\t{\n \t\t\tPlayerMode = LIVE_MODE; \t\t\t\n \t\t}\n \t\t\n \t\tUpdateBottomButton(PlayerMode);\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an aliased public.login_ip table reference
public LoginIp(String alias) { this(DSL.name(alias), LOGIN_IP); }
[ "public void setIpAddress(String tmp) {\n this.ipAddress = tmp;\n }", "public void setIp(String tmp) {\n this.ip = tmp;\n }", "void generateIPfromNetworkPrefix() {\n\t\tfor(int i=0; i<counterInitAddresses; i++) {\n\t\t\tNetworkPrefixIPformat[i] = processIP(NetworkPrefixBinary[i]); \n\t\t}\n\t}", "public Builder setLoginIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00200000;\n loginIp_ = value;\n onChanged();\n return this;\n }", "@FunctionInvocation\n public String ipV6(final String hexCase) {\n long leftLimit = 1L;\n long rightLimit = Long.MAX_VALUE;\n long generatedLong1 = leftLimit + (long) (Math.random() * (rightLimit - leftLimit));\n long generatedLong2 = leftLimit + (long) (Math.random() * (rightLimit - leftLimit));\n return longToIP(new long[]{generatedLong1, generatedLong2}, hexCase);\n }", "public com.google.protobuf.ByteString\n getLoginIpBytes() {\n java.lang.Object ref = loginIp_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n loginIp_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "interface WithIpAddressRange {\n /**\n * Sets the starting Ip address of SQL server's firewall rule.\n *\n * @param startIpAddress starting Ip address in Ipv4 format.\n * @param endIpAddress starting Ip address in Ipv4 format.\n * @return The next stage of the definition.\n */\n WithCreate withIpAddressRange(String startIpAddress, String endIpAddress);\n\n /**\n * Sets the ending Ip address of SQL server's firewall rule.\n *\n * @param ipAddress Ip address in Ipv4 format.\n * @return The next stage of the definition.\n */\n WithCreate withIpAddress(String ipAddress);\n }", "interface WithIPAddress {\n /**\n * Specifies the IP address of the local network gateway.\n *\n * @param ipAddress an IP address\n * @return the next stage of the definition\n */\n WithAddressSpace withIPAddress(String ipAddress);\n }", "interface WithPublicIpAddress {\n /**\n * Specifies the publicIpAddress property: The reference to the public IP resource..\n *\n * @param publicIpAddress The reference to the public IP resource.\n * @return the next definition stage.\n */\n WithCreate withPublicIpAddress(PublicIpAddressInner publicIpAddress);\n }", "IPin setAlias(String alias);", "@Override\r\n\tpublic String getLoginIP()\r\n\t{\n\t\treturn loginIp;\r\n\t}", "public void setIp2(String ip2);", "public void insert_public_ip(String ipAddress) {\n\t\tString sql = \"insert public_ip (ip,date) values ('\"+ipAddress+\"',Convert(char(19),getdate(),120))\";\r\n\t\trssDao.update(sql);\r\n\t}", "public UserBuilder ipAddress(String ipAddress) {\n this.nestedIpValue = ipAddress;\n return this;\n }", "IPNetwork createIPNetwork();", "public void setIpAddress(String ip) {\n this.ipAddress = ip;\n }", "void setIP(String ip);", "public String myIpAddressEx();", "public abstract InetAddress getIpAdress();", "public void setIpUser(String ip){\n \tthis.ipUser=ip;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Auto generated getter method
public boolean getShowStatsToStudent(){ return localShowStatsToStudent; }
[ "public MethodDoc getGetter()\r\n {\r\n return m_jvdGetter;\r\n }", "public long getGetter() {\n return getter_;\n }", "public T get() {\n return value;\n }", "public abstract M get();", "@Override\n \tpublic String get() {\n \t\treturn null;\n \t}", "public Object get() {\n return toString();\n }", "public Getter get() {\n\t\treturn new TestGetter();\r\n\t}", "abstract int get();", "public String getCodigo()\r\n/* 105: */ {\r\n/* 106: 94 */ return this.codigo;\r\n/* 107: */ }", "public String get (String name);", "public abstract A get();", "public T get() {\n return get(getLanguage(), false);\n }", "public Producto getProducto()\r\n/* 103: */ {\r\n/* 104:116 */ return this.producto;\r\n/* 105: */ }", "public int getFoo() { return 3; }", "public String getNombre()\r\n/* 70: */ {\r\n/* 71: 72 */ return this.nombre;\r\n/* 72: */ }", "@Override\n\tpublic void get(String property) {\n\t\t\n\t}", "@Override\n\tpublic String get() {\n\t\treturn _get(String.class);\n\t}", "public Empresa getEmpresa()\r\n/* 238: */ {\r\n/* 239:380 */ return this.empresa;\r\n/* 240: */ }", "@Override\n public A get() {\n return value;\n }", "@Override\n public T get() {\n return (T) build();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the element to the beginning of the free list. The caller of this method needs to synchronize on freeQueueLock
private void addToFreeList(TimerCommand tc) { // Add command to the beginning of the free list. tc.next = freeQueueHead; freeQueueHead = tc; // Null out user object references (so the VM does not hold them). tc.context = null; tc.callbackObject = null; }
[ "public void addFirst(T item) {\n if (isFull()) {\n resize(capacity * REFACTOR);\n }\n items[nextFirst] = item;\n nextFirst--;\n // check after minus\n nextFirst = checkNext(nextFirst);\n size++;\n\n }", "public void enqueue(Object elem){\n insertAtBack(elem);\n }", "public void addFirst(E element) {\r\n\t\tif (element.equals(null))\r\n\t\t\tthrow new NullPointerException();\r\n\t\tif (size == deque.length)\r\n\t\t\tresize();\r\n\t\tfront = (front - 1 + deque.length) % deque.length;\r\n\t\tdeque[front] = element;\r\n\t\tsize++;\r\n\t}", "public void enqueue(Element elementToAdd) {\n Element oldLast = last;\n // Set last reference to new elementToAdd\n last = elementToAdd;\n if (first == null) {\n // If is empty there will be only one elementToAdd which will be first and last in same time\n first = last;\n } else {\n // Not empty -> oldLast elementToAdd next reference to new last (elementToAdd)\n oldLast.setNext(last);\n }\n count++;\n }", "public Object enqueue(Object element) {\r\n items.add(element);\r\n return element;\r\n }", "@Override\n\tpublic void enqueue(E element) {\n\t\tif (size() == capacity) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tlist.add(element);\n\t}", "public void enqueue(Object el) {\n ensureCapacity(size++);\n elements[finish] = el;\n finish = (finish + 1) % elements.length;\n }", "public void enqueue(E e) {\n list.addLast(e);\n }", "public void addFirst(T item) {\n sentinel.after = new Deque(sentinel, item, sentinel.after);\n sentinel.after.after.pre = sentinel.after;\n size+=1;\n }", "public static void enqueue(Object element) {\n ensureCapacity(nsize + 1);\n elements[(start + nsize++) % elements.length] = element;\n }", "public void enqueue(Object next) {\r\n\t\tsuper.insert(next, super.size());\r\n\t}", "@Override\r\n\tpublic void enqueue(E elem) {\r\n\t\tensureCapacity();\r\n\t\trear = (rear + 1) % data.length;\r\n\t\tdata[rear] = elem;\r\n\t\tsize++;\r\n\t}", "public void addFirst(T item) {\n if (size == items.length) {\n resize(size * 2);\n }\n if (nextFirst == -1) {\n nextFirst = items.length - 1;\n }\n items[nextFirst] = item;\n nextFirst -= 1;\n size += 1;\n }", "public void add(T elem) {\n queue[queueSize] = elem;\n shuffleUp();\n queueSize++;\n }", "public void enqueue(Object newItem){\n Spot J = front;\n if(queueLength>0){\n while(J.next!=null){\n J=J.next;\n }\n J.next = new Spot(newItem);\n queueLength++;\n return;\n }else{\n front = new Spot(newItem);\n queueLength++;\n }\n }", "public void enqueueIfNew(TypeElement element) {\n if (element != null && !this.shouldIgnore(element)) {\r\n this.queue.add(element);\r\n }\r\n }", "private Integer enqueueToFront(Integer item) {\n LOG(\"[BidirectionQueue] enqueueToFront / item = \" + item);\n LOG(\"[BidirectionQueue] enqueueToFront / mItemList.size() = \" + mItemList.size());\n\n Integer dequeueItem = null;\n\n if (mItemList.size() >= QUEUE_SIZE) {\n dequeueItem = mItemList.removeLast();\n }\n\n mItemList.addFirst(item);\n\n // temp\n if (IS_SHOW_LOG) {\n tempShowAllItem();\n }\n\n return dequeueItem;\n }", "@Override\n\n\tpublic void enqueue(T newEntry) {\n\n\t\tif (getIndex(newEntry) < 0) {\n\n\t\t\tsuper.enqueue(newEntry);\n\n\t\t\tassert newEntry == queue[backIndex];\n\n\t\t}\n\n\t}", "@Override\n public void addFirst(T item) {\n if(size == items.length) {\n resize(size*2);\n }\n items[nextFirst] = item;\n size++;\n nextFirst = nextFirst(nextFirst);\n }", "public void enqueue(Object theElement)\n {\n\n\n\n if(((rear + 1) % queue.length) != front){\n\n MyArrayQueue newQueue = new MyArrayQueue( queue.length * 2 );\n\n for (int i = 0; i < queue.length; i++){\n\n newQueue.queue[i] = queue[i];\n\n }\n\n queue = newQueue.queue;\n queue[((rear + 1) % queue.length)] = theElement;\n rear = ((rear + 1) % queue.length);\n\n }\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Test with writeQuorum = majority
@Override public void executeTest() throws Exception { banner("Test with writeQuorum = majority"); ODatabaseDocument dbServer1 = getDatabase(0); // changing configuration: readQuorum=2, autoDeploy=false System.out.print("\nChanging configuration (autoDeploy=false)..."); ODocument cfg = null; ServerRun server = serverInstance.get(2); ODistributedPlugin manager = (ODistributedPlugin) server.getServerInstance().getDistributedManager(); ODistributedConfiguration databaseConfiguration = manager.getDatabaseConfiguration(getDatabaseName()); cfg = databaseConfiguration.getDocument(); System.out.println("\nConfiguration updated."); // inserting record r1 and checking consistency on all the servers try { dbServer1.activateOnCurrentThread(); System.out.print("Inserting record r1..."); new ODocument("Person") .fields("id", "R001", "firstName", "Luke", "lastName", "Skywalker") .save(); System.out.println("Done."); } catch (Exception e) { e.printStackTrace(); fail("Record r1 not inserted!."); } finally { dbServer1.close(); } waitForInsertedRecordPropagation("R001"); System.out.print("Checking consistency for record r1..."); ODocument r1onServer1 = retrieveRecord(serverInstance.get(0), "R001"); ODocument r1onServer2 = retrieveRecord(serverInstance.get(1), "R001"); ODocument r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); final ORecordId r1Rid = (ORecordId) r1onServer1.getIdentity(); assertEquals((Integer) r1onServer1.field("@version"), (Integer) r1onServer2.field("@version")); assertEquals((String) r1onServer1.field("id"), (String) r1onServer2.field("id")); assertEquals((String) r1onServer1.field("firstName"), (String) r1onServer2.field("firstName")); assertEquals((String) r1onServer1.field("lastName"), (String) r1onServer2.field("lastName")); assertEquals((Integer) r1onServer2.field("@version"), (Integer) r1onServer3.field("@version")); assertEquals((String) r1onServer2.field("id"), (String) r1onServer3.field("id")); assertEquals((String) r1onServer2.field("firstName"), (String) r1onServer3.field("firstName")); assertEquals((String) r1onServer2.field("lastName"), (String) r1onServer3.field("lastName")); System.out.println("\tDone."); // initial version of the record r1 int initialVersion = r1onServer1.field("@version"); // isolating server3 System.out.println("Network fault on server3.\n"); simulateServerFault(serverInstance.get(2), "net-fault"); assertFalse(serverInstance.get(2).isActive()); // updating r1 in r1* on server3 banner("Updating r1* on server3 (isolated from the the cluster)"); ODatabaseDocument dbServer3 = null; try { r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); dbServer3 = getDatabase(2); r1onServer3.field("firstName", "Darth"); r1onServer3.field("lastName", "Vader"); r1onServer3.save(); System.out.println(r1onServer3.getRecord().toString()); } catch (Exception e) { e.printStackTrace(); fail(); } finally { if (dbServer3 != null) dbServer3.close(); } // restarting server3 serverInstance .get(2) .startServer(getDistributedServerConfiguration(serverInstance.get(SERVERS - 1))); System.out.println("Server 3 restarted."); assertTrue(serverInstance.get(2).isActive()); // reading r1* on server3 dbServer3 = getDatabase(2); try { r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); } catch (Exception e) { e.printStackTrace(); } finally { dbServer3.activateOnCurrentThread(); dbServer3.close(); } // r1 was not modified both on server1 and server2 r1onServer1 = retrieveRecord(serverInstance.get(0), "R001"); r1onServer2 = retrieveRecord(serverInstance.get(1), "R001"); assertEquals(1, (int) r1onServer1.field("@version")); assertEquals("R001", (String) r1onServer1.field("id")); assertEquals("Luke", (String) r1onServer1.field("firstName")); assertEquals("Skywalker", (String) r1onServer1.field("lastName")); assertEquals((Integer) r1onServer1.field("@version"), (Integer) r1onServer2.field("@version")); assertEquals((String) r1onServer1.field("id"), r1onServer2.field("id")); assertEquals((String) r1onServer1.field("firstName"), r1onServer2.field("firstName")); assertEquals((String) r1onServer1.field("lastName"), r1onServer2.field("lastName")); // checking we have different values for r1* on server3 assertEquals("R001", (String) r1onServer3.field("id")); assertEquals("Darth", (String) r1onServer3.field("firstName")); assertEquals("Vader", (String) r1onServer3.field("lastName")); assertEquals(initialVersion + 1, (int) r1onServer3.field("@version")); // shutdown server1 System.out.println("Network fault on server1.\n"); simulateServerFault(serverInstance.get(0), "net-fault"); assertFalse(serverInstance.get(0).isActive()); // delete request on server3 for r1* dbServer3 = getDatabase(2); try { dbServer3.command(new OCommandSQL("delete from Person where @rid=#27:0")).execute(); } catch (Exception e) { System.out.println(e.getMessage()); } finally { dbServer3.close(); } // restarting server1 serverInstance.get(0).startServer(getDistributedServerConfiguration(serverInstance.get(0))); System.out.println("Server 1 restarted."); assertTrue(serverInstance.get(0).isActive()); // r1 is still present both on server1 and server2 r1onServer1 = retrieveRecord(serverInstance.get(0), "R001"); r1onServer2 = retrieveRecord(serverInstance.get(1), "R001"); assertEquals(1, (int) r1onServer1.field("@version")); assertEquals("R001", (String) r1onServer1.field("id")); assertEquals("Luke", (String) r1onServer1.field("firstName")); assertEquals("Skywalker", (String) r1onServer1.field("lastName")); assertEquals(r1onServer1.field("@version"), r1onServer2.field("@version")); assertEquals(r1onServer1.field("id"), r1onServer2.field("id")); assertEquals(r1onServer1.field("firstName"), r1onServer2.field("firstName")); assertEquals(r1onServer1.field("lastName"), r1onServer2.field("lastName")); // r1* is still present on server3 r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); assertEquals(2, (int) r1onServer3.field("@version")); assertEquals("R001", (String) r1onServer3.field("id")); assertEquals("Darth", (String) r1onServer3.field("firstName")); assertEquals("Vader", (String) r1onServer3.field("lastName")); // delete request on server1 for r1 dbServer1 = getDatabase(0); try { Integer result = dbServer1.command(new OCommandSQL("delete from " + r1Rid)).execute(); } catch (Exception e) { e.printStackTrace(); } finally { dbServer1.close(); } // r1 is no more present neither on server1, server2 nor server3 r1onServer1 = retrieveRecord( serverInstance.get(0), "R001", true, new OCallable<ODocument, ODocument>() { @Override public ODocument call(ODocument doc) { assertEquals(MISSING_DOCUMENT, doc); return null; } }); r1onServer2 = retrieveRecord( serverInstance.get(1), "R001", true, new OCallable<ODocument, ODocument>() { @Override public ODocument call(ODocument doc) { assertEquals(MISSING_DOCUMENT, doc); return null; } }); r1onServer3 = retrieveRecord( serverInstance.get(2), "R001", true, new OCallable<ODocument, ODocument>() { @Override public ODocument call(ODocument doc) { assertEquals(MISSING_DOCUMENT, doc); return null; } }); }
[ "public void testStaleMasterNotHijackingMajority() throws Exception {\n final List<String> nodes = internalCluster().startNodes(3, Settings.builder()\n .put(LeaderChecker.LEADER_CHECK_TIMEOUT_SETTING.getKey(), \"1s\")\n .put(Coordinator.PUBLISH_TIMEOUT_SETTING.getKey(), \"1s\")\n .build());\n ensureStableCluster(3);\n\n // Save the current master node as old master node, because that node will get frozen\n final String oldMasterNode = internalCluster().getMasterName();\n\n // Simulating a painful gc by suspending all threads for a long time on the current elected master node.\n SingleNodeDisruption masterNodeDisruption = new LongGCDisruption(random(), oldMasterNode);\n\n // Save the majority side\n final List<String> majoritySide = new ArrayList<>(nodes);\n majoritySide.remove(oldMasterNode);\n\n // Keeps track of the previous and current master when a master node transition took place on each node on the majority side:\n final Map<String, List<Tuple<String, String>>> masters = Collections.synchronizedMap(new HashMap<>());\n for (final String node : majoritySide) {\n masters.put(node, new ArrayList<>());\n internalCluster().getInstance(ClusterService.class, node).addListener(event -> {\n DiscoveryNode previousMaster = event.previousState().nodes().getMasterNode();\n DiscoveryNode currentMaster = event.state().nodes().getMasterNode();\n if (!Objects.equals(previousMaster, currentMaster)) {\n logger.info(\"--> node {} received new cluster state: {} \\n and had previous cluster state: {}\", node, event.state(),\n event.previousState());\n String previousMasterNodeName = previousMaster != null ? previousMaster.getName() : null;\n String currentMasterNodeName = currentMaster != null ? currentMaster.getName() : null;\n masters.get(node).add(new Tuple<>(previousMasterNodeName, currentMasterNodeName));\n }\n });\n }\n\n final CountDownLatch oldMasterNodeSteppedDown = new CountDownLatch(1);\n internalCluster().getInstance(ClusterService.class, oldMasterNode).addListener(event -> {\n if (event.state().nodes().getMasterNodeId() == null) {\n oldMasterNodeSteppedDown.countDown();\n }\n });\n\n internalCluster().setDisruptionScheme(masterNodeDisruption);\n logger.info(\"--> freezing node [{}]\", oldMasterNode);\n masterNodeDisruption.startDisrupting();\n\n // Wait for majority side to elect a new master\n assertBusy(() -> {\n for (final Map.Entry<String, List<Tuple<String, String>>> entry : masters.entrySet()) {\n final List<Tuple<String, String>> transitions = entry.getValue();\n assertTrue(entry.getKey() + \": \" + transitions,\n transitions.stream().anyMatch(transition -> transition.v2() != null));\n }\n });\n\n // The old master node is frozen, but here we submit a cluster state update task that doesn't get executed, but will be queued and\n // once the old master node un-freezes it gets executed. The old master node will send this update + the cluster state where it is\n // flagged as master to the other nodes that follow the new master. These nodes should ignore this update.\n internalCluster().getInstance(ClusterService.class, oldMasterNode).submitStateUpdateTask(\"sneaky-update\", new\n ClusterStateUpdateTask(Priority.IMMEDIATE) {\n @Override\n public ClusterState execute(ClusterState currentState) {\n return ClusterState.builder(currentState).build();\n }\n\n @Override\n public void onFailure(String source, Exception e) {\n logger.warn(() -> new ParameterizedMessage(\"failure [{}]\", source), e);\n }\n });\n\n // Save the new elected master node\n final String newMasterNode = internalCluster().getMasterName(majoritySide.get(0));\n logger.info(\"--> new detected master node [{}]\", newMasterNode);\n\n // Stop disruption\n logger.info(\"--> unfreezing node [{}]\", oldMasterNode);\n masterNodeDisruption.stopDisrupting();\n\n oldMasterNodeSteppedDown.await(30, TimeUnit.SECONDS);\n logger.info(\"--> [{}] stepped down as master\", oldMasterNode);\n ensureStableCluster(3);\n\n assertThat(masters.size(), equalTo(2));\n for (Map.Entry<String, List<Tuple<String, String>>> entry : masters.entrySet()) {\n String nodeName = entry.getKey();\n List<Tuple<String, String>> transitions = entry.getValue();\n assertTrue(\"[\" + nodeName + \"] should not apply state from old master [\" + oldMasterNode + \"] but it did: \" + transitions,\n transitions.stream().noneMatch(t -> oldMasterNode.equals(t.v2())));\n }\n }", "@Override\n public void applyWriteStrategy(Packet packet) {\n if (NodeManager.numberOfOnlineNode < NodeManager.numberOfNode - writeFactor) {\n System.out.println(ansi().eraseScreen().fg(RED) + \"number of online nodes :\" + NodeManager.numberOfOnlineNode + \" / \" + NodeManager.numberOfNode);\n System.out.println(\"Error, the number of online nodes is too small to run the QUORUM test\" + ansi().reset());\n System.exit(1);\n }\n\n //Get the sorted array of online nodes, with write-mode\n nodeArray = deleteCurrentNodeAndBubbleSort(NodeManager.nodeList.toArray(new Node[NodeManager.nodeList.size()]), 'w');\n WriteRequestPacket pac = (WriteRequestPacket) packet;\n SimulatorEvent simulatorEvent = new SimulatorEvent() {\n @Override\n public void go() {\n SimulatorEvent simulatorEvent1 = new SimulatorEvent() {\n @Override\n public void go() {\n Packet backPacket = new ResponsePacket(pac.getDataId(), \"wn\", null, pac.getTimestamp());\n int dataVersion = pac.getDataToWrite().getVersionstamp();\n\n //variable \"result\" means whether this quorum operation succeed or not\n boolean result = true;\n\n //the quorum operation begins\n if (dataMap.get(pac.getDataId()) != null && dataVersion <= dataMap.get(pac.getDataId()).getVersionstamp()) {\n result = false;\n }\n for (int i = writeFactor - 1; i > -1; i--) {\n if (nodeArray[i].getDataMap().get(pac.getDataId()) != null && dataVersion <= nodeArray[i].dataMap.get(pac.getDataId()).getVersionstamp()) {\n result = false;\n }\n }\n System.out.println(ansi().eraseScreen().fg(YELLOW) + \"Time \" + Simulator.currentTime + \": The write quorum of data \" + pac.getDataId() + \" for client \" + pac.getSourceId() + \" ended\" + ansi().reset());\n if (result) {\n dataMap.put(pac.getDataId(), pac.getDataToWrite());\n for (int i = writeFactor - 1; i > -1; i--) {\n nodeArray[i].getDataMap().put(pac.getDataId(), pac.getDataToWrite());\n }\n System.out.println(ansi().eraseScreen().fg(GREEN) + \" Write Quorum of data \" + pac.getDataId() + \" succeed\" + ansi().reset() + \", \" + ansi().eraseScreen().fg(BLUE) + \"the current datavion in node(s): \" + pac.getDataToWrite().getVersionstamp() + ansi().reset());\n backPacket = new ResponsePacket(pac.getDataId(), \"wk\", null, pac.getTimestamp());\n } else {\n System.out.println(ansi().eraseScreen().fg(RED) + \" The dataversion of data \" + pac.getDataId() + \" was lower than expected in one(or more) of the nodes \" + ansi().reset());\n }\n backPacket.setSourceId(getNodeId());\n System.out.println(\" Node \" + QuorumNode.this.getNodeId() + \" sent a packet back to client \" + pac.getSourceId() + \" (\" + getDelay() / 2 + \"ms)\");\n Network.transferPacket(backPacket, QuorumNode.this, ClientManager.getClientWithClientId(pac.getSourceId()));\n }\n };\n\n //calculate how long this quorum operation will cost.\n //we take the longst load between the target node and the current node as the quorumTime (including random delay during the network transfer)\n quorumTime = Math.abs(nodeArray[writeFactor - 1].getDelay() - getDelay()) * 2 + new Random().nextInt(Network.maximumRandomNetworkDelay) + processingTime;\n System.out.println(ansi().eraseScreen().fg(YELLOW) + \"Time \" + Simulator.currentTime + \": Node \" + nodeId + \" strated the write quorum of data \" + pac.getDataId() + \" for client \" + pac.getSourceId() + \" (\" + quorumTime + \"ms)\" + ansi().reset());\n\n //print all nodes that participate in the operation\n for (int i = 0; i < writeFactor; i++) {\n System.out.println(\" The Data from Node \" + nodeArray[i].getNodeId() + \" was received\");\n }\n simulatorEvent1.setTime(quorumTime + Simulator.currentTime);\n Simulator.addEvent(simulatorEvent1);\n Simulator.currentTime++;\n }\n };\n simulatorEvent.setTime(Simulator.currentTime + processingTime);\n Simulator.addEvent(simulatorEvent);\n Simulator.currentTime++;\n }", "@Test\n public void testCompactionOnceWithUnseq() throws SQLException {\n int prevSeqLevelFileNum = IoTDBDescriptor.getInstance().getConfig().getSeqFileNumInEachLevel();\n int prevSeqLevelNum = IoTDBDescriptor.getInstance().getConfig().getSeqLevelNum();\n IoTDBDescriptor.getInstance().getConfig().setSeqFileNumInEachLevel(2);\n IoTDBDescriptor.getInstance().getConfig().setSeqLevelNum(3);\n try (Connection connection =\n DriverManager.getConnection(\n Config.IOTDB_URL_PREFIX + \"127.0.0.1:6667/\", \"root\", \"root\");\n Statement statement = connection.createStatement()) {\n statement.execute(\"SET STORAGE GROUP TO root.compactionTest\");\n for (int i = 1; i <= 3; i++) {\n try {\n statement.execute(\n \"CREATE TIMESERIES root.compactionTest.s\"\n + i\n + \" WITH DATATYPE=INT64,\"\n + \"ENCODING=PLAIN\");\n } catch (SQLException e) {\n // ignore\n }\n }\n\n statement.execute(\n String.format(\n \"INSERT INTO root.compactionTest(timestamp,s1,s2,s3) VALUES (%d,%d,\" + \"%d,%d)\",\n 1, 2, 3, 4));\n statement.execute(\"FLUSH\");\n statement.execute(\n String.format(\n \"INSERT INTO root.compactionTest(timestamp,s1,s2,s3) VALUES (%d,%d,\" + \"%d,%d)\",\n 0, 1, 2, 3));\n statement.execute(\"FLUSH\");\n\n int cnt;\n try (ResultSet resultSet = statement.executeQuery(\"SELECT * FROM root.compactionTest\")) {\n cnt = 0;\n while (resultSet.next()) {\n long time = resultSet.getLong(\"Time\");\n long s1 = resultSet.getLong(\"root.compactionTest.s1\");\n long s2 = resultSet.getLong(\"root.compactionTest.s2\");\n long s3 = resultSet.getLong(\"root.compactionTest.s3\");\n assertEquals(time + 1, s1);\n assertEquals(time + 2, s2);\n assertEquals(time + 3, s3);\n cnt++;\n }\n }\n assertEquals(2, cnt);\n }\n IoTDBDescriptor.getInstance().getConfig().setSeqFileNumInEachLevel(prevSeqLevelFileNum);\n IoTDBDescriptor.getInstance().getConfig().setSeqLevelNum(prevSeqLevelNum);\n }", "@Test\n public void testProgressiveReconcile() throws Exception {\n final WriterConfig config = DEFAULT_CONFIG;\n final int appendCount = 1000;\n final int failEvery = 3;\n final int maxFlushLoopCount = 5;\n\n @Cleanup\n TestContext context = new TestContext(config);\n context.storage.create(context.segmentAggregator.getMetadata().getName(), TIMEOUT).join();\n context.segmentAggregator.initialize(TIMEOUT).join();\n\n @Cleanup\n ByteArrayOutputStream writtenData = new ByteArrayOutputStream();\n ArrayList<StorageOperation> appendOperations = new ArrayList<>();\n ArrayList<InputStream> appendData = new ArrayList<>();\n for (int i = 0; i < appendCount; i++) {\n // Add another operation and record its length.\n StorageOperation appendOp = generateAppendAndUpdateMetadata(i, SEGMENT_ID, context);\n appendOperations.add(appendOp);\n val adStream = new ByteBufferOutputStream((int) appendOp.getLength());\n getAppendData(appendOp, adStream, context);\n appendData.add(adStream.getData().getReader());\n writtenData.write(adStream.getData().getCopy());\n }\n\n // Add each operation at at time, and every X appends, write ahead to storage (X-1 appends). This will force a\n // good mix of reconciles and normal appends.\n int errorCount = 0;\n int flushCount = 0;\n for (int i = 0; i < appendOperations.size(); i++) {\n StorageOperation op = appendOperations.get(i);\n context.segmentAggregator.add(op);\n if (i % failEvery == 0) {\n // Corrupt the storage by adding the next failEvery-1 ops to Storage.\n for (int j = i; j < i + failEvery - 1 && j < appendOperations.size(); j++) {\n long offset = context.storage.getStreamSegmentInfo(SEGMENT_NAME, TIMEOUT).join().getLength();\n context.storage.write(writeHandle(SEGMENT_NAME), offset, appendData.get(j), appendData.get(j).available(), TIMEOUT).join();\n }\n }\n\n context.increaseTime(config.getFlushThresholdTime().toMillis() + 1); // Force a flush by incrementing the time by a lot.\n int flushLoopCount = 0;\n while (context.segmentAggregator.mustFlush()) {\n try {\n flushCount++;\n context.segmentAggregator.flush(TIMEOUT).get(TIMEOUT.toMillis(), TimeUnit.MILLISECONDS);\n } catch (Exception ex) {\n errorCount++;\n Assert.assertTrue(\"\", Exceptions.unwrap(ex) instanceof BadOffsetException);\n }\n\n flushLoopCount++;\n AssertExtensions.assertLessThan(\"Too many flush-loops for a single attempt.\", maxFlushLoopCount, flushLoopCount);\n }\n }\n\n AssertExtensions.assertGreaterThan(\"At least one flush was expected.\", 0, flushCount);\n AssertExtensions.assertGreaterThan(\"At least one BadOffsetException was expected.\", 0, errorCount);\n\n // Verify data.\n byte[] expectedData = writtenData.toByteArray();\n byte[] actualData = new byte[expectedData.length];\n long storageLength = context.storage.getStreamSegmentInfo(context.segmentAggregator.getMetadata().getName(), TIMEOUT).join().getLength();\n Assert.assertEquals(\"Unexpected number of bytes flushed to Storage.\", expectedData.length, storageLength);\n context.storage.read(readHandle(context.segmentAggregator.getMetadata().getName()), 0, actualData, 0, actualData.length, TIMEOUT).join();\n Assert.assertArrayEquals(\"Unexpected data written to storage.\", expectedData, actualData);\n }", "@Test\n public void testFinalizeFromSecondNameNodeWithJournalNodes() throws IOException, URISyntaxException {\n MiniQJMHACluster qjCluster = null;\n FileSystem fs = null;\n try {\n MiniQJMHACluster.Builder builder = new MiniQJMHACluster.Builder(conf);\n builder.getDfsBuilder().numDataNodes(0);\n qjCluster = builder.build();\n MiniDFSCluster cluster = qjCluster.getDfsCluster();\n // No upgrade is in progress at the moment.\n TestDFSUpgradeWithHA.checkJnPreviousDirExistence(qjCluster, false);\n TestDFSUpgradeWithHA.checkClusterPreviousDirExistence(cluster, false);\n TestDFSUpgradeWithHA.assertCTimesEqual(cluster);\n // Transition NN0 to active and do some FS ops.\n cluster.transitionToActive(0);\n fs = HATestUtil.configureFailoverFs(cluster, conf);\n Assert.assertTrue(fs.mkdirs(new Path(\"/foo1\")));\n // Do the upgrade. Shut down NN1 and then restart NN0 with the upgrade\n // flag.\n cluster.shutdownNameNode(1);\n cluster.getNameNodeInfos()[0].setStartOpt(UPGRADE);\n cluster.restartNameNode(0, false);\n TestDFSUpgradeWithHA.checkNnPreviousDirExistence(cluster, 0, true);\n TestDFSUpgradeWithHA.checkNnPreviousDirExistence(cluster, 1, false);\n TestDFSUpgradeWithHA.checkJnPreviousDirExistence(qjCluster, true);\n // Now bootstrap the standby with the upgraded info.\n int rc = BootstrapStandby.run(new String[]{ \"-force\" }, cluster.getConfiguration(1));\n Assert.assertEquals(0, rc);\n cluster.restartNameNode(1);\n // Make the second NN (not the one that initiated the upgrade) active when\n // the finalize command is run.\n cluster.transitionToStandby(0);\n cluster.transitionToActive(1);\n runFinalizeCommand(cluster);\n TestDFSUpgradeWithHA.checkClusterPreviousDirExistence(cluster, false);\n TestDFSUpgradeWithHA.checkJnPreviousDirExistence(qjCluster, false);\n TestDFSUpgradeWithHA.assertCTimesEqual(cluster);\n } finally {\n if (fs != null) {\n fs.close();\n }\n if (qjCluster != null) {\n qjCluster.shutdown();\n }\n }\n }", "@Test\n public void testCompactionToSecondLevelNoUnseq() throws SQLException {\n this.testCompactionNoUnseq(4);\n }", "@Test\n public void testAppendMergeAfterDeserializeMerge() throws SQLException {\n boolean prevEnableUnseqCompaction =\n IoTDBDescriptor.getInstance().getConfig().isEnableUnseqCompaction();\n int prevSeqLevelFileNum = IoTDBDescriptor.getInstance().getConfig().getSeqFileNumInEachLevel();\n int prevSeqLevelNum = IoTDBDescriptor.getInstance().getConfig().getSeqLevelNum();\n IoTDBDescriptor.getInstance().getConfig().setSeqFileNumInEachLevel(2);\n IoTDBDescriptor.getInstance().getConfig().setSeqLevelNum(3);\n IoTDBDescriptor.getInstance().getConfig().setEnableUnseqCompaction(false);\n try (Connection connection =\n DriverManager.getConnection(\n Config.IOTDB_URL_PREFIX + \"127.0.0.1:6667/\", \"root\", \"root\");\n Statement statement = connection.createStatement()) {\n statement.execute(\"SET STORAGE GROUP TO root.compactionTest\");\n try {\n statement.execute(\"CREATE TIMESERIES root.compactionTest.s1 WITH DATATYPE=INT64\");\n } catch (SQLException e) {\n // ignore\n }\n\n long pageSize = 100;\n long timestamp = 1;\n\n for (long row = 0; row < 10000; row++) {\n statement.execute(\n String.format(\n \"INSERT INTO root.compactionTest(timestamp,s1) VALUES (%d,%d)\", timestamp, 1));\n if (row % pageSize == 0) {\n statement.execute(\"FLUSH\");\n }\n timestamp++;\n }\n\n timestamp = 8322;\n\n for (long row = 0; row < 2400; row++) {\n statement.execute(\n String.format(\n \"INSERT INTO root.compactionTest(timestamp,s1) VALUES (%d,%d)\", timestamp, 1));\n if (row % pageSize == 0) {\n statement.execute(\"FLUSH\");\n }\n timestamp++;\n }\n\n int cnt;\n try (ResultSet resultSet =\n statement.executeQuery(\"SELECT COUNT(s1) FROM root.compactionTest\")) {\n cnt = 0;\n while (resultSet.next()) {\n System.out.println(resultSet.getLong(1));\n assertEquals(10721, resultSet.getLong(1));\n cnt++;\n }\n }\n assertEquals(1, cnt);\n }\n IoTDBDescriptor.getInstance().getConfig().setSeqFileNumInEachLevel(prevSeqLevelFileNum);\n IoTDBDescriptor.getInstance().getConfig().setSeqLevelNum(prevSeqLevelNum);\n IoTDBDescriptor.getInstance().getConfig().setEnableUnseqCompaction(prevEnableUnseqCompaction);\n }", "static boolean beHonest() throws IOException {\n \n // Get an initial value\n boolean consensus = RNG.nextBoolean();\n\n for (int phase = 0; phase < phaseCount; phase++) {\n\n // Round 1\n // All nodes share their consensus\n boolean[] groupValues = new boolean[nodeCount];\n for (int i = 0; i < nodeCount; i++) {\n if (i == identifier - 1) continue;\n peers[i].getOutputStream().write(consensus ? 1 : 0);\n groupValues[i] = peers[i].getInputStream().read() == 1;\n }\n groupValues[identifier - 1] = consensus;\n\n // Compute the majority\n int trueCount = 0;\n int falseCount = 0;\n for (boolean groupValue : groupValues) if (groupValue) trueCount++; else falseCount++;\n boolean majority = trueCount > falseCount;\n int majCount = majority ? trueCount : falseCount;\n if (verbose) System.out.format(\"(PHASE %d - ROUND 1) Holding value: %b, majority: %b (%d occurrences)\\n\", phase + 1, consensus, majority, majCount);\n sync(210);\n\n\n // Round 2\n // If this node is king, send its majority to everybody else as the tiebreaker, otherwise listen and decide\n if (phase == identifier - 1) {\n if (verbose) System.out.format(\"(PHASE %d - ROUND 2) I am King, sending tiebreaker: %b\\n\", phase + 1, majority);\n for (int i = 0; i < nodeCount; i++) {\n if (i == identifier - 1) continue;\n peers[i].getOutputStream().write(majority ? 1 : 0);\n }\n consensus = majority; // majority and tiebreaker will be subjectively the same anyways\n }\n else {\n boolean tiebreaker = peers[phase].getInputStream().read() == 1;\n if (majCount > nodeCount / 2 + maxByzantine) {\n if (verbose) System.out.format(\"(PHASE %d - ROUND 2) High consensus, choosing majority: %b\\n\", phase + 1, majority);\n consensus = majority;\n }\n else {\n if (verbose) System.out.format(\"(PHASE %d - ROUND 2) Consensus not high enough, choosing tiebreaker: %b\\n\", phase + 1, tiebreaker);\n consensus = tiebreaker;\n }\n }\n sync(210);\n }\n \n return consensus;\n }", "@Test(timeout = 180000)\n public void testSelectiveFlushWhenEnabledAndWALinCompaction() throws IOException {\n Configuration conf = HBaseConfiguration.create();\n conf.setLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, 600 * 1024);\n conf.set(FlushPolicyFactory.HBASE_FLUSH_POLICY_KEY, FlushNonSloppyStoresFirstPolicy.class\n .getName());\n conf.setLong(FlushLargeStoresPolicy.HREGION_COLUMNFAMILY_FLUSH_SIZE_LOWER_BOUND_MIN, 200 *\n 1024);\n conf.setDouble(CompactingMemStore.IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY, 0.5);\n\n // Intialize the HRegion\n HRegion region = initHRegion(\"testSelectiveFlushWhenNotEnabled\", conf);\n // Add 1200 entries for CF1, 100 for CF2 and 50 for CF3\n for (int i = 1; i <= 1200; i++) {\n region.put(createPut(1, i));\n if (i <= 100) {\n region.put(createPut(2, i));\n if (i <= 50) {\n region.put(createPut(3, i));\n }\n }\n }\n // Now add more puts for CF2, so that we only flush CF2 to disk\n for (int i = 100; i < 2000; i++) {\n region.put(createPut(2, i));\n }\n\n long totalMemstoreSize = region.getMemstoreSize();\n\n // Find the sizes of the memstores of each CF.\n long cf1MemstoreSizePhaseI = region.getStore(FAMILY1).getMemStoreSize();\n long cf2MemstoreSizePhaseI = region.getStore(FAMILY2).getMemStoreSize();\n long cf3MemstoreSizePhaseI = region.getStore(FAMILY3).getMemStoreSize();\n\n // Some other sanity checks.\n assertTrue(cf1MemstoreSizePhaseI > 0);\n assertTrue(cf2MemstoreSizePhaseI > 0);\n assertTrue(cf3MemstoreSizePhaseI > 0);\n\n // The total memstore size should be the same as the sum of the sizes of\n // memstores of CF1, CF2 and CF3.\n String msg = \"totalMemstoreSize=\"+totalMemstoreSize +\n \" DefaultMemStore.DEEP_OVERHEAD=\"+DefaultMemStore.DEEP_OVERHEAD +\n \" cf1MemstoreSizePhaseI=\"+cf1MemstoreSizePhaseI +\n \" cf2MemstoreSizePhaseI=\"+cf2MemstoreSizePhaseI +\n \" cf3MemstoreSizePhaseI=\"+cf3MemstoreSizePhaseI ;\n assertEquals(msg,\n totalMemstoreSize + 2 * (CompactingMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD)\n + (DefaultMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD),\n cf1MemstoreSizePhaseI + cf2MemstoreSizePhaseI + cf3MemstoreSizePhaseI);\n\n // Flush!\n ((CompactingMemStore) region.getStore(FAMILY1).getMemStore()).flushInMemory();\n ((CompactingMemStore) region.getStore(FAMILY3).getMemStore()).flushInMemory();\n region.flush(false);\n\n long cf2MemstoreSizePhaseII = region.getStore(FAMILY2).getMemStoreSize();\n\n long smallestSeqInRegionCurrentMemstorePhaseII =\n region.getWAL().getEarliestMemstoreSeqNum(region.getRegionInfo().getEncodedNameAsBytes());\n long smallestSeqCF1PhaseII = region.getOldestSeqIdOfStore(FAMILY1);\n long smallestSeqCF2PhaseII = region.getOldestSeqIdOfStore(FAMILY2);\n long smallestSeqCF3PhaseII = region.getOldestSeqIdOfStore(FAMILY3);\n\n // CF2 should have been cleared\n assertEquals(DefaultMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD,\n cf2MemstoreSizePhaseII);\n\n String s = \"\\n\\n----------------------------------\\n\"\n + \"Upon initial insert and flush, LSN of CF1 is:\"\n + smallestSeqCF1PhaseII + \". LSN of CF2 is:\"\n + smallestSeqCF2PhaseII + \". LSN of CF3 is:\"\n + smallestSeqCF3PhaseII + \", smallestSeqInRegionCurrentMemstore:\"\n + smallestSeqInRegionCurrentMemstorePhaseII + \"\\n\";\n\n // Add same entries to compact them later\n for (int i = 1; i <= 1200; i++) {\n region.put(createPut(1, i));\n if (i <= 100) {\n region.put(createPut(2, i));\n if (i <= 50) {\n region.put(createPut(3, i));\n }\n }\n }\n // Now add more puts for CF2, so that we only flush CF2 to disk\n for (int i = 100; i < 2000; i++) {\n region.put(createPut(2, i));\n }\n\n long smallestSeqInRegionCurrentMemstorePhaseIII =\n region.getWAL().getEarliestMemstoreSeqNum(region.getRegionInfo().getEncodedNameAsBytes());\n long smallestSeqCF1PhaseIII = region.getOldestSeqIdOfStore(FAMILY1);\n long smallestSeqCF2PhaseIII = region.getOldestSeqIdOfStore(FAMILY2);\n long smallestSeqCF3PhaseIII = region.getOldestSeqIdOfStore(FAMILY3);\n\n s = s + \"The smallest sequence in region WAL is: \" + smallestSeqInRegionCurrentMemstorePhaseIII\n + \", the smallest sequence in CF1:\" + smallestSeqCF1PhaseIII + \", \" +\n \"the smallest sequence in CF2:\"\n + smallestSeqCF2PhaseIII +\", the smallest sequence in CF3:\" + smallestSeqCF3PhaseIII + \"\\n\";\n\n // Flush!\n ((CompactingMemStore) region.getStore(FAMILY1).getMemStore()).flushInMemory();\n ((CompactingMemStore) region.getStore(FAMILY3).getMemStore()).flushInMemory();\n region.flush(false);\n\n long smallestSeqInRegionCurrentMemstorePhaseIV =\n region.getWAL().getEarliestMemstoreSeqNum(region.getRegionInfo().getEncodedNameAsBytes());\n long smallestSeqCF1PhaseIV = region.getOldestSeqIdOfStore(FAMILY1);\n long smallestSeqCF2PhaseIV = region.getOldestSeqIdOfStore(FAMILY2);\n long smallestSeqCF3PhaseIV = region.getOldestSeqIdOfStore(FAMILY3);\n\n s = s + \"The smallest sequence in region WAL is: \" + smallestSeqInRegionCurrentMemstorePhaseIV\n + \", the smallest sequence in CF1:\" + smallestSeqCF1PhaseIV + \", \" +\n \"the smallest sequence in CF2:\"\n + smallestSeqCF2PhaseIV +\", the smallest sequence in CF3:\" + smallestSeqCF3PhaseIV + \"\\n\";\n\n // now check that the LSN of the entire WAL, of CF1 and of CF3 has progressed due to compaction\n assertTrue(s, smallestSeqInRegionCurrentMemstorePhaseIV >\n smallestSeqInRegionCurrentMemstorePhaseIII);\n assertTrue(smallestSeqCF1PhaseIV > smallestSeqCF1PhaseIII);\n assertTrue(smallestSeqCF3PhaseIV > smallestSeqCF3PhaseIII);\n\n HBaseTestingUtility.closeRegionAndWAL(region);\n }", "boolean promoteToWrite();", "@Test\n public void test2RWsShouldCompeteForReplicationOf2FragmentsAndCompleteReplication()\n throws Exception {\n LedgerHandle lh = bkc.createLedger(2, 2, BookKeeper.DigestType.CRC32,\n TESTPASSWD);\n\n for (int i = 0; i < 10; i++) {\n lh.addEntry(data);\n }\n lh.close();\n BookieSocketAddress replicaToKill = lh.getLedgerMetadata().getAllEnsembles().get(0L).get(0);\n LOG.info(\"Killing Bookie\", replicaToKill);\n ServerConfiguration killedBookieConfig = killBookie(replicaToKill);\n\n killAllBookies(lh, null);\n // Starte RW1\n BookieSocketAddress newBkAddr1 = startNewBookieAndReturnAddress();\n LOG.info(\"New Bookie addr : {}\", newBkAddr1);\n ReplicationWorker rw1 = new ReplicationWorker(baseConf);\n\n // Starte RW2\n BookieSocketAddress newBkAddr2 = startNewBookieAndReturnAddress();\n LOG.info(\"New Bookie addr : {}\", newBkAddr2);\n ReplicationWorker rw2 = new ReplicationWorker(baseConf);\n rw1.start();\n rw2.start();\n\n try {\n underReplicationManager.markLedgerUnderreplicated(lh.getId(),\n replicaToKill.toString());\n int counter = 10;\n while (counter-- > 0) {\n assertTrue(\"Expecting that replication should not complete\",\n ReplicationTestUtil.isLedgerInUnderReplication(zkc, lh\n .getId(), basePath));\n Thread.sleep(100);\n }\n // restart killed bookie\n bs.add(startBookie(killedBookieConfig));\n bsConfs.add(killedBookieConfig);\n while (ReplicationTestUtil.isLedgerInUnderReplication(zkc, lh\n .getId(), basePath)) {\n Thread.sleep(100);\n }\n // Should be able to read the entries from 0-9\n verifyRecoveredLedgers(lh, 0, 9);\n } finally {\n rw1.shutdown();\n rw2.shutdown();\n }\n }", "boolean waitForQuorum(long id) throws InterruptedException {\n int loopCounter = 0;\n while ((quora.get(id).size() <= count / 2) && (loopCounter < MAX_LOOP_COUNTER)) {\n Thread.sleep(100);\n loopCounter++;\n }\n\n return (loopCounter < MAX_LOOP_COUNTER) || (quora.get(id).size() > count / 2);\n }", "@Test\n public void testMany() throws Exception {\n SortedSet<Text> splits = new TreeSet<>();\n for (int i = 1; i < 100; i++) {\n splits.add(new Text(String.format(\"%05x\", i * 100)));\n }\n\n ServerContext context = getServerContext();\n\n try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {\n String[] tableNames = getUniqueNames(2);\n\n String manyWALsTable = tableNames[0];\n String rollWALsTable = tableNames[1];\n\n NewTableConfiguration ntc = new NewTableConfiguration().withSplits(splits);\n c.tableOperations().create(manyWALsTable, ntc);\n\n c.tableOperations().create(rollWALsTable);\n\n Set<String> allWalsSeen = new HashSet<>();\n\n addOpenWals(context, allWalsSeen);\n\n // This test creates the table manyWALsTable with a lot of tablets and writes a little bit to\n // each tablet. In between writing a little bit to each tablet a lot of data is written to\n // another table called rollWALsTable. Writing a lot causes the write ahead logs to roll. This\n // write pattern should cause the tablets in the manyWALsTable table to reference many closed\n // WALs. If nothing is done about all of these closed WALs, then it could cause a large burden\n // at recovery time.\n\n try (BatchWriter manyWALsWriter = c.createBatchWriter(manyWALsTable);\n BatchWriter rollWALsWriter = c.createBatchWriter(rollWALsTable)) {\n\n byte[] val = new byte[768];\n\n for (int i = 0; i < 100; i++) {\n int startRow = i * 100;\n\n // write a small amount of data to each tablet in the table\n for (int j = 0; j < 10; j++) {\n int row = startRow + j;\n Mutation m = new Mutation(String.format(\"%05x\", row));\n RANDOM.get().nextBytes(val);\n m.put(\"f\", \"q\", \"v\");\n\n manyWALsWriter.addMutation(m);\n }\n manyWALsWriter.flush();\n\n // write a lot of data to second table to forces the logs to roll\n for (int j = 0; j < 1000; j++) {\n Mutation m = new Mutation(String.format(\"%03d\", j));\n RANDOM.get().nextBytes(val);\n\n m.put(\"f\", \"q\", Base64.getEncoder().encodeToString(val));\n\n rollWALsWriter.addMutation(m);\n }\n\n rollWALsWriter.flush();\n\n // keep track of the open WALs as the test runs. Should see a lot of open WALs over the\n // lifetime of the test, but never a lot at any one time.\n addOpenWals(context, allWalsSeen);\n }\n }\n\n assertTrue(allWalsSeen.size() >= 50,\n \"Number of WALs seen was less than expected \" + allWalsSeen.size());\n\n // the total number of closed write ahead logs should get small\n int closedLogs = countClosedWals(context);\n while (closedLogs > 3) {\n log.debug(\"Waiting for wals to shrink \" + closedLogs);\n Thread.sleep(250);\n closedLogs = countClosedWals(context);\n }\n }\n }", "@Test\n public void testConcurrentWriteOps() throws Exception {\n final TestTableProcSet procSet = new TestTableProcSet(queue);\n\n final int NUM_ITEMS = 10;\n final int NUM_TABLES = 4;\n final AtomicInteger opsCount = new AtomicInteger(0);\n for (int i = 0; i < NUM_TABLES; ++i) {\n TableName tableName = TableName.valueOf(String.format(\"testtb-%04d\", i));\n for (int j = 1; j < NUM_ITEMS; ++j) {\n procSet.addBack(new TestTableProcedure(i * 100 + j, tableName,\n TableProcedureInterface.TableOperationType.EDIT));\n opsCount.incrementAndGet();\n }\n }\n assertEquals(opsCount.get(), queue.size());\n\n final Thread[] threads = new Thread[NUM_TABLES * 2];\n final HashSet<TableName> concurrentTables = new HashSet<>();\n final ArrayList<String> failures = new ArrayList<>();\n final AtomicInteger concurrentCount = new AtomicInteger(0);\n for (int i = 0; i < threads.length; ++i) {\n threads[i] = new Thread() {\n @Override\n public void run() {\n while (opsCount.get() > 0) {\n try {\n Procedure proc = procSet.acquire();\n if (proc == null) {\n queue.signalAll();\n if (opsCount.get() > 0) {\n continue;\n }\n break;\n }\n\n TableName tableId = procSet.getTableName(proc);\n synchronized (concurrentTables) {\n assertTrue(\"unexpected concurrency on \" + tableId, concurrentTables.add(tableId));\n }\n assertTrue(opsCount.decrementAndGet() >= 0);\n try {\n long procId = proc.getProcId();\n int concurrent = concurrentCount.incrementAndGet();\n assertTrue(\"inc-concurrent=\" + concurrent + \" 1 <= concurrent <= \" + NUM_TABLES,\n concurrent >= 1 && concurrent <= NUM_TABLES);\n LOG.debug(\n \"[S] tableId=\" + tableId + \" procId=\" + procId + \" concurrent=\" + concurrent);\n Thread.sleep(2000);\n concurrent = concurrentCount.decrementAndGet();\n LOG.debug(\n \"[E] tableId=\" + tableId + \" procId=\" + procId + \" concurrent=\" + concurrent);\n assertTrue(\"dec-concurrent=\" + concurrent, concurrent < NUM_TABLES);\n } finally {\n synchronized (concurrentTables) {\n assertTrue(concurrentTables.remove(tableId));\n }\n procSet.release(proc);\n }\n } catch (Throwable e) {\n LOG.error(\"Failed \" + e.getMessage(), e);\n synchronized (failures) {\n failures.add(e.getMessage());\n }\n } finally {\n queue.signalAll();\n }\n }\n }\n };\n threads[i].start();\n }\n for (int i = 0; i < threads.length; ++i) {\n threads[i].join();\n }\n assertTrue(failures.toString(), failures.isEmpty());\n assertEquals(0, opsCount.get());\n assertEquals(0, queue.size());\n\n for (int i = 1; i <= NUM_TABLES; ++i) {\n final TableName table = TableName.valueOf(String.format(\"testtb-%04d\", i));\n final TestTableProcedure dummyProc =\n new TestTableProcedure(100, table, TableProcedureInterface.TableOperationType.DELETE);\n assertTrue(\"queue should be deleted, table=\" + table,\n queue.markTableAsDeleted(table, dummyProc));\n }\n }", "@Test\n public void testCompactionOnceNoUnseq() throws SQLException {\n this.testCompactionNoUnseq(2);\n }", "@Test(timeout = 180000)\n public void testSelectiveFlushWhenEnabled() throws IOException {\n Configuration conf = HBaseConfiguration.create();\n conf.setLong(HConstants.HREGION_MEMSTORE_FLUSH_SIZE, 600 * 1024);\n conf.set(FlushPolicyFactory.HBASE_FLUSH_POLICY_KEY,\n FlushNonSloppyStoresFirstPolicy.class.getName());\n conf.setLong(FlushLargeStoresPolicy.HREGION_COLUMNFAMILY_FLUSH_SIZE_LOWER_BOUND_MIN, 200 * 1024);\n conf.setDouble(CompactingMemStore.IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY, 0.25);\n\n // Intialize the region\n Region region = initHRegion(\"testSelectiveFlushWhenEnabled\", conf);\n\n // Add 1200 entries for CF1, 100 for CF2 and 50 for CF3\n for (int i = 1; i <= 1200; i++) {\n region.put(createPut(1, i)); // compacted memstore, all the keys are unique\n\n if (i <= 100) {\n region.put(createPut(2, i));\n if (i <= 50) {\n // compacted memstore, subject for compaction due to duplications\n region.put(createDoublePut(3, i));\n }\n }\n }\n\n // Now add more puts for CF2, so that we only flush CF2 (DefaultMemStore) to disk\n for (int i = 100; i < 2000; i++) {\n region.put(createPut(2, i));\n }\n\n long totalMemstoreSize = region.getMemstoreSize();\n\n // Find the smallest LSNs for edits wrt to each CF.\n long smallestSeqCF1PhaseI = region.getOldestSeqIdOfStore(FAMILY1);\n long smallestSeqCF2PhaseI = region.getOldestSeqIdOfStore(FAMILY2);\n long smallestSeqCF3PhaseI = region.getOldestSeqIdOfStore(FAMILY3);\n\n // Find the sizes of the memstores of each CF.\n long cf1MemstoreSizePhaseI = region.getStore(FAMILY1).getMemStoreSize();\n long cf2MemstoreSizePhaseI = region.getStore(FAMILY2).getMemStoreSize();\n long cf3MemstoreSizePhaseI = region.getStore(FAMILY3).getMemStoreSize();\n\n // Get the overall smallest LSN in the region's memstores.\n long smallestSeqInRegionCurrentMemstorePhaseI = getWAL(region)\n .getEarliestMemstoreSeqNum(region.getRegionInfo().getEncodedNameAsBytes());\n\n String s = \"\\n\\n----------------------------------\\n\"\n + \"Upon initial insert and before any flush, size of CF1 is:\"\n + cf1MemstoreSizePhaseI + \", is CF1 compacted memstore?:\"\n + region.getStore(FAMILY1).getMemStore().isSloppy() + \". Size of CF2 is:\"\n + cf2MemstoreSizePhaseI + \", is CF2 compacted memstore?:\"\n + region.getStore(FAMILY2).getMemStore().isSloppy() + \". Size of CF3 is:\"\n + cf3MemstoreSizePhaseI + \", is CF3 compacted memstore?:\"\n + region.getStore(FAMILY3).getMemStore().isSloppy() + \"\\n\";\n\n // The overall smallest LSN in the region's memstores should be the same as\n // the LSN of the smallest edit in CF1\n assertEquals(smallestSeqCF1PhaseI, smallestSeqInRegionCurrentMemstorePhaseI);\n\n // Some other sanity checks.\n assertTrue(smallestSeqCF1PhaseI < smallestSeqCF2PhaseI);\n assertTrue(smallestSeqCF2PhaseI < smallestSeqCF3PhaseI);\n assertTrue(cf1MemstoreSizePhaseI > 0);\n assertTrue(cf2MemstoreSizePhaseI > 0);\n assertTrue(cf3MemstoreSizePhaseI > 0);\n\n // The total memstore size should be the same as the sum of the sizes of\n // memstores of CF1, CF2 and CF3.\n String msg = \"totalMemstoreSize=\"+totalMemstoreSize +\n \" DefaultMemStore.DEEP_OVERHEAD=\"+DefaultMemStore.DEEP_OVERHEAD +\n \" CompactingMemStore.DEEP_OVERHEAD=\"+CompactingMemStore.DEEP_OVERHEAD +\n \" cf1MemstoreSizePhaseI=\"+cf1MemstoreSizePhaseI +\n \" cf2MemstoreSizePhaseI=\"+cf2MemstoreSizePhaseI +\n \" cf3MemstoreSizePhaseI=\"+cf3MemstoreSizePhaseI ;\n assertEquals(msg,\n totalMemstoreSize + 2 * (CompactingMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD)\n + (DefaultMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD),\n cf1MemstoreSizePhaseI + cf2MemstoreSizePhaseI + cf3MemstoreSizePhaseI);\n\n // Flush!!!!!!!!!!!!!!!!!!!!!!\n // We have big compacting memstore CF1 and two small memstores:\n // CF2 (not compacted) and CF3 (compacting)\n // All together they are above the flush size lower bound.\n // Since CF1 and CF3 should be flushed to memory (not to disk),\n // CF2 is going to be flushed to disk.\n // CF1 - nothing to compact (but flattening), CF3 - should be twice compacted\n ((CompactingMemStore) region.getStore(FAMILY1).getMemStore()).flushInMemory();\n ((CompactingMemStore) region.getStore(FAMILY3).getMemStore()).flushInMemory();\n region.flush(false);\n\n // Recalculate everything\n long cf1MemstoreSizePhaseII = region.getStore(FAMILY1).getMemStoreSize();\n long cf2MemstoreSizePhaseII = region.getStore(FAMILY2).getMemStoreSize();\n long cf3MemstoreSizePhaseII = region.getStore(FAMILY3).getMemStoreSize();\n\n long smallestSeqInRegionCurrentMemstorePhaseII = getWAL(region)\n .getEarliestMemstoreSeqNum(region.getRegionInfo().getEncodedNameAsBytes());\n // Find the smallest LSNs for edits wrt to each CF.\n long smallestSeqCF1PhaseII = region.getOldestSeqIdOfStore(FAMILY1);\n long smallestSeqCF2PhaseII = region.getOldestSeqIdOfStore(FAMILY2);\n long smallestSeqCF3PhaseII = region.getOldestSeqIdOfStore(FAMILY3);\n\n s = s + \"DefaultMemStore DEEP_OVERHEAD is:\" + DefaultMemStore.DEEP_OVERHEAD\n + \", CompactingMemStore DEEP_OVERHEAD is:\" + CompactingMemStore.DEEP_OVERHEAD\n + \"\\n----After first flush! CF1 should be flushed to memory, but not compacted.---\\n\"\n + \"Size of CF1 is:\" + cf1MemstoreSizePhaseII + \", size of CF2 is:\" + cf2MemstoreSizePhaseII\n + \", size of CF3 is:\" + cf3MemstoreSizePhaseII + \"\\n\";\n\n // CF1 was flushed to memory, but there is nothing to compact, and CF! was flattened\n assertTrue(cf1MemstoreSizePhaseII < cf1MemstoreSizePhaseI);\n\n // CF2 should become empty\n assertEquals(DefaultMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD,\n cf2MemstoreSizePhaseII);\n\n // verify that CF3 was flushed to memory and was compacted (this is approximation check)\n assertTrue(cf3MemstoreSizePhaseI / 2 + CompactingMemStore.DEEP_OVERHEAD\n + ImmutableSegment.DEEP_OVERHEAD_CAM\n + CompactionPipeline.ENTRY_OVERHEAD > cf3MemstoreSizePhaseII);\n\n // CF3 was compacted and flattened!\n assertTrue(\"\\n<<< Size of CF3 in phase I - \" + cf3MemstoreSizePhaseI\n + \", size of CF3 in phase II - \" + cf3MemstoreSizePhaseII + \"\\n\",\n cf3MemstoreSizePhaseI / 2 > cf3MemstoreSizePhaseII);\n\n\n // Now the smallest LSN in the region should be the same as the smallest\n // LSN in the memstore of CF1.\n assertEquals(smallestSeqInRegionCurrentMemstorePhaseII, smallestSeqCF1PhaseI);\n\n // Now add more puts for CF1, so that we also flush CF1 to disk instead of\n // memory in next flush\n for (int i = 1200; i < 3000; i++) {\n region.put(createPut(1, i));\n }\n\n s = s + \"The smallest sequence in region WAL is: \" + smallestSeqInRegionCurrentMemstorePhaseII\n + \", the smallest sequence in CF1:\" + smallestSeqCF1PhaseII + \", \" +\n \"the smallest sequence in CF2:\"\n + smallestSeqCF2PhaseII +\", the smallest sequence in CF3:\" + smallestSeqCF3PhaseII + \"\\n\";\n\n // How much does the CF1 memstore occupy? Will be used later.\n long cf1MemstoreSizePhaseIII = region.getStore(FAMILY1).getMemStoreSize();\n long smallestSeqCF1PhaseIII = region.getOldestSeqIdOfStore(FAMILY1);\n\n s = s + \"----After more puts into CF1 its size is:\" + cf1MemstoreSizePhaseIII\n + \", and its sequence is:\" + smallestSeqCF1PhaseIII + \" ----\\n\" ;\n\n\n // Flush!!!!!!!!!!!!!!!!!!!!!!\n // Flush again, CF1 is flushed to disk\n // CF2 is flushed to disk, because it is not in-memory compacted memstore\n // CF3 is flushed empty to memory (actually nothing happens to CF3)\n region.flush(false);\n\n // Recalculate everything\n long cf1MemstoreSizePhaseIV = region.getStore(FAMILY1).getMemStoreSize();\n long cf2MemstoreSizePhaseIV = region.getStore(FAMILY2).getMemStoreSize();\n long cf3MemstoreSizePhaseIV = region.getStore(FAMILY3).getMemStoreSize();\n\n long smallestSeqInRegionCurrentMemstorePhaseIV = getWAL(region)\n .getEarliestMemstoreSeqNum(region.getRegionInfo().getEncodedNameAsBytes());\n long smallestSeqCF1PhaseIV = region.getOldestSeqIdOfStore(FAMILY1);\n long smallestSeqCF2PhaseIV = region.getOldestSeqIdOfStore(FAMILY2);\n long smallestSeqCF3PhaseIV = region.getOldestSeqIdOfStore(FAMILY3);\n\n s = s + \"----After SECOND FLUSH, CF1 size is:\" + cf1MemstoreSizePhaseIV + \", CF2 size is:\"\n + cf2MemstoreSizePhaseIV + \" and CF3 size is:\" + cf3MemstoreSizePhaseIV\n + \"\\n\";\n\n s = s + \"The smallest sequence in region WAL is: \" + smallestSeqInRegionCurrentMemstorePhaseIV\n + \", the smallest sequence in CF1:\" + smallestSeqCF1PhaseIV + \", \" +\n \"the smallest sequence in CF2:\"\n + smallestSeqCF2PhaseIV +\", the smallest sequence in CF3:\" + smallestSeqCF3PhaseIV\n + \"\\n\";\n\n // CF1's pipeline component (inserted before first flush) should be flushed to disk\n // CF2 should be flushed to disk\n assertTrue(cf1MemstoreSizePhaseIII > cf1MemstoreSizePhaseIV);\n assertEquals(DefaultMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD,\n cf2MemstoreSizePhaseIV);\n\n // CF3 shouldn't have been touched.\n assertEquals(cf3MemstoreSizePhaseIV, cf3MemstoreSizePhaseII);\n\n // the smallest LSN of CF3 shouldn't change\n assertEquals(smallestSeqCF3PhaseII, smallestSeqCF3PhaseIV);\n\n // CF3 should be bottleneck for WAL\n assertEquals(s, smallestSeqInRegionCurrentMemstorePhaseIV, smallestSeqCF3PhaseIV);\n\n // Flush!!!!!!!!!!!!!!!!!!!!!!\n // Trying to clean the existing memstores, CF2 all flushed to disk. The single\n // memstore segment in the compaction pipeline of CF1 and CF3 should be flushed to disk.\n // Note that active set of CF3 is empty\n // But active set of CF1 is not yet empty\n region.flush(true);\n\n // Recalculate everything\n long cf1MemstoreSizePhaseV = region.getStore(FAMILY1).getMemStoreSize();\n long cf2MemstoreSizePhaseV = region.getStore(FAMILY2).getMemStoreSize();\n long cf3MemstoreSizePhaseV = region.getStore(FAMILY3).getMemStoreSize();\n long smallestSeqInRegionCurrentMemstorePhaseV = getWAL(region)\n .getEarliestMemstoreSeqNum(region.getRegionInfo().getEncodedNameAsBytes());\n\n assertTrue(\n CompactingMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD < cf1MemstoreSizePhaseV);\n assertEquals(DefaultMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD,\n cf2MemstoreSizePhaseV);\n assertEquals(CompactingMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD,\n cf3MemstoreSizePhaseV);\n\n region.flush(true); // flush once again in order to be sure that everything is empty\n assertEquals(CompactingMemStore.DEEP_OVERHEAD + MutableSegment.DEEP_OVERHEAD,\n region.getStore(FAMILY1).getMemStoreSize());\n\n // What happens when we hit the memstore limit, but we are not able to find\n // any Column Family above the threshold?\n // In that case, we should flush all the CFs.\n\n // The memstore limit is 200*1024 and the column family flush threshold is\n // around 50*1024. We try to just hit the memstore limit with each CF's\n // memstore being below the CF flush threshold.\n for (int i = 1; i <= 300; i++) {\n region.put(createPut(1, i));\n region.put(createPut(2, i));\n region.put(createPut(3, i));\n region.put(createPut(4, i));\n region.put(createPut(5, i));\n }\n\n region.flush(false);\n\n s = s + \"----AFTER THIRD AND FORTH FLUSH, The smallest sequence in region WAL is: \"\n + smallestSeqInRegionCurrentMemstorePhaseV\n + \". After additional inserts and last flush, the entire region size is:\" + region\n .getMemstoreSize()\n + \"\\n----------------------------------\\n\";\n\n // Since we won't find any CF above the threshold, and hence no specific\n // store to flush, we should flush all the memstores\n // Also compacted memstores are flushed to disk.\n assertEquals(0, region.getMemstoreSize());\n System.out.println(s);\n HBaseTestingUtility.closeRegionAndWAL(region);\n }", "@Test\n public void testLogUnitQuota() throws Exception {\n\n long maxLogSize = FileUtils.ONE_MB / 2;\n Process server_1 = runServerWithQuota(DEFAULT_PORT, maxLogSize, true);\n\n CorfuRuntime rt = createRuntime(DEFAULT_ENDPOINT);\n\n // Create a table\n PersistentCorfuTable<String, String> table = createCorfuTable(rt, \"s1\");\n table.insert(\"k1\", \"v1\");\n table.insert(\"k2\", \"v2\");\n\n // Create a stream and keep writing data till the quota is exhausted\n // quota is exhausted\n UUID streamId = UUID.randomUUID();\n IStreamView sv = rt.getStreamsView().get(streamId);\n\n exhaustQuota(sv);\n\n // Verify that transactions will fail after the quota is exceeded\n boolean txnAborted = false;\n try {\n rt.getObjectsView().TXBegin();\n table.insert(\"largeEntry\", \"Val\");\n rt.getObjectsView().TXEnd();\n } catch (TransactionAbortedException tae) {\n assertThat(tae.getAbortCause()).isEqualTo(AbortCause.QUOTA_EXCEEDED);\n txnAborted = true;\n }\n\n assertThat(txnAborted).isTrue();\n\n // bump up the sequencer counter to create multiple empty segments\n final int emptySlots = StreamLogFiles.RECORDS_PER_LOG_FILE;\n for (int x = 0; x < emptySlots; x++) {\n rt.getSequencerView().next();\n }\n\n // Create a privileged client to checkpoint and compact\n CorfuRuntime.CorfuRuntimeParameters.CorfuRuntimeParametersBuilder paramsBuilder =\n CorfuRuntime.CorfuRuntimeParameters.builder().priorityLevel(PriorityLevel.HIGH);\n\n CorfuRuntime privilegedRt = createRuntime(DEFAULT_ENDPOINT, paramsBuilder);\n privilegedRt.parseConfigurationString(DEFAULT_ENDPOINT);\n privilegedRt.connect();\n\n PersistentCorfuTable<String, String> table2 = createCorfuTable(privilegedRt, \"s1\");\n\n // Verify that a high priority client can write to a table\n table2.insert(\"k4\", \"v4\");\n\n // Verify that the high priority client can checkpoint/trim\n MultiCheckpointWriter<PersistentCorfuTable<String, String>> mcw = new MultiCheckpointWriter<>();\n mcw.addMap(table2);\n Token token = mcw.appendCheckpoints(privilegedRt, \"privilegedWriter\");\n privilegedRt.getAddressSpaceView().prefixTrim(token);\n privilegedRt.getAddressSpaceView().gc();\n\n // Now verify that the original client (i.e. has a normal priority) is\n // able to write after some of the quota has been freed\n table.insert(\"k3\", \"v3\");\n\n // Now verify that all those changes can be observed from a new client\n CorfuRuntime rt3 = createRuntime(DEFAULT_ENDPOINT);\n PersistentCorfuTable<String, String> table3 = createCorfuTable(rt3, \"s1\");\n\n assertThat(table3.get(\"k1\")).isEqualTo(\"v1\");\n assertThat(table3.get(\"k2\")).isEqualTo(\"v2\");\n assertThat(table3.get(\"k3\")).isEqualTo(\"v3\");\n assertThat(table3.get(\"k4\")).isEqualTo(\"v4\");\n }", "@Test\n public void writeRetriesTest() {\n // TODO: test writeRetries\n }", "@Test\n public void testReplicationOfEmptyWALFollowingNonEmptyWAL() throws Exception {\n final int numRs = UTIL1.getHBaseCluster().getRegionServerThreads().size();\n // make sure we only the current active wal file in queue\n verifyNumberOfLogsInQueue(1, numRs);\n\n // Disable the replication peer to accumulate the non empty WAL followed by empty WAL\n hbaseAdmin.disableReplicationPeer(PEER_ID2);\n\n int numOfEntriesToReplicate = 20;\n // for each RS, create an empty wal with same walGroupId\n final List<Path> emptyWalPaths = new ArrayList<>();\n long ts = EnvironmentEdgeManager.currentTime();\n for (int i = 0; i < numRs; i++) {\n RegionInfo regionInfo =\n UTIL1.getHBaseCluster().getRegions(tableName.getName()).get(0).getRegionInfo();\n WAL wal = UTIL1.getHBaseCluster().getRegionServer(i).getWAL(regionInfo);\n Path currentWalPath = AbstractFSWALProvider.getCurrentFileName(wal);\n\n appendEntriesToWal(numOfEntriesToReplicate, wal);\n String walGroupId = AbstractFSWALProvider.getWALPrefixFromWALName(currentWalPath.getName());\n Path emptyWalPath = new Path(UTIL1.getDefaultRootDirPath(), walGroupId + \".\" + ts);\n UTIL1.getTestFileSystem().create(emptyWalPath).close();\n emptyWalPaths.add(emptyWalPath);\n }\n\n injectEmptyWAL(numRs, emptyWalPaths);\n // There should be three WALs in queue\n // 1. non empty WAL\n // 2. empty WAL\n // 3. live WAL\n verifyNumberOfLogsInQueue(3, numRs);\n hbaseAdmin.enableReplicationPeer(PEER_ID2);\n // ReplicationSource should advance past the empty wal, or else the test will fail\n waitForLogAdvance(numRs);\n\n // Now we should expect numOfEntriesToReplicate entries\n // replicated from each region server. This makes sure we didn't loose data\n // from any previous batch when we encounter EOF exception for empty file.\n Assert.assertEquals(\"Replicated entries are not correct\", numOfEntriesToReplicate * numRs,\n replicatedEntries.size());\n\n // We expect just one batch of replication which will\n // be from when we handle the EOF exception.\n Assert.assertEquals(\"Replicated batches are not correct\", 1, replicateCount.intValue());\n verifyNumberOfLogsInQueue(1, numRs);\n // we're now writing to the new wal\n // if everything works, the source should've stopped reading from the empty wal, and start\n // replicating from the new wal\n runSimplePutDeleteTest();\n rollWalsAndWaitForDeque(numRs);\n }", "@Test\n public void testJoinInconsistentEnsemble() throws Exception {\n int sid;\n QuorumPeer peer;\n int waitTime = 10 * 1000;\n ArrayList<QuorumPeer> peerList = new ArrayList<>();\n for (sid = 0; sid < 3; sid++) {\n peers.put(Long.valueOf(sid), new QuorumServer(sid, new InetSocketAddress(\"127.0.0.1\", PortAssignment.unique()), new InetSocketAddress(\"127.0.0.1\", PortAssignment.unique())));\n tmpdir[sid] = ClientBase.createTmpDir();\n port[sid] = PortAssignment.unique();\n }\n // start 2 peers and verify if they form the cluster\n for (sid = 0; sid < 2; sid++) {\n peer = new QuorumPeer(peers, tmpdir[sid], tmpdir[sid], port[sid], 3, sid, 2000, 2, 2, 2);\n LOG.info(\"Starting peer {}\", peer.getMyId());\n peer.start();\n peerList.add(sid, peer);\n }\n peer = peerList.get(0);\n VerifyState v1 = new VerifyState(peerList.get(0));\n v1.start();\n v1.join(waitTime);\n assertFalse(!v1.isSuccess(), \"Unable to form cluster in \" + waitTime + \" ms\");\n // Change the election round for one of the members of the ensemble\n long leaderSid = peer.getCurrentVote().getId();\n long zxid = peer.getCurrentVote().getZxid();\n long electionEpoch = peer.getCurrentVote().getElectionEpoch();\n ServerState state = peer.getCurrentVote().getState();\n long peerEpoch = peer.getCurrentVote().getPeerEpoch();\n Vote newVote = new Vote(leaderSid, zxid + 100, electionEpoch + 100, peerEpoch, state);\n peer.setCurrentVote(newVote);\n // Start 3rd peer and check if it joins the quorum\n peer = new QuorumPeer(peers, tmpdir[2], tmpdir[2], port[2], 3, 2, 2000, 2, 2, 2);\n LOG.info(\"Starting peer {}\", peer.getMyId());\n peer.start();\n peerList.add(sid, peer);\n v1 = new VerifyState(peer);\n v1.start();\n v1.join(waitTime);\n if (v1.isAlive()) {\n fail(\"Peer \" + peer.getMyId() + \" failed to join the cluster \" + \"within \" + waitTime + \" ms\");\n }\n // cleanup\n for (int id = 0; id < 3; id++) {\n peer = peerList.get(id);\n if (peer != null) {\n peer.shutdown();\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
repeated .dstore.engine.Message message = 3;
public java.util.List<? extends io.dstore.engine.MessageOrBuilder> getMessageOrBuilderList() { if (messageBuilder_ != null) { return messageBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(message_); } }
[ "void mo31256a(Message message);", "Recorder setMessage(String message);", "public void d(Message message) {\n if (message != null) {\n int i = 1;\n if (message.arg1 >= 1) {\n i = message.arg1;\n }\n this.g = i;\n this.i = 0;\n this.j = 0;\n }\n }", "int countByExample(EmessageDOExample example);", "public void insertData(MessageModel message)\n {\n\n }", "@Override\n public void message(Message message) {\n }", "void recordState(String message);", "Message deliverMessage(Message message);", "void onNext(Message message);", "public void responderMsg(){\n\t\tmsg++;\n\t}", "MessagePayload(){}", "Message.Record getRecord();", "int insert(MessageDO record);", "@Override\n public void update(Message msg) {\n }", "public long insert(StructuredFullMessage msg);", "public Result addMessage(int message);", "ppl.delite.runtime.messages.Messages.Id getId();", "public void messageFromServer(Message message) {\n\t}", "public interface MessageStore {\n\n void start() throws Exception;\n\n void shutdown();\n\n void destroy();\n\n PutMessageResult putMessage(final MessageExtBrokerInner msg);\n\n long now();\n}", "void sendMessageFromFSM(Message message);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override protected void onPostExecute(String result) { super.onPostExecute(result); adapter.notifyDataSetChanged(); }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the object that takes on the responsibility for drawing an individual marker. This allows for the option of reusing the drawing code for symbol previews or other purposes outside the map, or for changing the rendering code without changing other code.
public final void setRenderer(@NonNull PointRenderer renderer) { if (renderer == null) { throw new IllegalArgumentException("Argument renderer cannot be null."); } this.renderer = renderer; }
[ "public void setMarker(String marker) {\n this.marker = marker;\n paint();\n }", "void setMarker(Object o) {\n this.undoActionMarker = o;\n }", "public void drawMarker(PGraphics pg, float x, float y);", "public void setmMarker(Marker m){\n mMarker = m;\n }", "private void setMarkerForElderlyPerson(){\n MarkerOptions mo = new MarkerOptions();\n mo.position(locationOfElderly);\n mo.title(\"Location of Elderly\");\n mo.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\n markerOfElderly = map.addMarker(mo,locationOfElderly, true);\n }", "private void drawMarker(LatLng point) {\n MarkerOptions markerOptions = new MarkerOptions();\n\n // Setting latitude and longitude for the marker\n markerOptions.position(point);\n\n // Setting snippet for the InfoWindow\n markerOptions.snippet(\"Tap here to remove this marker\");\n\n // Setting title for the InfoWindow\n markerOptions.title(\"Marker Demo\");\n\n // Adding marker on the Google Map\n googleMap.addMarker(markerOptions);\n }", "public void setDrawingInfo(EsriDrawingInfo drawingInfo)\n {\n myDrawingInfo = drawingInfo;\n }", "private void setHighlightMarker() {\n selectedSquare.setBackground(ContextCompat.getDrawable(context, R.drawable.selected_square_marker));\n\n }", "public void setPoint(GeographicPoint point, Marker marker) {\n \tpointLabel.setItem(point);\r\n selectedMarker = marker;\r\n }", "private void setMarker() {\n\t\t//Code to set a marker\n\t\t// latitude and longitude\n\t\tdouble latitude = 46;\n\t\tdouble longitude = 21;\n\t\t\t\n\t\t\n\t\tLatLng position = new LatLng(latitude, longitude);\n\t\t\n\t\t// create marker\n\t\tMarkerOptions marker = new MarkerOptions().position(position).title(\"Hello Maps \");\n\t\t \n\t\t// adding marker\n\t\tgoogleMap.addMarker(marker);\n\t}", "@Override\n\t\t\tpublic boolean onMarkerClick(Marker mark) {\n\t\t\t\tLog.i(\"VIND\",\"mark.getPosition() =\"+mark.getPosition());\n\t\t\t\tif(oldMarker != null ){\n\t\t\t\t\toldMarker.setIcon(oldBitmap);\n\t\t\t\t}\n\t\t\t\tif(mMarkerA != null){\n\t\t\t\t\tmMarkerA.remove();\n\t\t\t\t}\n\t\t\t\tif(mark != mMarker_Car){\n\t\t\t\t\toldMarker = mark;\n\t\t\t\t\toldBitmap = mark.getIcon();\n\t\t\t\t\tBitmapDescriptor bitmap = BitmapDescriptorFactory \n\t\t\t\t\t\t .fromResource(R.drawable.icon_en);\n\t\t\t\t\tmark.setIcon(bitmap);\n\t\t\t\t\tshowLocation(mark.getPosition());\n\t\t\t\t}else{\n\t\t\t\t\tToast.makeText(MainActivity.this, \"请重新选择目标地点!\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}", "private void drawMarker(LatLng point) {\n MarkerOptions markerOptions = new MarkerOptions();\n\n // Setting latitude and longitude for the marker\n markerOptions.position(point);\n\n // Adding marker on the Google Map\n mMap.addMarker(markerOptions);\n }", "public void setMarker(double latitude, double longitude) {\n if (marker != null) {\n marker.remove();\n }\n\n LatLng latLng = new LatLng(latitude, longitude);\n\n MarkerOptions options = new MarkerOptions();\n options.position(latLng);\n // Custom Marker Icon\n Drawable drawable = activity.getDrawable(R.drawable.ic_place);\n if (drawable != null) {\n float scale = 1.5f;\n\n Bitmap bitmap = Bitmap.createBitmap(Math.round(drawable.getIntrinsicWidth() * scale),\n Math.round(drawable.getIntrinsicHeight() * scale), Bitmap.Config.ARGB_8888);\n Canvas canvas = new Canvas(bitmap);\n\n drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());\n\n int color = Colors.getColor(activity, R.color.red);\n drawable.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);\n\n drawable.draw(canvas);\n\n BitmapDescriptor descriptor = BitmapDescriptorFactory.fromBitmap(bitmap);\n options.icon(descriptor);\n }\n\n marker = map.addMarker(options);\n }", "private void drawMarker(LatLng point)\r\n {\n MarkerOptions markerOptions = new MarkerOptions();\r\n\r\n // Setting latitude and longitude for the marker\r\n markerOptions.position(point);\r\n\r\n // Adding InfoWindow title\r\n markerOptions.title(\"Location Coordinates\");\r\n\r\n // Adding InfoWindow contents\r\n markerOptions.snippet(Double.toString(point.latitude) + \",\"\r\n + Double.toString(point.longitude));\r\n\r\n // Adding marker on the Google Map\r\n googleMap.addMarker(markerOptions);\r\n }", "@Override\n public boolean onMarkerClick(Marker marker) {\n markers.get(pointer).setIcon(BitmapDescriptorFactory.fromResource(R.drawable.bus_stop_red_marker));\n // Move the pointer to the right marker\n String markerID = marker.getId().toString();\n pointer = Integer.parseInt(markerID.substring(1, markerID.length()));\n // Change the current pointer color\n markers.get(pointer).setIcon(BitmapDescriptorFactory.fromResource(R.drawable.bus_stop_blue_marker));\n // Show the Info Window of the marker\n marker.showInfoWindow();\n // Animate - flyTo this marker\n flyTo(CameraPosition.builder()\n .target(marker.getPosition())\n .zoom(15)\n .bearing(0)\n .tilt(0)\n .build());\n return true;\n }", "private void drawMarker(LatLng point){\n MarkerOptions markerOptions = new MarkerOptions();\n \n // Setting latitude and longitude for the marker\n markerOptions.position(point);\n \n // Adding marker on the Google Map\n mMap.addMarker(markerOptions);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(toPosition));\n\t\tmMap.animateCamera(CameraUpdateFactory.zoomTo(20));\n }", "@StateStrategyType(OneExecutionStateStrategy.class)\n void setMarker(double x, double y);", "public void setVisitMarker(int marker) {\r\n\t\tthis.setMark(marker);\r\n\t}", "@Override\n public void onMapClick(LatLng point) {\n mGoogleMap.clear();\n\n // Setting the touched location in member variable\n mLocation = point;\n Log.d(\"marker\", \"The location is: \" +mLocation);\n\n // Drawing a marker at the touched location\n drawMarker(mLocation,BitmapDescriptorFactory.HUE_GREEN);\n\n\n\n\n\n\n }", "public void setMarker(Double lat, Double lng, String key){\n LatLng latLng = new LatLng(lat, lng);\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.snippet(key); // Contains the user id of the hiker located at this position (To identify the markers)\n Marker marker = mGoogleMap.addMarker(markerOptions);\n marker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.locmarkeryellow));\n mMarkers.add(marker); // Stores every Marker in a list object\n initGettingLocations(); // Updates the Markers of the Hikers which the driver gas marked to pick up, they will appear green instead of yellow.\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by Abator for iBATIS. This method returns the value of the database column MI402.SUCCESSNUM
public Integer getSuccessnum() { return successnum; }
[ "public String getSuccessCode() {\n return getPropertyAsString(SUCCESSCODE);\n }", "public int getSuccess() {\n return success;\n }", "public Long getReturnCode() {\n return returnCode;\n }", "long getReturnCode();", "public java.lang.Integer getResultCode() {\n return result_code;\n }", "int getSuccessSeq();", "public final native double getSuccessCount() /*-{\n return this.getSuccessCount();\n }-*/;", "public String getOkNumber() {\n return okNumber;\n }", "public String getResultCode() {\r\n return resultCode;\r\n }", "@ReportableProperty(order = 10, value = \"Result-Code header value.\")\r\n public String getResultCode() {\r\n return record.resultCode;\r\n }", "protected String getReturnCode() {\n return this.returnCode;\n }", "public java.lang.Integer getErrCode() {\n return errCode;\n }", "@Override\n final public int returnStatus() {\n return returnStatus == 0 ? returnStatus : (int) ERROR_SEQ_NUMBER++;\n }", "@java.lang.Override\n public long getReturnCode() {\n return returnCode_;\n }", "@ComMethod(name = \"GetAsyncProcessReturnCode\", dispId = 0x5a)\n Integer GetAsyncProcessReturnCode();", "@java.lang.Override\n public long getReturnCode() {\n return returnCode_;\n }", "public java.lang.String getReturnCode() {\n java.lang.Object ref = returnCode_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n returnCode_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public void setSuccess(final int success) {\n\t\tmSuccess = success;\n\t}", "public int getStatus(int mCode) {\r\n\t\treturn MRs[mCode].getStatus();//Call the getStatus() method in the management record class for the management record at the position of the mCode\r\n\t}", "public Boolean isSuccessful() {\n return (this.code != null && ResultCode.SUCCESS.equals(this.code));\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Preload some application definition, including application name and whether the app is based on behavior network.
public String preloadAppDef(String externalFile) { try { return AppLoader.preloadAppDef(externalFile); } catch (Exception e) { MessageUtils.debug(this, "preloadAppDef", e); MessageUtils.displayError("Can not preload the app definition."); } return null; }
[ "public void loadApplication() {\n loadUsers();\n loadPapers();\n loadReviews();\n loadReports();\n loadNotifications();\n loadDeadlines();\n }", "public void setApplicationIsLoaded(ApplicationConfiguration appConf) {\n this.loadedApps.add( appConf );\n this.appsLoaded = (this.loadedApps.size() == this.handler.getApplications().size());\n }", "protected HomeFactoryPage loadApplication() {\n\t\treturn PageFactory.initElements(driver, HomeFactoryPage.class); // 2nd item\r\n\t}", "RackApplication newApplication(RT runtime) throws RackInitializationException;", "protected void onStartLoading() {\n\t\t\tif (apps != null)\n\t\t\t{\n\t\t\t\t//If we currently have a result available, deliver it immediately.\n\t\t\t\tdeliverResult(apps);\n\t\t\t}\n\t\t\t\n\t\t\t//Start watching for changes in the app data.\n\t\t\tif (appObserver == null)\n\t\t\t{\n\t\t\t\tappObserver = new AppObserver(this);\n\t\t\t}\n\t\t\t\n\t\t\t//Has something interesting in the configuration changed since we last built the app list?\n\t\t\tboolean configChange = config.applyConfig(getContext().getResources());\n\t\t\t\n\t\t\tif (takeContentChanged() || apps == null || configChange)\n\t\t\t{\n\t\t\t\t//If the data has changed since the last time it was loaded\n //or is not currently available, start a load.\n\t\t\t\tforceLoad();\n\t\t\t}\n\t\t}", "protected final App tryInitializeApp() throws AppInequalityException {\n\t\tApp app = ObjectifyService.run(new InitWork());\n\t\treturn app;\n\t}", "public void onModuleLoad() {\n\t\t_app = this;\n\t\t_app.initialize(\"SpeedClient\");\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\t\tif (LogConfiguration.loggingIsEnabled()) {\n\t\t\tlog().jobStart(\"Bootstrapping\", \"Bootstrapping application\");\n\t\t}\n\t\t\n\t\t// Bootstrapping\n\t\t\n\t\tif (LogConfiguration.loggingIsEnabled()) {\n\t\t\tlog().jobEnd(\"Bootstrapping\", \"Application ready\", startTime);\n\t\t}\n\t}", "public void init() {\n List<LMApplicationEntity> rowsList = applicationService.getAllApplication();\n for (int i = 0; i < rowsList.size(); i++) {\n LMApplicationEntity lmApplicationEntity = rowsList.get(i);\n String appKeyLive = lmApplicationEntity.getAppKeyLive();\n String appTestLive = lmApplicationEntity.getAppKeyTest();\n applicationMap.put(appTestLive, lmApplicationEntity);\n applicationMap.put(appKeyLive, lmApplicationEntity);\n }\n }", "public void setApplication(String lapp) {\n this.application = lapp;\n }", "public abstract Application fetch( String locator) throws IOException;", "public ApplicationModel () {\n\t\tthis.mod = ResourceManager.getInstance();\n\t\tthis.appName = this.mod.getString(\"name\");\n\t\tthis.tabs = new HashMap<>();\n\t\tthis.servers = new HashMap<>();\n\t\tthis.clients = new HashMap<>();\n\t}", "public void onCreate(){\n try {\n Field sClassLoader = Globals.class.getDeclaredField(\"sClassLoader\");\n sClassLoader.setAccessible(true);\n sClassLoader.set(null, Atlas.getInstance().getDelegateClassLoader());\n } catch (Exception e) {\n throw new RuntimeException(\"Could not set Globals !!!\", e);\n }\n\n Services.setSystemClassloader(Atlas.getInstance().getDelegateClassLoader());\n mAtlasApplicationDelegate.setRemoteMonitor(new AtlasMonitorImpl(mApplication));\n mAtlasApplicationDelegate.setLocalLog(new ExternalLog());\n mAtlasApplicationDelegate.setClassNotFoundListener(new ClassNotFoundInterceptor());\n mAtlasApplicationDelegate.onCreate();\n ((PanguApplication) Globals.getApplication()).registerCrossActivityLifecycleCallback(new AppForgroundObserver());\n }", "public void createApplication() {\n }", "void preload(PreloadConfig config);", "public abstract Application getApplication( String appId);", "public void loadCustomApps()// change to loadCustomApps //changed from loadESApp as can add more checks into this\n\t{\n\t\tnew Handler().postDelayed(new Runnable()\n\t\t{\n\t\t\t//check if app is on phone\n\t\t\t@Override\n\t\t\tpublic void run(){\n\t\t\t\t//added on check if on device\n\t\t\t\tif(checkes() == true){\n\t\t\t\t\tshowESIcon(\"/data/app/com.estrongs.android.pop.cupcake-1.apk\");\n\t\t\t\t}\n\t\t\t\t/*else {//=false\n\n\t\t\t\t}*/\n\t\t\t\tif(checkfb() == true){\n\t\t\t\t\t\tshowFbIcon(\"/data/app/com.facebook.katana-1.apk\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//end on check\n\t\t\t}\n\t\t},0);\n\t}", "@Override\n public void onApplicationEvent(final ApplicationReadyEvent event) {\n System.out.println(\"Entre en el iniciador de app\");\n appDD.initAppData();\n \n }", "@Override\n public void load(FilterPagingLoadConfig loadConfig,\n final AsyncCallback<PagingLoadResult<App>> callback) {\n lastQueryText = \"\"; //$NON-NLS-1$\n\n // Get the proxy's search params.\n List<FilterConfig> filterConfigs = loadConfig.getFilters();\n if (filterConfigs != null && !filterConfigs.isEmpty()) {\n lastQueryText = filterConfigs.get(0).getValue();\n }\n\n if (Strings.isNullOrEmpty(lastQueryText)) {\n // nothing to search\n return;\n }\n\n // Cache the search text for this callback; used to sort the results.\n final String searchText = lastQueryText;\n final AppSearchRpcProxy source = this;\n\n // Call the searchApp service with this proxy's query.\n ServicesInjector.INSTANCE.getAppServiceFacade().searchApp(lastQueryText, new AsyncCallback<String>() {\n @Override\n public void onSuccess(String result) {\n AppAutoBeanFactory factory = GWT.create(AppAutoBeanFactory.class);\n List<App> apps = AutoBeanCodex.decode(factory, AppList.class, result).as().getApps();\n\n Collections.sort(apps, new AppComparator(searchText));\n\n // Pass the App list to this proxy's load callback.\n AppListLoadResult searchResult = AppSearchAutoBeanFactory.instance.dataLoadResult().as();\n searchResult.setData(apps);\n callback.onSuccess(searchResult);\n\n // Fire the search results load event.\n EventBus eventBus = EventBus.getInstance();\n eventBus.fireEvent(new AppSearchResultLoadEvent(source, searchText, apps));\n }\n\n @Override\n public void onFailure(Throwable caught) {\n // TODO Add user error message or remove post here?\n ErrorHandler.post(caught);\n callback.onFailure(caught);\n }\n });\n }", "boolean loadOnStartup();", "protected void registerApps() {\n\t\tif(binder.equals(RABBIT_BINDER)) {\n\t\t\tappRegistryOperations.importFromResource(\n\t\t\t\t\t\"http://bit.ly/stream-applications-rabbit-maven\", true);\n\t\t}\n\t\telse if (binder.equals(KAFKA_BINDER)) {\n\t\t\tappRegistryOperations.importFromResource(\n\t\t\t\t\t\"http://bit.ly/stream-applications-kafka-maven\", true);\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalStateException(String.format(\n\t\t\t\t\t\"Binder type of \\\"%s\\\" is invalid. Only valid types are \"\n\t\t\t\t\t+ \"\\\"%s\\\" and \\\"%s\\\" \", binder, RABBIT_BINDER,\n\t\t\t\t\tKAFKA_BINDER));\n\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Granted by DB it's will return a unique menu for restaurant in 1 day
default Map<Integer, List<Menu>> findAllWithLunchsByDateToMap(LocalDate date) { return findAllWithLunchsByDate(date).stream().collect(Collectors.groupingBy(menu -> menu.getRestaurant().getId())); }
[ "@Transactional(readOnly = true)\n Menu getRandomMenuByRetaurant(Restaurant r);", "@Transactional(readOnly = true)\n Menu getRandomMenuByTagAndRestaurant(Tag tag, Restaurant restaurant);", "@Override\r\n\tpublic Menu getMenuByRestaurant(Long id) {\n\t\treturn null;\r\n\t}", "@Test\n public void testGetCurrentMenu(){\n List<Dish> dishes = getListWithPersistedDish();\n\n Long menuId = menuEJB.createMenu(LocalDate.now(),dishes);\n menuEJB.createMenu(LocalDate.now().plusDays(1), dishes);\n menuEJB.createMenu(LocalDate.now().minusDays(1), dishes);\n\n assertEquals(menuId, menuEJB.getClosestMenu().getId());\n }", "@Override\n public void getMenuIdInside()\n {\n try\n {\n result1 = gatherResultSet(setStatement(inputQuery1,menu.getRestaurants_id(),menu.getMenu_name(), true,1,2));\n //System.out.println(result1);\n if(result1.next())\n {\n menu_id = result1.getInt(1);\n this.setMessage(\"menu found\");\n }\n else\n {\n this.setMessage(\"The menu id not found\");\n }\n }\n catch (SQLException e)\n {\n message = e.fillInStackTrace().toString();\n }\n }", "@Caching(put = { \n \t @CachePut(value = \"restaurants\", key =\"#id.toString() + #menuid.toString()\"),\n \t\t @CachePut(value = \"restaurants\", key = \"#p0\")\n })\n @PostMapping(\"/restaurants/{id}/menus/{menuid}/items\")\n @ResponseStatus(HttpStatus.CREATED)\n public void addMenuItems(@PathVariable(\"id\") int id,@PathVariable(\"menuid\") int menuid, @RequestBody MenuItem items) {\n Restaurant rest = restaurantDAO.findOne(id);\n if (rest == null)\n return ;\n \n System.out.println(\"restaurant \" + rest);\n \n List<Menu> menu = menuDAO.findByRestaurantRestaurantId(id);\n //System.out.println(menu.size());\n \n List<MenuItem> menuitem = menuitemDAO.findByMenuMenuId(menuid);\n MenuItem menuitems = new MenuItem(items.getItemId(),items.getItemName(),items.getItemPrice());\n menuitems.setRestaurant(rest);\n int i=0;\n for(Menu m:menu){\n \tif(menuid==m.getMenuId()){\n \t menuitems.setMenu(menu.get(i));\n \t break;\n \t}\n \ti++;\n }\n \n menuitem.add(menuitems);\n menuitemDAO.save(menuitems);\n }", "@Override\n public void addMenuInside()\n {\n try\n {\n result1 = gatherResultSet(setStatement(inputQuery1,menu.getRestaurants_id(),menu.getMenu_name(), true,1,2));\n result2 = gatherResultSet(setStatement(inputQuery2,menu.getRestaurants_id(),null, false,1,2));\n if (result1.next())\n {\n this.setMessage(\"This menu name has already used\");\n }\n else if (!result2.next())\n {\n setMessage(\"Did not find the restaurant id\");\n }\n else\n {\n int affected = gatherResult(setStatement(inputQuery3, menu.getRestaurants_id(), menu.getMenu_name(), true,1,2));\n if (affected > 0)\n {\n setMessage(\"You have successfully add the menu \" + menu.getMenu_name());\n }\n }\n }\n catch (SQLException e)\n {\n e.printStackTrace();\n }\n }", "@Test\n public void testMenu(){\n String userId = getUniqueId();\n createAndLogNewUser(userId,true);\n Date today= Date.from(Instant.now());\n\n // if menu with today's date exist, test exit\n if (isTodayMenuAlreadyExists(today)){return;}\n\n\n // dishes\n String dishName1 = getUniqueDishName();\n String dishName2 = getUniqueDishName();\n String dishName3 = getUniqueDishName();\n\n DishesPageObject dishesPage = home.toDishes();\n assertTrue(dishesPage.isOnPage());\n\n /**\n * Act && Assert\n * * */\n\n // 1 create 3 new dishes\n dishesPage = dishesPage.createDish(dishName1);\n dishesPage = dishesPage.createDish(dishName2);\n dishesPage = dishesPage.createDish(dishName3);\n\n // 2 go on the Menu creation page\n HomePageObject home1 = dishesPage.toHome();\n MenuPageObject menuPage = home1.toMenus();\n assertNotNull(menuPage);\n assertTrue(menuPage.isOnPage());\n\n // 3 verify that those 3 dishes are selectable\n boolean isExists1 = menuPage.isDishExistsOnMenuForm(dishName1);\n boolean isExists2 = menuPage.isDishExistsOnMenuForm(dishName2);\n boolean isExists3 = menuPage.isDishExistsOnMenuForm(dishName3);\n assertTrue(isExists1 && isExists2 && isExists3);\n\n // 4 select 2 of them (sorted DESC: than 2 first are: dishName3 & dishName2)\n menuPage.chooseDish(0,true); // dishName3\n menuPage.chooseDish(1,true); // dishName2\n\n // 5 create a menu for today\n String dateText = menuPage.parseDateDirect(today);\n home = menuPage.clickCreate(dateText);\n assertTrue(home.isOnPage());\n\n // 6 on home page, click “show default”\n // to make sure that the created menu for today is displayed\n home.clickDefault();\n\n // 7 verify that the date of the displayed menu is correct (ie today)\n String currentDate = home.getCurrentDateId().trim();\n String todaysDate = home.parseDateRevert(today).trim();\n assertEquals(currentDate,todaysDate);\n\n // 8.1 verify that the 2 selected dishes are displayed in the menu,\n int amountDishes = home.getNumberOfDisplayedDishes();\n assertEquals(2, amountDishes);\n\n // 8.2 and only those 2.\n assertTrue(home.isDishExists(dishName3));\n assertTrue(home.isDishExists(dishName2));\n }", "@Override\r\n\tpublic List<HashMap> food_menu() {\n\t\treturn dao.food_menu();\r\n\t}", "private YumMenuItem generateMenuItemFromUI() {\n\t\t\n\t\t\n\t\tYumRestaurant selectedRestaurant = \n\t\t\t\t(YumRestaurant)(mRestaurantSpinner.getItemAtPosition(mSelectedRestaurantPosition));\n\t\tString restuarantId = selectedRestaurant.getRestaurantId();\n\t\t\n\t\tEditText etName = ((EditText)findViewById(R.id.et_addmenu_itemname));\n\t\tEditText etDesc = ((EditText)findViewById(R.id.et_addmenu_itemdescr));\n\t\tEditText etPrice = ((EditText)findViewById(R.id.et_addmenu_itemprice));\n\t\t\n\t\tString nameStr = etName.getText().toString().trim();\n\t\tString descriptionStr = etDesc.getText().toString().trim();\n\t\tString priceStr = etPrice.getText().toString().trim();\n\t\t\n\t\tNumberFormat formatter = NumberFormat.getInstance(Locale.US);\n\t\tNumber number;\n\t\ttry {\n\t\t\t number = formatter.parse(priceStr);\n\t\t} catch (java.text.ParseException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\tdouble price = number.doubleValue();\n\t\t\n\t\treturn new YumMenuItem(nameStr, descriptionStr, price, restuarantId);\n\t\t\n\t}", "@Override\n public MenuList get(int id, int restaurantId) {\n List<MenuList> menuLists = jdbcTemplate.query(\"SELECT * FROM menu_lists WHERE id=? AND restaurant_id=?\", ROW_MAPPER, id,restaurantId);\n return DataAccessUtils.singleResult(menuLists);\n }", "public List<Menu> getMenuList() {\r\n\t\tString sql = \"SELECT A.* FROM topic.menu AS A left join menustock AS B on A.menu_id = B.menu_id WHERE B.menu_stock_date = DATE_FORMAT(NOW(),'%Y-%m-%d') or B.menu_stock_date = DATE_FORMAT(date_add(now(), interval 1 day),'%Y-%m-%d') group by A.menu_id HAVING sum(B.menu_stock_amount) > '0';\";\r\n\t\treturn getList(sql);\r\n\t}", "public List<MenuFood> getMenuFood(String menu_id){\r\n\t\t//String sql = \"SELECT * FROM topic.menufood where menufood.menu_id=\"+menu_id;\r\n\t\t\r\n\t\tString sql = \"SELECT menu_food_id, menu_id, menu_food_amount, A.food_id, food_name FROM topic.menufood AS A LEFT JOIN food AS B on A.food_id = B.food_id where A.menu_id=\"+menu_id;\r\n\t\t\r\n\t\t\r\n\t\treturn menuFoodShow(sql);\r\n\t}", "public static ArrayList<Menu> printMenu(){\n\t\tPreparedStatement st = null;\n\t\tResultSet results = null;\n\t\tConnection conn1 = null;\n\t\ttry{\n\t\t\tArrayList<Menu> items = new ArrayList<Menu>();\n\t\t\tconn1 = getConnection();\n\n\t\t\tst = conn1.prepareStatement(\"select * from menu where restaurant = ?\");\n\t\t\tst.setString(2, \"*\");\n\t\t\tresults = st.executeQuery();\n\t\t\twhile (results.next()){\n\t\t\t\tMenu item = new Menu();\n\t\t\t\titem.setID(results.getInt(\"id\"));\n\t\t\t\titem.setItem(results.getString(\"item\"));\n\t\t\t\titem.setDescription(results.getString(\"description\"));\n\t\t\t\titem.setPrice(results.getFloat(\"price\"));\n\t\t\t\titem.setRestaurant(results.getString(\"restuarant\"));\n\t\t\t\titems.add(item);\n\t\t\t}\n\t\t\treturn items;\n\t\t} catch (SQLException ex){\n\t\t\tSystem.out.println(\"SQLException: \" + ex.getMessage());\n\t\t\tSystem.out.println(\"SQLState: \" + ex.getSQLState());\n\t\t\tSystem.out.println(\"VendorError: \" + ex.getErrorCode());\n\t\t}\n\t\t//Freeing up resources\n\t\tfinally{\n\t\t\tif (results != null){\n\t\t\t\ttry{\n\t\t\t\t\tresults.close();\n\t\t\t\t}\n\t\t\t\tcatch (SQLException ex2){\n\t\t\t\t}\n\n\t\t\t\tresults = null;\n\t\t\t}\n\n\t\t\tif (st != null){\n\t\t\t\ttry{\n\t\t\t\t\tst.close();\n\t\t\t\t}\n\t\t\t\tcatch (SQLException ex2){\n\t\t\t\t}\n\n\t\t\t\tst = null;\n\t\t\t}\n\n\t\t\tif (conn1 != null)\n\t\t\t{\n\t\t\t\ttry{\n\t\t\t\t\tconn1.close();\n\t\t\t\t}\n\t\t\t\tcatch(SQLException ex2){\n\t\t\t\t}\n\n\t\t\t\tconn1 = null;\n\t\t\t}\n\n\t\t}\n\t\treturn null;\n\t\t\n\t}", "@DeleteMapping(\"/menus/{id}\")\n @Timed\n @Secured({\n \tAuthoritiesConstants.ADMIN,\n \tAuthoritiesConstants.MANAGER\n })\n public ResponseEntity<Void> deleteMenu(@PathVariable Long id) {\n log.debug(\"REST request to delete Menu : {}\", id);\n\n List<Restaurant> restaurants = restaurantRepository.findByManagerIsCurrentUser();\n List<Menu> menu = menuRepository.findAllByRestaurantIn(restaurants);//managers do not see each other menus \n \n if (menu.stream().filter(m -> m.getId().equals(id)).count() > 0 || SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)) {\n menuRepository.delete(id);\n menuSearchRepository.delete(id);\n return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n } else {//not allowed\n return ResponseEntity.status(403).headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();\n }\n \n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_list_restaurant, menu);\r\n return true;\r\n }", "private void createNoMenuError(){\n RuVo ru = new RuVo();\n\n ru.place = mContext.getString(R.string.menu_unavailable);\n ru.menu = mContext.getString(R.string.menu_not_ready_yet_message);\n ru.error = true;\n\n List<RuVo> ruList = new ArrayList<>();\n ruList.add(ru);\n\n mRestaurantList = ruList;\n }", "public Menu get(int MenuId);", "@Transactional(propagation = Propagation.MANDATORY)\n private List<Dish> findDishesByMenuId(int menuId) {\n String sql = \"SELECT Dish.id, Dish.name, Dish.description, Dish.cost, Dish.weight\\n\" +\n \"FROM (Dish_to_menu INNER JOIN Dish ON Dish_to_menu.dish_id = Dish.id)\\n\" +\n \"WHERE Dish_to_menu.menu_id = ?\";\n List<Map<String, Object>> mapList = template.queryForList(sql, menuId);\n return mapList.stream()\n .map(row -> jdbcDishDAO.getDishFromMap(row))\n .collect(Collectors.toList());\n }", "public List<Restaurant> getPendingRestaurants();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetches all flight numbers /ContentValues initialValues = new ContentValues(); //adds some test cases to the database double weight = 45.0; initialValues.put(PREDICTED_LONG, weight); double weight1 = 45.1; initialValues.put(PREDICTED_LAT, weight1); double weight2 = 45.2; initialValues.put(TRACKED_LONG, weight2); double weight3 = 45.3; initialValues.put(TRACKED_LAT, weight3); initialValues.put(KEY_ROWID, 6); ContentValues initialValues2 = new ContentValues(); //adds some test cases to the database double weight22 = 49.4; initialValues2.put(PREDICTED_LONG, weight22); double weight21 = 49.3; initialValues2.put(PREDICTED_LAT, weight21); double weight222 = 49.5; initialValues2.put(TRACKED_LONG, weight222); double weight23 = 49.4; initialValues2.put(TRACKED_LAT, weight23); initialValues2.put(KEY_ROWID, 5); ContentValues initialValues1 = new ContentValues(); double weight10 = 46.2; initialValues1.put(PREDICTED_LONG, weight10); double weight11 = 45.4; initialValues1.put(PREDICTED_LAT, weight11); double weight12 = 46.2; initialValues1.put(TRACKED_LONG, weight12); double weight13 = 46.3; initialValues1.put(TRACKED_LAT, weight13); initialValues1.put(KEY_ROWID, 4); mDb.insert(DATABASE_TABLE2, null, initialValues1); mDb.insert(DATABASE_TABLE2, null, initialValues2); mDb.insert(DATABASE_TABLE2, null, initialValues);
public Cursor fetchGPSData(String flightnumber) { return mDb.query(DATABASE_TABLE2, new String[] {PREDICTED_LONG, PREDICTED_LAT, TRACKED_LONG, TRACKED_LAT}, KEY_ROWID + " = " + flightnumber, null, null, null, null); // picks the four columns based on the flight number }
[ "public void fillDB(){\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n\n //create a map of each car to later insert into the database\n Map<String, String> car1 = new HashMap<>();\n car1.put(\"_id\", \"59d2698c2eaefb1268b69ee5\");\n car1.put(\"make\", \"Chevy\");\n car1.put(\"year\", \"2016\");\n car1.put(\"color\", \"Gray\");\n car1.put(\"price\", \"16106\");\n car1.put(\"hasSunroof\", \"0\");\n car1.put(\"isFourWheelDrive\", \"1\");\n car1.put(\"hasLowMiles\", \"1\");\n car1.put(\"hasPowerWindows\", \"0\");\n car1.put(\"hasNavigation\", \"1\");\n car1.put(\"hasHeatedSeats\", \"0\");\n\n Map<String, String> car2 = new HashMap<>();\n car2.put(\"_id\", \"59d2698c05889e0b23959106\");\n car2.put(\"make\", \"Toyota\");\n car2.put(\"year\", \"2012\");\n car2.put(\"color\", \"Silver\");\n car2.put(\"price\", \"18696\");\n car2.put(\"hasSunroof\", \"1\");\n car2.put(\"isFourWheelDrive\", \"1\");\n car2.put(\"hasLowMiles\", \"0\");\n car2.put(\"hasPowerWindows\", \"1\");\n car2.put(\"hasNavigation\", \"0\");\n car2.put(\"hasHeatedSeats\", \"1\");\n\n\n Map<String, String> car3 = new HashMap<>();\n car3.put(\"_id\", \"59d2698c6f1dc2cbec89c413\");\n car3.put(\"make\", \"Mercedes\");\n car3.put(\"year\", \"2016\");\n car3.put(\"color\", \"Black\");\n car3.put(\"price\", \"18390\");\n car3.put(\"hasSunroof\", \"1\");\n car3.put(\"isFourWheelDrive\", \"0\");\n car3.put(\"hasLowMiles\", \"0\");\n car3.put(\"hasPowerWindows\", \"1\");\n car3.put(\"hasNavigation\", \"1\");\n car3.put(\"hasHeatedSeats\", \"0\");\n\n\n Map<String, String> car4 = new HashMap<>();\n car4.put(\"_id\", \"59d2698c340f2728382c0a73\");\n car4.put(\"make\", \"Toyota\");\n car4.put(\"year\", \"2015\");\n car4.put(\"color\", \"White\");\n car4.put(\"price\", \"15895\");\n car4.put(\"hasSunroof\", \"1\");\n car4.put(\"isFourWheelDrive\", \"0\");\n car4.put(\"hasLowMiles\", \"1\");\n car4.put(\"hasPowerWindows\", \"1\");\n car4.put(\"hasNavigation\", \"0\");\n car4.put(\"hasHeatedSeats\", \"1\");\n\n\n Map<String, String> car5 = new HashMap<>();\n car5.put(\"_id\", \"59d2698cba9b82c2347cd13a\");\n car5.put(\"make\", \"Ford\");\n car5.put(\"year\", \"2014\");\n car5.put(\"color\", \"Gray\");\n car5.put(\"price\", \"19710\");\n car5.put(\"hasSunroof\", \"0\");\n car5.put(\"isFourWheelDrive\", \"1\");\n car5.put(\"hasLowMiles\", \"0\");\n car5.put(\"hasPowerWindows\", \"0\");\n car5.put(\"hasNavigation\", \"1\");\n car5.put(\"hasHeatedSeats\", \"1\");\n\n\n Map<String, String> car6 = new HashMap<>();\n car6.put(\"_id\", \"59d2698ce2e7eeeb4f109001\");\n car6.put(\"make\", \"Toyota\");\n car6.put(\"year\", \"2014\");\n car6.put(\"color\", \"Red\");\n car6.put(\"price\", \"19248\");\n car6.put(\"hasSunroof\", \"1\");\n car6.put(\"isFourWheelDrive\", \"0\");\n car6.put(\"hasLowMiles\", \"1\");\n car6.put(\"hasPowerWindows\", \"1\");\n car6.put(\"hasNavigation\", \"1\");\n car6.put(\"hasHeatedSeats\", \"1\");\n\n Map<String, String> car7 = new HashMap<>();\n car7.put(\"_id\", \"59d2698cd6a3b8f0dd994c9d\");\n car7.put(\"make\", \"Toyota\");\n car7.put(\"year\", \"2015\");\n car7.put(\"color\", \"Black\");\n car7.put(\"price\", \"13170\");\n car7.put(\"hasSunroof\", \"1\");\n car7.put(\"isFourWheelDrive\", \"0\");\n car7.put(\"hasLowMiles\", \"1\");\n car7.put(\"hasPowerWindows\", \"1\");\n car7.put(\"hasNavigation\", \"0\");\n car7.put(\"hasHeatedSeats\", \"0\");\n\n Map<String, String> car8 = new HashMap<>();\n car8.put(\"_id\", \"59d2698c86ab54cee8acdc7b\");\n car8.put(\"make\", \"Mercedes\");\n car8.put(\"year\", \"2013\");\n car8.put(\"color\", \"Gray\");\n car8.put(\"price\", \"15669\");\n car8.put(\"hasSunroof\", \"0\");\n car8.put(\"isFourWheelDrive\", \"0\");\n car8.put(\"hasLowMiles\", \"1\");\n car8.put(\"hasPowerWindows\", \"0\");\n car8.put(\"hasNavigation\", \"0\");\n car8.put(\"hasHeatedSeats\", \"0\");\n\n Map<String, String> car9 = new HashMap<>();\n car9.put(\"_id\", \"59d2698cda9e8d39476c678a\");\n car9.put(\"make\", \"Toyota\");\n car9.put(\"year\", \"2015\");\n car9.put(\"color\", \"White\");\n car9.put(\"price\", \"16629\");\n car9.put(\"hasSunroof\", \"0\");\n car9.put(\"isFourWheelDrive\", \"0\");\n car9.put(\"hasLowMiles\", \"1\");\n car9.put(\"hasPowerWindows\", \"0\");\n car9.put(\"hasNavigation\", \"0\");\n car9.put(\"hasHeatedSeats\", \"1\");\n\n //create an arraylist of each map created\n //so one for loop can be use to insert the\n //entire sample data set\n ArrayList<Map> carMap = new ArrayList<>();\n carMap.add(car1);\n carMap.add(car2);\n carMap.add(car3);\n carMap.add(car4);\n carMap.add(car5);\n carMap.add(car6);\n carMap.add(car7);\n carMap.add(car8);\n carMap.add(car9);\n\n\n for(int i = 0; i < carMap.size(); i++) {\n values.put(Cars.COLUMN__ID, carMap.get(i).get(\"_id\").toString());\n values.put(Cars.COLUMN_MAKE, carMap.get(i).get(\"make\").toString());\n values.put(Cars.COLUMN_YEAR, carMap.get(i).get(\"year\").toString());\n values.put(Cars.COLUMN_COLOR, carMap.get(i).get(\"color\").toString());\n values.put(Cars.COLUMN_PRICE, carMap.get(i).get(\"price\").toString());\n values.put(Cars.COLUMN_HASSUNROOF, carMap.get(i).get(\"hasSunroof\").toString());\n values.put(Cars.COLUMN_ISFOURWHEELDRIVE, carMap.get(i).get(\"isFourWheelDrive\").toString());\n values.put(Cars.COLUMN_HASLOWMILES, carMap.get(i).get(\"hasLowMiles\").toString());\n values.put(Cars.COLUMN_HASPOWERWINDOWS, carMap.get(i).get(\"hasPowerWindows\").toString());\n values.put(Cars.COLUMN_HASNAVIGATION, carMap.get(i).get(\"hasNavigation\").toString());\n values.put(Cars.COLUMN_HASHEATEDSEATS, carMap.get(i).get(\"hasHeatedSeats\").toString());\n\n //insert each car\n db.insert(Cars.TABLE_NAME, null, values);\n }\n db.close();\n }", "private void insertDummyData()\n {\n\n for (int i = 1; i <= 9; i++)\n {\n /* ContentValues employeeValues = new ContentValues();\n employeeValues.put(\"emp_id\", \"emp_id\" + i);\n employeeValues.put(\"imei\", \"IMEI-\" + i);\n employeeValues.put(\"reports_to\", \"emp_id0\");\n employeeValues.put(\"emp_name\", \"emp_name\" + i);\n employeeValues.put(\"emp_username\", \"u\" + i);\n employeeValues.put(\"emp_password\", \"p\" + i);\n employeeValues.put(\"created_date\", getTodayDate());\n employeeValues.put(\"modified_date\", getTodayDate());\n employeeValues.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_EMPLOYEE, null, employeeValues);*/\n\n /* ContentValues retailerValues = new ContentValues();\n retailerValues.put(\"retailer_id\", \"retailer_id\" + i);\n retailerValues.put(\"emp_id\", \"emp_id\" + i);\n retailerValues.put(\"retailer_name\", \"retailer_name\" + i);\n retailerValues.put(\"shop_name\", \"shop_name\" + i);\n retailerValues.put(\"shop_address\", \"shop_address\" + i);\n retailerValues.put(\"pincode\", \"pincode\" + i);\n retailerValues.put(\"mobile_no\", \"900080000\" + i);\n retailerValues.put(\"email\", \"email\" + i);\n retailerValues.put(\"area_id\", \"area_id\" + i);\n retailerValues.put(\"latitude\", NOT_PRESENT);\n retailerValues.put(\"longitude\", NOT_PRESENT);\n retailerValues.put(\"img_source\", NOT_PRESENT);\n retailerValues.put(\"created_date\", getTodayDate());\n retailerValues.put(\"modified_date\", getTodayDate());\n retailerValues.put(\"landmark\", \"landmark\" + i);\n retailerValues.put(\"area\", \"area\" + i);\n retailerValues.put(\"taluk\", \"taluk\" + i);\n retailerValues.put(\"district\", \"district\" + i);\n retailerValues.put(\"state\", \"state\" + i);\n retailerValues.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_RETAILER, null, retailerValues);*/\n\n ContentValues schemeValues = new ContentValues();\n schemeValues.put(\"scheme_id\", \"scheme_id\" + i);\n schemeValues.put(\"scheme_name\", \"scheme_name\" + i);\n schemeValues.put(\"scheme_description\", \"scheme_description\" + i);\n schemeValues.put(\"created_date\", String.format(getTodayDate(), -2));\n schemeValues.put(\"start_date\", String.format(getTodayDate(), -1));\n schemeValues.put(\"end_date\", getTodayDate());\n schemeValues.put(\"is_viewed\", 0);\n schemeValues.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_SCHEME, null, schemeValues);\n }\n\n /* for(int i = 1; i <= 10; i++)\n {\n ContentValues skuValues = new ContentValues();\n skuValues.put(\"sku_id\", \"sku_id\" + i);\n skuValues.put(\"sku_name\", \"sku_name\" + i);\n skuValues.put(\"sku_price\", +i);\n skuValues.put(\"description\", \"description\" + i);\n skuValues.put(\"sku_category\", \"sku_category\" + i);\n skuValues.put(\"sku_sub_category\", \"sku_sub_category\" + i);\n skuValues.put(\"new_sku\", 1);\n skuValues.put(\"promotional_sku\", 1);\n skuValues.put(\"sku_photo_source\", \"sku_photo_source\" + i);\n skuValues.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_SKU, null, skuValues);\n }\n\n //To display similar SKUs - SKUs with same cat, sub_cat as above\n for(int catAndSubCat = 1; catAndSubCat <= 10; catAndSubCat++)\n {\n int j = catAndSubCat + 10;\n\n ContentValues skuValues = new ContentValues();\n skuValues.put(\"sku_id\", \"sku_id\" + j);\n skuValues.put(\"sku_name\", \"sku_name\" + j);\n skuValues.put(\"sku_price\", +j);\n skuValues.put(\"description\", \"description\" + j);\n skuValues.put(\"sku_category\", \"sku_category\" + catAndSubCat);\n skuValues.put(\"sku_sub_category\", \"sku_sub_category\" + catAndSubCat);\n skuValues.put(\"new_sku\", 1);\n skuValues.put(\"promotional_sku\", 1);\n skuValues.put(\"sku_photo_source\", \"sku_photo_source\" + j);6+\n skuValues.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_SKU, null, skuValues);\n }*/\n\n /* insertIntoGlobalAttrTable(\"color\", \"colorSet1\", \"any`red`green`blue\");\n insertIntoGlobalAttrTable(\"color\", \"colorSet2\", \"any`pink`cyan`black\");\n insertIntoGlobalAttrTable(\"size\", \"sizeSet1\", \"any`tiny`xlarge`medium\");\n insertIntoGlobalAttrTable(\"size\", \"sizeSet2\", \"any`large`small`xxlarge\");\n insertIntoGlobalAttrTable(\"shape\", \"shapeSet1\", \"any`circular`oval\");\n insertIntoGlobalAttrTable(\"shape\", \"shapeSet2\", \"any`square`rectangle\");*/\n\n /* for(int i = 1; i <= 20; i++)\n {\n if((i % 2) == 0)\n {\n insetIntoSkuAttrMappingTable(i, 2);\n insetIntoSkuAttrMappingTable(i, 4);\n insetIntoSkuAttrMappingTable(i, 6);\n }\n else\n {\n insetIntoSkuAttrMappingTable(i, 1);\n insetIntoSkuAttrMappingTable(i, 3);\n //insetIntoSkuAttrMappingTable(i,5);\n }\n }*/\n\n ContentValues configValues = new ContentValues();\n configValues.put(\"config_for\", \"retailer visits per day\");\n configValues.put(\"config_value\", \"15\");\n configValues.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_CONFIG, null, configValues);\n\n ContentValues configValues2 = new ContentValues();\n configValues2.put(\"config_for\", \"default date range in months\");\n configValues2.put(\"config_value\", \"1\");\n configValues2.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_CONFIG, null, configValues2);\n\n ContentValues configValues3 = new ContentValues();\n configValues3.put(\"config_for\", \"maximum date range in months\");\n configValues3.put(\"config_value\", \"6\");\n configValues3.put(\"upload_status\", 0);\n sqLiteDatabase.insert(TBL_CONFIG, null, configValues3);\n }", "@Override\n public void onCreate(SQLiteDatabase db){\n String createTripTable = \"CREATE TABLE \" + TABLE_TRIP + \" (\"\n + COLUMN_TRIP_ID + \" INTEGER primary key, \"\n + COLUMN_TRIP_LOCATION_ID + \" REFERENCES location(_id), \"\n + COLUMN_TRIP_TIME + \" TEXT, \"\n + COLUMN_TRIP_ACTIVE + \" INTEGER, \"\n + COLUMN_TRIP_ARRIVED + \" INTEGER,\"\n + COLUMN_TRIP_FINISHED + \" INTEGER);\";\n\n // Create trip table\n db.execSQL(createTripTable);\n\n // SQL script used to create location table\n String createLocTable = \"CREATE TABLE \" + TABLE_LOCATION + \" (\"\n + COLUMN_LOC_ID + \" INTEGER primary key AUTOINCREMENT, \"\n + COLUMN_LOC_LAT + \" REAL, \"\n + COLUMN_LOC_LONG + \" REAL, \"\n + COLUMN_LOC_NAME + \" TEXT, \"\n + COLUMN_LOC_ADDRESS + \" TEXT)\";\n\n // Create location table\n db.execSQL(createLocTable);\n\n // SQL script used to create person table\n String createPersonTable = \"CREATE TABLE \" + TABLE_PERSON + \" (\"\n + COLUMN_PERSON_ID + \" INTEGER primary key AUTOINCREMENT, \"\n + COLUMN_PERSON_NAME + \" TEXT, \"\n + COLUMN_PERSON_PHONENUM + \" INTEGER)\";\n // Create person table\n db.execSQL(createPersonTable);\n\n // SQL script used to create trip-person-map table\n String createTripPersonMapTable = \"CREATE TABLE \" + TABLE_TRIP_PERSON_MAP + \" (\"\n + COLUMN_TPM_ID + \" INTEGER primary key AUTOINCREMENT, \"\n + COLUMN_TPM_TRIPID + \" INTEGER references trip(_id), \"\n + COLUMN_TPM_PERSONID + \" INTEGER references person(_id))\";\n // Create trip-person-map table\n db.execSQL(createTripPersonMapTable);\n }", "@Override\n public void onCreate(SQLiteDatabase sqLiteDatabase) {\n final String SQL_CREATE_COUNTRY_TABLE = \"CREATE TABLE \" + CountryEntry.TABLE_NAME + \" \" +\n \"( \" +\n CountryEntry._ID + \" INTEGER PRIMARY KEY AUTOINCREMENT, \" +\n CountryEntry.COLUMN_NAME + \" TEXT NOT NULL,\" +\n CountryEntry.COLUMN_API_ID + \" TEXT NOT NULL UNIQUE,\" +\n CountryEntry.COLUMN_CAPITAL_CITY + \" TEXT,\" +\n CountryEntry.COLUMN_LATITUDE + \" REAL,\" +\n CountryEntry.COLUMN_LONGITUDE + \" REAL\"\n + \")\";\n sqLiteDatabase.execSQL(SQL_CREATE_COUNTRY_TABLE);\n\n final String SQL_CREATE_METRIC_TABLE = \"CREATE TABLE \" + MetricEntry.TABLE_NAME + \" \" +\n \"( \" +\n MetricEntry._ID + \" INTEGER PRIMARY KEY AUTOINCREMENT ,\" +\n MetricEntry.COLUMN_API_ID + \" TEXT NOT NULL UNIQUE,\" +\n MetricEntry.COLUMN_DESCRIPTION + \" TEXT NOT NULL,\" +\n MetricEntry.COLUMN_NAME + \" TEXT NOT NULL\"\n + \")\";\n sqLiteDatabase.execSQL(SQL_CREATE_METRIC_TABLE);\n\n final String SQL_CREATE_DATA_POINT_TABLE = \"CREATE TABLE \" + DataPointEntry.TABLE_NAME +\n \" (\" +\n DataPointEntry._ID + \" INTEGER PRIMARY KEY AUTOINCREMENT,\" +\n DataPointEntry.COLUMN_COUNTRY_ID + \" INTEGER NOT NULL,\" +\n DataPointEntry.COLUMN_METRIC_ID + \" INTEGER NOT NULL,\" +\n DataPointEntry.COLUMN_YEAR + \" INTEGER NOT NULL,\" +\n DataPointEntry.COLUMN_VALUE + \" REAL NOT NULL,\" +\n \"FOREIGN KEY (\" + DataPointEntry.COLUMN_COUNTRY_ID + \") REFERENCES \" +\n CountryEntry.TABLE_NAME + \" (\" + CountryEntry._ID + \"),\" +\n \"FOREIGN KEY (\" + DataPointEntry.COLUMN_METRIC_ID + \") REFERENCES \" +\n MetricEntry.TABLE_NAME + \" (\" + MetricEntry._ID + \")\" +\n \"UNIQUE(\" + DataPointEntry.COLUMN_METRIC_ID + \", \" +\n DataPointEntry.COLUMN_COUNTRY_ID + \" ,\" +\n DataPointEntry.COLUMN_YEAR + \") ON CONFLICT IGNORE\"\n + \")\";\n sqLiteDatabase.execSQL(SQL_CREATE_DATA_POINT_TABLE);\n\n }", "@Override\n\tpublic void onCreate(SQLiteDatabase db) \n\t{\n\n\t\tString query_table1 = \"CREATE TABLE SPATIAL_FEATURES (FEATURE_ID INTEGER PRIMARY KEY AUTOINCREMENT,SERVER_FEATURE_ID TEXT,COORDINATES TEXT,GEOMTYPE TEXT,CREATEDTIME TEXT,STATUS TEXT,COMPLETEDTIME TEXT,SERVER_PK TEXT,IMEI TEXT,PERSON_TYPE TEXT,HAMLET_ID INTEGER,WITNESS_1 TEXT,WITNESS_2 TEXT)\";\n\t\tString query_table2 = \"CREATE TABLE ATTRIBUTE_MASTER(ID INTEGER PRIMARY KEY AUTOINCREMENT,ATTRIB_ID INTEGER,ATTRIBUTE_TYPE STRING,ATTRIBUTE_CONTROLTYPE INTEGER,ATTRIBUTE_NAME TEXT,LISTING TEXT,ATTRIBUTE_NAME_OTHER TEXT,VALIDATION TEXT)\";\n\t\tString query_table3 = \"CREATE TABLE OPTIONS(OPTION_ID TEXT,ATTRIB_ID INTEGER,OPTION_NAME TEXT,OPTION_NAME_OTHER TEXT)\";\n\t\tString query_table4 = \"CREATE TABLE FORM_VALUES(GROUP_ID INTEGER,ATTRIB_ID INTEGER,ATTRIB_VALUE TEXT,FEATURE_ID TEXT)\";\n\t\tString query_table5 = \"CREATE TABLE USER(USER_ID TEXT,USER_NAME TEXT,PASSWORD TEXT,ROLE_ID TEXT,ROLE_NAME TEXT)\";\n\t\tString query_table6 = \"CREATE TABLE BOOKMARKS(ID INTEGER PRIMARY KEY AUTOINCREMENT,NAME TEXT,LATITUDE TEXT,LONGITUDE TEXT,ZOOMLEVEL TEXT)\";\n\t\tString query_table7 = \"CREATE TABLE MEDIA(MEDIA_ID INTEGER PRIMARY KEY,FEATURE_ID TEXT,TYPE TEXT,PATH TEXT,ATTRIB_1 TEXT,ATTRIB_2 TEXT,SYNCED INTEGER DEFAULT 0)\";\n\t\tString query_table8 = \"CREATE TABLE PERSON(ID INTEGER PRIMARY KEY,ATTRIB_1 TEXT,ATTRIB_2 TEXT,FEATURE_ID TEXT,SERVER_PK TEXT,PERSON_SUBTYPE TEXT)\";\n\t\t\n\t\tString query_table10 = \"CREATE TABLE SOCIAL_TENURE(ID INTEGER PRIMARY KEY,ATTRIB_1 TEXT,ATTRIB_2 TEXT,PERSON_ID INTEGER,FEATURE_ID TEXT,SERVER_PK TEXT)\";\n\t\tString query_table11 = \"CREATE TABLE GROUPID_SEQ(VALUE INTEGER)\";\n\t\tString query_table12 = \"CREATE TABLE PERSON_MEDIA(ID INTEGER PRIMARY KEY AUTOINCREMENT,PERSON_ID TEXT,TYPE TEXT,PATH TEXT,FEATURE_ID TEXT,SYNCED INTEGER DEFAULT 0)\";\n\t\tString query_table13 = \"CREATE TABLE PROJECT_SPATIAL_DATA(SERVER_PK INTEGER,PROJECT_NAME TEXT,FILE_NAME TEXT,FILE_EXT TEXT,ALIAS TEXT,VILLAGE_NAME TEXT)\";\n\t\t\n\t\t// added for phase 2 on 18/09/2015\n\t\t\n\t\tString query_table14 = \"CREATE TABLE HAMLET_DETAILS(ID INTEGER PRIMARY KEY ,HAMLET_NAME TEXT)\";\n\t\tString query_table15 = \"CREATE TABLE ADJUDICATOR_DETAILS(ID INTEGER PRIMARY KEY,ADJUDICATOR_NAME TEXT)\";\n\t\tString query_table16 = \"CREATE TABLE NEXT_KIN_DETAILS(ID INTEGER PRIMARY KEY AUTOINCREMENT,NEXT_KIN_NAME TEXT,FEATURE_ID TEXT)\";\n\t\tString query_table17 = \"CREATE TABLE DECEASED_PERSON(ID INTEGER PRIMARY KEY AUTOINCREMENT,FIRST_NAME TEXT,MIDDLE_NAME TEXT,LAST_NAME TEXT,FEATURE_ID TEXT)\";\n \n\t\n\t\t\n\t\ttry \n\t\t{\n\t\t\tdropTable(db, \"SPATIAL_FEATURES\");\n\t\t\tdb.execSQL(query_table1);\n\t\t} catch (Exception e) {\n\t\t\tcf.appLog(\"\", e);e.printStackTrace();\n\t\t}\n\t\ttry \n\t\t{\n\t\t\tdropTable(db, \"ATTRIBUTE_MASTER\");\n\t\t\tdropTable(db, \"OPTIONS\");\n\t\t\tdb.execSQL(query_table2);\n\n\t\t} catch (Exception e) {\n\t\t\tcf.appLog(\"\", e);e.printStackTrace();\n\t\t}\t\t\n\t\ttry \n\t\t { db.execSQL(query_table3);\n\t\t\tdb.execSQL(query_table4);\n\t\t\tdb.execSQL(query_table5);\n\t\t\tdb.execSQL(query_table6);\n\t\t\tdb.execSQL(query_table7);\n\t\t\tdb.execSQL(query_table8);\n\t\t\t\n\t\t\tdb.execSQL(query_table10);\n\t\t\tdb.execSQL(query_table11);\n\t\t\tdb.execSQL(query_table12);\n\t\t\tdb.execSQL(query_table13);\n\t\t\t db.execSQL(query_table14);\n\t\t\t\tdb.execSQL(query_table15);\n\t\t\t\tdb.execSQL(query_table16);\n\t\t\t\tdb.execSQL(query_table17);\n\t\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tcf.appLog(\"\", e);e.printStackTrace();\n\t\t}\n\t\t\n//\tinsertValues(db);\n\t}", "@Override\n public void onCreate(SQLiteDatabase db) {\n final String SQL_CREATE_USER_TABLE = \"CREATE TABLE \" + UserEntry.TABLE_NAME + \" (\" +\n UserEntry.COLUMN_USER_ID + \" TEXT UNIQUE PRIMARY KEY,\" +\n UserEntry.COLUMN_USER_NAME + \" TEXT NOT NULL,\" +\n UserEntry.COLUMN_USER_ADDRESS + \" TEXT,\" +\n UserEntry.COLUMN_USER_EMAIL + \" TEXT NOT NULL,\" +\n UserEntry.COLUMN_USER_PHONE + \" TEXT NOT NULL,\" +\n UserEntry.COLUMN_USER_BDAY + \" INTEGER,\" +\n UserEntry.COLUMN_USER_IMAGE + \" TEXT,\" +\n UserEntry.COLUMN_USER_TOKEN + \" TEXT NOT NULL\" +\n \");\";\n\n // Create a table to hold doctor info data. A doctor consists of the string supplied\n // with id, name, email, address, phone, image path, license, speciality, work time\n // , work days, rating and location coordination ( lat, lng) to add on map\n final String SQL_CREATE_DOCTOR_TABLE = \"CREATE TABLE \" + DoctorEntry.TABLE_NAME + \" (\" +\n DoctorEntry.COLUMN_DR_ID + \" TEXT UNIQUE PRIMARY KEY,\" +\n DoctorEntry.COLUMN_DR_NAME + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_ADDRESS + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_EMAIL + \" TEXT UNIQUE NOT NULL,\" +\n DoctorEntry.COLUMN_DR_PHONE + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_LICENSE + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_IMAGE + \" TEXT,\" +\n DoctorEntry.COLUMN_DR_SPECIALITY + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_WORKDAYS + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_WORKTIME + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_LOCATION + \" TEXT NOT NULL,\" +\n DoctorEntry.COLUMN_DR_RATING + \" INTEGER\" +\n DoctorEntry.COLUMN_IS_FAV + \" INTEGER\" +\n \");\";\n\n // Create table hold booking info data. A booking data consists of string and boolean value\n // like : booking id, doctor, date , time, email, phone, is checked or not, rebook days\n // Foreign key (booking_doctor) column with dr_id column on DOCTOR table\n final String SQL_CREATE_BOOKING_TABLE = \"CREATE TABLE \" + BookingEntry.TABLE_NAME + \" (\" +\n\n BookingEntry.COLUMN_BOOKING_ID + \" INTEGER PRIMARY KEY,\" +\n BookingEntry.COLUMN_BOOKING_DOCTOR + \" TEXT NOT NULL,\" +\n BookingEntry.COLUMN_BOOKING_DATE + \" INTEGER NOT NULL,\" +\n BookingEntry.COLUMN_BOOKING_TIME + \" TEXT NOT NULL,\" +\n BookingEntry.COLUMN_BOOKING_EMAIL + \" TEXT NOT NULL,\" +\n BookingEntry.COLUMN_BOOKING_PHONE + \" TEXT NOT NULL,\" +\n BookingEntry.COLUMN_REBOOK_DAYS + \" INTEGER,\" +\n BookingEntry.COLUMN_IS_CHECKED + \" INTEGER,\" +\n // Set up the booking_doctor column as a foreign key to DOCTOR table.\n \" FOREIGN KEY (\" + BookingEntry.COLUMN_BOOKING_DOCTOR + \") REFERENCES \" +\n DoctorEntry.TABLE_NAME + \" (\" + DoctorEntry.COLUMN_DR_ID + \"); \" +\n \");\";\n\n //Create table hold favoured doctor by current user. This contain foreign key with DOCTOR\n // table\n final String SQL_CREATE_FAV_DOCTOR_TABLE = \"CREATE TABLE \" + FavDoctorEntry.TABLE_NAME + \" (\" +\n FavDoctorEntry._ID + \" INTEGER UNIQUE PRIMARY KEY AUTOINCREMENT,\" +\n FavDoctorEntry.COLUMN_DR_ID + \" TEXT NOT NULL,\" +\n // Set up the dr_id column as a foreign key to DOCTOR table.\n \" FOREIGN KEY (\" + FavDoctorEntry.COLUMN_DR_ID + \") REFERENCES \" +\n DoctorEntry.TABLE_NAME + \" (\" + DoctorEntry.COLUMN_DR_ID + \")\" +\n \");\";\n\n //Create table hold user logging data ( sign in, sign out, make booking, location,etc...) ,\n // and contain 2 foreign keys: 1 with DOCTOR table(log_doctor) and 1 with USER table(log_user)\n final String SQL_CREATE_USER_LOG_TABLE = \"CREATE TABLE \" + UserLogEntry.TABLE_NAME + \" (\" +\n UserLogEntry._ID + \" INTEGER UNIQUE PRIMARY KEY AUTOINCREMENT,\" +\n UserLogEntry.COLUMN_LOG_USER + \" TEXT NOT NULL,\" +\n UserLogEntry.COLUMN_LOG_DOCTOR + \" TEXT,\" +\n UserLogEntry.COLUMN_LOG_ADDRESS + \" TEXT NOT NULL,\" +\n UserLogEntry.COLUMN_LOG_DATE + \" INTEGER NOT NULL,\" +\n UserLogEntry.COLUMN_LOG_LOCATION + \" TEXT NOT NULL,\" +\n UserLogEntry.COLUMN_LOG_SYNC + \" INTEGER NOT NULL,\" +\n // Set up the log_doctor column as a foreign key to DOCTOR table.\n \" FOREIGN KEY (\" + UserLogEntry.COLUMN_LOG_DOCTOR + \") REFERENCES \" +\n DoctorEntry.TABLE_NAME + \" (\" + DoctorEntry.COLUMN_DR_ID + \"), \" +\n // Set up the log_user column as a foreign key to USER table.\n \" FOREIGN KEY (\" + UserLogEntry.COLUMN_LOG_USER + \") REFERENCES \" +\n UserEntry.TABLE_NAME + \" (\" + UserEntry.COLUMN_USER_ID + \")\" +\n \");\";\n\n //Execute SQL query to create tables\n db.execSQL(SQL_CREATE_USER_TABLE);\n db.execSQL(SQL_CREATE_DOCTOR_TABLE);\n db.execSQL(SQL_CREATE_BOOKING_TABLE);\n db.execSQL(SQL_CREATE_FAV_DOCTOR_TABLE);\n db.execSQL(SQL_CREATE_USER_LOG_TABLE);\n }", "public long initializeDB() {\n /*\n * A long variable to hold the insert results.\n */\n long queryResult = 0;\n\n // A couple of syntax examples for future use.\n //INSERT OR IGNORE INTO bookmarks(users_id, lessoninfo_id) VALUES(123, 456)\n //database.execSQL(CREATE_ITEM0);\n\n /*\n * Create a pair of string arrays holding the USERS and ITEMS table initialization\n * values, respectively.\n */\n String[] initUserStrings = {\n \"username:user,password:user,email:[email protected],card:333388888899999,expire:01/23,cvv:1234\",\n \"username:admin,password:admin,email:[email protected],card:0000000000000000,expire:00/00,cvv:000\",\n \"username:michael,password:michael,email:[email protected],card:4444777788889999,expire:12/24,cvv:765\"\n };\n\n /*\n * Future use, separation of user and card info.\n *\n String[] initCardStrings = {\n \"username:user,password:user,email:[email protected],card:333388888899999,expire:01/23,cvv:1234\",\n \"username:admin,password:admin,email:[email protected],card:0000000000000000,expire:00/00,cvv:000\",\n \"username:michael,password:michael,email:[email protected],card:4444777788889999,expire:12/24,cvv:765\"\n };\n */\n\n String[] initItemStrings = {\n \"item_name:Small Coffee,item_price:1.99,item_image_file:small_coffee\",\n \"item_name:Medium Coffee,item_price:2.49,item_image_file:medium_coffee\",\n \"item_name:Large Coffee,item_price:2.99,item_image_file:large_coffee\",\n \"item_name:Small Tea,item_price:1.99,item_image_file:small_tea\",\n \"item_name:Medium Tea,item_price:2.49,item_image_file:medium_tea\",\n \"item_name:Large Tea,item_price:2.99,item_image_file:large_tea\",\n \"item_name:Cafe Latte,item_price:3.49\",\n \"item_name:Cappucino,item_price:3.49\",\n \"item_name:Bagel,item_price:1.00\",\n \"item_name:Donut,item_price:1.00\",\n \"item_name:Muffin,item_price:2.49\",\n \"item_name:12 Munchkins,item_price:2.99\"\n };\n\n /*\n * Now iterate over the String arrays, once for USERS, once for ITEMS.\n *\n * ToDo: Add error/exception checking.\n */\n for(String insertString: initUserStrings) {\n queryResult = this.insert(DBHelper.USERS_TABLE_NAME, insertString);\n }\n\n /*\n * Future use, separation of user and card info.\n *\n for(String insertString: initCardStrings) {\n queryResult = this.insert(DBHelper.CARDS_TABLE_NAME, insertString);\n }\n */\n\n for(String insertString: initItemStrings) {\n queryResult = this.insert(DBHelper.ITEMS_TABLE_NAME, insertString);\n }\n\n return(queryResult);\n }", "public void loadDataFromDatabase(Context context) {\n String[] projection = {WaypointsTable.COLUMN_LATITUDE, WaypointsTable.COLUMN_LONGITUDE, WaypointsTable.COLUMN_NAME, WaypointsTable.COLUMN_QUIZ_ID};\n String selection = WaypointsTable.COLUMN_WAYPOINT_ID + \"=?\";\n String[] selectionArgs = {\"\" + mId};\n\n Cursor cursor = context.getContentResolver().query(WeltkulturerbeContentProvider.URI_TABLE_WAYPOINTS, projection, selection, selectionArgs, null);\n if (cursor.moveToNext()) {\n mLatitude = cursor.getFloat(cursor.getColumnIndex(WaypointsTable.COLUMN_LATITUDE));\n mLongitude = cursor.getFloat(cursor.getColumnIndex(WaypointsTable.COLUMN_LONGITUDE));\n mName = cursor.getString(cursor.getColumnIndex(WaypointsTable.COLUMN_NAME));\n mQuizId = cursor.getInt(cursor.getColumnIndex(WaypointsTable.COLUMN_QUIZ_ID));\n }\n cursor.close();\n }", "final java.util.Map<java.lang.Integer, java.util.List<com.google.android.gms.internal.measurement.zzkk>> zzl(java.lang.String r13, java.lang.String r14) {\n /*\n r12 = this;\n r12.zzch();\n r12.zzab();\n com.google.android.gms.common.internal.Preconditions.checkNotEmpty(r13);\n com.google.android.gms.common.internal.Preconditions.checkNotEmpty(r14);\n r0 = new android.support.v4.util.ArrayMap;\n r0.<init>();\n r1 = r12.getWritableDatabase();\n r9 = 0;\n r2 = \"property_filters\";\n r3 = \"audience_id\";\n r4 = \"data\";\n r3 = new java.lang.String[]{r3, r4};\t Catch:{ SQLiteException -> 0x0096, all -> 0x0093 }\n r4 = \"app_id=? AND property_name=?\";\n r5 = 2;\n r5 = new java.lang.String[r5];\t Catch:{ SQLiteException -> 0x0096, all -> 0x0093 }\n r10 = 0;\n r5[r10] = r13;\t Catch:{ SQLiteException -> 0x0096, all -> 0x0093 }\n r11 = 1;\n r5[r11] = r14;\t Catch:{ SQLiteException -> 0x0096, all -> 0x0093 }\n r6 = 0;\n r7 = 0;\n r8 = 0;\n r14 = r1.query(r2, r3, r4, r5, r6, r7, r8);\t Catch:{ SQLiteException -> 0x0096, all -> 0x0093 }\n r1 = r14.moveToFirst();\t Catch:{ SQLiteException -> 0x0091 }\n if (r1 != 0) goto L_0x0042;\n L_0x0038:\n r0 = java.util.Collections.emptyMap();\t Catch:{ SQLiteException -> 0x0091 }\n if (r14 == 0) goto L_0x0041;\n L_0x003e:\n r14.close();\n L_0x0041:\n return r0;\n L_0x0042:\n r1 = r14.getBlob(r11);\t Catch:{ SQLiteException -> 0x0091 }\n r2 = r1.length;\t Catch:{ SQLiteException -> 0x0091 }\n r1 = com.google.android.gms.internal.measurement.zzaca.zza(r1, r10, r2);\t Catch:{ SQLiteException -> 0x0091 }\n r2 = new com.google.android.gms.internal.measurement.zzkk;\t Catch:{ SQLiteException -> 0x0091 }\n r2.<init>();\t Catch:{ SQLiteException -> 0x0091 }\n r2.zzb(r1);\t Catch:{ IOException -> 0x0073 }\n r1 = r14.getInt(r10);\t Catch:{ SQLiteException -> 0x0091 }\n r3 = java.lang.Integer.valueOf(r1);\t Catch:{ SQLiteException -> 0x0091 }\n r3 = r0.get(r3);\t Catch:{ SQLiteException -> 0x0091 }\n r3 = (java.util.List) r3;\t Catch:{ SQLiteException -> 0x0091 }\n if (r3 != 0) goto L_0x006f;\n L_0x0063:\n r3 = new java.util.ArrayList;\t Catch:{ SQLiteException -> 0x0091 }\n r3.<init>();\t Catch:{ SQLiteException -> 0x0091 }\n r1 = java.lang.Integer.valueOf(r1);\t Catch:{ SQLiteException -> 0x0091 }\n r0.put(r1, r3);\t Catch:{ SQLiteException -> 0x0091 }\n L_0x006f:\n r3.add(r2);\t Catch:{ SQLiteException -> 0x0091 }\n goto L_0x0085;\n L_0x0073:\n r1 = move-exception;\n r2 = r12.zzgi();\t Catch:{ SQLiteException -> 0x0091 }\n r2 = r2.zziv();\t Catch:{ SQLiteException -> 0x0091 }\n r3 = \"Failed to merge filter\";\n r4 = com.google.android.gms.internal.measurement.zzfi.zzbp(r13);\t Catch:{ SQLiteException -> 0x0091 }\n r2.zze(r3, r4, r1);\t Catch:{ SQLiteException -> 0x0091 }\n L_0x0085:\n r1 = r14.moveToNext();\t Catch:{ SQLiteException -> 0x0091 }\n if (r1 != 0) goto L_0x0042;\n L_0x008b:\n if (r14 == 0) goto L_0x0090;\n L_0x008d:\n r14.close();\n L_0x0090:\n return r0;\n L_0x0091:\n r0 = move-exception;\n goto L_0x0098;\n L_0x0093:\n r13 = move-exception;\n r14 = r9;\n goto L_0x00b0;\n L_0x0096:\n r0 = move-exception;\n r14 = r9;\n L_0x0098:\n r1 = r12.zzgi();\t Catch:{ all -> 0x00af }\n r1 = r1.zziv();\t Catch:{ all -> 0x00af }\n r2 = \"Database error querying filters. appId\";\n r13 = com.google.android.gms.internal.measurement.zzfi.zzbp(r13);\t Catch:{ all -> 0x00af }\n r1.zze(r2, r13, r0);\t Catch:{ all -> 0x00af }\n if (r14 == 0) goto L_0x00ae;\n L_0x00ab:\n r14.close();\n L_0x00ae:\n return r9;\n L_0x00af:\n r13 = move-exception;\n L_0x00b0:\n if (r14 == 0) goto L_0x00b5;\n L_0x00b2:\n r14.close();\n L_0x00b5:\n throw r13;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzek.zzl(java.lang.String, java.lang.String):java.util.Map<java.lang.Integer, java.util.List<com.google.android.gms.internal.measurement.zzkk>>\");\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_db_add);\n btnAddData = (Button) findViewById(R.id.button_AddToDbTable);\n m_BtnViewAllData = (Button) findViewById(R.id.button_ViewData);\n mySurveyTable = new MySQLiteHelperSurveyTable(this);\n mSurveyPref = PreferenceManager.getDefaultSharedPreferences(AddSurveyTableActivity.this);\n mSurveyDate = mSurveyPref.getString(\"date_preference\", \"29/04/16\");\n mStartTime = mSurveyPref.getString(\"start_time_preference\", null);\n mEndTime = mSurveyPref.getString(\"end_time_preference\", null);\n mWeather = mSurveyPref.getString(\"weather_preference\", null);\n assert mWeather != null;\n\n // Assign certain string values to mWeatherArray based on array value stored after user section\n switch(mWeather){\n case \"1\": mWeatherArray = \"Dry and sunny\"; break;\n case \"2\": mWeatherArray = \"Dry and overcast\"; break;\n case \"3\": mWeatherArray = \"Raining\"; break;\n case \"4\": mWeatherArray = \"Snowing\"; break;\n case \"5\": mWeatherArray = \"Frost\"; break;\n case \"6\": mWeatherArray = \"Other\"; break;\n default: mWeatherArray = \"Weather Unknown \"; break;\n }\n mRoadCondition = mSurveyPref.getString(\"surface_preference\", null);\n assert mRoadCondition != null;\n\n // Assign certain string values to mRoadArray based on array value stored after user section\n switch(mRoadCondition) {\n case \"1\": mRoadArray = \"Wet\"; break;\n case \"2\": mRoadArray = \"Dry\"; break;\n case \"3\": mRoadArray = \"Snow\"; break;\n case \"4\": mRoadArray = \"Ice\"; break;\n case \"5\": mRoadArray = \"Leafs\"; break;\n case \"6\": mRoadArray = \"InNeedOfRepair\"; break;\n case \"7\": mRoadArray = \"Other\"; break;\n default: mRoadArray = \"Surface Unknown \"; break;\n }\n\n // Call methods during onCreate\n addData();\n viewAll();\n }", "public void queryFields(String first, String last, String dob, String ssn){\n\n //search by firstname.\n if(!first.isEmpty() && last.isEmpty() && dob.isEmpty() && ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"firstname=?\",\n new String[]{first}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by lastname.\n else if(first.isEmpty() && !last.isEmpty() && dob.isEmpty() && ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"lastname=?\",\n new String[]{last}, null, null, null);\n\n result = new Intent(this, Result.class);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by dob\n else if(first.isEmpty() && last.isEmpty() && !dob.isEmpty() && ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"dob=?\",\n new String[]{dob}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by ssn\n else if(first.isEmpty() && last.isEmpty() && dob.isEmpty() && !ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"ssn=?\",\n new String[]{ssn}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by firstname and lastname.\n else if(!first.isEmpty() && !last.isEmpty() && dob.isEmpty() && ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"firstname=? and lastname =?\",\n new String[]{first, last}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by firstname and dob.\n else if(!first.isEmpty() && last.isEmpty() && !dob.isEmpty() && ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"firstname=? and dob =?\",\n new String[]{first, dob}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by lastname and dob.\n else if(first.isEmpty() && !last.isEmpty() && !dob.isEmpty() && ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"lastname=? and dob=?\",\n new String[]{last, dob}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by firstname, lastname and dob.\n else if(!first.isEmpty() && !last.isEmpty() && !dob.isEmpty() && ssn.isEmpty()){\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"firstname=? and lastname =? and dob=?\",\n new String[]{first, last, dob}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n startActivity(result);\n }\n else{\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n //search by firstname, lastname, dob, and ssn\n else if(!first.isEmpty() && !last.isEmpty() && !dob.isEmpty() && !ssn.isEmpty()) {\n\n Cursor temp = patientsDB.query(TABLE_NAME, null, \"firstname=? and lastname=? and dob=? and ssn=?\",\n new String[]{first, last, dob, ssn}, null, null, null);\n\n ArrayList<Integer> identification = new ArrayList<Integer>();\n ArrayList<String> firstN = new ArrayList<String>();\n ArrayList<String> lastN = new ArrayList<String>();\n ArrayList<String> dateofB = new ArrayList<String>();\n ArrayList<String> SSNumber = new ArrayList<String>();\n ArrayList<String> addr = new ArrayList<String>();\n ArrayList<String> insuranceNa = new ArrayList<String>();\n ArrayList<String> insuranceNum = new ArrayList<String>();\n ArrayList<String> dateofSer = new ArrayList<String>();\n ArrayList<String> cond = new ArrayList<String>();\n ArrayList<String> treat = new ArrayList<String>();\n\n result = new Intent(this, Result.class);\n\n if(temp.getCount() > 0 ){\n\n if(temp.moveToFirst()){\n\n do{\n\n //this was a problem because I was passing the lines individually\n //which overwrote the lines for duplicate patients in the Results Activity.\n /*result.putExtra(\"id\", temp.getInt(temp.getColumnIndex(\"_id\")));\n result.putExtra(\"firstname\", temp.getString(temp.getColumnIndex(\"firstname\")));\n result.putExtra(\"lastname\", temp.getString(temp.getColumnIndex(\"lastname\")));\n result.putExtra(\"dob\", temp.getString(temp.getColumnIndex(\"dob\")));\n result.putExtra(\"ssn\", temp.getString(temp.getColumnIndex(\"ssn\")));\n result.putExtra(\"address\", temp.getString(temp.getColumnIndex(\"address\")));\n result.putExtra(\"insurancename\", temp.getString(temp.getColumnIndex(\"insurancename\")));\n result.putExtra(\"insurancenumber\", temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n result.putExtra(\"dateofservice\", temp.getString(temp.getColumnIndex(\"dateofservice\")));\n result.putExtra(\"condition\", temp.getString(temp.getColumnIndex(\"condition\")));\n result.putExtra(\"treatment\", temp.getString(temp.getColumnIndex(\"treatment\")));*/\n\n //add lines to the arraylists\n identification.add(temp.getInt(temp.getColumnIndex(\"_id\")));\n firstN.add(temp.getString(temp.getColumnIndex(\"firstname\")));\n lastN.add(temp.getString(temp.getColumnIndex(\"lastname\")));\n dateofB.add(temp.getString(temp.getColumnIndex(\"dob\")));\n SSNumber.add(temp.getString(temp.getColumnIndex(\"ssn\")));\n addr.add(temp.getString(temp.getColumnIndex(\"address\")));\n insuranceNa.add(temp.getString(temp.getColumnIndex(\"insurancename\")));\n insuranceNum.add(temp.getString(temp.getColumnIndex(\"insurancenumber\")));\n dateofSer.add(temp.getString(temp.getColumnIndex(\"dateofservice\")));\n cond.add(temp.getString(temp.getColumnIndex(\"condition\")));\n treat.add(temp.getString(temp.getColumnIndex(\"treatment\")));\n\n }while(temp.moveToNext());\n }\n\n //pass the arraylists to Result Activity\n result.putIntegerArrayListExtra(\"id\", identification);\n result.putStringArrayListExtra(\"firstname\", firstN);\n result.putStringArrayListExtra(\"lastname\", lastN);\n result.putStringArrayListExtra(\"dob\", dateofB);\n result.putStringArrayListExtra(\"ssn\", SSNumber);\n result.putStringArrayListExtra(\"address\", addr);\n result.putStringArrayListExtra(\"insurancename\", insuranceNa);\n result.putStringArrayListExtra(\"insurancenumber\", insuranceNum);\n result.putStringArrayListExtra(\"dateofservice\", dateofSer);\n result.putStringArrayListExtra(\"condition\", cond);\n result.putStringArrayListExtra(\"treatment\", treat);\n\n startActivity(result);\n }\n else {\n Toast.makeText(this, \"Patient Not Found!\", Toast.LENGTH_LONG).show();\n }\n }\n\n else{ //field combination incorrect.\n\n Toast.makeText(this, \"Invalid Search!\", Toast.LENGTH_LONG).show();\n }\n }", "private void addData() {\n SQLiteDatabase db = dbHelper.getWritableDatabase();\r\n\r\n // Create a new map of values, where column names are the keys\r\n ContentValues values = new ContentValues();\r\n values.put(FeedEntry.COLUMN_NAME_TITLE, \"my_title\");\r\n values.put(FeedEntry.COLUMN_NAME_SUBTITLE, \"my_subtitle\");\r\n values.put(FeedEntry.COLUMN_NAME_PRIORITY, \"priority\");\r\n\r\n // Insert the new row, returning the primary key value of the new row\r\n long newRowId = db.insert(FeedEntry.TABLE_NAME, null, values);\r\n Log.i(TAG, \"perform add data, result:\" + newRowId);\r\n\r\n values.put(FeedEntry.COLUMN_NAME_TITLE, \"title1\");\r\n values.put(FeedEntry.COLUMN_NAME_SUBTITLE, \"my_subtitle1\");\r\n newRowId = db.insert(FeedEntry.TABLE_NAME, null, values);\r\n Log.i(TAG, \"perform add data(title1), result:\" + newRowId);\r\n\r\n values.put(FeedEntry.COLUMN_NAME_TITLE, \"title2\");\r\n values.put(FeedEntry.COLUMN_NAME_SUBTITLE, \"my_subtitle2\");\r\n newRowId = db.insert(FeedEntry.TABLE_NAME, null, values);\r\n Log.i(TAG, \"perform add data(title2), result:\" + newRowId);\r\n\r\n values.put(FeedEntry.COLUMN_NAME_TITLE, \"title3\");\r\n values.put(FeedEntry.COLUMN_NAME_SUBTITLE, \"my_subtitle3\");\r\n newRowId = db.insert(FeedEntry.TABLE_NAME, null, values);\r\n Log.i(TAG, \"perform add data(title3), result:\" + newRowId);\r\n\r\n// User user = new User();\r\n// user.firstName = \"zhang\";\r\n// user.lastName = \"san\";\r\n// AppDatabase.getInstance(this).userDao().insertAll(user);\r\n }", "public void doWorkStoreActivity(int start) {//\n\n// Log.d(LOG_TAG,\"cursorId = \" + start + \" size = \" +dbIdList.size() + \" value \" + dbIdList.get(start));\n\n db = dbHelper.getWritableDatabase();\n String selection = \" id LIKE ? \";\n\n if(dbIdList.size()>0) {// if next exists\n String[] selectionArgs = new String[]{dbIdList.get(start) + \"\"};\n Cursor c1 = db.query(\"data\", null, selection, selectionArgs, null, null, null);\n\n if (c1 != null) {\n c1.moveToFirst();\n\n// int idColIndex = c1.getColumnIndex(\"id\");\n int timeColIndex = c1.getColumnIndex(\"time\");\n int temperatureColIndex = c1.getColumnIndex(\"temperature\");\n int systolicColIndex = c1.getColumnIndex(\"systolic\");\n int diastolicColIndex = c1.getColumnIndex(\"diastolic\");\n int pulseColIndex = c1.getColumnIndex(\"pulse\");\n int sugarColIndex = c1.getColumnIndex(\"sugar\");\n\n// Log.d(LOG_TAG,\n// \"id = \" + c1.getString(idColIndex) + \", \" +\n// \"time = \" + c1.getString(timeColIndex) + \", \" +\n// \"temperature = \" + c1.getString(temperatureColIndex)+ \", \" +\n// \"systolic = \" + c1.getString(systolicColIndex) + \", \" +\n// \"diastolic = \" + c1.getString(diastolicColIndex) + \", \" +\n// \"pulse = \" + c1.getString(pulseColIndex) + \", \" +\n// \"sugar = \" + c1.getString(sugarColIndex)\n// );\n\n String moment = getMoment(Long.valueOf(c1.getString(timeColIndex)));\n date1.setText(moment);\n temperature1.setText(c1.getString(temperatureColIndex));\n high1.setText(c1.getString(systolicColIndex));\n low1.setText(c1.getString(diastolicColIndex));\n pulse1.setText(c1.getString(pulseColIndex));\n sugar1.setText(c1.getString(sugarColIndex));\n\n c1.close();\n }\n }\n else {\n Toast.makeText(getApplicationContext(), getString(R.string.EMPTY) + getString(R.string.UPS), Toast.LENGTH_LONG).show();\n go_activity_data();\n }\n\n if(dbIdList.size()>1) {// if next exists\n\n String[] selectionArgs2 = new String[]{dbIdList.get(start + 1) + \"\"};\n\n Cursor c2 = db.query(\"data\", null, selection, selectionArgs2, null, null, \"id DESC\");\n\n if (c2 != null) {\n c2.moveToFirst();\n\n// int idColIndex2 = c2.getColumnIndex(\"id\");\n int timeColIndex2 = c2.getColumnIndex(\"time\");\n int temperatureColIndex2 = c2.getColumnIndex(\"temperature\");\n int systolicColIndex2 = c2.getColumnIndex(\"systolic\");\n int diastolicColIndex2 = c2.getColumnIndex(\"diastolic\");\n int pulseColIndex2 = c2.getColumnIndex(\"pulse\");\n int sugarColIndex2 = c2.getColumnIndex(\"sugar\");\n\n\n// Log.d(LOG_TAG,\"id2 = \" + c2.getString(idColIndex2) + \", \" +\n// \"time2 = \" + c2.getString(timeColIndex2) + \", \" +\n// \"temperature2 = \" + c2.getString(temperatureColIndex2)+ \", \" +\n// \"systolic2 = \" + c2.getString(systolicColIndex2) + \", \" +\n// \"diastolic2 = \" + c2.getString(diastolicColIndex2) + \", \" +\n// \"pulse2 = \" + c2.getString(pulseColIndex2) + \", \" +\n// \"sugar2 = \" + c2.getString(sugarColIndex2)\n// );\n\n\n String moment2 = getMoment(Long.valueOf(c2.getString(timeColIndex2)));\n date2.setText(moment2);\n temperature2.setText(c2.getString(temperatureColIndex2));\n high2.setText(c2.getString(systolicColIndex2));\n low2.setText(c2.getString(diastolicColIndex2));\n pulse2.setText(c2.getString(pulseColIndex2));\n sugar2.setText(c2.getString(sugarColIndex2));\n\n c2.close();\n\n butRight.setVisibility(View.VISIBLE);\n\n }\n }\n\n\n dbHelper.close();\n\n}", "public void onClick(DialogInterface dialog, int whichButton) {\n\n distancefr = distancefrom.getText().toString();\n distancet = distanceto.getText().toString();\n nameofvehic = nameofvehicle.getText().toString();\n transportcoststring = Transportcost.getText().toString();\n distancekm = distanceinkm.getText().toString();\n costsstring = cost.getText().toString();\n mobrentstring = mobilerent.getText().toString();\n compensationsstring = Compensations.getText().toString();\n packetwithdrawstring = packetwithdraw.getText().toString();\n othercoststring = othercost.getText().toString();\n totalstring = total.getText().toString();\n\n Log.d(\"v\", String.valueOf(costs+mobrent+compensations+packetwidthdraw+othercosts));\n Log.d(\"ouputs\",\"from\"+distancefr+\"to\"+distancet+\"nameofvehic\"+nameofvehic+\"transportcost\"+transportcoststring+\"distancekm\"+distancekm+\"cost\"+costsstring+\"mobile\"+mobrentstring+\"compnesation\"+compensations+\"packet\"+packetdrawal+\"othercost\"+othercosts+\"total\"+totalstring);\n Log.d(\"values\",\"startjourfr\"+String.valueOf(calculateusedkm)+\"endjourneykm\"+String.valueOf(calculatesumkm2)+\"totaljourkm\"+String.valueOf(distotal)+\"personalusekm\"+String.valueOf(personaluse)+\"officeuse\"+String.valueOf(officeuse)+\"kmerent\"+String.valueOf(kmrent));\n /*\n startjournstring = input.getText().toString();\n endjourneystring = input1.getText().toString();\n totaljourneystring = input2.getText().toString();\n personalusestring = input3.getText().toString();\n officestring = input4.getText().toString();\n kmrentstring = input5.getText().toString();\n */\n\n //Toast.makeText(getApplicationContext(),\"costs\"+distancefr+\"mobrent\"+distancet+\"total\"+totals, Toast.LENGTH_LONG).show();\n\n new InsertintoDB().execute();\n\n\n\n }", "public void testInsertReadDb () {\n DatabaseHelper dbHelper = new DatabaseHelper(mContext);\n SQLiteDatabase db = dbHelper.getWritableDatabase();\n\n ContentValues cv = new ContentValues();\n\n String placeID = \"ChIJN1rU1nSFqkARt_B13ZcY8PI\";\n\n cv.put(DatabaseMap.PlaceEntry._ID, placeID);\n cv.put(DatabaseMap.PlaceEntry.PLACE_NAME, \"Starbucks Coffee\");\n cv.put(DatabaseMap.PlaceEntry.PLACE_ADDRESS, \"ulitsa Gen. Yosif V. Gurko 62, Sofia\");\n cv.put(DatabaseMap.PlaceEntry.PLACE_LAT, \"42.690506\");\n cv.put(DatabaseMap.PlaceEntry.PLACE_LNG, \"23.317773\");\n cv.put(DatabaseMap.PlaceEntry.PLACE_NUMBER, \"+359 2 986 3294\");\n cv.put(DatabaseMap.PlaceEntry.PLACE_WEB, \"http://www.starbucks.bg/bg/\");\n\n long placeRowId = db.insert(DatabaseMap.PlaceEntry.TABLE_NAME, null, cv);\n assertTrue(placeRowId != -1);\n\n Log.d(LOG_TAG, \"New place row id: \" + placeRowId);\n\n Cursor placeCursor = db.query(\n DatabaseMap.PlaceEntry.TABLE_NAME, // Table to Query\n null, // all columns\n null, // Columns for the \"where\" clause\n null, // Values for the \"where\" clause\n null, // columns to group by\n null, // columns to filter by row groups\n null // sort order\n );\n\n validateCursor(placeCursor, cv);\n\n cv.clear();\n\n cv.put(DatabaseMap.ReviewsEntry.PLACE_ID, placeID);\n cv.put(DatabaseMap.ReviewsEntry.USER_NAME, \"Gan Cho\");\n cv.put(DatabaseMap.ReviewsEntry.USER_COMMENT, \"No comment\");\n\n long reviewRowId = db.insert(DatabaseMap.ReviewsEntry.TABLE_NAME, null, cv);\n assertTrue(reviewRowId != -1);\n\n Log.d(LOG_TAG, \"New review row id: \" + reviewRowId);\n\n Cursor reviewCursor = db.query(\n DatabaseMap.ReviewsEntry.TABLE_NAME, // Table to Query\n null, // all columns\n null, // Columns for the \"where\" clause\n null, // Values for the \"where\" clause\n null, // columns to group by\n null, // columns to filter by row groups\n null // sort order\n );\n\n validateCursor(reviewCursor, cv);\n\n cv.clear();\n\n cv.put(DatabaseMap.PlaceTypeEntry.PLACE_ID, placeID);\n cv.put(DatabaseMap.PlaceTypeEntry.TYPE_ID, 0);\n\n long placeTypewRowId = db.insert(DatabaseMap.PlaceTypeEntry.TABLE_NAME, null, cv);\n assertTrue(placeTypewRowId != -1);\n\n Log.d(LOG_TAG, \"New place type row id: \" + placeTypewRowId);\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n Log.d(\"ae3cw4\", \"onCreate\");\n // TODO Auto-generated method stub\n db.execSQL(\"CREATE TABLE users (\" +\n \"_id INTEGER PRIMARY KEY AUTOINCREMENT ,\" +\n \"username VARCHAR(128) NOT NULL,\" +\n \"password VARCHAR(128) NOT NULL\" +\n \");\");\n\n db.execSQL(\"CREATE TABLE deliveries (\" +\n \"_id INTEGER PRIMARY KEY AUTOINCREMENT ,\" +\n \"pickUp VARCHAR(128) NOT NULL,\" +\n \"des VARCHAR(128) NOT NULL,\" +\n \"distance DOUBLE NOT NULL,\" +\n \"price DOUBLE NOT NULL,\" +\n \"status VARCHAR(128) NOT NULL,\" +\n \"finishTime VARCHAR(128)\" +\n \");\");\n\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status) VALUES ('Connecticut', 'Delaware', '10', '1.0', 'pending');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status, finishTime) VALUES ('California', 'Florida', '9', '1.2', 'delivered', '2019/5/6');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status) VALUES ('Indiana', 'Illinois', '8', '1.3', 'pending');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status, finishTime) VALUES ('New hampshise', 'New York', '18', '1.3', 'delivered', '2019/5/3');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status) VALUES ('702-1', '705-1', '16', '1.6', 'pending');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status) VALUES ('702-1', '705-1', '19', '4.3', 'pending');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status, finishTime) VALUES ('702-1', '705-1', '22', '1.3', 'delivered', '2019/5/2');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status) VALUES ('702-1', '705-1', '23', '5.9', 'pending');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status) VALUES ('702-1', '705-1', '19', '7.4', 'pending');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status, finishTime) VALUES ('702-1', '705-1', '7', '9.0', 'delivered', '2019/5/2');\");\n db.execSQL(\"INSERT INTO deliveries (pickUp, des, distance, price, status) VALUES ('702-1', '705-1', '2', '1.3', 'pending');\");\n }", "public void insertar10Mascotas(BaseDatos db){\n\n ContentValues contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Rambo\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.primero);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n\n contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Dina\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.segundo);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n\n contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Perla\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.tercero);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n\n contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Steben\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.cuarto);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n\n contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Choco\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.quinto);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n\n contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Filulay\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.sexto);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n\n contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Betoben\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.septimo);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n\n contentValues = new ContentValues();\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_NOMBRE,\"Mimo\");\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_IMAGEN,R.drawable.octavo);\n contentValues.put(ConstantesBaseDatos.TABLE_MASCOTA_RETUIT,0);\n db.loadDummy(contentValues);\n }", "@Override\n public void onCreate(SQLiteDatabase db) {\n // TODO Auto-generated method stub\n String CREATE_ROCKFALL_TABLE = \"CREATE TABLE \" +\n TABLE_ROCKFALL + \"(\"\n + COLUMN_ID + \" INTEGER PRIMARY KEY,\" + COLUMN_UMBRELLA_AGENCY + \" TEXT,\" + COLUMN_REGIONAL_ADMIN + \" TEXT,\"+COLUMN_LOCAL_ADMIN + \" TEXT,\"+COLUMN_DATE +\n \" TEXT,\" + COLUMN_ROAD_TRAIL_NUMBER + \" TEXT,\" + COLUMN_ROAD_OR_TRAIL + \" INTEGER,\" + COLUMN_ROAD_TRAIL_CLASS +\n \" TEXT,\" + COLUMN_RATER + \" TEXT,\" + COLUMN_BEGIN_MILE_MARKER + \" TEXT,\" + COLUMN_END_MILE_MARKER + \" TEXT,\" +\n COLUMN_SIDE + \" INTEGER,\" + COLUMN_WEATHER + \" INTEGER,\" + COLUMN_HAZARD_TYPE + \" TEXT,\" + COLUMN_BEGIN_COORDINATE_LAT +\n \" TEXT,\" + COLUMN_BEGIN_COORDINATE_LONG + \" TEXT,\" + COLUMN_END_COORDINATE_LATITUDE + \" TEXT,\" + COLUMN_END_COORDINATE_LONGITUDE +\n \" TEXT,\" + COLUMN_DATUM + \" TEXT,\" + COLUMN_AADT + \" TEXT,\" + COLUMN_LENGTH_AFFECTED + \" TEXT,\" + COLUMN_SLOPE_HEIGHT_AXIAL_LENGTH\n + \" TEXT,\" + COLUMN_SLOPE_ANGLE + \" TEXT,\" + COLUMN_SIGHT_DISTANCE + \" TEXT,\" + COLUMN_ROAD_TRAIL_WIDTH + \" TEXT,\" + COLUMN_SPEED_LIMIT +\n \" INTEGER,\" + COLUMN_MINIMUM_DITCH_WIDTH + \" TEXT,\" + COLUMN_MAXIMUM_DITCH_WIDTH + \" TEXT,\" + COLUMN_MINIMUM_DITCH_DEPTH + \" TEXT,\" +\n COLUMN_MAXIMUM_DITCH_DEPTH + \" TEXT,\" + COLUMN_FIRST_BEGIN_DITCH_SLOPE + \" TEXT,\" + COLUMN_FIRST_END_DITCH_SLOPE + \" TEXT,\" +\n COLUMN_SECOND_BEGIN_DITCH_SLOPE + \" TEXT,\" + COLUMN_SECOND_END_DITCH_SLOPE + \" TEXT,\" + COLUMN_BLK_SIZE + \" TEXT,\" + COLUMN_VOLUME + \" TEXT,\"\n + COLUMN_START_ANNUAL_RAINFALL + \" TEXT,\" + COLUMN_END_ANNUAL_RAINFALL + \" TEXT,\" + COLUMN_SOLE_ACCESS_ROUTE + \" INTEGER,\" + COLUMN_FIXES_PRESENT +\n \" INTEGER,\" + COLUMN_PHOTOS + \" TEXT,\" + COLUMN_COMMENTS + \" TEXT,\" + COLUMN_FLMA_NAME + \" TEXT,\" + COLUMN_FLMA_ID + \" TEXT,\" +\n COLUMN_FLMA_DESCRIPTION + \" TEXT,\" + COLUMN_PRELIM_ROCKFALL_DITCH_EFF + \" INTEGER,\" + COLUMN_PRELIM_ROCKFALL_ROCKFALL_HISTORY + \" INTEGER,\" +\n COLUMN_PRELIM_ROCKFALL_BLOCK_SIZE_EVENT_VOL + \" TEXT,\" + COLUMN_IMPACT_ON_USE + \" INTEGER,\" + COLUMN_AADT_USAGE_CALC_CHECKBOX + \" INTEGER,\" +\n COLUMN_AADT_USAGE + \" TEXT,\" + COLUMN_PRELIM_RATING + \" TEXT,\" + COLUMN_SLOPE_DRAINAGE + \" INTEGER,\" + COLUMN_HAZARD_RATING_ANNUAL_RAINFALL\n + \" TEXT,\" + COLUMN_HAZARD_RATING_SLOPE_HEIGHT_AXIAL_LENGTH + \" TEXT,\" + COLUMN_HAZARD_RATING_TOTAL + \" TEXT,\" + COLUMN_HAZARD_ROCKFALL_MAINT_FREQUENCY +\n \" INTEGER,\" + COLUMN_CASE_ONE_STRUC_COND + \" INTEGER,\" + COLUMN_CASE_ONE_ROCK_FRICTION + \" INTEGER,\" + COLUMN_CASE_TWO_STRUC_COND + \" INTEGER,\" +\n COLUMN_CASE_TWO_DIFF_EROSION + \" INTEGER,\" + COLUMN_ROUTE_TRAIL_WIDTH + \" TEXT,\" + COLUMN_HUMAN_EX_FACTOR + \" TEXT,\" + COLUMN_PERCENT_DSD + \" TEXT,\" + COLUMN_R_W_IMPACTS + \" INTEGER,\" +\n COLUMN_ENVIRO_CULT_IMPACTS + \" INTEGER,\" + COLUMN_MAINT_COMPLEXITY + \" INTEGER,\" + COLUMN_EVENT_COST + \" INTEGER,\" + COLUMN_RISK_TOTAL\n + \" TEXT,\" + COLUMN_TOTAL_SCORE + \" TEXT\" + \")\";\n\n db.execSQL(CREATE_ROCKFALL_TABLE);\n\n }", "@Override\n protected void onPostExecute(List<List<HashMap<String, String>>> result) {\n ArrayList<LatLng> points = null;\n MarkerOptions markerOptions = new MarkerOptions();\n String duration = \"\";\n Random rand = new Random();\n\n for(int i=0;i<result.size();i++){\n points = new ArrayList<LatLng>();\n lineOptions = new PolylineOptions();\n\n // Fetching i-th route\n List<HashMap<String, String>> path = result.get(i);\n\n // Fetching all the points in i-th route\n for(int j=0;j<path.size();j++){\n HashMap<String,String> point = path.get(j);\n\n if(j==0){ // Get distance from the list\n String pars=(String)point.get(\"distance\");\n String[]pars1=pars.split(\" \");\n distance = Float.parseFloat(pars1[0])/1000;\n\n if(go ) {\n if(con!=null) {\n Distance_travel =Distance_travel +distance;\n Total_cost = (Minimum_fare + (Distance_travel) * Hourly_fare);\n mDatabase.child(\"Accepted_Ride\").child(con).child(\"Distance_travel\").setValue(dfto.format(Distance_travel));\n mDatabase.child(\"Accepted_Ride\").child(con).child(\"Cost\").setValue(dfto.format(Total_cost));\n }\n }\n continue;\n }else if(j==1){ // Get duration from the list\n duration = (String)point.get(\"duration\");\n if(wait||got){\n if(marker!=null) {\n //marker.showInfoWindow();\n marker.setTitle(duration);\n }\n }else{\n marker.hideInfoWindow();\n }\n continue;\n }\n\n double lat = Double.parseDouble(point.get(\"lat\"));\n double lng = Double.parseDouble(point.get(\"lng\"));\n LatLng position = new LatLng(lat, lng);\n\n points.add(position);\n }\n\n\n\n lineOptions.addAll(points);\n lineOptions.width(12);\n lineOptions.startCap(new SquareCap());\n lineOptions.endCap(new SquareCap());\n lineOptions.jointType(ROUND);\n lineOptions.color(Color.argb(255, rand.nextInt(256), rand.nextInt(256), rand.nextInt(256) ));\n\n\n\n }\n if(lineOptions!=null&& !got) {\n if(polylineFinal==null) {\n polylineFinal = googleMap.addPolyline(lineOptions);\n }\n }\n\n\n }", "public void insertIntoShoppinglist(Rezept r){\n // SQLiteDatabase db = this.getWritableDatabase();\n //Zutaten aufsplitten\n String[] zutaten = r.getZutaten().split(ZUTATENSPLITTER);\n\n if(zutaten!=null && zutaten.length>0){\n\n ContentValues values = new ContentValues();\n try{\n\n for(int i=0;i<zutaten.length;i++){\n\n values.put(TABELLE3_4,r.getId());\n values.put(TABELLE3_3, 0);\n values.put(TABELLE3_2,zutaten[i]);\n\n myDB.insert(TABELLE3, null, values);\n values.clear();\n // System.out.println(\"Zutat \"+zutaten[i]+\"[\"+r.getId()+\"] in die neue Tabelle gesteckt\");\n }\n }\n catch(SQLiteException e){\n e.printStackTrace();\n }\n }\n // db.close();\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates the integration of the first input provided in window
public static void int1(Window window) { window.getOutput().setText(Functions .integrate(StringToPolynomial.stringToRealPolynomial(window.getInput1().getText())).toString()); }
[ "double integrate(Element e, Function fun);", "public Polinom integrate(){\n\t\t// neimplementat\n\t\tArrayList<Monom> newCoefs= new ArrayList<Monom>();\n\n\t\t//constanta C\n\t\tnewCoefs.add(new MonomInt(0 ,0));\n\t\t//\n\t\tfor(Monom coef:coefs)\n\t\t\tnewCoefs.add(coef.integration());\n\t\treturn new Polinom(newCoefs);\n\t}", "@Override\n\tpublic double integrate(double _x0, double _x1) {\n\t\treturn 0;\n\t}", "public static double Integrater(double place){\n\t///this goes along the x axis at each y and makes the integral\t\n\t//this is used in double integrater where the y vareis and the integral with respectto x is calculated\n\t\t//this should be switched\n\t\tdouble spacing = (end- start)/intervalsx;\n\t\t\n\t\t\n\t\tdouble sum1 = 0;\n\t\tdouble x_1 = start;\n\t\tdouble y_1 = place;\n\t\t//This is a RRam \n\t\tfor(int i=0;i<intervalsx;i++){\n\t\t\tx_1 = x_1+ spacing;\n\t\t\tsum1 = sum1 + Mathfunction(x_1,y_1)*spacing;\n\t\t}\n\t\treturn sum1;\n\t}", "public Complex hannWindow(Complex input, int idx) {\n\t\tdouble multiplier = 0.5 - 0.5 * Math.cos(2 * Math.PI * idx / N);\n\t\treturn input.kali(new Complex(multiplier, 0));\n\t}", "public double integrate(float upper){\n return integrate(0, upper);\n }", "public double trapezium(){\r\n \t if(!this.setIntervals)throw new IllegalArgumentException(\"Number of intervals not set\");\r\n \t if(!this.setLimits)throw new IllegalArgumentException(\"One limit or both limits not set\");\r\n \t if(!this.setFunction)throw new IllegalArgumentException(\"No integral function has been set\");\r\n\r\n \tdouble \ty1 = 0.0D;\r\n \tdouble \tinterval = (this.upperLimit - this.lowerLimit)/this.nIntervals;\r\n \tdouble\tx0 = this.lowerLimit;\r\n \tdouble \tx1 = this.lowerLimit + interval;\r\n \tdouble\ty0 = this.integralFunc.function(x0);\r\n \tthis.integralSum= 0.0D;\r\n\r\n\t\t for(int i=0; i<nIntervals; i++){\r\n\t\t // adjust last interval for rounding errors\r\n\t\t if(x1>this.upperLimit){\r\n\t\t x1 = this.upperLimit;\r\n\t\t interval -= (x1 - this.upperLimit);\r\n\t\t }\r\n\r\n\t\t // perform summation\r\n \t\ty1 = this.integralFunc.function(x1);\r\n \t\tthis.integralSum += 0.5D*(y0+y1)*interval;\r\n \t\tx0 = x1;\r\n \t\ty0 = y1;\r\n \t\tx1 += interval;\r\n \t}\r\n \tthis.integrationDone = true;\r\n \treturn this.integralSum;\r\n \t}", "public Polynomial_double integratePolynomials(Polynomial_double pol, JTextField tf) {\r\n\r\n Polynomial_double result = new Polynomial_double();\r\n pol = Polynomial_double.stringToPolynomial(tf);\r\n result = Operations.integration(pol);\r\n return result;\r\n }", "public double IntegrateWork(ELine elem, Domain theDomain, int step){\n double Length=0.;\n double ux,uy,px,py;\n Node theNode_i;\n Node theNode_j;\n\n double[] xsis = new double[numGP];\n double[] weights = new double[numGP];\n switch(numGP){\n case 3:\n xsis[0]=0.774596669; xsis[1]=0.0; xsis[2]=-xsis[0];\n weights[0]=0.555555555; weights[1]=0.888888888; weights[2]=weights[0];\n break;\n case 4:\n xsis[0]=0.861136311; xsis[1]=0.339981043; xsis[2]=-xsis[1]; xsis[3]=-xsis[0];\n weights[0]=0.347854845; weights[1]=0.652145154; weights[2]=weights[1]; weights[3]=weights[0];\n break;\n case 5:\n xsis[0]=0.906179845; xsis[1]=0.538469310; xsis[2]=0.00; xsis[3]=-xsis[1]; xsis[4]=-xsis[0];\n weights[0]=0.236926885; weights[1]=0.478628670; weights[2]=0.568888888; weights[3]=weights[1]; weights[4]=weights[0];\n break;\n default: System.exit(345); break;\n }\n\n for(Iterator<Node>it=elem.getNodes().values().iterator(); it.hasNext();){\n theNode_i= it.next();\n for(Iterator<Node>jt=elem.getNodes().values().iterator(); jt.hasNext();){\n theNode_j= jt.next();\n\n double[] CoordsOnElem=new double[1];\n double[] weight = new double[1];\n double xsi;\n\n int hierInelem_i=elem.getHierOfNode(theNode_i.getID());\n\n int hierInelem_j=elem.getHierOfNode(theNode_j.getID());\n\n for(int i=0; i<numGP; i++){\n\n double val=1.0;\n CoordsOnElem[0]=xsis[i];\n weight[0]=weights[i];\n\n xsi=CoordsOnElem[0];\n\n if(this.DomainAuxiliaryField){\n ux=elem.getNodeHier(hierInelem_i).getu_aux()[0][step][0];\n uy=elem.getNodeHier(hierInelem_i).getu_aux()[1][step][0];\n\n px=elem.getNodeHier(hierInelem_j).getp_aux(elem,theDomain.getFundamentalSolution().get_p_DOFs())[0][step];\n py=elem.getNodeHier(hierInelem_j).getp_aux(elem,theDomain.getFundamentalSolution().get_p_DOFs())[1][step];\n }else{\n ux=elem.getNodeHier(hierInelem_i).getu()[0][step][0];\n uy=elem.getNodeHier(hierInelem_i).getu()[1][step][0];\n\n px=elem.getNodeHier(hierInelem_j).getp(elem,theDomain.getFundamentalSolution().get_p_DOFs())[0][step];\n py=elem.getNodeHier(hierInelem_j).getp(elem,theDomain.getFundamentalSolution().get_p_DOFs())[1][step];\n }\n val*=elem.getShapeFunctionProduct(hierInelem_i, hierInelem_j, xsi)*(ux*px+uy*py);\n val*=elem.getJacobian(xsi);\n val*=weight[0];\n\n Length+=val;\n }\n }\n }\n //System.err.println(\"2* Strain Energy Computed = \"+Length);\n return Length;\n }", "public VarSum integrate(){\n ArrayList<Variable> list = new ArrayList<Variable>();\n\n // for each Variable in function\n for(int i=0; i < function.expression.size(); i++){\n Variable v = function.expression.get(i);\n\n // if a constant, multiply by variable\n if(v.isNumber())\n list.add(new Variable(v.getCoefficient(), variable, 1));\n\n // else perform reverse power-rule\n else\n list.add(new Variable(v.getCoefficient() / (v.getPower() + 1),\n v.getVariable(), v.getPower() + 1));\n }\n\n return new VarSum(list);\n\n }", "public Complex hammWindow(Complex input, int idx) {\n\t\tdouble multiplier = 0.54 - 0.46 * Math.cos(2 * Math.PI * idx / N);\n\t\treturn input.kali(new Complex(multiplier, 0));\n\t}", "double getValue(double step);", "@Override\n public Double next(double x) {\n return (min + length * x);\n }", "Integrator(GaussianDistro f, double xi, double xf, double dx){\n\tthis.f = f;\n\tthis.xi = xi;\n\tthis.xf = xf;\n\tthis.dx = dx;\n\tnsteps = (int)((xf - xi) / dx);\n }", "@Override\r\n\tpublic Function offset(){\r\n\t\tdouble min = vals[0];\r\n\t\tfor(int i = 0; i < vals.length; i++){\r\n\t\t\tif (this.evalAtIdx(i) < min)\r\n\t\t\t\tmin = this.evalAtIdx(i);\r\n\t\t}\r\n\t\tdouble[] newVals = new double[vals.length];\r\n\t\tfor(int i = 0; i < vals.length; i++)\r\n\t\t\tnewVals[i] = vals[i] - min;\r\n\t\treturn new GreedyFunction(domain, newVals);\r\n\t}", "public Numeric integral ( NumericExpression1D expr, double start, double end ) {\n if ( start >= end )\n throw new IllegalArgumentException (\n \"Start value must be less than ending value.\");\n double[] sumParts = new double[threadCount];\n int numPts = 10000;\n // number of points per thread, must be even for Simpsons rule\n numPts /= threadCount;\n numPts = ( numPts % 2 == 0 ) ? numPts : numPts + 1;\n // 2 extra for first and last evaluation\n double h = ( end - start ) / ( 2 + numPts * threadCount - 1 );\n\n //create worker\n CountDownLatch count = new CountDownLatch( threadCount );\n final int increment = numPts;\n class worker implements Runnable {\n final int ind;\n final double startVal;\n public worker ( int thread, double start ) { ind = thread; startVal = start; }\n public void run ( ) {\n try {\n sumParts[ind] = 0.0;\n double coef = 2.0, x = startVal;\n for ( int i = 0; i < increment; i++ ) {\n coef = ( coef == 2.0 ) ? 4.0 : 2.0;\n sumParts[ind] += expr.evaluate( x ) * coef;\n x += h;\n }\n } catch ( RuntimeException ex ) {\n throw new ExecutionInterruptedException(\n \"Error executing numeric expression:\\n\" + ex );\n } finally { count.countDown(); }\n }\n }\n\n start = start + h;\n for ( int i = 0; i < threadCount; i++ ) {\n executorService.execute( new worker( i, start ) );\n start += increment * h;\n }\n this.await( count );\n\n // the first and last value with a coefficient of 1\n double sum = expr.evaluate( start ) + expr.evaluate( end );\n for ( double d : sumParts ) sum += d;\n\n return Numeric.Scalar( sum * h / 3 );\n }", "public abstract void simulate(double inputFlow);", "Quaternion integrate (IVector3 velocity, float t, Quaternion result);", "public double IntegrateSlipDrivingForce(IELine elem, Interface theInterface, int wstep){\n double stored=0.;\n double[] CoordsOnElem=new double[1];\n double[] weight = new double[1];\n double xsi;\n double val;\n double kh = 0.0;\n double kt = 0.0;\n double N1,N2;\n \n double z1 ,z2 ;\n double zw1 ,zw2 ;\n double ua1=0.,ua2=0.;\n double ub1=0.,ub2=0.;\n double s1 ,s2 ;\n double sw1 ,sw2 ;\n \n int pstep = 0;\n if(wstep>0){\n \n pstep=wstep-1;\n \n kt = theInterface.getTangentSpring().getStiffness();\n kh = theInterface.getTangentSpring().getIsotropicHardening();\n\n double[] xsis = new double[numGP];\n double[] weights = new double[numGP];\n switch(numGP){\n case 3:\n xsis[0]=0.774596669; xsis[1]=0.0; xsis[2]=-xsis[0];\n weights[0]=0.555555555; weights[1]=0.888888888; weights[2]=weights[0];\n break;\n case 4:\n xsis[0]=0.861136311; xsis[1]=0.339981043; xsis[2]=-xsis[1]; xsis[3]=-xsis[0];\n weights[0]=0.347854845; weights[1]=0.652145154; weights[2]=weights[1]; weights[3]=weights[0];\n break;\n case 5:\n xsis[0]=0.906179845; xsis[1]=0.538469310; xsis[2]=0.00; xsis[3]=-xsis[1]; xsis[4]=-xsis[0];\n weights[0]=0.236926885; weights[1]=0.478628670; weights[2]=0.568888888; weights[3]=weights[1]; weights[4]=weights[0];\n break;\n default: System.exit(345); break;\n }\n\n for(int i=0; i<numGP; i++){\n z1=0.; z2=0.;\n zw1 = 1.; zw2 = 1.;\n ua1=0.;ua2=0.;\n ub1=0.;ub2=0.;\n s1=0.; s2=0.;\n sw1=0.; sw2=0.;\n val=1.0;\n CoordsOnElem[0]=xsis[i];\n weight[0]=weights[i];\n xsi=CoordsOnElem[0];\n\n if(theInterface.IsSlipIncluded()){\n s1 = elem.getINodeHier(1).gets(elem.getID())[pstep]; \n s2 = elem.getINodeHier(2).gets(elem.getID())[pstep];\n \n sw1 = elem.getINodeHier(1).gets(elem.getID())[wstep]; \n sw2 = elem.getINodeHier(2).gets(elem.getID())[wstep];\n }\n\n if(theInterface.IsDamageIncluded())z1 = elem.getINodeHier(1).getz(elem.getID())[pstep];\n if(theInterface.IsDamageIncluded())z2 = elem.getINodeHier(2).getz(elem.getID())[pstep];\n\n if(theInterface.IsDamageIncluded())zw1 = elem.getINodeHier(1).getz(elem.getID())[wstep];\n if(theInterface.IsDamageIncluded())zw2 = elem.getINodeHier(2).getz(elem.getID())[wstep];\n\n ua1 = elem.getINodeHier(1).getut()[pstep];\n ua2 = elem.getINodeHier(2).getut()[pstep];\n\n if(theInterface.getNumOfConnectedDomains()==2){\n if(elem.getINodeHier(1).isMain()||elem.getINodeHier(2).isMain()){\n ua1 = elem.getINodeHier(1).getut()[pstep];\n ub1 = elem.getINodeHier(1).getTwin().getut()[pstep];\n ua2 = elem.getINodeHier(2).getut()[pstep];\n ub2 = elem.getINodeHier(2).getTwin().getut()[pstep];\n }else{\n ub1 = elem.getINodeHier(1).getut()[pstep];\n ua1 = elem.getINodeHier(1).getTwin().getut()[pstep];\n ub2 = elem.getINodeHier(2).getut()[pstep];\n ua2 = elem.getINodeHier(2).getTwin().getut()[pstep];\n }\n }\n\n N1=elem.getShapeFunction(1, xsi);\n N2=elem.getShapeFunction(2, xsi);\n\n val*=(kt*((N1*s1+N2*s2)-(N1*ua1+N2*ua2)+(N1*ub1+N2*ub2))*(N1*z1+N2*z2)+\n kh*(N1*s1+N2*s2)\n )*(N1*(s1-sw1)+N2*(s2-sw2));\n\n val*=elem.getJacobian(xsi);\n val*=weight[0];\n stored+=val;\n }\n \n }\n return stored;\n }", "public double getNext(double t);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ The ElementListener interface is for use with GameElements which generate events. The events generated by those GameElements are passed to an ElementListener's event function so that the listener can process the event.
public interface ElementListener { public void event(ElementEvent event); }
[ "void addEventListener( String type, IEventListener listener );", "public void processElementEvent(ElementEvent ee) {\n//\t\tif (ee instanceof KeyInputEvent) {\n//\t\t\tSystem.out.println(ee);\n//\t\t}\n\t\tList<GameEvent> gameEvents = new ArrayList<>();\n\t\tfor (GameElement ge: gameSate.getCurrentGamePart().getElements()) {\n\t\t\tgameEvents.addAll(ge.processEvent(ee));\n\t\t}\n\t\tgameEvents.addAll(collisionManager.handleCollisions(gameSate.getCurrentGamePart()));\n\t\tgameEvents.stream().forEach(event -> processGameEvent(event));\n\t}", "public interface GameEventListener extends EventListener {\n\n /**\n * Defines the callback performed as a reaction to the given event.\n * @param evt Received event\n */\n public void onGameEventActionPerformed(GameEvent evt);\n}", "public interface Listener {\n void onEventAttach(Event event);\n}", "public interface ListListener<T> {\n\tpublic void elementsAdded(AddElementsEvent<T> event);\n\n\tpublic void elementsRemoved(RemoveElementsEvent<T> event);\n\n\tpublic void elementChanged(ChangeElementEvent<T> event);\n\n\tpublic void elementsReplaced(ReplaceElementsEvent<T> event);\n}", "public interface Listener extends java.util.EventListener {\n\tpublic void itemChosen(StatsRadio.Event e);\n }", "public interface GameControlsListener extends EventListener {\n /**\n * The Start/Stop button is clicked.\n * @param e event object\n */\n public void startStopButtonClicked( GameControlsEvent e );\n\n /**\n * The Next button is clicked.\n * @param e event object\n */\n public void nextButtonClicked( GameControlsEvent e );\n\n /**\n * A new speed is selected.\n * @param e event object\n */\n public void speedChanged( GameControlsEvent e );\n\n /**\n * A new cell size is selected.\n * @param e event object\n */\n public void zoomChanged( GameControlsEvent e );\n\n /**\n * A new shape is selected.\n * @param e event object\n */\n public void shapeSelected( GameControlsEvent e );\n}", "public interface Listener extends EventListener\n {\n public void lifeCycleStarting(LifeCycle event);\n public void lifeCycleStarted(LifeCycle event);\n public void lifeCycleFailure(LifeCycle event,Throwable cause);\n public void lifeCycleStopping(LifeCycle event);\n public void lifeCycleStopped(LifeCycle event);\n }", "protected synchronized void addEventListener(GuiEventListner list) {\n LISTENER.add(list);\n }", "public void addPersistingElementListener(PersistingElementListener listener);", "public interface AttributeListener<E> {\n /**\n * Notifies this listener that attributes of an element within a document have\n * changed.\n *\n * @param element element that changed\n * @param oldValues attribute values that have been deleted\n * @param newValues attribute values that have been inserted\n */\n void onAttributesChanged(E element, Map<String, String> oldValues, Map<String, String> newValues);\n}", "public interface EatEventListener {\n\n\t/**\n\t * Receive an eat event for further processing. E.g. the renderer can\n\t * determine by accepting an eat event where an eat animation has to be\n\t * played.\n\t * \n\t * @param eater\n\t * the alligator \"eating\" the EatenFamily\n\t * @param eatenFamily\n\t * the parent of all eaten objects, which is being eaten himself\n\t * @param eatenPositionInParent\n\t * the index of the subtree that was eaten in its parent's\n\t * children list, before it was removed\n\t */\n\tpublic void onEat(ColoredAlligator eater, InternalBoardObject eatenFamily,\n\t\t\tint eatenPositionInParent);\n\n}", "public interface ChangeListener<I extends Serializable, E> extends EventListener {\n void create(I pIndex, E pElement);\n void update(I pIndex, E pElement, E pPreviousElement);\n void delete(I pIndex, E pElement);\n void clear();\n}", "public interface MetaStoreElementListener {\n \n /**\n * This method is called after an element was created in the store\n *\n * @param namespace The namespace of the element\n * @param elementTypeId The element type ID of the element\n * @param element The element that was created\n */\n public void elementCreated(String namespace, String elementTypeId, IMetaStoreElement element);\n\n /**\n * This method is called when an element is changed\n *\n * @param namespace The namespace of the element\n * @param dataType The element type of the element\n * @param oldElement The element before the change\n * @param newElement The element after the change \n */\n public void elementUpdated(String namespace, String elementTypeId, IMetaStoreElement oldElement, IMetaStoreElement newElement);\n\n /**\n * This method is called after an element was deleted from the store\n *\n * @param namespace The namespace of the element\n * @param dataType The element type ID of the element\n * @param element The element that was deleted\n */\n public void elementDeleted(String namespace, String elementTypeId, IMetaStoreElement element);\n}", "public interface ButtonIntegerListener extends EventListener {\n public void ButtonIntegerEvent(int buttonIndex);\n}", "public interface Element {\n\tvoid accept (ElementVisitor visitor);\n}", "public interface ListenerLoop {\n void update();\n void draw();\n}", "public interface WindowablePanelListener\n extends EventListener\n{\n /**\n * Call when the windowable panel is attach\n *\n * @param windowablePanelEvent Event description\n */\n void windowablePanelAttach(WindowablePanelEvent windowablePanelEvent);\n\n /**\n * Call when the windowable panel is close\n *\n * @param windowablePanelEvent Event description\n */\n void windowablePanelClose(WindowablePanelEvent windowablePanelEvent);\n\n /**\n * Call when the windowable panel is detach\n *\n * @param windowablePanelEvent Event description\n */\n void windowablePanelDetach(WindowablePanelEvent windowablePanelEvent);\n\n /**\n * Call when the windowable panel is hide\n *\n * @param windowablePanelEvent Event description\n */\n void windowablePanelHide(WindowablePanelEvent windowablePanelEvent);\n\n /**\n * Call when the windowable panel is open\n *\n * @param windowablePanelEvent Event description\n */\n void windowablePanelOpen(WindowablePanelEvent windowablePanelEvent);\n\n /**\n * Call when the windowable panel is show\n *\n * @param windowablePanelEvent Event description\n */\n void windowablePanelShow(WindowablePanelEvent windowablePanelEvent);\n}", "public interface GameEventListener {\n\n /**\n * Called at a given elapsed time\n * @param eventTag set when the listener is registered, and returned when the event is triggered to allow the calling class to identify the event\n */\n public void onGameEvent(String eventTag);\n\n}", "public void addToListener() {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cria a estrutura do email
protected SimpleMailMessage prepareSimpleMailMessage(Pedido obj) { SimpleMailMessage mensagem = new SimpleMailMessage(); mensagem.setTo(obj.getCliente().getEmail()); // email do destinatario mensagem.setFrom(sender); //email remetente recuperado de application mensagem.setSubject("Pedido confirmado! Código: " + obj.getId()); //assunto do email mensagem.setSentDate(new Date(System.currentTimeMillis())); // data do email mensagem.setText(obj.toString()); //corpo do email return mensagem; }
[ "private CreationViaEmail() { }", "public EmailKey(String Email){ \r\n email = Email;\r\n }", "private static Email getEmailOne() {\n Email email = new Email();\n email.setSubject(\"test email one\");\n email.addTO(\"[email protected]\");\n email.setBody(\"blah blah blah\");\n\n return email;\n }", "public EmailMessage() {\n\t\tthis(\"\", \"\");\n\t}", "public Email(String address) {\n String[] es = address.split(\"@\");\n this.username = es[0];\n this.domain = es[1];\n }", "public Email(String fName, String lName){\n this.fName = fName;\n this.lName = lName;\n System.out.println(\"New user \" + this.fName +\" \" + this.lName + \" created an new Email account\");\n\n\n //Call a method for the department-return the department\n this.department = setDepartment();\n System.out.println(\"Department: \" + this.department);\n\n //call method that'll return password\n this.password = randomPassword(defaultPassword);\n System.out.println(\"Your password is : \" + this.password);\n\n //combine element to generate email\n email = fName.toLowerCase() + \".\" + lName.toLowerCase() + \"@\" + department + \".\" + companyName;\n System.out.println(\"Your official Email name is: \" + email + \" ....lame\");\n\n\n\n }", "public EmailSender() {\n\t}", "public Mail() {\r\n\t}", "public Email()\n\t{\n\t\tto = new ArrayList<EmailAddress>();\n\t\tcc = new ArrayList<EmailAddress>();\n\t\tbcc = new ArrayList<EmailAddress>();\n\t\tfrom = null;\n\t\tsubject = \"\";\n\t\ttext = \"\";\n\t}", "public EmailSetup() {\n initComponents();\n // lê os dados apartir do ficheiro\n SendEmail account = new SendEmail();\n Load(account);\n\n }", "public email(String Firstname, String Lastname)\r\n {\r\n\t this.FirstName=Firstname;\r\n\t this.LastName=Lastname;\r\n\t System.out.println(\"Email Created: \"+\"\"+this.FirstName+\" \"+this.LastName);\r\n\t \r\n\t //calling method asking for the department name.\r\n\t this.Department = setDepartment();\r\n\t System.out.println(\"Department:\"+this.Department);\r\n\t \r\n\t //Calling a method to return a random password.\r\n\t this.Password = randomPassword(defaultLength);\r\n\t System.out.println(\"The password is: \" +this.Password);\r\n\t \r\n\t //Now we will create a email generated by the given information.\r\n\t email = FirstName.toLowerCase()+\".\"+LastName.toLowerCase() + \"@\" +Department+\".\"+company;\r\n\t System.out.println(email);}", "private Mail() {\n\t}", "public EmailAddress(EmailAddress e , Address a) {\r\n\t\t\t\t\tsuper(a);\r\n\t\t\t\t\tuserName = e.userName;\r\n\t\t\t\t\tat = e.at;\r\n\t\t\t\t\tdomainName = e.domainName;\r\n\t\t\t\t\tdot = e.dot;\r\n\t\t\t\t\tTLD = e.TLD;\r\n\t\t\t\t}", "private static Email getEmailTwo() {\n Email email = new Email();\n email.setSubject(\"test email two\");\n email.addTO(\"[email protected]\");\n email.setAsHTML(true);\n email.addEncryption(Encryption.DES);\n email.setBody(\"two burgers please\");\n\n return email;\n }", "public AbstractEmailBody() {\r\n }", "private EmailUtil() {\n\t}", "public SetupMail() {\n }", "public void setEmail(Email email) {\n \tthis.email = email;\n}", "public CwmEmail createCwmEmail(java.lang.String name, org.pentaho.pms.cwm.pentaho.meta.core.VisibilityKind visibility, java.lang.String emailAddress, java.lang.String emailType);", "public Email(String firstName, String lastName) {\r\n\t\tthis.firstName=firstName;\r\n\t\tthis.lastName=lastName;\r\n\t\t\r\n\t\t//System.out.println(\"Email created\"+this.firstName+ \" \"+this.lastName);\r\n\t\t\r\n\t\t//department assignmnet and storing\r\n\t\tthis.department=setDepartment();\r\n\t\t//System.out.println(\"Department :\"+this.department);\r\n\t\t\r\n\t\t//password generation and storing\r\n\t\tthis.password=generatePassword(defaultPasswordLength);\r\n\t\t//System.out.println(\"Password :\"+this.password);\r\n\t\t\r\n\t\t//combine elements to generate email\r\n\t\temail= firstName.toLowerCase()+lastName.toLowerCase()+\"@\"+department+\".com\";\r\n\t\t//System.out.println(\"Email created is:\"+email);\r\n\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end names who survived < age X get names who perished < age X
public String getPerishedNamesLessGivenAge(int age) { String name = ""; for (int i = 0; i < getTotalPax(); i++) { if (data[i].length >= 6 && data[i][4].length()>0) { int status = Integer.parseInt(data[i][1]); double givenAge = Double.parseDouble(data[i][4]); if (status == 0 && givenAge < age) { name += "\n" + data[i][2]; }//end if statement }//end if statement }//end for loop return name; }
[ "private void filterByAge(List<Person> people){\n final PersonFilter personFilter = new PersonFilter();\n people.stream()\n .filter(personFilter::filterAdult);\n }", "void search(ArrayList <Data> a, int age ) {\n\t\tint count =0;\n\t\tArrayList <Data> r = new ArrayList();\n\t\tfor(int i = 0; i < a.size(); i++)\n\t\t\tif(a.get(i).getAge() > 55) {\n\t\t\t\tcount ++;\n\t\t\t\tr.add(a.get(age));\n\t\t\t}\n\t}", "List<Employee> filterEmployee(String lastName);", "List<Person> findByAgeGreaterThanEqual(Integer age);", "public List<Person> completePerson(String query){\n\t\tSystem.out.println(\"completePerson: \"+ query);\n\t\t\n\t\tList<Person> filterPerson = new ArrayList<>();\n\t\t\n\t\tfor(Person p: personList){\n\t\t\tif(p.getFirstName().toLowerCase().startsWith(query)) {\n\t\t\t\tfilterPerson.add(p);\n }\n\t\t}\n\t\treturn filterPerson;\n\t\n\t}", "List<StudentEntity> findByNameStartingWithAndAgeLessThanEqualOrderByIdDesc(String name, int age);", "List<Person> getByNameStartingWithAndIdLessThan(String name, Integer id);", "void search(LinkedList <Data> l, int age ) {\n\t\tint count =0;\n\t\tLinkedList <Data> r = new LinkedList();\n\t\tfor(int i = 0; i < l.size(); i++)\n\t\t\tif(l.get(i).getAge() > age) {\n\t\t\t\tcount ++;\n\t\t\t\tr.add(l.get(age));\n\t\t\t}\n\t\t//print(r);\n\t}", "public List<User> findPageUser(int start, int end, String name,Integer nage);", "public User[] search(int startAge, int endAge)\n { \n String jsonString = \"{\\\"start_age\\\":\" + startAge + \",\" + \"\\\"end_age\\\":\" + endAge + \"}\";\n\t System.out.println(\"See jsonString:\" + jsonString);\n \t\n\t User[] response = \n\t \tgiven().\n\t \theader(\"X-Auth-Token\", authToken).\n\t \theader(\"content-type\", \"application/json\").\n\t \tbody(jsonString).\n\t \tlog().all().\n\t \twhen().\n\t \tpost(BASE_URI+ SERVICE_URL_SEARCH_USER).as(User[].class);\n\t \n\t //List out users returned\n\t for (User user: response)\n\t {\tSystem.out.println(\"Search result:\" + user.toString());\n\t //Verify retrieved result is right\n\t \tif (user.getAge()> 45 || user.getAge()<35)\n\t \t\terrors.append(\"Search result is not right.\");\n\t }\n\t return response;\n }", "boolean isOlder(Person other) {\n return this.age> other.age;\n }", "public void search(int age){\n int currentIndex = 0;\n int found = 0;\n \n printHeader();\n \n //print body if there is a match\n for(Pet pet : db){ \n if(pet.getAge()== age){\n printRow(currentIndex, pet.getName(), pet.getAge());\n found++;\n }\n currentIndex++; \n }\n printFooter(found); \n }", "@GetMapping(\"/dogs/age/age-greater/{age}\")\n public ResponseEntity<List <Dog>> filterByAgeGreater(@ApiParam(\"Clave age del perro en formato String\")@PathVariable Integer age) {\n log.debug(\"REST request to filter age {}\", age);\n List<Dog> dogs = dogService.findByAgeGreater(age);\n if(dogs.isEmpty())\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\n return ResponseEntity.ok().body(dogs);\n }", "boolean isJunior()\n {\n return dob.getAge() < 18;\n }", "public static void main(String[] args) {\n\t\tList <Students> students = new ArrayList<>();\n\t\t\n\t\tstudents.add(new Students(1001, \"Anna\", \"Smith\", 23));\n\t\tstudents.add(new Students(1002, \"Jack\", \"Ryan\", 20));\n\t\tstudents.add(new Students(1003, \"Myles\", \"Skyler\", 20));\n\t\tstudents.add(new Students(1004, \"Nikki\", \"Mill\", 22));\n\t\tstudents.add(new Students(2012, \"Andrea\", \"Riaz\", 21));\n\t\tstudents.add(new Students(2013, \"Alma\", \"Sanchez\", 23));\n\t\tstudents.add(new Students(2014, \"Bess\", \"Suarez\", 25));\n\t\tstudents.add(new Students(2015, \"Aliyah\", \"Dela Cruz\", 26));\n\t\t\n\t\t\n\t\n\tList<Students> filteredbyFirstName = students.stream().filter(student -> (student.getFirstName().charAt(0)=='A'))\n\t\t\t.collect(Collectors.toList());\n\t\n\tfor(Students s : filteredbyFirstName) {\n\t\tSystem.out.println(\"FirstName: \" + s.getFirstName());\n\t}\n\tList<Students> filteredbyLastName = students.stream().filter(student -> (student.getLastName().charAt(0)=='S'))\n\t\t\t.collect(Collectors.toList());\n\t\n\tfor(Students s : filteredbyLastName) {\n\t\tSystem.out.println(\"LastName: \" + s.getLastName());\n\t}\n\tList<Students> filteredByAge = students.stream().filter(student -> (student.getAge()>21))\n\t\t\t.collect(Collectors.toList());\n\t\n\tfor(Students s : filteredByAge) {\n\t\tSystem.out.println(\"Age: \" + s.getAge() + \" Name: \"+s.getFirstName());\n\t}\n\t\n\tstudents.sort((o1, o2) -> {\n\t\treturn o1.getFirstName().compareTo(o2.getFirstName());\n\t});\n\tstudents.forEach(s -> {\n\t\tSystem.out.println(\" , Name: \" + s.getFirstName());\n\t});\n\t\n\t}", "@Override\r\n\tpublic Student[] getStudentsByAge(int age) {\n\t\tif(age<0) return null;\r\n Student[] temp= new Student[size];\r\n int index=0;\r\n for(int i=0;i<size;i++)\r\n if(getAge(students[i].getBirthDate())==age) temp[index++]=students[i];\r\n if(index==0) return null;\r\n return Arrays.copyOfRange(temp, 0, index);\r\n\t}", "@Query(\"select p from Person p where p.age > :p1\")\n\tList<Person> findPersonsWithAgeGt(@Param(\"p1\") int age);", "private static void empFilterWithTwoSearchParameters(List<Employee> employees, int low, int high)\n {\n for(Employee employee: employees)\n {\n if(employee.getAge() > low && employee.getAge() < high)\n {\n employee.printEmployee();\n }\n }\n }", "public static List<UserData> searchUsers(String theFirstName, String theLastName, Integer olderThan, Integer youngerThan, AnnuData.Gender gender, String theCity, String theCountry, int skip, int count) {\n\n\t\t// note : when the passed param gender is null, we do NOT search for\n\t\t// people with unknown gender : we must not apply the param\n\t\treturn UserData.generateList(Factories.USER.searchUsers(theFirstName, theLastName, olderThan, youngerThan, gender, theCity, theCountry, skip, count));\n\t}", "public List<Applicant> getApplicantByAgeRange(int ageFrom, int ageTo) throws NotFoundException {\n int thisYear = Calendar.getInstance().get(Calendar.YEAR);// save current year to an integer variable\n int yearTo = thisYear - ageFrom; //calculate the corresponding year from the user's ageFrom input eg:2000 if ageFrom = 20\n int yearFrom = thisYear - ageTo; //calculate the corresponding year from the user's ageTo input eg:1980 if ageFrom = 40\n List<Applicant> applicantsInRange = applicantRepository\n .findAll()\n .stream()\n .filter(applicant -> applicant.getDob().get(Calendar.YEAR) >= yearFrom) //get all applicants younger than 40 years old\n .filter(applicant -> applicant.getDob().get(Calendar.YEAR) <= yearTo) //get all applicants older than 20 years old\n .collect(Collectors.toList());\n if(applicantsInRange.isEmpty()){\n throw new NotFoundException(ErrorMessage.NO_ONE_IN_AGE_RANGE);\n }\n return applicantsInRange;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create GTFS Feed with service alerts
@Test @Transactional public void testReadAlerts() { FeedEntity alertEntityA = createAlert("alertA", TEST_1, DESC_1, CAUSE_1, EFFECT_1, URL_1, TIME_START_1, TIME_END_1, AGENCY_1, ROUTE_1, STOP_1); FeedEntity alertEntityB = createAlert("alertB", TEST_2, DESC_2, CAUSE_2, EFFECT_2, URL_2, TIME_START_2, TIME_END_2, AGENCY_2, ROUTE_2, STOP_2); FeedEntity alertEntityC = createAlert("alertC", TEST_3, DESC_3, CAUSE_3, EFFECT_3, URL_3, TIME_START_3, TIME_END_3, AGENCY_3, ROUTE_3, STOP_3); // Create FeedMessage FeedMessage.Builder alerts = createFeed(); alerts.addEntity(alertEntityA); alerts.addEntity(alertEntityB); alerts.addEntity(alertEntityC); FeedMessage alert = alerts.build(); _feedService.readAlerts(alert, _entitySource); Collection<AlertModel> alertsFromDB = null; // Wait for 15 seconds to make sure GtfsPersistor has had time to run // the AlertThread, which actually writes to the DB. try { TimeUnit.SECONDS.sleep(15); } catch (Exception ignoredEx) { } // Get data that was persisted to the database try { Query query = getSession().createQuery("from AlertModel"); alertsFromDB = query.list(); } catch (Exception ex) { ex.getMessage(); _log.info("find failed: " + ex.getMessage()); } assertNotNull("database query failed!", alertsFromDB); // Check persisted data against the original value. _log.info("results size: " + alertsFromDB.size()); assertEquals(3, alertsFromDB.size()); for (AlertModel alertFromDB : alertsFromDB) { String header = alertFromDB.getHeaderText(); String desc = alertFromDB.getDescriptionText(); String cause = alertFromDB.getCause(); String effect = alertFromDB.getEffect(); String url = alertFromDB.getUrl(); long timeStart = 0L; long timeEnd = 0L; List<TimeRangeModel> timeRanges = alertFromDB.getTimeRanges(); for (TimeRangeModel tr : timeRanges) { timeStart = tr.getStart(); timeEnd = tr.getEnd(); } String agency = ""; String route = ""; String stop = ""; List<EntitySelectorModel> entitySelectors = alertFromDB.getEntitySelectors(); for (EntitySelectorModel es : entitySelectors) { agency = es.getAgencyId(); route = es.getRouteId(); stop = es.getStopId(); } if (header.equals(TEST_1)) { assertEquals(TEST_1, header); assertEquals(DESC_1, desc); assertEquals(CAUSE_1.toString(), cause); assertEquals(EFFECT_1.toString(), effect); assertEquals(URL_1.toString(), url); assertEquals(TIME_START_1, timeStart); assertEquals(TIME_END_1, timeEnd); assertEquals(AGENCY_1, agency); assertEquals(ROUTE_1, route); assertEquals(STOP_1, stop); } else if (header.equals(TEST_2)) { assertEquals(TEST_2, header); assertEquals(DESC_2, desc); assertEquals(CAUSE_2.toString(), cause); assertEquals(EFFECT_2.toString(), effect); assertEquals(URL_2.toString(), url); assertEquals(TIME_START_2, timeStart); assertEquals(TIME_END_2, timeEnd); assertEquals(AGENCY_2, agency); assertEquals(AGENCY_2 + "_" + ROUTE_2, route); // Verify that agency has // been prepended to // route. assertEquals(STOP_2, stop); } else if (header.equals(TEST_3)) { assertEquals(TEST_3, header); assertEquals(DESC_3, desc); assertEquals(CAUSE_3.toString(), cause); assertEquals(EFFECT_3.toString(), effect); assertEquals(URL_3.toString(), url); assertEquals(TIME_START_3, timeStart); assertEquals(TIME_END_3, timeEnd); assertEquals(AGENCY_3, agency); assertEquals(ROUTE_3, route); assertEquals(AGENCY_3 + "_" + STOP_3, stop); // Verify that agency has // been prepended to stop. } } }
[ "public void createTaskFeed(int taskId);", "private void feed() {\n for (Server tempServer : Server.servers) {\n Fsd.serverInterface.sendServerNotify(\"*\", tempServer, this);\n }\n for (Client tempClient : Client.clients) {\n Fsd.serverInterface.sendAddClient(\"*\", tempClient, this, null, 1);\n if (tempClient.getPlan() != null) {\n Fsd.serverInterface.sendPlan(\"*\", tempClient, this);\n }\n }\n for (Certificate tempCert : Certificate.certs) {\n Fsd.serverInterface.sendCert(\"*\", ProtocolConstants.CERT_ADD, tempCert, this);\n }\n for (WProfile tempWp : Weather.wProfiles) {\n Fsd.serverInterface.sendAddWp(this, tempWp);\n }\n }", "public void refreshFeed() {\n //Attempt to get cached file, if none exist Assign the new feed\n if (NetworkStatics.isDeviceOnline(c))\n saveMessage();\n feedMessage = getSavedMessage();\n\n if (DEBUG) {\n Log.d(LOG_TAG, \"Refreshing Feed...\");\n }\n\n stopIds = new ArrayList<>();\n\n /**\n * Get ALLLLL teh entitiez!!\n */\n for (FeedEntity entity : feedMessage.getEntityList()) {\n\n TripUpdate tripUpdate = entity.getTripUpdate();\n VehiclePosition vehicle = entity.getVehicle();\n //Alert alert = entity.getAlert(); //TODO: Handle alerts later app version.\n\n if (DEBUG) {\n Log.d(LOG_TAG, \"LISTING ENTITIES\");\n Log.d(LOG_TAG, \"----------------\");\n }\n /*\n System.out.println(entity.getId() + \" -- ENTITIY ID\");\n //System.out.println(tripUpdate.getTrip());\n System.out.println(tripUpdate.getTrip().getRouteId() + \" -- ROUTE ID\");\n\n //if(tripUpdate.getStopTimeUpdateCount() == 0)\n // continue;\n\n if(entity.hasTripUpdate()) {\n StopTimeUpdate stopTimeUpdate = tripUpdate.getStopTimeUpdate(0);\n if (stopTimeUpdate.hasArrival()) {\n if(DEBUG) {\n Log.d(LOG_TAG, \"STOPTIMEUPDATE\");\n Log.d(LOG_TAG, \"----------------\");\n }\n System.out.println(stopTimeUpdate.getStopId() + \" arriving at \" + new Date(stopTimeUpdate.getArrival().getTime() * 1000) + \" -- Arrival Time Converted\");\n }\n }*/\n\n for (StopTimeUpdate stu : tripUpdate.getStopTimeUpdateList()) {\n if (!entity.hasTripUpdate())\n continue;\n if (stu.getArrival().getTime() == 0) //TODO: Check this out for trains approaching last stop\n continue;\n //System.out.println(stu.getStopId() + \" -- ENTITY STOPid\");\n stopIds.add(stu.getStopId());\n }\n /*\n //if (!entity.hasVehicle()) {\n // continue;\n //}\n if(DEBUG) {\n Log.d(LOG_TAG, \"VEHICLE POSITION\");\n Log.d(LOG_TAG, \"----------------\");\n }\n\n System.out.println(vehicle.getTrip().getTripId() + \" -- TRIP_ID\");\n\n //System.out.println(vehicle.getTimestamp() + \" -- TIMESTAMP\");\n System.out.println(new Date(vehicle.getTimestamp() * 1000) + \" -- TIME TAKEN\");\n System.out.println(vehicle.getStopId() + \" -- NEXT STOP\");\n System.out.println(vehicle.getCurrentStatus().toString() + \" -- STOP STATUS\");\n\n *//*if(DEBUG) {\n Log.d(LOG_TAG, \"ALERT\");\n Log.d(LOG_TAG, \"----------------\");\n }\n for(EntitySelector aler : entity.getAlert().getInformedEntityList()){\n if(!entity.hasAlert())\n continue;\n //System.out.println(aler.toString() + \" -- ALERT\");\n System.out.println(entity.getAlert().getHeaderText());\n }*/ //TODO:Handle alerts in later app version\n }\n }", "private static ArrayList<FeedMessage> grabAndParseAllFeeds(Map<String, String> feedList) {\n \tArrayList<FeedMessage> feedMessages = new ArrayList<FeedMessage>();\n \t\n \t//grab and parse each feed in feedList\n \tfor(String key: feedList.keySet()){\n \t\ttry {\n\t\t\t\tlogger.info(\"Getting feed {} using URL {}\", key, feedList.get(key));\n\t\t\t\tSyndFeed feed = getFeed(feedList.get(key));\n\t\t\t\t//System.out.println(feed);\n\t\t\t\t\n\t\t\t\tlogger.trace(\"Fetched Feed:\\n{}\", feed);\n\t\t\t\t\n\t\t\t\tList<SyndEntry> entries = feed.getEntries();\n\t for (SyndEntry entry : entries) {\n\t \tFeedMessage tempFM = null;\n\t \t\n\t \t\n\t \tif(key.matches(\"^HuffPost_.*$\")){\n\t \t\tlogger.debug(\"Creating and adding a HuffPostFeedMessage with Title: {}\", entry.getTitle() + \"\");\n\t \t\ttempFM = new HuffPostFeedMessage(entry);\n\t \t}else if(key.matches(\"^TheGuardian.*$\")){\n\t \t\tlogger.debug(\"Creating and adding a TheGuardianFeedMessage with Title: {}\", entry.getTitle() + \"\");\n\t \t\ttempFM = new TheGuardianFeedMessage(key, entry);\n\t \t}else if(key.matches(\"^ScienceDaily.*$\")){\n\t \t\tlogger.debug(\"Creating and adding a ScienceDailyFeedMessage with Title: {}\", entry.getTitle() + \"\");\n\t \t\ttempFM = new ScienceDailyFeedMessage(key, entry);\n\t \t}else if(key.matches(\"^CBS.*$\")){\n\t \t\tlogger.debug(\"Creating and adding a CBSLocalFeedMessage with Title: {}\", entry.getTitle() + \"\");\n\t \t\ttempFM = new CBSLocalFeedMessage(key, entry);\n\t \t}else if(key.matches(\"^Bing_.*$\")){\n\t \t\tlogger.debug(\"Creating and adding a BingFeedMessage with Title: {}\", entry.getTitle() + \"\");\n\t \t\ttempFM = new BingFeedMessage(entry);\n\t \t}else if(key.matches(\"^Google_.*$\")){\n\t \t\tlogger.debug(\"Creating and adding a GoogleFeedMessage with Title: {}\", entry.getTitle() + \"\");\n\t \t\ttempFM = new GoogleFeedMessage(entry);\n\t \t}else if(key.matches(\"^GoogleAlert_.*$\")){\n\t \t\tlogger.debug(\"Creating and adding a GoogleAlertFeedMessage with Title: {}\", entry.getTitle() + \"\");\n\t \t\ttempFM = new GoogleAlertFeedMessage(key, entry);\n }else if(key.matches(\"^BbcUK_.*$\")){\n logger.debug(\"Creating and adding a BbcUKFeedMessage with Title: {}\", entry.getTitle() + \"\");\n tempFM = new BbcUKFeedMessage(key, entry);\n }else{\n logger.debug(\"Creating and adding a StandardFeedMessage with Title: {}\", entry.getTitle() + \"\");\n tempFM = new StandardFeedMessage(key,entry);\n\t \t}\n\t \t\n\t \t\n\t \t//only add to list of feed messages from all providers if it doesn't exist\n\t \t//also only add if within published date within interval\n\t \t\n\t \t\n\t \tlong now = new Date().getTime();\n\t \tlogger.trace(\"Checking article with title: {} \\n and description: {}\", tempFM.getTitle(), tempFM.getDescription());\n\t \tlogger.trace(\"now: {}\", now);\n \t\t\tlogger.trace(\"pubDate: {}\", tempFM.getPubDate().getTime());\n \t\t\tlogger.trace(\"difference: {}\", now - tempFM.getPubDate().getTime());\n \t\t\tlogger.trace(\"difference in minutes: {}\", (now - tempFM.getPubDate().getTime())/60/1000);\n \t\t\t//check time interval - 10 Hours or Less\n Integer checkInterval = 1000*60*8*60;\n\t \tif(tempFM != null && now - tempFM.getPubDate().getTime() <= checkInterval){\n\t \t\t//check if article relevant\n\t \t\tString regExKeyWords = generateRegExForCheckingRelevantArticles(searchWords);\n\t \t\t\n\t \t\tif(tempFM.getTitle().matches(regExKeyWords) || tempFM.getDescription().matches(regExKeyWords)){\n\t \t\t\t//check if its not dupliacate\n\t \t\t\tboolean duplicate = false;\n\t \t\t\tfor(int i = 0; i < feedMessages.size(); i++){\n\t\t\t \t\tif(tempFM.getLink().equals(feedMessages.get(i).getLink())){\n\t\t\t \t\t\tduplicate = true;\n\t\t\t \t\t\tbreak;\n\t\t\t \t\t}\n\t\t\t \t}\n\t \t\t\tif(!duplicate){\n\t \t\t\t\t//check taxonomy to see if it is related article\n\t \t\t\t\tTaxonomy[] taxonomy = new Taxonomy[0];\n\t \t\t\t\tAlchemyAPI alchemyObj = AlchemyAPI.GetInstanceFromFile(\"api_key.txt\");\n\t \t\t\t\tDocument doc;\n\t \t\t try {\n\t \t\t \t// Create an AlchemyAPI object.\n\t\t \t\t logger.info(\"Checking Taxonomy using AlchemyAPI for {}\", tempFM.getLink() + \"\");\n\t\t \t\t doc = alchemyObj.URLGetTaxonomy(tempFM.getLink() + \"\");\n\t \t\t\t\t\ttaxonomy = getTaxonomyFromDocument(doc);\n\t \t\t\t\t\t\n\t \t\t\t\t} catch (Exception e) {\n\t \t\t\t\t\tlogger.error(\"Error occurred checking Taxonomy using AlchemyAPI\", e);\n\t \t\t\t\t\t\n\t \t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\tlogger.info(\"Checking Entity using AlchemyAPI for {}\", tempFM.getLink() + \"\");\n\t\t\t \t\t doc = alchemyObj.URLGetRankedNamedEntities(tempFM.getLink() + \"\");\n\t\t \t\t\t\t\ttempFM.setCities(getCitiesFromDocument(doc));\n\t\t\t\t\t\t\t\t\t}catch(Exception ex){}\n\t \t\t\t\t\t\n\t \t\t\t\t\t//logger.debug(\"Adding article: {}\", tempFM.getTitle());\n\t\t \t\t\t\t//feedMessages.add(tempFM);\n\t \t\t\t\t}\n\t \t\t \n\t \t\t if (taxonomy.length > 0) {\n\t\t\t\t\t\t\t\t\t//if taxonomy matches then add the article\n\t\t\t\t\t\t\t\t\tboolean matches = false;\n\t\t\t\t\t\t\t\t\tString[] relWords = { \"weather\",\n\t\t\t\t\t\t\t\t\t\t\t\"disaster\", \"geology\",\n\t\t\t\t\t\t\t\t\t\t\t\"landslide\", \"mudslide\",\n\t\t\t\t\t\t\t\t\t\t\t\"rockslide\"};\n\t\t\t\t\t\t\t\t\tString regExToMatch = generateRegExForCheckingRelevantArticles(relWords);\n\t\t\t\t\t\t\t\t\tfor (int i=0; i < taxonomy.length; i++) {\n\t\t\t\t\t\t\t\t\t\tif (taxonomy[i].getLabel().matches(regExToMatch)) {\n\t\t\t\t\t\t\t\t\t\t\tmatches = true;\n\t\t\t\t\t\t\t\t\t\t\t//add taxonomy info to tempFM before adding\n\t\t\t\t\t\t\t\t\t\t\ttempFM.setTaxonomyConfidence(taxonomy[i].getConfidenceScore());\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (matches) {\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\t\t\tlogger.info(\"Checking Entity using AlchemyAPI for {}\", tempFM.getLink() + \"\");\n\t\t\t\t \t\t doc = alchemyObj.URLGetRankedNamedEntities(tempFM.getLink() + \"\");\n\t\t\t \t\t\t\t\ttempFM.setCities(getCitiesFromDocument(doc));\n\t\t\t\t\t\t\t\t\t\t}catch(Exception e){}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tlogger.debug(\"Adding article: {}\",\n\t\t\t\t\t\t\t\t\t\t\t\ttempFM.getTitle());\n\t\t\t\t\t\t\t\t\t\tfeedMessages.add(tempFM);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tlogger.info(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Skipping irrelevant article based on AlchemyAPI Taxonomy: {}\",\n\t\t\t\t\t\t\t\t\t\t\t\ttempFM.getTitle());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tlogger.debug(\"No Taxonomy info available.\");\n\t\t\t\t\t\t\t\t\tlogger.info(\"Skipping irrelevant article: {}\", tempFM.getTitle());\n\t\t\t\t\t\t\t\t}\n\t \t\t\t}else{\n\t \t\t\t\tlogger.info(\"Skipping duplicate article: {}\", tempFM.getTitle());\n\t \t\t\t}\n\t \t\t}else{\n\t \t\t\tlogger.info(\"Skipping irrelevant article: {}\", tempFM.getTitle());\n\t \t\t}\n\t \t}else{\n\t \t\tlogger.info(\"Skipping old article: {}\", tempFM.getTitle());\n\t \t}\n\t }\t\t\t\t\t\n\t\t\t} catch (IOException e){\n\t\t\t\tlogger.error(\"IOException occurred\", e);\n\t\t\t} catch (IllegalArgumentException e){\n\t\t\t\tlogger.error(\"IllegalArgumentException occurred\", e);\n\t\t\t} catch (FeedException e){\n\t\t\t\tlogger.error(\"FeedException occurred\", e);\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(\"Unknown error occurred\", e);\n\t\t\t}\n \t}\n \t\n \treturn feedMessages;\n\t}", "private void downloadFeed() {\n APIService.startActionGetFeed(this, SyncReceiver.receiver);\n //Temp Code for placeholder:\n //This Code Parses the JSON resposne.\n }", "public void createActivity(ServiceRequest serviceRequest,String email);", "com.exacttarget.wsdl.partnerapi.TrackingEvent addNewEvents();", "@Override\n public void onSuccess(final AuthenticationResult authenticationResult) {\n IClientConfig clientConfig = DefaultClientConfig.createWithAuthenticationProvider(\n new IAuthenticationProvider() {\n @Override\n public void authenticateRequest(IHttpRequest request) {\n request.addHeader(\"Authorization\", \"Bearer \"\n + authenticationResult.getAccessToken());\n request.addHeader(\"Content-Type\", \"application/json\");\n }\n });\n mGraphServiceClient = new GraphServiceClient.Builder().fromConfig(\n clientConfig).buildClient();\n\n\n String calId = prefs.getString(\"office_cal_id\", null);\n final IEventCollectionRequestBuilder eventCollectionRequestBuilder =\n mGraphServiceClient.getMe()\n .getCalendars(calId)\n .getEvents();\n\n\n @SuppressLint(\"StaticFieldLeak\")\n class AddToOfficeTask extends AsyncTask<Void, Void, Void> {\n\n @Override\n protected Void doInBackground(Void... voids) {\n for (Event e : parsedEvents) {\n //To deal with 429 throttling until MS put batching in their sdk\n// try {\n// Thread.sleep(800);\n// } catch (InterruptedException e1) {\n// e1.printStackTrace();\n// }\n eventCollectionRequestBuilder.buildRequest()\n .post(e, new ICallback<Event>() {\n @Override\n public void success(Event event) {\n PugNotification.with(getApplicationContext())\n .load()\n .title(\"Office Sync Complete!\")\n .message(\n \"Your Uni Timetable is now on your \"\n + \"Office Calendar\")\n .flags(DEFAULT_ALL)\n .smallIcon(\n R.drawable.pugnotification_ic_launcher)\n .simple()\n .build();\n }\n\n @Override\n public void failure(ClientException ex) {\n Log.e(TAG, ex.getMessage());\n PugNotification.with(getApplicationContext())\n .load()\n .title(\"Office Sync Failed\")\n .message(ex.getLocalizedMessage())\n .flags(DEFAULT_ALL)\n .click(SettingsActivity.class)\n .smallIcon(\n R.drawable.pugnotification_ic_launcher)\n .simple()\n .build();\n }\n });\n }\n return null;\n }\n }\n\n new AddToOfficeTask().execute();\n\n PugNotification.with(getApplicationContext())\n .load()\n .title(\"Office Sync Complete!\")\n .message(\"Your Uni Timetable is now on your Office Calendar\")\n .flags(DEFAULT_ALL)\n .smallIcon(R.drawable.pugnotification_ic_launcher)\n .simple()\n .build();\n\n }", "@Override\n public void request(\n final MSGraphEventsService MSGraphEventsService,\n final Callback<ResponseBody> callback) {\n MSGraphEventsService.createNewEvent(\n getVersion(),\n createEvent()).enqueue(\n new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {\n try {\n String eventId = new JSONObject(response.body().string()).getString(\"id\");\n // now that the event has been created,\n // let's change the subject\n Event amended = new Event();\n amended.subject = \"Weekly Sync Meeting\";\n\n MSGraphEventsService.updateEvent(\n getVersion(),\n eventId,\n amended).enqueue(callback);\n } catch(JSONException | IOException e) {\n callback.onFailure(call, e);\n }\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n callback.onFailure(call, t);\n }\n }\n );\n }", "public RetrieveRSSFeeds(ActivityNotification activityDailyEvents) \r\n\t{\r\n\t\tthis.activityDailyEvents = activityDailyEvents;\r\n\t itemlist = new ArrayList<RSSItem>();\r\n\t}", "void postAppToFeed(String message) {\n\t\tpostAppToFeed(message, robinFbAppDesc);\n\t}", "public abstract List<SyndEntry> getNewEntries(SyndFeed feed);", "@Override\r\n protected Void doInBackground(EventFeed... params) {\n saveFeed(params[0].TOPIC, \" \" , params[0].EVENTQUESTION, params[0].DATE,params[0].UNIVERSITY,\"\",\"1\");\r\n return null;\r\n }", "public static void main(String[] args) {\n HttpClientAdapter okHttpClientAdapter = getClient(collectorEndpoint);\n \n Emitter emitter = SimpleEmitter.builder()\n .httpClientAdapter( okHttpClientAdapter ) // Required\n .threadCount(20) // Default is 50\n .build();\n \n \n Tracker tracker = new Tracker.TrackerBuilder(emitter, namespace, appID)\n .base64(baseSetting)\n .platform(DevicePlatform.Desktop)\n .build();\n \n //----------------------------------------\n // Create a Map of the data you want to include...\n Map<String, Object> citizenMap = new HashMap<>();\n citizenMap.put(\"client_id\", 111111);\n citizenMap.put(\"quick_txn\", false);\n SelfDescribingJson citizen = new SelfDescribingJson(\"iglu:ca.bc.gov.cfmspoc/citizen/jsonschema/2-0-0\", citizenMap);\n\n //----------------------------------------\n Map<String, Object> officeMap = new HashMap<>();\n officeMap.put(\"office_id\", 12);\n officeMap.put(\"office_type\", \"reception\");\n SelfDescribingJson office = new SelfDescribingJson(\"iglu:ca.bc.gov.cfmspoc/office/jsonschema/1-0-0\", officeMap);\n \n //----------------------------------------\n Map<String, Object> agentMap = new HashMap<>();\n agentMap.put(\"agent_id\", 12);\n agentMap.put(\"role\", \"CSR\");\n agentMap.put(\"quick_txn\", true);\n SelfDescribingJson agent = new SelfDescribingJson(\"iglu:ca.bc.gov.cfmspoc/agent/jsonschema/2-0-0\", agentMap);\n \n //----------------------------------------\n List<SelfDescribingJson> contexts = new ArrayList<>();\n contexts.add(citizen);\n contexts.add(office);\n contexts.add(agent);\n \n // Create your event data -- in this example the event has data of its own\n Map<String, Object> chooseserviceMap = new HashMap<>();\n chooseserviceMap.put(\"channel\",\"in-person\");\n chooseserviceMap.put(\"program_id\",12);\n chooseserviceMap.put(\"parent_id\",0);\n chooseserviceMap.put(\"program_name\",\"An amazing program\");\n chooseserviceMap.put(\"transaction_name\",\"A fantastic transaction\");\n chooseserviceMap.put(\"quick_txn\",false);\n\n SelfDescribingJson chooseserviceData = new SelfDescribingJson(\"iglu:ca.bc.gov.cfmspoc/chooseservice/jsonschema/1-0-0\", chooseserviceMap);\n // Track your event with your custom event data\n tracker.track(Unstructured.builder()\n .eventData(chooseserviceData)\n .customContext(contexts)\n .build());\n\n //----------------------------------------\n // Create your event data -- in this example the event has no data of its own\n SelfDescribingJson beginserviceData = new SelfDescribingJson(\"iglu:ca.bc.gov.cfmspoc/beginservice/jsonschema/1-0-0\");\n // Track your event with your custom event data\n tracker.track(Unstructured.builder()\n .eventData(beginserviceData)\n .customContext(contexts)\n .build());\n }", "@Override\n\tpublic void feedEvent() {\n\t\tBaseEvent event = new EventWithPayload(payload);\n\t\tevent.setFeedingTime(System.nanoTime());\n\t\t\n\t\tepService.getEPRuntime().sendEvent(event);\n\t}", "private static void reportFeed(String[] tokens) {\n\t\tif(tokens.length==2){\n\t\t\tif(validate(\"Zoo\",tokens[1])){\n\t\t\t\tint zooId = Integer.parseInt(tokens[1]);\n\t\t\t\tif(zooList.containsKey(zooId)){\n\t\t\t\t\tzooList.get(zooId).reportFeed();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.err.println(\"ZooId not found \"+zooId);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(tokens.length==1){\n\t\t\t\tfor(Map.Entry<Integer, Zoo> entry: zooList.entrySet()){\n\t\t\t\t\tentry.getValue().reportFeed();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.err.println(\"Invalid number of Arguments for report_feed\");\n\t\t\t}\n\t\t}\n\t}", "@GET(\"espn/rss/tennis/news\")\n Call<RssFeedTennis> getTennisFeeds();", "void createActivity(WfActivity wfActivity);", "@Override\n public void request(\n final MSGraphEventsService MSGraphEventsService,\n final Callback<ResponseBody> callback) {\n Event event = createEvent();\n MSGraphEventsService.createNewEvent(\n getVersion(),\n event).enqueue(\n new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {\n try {\n String eventId = new JSONObject(response.body().string()).getString(\"id\");\n // event created, now let's delete it\n MSGraphEventsService.deleteEvent(\n getVersion(),\n eventId).enqueue(callback);\n } catch(JSONException | IOException e) {\n callback.onFailure(call, e);\n }\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n callback.onFailure(call, t);\n }\n }\n );\n }", "private void fetchAllPosts() {\n serviceWorkerRequestParamsBuilder = new ServiceWorkerRequestBuilder();\n serviceWorkerRequestParams = serviceWorkerRequestParamsBuilder.serCommunityTag(Communities.ALL)\n .setLimit(Constants.MAX_FEED_LOAD_LIMIT)\n .setUserName(HaprampPreferenceManager.getInstance().getCurrentSteemUsername())\n .createRequestParam();\n //serviceWorker.requestAllFeeds(serviceWorkerRequestParams);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public long getItemId(int arg0) { return 0; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public boolean insert(BuyingHistory buyingHistory) { return false; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void classement() {\n\t\t\t\n\t\t}", "@Override\r\n public void publicando() {\n }", "@Override\n\tpublic void tyre() {\n\t\t\n\t}", "@Override\n \tpublic void init() {\n \n \t}", "private static void EX5() {\n\t\t\r\n\t}", "protected void method_5557() {}", "@Override\n\tpublic void cafeteria() {\n\t\t\n\t}", "@Override\r\n\tpublic void preco() {\n\r\n\t}", "@Override\r\n\tpublic void jugar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void limpar() {\n\t\t\r\n\t}", "public void mo5201a() {\n }", "@Override\n\tpublic void annuler() {\n\n\t}", "@Override\r\n\tpublic void zwroc() {\n\t\t\r\n\t}", "@Override\n\t\tprotected void swop() {\n\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the Start Updates button and requests start of location updates. Does nothing if updates have already been requested.
public void startUpdatesButtonHandler() { if (!mRequestingLocationUpdates) { mRequestingLocationUpdates = true; startLocationUpdates(); } }
[ "public void startUpdatesButtonHandler(View view) {\n if (!mRequestingLocationUpdates) {\n mRequestingLocationUpdates = true;\n startLocationUpdates();\n }else{\n mRequestingLocationUpdates = false;\n stopLocationUpdates();\n }\n setButtonsText();\n }", "private void startPeriodicUpdates() {\n\n mLocationClient.requestLocationUpdates(mLocationRequest, this);\n appendStatus(R.string.location_requested);\n }", "public void startUpdatesButtonHandler(View view) {\r\n if (!mRequestingLocationUpdates) {\r\n mRequestingLocationUpdates = true;\r\n setButtonsEnabledState();\r\n startLocationUpdates();\r\n }\r\n }", "private void startPeriodicUpdates() {\n\n mLocationClient.requestLocationUpdates(mLocationRequest, this);\n Toast.makeText(this, R.string.location_requested, Toast.LENGTH_SHORT).show();\n }", "private void startLocationUpdates() {\n // Begin by checking if the device has the necessary location settings.\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(requireActivity(), locationSettingsResponse -> {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n updateUI();\n })\n .addOnFailureListener(requireActivity(), e -> {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(requireActivity(), REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n Toast.makeText(requireActivity(), errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n updateUI();\n });\n }", "protected void startLocationUpdates() {\n\n\n }", "private void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettingsRequest object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Check whether location settings are satisfied\n // https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n\n Log.d(TAG, \"startLocationUpdates: STARTED\");\n }", "@SuppressLint(\"MissingPermission\")\n private void startLocationUpdates() {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback,\n null);\n }", "private void startLocationUpdates() {\n\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n\n // Get last known location of the device\n mFusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n dumpLocation(location);\n }\n });\n\n mLocationUpdatesCounter = 0;\n\n mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n if (locationResult == null) {\n return;\n }\n for (Location location : locationResult.getLocations()) {\n dumpLocation(location);\n setViewText(R.id.lbLocationUpdatesCounter, ++mLocationUpdatesCounter);\n\n if (mLocationUpdatesCounter == Integer.MAX_VALUE)\n mLocationUpdatesCounter = 0;\n }\n }\n };\n\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback,\n null);\n\n }", "protected void startLocationUpdates() {\n locationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY )\n .setInterval(Environment.UPDATE_INTERVAL)\n .setFastestInterval(Environment.FASTEST_INTERVAL);\n\n // Request location updates\n if (!checkPermission()) {\n return;\n }\n\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient,\n locationRequest, this);\n\n // Schedule a runnable to unregister location listeners\n Executors.newScheduledThreadPool(1).schedule(new Runnable() {\n @Override\n public void run() { Stop(); }\n }, Environment.TimeToRefresh, TimeUnit.MILLISECONDS);\n }", "public void startUpdatesButtonHandler(View view) {\n checkLocationSettings();\n }", "private void startLocationUpdates() {\n mSettingsClient\n .checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(getActivity(), new OnSuccessListener<LocationSettingsResponse>() {\n @SuppressLint(\"MissingPermission\")\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(\"\", \"All location settings are satisfied.\");\n\n //Toast.makeText(getApplicationContext(), \"Started location updates!\", Toast.LENGTH_SHORT).show();\n\n //noinspection MissingPermission\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n mMap.setMyLocationEnabled(true);\n updateLocationUI();\n }\n })\n .addOnFailureListener(getActivity(), new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(getActivity(), REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n\n Toast.makeText(getContext(), errorMessage, Toast.LENGTH_LONG).show();\n break;\n }\n\n updateLocationUI();\n }\n });\n }", "private void startLocationUpdates() {\n // Begin by checking if the device has the necessary location settings.\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //Toast.makeText(getApplicationContext(), \"Started location updates!\", Toast.LENGTH_SHORT).show();\n\n if (ActivityCompat.checkSelfPermission( ScoreActivity.this, Manifest.permission.ACCESS_FINE_LOCATION ) != PackageManager.PERMISSION_GRANTED ) {\n requestPermissions();\n }\n //noinspection MissingPermission\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n updateUI();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(ScoreActivity.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n\n Log.e(TAG, errorMessage);\n Toast.makeText(ScoreActivity.this, errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n\n updateUI();\n }\n });\n }", "protected void startLocationUpdates() {\n Log.d(TAG, \"startLocationUpdates: Called start location updates\");\n try {\n\t LocationServices.FusedLocationApi.requestLocationUpdates(\n googleApiClient, locationRequest, this);\n } catch (SecurityException e) {}\n }", "protected void startLocationUpdates() {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)\n .setInterval(UPDATE_INTERVAL)\n .setFastestInterval(FASTEST_INTERVAL);\n // Request location updates\n if (checkPermission(ACCESS_FINE_LOCATION)) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n } else{\n Log.d(TAG, \"Location permission declined, no updates retrieved.\");\n Toast.makeText(this, \"Location permission needed to get updates\", Toast.LENGTH_SHORT).show();\n }\n }", "public void requestLocationUpdates() {\n try {\n Log.i(TAG, \"Starting location updates\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, getPendingIntent());\n sendPluginResultAndKeepCallback(true,mCallbackContext);\n } catch (SecurityException e) {\n e.printStackTrace();\n mCallbackContext.error(e.getMessage());\n }\n }", "private void startLocationUpdate() {\n settingsClient\n .checkLocationSettings(locationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @SuppressLint(\"MissingPermission\")\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG,\"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n fusedLocationClient.requestLocationUpdates(locationRequest,locationCallback, Looper.myLooper());\n\n onLocationChange();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(NavigationActivity.this, REQUEST_CODE);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n\n Toast.makeText(NavigationActivity.this, errorMessage, Toast.LENGTH_LONG).show();\n }\n\n onLocationChange();\n }\n });\n }", "public void startUpdates(){\n mStatusChecker.run();\n }", "public void startLocationUpdates() {\n\n boolean isLocationPermissionGranted = new GeneralFunctions(mContext).checkLocationPermission(isPermissionDialogShown);\n\n if (isLocationPermissionGranted == true) {\n// Utils.printLog(\"Loc start update\",\"called\");\n try\n\n {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n catch (Exception e)\n {\n if (mGoogleApiClient != null)\n {\n mGoogleApiClient.connect();\n }\n }\n } else {\n isPermissionDialogShown = true;\n }\n\n }", "protected void startLocationUpdates() {\n if (!mRequestingLocationUpdates) {\n mRequestingLocationUpdates = true;\n\n // The final argument to {@code requestLocationUpdates()} is a LocationListener\n // (http://developer.android.com/reference/com/google/android/gms/location/LocationListener.html).\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n Log.d(TAG,\"Permissions Failed, deal with it\");\n Log.e(TAG, \"ToastTest\");\n\n Handler handler = new Handler(Looper.getMainLooper());\n\n handler.post(new Runnable() {\n\n @Override\n public void run() {\n if(getApplicationContext() != null) {\n Toast.makeText(getApplicationContext(), \"Provide Location Services Permission! (Logout/In)\", Toast.LENGTH_LONG).show();\n }\n }\n });\n killService();\n return;\n }\n\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n Log.i(TAG, \" startLocationUpdates===\");\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method automatically generated with DtoGenerator
public SemanticAnnotationFetchOptions withSemanticAnnotationsUsing(SemanticAnnotationFetchOptions fetchOptions) { return semanticAnnotations = fetchOptions; }
[ "private DtoConverter() {\n // Empty for SonarQube.\n }", "public SedeDTO() {}", "S convertToEntity(D dto);", "D convertToDto(S entity);", "private FamilyRelationOutDTOMapper() {}", "MODEL map(DTO dto);", "public IdentificadorDto() {}", "public interface DTO<T> {\n\n\tpublic T toModel();\n\n}", "public ResultDtoJax() {\n }", "Dto convertToDto(Entity entity);", "public DTOIntPerson getRenapoPersonDummy2(Person person);", "public interface PeriodicVaccinationDto {\n Integer getPatientId();\n String getName();\n String getDateOfBirth();\n String getGender();\n String getGuardian();\n String getPhone();\n String getAddress();\n String getStatus();\n\n}", "public EntidadDTO() {\n }", "S convertModelToDto(T source);", "public GroupeDto() {}", "@Mapper\npublic interface MeyouUserConvert {\n\n MeyouUserConvert INSTANCE = Mappers.getMapper(MeyouUserConvert.class);\n\n static MeyouUserConvertConvertor instance() {\n return INSTANCE;\n }\n\n @Mappings({})\n MeyouUser toMeyouUser(MeyouUserDTO meyouUserDTO);\n\n @Mappings({})\n MeyouUserDTO toMeyouUserDTO(MeyouUser meyouUser);\n\n List<MeyouUserDTO> toMeyouUserDTOs(List<MeyouUser> meyouUsers);\n\n List<MeyouUser> toMeyouUsers(List<MeyouUserDTO> meyouUserDTOs);\n}", "@Override\n\tpublic boolean validateDTO() {\n\t\treturn false;\n\t}", "public DetalleEntregaDTO() {\n }", "public interface IValoracionArticularMuscularUtilDTO {\n\n\t/**\n\t * To business.\n\t * \n\t * @param valoracionArticularMuscularDTO\n\t * the valoracion articular muscular dto\n\t * @return the valoracion articular muscular\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tValoracionArticularMuscular toBusiness(ValoracionArticularMuscularDTO valoracionArticularMuscularDTO) throws TransferObjectException;\n\n\t/**\n\t * To rest.\n\t * \n\t * @param valoracionArticularMuscular\n\t * the valoracion articular muscular\n\t * @return the valoracion articular muscular dto\n\t * @throws TransferObjectException\n\t * the transfer object exception\n\t */\n\tValoracionArticularMuscularDTO toRest(ValoracionArticularMuscular valoracionArticularMuscular) throws TransferObjectException;\n}", "public ResponseWithFieldsByTargetType() {\n super();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
First startup, leader is discovered
public void pong(Pong message) { if (message.getId() != 0 && context.getLeaderId() == 0 && context.isLeader() == false) { context.setLeader(true); context.setLeaderId(message.getId()); context.setLeaderPort(message.getPort()); //The peer of other side is leader if (message.getLocalId() == message.getId()) { context.setConnectedToLeader(true); } else { //Connect to leader try { ConnectionFactory.getInstance(context.getPeerFactory()).connect(String.valueOf(message.getId()), "127.0.0.1", message.getPort()); } catch (Exception e) { logger.error(e.getMessage(), e); } } } //This peer is leader if (context.isLeader()) { //Nothing to do } //Leader is founded if (context.getLeaderId() != 0) { //Nothing to do } //The peer of other side isn't leader, close the connection if (message.getLocalId() != message.getId()) { ConnectionFactory.getInstance(context.getPeerFactory()).disConnect(String.valueOf(message.getLocalId())); } }
[ "public void startup() {\n }", "private void startup()\n\t{\n\t}", "@Override\r\n\tpublic void watchLeader() {\n\t\t\r\n\t}", "Member leader();", "private EpzillaLeader() {\r\n\t\tsetClusterClientList(new Vector<IEpzillaEventListner>());\r\n\t}", "@Override\r\n\t\t\tpublic void isLeader() {\n\t\t\t\tSystem.out.println(name + \":I am leader2.\" + \",date=\" + new Date());\r\n\t\t\t}", "public void startup() {\n\tstart();\t\n }", "@Override\n public void onStartup() {\n LOGGER.info(\"Pro2Future OpcUa Machine Simulator: startup in progress.\");\n this.serverManager.startup();\n this.actionManager.startup();\n LOGGER.info(\"Pro2Future OpcUa Machine Simulator: successfully started.\");\n }", "protected void startup()\n {\n long t1 = Calendar.getInstance().getTimeInMillis();\n // instantiate the database\n db = new GraphDatabaseFactory().newEmbeddedDatabase(DBPATH);\n // register shutdown hook\n Runtime.getRuntime().addShutdownHook(new Thread()\n {\n @Override\n public void run()\n {\n db.shutdown();\n }\n });\n long t2 = Calendar.getInstance().getTimeInMillis();\n System.out.println(\"Startup: \" + (t2 - t1));\n }", "public boolean isLeaderInitialized() {\n return leader_is_initialized; \n }", "protected void hostStarted()\n\t{\n\t\tisOnline = true;\n\t\tonlineSignallingLatch.countDown();\n\t}", "@Override\n\tpublic void startupImpl() {\n\t\t// Create event broadcast group for broadcasting our own events\n\t\tEventBroadcaster.getInstance().createBroadcastGroup(getClass().getCanonicalName());\n\t\t\n\t\t// Set Caf Client debugging property according to our global debug\n\t\t// debug logging property; and register for notification of changes\n\t\t// to our global debug logging property\n\t\tClient.setDebug(GeneralManagement.isDebugLogging());\n\t\tEventBroadcaster.getInstance().registerEventProcessor(\n\t\t\t\tManagement.class.getCanonicalName(), this);\n\t\t\n\t\t// Register with the CAF Client\n\t\t_cafClient = Client.getInstance(\n\t\t\t\tCAF_MAJOR_VERSION, \n\t\t\t\tCAF_MINOR_VERSION, \n\t\t\t\t_routerIpAddress, \n\t\t\t\t_routerPort, \n\t\t\t\t_userName, \n\t\t\t\t_password, \n\t\t\t\t_clientLabel,\n\t\t\t\t\"\", \n\t\t\t\t0, \n\t\t\t\tnull, \n\t\t\t\tnull);\n\t\t\n\t\t// Create and configure the CAF Service\n\t\t_cafService = _cafClient.createService();\n\t\t_cafService.setServiceID(DTN_CAF_SERVICE_ID);\n\t\t_cafService.setSubServiceID(DTN_CAF_SUBSERVICE_ID);\n\t\t_cafService.generateRandomServiceInstance();\n\t\t\n\t\t// Publish to CAF\n\t\tpublish();\n\t\t\n\t\t// Register notification for births and deaths of any other nodes \n\t\t// advertising the DTN Service\n\t\t_cafSubscription = _cafClient.createService();\n\t\t_cafSubscription.setServiceID(DTN_CAF_SERVICE_ID);\n\t\t_cafSubscription.setSubServiceID(DTN_CAF_SUBSERVICE_ID);\n\t\t_cafSubscription.setServiceInstance(\n\t\t\t\tnew UUID(\n\t\t\t\t\t\t-1L, -1L));\n\t\t_cafSubscription.addSubscriptionMatchListener(this);\n\t\t_cafSubscription.subscribe();\n\t}", "public void startInitialTurn() {\r\n\t\tisInitialTurnActive = true;\r\n\t}", "private void checkForFirstStartups() {\n SharedPreferences prefs = getPreferences(0);\n SharedPreferences.Editor editor = prefs.edit();\n int timesStarted = prefs.getInt(Constants.KEY_STARTED_TIMES, 0);\n\n if (timesStarted <= TUTORIAL_FIRST_STARTUPS) {\n timesStarted++;\n editor.putInt(Constants.KEY_STARTED_TIMES, timesStarted);\n editor.commit();\n\n //show tutorial\n showTutorialAddSeminar();\n }\n }", "@Override\n public void takeLeadership(CuratorFramework client) throws Exception {\n log.info(name + \" is now the leader.\");\n log.info(name + \" has been leader \" + leaderCount.getAndIncrement() + \" time(s) before.\");\n while (true) {\n\n }\n }", "@Override\n\tpublic void takeLeadership(CuratorFramework client) throws Exception {\n\t\tLOGGER.info(\"{}: I'm now the leader\", this.name);\n\t\ttry {\n\t\t\tisLeader = false;\n\t\t\tmaxwell.run();\n\t\t} finally {\n\t\t\tLOGGER.info(\"I relinquish leadership\");\n\t\t}\n\t}", "public synchronized void start() {\n if (exclusiveLeaderProducer == null) {\n try {\n // This means that we are in non-leader mode. start function metadata tailer\n initializeTailer();\n } catch (PulsarClientException e) {\n throw new RuntimeException(\"Could not start MetaData topic tailer\", e);\n }\n }\n }", "void findLeaderExecution()\r\n {\r\n try\r\n {\r\n /*\r\n Variables declaration and sockets initialization. \r\n This is going to get the group IP and the local IP. \r\n */\r\n String msg = \"NewNode\";//CGlobals.m_strLocalHost;\r\n //Variables for the IP management\r\n InetAddress group = InetAddress.getByName(CGlobals.m_strGroupId );\r\n InetAddress local = InetAddress.getByName( CGlobals.m_strLocalHost );\r\n byte[] data = msg.getBytes();\r\n DatagramSocket socket = new DatagramSocket( CGlobals.m_iPortLeaderListener, local );\r\n DatagramPacket datagram = new DatagramPacket( data, data.length, group , CGlobals.m_iPortLeaderListener );\r\n System.out.println(\"Connected at: \"+socket.getLocalAddress());\r\n DatagramSocket receiverSocket = new DatagramSocket( CGlobals.m_iPortLeaderListener+1 );\r\n /*\r\n Looking for the system leader is a message that it is going to be printed if\r\n the system is looking to another leader. \r\n */\r\n if ( CGlobals.m_bDebugConnection )\r\n System.out.println( \"[Node]: Looking for system leader\" );\r\n \r\n /*\r\n This while contains a validation to do when the getting leader attempts are less than 4. \r\n If there are less than 4 it will active a receiverSocket to manage the time of the system users\r\n and select a new leader through the LeaderService application. \r\n */\r\n while ( m_iTryAttempt < 4 )\r\n {\r\n try\r\n {\r\n socket.send( datagram );\r\n receiverSocket.setSoTimeout(CGlobals.m_iTimeOutLeaderSearch );\r\n data = new byte[1024];\r\n DatagramPacket packet = new DatagramPacket( data, data.length );\r\n receiverSocket.receive( packet );\r\n String remoteIP = packet.getAddress().toString();\r\n remoteIP = remoteIP.replace( \"/\", \"\" );\r\n if( CGlobals.m_bDebugConnection )\r\n System.out.println( \"[Connection]: Response from: \" + remoteIP);\r\n CGlobals.m_strLeaderId = remoteIP;\r\n break;\r\n } \r\n catch ( SocketTimeoutException e )\r\n {\r\n if( CGlobals.m_bDebugConnection )\r\n System.out.println( \"[Connection]: Leader search timeout\" );\r\n }\r\n m_iTryAttempt++;\r\n }\r\n socket.close();\r\n receiverSocket.close();\r\n } \r\n catch(UnknownHostException uhe)\r\n {\r\n if( CGlobals.m_bDebugConnection && CGlobals.m_bDebugExceptions )\r\n uhe.getStackTrace();\r\n }\r\n catch(IOException ioe)\r\n {\r\n if( CGlobals.m_bDebugConnection && CGlobals.m_bDebugExceptions )\r\n ioe.getStackTrace();\r\n }\r\n }", "@Override\n public void takeLeadership(CuratorFramework client) throws Exception {\n leaderCount.incrementAndGet();\n LOGGER.info(\"Becoming leader in Sentry HA cluster:{}\", this);\n lock.lock();\n try {\n isLeader = true;\n // Wait until we are interrupted or receive a signal\n cond.await();\n } catch (InterruptedException ignored) {\n Thread.currentThread().interrupt();\n LOGGER.error(\"takeLeadership call interrupted:\" + this, ignored);\n } finally {\n isLeader = false;\n lock.unlock();\n LOGGER.info(\"Resigning from leader status in a Sentry HA cluster:{}\", this);\n }\n }", "public void onStartup() throws Exception\n {\n NNTPServer.startup();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form MainFrame
public MainFrame() { contador.adicionaNovoInteressadoNoContador(this); initComponents(); }
[ "private static void createAndShowGUI() {\n new MainFrame();\n }", "public MainFrame() {\n\t\tcreate();\n\t\taddListeners();\n\t\tsetVisible(true);\n\t}", "public MainFrame() {\r\n\t\tinitComponents();\r\n\t}", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public MainJFrame() {\r\n initComponents();\r\n initExtra();\r\n \r\n this.setVisible(true);\r\n }", "private void createFrame() {\r\n List menus = new ArrayList();\r\n frmAtux = new FrmAtuxV2(menus);\r\n //frmAtux = new MainWindow();\r\n String version = \"1.0\";\r\n// String version = StringUtils.nvl(VersionInfo.instance().getVersion(), \"¿ver?\");\r\n String enviroment = StringUtils.nvl(System.getProperty(SPSysProp.ATUX_ENVIROMENT), \"¿ENV?\");\r\n String bdInfo = StringUtils.nvl(\"TEST\", \"¿BD?\");\r\n String debugInfo = SPSysProp.isDeveloperDebugEnabled() ? \" /DEBUGMODE \" : \"\";\r\n String appInfo = \"[V:\" + version + \"/Env:\" + enviroment + \"/BD:\" + bdInfo + debugInfo + \"]\";\r\n frmAtux.setTitle(\"ICBB \" + appInfo /*version + \" \" +*/ + \" \" + AppCtx.instance().getUsuario().getIdUsuario());\r\n final MenuBuilder mb = new MenuBuilder();\r\n frmAtux.setJMenuBar(mb.createMenus());\r\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\r\n Dimension frameSize = frmAtux.getSize();\r\n if (frameSize.height > screenSize.height) {\r\n frameSize.height = screenSize.height;\r\n }\r\n if (frameSize.width > screenSize.width) {\r\n frameSize.width = screenSize.width;\r\n }\r\n frmAtux.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);\r\n frmAtux.setVisible(true);\r\n }", "public MainFrame() {\r\n initComponents();\r\n setImagePanel(new LogoPanel());\r\n setNavigationToForward();\r\n setNavigationPanel(navigationPanel);\r\n addWizardPanels();\r\n }", "public Main_frame() {\n initComponents();\n myinitComponents();\n setLocationRelativeTo(null);\n\n }", "public MainFrame() {\n initComponents();\n this.setTitle(\"Accov-flight simulator...\");\n this.setSize(1000, 600);\n this.setLocationRelativeTo(null);\n }", "public MainFrame() {\n initComponents();\n CurrentTimeDate();\n }", "public void createFrame() {\n frame = new JFrame();\n frame.setTitle(\"Movie Tracker App\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.setSize(1300, 800);\n frame.setResizable(false);\n frame.setVisible(true);\n frame.setLayout(null);\n frame.getContentPane().setBackground(Color.WHITE);\n ImageIcon icon = new ImageIcon(\"pics/Logo.jpg\");\n frame.setIconImage(icon.getImage());\n\n frame.add(watchedPane);\n frame.add(toWatchPane);\n\n frame.add(watchedPanel);\n frame.add(toWatchPanel);\n frame.add(addPanel);\n frame.add(deletePanel);\n frame.add(mainPanel);\n\n frame.add(titleField);\n frame.add(yearField);\n frame.add(genreField);\n\n frame.revalidate();\n frame.repaint();\n\n }", "public MainForm() {\n super(null);\n this.display(\"Welcome to Virtual Trading\");\n this.setVisible(true);\n this.setTitle(\"Virtual Trading\");\n }", "public MainFrame() {\n initComponents();\n setLocationRelativeTo(null);\n autocomplete();\n try {\n initFiles();\n } catch (IOException ex) {\n Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n setTournament();\n loadPlayers();\n }", "public MainJFrame() {\n initComponents();\n init();\n start();\n }", "private static void createAndShowGUI() {\n\t\tmain = null;\n\t\tmain = new InterfaceMain();\n main.mainFrame = new JFrame(\"Model Interface\");\n\t\tif(Boolean.parseBoolean(main.savedProperties.getProperty(\"isMaximized\", \"false\"))) {\n\t\t\tmain.mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);\n\t\t}\n\t\tString lastHeight = main.savedProperties.getProperty(\"lastHeight\", \"600\");\n\t\tString lastWidth = main.savedProperties.getProperty(\"lastWidth\", \"800\");\n\t\tmain.mainFrame.setSize(Integer.parseInt(lastWidth), Integer.parseInt(lastHeight));\n\n\t\tmain.mainFrame.setLayout(new BorderLayout());\n\n\t\tmain.initialize();\n\t\t//main.pack();\n\t\tmain.mainFrame.setVisible(true);\n\t}", "public MainFrame() {\r\n initWidget(uiBinder.createAndBindUi(this));\r\n logo.setUrl(SysResource.INSTANCE.logo().getSafeUri());\r\n\r\n apiTree.addSelectionHandler(treeSelect);\r\n\r\n adjustUI();\r\n }", "private static void createAndShowGUI() {\r\n //Create and set up the window.\r\n JFrame frame = new JFrame(\"ActionRule\");\r\n frame.setSize(200, 200);\r\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\r\n //Add content to the window.\r\n frame.add(new Main());\r\n\r\n //Display the window.\r\n frame.pack();\r\n frame.setVisible(true);\r\n }", "public MainFrame() {\n\t\tsuper(TITRE_FENETRE_INITIAL);\n\n\t\tthis.setMinimumSize(new Dimension(400, 600));\n\t\tthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n\t\tthis.setResizable(false);\n\t}", "public MainFrame() {\n\n setTitle(\"MainApplication\");\n setLocationRelativeTo(null);\n setBounds(0, 0, screenSize.width, screenSize.height);\n\n setResizable(true);\n\n setVisible(true);\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n\n contentpane = (JPanel) getContentPane();\n contentpane.setLayout(new BorderLayout());\n //contentpane.setLayout(new BorderLayout());\n AddMenu(this);\n AddMainGame();\n\n }", "public void guiMain() {\n\t\tframe = new JFrame(\"NUHorror\");\n\t\tframe.setIconImage(img.getImage());\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.setExtendedState(JFrame.MAXIMIZED_BOTH);\n\t\ttry {\n\t\t\tmainPanel();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\taudio.mainMenuMusic();\n\t\tframe.setVisible(true);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Performs a full cold app restart restarts application
protected void doColdRestart() { String baseError = "Unable to cold restart application: "; try { Log.d(TAG, "Cold restarting application"); Context c = applicationContext; //check if the context is given if (c != null) { //fetch the packagemanager so we can get the default launch activity // (you can replace this intent with any other activity if you want PackageManager pm = c.getPackageManager(); //check if we got the PackageManager if (pm != null) { //create the intent with the default start activity for your application Intent mStartActivity = pm.getLaunchIntentForPackage( c.getPackageName() ); if (mStartActivity != null) { //mStartActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); //create a pending intent so the application is restarted after System.exit(0) was called. // We use an AlarmManager to call this intent in 100ms int mPendingIntentId = 223344; PendingIntent mPendingIntent = PendingIntent .getActivity(c, mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager mgr = (AlarmManager) c.getSystemService(Context.ALARM_SERVICE); mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent); Log.i(TAG, "Killing application for cold restart"); //kill the application System.exit(0); } else { handleError(baseError+"StartActivity is null"); } } else { handleError(baseError+"PackageManager is null"); } } else { handleError(baseError+"Context is null"); } } catch (Exception ex) { handleError(baseError+ ex.getMessage()); } }
[ "private void restartApp() {\n\n System.exit(0);\n }", "public void restart() {\n appController.restart();\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tdashboardSENDSTATE(STATE_APP_ON);\n\t}", "protected void restart() {\n cleanup();\n init();\n }", "public static void restartApplication() {\n\n ScheduledExecutorService schedulerExecutor = Executors.newScheduledThreadPool(2);\n Callable<Process> callable = new Callable<Process>() {\n \n @Override\n public Process call() throws Exception {\n String command = null;\n if (executable.endsWith(\"jar\")) {\n command = \"java -jar \";\n } else if (executable.endsWith(\"exe\")) {\n if (executable.contains(\".exe\")) {\n executable = executable.substring(0, executable.length() - 4);\n }\n command = \"\";\n } else if (executable.endsWith(\"sh\")) {\n command = \"sh \";\n } else if (executable.endsWith(\"bin\")) {\n command.concat(\"\");\n }\n Process p = Runtime.getRuntime().exec(command + executable);\n System.out.println(\"Trying to execute \" + command + executable);\n return p;\n }\n };\n FutureTask<Process> futureTask = new FutureTask<>(callable);\n schedulerExecutor.submit(futureTask);\n System.out.println(\"Restarting Application.\");\n System.exit(0);\n }", "public void restart() {\n\t\tinitializeLocations();\n\t\tinitialize_local();\n }", "public void restart() {\n start();\n }", "public final void restart()\n {\n }", "public static void restart() {\r\n\t\tstop();\r\n\t\tstartInternal();\r\n\t}", "@Override\n public void onRestart() {\n }", "public static void restartApplication(Runnable runBeforeRestart) throws IOException {\n try {\n // java binary\n String java = System.getProperty(\"java.home\") + \"/bin/java\";\n // vm arguments\n List<String> vmArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();\n StringBuffer vmArgsOneLine = new StringBuffer();\n for (String arg : vmArguments) {\n // if it's the agent argument : we ignore it otherwise the\n // address of the old application and the new one will be in conflict\n if (!arg.contains(\"-agentlib\")) {\n vmArgsOneLine.append(arg);\n vmArgsOneLine.append(\" \");\n }\n }\n // init the command to execute, add the vm args\n final StringBuffer cmd = new StringBuffer(\"\\\"\" + java + \"\\\" \" + vmArgsOneLine);\n\n // program main and program arguments\n String[] mainCommand = System.getProperty(SUN_JAVA_COMMAND).split(\" \");\n // program main is a jar\n if (mainCommand[0].endsWith(\".jar\")) {\n // if it's a jar, add -jar mainJar\n cmd.append(\"-jar \").append(new File(mainCommand[0]).getPath());\n } else {\n // else it's a .class, add the classpath and mainClass\n cmd.append(\"-cp \\\"\").append(System.getProperty(\"java.class.path\")).append(\"\\\" \").append(mainCommand[0]);\n }\n // finally add program arguments\n for (int i = 1; i < mainCommand.length; i++) {\n cmd.append(\" \");\n cmd.append(mainCommand[i]);\n }\n // execute the command in a shutdown hook, to be sure that all the\n // resources have been disposed before restarting the application\n Runtime.getRuntime().addShutdownHook(new Thread() {\n @Override\n public void run() {\n try {\n Runtime.getRuntime().exec(cmd.toString());\n } catch (IOException e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }\n });\n // execute some custom code before restarting\n if (runBeforeRestart != null) {\n runBeforeRestart.run();\n }\n // exit\n System.exit(0);\n } catch (Exception e) {\n // something went wrong\n throw new IOException(\"Error while trying to restart the application\", e);\n }\n }", "@Override\n\tprotected void doRestart() {\n\t\t\n\t}", "public static void restartApplication(Runnable runBeforeRestart) {\r\n\t\ttry {\r\n\t\t\t// java binary\r\n\t\t\tString java = System.getProperty(\"java.home\") + \"/bin/java\";\r\n\t\t\t// vm arguments\r\n\t\t\tList<String> vmArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();\r\n\t\t\tStringBuffer vmArgsOneLine = new StringBuffer();\r\n\t\t\tfor (String arg : vmArguments) {\r\n\t\t\t\t// if it's the agent argument : we ignore it otherwise the\r\n\t\t\t\t// address of the old application and the new one will be in conflict\r\n\t\t\t\tif (!arg.contains(\"-agentlib\")) {\r\n\t\t\t\t\tvmArgsOneLine.append(arg);\r\n\t\t\t\t\tvmArgsOneLine.append(\" \");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// init the command to execute, add the vm args\r\n\t\t\tfinal StringBuffer cmd = new StringBuffer(\"\\\"\" + java + \"\\\" \" + vmArgsOneLine);\r\n\r\n\t\t\t// program main and program arguments\r\n\t\t\tString[] mainCommand = System.getProperty(\"sun.java.command\").split(\" \");\r\n\t\t\t// program main is a jar\r\n\t\t\tif (mainCommand[0].endsWith(\".jar\")) {\r\n\t\t\t\t// if it's a jar, add -jar mainJar\r\n\t\t\t\tcmd.append(\"-jar \" + new File(mainCommand[0]).getPath());\r\n\t\t\t} else {\r\n\t\t\t\t// else it's a .class, add the classpath and mainClass\r\n\t\t\t\tcmd.append(\"-cp \\\"\" + System.getProperty(\"java.class.path\") + \"\\\" \" + mainCommand[0]);\r\n\t\t\t}\r\n\t\t\t// finally add program arguments\r\n\t\t\tfor (int i = 1; i < mainCommand.length; i++) {\r\n\t\t\t\tcmd.append(\" \");\r\n\t\t\t\tcmd.append(mainCommand[i]);\r\n\t\t\t}\r\n\t\t\tnew Thread() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tSystem.gc();\r\n\t\t\t\t}\r\n\t\t\t}.start();\r\n\t\t\tSystem.out.println((cmd.toString()));\r\n\t\t\t// execute the command in a shutdown hook, to be sure that all the\r\n\t\t\t// resources have been disposed before restarting the application\r\n\t\t\tRuntime.getRuntime().addShutdownHook(new Thread() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tRuntime.getRuntime().exec(cmd.toString());\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t// execute some custom code before restarting\r\n\t\t\tif (runBeforeRestart != null) {\r\n\t\t\t\trunBeforeRestart.run();\r\n\t\t\t}\r\n\t\t\t// exit\r\n\t\t\tSystem.exit(0);\r\n\t\t} catch (Exception e) {\r\n\t\t\t// something went wrong\r\n\t\t\tSystem.out.println(\"Error while trying to restart the application: \"+e.getMessage());\r\n\t\t}\r\n\t}", "@Override\r\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\r\n\r\n\t}", "@Override\r\n protected void onRestart() {\n\tsuper.onRestart();\r\n }", "@Override\n\tprotected void onRestart() {\n\n\t\tsuper.onRestart();\n\t}", "public static void restartApplication() throws IOException {\n sendMessageAllClients(\"CLOSE\");\n\ttry {\n // java binary\n String java = System.getProperty(\"java.home\") + \"/bin/java\";\n // vm arguments\n List<String> vmArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();\n StringBuffer vmArgsOneLine = new StringBuffer();\n for (String arg : vmArguments) {\n // if it's the agent argument : we ignore it otherwise the\n // address of the old application and the new one will be in conflict\n if (!arg.contains(\"-agentlib\")) {\n vmArgsOneLine.append(arg);\n vmArgsOneLine.append(\" \");\n }\n }\n // init the command to execute, add the vm args\n final StringBuffer cmd = new StringBuffer(\"\\\"\" + java + \"\\\" \" + vmArgsOneLine);\n\n // program main and program arguments\n String[] mainCommand = System.getProperty(SUN_JAVA_COMMAND).split(\" \");\n // program main is a jar\n if (mainCommand[0].endsWith(\".jar\")) {\n // if it's a jar, add -jar mainJar\n cmd.append(\"-jar \" + new File(mainCommand[0]).getPath());\n } else {\n // else it's a .class, add the classpath and mainClass\n cmd.append(\"-cp \\\"\" + System.getProperty(\"java.class.path\") + \"\\\" \" + mainCommand[0]);\n }\n // finally add program arguments\n for (int i = 1; i < mainCommand.length; i++) {\n cmd.append(\" \");\n cmd.append(mainCommand[i]);\n }\n // execute the command in a shutdown hook, to be sure that all the\n // resources have been disposed before restarting the application\n Runtime.getRuntime().addShutdownHook(new Thread() {\n @Override\n public void run() {\n try {\n Runtime.getRuntime().exec(cmd.toString());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n });\n // exit\n\n System.exit(0);\n\t} catch (Exception e) {\n // something went wrong\n throw new IOException(\"Error while trying to restart the application\", e);\n\t}\n }", "public void relaunch();", "@Override\n protected void onRestart() {\n super.onRestart();\n logger.log(ILoggingLogLevel.Debug, LOG_TAG, \"onRestart()\");\n LifecycleDelegate lifecycleDelegate = ((LifecycleDelegate) AppRegistryBridge.getInstance().getLifecycleBridge().getDelegate());\n lifecycleDelegate.updateBackground(false);\n }", "public void restartAll() throws Exception;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }