query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Log.i(TAG, "onPanelStateChanged " + newState);
@Override public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) { mSlidingToolbarState = newState; if (newState == COLLAPSED) { Otto.post(MapFragment.DIALOG_DISMISS); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void onPanelOpened(Panel panel) {\n\r\n\t}", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "void currentStateChanged();", "public void stateChanged (ChangeEvent e)\n {\n }", "public abstract void stateChanged(STATE state);", "public void onStateLeft...
[ "0.69586575", "0.67095095", "0.66806763", "0.6400235", "0.6371293", "0.63639444", "0.63568455", "0.63222265", "0.6296268", "0.6264933", "0.6251332", "0.62394243", "0.6220982", "0.6220982", "0.6220982", "0.6220982", "0.6185661", "0.61457163", "0.61262864", "0.6083901", "0.6079...
0.66432697
3
TODO Autogenerated method stub
public static void main(String[] args) { Client client = Client.create(); WebResource webResource = client.resource("http://10.14.129.6:8080/api/json"); System.out.println("changes made"); System.out.println("blah!"); System.out.println("blah! blah!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
This method prepares all the payments params to be sent to PayuBaseActivity.java
public void navigateToBaseActivity() throws JSONException { String merchantKey = jsonObject.getString("merchantKey"); String amount = jsonObject.getString("amount"); String email = jsonObject.getString("email"); String value = jsonObject.getString("value"); String firstName = jsonObject.getString("firstName"); String phone = jsonObject.getString("phone"); String txnId = jsonObject.getString("txnId"); String sUrl = jsonObject.getString("sUrl"); String fUrl = jsonObject.getString("fUrl"); String udf1 = jsonObject.getString("udf1"); String udf2 = jsonObject.getString("udf2"); String udf3 = jsonObject.getString("udf3"); String udf4 = jsonObject.getString("udf4"); String udf5 = jsonObject.getString("udf5"); salt = jsonObject.getString("salt"); int environment; if (value.equals("test")) environment = PayuConstants.STAGING_ENV; else environment = PayuConstants.PRODUCTION_ENV; String userCredentials = merchantKey + ":" + email; mPaymentParams = new PaymentParams(); mPaymentParams.setKey(merchantKey); mPaymentParams.setAmount(amount); mPaymentParams.setProductInfo("GoCharge power bank charges"); mPaymentParams.setFirstName(firstName); mPaymentParams.setEmail(email); mPaymentParams.setPhone(phone); mPaymentParams.setTxnId(txnId); mPaymentParams.setSurl(sUrl); mPaymentParams.setFurl(fUrl); mPaymentParams.setNotifyURL(mPaymentParams.getSurl()); //for lazy pay mPaymentParams.setUdf1(udf1); mPaymentParams.setUdf2(udf2); mPaymentParams.setUdf3(udf3); mPaymentParams.setUdf4(udf4); mPaymentParams.setUdf5(udf5); mPaymentParams.setUserCredentials(userCredentials); payuConfig = new PayuConfig(); payuConfig.setEnvironment(environment); generateHashFromSDK(mPaymentParams, salt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onPaymentRequestParamsInitiated(PaymentRequestParams params);", "public void navigateToBaseActivity() {\n\n //merchantKey = \"gtKFFx\"; //Testing\n merchantKey = \"ImrH8w\"; //Live\n //merchantKey = ((EditText) findViewById(R.id.editTextMerchantKey)).getText().toString();\n // St...
[ "0.7172042", "0.6796651", "0.6332949", "0.6208003", "0.61292714", "0.60579646", "0.6021187", "0.60198134", "0.601913", "0.59251523", "0.5893264", "0.5872877", "0.58212876", "0.5808636", "0.5779179", "0.57582784", "0.5733731", "0.57193863", "0.5687134", "0.56812465", "0.565941...
0.65090543
2
Rotate array to the left by 1.
private static void leftRotateByOne(int[] array) { int tmp = array[0]; for (int i = 0; i < array.length - 1; i++) { array[i] = array[i + 1]; } array[array.length - 1] = tmp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void leftRotateByOne(int[] data) {\n\t\tint temp = data[0]; // Storing first element in temp value\n\t\tfor (int i = 0; i < data.length - 1; i++) {\n\t\t\t// shift each element\n\t\t\tdata[i] = data[i + 1];\n\t\t}\n\t\t// store the last index by temp val\n\t\tdata[data.length - 1] = temp;\n\t}", "public s...
[ "0.82955825", "0.78433144", "0.76713765", "0.73835", "0.73525834", "0.7255143", "0.7254278", "0.71991676", "0.700667", "0.69428575", "0.68843406", "0.6834585", "0.6817148", "0.68070316", "0.6737213", "0.6715721", "0.669153", "0.6649761", "0.66386044", "0.66183704", "0.658738"...
0.87179786
0
Reverses array in place
public static void reverse(int[] array, int start, int end) { if (array == null || start > array.length || end > array.length || start > end) { throw new IllegalArgumentException("Invalid args"); } int len = end - start + 1; for (int i = start; i < start + len / 2; i++) { int tmp = array[i]; array[i] = array[start + end - i]; array[start + end - i] = tmp; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void reverse(byte[] array) {\n if (array == null) {\n return;\n }\n int i = 0;\n int j = array.length - 1;\n byte tmp;\n while (j > i) {\n tmp = array[j];\n array[j] = array[i];\n array[i] = tmp;\n j--;\n i++;\n }\n }", "private static int[] rever...
[ "0.781399", "0.7636129", "0.75983894", "0.7535497", "0.75226593", "0.7501938", "0.74902797", "0.7486421", "0.7469072", "0.7402186", "0.7376965", "0.73274356", "0.732144", "0.72576296", "0.7231128", "0.71866685", "0.7182912", "0.7161635", "0.71402705", "0.71117073", "0.7092154...
0.6221734
77
When the map is ready ,i put markers for all of the objects in the list and save their id in hashmap to use it for Click Listener
@Override public void onMapReady(GoogleMap map) { // TODO Auto-generated method stub hashmap = new HashMap<Marker, Integer>(); double latitude, longitude; map.setMyLocationEnabled(true); LatLng myCoordinates = new LatLng(42.733883, 25.48583); CameraUpdate location = CameraUpdateFactory.newLatLngZoom( myCoordinates, 6); map.animateCamera(location); for (int i = 0; i < list.size(); i++) { latitude = Double.parseDouble(list.get(i).getmLatitude()); longitude = Double.parseDouble(list.get(i).getmLongitude()); Marker marker = map.addMarker(new MarkerOptions().title( list.get(i).getmName()).position( new LatLng(latitude, longitude))); hashmap.put(marker, list.get(i).getmId()); } // When the user click on marker information will be open new activity map.setOnInfoWindowClickListener(new OnInfoWindowClickListener() { @Override public void onInfoWindowClick(Marker marker) { // TODO Auto-generated method stub int id = hashmap.get(marker)-1; Bundle bundle = new Bundle(); DataBase.Object object = new Object(); object = list.get(id); bundle.putSerializable("ob", object); Intent intent = new Intent(getActivity(), Places.class); intent.putExtras(bundle); startActivity(intent); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addMarkers() {\n\n for (MarkerPropio m : listMarkers) {\n LatLng posicion = new LatLng(m.getLatitud(), m.getLogitud());\n final MarkerOptions marker = new MarkerOptions()\n .position(posicion)\n .icon(BitmapDescriptorFactory.fromResou...
[ "0.7311496", "0.70249975", "0.70243734", "0.692919", "0.6925318", "0.6911619", "0.689577", "0.6887617", "0.68523234", "0.6836941", "0.67785037", "0.67771053", "0.6746005", "0.67420936", "0.6707727", "0.6664817", "0.6647643", "0.6628125", "0.6616582", "0.6606718", "0.6584461",...
0.7553457
0
TODO Autogenerated method stub
@Override public void onInfoWindowClick(Marker marker) { int id = hashmap.get(marker)-1; Bundle bundle = new Bundle(); DataBase.Object object = new Object(); object = list.get(id); bundle.putSerializable("ob", object); Intent intent = new Intent(getActivity(), Places.class); intent.putExtras(bundle); startActivity(intent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Add a new user to the database. The new user will not be activated and have a random password assigned. It is the responsibility of the caller to make sure the new user has a means of activating their account.
public User createUser(UserDTO userDto) { User user = new User(); user.setLogin(userDto.getLogin()); user.setFirstName(userDto.getFirstName()); user.setLastName(userDto.getLastName()); user.setEmail(userDto.getEmail()); if (userDto.getLangKey() == null) { user.setLangKey("en"); // default language } else { user.setLangKey(userDto.getLangKey()); } String encryptedPassword = passwordEncoder.encode(RandomUtil.generatePassword()); user.setPassword(encryptedPassword); user.setResetKey(RandomUtil.generateResetKey()); user.setResetDate(ZonedDateTime.now()); user.setActivated(false); user.setRoles(getUserRoles(userDto)); userRepository.save(user); log.debug("Created Information for User: {}", user); return user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int insertUser(User newUser) {\r\n\r\n try {\r\n BusTrackerDB = this.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(\"username\", newUser.getUsername());\r\n values.put(\"password\", newUser.getPassword());\r\n\r\n...
[ "0.7330902", "0.72758096", "0.7214464", "0.71626204", "0.71559775", "0.71327055", "0.712628", "0.70727545", "0.70651627", "0.70578295", "0.7040146", "0.70332444", "0.7018973", "0.70046693", "0.700366", "0.6989313", "0.6975465", "0.69734013", "0.69727755", "0.69709766", "0.694...
0.0
-1
Update basic information (first name, last name, email, language) for the current user.
public void updateUser(String firstName, String lastName, String email, String langKey) { userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin()).ifPresent(user -> { user.setFirstName(firstName); user.setLastName(lastName); user.setEmail(email); user.setLangKey(langKey); log.debug("Changed Information for User: {}", user); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk updateUser\");\r\n\t}", "private void saveUserInformation() {\n name.setText(nameInput.getText().toString());\n\n if (name.getText().toString().isEmpty()) {\n name.setError(\"Name required\");\n name.reques...
[ "0.7013294", "0.6935942", "0.680169", "0.67241806", "0.6700118", "0.6680306", "0.66797537", "0.6652704", "0.65978223", "0.65849096", "0.6583428", "0.65812653", "0.6556191", "0.65531945", "0.65213406", "0.6510827", "0.6508878", "0.64880466", "0.6484215", "0.6471465", "0.646688...
0.7371399
0
Update all information for a specific user, and return the modified user.
public Optional<UserDTO> updateUser(UserDTO userDto) { return Optional.of(userRepository .findOne(userDto.getId())) .map(user -> { user.setLogin(userDto.getLogin()); user.setFirstName(userDto.getFirstName()); user.setLastName(userDto.getLastName()); user.setEmail(userDto.getEmail()); user.setActivated(userDto.isActivated()); user.setLangKey(userDto.getLangKey()); Set<Role> managedRoles = user.getRoles(); managedRoles.clear(); managedRoles.addAll(getUserRoles(userDto)); log.debug("Changed Information for User: {}", user); return user; }) .map(userMapper::userToUserDTO); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User UpdateUser(User user){\n\t\t\treturn user;\n\t\t}", "ResponseMessage updateUser(final User user);", "public void updateUser(User user) {\n\t\t\r\n\t}", "public String update() {\r\n\t\tuserService.update(userEdit);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"update\";\r\n\t}"...
[ "0.7835854", "0.7647325", "0.7580148", "0.7497803", "0.74960774", "0.7461639", "0.746063", "0.7444397", "0.7418995", "0.7418995", "0.7410621", "0.7398119", "0.7388299", "0.7318675", "0.72982174", "0.7285237", "0.7278825", "0.72633743", "0.7224204", "0.718487", "0.7166245", ...
0.67655563
62
Delete the user with the given login.
public void deleteUser(String login) { userRepository.findOneByLogin(login).ifPresent(user -> { userRepository.delete(user); log.debug("Deleted User: {}", user); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void removeUser(String login) {\n try (PreparedStatement pst = this.conn.prepareStatement(\"DELETE FROM users WHERE login = ?\")) {\n pst.setString(1, login);\n pst.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "publ...
[ "0.7842389", "0.78171885", "0.7339181", "0.732062", "0.72806025", "0.7237815", "0.7185602", "0.71842104", "0.7168893", "0.715786", "0.7034591", "0.70232475", "0.6979114", "0.6950245", "0.6912177", "0.6910618", "0.6896645", "0.68808097", "0.6879136", "0.6850714", "0.6832403", ...
0.857147
0
Change the current user's password.
public void changePassword(String password) { userRepository.findOneByLogin(SecurityUtils.getCurrentUserLogin()).ifPresent(user -> { String encryptedPassword = passwordEncoder.encode(password); user.setPassword(encryptedPassword); log.debug("Changed password for User: {}", user); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setUserPassword(String newPassword) {\n profile.setPassword(currentUser, newPassword);\n }", "public void setPassword(java.lang.String newPassword);", "void setPassword(Password newPassword, String plainPassword) throws NoUserSelectedException;", "@Override\n public boolean changeCur...
[ "0.81507105", "0.81398386", "0.7911613", "0.7687582", "0.7645982", "0.76141953", "0.7595653", "0.7558049", "0.75443983", "0.7490715", "0.7467969", "0.74291885", "0.74090576", "0.74090576", "0.74090576", "0.7382158", "0.7340699", "0.725353", "0.7243665", "0.71739924", "0.71178...
0.75138503
9
Get a page of users.
@Transactional(readOnly = true) public Page<UserDTO> getAllManagedUsers(Pageable pageable) { log.debug("Request to get all Users"); return userRepository.findAllByLoginNot(pageable, Constants.ANONYMOUS_USER) .map(userMapper::userToUserDTO); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Set<String> getUsers(String page);", "public PageList<User> getUserPageList(User user, int pageSize, int pageNum) throws DataAccessException;", "public Page<User> findAll(Pageable pageable);", "@GetMapping\n public String getUsers(@RequestParam(value =\"page\", defaultValue = \"1\") int page,\n ...
[ "0.7877788", "0.7412282", "0.6849328", "0.6827293", "0.6805876", "0.6790041", "0.67646044", "0.6739378", "0.67189896", "0.6658679", "0.66557115", "0.6625835", "0.65834016", "0.6582009", "0.65021145", "0.65005755", "0.64996076", "0.6485916", "0.64848167", "0.64441395", "0.6441...
0.0
-1
Get the projects a given user has any role in.
@Transactional(readOnly = true) public List<ProjectDTO> getProjectsAssignedToUser(String login) { User userByLogin = userRepository.findOneWithRolesByLogin(login).get(); List<Project> projectsOfUser = new ArrayList<>(); for (Role role : userByLogin.getRoles()) { // get all projects for admin if (AuthoritiesConstants.SYS_ADMIN.equals(role.getAuthority().getName())) { return projectMapper.projectsToProjectDTOs(projectRepository.findAll()); } // get unique project from roles if (!projectsOfUser.contains(role.getProject())) { projectsOfUser.add(role.getProject()); } } return projectMapper.projectsToProjectDTOs(projectsOfUser); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Project> allProjects() {\n ArrayList<Project> projects = new ArrayList<>();\n for (Role role : this.roles) {\n if (role instanceof Member) {\n projects.add(((Member) role).getProject());\n } else if (role instanceof Leader) {\n proj...
[ "0.71026707", "0.6798331", "0.65896755", "0.65871054", "0.64485687", "0.6364337", "0.62863714", "0.6272251", "0.6085279", "0.60433424", "0.6019998", "0.60008365", "0.5970659", "0.59587413", "0.5941708", "0.59282285", "0.5913379", "0.58965355", "0.58803445", "0.5879192", "0.58...
0.7044436
1
Get the current user.
@Transactional(readOnly = true) public User getUserWithAuthorities() { return userRepository.findOneWithRolesByLogin(SecurityUtils.getCurrentUserLogin()) .orElse(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public User getCurrentUser() {\n\t\tString id = contextHolder.getUserId();\r\n\t\treturn userRepository.get(id);\r\n\t}", "public static User getCurrentUser() {\n\t\treturn ApplicationContext.getInstance().getCurrentUser();\n\t}", "private User getUser() {\r\n\t\tUserService userService = UserServiceFactory.ge...
[ "0.8369364", "0.82508093", "0.81224155", "0.8059196", "0.80084556", "0.8004987", "0.8004983", "0.79203", "0.784653", "0.7816411", "0.7792965", "0.77753365", "0.7769282", "0.77001184", "0.76925874", "0.768298", "0.766507", "0.76614004", "0.7641961", "0.76227045", "0.76016366",...
0.0
-1
Not activated users should be automatically deleted after 3 days. This is scheduled to get fired everyday, at 01:00 (am).
@Scheduled(cron = "0 0 1 * * ?") public void removeNotActivatedUsers() { ZonedDateTime now = ZonedDateTime.now(); List<User> users = userRepository .findAllByActivatedIsFalseAndCreatedDateBefore(now.minusDays(3)); for (User user : users) { log.debug("Deleting not activated user {}", user.getLogin()); userRepository.delete(user); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Scheduled(cron = \"0 0 1 * * ?\")\n\tpublic void removeNotActivatedUsers() {\n\t\tDateTime now = new DateTime();\n\t\tList<User> users = userRepository\n\t\t\t\t.findAllByActivatedIsFalseAndCreatedDateBefore(now.minusDays(3));\n\t\tfor (User user : users) {\n\t\t\tlog.debug(\"Deleting not activated user {}\", use...
[ "0.8203536", "0.67530346", "0.6130596", "0.549849", "0.54830366", "0.547205", "0.5446493", "0.5404585", "0.53871423", "0.5344045", "0.5326186", "0.5320905", "0.530552", "0.52972645", "0.5284898", "0.52772087", "0.5277021", "0.52763474", "0.52673054", "0.52671075", "0.5247866"...
0.8154884
1
Constructs a new polygon with the given vertices. The vertices must form a simple polygon and must be given in either clockwise or counterclockwise order.
public Polygon(List<Point> vertices) { this.vertices = vertices; this.segments = new ArrayList<LineSegment>(vertices.size()); Point first = vertices.get(0); Point current = first; for (int i = 1; i < vertices.size(); i++) { Point next = vertices.get(i); segments.add(new LineSegment(current, next)); current = next; } segments.add(new LineSegment(current, first)); vertices.add(first); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Polygon4D(ArrayList<Vertex> vertices){\n\t\t\n\t\tthis.vertices = vertices;\n\t\tsetFaces();\n\t}", "private static double[] makePolygon() {\n double[] polygon = new double[POINTS*2];\n \n for (int i = 0; i < POINTS; i++) {\n double a = i * Math.PI * 2.0 / POINTS;\n ...
[ "0.6643565", "0.61017877", "0.5830574", "0.58270395", "0.57636046", "0.5684814", "0.568481", "0.5644925", "0.5615554", "0.55953777", "0.559102", "0.55232704", "0.55121636", "0.5454939", "0.54320586", "0.54078144", "0.5406575", "0.54048866", "0.5404025", "0.53479064", "0.53177...
0.7627039
0
Returns the area of this polygon.
public double area() { if (area != 0) return area; Point current = vertices.get(0); for (int i = 1; i < vertices.size(); i++) { Point next = vertices.get(i); area += current.crossProduct(next); current = next; } orientation = area > 0 ? "CCW" : "CW"; area = Math.abs(area / 2); return area; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Polygon getArea() {\n\t\treturn area;\n\t}", "public double getArea() {\n return ((this.xR - this.xL) * (this.yT - this.yD));\n }", "public int area() {\r\n\t\tint area = (getLength()) * (getBreath());\r\n\t\treturn (area);\r\n\t}", "public double getArea() {\n\t\treturn this.area;\n\t}", ...
[ "0.8341735", "0.7833721", "0.78149045", "0.7808657", "0.77667207", "0.7733111", "0.76727885", "0.7649575", "0.76411605", "0.7640796", "0.7640344", "0.7625202", "0.7586574", "0.75538886", "0.75468725", "0.754185", "0.7540331", "0.75303894", "0.75089496", "0.7501422", "0.749182...
0.76673746
7
Returns the orientation of the vertices of this polygon.
public String orientation() { if (orientation == null) area(); return orientation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final Vector2D getOrientation() {\n return orientation;\n }", "public float getRotationAngle() {\n return mPolygonShapeSpec.getRotation();\n }", "public double getOrientation()\r\n\t{\r\n\t\treturn Math.atan2(-end.getY()+start.getY(), end.getX()-start.getX());\r\n\t}", "public flo...
[ "0.6792841", "0.66841394", "0.6656061", "0.6481423", "0.6462535", "0.643318", "0.64078414", "0.6392409", "0.6356453", "0.63194966", "0.62918", "0.6156541", "0.6155147", "0.6131555", "0.6129622", "0.6037524", "0.6032674", "0.6029049", "0.60224676", "0.5962337", "0.5930254", ...
0.6622115
3
Returns 1, 0 or 1 as p is outside, on or inside this polygon.
public int insidePoly(Point p) { if (vertices.contains(p)) return 0; double angleSum = 0; Point u = vertices.get(0); for (int i = 1; i < vertices.size(); i++) { Point v = vertices.get(i); Point pu = u.subtract(p); Point pv = v.subtract(p); double angle = Math.atan2(pu.crossProduct(pv), pu.dotProduct(pv)); if (Math.abs(Math.abs(angle) - Math.PI) < EPSILON) return 0; angleSum += angle; u = v; } if (Math.abs(angleSum) > Math.PI) return 1; return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@JsMethod(name = \"interiorContainsPoint\")\n public boolean interiorContains(double p) {\n return p > lo && p < hi;\n }", "static boolean PointInPolygon(final PT[] p, PT q) {\r\n\t\tboolean c = false;\r\n\t\tfor (int i = 0; i < p.length; i++) {\r\n\t\t\tint j = (i + 1) % p.length;\r\n\t\t\tif ((p[i].y <= q...
[ "0.73258394", "0.685917", "0.67844254", "0.6700918", "0.6644435", "0.655375", "0.64696497", "0.6442981", "0.6419617", "0.63620955", "0.63435405", "0.6273844", "0.62653214", "0.62353355", "0.6220488", "0.6164318", "0.6147767", "0.6145761", "0.6107024", "0.6071492", "0.60371864...
0.7193433
1
TODO Autogenerated method stub
public static void main(String[] args) { String s="abinaya"; int count=0; int n=s.length()-1;int i=0;int j=n; while(i!=j) { if(s.charAt(i)==s.charAt(j)) { i++;j--; } else count++; i++;j--; } if(count==0) { System.out.println("the given is string is palindrome"); } else System.out.println("the given is string is not palindrome"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
=========================================================== Override Methods ===========================================================
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); initViews(savedInstanceState); mPresenter = onLoadPresenter(savedInstanceState); if (mPresenter != null) { mPresenter.attachView(this); mPresenter.subscribe(); } initEventAndData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\...
[ "0.7462368", "0.73994255", "0.7191272", "0.71695834", "0.7124893", "0.7056277", "0.7029824", "0.7029824", "0.70167154", "0.6985222", "0.6985222", "0.6970448", "0.69442546", "0.69275594", "0.6805785", "0.6795574", "0.6788476", "0.6769122", "0.6735416", "0.6703676", "0.6695863"...
0.0
-1
=========================================================== Define Methods ===========================================================
protected abstract P onLoadPresenter(Bundle savedInstanceState);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {...
[ "0.6723513", "0.6530224", "0.64759845", "0.64723283", "0.64317274", "0.6424724", "0.6424074", "0.6419816", "0.6379648", "0.6367273", "0.6350311", "0.634702", "0.6340371", "0.6318542", "0.6318542", "0.6313613", "0.63031983", "0.6303038", "0.6274547", "0.62706023", "0.6243562",...
0.0
-1
create car and bike object
public static void main(String[] args){ Vehicle bike = new Vehicle("blue"); // Vehicle car = new Vehicle(); // contruct is being used on this new object Vehicle redCar = new Vehicle("red"); System.out.println(redCar.getColor()); // set bike color and wheels // bike.setColor("Blue"); bike.setNumberOfWheels(2); // get bike color and wheels System.out.println(" Bike object - color" + bike.getColor()); System.out.println(" Bike object - Wheels" + bike.getNumberOfWheels()); // set car color and wheels // car.setColor("Green"); // car.setNumberOfWheels(4); // get car color and wheels // System.out.println(" Car object - color" + car.getColor()); // System.out.println(" Car object - Wheels" + car.getNumberOfWheels()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createBike(){\n createFrame();\n addWheels();\n addPedals();\n getPrice();\n }", "public void createBike() {\n createFrame();\n addWheels();\n addPedals();\n getPrice();\n }", "public Bike createCityBike() {\n Wheels cityWheels = new ...
[ "0.75508595", "0.75239635", "0.7185892", "0.6919602", "0.6919602", "0.6504572", "0.63217527", "0.63204086", "0.6307148", "0.629326", "0.61392146", "0.6121396", "0.6114216", "0.6104773", "0.6054029", "0.60503167", "0.6006575", "0.60032904", "0.597035", "0.59087", "0.59062594",...
0.6726071
5
int size = 1024;
public static void start(){ int size = 1024; int max = 32; GenericObjectPoolConfig genericObjectPoolConfig = new GenericObjectPoolConfig(); genericObjectPoolConfig.setMaxTotal(size * max); genericObjectPoolConfig.setMaxIdle(size * max); genericObjectPoolConfig.setMinIdle(size); long time = 1000 * 30; genericObjectPoolConfig.setMaxWaitMillis(time); genericObjectPoolConfig.setSoftMinEvictableIdleTimeMillis(time); updateEventCacheFactory = new UpdateEventCacheFactory(new UpdateEventPoolFactory(), genericObjectPoolConfig); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getLocalSize();", "public int getLocalSize();", "long getSize();", "int getSize ();", "public int getSize(){return _size;}", "int fixedSize();", "public int getSize(){\n //To be written by student\n return localSize;\n }", "int getSize();", "int getSize();", "int getSize();",...
[ "0.7480682", "0.7381384", "0.735615", "0.72936696", "0.7211244", "0.7174475", "0.7160874", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.7149912", "0.71069974", ...
0.0
-1
create a new view
@Override public MemeRecycleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.meme_cell, parent, false); // set the view's size, margins, paddings and layout parameters return new MemeRecycleViewHolder(v); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "View createView();", "@Override\n public void Create() {\n\n initView();\n }", "private View create(PersistedView pView) {\n DsmSorting sorting = nameToSorting.get(pView.dsmSortingName);\n if (null == sorting) {\n sorting = DsmSorting.values()[0];\n }\n\n Vie...
[ "0.83559227", "0.7407321", "0.7255932", "0.7184321", "0.71416366", "0.70963496", "0.70311505", "0.6987128", "0.6879693", "0.68619394", "0.67851686", "0.67701006", "0.6756971", "0.67380404", "0.67086893", "0.67063946", "0.67045623", "0.66373485", "0.6610312", "0.65590096", "0....
0.0
-1
A method to handle service exception and response with custom error object.
@ExceptionHandler(ServiceException.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public ExceptionResponse serviceException(final ServiceException serviceException) { return processError(serviceException, HttpStatus.INTERNAL_SERVER_ERROR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@ExceptionHandler({CSHRServiceException.class})\n @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)\n @ResponseBody\n public CSHRServiceStatus handleException(CSHRServiceException ex) {\n log.error(ex.getCshrServiceStatus().getSummary(), ex);\n\n return ex.getCshrServiceStatus();\n }", ...
[ "0.7092178", "0.6915946", "0.67945725", "0.6767332", "0.67636377", "0.6738534", "0.66475844", "0.6642358", "0.6581788", "0.65762144", "0.65587753", "0.65480715", "0.65466756", "0.65359414", "0.6526", "0.6460025", "0.6458379", "0.6443842", "0.6407831", "0.63751596", "0.6358165...
0.7284543
0
Method not allowed exception handler.
@ExceptionHandler(MethodNotAllowedException.class) @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) public ExceptionResponse methodNotAllowedException(final MethodNotAllowedException notAllowedException) { return processError(notAllowedException, HttpStatus.METHOD_NOT_ALLOWED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@ResponseStatus (HttpStatus.METHOD_NOT_ALLOWED)\n\t@ExceptionHandler (HttpRequestMethodNotSupportedException.class)\n\tpublic Result handleHttpRequestMethodNotSupportedException (HttpRequestMethodNotSupportedException e)\n\t{\n\t\treturn new Result ().failure (\"request_method_not_supported\");\n\t}", "@Override...
[ "0.6636575", "0.631444", "0.6300355", "0.626121", "0.62429374", "0.62380743", "0.6233672", "0.6209403", "0.6183338", "0.6170164", "0.6135163", "0.6113512", "0.6091296", "0.60546726", "0.6041141", "0.602853", "0.5952869", "0.59411335", "0.59407157", "0.5934032", "0.5883297", ...
0.70990676
0
Bad request exception handler.
@ExceptionHandler(BadRequestException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) public ExceptionResponse badRequestException(final BadRequestException badRequestException) { return processError(badRequestException, HttpStatus.BAD_REQUEST); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@ExceptionHandler({IllegalArgumentException.class})\n public R handleException(IllegalArgumentException e, HttpServletRequest request) {\n return R.error(400, e.getMessage());\n }", "private Response badRequest(final String message, final Exception e) {\n logger.debug(message, e == null && logger.isDebug...
[ "0.7391113", "0.7197803", "0.71427697", "0.70581603", "0.68627656", "0.6797348", "0.6711968", "0.6682647", "0.66063064", "0.659898", "0.6572907", "0.6570735", "0.6561465", "0.65503085", "0.65428674", "0.6517088", "0.64810216", "0.6466812", "0.64602417", "0.6416992", "0.641454...
0.61928636
35
Constraint violation exception handler.
@ExceptionHandler(ConstraintViolationException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) public ExceptionResponse constraintViolationException(final ConstraintViolationException violationException) { return processError(violationException, HttpStatus.BAD_REQUEST); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@ExceptionHandler(value = {ConstraintViolationException.class})\t\t\t\t\t\t\t\t//restringir que eh pra excecao constraintValidation\r\n\tprotected ResponseEntity<Object> constraintValidationException(ConstraintViolationException ex\r\n\t\t\t, WebRequest request){\r\n\t\t\r\n\t\tList<ExceptionDTO> response = new Ar...
[ "0.6579688", "0.597865", "0.5963095", "0.5907206", "0.58836806", "0.58836323", "0.58776957", "0.5877378", "0.5866048", "0.58552307", "0.58427066", "0.58390826", "0.5838462", "0.5836217", "0.5810162", "0.5776535", "0.5760508", "0.5729084", "0.5726516", "0.5722268", "0.5716268"...
0.634972
1
Resource not found exception handler.
@ExceptionHandler(ResourceNotFoundException.class) @ResponseStatus(HttpStatus.NOT_FOUND) public ExceptionResponse notFoundException(final ResourceNotFoundException notFoundException) { return processError(notFoundException, HttpStatus.NOT_FOUND); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ResourceNotFoundException(String msg) {\r\n\t\tsuper(msg);\r\n\t}", "@ExceptionHandler(ResourceNotFoundException.class)\n public BaseResponse handleResourceNotFound(ResourceNotFoundException e) {\n return BaseResponse.buildErrorResponse(404, e);\n }", "@ExceptionHandler(ResourceNotFoundExce...
[ "0.760538", "0.7467611", "0.7450715", "0.72593796", "0.7120243", "0.7114362", "0.7031842", "0.6802736", "0.67939204", "0.6779894", "0.67600405", "0.6724013", "0.6718617", "0.6666069", "0.657246", "0.65561587", "0.6498826", "0.64906645", "0.64642495", "0.64483523", "0.64399225...
0.66343075
14
Generic exception handler method.
@ExceptionHandler(Exception.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public ExceptionResponse exception(final Exception exception) { return processError(exception, HttpStatus.INTERNAL_SERVER_ERROR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void exceptionHandler(Handler<Exception> handler) {\n\t\t\n\t}", "void handleError(Exception ex);", "public interface ExceptionHandler\n{\n //TODO not sure how to handle this\n}", "protected abstract void exceptionsCatching( ExceptionType exceptionType );", "void handleException(Contex...
[ "0.7731117", "0.74597454", "0.74252397", "0.7164003", "0.71219397", "0.69591576", "0.6895114", "0.6821879", "0.6786052", "0.67701644", "0.6707187", "0.6684261", "0.6681464", "0.66341275", "0.66015285", "0.6592682", "0.6533771", "0.6527411", "0.65241534", "0.6517711", "0.64906...
0.0
-1
A method to handle field validation errors.
@Override @SuppressWarnings("all") protected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex, HttpHeaders headers, HttpStatus status, WebRequest request) { Map<String, Object> hashMap = new LinkedHashMap<>(); Map<String, Set<String>> setMap = ex.getBindingResult() .getFieldErrors() .stream() .collect(Collectors.groupingBy( FieldError::getField, Collectors.mapping(FieldError::getDefaultMessage, Collectors.toSet()))); hashMap.put("errors", setMap); return new ResponseEntity<>(hashMap, headers, status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ValidationError getValidationError();", "void onValidationFailed();", "@ExceptionHandler(MethodArgumentNotValidException.class)\n public ResponseEntity<Object> processValidationError(MethodArgumentNotValidException ex) {\n BindingResult result = ex.getBindingResult();\n List<FieldError> fieldE...
[ "0.6783745", "0.66691965", "0.6593683", "0.65812737", "0.6411649", "0.64094913", "0.6399125", "0.62735957", "0.623522", "0.6225869", "0.6212552", "0.61757976", "0.61700034", "0.61596364", "0.6146254", "0.6115253", "0.6114112", "0.6114112", "0.6114112", "0.6108199", "0.6095115...
0.6395031
7
TODO Autogenerated method stub
@Override public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.what == 1) { CkeckUpServer.this.stopSelf(); } else if (msg.what == 2) { if (android.os.Build.VERSION.SDK_INT < 12) { CkeckUpServer.this.stopSelf(); return; } // 发送通知栏 有新版本应用程序 NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder( CkeckUpServer.this); Intent service = new Intent(CkeckUpServer.this, org.aisin.sipphone.DwonNewAppService.class); service.putExtra("ver", ver); service.putExtra("update_addr", update_addr); service.putExtra("update_tips", update_tips); PendingIntent pendingIntent = PendingIntent.getService( CkeckUpServer.this, NotificationConstants.NrequestCode_UP, service, PendingIntent.FLAG_UPDATE_CURRENT); mBuilder.setLargeIcon(BitmapFactory.decodeResource( CkeckUpServer.this.getResources(), R.drawable.ic_launcher)); mBuilder.setSmallIcon(R.drawable.notificationimage); mBuilder.setContentTitle("环宇新版本升级啦"); mBuilder.setContentText(update_tips); mBuilder.setTicker("发现环宇新版本\n" + update_tips); mBuilder.setOngoing(false);// true无法通过左右滑动清除 mBuilder.setAutoCancel(true);// 点击后消失 mBuilder.setContentIntent(pendingIntent); mBuilder.setDefaults(Notification.DEFAULT_ALL); mBuilder.setNumber(1); mNotificationManager .notify(NotificationConstants.NrequestCode_UP, mBuilder.build()); CkeckUpServer.this.stopSelf(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public IBinder onBind(Intent intent) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@SuppressLint("SimpleDateFormat") @Override public void onCreate() { super.onCreate(); /* if (!CheckUpadateTime.CheckResult_4Ckeckupserver_uptime(this)) { stopSelf(); return; } new Thread(new Runnable() { @Override public void run() { try { String url = URLTools .GetHttpURL_4CheckUpdate(CkeckUpServer.this); String result = HttpUtils.result_url_get(url, "{'result':'-14'}"); JSONObject jsonobject = new JSONObject(result.trim()); update_addr = jsonobject.optString("update_addr"); update_tips = jsonobject.optString("update_tips"); ver = jsonobject.optString(SharedPreferencesTools.upAPPVer); int result_int = jsonobject.optInt("result"); if (result_int != 0) { mHandler.sendEmptyMessage(1); return; } // 存储更新时间 SimpleDateFormat sdf = new SimpleDateFormat("MMdd"); String date = sdf.format(new Date()); SharedPreferencesTools .getSharedPreferences_4UPSERVER(CkeckUpServer.this) .edit() .putString(SharedPreferencesTools.CUPDATE, date) .commit(); if (update_addr != null && !"".equals(update_addr)) { mHandler.sendEmptyMessage(2); } else { mHandler.sendEmptyMessage(1); } } catch (Exception e) { mHandler.sendEmptyMessage(1); } } }).start();*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { String s = "Hello world"; int size = lengthOfLastWord(s); System.out.println(size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Constructor: Saves handles to the url and identifier. The identifier should look like a filename, and it must have the correct extension so SoundSystem knows what format to use for the file referenced by the URL instance.
public FilenameURL( URL url, String identifier ) { // grab a handle to the message logger: logger = SoundSystemConfig.getLogger(); filename = identifier; this.url = url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FilenameURL( String filename )\n {\n // grab a handle to the message logger:\n logger = SoundSystemConfig.getLogger();\n\n this.filename = filename;\n url = null;\n }", "private SoundPlayer(URI uri) {\n\t\tfile = new File(uri.getPath());\n\t}", "public SaveStore(String ...
[ "0.60005605", "0.5631247", "0.54014385", "0.5327099", "0.5201054", "0.5075064", "0.4932276", "0.4909202", "0.4886909", "0.4831748", "0.48138365", "0.48089173", "0.48082012", "0.47667366", "0.47361827", "0.47334838", "0.47329655", "0.47147417", "0.47008586", "0.46866396", "0.4...
0.70332325
0
Constructor: Saves a handle to the filename (used later to generate a URL instance). The file may either be located within the JAR or at an online location. If the file is online, filename must begin with " since that is how SoundSystem recognizes URL names.
public FilenameURL( String filename ) { // grab a handle to the message logger: logger = SoundSystemConfig.getLogger(); this.filename = filename; url = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FilenameURL( URL url, String identifier )\n {\n // grab a handle to the message logger:\n logger = SoundSystemConfig.getLogger();\n\n filename = identifier;\n this.url = url;\n }", "public FileReceiver(String filename) {\r\n _fileName = filename;\r\n }", "publ...
[ "0.6478271", "0.6200478", "0.6086638", "0.60769105", "0.60756147", "0.58036774", "0.57878965", "0.57400155", "0.5643627", "0.5624743", "0.5620232", "0.5616679", "0.56125945", "0.56125945", "0.5594104", "0.5584634", "0.55616295", "0.5539618", "0.5520558", "0.55157727", "0.5503...
0.68800604
0
Returns the URL interface to the file. If a URL was not originally specified in the constructor, then the first time this method is called it creates a URL instance using the previously specified filename.
public URL getURL() { if( url == null ) { // Check if the file is online or inside the JAR: if( filename.matches( SoundSystemConfig.PREFIX_URL ) ) { // Online try { url = new URL( filename ); } catch( Exception e ) { errorMessage( "Unable to access online URL in " + "method 'getURL'" ); printStackTrace( e ); return null; } } else { // Inside the JAR url = getClass().getClassLoader().getResource( SoundSystemConfig.getSoundFilesPackage() + filename ); } } return url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private URL getURL(String filename) {\n\t\tURL url = null;\r\n\t\ttry { \r\n\t\t\turl = this.getClass().getResource(filename);\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn url;\r\n\t}", "URL toURL(FileReference fileReferece);", "public FilenameURL( String filename )\n {...
[ "0.715044", "0.6789643", "0.67402864", "0.6711371", "0.6686238", "0.66095734", "0.6520084", "0.639138", "0.638276", "0.6246967", "0.6230506", "0.61488634", "0.60567063", "0.6047496", "0.60224134", "0.59979314", "0.5964521", "0.59173006", "0.59101355", "0.59077233", "0.5897082...
0.694549
1
Prints an error message.
private void errorMessage( String message ) { logger.errorMessage( "MidiChannel", message, 0 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void printError(String message)\n {\n System.out.println(\"\\n\\n=============================\\n\\n\");\n System.out.println(message);\n System.out.println(\"\\n\\n=============================\\n\\n\");\n }", "void showError(String message);", "void showError(String m...
[ "0.765195", "0.75593597", "0.75593597", "0.7545536", "0.74014455", "0.7377976", "0.7269557", "0.72571194", "0.7162203", "0.7088485", "0.702529", "0.70199805", "0.6979989", "0.69458807", "0.69438183", "0.6898209", "0.6879639", "0.6869302", "0.68575233", "0.6848694", "0.6839244...
0.0
-1
Prints an exception's error message followed by the stack trace.
private void printStackTrace( Exception e ) { logger.printStackTrace( e, 1 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String displayError(Exception e) {\r\n\t\t\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\te.printStackTrace(new PrintWriter(sw));\r\n\t\tString ret_str = sw.toString();\r\n\t\t\r\n\t\treturn ret_str;\r\n\t}", "public void printError(RubyException excp) {\n if (excp == null || excp.isNi...
[ "0.67760575", "0.6627832", "0.659803", "0.65960544", "0.65869176", "0.6586069", "0.65775603", "0.65677166", "0.6483507", "0.6407452", "0.64063096", "0.62644714", "0.61158323", "0.61134124", "0.61044914", "0.60962665", "0.59940976", "0.5967286", "0.59585905", "0.5938891", "0.5...
0.6180622
12
Creates new form AddStFrame
public addStFrame() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Frame createFrame();", "FRAME createFRAME();", "public FrameInsert() {\n initComponents();\n }", "public AddStationPanel(JFrame frame) {\n\t\tmainFrame = frame;\n\t\tinitialize();\n\t}", "public NewFrame() {\n initComponents();\n }", "private void createFrame(){\n System.out.pr...
[ "0.7044245", "0.700467", "0.6958252", "0.6597706", "0.65312445", "0.648609", "0.6482477", "0.64824253", "0.643996", "0.6297398", "0.62788224", "0.62543046", "0.6248449", "0.6246441", "0.62186706", "0.6208133", "0.6152065", "0.60915047", "0.6044096", "0.60417175", "0.6033611",...
0.7760246
0
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); txt_idSt = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); txt_stNumBin = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); txt_StLocation = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); txt_stname = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Aggiungi Stazione"); jLabel1.setText("Inserisci id stazione "); jLabel2.setText("Inserisci numero binari"); txt_stNumBin.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txt_stNumBinActionPerformed(evt); } }); jLabel3.setText("Inserisci Locazione"); txt_StLocation.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txt_StLocationActionPerformed(evt); } }); jLabel4.setText("Inserisci Nome Stazione"); txt_stname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txt_stnameActionPerformed(evt); } }); jButton1.setText("Aggiungi"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setText("Annulla"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txt_stNumBin, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(txt_idSt) .addComponent(jLabel2) .addComponent(txt_StLocation) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(txt_stname))) .addGroup(layout.createSequentialGroup() .addGap(35, 35, 35) .addComponent(jButton1) .addGap(28, 28, 28) .addComponent(jButton2))) .addContainerGap(47, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txt_idSt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel2) .addGap(4, 4, 4) .addComponent(txt_stNumBin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txt_StLocation, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txt_stname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton2)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.7319975", "0.7291426", "0.7291426", "0.7291426", "0.7286372", "0.7249133", "0.72134817", "0.7208172", "0.7196412", "0.7190365", "0.7184679", "0.71593916", "0.7147999", "0.7093026", "0.7080469", "0.7056178", "0.69875216", "0.69774026", "0.69545585", "0.69538534", "0.6945255...
0.0
-1
Constructor de la clase Controlador que recibe dos parametros (vista, modelo)
public Controlador(Vista view, Modelo model){ //Se igualan las propiedades this.view = view; this.model = model; this.view.btnGuardar.addActionListener(this); //se iguala el modelo de la tabla table = new DefaultTableModel(); view.tablaResultado.setModel(table); //nombre para la columna de la tabla table.addColumn("Listado"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AfiliadoVista() {\r\n }", "public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }", "public Veiculo(String marca, String modelo, in...
[ "0.69880563", "0.6986625", "0.683546", "0.67823905", "0.67093074", "0.6705039", "0.6613791", "0.6588581", "0.6568051", "0.6553679", "0.6473831", "0.64417875", "0.6410769", "0.6393596", "0.6384976", "0.6373491", "0.63638324", "0.62754697", "0.6257017", "0.62468266", "0.6223046...
0.707465
0
Metodo para iniciar la vista
public void iniciar(){ view.setTitle("MVC Proyecto"); //Indica posicion, null -> posicion 0 = centro view.setLocationRelativeTo(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void iniciar() {\n\t\t\n\t}", "public void inicializarInterfaz() {\n\t\tvista.setVisible(true);\n\t\tvista.bienvenida.setVisible(true);\n\t\tvista.sel_billete.setVisible(false);\n\t\tvista.sel_fecha.setVisible(false);\n\t\tvista.detalles_compra.setVisible(false);\n\t\tvista.login.setVisible(f...
[ "0.7784787", "0.735515", "0.7301619", "0.7297632", "0.7288873", "0.7231947", "0.7198614", "0.7156365", "0.7061569", "0.7049462", "0.70439404", "0.7042891", "0.70282036", "0.70271456", "0.6936024", "0.6936024", "0.6908887", "0.68688285", "0.6865168", "0.68605447", "0.681303", ...
0.0
-1
Funcion que realiza el boton
@Override public void actionPerformed(ActionEvent e) { model.setText(view.txtTexto.getText()); model.Content(); Object []object = new Object[1]; object [0] = view.txtTexto.getText(); table.addRow(object); limpiar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void botonFuncional(JButton Boton){\n \n if(!caraUp){\n Boton.setEnabled(false);\n imagen1 =(ImageIcon) Boton.getDisabledIcon();\n v[0] = Boton;\n caraUp = true;\n cara1 = false;\n }\n else {\n Boton.setEnabled(fa...
[ "0.68368715", "0.67116666", "0.6116272", "0.60859025", "0.6081585", "0.60759705", "0.6027958", "0.5886448", "0.5853932", "0.5843504", "0.5840524", "0.5806997", "0.58000684", "0.58000207", "0.5796233", "0.5782111", "0.5766337", "0.57631075", "0.5723458", "0.57187057", "0.57043...
0.0
-1
Limpia el espacio de texto despues de almacenar
private void limpiar() { view.txtTexto.setText(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String limpiar_texto(String texto){\n \n texto = texto.replaceAll(\"\\n\",\"\");\n texto=texto.toUpperCase();\n for(int i=0;i<texto.length();i++){\n //Se crea un for que llenara el nuevo char\n int posicion = tabla.indexOf(texto.charAt(i)); //charat regresa el valor del arreglo\n ...
[ "0.66720533", "0.6639844", "0.65843135", "0.6575439", "0.6230856", "0.6193166", "0.6129038", "0.6118766", "0.61065453", "0.6097829", "0.60884935", "0.6085086", "0.60621464", "0.6022037", "0.6016105", "0.601031", "0.597474", "0.5958228", "0.595345", "0.5944075", "0.5935935", ...
0.55702347
75
String str1 = new String("abc");
public static void main(String[] args) { String str2 = new String("a") + new String("bc"); str2.intern(); String str3 = "abc"; System.out.println(str2 == str3); Thread t = new Thread(); System.out.println(t.getState()); t.start(); System.out.println(t.getState()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n String str=new String(\"ab\");//创建几个对象?\n }", "public static void main(String[] args) {\n String s = \"aaa\";\n String b = new String(\"aaa\");\n System.out.println(b==\"aaa\");\n\n }", "public static void main(String args[]) {\n ...
[ "0.7645896", "0.7516464", "0.7190069", "0.70393395", "0.70374024", "0.68687713", "0.6707765", "0.66999793", "0.66925913", "0.6578794", "0.65457374", "0.65039706", "0.64893866", "0.64342237", "0.6410868", "0.63839555", "0.6332787", "0.6332787", "0.632602", "0.6307745", "0.6273...
0.59508324
45
// Setarisma ths sumperiforas tou button gia neo project //
@SuppressWarnings({ "serial" }) private void newTaskButtonHandler(Button NewTaskButton) { if (editable) { NewTaskButton.addListener(new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { errorMessages.setVisible(false); Task emptytask=new Task(--counter, project.getProjectID(), null,null, null,null,null,false, null,null, 1, null,null, "","") ; ViewEditTaskWindow wind=new ViewEditTaskWindow("New Task",emptytask,true,container,table,taskManager,db,project,thisobject) ; setProject(); wind.center(); UI.getCurrent().addWindow(wind); } }); } else { NewTaskButton.setEnabled(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void setRiippumatonMuuttuja(final int muuttuja) {\r\n this.riippumatonMuuttuja = muuttuja;\r\n }", "public void setBunga(int tipeBunga){\n }", "public void setIDEMPRESA(Integer idempresa) {\n\t\tthis.IDEMPRESA = idempresa;\n\t}", "public void setButacas(int butacas) {\r\n\t\tthis.bu...
[ "0.5626795", "0.55160433", "0.5483853", "0.5482515", "0.54150957", "0.5381948", "0.53581977", "0.53468573", "0.5344829", "0.5341227", "0.53376293", "0.53338057", "0.53168285", "0.527036", "0.52695966", "0.52651453", "0.5245398", "0.5197272", "0.5183701", "0.51821035", "0.5178...
0.0
-1
// Setarisma ths sumperiforas tou ok kai tou cancel button //
@SuppressWarnings("serial") private void cancelOkHandler(Button cancel,Button ok) { ok.addClickListener(new ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { errorMessages.setVisible(false); if (editable) { if (((!(tf0.getValue().toString().trim().length() > 0))||(tf0.getValue().toString().equals(""))||(tf0.getValue()==null)||(sf6.getValue()==null)||(sf1.getValue()==null)||(df3.getValue()==null))) { if ((!(tf0.getValue().toString().trim().length() > 0))||(tf0.getValue().toString().equals(""))||(tf0.getValue()==null)) { errorMessages.setValue("Wrong input on Name field(Name can not be empty!)."); errorMessages.setVisible(true); } if((sf1.getValue()==null)) { errorMessages.setValue("I need you to tell me the Customer!"); errorMessages.setVisible(true); } if((sf6.getValue()==null)) { errorMessages.setValue("Active field can't be empty!"); errorMessages.setVisible(true); } if ((df3.getValue()==null)) { errorMessages.setValue("I need the Start Date from you."); errorMessages.setVisible(true); } } else { if(!isfloat(tf7.getValue().toString())&&(!tf7.getValue().toString().equals(""))||tf7.getValue().toString().length()>5) { errorMessages.setValue("Budget should be a number with a max of 5 digits"); errorMessages.setVisible(true); } else { if (!(checkdates(df3.getValue(),df4.getValue())&&checkdates(df3.getValue(),df5.getValue())&&checkdates(df5.getValue(),df4.getValue()))) { if(!checkdates(df3.getValue(),df4.getValue())) { errorMessages.setValue("End date can't be before Start date."); errorMessages.setVisible(true); } if(!checkdates(df3.getValue(),df5.getValue())) { errorMessages.setValue("Deadline should be between start/end(check Deadline)."); errorMessages.setVisible(true); } if(!checkdates(df5.getValue(),df4.getValue())) { errorMessages.setValue("Deadline should be between start/end(check Deadline)."); errorMessages.setVisible(true); } } else { if(( Mode.equals("New Project"))||( Mode.equals("Edit"))) { setProject(); } //Chekare an oles oi hmeromhnies twn tasks sou einai swstes if (checkProjectTaskDates(project)) { try { db.projectModifier(Mode, project, taskManager); } catch (SQLException e) { ErrorWindow wind = new ErrorWindow(e); UI.getCurrent().addWindow(wind); e.printStackTrace(); } project_container.removeAllItems(); gntTraineeProjectUI.containerFiller(project_table,project_container); project_table.setContainerDataSource(project_container); close(); } else { errorMessages.setValue("Tasks/project dates mismatch(check task/project dates)."); errorMessages.setVisible(true); } } } } } else { close(); } } }); cancel.addClickListener(new ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { errorMessages.setVisible(false); close(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cancelar() {\n setCancelado(true);\n }", "public void cancelar() {\n controlGrabar = false;\n validaVacios = true;\n segUsuPerfil = null; \n existe = false;\n usuario = \"\";\n perfil = \"\";\n }", "public final void setRiippumatonMuuttu...
[ "0.5914468", "0.577992", "0.5742518", "0.5679777", "0.56501573", "0.5613368", "0.5504274", "0.54985875", "0.5487803", "0.54766804", "0.5453195", "0.5416804", "0.5373694", "0.5368062", "0.53613675", "0.5353795", "0.5345904", "0.5343257", "0.53157854", "0.53078914", "0.5304059"...
0.0
-1
// Arxikopoihse ton container //
public void containerInitializer(Container container) { container.addContainerProperty("Description", String.class, null); container.addContainerProperty("Start Date", Date.class, null); container.addContainerProperty("End Date", Date.class, null); container.addContainerProperty("Deadline", Date.class, null); container.addContainerProperty("Active", Image.class, null); container.addContainerProperty("Type",String.class, null); container.addContainerProperty("View", Button.class, null); container.addContainerProperty("Edit",Button.class, null); container.addContainerProperty("Delete",Button.class, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void cajas() {\n\t\t\n\t}", "void examineContainers(){\n\t\t\tif (this.receptacle != null)//checks and sees if there's any containers in the location.\n\t\t\t\tfor (int i = 0; i < this.receptacle.size(); i++)\n\t\t\t\t\tif (!(this.receptacle.get(i) instanceof SpecialtyContainer))//if it's a hidden...
[ "0.5523012", "0.54593724", "0.5420301", "0.5361835", "0.53598154", "0.52893037", "0.5210673", "0.5208269", "0.5188496", "0.5184044", "0.5174588", "0.5172961", "0.51655996", "0.5164649", "0.51579916", "0.5146057", "0.5119724", "0.5059974", "0.5044771", "0.50353557", "0.5013694...
0.0
-1
// Sunarthsh pou genizei to container kai prosthetei plhktra diaxeirishs twn tasks //
@SuppressWarnings({ "serial", "unchecked" }) public void containerFiller(Table table ,Container container,ArrayList<Task> tasks) { containerInitializer(container); removeFilter(table); for(Task ts : tasks) { Object[] row=new Object[]{ts.getTask_DESC(),ts.getTask_STARDATE(),ts.getTask_ENDDATE(),ts.getTask_DEADLINE(),ts.isTask_ACTIVE(),ts.getTask_Type()}; Object itemrow=container.addItem(); Item newItem = container.getItem(itemrow); Image active = new Image(null,new ThemeResource("icons/check-24.png")); Image notactive = new Image(null, new ThemeResource("icons/basic1-177_checkbox_no-24.png")); newItem.getItemProperty("Description").setValue(row[0]); newItem.getItemProperty("Start Date").setValue(row[1]); newItem.getItemProperty("End Date").setValue(row[2]); newItem.getItemProperty("Deadline").setValue(row[3]); if (ts.isTask_ACTIVE()) newItem.getItemProperty("Active").setValue(active); else newItem.getItemProperty("Active").setValue(notactive); newItem.getItemProperty("Type").setValue(row[5]); Button ViewButton=new Button(); Button EditButton=new Button (); Button DeleteButton=new Button(); ViewButton.setStyleName(BaseTheme.BUTTON_LINK); EditButton.setStyleName(BaseTheme.BUTTON_LINK); DeleteButton.setStyleName(BaseTheme.BUTTON_LINK); ViewButton.setIcon(new ThemeResource("icons/01_arrow_right-24.png")); EditButton.setIcon( new ThemeResource("icons/09_pencil-24.png")); DeleteButton.setIcon(new ThemeResource("icons/010_trash-2-24.png")); ViewButton.addListener(new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { ViewEditTaskWindow wind = new ViewEditTaskWindow("View",ts,false,container,table,null,db,project,thisobject); wind.center(); UI.getCurrent().addWindow(wind); } }); EditButton.addListener(new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { if (editable) { ViewEditTaskWindow wind = new ViewEditTaskWindow("Edit",ts,true,container,table,taskManager,db,project,thisobject); wind.center(); UI.getCurrent().addWindow(wind); } else { Notification.show("You are in View Mode you dont have privilege to edit or delete"); } } }); DeleteButton.addListener(new Button.ClickListener() { @Override public void buttonClick(com.vaadin.ui.Button.ClickEvent event) { if (editable) { ConfirmationwindowTask wind = new ConfirmationwindowTask(container,table,itemrow,ts,thisobject); UI.getCurrent().addWindow(wind); } else { Notification.show("You are in View Mode you dont have privilege to edit or delete"); } } }); if (!editable)EditButton.setEnabled(false); if (!editable)DeleteButton.setEnabled(false); newItem.getItemProperty("View").setValue(ViewButton); newItem.getItemProperty("Edit").setValue(EditButton); newItem.getItemProperty("Delete").setValue( DeleteButton); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void generateNewTasks(List<CaptureTask> tasks) {\n\t\t\r\n\t}", "protected final void spawn(Task<?>... task) {\n // Gets a list of tasks, make a forLoop, and add it the the queue of that specific task\n for (int i=0; i<task.length; i++){\n // We want the pool to add a given task.\...
[ "0.5966872", "0.58988065", "0.58771944", "0.58107597", "0.5796095", "0.5640548", "0.56348026", "0.56059754", "0.55203336", "0.54979897", "0.5468581", "0.5444134", "0.53771234", "0.5362599", "0.535526", "0.5298386", "0.5297841", "0.5292702", "0.52696466", "0.5256803", "0.52527...
0.0
-1
// Gemise twn pinaka apo to container //
@SuppressWarnings("serial") private void tableFiller(Container container,Table table) { table.setWidth("100%"); table.setHeight("100%"); table.setColumnWidth("Description", 140); table.setColumnWidth("View", 60); table.setColumnWidth("Edit", 60); table.setColumnWidth("Delete", 65); table.setPageLength(table.size()); table.setContainerDataSource(container); table.setConverter("Start Date", new StringToDateConverter() { @Override public DateFormat getFormat(Locale locale) { return new SimpleDateFormat("d/M/y"); } }); table.setConverter("End Date", new StringToDateConverter() { @Override public DateFormat getFormat(Locale locale) { return new SimpleDateFormat("d/M/y"); } }); table.setConverter("Deadline", new StringToDateConverter() { @Override public DateFormat getFormat(Locale locale) { return new SimpleDateFormat("d/M/y"); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ContainerWithMostWater() {\n }", "public void DoPutInNest(Holdable p);", "public void pin();", "public void pin();", "public ZoomDragger(TrekPane gpane) {\r\n super();\r\n this.trekPane = gpane;\r\n setOverlayLayer(gpane.getOverlayLayer());\r\n setEventLayer(gpane.getBackgrou...
[ "0.5360937", "0.49536705", "0.47862214", "0.47862214", "0.474147", "0.47373766", "0.4723967", "0.47208488", "0.45846906", "0.4518271", "0.45047483", "0.44702926", "0.4442006", "0.44345316", "0.44295698", "0.44241872", "0.4417345", "0.43937245", "0.4385674", "0.43805906", "0.4...
0.0
-1
// Dhmiourgia ths formas kai kathorismos twn idiothtwn ths //
private void formFiller(FormLayout fl) { fl.setSizeFull(); tf0=new TextField("Name"); tf0.setRequired(true); sf1 = new Select ("Customer"); try { for(String st :db.selectAllCustomers()) { sf1.addItem(st); } } catch (UnsupportedOperationException | SQLException e) { ErrorWindow wind = new ErrorWindow(e); UI.getCurrent().addWindow(wind); e.printStackTrace(); } sf1.setRequired(true); sf2 = new Select ("Project Type"); sf2.addItem("In house"); sf2.addItem("Outsourcing"); df3=new DateField("Start Date"); df3.setDateFormat("d-M-y"); df3.setRequired(true); df4=new DateField("End Date"); df4.setDateFormat("d-M-y"); df4.setRangeStart(df3.getValue()); df5=new DateField("Next DeadLine"); df5.setDateFormat("d-M-y"); df5.setRangeStart(df3.getValue()); df5.setRangeEnd(df4.getValue()); sf6 = new Select ("Active"); sf6.addItem("yes"); sf6.addItem("no"); sf6.setRequired(true); tf7=new TextField("Budget(mandays)"); tf8=new TextArea("Description"); tf9=new TextField("Inserted By"); tf10=new TextField("Inserted At"); tf11=new TextField("Modified By"); tf12=new TextField("Modified At"); if( project.getName()!=null)tf0.setValue(project.getName()); else tf0.setValue(""); if(!editable)tf0.setReadOnly(true); fl.addComponent(tf0, 0); if(project.getCustomerID()!=-1) try { sf1.setValue(db.selectCustomerforId(project.getCustomerID())); } catch (ReadOnlyException | SQLException e) { ErrorWindow wind = new ErrorWindow(e); UI.getCurrent().addWindow(wind); e.printStackTrace(); } else sf1.setValue(""); if(!editable)sf1.setReadOnly(true); fl.addComponent(sf1, 1); if(project.getProjectType()!=null)sf2.setValue(project.getProjectType()); else sf2.setValue(""); if(!editable)sf2.setReadOnly(true); fl.addComponent(sf2, 2); if(project.getStartDate()!=null) df3.setValue(project.getStartDate()); if(!editable)df3.setReadOnly(true); fl.addComponent(df3, 3); if(project.getEndDate()!=null) df4.setValue(project.getEndDate()); if(!editable)df4.setReadOnly(true); fl.addComponent(df4, 4); if(project.getNextDeadline()!=null)df5.setValue(project.getNextDeadline()); if(!editable)df5.setReadOnly(true); fl.addComponent(df5, 5); if (project.isActive())sf6.setValue("yes"); else sf6.setValue("no"); if(!editable)sf6.setReadOnly(true); fl.addComponent(sf6, 6); if(project.getBudget()!=-1.0) tf7.setValue(String.valueOf(project.getBudget())); else tf7.setValue(""); if(!editable)tf7.setReadOnly(true); fl.addComponent(tf7, 7); if(project.getDescription()!=null)tf8.setValue(project.getDescription()); else tf8.setValue(""); if(!editable)tf8.setReadOnly(true); fl.addComponent(tf8, 8); if(project.getInserted_by()!=null)tf9.setValue(project.getInserted_by()); else tf9.setValue(""); tf9.setEnabled(false); fl.addComponent(tf9, 9); if(project.getInserted_at()!=null)tf10.setValue(project.getInserted_at().toString()); else tf10.setValue(""); tf10.setEnabled(false); fl.addComponent(tf10, 10); if(project.getModified_by()!=null)tf11.setValue(project.getModified_by()); else tf11.setValue(""); tf11.setEnabled(false); fl.addComponent(tf11, 11); if(project.getModified_at()!=null)tf12.setValue(project.getModified_at().toString()); else tf12.setValue(""); tf12.setEnabled(false); fl.addComponent(tf12, 12); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void cajas() {\n\t\t\n\t}", "@DSComment(\"Private Method\")\n @DSBan(DSCat.PRIVATE_METHOD)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:28:20.919 -0500\", hash_original_method = \"D4C81D48070585F36B5352844546D049\", hash_generated_method...
[ "0.5982711", "0.5682057", "0.56770295", "0.56447136", "0.56244975", "0.5571892", "0.5533779", "0.5484336", "0.54774314", "0.54727894", "0.5462752", "0.5451562", "0.5440237", "0.54379016", "0.5417948", "0.54099894", "0.53806454", "0.5377604", "0.5376195", "0.5369534", "0.53460...
0.0
-1
// Dhmiourgia kai efarmogh filtrou ston pinaka twn tasks //
@SuppressWarnings("serial") private void setFilter(TextField filter,Table table) { filter.setImmediate(true); filter.setTextChangeEventMode(TextChangeEventMode.EAGER); filter.addTextChangeListener(new TextChangeListener() { Filter filter = null; public void textChange(TextChangeEvent event) { String search_text = event.getText(); Filterable f = (Filterable) table.getContainerDataSource(); if (filter != null) f.removeContainerFilter(filter); filter = new Or(new SimpleStringFilter("Description", search_text, true,false), new Or(new DateFilter("Start Date", search_text)), new Or(new DateFilter("End Date", search_text)), new Or(new DateFilter("Deadline", search_text)), new SimpleStringFilter("Type", search_text, true, false)); f.addContainerFilter(filter); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void findTasks(ArrayList<Task> tasks, String keywords) {\n ArrayList<Task> filteredTasks;\n filteredTasks = (ArrayList<Task>) tasks.stream()\n .filter((t) -> t.getTask().contains(keywords))\n .collect(Collectors.toList());\n if (filteredTasks.size() == 0) {...
[ "0.6406779", "0.64049107", "0.6363198", "0.6118038", "0.6061535", "0.5950296", "0.58382136", "0.5802221", "0.57747954", "0.5723079", "0.57115394", "0.5710965", "0.5645907", "0.56147784", "0.5610553", "0.5604795", "0.56040215", "0.5585402", "0.55584687", "0.5542099", "0.551106...
0.0
-1
// Boithitikh sunarthsh pou setarei to project //
private void setProject() { project.setName(tf0.getValue().toString()); project.setDescription(tf8.getValue().toString()); project.setEndDate(df4.getValue()); if (sf6.getValue().toString().equals("yes"))project.setActive(true); else project.setActive(false); if (!tf7.getValue().toString().equals(""))project.setBudget(Float.parseFloat(tf7.getValue().toString())); else project.setBudget(-1); project.setNextDeadline(df5.getValue()); project.setStartDate(df3.getValue()); try { if (sf1.getValue()!=null) project.setCustomerID(db.selectCustomerforName( sf1.getValue().toString())); } catch (SQLException|java.lang.NullPointerException e) { ErrorWindow wind = new ErrorWindow(e); UI.getCurrent().addWindow(wind); e.printStackTrace(); } project.setInserted_by("Grigoris"); project.setModified_by("Grigoris"); project.setRowversion(1); if (sf2.getValue()!=null)project.setProjectType(sf2.getValue().toString()); else project.setProjectType(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Project createProject();", "Project createProject();", "Project createProject();", "void setProject(InternalActionContext ac, HibProject project);", "Project getProject();", "LectureProject createLectureProject();", "public Project() {\n\t\t\n\t}", "public void setProject(Project project) {\n ...
[ "0.6131616", "0.6131616", "0.6131616", "0.6105386", "0.61039454", "0.57754433", "0.57741433", "0.57716745", "0.57716745", "0.576062", "0.5723604", "0.5721164", "0.5702455", "0.5677936", "0.56479615", "0.56479615", "0.56326324", "0.5623874", "0.56129503", "0.56098384", "0.5606...
0.65291816
0
// Boithitikh synarthsh pou tsekarei tis hmeromhnies //
private boolean checkdates(java.util.Date date,java.util.Date date2) { if (date==null||date2==null) return true; if (!date.after(date2)&&!date.before(date2))return true; return date.before(date2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void eisagwgiAstheni() {\n\t\t// Elegxw o arithmos twn asthenwn na mhn ypervei ton megisto dynato\n\t\tif(numOfPatient < 100)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tpatient[numOfPatient] = new Asthenis();\n\t\t\tpatient[numOfPatient].setFname(sir.readString(\"DWSTE TO ONOMA TOU ASTHENH: \")); // Pairnei...
[ "0.66364115", "0.65133125", "0.6155257", "0.6029723", "0.59240115", "0.59130615", "0.59130615", "0.59095544", "0.59094864", "0.5887264", "0.58814394", "0.5838726", "0.5829032", "0.58214337", "0.57863927", "0.57628834", "0.57627165", "0.57615876", "0.5760361", "0.5707525", "0....
0.0
-1
// Synarthsh pou tsekarei tis hmeromhnies gia ta tasks tou project //
private boolean checkProjectTaskDates(Project pr) { for(Task ts:taskManager.get("toInsert")) { if( checkdates(ts.getTask_STARDATE(),pr.getEndDate())&& checkdates(pr.getStartDate(),ts.getTask_STARDATE())&& checkdates(ts.getTask_ENDDATE(),pr.getEndDate())&& checkdates(pr.getStartDate(),ts.getTask_ENDDATE())) continue; else return false; } for(Task ts:taskManager.get("toEdit")) { if( checkdates(ts.getTask_STARDATE(),pr.getEndDate())&& checkdates(pr.getStartDate(),ts.getTask_STARDATE())&& checkdates(ts.getTask_ENDDATE(),pr.getEndDate())&& checkdates(pr.getStartDate(),ts.getTask_ENDDATE())) continue; else return false; } ArrayList<Task> tasks=null; try { tasks=db.selectTaskforProjID(project.getProjectID()); } catch (SQLException e) { ErrorWindow wind = new ErrorWindow(e); UI.getCurrent().addWindow(wind); e.printStackTrace(); } for(Task ts:tasks) { if( checkdates(ts.getTask_STARDATE(),pr.getEndDate())&& checkdates(pr.getStartDate(),ts.getTask_STARDATE())&& checkdates(ts.getTask_ENDDATE(),pr.getEndDate())&& checkdates(pr.getStartDate(),ts.getTask_ENDDATE())) continue; else return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int createTask() {\n Calendar cal = Calendar.getInstance();\n String taskName = \"Task-\" + cal.getTimeInMillis();\n\n return TaskServiceClient.createTask(\n projObjKey, // projObjKey-新建立工作項目所在的專案key值\n parentObjKey, // parentObjKey-新建立工作項目所屬的子專案/專案key值\n ...
[ "0.6344628", "0.6168874", "0.60403043", "0.59709626", "0.5959768", "0.59540266", "0.5780165", "0.57398915", "0.5662843", "0.5628571", "0.56123525", "0.56046534", "0.5596079", "0.55891234", "0.5574255", "0.55721015", "0.5569556", "0.5563091", "0.5527829", "0.55168027", "0.5508...
0.5252483
74
To initialize the class. It must be called before call the method getInstance()
public static void initialize(Context ctx) { mContext = ctx; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void initialize() {\n \t\n }", "public void init() {\n \n }", "protected void initialize() {}", "protected void initialize() {}", "protected void init() {\n }", "protected void initialize() {\r\n }", "protected void initialize() {\r\n }", "public void initialize()\n...
[ "0.7908821", "0.78533244", "0.7826055", "0.7826055", "0.78186446", "0.78069884", "0.78069884", "0.78056055", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869", "0.7770869"...
0.0
-1
Check if the class has been initialized
public static boolean hasBeenInitialized() { return mContext != null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean initialized() {\n return true;\r\n }", "public static boolean isInitialized() {\n\t\treturn instance != null;\n\t}", "public boolean isInitialized();", "protected static boolean isInitialized(){\n return initialized;\n }", "public boolean isInitialized()\n {\n return isInit...
[ "0.7730541", "0.76971227", "0.7492414", "0.7487923", "0.74159503", "0.7368972", "0.73669565", "0.732108", "0.72981465", "0.72909665", "0.72736233", "0.726337", "0.72409743", "0.7240943", "0.7237803", "0.7236107", "0.7233053", "0.72245324", "0.71843433", "0.71842676", "0.71787...
0.7456316
4
The private constructor. Here you can use the context to initialize your variables.
private Singleton() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Context() {\n }", "public void initializeContext(Context context) {\n this.context = context;\n }", "public static synchronized void initialize(Context context) {\n instance.context = context;\n initInternal();\n }", "protected void initialize(ExternalContext context)\n {\n }", "...
[ "0.7822031", "0.7311067", "0.71639687", "0.71374285", "0.7089914", "0.6956271", "0.69424546", "0.6915192", "0.68934804", "0.68895674", "0.6886771", "0.68764544", "0.6830242", "0.6820841", "0.6771804", "0.67508185", "0.67508185", "0.6747772", "0.67414385", "0.6739816", "0.6739...
0.0
-1
The main method used to get the instance
public static synchronized Singleton getInstance() { if (mContext == null) { throw new IllegalArgumentException("Impossible to get the instance. This class must be initialized before"); } if (instance == null) { instance = new Singleton(); } return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Main getInstance() {\n return instance;\n }", "public static Main getInstance() {\r\n return instance;\r\n }", "private Main() {\n\n super();\n }", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public Main() {\n \n \n }", ...
[ "0.78469896", "0.784688", "0.70914483", "0.7068727", "0.6807005", "0.6790786", "0.6780528", "0.6761551", "0.6697633", "0.6685678", "0.66268015", "0.6599886", "0.65612614", "0.65304464", "0.6510587", "0.65087557", "0.6505434", "0.6468982", "0.6463834", "0.6446331", "0.6445233"...
0.0
-1
set the default tag if tag is empty
public <T> void addToRequestQueue(Request<T> req, String tag) { req.setTag(TextUtils.isEmpty(tag) ? TAG : tag); getRequestQueue().add(req); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tag addDefaultTag(){\n StringProperty tagName = new SimpleStringProperty();\n tagName.setValue(\"New Tag\");\n Tag newTag = new Tag(tagName);\n\n\n /* verify if id is integer or string, we handle just strings here\n newTag.setIdProperty(0);\n */\n\n addTag(n...
[ "0.6947677", "0.64617544", "0.63822204", "0.63353443", "0.62309545", "0.6083666", "0.6058373", "0.6008387", "0.6006476", "0.59884214", "0.5962166", "0.59496534", "0.5919006", "0.5916324", "0.591185", "0.5904689", "0.5898822", "0.5888592", "0.5884294", "0.5864048", "0.5864048"...
0.0
-1
A complete location structure of the entire restaurant gets passed into here
public void setLocations(JSONArray locations) throws JSONException { for(int a = 0; a < locations.length(); a++){ if(locations.getJSONObject(a).getInt("locationCategoryId") == TYPE_TABLE){ setTables(locations.getJSONObject(a).getJSONArray("locations")); } else if(locations.getJSONObject(a).getInt("locationCategoryId") == TYPE_BAR){ setBars(locations.getJSONObject(a).getJSONArray("locations")); } else if(locations.getJSONObject(a).getInt("locationCategoryId") == TYPE_TAKEOUT){ setTakeouts(locations.getJSONObject(a).getJSONArray("locations")); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RestaurantFullInfo getFullRestaurant();", "public String getRestaurantLocation() {\n return mRestaurantLocation;\n }", "Restaurant getRestaurant();", "public Restaurant getRestaurant() {\n return restaurant;\n }", "Location createLocation();", "Location createLocation();", "Location creat...
[ "0.6883988", "0.679058", "0.6296951", "0.61251736", "0.5995687", "0.5995687", "0.5995687", "0.5973199", "0.5937099", "0.5925337", "0.591893", "0.59183973", "0.5914863", "0.59067684", "0.5881041", "0.58795255", "0.5852269", "0.5850613", "0.58435285", "0.5833579", "0.5816994", ...
0.0
-1
creates a new database (new file)
public Database(String url) { this.url = url; File f = new File(url); if (f.exists()) { try { f.mkdirs(); f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } //create table relationship LinkedList<String> relationship_attributes = new LinkedList<>(); relationship_attributes.add("id_entity1"); relationship_attributes.add("id_entity2"); relationship_attributes.add("description"); this.create_table("relationship", relationship_attributes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createDB() {\n\t\ttry {\n\t\t\tBufferedReader br= new BufferedReader(new FileReader(\"db_schema.txt\"));\n\t\t\tString line= null;\n\t\t\tStringBuilder sb= new StringBuilder();\n\t\t\twhile ((line=br.readLine())!=null){\n\t\t\t\tsb.append(line);\n\t\t\t\tif(sb.length()>0 && sb.charAt(sb.length()-1)==';...
[ "0.77281", "0.7668276", "0.76193964", "0.75491893", "0.73424864", "0.72722685", "0.72303236", "0.71857375", "0.7149643", "0.71475434", "0.7146998", "0.7088073", "0.70850587", "0.7078761", "0.7029505", "0.70262057", "0.70025593", "0.6989431", "0.6960584", "0.6936741", "0.69143...
0.0
-1
opens connection to the database
private Connection connect() { Connection c = null; try { Class.forName("org.sqlite.JDBC"); //make sure jdbc exists and can be found c = DriverManager.getConnection("jdbc:sqlite:" + url); } catch (SQLException e) { System.out.println(e.getMessage()); } catch (ClassNotFoundException e) { e.printStackTrace(); } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void openDatabase() {\r\n if ( connect != null )\r\n return;\r\n\r\n try {\r\n // Setup the connection with the DB\r\n String host = System.getenv(\"DTF_TEST_DB_HOST\");\r\n String user = System.getenv(\"DTF_TEST_DB_USER\");\r\n String pa...
[ "0.78110117", "0.7683591", "0.7633942", "0.7628182", "0.76009434", "0.75946707", "0.7524785", "0.7524334", "0.75241953", "0.75130653", "0.75053734", "0.7504396", "0.7471219", "0.7469113", "0.7449458", "0.7434659", "0.7423184", "0.7345939", "0.7335151", "0.7330486", "0.7275372...
0.6845922
92
if the statement returns a resultSet the parameter returns_rs should be true otherwise false
private ResultSet execute_statement(String sql, boolean returns_rs) { Connection connection = null; Statement statement = null; ResultSet resultSet = null; try { connection = this.connect(); //connect to database statement = connection.createStatement(); if (returns_rs) { resultSet = statement.executeQuery(sql); //calculate resultSet } else { statement.execute(sql); //execute statement } } catch (SQLException e) { e.printStackTrace(); } finally { if (!returns_rs) { try { this.disconnect(null, statement, connection); //disconnect from database } catch (SQLException ignored) { } } } return resultSet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean evaluate(RowSet rs) {\n\t\treturn false;\r\n\t}", "public ResultSet getNativeResultSet(ResultSet rs)\r\n/* 86: */ throws SQLException\r\n/* 87: */ {\r\n/* 88:163 */ return rs;\r\n/* 89: */ }", "public static boolean closeRsAndStatement(final ILogger aLogge...
[ "0.68953025", "0.67429066", "0.6668486", "0.66402256", "0.6616208", "0.65832436", "0.65556157", "0.65189", "0.6365302", "0.6318356", "0.6312653", "0.6299731", "0.6253281", "0.620606", "0.620219", "0.6182407", "0.616239", "0.6136087", "0.6133598", "0.6110103", "0.6060372", "...
0.73987687
0
closes connection to the database
private void disconnect(ResultSet resultSet, Statement statement, Connection connection) throws SQLException{ if (resultSet != null) { resultSet.close(); //disconnect from resultSet } if (statement != null) { statement.close(); //disconnect from statement } if (connection != null) { connection.close(); //disconnect from database } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void closeDatabase() {\r\n try {\r\n if ( connect != null ) {\r\n connect.close();\r\n }\r\n } catch ( Exception e ) {\r\n System.err.println( \"ERROR: Could not close database connection, \" + e.getMessage() );\r\n } finally {\r\n ...
[ "0.81536084", "0.8014085", "0.80041164", "0.7989045", "0.7958451", "0.79582614", "0.79241794", "0.7885723", "0.78633124", "0.78244513", "0.78196776", "0.78180295", "0.7812715", "0.7786084", "0.77723897", "0.77613807", "0.77318126", "0.7719413", "0.7705821", "0.7692892", "0.76...
0.0
-1
creates a table (without a content)
public void create_table(String table_name, List<String> attributes) { //throw error if table already exists if (get_table_names().contains(table_name) && !table_name.equals("relationship")) { throw new RuntimeException("Table with this name already exists."); } //throw error if no name is given if (table_name.isEmpty()) { throw new RuntimeException("Table name can not be empty."); } //throw error if no attributes are given if (attributes.isEmpty()) { throw new RuntimeException("Table needs at least one attribute."); } StringBuilder stringBuilder = new StringBuilder("create table if not exists "); stringBuilder.append(table_name); //autoincrement handles the correct incrementation of the primary key stringBuilder.append(" (id integer primary key autoincrement, "); for (String attribute : attributes) { stringBuilder.append(attribute); stringBuilder.append(" varchar, "); //values are varchar since the user inputs text } stringBuilder.delete(stringBuilder.length() - 2, stringBuilder.length()); stringBuilder.append(")"); String sql = stringBuilder.toString(); execute_statement(sql, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each ...
[ "0.7606245", "0.7484255", "0.7423184", "0.73107594", "0.7275267", "0.72524136", "0.7176641", "0.70454663", "0.7035555", "0.6975832", "0.69129723", "0.69061327", "0.68470776", "0.6787225", "0.6736852", "0.67353934", "0.6725798", "0.6721842", "0.67148465", "0.6697196", "0.66595...
0.0
-1
deletes the table (and its content) from the database
void delete_table(String table_name) { //table does not exist if (!get_table_names().contains(table_name) && !table_name.equals("relationship")) { throw new RuntimeException("Table does not exists and can therefore not be deleted."); } String sql = "drop table if exists " + table_name; execute_statement(sql, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public boolean deleteAll(String strTable)\r\n { try\r\n { String strSQL = \"DELETE * FROM \" + strTable;\r\n status(strSQL);\r\n dbCmdText.executeUpdate(strSQL);\r\n\r\n // dbRecordset.close();\r\n } catch (SQLException e)\r\n {\r\n e.printStackTrace();\r\n ...
[ "0.73465395", "0.7245303", "0.721597", "0.7193786", "0.7180161", "0.70610946", "0.6988799", "0.6961249", "0.69554174", "0.6933969", "0.69311345", "0.69100696", "0.69085634", "0.68441623", "0.6831449", "0.6827229", "0.6820628", "0.6817097", "0.6815895", "0.68054706", "0.680311...
0.6559072
45
creates a new data record of the specified entity
public void create_entity(String table, List<String> attributes) { //table does not exist if (!get_table_names().contains(table) && !table.equals("relationship")) { throw new RuntimeException("Table does not exist."); } //number of attributes need to be correct if (attributes.size() != get_attribute_name(table).size()) { throw new RuntimeException("Number of attributes does not correspond with number of attributes in table."); } StringBuilder stringBuilder = new StringBuilder("insert into "); stringBuilder.append(table); stringBuilder.append(" ("); for (String attribute : this.get_attribute_name(table)) { stringBuilder.append(attribute); //all attribute names need to be specified since id is inserted automatically stringBuilder.append(", "); } stringBuilder.delete(stringBuilder.length()-2, stringBuilder.length()); stringBuilder.append(")"); stringBuilder.append(" values ("); for (String attribute : attributes) { stringBuilder.append("\""); stringBuilder.append(attribute); stringBuilder.append("\", "); } stringBuilder.delete(stringBuilder.length()-2, stringBuilder.length()); stringBuilder.append(");"); String sql = stringBuilder.toString(); execute_statement(sql, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "E create(E entity);", "E create(E entity);", "void create(T entity);", "void create(E entity);", "public DataEntry create(long dataEntryId);", "ID create(T entity);", "Entity createEntity();", "void create(Student entity);", "void create(T entity) throws Exception;", "T createEntity();", "publi...
[ "0.71768266", "0.71768266", "0.7155578", "0.7133971", "0.6994938", "0.6910514", "0.68846786", "0.68703914", "0.6809424", "0.6678185", "0.6674781", "0.66372246", "0.661713", "0.6598216", "0.65608627", "0.65115005", "0.6510869", "0.6503594", "0.6441154", "0.64097196", "0.639818...
0.0
-1
updates the values of a given entity (specified via the id) to the given ones
void update_entity(String table, int id, List<String> new_attributes) { //table does not exist if (!get_table_names().contains(table) && !table.equals("relationship")) { throw new RuntimeException("Table does not exist."); } //invalid id given if (!get_valid_ids(table).contains(id)) { throw new RuntimeException("Id does not exist in this table."); } //number of attributes is incorrect if (new_attributes.size() != get_attribute_name(table).size()) { throw new RuntimeException("Number of attributes does not correspond with number of attributes in table."); } StringBuilder stringBuilder = new StringBuilder("update "); stringBuilder.append(table); int i = 0; stringBuilder.append(" set "); for (String attribute : this.get_attribute_name(table)) { stringBuilder.append(attribute); stringBuilder.append(" = \""); stringBuilder.append(new_attributes.get(i)); stringBuilder.append("\", "); i++; } stringBuilder.delete(stringBuilder.length()-2, stringBuilder.length()); stringBuilder.append(" where id = "); stringBuilder.append(id); //update entity with corresponding id stringBuilder.append(";"); String sql = stringBuilder.toString(); execute_statement(sql, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "E update(E entity);", "E update(E entity);", "default E update(ID id, E entity) {\n return update(id, entity, null);\n }", "E update(ID id, E entity, RequestContext context);", "public void updateEntity();", "void update(CE entity);", "T update(T entity);", "T update(T entity);", "public ...
[ "0.66680485", "0.66680485", "0.66490656", "0.645032", "0.6447729", "0.6346712", "0.6340134", "0.6340134", "0.6321517", "0.62780255", "0.62752616", "0.6267577", "0.6267577", "0.6235604", "0.6210734", "0.61570567", "0.61087096", "0.6078652", "0.6019249", "0.60133284", "0.597870...
0.6281917
9
deletes the entity with the id from the table
public void delete_entity(String table, int id) { //table does not exist if (!get_table_names().contains(table) && !table.equals("relationship")) { throw new RuntimeException("Table does not exist."); } //invalid id if (!get_valid_ids(table).contains(id)) { throw new RuntimeException("Id does not exist in this table."); } String sql = "delete from " + table + " where id = " + id + ";"; //delete corresponding entity execute_statement(sql, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteEntityById(Long id);", "ApiResponse deleteEntityById(Integer id);", "public void deleteById(Long id);", "void delete(int entityId);", "public void delete(E entity){\n Object idEntity = HibernateUtil.getIdEntity(entity);\n EntityTransaction entityTransaction = entityManager.getTrans...
[ "0.8277832", "0.7770834", "0.77131", "0.7687042", "0.76544935", "0.76317114", "0.7535891", "0.7535891", "0.7535891", "0.7535891", "0.7535891", "0.75316733", "0.75316733", "0.75316733", "0.75316733", "0.75018626", "0.7495265", "0.7478058", "0.74454457", "0.74405587", "0.743934...
0.7234954
53
returns number of rows of the table
int get_row_count(String table) { //table does not exist if (!get_table_names().contains(table) && !table.equals("relationship")) { throw new RuntimeException("Table does not exist."); } //maybe use select count(id) from table instead String sql = "select * from " + table; int count = 0; ResultSet resultSet = execute_statement(sql, true); try { while (resultSet.next()) { count++; //count number of entities } } catch (SQLException e) { e.printStackTrace(); } try { this.disconnect(resultSet, null, null); //disconnect from database } catch (SQLException e) { e.printStackTrace(); } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getRowsCount();", "private int getJTableNumberOfRows() {\n\n\t\tint count = 0; /* create a integer object for rows count */\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(DATABASE_URL, UserName_SQL, Password_SQL);\n\t\t\tstatemen...
[ "0.87228954", "0.84397674", "0.83298826", "0.82656807", "0.8226136", "0.8146636", "0.8139031", "0.81215596", "0.81103784", "0.8058908", "0.80567575", "0.8009967", "0.79719394", "0.79657507", "0.7961821", "0.795817", "0.795817", "0.795817", "0.795817", "0.795817", "0.795817", ...
0.7863637
28
returns a list of all attribute names of the table
List<String> get_attribute_name(String table) { //table does not exist if (!get_table_names().contains(table) && !table.equals("relationship")) { throw new RuntimeException("Table does not exist."); } LinkedList<String> res = new LinkedList<>(); String sql = "select * from " + table; ResultSet resultSet = execute_statement(sql, true); //get all data records try { ResultSetMetaData rsmd = resultSet.getMetaData(); int column_cnt = rsmd.getColumnCount(); for (int i=2; i <= column_cnt; i++) { res.add(rsmd.getColumnName(i)); //add column name } } catch (SQLException e) { e.printStackTrace(); } try { this.disconnect(resultSet, null, null); //disconnect from database } catch (SQLException e) { e.printStackTrace(); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<String> getAttributeNames(String table) throws QueryFailedException {\n String query = String.format(\"SELECT COLUMN_NAME FROM information_schema.Columns WHERE TABLE_NAME = '%s' AND TABLE_SCHEMA = '%s'\", table, database.getDatabaseName());\n try {\n ResultSet rs = this.ex...
[ "0.8177027", "0.80545765", "0.757238", "0.7420023", "0.72475797", "0.72221005", "0.7215488", "0.7116724", "0.709485", "0.7055875", "0.7053473", "0.7041128", "0.70210713", "0.6977352", "0.69504744", "0.69368833", "0.6854882", "0.68426484", "0.6838119", "0.68175834", "0.6786983...
0.80447435
2
returns a list of all tables
public List<String> get_table_names() { LinkedList<String> res = new LinkedList<>(); //the table name information is stored in sqlite_master ResultSet resultSet = execute_statement("SELECT name FROM sqlite_master WHERE type='table'" + "AND name <> 'sqlite_sequence' AND name <> 'relationship'", true); try { while (resultSet.next()) { res.add(resultSet.getString(1)); } } catch (SQLException e) { e.printStackTrace(); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Table> getAllTables() {\r\n\t\treturn tables;\r\n\t}", "java.util.List<Table>\n getTablesList();", "public void listTables() {\r\n\t\tfor (Table table : tables) {\r\n\t\t\tSystem.out.println(table.getName());\r\n\t\t}\r\n\t}", "public List<String> getAllTables() throws Exception {\n\t...
[ "0.8248577", "0.81736684", "0.78488916", "0.7806722", "0.7788768", "0.7744177", "0.7718933", "0.7709098", "0.76043606", "0.7553524", "0.7552605", "0.7540895", "0.75251853", "0.7464382", "0.74463904", "0.74193704", "0.741288", "0.74115163", "0.73840773", "0.7295714", "0.728240...
0.7765469
5
returns the values of the attributes of an entity
public List<String> get_attributes(String table, int id) { //table does not exist if (!get_table_names().contains(table) && !table.equals("relationship")) { throw new RuntimeException("Table does not exist."); } //id is invalid if (!get_valid_ids(table).contains(id)) { throw new RuntimeException("Id does not exist in this table."); } LinkedList<String> res = new LinkedList<>(); String sql = "select * from " + table + " where id = " + id; ResultSet resultSet = execute_statement(sql, true); try { while (resultSet.next()) { for (String name : get_attribute_name(table)) { res.add(resultSet.getString(name)); //store attribute names } } } catch (SQLException e) { e.printStackTrace(); } try { this.disconnect(resultSet, null, null); //disconnect from database } catch (SQLException e) { e.printStackTrace(); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "Map<String, Object> getAttributes();", "public java.util.Collection getAttributes();", "default List<Object> getPrimaryAttributeValues(T entity) {\n\t\treturn getPrimaryAttributes().stream().map(attr -> attr.getValue(entity)).c...
[ "0.71500975", "0.71500975", "0.71500975", "0.71448797", "0.70686597", "0.70509917", "0.69101703", "0.69101703", "0.6894012", "0.68794554", "0.68146867", "0.6782098", "0.67556465", "0.66905564", "0.665985", "0.6659631", "0.6624723", "0.6614476", "0.65980506", "0.65814006", "0....
0.0
-1
deletes the database file
public void delete_database() { //deletes file and by doing so all the tables File file = new File(url); String path = ".." + File.separator + file.getPath(); File file_path = new File(path); file_path.delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deleteDB() {\n File dbFile = new File(dbPath + dbName);\n if (dbFile.exists()) {\n dbFile.delete();\n }\n }", "@Override\r\n\tpublic void deleteDatabase() {\r\n\t\tlog.info(\"Enter deleteDatabase\");\r\n\r\n\t\t\r\n\t\tConnection connection = null;\t\t\r\n\t\ttry {\...
[ "0.7851411", "0.7327888", "0.72308785", "0.71692157", "0.7111151", "0.7080164", "0.70274127", "0.70178556", "0.6974801", "0.69604594", "0.69158894", "0.69139296", "0.69040906", "0.6900279", "0.68972534", "0.6878035", "0.6877326", "0.6875193", "0.68718535", "0.6819017", "0.678...
0.8200948
0
returns a list of the ids that are currently being stored in the table
public List<Integer> get_valid_ids(String table) { //table does not exist if (!get_table_names().contains(table) && !table.equals("relationship")) { throw new RuntimeException("Table does not exist."); } LinkedList<Integer> valid_ids = new LinkedList<>(); String sql = "select id from " + table; ResultSet resultSet = execute_statement(sql, true); //get all ids from the table try { while (resultSet.next()) { int i = resultSet.getInt("id"); //store all ids valid_ids.add(i); } } catch (SQLException e) { e.printStackTrace(); } return valid_ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String [] _truncatable_ids()\r\n {\r\n return _ids_list;\r\n }", "public List<K> getSavedIds() {\n if (dbObjects.length > 0 && dbObjects[0] instanceof JacksonDBObject) {\n throw new UnsupportedOperationException(\n \"Generated _id retrieval not supported w...
[ "0.7350335", "0.71968174", "0.69179064", "0.6852948", "0.68120503", "0.67833817", "0.6718109", "0.6715457", "0.6669857", "0.66696525", "0.66490114", "0.66490114", "0.6543258", "0.6480771", "0.6464424", "0.6459136", "0.6445395", "0.63978565", "0.6368832", "0.6362016", "0.63460...
0.66034716
12
returns the file name of the database (including .db)
String get_name() { File file = new File(url); return file.getName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDatabaseFileName();", "java.lang.String getDatabaseName();", "java.lang.String getDatabaseName();", "java.lang.String getDatabaseName();", "java.lang.String getDatabaseName();", "String getUserDatabaseFilePath();", "public String getDataBaseName() {\r\n\t\treturn dataBaseName + \".db\"...
[ "0.8564524", "0.77475685", "0.77475685", "0.77475685", "0.77475685", "0.7428331", "0.73850685", "0.7355971", "0.72150624", "0.7087179", "0.7080175", "0.7080175", "0.7080175", "0.7080175", "0.70224977", "0.70224977", "0.70224977", "0.70224977", "0.6894604", "0.6894544", "0.688...
0.0
-1
returns the absolute path of the database
private String get_url() { File file = new File(url); return file.getAbsolutePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String getDBPath() {\r\n\t\ttry {\r\n\t\t\tString path = Consts.class.getProtectionDomain().getCodeSource().getLocation().getPath();\r\n\t\t\tString decoded = URLDecoder.decode(path, \"UTF-8\");\r\n\t\t\tif (decoded.contains(\".jar\")) {\r\n\t\t\t\tdecoded = decoded.substring(0, decoded.lastIndexOf(...
[ "0.779475", "0.77049863", "0.7626975", "0.75927395", "0.7407262", "0.7266032", "0.7232387", "0.7148192", "0.71279085", "0.70763034", "0.70063657", "0.6785073", "0.67307514", "0.666614", "0.66632086", "0.66475254", "0.66475254", "0.66475254", "0.66475254", "0.6581908", "0.6536...
0.0
-1
create data record of relationship
void create_relationship(EntityIdentifier id1, EntityIdentifier id2, String description) { //a relationship is defined as two entities (table, id) and a description //description is empty if (description.isEmpty()) { throw new RuntimeException("Description can not be empty."); } LinkedList<String> attributes = new LinkedList<>(); attributes.add(id1.toString()); attributes.add(id2.toString()); attributes.add(description); this.create_entity("relationship", attributes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Relationship createRelationship();", "void relationshipCreate( long id, int typeId, long startNodeId,\n long endNodeId );", "@Override()\n protected RelationshipData createNewData(final String _name)\n {\n return new RelationshipData(this, _name);\n }", "Relation createRelation();", ...
[ "0.7526939", "0.6777354", "0.66915643", "0.66321135", "0.6331135", "0.62728816", "0.61346835", "0.59716725", "0.584703", "0.58289593", "0.575279", "0.5706332", "0.5698096", "0.5630212", "0.56299", "0.5629349", "0.5545207", "0.5523132", "0.5494963", "0.54943645", "0.54781026",...
0.58993995
8
/ (nonJavadoc) Run the STDZ algorithm if conditions are met
@Override public String getFormattedString(String formatStr) { if (formatStr == null || formatStr.isEmpty() || formatStr.startsWith("%")) { return super.getFormattedString(formatStr); } else if (!formatStr.equals("STDZ")) { return super.getFormattedString(formatStr); } int height = super.getValueAs(SI.METER).intValue(); if (pressureLevel == null) { // can't calculate STDZ return null; } int pressureLevelValue = pressureLevel.getValue().intValue(); return calculateSTDZ(pressureLevelValue, height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int run(Point xS, Point xE)\n throws OptimizerException, Exception\n {\n boolean terminate = false;\n boolean f1eqf2 = false;\n // Vector of points, used for parallel computation\n Point[] x = new Point[2];\n x[0] = new Point(xS.getDimensionContinuous(), xS.ge...
[ "0.55582035", "0.53825575", "0.53818107", "0.53813624", "0.5367226", "0.5248428", "0.52032393", "0.51995456", "0.5164266", "0.5149347", "0.5146581", "0.5139259", "0.5127396", "0.51145613", "0.5100767", "0.5097967", "0.5097967", "0.507695", "0.5068729", "0.5067979", "0.5065741...
0.0
-1
Compute standard height using STDZ algorithm This function computes a standard height used on upperair charts. For data below 500mb, the standard height is the last three digits of the height. For data at and above 500mb, the height is the last three digits of the height in decameters.
private String calculateSTDZ(int pressureLevelValue, int height) { String stdz = ""; if (pressureLevelValue <= 500) { // Data at and above 500mb stdz = Integer.toString((height / DECAMETER_DIVISOR) % MOD_DIVISOR); } else if (pressureLevelValue > 500) { // Data below 500mb stdz = Integer.toString(height % MOD_DIVISOR); } return stdz; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Double getZLength();", "double getZLength();", "public double getStandardDeviation() {\r\n\t\tdouble standDev=0;\r\n\t\tdouble avgD=getAverageDuration();\r\n\t\tdouble zaehler=0;\r\n\t\tfor(int a=0;a<populationSize();a++) {\r\n\t\t\tzaehler+=Math.pow((avgD-getTour(a).getDuration()), 2);\r\n\t\t}\r\n\t\tstandDe...
[ "0.5712538", "0.56505466", "0.55342406", "0.54649657", "0.54174834", "0.539646", "0.537703", "0.536152", "0.53473616", "0.5328893", "0.53239375", "0.53141624", "0.529604", "0.529604", "0.52807856", "0.5262952", "0.5257163", "0.51846236", "0.5168262", "0.51554936", "0.5152113"...
0.75068706
0
DecimalFormat df = new DecimalFormat("0.00");
public BankAccount(String name, double balance, String animalType, String typeOfAccount, boolean behaviour) { this.name = name; this.balance = balance; this.animalType = animalType; this.typeOfAccount = typeOfAccount; this.behaviour = behaviour; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String doubleToDecimalString(double toFormat){\r\n\r\n String d = \"\";\r\n DecimalFormat df = new DecimalFormat(\"0.00\");\r\n d = df.format(toFormat);\r\n\r\n return d;\r\n }", "public RealNumberFormat()\r\n\t{\r\n\t\tdf\t= new DecimalFormat( \"#,##0.000\" );\r\n\t}", "...
[ "0.68070036", "0.65231234", "0.65071523", "0.64467317", "0.6415198", "0.638711", "0.63599217", "0.63220817", "0.6293623", "0.61840874", "0.6108846", "0.6082613", "0.60738677", "0.5978815", "0.59616774", "0.59363693", "0.59033406", "0.58590263", "0.5824283", "0.5810301", "0.57...
0.0
-1
Load Widgets with Data already retrieved from Main Activity.
private void getInitialValues() { mEditTextJobText.setText(SharedPrefStatic.mJobTextStr); mEditTextSkill.setText(SharedPrefStatic.mJobSkillStr); mEditTextLocation.setText(SharedPrefStatic.mJobLocationStr); mEditTextAge.setText(SharedPrefStatic.mJobAgeStr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initializeWidgets() {\n\t\timg_home = (ImageView) findViewById(R.id.img_home);\n\t\tlv_customer_info = (ListView) findViewById(R.id.lv_customer_info);\n\t\tmc_ed_search = (AutoCompleteTextView) findViewById(R.id.mc_ed_search);\n\t\ttxv_invisible = (TextView) findViewById(R.id.txv_invisible);\n\t\ttxv_...
[ "0.63460654", "0.632478", "0.61996084", "0.6156762", "0.6083134", "0.6034051", "0.60339904", "0.6026051", "0.598201", "0.5960129", "0.59541905", "0.59423435", "0.59413326", "0.59302354", "0.5920047", "0.59040606", "0.5899636", "0.589499", "0.58860636", "0.5871079", "0.5864267...
0.0
-1
user pressed action button (enter)
@Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void actionPerformed(ActionEvent e) { \n enter();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent ev) {\n\t\tString command = ev.getActionCommand();\n\t\tif (command.equals(\"Enter\")) {\n\t\t\tshowResult();\n\t\n\t\t} else if (command.equals(\"Reset\")) {\n\t\t\treset();\n\t\t\t\n\t...
[ "0.8182929", "0.77900916", "0.7735845", "0.7676047", "0.7582919", "0.75028527", "0.7459635", "0.74173427", "0.73649096", "0.7319114", "0.73112184", "0.72901607", "0.72004867", "0.7180305", "0.7117198", "0.7102338", "0.7003237", "0.69528085", "0.68283033", "0.68123746", "0.677...
0.0
-1
user pressed action button (enter)
@Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void actionPerformed(ActionEvent e) { \n enter();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent ev) {\n\t\tString command = ev.getActionCommand();\n\t\tif (command.equals(\"Enter\")) {\n\t\t\tshowResult();\n\t\n\t\t} else if (command.equals(\"Reset\")) {\n\t\t\treset();\n\t\t\t\n\t...
[ "0.8182929", "0.77900916", "0.7735845", "0.7676047", "0.7582919", "0.75028527", "0.7459635", "0.74173427", "0.73649096", "0.7319114", "0.73112184", "0.72901607", "0.72004867", "0.7180305", "0.7117198", "0.7102338", "0.7003237", "0.69528085", "0.68283033", "0.68123746", "0.677...
0.0
-1
user pressed action button (enter)
@Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void actionPerformed(ActionEvent e) { \n enter();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent ev) {\n\t\tString command = ev.getActionCommand();\n\t\tif (command.equals(\"Enter\")) {\n\t\t\tshowResult();\n\t\n\t\t} else if (command.equals(\"Reset\")) {\n\t\t\treset();\n\t\t\t\n\t...
[ "0.81833726", "0.7789945", "0.77362883", "0.7675621", "0.7582766", "0.7502361", "0.745904", "0.7417644", "0.7364974", "0.7318904", "0.73106736", "0.7289309", "0.7199506", "0.7179857", "0.71165365", "0.7102659", "0.70022845", "0.6953069", "0.6828333", "0.6812106", "0.6773944",...
0.0
-1
user pressed action button (enter)
@Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void actionPerformed(ActionEvent e) { \n enter();\n }", "@Override\n\tpublic void actionPerformed(ActionEvent ev) {\n\t\tString command = ev.getActionCommand();\n\t\tif (command.equals(\"Enter\")) {\n\t\t\tshowResult();\n\t\n\t\t} else if (command.equals(\"Reset\")) {\n\t\t\treset();\n\t\t\t\n\t...
[ "0.81830627", "0.7789789", "0.7735927", "0.7675297", "0.7583138", "0.750217", "0.7459411", "0.74176013", "0.7365541", "0.7318137", "0.73108417", "0.7290084", "0.7200635", "0.71796775", "0.7117126", "0.7103939", "0.700181", "0.69534224", "0.6829399", "0.681183", "0.67735046", ...
0.0
-1
Have we even changed any values? Returns true if so.
private boolean settingChangedValues(String origJobText, String origJobSkill, String origLocation, String origAge) { if (!origJobText.contentEquals(mEditTextJobText.getText().toString()) || !origJobSkill.contentEquals(mEditTextSkill.getText().toString()) || !origLocation.contentEquals(mEditTextLocation.getText().toString()) || !origAge.contentEquals(mEditTextAge.getText().toString())) { return true; } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean hasChanges() {\n return !(changed.isEmpty() && defunct.isEmpty());\n }", "synchronized boolean resetWasUsed() {\n\n boolean result = lastValue != currValue;\n\n lastValue = currValue;\n\n return result;\n }", "public boolean hasChanges() {\n return Math.abs...
[ "0.7083124", "0.70670074", "0.70350724", "0.69812775", "0.6904217", "0.68504214", "0.68504214", "0.6831495", "0.6787548", "0.6727907", "0.6700997", "0.66991645", "0.66228366", "0.66210353", "0.65451294", "0.65090543", "0.6465205", "0.6428989", "0.64209414", "0.64028347", "0.6...
0.0
-1
Save the preferences. Save settings to our location.
private void savePreferences() { SharedPrefStatic.mJobTextStr = mEditTextJobText.getText().toString().replace(" ", ""); SharedPrefStatic.mJobSkillStr = mEditTextSkill.getText().toString().replace(" ", ""); SharedPrefStatic.mJobLocationStr = mEditTextLocation.getText().toString().replace(" ", ""); SharedPrefStatic.mJobAgeStr = mEditTextAge.getText().toString().replace(" ", ""); SharedPreferences sharedPref = getSharedPreferences(AppConstants.PREF_FILENAME, 0); SharedPreferences.Editor editer = sharedPref.edit(); editer.putString(AppConstants.PREF_KEY_TEXT, SharedPrefStatic.mJobTextStr); editer.putString(AppConstants.PREF_KEY_SKILL, SharedPrefStatic.mJobSkillStr); editer.putString(AppConstants.PREF_KEY_LOCATION, SharedPrefStatic.mJobLocationStr); editer.putString(AppConstants.PREF_KEY_AGE, SharedPrefStatic.mJobAgeStr); // The commit runs faster. editer.apply(); // Run this every time we're building a query. SharedPrefStatic.buildUriQuery(); SharedPrefStatic.mEditIntentSaved = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void save() {\n try {\n FileOutputStream fos = new FileOutputStream(file);\n properties.store(fos, \"Preferences\");\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public static void Save...
[ "0.8455257", "0.8261023", "0.8072881", "0.80358696", "0.79881877", "0.7986699", "0.79469097", "0.79010785", "0.76679254", "0.7666824", "0.7628874", "0.75606245", "0.7554301", "0.75015295", "0.7500807", "0.7495379", "0.74400926", "0.74355745", "0.7433509", "0.7402209", "0.7378...
0.7307472
21
Constructor Also accepts Directories in Standard
public WildcardFilenameFilter( String wildcard ) { pattern = Pattern.compile( wildcardAsRegex( wildcard ) ); setAcceptDirectories( true ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Directories() {\n\n\t}", "public Directory(String nm){\r\n\t\tsuper();\r\n\t}", "public DirectoryFileLocator() {\r\n this(System.getProperty(\"user.dir\"));\r\n }", "public DirectoryFileLocator(File dir) {\r\n directory = dir;\r\n }", "public Directory(String dirName) {\n setDirName(dirN...
[ "0.8266165", "0.75653815", "0.7172325", "0.714668", "0.7029141", "0.698746", "0.6972597", "0.6730681", "0.6721476", "0.6585135", "0.6584104", "0.6497364", "0.6488155", "0.6475589", "0.6453749", "0.6415887", "0.6349304", "0.63393855", "0.630775", "0.6295914", "0.6288195", "0...
0.0
-1
convert a wild card containing and ? to the equivalent regex Code duplicated in com.mindprod.example.TestWildcard
private static String wildcardAsRegex( String wildcard ) { StringBuilder sb = new StringBuilder( wildcard.length() * 110 / 100 ); for ( int i = 0; i < wildcard.length(); i++ ) { final char c = wildcard.charAt( i ); switch (c) { case '*': sb.append( ".*?" ); break; case '?': sb.append( "." ); break; // chars that have magic regex meaning. They need quoting to be taken // literally case '$': case '(': case ')': case '+': case '-': case '.': case '[': case '\\': case ']': case '^': case '{': case '|': case '}': sb.append( '\\' ); sb.append( c ); break; default: sb.append( c ); break; } } return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String wildcardToRegex(String wildcard){\r\n StringBuffer s = new StringBuffer(wildcard.length());\r\n s.append('^');\r\n for (int i = 0, is = wildcard.length(); i < is; i++) {\r\n char c = wildcard.charAt(i);\r\n switch(c) {\r\n case '*':\r\n...
[ "0.7157577", "0.643753", "0.63913345", "0.63223076", "0.59543186", "0.5952671", "0.57741576", "0.5747378", "0.5688685", "0.5670901", "0.5620696", "0.56071377", "0.55935574", "0.5533766", "0.5516511", "0.54353595", "0.5421081", "0.54051816", "0.5359027", "0.5353292", "0.532792...
0.7382609
0
Sets the value of dice.
void rollDice();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setDice(Dice dice) {\n this.dice = dice;\n }", "public int setDiceValue(int num){\r\n\t\trollNumber = num;\r\n\r\n\t\treturn rollNumber;\r\n\t}", "public void setDirection(int dice){\n\t}", "public ToolCardSetDiceValueAction(int callerID, Value value)\n\t{\n\t\tsuper(callerID);\n\t\tthi...
[ "0.79068035", "0.7181093", "0.7006592", "0.6938979", "0.68934", "0.68167526", "0.6765081", "0.6695971", "0.65340066", "0.64786", "0.6429418", "0.6428136", "0.62927425", "0.6255289", "0.6243227", "0.6239305", "0.62095165", "0.61994946", "0.61951214", "0.6170628", "0.6161905", ...
0.57873714
65
Manage the game pause.
void pause();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void pauseGame() {\n paused = true;\r\n cam.zoom = worldWidth/screenWidth;\r\n boundCamera();\r\n topHud.setPauseButtonCanDraw(false);\r\n gameHud.setCanPress(false);\r\n\r\n playButton.setDrawable(!(win || lose));\r\n homeButton.setDrawable(true);\r\n ...
[ "0.81949824", "0.806709", "0.7967236", "0.7909636", "0.7886771", "0.7886771", "0.78779817", "0.78645873", "0.78579706", "0.78497875", "0.783701", "0.782057", "0.779441", "0.7786459", "0.77861124", "0.7781988", "0.7781988", "0.7781988", "0.7781988", "0.7781988", "0.7781988", ...
0.0
-1
Give up the game.
void giveUp();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void preGame() {\n\n\t}", "private void playGame() {\n do {\n new Round(this);\n } while (!winner.isPresent());\n }", "private void gameOver() {\n\t\t\n\t}", "private void startGame() {\n betOptionPane();\n this.computerPaquetView.setShowJustOneCard(true);\n ...
[ "0.7295592", "0.7242153", "0.7213286", "0.72100884", "0.72051364", "0.71967095", "0.71732587", "0.71635145", "0.71497434", "0.7135495", "0.71187925", "0.7101679", "0.70883894", "0.7050977", "0.70508516", "0.70454985", "0.7029663", "0.7026282", "0.7024461", "0.6994453", "0.699...
0.0
-1
Sets the language of game.
void setLanguage(Language language);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLanguage(String language);", "@Override\n public void setLanguage(String lang) {\n }", "public void setApplicationLanguage() {\n\t\tinitializeMixerLocalization();\n\t\tinitializeRecorderLocalization();\n\t\tinitializeMenuBarLocalization();\n\t\tsetLocalizedLanguageMenuItems();\n\t\tboardCo...
[ "0.78193235", "0.77048916", "0.7579731", "0.7498519", "0.74590254", "0.7351712", "0.7344239", "0.7330076", "0.7287355", "0.7281283", "0.7184666", "0.7181612", "0.7138641", "0.7124942", "0.7094639", "0.7087071", "0.707606", "0.7075753", "0.7048971", "0.7048971", "0.70456916", ...
0.82242644
0
Starts the background music.
void startMusic(AudioTrack newSong);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void startMusic()\n\t{\n\t\tmusic.loop();\n\t}", "public void start() {\n background.playMusic();\n createTimer();\n timer.start();\n }", "public void playMusic() {\n\t\tthis.music.start();\n\t}", "public static void startMusic()\r\n\t{\r\n\t\tif ( musicPlayer == null )\...
[ "0.81026804", "0.7988838", "0.77739334", "0.74045044", "0.73998654", "0.7313298", "0.72533303", "0.72457004", "0.723474", "0.71794444", "0.71671754", "0.71570325", "0.70962274", "0.708318", "0.69864005", "0.689974", "0.68885416", "0.6867503", "0.6850568", "0.6849246", "0.6839...
0.6268287
58