anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
public static synchronized int getCred_IDByBean(Credentials cred){
int cred_ID=0;
Connection connection;
PreparedStatement statement = null;
String preparedSQL = "Select Credentials_ID From credential Where Email = ? " +
"And Pass= ? And Role= ? And Validated= ? And RegKey= ?";
try{
connecti... | Method.........................................getCred_IDByBean Author......................................................JLH This method retrieves the Credential ID based on the Credential Bean Return Value (int) cred_ID: Returns a credential ID, this is an int that is automatically incremented in the database when ... |
@Override
public List<Chitietdonhang> findByIdChiTietDonHangActive() {
return chiTietDonHangRepository.findByIdChiTietDonHangActive();
} | TODO Autogenerated method stub |
@Override
public boolean isLabelProperty(Object element, String property) {
return false;
} | TODO Autogenerated method stub |
@Override
public void onLocalAudioStats(LocalAudioStats stats) {
if (timeCodeIndicator % TIME_CODE_FREQUENCY == 0) {
appointment.setTimeCode(new DatabaseUser(MainUser.getMainUser().getId()), System.currentTimeMillis());
}
timeCodeIndicator ... | Time code is set at a given frequency |
private void testAndUpdateControlFields(int startFieldNr) {
boolean consistent = true;
//test and correct y
for (int i = 0; i < _controlPoints.length; i++) {
if (parseTextFieldValue(_controlPoints[i][1]) == -1.0f) {
consistent = false;
}
}
//test and correct x at startFieldNr and above
fo... | checks for all y controlPoint fields if they are in the interval 0..1 checks for all x controlPoint fields if they are in the interval 0..1 and if they form a increasing row. First controlPoints x has to be <= 2nds... If necessary tries to auto correct errors in the ordering. |
public void setFirstName(final String value)
{
setFirstName( getSession().getSessionContext(), value );
} | Generated method Setter of the MyCustomer.firstName attribute. |
public static List<String> getNames() {
return Collections.unmodifiableList(widgetNames);
} | Returns the widget names as a list. This is an example of a safe get method. Instead of returning the reference to our private mutable data directly, it is first made unmodifiable. While code in this class will still be able to mutate the data, code outside of this class will not. |
public Builder setOwnerBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
owner_ = value;
onChanged();
... | Short alias or acronym of the owner of the node string owner = 3; |
@Override
protected void onPause() {
super.onPause();
onPause = true;
} | TODO Autogenerated method stub |
private synchronized static void internalLog(StringBuilder msg) {
//add time header
String timeStamp = simpleDateFormat.format(new Date());
msg.insert(0, timeStamp);
byte[] contentArray = msg.toString().getBytes();
int length = contentArray.length;
int srcPos = 0;
... | Produce internal log format and save to SD card. |
@Test(expected = java.io.UnsupportedEncodingException.class)
public void testRenderMergedOutputModel_5()
throws Exception {
RedirectView fixture = new RedirectView("", true, true);
fixture.setUrl("");
fixture.setEncodingScheme("");
Map model = new LinkedHashMap();
HttpServletRequest request = new JSecurity... | Run the void renderMergedOutputModel(Map,HttpServletRequest,HttpServletResponse) method test. |
public int uncompress(InputStream in, OutputStream out) throws IOException {
int codeCount = 0;
int code = 0;
BitInputStream bitIn = new BitInputStream(in);
StringBuilder codeString = new StringBuilder(0);
// *** Bellow for building array of encoded values ****
// ****... | "Decompresses" files that were previously "compressed" by this program |
public Builder addCases(
int index, build.buf.validate.conformance.harness.CaseResult.Builder builderForValue) {
if (casesBuilder_ == null) {
ensureCasesIsMutable();
cases_.add(index, builderForValue.build());
onChanged();
} else {
casesBuilder_.addMessage(index, buil... | List of case results. repeated .buf.validate.conformance.harness.CaseResult cases = 4 [json_name = "cases"]; |
public static void main(String[] args) {
Person p1 = new Person("1", "Nishant");
Person p2 = new Person("2", "Nikhil");
PersonStack ps = new PersonStack();
ps.push(p1);
ps.push(p2);
System.out.println(ps.pop().toString());
System.out.println(ps.pop().toString());
} | IntStack no1 = new IntStack(); no1.push(10); no1.push(20); no1.push(30); no1.push(40); no1.push(50); System.out.println(no1.pop()); System.out.println(no1.pop()); System.out.println(no1.pop()); Output 50 40 30 |
@Override
@Transactional
public String addOrUpdateRole(ApplicationUserRole applicationUserRoleBean) {
String ex=null;
try
{
Session session = sessionFactory.getCurrentSession();
session.merge(applicationUserRoleBean);
}
catch(HibernateException e)
{
e.printStackTrace();
}
return ex;
} | TODO Autogenerated method stub |
public interface Selectable
{
boolean isSelected();
void setSelected(boolean selected);
void setGroup(SelectionGroup group);
} | Created by JCM on 25.11.2018. |
private void m20461b() {
this.f16556a.f16545b = 1;
this.f16556a.m20453f();
this.f16556a.m20444b(this.f16557b);
} | / renamed from: b |
private void loginForm(HttpServletRequest req, HttpServletResponse res)
throws IOException {
String url = req.getRequestURI();
String query = req.getQueryString();
if (query != null) {
url = url + '?' +query;
}
ProtectedRequest target = new ProtectedRequest(url);
// Store in curren... | Save the protected request |
public MainActivityFragment() {
} | final static String BASE_URL = " // BASE_URL to fetch movie data |
@SuppressWarnings( {"raw", "unchecked"} )
public static <T> GeSpecification<T> ge( Property<T> property, Variable variable )
{
return new GeSpecification( property( property ), variable );
} | Create a new GREATER OR EQUALS specification for a Property using a named Variable. |
public com.google.protobuf.ByteString
getAddressBytes() {
java.lang.Object ref = address_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
addres... | string address = 2; |
int compareTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition); | Compare the values in the specified block at the specified positions equal. |
private ServerSocket createServerSocket() throws IOException {
ServerSocket serverSocket = new ServerSocket(Constants.SERVER_PORT);
System.out.printf("Server for chatting started at %d\n", Constants.SERVER_PORT);
return serverSocket;
} | Creates the server socket. |
public boolean valid() {
if (newFlag) {
if (procNameText.getText() == null || StringUtil.isEmpty(procNameText.getText())) {
CommonUITool.openErrorBox(getShell(), Messages.errInputProcedureName);
return false;
}
if (!ValidateUtil.isValidIdentifier(procNameText.getText())) {
CommonUITool.openErrorB... | Check the data validation |
public void setIsDel(Integer isDel) {
this.isDel = isDel;
} | This method was generated by MyBatis Generator. This method sets the value of the database column eshop_order_item.is_del |
private boolean containsOnlyProjects(IResource[] resources) {
int types = getSelectedResourceTypes(resources);
// note that the selection may contain multiple types of resource
return types == IResource.PROJECT;
} | Returns whether the selection contains only projects. |
java.lang.String getPkiType(); | none / x509+sha256 / x509+sha1 optional string pki_type = 2 [default = "none"]; |
private AbsentYear findAbsentYear(Employee emp, LocalDate startDate) {
AbsentYear absentYear = absYearRepo.findByEmployeeAndYear(emp, (short)startDate.getYear());
if(absentYear == null) {
absentYear = createAbsentYear(emp, startDate);
}
return absentYear;
} | Find the year for an employee's absenteeism. |
private void initComponents() {
frame = new JFrame();
JPanel panel2 = new JPanel();
enrereButton = new JButton();
JLabel label1 = new JLabel();
JPanel panel3 = new JPanel();
textField1 = new JTextField();
JLabel label2 = new JLabel();
JPanel panel4 ... | JFormDesigner Component initialization DO NOT MODIFY //GENBEGIN:initComponents Generated using JFormDesigner Evaluation license Mariano Rajoy |
private static double[][] moments(double[][] data, int K) {
double[] expectedX = new double[K];
double[] expectedXSquared = new double[K];
for (double[] theta : data) {
if (theta.length != K) {
throw new IllegalArgumentException("Dimensions of data and alpha do not match!");
}
for (int k = 0; k < ... | Index 0 of returned value is E[x]; Index 1 is E[x^2] (noncentral) |
private void loadConfig() throws IOException {
final boolean hasPropertiesFile = configFile != null && configFile.exists()
&& configFile.canRead() && configFile.isFile();
if (hasPropertiesFile) {
Properties props = new Properties();
FileInputStream fis = nu... | Load the configured parameters through the properties file. TODO: Move to XML instead of properties file |
public vn.com.ecopharma.hrm.rc.model.InterviewSchedule findByVacancyCandidate_First(
long vacancyCandidateId,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException,
vn.com.ecopharma.hrm.rc.NoSuchInterviewScheduleException; | Returns the first interview schedule in the ordered set where vacancyCandidateId = &63;. |
public String getEmail()
{
return getEmail( getSession().getSessionContext() );
} | Generated method Getter of the BraintreeCustomerDetails.email attribute. |
private static int minDepth(TreeNode node) {
if (node == null) return 0;
return 1 + Math.min(minDepth(node.left), minDepth(node.right));
} | Find the minimum depth in the tree using recursion. |
public M csmiUpdateTimeStart(Object start){this.put("csmiUpdateTimeStart", start);return this;} | and csmi_update_time >= ? |
public Builder addTransactions(com.google.protobuf.ByteString value) {
copyOnWrite();
instance.addTransactions(value);
return this;
} | Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2; |
public void setPhone(final SessionContext ctx, final String value)
{
setProperty(ctx, PHONE,value);
} | Generated method Setter of the BraintreeCustomerDetails.phone attribute. |
public static void main(String[] args) throws IOException {
File file = new File("testeArquivo.txt");
file.createNewFile();
FileWriter writer = new FileWriter(file);
writer.write("Arquivo criado");
writer.flush();
writer.close();
FileReader fr = new FileReader(file);
char [] a = new char[50];
f... | TODO Autogenerated method stub |
private static FunctionCycle findCycleWithHashingInternal(IntUnaryOperator func, int x0) {
IntHashSet detectedValues = new IntHashSet();
int curValue = x0;
while (!detectedValues.contains(curValue)) {
detectedValues.add(curValue);
curValue = func.applyAsInt(curValue);
... | Find function cycle using HashSet |
private void countAndPadding(int type, int fill) {
if ( sealed ) return;
final Buffer dest;
final boolean dSigned;
final int e;
switch (type) {
case VERTEX:
dest = vertexArray;
dSigned = vDataTypeSigned;
... | Fourth element default value for color (alpha), vertex (w) is '1', as specified w/ VertexAttributes (ES2/GL3). vec4 v = vec4(0, 0, 0, 1); vec4 c = vec4(0, 0, 0, 1); |
public interface IViewConfiguration {
/** Get the filter defining how to handle conditional directives */
IViewFilter getViewFilter();
/** Get the fixed macros (macro name or name=value).
* This array should not change after creation since this
* configuration is stored in a view.
*/
Collection<ID... | This interface defines the configuration for a view. |
public void setAmcContract (java.lang.String amcContract) {
this.amcContract = amcContract;
} | Set the value related to the column: amc_contract |
private static String getXadlDirection(Direction direction) {
String strDirection = null;
switch (direction) {
case IN:
strDirection = "in";
break;
case OUT_MULTI:
case OUT_SINGLE:
strDirection = "out";
break;
default:
strDirection = "none";
}
return strDirection;
} | Gets string expression of the given signature for xadl. |
@Override
public void onResponse(String response) {
if (new CheckConnectivity().isConnected(context)) {
try {
prog.dismiss();
Log.e("Response : prince ", response);
... | Display the first 500 characters of the response string. |
public boolean isDeprecated() {
return isDeprecated;
} | Has this action method been deprecated |
public void setCallback(final CallbackSync callback) {
this.callback = callback;
} | ========= Operations ========= set callback called when buffers where synched to disk |
Text createText(); | Returns a new object of class 'Text'. |
@Test(timeout = 4000)
public void test57() throws Throwable {
FBProcedureCall fBProcedureCall0 = new FBProcedureCall();
// Undeclared exception!
try {
fBProcedureCall0.addOutputParam((FBProcedureParam) null);
fail("Expecting exception: NullPointerException");
} catch(... | Test case number: 57 /Coverage entropy=0.6931471805599453 |
public Builder setMoodMessage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
moodMessage_ = value;
onChanged();
return this;
} | string moodMessage = 5; |
public void setDay(Date day) {
this.day = day;
} | This method was generated by Apache iBATIS ibator. This method sets the value of the database column V_RP_DY_ROUTE.DAY |
public static void main(String[] args) {
final Scanner scanner = new Scanner(System.in);
boolean exit = false;
String select;
loadFromFile();
do {
System.out.println("Premier League Manager");
System.out.println("=================================");
... | input data validation resourse link implement the menu |
public void waitForVerifyHhsPage() {
verifyHHSPageElement.waitForState().enabled(30);
} | Verify the HHS Footer Link in LoginPage. |
private static float getDefaultDuration(ResourceLocation effectId) {
return new ResourceLocation("night_vision").equals(effectId) ? 15.9f : 1.9f;
} | Duration in seconds. The .9 should prevent flickering. |
@Test
public void applyOnceGoal() {
assertSuccess(" ;H; ;S; x ∈ ℤ ;; y ∈ ℤ |- x↦y ∈ id", rm("", empty));
} | Ensures that the Rmi tactic succeeds once on a goal |
public JsonMember copy() {
return new JsonMember(name, value.copy());
} | Create an independent copy of this JSON member. |
public Builder clearItemId() {
itemId_ = 0L;
onChanged();
return this;
} | item_id int64 item_id = 9; |
boolean isSetIdVerificationResponseData(); | True if has "idVerificationResponseData" element |
public void onSearchStarted(); | Called when the action bar initially shows the search entry field. |
private static void displayStatistics(){
Scanner scanner = new Scanner(System.in);
System.out.print("Please enter Club Name: ");
String clubName = scanner.nextLine();
leagueManager.displayStatistics(clubName);
} | display a specific club's statistics |
private Swiftbuy() {
super("swiftbuy");
} | No further instances allowed |
String getModuleDisplayName(); | Gets the display name that identifies the family of ingest modules the factory creates. Autopsy uses this string to identify the module in user interface components and log messages. The module name must be unique. so a brief but distinctive name is recommended. |
public void translate(BitInputStream input, PrintStream output) {
HuffmanNode node = this.front;
while (input.hasNextBit()) {
while (node.left != null && node.right != null) {
if (input.nextBit() == 0) {
node = node.left;
} else {
... | A method that takes in a BitInputStream and a PrintStream. Reads bits from the BitInputStream and translates them using the HuffmanTree and prints those characters to the PrintStream. |
public List<List<Integer>> pathSum(TreeNode root, int sum) {
if(root==null)
return res;
dfs(root, sum, new ArrayList<Integer>());
return res;
} | 113 use dfs recursive |
public void openIe(){
} | System.setProperty("webdriver.ie.driver","F:\\IdeaProjectsWork\\selenium2\\drivers\\chromedriver.exe"); WebDriver wb = new InternetExplorerDriver(); |
public void printTopRatingMovies() {
Collections.sort(this.dataList, new SortByRating());
int top = Math.min(5, getDataLength());
for (int i=0; i<top; ++i) {
System.out.println(this.dataList.get(i).toString());
}
Collections.sort(this.dataList);
} | method to print the movies with the 5 highest ratings |
private static void cargarLista(String linea, TraductorDesdeLista grafo)
throws IllegalArgumentException
{
int vertice = Integer.parseInt(linea.substring(0,1)); // Guarda el vertice
linea = linea.substring(3); // Guarda los vertices sucesores
String[] lista = linea.split(" "); // Almacena... | Carga la linea de un archivo Lista de Adyacencias dada en el Grafo dado. |
public void setRating(int rating); | set a rating for the item |
@Override
public void onClick(View v) {
Intent intent = new Intent(GuideActivity.this,MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
startActivity(intent);
MyApplication.getApp().getSysSpUtil().setIsFirstTime(false);
finish();
} | TODO Autogenerated method stub |
private void defaultConfig(Set<String> defaultFontFamilyNames) {
defaultFontFamily = DEFAULT_SELECTED_FONT_NAME;
// the empty font name
addItem("");
// all the system font names to combo box
for (String defaultFontFamilyName : defaultFontFamilyNames) {
this.listFont... | Config the FontFamilySelector using the default values. All the system available font names are added to the combo box. |
public static void main(String[] args) throws IOException {
int h = 0;
int v = 0;
InputStreamReader file = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(file);
//This string will be the iterable container
String directions = br.readLine();
//this code will check upp... | This code will create two variables to store the horizontal and vertical positions specified origin is (0,0) h= horizontal v=vertical |
public interface SearchPresenter {
void onDestroy();
void loadNextPage();
void searchGithubRepos(String searchPhrase);
} | Created by sandyr on 11/23/2017. |
public static String formatearRut(String rut){
int cont = 0;
String format;
rut= rut.replace(".", "");
rut = rut.replace("-", "");
format= "-" + rut.substring(rut.length()-1);
for(int i = rut.length()-2; i>=0;i--){
format=rut.substring(i,i+1)+format;
... | method that allows to format the ru of the form with period and hyphen even if it is entered in different ways |
private void demoInnerClass2() {
} | Inner x = new Inner(); |
private boolean contains(int[] piket,int vlera){
for(int i=0; i<piket.length; i++){
if(piket[i]==vlera) return true; //eshte metode booleane spese kthen true ose false ne menyre qe te plotesohet if me lart
}
return false;
} | krahason elementet e vektorit me nje vlere te caktuar |
Player getCurrentPlayer(); | Returns the current Player. |
public MyWorld()
{
// Create a new world with 800x600 cells with a cell size of 1x1 pixels.
super(800, 600, 1);
//could have as many RideLines as capasity dictates
rides = new RideLines[MAX_RIDES];
currentRide=0; //initially, we have 0 prisoners
//Crea... | the collection of ride lines Constructor for objects of class MyWorld. |
void onSuccess(int responseCode, int requestCode, Response<JsonElement> response); | Success callback. Request is considered as successful when response code is between 200 and 299 |
@PostMapping("/Verify")
public ResponseEntity<String> verify(@RequestBody VerifyRequest request){
logger.debug("verify request");
String username = conferenceService.findConference(request.getId()).getOwner();
Conference conference = conferenceService.findConference(request.getId());
... | verify the conference When debug, delete the param "request" |
public java.math.BigDecimal getExciseDuty () {
return exciseDuty;
} | Return the value associated with the column: excise_duty |
@Override
public void specialAbility() {
} | TODO: Double value of Defence Order |
private String edit(String input_from_user, char[] input_array) {
System.out.println("Enter the number of positions you want to change the string"+input_from_user);
int user_input = in.nextInt();
String result = null;
for(int i=0; i <user_input; i++){
System.out.println("Enter the"+i+"th to edit in the "+inp... | TODO Autogenerated method stub |
private List<Student> getStudentList(StudentSearchResponse srchResponse) {
List<Student> studentList = new ArrayList<Student>();
if (srchResponse != null && srchResponse.size() > 0) {
for (StudentSearchResult srchRes : srchResponse) {
Student std = new Student(srchRes.getInquiryId(),
srchRes.getSt... | Returns a list of students objects from the search results |
public entities.Torrent.FileInfo.Builder addFilesBuilder(
int index) {
return getFilesFieldBuilder().addBuilder(
index, entities.Torrent.FileInfo.getDefaultInstance());
} | repeated .FileInfo files = 4; |
protected DocumentTestObject homeMembership(TestObject anchor, long flags)
{
return new DocumentTestObject(
getMappedTestObject("homeMembership"), anchor, flags);
} | HomeMembershipBoilerCoverHomeEmergencyAA: with specific test context and state. .title : Home Membership | Boiler Cover | Home Emergency | AA .class : Html.HtmlDocument .url : RegularExpression(homemembership) |
public Builder addAllTransactions(
java.lang.Iterable<? extends com.google.protobuf.ByteString> values) {
copyOnWrite();
instance.addAllTransactions(values);
return this;
} | Signed transactions that satisfy PaymentDetails.outputs repeated bytes transactions = 2; |
public static String initLbInstanceId() {
try {
String url = "http://169.254.169.254/latest/meta-data/instance-id";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.b... | Used to instruct the autoscaler to not try to synchronize this instance as an EC2 web server instance |
public Iterator<Item> iterator() {
return new RandomArrayIterator();
} | Returns iterator in random order |
public String getParamName() {
return this.paramName;
} | Return the name of the parameter that contains a locale specification in a locale change request. |
public static String toString(final Object[] segments) {
final StringBuilder builder = new StringBuilder();
for (final Object segment: segments) {
if (segment instanceof Integer) {
builder.append('[').append(segment).append(']');
} else if (segment == ANY_INDEX) {
builder.append(segment);
} ... | Encodes the specified path segments as a path string |
private String makeEventRecurrence(LocalDateTime lastDay) {
return "RRULE:FREQ=WEEKLY;UNTIL=" + formatTimeToICS(lastDay) + "Z" + "\n";
} | / ICS FORMATTING METHODS Write RRULE property of event given an UNTIL date The frequency of the recurrence is hardcoded to WEEKLY |
@Override
public double calPx() {
return this.n.getPx();
} | pour avoir position de l'appui Px sur segment |
public String getName()
{
return name;
} | Gets the value of the name property |
private static void createNotesCollectionIfNotExists(UserRegistry registry) throws RegistryException {
if (!registry.resourceExists(NoteConstants.NOTE_LOCATION)) {
Collection collection = registry.newCollection();
registry.put(NoteConstants.NOTE_LOCATION, collection);
}
} | Create the note directory if it does not exist |
protected void parseURL(URL paramURL, String paramString, int paramInt1, int paramInt2) {
/* 126 */ String str1 = paramURL.getProtocol();
/* 127 */ String str2 = paramURL.getAuthority();
/* 128 */ String str3 = paramURL.getUserInfo();
/* 129 */ String str4 = paramURL.getHost();
/* 130 */ int i = par... | / / / / / / / / / / / / / / / / / / / / / / / / / / / / |
public Plan getPlan(String planName); | Gets a Plan form DB with planName |
public Builder addCertificate(liubaninc.m0.pki.CertificateOuterClass.Certificate value) {
if (certificateBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureCertificateIsMutable();
certificate_.add(value);
onChanged();
... | repeated .liubaninc.m0.pki.Certificate Certificate = 1; |
public StringFilter getCurrentJobTitle() {
return currentJobTitle;
} | Gets the current job title. |
public org.csapi.schema.parlayx.subscribe.manage.v1_0.local.UnSubscribeServiceResponse unSubscribeService(org.csapi.schema.parlayx.subscribe.manage.v1_0.local.UnSubscribeServiceRequest parameters) {
throw new UnsupportedOperationException("Not implemented yet.");
} | TODO implement this method |
@Override
public void mouseMoved(MouseEvent e) {
View view = getChart().getView();
//
if (getChart().getView().is3D()) {
mousePosition.event = null;
mousePosition.projection = null;
} else {
mousePosition.event = e;
mousePosition.projection = screenToModel(e);
}
view.s... | When mouse moves on the canvas In 3D, drop mouse position as it should not be displayed In 2D, store mouse position to overlay coordinates |
protected void exportScriptToFile() {
try {
final MigrationConfiguration cfg = getMigrationWizard()
.getMigrationConfig();
prepare4SaveScript();
ExportScriptDialog.exportScript(cfg, isSaveSchema());
} catch (Exception e) {
// MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveS... | Export script to a external XML file |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.