anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
public User(){ this(null, null); }
creates new user with null fields
@Test public void testDACKLoadedMessage() throws Exception { final CacheTransactionManager txMgr = getCache().getCacheTransactionManager(); final String rgnName = getUniqueName(); AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK); factory.setEarlyAck(fals...
Test distributed ack transactions that consist only of data from loaded values
public static ArrayList<Integer> union(ArrayList<Integer> list1, ArrayList<Integer> list2) { ArrayList<Integer> union = new ArrayList<>(); //adding elements from first array list to the new array list for (int i = 0; i < list1.size(); i++) { union.add(list1.get(i)); } //adding elements from...
Combining two array list into one
public void setDefaultPricebookAccess(java.lang.String defaultPricebookAccess) { this.defaultPricebookAccess = defaultPricebookAccess; }
Sets the defaultPricebookAccess value for this Organization.
public Packet1Login () { }
private boolean accepted = false;
public Dialog onCreateDialog(Bundle savedInstanceState) { final Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); // Create a new instance of DatePickerDialog and return it Dat...
Use the current date as the default date in the picker
@Override protected String toCloudEventsKey(final String key) { return key.substring(AmqpConstants.CE_PREFIX.length()); }
Gets the cloud event attribute key without the preceding prefix.
private int getIncrement(Value v) { if (v instanceof IntConstant) { return ((IntConstant) v).value; } else { return 0; } }
JimpleLocal local = (JimpleLocal) v;
public void executeFromGui(Player target) { removeTrail(target); }
Invoked from the GUI because it's easier this way
public InaccessibleTile(int x, int y) { super(true, true, true, true, x, y); }
Inaccessible tiles always have all 4 walls since you can't get to them
@Override public boolean getElemento(T elemento) { return false; }
TODO Autogenerated method stub
@JsonIgnore public void setType(URI type) { this.type = type == null ? null : new TypeReference<AlternateIdType>(type); }
The type of the id.
private void initInfo(Map<String, String> _info) { this.jlCPU.setText(_info.get("Model"));// FIXME may be very long name this.jlCores.setText(_info.get("TotalCores")); this.jlVendor.setText(_info.get("Vendor")); this.jlFrequency.setText(_info.get("Mhz") + " MHz"); this.jlRAM.setT...
End of variables declaration//GENEND:variables
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jTabbedPane1 = new javax.swing.JTabbedPane(); jPanel2 = new javax.swing.JPanel(); jLabel1 ...
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.
public synchronized Object read() throws PipeException { if (!connected) { throw new PipeException("Pipe not connected"); } else if (closedByReader) { throw new PipeException("Pipe closed"); } else if (writeSide != null && !writeSide.isAlive() && !closedByWriter && (in < 0)) ...
read Reads the next Object from this piped stream. If no Object is available because the end of the stream has been reached, the value null is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown. If a thread was providing Objects to the connected pipe...
public static void main(String[] args) { int [] a={5,10,90}; int [] b={4,7,9,10}; List <Integer> l1=new ArrayList<>(); l1=mergeSorted(a,b); System.out.println(l1); Map <Integer,Integer> se=new HashMap<>(); se.put(4,6); se.putIfAbsent(4,7); se.put(...
String s=" My name is Sayantika Ghosh "; String reverseString=reverse(s); System.out.println(reverseString);
@Test public void testBlocking() throws Exception { FutureRecordMetadata future = new FutureRecordMetadata(asyncRequest(baseOffset, null, 50L), relOffset, RecordBatch.NO_TIMESTAMP, 0, 0, Time.SYSTEM); assertEquals(baseOffset + relOffset, future.get().offset()); }
Test that an asynchronous request will eventually return the right offset
public void destroy() { }
Remove the filter from service
@GetMapping public List<Recipe> get(HttpSession httpSession){ List<Recipe> recipes = new ArrayList<>(); String username = (String) httpSession.getAttribute("username"); //recipeRepository.findByAcess("PUBLIC").iterator().forEachRemaining(x -> recipes.add(x)); if(username != null){ ...
To Get All the recipes with the username same as the one that is logged in
public Node<E> getPresentNode(E data){ for(Node<E> node: nodes.keySet()){ if(node.data.equals(data)){ return node; } } return null; }
get node based from value
public String getName() { return name; }
Gets the name of this Settlement.
List<Seller> findByDepartment(Department department);
retorna todos os funcionario atraves de uma lista
public VistaCrearPedidoAbonado() { initComponents(); errorLabel.setVisible(false); controlador = new CtrlVistaCrearPedidoAbonado(this); }
Creates new form VistaCrearPedidoAbonado
public static String gmtFormat(String $formatString) { return gmtFormat($formatString, 0); }
Format current time to GMT string presentation.
public void registerAdministrative(String[] fields) throws BadEntryException{ int id = Integer.parseInt(fields[1]); if(_persons.get(id) != null){ throw new BadEntryException(fields[0]); } Administrative _administrative = new Administrative(id, fields[2], fields[3]); _administratives.put(id, ...
Registers the administratives that come from the file that is imported.
public void setleZoom( double valeur) { zoomMonde = valeur; }
Methode qui permet changer l'argrandissement du monde
public static void main(String[] args) { LocalDate localDate = LocalDate.now(); System.out.println("LocalDate: " + localDate); System.out.println(LocalDate.of(2019, 04, 16)); System.out.println(LocalDate.parse("2019-04-16")); //////////////////////////////////////////////////////// LocalDate tomorrow =...
The LocalDate represents a date in ISO format (yyyyMMdd) without time.
public void onSurfaceCreated(GL10 gl, EGLConfig config) { gl.glDisable(GL10.GL_DITHER); /* * Some one-time OpenGL initialization can be made here * probably based on features of this particular context */ gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, ...
/ By default, OpenGL enables features that improve quality but reduce performance. One might want to tweak that especially on software renderer.
private boolean isAuthenticated(@Nonnull final InetAddress address, @Nonnull @NonnullElements final Collection<IPRange> ranges) { final byte[] resolvedAddress = address.getAddress(); for (final IPRange range : ranges) { if (range.contains(resolvedAddress)) { retu...
Checks whether the given IP address meets a set of IP range requirements.
public native void setScrollIndocatorStyle(double value) /*-{ var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()(); jso.scrollIndicatorStyle = value; }-*/;
Style of the scrollbar, specified using one of the constants from Titanium.UI.iPhone.ScrollIndicatorStyle. Default: Titanium.UI.iPhone.ScrollIndicatorStyle.DEFAULT
public PermisosPyS obtenerPermisos(String user) { try { PreparedStatement pstm = null; ResultSet rs = null; String query = "SELECT * FROM permisos WHERE ID_permiso IN (SELECT ID_permisos FROM Roles as r INNER JOIN Usuario as u ON r.ID_Rol = u.ID_Rol WHERE u.username...
Metodo que devuelve los permisos segun el tipo de usuario
@JSONWebService @Transactional(isolation = Isolation.PORTAL, rollbackFor = { PortalException.class, SystemException.class}) public interface VcmsDiscussionService { /* * NOTE FOR DEVELOPERS: * * Never modify or reference this interface directly. Always use {@link VcmsDiscussionServiceUtil} to access the vcms d...
The interface for the vcms discussion remote service. This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
public void fetchTasks() { tasksTotales.clear(); for (String taskId : taskList) { databaseTaskReference.child(taskId).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { ...
todo trabajar aqui para mostrar los elementos en el adapter tasksTotales=new ArrayList();
public BaseStoreGrnM (java.lang.Integer id) { this.setId(id); initialize(); }
Constructor for primary key
@RequestMapping(value = "/flood/addComment", method = RequestMethod.POST) public String addCommentPost(@ModelAttribute("newComment") Comment comment, HttpServletRequest request, Model model) { comment.setUserId(1L); model.addAttribute...
comment.setUserId((Long) request.getSession().getAttribute("userId")); //TODO looks ugly, need learn best practice
private void rehash() { int oldSize = this.size; int newSize = size * 2; while (!isPrime(newSize)) newSize++; this.size = newSize; DataItem[] newHashArray = new DataItem[newSize]; String temp; this.collision = 0; Boolean repeatValue; for (int i = 0; i < oldSize; i++) { if (hashArray[i] != null &...
doubles array length and rehash items whenever the load factor is reached
public GetOpt(String [] sargs, String flags) throws BadOptException { int size = sargs.length; try { StringReader sreader = new StringReader(flags); for (int i = 0; i < flags.length(); i++) { int opt = sreader.read(); if (opt == ':') ((OptPair) optlist.elementAt(optlist.size() - 1)).bool = fals...
Constructor for creating an instance that will parse a set of String arguments with respect to a set of command line options. Option switches are required to be a single character. By default switches are assumed to be boolean unless followed by a colon. example : &nbsp;&nbsp;&nbsp "cvf:" In this example "c" and "v" ar...
String getWiki();
Returns the value of the 'Wiki' attribute. If the meaning of the 'Wiki' attribute isn't clear, there really should be more of a description here...
@Override public int compare(Person o1, Person o2) { return o1.payGrade - o2.payGrade; }
compares two Person objects by their pay grades.
public static void main(String[] args) { FundsTransfer transfer = new FundsTransfer(clientId, clientSecret, Interswitch.ENV_DEV); try { BankResponse response = transfer.fetchBanks(); // makes network call Bank[] bank = response.getBanks(); // a bank array of all banks ...
Interswitch.ENV_SANDBOX, is for sandbox environment Interswitch.ENV_PROD, is for production environment
public Login() { initComponents(); txtAccountStatus.setVisible(false); showDate(); // Class para sa Date showTime(); // Class para sa Time }
1. for no user 2. for denied user 3. exeisting user but failed login Creates new form Main
public static String getXPathValue(FuzzyXMLElement element,String xpath){ try { String value = (String)XPath.getValue(element,xpath); return value.trim(); } catch(Exception ex){ return null; } }
Wrapps XPathgetValue() of FuzzyXML. This method provides following additional features. returns null when exceptions are caused. trims a return value.
com.google.apps.drive.activity.v2.DriveItem.DriveFile getDriveFile();
The Drive item is a file. .google.apps.drive.activity.v2.DriveItem.DriveFile drive_file = 8;
@Override public View getView(int location, View arg1, ViewGroup arg2) { Holder holder; if (arg1 == null) { holder = new Holder(); arg1 = inflater.inflate(resource, null); holder.gallery2_bucket_img = (ImageView) arg1.findViewById(R.id.gallery2_bucket_img); ...
TODO Autogenerated method stub
@Override public String serialize(List<Person> list) throws Exception { XmlSerializer serializer = Xml.newSerializer(); StringWriter writer = new StringWriter(); serializer.setOutput(writer); serializer.startDocument("UTF-8", true); serializer.startTag("", "persons"); for (Person p : list) { ser...
TODO Autogenerated method stub
public SVector3d getPositionCam() { return transCamera; }
Methode permettant de retourner la position du camera
public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter a letter: "); String s = input.nextLine(); char ch = s.charAt(0); ch = Character.toUpperCase(ch); if (s.length() != 1) { System.out.println("Invalid input"); System.exit(1); } ...
/ Phone key pads) The international standard letter/number mapping found on the telephone is shown below: Write a program that prompts the user to enter a letter and displays its corresponding number.
public T caseContinuous(Continuous object) { return null; }
Returns the result of interpreting the object as an instance of 'Continuous'. This implementation returns null; returning a nonnull result will terminate the switch.
public void feedAll() { for (VirtualPet p : shelterPets.values()) { p.feedPet(); } }
Method to feed all pets. For each VirtualPet in the map, run the feedPet method.
public int getId() { return id; }
end region Get set
public Object getBean(String name) { if (ctx == null) { ctx = WebApplicationContextUtils .getRequiredWebApplicationContext(servlet .getServletContext()); } return ctx.getBean(name); }
Convenience method to bind objects in Actions
@After public void end(){ driver.close(); driver.quit(); }
close ChromeDriver and browser
public static void end(){ try{ System.out.println("\nPress Enter key to continue: "); System.in.read(); System.out.print("\033[H\033[2J"); System.out.flush(); }catch(Exception e){ System.err.println(e.getMessage()); } }
/ End method After an argument is generated, this method is called to / prompt the user to continue and clears the console
public String getDefaultAccount() { return this.defaultAccount; }
Getter for property defaultAccount.
private void _writeTopic(final Topic topic) throws IOException { // Ignore the topic if it is the default name type and it has no further // characteristics if (topic.equals(_defaultNameType)) { return; } _out.startObject(); _writeItemIdentifiers(topic); ...
Serializes the specified topic. The default name type topic is omitted in case it carries no further characteristics.
@Override public void onFailed(String text) { view.onFailed("Greska u dohvacanju favorita!"); }
Implementacija SettingsInteractorListener. View se obavjestava u neuspjesnosti dohvacanja favorita.
@Test public void testExtractPropertyValueCLOB() throws ConfigurationException, SQLException { final ResultSet rs = mock(ResultSet.class); final Clob clob = mock(Clob.class); final String content = "This is the content of the test CLOB!"; when(rs.getObject(DatabaseConfigurationTestH...
Tests whether a CLOB as a property value is handled correctly.
public void initMatrixRandom(DoubleMatrix m){ for(int i = 0; i < m.rows; i++) for(int j = 0; j < m.columns; j++) m.put(i, j, randomValue()); }
Initialise the matrix with random normally distributed values
public static TreeMap<Plugin, TreeSet<ArchivalUnit>> orderAusByPlugin(Collection<ArchivalUnit> allAus) { Iterator itr = allAus.iterator(); TreeMap<Plugin, TreeSet<ArchivalUnit>> ausMap = new TreeMap<Plugin, TreeSet<ArchivalUnit>>(new PluginComparator()); while (itr.hasNext()) { ArchivalUni...
Rearranges AUs according to the plugin
public String buildInClauseFromSelectedTypes() { String inClause = ""; boolean isFirst = true; for (int i = 0; i < mExpenseTypesSelected.length; ++i) { if (mExpenseTypesSelected[i]) { inClause += (isFirst ? "" : ",") + i; isFirst = false; }...
Browse expenses and credits grid layout to find selected types.
public static Connection createConnection() throws SQLException, NamingException { DATA_SOURCE.init(); return DATA_SOURCE.getConnection(); }
Initialize DataSource class Only use one connection for this application, prevent memory leaks
static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) { List<Integer> result = new ArrayList<Integer>(); HashMap<String, Integer> temp = new HashMap<String, Integer>(); temp.put("a", 0); temp.put("b", 0); for(int i = 0; i < a.size(); i++){ if(a.get(...
Complete the compareTriplets function below.
public Patient() { this(DSL.name("patient"), null); }
Create a patientregsys.patient table reference
public static String combinedUniqueId() { // generate combined unique id using device id, pseudo unique id and // android id String _combinedUniqueId = deviceId() + pseudoUniqueId() + androidId(); Log.d(LOG_TAG, "The combined unique id = " + _combinedUniqueId); return StringUtils.md5(_combinedUniqueId); }
get combined unique id(had been md5)
private ProxyCreationResult createRepo( String trackingId, URL url, String name ) throws IndyDataException { UrlInfo info = new UrlInfo( url.toExternalForm() ); UserPass up = UserPass.parse( ApplicationHeader.authorization, httpRequest, url.getAuthority() ); String baseU...
Create repositories (group, remote, hosted) when trackingId is present. Otherwise create normal remote repository with specified name.
public void setInvoiceNo (java.lang.String invoiceNo) { this.invoiceNo = invoiceNo; }
Set the value related to the column: invoice_no
public static GreeterStub newStub(io.grpc.Channel channel) { return new GreeterStub(channel); }
Creates a new async stub that supports all call types for the service
public ArrayList llenar_lv(){ ArrayList<String> lista = new ArrayList<>(); SQLiteDatabase database = this.getWritableDatabase(); String q = "SELECT * FROM " + TABLE_NAME; Cursor registros = database.rawQuery(q,null); if(registros.moveToFirst()){ do{ li...
PARA RETORNAR LOS USUARIOS
public String getHex() { return hex; }
Hexadecimal string. This is the representation of your binary data. Two hex digits represent one byte. They should be separated by the space character (Example: &x60;0f c2 4a bf 34 13 ba&x60;).
@Override String getName();
Gets the id of this item. Ex. Minecraft registers a golden carrot as "minecraft:golden_carrot".
public List<Session> getListSessionApprenant() {// OK if (utilisateur.getListeSessionsApprenantAccessible().isEmpty()) { List<Session> liste = new ArrayList<Session>(); liste = getListeSessionsParam("sessionsAcc", "role", "apprenant"); utilisateur.setListeSessionsApprenantAccessible(liste); return ...
liste des sessions accessibles par l'utilisateur en tant qu'apprenant
public boolean hasSubnetResponse() { return subnetResponseBuilder_ != null || subnetResponse_ != null; }
.SubnetResponse subnetResponse = 17;
public void setNext(Node next) { this.next = next; }
Setter for next node.
java.util.List<com.pkuvr.game_server.proto.serverproto.Mine_Collect_Log_Response.Mine_Collect_Info_Mes> getCollectListList();
repeated .Mine_Collect_Info_Mes collectList = 2;
@Override public String[] getTextureNames() { return null; }
TODO Autogenerated method stub
public boolean isAbsorbed() { return absorbed; }
Return True if the L2Attackable had his soul absorbed.
Order addOrder(String orderNumber, Order order) throws FlooringMasteryPersistenceException;
Adds the given Order to the order book and associates it with the given order id. If there is already a order associated with the given order id it will return that order object, otherwise it will return null.
public interface Individual { /** * * @return this individual's alphabet */ Alphabet getAlphabet(); /** * * @return the individual's fitness */ double getFitness(); }
Represents an individual in the generation of a genetic algorithm
public boolean createPatient(Patient patient,PatientRecord patientRecord) { boolean isCreated= false; String[] row= new String[9]; try { String query = "INSERT INTO patients VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"; PreparedStatement pStatement= super.getConnection().prepareStatement(query); pStatement.s...
Create a patient and also create its record into patient_record
public Future<String> getBrokerName() throws DynamicCallException, ExecutionException { return call("getBrokerName"); }
Gets the name of the parent broker.
public int getHorSTX() { return horSTX; }
getter for street x
private boolean employeeDataIsOk(RoleAndSeniority ras, EmployeeDto newEmpDto) { if(employeeSalaryInTheCorrectRange(ras, newEmpDto.getSalary()) && employeeSsnValid(newEmpDto) && employeeNameValid(newEmpDto) && employeeDobValid(newEmpDto)) { return true; } return false; }
/ Validate employee data.
@Test(expected= VotingException.class) public void VotingMadeByAuthorThrowsException() throws Exception { bob.upVote(bobPost); bob.downVote(bobPost); alice.upVote(question); alice.downVote(question); }
Using a test, ensure that voting either up or down is not allowed on questions or answers by the original author, you know to avoid gaming the system. Ensure the proper exceptions are being thrown.
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = super.onCreateView(inflater, container, savedInstanceState); unbinder = ButterKnife.bind(this, rootView); return rootView; }
TODO: inflate a fragment view
@GET @Path("get") public Customer getCustomer(@QueryParam("id") int id) { return ManagerHelper.getCustomerManager().get(id); }
function that get customer
@Override public List<Disease> findDiseaseByInfo(Disease diseaseInfo) { List<Disease> list = diseaseRepository.findByInfo(diseaseInfo.getDname(),diseaseInfo.getNickName(), diseaseInfo.getLevel(),diseaseInfo.getSymptom(),diseaseInfo.getCure()); return list; }
String dname, String nickName, Integer level, String symptom, String cure
@java.lang.Override public java.lang.String getErrorMessage() { java.lang.Object ref = errorMessage_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (co...
string errorMessage = 3;
public void m65932e() { if (this.f56359a.m56684k() != null) { this.f56360b.a(this.f56359a.m56679f().b(Schedulers.io()).a(C19397a.a()).a(new aa(this), new ab(this))); } this.f56359a.m56675c(null); ((SpotifyTrackSearchTarget) H()).closeView(); }
/ renamed from: e
public Utente getUtente() { return utente; }
Access method for utente.
byte[] getSegmentData(Locator locator) throws PhysicalResourceException;
get the segment data for the given locator.
public com.google.protobuf.ByteString getUserNameBytes() { java.lang.Object ref = userName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); userName_ = b;...
string userName = 3;
public interface ArtMasterAttachmentManager { Map saveArtMasterAttachment(HttpServletRequest request, LogBean logBean) throws Exception; Map deleteArtMasterAttachment(HttpServletRequest request, LogBean logBean) throws Exception; }
Created by Administrator on 2016/9/7.
public static void classifyWithHeaders(String[] args) throws IOException { File dir_location = new File( args[0] ); // Listing of the directory (should contain 2 subdirectories: ham/ and spam/) File[] dir_listing = new File[0]; // Check if the cmd line arg is a directory and list it ...
gw: training set dir Location of the directory (the path) taken from the cmd line (first arg)
public interface WrapperAdapter { RecyclerView.Adapter getWrappedAdapter(); }
Created by Administrator on 2016/1/15.
public AlertDialog.Builder connectivityAlert(){ mAlertDialogBuilder = new AlertDialog.Builder(mContext); Log.i(TAG,"in connectivyAlert!!!!!"); mAlertDialogBuilder.setMessage(R.string.connectivityLossMessageString) .setPositiveButton(R.string.wifiString,new DialogInterface.OnClick...
This method displays a dialog to get user preferences for syncing images in the absence of Network.
public String adcionarEmail() { pessoa.adicionaEmail(email); this.email = new Email(); return null; }
/Tudo Referente aos emails vinculados
public static void main(String[] args) { Scanner rd = new Scanner(System.in); double C = 0, F = 0; System.out.println("Escreva a Temperatura: "); C = rd.nextDouble(); F = (C * 1.8) + 32; System.out.println("A temperatura em Fahrenheit é : \n" + F); }
TODO Autogenerated method stub
public static double getVoltage(LinearOpMode myLOM) { HardwareMap hardwareMap = myLOM.hardwareMap; // Use enum to access the voltage sensor without knowing its // name in the hardwareMap. Only one sensor will be found. List <VoltageSensor> voltageSensors; voltageSensors = hard...
The single parameter here is the minimum required, for the current prerelease SDK version implementing myBlocks. It will generate an idle socket in the purple myBlock.
public void setCityagent(Long cityagent) { this.cityagent = cityagent; }
This method was generated by MyBatis Generator. This method sets the value of the database column t_mp_num.cityAgent
@Override public void onFailure(int code) { Log.e(TAG, "discoverServices Failure " + code); if (code == WifiP2pManager.BUSY && mDeviceRegistering != null) { discoverServices(); } else { mService.stopSelf(); ...
Command failed. Check for P2P_UNSUPPORTED, ERROR, or BUSY