anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
protected void initializeField(FieldEditor pe, PreferencePage page) { if (page instanceof IPropertyChangeListener) { pe.setPropertyChangeListener((IPropertyChangeListener)page); } pe.setPreferenceStore(page.getPreferenceStore()); }
RMF 1/10/2009 Not sure this is at all necessary... but does it hurt? The X10DT PrefUtils did this...
void injectorClassLoader() { //To get the package name String pkgName = context.getPackageName(); //To get the context Context contextImpl = ((ContextWrapper) context).getBaseContext(); //Access to the Activity of the main thread Object activityThread = null; try { activityThread = Reflection.getField(...
Replace the android default class loader
@EventHandler(ignoreCancelled = true) public void onSignChange(SignChangeEvent event) { // Automatically flag players with bypass as posting non-empty signs to skip empty checks boolean empty = !event.getPlayer().hasPermission("sblock.sign.unlogged"); for (int i = 0; i < event.getLines().length; i++) { even...
The event handler for SignChangeEvents. Allows signs to be colored using &codes.
public final boolean isMessageSetted() { return engine.isPropertySetted(Properties.MESSAGE); }
Returns true if the attribute "message" is set.
private Node<Value> get(Node<Value> x, String key, int d) { if (x == null) return null; char c = key.charAt(d); if (c > x.c) return get(x.right, key, d); else if (c < x.c) return get(x.left, key, d); else if (d < key.length()-1) ret...
Helper Functions Precondition: key != null && key != ""
public static String leerFasta(File prueba) { String gen = "", genescogido = null; try { ArrayList<Integer> cabeceras = new ArrayList<>(); int contador = 0; Scanner leerfichero = new Scanner(prueba); while(leerfichero.hasNextLine()){ if (leerfichero.nextLine().startsWith(">")) { cabeceras.add(c...
Elige un gen aleatorio del fichero fasta y lo devuelve.
public String getPosterUrl() { return posterUrl; }
Gets the poster URL address of the movie.
public static String getPid() { String name = ManagementFactory.getRuntimeMXBean().getName(); // get pid return name.split("@")[0]; }
get name representing the running Java virtual machine.
public void loadKeyboard() { keysInUse = keyList.size(); partial = keysInUse % (KEYS.length - 2); totalScreens = keysInUse / (KEYS.length - 2); if (partial != 0) { totalScreens++; } int visibleKeys; if (keysInUse > KEYS.length) { visibleKe...
There are 35 key buttons available (KEYS.length), but the language may need a smaller amount (Start.keysArraySize) Starting with k = 1 to skip the header row
public void equip(Hero h) { for(Weapon w : h.getInventory().getWeaponList()) { if(w.getName().equals(this.getName())) { w.setEquipped(true); w.statsIncrease(h, StatType.STRENGTH, getWeaponDmg()); } else { w.unequip(h); } } }
/ Function to equip weapon for hero
public void setPosition(int row, int col) { this.row = row; this.col = col; }
setPosition public void setPosition (int row, int col) Sets the position on the board that this object is present in.
public entities.Torrent.RegistrationResponse getRegistrationResponse() { if (registrationResponseBuilder_ == null) { return registrationResponse_ == null ? entities.Torrent.RegistrationResponse.getDefaultInstance() : registrationResponse_; } else { ...
.RegistrationResponse registrationResponse = 15;
public static short getBytesAsShort(byte[] b) { int i = (b[0] & 0xFF << 8) | (b[1] & 0xFF); return (short) i; }
Returns a short from a given byte array.
public String comunicarServidor(String[][] parametros) { String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; xmlString += "<" + parametros[0][0] + " id=\"" + parametros[0][1] + "\">"; for (int i = 1; i < parametros.length; i++) { xmlString += "<" + parametros[i][0] + ">" + parametros[i][1] +...
Recebe a string bidireccional com varios parametros e reencaminhaos para o servidor
public Map<Integer, Item> getAllItems() { return hashOperations.entries(KEY); }
/ Getting all Items from tSable
public String toJsonMetric() { StringBuilder builder = new StringBuilder("{\"messageType\" : \"view\""); builder.append(",\"nodes\" : ["); int i = 0; for (Node node : getAllNodes().values()) { if (++i != 1) builder.append(","); builder.append("{"); bui...
need to remove this json construction using a library call
public static String footerStatus(Connection conn,String kix,String type) { String footerStatus = ""; try{ if(type.equals("ARC")){ footerStatus = "Archived on " + getFndItem(conn,kix,"dateapproved"); } else if(type.equals("CUR")){ footerStatus = "Approved on " + getFndItem(conn,kix,"dateapproved"...
returns true if the String argument is empty
Long getUserId();
This method was generated by MyBatis Generator. This method returns the value of the database column cart.user_id
@Test public void testIsApellido_Paterno() { System.out.println("isApellido_Paterno"); String AP = "ulfric"; Entradas instance = new Entradas(); boolean expResult = false; boolean result = instance.isApellido_Paterno(AP); assertEquals(expResult, result); // TO...
Test of isApellido_Paterno method, of class Entradas.
public entities.Torrent.FileInfo.Builder addFileInfoBuilder() { return getFileInfoFieldBuilder().addBuilder( entities.Torrent.FileInfo.getDefaultInstance()); }
repeated .FileInfo fileInfo = 3;
public static void main(String[] args){ ThrowsKeyword obj = new ThrowsKeyword(); obj.sum(); System.out.println("ABC"); }
throws key word will terminate the program as we are not handling the exception to overcome this we need to add a trycatch block using throws key word we won't report anything no option But in try catch block, we can report with the help of catch block where we can print the error message.
@Schema(required = true, description = "An identifier with the intention of being globally unique. ") public String getId() { return id; }
An identifier with the intention of being globally unique.
Image createImage();
Returns a new object of class 'Image'.
public void setSexo(String sexo) { this.sexo = sexo; }
This method was generated by Apache iBATIS ibator. This method sets the value of the database column cementerio.persona.sexo
public void Login()throws Exception{ if(eMailField.getText().equals("user") && PasswordField.getText().equals("pass")){ displayMainMenu(); } else{ System.out.println("Username or Password Does not match"); } }
Actually Check user Creditentials if so opens main menu.
@Bean @Qualifier("batch-operations") @SuppressWarnings("SpringJavaAutowiringInspection") public SqlSession myBatisBatchOperationsSession(DataSource dataSource) throws Exception { SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean(); sqlSessionFactoryBean.setDataSource(d...
/ NOTE: Unfortunately, in MyBatis it's not possible to execute batch and nonbatch operations in single SqlSession. To support this scenario, we have to create completely new SqlSessionFactoryBean and completely new SqlSession. Surprisingly, this does not necessarily mean that the batch and nonbatch operations will be e...
public GallerySwitchPreference(Context context, AttributeSet attrs) { super(context, attrs); mResources = context.getResources(); }
Construct a new SwitchPreference with the given style options.
public liubaninc.m0.pki.CertificateOuterClass.Certificate.Builder addCertificateBuilder() { return getCertificateFieldBuilder().addBuilder( liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance()); }
repeated .liubaninc.m0.pki.Certificate Certificate = 1;
@Test //checks for state switching (on/off) void SwitchStates() { Assertions.assertFalse(machine.isTurnedOn()); //then, switch on and check if on machine.setTurnedOn(true); Assertions.assertTrue(machine.isTurnedOn()); //switch off to see if turned off correctly ...
by default machine is off
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.salir: finish(); return true; default: return super.onOptionsItemSelected(item); } }
Take appropriate action for each action item click
public UpgradeData(int c) { super(); JLabel l; // GridLayout grid; JPanel pan; JButton val; confignb = c; String fichier; NumberFormatter formatter = new NumberFormatter(new DecimalFormat("0")); formatter.setAllowsInvalid(false); try { sz_rss = new JFormattedTextField((NumberForm...
Creates a new instance of UpgradeData
IDAOSession createNewSession();
creates a new hibernate session and transaction.
@Override public int cantAlumnos(String curso) throws Exception { Connection c = null; PreparedStatement pstmt = null; ResultSet rs = null; int cantAlumnos = 0; try { c = DBUtils.getConnection(); pstmt = c.prepareStatement("select count(a.id) as cant f...
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
private void showSendSMSActivity() { Uri uri = getIntent().getData(); if (uri == null) { return; } // get phone number where to send the SMS String ssp = uri.getSchemeSpecificPart(); String number = ContactsAccessHelper.normalizePhoneNumber(ssp); if (...
Shows the activity of SMS sending
public void reportStats() { System.out.println("Number of requests: " + (requestCount - warmUpRequests)); System.out.println("Number of hits: " + hitCount); System.out.println("hit ratio: " + (double) hitCount / (requestCount - warmUpRequests)); System.out.println("Average hit cost: " + (double) hitCost...
DO NOT MODIFY THIS METHOD Prints the total number of requests and the number of requests that resulted in a cache hit.
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { int year; int month; int day; if (!this.getArguments().containsKey("date")) { final Calendar c = Calendar.getInstance(); year = c.get(Calendar.YEAR); month = c.get(Calendar.MONTH); day = c.get(Calendar.DAY_OF_MONTH); } else { ...
Use the current date as the default date in the picker
private FieldSumMap(com.shopee.protocol.ads.action.FieldSumMap.Builder r17) { /* r16 = this; r0 = r17 java.lang.Long r2 = r0.impression java.lang.Long r3 = r0.click java.lang.Long r4 = r0.order java.lang.Long r5 = r0.order_amount ...
/ JADX WARNING: Illegal instructions before constructor call / Code decompiled incorrectly, please refer to instructions dump.
public float max3DZ() { return Math.max(stop3D.z, start3D.z); }
The max Z value of the 2D point projected to 3D
public void update(){ addNotificaciones(nombre + " " + this.sucursal.descuento()); mostrarNotificaciones(); notificaciones.clear(); }
Metodo update del patron Observer, actualiza las notificaciones
FData createFData();
Returns a new object of class 'FData'.
public static void removeAllNumbersGreaterThan10(Set<Integer> set) { Iterator<Integer> iterator = set.iterator(); while (iterator.hasNext()) { Integer integer = iterator.next(); if (integer.intValue() > 10) { iterator.remove(); } } }
write your code here
@Inject public AppControllerImpl(PlaceController placeController, EventBus eventBus, PlaceHistoryHandler placeHistoryHandler, AppLayout appLayout, ActivityManagerInitializer activityManagerInitializer) { this.placeController = placeController; this.placeHistoryHandler = placeHistoryHandler; this.appPanelView = a...
All parameters are injected by GIN
@Override public Set<RepairKit> getRepairKits(Board board) { return board.getElements(RepairKit.class); }
Return a set containing all repair kits on board.
public int[] getDamage(){ return shipDamage; }
Takes no arguments and returns an array containing the states of each block of the ship
public SingleUploader() { this(null); }
If no status gadget is provided, it uses a basic one.
public Long getTwomerchant() { return twomerchant; }
This method was generated by MyBatis Generator. This method returns the value of the database column t_mp_num.twoMerchant
@SuppressWarnings("unchecked") protected Map<String, List<PageViewVO>> processUserFavorites(ModuleVO mod) throws ActionException { log.debug("processUserFavorites..."); Map<String, List<PageViewVO>> pageMap = initializePageMap(); if (mod.getErrorCondition()) return pageMap; List<FavoriteVO> favs = (List<F...
Parses a user's favorites into a map of page views keyed by section (e.g. MARKET, COMPANY, etc.).
String title();
The title property is a short plain text description of the RESTful API. The value SHOULD be suitable for use as a title for the contained user documentation.
entities.Torrent.DownloadRequestOrBuilder getDownloadRequestOrBuilder();
.DownloadRequest downloadRequest = 12;
@Override public void onClick(View v) { }
TODO Autogenerated method stub
private TextView getTextView(String content) { TextView textView = new TextView(this.getContext()); textView.setEms(30); textView.setTextColor(getResources().getColor(R.color.ldstools_black)); if(content != null && !content.isEmpty()) { textView.setText(content); } ...
/ Generic TextView creation.
public final void mo3957e() { this.f1313w = true; }
/ renamed from: e
@Override public void onError(DialogError e) { }
No special processing if dialog has been canceled
void deleteUser(int id) throws DataAccessException;
Deletes a User from the data store.
public boolean equals(Object object) { /* 326 */ if (object == null) { /* 327 */ return false; /* */ } /* 329 */ if (object == this) { /* 330 */ return true; /* */ } /* 332 */ if (object instanceof DefaultTimeline) { /* 333 */ return true; /* */...
/ / / / / / / / / / /
public ReceivingSpace planToRemoveGoodsListWithGoodsAllocation(ReceivingSpace receivingSpace, String goodsAllocationId, Map<String,Object> options)throws Exception;
disconnect ReceivingSpace with goods_allocation in Goods
public static String function_2(String question) { //int first_par = 0; //int second_par = question.indexOf(")"); //int third_par = question.indexOf("(", second_par); String function_2 = question.substring(find_par(2,question)+1,find_par(3,question)); return function_2; }
/// returns the trig function of the equation purely for walk through
public Buyer(String username, String password, String firstName, String lastName, String emailAddress, String phoneNumber) { super(username, password, firstName, lastName, emailAddress, phoneNumber); this.role = 1; credit = 10000; ProgramManager.getProgramManagerInstance().addAccountToLi...
The HashMap is productId to count
public M csmiPlaceNull(){if(this.get("csmiPlaceNot")==null)this.put("csmiPlaceNot", "");this.put("csmiPlace", null);return this;}
and csmi_place is null
long getConsumedWorkUnits();
Returns the total number of consumed work units by the engine instance at hand since the engine's last deployment.
@Test void processListOfPlates() throws Exception { String request = "[" + "{\"name\": \"Ensalada\", \"ingredients\": [" + createIngredient("Calabaza", 100) + "," + createIngredient("Cebolla", 70) + "]}," + "{\"name\": \"Hamburguesa\", \"ingredients\": [" + createIngredient...
d) Optional: Generar endpoint para recibir un listo de platos y devolver el listado procesado.
private void setExpires(long value) { bitField0_ |= 0x00000004; expires_ = value; }
Timestamp; when this request should be considered invalid optional uint64 expires = 4;
Car readCar(String plateNo) throws CarNotFoundException;
Read a single car based on the plate number.
void visitComment(MappedElementKind targetKind, String comment);
Comment for the specified element (last contentvisited or any parent).
@java.lang.Override public boolean hasFdset() { return fdset_ != null; }
The file descriptor set used to generate this result. .google.protobuf.FileDescriptorSet fdset = 5 [json_name = "fdset"];
public void displayInput() { scan = new Scanner(System.in); boolean exit = false; while (!exit) { System.out.println("\n1.Display Product"); System.out.println("2.Buy Product"); System.out.println("3.Cart"); System.out.println("4.Exit"); System.out.println("Enter Your Choice:-"); choice = getVal...
Display the main menu
public void onClick(DialogInterface dialog, int id) { }
User cancelled the dialog
@Override public void update(int n, int n2) { void mouseY; void mouseX; super.update((int)mouseX, (int)mouseY); float[] hsb = Color.RGBtoHSB(this.setting.getValue().getRed(), this.setting.getValue().getGreen(), this.setting.getValue().getBlue(), null); double difference = Mat...
/ WARNING void declaration
String getVersion();
Returns the value of the 'Version' attribute. If the meaning of the 'Version' attribute isn't clear, there really should be more of a description here...
default void listServices( com.google.cloud.servicedirectory.v1beta1.ListServicesRequest request, io.grpc.stub.StreamObserver<com.google.cloud.servicedirectory.v1beta1.ListServicesResponse> responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( getListServi...
Lists all services belonging to a namespace.
public NuxeoConnector getNuxeoInstance() { if(this.nuxeoConnector==null) { nuxeoConnector = new NuxeoConnector(); } return this.nuxeoConnector; }
Only creates one NuxeoConnector instance and returns it.
public int lengthOfLongestSubstring(String s) { int l=s.length(),len=0,r=0; HashMap<Character,Integer> h=new HashMap<Character,Integer>(); for(int i=0;i<l;) { char c=s.charAt(i); if(h.containsKey(c)) { i=h.get(c)+1; // we should restart and clear the hash...
Start typing your Java solution below DO NOT write main() function
public double getTotalCellularityPercentage() { return totalCellularityPercentage; }
Returns the total cellularity percentage.
@Test public void testPlayer_getBoldStrategyCard_numeric_colorBeatsNumber() { player2 = new Player("Player Two", true); player2.setHand(strategyHand.getAllCards()); // pick a cpc that could return two possible options // and assert that the higher value card comes back ...
tempt algorithm with higher cards (strategy hand has both wild and wd4)
@Test public void testResetAndCanRetry() { assertTrue(rc.attempt()); assertTrue(rc.attempt()); assertTrue(rc.attempt()); rc.reset(); assertTrue(rc.attempt()); assertTrue(rc.attempt()); assertTrue(rc.attempt()); assertFalse(rc.attempt()); asser...
The same RequestContext is used throughout the processing, and retries need to be reset once successfully connected so that any earlier (successful) recoveries are not considered when performing any new future recoveries. This test ensures that a reset clears the retry counter and that we can attempt retries again up t...
@ApiOperation("新增一个会场") @PostMapping("/insertOnePlace") public ResultResponse insertOnePlace(@ApiParam("place对象") @RequestBody VoPlace voPlace){ Object data = null; StringBuilder message = new StringBuilder("新增会场"); try { data = placeService.insertOnePlace(voPlace); }...
System.out.println("voPlace = " + voPlace);
public void setRTLParams() { ViewGroup.LayoutParams layoutParams = this.mSkipView.getLayoutParams(); if (layoutParams instanceof RelativeLayout.LayoutParams) { RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) layoutParams; layoutParams2.removeRule(20); ...
/ access modifiers changed from: packageprivate
public T caseDataType(DataType object) { return null; }
Returns the result of interpreting the object as an instance of 'Data Type'. This implementation returns null; returning a nonnull result will terminate the switch.
public void mo38284b(C7998s sVar) { this.f27044g = sVar; }
/ renamed from: b
public long toTimelineValue(long millisecond) { return millisecond; }
/ / / / / / / 235
public double getZScore(K keyToCheck) { V winRateDataForKey = this.winRateData.get(keyToCheck); double p1 = winRateDataForKey.getWinRate(); double n1 = winRateDataForKey.playedCount; double p2 = (this.totalWinCount - winRateDataForKey.winCount) / (this.totalPlayedCount - winRateDataFor...
Determines a ZScore for the specific key's win rate compared to the overall win rate Test from:
public A mo9868b() { return this.f2527b; }
/ renamed from: b
public Document(String title, CopyOnWriteArrayList<String> docModel, String location, int id) { this.docModel = docModel; this.name = title; this.location = location; this.id = id; /* Starts up command listener for document */ Thread t = new Thread(new Runnable() { @Override public voi...
Constructor that makes document with Document Model docModel and Title title.
static public void extractFromCSVRefFile(String file_path) throws Exception { DataExtractor de = new DataExtractor(); File commitFile = new File(file_path); BufferedReader reader = new BufferedReader(new FileReader(commitFile)); String line = ""; List<String> commit_ids = new ArrayList<String>(); wh...
Main method used to import dataset from CVS files: the file must contain: feature name;commitId; The program then takes each commit and extract the feature oriented changes from it and stores everything into the Neo4J database.
public int getTotalCustomers() { return totalCustomers; }
getTotalCustomers() Gets the total customers and returns.
public static QuadricRobustEstimator create(List<Point3D> points, RobustEstimatorMethod method) { switch (method) { case LMedS: return new LMedSQuadricRobustEstimator(points); case MSAC: return new MSACQuadricRobustEstimator(points); ...
Creates a quadric robust estimator based on 3D point samples and using provided points and robust estimator method.
public Record query(final PlayerType p_type, final int p_queryDate) throws RemoteException { for(int x= 0; x <= 100; x++) { records [x][1] = query(PlayerType.LEADER, x); records [x][2] = query(PlayerType.FOLLOWER, x); } return null; }
this returns the record for a specified day, this method stores all the records in the array
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int num = scanner.nextInt(); int i; int result = 1; for (i = 1; i <= num; i++) { result = result * i; if (i == num) { System.out.println(result); } } }
TODO Autogenerated method stub
public void disablePlayerAttacking(final Player p) { p.sendMessage(ChatColor.GRAY + "You cannot attack for 10 seconds."); final Listener l = new Listener() { @EventHandler public void onPlayerDamage(EntityDamageByEntityEvent e) { if (e.getDamager() instanceof Player && e.getEntity() instanceof Player) { ...
Disables a player from attacking for 10 seconds
static boolean hasArrayTwoCandidates(int A[], int arr_size, int sum) { int l, r; /* Sort the elements */ Arrays.sort(A); /* Now look for the two candidates in the sorted array*/ l = 0; r = arr_size-1; while (l < r) { if(A[l] + A[r] == sum) return true; else if(A[l] + A...
Function to check if array has 2 elements whose sum is equal to the given value
public void removeFramesWithValue(Slot slot, Facet facet, boolean isTemplate) throws SQLException { trace("removeFramesWithValue", slot, facet); String command = "DELETE FROM " + _tableName + " WHERE " + SLOT + "= ? AND " + FACET + "= ? AND " + IS_TEMPLATE + "= ?"; PreparedStatement stmt = _stat...
Log.enter(this, "removeFramesWithValue", slot, facet, new Boolean(isTemplate));
public void purchase(double shares, double pricePerShare) { this.totalShares += shares; super.addCost(shares * pricePerShare); }
records purchase of the given shares at the given price
public Optional<Tag> capturedFrom() { return this.from.get(); }
Get captured `from` argument.
public MasonGeometry getGeometry() {return agentLocation;}
It returns the geometry representing agent location
public void validate_the_Postcode_of_Billing_Address_in_Customer_Tab(String Postcode)throws Exception { VerifyElementPresent(Desktop_XPATH_Verify_Customer_Page_BillingAddress.replaceAll("M_Header", "Billing Address").replaceAll("M_Category", "Postcode").replaceAll("M_InnerText", Postcode), "Postcode of Billing Addres...
Validation Functions Description : To validate the Postcode of Billing Address in Customer Tab Coded by :Raja Created Data:05 Oct 2016 Last Modified Date:05 Oct 2016 Modified By:Raja Parameter:Postcode
public void setUserId(int userId) { this.userId = userId; }
Sets the user id.
private int getRandomMaterialColor(String typeColor) { int returnColor = Color.GRAY; int arrayId = getResources().getIdentifier("mdcolor_" + typeColor, "array", getContext().getPackageName()); if (arrayId != 0) { TypedArray colors = getResources().obtainTypedArray(arrayId); ...
/ Choose a random Color
public Builder clearMemo() { copyOnWrite(); instance.clearMemo(); return this; }
Humanreadable message for the merchant optional string memo = 4;
protected AbstractMetadata(final boolean pStandardFormatSupported, final String pNativeFormatName, final String pNativeFormatClassName, final String[] pExtraFormatNames, final String[] pExtraFormatClassNames) { super(pStandardFormatSupported, pNative...
TODO: Move to core...
interface Literals { /** * The meta object literal for the '{@link com.devoxx2012.xtext.demo1.demo1.impl.ModelImpl <em>Model</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see com.devoxx2012.xtext.demo1.demo1.impl.ModelImpl * @see com.devoxx2012.xtext.demo1.demo1.impl....
Defines literals for the meta objects that represent each class, each feature of each class, each enum, and each data type