anchor
stringlengths
10
14.3k
positive
stringlengths
10
14.9k
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
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'.