blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71dd8197b392593b8778de9893ee198a1cc2e4e8 | 799cce351010ca320625a651fb2e5334611d2ebf | /Data Set/Manual/After/after_837.java | 0701da8b81cab7e7d8e8ff6a51584e2056f73e74 | [] | no_license | dareenkf/SQLIFIX | 239be5e32983e5607787297d334e5a036620e8af | 6e683aa68b5ec2cfe2a496aef7b467933c6de53e | refs/heads/main | 2023-01-29T06:44:46.737157 | 2020-11-09T18:14:24 | 2020-11-09T18:14:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 299 | java | public class Dummy{
public void updateLrc(int id, String lrc) throws SQLException {
String sql = "update inception_music set lyrics = ? where id = ?";
PreparedStatement ps = util.getConnection().prepareStatement(sql);
ps.setObject(1, lrc);
ps.setObject(2, id);
ps.execute();
}}
| [
"jahin99@gmail.com"
] | jahin99@gmail.com |
0ca791b6f86387346aee503fef4d3eb4a98fe9bf | a151473ac361651ef8d3354d4847dbcaa4434d35 | /src/test/java/org/test/Task2.java | 4931429bf8db7cf42d54d85c79c92fd2e02a8fee | [] | no_license | Priya1698/SnapedealTask | 272f37e13aef5230fe7d706434c03afb2a6ad1d8 | 26e655c7270282d5517f141f699ec70102f94fc0 | refs/heads/master | 2021-06-20T00:41:05.071477 | 2019-09-20T04:40:26 | 2019-09-20T04:40:26 | 209,594,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,616 | java | package org.test;
import java.util.Set;
import org.openqa.selenium.WebElement;
public class Task2 extends Task {
public static void main(String[] args) throws Throwable {
browserLaunch();
webBage("https://www.snapdeal.com");
scrShot("D:\\Priya\\Screenshots.img1.png");
WebElement enter = findIdBath("inputValEnter");
textValue(enter, getData(1, 0));
scrShot("D:\\Priya\\Screenshots.img2.png");
WebElement search = findXpath("//button[@class='searchformButton col-xs-4 rippleGrey']");
btnClick(search);
WebElement mb = findXpath("(//img[@class='product-image '])[4]");
btnClick(mb);
scrShot("D:\\Priya\\Screenshots.img3.png");
String pa1 = parentWindow();
Set<String> allWindow = allWindow();
for (String x : allWindow) {
if(!pa1.equals(x)) {
driver.switchTo().window(x);
}
}
Thread.sleep(3000);WebElement add = findXpath("(//span[@class='intialtext'])[2]");
btnClick(add);
scrShot("D:\\Priya\\Screenshots.img4.png");
Thread.sleep(3000);
WebElement cart = findXpath("//div[@class='cartInner']");
btnClick(cart);
scrShot("D:\\Priya\\Screenshots.img5.png");
Thread.sleep(3000);
WebElement addno = findXpath("//div[@id='CS1']");
btnClick(addno);
scrShot("D:\\Priya\\Screenshots.img6.png");
Thread.sleep(3000);
WebElement proceed = findXpath("//input[@class='btn btn-xl rippleWhite cart-button']");
btnClick(proceed);
scrShot("D:\\Priya\\Screenshots.img7.png");
WebElement mail = findIdBath("username");
textValue(mail, getData(1, 1));
scrShot("D:\\Priya\\Screenshots.img8.png");
Thread.sleep(3000);
WebElement con = findXpath("//button[@id='login-continue']");
scrShot("D:\\Priya\\Screenshots.img9.png");
}
}
| [
"priyapragathi1086@gmail.com"
] | priyapragathi1086@gmail.com |
6db0a051258df2a80fdd26f4173ffdb6b52f13d0 | 2fbd0602154935914fa4d6c45f6b10d42093c2bc | /src/controllers/ApplicationController.java | 41b01a2094b05879fa485f7a3ce9c7e71dad014c | [] | no_license | nilsma/jobApplicationTracker | c2619f0c2d9d6e01ae7bb2e34cf17790dde45eb2 | 56af7f74e157ef3f547471f5599bfdd6ce2cd0c2 | refs/heads/master | 2021-01-02T09:20:24.216400 | 2014-01-31T11:47:47 | 2014-01-31T12:11:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,184 | java | package controllers;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import javax.xml.transform.TransformerException;
import models.JobApplication;
import models.Profile;
import utils.JobApplicationSorter;
import utils.Utils;
import views.ApplicationView;
import views.StartView;
import xml.PreferencesXMLWriter;
import xml.StaxParser;
import xml.StaxWriterRev;
/**
* a controller class to control the main-application mainframe
* @author Nils Martinussen
* @version 0.1-13.08.2013
*/
public class ApplicationController implements ActionListener {
@SuppressWarnings("unused")
private AppDetailsController appDetailsController;
@SuppressWarnings("unused")
private PreferencesController preferencesController;
private String preferencesPath;
private String rootFolder = "/home/nilsma/JobApplicationTracker";
private StartView startView;
private ApplicationView applicationView;
private StartController startController;
private RegisterNewAppController regNewAppController;
private String filename;
private List<JobApplication> applications;
private ProfilesController profilesController;
private List<Profile> profilesList;
private String lastUsedProfile;
/**
* ApplicationController constructor which employs a run()-method
* to instantiate the main-application view, adds actionlisteners
*/
public ApplicationController() {
setApplicationDimensions();
startController = new StartController(this);
startView = startController.getStartView();
setPreferencesPath(rootFolder + "/preferences.xml");
preferencesController = new PreferencesController(this);
run();
applicationView.getChangeUser().addActionListener(this);
applicationView.getCloseapplication().addActionListener(this);
this.profilesController = new ProfilesController(this);
}
/**
* listens to actions performed on the main-application file-menu
*/
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == applicationView.getChangeUser()) {
lastUsedProfile = "";
profilesController.checkLastUsedProfile();
} else if(e.getSource() == applicationView.getCloseapplication()) {
promptForQuit();
}
}
/**
* a method to start the main-application main view
*/
public void run() {
applicationView = new ApplicationView(startController.getStartView());
applicationView.setVisible(true);
}
/**
* a method to update the main-applications last used profile field
* and to write the name of the profile to the preferences.xml file
* @param name of the last used profile
*/
public void updateLastUsedProfile(String name) {
lastUsedProfile = name;
PreferencesXMLWriter preferencesWriter = PreferencesXMLWriter.getInstance();
try {
preferencesWriter.writeLastUsedProfile(name, preferencesPath);
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "Something went wrong while trying to update last used profile (IO)");
e.printStackTrace();
} catch (ParserConfigurationException e) {
JOptionPane.showMessageDialog(null, "Something went wrong while trying to update last used profile (Parser)");
e.printStackTrace();
} catch (TransformerException e) {
JOptionPane.showMessageDialog(null, "Something went wrong while trying to update last used profile (Transformer)");
e.printStackTrace();
}
}
/**
* a method that prompts the user for verification, and
* closes the main-application if the user chooses to
*/
public void promptForQuit() {
Object[] options = {"Yes", "No"};
int returnVal = JOptionPane.showOptionDialog(
null, "Do you wish to to quit?", "Quit Program",
JOptionPane.OK_OPTION, JOptionPane.CANCEL_OPTION,
null, options, options[1]);
if(returnVal == JOptionPane.OK_OPTION) {
killProgram();
}
}
/**
* a method to update and sort the main-applications job-application-list
* and update the table of job-applications
*/
public void updateApplication() {
Utils.setOriginalList(filename);
applications = Utils.getOriginalList();
Utils.setLastUsedId(applications);
applications = JobApplicationSorter.sortApplications(
applications, startView.getSortCategories().getSelectedItem().toString()
);
startController.updateTable();
}
/**
* a method to kill the main-application
*/
public void killProgram() {
System.exit(0);
}
/**
* a method to generate the list of job-applications
* @param filename of the xml-file to be parsed
* @return a list of job-applications
*/
public List<JobApplication> loadApplications(String filename) {
StaxParser staxParser = StaxParser.getInstance();
List<JobApplication> list = new ArrayList<JobApplication>();
try {
list = staxParser.readFile(filename);
return list;
} catch (IOException e) {
System.out.println("Something went wrong while trying to parse the file: " + filename + " (IOException)");
e.printStackTrace();
} catch (XMLStreamException e) {
System.out.println("Something went wrong while trying to parse the file: " + filename + " (XMLStreamException)");
e.printStackTrace();
}
return applications;
}
/**
* a method to set the main-application view
* by removing components from the content pane
* and adding the general startView before repainting the view
*/
public void setStartView() {
applicationView.getContentPane().removeAll();
applicationView.getContentPane().add(startController.getStartView());
applicationView.validate();
applicationView.repaint();
}
/**
* a method that removes a job-application from the list of job-applications,
* and subsequently calls the updateListOfApplications() method to refresh the list on display
* @param index of the job-application to be removed
*/
public void removeRow(int index) {
applications.remove(index);
updateListOfApplications();
}
/**
* a method to update the list of job-applications xml-file
* by rewriting the xml-file of job-applications
*/
public void updateListOfApplications() {
StaxWriterRev staxWriter = StaxWriterRev.getInstance();
try {
staxWriter.addApplication(applications, filename);
} catch (IOException e) {
JOptionPane.showMessageDialog(null, "Something went wrong while trying to add an application to the list of applications");
e.printStackTrace();
} catch (ParserConfigurationException e) {
JOptionPane.showMessageDialog(null, "Something went wrong while trying to add an application to the list of applications");
e.printStackTrace();
} catch (TransformerException e) {
JOptionPane.showMessageDialog(null, "Something went wrong while trying to add an application to the list of applications");
e.printStackTrace();
}
}
/**
* a method to create an instance of AppDetailsController to
* display the details of the given job-application specified
* through the given param index
* @param index of the job-application of which to display the details
*/
public void initiateAppDetailsController(int index) {
this.appDetailsController = new AppDetailsController(this, index);
}
/**
* a method to create an instance of RegisterNewAppController
*/
public void initiateRegNewAppController() {
this.regNewAppController = new RegisterNewAppController(this, startController, applicationView, applications);
}
/**
* sets the screen dimensions of the application in the Utils-class
*/
public void setApplicationDimensions() {
Utils.setApplicationFrameWidth((int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().width);
Utils.setApplicationFrameHeight((int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().height);
}
/**
* @return the filename
*/
public String getFilename() {
return filename;
}
/**
* @paramupdateApps filename the filename to set
*/
public void setFilename(String filename) {
this.filename = filename;
applicationView.updateTitle(filename);
}
/**
* @return the applications
*/
public List<JobApplication> getApplications() {
return applications;
}
/**
* @param applications the applications to set
*/
public void setApplications(List<JobApplication> applications) {
this.applications = applications;
}
/**
* @return the applicationController
*/
public ApplicationController getApplicationController() {
return this;
}
/**
* @return the regNewAppController
*/
public RegisterNewAppController getRegNewAppController() {
return regNewAppController;
}
/**
* @param regNewAppController the regNewAppController to set
*/
public void setRegNewAppController(RegisterNewAppController regNewAppController) {
this.regNewAppController = regNewAppController;
}
/**
* @return the rootFolder
*/
public String getRootFolder() {
return rootFolder;
}
/**
* @param rootFolder the rootFolder to set
*/
public void setRootFolder(String rootFolder) {
this.rootFolder = rootFolder;
}
/**
* @return the profilesList
*/
public List<Profile> getProfilesList() {
return profilesList;
}
/**
* @param profilesList the profilesList to set
*/
public void setProfilesList(List<Profile> profilesList) {
this.profilesList = profilesList;
}
/**
* @return the preferencesPath
*/
public String getPreferencesPath() {
return preferencesPath;
}
/**
* @param preferencesPath the preferencesPath to set
*/
public void setPreferencesPath(String preferencesPath) {
this.preferencesPath = preferencesPath;
}
/**
* @return the lastUsedProfile
*/
public String getLastUsedProfile() {
return lastUsedProfile;
}
/**
* @param lastUsedProfile the lastUsedProfile to set
*/
public void setLastUsedProfile(String lastUsedProfile) {
this.lastUsedProfile = lastUsedProfile;
}
/**
* @return the startView
*/
public StartView getStartView() {
return startView;
}
/**
* @return the applicationView
*/
public ApplicationView getApplicationView() {
return applicationView;
}
}
| [
"nilsma231@gmail.com"
] | nilsma231@gmail.com |
d9526d2322b63f1f9ff0238102598f8ce0ee5b0d | cea2bd428ba7b16186ef6fb5cc7e993f84da729e | /spring-cloud-gcp-autoconfigure/src/test/java/org/springframework/cloud/gcp/autoconfigure/core/cloudfoundry/GcpCloudFoundryEnvironmentPostProcessorTests.java | c2e00834aa3a6f8df10446b6bd1b451766aa82ad | [
"Apache-2.0"
] | permissive | RomanKharkiv/spring-cloud-gcp | 2299f23667877a7a87904f2de5b6c49c95775749 | 62612a3cdacdcde57ddf77092e7582fd7ef3ede3 | refs/heads/master | 2020-03-23T18:00:51.911469 | 2018-07-19T21:03:03 | 2018-07-19T21:03:03 | 141,885,581 | 1 | 0 | Apache-2.0 | 2018-07-22T10:18:11 | 2018-07-22T10:18:10 | null | UTF-8 | Java | false | false | 6,164 | java | /*
* Copyright 2018 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.gcp.autoconfigure.core.cloudfoundry;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.json.JsonParser;
import org.springframework.boot.json.JsonParserFactory;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.cloud.gcp.autoconfigure.pubsub.GcpPubSubProperties;
import org.springframework.cloud.gcp.autoconfigure.spanner.GcpSpannerProperties;
import org.springframework.cloud.gcp.autoconfigure.sql.GcpCloudSqlProperties;
import org.springframework.cloud.gcp.autoconfigure.storage.GcpStorageProperties;
import org.springframework.cloud.gcp.autoconfigure.trace.GcpTraceProperties;
import org.springframework.core.io.ClassPathResource;
import static org.assertj.core.api.Assertions.assertThat;
/**
* @author João André Martins
*/
public class GcpCloudFoundryEnvironmentPostProcessorTests {
private ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withInitializer(context ->
new GcpCloudFoundryEnvironmentPostProcessor()
.postProcessEnvironment(context.getEnvironment(), null))
.withSystemProperties(new String[] {
"spring.cloud.gcp.sql.instance-connection-name=test-connection",
"spring.cloud.gcp.sql.database-name=test-dbname",
"spring.cloud.gcp.sql.credentials.encoded-key=test-key"
})
.withUserConfiguration(GcpCfEnvPPTestConfiguration.class);
@Test
public void testConfigurationProperties() throws IOException {
String vcapFileContents = new String(Files.readAllBytes(
new ClassPathResource("VCAP_SERVICES").getFile().toPath()));
this.contextRunner.withSystemProperties("VCAP_SERVICES=" + vcapFileContents)
.run(context -> {
GcpPubSubProperties pubSubProperties =
context.getBean(GcpPubSubProperties.class);
assertThat(pubSubProperties.getProjectId())
.isEqualTo("graphite-test-spring-cloud-gcp");
assertThat(pubSubProperties.getCredentials().getEncodedKey())
.isEqualTo(getPrivateKeyDataFromJson(vcapFileContents, "google-pubsub"));
GcpStorageProperties storageProperties =
context.getBean(GcpStorageProperties.class);
assertThat(storageProperties.getCredentials().getEncodedKey())
.isEqualTo(getPrivateKeyDataFromJson(vcapFileContents, "google-storage"));
GcpSpannerProperties spannerProperties =
context.getBean(GcpSpannerProperties.class);
assertThat(spannerProperties.getProjectId())
.isEqualTo("graphite-test-spring-cloud-gcp");
assertThat(spannerProperties.getCredentials().getEncodedKey())
.isEqualTo(getPrivateKeyDataFromJson(vcapFileContents, "google-spanner"));
assertThat(spannerProperties.getInstanceId())
.isEqualTo("pcf-sb-7-1521579042901037743");
GcpTraceProperties traceProperties = context.getBean(GcpTraceProperties.class);
assertThat(traceProperties.getProjectId())
.isEqualTo("graphite-test-spring-cloud-gcp");
assertThat(traceProperties.getCredentials().getEncodedKey())
.isEqualTo(getPrivateKeyDataFromJson(vcapFileContents, "google-stackdriver-trace"));
GcpCloudSqlProperties sqlProperties = context.getBean(GcpCloudSqlProperties.class);
assertThat(sqlProperties.getCredentials().getEncodedKey())
.isEqualTo(getPrivateKeyDataFromJson(vcapFileContents, "google-cloudsql-postgres"));
assertThat(sqlProperties.getInstanceConnectionName())
.isEqualTo("graphite-test-spring-cloud-gcp:us-central1:pcf-sb-3-1521233681947276465");
assertThat(sqlProperties.getDatabaseName())
.isEqualTo("pcf-sb-4-1521234236513507790");
DataSourceProperties dataSourceProperties = context.getBean(DataSourceProperties.class);
assertThat(dataSourceProperties.getUsername()).isEqualTo("fa6bb781-c76d-42");
assertThat(dataSourceProperties.getPassword())
.isEqualTo("IxEQ63FRxSUSgoDWKbqEHmhY6D9h4nro1fja8lnP48s=");
});
}
@Test
public void test2Sqls() throws IOException {
String vcapFileContents = new String(Files.readAllBytes(
new ClassPathResource("VCAP_SERVICES_2_SQL").getFile().toPath()));
this.contextRunner.withSystemProperties("VCAP_SERVICES=" + vcapFileContents)
.run(context -> {
GcpCloudSqlProperties sqlProperties =
context.getBean(GcpCloudSqlProperties.class);
//Both mysql and postgres settings present in VCAP_SERVICES_2_SQL file,
//so db name and connection name should not change
assertThat(sqlProperties.getDatabaseName()).isEqualTo("test-dbname");
assertThat(sqlProperties.getInstanceConnectionName()).isEqualTo("test-connection");
assertThat(sqlProperties.getCredentials().getEncodedKey()).isEqualTo("test-key");
});
}
private String getPrivateKeyDataFromJson(String json, String serviceName) {
JsonParser parser = JsonParserFactory.getJsonParser();
Map<String, Object> vcapMap = parser.parseMap(json);
return ((Map<String, String>) ((Map<String, Object>) ((List<Object>) vcapMap.get(serviceName)).get(0))
.get("credentials")).get("PrivateKeyData");
}
@EnableConfigurationProperties({GcpPubSubProperties.class, GcpStorageProperties.class,
GcpSpannerProperties.class, GcpTraceProperties.class, GcpCloudSqlProperties.class,
DataSourceProperties.class})
static class GcpCfEnvPPTestConfiguration {
}
}
| [
"noreply@github.com"
] | RomanKharkiv.noreply@github.com |
bd330b49e5805468fc8ac2058e0c98505f8627fe | 03e2782802728f557a23f9594b970f31a5de0d76 | /InterceptedNamedParameterJdbcTemplate/src/main/java/io/dveamer/sample/config/DatabaseConfig.java | cc6ca2f237167bc22159b5d9cdf16bbd0b407b01 | [
"MIT"
] | permissive | dveamer/SpringBootSample | 8cced11de421aae81c08e75d57a402b0c7f56b51 | fa610001fc5b6470d1de09358b55bc069d702d27 | refs/heads/master | 2021-12-23T21:11:32.145860 | 2021-12-19T08:02:26 | 2021-12-19T08:02:26 | 74,669,565 | 7 | 15 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package io.dveamer.sample.config;
import io.dveamer.sample.common.interceptor.jdbc.CudModifierJdbcInterceptor;
import io.dveamer.sample.common.interceptor.jdbc.JdbcInterceptor;
import io.dveamer.sample.common.interceptor.jdbc.PrintJdbcInterceptor;
import io.dveamer.sample.common.interceptor.jdbc.SqlIdJdbcInterceptor;
import io.dveamer.sample.common.wrapper.jdbc.InterceptedNamedParameterJdbcTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import javax.sql.DataSource;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class DatabaseConfig {
@Bean
public NamedParameterJdbcOperations namedParameterJdbcOperations(DataSource dataSource){
JdbcInterceptor sqlIdInterceptor = new SqlIdJdbcInterceptor();
JdbcInterceptor printInterceptor = new PrintJdbcInterceptor();
List<JdbcInterceptor> queryInterceptors = new ArrayList<>();
queryInterceptors.add(sqlIdInterceptor);
queryInterceptors.add(printInterceptor);
List<JdbcInterceptor> commandInterceptors = new ArrayList<>();
commandInterceptors.add(sqlIdInterceptor);
commandInterceptors.add(new CudModifierJdbcInterceptor());
commandInterceptors.add(printInterceptor);
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
jdbcTemplate.setFetchSize(300);
return new InterceptedNamedParameterJdbcTemplate(new NamedParameterJdbcTemplate(jdbcTemplate), queryInterceptors, commandInterceptors);
}
}
| [
"dveamer@gmail.com"
] | dveamer@gmail.com |
864ac3863003c7884ab03480b901d2af613fddff | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdas/applicationModule/src/test/java/applicationModulepackageJava1/Foo472Test.java | a82251c6e63217f9dd5fb6254e7e02910975e85b | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 481 | java | package applicationModulepackageJava1;
import org.junit.Test;
public class Foo472Test {
@Test
public void testFoo0() {
new Foo472().foo0();
}
@Test
public void testFoo1() {
new Foo472().foo1();
}
@Test
public void testFoo2() {
new Foo472().foo2();
}
@Test
public void testFoo3() {
new Foo472().foo3();
}
@Test
public void testFoo4() {
new Foo472().foo4();
}
@Test
public void testFoo5() {
new Foo472().foo5();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
a713bfea1718bf31dd21bde6b91bff3abda54559 | 49748bade95a27a8251f648e8a1197615b1d5c35 | /src/main/java/com/example/api/error/exception/MemberException.java | 4155a7349df7d3401a87993d2988a6ca7a218087 | [] | no_license | syh8088/example | 115f85970663c64420b2b981a30202447c925324 | 6a111f74c58d69b1fd2fe074528a56b28c9ba5b0 | refs/heads/master | 2021-07-18T17:34:04.033598 | 2021-02-07T13:22:50 | 2021-02-07T13:22:50 | 59,447,659 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 703 | java | package com.example.api.error.exception;
import com.example.api.config.handler.CustomMessageHandler;
import com.example.api.error.errorCode.ErrorCode;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.BAD_REQUEST)
public class MemberException extends RuntimeException {
private ErrorCode errorCode;
private String message;
public MemberException(ErrorCode errorCode) {
super(errorCode.getCode());
this.errorCode = errorCode;
this.message = CustomMessageHandler.getMessage(errorCode.getCode());
}
@Override
public String getMessage() {
return message;
}
}
| [
"syh8088@gmail.com"
] | syh8088@gmail.com |
6ee8448b24cf907a627898dcfb54c77ae53b40ca | 74b47b895b2f739612371f871c7f940502e7165b | /aws-java-sdk-globalaccelerator/src/main/java/com/amazonaws/services/globalaccelerator/model/CreateCustomRoutingAcceleratorRequest.java | 93610bf258c0245d871f594b8a89dbbe3b0b91bd | [
"Apache-2.0"
] | permissive | baganda07/aws-sdk-java | fe1958ed679cd95b4c48f971393bf03eb5512799 | f19bdb30177106b5d6394223a40a382b87adf742 | refs/heads/master | 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 | Apache-2.0 | 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null | UTF-8 | Java | false | false | 33,029 | java | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.globalaccelerator.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/CreateCustomRoutingAccelerator"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateCustomRoutingAcceleratorRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only
* alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.
* </p>
*/
private String name;
/**
* <p>
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.
* </p>
*/
private String ipAddressType;
/**
* <p>
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.
* </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you
* create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a
* second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web
* Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global
* Accelerator assigns each address range to a different network zone, for high availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses
* (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*/
private java.util.List<String> ipAddresses;
/**
* <p>
* Indicates whether an accelerator is enabled. The value is true or false. The default value is true.
* </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.
* </p>
*/
private Boolean enabled;
/**
* <p>
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
* </p>
*/
private String idempotencyToken;
/**
* <p>
* Create tags for an accelerator.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in
* Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*/
private java.util.List<Tag> tags;
/**
* <p>
* The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only
* alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.
* </p>
*
* @param name
* The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only
* alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.
*/
public void setName(String name) {
this.name = name;
}
/**
* <p>
* The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only
* alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.
* </p>
*
* @return The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only
* alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.
*/
public String getName() {
return this.name;
}
/**
* <p>
* The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only
* alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.
* </p>
*
* @param name
* The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only
* alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomRoutingAcceleratorRequest withName(String name) {
setName(name);
return this;
}
/**
* <p>
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.
* </p>
*
* @param ipAddressType
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be
* IPV4.
* @see IpAddressType
*/
public void setIpAddressType(String ipAddressType) {
this.ipAddressType = ipAddressType;
}
/**
* <p>
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.
* </p>
*
* @return The IP address type that an accelerator supports. For a custom routing accelerator, the value must be
* IPV4.
* @see IpAddressType
*/
public String getIpAddressType() {
return this.ipAddressType;
}
/**
* <p>
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.
* </p>
*
* @param ipAddressType
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be
* IPV4.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IpAddressType
*/
public CreateCustomRoutingAcceleratorRequest withIpAddressType(String ipAddressType) {
setIpAddressType(ipAddressType);
return this;
}
/**
* <p>
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.
* </p>
*
* @param ipAddressType
* The IP address type that an accelerator supports. For a custom routing accelerator, the value must be
* IPV4.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IpAddressType
*/
public CreateCustomRoutingAcceleratorRequest withIpAddressType(IpAddressType ipAddressType) {
this.ipAddressType = ipAddressType.toString();
return this;
}
/**
* <p>
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.
* </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you
* create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a
* second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web
* Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global
* Accelerator assigns each address range to a different network zone, for high availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses
* (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*
* @return Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an
* IPv4 address from your own pool to use for the accelerator's static IPv4 address when you create an
* accelerator. </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool.
* When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator
* assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address
* ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This
* restriction is because Global Accelerator assigns each address range to a different network zone, for
* high availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a
* new accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP
* addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
*/
public java.util.List<String> getIpAddresses() {
return ipAddresses;
}
/**
* <p>
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.
* </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you
* create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a
* second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web
* Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global
* Accelerator assigns each address range to a different network zone, for high availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses
* (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*
* @param ipAddresses
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an
* accelerator. </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool.
* When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator
* assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address
* ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This
* restriction is because Global Accelerator assigns each address range to a different network zone, for high
* availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP
* addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
*/
public void setIpAddresses(java.util.Collection<String> ipAddresses) {
if (ipAddresses == null) {
this.ipAddresses = null;
return;
}
this.ipAddresses = new java.util.ArrayList<String>(ipAddresses);
}
/**
* <p>
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.
* </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you
* create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a
* second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web
* Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global
* Accelerator assigns each address range to a different network zone, for high availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses
* (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setIpAddresses(java.util.Collection)} or {@link #withIpAddresses(java.util.Collection)} if you want to
* override the existing values.
* </p>
*
* @param ipAddresses
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an
* accelerator. </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool.
* When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator
* assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address
* ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This
* restriction is because Global Accelerator assigns each address range to a different network zone, for high
* availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP
* addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomRoutingAcceleratorRequest withIpAddresses(String... ipAddresses) {
if (this.ipAddresses == null) {
setIpAddresses(new java.util.ArrayList<String>(ipAddresses.length));
}
for (String ele : ipAddresses) {
this.ipAddresses.add(ele);
}
return this;
}
/**
* <p>
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.
* </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you
* create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a
* second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web
* Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global
* Accelerator assigns each address range to a different network zone, for high availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses
* (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*
* @param ipAddresses
* Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4
* address from your own pool to use for the accelerator's static IPv4 address when you create an
* accelerator. </p>
* <p>
* After you bring an address range to Amazon Web Services, it appears in your account as an address pool.
* When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator
* assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address
* ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This
* restriction is because Global Accelerator assigns each address range to a different network zone, for high
* availability.
* </p>
* <p>
* You can specify one or two addresses, separated by a space. Do not include the /32 suffix.
* </p>
* <p>
* Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new
* accelerator with the new addresses.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP
* addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomRoutingAcceleratorRequest withIpAddresses(java.util.Collection<String> ipAddresses) {
setIpAddresses(ipAddresses);
return this;
}
/**
* <p>
* Indicates whether an accelerator is enabled. The value is true or false. The default value is true.
* </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.
* </p>
*
* @param enabled
* Indicates whether an accelerator is enabled. The value is true or false. The default value is true. </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be
* deleted.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
* <p>
* Indicates whether an accelerator is enabled. The value is true or false. The default value is true.
* </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.
* </p>
*
* @return Indicates whether an accelerator is enabled. The value is true or false. The default value is true. </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be
* deleted.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
* <p>
* Indicates whether an accelerator is enabled. The value is true or false. The default value is true.
* </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.
* </p>
*
* @param enabled
* Indicates whether an accelerator is enabled. The value is true or false. The default value is true. </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be
* deleted.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomRoutingAcceleratorRequest withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
* <p>
* Indicates whether an accelerator is enabled. The value is true or false. The default value is true.
* </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.
* </p>
*
* @return Indicates whether an accelerator is enabled. The value is true or false. The default value is true. </p>
* <p>
* If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be
* deleted.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
* <p>
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
* </p>
*
* @param idempotencyToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of
* the request.
*/
public void setIdempotencyToken(String idempotencyToken) {
this.idempotencyToken = idempotencyToken;
}
/**
* <p>
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
* </p>
*
* @return A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of
* the request.
*/
public String getIdempotencyToken() {
return this.idempotencyToken;
}
/**
* <p>
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the
* request.
* </p>
*
* @param idempotencyToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of
* the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomRoutingAcceleratorRequest withIdempotencyToken(String idempotencyToken) {
setIdempotencyToken(idempotencyToken);
return this;
}
/**
* <p>
* Create tags for an accelerator.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in
* Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*
* @return Create tags for an accelerator.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html"
* >Tagging in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
*/
public java.util.List<Tag> getTags() {
return tags;
}
/**
* <p>
* Create tags for an accelerator.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in
* Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*
* @param tags
* Create tags for an accelerator.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging
* in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
*/
public void setTags(java.util.Collection<Tag> tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList<Tag>(tags);
}
/**
* <p>
* Create tags for an accelerator.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in
* Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
* </p>
*
* @param tags
* Create tags for an accelerator.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging
* in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomRoutingAcceleratorRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList<Tag>(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
* <p>
* Create tags for an accelerator.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in
* Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
* </p>
*
* @param tags
* Create tags for an accelerator.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging
* in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomRoutingAcceleratorRequest withTags(java.util.Collection<Tag> tags) {
setTags(tags);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getIpAddressType() != null)
sb.append("IpAddressType: ").append(getIpAddressType()).append(",");
if (getIpAddresses() != null)
sb.append("IpAddresses: ").append(getIpAddresses()).append(",");
if (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getIdempotencyToken() != null)
sb.append("IdempotencyToken: ").append(getIdempotencyToken()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateCustomRoutingAcceleratorRequest == false)
return false;
CreateCustomRoutingAcceleratorRequest other = (CreateCustomRoutingAcceleratorRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getIpAddressType() == null ^ this.getIpAddressType() == null)
return false;
if (other.getIpAddressType() != null && other.getIpAddressType().equals(this.getIpAddressType()) == false)
return false;
if (other.getIpAddresses() == null ^ this.getIpAddresses() == null)
return false;
if (other.getIpAddresses() != null && other.getIpAddresses().equals(this.getIpAddresses()) == false)
return false;
if (other.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
return false;
if (other.getIdempotencyToken() == null ^ this.getIdempotencyToken() == null)
return false;
if (other.getIdempotencyToken() != null && other.getIdempotencyToken().equals(this.getIdempotencyToken()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getIpAddressType() == null) ? 0 : getIpAddressType().hashCode());
hashCode = prime * hashCode + ((getIpAddresses() == null) ? 0 : getIpAddresses().hashCode());
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getIdempotencyToken() == null) ? 0 : getIdempotencyToken().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateCustomRoutingAcceleratorRequest clone() {
return (CreateCustomRoutingAcceleratorRequest) super.clone();
}
}
| [
""
] | |
38d7018220260d7a1abe3296b02620ce280d1a97 | a04617473fd2151814b202174e81ebea401d9efd | /src/peliculas/dao/repartoDAO.java | 0a7ad2cbc80fe357a2ffa60012534af20b1a67b4 | [] | no_license | mateovelilla/ITM-Peliculas | 2c991ec2cc2fb5ca474de28cddedca0b5dcf7619 | 1aaedd81d819a28d6c4359b2f7120a9c68c3eed6 | refs/heads/master | 2021-01-20T09:06:38.453902 | 2017-05-07T22:27:09 | 2017-05-07T22:27:09 | 90,219,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,168 | java | package peliculas.dao;
import peliculas.dto.repartoDTO;
import java.sql.*;
public class repartoDAO {
conexion con;
public int countRow(ResultSet resultado)
{
int cont=0;
try{
while(resultado.next())
{
cont++;
}
}catch(Exception e)
{
System.err.println("Error al realizar el conteo");
}
return cont;
}
public repartoDTO[] buscarReparto(repartoDTO reparto)
{
repartoDTO[] repartos = null;
try{
con = new conexion();
con.iniciarConnection();
}catch(Exception e)
{
System.err.println("Error al iniciar la conexion");
System.err.println(e);
}
try{
PreparedStatement pstm = con.traerConexion().prepareStatement(
"SELECT * FROM reparto " +
"WHERE peliculaId = ?");
pstm.setInt(1,reparto.getPeliculaId());
int cont;
try (ResultSet res = pstm.executeQuery()) {
int size = this.countRow(res);
repartoDTO[] dto = new repartoDTO[size];
cont = 0;
res.beforeFirst();// Retorna el cursor al principio
while(res.next()){
repartoDTO repartoRow = new repartoDTO();
repartoRow.setId(res.getInt("id"));
repartoRow.setPeliculaId(res.getInt("peliculaId"));
repartoRow.setActorId(res.getInt("actorId"));
repartoRow.setReparto(res.getString("personaje"));
dto[cont] = repartoRow;
cont++;
}
repartos = dto;
}
con.cerrarConexion();
}catch(SQLException e){
System.err.println("Error de base de datos");
System.err.println(e);
}
return repartos;
}
public boolean crear(repartoDTO reparto)
{
boolean response = false;
try{
con = new conexion();
con.iniciarConnection();
}catch(Exception e)
{
System.err.println("Error al iniciar la conexion");
System.err.println(e);
response = false;
}
try{
PreparedStatement pstm = con.traerConexion().prepareStatement(
"insert into reparto (peliculaId," +
"actorId,"+
"personaje)"+
" values(?,?,?)");
pstm.setInt(1, reparto.getPeliculaId());
pstm.setInt(2, reparto.getActorId());
pstm.setString(3, reparto.getReparto());
if(pstm.executeUpdate() > 0)
{
response = true;
}else{
response = false;
}
con.cerrarConexion();
}catch(SQLException sqE)
{
System.err.println("Error al insertar");
System.err.println(sqE);
}
catch(Exception e){
System.err.println("Error:");
System.err.println(e);
}
return response;
}
public boolean eliminar(int id)
{
boolean respuesta = false;
int resultado;
try{
con = new conexion();
con.iniciarConnection();
}catch(Exception e)
{
System.err.println("Error al iniciar la conexion");
System.err.println(e);
respuesta = false;
}
try{
PreparedStatement pstm = con.traerConexion().prepareStatement(
"delete from reparto " + " where id = ?");
pstm.setInt(1, id);
resultado = pstm.executeUpdate();
if(resultado > 0){
respuesta = true;
}else
{
respuesta = false;
}
}catch(SQLException sqlEx)
{
System.err.println("Error al ejecutar el query");
System.err.println(sqlEx);
}
catch(Exception e)
{
System.err.println("Error");
System.err.println(e);
}
con.cerrarConexion();
return respuesta;
}
}
| [
"teovelilla@gmail.com"
] | teovelilla@gmail.com |
d3cc6f48befb793b7570532bcbc1b8312f1c2752 | d0cbede62d34a1925b391c9cf612ade2cafd1035 | /com.gxlu.international/com.gxlu.international.common/src/main/java/com/gxlu/international/common/FtpUpJobTemplate.java | 4a2ca5c89b2e68398e89d3bf61a5c27ca8f083a1 | [] | no_license | lordofwar/interfacePlatform | 22d0f937035fa6d9b71252b6f9e101825495459e | bf3cfe447a7ecbd01512c0fafe31047be167a9a9 | refs/heads/master | 2021-01-17T16:08:22.168918 | 2014-04-10T06:34:44 | 2014-04-10T06:34:44 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 1,899 | java | /**
*
*/
package com.gxlu.international.common;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.gxlu.interfacePlatform.foundation.ftp.component.FTPException;
import com.gxlu.interfacePlatform.foundation.ftp.component.FTPMessageCollector;
import com.gxlu.interfacePlatform.foundation.ftp.component.FTPServer;
/**
* @author Clark
*
*/
public abstract class FtpUpJobTemplate {
protected FTPServer ftpServer;
protected List<File> upLoadFiles = new ArrayList<File>();
protected File tempFilePath;
private static Log logger = LogFactory.getLog(FtpUpJobTemplate.class);
protected FtpUpJobTemplate(){
tempFilePath = getTempFilePath();
}
protected abstract void generateFiles() throws Exception;
protected abstract FTPServer getFtpServer() throws Exception;
protected void upLoadFiles() throws Exception{
ftpServer = getFtpServer();
FTPMessageCollector listener = new FTPMessageCollector();
ftpServer.setMessageListener(listener);
if(upLoadFiles != null && upLoadFiles.size()>0){
for(File file: upLoadFiles){
logger.info("ÉÏ´«Îļþ: "+file.getName());
ftpServer.put(file.getAbsolutePath(),file.getName());
file.delete();
}
}
ftpServer.quit();
}
public File getTempFilePath(){
File tempPath = new File("temp");
if(!tempPath.exists())
tempPath.mkdir();
return tempPath;
}
public void execute() throws Exception{
generateFiles();
upLoadFiles();
}
public List<File> getUpLoadFiles() {
return upLoadFiles;
}
public void setUpLoadFiles(List<File> upLoadFiles) {
this.upLoadFiles = upLoadFiles;
}
}
| [
"greenandbule@126.com"
] | greenandbule@126.com |
634102f09bedf0c59ebf7ecfc3ace3456bdc843f | 69005ab4c8cc5d88d7996d47ac8def0b28730b95 | /android-medium/app/src/main/java/test/perf/MyPerfClass_2437.java | 21cbf217773440c60e6750a40f887a8bbd63ebe8 | [] | no_license | sakerbuild/performance-comparisons | ed603c9ffa0d34983a7da74f7b2b731dc3350d7e | 78cd8d7896c4b0255ec77304762471e6cab95411 | refs/heads/master | 2020-12-02T19:14:57.865537 | 2020-05-11T14:09:40 | 2020-05-11T14:09:40 | 231,092,201 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 803 | java | package test.perf;
public class MyPerfClass_2437{
private final String property;
public MyPerfClass_2437(String param) {
this.property = param;
}
public String getProperty() {
return property;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((property == null) ? 0 : property.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MyPerfClass_2437 other = (MyPerfClass_2437) obj;
if (property == null) {
if (other.property != null)
return false;
} else if (!property.equals(other.property))
return false;
return true;
}
}
| [
"10866741+Sipkab@users.noreply.github.com"
] | 10866741+Sipkab@users.noreply.github.com |
3737762e094f246cde51a9972e27ff6e45d71fc0 | a91e396ab4a04db61bfeb5ac6b82ba0452d284cf | /app/src/main/java/com/ace/burning/demomvp/View/ViewData.java | cf15bc6a0e2c70ea0d44e7fd39c419535959d948 | [] | no_license | Ashraf100/DemoMvp | a37ae6c0fd912d1efd47c2740bd6e9823361cf3a | de7b38613c4759016b772957e78fdd8c02109f59 | refs/heads/master | 2021-01-21T10:13:50.053925 | 2017-02-28T06:17:54 | 2017-02-28T06:17:54 | 83,396,980 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,721 | java | package com.ace.burning.demomvp.View;
import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.widget.Toast;
import com.ace.burning.demomvp.Model.AllTask;
import com.ace.burning.demomvp.Model.ApiResponse;
import com.ace.burning.demomvp.Model.JSONResponse;
import com.ace.burning.demomvp.Presenter.DataPresenter;
import com.ace.burning.demomvp.R;
import java.util.ArrayList;
import java.util.Arrays;
import butterknife.BindView;
import butterknife.ButterKnife;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ViewData extends AppCompatActivity implements DataPresenter {
private ArrayList<AllTask> data;
private DataAdapter adapter;
ProgressDialog progressDialog;
@BindView(R.id.card_recycler_view) RecyclerView recyclerView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
intView();
}
@Override
public void intView() {
ButterKnife.bind(this);
recyclerView.setHasFixedSize(true);
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
recyclerView.setLayoutManager(layoutManager);
loadJson();
}
@Override
public void loadJson() {
progressDialog = ProgressDialog.show(this, "Loading...", null);
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://10.10.10.116")
.addConverterFactory(GsonConverterFactory.create())
.build();
ApiResponse request = retrofit.create(ApiResponse.class);
Call<JSONResponse> call = request.getJSON();
call.enqueue(new Callback<JSONResponse>() {
@Override
public void onResponse(Call<JSONResponse> call, Response<JSONResponse> response) {
JSONResponse jsonResponse = response.body();
data = new ArrayList<>(Arrays.asList(jsonResponse.getEvent()));
adapter = new DataAdapter(data);
recyclerView.setAdapter(adapter);
progressDialog.dismiss();
}
@Override
public void onFailure(Call<JSONResponse> call, Throwable t) {
Log.d("Error",t.getMessage());
}
});
}
@Override
public void onBackPressed() {
super.onBackPressed();
}
}
| [
"developer.ashraf100@gmail.com"
] | developer.ashraf100@gmail.com |
50eb1923b08414778f3f207859c9d444fa444a40 | cc6b5940d80553bf8a178e8f3108167945fcfb12 | /drools-serialization-protobuf/src/main/java/org/drools/serialization/protobuf/ProtobufMarshallerWriteContext.java | 194e058b5867b3fe9d24963af0ec195bea376179 | [
"Apache-2.0"
] | permissive | yesamer/drools | f0f9889f212a1becb1144ed704e58649f2555bcd | 92b5f4e57755bfd1f4e52af34dfcbf0d608f33c9 | refs/heads/master | 2023-07-06T14:50:31.161516 | 2023-06-27T01:00:28 | 2023-06-27T01:00:28 | 185,600,193 | 0 | 0 | Apache-2.0 | 2022-02-15T11:22:48 | 2019-05-08T12:19:09 | Java | UTF-8 | Java | false | false | 8,141 | java | /*
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.drools.serialization.protobuf;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Map;
import org.drools.core.common.BaseNode;
import org.drools.core.common.InternalWorkingMemory;
import org.drools.kiesession.rulebase.InternalKnowledgeBase;
import org.drools.core.marshalling.MarshallerWriteContext;
import org.drools.serialization.protobuf.marshalling.ObjectMarshallingStrategyStoreImpl;
import org.drools.core.phreak.PhreakTimerNode.TimerNodeJobContext;
import org.drools.core.reteoo.LeftTuple;
import org.drools.core.reteoo.ObjectTypeNode.ExpireJobContext;
import org.drools.core.rule.SlidingTimeWindow;
import org.drools.serialization.protobuf.timers.BehaviorJobContextTimerOutputMarshaller;
import org.drools.serialization.protobuf.timers.ExpireJobContextTimerOutputMarshaller;
import org.drools.serialization.protobuf.timers.TimerNodeTimerOutputMarshaller;
import org.kie.api.marshalling.ObjectMarshallingStrategy;
import org.kie.api.marshalling.ObjectMarshallingStrategyStore;
import org.kie.api.runtime.Environment;
import org.kie.api.runtime.EnvironmentName;
import org.kie.internal.marshalling.MarshallerFactory;
public class ProtobufMarshallerWriteContext extends ObjectOutputStream implements MarshallerWriteContext {
private final InternalKnowledgeBase kBase;
private final InternalWorkingMemory wm;
private final Map<Integer, BaseNode> sinks;
private long clockTime;
public final Map<Class< ? >, TimersOutputMarshaller> writersByClass;
public final PrintStream out = System.out;
private final ObjectMarshallingStrategyStore objectMarshallingStrategyStore;
private final Map<ObjectMarshallingStrategy, Integer> usedStrategies;
private final Map<ObjectMarshallingStrategy, ObjectMarshallingStrategy.Context> strategyContext;
public final Map<LeftTuple, Integer> terminalTupleMap;
private final boolean marshalProcessInstances;
private final boolean marshalWorkItems;
private final Environment env;
private Object parameterObject;
public ProtobufMarshallerWriteContext( OutputStream stream,
InternalKnowledgeBase kBase,
InternalWorkingMemory wm,
Map<Integer, BaseNode> sinks,
ObjectMarshallingStrategyStore resolverStrategyFactory,
Environment env) throws IOException {
this( stream,
kBase,
wm,
sinks,
resolverStrategyFactory,
true,
true,
env );
}
public ProtobufMarshallerWriteContext( OutputStream stream,
InternalKnowledgeBase kBase,
InternalWorkingMemory wm,
Map<Integer, BaseNode> sinks,
ObjectMarshallingStrategyStore resolverStrategyFactory,
boolean marshalProcessInstances,
boolean marshalWorkItems,
Environment env) throws IOException {
super( stream );
this.kBase = kBase;
this.wm = wm;
this.sinks = sinks;
this.writersByClass = new HashMap<>();
this.writersByClass.put( SlidingTimeWindow.BehaviorJobContext.class, new BehaviorJobContextTimerOutputMarshaller() );
this.writersByClass.put( ExpireJobContext.class, new ExpireJobContextTimerOutputMarshaller() );
this.writersByClass.put( TimerNodeJobContext.class, new TimerNodeTimerOutputMarshaller() );
if ( resolverStrategyFactory == null ) {
ObjectMarshallingStrategy[] strats = (ObjectMarshallingStrategy[]) env.get( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES );
if ( strats == null ) {
strats = getMarshallingStrategy();
}
this.objectMarshallingStrategyStore = new ObjectMarshallingStrategyStoreImpl( strats );
}
else {
this.objectMarshallingStrategyStore = resolverStrategyFactory;
}
this.usedStrategies = new HashMap<>();
this.strategyContext = new HashMap<>();
this.terminalTupleMap = new IdentityHashMap<>();
this.marshalProcessInstances = marshalProcessInstances;
this.marshalWorkItems = marshalWorkItems;
this.env = env;
}
protected ObjectMarshallingStrategy[] getMarshallingStrategy() {
return new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()};
}
@Override
public Integer getStrategyIndex(ObjectMarshallingStrategy strategy) {
Integer index = usedStrategies.get( strategy );
if ( index == null ) {
index = Integer.valueOf( usedStrategies.size() );
usedStrategies.put( strategy, index );
strategyContext.put( strategy, strategy.createContext() );
}
return index;
}
@Override
public InternalKnowledgeBase getKnowledgeBase() {
return kBase;
}
@Override
public ObjectMarshallingStrategyStore getObjectMarshallingStrategyStore() {
return objectMarshallingStrategyStore;
}
@Override
public Object getParameterObject() {
return parameterObject;
}
@Override
public void setParameterObject( Object parameterObject ) {
this.parameterObject = parameterObject;
}
@Override
public InternalWorkingMemory getWorkingMemory() {
return wm;
}
@Override
public Map<ObjectMarshallingStrategy, ObjectMarshallingStrategy.Context> getStrategyContext() {
return strategyContext;
}
@Override
public Map<ObjectMarshallingStrategy, Integer> getUsedStrategies() {
return usedStrategies;
}
@Override
public Map<Integer, BaseNode> getSinks() {
return sinks;
}
@Override
public boolean isMarshalProcessInstances() {
return marshalProcessInstances;
}
@Override
public boolean isMarshalWorkItems() {
return marshalWorkItems;
}
@Override
public Environment getEnvironment() {
return env;
}
@Override
public long getClockTime() {
return clockTime;
}
@Override
public void setClockTime( long clockTime ) {
this.clockTime = clockTime;
}
@Override
public Object getWriterForClass(Class<?> c) {
return writersByClass.get( c );
}
@Override
public void setWriterForClass(Class<?> c, Object writer) {
writersByClass.put( c, (TimersOutputMarshaller ) writer );
}
}
| [
"noreply@github.com"
] | yesamer.noreply@github.com |
92c14c8959014db82d02ce3c6ec5a7f4e7786240 | 85510df1d9665660b5c8e49b34dbc94937055c71 | /hyeokdev/src/main/java/com/hyeokdev/home/controller/HomeController.java | 6819e8a9044889c953a4e13cbe8fb844ee6a41cc | [] | no_license | hyeokdev/study | 81d8173089e5c2c9caf3d5fab2d556445f6d4f18 | 117e7d63f48fbf4ec7bfa26ddf483eff61e81abf | refs/heads/master | 2023-01-28T17:04:26.509905 | 2019-12-11T03:33:56 | 2019-12-11T03:33:56 | 227,268,903 | 0 | 0 | null | 2023-01-05T02:47:08 | 2019-12-11T03:31:23 | Java | UTF-8 | Java | false | false | 261 | java | package com.hyeokdev.home.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HomeController {
@GetMapping("/")
public String home() {
return "index.html";
}
}
| [
"hyeokdev@gmail.com"
] | hyeokdev@gmail.com |
89e509e8ce1c967ffa1d3a1539d450098db7caac | a78b493dbdc0b0d49f5b85bf6f8d2120b3020909 | /src/examples/gipc/consensus/asynchronous/AnAsynchronousProposerLauncher.java | c4bfe48b7a903cbd208b61fffcb95cb82e93e818 | [] | no_license | pdewan/GIPC | 6998839307eedf37dda0451bfe331c45c0bfc1b5 | 46c18824b7a5cf73bf12122023a714194a464415 | refs/heads/master | 2022-04-26T20:32:09.075467 | 2022-04-03T19:48:39 | 2022-04-03T19:48:39 | 16,309,078 | 3 | 6 | null | 2017-05-10T23:29:18 | 2014-01-28T10:45:03 | Java | UTF-8 | Java | false | false | 678 | java | package examples.gipc.consensus.asynchronous;
import consensus.ConsensusMechanismFactory;
import consensus.asynchronous.sequential.AnAsynchronousConsensusMechanismFactory;
import examples.gipc.consensus.AnExampleProposerLauncher;
public class AnAsynchronousProposerLauncher extends AnExampleProposerLauncher {
public AnAsynchronousProposerLauncher(String aLocalName,
int aPortNumber) {
super(aLocalName, aPortNumber);
}
@Override
protected ConsensusMechanismFactory<Integer> meaningConsensusMechanismFactory() {
return new AnAsynchronousConsensusMechanismFactory<>();
}
@Override
protected void customizeConsensusMechanisms() {
}
}
| [
"dewan@cs.unc.edu"
] | dewan@cs.unc.edu |
f789865bb70f4e72a538d50ad2c80aa52463826b | a64cd39b2d26fef2840b875c1103f18b1dd3a1d9 | /app/src/test/java/uk/ac/rgu/rguweather/ExampleUnitTest.java | 196aa3a7ef935cccdf544d1e2b00a89c5f1d04c7 | [] | no_license | chloeolut/cm3110-2020-week-1-chloeolut | a096a4b00de321f34a0db07e2b154fce9a9a9abf | 10fb95a11666f3091db77735e79815a2abca9d9f | refs/heads/master | 2022-12-28T15:53:10.891073 | 2020-10-17T22:56:52 | 2020-10-17T22:56:52 | 304,982,926 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 381 | java | package uk.ac.rgu.rguweather;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"davidcorsar@gmail.com"
] | davidcorsar@gmail.com |
8df3f88153b68a13a63e70857e3f4bb1ac2bc3c7 | bd7f35922471f956d434918e65e9cfbb7e0defdc | /FinalProject/src/finalproject/BloodGlucoseGUI.java | 824b315a4ab770faa7ed662b4c5540b83994e27b | [] | no_license | jflinn18/CS372-Homework | 8436fc9f6508442675af0499a6823d19f42fdbc1 | 86673f37000c3083c0972d66457c0eebd0925886 | refs/heads/master | 2020-06-13T23:09:51.490005 | 2015-02-20T03:44:05 | 2015-02-20T03:44:05 | 28,835,344 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,144 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package finalproject;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import javax.swing.DefaultListModel;
import javax.swing.JFileChooser;
import javax.swing.UIManager;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import org.jfree.chart.ChartPanel;
/**
* This is a Blood Glucose Data Analyzer. It takes data in and tells the user,
* based on the data the is opened, where there have been patterns in the data
* over the last week.
* @author Joseph
*/
public class BloodGlucoseGUI extends javax.swing.JFrame {
private MyTableModel tabMod;
private ChartPanel chartPanel;
private DefaultListModel listMod;
private JFileChooser jfc;
/**
* Constructor
* Creates new form BloodGlucoseGUI
*/
// I would put most of it in initComponents if I could
// edit that generated code.
public BloodGlucoseGUI() {
initComponents();
//jfc = new JFileChooser("Resources/Data");
// For "commercial" use
//jfc = new JFileChooser("C:\\Program Files\\BGDataAnalysis\\Data");
jfc = new JFileChooser("C:\\BGDataAnalysis\\Data");
tabMod = new MyTableModel();
jTable2.setModel(tabMod);
listMod = new DefaultListModel();
jList1.setModel(listMod);
JTableHeader th = jTable2.getTableHeader();
TableColumnModel tcm = th.getColumnModel();
TableColumn tc = tcm.getColumn(0);
tc.setHeaderValue("Time");
tc = tcm.getColumn(1);
tc.setHeaderValue( "Blood Glucose" );
th.repaint();
notesTextArea.setLineWrap(true);
notesTextArea.setWrapStyleWord(true);
notesTextArea.addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_ENTER)
{
e.consume();
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Please don't press the ENTER button!");
pu.display();
}
}
});
}
/**
* 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() {
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jScrollPane2 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
dateTextField = new javax.swing.JTextField();
analyzeBtn = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jList1 = new javax.swing.JList();
jScrollPane3 = new javax.swing.JScrollPane();
notesTextArea = new javax.swing.JTextArea();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
graphBtn = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
newMenuItem = new javax.swing.JMenuItem();
openMenuItem = new javax.swing.JMenuItem();
saveGraphMenuItem = new javax.swing.JMenuItem();
saveDataMenuItem = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Blood Glucose Data Analysis");
setName(""); // NOI18N
jTable2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{"12:00 am", null},
{"1:00 am", null},
{"2:00 am", null},
{"3:00 am", null},
{"4:00 am", null},
{"5:00 am", null},
{"6:00 am", null},
{"7:00 am", null},
{"8:00 am", null},
{"9:00 am", null},
{"10:00 am", null},
{"11:00 am", null},
{"12:00 pm", null},
{"1:00 pm", null},
{"2:00 pm", null},
{"3:00 pm", null},
{"4:00 pm", null},
{"5:00 pm", null},
{"6:00 pm", null},
{"7:00 pm", null},
{"8:00 pm", null},
{"9:00 pm", null},
{"10:00 pm", null},
{"11:00 pm", null}
},
new String [] {
"Time", "Blood Glucose"
}
) {
boolean[] canEdit = new boolean [] {
false, true
};
public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit [columnIndex];
}
});
jScrollPane2.setViewportView(jTable2);
jLabel1.setText("Date:");
analyzeBtn.setText("Analyze");
analyzeBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
analyzeBtnActionPerformed(evt);
}
});
jList1.setModel(new javax.swing.AbstractListModel() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
jScrollPane1.setViewportView(jList1);
notesTextArea.setColumns(20);
notesTextArea.setRows(5);
jScrollPane3.setViewportView(notesTextArea);
jLabel2.setText("Notes:");
jLabel3.setText("Analysis:");
graphBtn.setText("Graph");
graphBtn.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
graphBtnActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(dateTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(graphBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(analyzeBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(21, 21, 21)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 69, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(174, 174, 174)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(19, 19, 19))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(dateTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(graphBtn)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(analyzeBtn)
.addGap(39, 39, 39))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(1, 1, 1)
.addComponent(jLabel3)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2)
.addGap(18, 18, 18))
.addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 319, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 554, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(35, Short.MAX_VALUE))))
);
jTabbedPane1.addTab("Blood Glucose", jPanel1);
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 695, Short.MAX_VALUE)
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 560, Short.MAX_VALUE)
);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(40, 40, 40))
);
jTabbedPane1.addTab("Graph", jPanel2);
jMenu1.setText("File");
newMenuItem.setText("New");
newMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
newMenuItemActionPerformed(evt);
}
});
jMenu1.add(newMenuItem);
openMenuItem.setText("Open");
openMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
openMenuItemActionPerformed(evt);
}
});
jMenu1.add(openMenuItem);
saveGraphMenuItem.setText("Save Graph");
saveGraphMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveGraphMenuItemActionPerformed(evt);
}
});
jMenu1.add(saveGraphMenuItem);
saveDataMenuItem.setText("Save Data");
saveDataMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
saveDataMenuItemActionPerformed(evt);
}
});
jMenu1.add(saveDataMenuItem);
jMenuBar1.add(jMenu1);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* Opens a user specified file
* @param evt
*/
private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openMenuItemActionPerformed
jfc.showOpenDialog(jfc);
jfc.cancelSelection();
for (int i = 0; i < tabMod.getMyData().length; i++)
jTable2.setValueAt("", i, 1);
tabMod.getDataFromFile(jfc.getSelectedFile());
try
{
setTable();
}
catch (Exception ex) {}
}//GEN-LAST:event_openMenuItemActionPerformed
/**
* Saves the data to a file
* @param evt
*/
private void saveDataMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveDataMenuItemActionPerformed
FileIO fio = new FileIO();
try
{
tabMod.setDate(dateTextField.getText());
tabMod.setNotes(notesTextArea.getText());
fio.outputToFile(tabMod.getDate(), tabMod.getMyData(), tabMod.getNotes());
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Save Complete!");
pu.display();
}
catch (Exception ex)
{
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Input a valid date:");
pu.add("mm/dd/yy");
pu.add("mm-dd-yy");
pu.display();
System.out.printf("%s", ex.getMessage());
}
}//GEN-LAST:event_saveDataMenuItemActionPerformed
/**
* Analyzes the data
* @param evt
*/
private void analyzeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_analyzeBtnActionPerformed
listMod.clear();
int[] hls;
try
{
AnalyzeData ad = new AnalyzeData(tabMod.getMyData(), tabMod.getDate());
hls = ad.getToday();
MyListModel list = new MyListModel(hls, tabMod.getMyData());
for (int i = 0; i < list.getList().size(); i++)
{
listMod.addElement(list.getList().get(i));
}
//jList1.setModel(listMod);
}
catch (Exception ex)
{
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Invalid Input!");
pu.display();
ex.getMessage();
}
}//GEN-LAST:event_analyzeBtnActionPerformed
/**
* "Clears" the GUI of any data so that the user can input more
* @param evt
*/
private void newMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newMenuItemActionPerformed
for (int i = 0; i < tabMod.getMyData().length; i++)
tabMod.setValueAt("", i, 1);
tabMod.resetDate();
listMod.clear();
notesTextArea.setText("");
dateTextField.setText("");
}//GEN-LAST:event_newMenuItemActionPerformed
/**
* Graphs the data
* @param evt
*/
private void graphBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_graphBtnActionPerformed
try
{
tabMod.setDate(dateTextField.getText());
tabMod.setNotes(notesTextArea.getText());
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Added Data Successfully!");
pu.display();
}
catch (Exception ex)
{
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Input a valid date:");
pu.add("mm/dd/yy");
pu.add("mm-dd-yy");
pu.display();
System.out.println("setTable() Error!");
}
try
{
GraphData graph = new GraphData(tabMod.getDate());
chartPanel = new ChartPanel(graph.graphVsTime(tabMod.getMyData(), tabMod.getNames()));
jTabbedPane1.setComponentAt(1, chartPanel);
}
catch (Exception ex)
{
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("No Data Found!");
pu.display();
}
}//GEN-LAST:event_graphBtnActionPerformed
/**
* Saves the generated Graph to a file
* @param evt
*/
private void saveGraphMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveGraphMenuItemActionPerformed
try
{
FileIO fio = new FileIO();
fio.saveGraph(tabMod.getDate(), chartPanel.getChart());
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Done saving the Chart.");
pu.display();
}
catch (Exception ex)
{
ErrorGUIs.Popup pu = new ErrorGUIs.Popup();
pu.add("Saving the chart Failed!");
pu.display();
}
}//GEN-LAST:event_saveGraphMenuItemActionPerformed
/**
* Sets the jTable with data from the model
* @throws Exception
*/
public void setTable() throws Exception
{
dateTextField.setText(tabMod.getDate());
notesTextArea.setText(tabMod.getNotes());
for (int i = 0; i < tabMod.getMyData().length; i++)
{
if (tabMod.getMyData()[i][1] != null)
jTable2.setValueAt(tabMod.getMyData()[i][1], i, 1);
}
}
/**
* Launches the Application
* @param args the command line arguments
*/
public static void main(String[] args) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
/*if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}*/
UIManager.setLookAndFeel("com.jtattoo.plaf.texture.TextureLookAndFeel");
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(BloodGlucoseGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(BloodGlucoseGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(BloodGlucoseGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(BloodGlucoseGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new BloodGlucoseGUI().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton analyzeBtn;
private javax.swing.JTextField dateTextField;
private javax.swing.JButton graphBtn;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JList jList1;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTable jTable2;
private javax.swing.JMenuItem newMenuItem;
private javax.swing.JTextArea notesTextArea;
private javax.swing.JMenuItem openMenuItem;
private javax.swing.JMenuItem saveDataMenuItem;
private javax.swing.JMenuItem saveGraphMenuItem;
// End of variables declaration//GEN-END:variables
}
| [
"joeflinn412@gmail.com"
] | joeflinn412@gmail.com |
9c9dcebe6d0e5973f9fab2d436047200966ec16f | 6f163cb4414ea64ab67beb682cd12137251f7567 | /src/java/galgeleg/highscoreServlet.java | cd3970494ce702eefbc9dd2caeae80adb8561e4e | [] | no_license | AsgerStage/GalgelegWeb | 7e9aa5c43e96daf168ea2a181290ff5ddb988290 | 34291b710667bad8fc832fd4fe2e82ace5f33a15 | refs/heads/master | 2021-01-17T22:01:56.696816 | 2017-05-08T10:39:37 | 2017-05-08T10:39:37 | 84,185,226 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,444 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package galgeleg;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.ConnectException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Scanner;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.URL;
import java.net.MalformedURLException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Martin
*/
@WebServlet(name = "highscoreServlet", urlPatterns = {"/highscoreServlet"})
public class highscoreServlet extends HttpServlet {
public static GalgelegI g;
String name;
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
// /* TODO output your page here. You may use following sample code. */
URL url = new URL("http://ubuntu4.javabog.dk:3043/galgelegtjeneste?wsdl");
QName qname = new QName("http://galgeleg/", "GalgelegImplService");
QName qnameport = new QName("http://galgeleg/", "GalgelegImplPort");
Service service = Service.create(url, qname);
g = service.getPort(qnameport,GalgelegI.class);
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\">");
out.println("<title>Galgeleg</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Don Frankos Mobs Galgeleg</h1>");
out.println("<p2>Highscores</p2><br>");
ArrayList<scoreDTO> list = g.getScores();
out.println("<div align=\"center\">");
out.println(" <table border=\"0\" cellpadding=\"10\">");
out.println(" <tr>");
out.println(" <th>Spiller</th>");
out.println(" <th>score</th>");
out.println(" </tr>");
out.println(" <tr>");
for (int i = 0; i < list.size(); i++) {
out.println("<tr>");
out.println("<td>" + list.get(i).getUserID() + "</td>");
out.println("<td>" + list.get(i).getScore() + "</td>");
out.println("</tr>");
}
out.println("</table>");
out.println("</div><br>");
//out.println("<sql:setDataSource" +
//" var=\"myDS\""+
//" driver=\"com.mysql.jdbc.Driver\""+
//" url=\"jdbc:mysql://localhost:3306/galgescores\""+
//" user=\"root\" password=\"\""+
//" />");
//
//out.println("<sql:query var=\"listScores\" dataSource=\"${myDS}\">"+
//"SELECT * FROM galgescores.highscores;"+
//"</sql:query>");
//
//out.println("<div align=\"center\">");
//out.println(" <table border=\"1\" cellpadding=\"5\">");
//out.println(" <tr>");
//out.println(" <th>studentID</th>");
//out.println(" <th>score</th>");
//out.println(" </tr>");
//out.println(" <c:forEach var=\"student\" items=\"${listScores.rows}\">");
//out.println(" <tr>");
//out.println(" <td><c:out value=\"${student.studentID}\" /></td>");
//out.println(" <td><c:out value=\"${student.score}\" /></td>");
//out.println(" </tr>");
//out.println(" </c:forEach>");
//out.println(" </table>");
//out.println(" </div><br>");
out.println("<form method=\"POST\" action=\"multiplayerServlet\">");
out.println("<input type=\"text\" name=\"name\" value="+name+" readonly hidden/>");
out.println("<input type=\"text\" name=\"leaveLobby\" value=\"dontLeaveLobby\" readonly hidden/>");
out.println("<input type=\"submit\" name=\"singleMultiTilbage\" value=\"Gå tilbage\"></form><br>");
out.println("</body>");
out.println("</html>");
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
// PrintWriter out = response.getWriter();
// out.println("<html>");
// out.println("<head><title>Syvtabellen - fra en servlet</title></head>");
// out.println("<body>");
//
// out.println("<label for=\"tal1\"> Første tal </label>");
// out.println("<input type=\"text\" name=\"tal1\">");
//
// out.println("<label for=\"tal2\"> Andet tal </label>");
// out.println("<input type=\"text\" name=\"tal2\">");
// out.println("<input type=\"submit\" value=\"Regn det ud!\">");
// for (int i = 1; i <= 10; i++) {
// out.println("Syv gange " + i + " er: " + 7 * i + ".<br>");
// }
//out.println("</body>");
//out.println("</html>");
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
name = request.getParameter("name");
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"magnus_enevoldsen@live.dk"
] | magnus_enevoldsen@live.dk |
f314811de205676532ef099001c9cb710845016f | bcad85aa30ea1247463435435fedfa8667830769 | /src/main/java/com/fidelit/implementation/CameraServiceImpl.java | 020f79a3d4296b599a0866cba9a49b430eeae491 | [] | no_license | GaneshVarahade/UniverSchoolAdminPanel | 91f6c917e9e8192992f41e30f1ba995d455600f7 | 60997bb7f7f69b69e8d752a5a6c2c2d71645df19 | refs/heads/master | 2016-08-12T22:37:26.264762 | 2016-03-21T13:11:37 | 2016-03-21T13:11:37 | 51,512,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,714 | java | package com.fidelit.implementation;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.fidelit.model.Camera;
import com.fidelit.model.Device;
import com.fidelit.service.CameraService;
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
@Service("cameraService")
public class CameraServiceImpl implements CameraService{
@Autowired
SessionFactory sessionFactory;
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public void addOrUpdateCamera(Camera camera) {
Session session = sessionFactory.getCurrentSession();
session.saveOrUpdate(camera);
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public List<Camera> getAllCameraByUsername(String userName) {
Session session = sessionFactory.getCurrentSession();
String hql = "from Camera where accountID = :accountID";
Query query = session.createQuery(hql);
query.setString("accountID", userName);
List<Camera> cameraList = query.list();
return cameraList;
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public Camera getCameraByCameraId(Integer cameraID) {
Session session = sessionFactory.getCurrentSession();
String hql = "from Camera where cameraID = :cameraID";
Query query = session.createQuery(hql);
query.setInteger("cameraID", cameraID);
Camera camera = (Camera) query.uniqueResult();
return camera;
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
@Override
public List<Camera> getCameraListByUsername(String username) {
Session session = sessionFactory.getCurrentSession();
String hql = "from Camera where accountID = :accountID and isCameraUsed = :isCameraUsed";
Query query = session.createQuery(hql);
query.setString("accountID", username);
query.setBoolean("isCameraUsed", false);
List<Camera> cameraList = query.list();
return cameraList;
}
@Override
public void deleteCameraByCameraIdAndAccountId(String cameraId,
String userName) {
try{
Session session = sessionFactory.openSession();
String sql = "delete from Camera where cameraID='"+cameraId+"' and accountID = '"+userName+"' ";
SQLQuery query = session.createSQLQuery(sql);
query.executeUpdate();
session.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
| [
"aniket.deshmukh@fidelitservices.com"
] | aniket.deshmukh@fidelitservices.com |
51b02c8d8fe459069c40b6be4334daea32dc5da5 | d96bef4c2cadc6caab4aeedcca3e083468f39c5c | /jayanagadurgabhavani/src/AbstractParent.java | c454b3a0db8c2eaa108d6bc474a44214ac6db57c | [] | no_license | TechieFrogs-Achievers/JavaBasics | a06d46a9b912c587982a52975d61c84722b5b1b1 | 9a5c5653610449dc7265406fb4343079089328e9 | refs/heads/main | 2023-03-20T20:42:30.820354 | 2021-03-12T06:17:19 | 2021-03-12T06:17:19 | 313,300,339 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 563 | java | abstract class Parent
{
abstract void message();//methode
}
class Parent1 extends Parent//class extend
{
void message()//methode
{
System.out.println("this is the first subclass");
}
}
class Parent2 extends Parent//class extend
{
void message()//methode
{
System.out.println("this is the second subclass");
}
}
public class AbstractParent
{
public static void main(String[] args)
{
Parent p=new Parent1();
p.message();
Parent pa=new Parent2();
pa.message();
}
}
| [
"jayachinna94@email.com"
] | jayachinna94@email.com |
63d6c13d19f4738d8a3ef59a233d8248016c8e09 | 618972091e2df064ea5d219dba530f73e861f6da | /forge-game/src/main/java/forge/game/event/GameEventPlayerLivesChanged.java | e08073b14ceeb01348e2c13d8e1040f552d13832 | [] | no_license | An-T-Le/forge | 1d6cbd42e256e7ef261602c242e08d1fac3eee3f | 85c3fab82fe35c4bba7347dcb6adc69dbd3fd5ff | refs/heads/master | 2021-01-20T05:19:34.666161 | 2014-06-08T18:53:02 | 2014-06-08T18:53:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 735 | java | package forge.game.event;
import forge.game.player.Player;
import forge.util.Lang;
public class GameEventPlayerLivesChanged extends GameEvent {
public final Player player;
public final int oldLives;
public final int newLives;
public GameEventPlayerLivesChanged(Player who, int oldValue, int newValue) {
player = who;
oldLives = oldValue;
newLives = newValue;
}
@Override
public <T> T visit(IGameEventVisitor<T> visitor) {
return visitor.visit(this);
}
@Override
public String toString() {
return String.format("%s lives changed: %d -> %d", Lang.getPossesive(player.getName()), oldLives, newLives);
}
}
| [
"Max mtg@269b9781-a132-4a9b-9d4e-f004f1b56b58"
] | Max mtg@269b9781-a132-4a9b-9d4e-f004f1b56b58 |
6f3b54c7c76eaf30947690e7c3b62f2f0ba3a724 | 1399eddb6df343cc3edb1713a7b77c447263d54c | /src/IncorrectRowSizeException.java | 6b70e0b9516293eee1fe82b9254df5379bbc415a | [] | no_license | samuraiseoul/gameoflife | cae514bde00760e8ce1112a04b942dbdf2d213cd | 19d51950fdb3f87dd32856bd79ef6cd02a1b4fda | refs/heads/master | 2021-01-01T05:07:59.823921 | 2018-02-15T18:28:20 | 2018-02-15T18:28:20 | 59,383,401 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 63 | java |
public class IncorrectRowSizeException extends Exception {
}
| [
"scottlavigne28@gmail.com"
] | scottlavigne28@gmail.com |
ca66247d4e3ab4b02f4cfc721b1557dee43fc5da | 73b2779688a532594cc45f96bc0135d41cfb03d9 | /src/util/CurrencyConverter.java | 9fa4570e9aafac3a890eaadf9c817cdf659a9baa | [] | no_license | davidtveira/curso-programacao | d2e4b76ed4121c425ac151c4cd6030116ca76b0f | c059358b5eaa47b3b533543f575f1cdfb3a5c0a4 | refs/heads/master | 2020-09-21T19:09:57.135134 | 2019-11-29T17:14:05 | 2019-11-29T17:14:05 | 224,894,374 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | package util;
public class CurrencyConverter {
public static final double IOF = 0.06;
public static double amountToBePaid(double price, double boughtDollars) {
return ((price*IOF)+price)*boughtDollars;
}
}
| [
"davidamstaveira@gmail.com"
] | davidamstaveira@gmail.com |
613b82ae91c4982d75c93d1dd1e099896ab2e4e5 | 21b15b7db171189ed847a235c6ace4f8b3ffd1cb | /src/main/java/com/atlp/rsgl/service/login/LoginServiceImpl.java | 81e2e47dc605b5c9b53ebb52d50cddc6b3b8217c | [] | no_license | aitlamp/rsgl | bb87d401410db77bb1c893f844228cd5f21be607 | ae6c37387f9fd206c28e68931d23050fd3ee3cae | refs/heads/master | 2020-03-28T15:10:42.311584 | 2018-10-07T10:32:46 | 2018-10-07T10:32:46 | 148,563,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,873 | java | package com.atlp.rsgl.service.login;
import com.alibaba.fastjson.JSON;
import com.atlp.rsgl.common.prop.CustomProps;
import com.atlp.rsgl.common.utils.HttpClientUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
/**
* 登录 Service
*
* @author ctc
* @date 2018年8月14日 23:11:18
*/
@Service
@Transactional
public class LoginServiceImpl implements ILoginService {
private static Logger log = LoggerFactory.getLogger(LoginServiceImpl.class);
@Autowired
CustomProps customProps;
//登录方法
public Map<String, Object> doLogin(String userName, String userPwd, String clientIp) {
// 设置header
Map<String, String> headers = new HashMap<>();
headers.put("Content-Type", "application/json; charset=UTF-8");
// 组织参数
Map<String, Object> pmap = new HashMap<>();
pmap.put("ip", clientIp);
pmap.put("hhid", "");
pmap.put("method", "userLogin");
pmap.put("appCode", customProps.getAppCode());
pmap.put("userName", userName);
pmap.put("userPwd", userPwd);
// 发送请求
Map<String, Object> responseMap = HttpClientUtil.postJson(customProps.getTysqPath(), pmap, headers);
log.debug("调用统一授权接口登录方法返回值:" + responseMap);
// 处理参数
int statusCode = (Integer) responseMap.get("statusCode");
if (statusCode == 200) {
String responseContent = responseMap.get("responseContent").toString();
// 将返回值转为Map对象
return JSON.parseObject(responseContent);
}
return null;
}
}
| [
"441799574@qq.com"
] | 441799574@qq.com |
c74eca6f72fc9263844d60ddae5a630ed3fd8021 | 56794c086c6269d9356cf8f5e4f5b7c46990ac89 | /src/ares/application/player/boundaries/viewers/PlayerViewer.java | 029828e68c4824c278714d3567d1ea820f76e27b | [] | no_license | magomar/ares | d44afa97e789ec6516b6d1f6c59aee3051335ba0 | c9cb0856d225b4d9aa74564cc691d17da3e66daa | refs/heads/master | 2023-03-15T09:57:14.628299 | 2013-09-09T10:32:51 | 2013-09-09T10:32:51 | 117,743,598 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | package ares.application.player.boundaries.viewers;
import ares.application.shared.boundaries.viewers.*;
import ares.application.shared.gui.views.View;
import javax.swing.*;
/**
* @author Mario Gomez <margomez at dsic.upv.es>
*/
public interface PlayerViewer extends View<JFrame> {
// Perspectives
static final String MAIN_MENU_PERSPECTIVE = "Main";
static final String PLAYER_PERSPECTIVE = "Player";
/**
* Switches to one among several available perspectives Each perspective is a different combination of visible and
* invisible views
*/
void switchPerspective(String perspective);
BoardViewer getBoardView();
InfoViewer getInfoView();
ToolBarViewer getToolBarView();
MenuBarViewer getMenuView();
MessagesViewer getMessagesView();
OOBViewer getOobView();
BoardViewer getMiniMapView();
PanelMenuViewer getMainMenuView();
}
| [
"magomar@gmail.com"
] | magomar@gmail.com |
23bd6879f28bc5697d0b647630867f4cf4c7cc0e | 1ebe19cc6ff0de9f46f64e747eaa4d7539c4c485 | /src/main/java/com/capv/um/model/ScheduleChat.java | 49af831eed9b2e3a924a543cac7b363dbd5cc80a | [] | no_license | diwakarreddy845/um | 95466c27ac8952003e685a21ba34998fc22b18ae | ea28e8f86be9ae584b5f560d4a89d32fc407e035 | refs/heads/master | 2020-09-23T06:56:48.207275 | 2019-12-02T17:42:41 | 2019-12-02T17:42:41 | 225,432,819 | 0 | 0 | null | 2019-12-02T17:43:48 | 2019-12-02T17:36:06 | Java | UTF-8 | Java | false | false | 2,585 | java | package com.capv.um.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@Entity
@Table(name = "schedule_chat")
@JsonIgnoreProperties(ignoreUnknown = true)
public class ScheduleChat {
@Id
@GeneratedValue
@Column(name = "id")
private Long id;
@Column(name = "room_name")
private String roomName;
@Column(name = "room_no")
private String roomNumber;
@Column(name = "user_name")
private String userName;
@Column(name = "client_Id")
private String clientId;
@Column(name = "created_date", updatable = false)
private Date createdDate;
@Column(name = "schedule_start_date")
private Date scheduleStartDate;
@Column(name = "schedule_end_date")
private Date scheduleEndDate;
@Column(name = "status")
private int status;
@Column(name = "recurrence")
private boolean recurrence;
@Column(name = "chat_message")
private String chatMesage;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getRoomName() {
return roomName;
}
public void setRoomName(String roomName) {
this.roomName = roomName;
}
public String getRoomNumber() {
return roomNumber;
}
public void setRoomNumber(String roomNumber) {
this.roomNumber = roomNumber;
}
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getChatMesage() {
return chatMesage;
}
public void setChatMesage(String chatMesage) {
this.chatMesage = chatMesage;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Date getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public Date getScheduleStartDate() {
return scheduleStartDate;
}
public void setScheduleStartDate(Date scheduleStartDate) {
this.scheduleStartDate = scheduleStartDate;
}
public Date getScheduleEndDate() {
return scheduleEndDate;
}
public void setScheduleEndDate(Date scheduleEndDate) {
this.scheduleEndDate = scheduleEndDate;
}
public boolean isRecurrence() {
return recurrence;
}
public void setRecurrence(boolean recurrence) {
this.recurrence = recurrence;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}
| [
"diwakar.gudisi@CaprusIT.local"
] | diwakar.gudisi@CaprusIT.local |
c754ccbf1a921f49af3020c89fae36d333f8ccef | 6f6583231358d9294963ca0e5d9cf82822f1ed20 | /common/src/main/java/com/yanxin/common/home/HomeRouterPath.java | e50bb9e6c697f79b03993e341e105c1afb09a7bd | [] | no_license | willpyshan13/CarStore | 298c6ff6ebb681883798e31991957a6707eae1fb | e42301c14e0ad1421322c63e79aa09391c13113b | refs/heads/main | 2023-06-14T06:17:26.534855 | 2021-07-14T05:51:47 | 2021-07-14T05:51:47 | 385,820,045 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package com.yanxin.common.home;
/**
* @author zhouz
* @date 2021/1/6
*/
public interface HomeRouterPath {
/**
* 首页
*/
String CAR_ROUTER_HOME = "/home/home";
/**
* 地区选择
*/
String CAR_ROUTER_AREA = "/home/area";
/**
* webView
*/
String CAR_ROUTER_WEB_VIEW = "/home/webView";
}
| [
"545512533@qq.com"
] | 545512533@qq.com |
921e0971561b2dc0eb22da34ee95557b038e5170 | e8a9e83a9114c4285920e7003cc748ca1fe91284 | /src/com/twpathashala/game/UserInputParse.java | 9ee4397980a5f4867567354943662328484424ba | [] | no_license | abilaashsai/Minesweeper-TDD | 2af7763fe630e892cca212aa1351758e8a7166a1 | 9bd429c3e9581cf65d3a9edf811651b380060ef5 | refs/heads/master | 2021-06-10T03:51:23.210581 | 2017-01-01T15:14:55 | 2017-01-01T15:14:55 | 61,047,689 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | package com.twpathashala.game;
//Understands the input
class UserInputParse {
private final Reveal REVEAL;
private int row;
private int column;
UserInputParse(Reveal REVEAL) {
this.REVEAL = REVEAL;
}
Boolean categorization(String input) throws GameEnd {
if (input == null || input.length() != 6) {
throw new GameEnd("Enter Valid Input");
}
char[] letters = input.toCharArray();
row = Integer.parseInt(String.valueOf(letters[2]));
column = Integer.parseInt(String.valueOf(letters[4]));
if (letters[0] == 'o' || letters[0] == 'O') {
return REVEAL.open(row, column);
}
if (letters[0] == 'f' || letters[0] == 'F') {
return REVEAL.flag(row, column);
}
throw new GameEnd("Input not Accepted, Game Over");
}
}
| [
"abilashr@INabilashr.local"
] | abilashr@INabilashr.local |
d4979b765ec2ac190433bca95114b00c25b8dbdf | f44f88fbb3badb84c311b56fbb9c03ae2593c12d | /hellohibernate3/src/test/java/by/pvt/pojo/ProjectTest.java | 1966379045375df74a015e36895f7998c04ea854 | [] | no_license | kdmitry123/Java_EE_course | a86dbe05032dcc35d5cb82532afb3ccbdee37159 | b5129a002ac535d33df5c3734f86f3bffc3fa3ef | refs/heads/master | 2022-12-21T23:44:40.489253 | 2020-03-06T07:00:43 | 2020-03-06T07:00:43 | 245,351,054 | 0 | 0 | null | 2022-12-16T10:02:33 | 2020-03-06T06:58:40 | Java | UTF-8 | Java | false | false | 2,365 | java | package by.pvt.pojo;
import by.pvt.util.HibernateUtil;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.junit.Test;
import java.util.Calendar;
import java.util.Date;
import static by.pvt.helper.ProjectHelper.addEmployee;
import static by.pvt.helper.ProjectHelper.removeEmployee;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class ProjectTest {
static Project createTestData(int index) {
Project project = new Project();
project.setProjectName("Project" + index);
project.setStartDate(new Date());
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, 12);
project.setEndDate(calendar.getTime());
return project;
}
@Test
public void testSave() {
Session session = HibernateUtil.getInstance().getSession();
Transaction tx = session.beginTransaction();
Project project1 = createTestData(1);
Project project2 = createTestData(2);
Employee employee5 = EmployeeTest.createTestData(5);
Employee employee6 = EmployeeTest.createTestData(6);
Employee employee7 = EmployeeTest.createTestData(7);
addEmployee(project1, employee5);
addEmployee(project1, employee6);
addEmployee(project1, employee7);
addEmployee(project2, employee6);
addEmployee(project2, employee7);
session.save(project1);
session.save(project2);
session.save(employee5);
session.save(employee6);
session.save(employee7);
tx.commit();
session.close();
session = HibernateUtil.getInstance().getSession();
Project savedProject1 = session.load(Project.class, 1L);
assertEquals(3, savedProject1.getEmployees().size());
session.close();
session = HibernateUtil.getInstance().getSession();
tx = session.beginTransaction();
Project savedProject2 = session.get(Project.class, 2L);
assertNotNull(savedProject2);
Employee savedEmployee7 = session.get(Employee.class, 7L);
// assertNotNull(savedEmployee7);
removeEmployee(savedProject2, savedEmployee7);
session.update(savedEmployee7);
session.update(savedProject2);
tx.commit();
session.close();
}
} | [
"dzmitry.karachun@mail.ru"
] | dzmitry.karachun@mail.ru |
847e9695c9e8b7229549c06cd95e580331368ffb | 3a0a5feebe65e5d363a517b9b1d31d34a59db3a4 | /src/Runner.java | f77080651af1aafadca15f23b33bc6f06fa1e546 | [] | no_license | ellaashley/Basics | 146df32f9d52b9196bf8dc68deeaf19a3e8e256b | 1e605c3885a0e103277582f99c0dc9865d263caf | refs/heads/master | 2020-12-30T00:10:50.220801 | 2020-02-06T21:40:22 | 2020-02-06T21:40:22 | 238,790,254 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 446 | java | public class Runner {
public static void main(String[] args){
Car myCar = new Car(2020, "Land Rover", "Range Rover Sport");
System.out.println(myCar.toString());
myCar.drive(2000);
System.out.println(myCar.toString());
Rectangle rect = new Rectangle(5,5);
System.out.println(rect.getArea());
System.out.println(rect.getDiagonal());
System.out.println(rect.isSquare());
}
}
| [
"ellaashley@students.bestudents.berkeley.net"
] | ellaashley@students.bestudents.berkeley.net |
ceea315e4968ea2b0e6cc6cd1caba28b222d5371 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/grade/1c2bb3a40a82cba97b2937bc6825903a28ecfe91f993fc177a0f2ae003bcc7b1073eb49e35d3f0f69d6b612e8347e9c1b93306bf25a7e5390098c1a06845baac/003/mutations/20/grade_1c2bb3a4_003.java | 136ad28ed17fa507a18125a34dd09b5d15bd5571 | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,381 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class grade_1c2bb3a4_003 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
grade_1c2bb3a4_003 mainClass = new grade_1c2bb3a4_003 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
DoubleObj a = new DoubleObj (), b = new DoubleObj (), c =
new DoubleObj (), d = new DoubleObj (), e = new DoubleObj ();
output +=
(String.format
("Enter thresholds for A, B, C, D\nin that order, decreasing percentages > Thank you. "));
a.value = scanner.nextDouble ();
b.value = scanner.nextDouble ();
c.value = scanner.nextDouble ();
d.value = scanner.nextDouble ();
output += (String.format ("Now enter student score (percent) >"));
e.value = scanner.nextDouble ();
if (e.value >= a.value) {
output += (String.format ("Student has an A grade\n"));
} else if (e.value >= b.value) {
output += (String.format ("Student has an B grade\n"));
} else if (e.value >= c.value) {
output += (String.format ("Student has an C grade\n"));
} else if (true) return ;
if (e.value >= d.value) {
output += (String.format ("Student has an D grade\n"));
} else {
output += (String.format ("Student has an F grade\n"));
}
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
413e5ca6215a92594140731bc6a435c0214ce4a8 | 2e88428a66fc3fd1cb2613e4f3eb6ca909245856 | /project year 4/work/projectcode1/NjoroApp/app/src/main/java/com/example/njoroapp/Courses/CompnetworksActivity.java | f871f8909ad8de9be9f72fce7b3c33ec5cabda99 | [] | no_license | njoroge/NjoroApp | 0f9dc6694363b1e5673d708bc03d69aa48963761 | 5ff2e3dbee246aa3a3ad45b93ab1223b396727bb | refs/heads/master | 2021-03-07T15:03:56.599767 | 2020-03-10T10:45:01 | 2020-03-10T10:45:01 | 246,267,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.example.njoroapp.Courses;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import com.example.njoroapp.R;
public class CompnetworksActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_network);
}
}
| [
"jsnjoroge34@gmail.com"
] | jsnjoroge34@gmail.com |
efad9f9611a4480cd2fb6568cf49e434cbc9c0b4 | 45e8129980cadca29b693e867de67836b12037d5 | /battercake-practice/battercake-netty-consumer/src/main/java/com/yicj/study/util/IdUtil.java | 5c8cb4f8fd786c512948ce800cc5738cd9d8538e | [] | no_license | yichengjie/rpc-study | b5d6b5f694060d54796a04e9a8f6f6c1b9133a3c | a073d1685842ca5a33a6fee84573c7d218d03880 | refs/heads/master | 2022-06-21T19:17:16.759057 | 2019-10-07T09:50:08 | 2019-10-07T09:50:08 | 206,066,361 | 1 | 0 | null | 2022-06-17T02:32:24 | 2019-09-03T11:58:15 | Java | UTF-8 | Java | false | false | 284 | java | package com.yicj.study.util;
public class IdUtil {
private final static SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0);
/**
* 消息ID
* @return
*/
public static String getId(){
return String.valueOf(idWorker.nextId());
}
} | [
"626659321@qq.com"
] | 626659321@qq.com |
3053a347095f4bd46b65e008d5c15397a9dc98af | 8da50115d0ca3b447aa8fb0150ed5616fc716b98 | /src/crearPartido.java | 8aaebbcf82fe53e6f18125a17e9382b9ab7d035b | [] | no_license | AlumAlbertoPiedra/AlbertoPiedra_Ex_UD4 | 8c3e1b3a32312df49789687852537bb9bc0a1098 | fc68a88fdfa163aac10ba5d043c40bdb76099310 | refs/heads/master | 2023-03-10T20:58:08.378016 | 2021-02-25T13:53:09 | 2021-02-25T13:53:09 | 342,247,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,780 | java |
import java.awt.event.KeyEvent;
/**
* Crea un nuevo partido que añade en la ventana izquierda
* @author 1DAW04
*/
public class crearPartido extends javax.swing.JFrame
{
/**
* Clase principal a la que pertenece
*/
private Apuesta v;
/**
* Metodo constructor que incia los componentes
*/
public crearPartido()
{
initComponents();
}
/**
* Crea el partido que iniciar los componentes
* @param ventana
*/
public crearPartido(Apuesta ventana)
{
initComponents();
v = ventana;
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
pFuncionalidad = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
tPartido = new javax.swing.JTextField();
bAgregarPartido = new javax.swing.JButton();
pInformacion = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
pFuncionalidad.setBackground(java.awt.Color.white);
pFuncionalidad.setLayout(new java.awt.BorderLayout());
jLabel1.setText("Partido:");
pFuncionalidad.add(jLabel1, java.awt.BorderLayout.WEST);
tPartido.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
tPartidoKeyPressed(evt);
}
});
pFuncionalidad.add(tPartido, java.awt.BorderLayout.CENTER);
bAgregarPartido.setText("Aceptar");
bAgregarPartido.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bAgregarPartidoActionPerformed(evt);
}
});
pFuncionalidad.add(bAgregarPartido, java.awt.BorderLayout.LINE_END);
getContentPane().add(pFuncionalidad, java.awt.BorderLayout.NORTH);
pInformacion.setBorder(javax.swing.BorderFactory.createEtchedBorder());
pInformacion.setLayout(new java.awt.BorderLayout());
jLabel2.setText("Advertencia: ventana de subprograma");
pInformacion.add(jLabel2, java.awt.BorderLayout.PAGE_START);
getContentPane().add(pInformacion, java.awt.BorderLayout.CENTER);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* Añade el partido creado a la venana a la izquierda de la aplciación
* @param p partido que es añadido a la ventana
*/
public void añadePartido(String p)
{
v.partidoNuevo(p);
tPartido.setText("");
tPartido.requestFocus();
}
/**
* Agrega el partido que se a creado anteriormente
* @param evt el evento que se realiza
*/
private void bAgregarPartidoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bAgregarPartidoActionPerformed
añadePartido(tPartido.getText());
}//GEN-LAST:event_bAgregarPartidoActionPerformed
/**
* Al pulsar la tecla enter se añade automaticamente el partido que se ha escrito anteriormente
* @param evt el evento que se realiza
*/
private void tPartidoKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tPartidoKeyPressed
if( evt.getKeyCode() == KeyEvent.VK_ENTER )
{
añadePartido(tPartido.getText());
}
}//GEN-LAST:event_tPartidoKeyPressed
/**
* Se añaden los argumentos necesarios para poder ejcutar la aplicación
* @param args los argumentos necesarios para el codigo
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(crearPartido.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(crearPartido.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(crearPartido.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(crearPartido.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new crearPartido().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton bAgregarPartido;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel pFuncionalidad;
private javax.swing.JPanel pInformacion;
private javax.swing.JTextField tPartido;
// End of variables declaration//GEN-END:variables
}
| [
"alum.alberto.piedra.venegas@ieslosremedios.org"
] | alum.alberto.piedra.venegas@ieslosremedios.org |
980d1600bffb59715d1874573065b247e86a88f6 | 5eb08b8df09dc3d0540776976ac764e10ccf9790 | /src/main/java/com/leszko/calculator/CalculatorController.java | 2ef2891be6bcea433cdd471949003af62d094619 | [] | no_license | kobisony1/calculator | 5e4a6e60e42fb8219a99835e9c7dc9e72cf8a711 | 0411fe449a6c8828b3f50fce2a85f0814e82820c | refs/heads/master | 2021-09-03T17:50:40.938658 | 2018-01-10T21:33:50 | 2018-01-10T21:33:50 | 112,611,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 568 | java | package com.leszko.calculator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
class CalculatorController {
@Autowired
private Calculator calculator;
@RequestMapping("/sum")
String sum(@RequestParam("a") Integer a,
@RequestParam("b") Integer b) {
return String.valueOf(calculator.sum(a, b));
}
}
| [
"amsalem@hpe.com"
] | amsalem@hpe.com |
9f028402e87358fc6bf03171d416ff5e3a35051b | 40751ac2939f43bfce82e4436985562c57bf460d | /src/main/java/com/backend/tienda/repository/ClientesRepository.java | 52772f5d4976d778c3ee4bd97fb088bd8846a2a8 | [] | no_license | tacoradam/backendtienda | 651e8bd60283b1b4d849486b8c9086bf58f908a4 | 175cdfeebed8f4603ee727bf4495884f9e22bdf6 | refs/heads/master | 2023-08-22T04:01:43.327144 | 2021-10-13T05:42:07 | 2021-10-13T05:42:07 | 409,005,304 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 227 | java | package com.backend.tienda.repository;
import com.backend.tienda.entidades.Clientes;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ClientesRepository extends JpaRepository<Clientes, Long> {
}
| [
"rinckoar@gmail.com"
] | rinckoar@gmail.com |
e8171dae9e7aa2183bd22c38f6f5c2a547b315a0 | d6171946202fccf0bcc03092eb103ae9fd02a37a | /program/src/program/Adapters/MernisServiceAdapter.java | 34a2f378e79efc1381d5e695e7d5cfe34d801c6c | [] | no_license | aysenurgokce/CoffeeProgram | 3fb09819feecbd1117456e6119162aac6546f8ca | 1a05c996ec7883c6ced6efcebe6c37813cf19046 | refs/heads/main | 2023-04-25T22:56:06.480536 | 2021-05-14T01:48:32 | 2021-05-14T01:48:32 | 367,220,435 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package program.Adapters;
import program.Abstract.ICustomerCheckService;
import program.Entities.Customer;
import tr.gov.nvi.tckimlik.WS.KPSPublicSoapProxy;
public class MernisServiceAdapter implements ICustomerCheckService{
@Override
public boolean CheckIfRealPerson(Customer customer) {
KPSPublicSoapProxy client = new KPSPublicSoapProxy();
try {
return client.TCKimlikNoDogrula(customer.NationalityId,customer.firstName,customer.lastName,customer.dateOfBirt);
}catch (Exception e) {
System.out.println("Not a valid natioanlity id.");
}
return false;
}
}
| [
"noreply@github.com"
] | aysenurgokce.noreply@github.com |
2633bae3b7369f62404c7196542c27b23d0fa617 | 7d7ac50d1aecda62ac8fad07a40522944df285af | /app/src/main/java/com/example/asdzx/weatherand2/weather.java | 194380b3728f49b55dec7ab6987400209cbaa406 | [] | no_license | saypresident/weatherand2 | 3c50fd80a4fefd85a9221076f17c93404b676e9f | 9d3b740c6ee6dd1ba39aa882b6207bb5c53a28c7 | refs/heads/master | 2020-05-27T20:49:00.011395 | 2019-04-18T00:40:17 | 2019-04-18T00:40:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,748 | java | package com.example.asdzx.weatherand2;
public class weather {
//미세먼지
String pm10 = null;
String pm25 = null;
//초단기 실황 (지금 현재 날씨)
String T1H = null; //현재 기온
String REH = null; //현재 습도
String PTY = null; //현재 강수형태
String WDF = null; //현재 풍속
String VEC = null; //현재 풍향
//일주일 날씨 (해,구름 등) - 중기예보, 동네예보- 1200
String SKY3 = null;
String SKY4 = null;
String SKY5 = null;
String SKY6 = null;
String SKY7 = null;
String SKY8 = null;
String SKY9 = null;
String SKY10 = null;
//일주일 최고온도 (중기예보, 동네예보- 0500)
String TMX1 = null;
String TMX2 = null;
String TMX3 = null;
String TMX4 = null;
String TMX5 = null;
String TMX6 = null;
String TMX7 = null;
String TMX8 = null;
String TMX9 = null;
String TMX10 = null;
//일주일 최저온도 (중기예보, 동네예보-0200은 오늘내일 최저 0500은 모레최저)
String TMN1 = null;
String TMN2 = null;
String TMN3 = null;
String TMN4 = null;
String TMN5 = null;
String TMN6 = null;
String TMN7 = null;
String TMN8 = null;
String TMN9 = null;
String TMN10 = null;
//오늘 날씨 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String SKY0_1 = null;
String SKY0_2 = null;
String SKY0_3 = null;
String SKY0_4 = null;
String SKY0_5 = null;
//오늘 강수 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String PTY_1 = null;
String PTY_2 = null;
String PTY_3 = null;
String PTY_4 = null;
String PTY_5 = null;
//오늘 온도 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String T3H_1 = null;
String T3H_2 = null;
String T3H_3 = null;
String T3H_4 = null;
String T3H_5 = null;
//오늘 습도 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String REH_1 = null;
String REH_2 = null;
String REH_3 = null;
String REH_4 = null;
String REH_5 = null;
//오늘 풍속 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String WSD_1 = null;
String WSD_2 = null;
String WSD_3 = null;
String WSD_4 = null;
String WSD_5 = null;
//내일 날씨 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String SKY1_1 = null;
String SKY1_2 = null;
String SKY1_3 = null;
String SKY1_4 = null;
String SKY1_5 = null;
//내일 강수 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String T_PTY_1 = null;
String T_PTY_2 = null;
String T_PTY_3 = null;
String T_PTY_4 = null;
String T_PTY_5 = null;
//내일 온도 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String T_T3H_1 = null;
String T_T3H_2 = null;
String T_T3H_3 = null;
String T_T3H_4 = null;
String T_T3H_5 = null;
//내일 습도 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String T_REH_1 = null;
String T_REH_2 = null;
String T_REH_3 = null;
String T_REH_4 = null;
String T_REH_5 = null;
//내일 풍속 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String T_WSD_1 = null;
String T_WSD_2 = null;
String T_WSD_3 = null;
String T_WSD_4 = null;
String T_WSD_5 = null;
//모레 날씨 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String SKY2_1 = null;
String SKY2_2 = null;
String SKY2_3 = null;
String SKY2_4 = null;
String SKY2_5 = null;
//모레 강수 (새벽, 아침, 점심, 저녁, 밤) - 동네예보
String F_PTY_1 = null;
String F_PTY_2 = null;
String F_PTY_3 = null;
String F_PTY_4 = null;
String F_PTY_5 = null;
//일출 일중 일몰 월출 월중 월몰
String sunrise = null;
String suntransit = null;
String sunset = null;
String moonrise = null;
String moontransit = null;
String moonset = null;
String civilm = null; // 시민박명(아침)
String civile = null; // 시민박명(저녁)
String nautm = null; // 항해박명(아침)
String naute = null; //항해박명(저녁)
String astm = null; //천문박명(아침)
String aste = null; //천문박명(저녁)
public void setPm10(String pm10) {
this.pm10 = pm10;
}
public void setPm25(String pm25) {
this.pm25 = pm25;
}
public void setPTY(String PTY) {
this.PTY = PTY;
}
public void setREH(String REH) {
this.REH = REH;
}
public void setT1H(String t1H) {
T1H = t1H;
}
public void setVEC(String VEC) {
this.VEC = VEC;
}
public void setWDF(String WDF) {
this.WDF = WDF;
}
} | [
"asdzxcqwe01@naver.com"
] | asdzxcqwe01@naver.com |
8d1148cab862d198051c6a85df5d5a6db59d7eb5 | d742a049fb38f98d03a1b36f0965f4f39316f686 | /javademo/src/main/java/javademo/HelloWorld.java | f66053bd24419c8a530f795e9070ebc68606899b | [] | no_license | Bianshilong/Maven | f2c0a7cf90a25724818f98986b689c536882d46e | 67b975e8570dec0b33e57cd8f237d14248b5f5f2 | refs/heads/master | 2021-08-08T02:39:58.262633 | 2017-11-09T11:23:24 | 2017-11-09T11:23:24 | 110,105,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,796 | java | package javademo;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import lombok.Getter;
import lombok.Setter;
@Getter@Setter
public class HelloWorld {
private String name;
private int age;
public static final String DBDRIVER = "com.mysql.jdbc.Driver";
public static final String DBURL = "jdbc:mysql://localhost:3306/bsl_demo?useSSL=false";
public static final String DBUSER = "root";
public static final String DBPWD = "root";
public HelloWorld(String name, int age) {
this.name = name;
this.age = age;
}
public static void main(String[] args) throws Exception {
System.out.println("Hello World!");
HelloWorld helloWorld = new HelloWorld("zhangsan", 25);
System.out.println(helloWorld);
Class.forName(DBDRIVER); //方式二
//建立连接,导入java.sql.Connection包
Connection conn = null;
conn = DriverManager.getConnection(DBURL, DBUSER, DBPWD);
//创建statement
Statement st = conn.createStatement();
String sql = "select * from stu where age>25 and id > 10";
//执行SQL语句
ResultSet rs= st.executeQuery(sql);
//循环处理得到的结果集
System.out.println("id \t\t age \t\t name \t\t tel\t\t");
while (rs.next()) {
//取得每一条记录中的数据
int id=rs.getInt("id");
int age = rs.getInt("age");
String name = rs.getString("name");
String tel = rs.getString("tel");
//输出我们的每一条记录
System.out.println(id+" \t\t"+age+" \t\t"+name+" \t\t"+tel+" \t\t");
}
//数据输出完毕
System.out.println("数据输出完毕");
//释放资源
rs.close();
st.close();
conn.close();
}
@Override
public String toString() {
return "HelloWorld [name=" + this.getName() + ", age=" + this.getAge() + "]";
}
}
| [
"442668830@qq.com"
] | 442668830@qq.com |
5d76c73db3d6fa09b65eb89e2d37151ac07a8d35 | fcdb36f244019a4fd332d82ae90870c90af771aa | /android/src/main/java/com/devrappers/screenlock/ScreenshotLockModule.java | ac4106d56165c48d5899dfbef5f9ad1446c73b14 | [] | no_license | DevRappers/react-native-screenshot-lock | 176d78ca2a92e566e424edc078a514ddb52382b7 | aa2887edc31b398d37d442979d9a56add3462e39 | refs/heads/master | 2021-02-11T17:49:57.445170 | 2020-10-20T08:08:01 | 2020-10-20T08:08:01 | 244,516,665 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,382 | java | package com.devrappers.screenlock;
import android.app.Activity;
import android.view.WindowManager;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
public class ScreenshotLockModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext;
public ScreenshotLockModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Override
public String getName() {
return "ScreenshotLock";
}
public void flagChange(final boolean mount){
final Activity activity = getCurrentActivity();
if(activity != null){
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if(mount){
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
else{
activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
}
});
}
}
@ReactMethod
public void screenLock() {
flagChange(true);
}
@ReactMethod
public void screenUnLock(){
flagChange(false);
}
}
| [
"devrappers@gmail.com"
] | devrappers@gmail.com |
6ebc8bbd1fc1f57d27909c0e737d07a0d2edd32d | 183d057ee3f1255551c9f2bc6080dfcc23262639 | /app/src/main/java/com/cliffex/videomaker/videoeditor/introvd/template/module/iap/p340a/C7700b.java | 87b3c24208a49e08739072dceac8d3307b8bb192 | [] | no_license | datcoind/VideoMaker-1 | 5567ff713f771b19154ba463469b97d18d0164ec | bcd6697db53b1e76ee510e6e805e46b24a4834f4 | refs/heads/master | 2023-03-19T20:33:16.016544 | 2019-09-27T13:55:07 | 2019-09-27T13:55:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,595 | java | package com.introvd.template.module.iap.p340a;
import android.annotation.SuppressLint;
import android.text.TextUtils;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.introvd.template.apicore.C3625c;
import com.introvd.template.apicore.C3626d;
import com.introvd.template.apicore.C3634k;
import com.introvd.template.apicore.C3635l;
import com.introvd.template.apicore.C3636m;
import com.introvd.template.apicore.C3646w;
import com.introvd.template.datacenter.SocialConstDef;
import com.introvd.template.module.iap.C8048e;
import com.introvd.template.module.iap.business.C7824a;
import com.introvd.template.module.iap.business.p349a.p350a.C7826a;
import com.introvd.template.module.iap.business.p349a.p351b.C7828a;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import okhttp3.C9804ad;
import okhttp3.C9943t;
import org.json.JSONException;
import org.json.JSONObject;
import p037b.p050b.C1834l;
import p037b.p050b.C1838m;
import p037b.p050b.C1839n;
import p037b.p050b.C1840o;
import p037b.p050b.C1848s;
import p037b.p050b.C1852w;
import p037b.p050b.C1853x;
import p037b.p050b.p051a.p053b.C1487a;
import p037b.p050b.p057e.C1517e;
import p037b.p050b.p057e.C1518f;
import p037b.p050b.p076j.C1820a;
import p469f.C9769n;
/* renamed from: com.introvd.template.module.iap.a.b */
public class C7700b extends C3626d {
/* renamed from: com.introvd.template.module.iap.a.b$a */
class C7710a {
public List<C7826a> dPf;
}
/* renamed from: L */
private static C1834l<C9804ad> m22605L(final Map<String, String> map) {
return aBy().aTS().mo10162e((C1518f<? super T, ? extends C1840o<? extends R>>) new C1518f<C7699a, C1840o<C9804ad>>() {
/* renamed from: a */
public C1840o<C9804ad> apply(C7699a aVar) throws Exception {
return aVar.mo32580L(C3646w.m8942o(map));
}
});
}
private static C1848s<C7699a> aBy() {
String GL = C3625c.m8880GI().mo22958GL();
return TextUtils.isEmpty(GL) ? C1848s.m5331x(new Throwable(C3636m.bhq)) : C3636m.m8914dd(GL).mo10199i(new C1518f<C9769n, C7699a>() {
/* renamed from: i */
public C7699a apply(C9769n nVar) throws Exception {
return (C7699a) nVar.mo37510S(C7699a.class);
}
});
}
private static <T> C1853x<T, T> aBz() {
return new C1853x<T, T>() {
/* renamed from: b */
public C1852w<T> mo10202b(C1848s<T> sVar) {
return sVar.mo10196g(C1820a.aVi()).mo10194f(C1487a.aUa());
}
};
}
@SuppressLint({"CheckResult"})
/* renamed from: c */
public static void m22606c(final C3635l<List<C7828a>> lVar) {
m22605L(C8048e.aBe().mo23658hc(IronSourceConstants.INTERSTITIAL_DAILY_CAPPED)).mo10157d(C1820a.aVi()).mo10162e((C1518f<? super T, ? extends C1840o<? extends R>>) new C1518f<C9804ad, C1840o<List<C7828a>>>() {
/* renamed from: e */
public C1840o<List<C7828a>> apply(final C9804ad adVar) throws Exception {
return C1834l.m5254a((C1839n<T>) new C1839n<List<C7828a>>() {
/* renamed from: a */
public void mo10177a(C1838m<List<C7828a>> mVar) throws Exception {
JsonElement parse = new JsonParser().parse(adVar.string());
if (parse instanceof JsonArray) {
JsonObject jsonObject = new JsonObject();
jsonObject.add("250", parse);
parse = jsonObject;
}
mVar.mo9791K(C7700b.m22607h(parse.getAsJsonObject()));
}
}).mo10157d(C1820a.aVi());
}
}).mo10152c(C1487a.aUa()).mo10128a((C1517e<? super T>) new C1517e<List<C7828a>>() {
/* renamed from: V */
public void accept(List<C7828a> list) throws Exception {
lVar.onSuccess(list);
}
}, (C1517e<? super Throwable>) new C1517e<Throwable>() {
/* renamed from: m */
public void accept(Throwable th) throws Exception {
th.printStackTrace();
lVar.onError(th.getMessage());
}
});
}
/* access modifiers changed from: private */
/* renamed from: h */
public static List<C7828a> m22607h(JsonObject jsonObject) {
ArrayList arrayList = new ArrayList();
JsonArray asJsonArray = jsonObject.getAsJsonArray("250");
if (asJsonArray == null) {
return new ArrayList();
}
for (int i = 0; i < asJsonArray.size(); i++) {
C7828a aVar = new C7828a();
JsonElement jsonElement = asJsonArray.get(i);
if (jsonElement != null) {
JsonObject asJsonObject = jsonElement.getAsJsonObject();
if (asJsonObject.has("desc")) {
aVar.setDescription(asJsonObject.get("desc").getAsString());
}
if (asJsonObject.has("title")) {
aVar.setTitle(asJsonObject.get("title").getAsString());
}
if (asJsonObject.has("type")) {
aVar.mo32718lo(C7824a.m22802si(asJsonObject.get("type").getAsInt()));
}
if (asJsonObject.has("orderNo")) {
aVar.setOrder(asJsonObject.get("orderNo").getAsInt());
}
if (asJsonObject.has("id")) {
aVar.mo32717ln(asJsonObject.get("id").getAsString());
}
String str = "";
if (asJsonObject.has("extend")) {
str = asJsonObject.get("extend").getAsString();
}
try {
JSONObject jSONObject = new JSONObject(str);
aVar.mo32723sv(jSONObject.optInt("pPrice"));
aVar.mo32724sw(jSONObject.optInt("oPrice"));
aVar.mo32722su(jSONObject.optInt("effectiveTime"));
aVar.mo32716lj(jSONObject.optString(SocialConstDef.MESSAGE_LABEL));
arrayList.add(aVar);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
return arrayList;
}
/* renamed from: iC */
public static C1848s<List<C7826a>> m22609iC(final boolean z) {
return aBy().mo10198h(new C1518f<C7699a, C1852w<? extends List<C7826a>>>() {
/* renamed from: b */
public C1852w<? extends List<C7826a>> apply(C7699a aVar) throws Exception {
StringBuilder sb = new StringBuilder();
sb.append(C3625c.m8880GI().mo22958GL());
sb.append("commodityForeignList");
String sb2 = sb.toString();
HashMap hashMap = new HashMap(1);
hashMap.put("promoChannel", Integer.valueOf(z ? 3 : 2));
return aVar.mo32581m(new C3634k(C9943t.m28421ti(sb2), (Map<String, Object>) hashMap).mo22977GW()).mo10199i(new C1518f<C7710a, List<C7826a>>() {
/* renamed from: a */
public List<C7826a> apply(C7710a aVar) throws Exception {
return aVar.dPf;
}
});
}
}).mo10187a(aBz());
}
}
| [
"bhagat.singh@cliffex.com"
] | bhagat.singh@cliffex.com |
dfec49b9cfccafac7a01cc7f79af7a51fc1fd13f | cad46b6937386216ca164335a12ca772f50d42c1 | /Modulo 2/src/exerciciosEstruturaDecisao/ExercicioPossoVotarDirigir.java | afd4fa7e14637f67647daec5b1597c7dab98830f | [] | no_license | jpdal98/Java-Basico | 1b081ae83070d5fcd3f993094955484ff2d7c13e | 93422ec5540259e440f6c4e185c726c83c6f2b02 | refs/heads/main | 2023-07-07T01:26:00.551286 | 2023-07-03T16:56:56 | 2023-07-03T16:56:56 | 352,856,952 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 890 | java | package exerciciosEstruturaDecisao;
import java.util.Scanner;
public class ExercicioPossoVotarDirigir {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
System.out.println("Digite seu ano de nascimento");
int anoNascimento = teclado.nextInt();
System.out.println("Digite o ano em que estamos");
int anoAtual = teclado.nextInt();
if (anoAtual < anoNascimento) {
System.out.println("valor invalido");
}
if (anoAtual - anoNascimento == 16) {
System.out.println("Voce pode votar!!");
}else if ((anoAtual - anoNascimento >= 16 && anoAtual - anoNascimento >= 18) || (anoAtual - anoNascimento == 18)) {
System.out.println("Voce pode votar e dirigir!!");
}else if (anoAtual - anoNascimento < 16 && anoAtual - anoNascimento >= 0) {
System.out.println("Voce não pode votar e nem pode dirigir");
}
teclado.close();
}
}
| [
"jpdal98@gmail.com"
] | jpdal98@gmail.com |
57f299350dcd7477c9f3198a8f3055afc2c53582 | b2b5cacea2b0c52943f58284a15af3babbb0b5f6 | /src/com/zjh/javathink/concurrent/SimpleThread.java | 28c1261376f8a03a19dd94ea6c277ff213cfff62 | [] | no_license | PrometheusH/thinking-in-java | f2e03cf5ab8433932fea68c0eeacb673238302c6 | 84081d37b0bf368b843b85a45b51ec44ee242b04 | refs/heads/master | 2022-10-04T14:08:36.557634 | 2020-06-08T02:27:12 | 2020-06-08T02:27:12 | 267,790,339 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 989 | java | package com.zjh.javathink.concurrent;
/**
* 创建线程类的另一种方法,不用Runnable,不在main中用start()
*/
public class SimpleThread extends Thread {
private int countDown=5;
private static int threadCount=0;
public SimpleThread(){
super(Integer.toString(++threadCount));
//在构造器中调用start()可能会很有问题,因为另一个任务可能会在构造器结束之前开始执行,这意味着该任务能够访问处于不确定状态的对象
//这是优选Excutor而不是显示地创建Thread对象的原因
start();
}
@Override
public String toString() {
return "#" +getName()+
"(countDown=" + countDown +
')';
}
@Override
public void run() {
while (true){
System.out.println(this);
if (--countDown==0){
//return了线程就结束了
return;
}
}
}
}
| [
"zhoujiahuimaster@126.com"
] | zhoujiahuimaster@126.com |
4302fe5c8e64a5d3c06fb50b6b5fe070fa6465b4 | b3bad9b0ba0dd0e4c7b4753c8e4c09e5f7b0b0ef | /app/src/main/java/service/example/com/testcmake/MainActivity.java | 1e7042c6df56330aef1d21de86cd1ba5efb91ad7 | [] | no_license | preqel/JniSample | 11a6a6a492d44274c83a0df1234f2f80fa302704 | 7bf64c3b4dac4df5ff5afb91537d6818bf76f0c4 | refs/heads/master | 2021-01-16T19:11:31.134347 | 2017-08-14T10:41:56 | 2017-08-14T10:41:56 | 100,152,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 832 | java | package service.example.com.testcmake;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Example of a call to a native method
TextView tv = (TextView) findViewById(R.id.sample_text);
tv.setText(stringFromJNI());
}
/**
* A native method that is implemented by the 'native-lib' native library,
* which is packaged with this application.
*/
public native String stringFromJNI();
// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}
}
| [
"358795715@qq.com"
] | 358795715@qq.com |
f2e4bcc9d51bf1577befffe4f7ac6f7579157dca | 0320d9eada29d6ad1d4a2c415c0668f48e615ed5 | /TestNG/src/main/java/base/PaymentTestService.java | bdf1a1316ddc8ed6880d7676adb65515f9c56d7c | [] | no_license | tuotu/TestNG | 32583322949200f75afd2c8ce5087173d907f845 | 18286d40eafcd42d0a536e40f43c7de16ab5b77a | refs/heads/master | 2020-03-18T19:07:34.775384 | 2018-05-28T08:32:38 | 2018-05-28T08:32:38 | 135,135,508 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package base;
import com.yiji.commonproducts.payment.fastpay.api.query.FastPayQueryService;
import com.yjf.securitydata.client.SecurityDataClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
/**
* Copyright (C), 2018-2018
* FileName: paymentTestService
* Author: wiley
* Date: 2018/2/27 0027 14:21
* Description: ${DESCRIPTION}
* History:
* <author> <time> <version> <desc>
* 作者姓名 修改时间 版本号 描述
*/
@ContextConfiguration({"/integration/dubbo-payment.xml"})
public class PaymentTestService extends TestBase {
@Autowired
protected SecurityDataClient securityDataClient;
@Autowired
protected FastPayQueryService fastPayQueryService;
}
| [
"wiley_wang@163.com"
] | wiley_wang@163.com |
e652c5b54b8df7a1f192c32b11636903ac10bf2e | 146ab29e1d12a238c01019bb0c331790d97ecde7 | /src/main/java/com/mashibing/mapper/TblMessageReceiveMapper.java | 8f596fe98adb90148119636ddb6d6605d3c593d3 | [] | no_license | DT0352/family_service | 9d4477af02e934614bc710b1f3f54bed1fe5856b | 50dc5801dd74c0030f80f0c9a0588106174d0d40 | refs/heads/master | 2023-02-16T14:31:22.413132 | 2021-01-09T07:37:47 | 2021-01-09T07:37:47 | 328,101,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 313 | java | package com.mashibing.mapper;
import com.mashibing.bean.TblMessageReceive;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 短信接受表 Mapper 接口
* </p>
*
* @author lian
* @since 2021-01-09
*/
public interface TblMessageReceiveMapper extends BaseMapper<TblMessageReceive> {
}
| [
"18535222330fzd@gmail.com"
] | 18535222330fzd@gmail.com |
57f372fa36ce351bc838569b82492048b21d026c | 493bc80a298ba299054a611cfeb2d3618e9cc448 | /src/com/hjj/jianzhioffer/Problem_21.java | 1158c4bfa4170aa3f568b4fac2d6944f495f86fd | [] | no_license | soberhjj/algorithm | bcab700fb3a3163ff3c8b84733c7bb06513dcbe0 | 9dbb8f8ec8455467ddf92ebd206c04ab9791c991 | refs/heads/master | 2022-04-07T03:59:23.820307 | 2020-01-31T09:26:22 | 2020-01-31T09:26:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | package com.hjj.jianzhioffer;
import java.util.Stack;
/**
* @author soberhjj 2020/1/31 - 17:12
*/
//题目:包含main函数的栈
//定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数
//(时间复杂度应为O(1))。
public class Problem_21 {
Stack<Integer> stack1, stack2;
public void push(int node) {
}
public void pop() {
}
public int top() {
return 0;
}
public int min() {
return 0;
}
}
| [
"sober@163.com"
] | sober@163.com |
90eed47c9eec2083404aa39ad8995287bc9cec40 | eb8f0fad66bcf761ad12b642029b9fa9012a4fbe | /mcp-order-gateway/src/main/java/com/mcp/order/gateway/rmi/RmiContext.java | ff0da6027087241974bde8220cdb871661eb33af | [] | no_license | zhoudaqing/mcp | 29315afc5661cd355ade87c7779988c0660accd2 | 13197aadc65ebd330c47a1d2f2b2b251726134f0 | refs/heads/master | 2021-01-20T05:36:55.296631 | 2015-03-10T07:49:17 | 2015-03-10T07:49:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,028 | java | /**
*
*/
package com.mcp.order.gateway.rmi;
import com.mcp.rmi.common.RmiConstants;
import com.mcp.rmi.inter.SchemeInter;
import org.apache.log4j.Logger;
import java.rmi.Naming;
/**
* @author ming.li
*
*/
public class RmiContext {
public static Logger log = Logger.getLogger(RmiContext.class);
private static RmiContext context;
private SchemeInter schemeInter;
private RmiContext()
{
}
public static RmiContext getInstance()
{
if(context == null)
{
context = new RmiContext();
}
return context;
}
public SchemeInter getSchemeInter()
{
if(schemeInter == null)
{
log.info("开始连接方案引擎rmi接口....");
try {
String url = RmiConstants.getSchemeEngineUri();
schemeInter = (SchemeInter)Naming.lookup(url);
} catch (Exception e) {
throw new RuntimeException("请检查方案引擎rmi接口是否开启...");
}
log.info("成功连接方案引擎rmi接口....");
}
return schemeInter;
}
}
| [
"limiteemail@163.com"
] | limiteemail@163.com |
518e5567df5b5c82d5d65a4a9007bd0c03a65385 | 5acc31b15e2e9ec23df97c52ffdc53f0d422be6a | /Stacks/MinStack.java | 393f9e32809cff50b3931dcf462a11b7feaab294 | [] | no_license | AhmedSleeem/Algorithms- | e699c3e994d0fa687d1fb5e76b0b7d616c1c66b6 | 20595fd82cf0940e47be99e1a2a05ed64203f51b | refs/heads/master | 2023-04-11T15:02:12.711967 | 2021-04-18T22:10:32 | 2021-04-18T22:10:32 | 254,731,624 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | java | class MinStack {
Stack<Pair> stack;
/** initialize your data structure here. */
public MinStack() {
stack =new Stack();
}
public void push(int x) {
int min=stack.isEmpty()?x:Math.min(x,stack.peek().second);
stack.push(new Pair(x,min));
}
public void pop() {
stack.pop();
}
public int top() {
// first ->contains the min element for this index to start of this array
//second -> the element it self
return stack.peek().first;
}
public int getMin() {
return stack.peek().second;
}
}
class Pair implements Comparable<Pair> {
int first, second;
public Pair(int first, int second) {
this.first = first;
this.second = second;
}
@Override
public int compareTo(Pair o) {
if (first!=o.first)return first-o.first;
return second-o.second;
}
}
/**
* Your MinStack object will be instantiated and called as such:
* MinStack obj = new MinStack();
* obj.push(x);
* obj.pop();
* int param_3 = obj.top();
* int param_4 = obj.getMin();
*/ | [
"ahmedselim806.as@gmail.com"
] | ahmedselim806.as@gmail.com |
f05004c69fbba3518ce78a211b31efacee6e6d7b | d7554d676bf71200f4a10b2f6dc1d845a998412d | /persistence/src/main/java/challenge/proximity/repositories/CourseRepository.java | bbe01d0cbef950d1f88701b3c0381b6dcdbad32a | [] | no_license | ashishbagri/proximity_to | 45472bffd8948973fd38a3060455786fd1e76f72 | 4ab600905102691cd3b990ff26993e51d46333b2 | refs/heads/main | 2023-06-04T13:33:14.932712 | 2021-06-28T07:37:02 | 2021-06-28T07:37:02 | 380,945,436 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 586 | java | package challenge.proximity.repositories;
import challenge.proximity.domains.Course;
import challenge.proximity.domains.Subject;
import challenge.proximity.domains.Tag;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
import java.util.Optional;
public interface CourseRepository extends CrudRepository<Course,Long> {
List<Course> findBySubjects_Name(String name);
Optional<Course> findByIdAndUser_Name(long id, String name);
Iterable<Course> findBySubscribers_Name(String name);
}
| [
"ashish.bagri@ymail.com"
] | ashish.bagri@ymail.com |
f972de234cae873d708128bd1316de6388838b30 | 2bdedcda705f6dcf45a1e9a090377f892bcb58bb | /src/main/output/home/job/area/money_right/man.java | 5321ec41e5de5ea4d6d50f955266167057da1d81 | [] | no_license | matkosoric/GenericNameTesting | 860a22af1098dda9ea9e24a1fc681bb728aa2d69 | 03f4a38229c28bc6d83258e5a84fce4b189d5f00 | refs/heads/master | 2021-01-08T22:35:20.022350 | 2020-02-21T11:28:21 | 2020-02-21T11:28:21 | 242,123,053 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,564 | java | 'use strict';
let https = require ('https');
// **********************************************
// *** Update or verify the following values. ***
// **********************************************
// Replace the subscriptionKey string value with your valid subscription key.
let subscriptionKey = '1bdfe63d8aa97346398209128cc5800b';
let host = 'api.microsofttranslator.com';
let path = '/V2/Http.svc/TranslateArray';
let target = 'fr-fr';
let params = '';
let ns = "http://schemas.microsoft.com/2003/10/Serialization/Arrays";
let content =
'<TranslateArrayRequest>\n' +
// NOTE: AppId is required, but it can be empty because we are sending the Ocp-Apim-Subscription-Key header.
' <AppId />\n' +
' <Texts>\n' +
' <string xmlns=\"' + ns + '\">Hello</string>\n' +
' <string xmlns=\"' + ns + '\">Goodbye</string>\n' +
' </Texts>\n' +
' <To>' + target + '</To>\n' +
'</TranslateArrayRequest>\n';
let response_handler = function (response) {
let body = '';
response.on ('data', function (d) {
body += d;
});
response.on ('end', function () {
console.log (body);
});
response.on ('error', function (e) {
console.log ('Error: ' + e.message);
});
};
let TranslateArray = function () {
let request_params = {
method : 'POST',
hostname : host,
path : path + params,
headers : {
'Content-Type' : 'text/xml',
'5ef2b7b42be0db5648cd4c0d18145f8f' : subscriptionKey,
}
};
let req = https.request (request_params, response_handler);
req.write (content);
req.end ();
}
TranslateArray ();
| [
"soric.matko@gmail.com"
] | soric.matko@gmail.com |
16594f4687bb5175cd45b7656240583dd6e6dc8f | d2d6bf2518b244f86eec939aaceb4e16294b4d1e | /Excel2SQL/src/gui/SheetTableHeaderRenderer.java | b8890c779cb03ad7ddd70ff8aa091b05c30817e5 | [] | no_license | normannexo/de.normannexo.java | d735699788267670ddcfcd55dde028af24b702b8 | 82b20514ddc9c5a39f600dff2d02390515e0001a | refs/heads/master | 2021-01-01T16:34:29.711333 | 2013-04-23T13:11:26 | 2013-04-23T13:11:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,553 | java | package gui;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableCellRenderer;
public class SheetTableHeaderRenderer implements
TableCellRenderer, MouseListener {
// This method is called each time a column header
// using this renderer needs to be rendered.
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) {
JTableHeader header = table.getTableHeader();
header.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
System.out.println("clicked!");
}
});
JCheckBox checkWhere = new JCheckBox();
checkWhere.setToolTipText("select as WHERE-Statement");
checkWhere.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
JCheckBox cb = (JCheckBox) e.getSource();
cb.setSelected(true);
System.out.println("clicked!");
}
});
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
panel.setBorder(BorderFactory.createEtchedBorder());
panel.add(checkWhere);
panel.add(new JLabel("" + value ));
return panel;
}
// The following methods override the defaults for performance reasons
public void validate() {
}
public void revalidate() {
}
protected void firePropertyChange(String propertyName, Object oldValue,
Object newValue) {
}
public void firePropertyChange(String propertyName, boolean oldValue,
boolean newValue) {
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
}
| [
"normannexo@googlemail.com"
] | normannexo@googlemail.com |
245035b3d0ca2da6441e2a53a3cafe078820fdeb | 680f00dd9887a59b7e9ebdc5bfd623009bf8a286 | /src/main/java/ru/timeconqueror/timecore/animation/component/LoopMode.java | e01804eb8d2c611432c253523ffe62798cfdd5a1 | [] | no_license | TimeConqueror/Time-Core | 482d51158a0ef7101ab0f214c2451e64f40a8d4b | c87b8346d03358de50d7abbdad2e4ed0b8abea05 | refs/heads/1.16 | 2023-08-21T12:51:41.597764 | 2023-04-06T12:23:45 | 2023-04-06T12:49:44 | 194,283,073 | 9 | 5 | null | 2022-05-17T14:16:01 | 2019-06-28T14:01:16 | Java | UTF-8 | Java | false | false | 1,195 | java | package ru.timeconqueror.timecore.animation.component;
import com.google.gson.*;
import ru.timeconqueror.timecore.api.util.lookups.EnumLookup;
import java.lang.reflect.Type;
public enum LoopMode {
DO_NOT_LOOP,
HOLD_ON_LAST_FRAME,
LOOP;
public static final EnumLookup<LoopMode, Integer> ORDINAL_LOOKUP = EnumLookup.makeFromOrdinal(LoopMode.class);
public static class Deserializer implements JsonDeserializer<LoopMode> {
@Override
public LoopMode deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
JsonPrimitive primitive = jsonElement.getAsJsonPrimitive();
String loopMode = primitive.getAsString();
switch (loopMode) {
case "false":
return LoopMode.DO_NOT_LOOP;
case "true":
return LoopMode.LOOP;
case "hold_on_last_frame":
return LoopMode.HOLD_ON_LAST_FRAME;
default: {
throw new JsonSyntaxException("Unknown loop mode type: " + loopMode);
}
}
}
}
}
| [
"timeconqueror999@gmail.com"
] | timeconqueror999@gmail.com |
b4e0f59496ffca012b038f3c7567986b5cefa964 | 4156601c756fd15b72f54001912bbefa345fb392 | /src/pbo2/pkg10118063/latihan57/Vehicle.java | 33e44aa8da816a801cee7f4a1e5ff3a2db76ff9b | [] | no_license | NaufalAshaW/PBO2-10118063-Latihan57-Vehicle | ef8793bf9cdec60cb4526f9a4918b6330f217c53 | 63cfb4f536123df6a60a4a77c8338980e96003ec | refs/heads/master | 2020-09-05T21:26:43.319571 | 2019-11-07T11:16:24 | 2019-11-07T11:16:24 | 220,218,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 722 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pbo2.pkg10118063.latihan57;
/**
*
* @author
* NAMA : Naufal Asha
* KELAS : IF-2
* NIM : 10118063
*/
public class Vehicle {
private String myBrand, myModel;
public Vehicle(){
}
public String getMyBrand() {
return myBrand;
}
public void setMyBrand(String myBrand) {
this.myBrand = myBrand;
}
public String getMyModel() {
return myModel;
}
public void setMyModel(String myModel) {
this.myModel = myModel;
}
}
| [
"noreply@github.com"
] | NaufalAshaW.noreply@github.com |
a457beede0a930021c8c0b52cf06363819048d0d | 92e96504c12ca319a2c7adc0fef9129e434215db | /TwitterRx/app/src/test/java/com/training/twitterrx/ExampleUnitTest.java | 21b8ef9333840885be53dc8b1fb3095cd159459c | [] | no_license | AbdulrahmanMoubarak/Android-Java-Networking-Demo- | 9bcc943ce7e858d9788d243207a2a3721218903e | 44c252913dd6ea9705775014779590df9c97ef8a | refs/heads/main | 2023-07-31T13:06:32.209763 | 2021-09-27T19:16:16 | 2021-09-27T19:16:16 | 411,010,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | package com.training.twitterrx;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
} | [
"noreply@github.com"
] | AbdulrahmanMoubarak.noreply@github.com |
f97b4dd0cbc111358e3a1bb6edf7cc8c794ac388 | 353c42d919fdc6c0c389e911fce9181c018e253e | /ss.core/src/ss/client/ui/spheremanagement/ManagedSphere.java | 21e374ad4757b066ef8e02c497478ffd7a5ea2a0 | [] | no_license | djat/suprabrowser | ca5decc6fc27a66d7acd6068060285e6c6ac7659 | 110d84094e3ac6abda2af09f4f20368683103f80 | refs/heads/master | 2023-05-11T06:34:57.322343 | 2014-02-08T01:31:07 | 2014-02-08T01:31:07 | 10,919,796 | 1 | 2 | null | 2014-02-08T01:31:08 | 2013-06-24T20:45:03 | Java | UTF-8 | Java | false | false | 5,723 | java | /**
*
*/
package ss.client.ui.spheremanagement;
import java.util.ArrayList;
import java.util.List;
import ss.client.ui.spheremanagement.memberaccess.MemberAccess;
import ss.client.ui.spheremanagement.memberaccess.MemberVisibilityList;
import ss.domainmodel.SphereStatement;
/**
*
*/
public class ManagedSphere implements Comparable<Object> {
@SuppressWarnings("unused")
private static org.apache.log4j.Logger logger = ss.global.SSLogger
.getLogger(ManagedSphere.class);
private final IManagedSphereOwner managedSphereOwner;
private final SphereStatement sphere;
private final ManagedSphereList children = new ManagedSphereList( this );
private final MemberVisibilityList members = new MemberVisibilityList();
private ManagedSphere parent = null;
/**
* @param displayName
*/
public ManagedSphere(IManagedSphereOwner managedSphereOwner, SphereStatement sphere ) {
super();
this.managedSphereOwner = managedSphereOwner;
this.sphere = sphere;
}
/**
* @return
*/
public ManagedSphere getParent() {
return this.parent;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
if(!getStatement().isDeleted()) {
return this.sphere.getDisplayName();
} else {
return this.sphere.getDisplayName()+" (deleted)";
}
}
/**
*
*/
public void remove() {
if ( this.parent != null ) {
this.parent.getChildren().remove( this );
}
}
/**
* @param object
*/
void setParent(ManagedSphere parent) {
this.parent = parent;
}
/**
* @return
*/
public String getId() {
return this.sphere.getSystemName();
}
/**
* @return
*/
public String getDesiredParentId() {
return this.sphere.getSphereCoreId();
}
/**
* @return
*/
public SphereStatement getStatement() {
return this.sphere;
}
/**
* @return the children
*/
public ManagedSphereList getChildren() {
return this.children;
}
/* (non-Javadoc)
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public int compareTo(Object o) {
if ( o instanceof ManagedSphere ) {
return this.managedSphereOwner.compare( this, ((ManagedSphere) o) );
}
else {
return -1;
}
}
/**
* @return the members
*/
public MemberVisibilityList getMembers() {
return this.members;
}
public void setMemberEnabled( String displayName, boolean enabled ) {
final MemberAccess member = getMembers().require( displayName );
member.setAccess(enabled);
}
public boolean isMemberEnabled( String displayName ) {
final MemberAccess member = getMembers().require( displayName );
return member.isAccess();
}
/**
* @return
*/
public boolean isEditable() {
return true;
}
/**
* @return
*/
public boolean isRoot() {
if (getParent() == null)
return true;
return false;
}
/**
* @return
*/
public List<ManagedSphere> listDescendants() {
List<ManagedSphere> fullList = new ArrayList<ManagedSphere>();
collectSphere(this, fullList);
return fullList;
}
private void collectSphere(ManagedSphere parentSphere, List<ManagedSphere> fullList) {
fullList.add(parentSphere);
for(ManagedSphere child : getChildren()) {
collectSphere(child, fullList);
}
}
/**
* @param contactName
*/
public List<ManagedSphere> listEnabledSpheres(String contactName) {
List<ManagedSphere> enabledSpheres = new ArrayList<ManagedSphere>();
collectEnabledSpheres( enabledSpheres, contactName );
return enabledSpheres;
}
public ManagedSphere findSphere( String sphereId ) {
if ( sphereId == null ) {
return null;
}
if ( this.getId().equals( sphereId ) ) {
return this;
}
for( ManagedSphere sphere : getChildren() ) {
final ManagedSphere result = sphere.findSphere(sphereId);
if ( result != null ) {
return result;
}
}
return null;
}
/**
* @param contactName
* @param enabledSpheres
*/
private void addSelfIfEnabled(String contactName, List<ManagedSphere> enabledSpheres) {
final MemberAccess member = this.getMembers().find(contactName);
if ( member != null ) {
if ( member.isAccess() ) {
enabledSpheres.add( this );
}
}
else {
logger.warn( "Can't find member access in " + this + " for " + contactName );
}
}
/**
* @param enabledSpheres
* @param contactName
*/
private void collectEnabledSpheres(List<ManagedSphere> enabledSpheres, String contactName) {
this.addSelfIfEnabled(contactName, enabledSpheres);
for( ManagedSphere child : this.children ) {
child.collectEnabledSpheres(enabledSpheres, contactName);
}
}
public void traverse( IManagedSphereVisitor visitor ) {
visitor.beginNode( this );
for( ManagedSphere sphere : getChildren() ) {
sphere.traverse(visitor);
}
visitor.endNode( this );
}
public boolean isLeaf() {
return this.children.size() == 0;
}
public ManagedSphere find( String sphereId ) {
if ( sphereId == null ) {
return null;
}
if ( this.getId().equals( sphereId ) ) {
return this;
}
for( ManagedSphere sphere : this.children ) {
ManagedSphere result = sphere.find(sphereId);
if ( result != null ) {
return result;
}
}
return null;
}
/**
* @return
*/
public String getDisplayName() {
return this.sphere.getDisplayName();
}
/**
* @return
*/
public Object[] getPathAsArray() {
return getPathAsList().toArray();
}
/**
*
*/
public List<ManagedSphere> getPathAsList() {
List<ManagedSphere> path = new ArrayList<ManagedSphere>();
fillPath( path );
return path;
}
/**
* @return
*/
public void fillPath( List<ManagedSphere> path ) {
ManagedSphere parent = getParent();
if ( parent != null ) {
parent.fillPath(path);
}
path.add( this );
}
}
| [
"mexwebdev@gmail.com"
] | mexwebdev@gmail.com |
e6f84335b1ca15d6d0066d62c6422f00b31d79ee | d1f408a5989838b017b575d307cfec8ebe130223 | /research/src/main/java/com/memo/grouping/entity/ScprsScpOrderHead.java | 94c0d98bb02ad8390fa44d35c2e3f05e21564586 | [
"Apache-2.0"
] | permissive | yiguotang/soup-memo | b0a04fa4a92d9d4e7f629f3a122f40660b4da38d | 6738760544b7d06803dcab500ca44e30c9a07822 | refs/heads/master | 2022-04-30T23:31:28.370876 | 2020-03-16T13:16:36 | 2020-03-16T13:16:36 | 215,424,006 | 0 | 0 | Apache-2.0 | 2022-04-29T01:33:58 | 2019-10-16T00:47:41 | Java | UTF-8 | Java | false | false | 5,021 | java | /*
* Copyright (C), 2002-2015, 苏宁易购电子商务有限公司
* FileName: //文件名
* Author: 14050589
* Date: 2015-10-29 上午11:02:16
* Description: //模块目的、功能描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package com.memo.grouping.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 〈一句话功能简述〉 〈功能详细描述〉采购业务订单头表
*
* @author 14050589
* @see [相关类/方法](可选)
* @since [产品/模块版本] (可选)
*/
@Data
public class ScprsScpOrderHead implements Serializable {
/**
*
*/
private static final long serialVersionUID = 9200646912455318616L;
/**
* 主键ID
*/
private Integer id;
/**
* 采购业务订单号
*/
private String scpOrderNo;
/**
* 业务类型1采购2退货3调拨
*/
private String bsnType;
/**
* 订单类型
*/
private String orderType;
/**
* 订单状态10待审批20待确认21部分确认30待预约(待发货)31部分预约40待收货41部分收获50完成
*/
private String orderStatus;
/**
* 供应商编码
*/
private String supplierCode;
/**
* 供应商名称
*/
private String supplierName;
/**
* 创单时间
*/
private String createOrderTime;
/**
* 创建人
*/
private String createUser;
/**
* 系统源
*/
private String source;
/**
* 发起人用户组
*/
private String userGroup;
/**
* 商品编码集合
*/
private String cmmdtyCodes;
/**
* 品牌编码集合
*/
private String brandCodes;
/**
* 仓库编码集合
*/
private String categoryCodes;
/**
* 仓库编码集合
*/
private String depotCodes;
/**
* 调入仓库编码集合
*/
private String inDepotCodes;
/**
* 调入合同政策编码集合
*/
private String inLocationCodes;
/**
* 合同政策编码集合
*/
private String locationCodes;
/**
* 数据状态
*/
private String dataState;
/**
* 流程实例ID
*/
private String flowInstId;
/**
* 流程模版ID
*/
private String flowId;
/**
* 备注
*/
private String memo;
/**
* 特殊标识 1预算订单
*/
private String specFlag;
/**
* 预算流水号 年份后两位+公司四位+MP5/6/7(5采购,6退厂,7调拨)+7位流水
*/
private String budgetSerrialNo;
/**
* 创建时间
*/
private String createTime;
/**
* 更新时间
*/
private String updateTime;
/**
* 是否启动流程 0:不启动 1:启动
*/
private String startWorkFlow;
/**
* 审批意见
*/
private String remarks;
/**
* 订单行项目
*/
private List<ScprsScpOrderItem> itemList;
/**
* excel_id
*/
private String excelId;
/**
* 订单创建入口
*/
private String createOperateType;
/**
* 总价
*/
private String totalPrice;
/**
* 是否依赖R3 0否1是
*/
private String dependentOnR3;
/**
* 架构层级
*/
private String hierarchyCode;
/**
* 20180828_15040079:SCRPS-368创单业务类型:生鲜中转单-100
*/
private String createBusinessType;
/**
* 责任原因
*/
private String liabilityCause;
/**
* 终端公司采买标识
*/
private String terType;
/**
* 预约类型
* 1 无需预约 2 自动预约 空 普通预约
*/
private String bookOrderType;
/**
* 拆单原因
*/
private String newHeadReason;
/**
* 风险标签值,"1":存在风险标签内容,"0":无
*/
private String riskLable;
/**
* 20191215_19040838:操作方式--->查看详情
*/
private String operateSeeDetails;
/**
* 20191215_19040838:操作方式--->全部删除
*/
private String operateAllDel;
/**
* 20191215_19040838:操作方式--->全部改期
*/
private String operateAllChangeDate;
/**
* 20191215_19040838:操作方式--->全部关闭
*/
private String operateAllClose;
/**
* 20191215_19040838:操作方式--->行修改、删除按钮
*/
private String modifyAndDelButton;
/**
* 20191215_19040838:订单名称
*/
private String orderNameStr;
/**
* 20191215_19040838:采购订单管理订单类型是:100PRS中转、101新中转、111菜场中转、115加工要货单汇总、家乐福
* 订单行复选框置灰不可选
*/
private String disableCheckBox;
}
| [
"yizhao0328@gmail.com"
] | yizhao0328@gmail.com |
0e68cf88750fbd5652f87589754d60ca6ee751eb | 686e75c8ea5a2492f34461b4dc44cff10ac0691e | /src/main/java/com/github/growingspaghetti/eesti/util/DomUtils.java | b6d5e902133de8e4db2f358ce637b097ae54f084 | [] | no_license | growingspaghetti/estonian-anki-deck-builder | e5a9a0c1f0377211d2aacd7d24767069690716a0 | 169f88ae785101b04d09f4c954d68f7c2e49dc4c | refs/heads/master | 2020-05-18T01:57:08.397497 | 2019-06-26T10:47:56 | 2019-06-26T10:47:56 | 184,103,443 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,395 | java | package com.github.growingspaghetti.eesti.util;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import org.apache.xerces.parsers.DOMParser;
import org.apache.xerces.xni.parser.XMLDocumentFilter;
import org.cyberneko.html.HTMLConfiguration;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
public class DomUtils {
XPathFactory xPathFactory = XPathFactory.newInstance();
XPath xpath = xPathFactory.newXPath();
// http://d.hatena.ne.jp/kaiseh/20090219/1235058388
public static Document parseHtml(String s) throws Exception {
HTMLConfiguration config = new HTMLConfiguration();
DOMParser parser = new DOMParser(config);
parser.setProperty("http://cyberneko.org/html/properties/names/elems", "default");
parser.setProperty("http://cyberneko.org/html/properties/names/attrs", "default");
parser.setProperty("http://cyberneko.org/html/properties/filters", new XMLDocumentFilter[0]);
parser.setFeature("http://cyberneko.org/html/features/balance-tags", false);
try (InputStream is = new ByteArrayInputStream(s.getBytes("UTF-8"))) {
InputSource in = new InputSource(is);
in.setEncoding("UTF-8");
parser.parse(in);
return parser.getDocument();
}
}
}
| [
"ryoji.kodakari@gmail.com"
] | ryoji.kodakari@gmail.com |
934e59b95e80af7b9eed52673584a1c6ec6802e5 | b388d7ecdf0fcc78e40af3dbfce809b989a40dd1 | /otf-util/src/main/java/gov/va/isaac/associations/Association.java | 96a3a1414bcf4961591d938e37a0fb0d0fa8a4d7 | [
"Apache-2.0"
] | permissive | vaskaloidis/va-isaac-gui | a1c29bb66adfa7ebca4e2da133ddf7a9638b8f19 | d5917b4c639a2ca96e595a94a87fc72dec44604a | refs/heads/develop | 2021-01-24T02:58:29.026672 | 2015-08-20T17:02:33 | 2015-08-20T17:02:33 | 40,250,850 | 0 | 0 | null | 2015-08-05T14:45:12 | 2015-08-05T14:45:11 | null | UTF-8 | Java | false | false | 4,924 | java | /**
* Copyright Notice
*
* This is a work of the U.S. Government and is not subject to copyright
* protection in the United States. Foreign copyrights may apply.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package gov.va.isaac.associations;
import gov.va.isaac.ExtendedAppContext;
import gov.va.isaac.constants.ISAAC;
import gov.va.isaac.util.OTFUtility;
import java.io.IOException;
import java.util.Optional;
import org.ihtsdo.otf.tcc.api.chronicle.ComponentChronicleBI;
import org.ihtsdo.otf.tcc.api.concept.ConceptChronicleBI;
import org.ihtsdo.otf.tcc.api.concept.ConceptVersionBI;
import org.ihtsdo.otf.tcc.api.contradiction.ContradictionException;
import org.ihtsdo.otf.tcc.api.description.DescriptionVersionBI;
import org.ihtsdo.otf.tcc.api.metadata.binding.Snomed;
import org.ihtsdo.otf.tcc.api.refexDynamic.RefexDynamicVersionBI;
import org.ihtsdo.otf.tcc.api.refexDynamic.data.RefexDynamicDataBI;
import org.ihtsdo.otf.tcc.api.refexDynamic.data.RefexDynamicDataType;
import org.ihtsdo.otf.tcc.model.cc.refexDynamic.data.dataTypes.RefexDynamicNid;
import org.ihtsdo.otf.tcc.model.cc.refexDynamic.data.dataTypes.RefexDynamicUUID;
/**
* {@link Association}
*
* @author <a href="mailto:daniel.armbrust.list@gmail.com">Dan Armbrust</a>
*/
public class Association
{
private RefexDynamicVersionBI<?> refex_;
//TODO Write the code that checks the index states on startup
public Association(RefexDynamicVersionBI<?> data)
{
refex_ = data;
}
public ComponentChronicleBI<?> getSourceComponent() throws IOException
{
return ExtendedAppContext.getDataStore().getComponent(refex_.getReferencedComponentNid());
}
public ComponentChronicleBI<?> getTargetComponent() throws IOException, ContradictionException
{
int targetColIndex = AssociationUtilities.findTargetColumnIndex(refex_.getAssemblageNid());
if (targetColIndex >= 0)
{
RefexDynamicDataBI[] data = refex_.getData();
if (data != null && data.length > targetColIndex)
{
if (data[targetColIndex].getRefexDataType() == RefexDynamicDataType.UUID)
{
return ExtendedAppContext.getDataStore().getComponent(((RefexDynamicUUID) data[targetColIndex]).getDataUUID());
}
else if (data[targetColIndex].getRefexDataType() == RefexDynamicDataType.NID)
{
return ExtendedAppContext.getDataStore().getComponent(((RefexDynamicNid) data[targetColIndex]).getDataNid());
}
}
}
else
{
throw new RuntimeException("unexpected");
}
return null;
}
public ConceptChronicleBI getAssociationTypeConcept() throws IOException
{
return ExtendedAppContext.getDataStore().getConcept(refex_.getAssemblageNid());
}
public String getAssociationName() throws IOException, ContradictionException
{
Optional<? extends ConceptVersionBI> cc = getAssociationTypeConcept().getVersion(OTFUtility.getViewCoordinate());
if (!cc.isPresent())
{
return "NOT ON PATH!";
}
String best = null;
for (DescriptionVersionBI<?> desc : cc.get().getDescriptionsActive(Snomed.SYNONYM_DESCRIPTION_TYPE.getNid()))
{
if (best == null)
{
best = desc.getText();
}
if (OTFUtility.isPreferred(desc.getAnnotations()))
{
return desc.getText();
}
}
return best;
}
public String getAssociationInverseName() throws ContradictionException, IOException
{
Optional<? extends ConceptVersionBI> cc = getAssociationTypeConcept().getVersion(OTFUtility.getViewCoordinate());
if (!cc.isPresent())
{
return "NOT ON PATH!";
}
for (DescriptionVersionBI<?> desc : cc.get().getDescriptionsActive(Snomed.SYNONYM_DESCRIPTION_TYPE.getNid()))
{
for (RefexDynamicVersionBI<?> descNestedType : desc.getRefexesDynamicActive(OTFUtility.getViewCoordinate()))
{
if (descNestedType.getAssemblageNid() == ISAAC.ASSOCIATION_INVERSE_NAME.getNid())
{
return desc.getText();
}
}
}
return null;
}
public RefexDynamicVersionBI<?> getData()
{
return refex_;
}
/**
* @see java.lang.Object#toString()
*/
@Override
public String toString()
{
try
{
return "Association [Name: " + getAssociationName() + " Inverse Name: " + getAssociationInverseName() + " Source: " + getSourceComponent().getPrimordialUuid()
+ " Type: " + getAssociationTypeConcept().getPrimordialUuid() + " Target: " + getTargetComponent().getPrimordialUuid() + "]";
}
catch (Exception e)
{
e.printStackTrace();
return refex_.toString();
}
}
}
| [
"daniel.armbrust.list@gmail.com"
] | daniel.armbrust.list@gmail.com |
4b2609c473d2785df8c5b6f03aca303615eafa7e | aa036e03c5315324d69c6d0dddf4fe5baa8b3225 | /src/test/java/com/manning/liveproject/m2k8s/mapper/MappersTest.java | cfccf0cbf34891e130dcea365c9e44af8fa67d01 | [] | no_license | iainardo/m2k8s | 46e8d461a256770f5f856905b83030adab7f425c | a02487e92f912d73a4cf848e9323bb983a21f3f2 | refs/heads/master | 2022-09-23T07:30:48.581717 | 2020-05-30T08:48:16 | 2020-05-30T08:48:16 | 267,890,130 | 0 | 0 | null | 2020-05-30T08:48:45 | 2020-05-29T15:21:04 | Java | UTF-8 | Java | false | false | 2,262 | java | package com.manning.liveproject.m2k8s.mapper;
import com.manning.liveproject.m2k8s.data.model.Profile;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import static org.assertj.core.api.Assertions.assertThat;
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class MappersTest {
private static final Mappers.ProfileMapper MAPPER =
org.mapstruct.factory.Mappers.getMapper(Mappers.ProfileMapper.class);
@Test
void testApiToData() {
Profile profile = new Profile();
profile.setUsername("unamerkel");
profile.setFirstName("Una");
profile.setLastName("Merkel");
profile.setPassword("changeme");
profile.setEmail("unamerkel@example.com");
com.manning.liveproject.m2k8s.rest.api.Profile persistedProfile = MAPPER.toApiModel(profile);
assertThat(persistedProfile).isNotNull();
assertThat(persistedProfile.getUsername()).isEqualTo(profile.getUsername());
assertThat(persistedProfile.getPassword()).isEqualTo(profile.getPassword());
assertThat(persistedProfile.getFirstName()).isEqualTo(profile.getFirstName());
assertThat(persistedProfile.getLastName()).isEqualTo(profile.getLastName());
assertThat(persistedProfile.getEmail()).isEqualTo(profile.getEmail());
}
@Test
void testDataToAPI() {
com.manning.liveproject.m2k8s.rest.api.Profile dataProfile =
new com.manning.liveproject.m2k8s.rest.api.Profile();
dataProfile.setUsername("unamerkel");
dataProfile.setFirstName("Una");
dataProfile.setLastName("Merkel");
dataProfile.setPassword("changeme");
dataProfile.setEmail("unamerkel@example.com");
Profile apiProfile = MAPPER.toDataModel(dataProfile);
assertThat(apiProfile).isNotNull();
assertThat(apiProfile.getUsername()).isEqualTo(dataProfile.getUsername());
assertThat(apiProfile.getPassword()).isEqualTo(dataProfile.getPassword());
assertThat(apiProfile.getFirstName()).isEqualTo(dataProfile.getFirstName());
assertThat(apiProfile.getLastName()).isEqualTo(dataProfile.getLastName());
assertThat(apiProfile.getEmail()).isEqualTo(dataProfile.getEmail());
}
}
| [
"iainardo@gmail.com"
] | iainardo@gmail.com |
d5294ba585ebf32ab09daf54fc0df3ba2b9f0b11 | e162e19aa6be5216f730505337ab97c28d828527 | /src/main/java/com/nazkord/parsers/ParameterParser.java | 305851dfa73cce0285fa38616efd5858c08df0f7 | [] | no_license | nazkord/WeatherForecaster | 8e1726a9306614efb4df75de18aa98f4943d07be | ad6f630f39e523a0fbeede7e30c10df4039b20ce | refs/heads/master | 2022-05-27T15:14:26.780687 | 2020-01-26T18:41:49 | 2020-01-26T18:41:49 | 234,432,772 | 0 | 0 | null | 2022-05-20T21:22:41 | 2020-01-16T23:38:33 | Java | UTF-8 | Java | false | false | 1,527 | java | package com.nazkord.parsers;
import com.nazkord.model.CurrentWeather;
import com.nazkord.model.ForecastWeather;
import com.nazkord.model.Parameter;
import com.nazkord.options.ParameterOption;
import com.nazkord.utils.DateUtil;
import java.util.List;
import java.util.stream.Collectors;
public class ParameterParser {
public static Float parse(ForecastWeather forecast, String[] args) {
String date = ParameterOption.getDate(args);
Integer hour = ParameterOption.getHour(args);
Parameter parameter = ParameterOption.getParameter(args);
List<CurrentWeather> weathersOfDay = getCurrentWeatherByDate(forecast.getList(), date);
CurrentWeather currentWeather = getCurrentWeatherByHour(weathersOfDay, hour);
return Parameter.getParameter(currentWeather, parameter);
}
private static List<CurrentWeather> getCurrentWeatherByDate(List<CurrentWeather> currentWeatherList, String date) {
return currentWeatherList.stream()
.filter(cW -> date.equals(DateUtil.getDate(cW.getDt_txt())))
.collect(Collectors.toList());
}
private static CurrentWeather getCurrentWeatherByHour(List<CurrentWeather> currentWeathers, Integer hour) {
return currentWeathers.stream()
.filter(cW -> {
Integer weatherHour = Integer.parseInt(DateUtil.getHour(cW.getDt_txt()));
return hour.equals(weatherHour);
})
.collect(Collectors.toList()).get(0);
}
} | [
"nazkord@gmail.com"
] | nazkord@gmail.com |
494c72b9b2b343c85bcadae6db08560fabe113b3 | aa47a3df7a9f50c3586cf629d4c1349e0cff5b6d | /libraries/etbapi/src/main/java/com/easytobook/api/model/DetailsResponse.java | 3b5e0ebf4f92c117b881ea9f6f24b8c4420442bb | [] | no_license | ortal83cohen/hotels | 69c631b4ca53760a702c97293d11eb6934a2048a | d616d45a1f5eef8345e41cda97458a7caff18569 | refs/heads/master | 2021-01-10T05:58:41.772262 | 2016-02-23T19:02:01 | 2016-02-23T19:02:01 | 50,831,676 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 176 | java | package com.easytobook.api.model;
/**
* @author alex
* @date 2015-04-19
*/
public class DetailsResponse {
public Meta meta;
public Accommodation accommodation;
}
| [
"ortal.cohen@easytobook.com"
] | ortal.cohen@easytobook.com |
43f616561f6af69150327d55a46ad4e7e50bf734 | c7ba9be2601a1718507c7a5e013536dea72d9b77 | /src/libraryms/Member.java | 9735b432393490b1e2a4f1af80fd7c4146dded20 | [] | no_license | SandunMadush/Library_Management_System | b4a734285e95084034794c73f4b2186a4f7e4b67 | ee60fa38af30c37f023d5a71f5cb68a5770d598e | refs/heads/master | 2022-12-25T12:14:01.792071 | 2020-09-23T05:53:33 | 2020-09-23T06:05:04 | 297,865,207 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,994 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package libraryms;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
/**
*
* @author Acer
*/
public class Member extends javax.swing.JFrame {
/**
* Creates new form Category
*/
public Member() {
initComponents();
Connect();
Author_Load();
}
Connection con;
PreparedStatement pst;
ResultSet rs;
public void Connect() {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/libraryms", "root", "");
} catch (ClassNotFoundException ex) {
Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, ex);
} catch (SQLException ex) {
Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void Author_Load() {
int c;
try {
pst = con.prepareStatement("select * from member");
rs = pst.executeQuery();
ResultSetMetaData rsd = rs.getMetaData();
c = rsd.getColumnCount();
DefaultTableModel d = (DefaultTableModel) jTable1.getModel();
d.setRowCount(0);
while (rs.next()) {
Vector v2 = new Vector();
for (int i = 1; i <= c; i++) {
v2.add(rs.getString("id"));
v2.add(rs.getString("name"));
v2.add(rs.getString("address"));
v2.add(rs.getString("phone"));
}
d.addRow(v2);
}
} catch (SQLException ex) {
Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* 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() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
txtname = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jButton5 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jScrollPane2 = new javax.swing.JScrollPane();
txtaddress = new javax.swing.JTextArea();
jLabel6 = new javax.swing.JLabel();
txtphone = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true);
jPanel1.setBackground(new java.awt.Color(255, 153, 0));
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.red, 5));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/libraryms/Kotelawala_Defence_University_crest__2_-removebg-preview.png"))); // NOI18N
jLabel2.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("KDU LIBRARY");
jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel3.setFont(new java.awt.Font("Arial", 1, 48)); // NOI18N
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLabel3.setText("MEMBER");
jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel4.setText("Member Name");
jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel5.setText("Address");
jButton5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton5.setText("Add");
jButton5.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jButton1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton1.setText("Update");
jButton1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton2.setText("Delete");
jButton2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
jButton3.setText("Cancel");
jButton3.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
"ID", "Member Name", "Address", "Telephone"
}
) {
Class[] types = new Class [] {
java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
});
jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable1MouseClicked(evt);
}
});
jScrollPane1.setViewportView(jTable1);
txtaddress.setColumns(20);
txtaddress.setRows(5);
jScrollPane2.setViewportView(txtaddress);
jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel6.setText("Telephone");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(35, 35, 35)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtname)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE)
.addComponent(txtphone)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(67, 67, 67)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(41, 41, 41)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 461, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(94, 94, 94)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(jLabel2))
.addComponent(jLabel1))))
.addGap(26, 26, 26))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 338, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(22, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(txtname, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(65, 65, 65))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtphone, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(25, 25, 25)))
.addGap(9, 9, 9)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(43, 43, 43))))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
String name = txtname.getText();
String address = txtaddress.getText();
String phone = txtphone.getText();
try {
pst = con.prepareStatement("insert into member(name,address,phone)values(?,?,?)");
pst.setString(1, name);
pst.setString(2, address);
pst.setString(3, phone);
int k = pst.executeUpdate();
if (k == 1) {
JOptionPane.showMessageDialog(this, "Member Added");
txtname.setText("");
txtaddress.setText("");
txtphone.setText("");
txtname.requestFocus();
Author_Load();
} else {
JOptionPane.showMessageDialog(this, "Error!");
}
} catch (SQLException ex) {
Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton5ActionPerformed
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
DefaultTableModel d1 = (DefaultTableModel) jTable1.getModel();
int selectIndex = jTable1.getSelectedRow();
int id = Integer.parseInt(d1.getValueAt(selectIndex, 0).toString());
txtname.setText(d1.getValueAt(selectIndex, 1).toString());
txtaddress.setText(d1.getValueAt(selectIndex, 2).toString());
txtphone.setText(d1.getValueAt(selectIndex, 3).toString());
jButton5.setEnabled(false);
}//GEN-LAST:event_jTable1MouseClicked
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
DefaultTableModel d1 = (DefaultTableModel) jTable1.getModel();
int selectIndex = jTable1.getSelectedRow();
int id = Integer.parseInt(d1.getValueAt(selectIndex, 0).toString());
String name = txtname.getText();
String address = txtaddress.getText();
String phone = txtphone.getText();
try {
pst = con.prepareStatement("update member set name = ?, address = ?, phone = ? where id = ?");
pst.setString(1, name);
pst.setString(2, address);
pst.setString(3, phone);
pst.setInt(4, id);
int k = pst.executeUpdate();
if (k == 1) {
JOptionPane.showMessageDialog(this, "Member Updated");
txtname.setText("");
txtaddress.setText("");
txtphone.setText("");
txtname.requestFocus();
jButton5.setEnabled(true);
Author_Load();
} else {
JOptionPane.showMessageDialog(this, "Error!");
}
} catch (SQLException ex) {
Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
DefaultTableModel d1 = (DefaultTableModel) jTable1.getModel();
int selectIndex = jTable1.getSelectedRow();
int id = Integer.parseInt(d1.getValueAt(selectIndex, 0).toString());
try {
pst = con.prepareStatement("delete from member where id = ?");
pst.setInt(1, id);
int k = pst.executeUpdate();
if (k == 1) {
JOptionPane.showMessageDialog(this, "Member Deleted");
txtname.setText("");
txtaddress.setText("");
txtphone.setText("");
txtname.requestFocus();
jButton5.setEnabled(true);
Author_Load();
} else {
JOptionPane.showMessageDialog(this, "Error!");
}
} catch (SQLException ex) {
Logger.getLogger(Member.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
this.setVisible(false);
}//GEN-LAST:event_jButton3ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Member.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Member.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Member.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Member.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Member().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTable jTable1;
private javax.swing.JTextArea txtaddress;
private javax.swing.JTextField txtname;
private javax.swing.JTextField txtphone;
// End of variables declaration//GEN-END:variables
}
| [
"sandunmadushanka57@gmail.com"
] | sandunmadushanka57@gmail.com |
a20084dbfeb3dba3f9fe39c8c874909d3dd75d53 | d6e3e6b3c84e8796b375ec4843dfdcb90b90e43b | /src/main/java/com/pony/database/interpret/DropTable.java | da2f797624411e2de7829f64ac4e6ca791c5e7ab | [
"Apache-2.0"
] | permissive | IllayDevel/ponysql | b8342729ce3dbedec444b7fb6d85b80570eb414b | c24bd9f6a06486a4dc24719742a017c1b78cde5b | refs/heads/master | 2022-05-02T00:07:18.852481 | 2022-04-10T05:17:35 | 2022-04-10T05:17:35 | 230,018,684 | 35 | 1 | Apache-2.0 | 2022-04-10T05:17:36 | 2019-12-25T00:40:13 | Java | UTF-8 | Java | false | false | 5,897 | java | /*
* Pony SQL Database ( http://i-devel.ru )
* Copyright (C) 2019-2020 IllayDevel.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.pony.database.interpret;
import com.pony.database.*;
import java.util.ArrayList;
/**
* The logic of the 'DROP TABLE' SQL command.
*
* @author Tobias Downer
*/
public class DropTable extends Statement {
/**
* Only create if table doesn't exist.
*/
boolean only_if_exists = false;
/**
* The list of tables to drop.
*/
ArrayList drop_tables = new ArrayList();
// /**
// * Adds the table name to the list of tables to drop.
// */
// void addTable(String table) throws ParseException {
// if (drop_tables.contains(table)) {
// throw new ParseException("Duplicate table in drop");
// }
// drop_tables.add(table);
// }
// ---------- Implemented from Statement ----------
public void prepare() throws DatabaseException {
only_if_exists = cmd.getBoolean("only_if_exists");
drop_tables = (ArrayList) cmd.getObject("table_list");
// Check there are no duplicate entries in the list of tables to drop
for (int i = 0; i < drop_tables.size(); ++i) {
Object check = drop_tables.get(i);
for (int n = i + 1; n < drop_tables.size(); ++n) {
if (drop_tables.get(n).equals(check)) {
throw new DatabaseException("Duplicate table in drop: " + check);
}
}
}
}
public Table evaluate() throws DatabaseException {
DatabaseQueryContext context = new DatabaseQueryContext(database);
int list_size = drop_tables.size();
ArrayList resolved_tables = new ArrayList(list_size);
// Check the user has privs to delete these tables...
for (Object drop_table : drop_tables) {
String table_name = drop_table.toString();
TableName tname = resolveTableName(table_name, database);
// Does the table exist?
if (!only_if_exists && !database.tableExists(tname)) {
throw new DatabaseException("Table '" + tname + "' does not exist.");
}
resolved_tables.add(tname);
// Does the user have privs to drop this tables?
if (!database.getDatabase().canUserDropTableObject(context,
user, tname)) {
throw new UserAccessException(
"User not permitted to drop table: " + tname);
}
}
// Check there are no referential links to any tables being dropped
for (int i = 0; i < list_size; ++i) {
TableName tname = (TableName) resolved_tables.get(i);
// Any tables that have a referential link to this table.
Transaction.ColumnGroupReference[] refs =
database.queryTableImportedForeignKeyReferences(tname);
for (Transaction.ColumnGroupReference ref : refs) {
// If the key table isn't being dropped then error
if (!resolved_tables.contains(ref.key_table_name)) {
throw new DatabaseConstraintViolationException(
DatabaseConstraintViolationException.DROP_TABLE_VIOLATION,
"Constraint violation (" + ref.name + ") dropping table " +
tname + " because of referential link from " +
ref.key_table_name);
}
}
}
// If the 'only if exists' flag is false, we need to check tables to drop
// exist first.
if (!only_if_exists) {
// For each table to drop.
for (int i = 0; i < list_size; ++i) {
// Does the table already exist?
// String table_name = drop_tables.get(i).toString();
//// TableName tname =
//// TableName.resolve(database.getCurrentSchema(), table_name);
// TableName tname = resolveTableName(table_name, database);
TableName tname = (TableName) resolved_tables.get(i);
// If table doesn't exist, throw an error
if (!database.tableExists(tname)) {
throw new DatabaseException("Can not drop table '" + tname +
"'. It does not exist.");
}
}
}
// For each table to drop.
int dropped_table_count = 0;
GrantManager grant_manager = database.getGrantManager();
for (int i = 0; i < list_size; ++i) {
// Does the table already exist?
// String table_name = drop_tables.get(i).toString();
// TableName tname = resolveTableName(table_name, database);
TableName tname = (TableName) resolved_tables.get(i);
if (database.tableExists(tname)) {
// Drop table in the transaction
database.dropTable(tname);
// Drop the grants for this object
grant_manager.revokeAllGrantsOnObject(
GrantManager.TABLE, tname.toString());
// Drop all constraints from the schema
database.dropAllConstraintsForTable(tname);
++dropped_table_count;
}
}
return FunctionTable.resultTable(context, 0);
}
}
| [
"idevel@bk.ru"
] | idevel@bk.ru |
d802286995def8173998c6bc8ba28b152de9955c | ae620f47943097fdb3791cbbbbec832c48b426cc | /src/main/java/app/ClassController.java | ed47ada39071e19fe80a706a700521b60f32f9da | [
"MIT"
] | permissive | causztic/smartnation | b6aeaabda3a63a1a735cff333498d64351769a06 | 927b0c1f142ff1c3d873332ee3a51c550a2c8306 | refs/heads/master | 2021-08-28T18:40:07.519160 | 2017-12-13T00:29:11 | 2017-12-13T00:29:11 | 106,786,601 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,474 | java | package app;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.time.Instant;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import app.models.CohortClass;
@RestController
public class ClassController {
@RequestMapping(value="/classes", produces="application/json")
public String[] index() {
return CohortClass.CLASSES;
}
/*
* Get the class schedule for a particular class.
* @param klass the class to get. It should be one of CohortClass.CLASSES.
*/
@RequestMapping(value="/classes/{klass}", method=RequestMethod.GET, produces="application/json")
public String getClasses(@PathVariable String klass){
String result = getTimetable(klass).toString();
return result;
}
/*
* Get the class schedule for this week.
* @param klass the klass to get. It should be one of CohortClass.CLASSES.
*/
@RequestMapping(value="/classes/{klass}/this_week", method=RequestMethod.GET, produces="application/json")
public String getClassesThisWeek(@PathVariable String klass){
String result = null;
JsonArray timetable = getTimetable(klass);
JsonArray coursesInWeek = new JsonArray();
Calendar cal = Calendar.getInstance();
cal.setTimeZone(TimeZone.getTimeZone("GMT+0"));
// get the current week to check
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.clear(Calendar.MINUTE);
cal.clear(Calendar.SECOND);
cal.clear(Calendar.MILLISECOND);
cal.set(Calendar.DAY_OF_WEEK, cal.getFirstDayOfWeek());
Calendar nextWeek = (Calendar) cal.clone();
nextWeek.add(Calendar.WEEK_OF_YEAR, 1);
for (JsonElement element: timetable){
JsonObject obj = element.getAsJsonObject();
String start = obj.get("start").getAsString();
String end = obj.get("end").getAsString();
// java8 date parsing
Date startDate = Date.from(Instant.parse(start+'Z'));
Date endDate = Date.from(Instant.parse(end+'Z'));
if (startDate.after(cal.getTime()) && endDate.before(nextWeek.getTime())){
// if startDate occurs after this week and before
coursesInWeek.add(obj);
}
}
result = coursesInWeek.toString();
return result;
}
private JsonArray getTimetable(String klass){
HttpURLConnection connection = null;
JsonArray result = null;
try {
URL timetableURL = new URL("http://sutd-timetable.herokuapp.com/group_sections/?" + klass);
connection = (HttpURLConnection) timetableURL.openConnection();
connection.connect();
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK){
JsonElement root = new JsonParser().parse(new InputStreamReader(connection.getInputStream()));
result = root.getAsJsonObject().get("events").getAsJsonArray();
} else {
throw new Exception("Server responded with a response code of: " + connection.getResponseCode());
}
} catch (Exception e) {
e.printStackTrace();
} finally {
connection.disconnect();
}
return result;
}
} | [
"limyaojie93@gmail.com"
] | limyaojie93@gmail.com |
6bb1b5a3b7304457de099c833a4501af4393c48c | 6086b137e375e2ffc280ad31663ecd6024aa610d | /WORDAKSHARI/Main.java | b758544b1e5078aefda3478489a1c8c1a152e037 | [] | no_license | gumitrathore/Playground | 7b7d1ee5936562e3ab4df39f8d39d516724d5bc6 | 599de41f6c680fd993e73f260a685729f44b1fc0 | refs/heads/master | 2022-12-17T22:30:27.866333 | 2020-09-18T18:40:08 | 2020-09-18T18:40:08 | 285,206,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 315 | java | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main()
{
string str, front, last;
getline(cin, str);
cout << str << endl;
while (str != "####")
{
last = str.back();
getline(cin, str);
front = str.front();
if (last == front)
{
cout << str << endl;
}
else
break;
}
}
| [
"gumitrathore@gmail.com"
] | gumitrathore@gmail.com |
1365087035ddb8e182eec6285d68495343069223 | 5ff3864e275e73eae8ef0baffce12854d3f611d0 | /coding-skills/coding-challenge-geeksforgeeks/src/main/java/com/geeksforgeeks/mustdocoding/problems/A_ArrayProblems.java | ca62a1bd0770e4ed398d3c624a4197b0d8ae7919 | [] | no_license | vireninterviewkit/code-backup | 7b7a878f0c5628c3de07116af7e709bd16cad63e | 93251b3c8f20940417f31b0d074f0096b0dc4291 | refs/heads/master | 2023-01-14T01:33:15.785168 | 2020-11-19T13:19:40 | 2020-11-19T13:19:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,543 | java | package com.geeksforgeeks.mustdocoding.problems;
import java.util.ArrayList;
import java.util.Collections;
import java.util.PriorityQueue;
public class A_ArrayProblems {
// 1.Kadane's Algorithm
void kadaneAlgorithm(int[] a) {
int sum = 0, startIndex = 0, endIndex = 0, startIndexUpdate = 0, max = a[0];
for (int i = 0; i < a.length; i++) {
sum += a[i];
if (sum > max) {
max = sum;
startIndex = startIndexUpdate;
endIndex = i;
}
if (sum < 0) {
sum = 0;
startIndexUpdate = i + 1;
}
}
System.out.println(max);
System.out.println("Start: " + startIndex + " End:" + endIndex);
}
// 2.Missing number in array
public static int missingNumber(int[] a) {
int sum = 0, missingSum = 0;
for (int i = 1; i <= a.length + 1; i++) {
sum += i;
}
for (int i = 0; i < a.length; i++) {
missingSum += a[i];
}
return sum - missingSum;
}
// 3.Subarray with given sum
// Naive solution or Brute force approach: Time Complexity: O(n^2)
public static void subArrayWithGivenSum1(int[] arr, int sum) {
int start = 0, end = 0, tempSum = 0;
int n = arr.length;
for (int i = 0; i < n; i++) {
start = i;
tempSum = 0;
for (int j = i; j < n; j++) {
tempSum += arr[j];
if (sum == tempSum) {
end = j;
break;
}
}
if (sum == tempSum)
break;
}
if (sum == tempSum)
System.out.println((start + 1) + " " + (end + 1));
else
System.out.println("-1");
}
// 3.Subarray with given sum
// Efficient approach: Time Complexity: O(n)
public static void subArrayWithGivenSum2(int[] arr, int sum) {
int currSum = arr[0], start = 0, end = 0, n = arr.length, i;
for (i = 1; i < n; i++) {
currSum += arr[i];
while (currSum > sum && start < i - 1) {
currSum = currSum - arr[start];
start++;
}
if (currSum == sum) {
end = i;
break;
}
}
if (sum == currSum) {
// System.out.println((start) + " " + (end)); // Print the Index
System.out.println((start + 1) + " " + (end + 1)); // Print the Position
} else {
System.out.println("-1");
}
}
// 4.Sort an array of 0s, 1s and 2s
public static int[] sortArray012(int[] a) {
int low = 0, mid = 0, high = a.length - 1;
while (mid <= high) {
switch (a[mid]) {
case 0:
swap(a, low, mid);
low++;
mid++;
break;
case 1:
mid++;
break;
case 2:
swap(a, mid, high);
high--;
break;
default:
System.out.println("Wrong Data");
break;
}
}
return a;
}
public static void swap(int[] a, int i1, int i2) {
int temp = a[i1];
a[i1] = a[i2];
a[i2] = temp;
}
public static void printArray(int[] a) {
for (int i = 0; i < a.length; i++)
System.out.print(a[i] + " ");
}
/*
* Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements
* at higher indexes.
*/
// 5.Equilibrium point: Brute Force Approach- Time complexity: O(n^2)
public static int equilibriumPoint1(int[] a) {
int leftSum, rightSum;
if (a.length == 1)
return 1;
for (int i = 1; i < a.length; i++) {
leftSum = 0;
// Left Sum:
for (int j = 0; j < i; j++)
leftSum += a[j];
// Right sum
rightSum = 0;
for (int k = i + 1; k < a.length; k++)
rightSum += a[k];
if (leftSum == rightSum)
return (i + 1); // Problem expects to return position(not index)
}
return -1;
}
// 5.Equilibrium point: Brute Force Approach- Time complexity: O(n)
public static int equilibriumPoint2(int[] a) {
int leftSum = 0, sum = 0;
if (a.length == 1)
return 1;
for (int i = 0; i < a.length; i++)
sum += a[i];
for (int j = 0; j < a.length; j++) {
sum -= a[j];
if (leftSum == sum)
return j + 1;
leftSum += a[j];
}
return -1;
}
// 7.Leaders in array: BruteForce Approach- TimeComplexity:O(n^2)
public static void leadersInArray1(int[] arr) {
}
// 7.Leaders in array: Using PriorityQueue- TimeComplexity:O(nlogn)
public static void leadersInArray2(int[] arr) {
PriorityQueue<Integer> queue = new PriorityQueue<>(Collections.reverseOrder());
for (int i = 0; i < arr.length; i++)
queue.add(arr[i]);
for (int i = 0; i < arr.length; i++) {
queue.remove(arr[i]);
if (queue.isEmpty() || arr[i] > queue.peek())
System.out.print(arr[i] + " ");
}
System.out.println();
}
// 7.Leaders in array: Efficient Approach TimeComplexity:O(nlogn)
public static void leadersInArray3(int[] arr) {
int currMax = Integer.MIN_VALUE;
ArrayList<Integer> result = new ArrayList<>();
for (int i = arr.length - 1; i >= 0; i--) {
if (arr[i] > currMax) {
currMax = arr[i];
result.add(arr[i]);
}
}
for (int i = result.size(); i >= 0; i--) {
System.out.print(result.get(i) + " ");
}
System.out.println();
}
// 18.Find the element that appears once in a sorted array:Linear algorithm
public static int findElementAppearsOnce(int[] a) {
int i, result = -1;
for (i = 0; i < a.length - 1; i += 2) {
if (a[i] != a[i + 1]) {
result = a[i];
break;
}
}
if (result == -1)
result = a[a.length - 1];
return result;
}
public static void main(String[] args) {
System.out.println("Kadane Alg:");
int[] a = { 2, 3, 4, 1, 6, 7 };
System.out.println("Missing No: ");
missingNumber(a);
System.out.println("Sub array with given sum: ");
subArrayWithGivenSum1(a, 11);
subArrayWithGivenSum2(a, 11);
int[] a2 = { 1, 2, 3, 4, 4, 7 };
System.out.println("Find the element which appears more than once: " + findElementAppearsOnce(a2));
}
}
| [
"prabueee.b@gmail.com"
] | prabueee.b@gmail.com |
94ded2431772ca9b8ce536b8d3cd0786c5e35b6f | 0ec58ba6a8c42f1a10f8b67e6cfbc0bbb904ff9d | /src/main/java/com/pyb/mvc/weixin/replyMessageBean/TextMessage.java | 1be0151084acd7fbf56255b71753ba7381d197ca | [] | no_license | jingxiaohu/adver_task | 9c6be47ecd52f476b6592ba2bf199383972a9a48 | 0fd3ffd58e88760799df990b69660cf338541e9a | refs/heads/master | 2021-01-02T22:27:57.016503 | 2018-03-18T07:45:04 | 2018-03-18T07:45:04 | 99,323,216 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | package com.pyb.mvc.weixin.replyMessageBean;
/**
* 类名: TextMessage </br>
* 描述: 文本消息 </br>
* 开发人员: souvc </br>
* 创建时间: 2015-9-30 </br>
* 发布版本:V1.0 </br>
*/
public class TextMessage extends BaseMessage {
// 回复的消息内容
private String Content;
public String getContent() {
return Content;
}
public void setContent(String content) {
Content = content;
}
}
| [
"251878350@qq.com"
] | 251878350@qq.com |
7c4bb42928f3014676cec6499d91789884a6c422 | 039199a3964199aefe6a37cadb9316bf7b1f8b87 | /src/main/java/com/champika/empManagment/service/DepartmentService.java | b56cd2c07624a230f0d3892ff03954970078db67 | [] | no_license | ChampikaWijesundara/ems | 36289d1249fb9aef606eade237547007ea534102 | 88918832262dd555ebfe2f6d2d16214e70bc1259 | refs/heads/master | 2021-04-28T12:56:24.828574 | 2018-02-19T16:44:53 | 2018-02-19T16:44:53 | 122,090,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,140 | java | package com.champika.empManagment.service;
import java.util.List;
import com.champika.empManagment.request.CreateDepartmentRequest;
import com.champika.empManagment.request.UpdateDepartmentRequest;
import com.champika.empManagment.response.DepartmentDetailsResponse;
public interface DepartmentService {
/**
* Get department details for given department id.
*
* @param departmentId
* @return
*/
public DepartmentDetailsResponse findDepartmentById(String departmentId);
/**
* Get all the departments.
*
* @return
*/
public List<DepartmentDetailsResponse> findAllDepartments();
/**
* Create new department.
*
* @param departmentRequest
* @return
*/
public boolean addNewDepartment(CreateDepartmentRequest departmentRequest);
/**
* Update existing department.
*
* @param departmentId
* @param departmentRequest
* @return
*/
public boolean updateDepartment(String departmentId, UpdateDepartmentRequest departmentRequest);
/**
* Delete department by given department id.
*
* @param departmentId
* @return
*/
public boolean deleteDepartmentById(String departmentId);
}
| [
"champikaovi@gmail.com"
] | champikaovi@gmail.com |
482bce2fa11ff948abf5ad633158ef72b387202d | 81b701caf5d2e8658a46cc84eeb3d9ad6f7fbdae | /TimeSeriesAnalysis-master/data_acquisition/src/main/java/data/CSVDataAcquisitor.java | 32b55d0075581a419588b6c5f6c22c48f5e50568 | [] | no_license | DingXiye/PythonDemo | 0e78374595d19e4f71f9188a0e8012b861d0447b | 401f1ff2791124c9084a519a0262c9fbb12d3fed | refs/heads/master | 2020-03-20T21:12:59.607078 | 2018-08-03T08:22:19 | 2018-08-03T08:22:19 | 137,729,236 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,850 | java | /**
* Copyright (c) 2013,
* Tomasz Choma, Olgierd Grodzki, Łukasz Potępa, Monika Rakoczy, Paweł Synowiec, Łukasz Szarkowicz
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package data;
import au.com.bytecode.opencsv.CSVReader;
import java.io.FileReader;
import java.io.IOException;
import org.jfree.data.time.Day;
import org.jfree.data.time.TimeSeries;
import java.text.SimpleDateFormat;
import java.util.LinkedList;
/**
* 允许以CSV格式和转换读取文件的类
*/
public class CSVDataAcquisitor
{
/**
* 一个类,用于读取和解释CSV文件中与模式相关的数据
*/
CSVReader csvreader;
/**
* 文件路径
*/
String filePath;
/**
* 处理日期的格式
*/
String dateFormat;
/**
* 日期所在列的编号
*/
int timeTab;
/**
* 带有值的列号
*/
int valueTab;
/**
* 默认情况下接受值的类构造函数:
* ',' - 间隔
* '\"' - 数据指定
* "yyyy-MM-dd" - format daty
* 0 - 列号与日期
* 1 - 带有值的列号
* @param file CSV文件的路径
* @throws IOException 文件处理错误
*/
public CSVDataAcquisitor(String file) throws IOException{
this.csvreader=new CSVReader(new FileReader(file),',','\"');
this.filePath=file;
this.dateFormat="yyyy-MM-dd";
this.timeTab=0;
this.valueTab=1;
}
/**
* 类构造函数
* @param file CSV文件的路径
* @param separator 用于分隔数据字段的字符
* @param quotechar 标志指定
* @throws IOException bład przetwarzania pliku
*/
public CSVDataAcquisitor(String file,char separator, char quotechar) throws IOException{
this.csvreader=new CSVReader(new FileReader(file), separator, quotechar);
this.filePath=file;
this.dateFormat="yyyy-MM-dd";
this.timeTab=0;
this.valueTab=1;
}
/**
*类构造函数
* @param file CSV文件的路径
* @param separator 用于分隔数据字段的字符
* @param quotechar 标志指定
* @param tTab 列号与日期
* @param vTab 带有值的列号
* @throws IOException bład przetwarzania pliku
*/
public CSVDataAcquisitor(String file,char separator, char quotechar,int tTab,int vTab) throws IOException{
this.csvreader=new CSVReader(new FileReader(file), separator, quotechar);
this.filePath=file;
this.dateFormat="yyyy-MM-dd";
this.timeTab=tTab;
this.valueTab=vTab;
}
/**
* 类构造函数
* @param file scieżka do pliku CSV
* @param separator znak oddzielający pola danych
* @param quotechar znak wyznaczający daną
* @param tTab numer kolumny z datą
* @param vTab numer kolumny z wartością
* @param dateFormat format daty
* @throws IOException bład przetwarzania pliku
*/
public CSVDataAcquisitor(String file,char separator, char quotechar,int tTab,int vTab,String dateFormat) throws IOException{
this.csvreader=new CSVReader(new FileReader(file), separator, quotechar);
this.filePath=file;
this.dateFormat=dateFormat;
this.timeTab=tTab;
this.valueTab=vTab;
}
/**
* 类构造函数
* @param file scieżka do pliku CSV
* @param tTab numer kolumny z datą
* @param vTab numer kolumny z wartością
* @param dateFormat format daty
* @throws IOException bład przetwarzania pliku
*/
public CSVDataAcquisitor(String file,int tTab,int vTab,String dateFormat) throws IOException{
this.csvreader=new CSVReader(new FileReader(file), ',', '\"');
this.filePath=file;
this.dateFormat=dateFormat;
this.timeTab=tTab;
this.valueTab=vTab;
}
/**
* Konstruktor klasy
* @param file scieżka do pliku CSV
* @param tTab numer kolumny z datą
* @param vTab numer kolumny z wartością
* @throws IOException bład przetwarzania pliku
*/
public CSVDataAcquisitor(String file,int tTab,int vTab) throws IOException{
this.csvreader=new CSVReader(new FileReader(file));
this.filePath=file;
this.dateFormat="yyyy-MM-dd";
this.timeTab=tTab;
this.valueTab=vTab;
}
/**
* 用日期设置列号的函数
* @param tTab 列号与日期
*/
public void setTimeTab(int tTab){
this.timeTab=tTab;
}
/**
* 使用值设置列号的函数
* @param vTab 带有值的列号
*/
public void setValueTab(int vTab){
this.valueTab=vTab;
}
/**
* 用于设置日期格式的函数
* @param format format daty
*/
public void setDateFormat(String format){
this.dateFormat=format;
}
/**
* 从文件中读取数据的方法确定结果并将它们传递给输出
* @return 从适当的列中选择的数据
* @throws IOException błąd przetwarzania - brak przetworzonych danych
*/
public TimeSeries readData_TimeSeries() throws IOException{
String name=this.filePath.substring(this.filePath.lastIndexOf("\\")+1,this.filePath.length());
TimeSeries timeSeries=new TimeSeries(name);
String[] nextLine;
SimpleDateFormat dateFormatter = new SimpleDateFormat(this.dateFormat);
while ((nextLine=this.csvreader.readNext())!=null){
int added=timeSeries.getItemCount();
try{
if (nextLine[this.valueTab].contains(",")){
nextLine[this.valueTab]=nextLine[this.valueTab].replaceAll(",",".");
}
if (nextLine[this.timeTab].contains("\"")){
nextLine[this.timeTab]=nextLine[this.timeTab].replaceAll("\"", "");
}
timeSeries.add(new Day(dateFormatter.parse(nextLine[this.timeTab])),Double.valueOf(nextLine[this.valueTab]));
}
catch (Exception e){
if (!timeSeries.isEmpty()){
if (timeSeries.getItemCount()!=added){
timeSeries.clear();
}
}
}
}
if (timeSeries.isEmpty()){
throw new IOException();
}
return timeSeries;
}
/**
* 从文件中读取数据的方法确定结果并将它们传递给输出
* @return 从适当的列中选择的数据
* @throws IOException 处理错误 - 未处理数据
*/
public double[] readData_DoubleValueTable() throws IOException{
LinkedList<Double> list=new LinkedList<Double>();
String[] nextLine;
while ((nextLine=this.csvreader.readNext())!=null){
int added=list.size();
try{
if (nextLine[this.valueTab].contains(",")){
nextLine[this.valueTab]=nextLine[this.valueTab].replaceAll(",",".");
}
if (nextLine[this.timeTab].contains("\"")){
nextLine[this.timeTab]=nextLine[this.timeTab].replaceAll("\"", "");
}
list.add(Double.parseDouble(nextLine[this.valueTab]));
}
catch (Exception e){
if (!list.isEmpty()){
if (list.size()!=added){
list.clear();
}
}
}
}
if (list.isEmpty()){
throw new IOException();
}
double[] out=new double[list.size()];
for (int i=0;i<list.size();i++){
out[i]=list.get(i);
}
return out;
}
}
| [
"shenjiawen@qq.com"
] | shenjiawen@qq.com |
e809ea21e679b393f54c25223f58dafd74c91f37 | e8883f189365a8a4be518f4737264c35b054250a | /optaplanner-core/src/main/java/org/optaplanner/core/impl/heuristic/selector/move/generic/chained/SubChainSwapMoveSelector.java | 5bbbbfc2dcfb5d1022e08d38b01e769424a5362f | [
"Apache-2.0"
] | permissive | deyangdianzi/optaplanner | 06ee9e7be0e9a931ea6befafd1f6e7890b1553cd | 7841052c98d84664fe5c44fb3b1da5aed9f7ffa7 | refs/heads/master | 2020-06-21T03:45:54.060479 | 2019-07-07T18:33:20 | 2019-07-16T11:11:38 | 197,335,263 | 2 | 0 | Apache-2.0 | 2019-07-17T07:11:03 | 2019-07-17T07:11:03 | null | UTF-8 | Java | false | false | 6,566 | java | /*
* Copyright 2012 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.optaplanner.core.impl.heuristic.selector.move.generic.chained;
import java.util.Iterator;
import org.optaplanner.core.impl.domain.variable.descriptor.GenuineVariableDescriptor;
import org.optaplanner.core.impl.domain.variable.inverserelation.SingletonInverseVariableDemand;
import org.optaplanner.core.impl.domain.variable.inverserelation.SingletonInverseVariableSupply;
import org.optaplanner.core.impl.domain.variable.supply.SupplyManager;
import org.optaplanner.core.impl.heuristic.move.Move;
import org.optaplanner.core.impl.heuristic.selector.common.iterator.AbstractOriginalSwapIterator;
import org.optaplanner.core.impl.heuristic.selector.common.iterator.AbstractRandomSwapIterator;
import org.optaplanner.core.impl.heuristic.selector.move.generic.GenericMoveSelector;
import org.optaplanner.core.impl.heuristic.selector.value.chained.SubChain;
import org.optaplanner.core.impl.heuristic.selector.value.chained.SubChainSelector;
import org.optaplanner.core.impl.solver.scope.DefaultSolverScope;
public class SubChainSwapMoveSelector extends GenericMoveSelector {
protected final SubChainSelector leftSubChainSelector;
protected final SubChainSelector rightSubChainSelector;
protected final GenuineVariableDescriptor variableDescriptor;
protected final boolean randomSelection;
protected final boolean selectReversingMoveToo;
protected SingletonInverseVariableSupply inverseVariableSupply = null;
public SubChainSwapMoveSelector(SubChainSelector leftSubChainSelector, SubChainSelector rightSubChainSelector,
boolean randomSelection, boolean selectReversingMoveToo) {
this.leftSubChainSelector = leftSubChainSelector;
this.rightSubChainSelector = rightSubChainSelector;
this.randomSelection = randomSelection;
this.selectReversingMoveToo = selectReversingMoveToo;
variableDescriptor = leftSubChainSelector.getVariableDescriptor();
if (leftSubChainSelector.getVariableDescriptor() != rightSubChainSelector.getVariableDescriptor()) {
throw new IllegalStateException("The selector (" + this
+ ") has a leftSubChainSelector's variableDescriptor ("
+ leftSubChainSelector.getVariableDescriptor()
+ ") which is not equal to the rightSubChainSelector's variableDescriptor ("
+ rightSubChainSelector.getVariableDescriptor() + ").");
}
phaseLifecycleSupport.addEventListener(leftSubChainSelector);
if (leftSubChainSelector != rightSubChainSelector) {
phaseLifecycleSupport.addEventListener(rightSubChainSelector);
}
}
@Override
public void solvingStarted(DefaultSolverScope solverScope) {
super.solvingStarted(solverScope);
SupplyManager supplyManager = solverScope.getScoreDirector().getSupplyManager();
inverseVariableSupply = supplyManager.demand(new SingletonInverseVariableDemand(variableDescriptor));
}
@Override
public void solvingEnded(DefaultSolverScope solverScope) {
super.solvingEnded(solverScope);
inverseVariableSupply = null;
}
// ************************************************************************
// Worker methods
// ************************************************************************
@Override
public boolean isCountable() {
return leftSubChainSelector.isCountable() && rightSubChainSelector.isCountable();
}
@Override
public boolean isNeverEnding() {
return randomSelection || leftSubChainSelector.isNeverEnding() || rightSubChainSelector.isNeverEnding();
}
@Override
public long getSize() {
return AbstractOriginalSwapIterator.getSize(leftSubChainSelector, rightSubChainSelector);
}
@Override
public Iterator<Move> iterator() {
if (!randomSelection) {
return new AbstractOriginalSwapIterator<Move, SubChain>(leftSubChainSelector, rightSubChainSelector) {
private Move nextReversingSelection = null;
@Override
protected Move createUpcomingSelection() {
if (selectReversingMoveToo && nextReversingSelection != null) {
Move upcomingSelection = nextReversingSelection;
nextReversingSelection = null;
return upcomingSelection;
}
return super.createUpcomingSelection();
}
@Override
protected Move newSwapSelection(SubChain leftSubSelection, SubChain rightSubSelection) {
if (selectReversingMoveToo) {
nextReversingSelection = new SubChainReversingSwapMove(
variableDescriptor, inverseVariableSupply, leftSubSelection, rightSubSelection);
}
return new SubChainSwapMove(variableDescriptor, inverseVariableSupply, leftSubSelection, rightSubSelection);
}
};
} else {
return new AbstractRandomSwapIterator<Move, SubChain>(leftSubChainSelector, rightSubChainSelector) {
@Override
protected Move newSwapSelection(SubChain leftSubSelection, SubChain rightSubSelection) {
boolean reversing = selectReversingMoveToo && workingRandom.nextBoolean();
return reversing
? new SubChainReversingSwapMove(variableDescriptor, inverseVariableSupply, leftSubSelection, rightSubSelection)
: new SubChainSwapMove(variableDescriptor, inverseVariableSupply, leftSubSelection, rightSubSelection);
}
};
}
}
@Override
public String toString() {
return getClass().getSimpleName() + "(" + leftSubChainSelector + ", " + rightSubChainSelector + ")";
}
}
| [
"gds.geoffrey.de.smet@gmail.com"
] | gds.geoffrey.de.smet@gmail.com |
dcbd029153a3dd665d64a3f94f8aa598618da55e | 75492a81937a601169704aea7e33f274664793eb | /src/imooc/designPattern/proxy1/Moveable.java | 74837ff962d271325b4fe880edae088d77a685a9 | [] | no_license | guochan007/JavaStudy | 7b59faca6f5ad11987b61e9fd3272e057a4facbd | 2acdac83e67d8427b8ad5c674076f4533b91e049 | refs/heads/master | 2020-04-06T07:02:43.464625 | 2016-10-27T11:54:28 | 2016-10-27T11:54:28 | 40,290,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 81 | java | package imooc.designPattern.proxy1;
public interface Moveable {
void move();
}
| [
"2269029482@qq.com"
] | 2269029482@qq.com |
7db50627ac263de9366a61e1d10d52d93b35ddee | 5cc0f5b57c1d8f3e63f859b9ade1f46bdbe06b14 | /app/src/main/java/com/example/fronoman/mentorize/Appointment.java | 41b07938fff6ddfeb941edb097d7587e4eb617b7 | [] | no_license | FronTexas/Mentorize | f01371c6ca905bcd6ff432eca7c36e1a36065138 | 042e40514a3fdb3ba55fd6bc6005d037f965220b | refs/heads/master | 2021-01-22T10:08:00.555779 | 2015-03-01T18:05:58 | 2015-03-01T18:05:58 | 31,492,255 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,585 | java | package com.example.fronoman.mentorize;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.ArrayList;
/**
* Created by Fahran on 2/19/2015.
*/
public class Appointment implements Parcelable {
User user;
String expertise;
ArrayList<User> invited_user;
String dayAndDate;
String startEndTime;
String location;
public static final Creator<Appointment> CREATOR = new Creator<Appointment>(){
@Override
public Appointment createFromParcel(Parcel source) {
return new Appointment(source);
}
@Override
public Appointment[] newArray(int size) {
return new Appointment[size];
}
};
public Appointment(Parcel in){
user = in.readParcelable(getClass().getClassLoader());
expertise = in.readString();
in.readTypedList(invited_user,User.CREATOR);
dayAndDate = in.readString();
startEndTime = in.readString();
location = in.readString();
}
public Appointment(User user){
this.user = user;
invited_user = new ArrayList<>();
if(user instanceof Tutor)
expertise = ((Tutor)user).skills;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeParcelable(user,0);
out.writeString(expertise);
out.writeTypedList(invited_user);
out.writeString(dayAndDate);
out.writeString(startEndTime);
out.writeString(location);
}
}
| [
"forfron@gmail.com"
] | forfron@gmail.com |
b5c4d5c12dfd46845a6668bd2ffcb62475c16621 | 68315589031c1c2a0d3f99c7190147eff88064a1 | /camus-etl-kafka/src/test/java/com/linkedin/camus/etl/kafka/mapred/EtlMultiOutputCommitterTest.java | 1ce63f76a20b0c53cdc63336b081a7e896b300bd | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-public-domain",
"MIT"
] | permissive | confluentinc/camus | 852014606f71bdf94c17cee06882f9773936cc88 | e68a3084a97a73f73d01323302e82702d73e51da | refs/heads/confluent-master | 2023-08-28T04:59:37.052028 | 2023-06-12T03:34:33 | 2023-06-12T03:34:33 | 29,898,124 | 104 | 85 | Apache-2.0 | 2023-06-12T03:34:34 | 2015-01-27T04:58:55 | Java | UTF-8 | Java | false | false | 5,062 | java | //package com.linkedin.camus.etl.kafka.mapred;
//
//
//import com.linkedin.camus.coders.Partitioner;
//import com.linkedin.camus.etl.IEtlKey;
//import com.linkedin.camus.etl.kafka.coders.DefaultPartitioner;
//import com.linkedin.camus.etl.kafka.common.DateUtils;
//import com.linkedin.camus.etl.kafka.common.EtlKey;
//import org.apache.hadoop.conf.Configuration;
//import org.apache.hadoop.mapred.TaskAttemptID;
//import org.apache.hadoop.mapreduce.JobContext;
//import org.apache.hadoop.mapreduce.TaskAttemptContext;
//import org.junit.After;
//import org.junit.Before;
//import org.junit.Test;
//
//import java.io.IOException;
//
//import static junit.framework.Assert.assertEquals;
//import static junit.framework.Assert.assertTrue;
//
//public class EtlMultiOutputCommitterTest implements Partitioner {
//
// TaskAttemptContext taskAttemptContext;
// EtlMultiOutputFormat etlMultiOutputFormat;
// EtlMultiOutputFormat.EtlMultiOutputCommitter committer;
// Configuration configuration;
//
// @Before
// public void setup() throws IOException {
// configuration = new Configuration();
// configuration.set(EtlMultiOutputFormat.ETL_DEFAULT_PARTITIONER_CLASS, "com.linkedin.camus.etl.kafka.coders.DefaultPartitioner");
// taskAttemptContext = new TaskAttemptContext(configuration, new TaskAttemptID());
// etlMultiOutputFormat = new EtlMultiOutputFormat();
// committer = (EtlMultiOutputFormat.EtlMultiOutputCommitter) etlMultiOutputFormat.getOutputCommitter(taskAttemptContext);
// }
//
// @After
// public void tearDown() {
// EtlMultiOutputFormat.resetPartitioners();
// }
//
// @Test
// public void testWorkingFilenameIsCorrectUsingDefaultPartitioner() throws IOException {
// long now = System.currentTimeMillis();
// EtlKey key = new EtlKey("topic", "1", 0);
// key.setTime(now);
//
// assertEquals("data.topic.1.0." + convertTime(now), etlMultiOutputFormat.getWorkingFileName(taskAttemptContext, key));
// }
//
// @Test
// public void testWorkingFilenameRemovesDotsFromTopicName() throws IOException {
// long now = System.currentTimeMillis();
// EtlKey key = new EtlKey("topic.name", "1", 0);
// key.setTime(now);
//
// assertEquals("data.topic_name.1.0." + convertTime(now), etlMultiOutputFormat.getWorkingFileName(taskAttemptContext, key));
// }
//
// @Test
// public void testPartitionedFilenameIsCorrectUsingDefaultPartitioner() throws IOException {
// String workingFilename = "data.topic-name.1.0.1361656800000-m-00000.avro";
// assertEquals("topic-name/hourly/2013/02/23/14/topic-name.1.0.10.10000.avro",
// committer.getPartitionedPath(taskAttemptContext, workingFilename, 10, 10000));
// }
//
// @Test
// public void testDefaultPartitionerIsTheDefault() {
// assertTrue(EtlMultiOutputFormat.getDefaultPartitioner(taskAttemptContext) instanceof DefaultPartitioner);
// }
//
// @Test
// public void testConfiguredDefaultPartitionerIsCorrect() throws ClassNotFoundException {
// taskAttemptContext.getConfiguration().set(EtlMultiOutputFormat.ETL_DEFAULT_PARTITIONER_CLASS,
// "com.linkedin.camus.etl.kafka.mapred.EtlMultiOutputCommitterTest");
// assertTrue(EtlMultiOutputFormat.getDefaultPartitioner(taskAttemptContext) instanceof EtlMultiOutputCommitterTest);
// }
//
// @Test
// public void testPerTopicPartitioner() throws IOException {
// taskAttemptContext.getConfiguration().set(EtlMultiOutputFormat.ETL_DEFAULT_PARTITIONER_CLASS + ".test-topic",
// "com.linkedin.camus.etl.kafka.mapred.EtlMultiOutputCommitterTest");
// assertTrue(EtlMultiOutputFormat.getDefaultPartitioner(taskAttemptContext) instanceof DefaultPartitioner);
// assertTrue(EtlMultiOutputFormat.getPartitioner(taskAttemptContext, "unknown-topic") instanceof DefaultPartitioner);
// assertTrue(EtlMultiOutputFormat.getPartitioner(taskAttemptContext, "test-topic") instanceof EtlMultiOutputCommitterTest);
// }
//
// @Test
// public void testDefaultOutputCodecIsDeflate() {
// assertEquals("deflate", EtlMultiOutputFormat.getEtlOutputCodec(taskAttemptContext));
// }
//
// @Test
// public void testSetOutputCodec() {
// EtlMultiOutputFormat.setEtlOutputCodec(taskAttemptContext, "snappy");
// assertEquals("snappy", EtlMultiOutputFormat.getEtlOutputCodec(taskAttemptContext));
// }
//
// public long convertTime(long time) {
// long outfilePartitionMs = EtlMultiOutputFormat.getEtlOutputFileTimePartitionMins(taskAttemptContext) * 60000L;
// return DateUtils.getPartition(outfilePartitionMs, time);
// }
//
// @Override
// public String encodePartition(JobContext context, IEtlKey etlKey) {
// return null;
// }
//
// @Override
// public String generatePartitionedPath(JobContext context, String topic, int brokerId, int partitionId, String encodedPartition) {
// return null;
// }
//}
| [
"ggupta@linkedin.com"
] | ggupta@linkedin.com |
6d4c1f3cb46b233ac4391615b8c11c8095b062ac | c672b547ba9837f347b60c082c4f15c7cf9cb1f2 | /app/server/runtime/src/test/java/io/syndesis/server/runtime/migrations/MigrationsHelper.java | 78bf2da4032f09727f09eb2f7828ea918ea3fb05 | [
"Apache-2.0"
] | permissive | aidenkeating/syndesis | 19c818b5b01931d4bda6dadff99b634a8c056371 | 429bc81eb6990fcfa54583eaac8d2eec64e3fdf0 | refs/heads/master | 2020-08-02T20:17:29.735984 | 2019-09-27T21:15:36 | 2019-09-27T21:15:36 | 211,491,558 | 0 | 0 | Apache-2.0 | 2019-09-28T11:42:02 | 2019-09-28T11:42:02 | null | UTF-8 | Java | false | false | 1,482 | java | /*
* Copyright (C) 2016 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.syndesis.server.runtime.migrations;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import io.syndesis.common.util.Json;
import io.syndesis.server.jsondb.JsonDB;
final class MigrationsHelper {
static <T> List<T> load(final JsonDB jsondb, final String path, final Class<T> type) throws IOException {
final List<T> items = new ArrayList<>();
final String raw = jsondb.getAsString(path);
Json.reader().readTree(raw).fieldNames().forEachRemaining(id -> {
try {
final String itemRaw = jsondb.getAsString(path + "/" + id);
final T item = Json.reader().forType(type).readValue(itemRaw);
items.add(item);
} catch (final IOException e) {
throw new RuntimeException();
}
});
return items;
}
}
| [
"zoran@regvart.com"
] | zoran@regvart.com |
7773ba31758d7b3f8d71792cde89c75a8aad20a7 | 1420d89871285c2e6b7dedba4e893bd42deaf332 | /src/main/java/com/drug/store/interceptor/SessionInterceptor.java | 28f3fa3511076ea32363fa3b60c0e814b7bafc4d | [] | no_license | zhouqiao1984/drugstore | ae9725432ec67bd707f4575e61a6c98bcd071ea8 | deae7870288de707c298e335637a39c78ab694f9 | refs/heads/master | 2020-03-18T01:39:57.569295 | 2018-05-24T14:18:48 | 2018-05-24T14:18:48 | 134,153,348 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,228 | java | package com.drug.store.interceptor;
import com.drug.store.util.Constant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.List;
/**
* Created by root on 2016/8/17/0017.
*/
public class SessionInterceptor implements HandlerInterceptor{
private static final Logger logger = LoggerFactory.getLogger(SessionInterceptor.class);
private List<String> excludeMappingUrl;
public List<String> getExcludeMappingUrl() {
return excludeMappingUrl;
}
public void setExcludeMappingUrl(List<String> excludeMappingUrl) {
this.excludeMappingUrl = excludeMappingUrl;
}
private ThreadLocal<Long> dealTimeThreadLoacal = new ThreadLocal();
public boolean isStaticFile(String url){
if (!StringUtils.isEmpty(url)){
int i = url.lastIndexOf(".");
String postFix = null;
if (i>-1){
postFix = url.substring(i);
//System.out.println("url: "+postFix);
}
if (!StringUtils.isEmpty(postFix)&&excludeMappingUrl.contains(postFix)){
return true;
}
}
return false;
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
long startTime = System.currentTimeMillis();
dealTimeThreadLoacal.set(startTime);
String url = request.getRequestURI();
//System.out.println("url: "+url);
boolean result = isStaticFile(url);
if (result) {
return true;
}else{
if (!url.contains("/user/login")){
HttpSession session = request.getSession();
//System.out.println("验证session之前");
if (session.getAttribute(Constant.USERINFO)==null){
//System.out.println("验证session之后");
response.sendRedirect("/session/error");
return false;
}
return true;
}
}
return true;
}
@Override
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
boolean result = isStaticFile(request.getRequestURI());
if (!result){
long endTime = System.currentTimeMillis();
long startTime = dealTimeThreadLoacal.get();
logger.info("本次请求["+request.getRequestURI()+"]处理时间:"+(endTime-startTime)+"ms");
}
//super.afterCompletion(request, response, handler, ex);
}
}
| [
"Administrator@UXFUIUDSZYNQ7VD"
] | Administrator@UXFUIUDSZYNQ7VD |
e7627e50f6d2f3665660062439c2b5934ea0398e | 9371ae6ec24ad4b9914a43e64befb915d71e34f2 | /out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/src/android/util/Log.java | 09035c7cad0e621a005e8d89599c3a0175b5ddae | [] | no_license | kanaida/LG-Esteem-Homeless-Kernel | 9fac4c52993798eaf3021d9abb72a5e697464398 | a5780f82bef7631fdb43b079e6f9ea6dbd187ac7 | refs/heads/master | 2020-06-09T06:14:50.214296 | 2012-02-24T04:23:01 | 2012-02-24T04:23:01 | 3,532,548 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,263 | java | package android.util;
public final class Log
{
Log() { throw new RuntimeException("Stub!"); }
public static int v(java.lang.String tag, java.lang.String msg) { throw new RuntimeException("Stub!"); }
public static int v(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static int d(java.lang.String tag, java.lang.String msg) { throw new RuntimeException("Stub!"); }
public static int d(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static int i(java.lang.String tag, java.lang.String msg) { throw new RuntimeException("Stub!"); }
public static int i(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static int w(java.lang.String tag, java.lang.String msg) { throw new RuntimeException("Stub!"); }
public static int w(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static native boolean isLoggable(java.lang.String tag, int level);
public static int w(java.lang.String tag, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static int e(java.lang.String tag, java.lang.String msg) { throw new RuntimeException("Stub!"); }
public static int e(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static int wtf(java.lang.String tag, java.lang.String msg) { throw new RuntimeException("Stub!"); }
public static int wtf(java.lang.String tag, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static int wtf(java.lang.String tag, java.lang.String msg, java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static java.lang.String getStackTraceString(java.lang.Throwable tr) { throw new RuntimeException("Stub!"); }
public static int println(int priority, java.lang.String tag, java.lang.String msg) { throw new RuntimeException("Stub!"); }
public static final int VERBOSE = 2;
public static final int DEBUG = 3;
public static final int INFO = 4;
public static final int WARN = 5;
public static final int ERROR = 6;
public static final int ASSERT = 7;
}
| [
"kanaida.bat@gmail.com"
] | kanaida.bat@gmail.com |
16833f792ed79ea1f6f9d289ae41ac18fd645e8c | 796d6a7e44bd97c36ac312e1549a076675d21be6 | /src/main/java/com/example/ERP_NEW/services/Course_Schedule.java | a45690b81b32d8512d5b90451139907c3ea62a48 | [] | no_license | anshul1927/ERP_NEW | 8dcc2a4c26e87509e31bdc75e01c89718c3a826d | bd512acf4972dd4fe3448616908253e50e4608b2 | refs/heads/master | 2023-02-03T00:39:54.177245 | 2020-12-21T19:30:25 | 2020-12-21T19:31:05 | 322,069,730 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 72 | java | package com.example.ERP_NEW.services;
public class Course_Schedule {
}
| [
"63929895+khandya1@users.noreply.github.com"
] | 63929895+khandya1@users.noreply.github.com |
7460a5a2492dcede32d98d13f50d2a973a8dd8d7 | 533583f049ecafef6435c99edafe8e27fe707770 | /doitjava/src/chapter13/LocalInnerTest.java | c1cdcf4606858f02d96a300ea940be6cce5d3473 | [] | no_license | hyeonjeongDev/doitjava | a84a8e7465c4ce174e9f5d78d576fc4a8d5a7b7b | 595391d37c7ef2a0316587aa161a981c36e368db | refs/heads/master | 2022-12-26T18:17:34.653710 | 2020-10-06T07:06:44 | 2020-10-06T07:06:44 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 812 | java | package chapter13;
class Outer {
int outNum = 100;
static int sNum = 200;
Runnable getRunnable(int i) {
int num = 100;
class MyRunnable implements Runnable {
int localNum = 10;
@Override
public void run() {
// num = 200;
// i = 100;
System.out.println("i = " + i);
System.out.println("num = " + num);
System.out.println("localNum = " + localNum);
System.out.println("outNum = " + outNum + "(외부 클래스 인스턴스 변수)");
System.out.println("Outer.sNum = " + Outer.sNum + "(외부 클래스 정적 변수)");
}
}
return new MyRunnable();
}
}
public class LocalInnerTest {
public static void main(String[] args) {
Outer out = new Outer();
Runnable runner = out.getRunnable(10);
runner.run();
}
}
| [
"seohyeonjeong.dev@gmail.com"
] | seohyeonjeong.dev@gmail.com |
c9cb19dbd798f0f6cc69ea83105d0f89c4428353 | be679a2f73ac352b78578e98612c3fe2a1316bf1 | /compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/typeinfo/builtin/BinaryTypeInfoProducer.java | c9eca914a6128966da3b792d2360cd9daf8f107c | [
"BSD-2-Clause"
] | permissive | scodeman/jsonix-schema-compiler | 302602a3e603ac5583f3704f69f1ca1aac9c5835 | 7c322faf87c8589c79d6eb24c84c4deaeef70f00 | refs/heads/master | 2022-11-18T13:30:43.654933 | 2020-06-29T13:27:15 | 2020-06-29T13:27:15 | 263,977,075 | 0 | 0 | BSD-2-Clause | 2020-06-29T13:27:17 | 2020-05-14T17:10:17 | Java | UTF-8 | Java | false | false | 935 | java | package org.hisrc.jsonix.compilation.jsonschema.typeinfo.builtin;
import javax.json.JsonArrayBuilder;
import javax.json.JsonValue;
import javax.xml.namespace.QName;
import org.hisrc.jsonix.compilation.jsonschema.JsonSchemaMappingCompiler;
import org.hisrc.jsonix.compilation.jsonschema.typeinfo.BuiltinLeafInfoProducer;
public abstract class BinaryTypeInfoProducer<T, C extends T, O> extends BuiltinLeafInfoProducer<T, C, O> {
public BinaryTypeInfoProducer(QName qualifiedName) {
super(qualifiedName);
}
@Override
public JsonValue createValue(JsonSchemaMappingCompiler<T, C> mappingCompiler, String item) {
final JsonArrayBuilder arrayBuilder = mappingCompiler.getJsonBuilderFactory().createArrayBuilder();
final byte[] value = parse(item);
for (final byte b : value) {
final int v = b >= 0 ? b : b + 256;
arrayBuilder.add(v);
}
return arrayBuilder.build();
}
public abstract byte[] parse(String item);
}
| [
"aleksei.valikov@gmail.com"
] | aleksei.valikov@gmail.com |
6da73776d71202d2a0d33b9f43608fa081ef6419 | 15f0c0e81f2592db41bbfcd6561e85ab5e6072f8 | /quizschedule.java | 231acdd931b0d0f15d0917cbfe6ffc4eae8c2676 | [] | no_license | mkargar9/quizretakes | d1aa7d481cc860f1eb6b7344e00e73a769ac68fa | e0261368ff1b6d22aa454b58b10453e2341cc016 | refs/heads/master | 2020-04-19T15:27:53.721924 | 2019-01-30T03:52:10 | 2019-01-30T03:52:10 | 168,275,168 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,028 | java | // JO 3-Jan-2019
package quizretakes;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
import java.io.IOException;
import java.io.PrintWriter;
import javax.xml.parsers.ParserConfigurationException;
import java.util.ArrayList;
import java.time.*;
import java.lang.Long;
import java.lang.String;
import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;
/**
* @author Jeff Offutt
* Date: January, 2019
*
* Wiring the pieces together:
* quizschedule.java -- Servlet entry point for students to schedule quizzes
* quizReader.java -- reads XML file and stores in quizzes.
Used by quizschedule.java
* quizzes.java -- A list of quizzes from the XML file
* Used by quizschedule.java
* quizBean.java -- A simple quiz bean
* Used by quizzes.java and readQuizzesXML.java
* retakesReader.java -- reads XML file and stores in retakes.
Used by quizschedule.java
* retakes.java -- A list of retakes from the XML file
* Used by quizschedule.java
* retakeBean.java -- A simple retake bean
* Used by retakes.java and readRetakesXML.java
* apptBean.java -- A bean to hold appointments
* quizzes.xml -- Data file of when quizzes were given
* retakes.xml -- Data file of when retakes are given
*/
public class quizschedule extends HttpServlet
{
// Data files
// location maps to /webapps/offutt/WEB-INF/data/ from a terminal window.
// These names show up in all servlets
private static final String dataLocation = "/var/www/CS/webapps/offutt/WEB-INF/data/";
static private final String separator = ",";
private static final String courseBase = "course";
private static final String quizzesBase = "quiz-orig";
private static final String retakesBase = "quiz-retakes";
private static final String apptsBase = "quiz-appts";
// Filenames to be built from above and the courseID parameter
private String courseFileName;
private String quizzesFileName;
private String retakesFileName;
private String apptsFileName;
// Passed as parameter and stored in course.xml file (format: "swe437")
private String courseID;
// Stored in course.xml file, default 14
// Number of days a retake is offered after the quiz is given
private int daysAvailable = 14;
// To be set by getRequestURL()
private String thisServlet = "";
// doGet() : Prints the form to schedule a retake
@Override
protected void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType ("text/html");
PrintWriter out = response.getWriter ();
servletUtils.printHeader (out);
// Whoami? (Used in form)
thisServlet = (request.getRequestURL()).toString();
// CS server has a flaw--requires https & 8443, but puts http & 8080 on the requestURL
thisServlet = thisServlet.replace("http", "https");
thisServlet = thisServlet.replace("8080", "8443");
// CourseID must be a parameter (also in course XML file, but we need to know which course XML file ...)
courseID = request.getParameter("courseID");
if (courseID != null && !courseID.isEmpty())
{ // If not, ask for one.
courseBean course;
courseReader cr = new courseReader();
courseFileName = dataLocation + courseBase + "-" + courseID + ".xml";
try {
course = cr.read(courseFileName);
} catch (Exception e) {
String message = "<p>Can't find the data files for course ID " + courseID + ". You can try again.";
servletUtils.printNeedCourseID (out, thisServlet, message);
servletUtils.printFooter (out);
return;
}
daysAvailable = Integer.parseInt(course.getRetakeDuration());
// Filenames to be built from above and the courseID
String quizzesFileName = dataLocation + quizzesBase + "-" + courseID + ".xml";
String retakesFileName = dataLocation + retakesBase + "-" + courseID + ".xml";
String apptsFileName = dataLocation + apptsBase + "-" + courseID + ".txt";
// Load the quizzes and the retake times from disk
quizzes quizList = new quizzes();
retakes retakesList = new retakes();
quizReader qr = new quizReader();
retakesReader rr = new retakesReader();
try { // Read the files and print the form
quizList = qr.read (quizzesFileName);
retakesList = rr.read (retakesFileName);
printQuizScheduleForm (out, quizList, retakesList, course);
} catch (Exception e)
{
String message = "<p>Can't find the data files for course ID " + courseID + ". You can try again.";
servletUtils.printNeedCourseID (out, thisServlet, message);
}
}
else
{
servletUtils.printNeedCourseID (out, thisServlet, "");
}
servletUtils.printFooter (out);
}
// doPost saves an appointment in a file and prints an acknowledgement
@Override
protected void doPost (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
// No saving if IOException
boolean IOerrFlag = false;
String IOerrMessage = "";
// Filename to be built from above and the courseID
courseID = request.getParameter("courseID");
String apptsFileName = dataLocation + apptsBase + "-" + courseID + ".txt";
// Get name and list of retake requests from parameters
String studentName = request.getParameter ("studentName");
String[] allIDs = request.getParameterValues ("retakeReqs");
response.setContentType ("text/html");
PrintWriter out = response.getWriter ();
servletUtils.printHeader (out);
out.println ("<body bgcolor=\"#DDEEDD\">");
if(allIDs != null && studentName != null && studentName.length() > 0)
{
// Append the new appointment to the file
try {
File file = new File(apptsFileName);
synchronized(file)
{ // Only one student should touch this file at a time.
if (!file.exists())
{
file.createNewFile();
}
FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); //append mode
BufferedWriter bw = new BufferedWriter(fw);
for(String oneIDPair : allIDs)
{
bw.write(oneIDPair + separator + studentName + "\n");
}
bw.flush();
bw.close();
} // end synchronize block
} catch (IOException e) {
IOerrFlag = true;
IOerrMessage = "I failed and could not save your appointment." + e;
}
// Respond to the student
if (IOerrFlag)
{
out.println ("<p>");
out.println (IOerrMessage);
} else {
out.println ("<p>");
if (allIDs.length == 1)
out.println (studentName + ", your appointment has been scheduled.");
else
out.println (studentName + ", your appointments have been scheduled.");
out.println ("<p>Please arrive in time to finish the quiz before the end of the retake period.");
out.println ("<p>If you cannot make it, please cancel by sending email to your professor.");
}
} else { // allIDs == null or name is null
out.println ("<body bgcolor=\"#DDEEDD\">");
if(allIDs == null)
out.println ("<p>You didn't choose any quizzes to retake.");
if(studentName == null || studentName.length() == 0)
out.println ("<p>You didn't give a name ... no anonymous quiz retakes.");
thisServlet = (request.getRequestURL()).toString();
// CS server has a flaw--requires https & 8443, but puts http & 8080 on the requestURL
thisServlet = thisServlet.replace("http", "https");
thisServlet = thisServlet.replace("8080", "8443");
out.println("<p><a href='" + thisServlet + "?courseID=" + courseID + "'>You can try again if you like.</a>");
}
servletUtils.printFooter (out);
}
/**
* Print the body of HTML
* @param out PrintWriter
* @throws ServletException
* @throws IOException
*/
private void printQuizScheduleForm (PrintWriter out, quizzes quizList, retakes retakesList, courseBean course)
throws ServletException, IOException
{
// Check for a week to skip
boolean skip = false;
LocalDate startSkip = course.getStartSkip();
LocalDate endSkip = course.getEndSkip();
boolean retakePrinted = false;
out.println ("<body onLoad=\"setFocusMain()\" bgcolor=\"#DDEEDD\">");
out.println ("");
out.println ("<center><h2>GMU quiz retake scheduler for class " + course.getCourseTitle() + "</h2></center>");
out.println ("<hr/>");
out.println ("");
// print the main form
out.println ("<form name='quizSchedule' method='post' action='" + thisServlet + "?courseID=" + courseID + "' >");
out.print (" <p>You can sign up for quiz retakes within the next two weeks. ");
out.print ("Enter your name (as it appears on the class roster), ");
out.println ("then select which date, time, and quiz you wish to retake from the following list.");
out.println (" <br/>");
LocalDate today = LocalDate.now();
LocalDate endDay = today.plusDays(new Long(daysAvailable));
LocalDate origEndDay = endDay;
// if endDay is between startSkip and endSkip, add 7 to endDay
if (!endDay.isBefore(startSkip) && !endDay.isAfter(endSkip))
{ // endDay is in a skip week, add 7 to endDay
endDay = endDay.plusDays(new Long(7));
skip = true;
}
out.print (" <p>Today is ");
out.println ((today.getDayOfWeek()) + ", " + today.getMonth() + " " + today.getDayOfMonth() );
out.print (" <p>Currently scheduling quizzes for the next two weeks, until ");
out.println ((endDay.getDayOfWeek()) + ", " + endDay.getMonth() + " " + endDay.getDayOfMonth() );
out.println (" <br/>");
out.print (" <p>Name: ");
out.println (" <input type='text' id='studentName' name='studentName' size='50' />");
out.println (" <br/>");
out.println (" <br/>");
out.println (" <table border=1 style='background-color:#99dd99'><tr><td>"); // outer table for borders
out.println (" <tr><td>");
for(retakeBean r: retakesList)
{
LocalDate retakeDay = r.getDate();
if (!(retakeDay.isBefore (today)) && !(retakeDay.isAfter (endDay)))
{
// if skip && retakeDay is after the skip week, print a white bg message
if (skip && retakeDay.isAfter(origEndDay))
{ // A "skip" week such as spring break.
out.println (" <table border=1 width=100% style='background-color:white'>"); // inner table to format skip week
out.println (" <tr><td>Skipping a week, no quiz or retakes.");
out.println (" </table>"); // inner table for skip week
// Just print for the FIRST retake day after the skip week
skip = false;
}
retakePrinted = true;
out.println (" <table width=100%>"); // inner table to format one retake
// format: Friday, January 12, at 10:00am in EB 4430
out.println (" <tr><td>" + retakeDay.getDayOfWeek() + ", " +
retakeDay.getMonth() + " " +
retakeDay.getDayOfMonth() + ", at " +
r.timeAsString() + " in " +
r.getLocation());
for(quizBean q: quizList)
{
LocalDate quizDay = q.getDate();
LocalDate lastAvailableDay = quizDay.plusDays(new Long(daysAvailable));
// To retake a quiz on a given retake day, the retake day must be within two ranges:
// quizDay <= retakeDay <= lastAvailableDay --> (!quizDay > retakeDay) && !(retakeDay > lastAvailableDay)
// today <= retakeDay <= endDay --> !(today > retakeDay) && !(retakeDay > endDay)
if (!quizDay.isAfter(retakeDay) && !retakeDay.isAfter(lastAvailableDay) &&
!today.isAfter(retakeDay) && !retakeDay.isAfter(endDay))
{
out.println (" <tr><td align='right'><label for='q" + q.getID() + "r" + r.getID() + "'>Quiz " + q.getID() + " from " + quizDay.getDayOfWeek() + ", " + quizDay.getMonth() + " " + quizDay.getDayOfMonth() + ":</label> ");
// Value is "retakeID:quiziD"
out.println (" <td><input type='checkbox' name='retakeReqs' value='" + r.getID() + separator + q.getID() + "' id='q" + q.getID() + "r" + r.getID() + "'>");
}
}
}
if (retakePrinted)
{
out.println (" </table>");
out.println (" <tr><td>");
retakePrinted = false;
}
}
out.println (" <tr><td align='middle'><button id='submitRequest' type='submit' name='submitRequest' style='font-size:large'>Submit request</button>");
out.println (" </table>");
out.println ("</form>");
out.println ("<br/>");
out.println ("<br/>");
out.println ("<br/>");
out.println ("<br/>");
out.println ("<table border=1>");
out.println ("<tr><td align='middle'>All quiz retake opportunities</td></tr>");
for(retakeBean r: retakesList)
{
out.print (" <tr><td>");
out.print (r);
out.println (" </td></td>");
}
out.println ("</table>");
}
} // end quizschedule class
| [
"noreply@github.com"
] | mkargar9.noreply@github.com |
e963b6c9b68bc1a1e67cea32e33f049314ee2a1a | 8be7895d659a89478451e1c18bc1956056ccbce0 | /src/main/java/com/etc/biz/CustomerBiz.java | 2fa9e7c1c63b0a88f4e07b24fb72eb67226cff99 | [] | no_license | skyofme/OrderFood | abfdfd81452534ba0e6bca6ea521d94bde8f5a5e | 5774df2ae1119107a21d0578360c6c1da0b626ff | refs/heads/master | 2020-04-26T02:20:14.192532 | 2019-03-01T04:02:43 | 2019-03-01T04:02:43 | 173,232,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,180 | java | package com.etc.biz;
import java.util.List;
import com.etc.entity.Customer;
import com.etc.entity.Employee;
import com.etc.entity.Order;
/*
* Customer的业务逻辑层
* 这里提供了顾客对外的一系列方法
* */
public interface CustomerBiz {
//判断是否添加顾客成功
public Boolean addCustomer(Customer customer);
//判断用户名是否已经被注册
public Boolean findCustomerByName(String c_name);
//判断用户输入的账号密码是否是正确的
public List<Customer> findCustomer(String cName,String cPswd);
//判断员工输入的账号密码是否正确
public List<Employee> findEmp(String cName,String cPswd);
//通过id查询员工的方法
public Employee findEmployeeById(Integer eId);
//通过id查询顾客的方法
public Customer findCustomerById(Integer eId);
//修改customer并返回
public void updateCustomer(Customer customer);
//修改Employee并返回
public void updateEmployee(Employee employee);
//查询到订单的信息并且返还
public List<Order> showOrder(Integer cId);
//查询到订单的信息并且返还缩略版
public List<Order> showLittleOrder(Integer cId);
}
| [
"luogan007@gmail.com"
] | luogan007@gmail.com |
f8f4e7c9621215862bc8ed0f9cddb5557ddf23b0 | 9b3f59bcbce4420c0680f8c2ab2dba117c0b39de | /app/src/main/java/io/rong/app/utils/Constants.java | 20880231e1ef0e5890d4a2636cac0e8828df1721 | [
"MIT"
] | permissive | brooksgod/demo-app-android-v2 | 23ad43f7f7a92621802d8b08cb206b81be76e30d | 62c1045e38cabd5129e55c03b07c3078f85b64de | refs/heads/master | 2020-12-26T00:18:28.374572 | 2015-06-03T03:45:06 | 2015-06-03T03:45:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 699 | java | package io.rong.app.utils;
/**
* Created by Bob on 2015/4/17.
*/
public class Constants {
public static final String DEBUG = "-bob test-----";
//新的好友
public static final int FRIENDLIST_REQUESTCODE = 1001;
//搜索
public static final int SEARCH_REQUESTCODE = 1002;
//添加好友
public static final int PERSONAL_REQUESTCODE = 1003;
//加入群组
public static final int GROUP_JOIN_REQUESTCODE = 1004;
//退出群组
public static final int GROUP_QUIT_REQUESTCODE = 1005;
//修改用户名称
public static final int FIX_USERNAME_REQUESTCODE = 1006;
//删除好友
public static final int DELETE_USERNAME_REQUESTCODE = 1007;
}
| [
"ityangb@163.com"
] | ityangb@163.com |
bee18386ec8b41fb43e3ef8929f53070ebd30cca | 3c361e75f6b5ce942ee4bf0ddea98b79d7d21b33 | /src/java/model/Products.java | 9f0bdfd31b7078db73fcfdff569ffe8dfdc07262 | [] | no_license | HHungg/Fashion-Recommendation-Rule | ad49ef8f8754f8aaa471d083fae54fc6234f84aa | a007609d03c0beadb9db3f91be364c24a0aee546 | refs/heads/master | 2020-03-19T18:18:13.170265 | 2018-06-11T02:04:23 | 2018-06-11T02:04:23 | 136,803,616 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,916 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package model;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
/**
*
* @author Nhom10_HCSTT
*/
public class Products {
private String PID;
private String PName;
private int inputPrice; // giá nhập vào
private int PPirce; // giá bán ra
private String Img;
private int SID;
private String CategoryId;
private String PDescription;
private String supplyName;
private String categoryName;
private String supplyAddress;
public Products(String PID, String PName, int inputPirce, int PPirce, String Img, int SID, String CategoryId, String PDescription) {
this.PID = PID;
this.PName = PName;
this.inputPrice = inputPirce ;
this.PPirce = PPirce;
this.Img = Img;
this.SID = SID;
this.CategoryId = CategoryId;
this.PDescription = PDescription;
}
public Products() {
}
public int getInputPrice() {
return inputPrice;
}
public void setInputPrice(int inputPrice) {
this.inputPrice = inputPrice;
}
public String getSupplyName() {
return supplyName;
}
public void setSupplyName(String supplyName) {
this.supplyName = supplyName;
}
public String getSupplyAddress() {
return supplyAddress;
}
public void setSupplyAddress(String supplyAddress) {
this.supplyAddress = supplyAddress;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getPID() {
return PID;
}
public String getPName() {
return PName;
}
public int getPPirce() {
return PPirce;
}
public String getImg() {
return Img;
}
public int getSID() {
return SID;
}
public String getCategoryId() {
return CategoryId;
}
public void setPID(String PID) {
this.PID = PID;
}
public void setPName(String PName) {
this.PName = PName;
}
public void setPPirce(int PPirce) {
this.PPirce = PPirce;
}
public void setImg(String Img) {
this.Img = Img;
}
public void setSID(int SID) {
this.SID = SID;
}
public void setCategoryId(String CategoryId) {
this.CategoryId = CategoryId;
}
public String getPDescription() {
return PDescription;
}
public void setPDescription(String PDescription) {
this.PDescription = PDescription;
}
}
| [
"noreply@github.com"
] | HHungg.noreply@github.com |
c84cb712d8464ae658a431e198096d9c254abfad | 4d6f449339b36b8d4c25d8772212bf6cd339f087 | /netreflected/src/Framework/System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a/system/web/configuration/MachineKeyValidationConverter.java | 6ba57835ac67343e8f895d70f092ee68a5cb5d34 | [
"MIT"
] | permissive | lvyitian/JCOReflector | 299a64550394db3e663567efc6e1996754f6946e | 7e420dca504090b817c2fe208e4649804df1c3e1 | refs/heads/master | 2022-12-07T21:13:06.208025 | 2020-08-28T09:49:29 | 2020-08-28T09:49:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,809 | java | /*
* MIT License
*
* Copyright (c) 2020 MASES s.r.l.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**************************************************************************************
* <auto-generated>
* This code was generated from a template using JCOReflector
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
* </auto-generated>
*************************************************************************************/
package system.web.configuration;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.configuration.ConfigurationConverterBase;
import system.componentmodel.ITypeDescriptorContext;
import system.componentmodel.ITypeDescriptorContextImplementation;
import system.globalization.CultureInfo;
/**
* The base .NET class managing System.Web.Configuration.MachineKeyValidationConverter, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Extends {@link NetObject}.
* <p>
*
* See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Web.Configuration.MachineKeyValidationConverter" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Web.Configuration.MachineKeyValidationConverter</a>
*/
public class MachineKeyValidationConverter extends ConfigurationConverterBase {
/**
* Fully assembly qualified name: System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
*/
public static final String assemblyFullName = "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
/**
* Assembly name: System.Web
*/
public static final String assemblyShortName = "System.Web";
/**
* Qualified class name: System.Web.Configuration.MachineKeyValidationConverter
*/
public static final String className = "System.Web.Configuration.MachineKeyValidationConverter";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName));
} catch (JCException e) {
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public MachineKeyValidationConverter(Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link MachineKeyValidationConverter}, a cast assert is made to check if types are compatible.
*/
public static MachineKeyValidationConverter cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new MachineKeyValidationConverter(from.getJCOInstance());
}
// Constructors section
public MachineKeyValidationConverter() throws Throwable {
try {
// add reference to assemblyName.dll file
addReference(JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
public NetObject ConvertFrom(ITypeDescriptorContext ctx, CultureInfo ci, NetObject data) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.globalization.CultureNotFoundException, system.NotImplementedException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.threading.AbandonedMutexException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject objConvertFrom = (JCObject)classInstance.Invoke("ConvertFrom", ctx == null ? null : ctx.getJCOInstance(), ci == null ? null : ci.getJCOInstance(), data == null ? null : data.getJCOInstance());
return new NetObject(objConvertFrom);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public NetObject ConvertTo(ITypeDescriptorContext ctx, CultureInfo ci, NetObject value, NetType type) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.InvalidOperationException, system.MissingMethodException, system.reflection.TargetInvocationException, system.NotImplementedException, system.NotSupportedException, system.ArgumentOutOfRangeException, system.globalization.CultureNotFoundException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.FormatException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject objConvertTo = (JCObject)classInstance.Invoke("ConvertTo", ctx == null ? null : ctx.getJCOInstance(), ci == null ? null : ci.getJCOInstance(), value == null ? null : value.getJCOInstance(), type == null ? null : type.getJCOInstance());
return new NetObject(objConvertTo);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Properties section
// Instance Events section
} | [
"mario.mastrodicasa@masesgroup.com"
] | mario.mastrodicasa@masesgroup.com |
31abed41a8431851881b806fb2eafc3957af1120 | 6b5b4b76491d312becf8fccc6ddace7e6b67075c | /app/src/androidTest/java/com/techmonkey/topyaps/ExampleInstrumentedTest.java | 6496f37388eb6b977d7212398bef283a47b52974 | [] | no_license | pramod-locio/D_Techmonkey | a983018f9d481ad65ec39b194c1f718aa9336355 | 85390e16c46363843754973292e683fbe0d2a97e | refs/heads/master | 2020-07-05T07:22:46.959743 | 2017-02-10T06:29:33 | 2017-02-10T06:29:33 | 74,122,180 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 754 | java | package com.techmonkey.topyaps;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.dtechmonkey.d_techmonkey", appContext.getPackageName());
}
}
| [
"prom13k@gmail.com"
] | prom13k@gmail.com |
572236e624c98769f923abb0315246587e4c0186 | e9c241c227499c81633116251a36f46b4a0089b8 | /src/main/java/sg/edu/iss/ca/repo/AdminLogRepository.java | 4cc2e6175318ea10f502a4454882125fbf150ea2 | [] | no_license | EricL121/java_ca | fd734bbad64d9779ae4dba885d823de245a4cfc9 | f70306a24cfab432fa3490142be457c969421587 | refs/heads/main | 2023-02-02T21:24:52.760392 | 2020-12-22T04:00:40 | 2020-12-22T04:00:40 | 321,273,039 | 1 | 0 | null | 2020-12-22T04:00:41 | 2020-12-14T07:54:12 | Java | UTF-8 | Java | false | false | 492 | java | package sg.edu.iss.ca.repo;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import sg.edu.iss.ca.model.AdminLog;
public interface AdminLogRepository extends JpaRepository<AdminLog, Integer> {
@Query("select a from AdminLog a join a.inventory i where i.id = :id")
public List<AdminLog> findAdminLogByInventoryId(@Param("id") Integer id);
}
| [
"tingkai911@gmail.com"
] | tingkai911@gmail.com |
901ef8d263c6a7066caf56430c4d52041a576564 | 64b31c6e18855d00befe40cfb20619e20cb2b23c | /MMS-3/06_Datafiles_for_Students/J2ME/Lesson_1D/Exercise 3/proguard3.2/src/proguard/classfile/attribute/UnknownAttrInfo.java | 58117662f7b125835ea6c22a4484e506b1c0b6fb | [] | no_license | lixeon/NIIT-Source | 817e57e251ea40f445e4316d9c397b087a2e6da8 | dd8c6cde7697ce20e58a1f76dbc90d0e047267e1 | refs/heads/master | 2020-05-09T20:21:52.871943 | 2019-04-14T19:23:58 | 2019-04-14T19:23:58 | 181,401,666 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,994 | java | /* $Id: UnknownAttrInfo.java,v 1.1 2004/10/10 21:10:04 eric Exp $
*
* ProGuard -- shrinking, optimization, and obfuscation of Java class files.
*
* Copyright (c) 1999 Mark Welsh (markw@retrologic.com)
* Copyright (c) 2002-2004 Eric Lafortune (eric@graphics.cornell.edu)
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package proguard.classfile.attribute;
import proguard.classfile.visitor.*;
import proguard.classfile.attribute.*;
import proguard.classfile.*;
import java.io.*;
/**
* Representation of an unknown attribute.
*
* @author Eric Lafortune
*/
public class UnknownAttrInfo extends AttrInfo
{
public int u4attrLength;
public byte info[];
protected UnknownAttrInfo(int attrLength)
{
u4attrLength = attrLength;
}
// Implementations for AttrInfo.
protected int getLength()
{
return u4attrLength;
}
protected void readInfo(DataInput din, ClassFile classFile) throws IOException
{
info = new byte[u4attrLength];
din.readFully(info);
}
protected void writeInfo(DataOutput dout) throws IOException
{
dout.write(info);
}
public void accept(ClassFile classFile, AttrInfoVisitor attrInfoVisitor)
{
attrInfoVisitor.visitUnknownAttrInfo(classFile, this);
}
}
| [
"lixeon.lij@gmail.com"
] | lixeon.lij@gmail.com |
22f1b9f1b6e18b0e631bf8b5f71e390a6ec1a12c | 1800414d4910fc293b9a0df88f49c7772aea6b72 | /src/main/java/com/sahiljalan/service/CustomerServiceImpl.java | 96ed0ae0f684a2a9d4e0664f5f8b5d116a1bddc0 | [
"Apache-2.0"
] | permissive | sahiljalan/Spring-Sample-XML | 4a49770828bd75b0fffc13bdd6741bfce6a3767e | 62d33d1488d50e0378378b94345e44ae0709d128 | refs/heads/master | 2021-06-23T05:32:15.187776 | 2017-09-01T09:25:56 | 2017-09-01T09:25:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package com.sahiljalan.service;
import java.util.List;
import com.sahiljalan.model.Customer;
import com.sahiljalan.repository.CustomerRepository;
public class CustomerServiceImpl implements CustomerService {
private CustomerRepository customerRepository;
public CustomerServiceImpl() {
}
@Override
public List<Customer> findAll(boolean val, Integer rows) throws Exception {
return customerRepository.findAll(val, rows);
}
@Override
public List<Customer> findAll(boolean val) {
return customerRepository.findAll(true);
}
public void setCustomerRepository(CustomerRepository customerRepository) {
this.customerRepository = customerRepository;
}
}
| [
"noreply@github.com"
] | sahiljalan.noreply@github.com |
b757276825b18a69dae57a1a667e6b3d8793d500 | 52954648ff149d56586418bb3c3e72402fdd79cc | /src/Assiement1Introduction/ItStudent.java | 2c93b82ba1855950931327c10e32b2dac31219ae | [] | no_license | RulinAltanani/firstAppPR3 | ab5c1b9dd1be4cbd8369139eca6dafe01b5acb02 | af40412e1a363f7abb33cea0604051d41a83b8c6 | refs/heads/master | 2022-05-04T04:12:57.961805 | 2022-03-16T13:15:44 | 2022-03-16T13:15:44 | 241,180,416 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 534 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Assiement1Introduction;
/**
*
* @author hp
*/
public class ItStudent extends Student {
public ItStudent(int id, String name, String major, double midGrade, double finalGrade, double ProjectGrade) {
super(id, name, major);
this.grade=midGrade * 0.30 + ProjectGrade * 0.30 + finalGrade * 40;
}
}
| [
"hp@shaimaazakout"
] | hp@shaimaazakout |
a90a9b749def69a43ca76ff44af78a88a7d00053 | 1bbbbc7bf6d6667a12ffe9fb6bee033db8699aa4 | /.c9/metadata/environment/CHAPTER1/OverlyComplexFlag.java | 2da6d326d61df476dc4a7bd9f9377cfdae266e2d | [] | no_license | asamn/javathehardway | f1004d1fc3cb79b2203ef1b59e2cccb756540278 | 69a2598279e0969ef8ad188a7901181aac7ae022 | refs/heads/master | 2020-07-28T04:24:36.645460 | 2020-02-04T14:16:28 | 2020-02-04T14:16:28 | 209,308,325 | 0 | 0 | null | 2019-09-24T16:55:44 | 2019-09-18T12:55:14 | C | UTF-8 | Java | false | false | 27,921 | java | {"filter":false,"title":"OverlyComplexFlag.java","tooltip":"/CHAPTER1/OverlyComplexFlag.java","ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":0,"column":0},"end":{"row":5,"column":5},"isBackwards":true},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"hash":"cc7113c17533d1e760b5702b2ec2bcdc62464f30","undoManager":{"mark":100,"position":100,"stack":[[{"start":{"row":68,"column":50},"end":{"row":68,"column":51},"action":"insert","lines":["⣿"],"id":297}],[{"start":{"row":70,"column":53},"end":{"row":70,"column":54},"action":"remove","lines":[";"],"id":298},{"start":{"row":70,"column":52},"end":{"row":70,"column":53},"action":"remove","lines":[")"]},{"start":{"row":70,"column":51},"end":{"row":70,"column":52},"action":"remove","lines":["\""]},{"start":{"row":70,"column":50},"end":{"row":70,"column":51},"action":"remove","lines":["⠄"]},{"start":{"row":70,"column":49},"end":{"row":70,"column":50},"action":"remove","lines":["⡀"]},{"start":{"row":70,"column":48},"end":{"row":70,"column":49},"action":"remove","lines":["⡀"]},{"start":{"row":70,"column":47},"end":{"row":70,"column":48},"action":"remove","lines":["⣀"]}],[{"start":{"row":70,"column":46},"end":{"row":70,"column":47},"action":"remove","lines":["⢦"],"id":299}],[{"start":{"row":70,"column":46},"end":{"row":70,"column":47},"action":"insert","lines":["⣿"],"id":300}],[{"start":{"row":70,"column":47},"end":{"row":70,"column":48},"action":"insert","lines":["⣿"],"id":301}],[{"start":{"row":70,"column":48},"end":{"row":70,"column":49},"action":"insert","lines":["⣿"],"id":302}],[{"start":{"row":70,"column":49},"end":{"row":70,"column":50},"action":"insert","lines":["⣿"],"id":303}],[{"start":{"row":70,"column":50},"end":{"row":70,"column":51},"action":"insert","lines":["⣿"],"id":304}],[{"start":{"row":71,"column":53},"end":{"row":71,"column":54},"action":"remove","lines":[";"],"id":305},{"start":{"row":71,"column":52},"end":{"row":71,"column":53},"action":"remove","lines":[")"]},{"start":{"row":71,"column":51},"end":{"row":71,"column":52},"action":"remove","lines":["\""]},{"start":{"row":71,"column":50},"end":{"row":71,"column":51},"action":"remove","lines":["⣀"]},{"start":{"row":71,"column":49},"end":{"row":71,"column":50},"action":"remove","lines":["⣿"]},{"start":{"row":71,"column":48},"end":{"row":71,"column":49},"action":"remove","lines":["⠹"]}],[{"start":{"row":71,"column":48},"end":{"row":71,"column":49},"action":"insert","lines":["⣿"],"id":306}],[{"start":{"row":71,"column":49},"end":{"row":71,"column":50},"action":"insert","lines":["⣿"],"id":307}],[{"start":{"row":71,"column":50},"end":{"row":71,"column":51},"action":"insert","lines":["⣿"],"id":308}],[{"start":{"row":71,"column":51},"end":{"row":71,"column":53},"action":"insert","lines":["\"\""],"id":310}],[{"start":{"row":70,"column":51},"end":{"row":70,"column":53},"action":"insert","lines":["\"\""],"id":311}],[{"start":{"row":69,"column":51},"end":{"row":69,"column":53},"action":"insert","lines":["\"\""],"id":312}],[{"start":{"row":68,"column":51},"end":{"row":68,"column":53},"action":"insert","lines":["\"\""],"id":313}],[{"start":{"row":68,"column":52},"end":{"row":68,"column":53},"action":"remove","lines":["\""],"id":314}],[{"start":{"row":69,"column":52},"end":{"row":69,"column":53},"action":"remove","lines":["\""],"id":315}],[{"start":{"row":70,"column":52},"end":{"row":70,"column":53},"action":"remove","lines":["\""],"id":316}],[{"start":{"row":71,"column":52},"end":{"row":71,"column":53},"action":"remove","lines":["\""],"id":317}],[{"start":{"row":71,"column":52},"end":{"row":71,"column":53},"action":"insert","lines":[")"],"id":318}],[{"start":{"row":70,"column":52},"end":{"row":70,"column":53},"action":"insert","lines":[")"],"id":319}],[{"start":{"row":69,"column":52},"end":{"row":69,"column":53},"action":"insert","lines":[")"],"id":320}],[{"start":{"row":68,"column":52},"end":{"row":68,"column":53},"action":"insert","lines":[")"],"id":321}],[{"start":{"row":68,"column":53},"end":{"row":68,"column":54},"action":"insert","lines":[";"],"id":322}],[{"start":{"row":69,"column":53},"end":{"row":69,"column":54},"action":"insert","lines":[";"],"id":323}],[{"start":{"row":70,"column":53},"end":{"row":70,"column":54},"action":"insert","lines":[";"],"id":324}],[{"start":{"row":71,"column":53},"end":{"row":71,"column":54},"action":"insert","lines":[";"],"id":325}],[{"start":{"row":18,"column":19},"end":{"row":19,"column":0},"action":"insert","lines":["",""],"id":326},{"start":{"row":19,"column":0},"end":{"row":19,"column":8},"action":"insert","lines":[" "]},{"start":{"row":19,"column":8},"end":{"row":20,"column":0},"action":"insert","lines":["",""]},{"start":{"row":20,"column":0},"end":{"row":20,"column":8},"action":"insert","lines":[" "]},{"start":{"row":20,"column":8},"end":{"row":20,"column":9},"action":"insert","lines":["p"]},{"start":{"row":20,"column":9},"end":{"row":20,"column":10},"action":"insert","lines":["r"]},{"start":{"row":20,"column":10},"end":{"row":20,"column":11},"action":"insert","lines":["i"]},{"start":{"row":20,"column":11},"end":{"row":20,"column":12},"action":"insert","lines":["n"]},{"start":{"row":20,"column":12},"end":{"row":20,"column":13},"action":"insert","lines":["t"]},{"start":{"row":20,"column":13},"end":{"row":20,"column":14},"action":"insert","lines":["D"]},{"start":{"row":20,"column":14},"end":{"row":20,"column":15},"action":"insert","lines":["o"]},{"start":{"row":20,"column":15},"end":{"row":20,"column":16},"action":"insert","lines":["n"]}],[{"start":{"row":20,"column":16},"end":{"row":20,"column":17},"action":"insert","lines":["a"],"id":327},{"start":{"row":20,"column":17},"end":{"row":20,"column":18},"action":"insert","lines":["l"]},{"start":{"row":20,"column":18},"end":{"row":20,"column":19},"action":"insert","lines":["d"]}],[{"start":{"row":20,"column":19},"end":{"row":20,"column":21},"action":"insert","lines":["()"],"id":328}],[{"start":{"row":20,"column":21},"end":{"row":20,"column":22},"action":"insert","lines":[";"],"id":329}],[{"start":{"row":19,"column":0},"end":{"row":19,"column":8},"action":"remove","lines":[" "],"id":330}],[{"start":{"row":62,"column":53},"end":{"row":62,"column":54},"action":"insert","lines":[";"],"id":331}],[{"start":{"row":61,"column":5},"end":{"row":62,"column":0},"action":"insert","lines":["",""],"id":332},{"start":{"row":62,"column":0},"end":{"row":62,"column":8},"action":"insert","lines":[" "]},{"start":{"row":62,"column":8},"end":{"row":62,"column":9},"action":"insert","lines":["o"]},{"start":{"row":62,"column":9},"end":{"row":62,"column":10},"action":"insert","lines":["u"]},{"start":{"row":62,"column":10},"end":{"row":62,"column":11},"action":"insert","lines":["t"]},{"start":{"row":62,"column":11},"end":{"row":62,"column":12},"action":"insert","lines":["."]},{"start":{"row":62,"column":12},"end":{"row":62,"column":13},"action":"insert","lines":["p"]},{"start":{"row":62,"column":13},"end":{"row":62,"column":14},"action":"insert","lines":["r"]},{"start":{"row":62,"column":14},"end":{"row":62,"column":15},"action":"insert","lines":["i"]},{"start":{"row":62,"column":15},"end":{"row":62,"column":16},"action":"insert","lines":["n"]},{"start":{"row":62,"column":16},"end":{"row":62,"column":17},"action":"insert","lines":["t"]},{"start":{"row":62,"column":17},"end":{"row":62,"column":18},"action":"insert","lines":["l"]}],[{"start":{"row":62,"column":18},"end":{"row":62,"column":19},"action":"insert","lines":["n"],"id":333}],[{"start":{"row":62,"column":19},"end":{"row":62,"column":20},"action":"insert","lines":[")"],"id":334}],[{"start":{"row":62,"column":19},"end":{"row":62,"column":20},"action":"remove","lines":[")"],"id":335}],[{"start":{"row":62,"column":19},"end":{"row":62,"column":21},"action":"insert","lines":["()"],"id":336}],[{"start":{"row":62,"column":21},"end":{"row":62,"column":22},"action":"insert","lines":[";"],"id":337}],[{"start":{"row":75,"column":54},"end":{"row":76,"column":0},"action":"insert","lines":["",""],"id":338},{"start":{"row":76,"column":0},"end":{"row":76,"column":8},"action":"insert","lines":[" "]},{"start":{"row":76,"column":8},"end":{"row":76,"column":9},"action":"insert","lines":["o"]},{"start":{"row":76,"column":9},"end":{"row":76,"column":10},"action":"insert","lines":["u"]},{"start":{"row":76,"column":10},"end":{"row":76,"column":11},"action":"insert","lines":["t"]},{"start":{"row":76,"column":11},"end":{"row":76,"column":12},"action":"insert","lines":["."]},{"start":{"row":76,"column":12},"end":{"row":76,"column":13},"action":"insert","lines":["p"]},{"start":{"row":76,"column":13},"end":{"row":76,"column":14},"action":"insert","lines":["r"]},{"start":{"row":76,"column":14},"end":{"row":76,"column":15},"action":"insert","lines":["i"]},{"start":{"row":76,"column":15},"end":{"row":76,"column":16},"action":"insert","lines":["o"]},{"start":{"row":76,"column":16},"end":{"row":76,"column":17},"action":"insert","lines":["n"]},{"start":{"row":76,"column":17},"end":{"row":76,"column":18},"action":"insert","lines":["t"]},{"start":{"row":76,"column":18},"end":{"row":76,"column":19},"action":"insert","lines":["l"]},{"start":{"row":76,"column":19},"end":{"row":76,"column":20},"action":"insert","lines":["n"]}],[{"start":{"row":76,"column":19},"end":{"row":76,"column":20},"action":"remove","lines":["n"],"id":339},{"start":{"row":76,"column":18},"end":{"row":76,"column":19},"action":"remove","lines":["l"]},{"start":{"row":76,"column":17},"end":{"row":76,"column":18},"action":"remove","lines":["t"]},{"start":{"row":76,"column":16},"end":{"row":76,"column":17},"action":"remove","lines":["n"]},{"start":{"row":76,"column":15},"end":{"row":76,"column":16},"action":"remove","lines":["o"]}],[{"start":{"row":76,"column":15},"end":{"row":76,"column":16},"action":"insert","lines":["n"],"id":340},{"start":{"row":76,"column":16},"end":{"row":76,"column":17},"action":"insert","lines":["t"]},{"start":{"row":76,"column":17},"end":{"row":76,"column":18},"action":"insert","lines":["l"]},{"start":{"row":76,"column":18},"end":{"row":76,"column":19},"action":"insert","lines":["n"]}],[{"start":{"row":76,"column":19},"end":{"row":76,"column":21},"action":"insert","lines":["()"],"id":341}],[{"start":{"row":76,"column":20},"end":{"row":76,"column":22},"action":"insert","lines":["\"\""],"id":342}],[{"start":{"row":76,"column":21},"end":{"row":76,"column":24},"action":"insert","lines":[" "],"id":343}],[{"start":{"row":76,"column":24},"end":{"row":76,"column":28},"action":"insert","lines":[" "],"id":344}],[{"start":{"row":76,"column":28},"end":{"row":76,"column":32},"action":"insert","lines":[" "],"id":345}],[{"start":{"row":76,"column":32},"end":{"row":76,"column":36},"action":"insert","lines":[" "],"id":346}],[{"start":{"row":76,"column":36},"end":{"row":76,"column":40},"action":"insert","lines":[" "],"id":347}],[{"start":{"row":76,"column":40},"end":{"row":76,"column":44},"action":"insert","lines":[" "],"id":348}],[{"start":{"row":76,"column":44},"end":{"row":76,"column":48},"action":"insert","lines":[" "],"id":349}],[{"start":{"row":76,"column":48},"end":{"row":76,"column":52},"action":"insert","lines":[" "],"id":350}],[{"start":{"row":76,"column":52},"end":{"row":76,"column":56},"action":"insert","lines":[" "],"id":351}],[{"start":{"row":76,"column":21},"end":{"row":76,"column":22},"action":"insert","lines":["-"],"id":352},{"start":{"row":76,"column":22},"end":{"row":76,"column":23},"action":"insert","lines":["-"]},{"start":{"row":76,"column":23},"end":{"row":76,"column":24},"action":"insert","lines":["-"]},{"start":{"row":76,"column":24},"end":{"row":76,"column":25},"action":"insert","lines":["-"]},{"start":{"row":76,"column":25},"end":{"row":76,"column":26},"action":"insert","lines":["-"]},{"start":{"row":76,"column":26},"end":{"row":76,"column":27},"action":"insert","lines":["-"]}],[{"start":{"row":76,"column":26},"end":{"row":76,"column":27},"action":"remove","lines":["-"],"id":353},{"start":{"row":76,"column":25},"end":{"row":76,"column":26},"action":"remove","lines":["-"]},{"start":{"row":76,"column":24},"end":{"row":76,"column":25},"action":"remove","lines":["-"]},{"start":{"row":76,"column":23},"end":{"row":76,"column":24},"action":"remove","lines":["-"]},{"start":{"row":76,"column":22},"end":{"row":76,"column":23},"action":"remove","lines":["-"]},{"start":{"row":76,"column":21},"end":{"row":76,"column":22},"action":"remove","lines":["-"]}],[{"start":{"row":76,"column":21},"end":{"row":76,"column":22},"action":"insert","lines":["_"],"id":354},{"start":{"row":76,"column":22},"end":{"row":76,"column":23},"action":"insert","lines":["_"]}],[{"start":{"row":76,"column":22},"end":{"row":76,"column":23},"action":"remove","lines":["_"],"id":355},{"start":{"row":76,"column":21},"end":{"row":76,"column":22},"action":"remove","lines":["_"]}],[{"start":{"row":76,"column":21},"end":{"row":76,"column":22},"action":"insert","lines":["-"],"id":356},{"start":{"row":76,"column":22},"end":{"row":76,"column":23},"action":"insert","lines":["-"]},{"start":{"row":76,"column":23},"end":{"row":76,"column":24},"action":"insert","lines":["-"]},{"start":{"row":76,"column":24},"end":{"row":76,"column":25},"action":"insert","lines":["-"]},{"start":{"row":76,"column":25},"end":{"row":76,"column":26},"action":"insert","lines":["-"]},{"start":{"row":76,"column":26},"end":{"row":76,"column":27},"action":"insert","lines":["-"]},{"start":{"row":76,"column":27},"end":{"row":76,"column":28},"action":"insert","lines":["-"]},{"start":{"row":76,"column":28},"end":{"row":76,"column":29},"action":"insert","lines":["-"]},{"start":{"row":76,"column":29},"end":{"row":76,"column":30},"action":"insert","lines":["-"]},{"start":{"row":76,"column":30},"end":{"row":76,"column":31},"action":"insert","lines":["-"]},{"start":{"row":76,"column":31},"end":{"row":76,"column":32},"action":"insert","lines":["-"]},{"start":{"row":76,"column":32},"end":{"row":76,"column":33},"action":"insert","lines":["-"]},{"start":{"row":76,"column":33},"end":{"row":76,"column":34},"action":"insert","lines":["-"]},{"start":{"row":76,"column":34},"end":{"row":76,"column":35},"action":"insert","lines":["-"]},{"start":{"row":76,"column":35},"end":{"row":76,"column":36},"action":"insert","lines":["-"]},{"start":{"row":76,"column":36},"end":{"row":76,"column":37},"action":"insert","lines":["-"]},{"start":{"row":76,"column":37},"end":{"row":76,"column":38},"action":"insert","lines":["-"]},{"start":{"row":76,"column":38},"end":{"row":76,"column":39},"action":"insert","lines":["-"]},{"start":{"row":76,"column":39},"end":{"row":76,"column":40},"action":"insert","lines":["-"]},{"start":{"row":76,"column":40},"end":{"row":76,"column":41},"action":"insert","lines":["-"]},{"start":{"row":76,"column":41},"end":{"row":76,"column":42},"action":"insert","lines":["-"]},{"start":{"row":76,"column":42},"end":{"row":76,"column":43},"action":"insert","lines":["-"]},{"start":{"row":76,"column":43},"end":{"row":76,"column":44},"action":"insert","lines":["-"]},{"start":{"row":76,"column":44},"end":{"row":76,"column":45},"action":"insert","lines":["-"]},{"start":{"row":76,"column":45},"end":{"row":76,"column":46},"action":"insert","lines":["-"]},{"start":{"row":76,"column":46},"end":{"row":76,"column":47},"action":"insert","lines":["-"]},{"start":{"row":76,"column":47},"end":{"row":76,"column":48},"action":"insert","lines":["-"]},{"start":{"row":76,"column":48},"end":{"row":76,"column":49},"action":"insert","lines":["-"]},{"start":{"row":76,"column":49},"end":{"row":76,"column":50},"action":"insert","lines":["-"]},{"start":{"row":76,"column":50},"end":{"row":76,"column":51},"action":"insert","lines":["-"]},{"start":{"row":76,"column":51},"end":{"row":76,"column":52},"action":"insert","lines":["-"]}],[{"start":{"row":76,"column":52},"end":{"row":76,"column":53},"action":"insert","lines":["-"],"id":357},{"start":{"row":76,"column":53},"end":{"row":76,"column":54},"action":"insert","lines":["-"]},{"start":{"row":76,"column":54},"end":{"row":76,"column":55},"action":"insert","lines":["-"]}],[{"start":{"row":76,"column":89},"end":{"row":76,"column":90},"action":"remove","lines":[" "],"id":358},{"start":{"row":76,"column":88},"end":{"row":76,"column":89},"action":"remove","lines":[" "]},{"start":{"row":76,"column":84},"end":{"row":76,"column":88},"action":"remove","lines":[" "]},{"start":{"row":76,"column":80},"end":{"row":76,"column":84},"action":"remove","lines":[" "]},{"start":{"row":76,"column":76},"end":{"row":76,"column":80},"action":"remove","lines":[" "]},{"start":{"row":76,"column":72},"end":{"row":76,"column":76},"action":"remove","lines":[" "]},{"start":{"row":76,"column":68},"end":{"row":76,"column":72},"action":"remove","lines":[" "]},{"start":{"row":76,"column":64},"end":{"row":76,"column":68},"action":"remove","lines":[" "]},{"start":{"row":76,"column":60},"end":{"row":76,"column":64},"action":"remove","lines":[" "]},{"start":{"row":76,"column":56},"end":{"row":76,"column":60},"action":"remove","lines":[" "]}],[{"start":{"row":76,"column":55},"end":{"row":76,"column":56},"action":"remove","lines":[" "],"id":359}],[{"start":{"row":76,"column":55},"end":{"row":76,"column":56},"action":"insert","lines":["-"],"id":360}],[{"start":{"row":76,"column":55},"end":{"row":76,"column":56},"action":"remove","lines":["-"],"id":361}],[{"start":{"row":62,"column":20},"end":{"row":62,"column":22},"action":"insert","lines":["\"\""],"id":364}],[{"start":{"row":62,"column":21},"end":{"row":62,"column":22},"action":"insert","lines":["0"],"id":365}],[{"start":{"row":62,"column":21},"end":{"row":62,"column":22},"action":"remove","lines":["0"],"id":366}],[{"start":{"row":62,"column":21},"end":{"row":62,"column":22},"action":"insert","lines":["-"],"id":367},{"start":{"row":62,"column":22},"end":{"row":62,"column":23},"action":"insert","lines":["-"]},{"start":{"row":62,"column":23},"end":{"row":62,"column":24},"action":"insert","lines":["-"]},{"start":{"row":62,"column":24},"end":{"row":62,"column":25},"action":"insert","lines":["-"]},{"start":{"row":62,"column":25},"end":{"row":62,"column":26},"action":"insert","lines":["-"]},{"start":{"row":62,"column":26},"end":{"row":62,"column":27},"action":"insert","lines":["-"]},{"start":{"row":62,"column":27},"end":{"row":62,"column":28},"action":"insert","lines":["-"]},{"start":{"row":62,"column":28},"end":{"row":62,"column":29},"action":"insert","lines":["-"]},{"start":{"row":62,"column":29},"end":{"row":62,"column":30},"action":"insert","lines":["-"]},{"start":{"row":62,"column":30},"end":{"row":62,"column":31},"action":"insert","lines":["-"]},{"start":{"row":62,"column":31},"end":{"row":62,"column":32},"action":"insert","lines":["-"]},{"start":{"row":62,"column":32},"end":{"row":62,"column":33},"action":"insert","lines":["-"]},{"start":{"row":62,"column":33},"end":{"row":62,"column":34},"action":"insert","lines":["-"]},{"start":{"row":62,"column":34},"end":{"row":62,"column":35},"action":"insert","lines":["-"]},{"start":{"row":62,"column":35},"end":{"row":62,"column":36},"action":"insert","lines":["-"]},{"start":{"row":62,"column":36},"end":{"row":62,"column":37},"action":"insert","lines":["-"]},{"start":{"row":62,"column":37},"end":{"row":62,"column":38},"action":"insert","lines":["-"]},{"start":{"row":62,"column":38},"end":{"row":62,"column":39},"action":"insert","lines":["-"]},{"start":{"row":62,"column":39},"end":{"row":62,"column":40},"action":"insert","lines":["-"]},{"start":{"row":62,"column":40},"end":{"row":62,"column":41},"action":"insert","lines":["-"]},{"start":{"row":62,"column":41},"end":{"row":62,"column":42},"action":"insert","lines":["-"]},{"start":{"row":62,"column":42},"end":{"row":62,"column":43},"action":"insert","lines":["-"]},{"start":{"row":62,"column":43},"end":{"row":62,"column":44},"action":"insert","lines":["-"]},{"start":{"row":62,"column":44},"end":{"row":62,"column":45},"action":"insert","lines":["-"]},{"start":{"row":62,"column":45},"end":{"row":62,"column":46},"action":"insert","lines":["-"]},{"start":{"row":62,"column":46},"end":{"row":62,"column":47},"action":"insert","lines":["-"]},{"start":{"row":62,"column":47},"end":{"row":62,"column":48},"action":"insert","lines":["-"]},{"start":{"row":62,"column":48},"end":{"row":62,"column":49},"action":"insert","lines":["-"]},{"start":{"row":62,"column":49},"end":{"row":62,"column":50},"action":"insert","lines":["-"]}],[{"start":{"row":62,"column":50},"end":{"row":62,"column":51},"action":"insert","lines":["-"],"id":368},{"start":{"row":62,"column":51},"end":{"row":62,"column":52},"action":"insert","lines":["-"]},{"start":{"row":62,"column":52},"end":{"row":62,"column":53},"action":"insert","lines":["-"]},{"start":{"row":62,"column":53},"end":{"row":62,"column":54},"action":"insert","lines":["-"]},{"start":{"row":62,"column":54},"end":{"row":62,"column":55},"action":"insert","lines":["-"]}],[{"start":{"row":62,"column":21},"end":{"row":62,"column":22},"action":"insert","lines":["\\"],"id":369},{"start":{"row":62,"column":22},"end":{"row":62,"column":23},"action":"insert","lines":["n"]}],[{"start":{"row":76,"column":57},"end":{"row":77,"column":0},"action":"insert","lines":["",""],"id":370},{"start":{"row":77,"column":0},"end":{"row":77,"column":8},"action":"insert","lines":[" "]},{"start":{"row":77,"column":8},"end":{"row":77,"column":9},"action":"insert","lines":["o"]},{"start":{"row":77,"column":9},"end":{"row":77,"column":10},"action":"insert","lines":["u"]},{"start":{"row":77,"column":10},"end":{"row":77,"column":11},"action":"insert","lines":["t"]},{"start":{"row":77,"column":11},"end":{"row":77,"column":12},"action":"insert","lines":["."]},{"start":{"row":77,"column":12},"end":{"row":77,"column":13},"action":"insert","lines":["p"]},{"start":{"row":77,"column":13},"end":{"row":77,"column":14},"action":"insert","lines":["r"]},{"start":{"row":77,"column":14},"end":{"row":77,"column":15},"action":"insert","lines":["o"]},{"start":{"row":77,"column":15},"end":{"row":77,"column":16},"action":"insert","lines":["n"]}],[{"start":{"row":77,"column":15},"end":{"row":77,"column":16},"action":"remove","lines":["n"],"id":371},{"start":{"row":77,"column":14},"end":{"row":77,"column":15},"action":"remove","lines":["o"]},{"start":{"row":77,"column":13},"end":{"row":77,"column":14},"action":"remove","lines":["r"]}],[{"start":{"row":77,"column":13},"end":{"row":77,"column":14},"action":"insert","lines":["r"],"id":372},{"start":{"row":77,"column":14},"end":{"row":77,"column":15},"action":"insert","lines":["i"]},{"start":{"row":77,"column":15},"end":{"row":77,"column":16},"action":"insert","lines":["n"]},{"start":{"row":77,"column":16},"end":{"row":77,"column":17},"action":"insert","lines":["t"]},{"start":{"row":77,"column":17},"end":{"row":77,"column":18},"action":"insert","lines":["l"]},{"start":{"row":77,"column":18},"end":{"row":77,"column":19},"action":"insert","lines":["m"]}],[{"start":{"row":77,"column":18},"end":{"row":77,"column":19},"action":"remove","lines":["m"],"id":373}],[{"start":{"row":77,"column":18},"end":{"row":77,"column":19},"action":"insert","lines":["n"],"id":374}],[{"start":{"row":77,"column":19},"end":{"row":77,"column":21},"action":"insert","lines":["()"],"id":375}],[{"start":{"row":77,"column":20},"end":{"row":77,"column":22},"action":"insert","lines":["\"\""],"id":376}],[{"start":{"row":77,"column":21},"end":{"row":77,"column":24},"action":"insert","lines":[" "],"id":377}],[{"start":{"row":77,"column":24},"end":{"row":77,"column":28},"action":"insert","lines":[" "],"id":378}],[{"start":{"row":77,"column":28},"end":{"row":77,"column":32},"action":"insert","lines":[" "],"id":379}],[{"start":{"row":77,"column":32},"end":{"row":77,"column":36},"action":"insert","lines":[" "],"id":380}],[{"start":{"row":77,"column":36},"end":{"row":77,"column":40},"action":"insert","lines":[" "],"id":381}],[{"start":{"row":77,"column":40},"end":{"row":77,"column":44},"action":"insert","lines":[" "],"id":382}],[{"start":{"row":77,"column":44},"end":{"row":77,"column":48},"action":"insert","lines":[" "],"id":383}],[{"start":{"row":77,"column":48},"end":{"row":77,"column":52},"action":"insert","lines":[" "],"id":384}],[{"start":{"row":77,"column":52},"end":{"row":77,"column":56},"action":"insert","lines":[" "],"id":385}],[{"start":{"row":77,"column":32},"end":{"row":77,"column":33},"action":"insert","lines":["M"],"id":386},{"start":{"row":77,"column":33},"end":{"row":77,"column":34},"action":"insert","lines":["A"]},{"start":{"row":77,"column":34},"end":{"row":77,"column":35},"action":"insert","lines":["G"]},{"start":{"row":77,"column":35},"end":{"row":77,"column":36},"action":"insert","lines":["A"]}],[{"start":{"row":77,"column":56},"end":{"row":77,"column":60},"action":"remove","lines":[" "],"id":387}],[{"start":{"row":77,"column":32},"end":{"row":77,"column":33},"action":"insert","lines":[" "],"id":388},{"start":{"row":77,"column":33},"end":{"row":77,"column":34},"action":"insert","lines":[" "]},{"start":{"row":77,"column":34},"end":{"row":77,"column":35},"action":"insert","lines":[" "]}],[{"start":{"row":77,"column":58},"end":{"row":77,"column":59},"action":"remove","lines":[" "],"id":389},{"start":{"row":77,"column":57},"end":{"row":77,"column":58},"action":"remove","lines":[" "]},{"start":{"row":77,"column":56},"end":{"row":77,"column":57},"action":"remove","lines":[" "]}],[{"start":{"row":77,"column":58},"end":{"row":77,"column":59},"action":"insert","lines":[";"],"id":390}],[{"start":{"row":76,"column":57},"end":{"row":76,"column":58},"action":"insert","lines":[";"],"id":391}],[{"start":{"row":76,"column":58},"end":{"row":77,"column":0},"action":"insert","lines":["",""],"id":392},{"start":{"row":77,"column":0},"end":{"row":77,"column":8},"action":"insert","lines":[" "]}],[{"start":{"row":77,"column":8},"end":{"row":77,"column":59},"action":"insert","lines":["out.println(\" MAGA \");"],"id":393}],[{"start":{"row":77,"column":35},"end":{"row":77,"column":39},"action":"remove","lines":["MAGA"],"id":394},{"start":{"row":77,"column":35},"end":{"row":77,"column":36},"action":"insert","lines":["T"]},{"start":{"row":77,"column":36},"end":{"row":77,"column":37},"action":"insert","lines":["R"]},{"start":{"row":77,"column":37},"end":{"row":77,"column":38},"action":"insert","lines":["U"]},{"start":{"row":77,"column":38},"end":{"row":77,"column":39},"action":"insert","lines":["M"]},{"start":{"row":77,"column":39},"end":{"row":77,"column":40},"action":"insert","lines":["P"]}],[{"start":{"row":77,"column":40},"end":{"row":77,"column":41},"action":"insert","lines":[" "],"id":395},{"start":{"row":77,"column":41},"end":{"row":77,"column":42},"action":"insert","lines":["2"]},{"start":{"row":77,"column":42},"end":{"row":77,"column":43},"action":"insert","lines":["0"]},{"start":{"row":77,"column":43},"end":{"row":77,"column":44},"action":"insert","lines":["2"]},{"start":{"row":77,"column":44},"end":{"row":77,"column":45},"action":"insert","lines":["0"]}],[{"start":{"row":77,"column":34},"end":{"row":77,"column":35},"action":"remove","lines":[" "],"id":396},{"start":{"row":77,"column":33},"end":{"row":77,"column":34},"action":"remove","lines":[" "]}],[{"start":{"row":77,"column":32},"end":{"row":77,"column":33},"action":"remove","lines":[" "],"id":397}],[{"start":{"row":77,"column":58},"end":{"row":77,"column":59},"action":"remove","lines":[" "],"id":398},{"start":{"row":77,"column":57},"end":{"row":77,"column":58},"action":"remove","lines":[" "]},{"start":{"row":77,"column":56},"end":{"row":77,"column":57},"action":"remove","lines":[" "]}],[{"start":{"row":74,"column":46},"end":{"row":74,"column":47},"action":"insert","lines":["⠄"],"id":406}],[{"start":{"row":74,"column":51},"end":{"row":74,"column":52},"action":"remove","lines":["⣿"],"id":408}]]},"timestamp":1571931190298} | [
"aui80180@gmail.com"
] | aui80180@gmail.com |
ff4de5b6c96ddb8f9c5e28e94cb28db3c9daef18 | cd35a647ee44b23f9f6eccfd0380bd6608f8fdd4 | /src/r/Memento/Test.java | 090936deb8ac41c6a4ed0f3f825064dcd513e496 | [] | no_license | MrITzhongzi/DesignPatterns | d56df234e3b914ddf45165f8c630d3504b32e380 | 23c7e6a0c966976fe9240543db74e8396084e49a | refs/heads/master | 2020-04-28T15:42:16.170001 | 2019-03-14T06:13:51 | 2019-03-14T06:13:51 | 175,384,666 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 799 | java | package r.Memento;
public class Test {
/***
*
* @param args
* 适用性
*
* 1.必须*存一个对象在某一个时刻的(部分)状态,这样以后需要时它才能恢复到先前的状态。
*
* 2.如果一个用接口来让其它对象直接得到这些状态,将会暴露对象的实现细节并破坏对象的封装性。
*/
public static void main(String[] args) {
Originator org = new Originator();
org.setState("开会中");
Caretaker ctk = new Caretaker();
ctk.setMemento(org.createMemento());//将数据封装在Caretaker
org.setState("睡觉中");
org.showState();//显示
org.setMemento(ctk.getMemento());//将数据重新导入
org.showState();
}
}
| [
"http://wangtz@122.5.34.137:10101/r/wshop.git"
] | http://wangtz@122.5.34.137:10101/r/wshop.git |
4c999432b6c316d8175e354c6c969a98a15d0578 | 7034b8c445d2c6ec34b6ae2d7c4ea0a9ce7f2b36 | /src/main/java/tasks/CanMakeArithmeticProgressionFromSequence.java | 92088cead03882518855160729dbd32fcbd7dd12 | [] | no_license | RakhmedovRS/LeetCode | 1e0da62cf6fab90575e061aae27afb22cc849181 | da4368374eead2f2ce2300c3dfdc941430e717ca | refs/heads/master | 2023-08-31T01:03:59.047473 | 2023-08-27T04:52:15 | 2023-08-27T04:52:15 | 238,749,044 | 14 | 8 | null | null | null | null | UTF-8 | Java | false | false | 580 | java | package tasks;
import common.LeetCode;
import java.util.Arrays;
/**
* @author RakhmedovRS
* @created 05-Jul-20
*/
@LeetCode(id = 1502, name = "Can Make Arithmetic Progression From Sequence", url = "https://leetcode.com/problems/can-make-arithmetic-progression-from-sequence/")
public class CanMakeArithmeticProgressionFromSequence
{
public boolean canMakeArithmeticProgression(int[] arr)
{
Arrays.sort(arr);
int diff = arr[1] - arr[0];
for (int i = 1; i < arr.length; i++)
{
if (arr[i] - arr[i - 1] != diff)
{
return false;
}
}
return true;
}
}
| [
"rakhmedovrs@gmail.com"
] | rakhmedovrs@gmail.com |
ed21e951f5eca49bec7428346c27019168f688dc | 52037d6f49ab62c9e24ed314098611165c423b5f | /Site/src/main/java/com/sitelogin/Site/controllers/BookingController.java | 15b2cef25133e4dbe1a83e9da2ccd63ca56bcecd | [] | no_license | Madaist/Bookster | 7827f58079b4e2fd42cb9f268164d5e483b260d3 | 49b00a934d445ee4225a7e0a2642e8718bc23f7c | refs/heads/master | 2020-05-18T18:16:45.392768 | 2019-05-03T14:07:19 | 2019-05-03T14:07:19 | 184,549,167 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,881 | java | package com.sitelogin.Site.controllers;
import com.sitelogin.Site.domain.Book;
import com.sitelogin.Site.services.BookService;
import com.sitelogin.Site.services.BookingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpSession;
@Controller
public class BookingController {
@Autowired
private BookingService bookingService;
@Autowired
private BookService bookService;
@RequestMapping(value = "/borrowBook", method = RequestMethod.GET)
public ModelAndView borrowBook() {
ModelAndView mav = new ModelAndView();
Book book = new Book();
mav.addObject("book", book);
return mav;
}
@RequestMapping(value="/borrowBook", method = RequestMethod.POST)
public ModelAndView borrowBookPost(@ModelAttribute Book book, HttpSession session) throws Exception {
ModelAndView mav = new ModelAndView();
if(bookingService.borrowBook(book.getTitle(), session)){
mav.setViewName("redirect:/bookingSuccessful");
return mav;
}
else{
mav.setViewName("redirect:/bookingFailed");
return mav;
}
}
@RequestMapping(value = "/bookingSuccessful", method = RequestMethod.GET)
public String bookingSuccessful(){
return "bookingSuccessful";
}
@RequestMapping(value = "/bookingFailed", method = RequestMethod.GET)
public String bookingFailed(){
return "bookingFailed";
}
@RequestMapping(value = "/returnBook", method = RequestMethod.GET)
public ModelAndView returnBook() {
ModelAndView mav = new ModelAndView();
Book book = new Book();
mav.addObject("book", book);
return mav;
}
@RequestMapping(value="/returnBook", method = RequestMethod.POST)
public ModelAndView returnBookPost(@ModelAttribute Book book, HttpSession session) throws Exception {
ModelAndView mav = new ModelAndView();
if(bookingService.returnBook(book.getTitle(), session)){
mav.setViewName("redirect:/returnBookSuccessfully");
return mav;
}
else{
mav.setViewName("redirect:/returnBookFailed");
return mav;
}
}
@RequestMapping(value = "/returnBookSuccessfully", method = RequestMethod.GET)
public String returnBookSuccessfully(){
return "returnBookSuccessfully";
}
@RequestMapping(value = "/returnBookFailed", method = RequestMethod.GET)
public String returnBookFailed(){
return "returnBookFailed";
}
}
| [
"istrate_madalina7@yhoo.com"
] | istrate_madalina7@yhoo.com |
da0313e0bbbd2913b5b7c2f0eda6c2259cb9f4e5 | 0521595f94bdad627caadfbed826b259c3edfb99 | /Przelacznik/src/main/Main.java | 5a6216b92e0f9d7bcb21affe5df93d04943c858c | [] | no_license | m3ksyk/Java-exercises-project | ce9e7702e18416fd84c76fe27a872bb1291d2f6e | 56c1f753862bd2e660c0ba9125b348560ad7e67c | refs/heads/master | 2021-09-08T00:42:18.325710 | 2018-02-02T13:27:38 | 2018-02-02T13:27:38 | 111,434,769 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,401 | java |
package main;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Main extends JFrame {
public Main(){
initComponents();
}
public void initComponents()
{
this.setTitle("grupy przelacznikow radio");
this.setBounds(300, 300, 300, 200);
panel2.add(etykieta);
// JRadioButton przelacznik = new JRadioButton("Mały");
// JRadioButton sredniprzelacznik = new JRadioButton("Sredni");
zbudujPrzelacznikRozmiar("Maly", 15);
zbudujPrzelacznikRozmiar("Sredni", 20);
zbudujPrzelacznikRozmiar("Duzy", 25);
zbudujPrzelacznikKolor("zielony", Color.GREEN);
zbudujPrzelacznikKolor("marzena", Color.MAGENTA);
zbudujPrzelacznikKolor("niebieski", Color.BLUE);
this.getContentPane().add(panel, BorderLayout.NORTH);
this.getContentPane().add(panel2, BorderLayout.CENTER);
this.getContentPane().add(panel3, BorderLayout.SOUTH);
// przelacznik.addActionListener(new ActionListener()
// {
// public void actionPerformed(ActionEvent e)
// {
// etykieta.setFont(new Font("Monospaced", Font.PLAIN, 15));
// }
// });
// groupSize.add(przelacznik);
// groupSize.add(sredniprzelacznik);
//
// panel.add(przelacznik);
// panel.add(sredniprzelacznik);
//
this.setDefaultCloseOperation(3);
this.setVisible(true);
}
public void zbudujPrzelacznikRozmiar(String nazwa, int rozmiar)
{
JRadioButton przelacznik = new JRadioButton(nazwa);
przelacznik.addActionListener(new ActionListener()
{ public void actionPerformed(ActionEvent e)
{ etykieta.setFont(new Font("Monospaced", Font.PLAIN, rozmiar));
}
});
groupSize.add(przelacznik);
panel.add(przelacznik);
}
public void zbudujPrzelacznikKolor(String nazwa, final Color k)
{
JRadioButton przelacznikKolor = new JRadioButton(nazwa);
przelacznikKolor.addActionListener(new ActionListener()
{ public void actionPerformed(ActionEvent e)
{ etykieta.setForeground(k);
}
});
groupColor.add(przelacznikKolor);
panel3.add(przelacznikKolor);
}
JPanel panel = new JPanel();
JPanel panel2 = new JPanel();
JPanel panel3 = new JPanel();
JLabel etykieta = new JLabel("Cos");
ButtonGroup groupSize = new ButtonGroup();
ButtonGroup groupColor = new ButtonGroup();
public static void main(String[] args) {
new Main().setVisible(true);
}
}
| [
"32710982+m3ksyk@users.noreply.github.com"
] | 32710982+m3ksyk@users.noreply.github.com |
37f56f684a6530a1afb4a2af588321d9a638a7cc | 71045174193332b64af7fa5da9085a77abde13ad | /gen/com/olegflo/gcm/R.java | b3417b642a1a2f466f9d2232accfe9397287ce47 | [] | no_license | olegflo/simple-android-gcm-example | 1ae12e94ea5981b06152e4742ebf0ba7b277ae86 | cbf46c47c8dfb959f6e3551fe34aa648bf1d7f51 | refs/heads/master | 2021-01-15T18:01:05.327718 | 2012-09-20T19:45:52 | 2012-09-20T19:45:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 468 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.olegflo.gcm;
public final class R {
public static final class attr {
}
public static final class layout {
public static final int main=0x7f020000;
}
public static final class string {
public static final int app_name=0x7f030000;
}
}
| [
"oleg@injoit.com"
] | oleg@injoit.com |
f4b96ebb4329d9ba031aebd088376ce9d023ed5e | a2881dfb3246eebda78c695ede7f5aa0b426aec9 | /1.8 obfuscated/a/ahb.java | 3c4e6af72d4a9a507675619b64eade27a5130ad3 | [] | no_license | Jckf/mc-dev | ca03c1907b4b33c94a7bcb7a2067e3963bbf05d2 | 128dae1fe7e2b7772d89dcf130a49210bfd06aa3 | refs/heads/master | 2016-09-05T11:14:19.324416 | 2014-10-01T00:53:05 | 2014-10-01T00:53:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,597 | java | import java.util.concurrent.Callable;
public class ahb implements vq {
public amj[] a = new amj[36];
public amj[] b = new amj[4];
public int c;
public ahd d;
private amj f;
public boolean e;
public ahb(ahd var1) {
this.d = var1;
}
public amj h() {
return this.c < 9 && this.c >= 0?this.a[this.c]:null;
}
public static int i() {
return 9;
}
private int c(alq var1) {
for(int var2 = 0; var2 < this.a.length; ++var2) {
if(this.a[var2] != null && this.a[var2].b() == var1) {
return var2;
}
}
return -1;
}
private int d(amj var1) {
for(int var2 = 0; var2 < this.a.length; ++var2) {
if(this.a[var2] != null && this.a[var2].b() == var1.b() && this.a[var2].d() && this.a[var2].b < this.a[var2].c() && this.a[var2].b < this.p_() && (!this.a[var2].f() || this.a[var2].i() == var1.i()) && amj.a(this.a[var2], var1)) {
return var2;
}
}
return -1;
}
public int j() {
for(int var1 = 0; var1 < this.a.length; ++var1) {
if(this.a[var1] == null) {
return var1;
}
}
return -1;
}
public int a(alq var1, int var2, int var3, fn var4) {
int var5 = 0;
int var6;
amj var7;
int var8;
for(var6 = 0; var6 < this.a.length; ++var6) {
var7 = this.a[var6];
if(var7 != null && (var1 == null || var7.b() == var1) && (var2 <= -1 || var7.i() == var2) && (var4 == null || cy.a(var4, var7.o(), true))) {
var8 = var3 <= 0?var7.b:Math.min(var3 - var5, var7.b);
var5 += var8;
if(var3 != 0) {
this.a[var6].b -= var8;
if(this.a[var6].b == 0) {
this.a[var6] = null;
}
if(var3 > 0 && var5 >= var3) {
return var5;
}
}
}
}
for(var6 = 0; var6 < this.b.length; ++var6) {
var7 = this.b[var6];
if(var7 != null && (var1 == null || var7.b() == var1) && (var2 <= -1 || var7.i() == var2) && (var4 == null || cy.a(var4, var7.o(), false))) {
var8 = var3 <= 0?var7.b:Math.min(var3 - var5, var7.b);
var5 += var8;
if(var3 != 0) {
this.b[var6].b -= var8;
if(this.b[var6].b == 0) {
this.b[var6] = null;
}
if(var3 > 0 && var5 >= var3) {
return var5;
}
}
}
}
if(this.f != null) {
if(var1 != null && this.f.b() != var1) {
return var5;
}
if(var2 > -1 && this.f.i() != var2) {
return var5;
}
if(var4 != null && !cy.a(var4, this.f.o(), false)) {
return var5;
}
var6 = var3 <= 0?this.f.b:Math.min(var3 - var5, this.f.b);
var5 += var6;
if(var3 != 0) {
this.f.b -= var6;
if(this.f.b == 0) {
this.f = null;
}
if(var3 > 0 && var5 >= var3) {
return var5;
}
}
}
return var5;
}
private int e(amj var1) {
alq var2 = var1.b();
int var3 = var1.b;
int var4 = this.d(var1);
if(var4 < 0) {
var4 = this.j();
}
if(var4 < 0) {
return var3;
} else {
if(this.a[var4] == null) {
this.a[var4] = new amj(var2, 0, var1.i());
if(var1.n()) {
this.a[var4].d((fn)var1.o().b());
}
}
int var5 = var3;
if(var3 > this.a[var4].c() - this.a[var4].b) {
var5 = this.a[var4].c() - this.a[var4].b;
}
if(var5 > this.p_() - this.a[var4].b) {
var5 = this.p_() - this.a[var4].b;
}
if(var5 == 0) {
return var3;
} else {
var3 -= var5;
this.a[var4].b += var5;
this.a[var4].c = 5;
return var3;
}
}
}
public void k() {
for(int var1 = 0; var1 < this.a.length; ++var1) {
if(this.a[var1] != null) {
this.a[var1].a(this.d.o, this.d, var1, this.c == var1);
}
}
}
public boolean a(alq var1) {
int var2 = this.c(var1);
if(var2 < 0) {
return false;
} else {
if(--this.a[var2].b <= 0) {
this.a[var2] = null;
}
return true;
}
}
public boolean b(alq var1) {
int var2 = this.c(var1);
return var2 >= 0;
}
public boolean a(amj var1) {
if(var1 != null && var1.b != 0 && var1.b() != null) {
try {
int var2;
if(var1.g()) {
var2 = this.j();
if(var2 >= 0) {
this.a[var2] = amj.b(var1);
this.a[var2].c = 5;
var1.b = 0;
return true;
} else if(this.d.by.d) {
var1.b = 0;
return true;
} else {
return false;
}
} else {
do {
var2 = var1.b;
var1.b = this.e(var1);
} while(var1.b > 0 && var1.b < var2);
if(var1.b == var2 && this.d.by.d) {
var1.b = 0;
return true;
} else {
return var1.b < var2;
}
}
} catch (Throwable var5) {
b var3 = b.a(var5, "Adding item to inventory");
j var4 = var3.a("Item being added");
var4.a("Item ID", (Object)Integer.valueOf(alq.b(var1.b())));
var4.a("Item data", (Object)Integer.valueOf(var1.i()));
var4.a("Item name", (Callable)(new ahc(this, var1)));
throw new u(var3);
}
} else {
return false;
}
}
public amj a(int var1, int var2) {
amj[] var3 = this.a;
if(var1 >= this.a.length) {
var3 = this.b;
var1 -= this.a.length;
}
if(var3[var1] != null) {
amj var4;
if(var3[var1].b <= var2) {
var4 = var3[var1];
var3[var1] = null;
return var4;
} else {
var4 = var3[var1].a(var2);
if(var3[var1].b == 0) {
var3[var1] = null;
}
return var4;
}
} else {
return null;
}
}
public amj b(int var1) {
amj[] var2 = this.a;
if(var1 >= this.a.length) {
var2 = this.b;
var1 -= this.a.length;
}
if(var2[var1] != null) {
amj var3 = var2[var1];
var2[var1] = null;
return var3;
} else {
return null;
}
}
public void a(int var1, amj var2) {
amj[] var3 = this.a;
if(var1 >= var3.length) {
var1 -= var3.length;
var3 = this.b;
}
var3[var1] = var2;
}
public float a(atr var1) {
float var2 = 1.0F;
if(this.a[this.c] != null) {
var2 *= this.a[this.c].a(var1);
}
return var2;
}
public fv a(fv var1) {
int var2;
fn var3;
for(var2 = 0; var2 < this.a.length; ++var2) {
if(this.a[var2] != null) {
var3 = new fn();
var3.a("Slot", (byte)var2);
this.a[var2].b(var3);
var1.a((gd)var3);
}
}
for(var2 = 0; var2 < this.b.length; ++var2) {
if(this.b[var2] != null) {
var3 = new fn();
var3.a("Slot", (byte)(var2 + 100));
this.b[var2].b(var3);
var1.a((gd)var3);
}
}
return var1;
}
public void b(fv var1) {
this.a = new amj[36];
this.b = new amj[4];
for(int var2 = 0; var2 < var1.c(); ++var2) {
fn var3 = var1.b(var2);
int var4 = var3.d("Slot") & 255;
amj var5 = amj.a(var3);
if(var5 != null) {
if(var4 >= 0 && var4 < this.a.length) {
this.a[var4] = var5;
}
if(var4 >= 100 && var4 < this.b.length + 100) {
this.b[var4 - 100] = var5;
}
}
}
}
public int n_() {
return this.a.length + 4;
}
public amj a(int var1) {
amj[] var2 = this.a;
if(var1 >= var2.length) {
var1 -= var2.length;
var2 = this.b;
}
return var2[var1];
}
public String d_() {
return "container.inventory";
}
public boolean k_() {
return false;
}
public ho e_() {
return (ho)(this.k_()?new hy(this.d_()):new hz(this.d_(), new Object[0]));
}
public int p_() {
return 64;
}
public boolean b(atr var1) {
if(var1.r().l()) {
return true;
} else {
amj var2 = this.a(this.c);
return var2 != null?var2.b(var1):false;
}
}
public amj e(int var1) {
return this.b[var1];
}
public int m() {
int var1 = 0;
for(int var2 = 0; var2 < this.b.length; ++var2) {
if(this.b[var2] != null && this.b[var2].b() instanceof ajn) {
int var3 = ((ajn)this.b[var2].b()).c;
var1 += var3;
}
}
return var1;
}
public void a(float var1) {
var1 /= 4.0F;
if(var1 < 1.0F) {
var1 = 1.0F;
}
for(int var2 = 0; var2 < this.b.length; ++var2) {
if(this.b[var2] != null && this.b[var2].b() instanceof ajn) {
this.b[var2].a((int)var1, (xm)this.d);
if(this.b[var2].b == 0) {
this.b[var2] = null;
}
}
}
}
public void n() {
int var1;
for(var1 = 0; var1 < this.a.length; ++var1) {
if(this.a[var1] != null) {
this.d.a(this.a[var1], true, false);
this.a[var1] = null;
}
}
for(var1 = 0; var1 < this.b.length; ++var1) {
if(this.b[var1] != null) {
this.d.a(this.b[var1], true, false);
this.b[var1] = null;
}
}
}
public void o_() {
this.e = true;
}
public void b(amj var1) {
this.f = var1;
}
public amj p() {
return this.f;
}
public boolean a(ahd var1) {
return this.d.I?false:var1.h(this.d) <= 64.0D;
}
public boolean c(amj var1) {
int var2;
for(var2 = 0; var2 < this.b.length; ++var2) {
if(this.b[var2] != null && this.b[var2].a(var1)) {
return true;
}
}
for(var2 = 0; var2 < this.a.length; ++var2) {
if(this.a[var2] != null && this.a[var2].a(var1)) {
return true;
}
}
return false;
}
public void b(ahd var1) {}
public void c(ahd var1) {}
public boolean b(int var1, amj var2) {
return true;
}
public void b(ahb var1) {
int var2;
for(var2 = 0; var2 < this.a.length; ++var2) {
this.a[var2] = amj.b(var1.a[var2]);
}
for(var2 = 0; var2 < this.b.length; ++var2) {
this.b[var2] = amj.b(var1.b[var2]);
}
this.c = var1.c;
}
public int a_(int var1) {
return 0;
}
public void b(int var1, int var2) {}
public int g() {
return 0;
}
public void l() {
int var1;
for(var1 = 0; var1 < this.a.length; ++var1) {
this.a[var1] = null;
}
for(var1 = 0; var1 < this.b.length; ++var1) {
this.b[var1] = null;
}
}
}
| [
"jckf@jckf.no"
] | jckf@jckf.no |
f07b8b64f24b62ec8fa32952b9a47e878c20d9ce | 3b6eab9e253e73a02157f35ca9d7bb0c4ec7c942 | /src/com/intalio/android/DAO/ContractsDAO.java | 6f4add2bcfef47a5bad547e09cf576a0c4fe03b7 | [] | no_license | vinod-intalio/mobileui | 48d4c8c7d61b4c0893d9ac8b0d5c6a6c5cd5ec21 | afad421e5b0293545aae8cdb477cb78ec8a4c2ad | refs/heads/master | 2021-01-18T09:10:40.873768 | 2012-04-02T12:40:03 | 2012-04-02T12:40:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,607 | java | package com.intalio.android.DAO;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
/**
* DAO class for Contracts.
*
* @author ankit
*/
public class ContractsDAO extends SqlMapClientDaoSupport {
public List getContracts(int offset, int limit) {
int rowsfrom = offset - 1;
int rowsto = limit - rowsfrom;
Map QueryData = new HashMap();
QueryData.put("startFrom", rowsfrom);
QueryData.put("upto", rowsto);
return super.getSqlMapClientTemplate().queryForList("getContracts",
QueryData);
}
public List getContractsOnIDMain(String id) {
Map QueryData = new HashMap();
QueryData.put("id", id);
return super.getSqlMapClientTemplate().queryForList(
"getContractsOnIDMain", QueryData);
}
public List getContractsOnIDStandard(String id) {
Map QueryData = new HashMap();
QueryData.put("id", id);
return super.getSqlMapClientTemplate().queryForList(
"getContractsOnIDStandard", QueryData);
}
public List getContractsOnIDSpecific(String id) {
Map QueryData = new HashMap();
QueryData.put("id", id);
return super.getSqlMapClientTemplate().queryForList(
"getContractsOnIDSpecific", QueryData);
}
public List getContractsOnAccountID(long xid, int offset, int limit) {
int rowsfrom = offset - 1;
int rowsto = limit - rowsfrom;
Map QueryData = new HashMap();
QueryData.put("startFrom", rowsfrom);
QueryData.put("upto", rowsto);
QueryData.put("id", xid);
return super.getSqlMapClientTemplate().queryForList(
"getContractsOnAccountID", QueryData);
}
} | [
"vaish@intalio.com"
] | vaish@intalio.com |
5436b3be5be07da2046883ce537a9e5375f47b69 | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdasApi21/applicationModule/src/main/java/applicationModulepackageJava1/Foo652.java | 5e9357cb444c39e89c54b2e4ce3a113394c33d6b | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 346 | java | package applicationModulepackageJava1;
public class Foo652 {
public void foo0() {
new applicationModulepackageJava1.Foo651().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
7449e2ec8b36f2cc80b6972d8a7fc14dca8d78c7 | f37f327b8df414d64cae193709b18e204d3f8e2d | /reinforcement/src/_3_回溯/BackTracking.java | b5f8b8927775a1387027a21601aa5bb410f39c74 | [] | no_license | ITflying/leetcode-solution | da4031aa5c181f797bdf3c92875a9b71f164fb4c | 92912aa5f8d22ba1b06c314f4e3673ba15424aa7 | refs/heads/master | 2021-06-20T06:09:58.562797 | 2021-04-06T01:29:56 | 2021-04-06T01:29:56 | 203,513,347 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 965 | java | package _3_回溯;
import java.util.HashMap;
/**
* 回溯算法:优选搜索法,按优选条件向前搜索,以达到目标。
* 当达不到就返回上一步,本质是穷举法,但是会有剪枝函数帮忙去除不可能到达的点。
* @date 2019/9/24
**/
public class BackTracking {
public static void main(String args[]) {
testBackTracking(1);
}
private static void testBackTracking(int flag) {
switch (flag){
case 1:
break;
default:
System.out.println("test");
break;
}
}
/**
* 八皇后问题
* 十九世纪著名的数学家高斯1850年提出:在8X8格的国际象棋上摆放八个皇后(棋子),使其不能互相攻击,
* 即任意两个皇后都不能处于同一行、同一列或同一斜线上。
*/
public static void eightQueeen(String whatMater){
}
}
| [
"442665858@qq.com"
] | 442665858@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.