query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Write a full inventory (players, chests, etc.) to a compound list.
public static List<CompoundTag> writeInventory(ItemStack[] items, int start) { List<CompoundTag> out = new ArrayList<>(); for (int i = 0; i < items.length; i++) { ItemStack stack = items[i]; if (!InventoryUtil.isEmpty(stack)) { out.add(writeItem(stack, start + i)); } } return out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeInventoryToNBT(CompoundNBT tag) {\n IInventory inventory = this;\n ListNBT nbttaglist = new ListNBT();\n\n for (int i = 0; i < inventory.getSizeInventory(); i++) {\n if (!inventory.getStackInSlot(i).isEmpty()) {\n CompoundNBT itemTag = new CompoundNBT();\n itemTag.putBy...
[ "0.7227031", "0.70267856", "0.6298034", "0.6280265", "0.6182834", "0.6163082", "0.61322993", "0.5960756", "0.5950256", "0.58758813", "0.5858837", "0.584141", "0.5839575", "0.58350533", "0.57640874", "0.5708271", "0.5691962", "0.5682955", "0.568069", "0.5634403", "0.56314397",...
0.6209925
4
Attempt to resolve a world based on the contents of a compound tag.
public static World readWorld(GlowServer server, CompoundTag compound) { World world = compound .tryGetUniqueId("WorldUUIDMost", "WorldUUIDLeast") .map(server::getWorld) .orElseGet(() -> compound.tryGetString("World") .map(server::getWorld) .orElse(null)); if (world == null) { world = compound .tryGetInt("Dimension") .map(World.Environment::getEnvironment) .flatMap(env -> server.getWorlds().stream() .filter(serverWorld -> env == serverWorld.getEnvironment()) .findFirst()) .orElse(null); } return world; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public World getWorld(String worldName);", "public static Location listTagsToLocation(World world, CompoundTag tag) {\n // check for position list\n final Location[] out = {null};\n tag.readDoubleList(\"Pos\", pos -> {\n if (pos.size() == 3) {\n Location location = ...
[ "0.6014608", "0.52682006", "0.50689137", "0.49964178", "0.49864572", "0.49685648", "0.4877074", "0.487332", "0.48496693", "0.4840508", "0.47757232", "0.47033215", "0.463823", "0.46061084", "0.46000135", "0.4585842", "0.4569121", "0.4523775", "0.45160374", "0.44862166", "0.445...
0.5288118
1
Save world identifiers (UUID and dimension) to a compound tag for later lookup.
public static void writeWorld(World world, CompoundTag compound) { UUID worldUuid = world.getUID(); // world UUID used by Bukkit and code above compound.putLong("WorldUUIDMost", worldUuid.getMostSignificantBits()); compound.putLong("WorldUUIDLeast", worldUuid.getLeastSignificantBits()); // leave a Dimension value for possible Vanilla use compound.putInt("Dimension", world.getEnvironment().getId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void writeEntityToNBT(NBTTagCompound tagCompound) {}", "long getWorldId();", "protected void writeEntityToNBT(NBTTagCompound compound) {\n if (this.casterUuid != null) {\n compound.setUniqueId(\"OwnerUUID\", this.casterUuid);\n }\n }", "public void writeEntityToNBT(NBTTagCo...
[ "0.5613016", "0.5540101", "0.5509991", "0.5495599", "0.5421572", "0.540771", "0.540771", "0.53734255", "0.52556866", "0.5187762", "0.5179242", "0.51759005", "0.5146043", "0.5110338", "0.5096473", "0.5096473", "0.5061429", "0.5061429", "0.49977466", "0.4922984", "0.48519802", ...
0.73151857
0
Read a Location from the "Pos" and "Rotation" children of a tag. If "Pos" is absent or invalid, null is returned. If "Rotation" is absent or invalid, it is skipped and a location without rotation is returned.
public static Location listTagsToLocation(World world, CompoundTag tag) { // check for position list final Location[] out = {null}; tag.readDoubleList("Pos", pos -> { if (pos.size() == 3) { Location location = new Location(world, pos.get(0), pos.get(1), pos.get(2)); // check for rotation tag.readFloatList("Rotation", rot -> { if (rot.size() == 2) { location.setYaw(rot.get(0)); location.setPitch(rot.get(1)); } }); out[0] = location; } }); return out[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Location getLocation()\n {\n if (worldData == null || position == null)\n {\n // Must have a world and position to make a location;\n return null;\n }\n\n if (orientation == null)\n {\n return new Location(worldData.getWorld(), position....
[ "0.54107654", "0.50595963", "0.50088364", "0.49739027", "0.49515733", "0.4949175", "0.49420854", "0.49264184", "0.4846402", "0.48280886", "0.47792888", "0.47781882", "0.47768274", "0.47661182", "0.47653228", "0.47324544", "0.47324544", "0.47315767", "0.4720549", "0.4720549", ...
0.6124393
0
Write a Location to the "Pos" and "Rotation" children of a tag. Does not save world information, use writeWorld instead.
public static void locationToListTags(Location loc, CompoundTag tag) { tag.putDoubleList("Pos", Arrays.asList(loc.getX(), loc.getY(), loc.getZ())); tag.putFloatList("Rotation", Arrays.asList(loc.getYaw(), loc.getPitch())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void writeLoc(IPositionable loc)\n\t{\n\t\twriteD(loc.getX());\n\t\twriteD(loc.getY());\n\t\twriteD(loc.getZ());\n\t}", "private void writeActualLocation(Location location)\n {\n //textLat.setText( \"Lat: \" + location.getLatitude() );\n //textLong.setText( \"Long: \" + location.getLon...
[ "0.627463", "0.56775594", "0.5562638", "0.54289174", "0.5407792", "0.53520197", "0.52037627", "0.5171238", "0.51101744", "0.50896615", "0.5018152", "0.5011513", "0.49768856", "0.49669385", "0.49159616", "0.49149385", "0.48975855", "0.48611572", "0.485739", "0.48326653", "0.48...
0.6036864
1
Create a Vector from a list of doubles. If the list is invalid, a zero vector is returned.
public static Vector listToVector(List<Double> list) { if (list.size() == 3) { return new Vector(list.get(0), list.get(1), list.get(2)); } return new Vector(0, 0, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Vector(double... elems) {\n\t\tthis(false, elems);\n\t}", "@SuppressWarnings( { \"rawtypes\", \"unchecked\" } )\n\tprotected static Vector toVector( List list )\n\t{\n\t\tVector v = new Vector( );\n\t\tfor ( Object o : list )\n\t\t{\n\t\t\tv.add( o );\n\t\t}\n\t\treturn v;\n\t}", "public DocumentVector(...
[ "0.6794395", "0.6199841", "0.60955113", "0.60767394", "0.6022175", "0.6015106", "0.6007291", "0.59841603", "0.5858422", "0.58495456", "0.5781724", "0.5778561", "0.57618004", "0.57320553", "0.5667501", "0.5642133", "0.56350684", "0.5608889", "0.5608507", "0.56068355", "0.55867...
0.80048454
0
Create a list of doubles from a Vector.
public static List<Double> vectorToList(Vector vec) { return Arrays.asList(vec.getX(), vec.getY(), vec.getZ()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private VectorArit VectorToDouble(VectorArit v) {\r\n LinkedList<Object> l = new LinkedList<>();\r\n for (int i = 0; i < v.getTamanio(); i++) {\r\n Object o = v.Acceder(i);\r\n if (o instanceof Double) {\r\n l.add(o);\r\n } else {\r\n l.a...
[ "0.74826974", "0.65862393", "0.63890594", "0.62783986", "0.61233306", "0.61134994", "0.60390097", "0.6014532", "0.59740853", "0.5913459", "0.5887348", "0.584761", "0.57741094", "0.5773698", "0.57326657", "0.57112455", "0.56998575", "0.56794846", "0.5658091", "0.5629575", "0.5...
0.7899013
0
If pause, just return src result
public int processTexture(int srcTextureId, BytedEffectConstants.TextureFormat textureFormat, int srcTextureWidth, int srcTextureHeight, ImageQualityResult result) { if (mPause){ result.texture = srcTextureId; result.width = srcTextureWidth; result.height = srcTextureHeight; return 0; } if (mEnableVideoSr){ if (mVideoSRTask != null){ // This step to judge if the resolution larger than 720p, if true, we release the task, and disable it { if ((srcTextureWidth * srcTextureHeight) > 1280 * 720){ mEnableVideoSr = false; mVideoSRTask.release(); mVideoSRTask = null; ((Activity) mContext).runOnUiThread(new Runnable() { @Override public void run() { Toast.makeText(mContext, R.string.video_sr_resolution_not_support, Toast.LENGTH_SHORT).show(); } }); return 0; } } LogTimerRecord.RECORD("video_sr"); BefVideoSRInfo videoSrResult = mVideoSRTask.process(srcTextureId, srcTextureWidth, srcTextureHeight); if (videoSrResult == null){ return BytedEffectConstants.BytedResultCode.BEF_RESULT_FAIL; } LogTimerRecord.STOP("video_sr"); result.height = srcTextureHeight * 2; result.width = srcTextureWidth * 2; result.texture = videoSrResult.getDestTextureId(); return BytedEffectConstants.BytedResultCode.BEF_RESULT_SUC; } }else if (mEnableNightScene){ if (mNightSceneTask != null){ Integer destTextureId = new Integer(0); LogTimerRecord.RECORD("night_scene"); int ret = mNightSceneTask.process(srcTextureId, destTextureId, srcTextureWidth, srcTextureHeight); if (ret != BytedEffectConstants.BytedResultCode.BEF_RESULT_SUC){ return ret; } LogTimerRecord.STOP("night_scene"); result.height = srcTextureHeight; result.width = srcTextureWidth; result.texture = destTextureId.intValue(); return ret; } } return BytedEffectConstants.BytedResultCode.BEF_RESULT_SUC; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Source getSrc();", "java.lang.String getSrc();", "String getSrc();", "public void getToSource() {\r\n\t \r\n\t while(!closeEnough){\r\n\t getCloser(40);\r\n\t }\r\n\t \r\n\t Sound.beep();\r\n\t try {\r\n\t\tThread.sleep(2000);\r\n\t} catch (InterruptedException e) {\r\n\t\te.printStackTrace();\r\n\t}\...
[ "0.6046569", "0.60343313", "0.5880597", "0.5736548", "0.5660693", "0.54730034", "0.54462266", "0.53912234", "0.53699404", "0.53577715", "0.534428", "0.5324007", "0.53040636", "0.525723", "0.5217176", "0.5212994", "0.52055156", "0.5177462", "0.51406467", "0.5124224", "0.510896...
0.0
-1
this may be unnecessary, but who knows what tests run before us.
@Before public void setUp() { InternalDataSerializer.reinitialize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void runBeforeTest() {}", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "@Test\r\n\tpublic void testSanity() {\n\t}", "@Test\n public void questionIfNotAlreadyAccusedTest() throws Exception {\n\n }", "@Override\n\tpublic void homeTestRun() {\n\t\t\n\t}", "@Before\r\n\tpublic void se...
[ "0.71338165", "0.7055063", "0.68462867", "0.6834174", "0.6823441", "0.6778286", "0.6765121", "0.6736692", "0.67312086", "0.67034924", "0.6628211", "0.6621385", "0.661401", "0.66123617", "0.6598513", "0.65944767", "0.6591934", "0.658964", "0.6587358", "0.65783834", "0.655977",...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { ReusableMethods m = new ReusableMethods(); m.launchApp(); m.closeApp(); m.launchAppWithArguments("http://facebook.com"); m.elementAvaialble("email", true); m.elementAvaialble("pass", false); m.elementAvaialble("day", true); m.elementAvaialble("month", false); m.elementsCount("a", 50); m.elementsCount("img", 5); m.elementsCount("select", 3); m.closeApp(); m.launchAppWithArguments("http://yahoo.com"); m.elementsCount("img", 5); m.closeApp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
rotate counterclockwise 0 = left 1 = up 2 = right 3 = down
static void changeDirectionBackwards() { if(--direction == -1) direction = 3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void rotate() {\n byte tmp = topEdge;\n topEdge = leftEdge;\n leftEdge = botEdge;\n botEdge = rightEdge;\n rightEdge = tmp;\n tmp = reversedTopEdge;\n reversedTopEdge = reversedLeftEdge;\n reversedLeftEdge = reversedBotEdge;\n reversedBotEdge =...
[ "0.75299287", "0.7164311", "0.68009746", "0.66018265", "0.6586518", "0.65737605", "0.65207875", "0.6454987", "0.64529276", "0.6447467", "0.6433934", "0.64201003", "0.6400693", "0.6375078", "0.634201", "0.6238752", "0.622589", "0.6224172", "0.61898386", "0.613296", "0.6128194"...
0.0
-1
This method is used to print speak
@Override public void speak() { System.out.printf("i'm %s. I am a DINOSAURRRRR....!\n",this.name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void speak() {\n System.out.println(\"I'm an Aardvark, I make grunting sounds most of the time.\");\n }", "public void speak(){\n System.out.println(\"Smile and wave boys. Smile and wave.\");\n }", "@Override\n\tpublic void speak() {\n\t\tSystem.out.println(\"tik tik.....
[ "0.822601", "0.8159363", "0.81258583", "0.7966852", "0.788892", "0.7794152", "0.7751776", "0.77394956", "0.7711402", "0.7679073", "0.76509917", "0.757217", "0.73624456", "0.7328223", "0.7298158", "0.7290429", "0.72335386", "0.7162936", "0.71412843", "0.71374", "0.7135614", ...
0.8049894
3
This method is used to print move
@Override public void move() { System.out.println("I roam here and there"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void printMove(Position princessPos, int x, int y) {\r\n\t\tint diffX = princessPos.x - x;\r\n\t\tint diffY = princessPos.y - y;\r\n\t\t\r\n\t\tif (diffX < 0) {\r\n\t\t\tSystem.out.println(LEFT);\r\n\t\t}\r\n\t\telse if (diffX > 0) {\r\n\t\t\tSystem.out.println(RIGHT);\r\n\t\t}\r\n\t\telse if (diffY < 0) {\...
[ "0.80657685", "0.7900476", "0.77593255", "0.75796854", "0.75662225", "0.74352056", "0.7344991", "0.7265863", "0.7160944", "0.7151053", "0.71276283", "0.7110715", "0.71017796", "0.7027136", "0.70220596", "0.69911015", "0.6962771", "0.68498814", "0.6848854", "0.68410707", "0.68...
0.6917835
17
icon = new ImageIcon(("C.jpg"));
public static void secondOne() { Object[] option = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "reset" }; elipse = JOptionPane.showOptionDialog(frame, "are these doors to a farm? or are you just high?", "be prepared", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, icon, option, option[9]); highDoors(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static BufferedImage iconMaker(String s){\n BufferedImage buttonIcon;\n try{\n buttonIcon = ImageIO.read(new File(FILE_PATH + s));\n }catch(IOException e){\n buttonIcon = null;\n System.out.println(\"BooHOO\");\n }\n return buttonIcon;\n ...
[ "0.7087301", "0.70611477", "0.7039701", "0.7039701", "0.70393276", "0.6984713", "0.6822534", "0.67563933", "0.6750238", "0.67156863", "0.66847277", "0.667329", "0.66548705", "0.6648084", "0.66131014", "0.6577679", "0.6577679", "0.65481865", "0.65375257", "0.653288", "0.652642...
0.0
-1
following is with MediaPlayer
@Override public void onCompletion(MediaPlayer mp) { mp.reset(); nextMusic(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void forward(MediaPlayer mediaPlayer)\r\n\t{\n\r\n\t}", "@Override\r\n\tpublic void finished(MediaPlayer mediaPlayer)\r\n\t{\n\r\n\t}", "@Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n }", "@Override\n public void onSeekComplete(MediaPlayer pla...
[ "0.76307124", "0.7182488", "0.7163904", "0.71477914", "0.70249707", "0.69824654", "0.69782186", "0.69763124", "0.6916995", "0.6907356", "0.6907356", "0.69057006", "0.68898326", "0.68523526", "0.6796133", "0.6779364", "0.6755156", "0.6752031", "0.67144996", "0.6702062", "0.669...
0.6575361
28
Cancel crop trample event if leather boots are worn by the entity
public static void preventCropTrample(Cancellable event, LivingEntity entity) { ItemStack boots = entity.getEquipment().getBoots(); if (boots == null) { return; } else if (boots.getType() == Material.LEATHER_BOOTS) { event.setCancelled(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void cancel() {\n HologramHandler.despawnHologram(hologram);\n if (!mseEntity.isTamed())\n mseEntity.setCustomName(mseEntity.getDefaultName());\n threadCurrentlyRunning = false;\n super.cancel();\n }", "public void cancel() {\n target.setAllo...
[ "0.5858333", "0.5755257", "0.5566561", "0.55527467", "0.54930097", "0.5477237", "0.54741037", "0.5465665", "0.5452169", "0.5396552", "0.5358316", "0.53320366", "0.53262293", "0.5325623", "0.53075755", "0.5278277", "0.5271684", "0.52482015", "0.52177113", "0.5214529", "0.52099...
0.7334546
0
Eat event for special food from farming levels that applies boons based on item desc.
@EventHandler() public void onPlayerItemConsume(PlayerItemConsumeEvent event){ List<String> item_desc = event.getItem().getLore(); if (item_desc != null){ Player target = event.getPlayer(); for (String line : item_desc ) { if (line.contains("Hunger")) { int value = Integer.parseInt(line.substring(line.lastIndexOf(" ") + 1)); target.setFoodLevel(target.getFoodLevel() + value ); } else if (line.contains("Saturation")) { int value = Integer.parseInt(line.substring(line.lastIndexOf(" ") + 1)); target.setSaturation(target.getSaturation() + value ); } else if (line.contains("Effect")) { String effect_full = line.substring(line.lastIndexOf(": ") + 2, line.lastIndexOf("- ")); // Get the first number in the desc, which will be the strength of the effect by splitting the string at the number. String[] strength_effect = effect_full.split("(?<=\\D)(?=\\d)"); String effect = strength_effect[0]; String strength = strength_effect[1]; String duration_mins = line.substring(line.lastIndexOf("- ") + 2, line.lastIndexOf(":")); String duration_secs = line.substring(line.lastIndexOf(":") + 1, line.lastIndexOf(" min")); int amplifier = Integer.parseInt(strength.trim()) - 1; // Here we have to convert mins to seconds and also multiply the entire duration by the tick rate, which is default 20. int duration = (Integer.parseInt(duration_mins.trim()) * 60 + Integer.parseInt(duration_secs.trim())) * 20; PotionEffectType pot_effect = PotionEffectType.getByName(effect.trim()); PotionEffect food_effect = new PotionEffect(pot_effect, duration , amplifier); target.addPotionEffect(food_effect); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void eatCorpse(Corpse corpse) {\n if (corpse.getSpecies().equals(\"Agilisaurus\")) {\n raiseFoodLevel(20);\n } else {\n raiseFoodLevel(50);\n }\n }", "private static void customItems(ItemDefinition itemDef) {\n\n\t\tswitch (itemDef.id) {\n\n\t\tcase 11864:\n\t\tcase 11865:\n\t\tcase 19...
[ "0.6101966", "0.60963035", "0.6091165", "0.6045007", "0.5973083", "0.5959679", "0.59301347", "0.59116405", "0.590254", "0.59020936", "0.5885899", "0.58813226", "0.580867", "0.5807312", "0.5793812", "0.57839495", "0.57776815", "0.57700425", "0.5761535", "0.5751068", "0.5744263...
0.6254629
0
Does not have parameters. String is ignored.
@Override public void setParameter(String parameters) { // dummy }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getString(String paramString) {\n }", "void method(String string);", "private final String m43294b(String str) {\n return str != null ? str : ManagerWebServices.PARAM_TEXT;\n }", "@Test\n public void testWithNullString() throws org.nfunk.jep.ParseException\n {\n String ...
[ "0.66076654", "0.6430057", "0.608427", "0.6080107", "0.6069631", "0.60602844", "0.6047741", "0.60375667", "0.6036138", "0.6016647", "0.6000226", "0.5999912", "0.5935457", "0.59108895", "0.5900235", "0.5894665", "0.588821", "0.58863807", "0.5844865", "0.5820203", "0.5797278", ...
0.6159293
2
MachineCoreEntity constructor pass in the given Tier and an ID.
public MachineCoreEntity(MachineTier theTier) { super(); tier = theTier; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BaseVedioscore (java.lang.Integer id) {\n\t\tthis.setId(id);\n\t\tinitialize();\n\t}", "public InventoryEntity(int id) {\n\t\tthis.id = id;\n\t}", "public Vehicle(int id) \n\t{\n\t\t// each vehicle has a different identifying number\n\t\tthis.id = id;\n\t}", "public ReadModelEntity(Guid id)\n {...
[ "0.62739277", "0.5818446", "0.57552445", "0.56606764", "0.56138676", "0.5533413", "0.5499997", "0.5477099", "0.5446669", "0.53898734", "0.5370468", "0.53535664", "0.53332376", "0.53313047", "0.5297554", "0.5297332", "0.52197474", "0.5213488", "0.5182407", "0.5179939", "0.5172...
0.78884876
0
Checks for the structure completeness.
@Override public void updateEntity() { if (structureComplete() && checkCountdown >= CHECK_MAX) { checkCountdown = 0; // Refresh the core structure. updateStructure(); } else checkCountdown++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean structureComplete() { return structureID != null && structureID.length() != 0; }", "private void CheckStructureIntegrity() {\n int size = 0;\n for (Module mod : modules) {\n size += mod.getAddresses().size();\n logger.info(\"BBS : {} Module {}\", mod.getAddress...
[ "0.71431375", "0.70557237", "0.67785555", "0.66632897", "0.6504828", "0.6478169", "0.646109", "0.6440358", "0.6425955", "0.6404647", "0.63984746", "0.63979286", "0.6389358", "0.6377567", "0.63002884", "0.62914616", "0.62151885", "0.6206781", "0.6202291", "0.618069", "0.616304...
0.0
-1
Updates the structure. Override this with a super call to hook into the event.
public void updateStructure() { boolean itWorked = true; // Get block's rotational information as a ForgeDirection ForgeDirection rotation = ForgeDirection.getOrientation(Utils.backFromMeta(worldObj.getBlockMetadata(xCoord, yCoord, zCoord))); // // Step one: validate all blocks // // Get the MachineStructures from the MachineStructureRegistrar // But if the machine is already set up it should only check the desired structure. for (MachineStructure struct : (structureComplete() ? MachineStructureRegistrar.getStructuresForMachineID(getMachineID()) : MachineStructureRegistrar.getStructuresForMachineID(getMachineID()))) { // Check each block in requirements for (PReq req : struct.requirements) { // Get the rotated block coordinates. BlockPosition pos = req.rel.getPosition(rotation, xCoord, yCoord, zCoord); // Check the requirement. if (!req.requirement.isMatch(tier, worldObj, pos.x, pos.y, pos.z, xCoord, yCoord, zCoord)) { // If it didn't work, stop checking. itWorked = false; break; } // If it did work keep calm and carry on } // We've gone through all the blocks. They all match up! if (itWorked) { // **If the structure is new only** // Which implies the blocks have changed between checks if (struct.ID != structureID) { // // This is only called when structures are changed/first created. // // Save what structure we have. structureID = struct.ID; // Make an arraylist to save all teh structures ArrayList<StructureUpgradeEntity> newEntities = new ArrayList<StructureUpgradeEntity>(); // Tell all of the blocks to join us! for (PReq req : struct.requirements) { // Get the blocks that the structure has checked. BlockPosition pos = req.rel.getPosition(rotation, xCoord, yCoord, zCoord); Block brock = worldObj.getBlock(pos.x, pos.y, pos.z); if (brock == null) continue; if (brock instanceof IStructureAware) ((IStructureAware)brock).onStructureCreated(worldObj, pos.x, pos.y, pos.z, xCoord, yCoord, zCoord); // Check the tile entity for upgrades TileEntity ent = worldObj.getTileEntity(pos.x, pos.y, pos.z); if (ent != null && ent instanceof StructureUpgradeEntity) { StructureUpgradeEntity structEnt = (StructureUpgradeEntity)ent; newEntities.add(structEnt); /* // Not sure about this. if (structEnt.coreX != xCoord && structEnt.coreY != yCoord && structEnt.coreZ != zCoord) { structEnt.onCoreConnected() } */ } // do stuff with that } // I haven't figured out how the hell to do toArray() in this crap // so here's a weird combination of iterator and for loop upgrades = new StructureUpgradeEntity[newEntities.size()]; for (int i = 0; i < newEntities.size(); i++) upgrades[i] = newEntities.get(i); // Tell all of the structure blocks to stripe it up! for (RelativeFaceCoords relPos : struct.relativeStriped) { BlockPosition pos = relPos.getPosition(rotation, xCoord, yCoord, zCoord); Block brock = worldObj.getBlock(pos.x, pos.y, pos.z); // If it's a structure block tell it to stripe up if (brock != null && brock instanceof StructureBlock) worldObj.setBlockMetadataWithNotify(pos.x, pos.y, pos.z, 2, 2); } } return; } // If not, reset the loop and try again. else { itWorked = true; continue; } } // // None of the structures worked! // // If we had a structure before, we need to clear it if (structureComplete()) { for (PReq req : MachineStructureRegistrar.getMachineStructureByID(structureID).requirements) { BlockPosition pos = req.rel.getPosition(rotation, xCoord, yCoord, zCoord); Block brock = worldObj.getBlock(pos.x, pos.y, pos.z); // This will also un-stripe all structure blocks. if (brock instanceof IStructureAware) ((IStructureAware)brock).onStructureBroken(worldObj, pos.x, pos.y, pos.z, xCoord, yCoord, zCoord); } // We don't have a structure. structureID = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract void updateStructure();", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\r\n\tpublic void update() {\n\t\tsuper.update();\r\n\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\...
[ "0.6688686", "0.6359526", "0.6359526", "0.6359526", "0.6299376", "0.6241231", "0.6241231", "0.61990535", "0.6158818", "0.6157057", "0.6122569", "0.6122001", "0.6090554", "0.6086212", "0.6086212", "0.60827553", "0.60827553", "0.60827553", "0.60827553", "0.60827553", "0.6070897...
0.0
-1
If the machine has a valid structure. Does NOT check/validate structure, just a null check on structureID.
public boolean structureComplete() { return structureID != null && structureID.length() != 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validate() throws org.apache.thrift.TException {\n if (!isSetId()) {\n throw new org.apache.thrift.protocol.TProtocolException(\"Required field 'id' is unset! Struct:\" + toString());\n }\n\n // check for sub-struct validity\n }", "public void validate() throws org.apache.thrift.TExcep...
[ "0.6122413", "0.6085846", "0.59980565", "0.5993744", "0.5954218", "0.59241456", "0.5919142", "0.5917813", "0.5912431", "0.58381015", "0.5801351", "0.57969964", "0.5780662", "0.5774544", "0.5768316", "0.5726851", "0.5672493", "0.5650256", "0.56389266", "0.56188637", "0.5609001...
0.6684228
0
Return the machine ID used to look up machine structures.
public abstract String getMachineID();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getMachineId();", "public java.lang.String getMachineId() {\n java.lang.Object ref = machineId_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n machineId_ = s;\n ...
[ "0.834971", "0.820379", "0.8202763", "0.8088302", "0.7997878", "0.785238", "0.7780331", "0.77289146", "0.7480144", "0.7102257", "0.69102156", "0.66048306", "0.64761716", "0.64279157", "0.6369963", "0.6338008", "0.63331056", "0.63091844", "0.6285944", "0.6269442", "0.6166373",...
0.76319265
8
Checking the input parameter validity
@Override @Transactional public LotteryTicket createLotteryTicket(LotteryTicketRequest lotteryTicketRequest) { checkLotteryTicketRequest(lotteryTicketRequest); try { // Create a lottery ticket LotteryTicket lotteryTicket = lotteryTicketRepository.save(new LotteryTicket()); // Create lines per ticket List<LotteryTicketLine> linesList = createTicketLines(lotteryTicketRequest.getNumberOfLines(), lotteryTicket); lineRepository.saveAll(linesList); lotteryTicket.setLotteryTicketLine(linesList); // Return ticket response return lotteryTicket; } catch (Exception exception) { LOGGER.error("Something went wrong in createLotteryTicket" + exception); throw new InternalServerError("Something went wrong in creating lottery ticket"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validateInputParameters(){\n\n }", "public void checkParameters() {\n }", "protected abstract boolean isValidParameter(String parameter);", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "protected abstract boolean isInputValid();", "private boolean isInputValid() {\n ...
[ "0.8608429", "0.78570724", "0.766763", "0.76294076", "0.76042336", "0.7545249", "0.7354133", "0.7340896", "0.7314602", "0.7198875", "0.71971256", "0.7194595", "0.7178415", "0.7137243", "0.71290046", "0.71134675", "0.7079102", "0.70189255", "0.6954601", "0.69426894", "0.692391...
0.0
-1
Getting the tickets list
@Override public List<LotteryTicket> getAllLotteryTickets() { List<LotteryTicket> ticket = null; try { ticket = lotteryTicketRepository.findAllByIsCancelled(false); } catch (Exception exception) { LOGGER.error("Something went wrong in getAllLotteryTickets" + exception); throw new InternalServerError("Something went wrong in getting all lottery tickets"); } // Check if ticket list is empty if (ticket == null || ticket.size() == 0) { throw new InternalServerError("No tickets found"); } // Return tickets list response return ticket; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Ticket> getTickets() {return tickets;}", "public List<Ticket> getTicketList() {\r\n\t\treturn ticketList;\r\n\t}", "public List<Ticket> getAllTickets(){\n List<Ticket> tickets=ticketRepository.findAll();\n return tickets;\n }", "public static ArrayList<Ticket> getTickets() {\r\n...
[ "0.8482587", "0.7930974", "0.76994306", "0.7629429", "0.71753824", "0.7089727", "0.70004165", "0.6994404", "0.6953505", "0.6942885", "0.6928459", "0.68749183", "0.6840937", "0.6809192", "0.6689149", "0.6673528", "0.66677", "0.662694", "0.65247184", "0.6505669", "0.64338404", ...
0.70011187
6
Getting the ticket object as per ticket id
@Override public LotteryTicket getLotteryTicket(int ticketId) { LotteryTicket ticket = null; try { ticket = lotteryTicketRepository.findByTicketIdAndIsCancelled(ticketId, false); } catch (Exception exception) { LOGGER.error("Something went wrong in getLotteryTicket" + exception); throw new InternalServerError("Something went wrong in getting the lottery ticket"); } // Check if ticket object is empty if (ticket == null) { throw new InternalServerError("This ticket id does not exists"); } // Return ticket response return ticket; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Ticket getTicket(String id);", "public Ticket getTicketById(int id) {\r\n\t\tfor (Iterator<Ticket> iter = ticketList.iterator(); iter.hasNext(); ) {\r\n\t\t\tTicket ticket = iter.next();\r\n\t\t\tif (ticket.getTicketId() == id) {\r\n\t\t\t\treturn ticket;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t\t\r\...
[ "0.85826135", "0.7549913", "0.75330323", "0.7388918", "0.73852", "0.7363973", "0.7351541", "0.73221046", "0.7314493", "0.7145979", "0.70698774", "0.7025271", "0.7020464", "0.6881678", "0.68626124", "0.6835557", "0.68058693", "0.6770258", "0.6712056", "0.65342486", "0.6523477"...
0.7071378
10
Get the ticket object
@Override public LotteryTicket retrieveLotteryTicketStatus(int ticketId) { LotteryTicket ticket = getLotteryTicket(ticketId); // Check if ticket status is checked or not if (ticket.isTicketStatusChecked()) { throw new InternalServerError("This ticket is already checked"); } else { // Update the ticket object ticket.setTicketStatusChecked(true); try { // Save and return ticket response return lotteryTicketRepository.save(ticket); } catch (Exception exception) { LOGGER.error("Something went wrong in retrieveLotteryTicketStatus" + exception); throw new InternalServerError("Something went wrong in retrieving the lottery ticket status"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Ticket getTicket() {\n return ticket;\n }", "public Ticket getTicket(String id);", "public Ticket getCurrentTicket(){return this.currentTicket;}", "public java.lang.Object getTicketID() {\n return ticketID;\n }", "public phonecallTicket getTicket(){\n return currentticket;\n ...
[ "0.8326161", "0.76124597", "0.75919336", "0.7466717", "0.7197956", "0.71428037", "0.70996577", "0.7084744", "0.70574206", "0.6992954", "0.68679374", "0.6793144", "0.66545284", "0.66453576", "0.66409314", "0.6595078", "0.65612555", "0.6558332", "0.6536472", "0.6487191", "0.647...
0.0
-1
Get the ticket object
@Override public LotteryTicket cancelLotteryTicket(int ticketId) { LotteryTicket ticket = getLotteryTicket(ticketId); // Check if ticket status is checked or not if (ticket.isTicketStatusChecked()) { throw new InternalServerError("This ticket is already checked and cannot be cancelled"); } else { // Update the ticket object ticket.setCancelled(true); try { // Save and return ticket response return lotteryTicketRepository.save(ticket); } catch (Exception exception) { LOGGER.error("Something went wrong in cancelLotteryTicket" + exception); throw new InternalServerError("Something went wrong in cancelling the lottery ticket"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Ticket getTicket() {\n return ticket;\n }", "public Ticket getTicket(String id);", "public Ticket getCurrentTicket(){return this.currentTicket;}", "public java.lang.Object getTicketID() {\n return ticketID;\n }", "public phonecallTicket getTicket(){\n return currentticket;\n ...
[ "0.8326161", "0.76124597", "0.75919336", "0.7466717", "0.7197956", "0.71428037", "0.70996577", "0.7084744", "0.70574206", "0.6992954", "0.68679374", "0.6793144", "0.66545284", "0.66453576", "0.66409314", "0.6595078", "0.65612555", "0.6558332", "0.6536472", "0.6487191", "0.647...
0.0
-1
Checking the input parameter validity
@Override @Transactional public LotteryTicket ammendLotteryTicket(int ticketId, LotteryTicketRequest lotteryTicketRequest) { checkLotteryTicketRequest(lotteryTicketRequest); // Get the ticket object LotteryTicket ticket = getLotteryTicket(ticketId); // Check if ticket status is checked or not if (ticket.isTicketStatusChecked()) { throw new InternalServerError("This ticket is already checked and cannot be ammended anymore"); } else { try { // Append with n lines to existing lines and save in db List<LotteryTicketLine> additionalLinesList = createTicketLines(lotteryTicketRequest.getNumberOfLines(), ticket); lineRepository.saveAll(additionalLinesList); } catch (Exception exception) { LOGGER.error("Something went wrong in ammendLotteryTicket" + exception); throw new InternalServerError("Something went wrong in ammending the lottery ticket"); } // Return the updated ticket with lines return ticket; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void validateInputParameters(){\n\n }", "public void checkParameters() {\n }", "protected abstract boolean isValidParameter(String parameter);", "private boolean isValidInput() {\n\t\treturn true;\n\t}", "protected abstract boolean isInputValid();", "private boolean isInputValid() {\n ...
[ "0.8608429", "0.78570724", "0.766763", "0.76294076", "0.76042336", "0.7545249", "0.7354133", "0.7340896", "0.7314602", "0.7198875", "0.71971256", "0.7194595", "0.7178415", "0.7137243", "0.71290046", "0.71134675", "0.7079102", "0.70189255", "0.6954601", "0.69426894", "0.692391...
0.0
-1
Create ticket lines object
private List<LotteryTicketLine> createTicketLines(int lines, LotteryTicket ticket) { List<LotteryTicketLine> linesList = new ArrayList<>(); // Iterate the lines for (int linesItr = 1; linesItr <= lines; linesItr++) { // Generate appropriate parameters and add in list object int first = generateRandomNumber(); int second = generateRandomNumber(); int third = generateRandomNumber(); LotteryTicketLine line = new LotteryTicketLine(first, second, third, getOutcome(first, second, third), ticket); linesList.add(line); } return linesList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Ticket createTicket(int numLines) {\r\n\t\tList<Line> lineList = new ArrayList<Line>();\r\n\t\tint ticketScore = 0;\r\n\t\tfor (int i=0; i < numLines; i++) {\r\n\t\t\tList<Integer> lineSeq = generateLine();\r\n\t\t\tint lineScore = generateScore(lineSeq);\r\n\t\t\tticketScore += lineScore;\r\n\t\t\tLine lin...
[ "0.7692357", "0.64925206", "0.64611703", "0.6306172", "0.60693705", "0.6004325", "0.59934396", "0.5948389", "0.5886856", "0.58727586", "0.5869867", "0.58689654", "0.5800984", "0.576457", "0.571515", "0.57083035", "0.5655888", "0.56556785", "0.5637944", "0.5632556", "0.562701"...
0.7810738
0
Generate integers between and including 0 and 2
private int generateRandomNumber() { return new SplittableRandom().nextInt(0, 3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int RandomGenerator0To29 (){\n\t\t int randomInt2 = 0;\n\t\t Random randomGenerator2 = new Random();\n\t\t for (int idx2 = 1; idx2 <= 10; ++idx2) {\n\t\t\t randomInt2 = randomGenerator2.nextInt(30);\n\t\t }\n\t\t return randomInt2;\n\t }", "static int gen(int n)\n{ \n int []S = new int [n + 1];\n \n S[0] =...
[ "0.65196925", "0.63430923", "0.6311622", "0.6294277", "0.6289069", "0.6269597", "0.625065", "0.6240759", "0.6172047", "0.61538565", "0.61383915", "0.61285025", "0.61218345", "0.6102152", "0.6080808", "0.60666066", "0.60429764", "0.6040334", "0.6031832", "0.6027739", "0.602531...
0.59355104
25
Generate outcomes as per rules and return int value
public int getOutcome(int first, int second, int third) { if (first + second + third == 2) { return 10; } else if (first == second && first == third && second == third) { return 5; } else if (first != second && first != third) { return 1; } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int evaluate() {\n return (int) (Math.random() * 8);\n }", "public int evaluateAsInt();", "public Result determineOutcome() {\n for (int row = 0; row < TicTacToeModel.BOARD_DIMENSION; row++) {\n if (rowScore[row] == TicTacToeModel.BOARD_DIMENSION){\n ...
[ "0.6800778", "0.6571504", "0.6127514", "0.6072367", "0.60653096", "0.5999212", "0.59728473", "0.5913684", "0.5862464", "0.5862464", "0.58316493", "0.58198494", "0.58083403", "0.5781404", "0.5770064", "0.57669085", "0.5747497", "0.5735086", "0.57149184", "0.57011384", "0.57001...
0.60285836
5
module implement IoC pattern
private EventLogger initEventLogger(Review review) { //reduce coupling EventLogger eventLogger = loggerMap.get(getRating(review).toString()); if (eventLogger==null){ eventLogger = loggerMap.get(DEFAULT); } return eventLogger; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Singleton\n@Component(modules = {ContextModule.class, BusModule.class, GithubModule.class, GankModule.class, ZhiHuModule.class, RssModule.class})\npublic interface AppComponent {\n Context getContext();\n GankService getGankService();\n ZhiHuService getZhiHuService();\n RssService getRssService();\n ...
[ "0.66470474", "0.6513075", "0.6465432", "0.6457923", "0.64578456", "0.6343651", "0.63305837", "0.6317897", "0.62226367", "0.6221499", "0.622123", "0.62017995", "0.61953443", "0.6148781", "0.61342853", "0.6133832", "0.6128922", "0.6113409", "0.6109876", "0.60996133", "0.609048...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { System.out.println("hello"); System.out.println("hello worle"); String[] names; names = new String[] { "hello", "world" }; for (int i = 0; i < names.length; i++) { System.out.println(names[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
System.out.println("Resolviendo destinos para : "+bean);
private String[] resolverDestino(Object bean){ if(Abono.class.isAssignableFrom(bean.getClass()) ){ Abono abono=(Abono)bean; if(abono.getSucursal().getId().equals(new Long(1))){ return new String[]{"OFICINAS"}; } return new String[]{abono.getSucursal().getNombre()}; }else if(bean instanceof AplicacionDeNota ){ Aplicacion a=(Aplicacion)bean; if(a.getCargo().getOrigen().equals(OrigenDeOperacion.CAM)){ String suc=a.getCargo().getSucursal().getNombre(); return new String[]{suc}; }else{ return new String[0]; } }else if(bean instanceof AplicacionDePago ){ Aplicacion a=(Aplicacion)bean; if(a.getCargo().getOrigen().equals(OrigenDeOperacion.CAM)){ String suc=a.getCargo().getSucursal().getNombre(); return new String[]{suc}; }else{ return new String[0]; } }else if(bean instanceof Embarque){ Embarque e=(Embarque)bean; return new String[]{e.getSucursal()}; }else if(bean instanceof Entrega){ Entrega e=(Entrega)bean; return new String[]{e.getEmbarque().getSucursal()}; }else if(bean instanceof EntregaDet){ EntregaDet e=(EntregaDet)bean; return new String[]{e.getEntrega().getEmbarque().getSucursal()}; }else if(Cargo.class.isAssignableFrom(bean.getClass()) ){ Cargo cargo=(Cargo)bean; if(cargo.getSucursal().getId().equals(new Long(1))){ return new String[]{"ND"}; } return new String[]{cargo.getSucursal().getNombre()}; }else if (bean instanceof SolicitudDeDeposito){ SolicitudDeDeposito sol=(SolicitudDeDeposito)bean; return new String[]{sol.getSucursal().getNombre()}; }else if(bean instanceof Compra2){ Compra2 compra=(Compra2)bean; if(compra.isImportacion()){ return getDestinos().toArray(new String[0]); }else if(compra.getConsolidada()){ Set<String> sucs=new HashSet<String>(); for(CompraUnitaria cu:compra.getPartidas()){ sucs.add(cu.getSucursal().getNombre()); } return sucs.toArray(new String[0]); } return new String[]{compra.getSucursal().getNombre()}; }else if(bean instanceof CompraUnitaria){ CompraUnitaria com=(CompraUnitaria)bean; if( (com.getCompra()!=null) && com.getCompra().isImportacion()){ System.out.println("la compra es de importacion" +com.getId()); return getDestinos().toArray(new String[0]); }if(com.getCompra()==null){ System.out.println("la compra es de importacion" +com.getId()); return getDestinos().toArray(new String[0]); }else System.out.println("La compra no es de importacion "+com.getId()+"**********" ); return new String[]{com.getSucursal().getNombre()}; }else if(bean instanceof NotaDeCredito){ NotaDeCredito nota=(NotaDeCredito)bean; if(nota.getOrigenAplicacion().equals("CAM")){ Aplicacion a=nota.getAplicaciones().iterator().next(); String suc=a.getCargo().getSucursal().getNombre(); return new String[]{suc}; }else{ return new String[0]; } }else if(bean instanceof CargoPorTesoreria){ CargoPorTesoreria cargo=(CargoPorTesoreria)bean; if(cargo.getOrigen().equals(OrigenDeOperacion.CAM)){ return new String[]{cargo.getSucursal().getNombre()}; }else{ return new String[0]; } }else if(bean instanceof AsignacionVentaCE){ AsignacionVentaCE a=(AsignacionVentaCE)bean; return new String[]{a.getVenta().getSucursal().getNombre()}; }else if(bean instanceof SolicitudDeModificacion){ SolicitudDeModificacion a=(SolicitudDeModificacion)bean; return new String[]{a.getSucursal().getNombre()}; } else return new String[]{"ND"}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void exportar(Object bean) {\n\t\t\r\n\t}", "public void testbusquedaAvanzada() {\n// \ttry{\n\t \t//indexarODEs();\n\t\t\tDocumentosVO respuesta =null;//this.servicio.busquedaAvanzada(generarParametrosBusquedaAvanzada(\"agregatodos identificador:es-ma_20071119_1_9115305\", \"\"));\n\t\t\t/*\t\tObje...
[ "0.6244155", "0.5921236", "0.5896955", "0.58081335", "0.57833177", "0.57693094", "0.5752729", "0.56749845", "0.5659136", "0.5607659", "0.5597189", "0.55431336", "0.55279815", "0.5517488", "0.5509433", "0.55033773", "0.5501833", "0.5493354", "0.54816437", "0.5476899", "0.54677...
0.6188485
1
Created by liuyw on 2015/11/24.
public interface RegisterService { /** * 获取验证码 * @param para * @return */ RegisterResult getPictureCode(RegisterEnter para); /** * 注册用户 * @param para * @return */ RegisterResult registerUser(RegisterEnter para); /** * 个人用户注册设置密码 * @param para * @return */ @Role RegisterResult register_person(RegisterEnter para); /** * 插入注册推荐人公司信息 * @param dept */ void insertReferrerDept(String dept,String mobileNo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpubli...
[ "0.61426264", "0.6115469", "0.6012155", "0.59749585", "0.5912353", "0.5876299", "0.5876299", "0.5874969", "0.58626854", "0.57752264", "0.57736814", "0.576934", "0.57657605", "0.5723867", "0.5719237", "0.5718955", "0.57168627", "0.5711879", "0.5710715", "0.57020104", "0.570201...
0.0
-1
Instantiates a new combo listener.
@SuppressWarnings("rawtypes") public ComboListener(JComboBox cbListenerParam, Vector vectorParam) { cbListener = cbListenerParam; vector = vectorParam; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ComboManager()\n {\n comboSize = Math.min(SkillAPI.getSettings().getComboSize(), Click.MAX_COMBO_SIZE);\n clicks = SkillAPI.getSettings().getEnabledClicks();\n }", "private void initListeners() {\n comboBox.comboBoxListener(this::showProgramData);\n view.refreshListener(a...
[ "0.64264506", "0.624552", "0.6091409", "0.60706586", "0.59916955", "0.5975688", "0.5974954", "0.59088457", "0.5891216", "0.5828714", "0.57585216", "0.57504195", "0.572134", "0.5720302", "0.57150024", "0.5690651", "0.56864905", "0.56748724", "0.56669414", "0.56610405", "0.5658...
0.6074927
3
Gets the filtered list.
@SuppressWarnings({ "rawtypes", "unchecked" }) public Vector getFilteredList(String text) { Vector v = new Vector(); if (text.length() > 2) { FuncaoDAOImpl funcaoDao = new FuncaoDAOImpl(); List<Funcao> lista = funcaoDao.getListByStrDescriptor(text); for (Funcao funcao : lista) { v.add(funcao.getStrFuncaoVerbo() + " " + funcao.getStrFuncaoObjeto()); } } return v; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<SensorResponse> getFilteredList(){\n return filteredList;\n }", "List<String> getFilters();", "List<JSONObject> getFilteredItems();", "ObservableList<ReadOnlyEvent> getFilteredEventList();", "ObservableList<Patient> getFilteredPatientList();", "ObservableList<Deliverable> getFiltere...
[ "0.76004875", "0.744624", "0.7425063", "0.718296", "0.7174654", "0.7151332", "0.70975244", "0.707113", "0.7049913", "0.70308924", "0.6869721", "0.6869721", "0.6834401", "0.67945844", "0.67541814", "0.6753279", "0.6728503", "0.67229116", "0.6678008", "0.6671066", "0.6656516", ...
0.0
-1
Corresponds to attribute filterRes on the given filter element. Contains the X component of attribute filterRes.
public final OMSVGAnimatedInteger getFilterResX() { return ((SVGFilterElement)ot).getFilterResX(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void setFilterRes(int filterResX, int filterResY) throws JavaScriptException {\n ((SVGFilterElement)ot).setFilterRes(filterResX, filterResY);\n }", "public Element getFilterElement() {\n\t\tElement result = new Element(TAG_FILTER);\n\t\t\n\t\tElement desc = new Element(TAG_DESCRIPTION);\n\t\tdes...
[ "0.6021514", "0.5348354", "0.508172", "0.5073587", "0.5066995", "0.50579816", "0.49903288", "0.4971753", "0.49652562", "0.4950048", "0.49338785", "0.49277562", "0.4924896", "0.48890054", "0.48740754", "0.48621178", "0.48496217", "0.4845834", "0.4841458", "0.48071557", "0.4797...
0.68359345
0
Corresponds to attribute filterRes on the given filter element. Contains the Y component (possibly computed automatically) of attribute filterRes.
public final OMSVGAnimatedInteger getFilterResY() { return ((SVGFilterElement)ot).getFilterResY(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final OMSVGAnimatedInteger getFilterResX() {\n return ((SVGFilterElement)ot).getFilterResX();\n }", "public final void setFilterRes(int filterResX, int filterResY) throws JavaScriptException {\n ((SVGFilterElement)ot).setFilterRes(filterResX, filterResY);\n }", "public double getResy() {\n ...
[ "0.63414896", "0.5902405", "0.5025033", "0.49816856", "0.4935654", "0.49349245", "0.48259306", "0.48073032", "0.48043913", "0.47757584", "0.4773639", "0.47731116", "0.47686347", "0.47594827", "0.47502565", "0.46943566", "0.46332186", "0.46236876", "0.46230498", "0.4622405", "...
0.7253927
0
Sets the values for attribute filterRes.
public final void setFilterRes(int filterResX, int filterResY) throws JavaScriptException { ((SVGFilterElement)ot).setFilterRes(filterResX, filterResY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void setFilter(int... values){\n filterList.clear();\n for(int i = 0; i < values.length; i++)\n filterList.add(values[i]);\n }", "void setFilter(Filter f);", "public void setFilter(Object[] filter) {\n nativeSetFilter(filter);\n }", "public void setFilters(i...
[ "0.62181324", "0.5961481", "0.5828987", "0.5763497", "0.57477015", "0.57334197", "0.5693495", "0.56644756", "0.5607915", "0.5558239", "0.55548763", "0.55548763", "0.5449153", "0.5446016", "0.54451364", "0.54092175", "0.5399159", "0.5393019", "0.5319615", "0.53157705", "0.5303...
0.70432067
0
Implementation of the svg::SVGLangSpace W3C IDL interface Corresponds to attribute xml:lang on the given element.
public final String getXmllang() { return ((SVGFilterElement)ot).getXmllang(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setXmlLang(java.lang.String xmlLang)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(XMLLANG$26);\n if (target...
[ "0.63735586", "0.6278406", "0.6242505", "0.62244666", "0.61137164", "0.60131234", "0.6007545", "0.59231436", "0.5919064", "0.58340263", "0.5756228", "0.56489533", "0.5626731", "0.538342", "0.53660697", "0.5352539", "0.5350514", "0.52851206", "0.5276971", "0.5275726", "0.51582...
0.6115204
4
Corresponds to attribute xml:lang on the given element.
public final void setXmllang(java.lang.String value) throws JavaScriptException { ((SVGFilterElement)ot).setXmllang(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final String getXmlLangAttribute() {\n return getAttributeValue(\"xml:lang\");\n }", "public final String getLangAttribute() {\n return getAttributeValue(\"lang\");\n }", "public final String getXmllang() {\n return ((SVGFilterElement)ot).getXmllang();\n }", "@XmlAttribute\r\n ...
[ "0.78954834", "0.72481996", "0.67930233", "0.6616082", "0.6559277", "0.65510577", "0.6374292", "0.6318961", "0.6279018", "0.6263357", "0.6227289", "0.6179986", "0.6008768", "0.5956755", "0.58795106", "0.5866436", "0.5866436", "0.58467835", "0.5833319", "0.5812251", "0.5812251...
0.5963922
13
Corresponds to attribute xml:space on the given element.
public final String getXmlspace() { return ((SVGFilterElement)ot).getXmlspace(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void setXmlspace(java.lang.String value) throws JavaScriptException {\n ((SVGFilterElement)ot).setXmlspace(value);\n }", "private static boolean findPreserveSpace(/*@NotNull*/ TreeInfo doc) {\n if (doc instanceof TinyTree) {\n // Optimisation - see bug 2929. Makes a vast differ...
[ "0.6426133", "0.56879264", "0.5535104", "0.55146575", "0.54962945", "0.54956955", "0.54096824", "0.53822887", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", ...
0.6400629
1
Corresponds to attribute xml:space on the given element.
public final void setXmlspace(java.lang.String value) throws JavaScriptException { ((SVGFilterElement)ot).setXmlspace(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final String getXmlspace() {\n return ((SVGFilterElement)ot).getXmlspace();\n }", "private static boolean findPreserveSpace(/*@NotNull*/ TreeInfo doc) {\n if (doc instanceof TinyTree) {\n // Optimisation - see bug 2929. Makes a vast difference especially if there are few attributes i...
[ "0.6400629", "0.56879264", "0.5535104", "0.55146575", "0.54962945", "0.54956955", "0.54096824", "0.53822887", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", "0.52090746", ...
0.6426133
0
Implementation of the svg::SVGURIReference W3C IDL interface Corresponds to attribute 'xlink:href' on the given element.
public final OMSVGAnimatedString getHref() { return ((SVGFilterElement)ot).getHref(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public org.w3.x2005.sparqlResults.URIReference xgetHref()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.w3.x2005.sparqlResults.URIReference target = null;\n target = (org.w3.x2005.sparqlResults.URIReference)get_store().find_at...
[ "0.63557947", "0.6290508", "0.62088203", "0.6007623", "0.5750518", "0.56405896", "0.56329596", "0.56266356", "0.55410564", "0.5467041", "0.540143", "0.5377301", "0.53528523", "0.5343044", "0.53411305", "0.5307241", "0.52974546", "0.5294757", "0.5267302", "0.52460206", "0.5230...
0.545302
10
Ignore; surfaceChanged is guaranteed to be called immediately after this.
@Override public void surfaceCreated(SurfaceHolder holder) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {\n\t\tLog.e(TAG, \"surfaceChanged\");\n\t}", "@Override\r\n\tpublic void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {\n\t\t\r\n\t}", "@Override\n\tpublic void surfaceChanged(SurfaceHolder arg0, int ...
[ "0.772425", "0.767685", "0.7673717", "0.766441", "0.75905794", "0.74072844", "0.72515", "0.7232946", "0.71470094", "0.70564085", "0.7054932", "0.7044073", "0.7043666", "0.6979985", "0.6977365", "0.69480556", "0.6912105", "0.6912105", "0.6912105", "0.68580675", "0.68451935", ...
0.674272
27
Ask for unbuffered events. Flutter and Chrome do it so assume it's good for us as well.
@Override public boolean onTouchEvent(MotionEvent event) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { requestUnbufferedDispatch(event); } dispatchMotionEvent(event); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void pollEvents() {\n\t\tglfwPollEvents();\n\t}", "public static SDLEvent pollEvent() throws SDLException {\n\treturn pollEvent(true);\n }", "private void watch() {\n ByteBuffer buffer = ByteBuffer.allocate(BUFFER_SIZE);\n while (true) {\n try {\n int nu...
[ "0.6016235", "0.5513941", "0.54816806", "0.5427063", "0.53468406", "0.53152156", "0.5313156", "0.5284491", "0.5270549", "0.52560115", "0.5232327", "0.5224961", "0.5214905", "0.5203664", "0.51911825", "0.5180644", "0.5176799", "0.5128348", "0.51242644", "0.5093467", "0.5075412...
0.51408184
17
imeToRunes converts the Java character index into runes (Java code points).
static private native int imeToRunes(long handle, int chars);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Map<Integer, Integer> getRunes(JsonArray rune)\n\t{\n\t\tMap<Integer, Integer> runes = new HashMap<Integer, Integer>();\n\t\tfor(int i = 0; i < rune.size(); i++)\n\t\t{\n\t\t\tJsonObject r = rune.getJsonObject(i);\n\t\t\tint amount = r.getInt(\"rank\");\n\t\t\tint id = r.getInt(\"runeId\");\n\t\t\tru...
[ "0.5219393", "0.49126667", "0.48292255", "0.46307358", "0.46041104", "0.4513007", "0.44876868", "0.4391619", "0.438342", "0.43162462", "0.42428946", "0.4238592", "0.42342052", "0.4233655", "0.42304686", "0.42200145", "0.42164853", "0.42096674", "0.4198868", "0.4179013", "0.41...
0.6289041
0
imeToUTF16 converts the rune index into Java characters.
static private native int imeToUTF16(long handle, int runes);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static char getFCD16FromSurrogatePair(char paramChar1, char paramChar2)\n/* */ {\n/* 401 */ return FCDTrieImpl.fcdTrie.getTrailValue(paramChar1, paramChar2);\n/* */ }", "@Test\n\tpublic void testUTF16() throws IOException {\n\t\tBufferedReader reader = new BufferedReader(\n\t\t\t\tnew I...
[ "0.58591217", "0.57644296", "0.57423097", "0.56913203", "0.56315714", "0.55459464", "0.54801774", "0.5426502", "0.5364367", "0.5336306", "0.52982414", "0.5287807", "0.5275147", "0.5256271", "0.5232391", "0.5193359", "0.5183006", "0.51795894", "0.5179549", "0.5144824", "0.5035...
0.75210786
0
translate before and after to runes.
@Override public boolean deleteSurroundingText(int beforeChars, int afterChars) { int selStart = imeSelectionStart(nhandle); int selEnd = imeSelectionEnd(nhandle); int before = selStart - imeToRunes(nhandle, imeToUTF16(nhandle, selStart) - beforeChars); int after = selEnd - imeToRunes(nhandle, imeToUTF16(nhandle, selEnd) - afterChars); return deleteSurroundingTextInCodePoints(before, after); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void beforeRun();", "void afterRun();", "@Test\n void step() {\n Fb2ConverterStateMachine state = new Fb2ConverterStateMachine();\n StringBuilder sb = new StringBuilder();\n WordsTokenizer wt = new WordsTokenizer(getOriginalText());\n while (wt.hasMoreTokens()) {\n Str...
[ "0.5453681", "0.5246337", "0.5189891", "0.5183545", "0.50676996", "0.5032007", "0.4972847", "0.49317256", "0.49265313", "0.492346", "0.48748213", "0.48510134", "0.48291788", "0.48158014", "0.47146758", "0.4699296", "0.4697359", "0.46851373", "0.46843052", "0.46838534", "0.468...
0.0
-1
substringRunes returns the substring from start to end in runes. The resuls is truncated to the snippet.
String substringRunes(int start, int end) { start -= this.offset; end -= this.offset; int runes = snippet.codePointCount(0, snippet.length()); if (start < 0) { start = 0; } if (end < 0) { end = 0; } if (start > runes) { start = runes; } if (end > runes) { end = runes; } return snippet.substring( snippet.offsetByCodePoints(0, start), snippet.offsetByCodePoints(0, end) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public My_String substring(int start, int end);", "public static boolean goodRuns(String sequence) {\n\t\tString run = sequence.charAt(0) + \"\";\n\t\tint longestRun = 0;\n\t\tfor (int i = 1; i < sequence.length(); i++) {\n\t\t\tif (run.contains(sequence.charAt(i) + \"\")) run += sequence.charAt(i);\n\t\t\telse ...
[ "0.48966718", "0.466735", "0.46605286", "0.4646744", "0.46344262", "0.46078888", "0.45475978", "0.4520473", "0.44841102", "0.44722325", "0.44621637", "0.44552508", "0.4443341", "0.44333038", "0.4425208", "0.4416107", "0.4395244", "0.43617234", "0.4355518", "0.43440244", "0.43...
0.79747653
0
Stack time complexity: O(N), space complexity: O(N) 1 ms(90.96%), 38.4 MB(94.59%) for 98 tests
public int minOperations(String[] logs) { Stack<Integer> stack = new Stack<>(); for (String log : logs) { switch (log) { case "./": break; case "../": if (!stack.empty()) { stack.pop(); } break; default: stack.push(0); break; } } return stack.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static\nboolean\ncheck(\nint\nA[], \nint\nN) { \n\n// Stack S \n\nStack<Integer> S = \nnew\nStack<Integer>(); \n\n\n// Pointer to the end value of array B. \n\nint\nB_end = \n0\n; \n\n\n// Traversing each element of A[] from starting \n\n// Checking if there is a valid operation \n\n// that can be performed. \n\nf...
[ "0.6785072", "0.67048", "0.65553933", "0.63329184", "0.62648463", "0.62049055", "0.6182148", "0.6159157", "0.6084487", "0.6034364", "0.6030707", "0.59987783", "0.5982124", "0.5979093", "0.59739894", "0.58941346", "0.5870916", "0.5853693", "0.5847921", "0.58401227", "0.5809310...
0.0
-1
time complexity: O(N), space complexity: O(N) 1 ms(90.96%), 38.4 MB(94.59%) for 98 tests
public int minOperations2(String[] logs) { int res = 0; for (String log : logs) { switch (log) { case "./": break; case "../": res = Math.max(0, --res); break; default: res++; break; } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int f1(int N) {\n int x = 0; //O(1)\n for(int i = 0; i < N; i++...
[ "0.7035749", "0.67932683", "0.63114697", "0.6274625", "0.62510115", "0.62284565", "0.62137836", "0.61887586", "0.61797637", "0.6151484", "0.61056346", "0.60911316", "0.6076112", "0.6023081", "0.59838897", "0.5964601", "0.5949651", "0.5930693", "0.59228563", "0.590664", "0.589...
0.0
-1
Returns a deep clone of this.
@Override public Object deepCopy() { final UIAnimationMutable clone = new UIAnimationMutable(getName(), events.size(), controllers.size()); for (int i = 0, len = controllers.size(); i < len; ++i) { clone.controllers.add((UIController) controllers.get(i).deepCopy()); } for (int i = 0, len = events.size(); i < len; ++i) { final UIAttribute p = events.get(i); clone.events.add((UIAttribute) p.deepCopy()); } clone.nextEventsAdditionShouldOverride = nextEventsAdditionShouldOverride; if (driver != null) { clone.driver = (UIAttribute) driver.deepCopy(); } return clone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public T cloneDeep();", "public Object clone(){\n \t\n \treturn this;\n \t\n }", "public Complex makeDeepCopy() {\r\n Complex complex2 = new Complex(this.getReal(), this.getImaginary());\r\n return complex2;\r\n }", "public Object clone() {\n return this.copy();\n }", "Comp...
[ "0.7700862", "0.76551515", "0.7595971", "0.7421318", "0.7400157", "0.7308941", "0.7259989", "0.72043866", "0.7145762", "0.7129059", "0.70932287", "0.70779634", "0.7021453", "0.70213175", "0.69687927", "0.69687927", "0.6944371", "0.69308317", "0.69041324", "0.6888031", "0.6861...
0.0
-1
TODO Autogenerated method stub
@Override public Customer findByEmail(String email) { return customerDao.findByEmail(email); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Get call using spring based web services
@GetMapping("/myurl") public String sayHello() { System.out.println("sayHello...."); return "Hi User"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String serviceEndpoint();", "public interface HttpService {\n//banner/query?type=1\n // public static final String BASE_URL=\"http://112.124.22.238:8081/course_api/\";\n @GET(\"banner/query\")\n Call<List<HeaderBean>> getHeaderData(@Query(\"type\") String type);\n @GET(\"campaign/recommend\")\n ...
[ "0.65197134", "0.64671355", "0.6432957", "0.63002133", "0.6297513", "0.6294795", "0.6246508", "0.62421834", "0.62149525", "0.62111956", "0.61784405", "0.6178137", "0.60915256", "0.60885084", "0.6085576", "0.60353166", "0.6031038", "0.60216737", "0.60070115", "0.6005598", "0.6...
0.57949364
59
retrieve the person information by id
@GetMapping("/orderinfo/{​​​​​​​id}​​​​​​​") public OrderInfo getOrderById(@PathVariable("id") Integer id) { OrderInfo order =new OrderInfo(); //creating java object order.setOrder_id(1); order.setCustomer_address("Goa"); order.setCustomer_id(555); order.setProduct_id(456); order.setTotal_amt("1234567"); return order; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public person findbyid(int id){\n\t\t\treturn j.queryForObject(\"select * from person where id=? \", new Object[] {id},new BeanPropertyRowMapper<person>(person.class));\r\n\t\t\r\n\t}", "public Person getPerson(String id) throws DataAccessException {\n Person person;\n ResultSet rs = null;\n ...
[ "0.7679283", "0.7659709", "0.7651667", "0.74744946", "0.74592495", "0.73979145", "0.7390366", "0.7375833", "0.7337284", "0.7281456", "0.7249027", "0.72303", "0.71361965", "0.7121876", "0.7118155", "0.71148574", "0.7114028", "0.7113778", "0.70366436", "0.7013764", "0.6992705",...
0.0
-1
add the order information POst
@PostMapping(value = "/insertorderdetails") public OrderInfo insertDummyOrder(@RequestBody OrderInfo order) { return new OrderService().addOrder(order); //calling the service }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic int add(Forge_Order_Detail t) {\n\t\treturn 0;\n\t}", "static void addOrder(orders orders) {\n }", "public void addOrder(Order o) {\n medOrder.add(o);\n //System.out.println(\"in adding order\");\n for(OrderItem oi: o.getOrderItemList())\n {\n Medicine...
[ "0.74782324", "0.72950715", "0.728373", "0.72066194", "0.7079436", "0.6951476", "0.6929794", "0.6829358", "0.6806563", "0.6799678", "0.6787951", "0.6745088", "0.67093605", "0.66629", "0.66225755", "0.66082656", "0.66004914", "0.6594845", "0.65528095", "0.6540545", "0.65359193...
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState ) { View view = inflater.inflate(R.layout.fragment_third, container, false); final Calendar cal = Calendar.getInstance(); EditText titleText = view.findViewById(R.id.editTextTitle); EditText matkulText = view.findViewById(R.id.editTextMatkul); EditText deadlineDateText = view.findViewById(R.id.editTextDeadlineDate); DatePickerDialog.OnDateSetListener date = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) { cal.set(year, month, dayOfMonth); deadlineDateText.setText(cal.get(Calendar.DAY_OF_MONTH)+"-"+new DateFormatSymbols().getMonths()[cal.get(Calendar.MONTH)]+"-"+cal.get(Calendar.YEAR)); } }; deadlineDateText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new DatePickerDialog(view.getContext(), date, cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH)).show(); } }); EditText deadlineTimeText = view.findViewById(R.id.editTextDeadlineTime); TimePickerDialog.OnTimeSetListener time = new TimePickerDialog.OnTimeSetListener() { @Override public void onTimeSet(TimePicker view, int hourOfDay, int minute) { cal.set(Calendar.HOUR_OF_DAY, hourOfDay); cal.set(Calendar.MINUTE, minute); deadlineTimeText.setText(cal.get(Calendar.HOUR_OF_DAY)+"."+cal.get(Calendar.MINUTE)); } }; deadlineTimeText.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v) { new TimePickerDialog(view.getContext(), time, cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), true).show(); } }); EditText dscText = view.findViewById(R.id.editTextDsc); Button button = view.findViewById(R.id.buttonSubmit); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Tugas tugas = new Tugas(titleText.getText().toString(), matkulText.getText().toString(), new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), 00).getTimeInMillis(), dscText.getText().toString(), (cal.compareTo(GregorianCalendar.getInstance()) > 0) ? 0 : 1); try{ ((MainActivity)getActivity()).tugasViewModel.insert(tugas); ((MainActivity)getActivity()).tugasViewModel.getCount().observe(getActivity(), new Observer<Integer>() { @Override public void onChanged(Integer integer) { Log.i("DEBUG_TAG", String.valueOf(integer)); } }); }catch (NullPointerException ex){ ex.getMessage(); } titleText.setText(""); matkulText.setText(""); deadlineDateText.setText(""); deadlineTimeText.setText(""); dscText.setText(""); Toast.makeText(getActivity().getApplicationContext(),"Added new Work",Toast.LENGTH_SHORT).show(); } }); return view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
Function showListView returns the ListView of all the soldiers from Soldiers database
private void showListView() { SimpleCursorAdapter adapter = new SimpleCursorAdapter( this, R.layout.dataview, soldierDataSource.getCursorALL(), // _allColumns, new int[]{ R.id.soldierid, R.id.username, R.id.insertedphone, R.id.password}, 0); table.setAdapter(adapter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showListView() {\n Cursor data = mVehicleTypeDao.getData();\n // ArrayList<String> listData = new ArrayList<>();\n ArrayList<String> alVT_ID = new ArrayList<>();\n ArrayList<String> alVT_TYPE = new ArrayList<>();\n\n while (data.moveToNext()) {\n //get the...
[ "0.67847985", "0.65353984", "0.64636886", "0.63712525", "0.6341951", "0.6335774", "0.6307048", "0.630487", "0.63023573", "0.62684166", "0.62569135", "0.6199689", "0.61862314", "0.6174594", "0.6158796", "0.6137387", "0.61330384", "0.6083893", "0.60819906", "0.6058839", "0.6036...
0.7860506
0
Function DeleteData is getting a userToDelete from the Admin , and then deletes the soldier from Soldiers database.
private void DeleteData (String userToDelete) { cursor = db.rawQuery("SELECT * FROM "+MySQLiteHelper.TABLE_NAME+" WHERE "+MySQLiteHelper.COLUMN_USERNAME+"=?",new String[] {userToDelete}); if (cursor != null) { if(cursor.getCount() > 0) { cursor.moveToFirst(); String whereClause = MySQLiteHelper.COLUMN_USERNAME+ "=?"; String [] whereArgs = new String[] {userToDelete}; db.delete(MySQLiteHelper.TABLE_NAME , whereClause , whereArgs); showListView(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteSoldierArrangement (String userToDelete)\n {\n cursor3 = arrangement_db.rawQuery(\"SELECT * FROM \"+MyArrangementSQLiteHelper.TABLE_NAME+\" WHERE \"+MyArrangementSQLiteHelper.COLUMN_USERNAME+\"=?\",new String[] {userToDelete});\n if (cursor3!=null)\n {\n cursor3...
[ "0.69210374", "0.67774564", "0.6627461", "0.6466448", "0.62974966", "0.6258556", "0.625364", "0.62508804", "0.62326026", "0.62282705", "0.62012583", "0.6200129", "0.61841935", "0.618156", "0.61727256", "0.6166896", "0.61653113", "0.61639524", "0.6160431", "0.6160166", "0.6103...
0.6286439
5
Function SoldierCheckChoice is alertdialog that warns the Admin before the soldier delete. and then if the Admin press "yes" the Soldier will be deleted , else , the delete will be canceled
public void SoldierCheckChoice(View view){ AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.setMessage("Are you sure , You want to remove the soldier and his arrangements?"); alertDialogBuilder.setPositiveButton("yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { userToDelete = delUserName.getText().toString(); if (ifHasArrangement(userToDelete)) { deleteSoldierArrangement(userToDelete); } DeleteData(userToDelete); } }); alertDialogBuilder.setNegativeButton("No",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(ListDataActivity.this,"You cancelled the Soldier delete!",Toast.LENGTH_LONG).show(); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private AlertDialog AskOption(final Exercise item) {\n AlertDialog myQuittingDialogBox = new AlertDialog.Builder(ShowRoutine.this)\n //set message, title, and icon\n .setTitle(\"Delete\")\n .setMessage(\"Do you want to Delete\")\n .setIcon(R.drawab...
[ "0.68911296", "0.6827023", "0.66776747", "0.66445684", "0.6629233", "0.66006607", "0.6591457", "0.6582531", "0.6571064", "0.655829", "0.6535482", "0.6519219", "0.6502942", "0.64115775", "0.63931245", "0.63898265", "0.637995", "0.6379558", "0.63397366", "0.6324495", "0.6315994...
0.82394004
0
Function ifHasArrangement is getting userTodelete from the Admin and then returns true if the soldier has arrangement , else , the function returns false.
public boolean ifHasArrangement (String userToDelete) { cursor2 = arrangement_db.rawQuery("SELECT * FROM "+MyArrangementSQLiteHelper.TABLE_NAME+" WHERE "+MyArrangementSQLiteHelper.COLUMN_USERNAME+"=?",new String[] {userToDelete}); if (cursor2!=null) { cursor2.moveToFirst(); return true ; } return false ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isAutorisationUtilisation();", "boolean hasMission();", "boolean isAdmin();", "boolean hasTeam();", "boolean hasDonator();", "boolean isPlaced();", "public boolean populateAdmins(){\r\n\t\t\r\n\t\tboolean done=false;\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\tConnection conn=Database.getConnection();\r\n\t...
[ "0.5913239", "0.5827806", "0.576404", "0.5744502", "0.5642043", "0.5633808", "0.56257254", "0.56200165", "0.56019473", "0.5600749", "0.5536634", "0.55319476", "0.5502776", "0.5490155", "0.5490155", "0.5464137", "0.54549754", "0.54451984", "0.5416353", "0.54125637", "0.5403112...
0.67451274
0
Function deleteSoldierArrangement is getting userTodelete from the Admin and then delete the soldier's arrangements.
public void deleteSoldierArrangement (String userToDelete) { cursor3 = arrangement_db.rawQuery("SELECT * FROM "+MyArrangementSQLiteHelper.TABLE_NAME+" WHERE "+MyArrangementSQLiteHelper.COLUMN_USERNAME+"=?",new String[] {userToDelete}); if (cursor3!=null) { cursor3.moveToFirst(); String whereClause = MyArrangementSQLiteHelper.COLUMN_USERNAME+ "=?"; String [] whereArgs = new String[] {userToDelete}; arrangement_db.delete(MyArrangementSQLiteHelper.TABLE_NAME , whereClause , whereArgs); Toast.makeText(ListDataActivity.this,"The arrangments of the deleted soldier deleted sucssesfully",Toast.LENGTH_LONG); } else Toast.makeText(ListDataActivity.this,"There are no arrangements for the deleted soldier",Toast.LENGTH_LONG); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteDepartmentByDeptName(String dept_name);", "public void deleteDepartmentByDeptNo(int dept_no);", "public void deleteEquipoComunidad(EquipoComunidad equipoComunidad);", "@Test\n\tpublic void deleteByAdministratorTest() throws ParseException {\n\t\t\n\t\tSystem.out.println(\"-----Delete announ...
[ "0.6220188", "0.6195777", "0.6035712", "0.5988375", "0.5916746", "0.5882001", "0.5878912", "0.5789424", "0.5781408", "0.5729813", "0.5638961", "0.5510489", "0.5502472", "0.54421824", "0.53970635", "0.5393517", "0.53601223", "0.53358966", "0.5307086", "0.5294305", "0.5289302",...
0.70037556
0
Apache's Bag data structure.
public static void main(String[] args) { Bag<Character> bag = new CharacterCount().findCharacterCount("Hello World."); bag.uniqueSet().stream().forEach(ch -> {System.out.println(ch + "-" + bag.getCount(ch));}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Bag() {\n\t\tinstances = new ArrayList<double[]>();\n\t\tname = \"\";\n\t}", "public interface Bag<T>\n{\n // ----------------------------------------------------------\n /**\n * Adds the specified element to the bag.\n *\n * @param element item to be added\n * @precondition paramete...
[ "0.73135436", "0.7212167", "0.7143476", "0.69556075", "0.68672615", "0.68500865", "0.67194617", "0.6544114", "0.6522063", "0.6429989", "0.63295895", "0.62869084", "0.6207267", "0.6066918", "0.6025961", "0.58847225", "0.5883849", "0.5870369", "0.5864535", "0.5848945", "0.58155...
0.0
-1
TODO : Add javadocs
public interface Cache<K,E> { public E getCacheEntry(K id); public boolean addCacheEntry(K id, E entry); public void removeCacheEntry(K id); public Stream<E> getAllEntries(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "...
[ "0.61670774", "0.61651695", "0.6143641", "0.61146367", "0.60526574", "0.5929358", "0.58574325", "0.5855199", "0.585465", "0.5831625", "0.58231723", "0.5822457", "0.5822457", "0.5822457", "0.5822457", "0.5822457", "0.5822457", "0.57947206", "0.5793535", "0.5793535", "0.5777855...
0.0
-1
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"); PrintWriter out = response.getWriter(); response.setContentType("text/html;charset=UTF-8"); HttpSession session = request.getSession(); String nextJSP = ""; String action; int serviceId; try { /* TODO output your page here. You may use following sample code. */ action = request.getParameter(CONFIG.PARAM_ACTION); if (CONFIG.ACTION_HATAXI.equals(action)) { String lang = "en"; if (request.getSession().getAttribute(CONFIG.lang).equals("")) { } else { lang = "ar"; } serviceId = Integer.parseInt(request.getParameter(CONFIG.PARAM_SERVICE_ID)); session.setAttribute(CONFIG.PARAM_SERVICE_ID, serviceId); nextJSP = CONFIG.HATAXI_PAGE; } else if (CONFIG.ACTION_HATAXI_CONFIRM.equals(action)) { String mobile = request.getParameter("DonatorPhone"); String amount = request.getParameter("donationValue"); String token = session.getAttribute("Token").toString(); HataxiClient hataxiClient = new HataxiClient(); HataxiInquiryResponse resp = hataxiClient.hataxiInquiry(mobile, amount, "en", token, request.getRemoteAddr()); session.setAttribute("validationResp", resp); session.setAttribute("mobile", mobile); nextJSP = CONFIG.HATAXI_CONFIRMATION; } else { String lang = "en"; if (request.getSession().getAttribute(CONFIG.lang).equals("")) { } else { lang = "ar"; } String mobile = request.getParameter("DonatorPhone"); String amount = request.getParameter("txnValue"); HataxiPaymentRequest go = new HataxiPaymentRequest(); go.setMobileNumber(mobile); go.setAmount(Double.parseDouble(amount)); // go.setToken(request.getSession().getAttribute("Token").toString()); String token = session.getAttribute("Token").toString(); HataxiClient hataxiClient = new HataxiClient(); HataxiPaymentResponse resp = hataxiClient.hataxiPayment(go, "en", token, request.getRemoteAddr()); if(resp.getTransactionStatus().contains("SUCCEEDED")){ session.setAttribute("payResponse", resp); nextJSP = CONFIG.HATAXI_PAYMENT; }else{ session.setAttribute("ErrorMessage", resp.getTransactionStatus()); nextJSP = CONFIG.PAGE_ERRPR; } } RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/" + nextJSP); dispatcher.forward(request, response); } catch (Exception e) { session.setAttribute("ErrorMessage", e.getMessage()); nextJSP = CONFIG.PAGE_ERRPR; RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/" + nextJSP); dispatcher.forward(request, response); } finally { out.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_...
[ "0.7004024", "0.66585696", "0.66031146", "0.6510023", "0.6447109", "0.64421695", "0.64405906", "0.64321136", "0.6428049", "0.6424289", "0.6424289", "0.6419742", "0.6419742", "0.6419742", "0.6418235", "0.64143145", "0.64143145", "0.6400266", "0.63939095", "0.63939095", "0.6392...
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) thro...
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234",...
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n ...
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197"...
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short d...
[ "0.87634975", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8531295", "0.8531295", "0.85282224", "0.85282224", ...
0.0
-1
Creates a condition that is fulfilled when the specified card's "in play data" is not null.
public ForRemainderOfGameDataEqualsCondition(PhysicalCard card, int cardId, boolean value) { _permCardId = card.getPermanentCardId(); _cardId = cardId; _value = value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasPlayCardRequest();", "@Test\n public void testCardCanPlay_TRUE_VALUE() {\n System.out.println(\"cardCanPlay TRUE VALUE\");\n UnoCard cardSelection = new UnoCard(UnoCardColour.RED, UnoCardValue.TWO);\n UnoCard drawCard = new UnoCard(UnoCardColour.BLUE, UnoCardValue.TWO);\n ...
[ "0.5323214", "0.51457906", "0.51306576", "0.5107567", "0.505602", "0.5018188", "0.49991626", "0.49924776", "0.4969695", "0.49636966", "0.4951113", "0.4928032", "0.49276632", "0.49153304", "0.49097142", "0.48396027", "0.48203912", "0.48096338", "0.48094743", "0.48058766", "0.4...
0.53646356
0
/ Click Listeners, handle click based on objects attached to UI. Click listener for all toggle events
@Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (preference == mSubMenuVoicemailSettings) { return true; } else if (preference == mButtonDTMF) { return true; } else if (preference == mButtonTTY) { return true; } else if (preference == mButtonAutoRetry) { android.provider.Settings.System.putInt(mPhone.getContext().getContentResolver(), android.provider.Settings.System.CALL_AUTO_RETRY, mButtonAutoRetry.isChecked() ? 1 : 0); return true; } else if (preference == mButtonHAC) { int hac = mButtonHAC.isChecked() ? 1 : 0; // Update HAC value in Settings database Settings.System.putInt(mPhone.getContext().getContentResolver(), Settings.System.HEARING_AID, hac); // Update HAC Value in AudioManager mAudioManager.setParameter(HAC_KEY, hac != 0 ? HAC_VAL_ON : HAC_VAL_OFF); return true; } else if (preference == mVoicemailSettings) { if (preference.getIntent() != null) { this.startActivityForResult(preference.getIntent(), VOICEMAIL_PROVIDER_CFG_ID); } else { updateVoiceNumberField(); } return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void click() {\n\t\tif(toggles) {\n\t\t\tvalue = (value == 0) ? 1 : 0;\t// flip toggle value\n\t\t}\n\t\tupdateStore();\n\t\tif(delegate != null) delegate.uiButtonClicked(this);\t// deprecated\n\t}", "private void initSwitchEvents(){\n s1.setOnClickListener(v ->\n eventoSuperficie()\n ...
[ "0.6421955", "0.6366721", "0.62898886", "0.62213314", "0.61808765", "0.60722697", "0.60448873", "0.59940815", "0.5936274", "0.5931425", "0.5907471", "0.58671254", "0.5862117", "0.5862117", "0.5862117", "0.5862117", "0.5862117", "0.5862117", "0.5862117", "0.5862117", "0.586211...
0.0
-1
Implemented to support onPreferenceChangeListener to look for preference changes.
public boolean onPreferenceChange(Preference preference, Object objValue) { if (preference == mButtonDTMF) { int index = mButtonDTMF.findIndexOfValue((String) objValue); Settings.System.putInt(mPhone.getContext().getContentResolver(), Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, index); } else if (preference == mButtonTTY) { handleTTYChange(preference, objValue); } else if (preference == mVoicemailProviders) { updateVMPreferenceWidgets((String)objValue); // If the user switches to a voice mail provider and we have a // number stored for it we will automatically change the phone's // voice mail number to the stored one. // Otherwise we will bring up provider's config UI. final String providerVMNumber = loadNumberForVoiceMailProvider( (String)objValue); if (providerVMNumber == null) { // Force the user into a configuration of the chosen provider simulatePreferenceClick(mVoicemailSettings); } else { saveVoiceMailNumber(providerVMNumber); } } // always let the preference setting proceed. return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean onPreferenceChange(Preference preference, Object newValue) {\n \t\t\treturn false;\r\n \t\t}", "@Override\n public void onSettingChanged(ListPreference pref) {\n }", "@Override\r\n\tpublic boolean onPreferenceChange(Preference preference, Object newValue) {\n\t\tmcallback.onReturnF...
[ "0.8014766", "0.7696477", "0.7230977", "0.7176661", "0.7039559", "0.70011073", "0.69715273", "0.69557655", "0.68506575", "0.673825", "0.66384137", "0.658081", "0.6575921", "0.65484023", "0.65484023", "0.6539577", "0.649838", "0.64425844", "0.6379829", "0.63794917", "0.6377546...
0.6616023
11
Preference click listener invoked on OnDialogClosed for EditPhoneNumberPreference.
public void onDialogClosed(EditPhoneNumberPreference preference, int buttonClicked) { if (DBG) log("onPreferenceClick: request preference click on dialog close."); if (preference instanceof EditPhoneNumberPreference) { EditPhoneNumberPreference epn = preference; if (epn == mSubMenuVoicemailSettings) { handleVMBtnClickRequest(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void bindPreferenceClickListener(Preference preference);", "@Override\n public boolean onPreferenceClick(Preference preference) {\n Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,\n ContactsContract.CommonDataKinds.Phone.CONTENT_URI);\n ...
[ "0.68420815", "0.62663674", "0.5913299", "0.58991313", "0.58692235", "0.58493704", "0.57817656", "0.57734436", "0.57422954", "0.5656526", "0.56368047", "0.56294835", "0.56130433", "0.56019574", "0.55708176", "0.55689234", "0.5562892", "0.5556023", "0.5546305", "0.5523693", "0...
0.8071792
0
Implemented for EditPhoneNumberPreference.GetDefaultNumberListener. This method set the default values for the various EditPhoneNumberPreference dialogs.
public String onGetDefaultNumber(EditPhoneNumberPreference preference) { if (preference == mSubMenuVoicemailSettings) { // update the voicemail number field, which takes care of the // mSubMenuVoicemailSettings itself, so we should return null. if (DBG) log("updating default for voicemail dialog"); updateVoiceNumberField(); return null; } String vmDisplay = mPhone.getVoiceMailNumber(); if (TextUtils.isEmpty(vmDisplay)) { // if there is no voicemail number, we just return null to // indicate no contribution. return null; } // Return the voicemail number prepended with "VM: " if (DBG) log("updating default for call forwarding dialogs"); return getString(R.string.voicemail_abbreviated) + " " + vmDisplay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDefaultNumber(Integer defaultNumber) {\n this.defaultNumber = defaultNumber;\n }", "@Override\n\tprotected void performDefaults() {\n\t\t// Get the preference store\n\t\tfinal IPreferenceStore preferenceStore = getPreferenceStore();\n\n\t\tspiLength.setSelection(preferenceStore.getDefaul...
[ "0.62678844", "0.5636994", "0.5563568", "0.55039716", "0.5390341", "0.53392494", "0.53235203", "0.5313871", "0.5259591", "0.5218312", "0.5181447", "0.5161738", "0.51610863", "0.51327163", "0.51323587", "0.51109123", "0.5094433", "0.5089156", "0.508609", "0.5068896", "0.506223...
0.6432216
0
override the startsubactivity call to make changes in state consistent.
@Override public void startActivityForResult(Intent intent, int requestCode) { if (requestCode == -1) { // this is an intent requested from the preference framework. super.startActivityForResult(intent, requestCode); return; } if (DBG) log("startSubActivity: starting requested subactivity"); super.startActivityForResult(intent, requestCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void startActivity(final Activity activity) {\r\n\t// FIXME: temp hack for Slide curtains\r\n\tif (activity.getName().equals(\"Curtains\")) {\r\n\t\ttry {\r\n\t\t\tString response = Request.Post(\"https://\" + slideHost + \"/rpc/Slide.SetPos\").bodyString(\"{\\\"pos\\\": 1}\", ContentType.APPLI...
[ "0.61899185", "0.61181015", "0.6115353", "0.60360414", "0.58732605", "0.57392657", "0.56488615", "0.5573125", "0.5547847", "0.5547847", "0.5517698", "0.5515907", "0.54873914", "0.5441301", "0.5440674", "0.5436522", "0.54330593", "0.5419652", "0.5391675", "0.53822166", "0.5375...
0.65571046
0
asynchronous result call after contacts are selected or after we return from a call to the VM settings provider.
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // there are cases where the contact picker may end up sending us more than one // request. We want to ignore the request if we're not in the correct state. if (requestCode == VOICEMAIL_PROVIDER_CFG_ID) { if (resultCode != RESULT_OK) { if (DBG) log("onActivityResult: vm provider cfg result not OK."); return; } if (data == null) { if (DBG) log("onActivityResult: vm provider cfg result has no data"); return; } String vmNum = data.getStringExtra(VM_NUMBER_EXTRA); if (vmNum == null) { if (DBG) log("onActivityResult: vm provider cfg result has no vmnum"); return; } saveVoiceMailNumber(vmNum); return; } if (resultCode != RESULT_OK) { if (DBG) log("onActivityResult: contact picker result not OK."); return; } Cursor cursor = getContentResolver().query(data.getData(), NUM_PROJECTION, null, null, null); if ((cursor == null) || (!cursor.moveToFirst())) { if (DBG) log("onActivityResult: bad contact data, no results found."); return; } switch (requestCode) { case VOICEMAIL_PREF_ID: mSubMenuVoicemailSettings.onPickActivityResult(cursor.getString(0)); break; default: // TODO: may need exception here. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onFinish() {\n EventBus.getDefault().post(new SyncContactsFinishedEvent());\n //to prevent initial sync contacts when the app is launched for first time\n SharedPreferencesManager.setContactSynced(true);\n ...
[ "0.6374624", "0.61164016", "0.590102", "0.58835274", "0.57595277", "0.5733853", "0.57263404", "0.56436336", "0.5626307", "0.5621573", "0.56207675", "0.55863106", "0.5581115", "0.5578996", "0.55593735", "0.55237174", "0.5521722", "0.5504596", "0.5499597", "0.5496958", "0.54969...
0.6517454
0
empty vm number == clearing the vm number ?
private void saveVoiceMailNumber(String newVMNumber) { if (newVMNumber == null) { newVMNumber = ""; } //throw a warning if they are the same. if (newVMNumber.equals(mOldVmNumber)) { showVMDialog(MSG_VM_NOCHANGE); return; } maybeSaveNumberForVoicemailProvider(newVMNumber); // otherwise, set it. if (DBG) log("save voicemail #: " + newVMNumber); mPhone.setVoiceMailNumber( mPhone.getVoiceMailAlphaTag().toString(), newVMNumber, Message.obtain(mSetOptionComplete, EVENT_VOICEMAIL_CHANGED)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void reset() \n {\n try \n {\n // your code here\n \tSystem.out.println(\"Resetting virtual machine '\"+vm.getName() +\"'. Please wait...\"); \n \tTask t=vm.resetVM_Task();\n \tif(t.waitForTask()== Task.SUCCESS)\n \t{\n\t \tSystem.out.prin...
[ "0.6443147", "0.6095936", "0.5988009", "0.5973977", "0.5949394", "0.59255403", "0.5869492", "0.57979125", "0.5789847", "0.5789847", "0.5776848", "0.576536", "0.57388973", "0.5731268", "0.572747", "0.5702631", "0.5702631", "0.5698457", "0.56928796", "0.5689316", "0.5661857", ...
0.0
-1
query to make sure we're looking at the same data as that in the network.
@Override public void handleMessage(Message msg) { switch (msg.what) { case EVENT_VOICEMAIL_CHANGED: handleSetVMMessage((AsyncResult) msg.obj); break; default: // TODO: should never reach this, may want to throw exception } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isRankConsistent() {\r\n for (int i = 0; i < size(); i++)\r\n if (i != rank(select(i))) return false;\r\n for (Key key : keys())\r\n if (key.compareTo(select(rank(key))) != 0) return false;\r\n return true;\r\n }", "private boolean isRankConsistent() ...
[ "0.58550686", "0.57427925", "0.5589511", "0.5440948", "0.5331951", "0.532759", "0.52875626", "0.5286719", "0.52857333", "0.52843267", "0.5251215", "0.52496535", "0.52195156", "0.5201471", "0.51554626", "0.5139445", "0.5137111", "0.5135772", "0.51324385", "0.5124856", "0.51099...
0.0
-1
/ Methods used to sync UI state with that of the network update the voicemail number from what we've recorded on the sim.
private void updateVoiceNumberField() { if (mSubMenuVoicemailSettings == null) { return; } mOldVmNumber = mPhone.getVoiceMailNumber(); if (mOldVmNumber == null) { mOldVmNumber = ""; } mSubMenuVoicemailSettings.setPhoneNumber(mOldVmNumber); final String summary = (mOldVmNumber.length() > 0) ? mOldVmNumber : getString(R.string.voicemail_number_not_set); mSubMenuVoicemailSettings.setSummary(summary); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateGUIStatus() {\r\n\r\n }", "private void updateUI() {\n\t\t\tfinal TextView MessageVitesse = (TextView) findViewById(R.id.TextView01);\r\n\t\t\tfinal ProgressBar Progress = (ProgressBar) findViewById (R.id.ProgressBar01);\r\n\t\t\tfinal TextView MessageStatus = (TextView)findViewById (R.id.T...
[ "0.61092347", "0.60596395", "0.5911005", "0.5827604", "0.57633775", "0.5705396", "0.56983656", "0.5677321", "0.562981", "0.5586728", "0.5572326", "0.55684066", "0.5563913", "0.55203193", "0.55192804", "0.55187005", "0.5515929", "0.551491", "0.5505249", "0.55009204", "0.549694...
0.60928243
1
/ Helper Methods for Activity class. The inital query commands are split into two pieces now for individual expansion. This combined with the ability to cancel queries allows for a much better user experience, and also ensures that the user only waits to update the data that is relevant. dialog creation method, called by showDialog()
@Override protected Dialog onCreateDialog(int id) { if ((id == VM_RESPONSE_ERROR) || (id == VM_NOCHANGE_ERROR) || (id == VOICEMAIL_DIALOG_CONFIRM)) { AlertDialog.Builder b = new AlertDialog.Builder(this); int msgId; int titleId = R.string.error_updating_title; switch (id) { case VOICEMAIL_DIALOG_CONFIRM: msgId = R.string.vm_changed; titleId = R.string.voicemail; // Set Button 2 b.setNegativeButton(R.string.close_dialog, this); break; case VM_NOCHANGE_ERROR: // even though this is technically an error, // keep the title friendly. msgId = R.string.no_change; titleId = R.string.voicemail; // Set Button 2 b.setNegativeButton(R.string.close_dialog, this); break; case VM_RESPONSE_ERROR: msgId = R.string.vm_change_failed; // Set Button 1 b.setPositiveButton(R.string.close_dialog, this); break; default: msgId = R.string.exception_error; // Set Button 3, tells the activity that the error is // not recoverable on dialog exit. b.setNeutralButton(R.string.close_dialog, this); break; } b.setTitle(getText(titleId)); b.setMessage(getText(msgId)); b.setCancelable(false); AlertDialog dialog = b.create(); // make the dialog more obvious by bluring the background. dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); return dialog; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tthis.setContentView(R.layout.advance);\r\n\t\t\r\n\t\tButton cbtn = (Button) this.findViewById(R.id.cbtn);\r\n\t\t\r\n\t\tcbtn.setOnClickListener(new OnClickListener()\r\n\t\t{\r\n\r\n\t\t\t@Override...
[ "0.6272307", "0.625159", "0.6102075", "0.60557747", "0.60494554", "0.5961905", "0.5856076", "0.5767524", "0.571736", "0.56763095", "0.5660644", "0.56534606", "0.56494266", "0.5623371", "0.5620557", "0.5609118", "0.55849874", "0.5556062", "0.55546784", "0.5539842", "0.5535989"...
0.0
-1
This is a method implemented for DialogInterface.OnClickListener. Used with the error dialog to close the app, voicemail dialog to just dismiss. Close button is mapped to BUTTON1 for the errors that close the activity, while those that are mapped to 3 only move the preference focus.
public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); switch (which){ case DialogInterface.BUTTON3: // Neutral Button, used when we want to cancel expansion. break; case DialogInterface.BUTTON1: // Negative Button finish(); break; default: // If we were called to explicitly configure voice mail then finish here if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) { finish(); } // just let the dialog close and go back to the input // ready state // Positive Button } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tint which) {\n\t\t\t\t\t\t\t\t\tdialog.dismiss();\n...
[ "0.723786", "0.7227067", "0.7227067", "0.7211596", "0.7211596", "0.72064036", "0.7200973", "0.71912414", "0.71894133", "0.71894133", "0.7186947", "0.71841884", "0.71841884", "0.71841884", "0.71841884", "0.71819156", "0.7177933", "0.7177474", "0.71719533", "0.7161142", "0.7158...
0.0
-1
set the app state with optional status.
private void showVMDialog(int msgStatus) { switch (msgStatus) { case MSG_VM_EXCEPTION: showDialog(VM_RESPONSE_ERROR); break; case MSG_VM_NOCHANGE: showDialog(VM_NOCHANGE_ERROR); break; case MSG_VM_OK: showDialog(VOICEMAIL_DIALOG_CONFIRM); break; case MSG_OK: default: // This should never happen. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean setApplicationStatus(ApplicationBean application) throws UASException;", "@Override\n\tpublic void setStatus(int status) {\n\t\t_scienceApp.setStatus(status);\n\t}", "void setStatus(STATUS status);", "public void setStatus(boolean newstatus){activestatus = newstatus;}", "public void setStatu...
[ "0.65898377", "0.65872544", "0.632883", "0.6223362", "0.62156266", "0.6207264", "0.6207264", "0.6201945", "0.6169786", "0.614727", "0.6140088", "0.61056435", "0.61056435", "0.6102242", "0.6093718", "0.6093101", "0.6093101", "0.6084834", "0.6084772", "0.6074503", "0.60583216",...
0.0
-1
/ Activity class methods
@Override protected void onCreate(Bundle icicle) { super.onCreate(icicle); mPhone = PhoneFactory.getDefaultPhone(); addPreferencesFromResource(R.xml.call_feature_setting); mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); // get buttons PreferenceScreen prefSet = getPreferenceScreen(); mSubMenuVoicemailSettings = (EditPhoneNumberPreference)findPreference(BUTTON_VOICEMAIL_KEY); if (mSubMenuVoicemailSettings != null) { mSubMenuVoicemailSettings.setParentActivity(this, VOICEMAIL_PREF_ID, this); mSubMenuVoicemailSettings.setDialogOnClosedListener(this); mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label); } mButtonDTMF = (ListPreference) findPreference(BUTTON_DTMF_KEY); mButtonAutoRetry = (CheckBoxPreference) findPreference(BUTTON_RETRY_KEY); mButtonHAC = (CheckBoxPreference) findPreference(BUTTON_HAC_KEY); mButtonTTY = (ListPreference) findPreference(BUTTON_TTY_KEY); mVoicemailProviders = (ListPreference) findPreference(BUTTON_VOICEMAIL_PROVIDER_KEY); if (mVoicemailProviders != null) { mVoicemailProviders.setOnPreferenceChangeListener(this); mVoicemailSettings = (PreferenceScreen)findPreference(BUTTON_VOICEMAIL_SETTING_KEY); initVoiceMailProviders(); } if (getResources().getBoolean(R.bool.dtmf_type_enabled)) { mButtonDTMF.setOnPreferenceChangeListener(this); } else { prefSet.removePreference(mButtonDTMF); mButtonDTMF = null; } if (getResources().getBoolean(R.bool.auto_retry_enabled)) { mButtonAutoRetry.setOnPreferenceChangeListener(this); } else { prefSet.removePreference(mButtonAutoRetry); mButtonAutoRetry = null; } if (getResources().getBoolean(R.bool.hac_enabled)) { mButtonHAC.setOnPreferenceChangeListener(this); } else { prefSet.removePreference(mButtonHAC); mButtonHAC = null; } if (getResources().getBoolean(R.bool.tty_enabled)) { mButtonTTY.setOnPreferenceChangeListener(this); ttyHandler = new TTYHandler(); } else { prefSet.removePreference(mButtonTTY); mButtonTTY = null; } if (!getResources().getBoolean(R.bool.world_phone)) { prefSet.removePreference(prefSet.findPreference(BUTTON_CDMA_OPTIONS)); prefSet.removePreference(prefSet.findPreference(BUTTON_GSM_UMTS_OPTIONS)); if (mPhone.getPhoneName().equals("CDMA")) { prefSet.removePreference(prefSet.findPreference(BUTTON_FDN_KEY)); addPreferencesFromResource(R.xml.cdma_call_options); } else { addPreferencesFromResource(R.xml.gsm_umts_call_options); } } // create intent to bring up contact list mContactListIntent = new Intent(Intent.ACTION_GET_CONTENT); mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE); // check the intent that started this activity and pop up the voicemail // dialog if we've been asked to. // If we have at least one non default VM provider registered then bring up // the selection for the VM provider, otherwise bring up a VM number dialog. // We only bring up the dialog the first time we are called (not after orientation change) if (icicle == null) { if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL) && mVoicemailProviders != null) { if (mVMProvidersData.size() > 1) { simulatePreferenceClick(mVoicemailProviders); } else { mSubMenuVoicemailSettings.showPhoneNumberDialog(); } } } updateVoiceNumberField(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void openActivity() {\n }", "@Override\n\tpublic void starctActivity(Context context) {\n\t\t\n\t}", "@Override\n\tpublic void starctActivity(Context context) {\n\n\t}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}", "@Override\n public void onActivityCreated...
[ "0.7188008", "0.71591485", "0.7046226", "0.69698983", "0.6943855", "0.69095016", "0.6723075", "0.6722393", "0.6673645", "0.66259915", "0.66215897", "0.65929407", "0.64851135", "0.6460059", "0.6400533", "0.63749844", "0.6373116", "0.6356219", "0.63501775", "0.63458776", "0.632...
0.0
-1
Updates the look of the VM preference widgets based on current VM provider settings. Note that the provider name is loaded form the found activity via loadLabel in initVoiceMailProviders in order for it to be localizable.
private void updateVMPreferenceWidgets(String currentProviderSetting) { final String key = currentProviderSetting; final VoiceMailProvider provider = mVMProvidersData.get(key); /* This is the case when we are coming up on a freshly wiped phone and there is no persisted value for the list preference mVoicemailProviders. In this case we want to show the UI asking the user to select a voicemail provider as opposed to silently falling back to default one. */ if (provider == null) { mVoicemailProviders.setSummary(getString(R.string.sum_voicemail_choose_provider)); mVoicemailSettings.setSummary(""); mVoicemailSettings.setEnabled(false); mVoicemailSettings.setIntent(null); } else { final String providerName = provider.name; mVoicemailProviders.setSummary(providerName); mVoicemailSettings.setSummary(getApplicationContext().getString( R.string.voicemail_settings_for, providerName)); mVoicemailSettings.setEnabled(true); mVoicemailSettings.setIntent(provider.intent); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initVoiceMailProviders() {\n String providerToIgnore = null;\n if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {\n providerToIgnore = getIntent().getStringExtra(IGNORE_PROVIDER_EXTRA);\n }\n \n mVMProvidersData.clear();\n \n // Stick the de...
[ "0.6219001", "0.5614852", "0.5239478", "0.5096269", "0.4977755", "0.49659532", "0.49597114", "0.4955132", "0.49345115", "0.49217203", "0.4898295", "0.4879353", "0.4867325", "0.48598337", "0.48460418", "0.48057404", "0.47762764", "0.4773439", "0.47683054", "0.47617817", "0.474...
0.7577832
0
Enumerates existing VM providers and puts their data into the list and populates the preference list objects with their names. In case we are called with ACTION_ADD_VOICEMAIL intent the intent may have an extra string called IGNORE_PROVIDER_EXTRA with "package.activityName" of the provider which should be hidden when we bring up the list of possible VM providers to choose. This allows a provider which is being disabled (e.g. GV user logging out) to force the user to pick some other provider.
private void initVoiceMailProviders() { String providerToIgnore = null; if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) { providerToIgnore = getIntent().getStringExtra(IGNORE_PROVIDER_EXTRA); } mVMProvidersData.clear(); // Stick the default element which is always there final String myCarrier = getString(R.string.voicemail_default); mVMProvidersData.put("", new VoiceMailProvider(myCarrier, null)); // Enumerate providers PackageManager pm = getPackageManager(); Intent intent = new Intent(); intent.setAction(ACTION_CONFIGURE_VOICEMAIL); List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, 0); int len = resolveInfos.size() + 1; // +1 for the default choice we will insert. // Go through the list of discovered providers populating the data map // skip the provider we were instructed to ignore if there was one for (int i = 0; i < resolveInfos.size(); i++) { final ResolveInfo ri= resolveInfos.get(i); final ActivityInfo currentActivityInfo = ri.activityInfo; final String key = makeKeyForActivity(currentActivityInfo); if (key.equals(providerToIgnore)) { len--; continue; } final String nameForDisplay = ri.loadLabel(pm).toString(); Intent providerIntent = new Intent(); providerIntent.setAction(ACTION_CONFIGURE_VOICEMAIL); providerIntent.setClassName(currentActivityInfo.packageName, currentActivityInfo.name); mVMProvidersData.put( key, new VoiceMailProvider(nameForDisplay, providerIntent)); } // Now we know which providers to display - create entries and values array for // the list preference String [] entries = new String [len]; String [] values = new String [len]; entries[0] = myCarrier; values[0] = ""; int entryIdx = 1; for (int i = 0; i < resolveInfos.size(); i++) { final String key = makeKeyForActivity(resolveInfos.get(i).activityInfo); if (!mVMProvidersData.containsKey(key)) { continue; } entries[entryIdx] = mVMProvidersData.get(key).name; values[entryIdx] = key; entryIdx++; } mVoicemailProviders.setEntries(entries); mVoicemailProviders.setEntryValues(values); updateVMPreferenceWidgets(mVoicemailProviders.getValue()); mPerProviderSavedVMNumbers = this.getApplicationContext().getSharedPreferences( VM_NUMBERS_SHARED_PREFERENCES_NAME, MODE_PRIVATE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void populateProviderList()\n {\n synchronized(activeProvidersByName) {\n if(ModuleManager.getInstance() != null) {\n List<ModuleURN> providerUrns = ModuleManager.getInstance().getProviders();\n for(ModuleURN providerUrn : providerUrns) {\n ...
[ "0.63908386", "0.58927584", "0.5664489", "0.5516027", "0.5413342", "0.53188634", "0.52967906", "0.5287292", "0.5267376", "0.52613103", "0.5244314", "0.523932", "0.52323735", "0.52323735", "0.52323735", "0.52323735", "0.52323735", "0.52277637", "0.52262145", "0.52200514", "0.5...
0.7384767
0
Simulates user clicking on a passed preference. Usually needed when the preference is a dialog preference and we want to invoke a dialog for this preference programmatically. TODO(iliat): figure out if there is a cleaner way to cause preference dlg to come up
private void simulatePreferenceClick(Preference preference) { // Go through settings until we find our setting // and then simulate a click on it to bring up the dialog final ListAdapter adapter = getPreferenceScreen().getRootAdapter(); for (int idx = 0; idx < adapter.getCount(); idx++) { if (adapter.getItem(idx) == preference) { getPreferenceScreen().onItemClick(this.getListView(), null, idx, adapter.getItemId(idx)); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean onPreferenceClick(Preference preference) {\n \t \n \t Dialog dialog = onCreateDialogSingleChoice();\n \t dialog.show();\n \t \n \t \n\t\t\t\t\t\treturn true;\n \n ...
[ "0.74704564", "0.7013847", "0.68250895", "0.6730628", "0.6663854", "0.66384995", "0.6508442", "0.62585044", "0.6256941", "0.6222588", "0.618622", "0.6131373", "0.61091465", "0.6106653", "0.60845196", "0.6077613", "0.60126495", "0.60025257", "0.5978553", "0.5977848", "0.597140...
0.79720795
0
Saves the new VM number associating it with the currently selected provider if the number is different than the one already stored for this provider. Later on this number will be used when the user switches a provider.
private void maybeSaveNumberForVoicemailProvider(String newVMNumber) { if (mVoicemailProviders == null) { return; } final String key = mVoicemailProviders.getValue(); final String curNumber = loadNumberForVoiceMailProvider(key); if (newVMNumber.equals(curNumber)) { return; } mPerProviderSavedVMNumbers.edit().putString(key, newVMNumber).commit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveVoiceMailNumber(String newVMNumber) {\n if (newVMNumber == null) {\n newVMNumber = \"\";\n }\n \n //throw a warning if they are the same.\n if (newVMNumber.equals(mOldVmNumber)) {\n showVMDialog(MSG_VM_NOCHANGE);\n return;\n ...
[ "0.6300408", "0.55279887", "0.5378244", "0.5372128", "0.5350751", "0.5339868", "0.5265347", "0.5225953", "0.52020407", "0.5191017", "0.5094371", "0.50806284", "0.5049786", "0.50274765", "0.49878597", "0.49820295", "0.4980197", "0.49743098", "0.49447334", "0.49339902", "0.4930...
0.808057
0
Returns a voice mail number previously stored for the currently selected voice mail provider. If none is stored returns null. If the user switches to a voice mail provider and we have a number stored for it we will automatically change the phone's voice mail number to the stored one. Otherwise we will bring up provider's config UI.
private String loadNumberForVoiceMailProvider(String key) { return mPerProviderSavedVMNumbers.getString(key, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String onGetDefaultNumber(EditPhoneNumberPreference preference) {\n if (preference == mSubMenuVoicemailSettings) {\n // update the voicemail number field, which takes care of the\n // mSubMenuVoicemailSettings itself, so we should return null.\n if (DBG) log(\"upd...
[ "0.6959151", "0.6137913", "0.609555", "0.607137", "0.6002048", "0.58632207", "0.5845116", "0.58093375", "0.57443297", "0.56458795", "0.5620884", "0.55841404", "0.55841404", "0.5579339", "0.55652416", "0.5563517", "0.553125", "0.5529915", "0.55246454", "0.54857695", "0.5452192...
0.69835335
0
finally block always executes in this block you should manage resources for example, close file or close http connection
public static int doSomething() { try { return 1; } catch (Exception e) { return 2; } finally { // never use return in finally block // method will always return 9 return 9; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void closeResourceInFinally() {\n FileInputStream inputStream = null;\n try {\n File file = new File(\"./tmp.txt\");\n inputStream = new FileInputStream(file);\n\n // use the inputStream to read a file\n\n } catch (FileNotFoundException e) {\n ...
[ "0.75181", "0.75170225", "0.74526745", "0.7433636", "0.7332739", "0.7262743", "0.7242504", "0.71888924", "0.7168373", "0.7157413", "0.7128367", "0.7068818", "0.7057202", "0.7047404", "0.7008907", "0.69987243", "0.6986849", "0.6979665", "0.6946594", "0.6941065", "0.6937923", ...
0.0
-1
Create custom dialog object
@Override public void onClick(View arg0) { final Dialog dialog = new Dialog(SpinnerAcitivity.this); // Include dialog.xml file dialog.setContentView(R.layout.dialog); // Set dialog title //dialog.setTitle("Custom Dialog"); // set values for custom dialog components - text, image and button TextView text = (TextView) dialog.findViewById(R.id.textDialog); // text.setText("Thank you for yor response!"); ImageView image = (ImageView) dialog.findViewById(R.id.imageDialog); // image.setImageResource(R.drawable.icon); dialog.show(); Button declineButton = (Button) dialog.findViewById(R.id.declineButton); // if decline button is clicked, close the custom dialog declineButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // Close dialog dialog.dismiss(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Dialog createDialog(DialogDescriptor descriptor);", "protected abstract JDialog createDialog();", "public Dialog<String> createDialog() {\n\t\t// Creating a dialog\n\t\tDialog<String> dialog = new Dialog<String>();\n\n\t\tButtonType type = new ButtonType(\"Ok\", ButtonData.OK_DONE);\n\t\tdialog...
[ "0.82134604", "0.7788263", "0.7758855", "0.7721132", "0.732142", "0.73060775", "0.7247635", "0.71571946", "0.7095091", "0.7044119", "0.70069313", "0.69929796", "0.6951587", "0.6950426", "0.6914303", "0.6881337", "0.6860331", "0.68313944", "0.68199784", "0.6818976", "0.6813182...
0.0
-1
Performing action onItemSelected and onNothing selected
@Override public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long id) { Toast.makeText(getApplicationContext(),country[position] , Toast.LENGTH_LONG).show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onItemSelected();", "void onItemSelected();", "public void onItemSelected(int id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", ...
[ "0.8546972", "0.8546972", "0.818427", "0.8079545", "0.8079545", "0.8079545", "0.8079545", "0.8079545", "0.80601186", "0.80189794", "0.7992259", "0.79391134", "0.79391134", "0.79265434", "0.79078954", "0.79078954", "0.79022163", "0.7901009", "0.7901009", "0.78792834", "0.78689...
0.0
-1
TODO Autogenerated method stub
@Override public void onNothingSelected(AdapterView<?> arg0) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
This method helps user to track their order User can only track their own order
TrackingOrderDetails trackingOrderDetails(String username, int order_id, String role);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void acceptOrder() {\n buttonAcceptOrder.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n order.setDriver(ParseUser.getCurrentUser());\n order.saveInBackground();\n Log.i(TAG, \"driver!...
[ "0.6356461", "0.61161155", "0.60171366", "0.59470975", "0.5912857", "0.58886456", "0.58674693", "0.5833084", "0.5811288", "0.5811288", "0.5811288", "0.5750376", "0.5748684", "0.57470065", "0.5739097", "0.573056", "0.572947", "0.57112354", "0.5618667", "0.5614085", "0.558423",...
0.62320054
1
TODO Autogenerated method stub
@Override public void onReceive(Context context, Intent intent) { mContext = context; if(intent.getAction().equals(serviceRecieved)){ Toast.makeText(logActivity, "BroadCasting Recieved", Toast.LENGTH_LONG).show(); dialogBoxgenerator(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Creates new form Bifurcator
public Bifurcator() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FORM createFORM();", "@RequestMapping(\"/upload\")\n public String formNewGif(Model model) {\n if (!model.containsAttribute(\"gif\")) {\n model.addAttribute(\"gif\", new Gif());\n }\n model.addAttribute(\"categories\", categoryService.findAll());\n model.addAttribute(\"a...
[ "0.63686305", "0.5978615", "0.5778936", "0.5771151", "0.5768073", "0.5751261", "0.57157815", "0.56660813", "0.55858445", "0.5582635", "0.557197", "0.55528057", "0.55403954", "0.5517585", "0.54332304", "0.5419483", "0.5354231", "0.5330386", "0.5309376", "0.5286868", "0.5285607...
0.65506274
0
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.
private void initComponents() { folder = new File(SRC_FOLDER); fileList = folder.listFiles(); jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setText("please enter the tag to filter on:"); jTextField1.setText("[BIOME:ANY_LAND]"); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jButton1.setText("search"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.73185146", "0.7290127", "0.7290127", "0.7290127", "0.7285798", "0.7247533", "0.7214021", "0.720785", "0.71952385", "0.71891224", "0.7184117", "0.7158779", "0.7147133", "0.70921415", "0.70792264", "0.7055538", "0.6986984", "0.6976409", "0.6955238", "0.69525516", "0.69452786...
0.0
-1
TODO Autogenerated method stub
@Override public IColor getColor(String color) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
The Amazon Resource Name (ARN) of the pipeline.
public void setPipelineArn(String pipelineArn) { this.pipelineArn = pipelineArn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getPipelineArn() {\n return this.pipelineArn;\n }", "public String getPipelineExecutionArn() {\n return this.pipelineExecutionArn;\n }", "@Id\n @Output\n public String getArn() {\n return arn;\n }", "public String getArn() {\n return this.arn;\n }",...
[ "0.6983177", "0.62372386", "0.61557615", "0.6141931", "0.6141931", "0.6141931", "0.6141931", "0.60426223", "0.5990907", "0.59689915", "0.55886257", "0.5506444", "0.5446852", "0.5446852", "0.5446852", "0.5346395", "0.5336407", "0.532889", "0.5237029", "0.523352", "0.52294356",...
0.4834039
71