blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 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
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2717e6ab2d829096d7c93d78c4a62a241c880445 | fb750899510b0c2bad660914459292761d6dbade | /checkproj/src/test/java/checkproj/app/server/service/aaaboundedcontext/authentication/LoginTestCase.java | 01194e3c2b119c05b7078380244233b6c117d183 | [] | no_license | applifireAlgo/newRepo | 4123e1aa8df10579ccb2fa504441e8478745f8ed | 4d10db38e36f59a2d3c7e31328cde75586e3bde7 | refs/heads/master | 2021-01-10T13:56:26.311919 | 2016-03-31T13:23:15 | 2016-03-31T13:23:15 | 55,151,442 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 32,811 | java | package checkproj.app.server.service.aaaboundedcontext.authentication;
import checkproj.app.server.service.EntityTestCriteria;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import checkproj.app.config.WebConfigExtended;
import org.springframework.test.context.ContextConfiguration;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
import org.springframework.test.context.TestExecutionListeners;
import checkproj.app.server.repository.aaaboundedcontext.authentication.LoginRepository;
import checkproj.app.shared.aaaboundedcontext.authentication.Login;
import org.springframework.beans.factory.annotation.Autowired;
import com.athena.framework.server.helper.RuntimeLogInfoHelper;
import com.athena.framework.server.helper.EntityValidatorHelper;
import com.athena.framework.server.test.RandomValueGenerator;
import java.util.HashMap;
import java.util.List;
import com.spartan.healthmeter.entity.scheduler.ArtMethodCallStack;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.junit.Before;
import org.junit.After;
import com.athena.framework.shared.entity.web.entityInterface.CommonEntityInterface.RECORD_TYPE;
import org.junit.Test;
import checkproj.app.shared.aaaboundedcontext.authentication.User;
import checkproj.app.server.repository.aaaboundedcontext.authentication.UserRepository;
import checkproj.app.shared.aaaboundedcontext.authentication.UserAccessDomain;
import checkproj.app.server.repository.aaaboundedcontext.authentication.UserAccessDomainRepository;
import checkproj.app.shared.aaaboundedcontext.authentication.UserAccessLevel;
import checkproj.app.server.repository.aaaboundedcontext.authentication.UserAccessLevelRepository;
import checkproj.app.shared.aaaboundedcontext.authentication.PassRecovery;
import checkproj.app.shared.aaaboundedcontext.authentication.Question;
import checkproj.app.server.repository.aaaboundedcontext.authentication.QuestionRepository;
import checkproj.app.shared.aaaboundedcontext.authentication.UserData;
import checkproj.app.shared.organizationboundedcontext.contacts.CoreContacts;
import checkproj.app.server.repository.organizationboundedcontext.contacts.CoreContactsRepository;
import checkproj.app.shared.organizationboundedcontext.location.Language;
import checkproj.app.server.repository.organizationboundedcontext.location.LanguageRepository;
import checkproj.app.shared.organizationboundedcontext.contacts.Gender;
import checkproj.app.server.repository.organizationboundedcontext.contacts.GenderRepository;
import checkproj.app.shared.organizationboundedcontext.location.Timezone;
import checkproj.app.server.repository.organizationboundedcontext.location.TimezoneRepository;
import checkproj.app.shared.organizationboundedcontext.contacts.Title;
import checkproj.app.server.repository.organizationboundedcontext.contacts.TitleRepository;
import checkproj.app.shared.organizationboundedcontext.location.Address;
import checkproj.app.server.repository.organizationboundedcontext.location.AddressRepository;
import checkproj.app.shared.organizationboundedcontext.location.State;
import checkproj.app.server.repository.organizationboundedcontext.location.StateRepository;
import checkproj.app.shared.organizationboundedcontext.location.Country;
import checkproj.app.server.repository.organizationboundedcontext.location.CountryRepository;
import checkproj.app.shared.organizationboundedcontext.location.City;
import checkproj.app.server.repository.organizationboundedcontext.location.CityRepository;
import checkproj.app.shared.organizationboundedcontext.location.AddressType;
import checkproj.app.server.repository.organizationboundedcontext.location.AddressTypeRepository;
import checkproj.app.shared.organizationboundedcontext.contacts.CommunicationData;
import checkproj.app.shared.organizationboundedcontext.contacts.CommunicationGroup;
import checkproj.app.server.repository.organizationboundedcontext.contacts.CommunicationGroupRepository;
import checkproj.app.shared.organizationboundedcontext.contacts.CommunicationType;
import checkproj.app.server.repository.organizationboundedcontext.contacts.CommunicationTypeRepository;
import com.athena.framework.server.exception.biz.SpartanConstraintViolationException;
import com.athena.framework.server.exception.biz.SpartanIncorrectDataException;
import com.athena.framework.server.exception.repository.SpartanPersistenceException;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes = WebConfigExtended.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
@TestExecutionListeners({ org.springframework.test.context.support.DependencyInjectionTestExecutionListener.class, org.springframework.test.context.support.DirtiesContextTestExecutionListener.class, org.springframework.test.context.transaction.TransactionalTestExecutionListener.class })
public class LoginTestCase extends EntityTestCriteria {
@Autowired
private LoginRepository<Login> loginRepository;
@Autowired
private RuntimeLogInfoHelper runtimeLogInfoHelper;
@Autowired
private EntityValidatorHelper<Object> entityValidator;
private RandomValueGenerator valueGenerator = new RandomValueGenerator();
private static HashMap<String, Object> map = new HashMap<String, Object>();
private static List<EntityTestCriteria> entityContraint;
@Autowired
private ArtMethodCallStack methodCallStack;
protected MockHttpSession session;
protected MockHttpServletRequest request;
protected MockHttpServletResponse response;
protected void startSession() {
session = new MockHttpSession();
}
protected void endSession() {
session.clearAttributes();
session.invalidate();
session = null;
}
protected void startRequest() {
request = new MockHttpServletRequest();
request.setSession(session);
org.springframework.web.context.request.RequestContextHolder.setRequestAttributes(new org.springframework.web.context.request.ServletRequestAttributes(request));
}
protected void endRequest() {
((org.springframework.web.context.request.ServletRequestAttributes) org.springframework.web.context.request.RequestContextHolder.getRequestAttributes()).requestCompleted();
org.springframework.web.context.request.RequestContextHolder.resetRequestAttributes();
request = null;
}
@Before
public void before() {
startSession();
startRequest();
setBeans();
}
@After
public void after() {
endSession();
endRequest();
}
private void setBeans() {
runtimeLogInfoHelper.createRuntimeLogUserInfo(1, "AAAAA", request.getRemoteHost());
org.junit.Assert.assertNotNull(runtimeLogInfoHelper);
methodCallStack.setRequestId(java.util.UUID.randomUUID().toString().toUpperCase());
entityContraint = addingListOfFieldForNegativeTesting();
}
private Login createLogin(Boolean isSave) throws SpartanPersistenceException, SpartanConstraintViolationException {
User user = new User();
user.setLastPasswordChangeDate(new java.sql.Timestamp(1459429928651l));
user.setPasswordAlgo("XuJMUlvr8Et7ImCmnckDKF8Ogln5mqtM5idyq4ji2kHc45UjAf");
UserAccessDomain useraccessdomain = new UserAccessDomain();
useraccessdomain.setDomainIcon("89h2mM5jEnLeifbl9hFmmklESR6KKwAGx6HZEp9tki07sosmOQ");
useraccessdomain.setDomainName("g0OYpxhPSJfcaR9AAzQ1dT90K5XMcSxgUhG1liC9h6yrgbYnXS");
useraccessdomain.setDomainDescription("Dk3r4IaPQ3McYz8B6P4MXLkTQQXcYUhozYeEW48iDmCGXjUOUm");
useraccessdomain.setUserAccessDomain(valueGenerator.getRandomInteger(99999, 0));
useraccessdomain.setDomainHelp("2vZAWZGMdI8NaHvuS2v0dKpK2Uu4RHfTnrKgyLGEI6ZtEjRM59");
UserAccessDomain UserAccessDomainTest = new UserAccessDomain();
if (isSave) {
UserAccessDomainTest = useraccessdomainRepository.save(useraccessdomain);
map.put("UserAccessDomainPrimaryKey", useraccessdomain._getPrimarykey());
}
UserAccessLevel useraccesslevel = new UserAccessLevel();
useraccesslevel.setUserAccessLevel(valueGenerator.getRandomInteger(99999, 0));
useraccesslevel.setLevelName("1K8kxS2v2oGBdLltiyxTvJHUqUUV66Ne4hckQ6fF97m4CNC5vR");
useraccesslevel.setLevelDescription("5jS9eS6uWdhPI8C9YSWUHot3MIxliD0nXkKejtCsdsso1dwLje");
useraccesslevel.setLevelHelp("Gd2qB8gLrE0iCQU9j1ayHcs1qcgBfB90h4YT1aHNACijCW86Ms");
useraccesslevel.setLevelIcon("Vf87xieg7tdLH21LZ9Sb0Q70IaKNoIS8iu6X3EXJMlWf8PryqR");
UserAccessLevel UserAccessLevelTest = new UserAccessLevel();
if (isSave) {
UserAccessLevelTest = useraccesslevelRepository.save(useraccesslevel);
map.put("UserAccessLevelPrimaryKey", useraccesslevel._getPrimarykey());
}
user.setLastPasswordChangeDate(new java.sql.Timestamp(1459429928704l));
user.setPasswordAlgo("Bsydq1aHVPtu5pvb5fbLui1tLLcRNGgmTnqqMPgSVYNCeY18nn");
user.setUserAccessDomainId((java.lang.String) UserAccessDomainTest._getPrimarykey()); /* ******Adding refrenced table data */
user.setGenTempOneTimePassword(1);
user.setUserAccessCode(30123);
user.setIsLocked(1);
user.setAllowMultipleLogin(1);
user.setChangePasswordNextLogin(1);
user.setUserAccessLevelId((java.lang.String) UserAccessLevelTest._getPrimarykey()); /* ******Adding refrenced table data */
user.setSessionTimeout(2787);
user.setIsDeleted(1);
user.setMultiFactorAuthEnabled(1);
user.setPasswordExpiryDate(new java.sql.Timestamp(1459429928890l));
java.util.List<PassRecovery> listOfPassRecovery = new java.util.ArrayList<PassRecovery>();
PassRecovery passrecovery = new PassRecovery();
Question question = new Question();
question.setQuestion("Wsj7FgrO8imKLDFv0eV0p0vzdM6MoHu8mKImMnCoCvgD8hagPu");
question.setQuestionIcon("wwzjAjsLv1eP1Qnig4KsvMcbpviYBxgrnP2oRijzuF1SJbTDub");
question.setQuestionDetails("5xgivBNT5l");
question.setLevelid(8);
Question QuestionTest = new Question();
if (isSave) {
QuestionTest = questionRepository.save(question);
map.put("QuestionPrimaryKey", question._getPrimarykey());
}
passrecovery.setUser(user);
passrecovery.setAnswer("YSAPFkAhRRoL5YbyJse31EBxq54CFisftVW71Rih0mQcIenpdk");
passrecovery.setQuestionId((java.lang.String) QuestionTest._getPrimarykey()); /* ******Adding refrenced table data */
listOfPassRecovery.add(passrecovery);
user.addAllPassRecovery(listOfPassRecovery);
UserData userdata = new UserData();
userdata.setLast5Passwords("BeAJOpahg7bf24HOHQFR3r7p0CW8DNGwKuYu2evFWbzcZn7hNn");
userdata.setOneTimePasswordExpiry(1);
userdata.setOneTimePassword("IiNROwXFx4GkuI6ChV6ygrWsAAkV9kjH");
userdata.setOneTimePasswordGenDate(new java.sql.Timestamp(1459429929402l));
userdata.setPassword("vuLTRv0d2djq3NpaDdz8zRQZPScwvpjphYGCCmHj1mamhPRgpO");
userdata.setLast5Passwords("ZNOv9oNT6v196NtoovbL06d4XqMRBSYeI470uDBVGiS2OtrhYr");
userdata.setOneTimePasswordExpiry(3);
userdata.setOneTimePassword("AvpCLBPgkAlImUdMEQyOpCnWWixLW67R");
userdata.setOneTimePasswordGenDate(new java.sql.Timestamp(1459429929459l));
userdata.setPassword("PpEgfWCJGUoCvtbQKKZxsdkkMYglnBEcDJCTtEG6irKoAgFklO");
userdata.setUser(user);
user.setUserData(userdata);
CoreContacts corecontacts = new CoreContacts();
corecontacts.setNativeTitle("M15oGlUIzUkHeNX8B5DZAUc0fCHFvM80X1MKTOPJtsy4cmflFh");
Language language = new Language();
language.setAlpha3("tsV");
language.setLanguage("hQQtEnidzWUtw1IvuF6SYhkDoRVvGgKETAWDnhoSs7iqzQJVlf");
language.setAlpha4("lUzU");
language.setAlpha4parentid(1);
language.setLanguageIcon("jtFIKMODy2iC1iXJz3TwzYxLXvPEiZph1PAF2cl9QcYcYKTVLu");
language.setLanguageDescription("xZ5y1nZjQIqyOrxfUlq7eqpGxYTSuwVRMjre6oJM1CuW57U3je");
language.setLanguageType("aWlHWuppzfPYUM739bJ5o8uB0pjv5c4V");
language.setAlpha2("Oq");
Language LanguageTest = new Language();
if (isSave) {
LanguageTest = languageRepository.save(language);
map.put("LanguagePrimaryKey", language._getPrimarykey());
}
Gender gender = new Gender();
gender.setGender("3CB2NFpvBWiZ2kCesRrTcVCNMiVZpeSTMdqM3sFBpud5w4vdnD");
Gender GenderTest = new Gender();
if (isSave) {
GenderTest = genderRepository.save(gender);
map.put("GenderPrimaryKey", gender._getPrimarykey());
}
Timezone timezone = new Timezone();
timezone.setTimeZoneLabel("5Tm3RjCtlx03k52OP9eHyRL1NjmiqB6q9MVu9xZiJurqKqxfGW");
timezone.setUtcdifference(6);
timezone.setCities("uvaN10vywYgVelVPKrD7lXUSNIju7MCLFassNpgN4Jej9puB2m");
timezone.setCountry("JfQ1swRckX08u3dnewElETyF0p1z5YwZMfLLxFEQJ1md2Xx0LN");
timezone.setGmtLabel("yN4FPLfLwWizSsMZIUAZ7rqyyLBtFu19lUjatSGLbhPFR6JAhk");
Title title = new Title();
title.setTitles("fcILPYSJVr6PmOpqz42vTREP2qIOCrrVGFK0m3lBgzfZTe1M9A");
Title TitleTest = new Title();
if (isSave) {
TitleTest = titleRepository.save(title);
map.put("TitlePrimaryKey", title._getPrimarykey());
}
corecontacts.setNativeTitle("zKthjqOwtsTjgrqqgQpuUNCMFVlT5MqYYL0kZgL5OrRmQiBetT");
corecontacts.setNativeLanguageCode((java.lang.String) LanguageTest._getPrimarykey()); /* ******Adding refrenced table data */
corecontacts.setAge(41);
corecontacts.setGenderId((java.lang.String) GenderTest._getPrimarykey()); /* ******Adding refrenced table data */
corecontacts.setMiddleName("gulkFFBUB52fkQjOW5a9BwtoeghCO57AP1Zl87Qyp1FmS1rGgH");
corecontacts.setLastName("mPk8EWJvrGvzR8ouGIqXm83oqpp91jIYGm7aWboOayBqWamwAy");
corecontacts.setApproximateDOB(new java.sql.Timestamp(1459429930033l));
timezone.setTimeZoneId(null);
corecontacts.setTimezone(isSave ? timezoneRepository.save(timezone) : timezone);
map.put("TimezonePrimaryKey", timezone._getPrimarykey());
corecontacts.setPhoneNumber("C5T8M0aB8AcF3r53ZViy");
corecontacts.setNativeMiddleName("j4uNfEHj8lyGaSKiSWnNNVDtksr124xxXnGstFhBoLpxIVlg2r");
corecontacts.setNativeFirstName("WK9u9Epaws73pQ2X2dPtzkf05Tim6uSdv3JeHQdNSTH3dDcCg5");
corecontacts.setTitleId((java.lang.String) TitleTest._getPrimarykey()); /* ******Adding refrenced table data */
corecontacts.setDateofbirth(new java.sql.Timestamp(1459429930245l));
corecontacts.setEmailId("7yKuwjXmPdCNusDZySpoSaDMaU0xFYihCTzBm4rTxMrUj3uGMG");
corecontacts.setFirstName("hHGK8a6zxOLhfqKaXofMcqaRRS0Yg3pD4AziTpE7EL9kiQpm2x");
corecontacts.setNativeLastName("bk2yBlIS5umbSGAgvBoGl4RVBx8rQwhhDzEeWU1tUQu9IHO3At");
java.util.List<Address> listOfAddress = new java.util.ArrayList<Address>();
Address address = new Address();
address.setZipcode("TAOfZ2");
address.setAddress1("P5xNuESMvUFmyzR1EnK3S9VzQtPEKMzIdEDDKhhpZO937luOCw");
address.setLatitude("R3f6eLlmZa4PNY8sq5SRRMZVr4ej2K8X4baQM1BNLtZ960dKWR");
address.setAddress3("rBvrZMyFDXuRBJvusa01cnDWk6wCmH37OlTbihYLWZ4JsI5Wuk");
State state = new State();
state.setStateCapitalLatitude(6);
state.setStateFlag("VhFIkLqBgVssIqS7rVY7ER7knuyuwn0ruXstLLq3ZBtsk7gPaf");
state.setStateCodeChar3("fz1dP0j2pf88vZQKA3NMaGRe0YjKRofP");
Country country = new Country();
country.setCapitalLatitude(4);
country.setCapital("ly2KRwoNndCZqQwyJ2FM4uGyFJLVf6et");
country.setCurrencyCode("aAk");
country.setCurrencyName("T7DIoAPjvWgvd5IxzzmHdcGuME68DkeoPj2WG0TxITXrkH3wWY");
country.setIsoNumeric(364);
country.setCountryFlag("AAqTQD21cSfgMuPvSv5f6gPkKpfWN4Uk0HV2DRnC3BbMLKoE0w");
country.setCapitalLongitude(3);
country.setCountryCode2("YnU");
country.setCurrencySymbol("Rhh6nSTKPNFdtIBKE6kxUmuBWvdnU3RX");
country.setCountryCode1("qb6");
country.setCountryName("JoW3mV0eOEEBo4rO7pSiPyhZ4nuUfYPqcJzLsoQoQbL7xAgqoP");
Country CountryTest = new Country();
if (isSave) {
CountryTest = countryRepository.save(country);
map.put("CountryPrimaryKey", country._getPrimarykey());
}
state.setStateCapitalLatitude(7);
state.setStateFlag("AWBmtnnvaZYCH4XNGo5seDxSwp9aBtmBOELV6YFhH4cDuW4fgU");
state.setStateCodeChar3("VAIPRvJlqR8p8LWy1cMF7MwROxQIo1rf");
state.setCountryId((java.lang.String) CountryTest._getPrimarykey()); /* ******Adding refrenced table data */
state.setStateCapitalLongitude(1);
state.setStateCode(1);
state.setStateDescription("KOz04aDYJ02ZMgCFNfcP6joZjL4m7fEO8nBO5uKVIH5i5kQ5Q5");
state.setStateName("49Xts3nzYT3eYvQOOWLI67haBh7dHuoCrUTxZckKgu6n5K6W2Z");
state.setStateCodeChar2("ftCmwdiV5UNHJO1hHgLt8He50nvgVf3D");
state.setStateCapital("oRH72nM9qnQDlHQU2knrAicLDujVvEpFWU4yR4Zn8yX3HcKOhI");
State StateTest = new State();
if (isSave) {
StateTest = stateRepository.save(state);
map.put("StatePrimaryKey", state._getPrimarykey());
}
City city = new City();
city.setCityName("H8xpNAFfryBk2bIMT2dJttM3X1Fuc23iYErniikECnkPz8H4ps");
city.setCityCodeChar2("W7MgZ5ac4zO1DSSpypa4OSZ2Li5PoEYE");
city.setCityName("nfNNzu2gI5df0oQuQ5VL0fcDoPn5nXe6UBjFtfvQhOsKhRMsNh");
city.setCityCodeChar2("gepCCkp6YaZZrHz3n6m7d5zEIWk2TE4T");
city.setCountryId((java.lang.String) CountryTest._getPrimarykey()); /* ******Adding refrenced table data */
city.setCityFlag("eyXzvkdvQvT5Xc3iTmzjKH9d2eis3fj4UFBrZAV0crZhi5yO2n");
city.setCityLatitude(9);
city.setCityDescription("hGeP6bpbs5D9SXtnYq3VKztWUEVquOMjwBf9OIcfyreGXMqt0Q");
city.setStateId((java.lang.String) StateTest._getPrimarykey()); /* ******Adding refrenced table data */
city.setCityLongitude(11);
city.setCityCode(1);
City CityTest = new City();
if (isSave) {
CityTest = cityRepository.save(city);
map.put("CityPrimaryKey", city._getPrimarykey());
}
AddressType addresstype = new AddressType();
addresstype.setAddressTypeDesc("Rj03RDJs5eB8lad4FhLYNwq5Bbb2LY3VopuzkU0En0QQTEHXOA");
addresstype.setAddressTypeIcon("UBs9ZN7rwQ2UiP1XHxrJjfbpQv7tRSsSnaVeWJTbwvlshGtEqd");
addresstype.setAddressType("Mjked5WLopIPCtpe19cWFpGM884I8s3uCuaMEyPSkqswXdOhYR");
AddressType AddressTypeTest = new AddressType();
if (isSave) {
AddressTypeTest = addresstypeRepository.save(addresstype);
map.put("AddressTypePrimaryKey", addresstype._getPrimarykey());
}
address.setZipcode("6O8OKZ");
address.setAddress1("E2dk2vnhs0dxualxuXFsDOdPGbhkV7ZXPDwyd5cXaTqAcrKDzx");
address.setLatitude("ZBprr4hQ5RhtZhxRzNKq033MMpqoAsJNEmEjLAxtGJBPwdXAZo");
address.setAddress3("FRQx4fMHwgdLtBVcOX4eTkqJteeGpcqFDP4raDqBjBoIGOSV6n");
address.setStateId((java.lang.String) StateTest._getPrimarykey()); /* ******Adding refrenced table data */
address.setLongitude("2PQlUHLe8aTwvuatNEtaVDWigAhVeX5bqokKFbxnEB9gVmFH3H");
address.setCityId((java.lang.String) CityTest._getPrimarykey()); /* ******Adding refrenced table data */
address.setCountryId((java.lang.String) CountryTest._getPrimarykey()); /* ******Adding refrenced table data */
address.setAddressLabel("582cyOxcgFm");
address.setAddress2("4hCOcepJpZYdbU4sYXw4oIAlEowmGLBqH1F4EbWbn7b6JvbwXb");
address.setAddressTypeId((java.lang.String) AddressTypeTest._getPrimarykey()); /* ******Adding refrenced table data */
listOfAddress.add(address);
corecontacts.addAllAddress(listOfAddress);
java.util.List<CommunicationData> listOfCommunicationData = new java.util.ArrayList<CommunicationData>();
CommunicationData communicationdata = new CommunicationData();
CommunicationGroup communicationgroup = new CommunicationGroup();
communicationgroup.setCommGroupName("ryb6pFdAKUT00mRmlKdapMDbDqAZwRu86yh78JbfHmJVCjQfBY");
communicationgroup.setCommGroupDescription("Ss1sPuTtlaUKowDXJX1MlnTG2dJrCbunPUlLGBO203YMZkSnCc");
CommunicationGroup CommunicationGroupTest = new CommunicationGroup();
if (isSave) {
CommunicationGroupTest = communicationgroupRepository.save(communicationgroup);
map.put("CommunicationGroupPrimaryKey", communicationgroup._getPrimarykey());
}
CommunicationType communicationtype = new CommunicationType();
communicationtype.setCommTypeDescription("ylfAqxdrnjPnZcFE0VEjcGujY8N07re449t1rPQIZbLhzcRLhp");
communicationtype.setCommTypeName("5EP0aynIIAQPSLA4bowFCVTLaLm87EkhdAItSHcKiNfllcXWMm");
communicationtype.setCommTypeDescription("ILd6u9p8wTMO2OUExSE9bmMHeC7xaaH5Hvur5X8yNRwTVigoBt");
communicationtype.setCommTypeName("7I2q9qF9w65625pSiKZEHrdRcOFMTUyx0He9NUOspgU8TqYITE");
communicationtype.setCommGroupId((java.lang.String) CommunicationGroupTest._getPrimarykey()); /* ******Adding refrenced table data */
CommunicationType CommunicationTypeTest = new CommunicationType();
if (isSave) {
CommunicationTypeTest = communicationtypeRepository.save(communicationtype);
map.put("CommunicationTypePrimaryKey", communicationtype._getPrimarykey());
}
communicationdata.setCommGroupId((java.lang.String) CommunicationGroupTest._getPrimarykey()); /* ******Adding refrenced table data */
communicationdata.setCommData("");
communicationdata.setCommType((java.lang.String) CommunicationTypeTest._getPrimarykey());
listOfCommunicationData.add(communicationdata);
corecontacts.addAllCommunicationData(listOfCommunicationData);
Login login = new Login();
login.setServerAuthImage("Pt7DkDVSEVSJWGQvWkImzqxAZyeyKyU6");
login.setFailedLoginAttempts(1);
login.setServerAuthText("q8hvsgePzg9s2G1a");
user.setUserId(null);
login.setUser(user);
login.setIsAuthenticated(true);
login.setLoginId("L0nFLjRpviHEjds9EVivB6gCrLfvGPVeC9eo7LgnIXhK8T6mGU");
corecontacts.setContactId(null);
login.setCoreContacts(corecontacts);
login.setEntityValidator(entityValidator);
return login;
}
@Test
public void test1Save() {
try {
Login login = createLogin(true);
login.setEntityAudit(1, "xyz", RECORD_TYPE.ADD);
login.isValid();
loginRepository.save(login);
map.put("LoginPrimaryKey", login._getPrimarykey());
map.put("UserPrimaryKey", login.getUser()._getPrimarykey());
map.put("CoreContactsPrimaryKey", login.getCoreContacts()._getPrimarykey());
} catch (com.athena.framework.server.exception.biz.SpartanConstraintViolationException e) {
org.junit.Assert.fail(e.getMessage());
} catch (java.lang.Exception e) {
org.junit.Assert.fail(e.getMessage());
}
}
@Autowired
private UserRepository<User> userRepository;
@Autowired
private UserAccessDomainRepository<UserAccessDomain> useraccessdomainRepository;
@Autowired
private UserAccessLevelRepository<UserAccessLevel> useraccesslevelRepository;
@Autowired
private QuestionRepository<Question> questionRepository;
@Autowired
private CoreContactsRepository<CoreContacts> corecontactsRepository;
@Autowired
private LanguageRepository<Language> languageRepository;
@Autowired
private GenderRepository<Gender> genderRepository;
@Autowired
private TimezoneRepository<Timezone> timezoneRepository;
@Autowired
private TitleRepository<Title> titleRepository;
@Autowired
private AddressRepository<Address> addressRepository;
@Autowired
private StateRepository<State> stateRepository;
@Autowired
private CountryRepository<Country> countryRepository;
@Autowired
private CityRepository<City> cityRepository;
@Autowired
private AddressTypeRepository<AddressType> addresstypeRepository;
@Autowired
private CommunicationGroupRepository<CommunicationGroup> communicationgroupRepository;
@Autowired
private CommunicationTypeRepository<CommunicationType> communicationtypeRepository;
@Test
public void test2Update() {
try {
org.junit.Assert.assertNotNull(map.get("LoginPrimaryKey"));
Login login = loginRepository.findById((java.lang.String) map.get("LoginPrimaryKey"));
login.setServerAuthImage("Ub2sFkX6f5kUqfeBLDkMD3Ds4aJ450uB");
login.setFailedLoginAttempts(7);
login.setVersionId(1);
login.setServerAuthText("va9ReWT5sWvL8Rhy");
login.setLoginId("NofZOg1Paky8mojDuO06W0wKlwEESsR1TGXmyLlQ7mgLqZydkg");
login.setEntityAudit(1, "xyz", RECORD_TYPE.UPDATE);
loginRepository.update(login);
} catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) {
org.junit.Assert.fail(e.getMessage());
} catch (java.lang.Exception e) {
org.junit.Assert.fail(e.getMessage());
}
}
@Test
public void test3FindById() {
try {
org.junit.Assert.assertNotNull(map.get("LoginPrimaryKey"));
loginRepository.findById((java.lang.String) map.get("LoginPrimaryKey"));
} catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) {
org.junit.Assert.fail(e.getMessage());
} catch (Exception e) {
org.junit.Assert.fail(e.getMessage());
}
}
@Test
public void testNQFindMappedUser() {
try {
loginRepository.FindMappedUser();
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testNQFindUnMappedUser() {
try {
loginRepository.FindUnMappedUser();
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void test6Delete() {
try {
org.junit.Assert.assertNotNull(map.get("LoginPrimaryKey"));
loginRepository.delete((java.lang.String) map.get("LoginPrimaryKey")); /* Deleting refrenced data */
communicationtypeRepository.delete((java.lang.String) map.get("CommunicationTypePrimaryKey")); /* Deleting refrenced data */
communicationgroupRepository.delete((java.lang.String) map.get("CommunicationGroupPrimaryKey")); /* Deleting refrenced data */
addresstypeRepository.delete((java.lang.String) map.get("AddressTypePrimaryKey")); /* Deleting refrenced data */
cityRepository.delete((java.lang.String) map.get("CityPrimaryKey")); /* Deleting refrenced data */
stateRepository.delete((java.lang.String) map.get("StatePrimaryKey")); /* Deleting refrenced data */
countryRepository.delete((java.lang.String) map.get("CountryPrimaryKey")); /* Deleting refrenced data */
titleRepository.delete((java.lang.String) map.get("TitlePrimaryKey")); /* Deleting refrenced data */
timezoneRepository.delete((java.lang.String) map.get("TimezonePrimaryKey")); /* Deleting refrenced data */
genderRepository.delete((java.lang.String) map.get("GenderPrimaryKey")); /* Deleting refrenced data */
languageRepository.delete((java.lang.String) map.get("LanguagePrimaryKey")); /* Deleting refrenced data */
questionRepository.delete((java.lang.String) map.get("QuestionPrimaryKey")); /* Deleting refrenced data */
useraccesslevelRepository.delete((java.lang.String) map.get("UserAccessLevelPrimaryKey")); /* Deleting refrenced data */
useraccessdomainRepository.delete((java.lang.String) map.get("UserAccessDomainPrimaryKey"));
} catch (com.athena.framework.server.exception.repository.SpartanPersistenceException e) {
org.junit.Assert.fail(e.getMessage());
} catch (Exception e) {
org.junit.Assert.fail(e.getMessage());
}
}
private void validateLogin(EntityTestCriteria contraints, Login login) throws SpartanIncorrectDataException, SpartanConstraintViolationException, SpartanPersistenceException {
if (contraints.getRuleType() == MIN_MAX) {
login.isValid();
} else if (contraints.getRuleType() == NOT_NULL) {
login.isValid();
} else if (contraints.getRuleType() == REGEX) {
login.isValid();
} else if (contraints.getRuleType() == UNIQUE) {
loginRepository.save(login);
}
}
private List<EntityTestCriteria> addingListOfFieldForNegativeTesting() {
List<EntityTestCriteria> entityContraints = new java.util.ArrayList<EntityTestCriteria>();
entityContraints.add(new EntityTestCriteria(NOT_NULL, 1, "loginId", null));
entityContraints.add(new EntityTestCriteria(MIN_MAX, 2, "loginId", "YiYOFShNaiTwXtPdGnB4P5RO2n0eAs2WptwfZ0pwkFUpucKTiSWAsRPDH66b4TijD19Ve0YRCmRMbBwrRNPP9B0PKeWXfvs2pVP0pcB6MSmucPE5IHjE63N2kzqVPu3pXVLJVBln67rr7Co7S3mG3lUfriqYcNZGt5fIyLN6B3uayv9358SkgCrtP7kTW0kTzgnsgKQ4g"));
entityContraints.add(new EntityTestCriteria(MIN_MAX, 3, "serverAuthImage", "ib8KTKZb6nb3KbYArIb56Pm7wPn2aAnFM"));
entityContraints.add(new EntityTestCriteria(MIN_MAX, 4, "serverAuthText", "cI4GekbFUAwP9Rk4c"));
entityContraints.add(new EntityTestCriteria(MIN_MAX, 5, "failedLoginAttempts", 17));
entityContraints.add(new EntityTestCriteria(MIN_MAX, 6, "isAuthenticated", true));
return entityContraints;
}
@Test
public void test5NegativeTesting() throws NoSuchMethodException, SecurityException, IllegalArgumentException, IllegalAccessException, NoSuchFieldException, Exception, SpartanPersistenceException {
int failureCount = 0;
for (EntityTestCriteria contraints : this.entityContraint) {
try {
Login login = createLogin(false);
java.lang.reflect.Field field = null;
if (!contraints.getFieldName().equalsIgnoreCase("CombineUniqueKey")) {
field = login.getClass().getDeclaredField(contraints.getFieldName());
}
switch(((contraints.getTestId()))) {
case 0:
break;
case 1:
field.setAccessible(true);
field.set(login, null);
validateLogin(contraints, login);
failureCount++;
break;
case 2:
login.setLoginId(contraints.getNegativeValue().toString());
validateLogin(contraints, login);
failureCount++;
break;
case 3:
login.setServerAuthImage(contraints.getNegativeValue().toString());
validateLogin(contraints, login);
failureCount++;
break;
case 4:
login.setServerAuthText(contraints.getNegativeValue().toString());
validateLogin(contraints, login);
failureCount++;
break;
case 5:
login.setFailedLoginAttempts(Integer.parseInt(contraints.getNegativeValue().toString()));
validateLogin(contraints, login);
failureCount++;
break;
case 6:
break;
}
} catch (SpartanIncorrectDataException e) {
e.printStackTrace();
} catch (SpartanConstraintViolationException e) {
e.printStackTrace();
} catch (SpartanPersistenceException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
if (failureCount > 0) {
org.junit.Assert.fail();
}
}
}
| [
"applifire@b1bbae632b0b"
] | applifire@b1bbae632b0b |
c385b1193d9175d3e15b5a8f09c8e8aa80955e5f | ec3d86edfb06d9549d4e710473ecdc1dec26bd2b | /Sistema-de-Gestao-Consultas/test/br/edu/ufersa/controlConsult/model/jpaDAO/QuestionarioJpaControllerNGTest.java | a120da0e6e617d5671a7f916082560d754722aed | [] | no_license | ThuggerHacks/Sistema-de-Gestao-Hospitalar | bf6f1cc0634c9e7ddc82993da550df2ced261f89 | 56b07a0f0e3c67c76c65d7d0b9ccb139b4286221 | refs/heads/master | 2023-03-21T17:12:16.911999 | 2018-04-17T03:51:44 | 2018-04-17T03:51:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,565 | 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 br.edu.ufersa.controlConsult.model.jpaDAO;
import br.edu.ufersa.controlConsult.model.Medico;
import br.edu.ufersa.controlConsult.model.Questionario;
import javax.persistence.EntityManager;
import static org.testng.Assert.*;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
*
* @author juan
*/
public class QuestionarioJpaControllerNGTest {
public QuestionarioJpaControllerNGTest() {
}
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
@BeforeMethod
public void setUpMethod() throws Exception {
}
@AfterMethod
public void tearDownMethod() throws Exception {
}
/**
* Test of getEntityManager method, of class QuestionarioJpaController.
*/
@Test
public void testGetEntityManager() {
System.out.println("getEntityManager");
QuestionarioJpaController instance = null;
EntityManager expResult = null;
EntityManager result = instance.getEntityManager();
assertEquals(result, expResult);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of create method, of class QuestionarioJpaController.
*/
@Test
public void testCreate() {
System.out.println("create");
Questionario questionario = null;
QuestionarioJpaController instance = null;
instance.create(questionario);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
/**
* Test of mediaQ method, of class QuestionarioJpaController.
*/
@Test
public void testMediaQ() {
System.out.println("mediaQ");
Medico medico = null;
String num = "";
QuestionarioJpaController instance = null;
double expResult = 0.0;
double result = instance.mediaQ(medico, num);
assertEquals(result, expResult, 0.0);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}
| [
"[email protected]"
] | |
c03efee59a0cc910540c232a1bf1704245a08504 | a48c5c7b68ef4bff85da1f8ebf4a4a8738d511e5 | /lab7/src/synchronizationProblem/MyThread.java | 4da8e12a66f0e366e3931471f593ff98ac0c3fbe | [
"MIT"
] | permissive | mihaimusat/APD-labs-2019 | 0f1b90f305bf5e512556a7431441e15dbfc77054 | ba401a510a1ce3009ca8a5864d99bbcd5019fcb3 | refs/heads/master | 2021-01-01T14:26:57.339234 | 2020-02-11T12:33:09 | 2020-02-11T12:33:09 | 239,319,645 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package synchronizationProblem;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author cristian.chilipirea
*
*/
public class MyThread implements Runnable {
private final int id;
static AtomicInteger value = new AtomicInteger();
MyThread(int id) {
this.id = id;
}
@Override
public void run() {
if (id == 0) {
for (int i = 0; i < Main.N; i++)
value.getAndAdd(3);
} else {
for (int i = 0; i < Main.N; i++)
value.getAndAdd(3);
}
}
}
| [
"[email protected]"
] | |
516002f1fb7dca6d6c3b68c8b8df217f7fe95d70 | fef8d99b851b11324d73e0cee19f4fd556e5776a | /src/java/controladores/DeleteDoctorController.java | 397fa3dda07d6e1b11987c887455acae85d89d4d | [] | no_license | kimba97/proyectoToo | 0811866dd9c301b218c2ba3677fd6525f834526c | 83d7cfee0ff1a09cc578ae9ccaaf4a864e86f17e | refs/heads/master | 2021-08-16T22:45:53.580294 | 2017-11-20T12:36:36 | 2017-11-20T12:36:36 | 108,067,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,172 | 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 controladores;
import Sistema.Conectar;
import Sistema.Expediente;
import Sistema.Paciente;
import java.sql.ResultSet;
import javax.servlet.http.HttpServletRequest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
*
* @author kimba
*/
public class DeleteDoctorController {
private JdbcTemplate jdbcTemplate;
public DeleteDoctorController()
{
Conectar con = new Conectar();
this.jdbcTemplate = new JdbcTemplate(con.conectar());
}
@RequestMapping("deleteDoctor.htm")
public ModelAndView doctores(HttpServletRequest request)
{
String cod_esp = (request.getParameter("id"));
this.jdbcTemplate.update(
"delete from doctor "
+ "where "
+ "cod_esp=? ",
cod_esp);
return new ModelAndView("redirect:/doctores.htm");
}
} | [
"kimba@kimba-Lenovo-IdeaPad-N586"
] | kimba@kimba-Lenovo-IdeaPad-N586 |
f8d6cf3510e8df94a371a844637742a95a261241 | 333a5ba0e0dd623a2d032346e0462aa6cc2542c6 | /Spring10MEng/TestJingleDesktop/src/com/cornell/opencomm/jingleDesktop/Wait.java | f035566a0bb3e2dfcdfbec077642f5e0a2dc10d3 | [] | no_license | moki80/OpenComm | d645fc1816e17a6b0e2ce10f1563682396784e3c | 16251135961b66fba3377d951288496f5d1cda81 | refs/heads/master | 2020-04-06T07:46:11.301226 | 2011-02-03T10:25:24 | 2011-02-03T10:25:24 | 348,743 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 261 | java | package com.cornell.opencomm.jingleDesktop;
public class Wait {
@SuppressWarnings("static-access")
public static void waitforsec(long s){
try {
Thread.currentThread().sleep(s*1000);
} catch (InterruptedException e){
e.printStackTrace();
}
}
} | [
"[email protected]"
] | |
1d5b1f5dea264c7b709e76088ece563aec7fb0fc | 5d333f43eacf64724ece4f2171343a39b39a0fd8 | /727 server/network/com/rs/net/Session.java | 16c9f3f68cd951644945c5e396c515c31b170233 | [] | no_license | CSS-Lletya/open727 | 23867be2cbcd6b1dab7386d4f934f9fcb56703e0 | b39a0c645f9a3618ade293d835ec8417c127f99c | refs/heads/main | 2023-04-21T23:56:54.905626 | 2021-05-13T17:43:26 | 2021-05-13T17:43:26 | 357,363,677 | 4 | 1 | null | 2021-05-13T17:43:27 | 2021-04-12T23:10:07 | Java | UTF-8 | Java | false | false | 3,060 | java | package com.rs.net;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import com.rs.cache.io.OutputStream;
import com.rs.game.player.Player;
import com.rs.net.decoders.ClientPacketsDecoder;
import com.rs.net.decoders.Decoder;
import com.rs.net.decoders.GrabPacketsDecoder;
import com.rs.net.decoders.LoginPacketsDecoder;
import com.rs.net.decoders.WorldPacketsDecoder;
import com.rs.net.encoders.Encoder;
import com.rs.net.encoders.GrabPacketsEncoder;
import com.rs.net.encoders.LoginPacketsEncoder;
import com.rs.net.encoders.WorldPacketsEncoder;
public class Session {
private Channel channel;
private Decoder decoder;
private Encoder encoder;
public Session(Channel channel) {
this.channel = channel;
setDecoder(0);
}
public final ChannelFuture write(OutputStream outStream) {
if (channel.isConnected()) {
ChannelBuffer buffer = ChannelBuffers.copiedBuffer(outStream.getBuffer(), 0, outStream.getOffset());
synchronized (channel) {
return channel.write(buffer);
}
}
return null;
}
public final ChannelFuture write(ChannelBuffer outStream) {
if (outStream == null)
return null;
if (channel.isConnected()) {
synchronized (channel) {
return channel.write(outStream);
}
}
return null;
}
public final Channel getChannel() {
return channel;
}
public final Decoder getDecoder() {
return decoder;
}
public GrabPacketsDecoder getGrabPacketsDecoder() {
return (GrabPacketsDecoder) decoder;
}
public final Encoder getEncoder() {
return encoder;
}
public final void setDecoder(int stage) {
setDecoder(stage, null);
}
public final void setDecoder(int stage, Object attachement) {
switch (stage) {
case 0:
decoder = new ClientPacketsDecoder(this);
break;
case 1:
decoder = new GrabPacketsDecoder(this);
break;
case 2:
decoder = new LoginPacketsDecoder(this);
break;
case 3:
decoder = new WorldPacketsDecoder(this, (Player) attachement);
break;
case -1:
default:
decoder = null;
break;
}
}
public final void setEncoder(int stage) {
setEncoder(stage, null);
}
public final void setEncoder(int stage, Object attachement) {
switch (stage) {
case 0:
encoder = new GrabPacketsEncoder(this);
break;
case 1:
encoder = new LoginPacketsEncoder(this);
break;
case 2:
encoder = new WorldPacketsEncoder(this, (Player) attachement);
break;
case -1:
default:
encoder = null;
break;
}
}
public LoginPacketsEncoder getLoginPackets() {
return (LoginPacketsEncoder) encoder;
}
public GrabPacketsEncoder getGrabPackets() {
return (GrabPacketsEncoder) encoder;
}
public WorldPacketsEncoder getWorldPackets() {
return (WorldPacketsEncoder) encoder;
}
public String getIP() {
return channel == null ? "" : channel.getRemoteAddress().toString().split(":")[0].replace("/", "");
}
public String getLocalAddress() {
return channel.getLocalAddress().toString();
}
}
| [
"[email protected]"
] | |
f2c3a647e785fb1034dde5a4fc5e31a5c2cfa65e | 702ceb3749f0506697bdbb2aa3f62aa8be0489c1 | /src/test/java/com/fpij/chpt4/CalculateNavTest.java | 1a44b969891d41c93aa6219a84e77857b09a2981 | [] | no_license | anildiwan/functionalprogramminginjava | 9c5121b30081f32b9723c587f471a3543fbb84b4 | c45a9aa510fdc6d43c00b6ad5b78ab9fc49422cd | refs/heads/master | 2020-03-08T07:12:21.032072 | 2018-04-21T19:45:39 | 2018-04-21T19:45:39 | 127,988,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package com.fpij.chpt4;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.math.BigDecimal;
import static org.junit.Assert.*;
public class CalculateNavTest {
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() throws Exception {
}
@Test
public void computeStockWorth() {
final CalculateNav calculateNav = new CalculateNav(ticker -> new BigDecimal("6.01"));
BigDecimal expected = new BigDecimal("6010.00");
System.out.println(calculateNav.computeStockWorth("ABC", 1000 ));
assertEquals(0, calculateNav.computeStockWorth("ABC", 1000).compareTo(expected));
}
} | [
"[email protected]"
] | |
1e7347d1dca9c0fce3ff0f47531ab1c4d85a6b57 | 32f394c8f37dea46a2aebb5166bfdb70e95fbd46 | /src/main/java/com/mrdiipo/lending_engine/domain/model/Loan.java | 7eb418349bb01711b858e6bec1551240282d404c | [] | no_license | MrDiipo/Loaning-System-Lending-Engine-Service | b3575b293a66086d611f81a1c2b1aec2eb7d2994 | c7c4bfa276f6f1a199c9803a7bba091aa977d84f | refs/heads/master | 2023-08-13T06:39:44.548598 | 2021-10-04T20:38:30 | 2021-10-04T20:38:30 | 413,472,386 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 945 | java | package com.mrdiipo.lending_engine.domain.model;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.time.LocalDate;
@Data
@Entity
@NoArgsConstructor
public class Loan {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", nullable = false)
private Long id;
@ManyToOne
private User borrower;
@ManyToOne
private User lender;
private int amount;
private double interestRate;
private LocalDate dateLent;
private LocalDate dateDue;
public Loan(User lender, LoanApplication loanApplication) {
this.lender = lender;
this.borrower = loanApplication.getBorrower();
this.amount = loanApplication.getAmount();
this.interestRate = loanApplication.getInterestRate();
this.dateLent = LocalDate.now();
this.dateDue = LocalDate.now().plusDays(loanApplication.getRepaymentTermInDays());
}
}
| [
"[email protected]"
] | |
f6d6096f10070029fc7306def135638f6bbce9e2 | 5c7a9110eba1ff6ed695ea5ab6b12c838d0d0b55 | /src/com/adaming/entities/Utilisateur.java | 01660c0e2fce3f478139874ee28980e405cb2f9c | [] | no_license | ClementINTI/GestionDeptContentieuxx | 165e9c4199e4e46192f39e0b768a9fc7a19c9ad2 | 59f162aa87c947db18cec3a0160172df0ba5f435 | refs/heads/master | 2020-05-22T16:51:26.261687 | 2019-05-14T12:49:36 | 2019-05-14T12:49:36 | 186,438,332 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,029 | java | package com.adaming.entities;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
@Entity
public class Utilisateur implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long idUtilisateur;
private String email;
private String nom;
private String prenom;
@ManyToMany
@JoinTable(name="Utili_Tache",joinColumns=
@JoinColumn(name="idUtilisateur", referencedColumnName="idUtilisateur"),
inverseJoinColumns=@JoinColumn(name="idTache", referencedColumnName="idTache"))
private Set <Tache> listTache = new HashSet<Tache>();
@ManyToMany
@JoinTable(name="profil",joinColumns=
@JoinColumn(name="idUtilisateur", referencedColumnName="idUtilisateur"),
inverseJoinColumns=@JoinColumn(name="idRole", referencedColumnName="idRole"))
private Set <Role> listRole = new HashSet<Role>();
public Utilisateur(Long idUtilisateur, String email, String nom, String prenom) {
super();
this.idUtilisateur = idUtilisateur;
this.email = email;
this.nom = nom;
this.prenom = prenom;
}
public Utilisateur() {
super();
}
public Utilisateur(String email, String nom, String prenom) {
super();
this.email = email;
this.nom = nom;
this.prenom = prenom;
}
public Utilisateur(Long idUtilisateur, String email, String nom, String prenom, Set<Tache> listTache) {
super();
this.idUtilisateur = idUtilisateur;
this.email = email;
this.nom = nom;
this.prenom = prenom;
this.listTache = listTache;
}
public Utilisateur(String email, String nom, String prenom, Set<Tache> listTache, Set<Role> listRole) {
super();
this.email = email;
this.nom = nom;
this.prenom = prenom;
this.listTache = listTache;
this.listRole = listRole;
}
public Long getIdUtilisateur() {
return idUtilisateur;
}
public void setIdUtilisateur(Long idUtilisateur) {
this.idUtilisateur = idUtilisateur;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public Set<Tache> getListTache() {
return listTache;
}
public void setListTache(Set<Tache> listTache) {
this.listTache = listTache;
}
public Set<Role> getListRole() {
return listRole;
}
public void setListRole(Set<Role> listRole) {
this.listRole = listRole;
}
@Override
public String toString() {
return "Utilisateur [idUtilisateur=" + idUtilisateur + ", email=" + email + ", nom=" + nom + ", prenom="
+ prenom + ", listTache=" + listTache + ", listRole=" + listRole + "]";
}
}
| [
"[email protected]"
] | |
4b8de5f29997fbd270a31808fb7a71d206e6a2e9 | b15f319c8d5241b3e64f0ca42fa2c4602625632e | /Stanford_Laptrinhdesktop_JE112/src/stanford_laptrinhdesktop_je112/FrmBai3.java | 0d51c472fd731ff71f3240e787020353872c96f0 | [] | no_license | vandunghy/dung | 8b20854f4da369e688999c700dfb203a100c8d27 | be7fd0926edf6fad3d46cb0f4a8287dfc687cabc | refs/heads/main | 2023-08-26T03:18:17.670589 | 2021-11-09T01:50:08 | 2021-11-09T01:50:08 | 425,791,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,413 | java | /*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template
*/
package stanford_laptrinhdesktop_je112;
import javax.swing.JOptionPane;
/**
*
* @author macbookm1
*/
public class FrmBai3 extends javax.swing.JFrame {
/**
* Creates new form FrmBai3
*/
public FrmBai3() {
initComponents();
}
/**
* 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();
jLabel5 = new javax.swing.JLabel();
txtTenCuaBan = new javax.swing.JTextField();
txtTuoi = new javax.swing.JTextField();
cboTinhTrangHonNhan = new javax.swing.JComboBox<>();
cboGioiTinh = new javax.swing.JComboBox<>();
jScrollPane1 = new javax.swing.JScrollPane();
txtKetQua = new javax.swing.JTextArea();
jLabel6 = new javax.swing.JLabel();
dtnDangKy = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("Tên của bạn");
jLabel2.setText("Tuổi");
jLabel3.setText("Tình trạng hôn nhân");
jLabel4.setText("Giới tính");
jLabel5.setText("Kết quả");
cboTinhTrangHonNhan.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Độc Thân", "Có Gia Đình", "Ly Hôn", " " }));
cboGioiTinh.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Nam", "Nữ", " " }));
txtKetQua.setColumns(20);
txtKetQua.setRows(5);
jScrollPane1.setViewportView(txtKetQua);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(36, 36, 36)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel5)
.addComponent(jLabel4)
.addComponent(jLabel3)
.addComponent(jLabel2)
.addComponent(jLabel1))
.addGap(52, 52, 52)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(txtTuoi, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(cboTinhTrangHonNhan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cboGioiTinh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtTenCuaBan, javax.swing.GroupLayout.Alignment.TRAILING))
.addContainerGap(66, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtTenCuaBan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(22, 22, 22)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtTuoi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(cboTinhTrangHonNhan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(24, 24, 24)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(cboGioiTinh, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(48, 48, 48)
.addComponent(jLabel5)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))
);
jLabel6.setText("Chương trình kết bạn");
dtnDangKy.setText("Đăng Ký");
dtnDangKy.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
dtnDangKyActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(57, 57, 57)
.addComponent(jLabel6)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(dtnDangKy)
.addGap(152, 152, 152))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
.addComponent(dtnDangKy)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void dtnDangKyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dtnDangKyActionPerformed
// TODO add your handling code here:
//Khai báo biến
String tenCuaBan = "", strTuoi = "", tinhTrangHonNhan = "", gioiTinh = "", ketQua = "";
int tuoi = 0;
tenCuaBan = txtTenCuaBan.getText();
strTuoi = txtTuoi.getText();
tinhTrangHonNhan = "" + cboTinhTrangHonNhan.getSelectedItem();
gioiTinh = "" + cboGioiTinh.getSelectedItem();
if (tenCuaBan.length() == 0) {
JOptionPane.showMessageDialog(rootPane, "Hãy điền đủ thông tin");
txtTenCuaBan.requestFocus();
}
if (strTuoi.length() == 0) {
JOptionPane.showMessageDialog(rootPane, "Hãy điền đủ thông tin");
txtTuoi.requestFocus();
}
tuoi = Integer.parseInt(strTuoi);
if (gioiTinh.equals("Nam") && (tuoi >= 22 && tuoi <= 40) && (tinhTrangHonNhan.equals("Độc Thân") || tinhTrangHonNhan.equals("Ly Hôn"))) {
ketQua = "Được phép tham gia";
txtKetQua.setText(ketQua);
} else if (gioiTinh.equals("Nữ") && tuoi >= 19 && (tinhTrangHonNhan.equals("Độc Thân") || tinhTrangHonNhan.equals("Ly Hôn"))) {
ketQua = "Được phép tham gia";
txtKetQua.setText(ketQua);
} else {
ketQua = "Không được phép tham gia";
txtKetQua.setText(ketQua);
}
}//GEN-LAST:event_dtnDangKyActionPerformed
/**
* @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(FrmBai3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FrmBai3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FrmBai3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FrmBai3.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 FrmBai3().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JComboBox<String> cboGioiTinh;
private javax.swing.JComboBox<String> cboTinhTrangHonNhan;
private javax.swing.JButton dtnDangKy;
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.JTextArea txtKetQua;
private javax.swing.JTextField txtTenCuaBan;
private javax.swing.JTextField txtTuoi;
// End of variables declaration//GEN-END:variables
}
| [
"[email protected]"
] | |
4021096013622d4ef82e94a5a4954172b0a17ff2 | d4d69c526ef95e8bd268a95c5a09b9001cffc552 | /app/src/main/java/com/example/ricardopazdemiquel/moviles/Iniciar_Sesion_Activity.java | d4e1cb2aed5b487372212142a0d53778ad789efb | [] | no_license | edsoncito/servisisCliente | 9bce872accdc6c4c16a6a7b3fffa97f61288f572 | d2de2bf6668a76985011f749305257039b5a1614 | refs/heads/master | 2020-03-26T19:42:52.941711 | 2018-09-07T22:20:09 | 2018-09-07T22:20:09 | 145,281,840 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,615 | java | package com.example.ricardopazdemiquel.moviles;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class Iniciar_Sesion_Activity extends AppCompatActivity implements View.OnClickListener{
private Button btn_crear_cuenta;
private Button btn_iniciar_sesion;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_iniciar_sesion);
btn_crear_cuenta = findViewById(R.id.btn_crear_cuenta);
btn_iniciar_sesion = findViewById(R.id.btn_iniciar_sesion);
btn_iniciar_sesion.setOnClickListener(this);
btn_crear_cuenta.setOnClickListener(this);
}
@Override
public void onClick(View view) {
Intent intent;
switch (view.getId()){
case R.id.btn_iniciar_sesion:
intent = new Intent(Iniciar_Sesion_Activity.this, LoginCliente.class);
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
case R.id.btn_crear_cuenta:
intent = new Intent(Iniciar_Sesion_Activity.this, IniciarCuentaActivity.class);
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
}
}
}
| [
"[email protected]"
] | |
80551b6b68a5dc117fadc55ec4f121c52f497cfa | c3101515ddde8a6e6ddc4294a4739256d1600df0 | /GeneralApp__2.20_1.0(1)_source_from_JADX/sources/com/navibees/maps/MapControls.java | 3623950a50c9c606bdfc1db64d0fe8f96ef54292 | [] | no_license | Aelshazly/Carty | b56fdb1be58a6d12f26d51b46f435ea4a73c8168 | d13f3a4ad80e8a7d0ed1c6a5720efb4d1ca721ee | refs/heads/master | 2022-11-14T23:29:53.547694 | 2020-07-08T19:23:39 | 2020-07-08T19:23:39 | 278,175,183 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,040 | java | package com.navibees.maps;
public class MapControls {
public static boolean SHOW_BACK_BUTTON = true;
public static boolean SHOW_BUILDING_BUTTON_VIEW = true;
public static boolean SHOW_COMPASS_BUTTON = true;
public static boolean SHOW_FLOOR_BUTTON = true;
public static boolean SHOW_NAVIGATE_BUTTON = true;
public static boolean SHOW_NAVIGATION_BUTTON = true;
public static boolean SHOW_NAVIGATION_VIEW = true;
public static boolean SHOW_OUT_OF_COVERAGE_ALERT = true;
public static boolean SHOW_POI_INFO_VIEW_BUTTON = true;
public static boolean SHOW_POPUP_CANCEL_BUTTON = true;
public static boolean SHOW_POPUP_SAVE_LOCATION_BUTTON = true;
public static boolean SHOW_POPUP_SHARE_LOCATION_BUTTON = true;
public static boolean SHOW_POPUP_SHARE_USER_LOCATION_BUTTON = true;
public static boolean SHOW_POPUP_VIEW = true;
public static boolean SHOW_SAVE_LOCATION_BUTTON = true;
public static boolean SHOW_SEARCH_BAR = true;
public static boolean SHOW_TRACKER_BUTTON = true;
}
| [
"[email protected]"
] | |
ef71c0f7ef35dcb1c9363f81cf74e586729c0e52 | 0fcae0a37c3f2c8ceed5baecd2fae32bbbb6bcc8 | /api/src/main/java/org/onehippo/repository/security/JvmCredentials.java | edcf4ca6a7561910cf3f396eb393a3f956d236d0 | [
"Apache-2.0"
] | permissive | aharpour/hippo-repository | 123b0b1d24ee31872709de53859e0963c3b177db | 3ebe14dc55061f7508c5d35b8f10945f76fe2f5c | refs/heads/master | 2021-01-10T14:04:39.924863 | 2016-04-04T09:17:30 | 2016-04-04T09:17:30 | 55,515,311 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,863 | java | /*
* Copyright 2015 Hippo B.V. (http://www.onehippo.com)
*
* 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.onehippo.repository.security;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import javax.jcr.Credentials;
public final class JvmCredentials implements Credentials {
private static final Map<String, JvmCredentials> credentials = new ConcurrentHashMap<>();
public static final String PASSKEY = "jvm://";
private final String userID;
private final char[] password;
private JvmCredentials(String userID, char[] password) {
this.userID = userID;
this.password = password;
}
public String getUserID() {
return userID;
}
public char[] getPassword() {
return password;
}
public static JvmCredentials getCredentials(String userID) {
JvmCredentials credentials = JvmCredentials.credentials.get(userID);
if (credentials != null) {
return credentials;
}
credentials = new JvmCredentials(userID, UUID.randomUUID().toString().toCharArray());
final JvmCredentials prevCredentials = JvmCredentials.credentials.putIfAbsent(userID, credentials);
if (prevCredentials != null) {
return prevCredentials;
}
return credentials;
}
}
| [
"[email protected]"
] | |
eb37e31af243e38edf62733b8d65c03f754510e2 | a68affde1e447e2fc48893ae7a0c75ea0ec83aae | /src/PuzzleCommunity/HillNotationAndHillOrder/HillNotationAndHillOrder.java | 7321a49941d6a139f41f0999d148447153ecb684 | [] | no_license | ProkurorNSK/CodinGame | 0eb8fa4949a2be696bc8dcc2d6efb44339d174a6 | ae47be3c0db98b3a5a6425ad395e820485fd08e4 | refs/heads/master | 2020-04-10T21:57:39.733955 | 2019-02-03T08:16:41 | 2019-02-03T08:16:41 | 64,691,481 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,447 | java | package PuzzleCommunity.HillNotationAndHillOrder;
import java.util.*;
public class HillNotationAndHillOrder {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int numCompounds = in.nextInt();
in.nextLine();
ArrayList<HashMap<String, Integer>> formuls = new ArrayList<>();
HashMap<String, Integer> formula;
String buffer = "";
String bufferNumber = "";
for (int i = 0; i < numCompounds; i++) {
char[] compound = in.nextLine().toCharArray();
formula = new HashMap<>();
for (char symbol : compound) {
if (Character.isUpperCase(symbol)) {
if (!buffer.isEmpty()) {
formula.put(buffer, bufferNumber.isEmpty() ? 1 : Integer.parseInt(bufferNumber));
buffer = "";
bufferNumber = "";
}
buffer += symbol;
} else if (Character.isLowerCase(symbol)) {
buffer += symbol;
} else if (Character.isDigit(symbol)) {
bufferNumber += symbol;
}
}
formula.put(buffer, bufferNumber.isEmpty() ? 1 : Integer.parseInt(bufferNumber));
buffer = "";
bufferNumber = "";
formuls.add(formula);
}
System.out.println(formuls);
}
}
| [
"[email protected]"
] | |
429b53248afa7e0dbe51afea4048e2b1f89cbd69 | 19809d0be46f6582a7802a773afc792868304942 | /java9SrcStudy/src/java.corba/org/omg/IOP/CodecOperations.java | abc2310c64988abaf04a123e288189c40c73b8ac | [] | no_license | jxxiangwen/JavaStudy | fa5194630a0c46d498d1a49acba8449fa4d447e9 | fbf2accf3e9ec24b633ef26d2f3328e6b021d054 | refs/heads/master | 2022-12-21T20:46:04.447682 | 2019-09-02T09:35:27 | 2019-09-02T09:35:27 | 48,320,572 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,500 | java | package org.omg.IOP;
/**
* org/omg/IOP/CodecOperations.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /scratch/HUDSON/workspace/9-2-build-linux-amd64-phase2/jdk9/6725/corba/src/java.corba/share/classes/org/omg/PortableInterceptor/IOP.idl
* Thursday, August 3, 2017 3:57:53 AM UTC
*/
/**
* The formats of IOR components and service context data used by ORB
* services are often defined as CDR encapsulations encoding instances
* of IDL defined data types. The <code>Codec</code> provides a mechanism
* to transfer these components between their IDL data types and their CDR
* encapsulation representations.
* <p>
* A <code>Codec</code> is obtained from the <code>CodecFactory</code>.
* The <code>CodecFactory</code> is obtained through a call to
* <code>ORB.resolve_initial_references( "CodecFactory" )</code>.
*/
public interface CodecOperations
{
/**
* Converts the given any into a byte array based on the encoding
* format effective for this <code>Codec</code>.
*
* @param data The data, in the form of an any, to be encoded into
* a byte array.
* @return A byte array containing the encoded Any. This byte array
* contains both the <code>TypeCode</code> and the data of the type.
* @exception InvalidTypeForEncoding thrown if the type is not valid for
* the encoding format effective for this <code>Codec</code>.
*/
byte[] encode (org.omg.CORBA.Any data) throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding;
/**
* Decodes the given byte array into an Any based on the encoding
* format effective for this <code>Codec</code>.
*
* @param data The data, in the form of a byte array, to be decoded into
* an Any.
* @return An Any containing the data from the decoded byte array.
* @exception FormatMismatch is thrown if the byte array cannot be
* decoded into an Any.
*/
org.omg.CORBA.Any decode (byte[] data) throws org.omg.IOP.CodecPackage.FormatMismatch;
/**
* Converts the given any into a byte array based on the encoding
* format effective for this Codec. Only the data from the Any is
* encoded, not the <code>TypeCode</code>.
*
* @param data The data, in the form of an Any, to be encoded into
* a byte array.
* @return A byte array containing the data from the encoded any.
* @exception InvalidTypeForEncoding thrown if the type is not valid for
* the encoding format effective for this <code>Codec</code>.
*/
byte[] encode_value (org.omg.CORBA.Any data) throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding;
/**
* Decodes the given byte array into an Any based on the given
* <code>TypeCode</code> and the encoding format effective for
* this <code>Codec</code>.
*
* @param data The data, in the form of a byte array, to be decoded
* into an Any.
* @param tc The TypeCode to be used to decode the data.
* @return An Any containing the data from the decoded byte array.
* @exception FormatMismatch thrown if the byte array cannot be
* decoded into an Any.
*/
org.omg.CORBA.Any decode_value (byte[] data, org.omg.CORBA.TypeCode tc) throws org.omg.IOP.CodecPackage.FormatMismatch, org.omg.IOP.CodecPackage.TypeMismatch;
} // interface CodecOperations
| [
"[email protected]"
] | |
a50c496fd4cff7faf72e8bdb2e33a3d6ee9a21e7 | 9cb72d2f1842da54d170024a7445c66903c95ca5 | /AndroidStudio/PR4_2/app/src/main/java/com/january/egavett/pr4_2/MainActivity.java | c9fcea3f4f07bb98d16378765e2a5d7f0d6d039b | [] | no_license | egavett/CS372 | 84299dc3ba67cf3268bb4c518e8e2ddfedf41971 | 632217a4499e40b2fd27f4a654252de064536a09 | refs/heads/master | 2020-04-05T23:48:13.340373 | 2015-02-06T17:06:54 | 2015-02-06T17:06:54 | 28,836,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,535 | java | package com.january.egavett.pr4_2;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/*
* Randomly chooses an integer between 1 and 0
* Sets the label to the appropriate string
*/
public void flip(View v){
TextView f = (TextView)this.findViewById(R.id.TxtResult);
int a = (int)(Math.random()*2);
if(a == 0)
f.setText("Heads!");
else
f.setText("Tails!");
}
}
| [
"[email protected]"
] | |
018d8e976ae66350a38e75c05135d2fb52e6d78a | 94f1d77c19bf1d3e41f1fcdb7a8168e370b4dbe9 | /src/main/java/com/miao/rabbitmq/MQSender.java | ffc5ffe79388cd2fcc4ddf0e988d2423e5a89922 | [] | no_license | Arctic-cat/miaosha | 7276c1763a4b6f9f790a2e9ced0d40d3d169f780 | 5444b8f9cc81a5e7d076c220a5ebba429c60befb | refs/heads/master | 2020-03-27T08:25:56.048211 | 2018-08-27T06:12:30 | 2018-08-27T06:12:30 | 146,253,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 714 | java | package com.miao.rabbitmq;
import com.miao.miaosha.service.RedisService;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MQSender {
@Autowired
AmqpTemplate amqpTemplate;
public void send(Object message) {
String msg = RedisService.beanToString(message);
System.out.println("发送消息:"+msg);
amqpTemplate.convertAndSend(MQConfig.QUEUE_1,msg);
}
public void sendMiaoshaMsg(MiaoshaMsg miaoshaMsg) {
String msg = RedisService.beanToString(miaoshaMsg);
amqpTemplate.convertAndSend(MQConfig.QUEUE_1,msg);
}
}
| [
"[email protected]"
] | |
f5cf82c7dea43fad796c89646c35481c4ff0a3ae | 03abf51370017943dddc2a15968708e48c303915 | /src/main/java/com/common/microservice/service/CommonService.java | 73b2f983490ccade82f02a072c9f48dc12f6e4c0 | [] | no_license | sindhujeeru/microservice-common | 124c1d483442f05ffd6a2feaed89661a82aa82af | d71cbb0e5231b3de8d34e8cf6e63f173a86eaa83 | refs/heads/master | 2023-06-07T10:44:41.986035 | 2021-07-14T16:47:34 | 2021-07-14T16:47:34 | 346,051,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 387 | java | package com.common.microservice.service;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
public interface CommonService<E> {
public Iterable<E> findAll();
public Page<E> findAll(Pageable pageable);
public Optional<E> findById(Long id);
public E save(E entity);
public void deleteById(Long id);
}
| [
"[email protected]"
] | |
25159da80d9a271193f6f6e819999575320e7636 | dd43f8d8ccaf0eff41524b68281eecf8284b9b11 | /gulimall-ware/src/main/java/com/atguigu/gulimall/ware/entity/WareInfoEntity.java | 38a45cb999f5b7f5be63aabab541a00ad4a93606 | [] | no_license | Ke-shaun/gulimall | 335656400a0846a7e68120e8974101a5de9d9a66 | 6349872b6f6077b8b11472006b0f4cd30c6c205b | refs/heads/master | 2023-05-24T07:29:24.103225 | 2021-06-15T10:18:31 | 2021-06-15T10:18:31 | 367,046,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 664 | java | package com.atguigu.gulimall.ware.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 仓库信息
*
* @author keshaun
* @email [email protected]
* @date 2021-05-15 17:20:43
*/
@Data
@TableName("wms_ware_info")
public class WareInfoEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* 仓库名
*/
private String name;
/**
* 仓库地址
*/
private String address;
/**
* 区域编码
*/
private String areacode;
}
| [
"[email protected]"
] | |
8ab9d933d3fcb471494ea6402f1b1626a0f818d2 | 53037b55af9f20702f625ed2b3e4f02b27d340fe | /app/src/main/java/com/example/fashionproject/WomenActivity.java | 74e83dea79bc949e06521138077feb158a007d09 | [] | no_license | holymoon/FashionProject | a3fd9b40362cc46a08ab318e486abf98e56433d6 | 9abda528ebba7cac4db969db80826b70d1aa5e77 | refs/heads/master | 2020-11-25T11:42:16.298999 | 2019-12-23T15:00:08 | 2019-12-23T15:00:08 | 228,641,022 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 322 | java | package com.example.fashionproject;
import android.app.Activity;
import android.os.Bundle;
public class WomenActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_women);
}
}
| [
"[email protected]"
] | |
861356fdf4d62542db955685ce44bef8137c2919 | 5105d5338cb9519e07adadb7906a16bff0d99ba0 | /product-api-s/src/main/java/com/productpro/productapi/config/SwaggerConfig.java | a509da07e5e8010b8bfcf51aa4db8e4b7382b594 | [] | no_license | GanDigit/ProductPro | b9c5b42521f5ebe08920b2909ca1372f837a1325 | 76632c5278d6ae93d7f0b5de6225317aa34fc803 | refs/heads/master | 2023-01-21T08:10:14.773924 | 2019-06-24T08:56:12 | 2019-06-24T08:56:12 | 192,471,295 | 0 | 0 | null | 2023-01-07T22:32:40 | 2019-06-18T05:27:27 | JavaScript | UTF-8 | Java | false | false | 986 | java | package com.productpro.productapi.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2).select()
.apis(RequestHandlerSelectors.basePackage("com.productpro.productapi.controller")).build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("Product PRO API")
.description("Product PRO API reference for clients")
.build();
}
} | [
"[email protected]"
] | |
8471df2d6379a82be04f70105b306c6832d45a5f | e9033e8e73ca62caca08f55f72f5044c4a55d55a | /springboot-freemarker/src/main/java/com/wwy/controller/FreemarkerController.java | 7f847faa9b46e2f23a271922e694644fc18c89ef | [] | no_license | Manyat5/springboot-demo | 92eac3843e71fd682e84b42726fd860e21026ccf | 40f03fc650ac62496b17f083334e262c1a9ba6a6 | refs/heads/master | 2022-09-07T21:29:01.084255 | 2019-12-16T07:32:12 | 2019-12-16T07:32:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,009 | java | package com.wwy.controller;
import com.wwy.pojo.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.*;
@Controller
public class FreemarkerController {
@GetMapping("/test1")
public String test1(Map<String,Object> map,Model model){
map.put("name","freemarker");
return "test1";
}
@GetMapping("/test2")
public String test2(Map<String,Object> map){
//list数据
Student stu1 = new Student("zs",10,new Date(),null,null);
Student stu2=new Student("ls",20,new Date(),null,stu1);
List<Student> stus=new ArrayList<Student>();
stus.add(stu1);stus.add(stu2);
map.put("stus",stus);
//准备map数据
HashMap<String,Student> stuMap = new HashMap<String, Student>();
stuMap.put("stu1",stu1);
stuMap.put("stu2",stu2);
map.put("stuMap",stuMap);
return "test2";
}
}
| [
"[email protected]"
] | |
44391ba46a8e31e7e68ed40b55576469360b4de2 | 2ea49bfaa6bc1b9301b025c5b2ca6fde7e5bb9df | /contributions/MonteC/java/Fundamentals/2016-09-06.java | 618b8403cec622a06150bb641559807b72521821 | [] | no_license | 0x8801/commit | 18f25a9449f162ee92945b42b93700e12fd4fd77 | e7692808585bc7e9726f61f7f6baf43dc83e28ac | refs/heads/master | 2021-10-13T08:04:48.200662 | 2016-12-20T01:59:47 | 2016-12-20T01:59:47 | 76,935,980 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 215 | java | Common mistake on switch statements
Ternary operator
Altering format string output by changing a format specifier's `argument_index`
Use `DecimalFormat` class to format numbers
Locks in `static synchronized` methods | [
"[email protected]"
] | |
5145afd15e8ee9805679f9eb78fe8f9238ebf811 | 72dffafb1b2c7736e93a5444242e5c9511f7ceb0 | /src/test.java | e5d7280d28c8765afbe3aee24f961c42998ca4b6 | [] | no_license | Ujjawal21/IndentRecordSystem | e1f3536dc0747e4aec1e2319071f7cccc4103f34 | 8a3d70c5a6249c0386044208c92e0c4f8af05dcf | refs/heads/master | 2021-01-23T21:42:28.366262 | 2014-02-26T10:55:13 | 2014-02-26T10:55:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 298 | java |
public class test{
public static void main(String[] args) {
java.util.Date utilDate = new java.util.Date();
java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());
System.out.println("utilDate:" + utilDate);
System.out.println("sqlDate:" + sqlDate);
}
} | [
"[email protected]"
] | |
4b4c4f167d4b96c43d2a7f55905def4385b2dcaf | 6e91ac877051a06bcd9b94a850577cd10d1a6d8d | /knight-estoque/src/main/java/com/knight/estoque/modelos/Usuario.java | efb954003bb820e112fff7dd836685189a464853 | [] | no_license | italosiqueira/soa-tutorial | 0a91a863ab4ce45fa4c2e19e14091218bb76d88a | 27530a946696e10dbebe4a42ec60693ea3de562b | refs/heads/master | 2021-01-12T12:04:21.142852 | 2016-11-15T13:35:07 | 2016-11-15T13:35:07 | 69,232,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,045 | java | package com.knight.estoque.modelos;
public class Usuario{
private String nome;
private String login;
private String senha;
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getSenha() {
return senha;
}
public void setSenha(String senha) {
this.senha = senha;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((login == null) ? 0 : login.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;
Usuario other = (Usuario) obj;
if (login == null) {
if (other.login != null)
return false;
} else if (!login.equals(other.login))
return false;
return true;
}
}
| [
"[email protected]"
] | |
b6a02af57a5e190cca53455b29bd525a5d354505 | 18318231fe7a218d7b0568ba265190dd70126eb3 | /src/main/java/bsantanar/com/usersapi/models/Phone.java | 16aa698a7c8387af719c691f34b3669a10bec918 | [] | no_license | bsantanar/users-api | 69e006756b7aa3d5c7662ed3e1df460c258cfaf2 | b1b9aa06fa22afe88afae94746146af128f8f351 | refs/heads/master | 2023-08-06T02:11:41.113103 | 2021-09-25T00:53:16 | 2021-09-25T00:53:16 | 410,138,517 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 712 | java | package bsantanar.com.usersapi.models;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Data
@NoArgsConstructor
@Entity
@Table(name = "phones")
public class Phone {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@NotNull
@Column(name = "phone_id")
private Long phoneId;
@NotNull
@Column(name = "number")
private String number;
@NotNull
@Column(name = "city_code")
private String cityCode;
@NotNull
@Column(name = "country_code")
private String countryCode;
@ManyToOne
@JoinColumn(name = "user_id")
private User user;
}
| [
"[email protected]"
] | |
23ace805c315f64e304500a25d0a93738b04aadd | d15f1bf6451324abd5122c42d5078398bef1c8ca | /src/main/java/Website.java | 46ccf3c0f87989a480dd4270249073cf5ea05c12 | [] | no_license | qtpham1998/food-for-thought-server | 13f11100916120737d74ab826c169401a43b7de0 | a368a2db64172a3453a2d35d55e54b1f124bca9e | refs/heads/master | 2023-04-27T15:07:18.122645 | 2019-11-13T23:58:56 | 2019-11-13T23:58:56 | 221,573,950 | 0 | 0 | null | 2023-04-14T17:48:49 | 2019-11-13T23:56:22 | Java | UTF-8 | Java | false | false | 3,670 | java | import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.JSONArray;
import org.json.JSONObject;
public class Website extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
resp.setContentType("application/json");
PrintWriter writer = resp.getWriter();
String param = req.getParameter("req");
if (param != null && param.equals("list")) {
writer.print(getAllIngredientsList());
} else if (param != null && param.equals("recipe")) {
JSONArray recipes =
fetchMatchingRecipes(new JSONArray(req.getParameter("owned")));
writer.print(recipes);
} else if (param != null && param.equals("liked")) {
JSONArray likedRecipes =
fetchLikedRecipes(new JSONArray(req.getParameter("ids")));
writer.print(likedRecipes);
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String param = req.getParameter("req");
if (param != null && param.equals("new")) {
Database.insertNewRecipe(Recipe.decodeRecipe(
new JSONObject(req.getParameter("recipe"))
));
}
}
// Get matching recipes from owned ingredients, in JSON array form
private JSONArray fetchMatchingRecipes(JSONArray ownedIngredients) {
String ownedString = decodeOwnedIngrList(ownedIngredients);
List<Recipe> recipes = Database.fetchRecipes(ownedString);
List<JSONObject> jsonRecipes = new ArrayList<>();
recipes.forEach(recipe -> jsonRecipes.add(recipe.encodeRecipe()));
return new JSONArray(jsonRecipes);
}
private JSONArray fetchLikedRecipes(JSONArray likedList) {
List<JSONObject> likedRecipes = new ArrayList<>();
for (int i = 0; i < likedList.length(); i++) {
likedRecipes.add(Database.getRecipeInformation(
String.valueOf(likedList.getInt(i))).encodeRecipe());
}
return new JSONArray(likedRecipes);
}
// Convert JSONArray owned ingredients list to String
private String decodeOwnedIngrList(JSONArray list) {
StringBuilder sb = new StringBuilder();
sb. append("\'Salt\', \'Black pepper\', \'Oil\'");
for (int i = 0; i < list.length(); i++)
sb.append(", \'").append(list.getString(i)).append("\'");
return sb.toString();
}
// Gets list of all possible ingredients in JSON array form
private JSONArray getAllIngredientsList() {
ResultSet result = Database.getAllIngredientsList();
List<JSONObject> ingredients = new ArrayList<>();
try {
while (result.next()) {
JSONObject obj = new JSONObject();
obj.put("id", result.getInt("id"));
obj.put("name", result.getString("name"));
obj.put("category", result.getString("category"));
obj.put("duration", result.getInt("duration"));
ingredients.add(obj);
}
} catch (SQLException ignored) {}
return new JSONArray(ingredients);
}
} | [
"[email protected]"
] | |
aace6c8bd1bf381f597be87b0c943d14f61be426 | 67a1b5e8dc998ce3594c1c3bb2ec89c30850dee7 | /GooglePlay6.0.5/app/src/main/java/com/google/android/gms/people/internal/zza.java | 0436d81bc3dee851876d8690153db00f74442fc0 | [
"Apache-2.0"
] | permissive | matrixxun/FMTech | 4a47bd0bdd8294cc59151f1bffc6210567487bac | 31898556baad01d66e8d87701f2e49b0de930f30 | refs/heads/master | 2020-12-29T01:31:53.155377 | 2016-01-07T04:39:43 | 2016-01-07T04:39:43 | 49,217,400 | 2 | 0 | null | 2016-01-07T16:51:44 | 2016-01-07T16:51:44 | null | UTF-8 | Java | false | false | 997 | java | package com.google.android.gms.people.internal;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import com.google.android.gms.common.data.DataHolder;
public class zza
extends zzf.zza
{
public void zza(int paramInt, Bundle paramBundle1, Bundle paramBundle2) {}
public final void zza(int paramInt, Bundle paramBundle, ParcelFileDescriptor paramParcelFileDescriptor)
{
throw new RuntimeException("Shouldn't be called");
}
public final void zza(int paramInt, Bundle paramBundle1, ParcelFileDescriptor paramParcelFileDescriptor, Bundle paramBundle2) {}
public void zza(int paramInt, Bundle paramBundle, DataHolder paramDataHolder) {}
public final void zza(int paramInt, Bundle paramBundle, DataHolder[] paramArrayOfDataHolder) {}
}
/* Location: F:\apktool\apktool\Google_Play_Store6.0.5\classes-dex2jar.jar
* Qualified Name: com.google.android.gms.people.internal.zza
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
e816536b31b8aed3149cad336e42861898158353 | 447520f40e82a060368a0802a391697bc00be96f | /apks/comparison_qark/de.number26.android/classes_dex2jar/com/google/android/gms/maps/internal/zzbz.java | cc994c29715da32b4c4b06dd0f6ec90ccef9dcb8 | [
"Apache-2.0"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 4,167 | java | package com.google.android.gms.maps.internal;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.IBinder;
import android.os.IInterface;
import android.os.RemoteException;
import android.util.Log;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.internal.Hide;
import com.google.android.gms.common.internal.zzbq;
import com.google.android.gms.dynamic.zzn;
import com.google.android.gms.dynamite.DynamiteModule;
import com.google.android.gms.maps.model.RuntimeRemoteException;
@Hide
public class zzbz
{
private static final String zza = "zzbz";
@SuppressLint({"StaticFieldLeak"})
private static Context zzb;
private static zze zzc;
public zzbz() {}
public static zze zza(Context paramContext)
throws GooglePlayServicesNotAvailableException
{
zzbq.zza(paramContext);
if (zzc != null) {
return zzc;
}
int i = GooglePlayServicesUtil.isGooglePlayServicesAvailable(paramContext);
if (i != 0) {
throw new GooglePlayServicesNotAvailableException(i);
}
Log.i(zza, "Making Creator dynamically");
IBinder localIBinder = (IBinder)zza(zzb(paramContext).getClassLoader(), "com.google.android.gms.maps.internal.CreatorImpl");
Object localObject;
if (localIBinder == null)
{
localObject = null;
}
else
{
IInterface localIInterface = localIBinder.queryLocalInterface("com.google.android.gms.maps.internal.ICreator");
if ((localIInterface instanceof zze)) {
localObject = (zze)localIInterface;
} else {
localObject = new zzf(localIBinder);
}
}
zzc = (zze)localObject;
try
{
zzc.zza(zzn.zza(zzb(paramContext).getResources()), GooglePlayServicesUtil.GOOGLE_PLAY_SERVICES_VERSION_CODE);
return zzc;
}
catch (RemoteException localRemoteException)
{
throw new RuntimeRemoteException(localRemoteException);
}
}
private static <T> T zza(Class<?> paramClass)
{
try
{
Object localObject = paramClass.newInstance();
return localObject;
}
catch (IllegalAccessException localIllegalAccessException)
{
String str3 = String.valueOf(paramClass.getName());
String str4 = "Unable to call the default constructor of ".concat(str3);
str4 = str3.length() != 0 ? localIllegalAccessException : new String("Unable to call the default constructor of ");
throw new IllegalStateException(str4);
}
catch (InstantiationException localInstantiationException)
{
String str1 = String.valueOf(paramClass.getName());
String str2 = "Unable to instantiate the dynamic class ".concat(str1);
str2 = str1.length() != 0 ? localInstantiationException : new String("Unable to instantiate the dynamic class ");
throw new IllegalStateException(str2);
}
}
private static <T> T zza(ClassLoader paramClassLoader, String paramString)
{
try
{
Object localObject = zza(((ClassLoader)zzbq.zza(paramClassLoader)).loadClass(paramString));
return localObject;
}
catch (ClassNotFoundException localClassNotFoundException)
{
String str1 = String.valueOf(paramString);
String str2 = "Unable to find dynamic class ".concat(str1);
str2 = str1.length() != 0 ? localClassNotFoundException : new String("Unable to find dynamic class ");
throw new IllegalStateException(str2);
}
}
private static Context zzb(Context paramContext)
{
if (zzb != null) {
return zzb;
}
Context localContext = zzc(paramContext);
zzb = localContext;
return localContext;
}
private static Context zzc(Context paramContext)
{
try
{
Context localContext = DynamiteModule.zza(paramContext, DynamiteModule.zza, "com.google.android.gms.maps_dynamite").zza();
return localContext;
}
catch (Throwable localThrowable)
{
Log.e(zza, "Failed to load maps module, use legacy", localThrowable);
}
return GooglePlayServicesUtil.getRemoteContext(paramContext);
}
}
| [
"[email protected]"
] | |
71b11da40d5c9407f9cfc753e6dcac55b914e182 | 3ecc4e6edcf394adc64f3dfcf56560121b33e319 | /ag-web/src/main/java/com/cloud/service/impl/TbAdminServiceImap.java | 4307de5f29ca7d2309851b7d6f50efb8cd019a32 | [] | no_license | taotao11/ag-cloud | 548cd1f89b82cbcc21345409e6eebd98e1a1fc46 | 00b3dc8bacebf5f153f338a0dd7b493cdf765607 | refs/heads/master | 2021-04-06T08:32:36.991997 | 2018-03-21T00:37:35 | 2018-03-21T00:37:35 | 124,369,113 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 466 | java | package com.cloud.service.impl;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.cloud.entity.TbAdmin;
import com.cloud.mapper.TbAdminDao;
import com.cloud.service.TbAdminService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author taotao
* @since 2018-03-03
*/
@Service("tbAdminService")
public class TbAdminServiceImap extends ServiceImpl<TbAdminDao, TbAdmin> implements TbAdminService {
}
| [
"[email protected]"
] | |
d7007154d94446f89d1be873b1526acc9c625e7c | 1bc371b49271db936d0f9d18341223587ec8c436 | /common/src/main/java/com/rk/common/utils/wheel/CityDataModel.java | 6179d959b8c7124c7ca37decc220ee50745e4605 | [] | no_license | wenbo-ya/quickMvvmProject | e765aa80f8fd8fc62d0245cb2bbe144a13288cf4 | 34989f142d1b979d2e6b01769ff6b2c2fb6e280e | refs/heads/master | 2023-04-09T20:36:43.529974 | 2021-04-12T03:38:01 | 2021-04-12T03:38:01 | 343,034,374 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 482 | java | package com.rk.common.utils.wheel;
import java.util.List;
/**
* CodeFatCat
*/
public class CityDataModel {
public String areaId;
public String areaName;
public List<CitiesBean> cities;
public static class CitiesBean {
public String areaId;
public String areaName;
public List<CountiesBean> counties;
public static class CountiesBean {
public String areaId;
public String areaName;
}
}
}
| [
"“[email protected]”"
] | |
f28bc4354355a378ad08347c7b6b6966100ce37c | 10d0f5cccbacd12c12e319078859368faac63787 | /tapaal/src/dk/aau/cs/TCTL/TCTLTransitionNode.java | e3632739c24bc43aa42ab5fcb7b16e26112228e6 | [] | no_license | zinoviy23/tapn-to-mg | 66c3006dc418e52997b7a9d6e70525bab191f3d5 | f04455fcb7bb7c270cbd76f485f50430621af848 | refs/heads/master | 2023-02-04T06:49:42.734888 | 2020-12-16T15:27:58 | 2020-12-16T15:27:58 | 225,715,799 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,928 | java | package dk.aau.cs.TCTL;
import dk.aau.cs.TCTL.visitors.ITCTLVisitor;
import dk.aau.cs.io.NamePurifier;
public class TCTLTransitionNode extends TCTLAbstractStateProperty {
String template;
String transition;
public TCTLTransitionNode(String template, String transition) {
this.template = NamePurifier.purify(template);
this.transition = NamePurifier.purify(transition);
}
public TCTLTransitionNode(String transition) {
this("", transition);
}
@Override
public TCTLAbstractStateProperty replace(TCTLAbstractProperty object1,
TCTLAbstractProperty object2) {
if (this == object1 && object2 instanceof TCTLAbstractStateProperty) {
TCTLAbstractStateProperty obj2 = (TCTLAbstractStateProperty) object2;
obj2.setParent(parent);
return obj2;
} else {
return this;
}
}
@Override
public TCTLAbstractStateProperty copy() {
return new TCTLTransitionNode(template, transition);
}
@Override
public void accept(ITCTLVisitor visitor, Object context) {
visitor.visit(this, context);
}
@Override
public boolean containsAtomicPropositionWithSpecificPlaceInTemplate(
String templateName, String placeName) {
return false;
}
@Override
public boolean containsAtomicPropositionWithSpecificTransitionInTemplate(
String templateName, String transitionName) {
return transition.equals(transitionName) && template.equals(templateName);
}
@Override
public boolean containsPlaceHolder() {
return false;
}
@Override
public TCTLAbstractProperty findFirstPlaceHolder() {
return null;
}
public String getTemplate() {
return template;
}
public void setTemplate(String template) {
this.template = template;
}
public String getTransition() {
return this.transition;
}
public void setTransition(String transition) {
this.transition = transition;
}
@Override
public String toString() {
return (template == "" ? "" : template + ".") + transition;
}
}
| [
"[email protected]"
] | |
fc961723ab2be3e90359305650d776dc06770984 | 64e955ac1321223e38c4c2ca932b08502c22c0d5 | /Holo Festival/src/main/java/com/bai/nfc/zbar/decode/MainHandler.java | 18a0ba6540cb478fd714efe3b9f9c6ce26cb35fe | [] | no_license | ZhouYangGaoGao/ZY | 61105364881a659e00e96f776e6e40727f613606 | 0a9174f42e2003ee48a321a51a3c7179dfb9c1b8 | refs/heads/master | 2020-04-03T19:41:40.470974 | 2019-11-12T06:53:52 | 2019-11-12T06:53:52 | 155,523,656 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,032 | java | package com.bai.nfc.zbar.decode;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import com.bai.nfc.R;
import com.bai.nfc.zbar.CaptureActivity;
import com.bai.nfc.zbar.camera.CameraManager;
/**
* desc:主线程的Handler
* Author: znq
* Date: 2016-11-03 15:55
*/
public class MainHandler extends Handler {
private static final String TAG = "MainHandler";
private final CaptureActivity activity;
/**
* 真正负责扫描任务的核心线程
*/
private final DecodeThread decodeThread;
private State state;
private final CameraManager cameraManager;
public MainHandler(CaptureActivity activity, CameraManager cameraManager) {
this.activity = activity;
// 启动扫描线程
decodeThread = new DecodeThread(activity);
decodeThread.start();
state = State.SUCCESS;
this.cameraManager = cameraManager;
// 开启相机预览界面.并且自动聚焦
cameraManager.startPreview();
restartPreviewAndDecode();
}
/**
* 当前扫描的状态
*/
private enum State {
/**
* 预览
*/
PREVIEW,
/**
* 扫描成功
*/
SUCCESS,
/**
* 结束扫描
*/
DONE
}
@Override
public void handleMessage(Message msg) {
if (msg.what == R.id.decode_succeeded) {
String result = (String) msg.obj;
if (!TextUtils.isEmpty(result)) {
activity.checkResult(result);
}
} else if (msg.what == R.id.restart_preview) {
restartPreviewAndDecode();
} else if (msg.what == R.id.decode_failed) {
// We're decoding as fast as possible, so when one decode fails,
// start another.
state = State.PREVIEW;
cameraManager.requestPreviewFrame(decodeThread.getHandler(),
R.id.decode);
}
}
/**
* 完成一次扫描后,只需要再调用此方法即可
*/
private void restartPreviewAndDecode() {
if (state == State.SUCCESS) {
state = State.PREVIEW;
// 向decodeThread绑定的handler(DecodeHandler)发送解码消息
cameraManager.requestPreviewFrame(decodeThread.getHandler(),
R.id.decode);
}
}
public void quitSynchronously() {
state = State.DONE;
cameraManager.stopPreview();
Message quit = Message.obtain(decodeThread.getHandler(), R.id.quit);
quit.sendToTarget();
try {
// Wait at most half a second; should be enough time, and onPause()
// will timeout quickly
decodeThread.join(500L);
} catch (InterruptedException e) {
// continue
}
// Be absolutely sure we don't send any queued up messages
removeMessages(R.id.decode_succeeded);
removeMessages(R.id.decode_failed);
}
}
| [
"[email protected]"
] | |
9c53e022745ee99e9b21b78064bc5da5d5855562 | c32a21d899e4ea8fdfa8640a04170f1990027fd0 | /project/src/main/java/mc/login/controller/LogoutController.java | 79facb7570a5945c9478d981ff4b080b746407d5 | [] | no_license | SoH-2/git_Project | 24afef3437e2bf7b2e4b8b5c6f18d9e91f565cd0 | 25ff7aa42eaddc67f23894afd781fc7065301bd2 | refs/heads/master | 2023-01-05T22:32:53.634549 | 2020-11-09T11:28:28 | 2020-11-09T11:28:28 | 313,582,425 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package mc.login.controller;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class LogoutController {
@RequestMapping("/logout.do")
public String logout(HttpSession session) {
session.invalidate();
return "redirect:login.do";
}
}
| [
"[email protected]"
] | |
e0c98378934db45b3feb5ff0af76566ffe2992a3 | 83ea65940f58eb4efb8a7f40f61dbd6d060bcdc7 | /src/main/java/modulo06/GestoreVeicoli.java | 07da2e0667338996a101f5fdaa41f23b558805e7 | [] | no_license | BortoloMuttiDev/CorsoTreeJava2020Marcandelli | d9ce7d4fccac804726059c0cc8dd2e473702e683 | 25c493528fad4ce5ee118197aef51799caf7f98a | refs/heads/main | 2023-01-19T08:22:46.169243 | 2020-11-03T15:34:00 | 2020-11-03T15:34:00 | 306,328,417 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package modulo06;
public class GestoreVeicoli {
public static void main(String[] args) {
Automobile automobile = new Automobile("cf123rm", 4, 4);
AutoCarro autoCarro = new AutoCarro("ca133sm", 4, 2);
System.out.println(automobile.toString());
System.out.println(autoCarro.toString());
}
}
| [
"[email protected]"
] | |
cb7b3d2fda90ab1963bd634228d9a9baf3b54c0f | 7755a356382ed2936738f2087e4bfe333091f3dc | /BeatDrop-Server/src/main/java/com/example/BeatDropServer/repositories/LikeRepository.java | 07294cdd72f8953071d3cb1a603a35ca015877d1 | [
"MIT"
] | permissive | shardik95/Server-BeatDrop-Java | 12fb4df92afdb09fd21e25fb2c924c7e4342fe43 | 4db80e64796c1ac10ed0bfa1057ac43214839ed6 | refs/heads/master | 2022-07-17T22:41:04.140051 | 2020-02-23T06:12:06 | 2020-02-23T06:12:06 | 133,726,224 | 0 | 0 | MIT | 2022-06-20T23:17:41 | 2018-05-16T21:44:27 | Java | UTF-8 | Java | false | false | 233 | java | package com.example.BeatDropServer.repositories;
import org.springframework.data.repository.CrudRepository;
import com.example.BeatDropServer.model.Likes;
public interface LikeRepository extends CrudRepository<Likes, Integer>{
}
| [
"[email protected]"
] | |
255eb6375ad0f2ad52c5333cf623bd851a06afab | 2c947f0c7e2c19aa6099f59ffc3b4235ee4219e7 | /SmartHome/src/main/java/cz/fel/omo/smarthome/entity/vehicles/Ski.java | 2eaff294cafe1bda7858bea590256a9e6baaf478 | [] | no_license | arinamomot/simulation_of_SmartHome | d25661ae7942f1ae4600e8d1b55115f123ec6b23 | 6a09523e7c5d70331cfa732ad85f9ce566062c8f | refs/heads/main | 2023-06-13T02:20:30.015812 | 2021-07-11T17:12:45 | 2021-07-11T17:12:45 | 374,485,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package cz.fel.omo.smarthome.entity.vehicles;
import cz.fel.omo.smarthome.entity.devices.Documentation;
/**
* The type Ski.
*/
public class Ski extends Vehicle {
public Ski(int id) {
super(id);
type = "Ski";
documentation = new Documentation(type);
}
}
| [
"[email protected]"
] | |
1b67109c1cb426671401897b3285524dceb77378 | 82a34ea4e7a9cd905eab8cfa251da1db483725a4 | /MAD/com.sysord.mad.configDsl/src-gen/com/sysord/mad/configuration/madConfigDsl/CommandMdsl.java | 7a368b04594f37296cdd3f4d2f298d964950381e | [] | no_license | sysord/MAD | 8f6a4a5735a06015b7335613b1e0a1d3813d3298 | 14ba25a2d8e2a22211a85d39557255b0a21f15cc | refs/heads/master | 2020-04-20T21:53:57.999475 | 2015-06-04T07:56:47 | 2015-06-04T07:56:47 | 32,314,021 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | /**
*/
package com.sysord.mad.configuration.madConfigDsl;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Command Mdsl</b></em>'.
* <!-- end-user-doc -->
*
*
* @see com.sysord.mad.configuration.madConfigDsl.MadConfigDslPackage#getCommandMdsl()
* @model
* @generated
*/
public interface CommandMdsl extends EObject
{
} // CommandMdsl
| [
"[email protected]"
] | |
4386807df18d38e7a0c41c1b7967695461f839c6 | 41b001886440610ff9303616d06e3abf001b5452 | /src/main/java/com/tigratius/javacore/chapter05/MissingBreak.java | a11bf85ad334bf41030a379dc6a764d6ea1442c5 | [] | no_license | tigratius/JavaCore | 8514180d929216afdc5699436977830659bc9574 | 50f68a967b70eed39a90f6eb60e8bcd8d2fedde1 | refs/heads/master | 2020-04-22T14:25:25.083201 | 2019-06-03T17:13:52 | 2019-06-03T17:14:54 | 170,443,048 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 674 | java | package main.java.com.alex.javacore.chapter05;
public class MissingBreak {
public static void main(String args[]) {
for (int i = 0; i < 12; i++)
switch (i) {
case 0:
case 1:
case 2:
case 3:
case 4:
System.out.println("i < 5");
break;
case 5:
case 6:
case 7:
case 8:
case 9:
System.out.println("i < 10");
break;
default:
System.out.println("i >= 10");
}
}
}
| [
"[email protected]"
] | |
176fe76a65eb26ac660d5130e28cbdb0469d273a | 20c5fe83a827234024e77ad4107ae00e4ac425a4 | /src/org/zttc/itat/action/UserAction.java | be4afa1b9e2b5fbdaf4c0e58fdf42aca9331d6c9 | [] | no_license | Mr-Shang/SSH | 978d93898861f4afb758b53c0e70bfe63e743bfe | 9318258c0b3e266e5e6895fedacbd9003eb7a85a | refs/heads/master | 2021-01-10T16:26:52.809307 | 2016-02-05T12:58:45 | 2016-02-05T12:58:45 | 51,077,805 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,949 | java | package org.zttc.itat.action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zttc.itat.model.User;
import org.zttc.itat.service.IGroupService;
import org.zttc.itat.service.IUserService;
import javax.annotation.Resource;
@SuppressWarnings("serial")
/**
* 此时等于用Spring来创建了userAction对象,在struts的配置文件中写action的class的时候
* 就不能写类,而应该是userAction中对象
* @author Administrator
*
*/
@Controller("userAction")
@Scope("prototype")
public class UserAction extends ActionSupport implements ModelDriven<User> {
private User user;
private IUserService userService;
private IGroupService groupService;
private int gid;
public int getGid() {
return gid;
}
public void setGid(int gid) {
this.gid = gid;
}
public IUserService getUserService() {
return userService;
}
@Resource
public void setUserService(IUserService userService) {
this.userService = userService;
}
public IGroupService getGroupService() {
return groupService;
}
@Resource
public void setGroupService(IGroupService groupService) {
this.groupService = groupService;
}
@Override
public User getModel() {
if(user==null) user = new User();
return user;
}
public String addInput() {
ActionContext.getContext().put("gs", groupService.listAllGroup());
return SUCCESS;
}
public void validateAdd() {
if(user.getUsername()==null||"".equals(user.getUsername())) {
this.addFieldError("username","用户名不能为空");
}
if(user.getNickname()==null||"".equals(user.getNickname())) {
this.addFieldError("nickname","用户昵称不能为空");
}
//如果有错误,得需要重新调用addInput方法把组的信息设置进去
if(this.hasFieldErrors()) {
addInput();
}
}
public String add() {
userService.add(user, gid);
ActionContext.getContext().put("url","/user_list.action");
return "redirect";
}
public String list() {
ActionContext.getContext().put("us", userService.findUser());
return SUCCESS;
}
public String delete() {
userService.delete(user.getId());
ActionContext.getContext().put("url","/user_list.action");
return "redirect";
}
public String updateInput() {
ActionContext.getContext().put("gs", groupService.listAllGroup());
User tu = userService.load(user.getId());
user.setNickname(tu.getNickname());
user.setPassword(tu.getPassword());
user.setUsername(tu.getUsername());
this.setGid(tu.getGroup().getId());
return SUCCESS;
}
public String update() {
User tu = userService.load(user.getId());
tu.setNickname(user.getNickname());
tu.setUsername(user.getUsername());
userService.update(tu,gid);
ActionContext.getContext().put("url","/user_list.action");
return "redirect";
}
}
| [
"[email protected]"
] | |
9b33205e6cb4004c96aca2b0a32f7dc99d5bb685 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_a38d333047041b3538f874617e34b9c0119293d9/EulerProblem/2_a38d333047041b3538f874617e34b9c0119293d9_EulerProblem_s.java | b574f69295a83c2c17a0a8b730cea8a33e4099cf | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,197 | java | package utils.euler;
public abstract class EulerProblem {
long answer;
int runningTime;
protected EulerTimer eulerTimer;
{
eulerTimer = new EulerTimer();
}
public static void run(EulerProblem instance) {
// Actually do the problem
instance.setAnswer(instance.doProblemSpecificStuff());
System.out.println("Answer: " + instance.getAnswer());
// See if the problem was completed in one minute
instance.setRunningTime(instance.getEulerTime());
System.out.println("--------------------------");
System.out.println("Running time: " + instance.getRunningTime() + " seconds");
}
protected abstract long doProblemSpecificStuff();
protected int getEulerTime() {
return eulerTimer.getRunningTime();
}
public long getAnswer() {
return answer;
}
protected void setAnswer(long answerIn) {
answer = answerIn;
}
public int getRunningTime() {
return runningTime;
}
protected void setRunningTime(int runningTimeIn) {
runningTime = runningTimeIn;
}
}
| [
"[email protected]"
] | |
0e7244ab148f44bfc656ac54aa1de23e9a0d160c | 6b5abedc2e08f40cbcba5325a7fc8f35ad90282e | /!Random Java Code and Homeworks/Design_Patterns_Proxy/AccountLog.java | f2ae4c4e0a98c806892414fd2ae509161be7d668 | [] | no_license | dclems93/Java-MISC | 5f08b02ab0a255e153d150648c70fa862234674a | ea5cfba1c4c33c2843e4bf14d7f9a6fe544cc4da | refs/heads/master | 2021-09-10T03:01:58.204379 | 2018-03-20T20:43:54 | 2018-03-20T20:43:54 | 126,079,840 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | import java.util.*;
class AccountLog{
public static void main(String[] args){
Scanner s = new Scanner(System.in);
GetFileAccess realFileAccess = new FileAccess();
GetFileAccess proxyFileAccess = new AccessProxy();
System.out.println("What is your Username?");
String username = s.nextLine();
System.out.println("What is your SSN?");
String ssn = s.nextLine();
System.out.println("What is your Bank Number?");
String banknumber = s.nextLine();
proxyFileAccess.addUser(username, ssn, banknumber);
//realFileAccess.readUser(username);
// this line does not work because the proxy blocks this method from being implimented, thus
// securing the data.
}
} | [
"[email protected]"
] | |
38abd68410ee95ef386fa56c641d05249d5398a1 | 34b54878443d6f88015b7dabc63793d742a03212 | /src/main/BitStream.java | eb19460b7e95e8cc57cb4cc465f8ba7cf264efc6 | [] | no_license | Jaswar/CPU | 07674995cb89f9be801e4ba5d539bc1754ce4187 | 4d094e6db37a3a245e02eeb6549d95e9c3fc307f | refs/heads/main | 2023-04-21T23:01:49.978760 | 2021-04-22T19:57:07 | 2021-04-22T19:57:07 | 346,064,289 | 1 | 0 | null | 2021-04-22T19:57:08 | 2021-03-09T16:04:55 | Java | UTF-8 | Java | false | false | 3,121 | java | package main;
import main.exceptions.BitStreamInputSizeMismatch;
import main.utils.DataConverter;
import java.util.ArrayList;
import java.util.List;
public class BitStream {
private List<Node> endpoints;
private boolean[] data;
private Node source;
/**Constructors for the BitStream class.
*
* @param size - the size of the stream (ie how many bits should be contained)
* @param endpoints - a list of endpoints/nodes connected with this stream
*/
public BitStream(int size, List<Node> endpoints) {
this.endpoints = endpoints;
this.data = new boolean[size];
this.source = null;
initializeBitStream();
}
public BitStream(int size) {
this(size, new ArrayList<>());
}
/**Method used to initialize the data component to an array consisting of only "false".
*/
private void initializeBitStream() {
for (int i = 0; i < this.getSize(); i++) {
this.data[i] = false;
}
}
/**Getters for all the attributes of the BitStream class
*/
public List<Node> getEndpoints() {
return endpoints;
}
public boolean[] getData() {
return data;
}
public int getSize() {
return this.data.length;
}
public Node getSource() {return this.source;}
/**Setters for all the attributes of the BitStream class
*/
public void setEndpoints(List<Node> endpoints) {
this.endpoints = endpoints;
}
public void setData(boolean[] data) {
if (data.length != this.data.length) {
throw new BitStreamInputSizeMismatch(this);
}
for (int i = 0; i < data.length; i++) {
this.data[i] = data[i];
}
}
public void setSource(Node source) {this.source = source;}
/**Add a new endpoint to the BitStream.
*
* @param node - the endpoint to add
*/
public void addNewEndpoint(Node node) {this.endpoints.add(node);}
/**Remove an endpoint from the BitStream.
*
* @param node - the endpoint to remove
*/
public void removeEndpoint(Node node) {
this.endpoints.remove(node);
}
/**Get all neighbours of a node connected with this BitStream.
*
* @param node - the node whose neighbours should be returned
* @return - the list of neighbours of node
*/
public List<Node> getAllNeighbours(Node node) {
List<Node> out = new ArrayList<>();
int countCallingNode = 0;
for (Node neighbour : this.endpoints) {
if (neighbour != node) {
out.add(neighbour);
}
else {
countCallingNode++;
}
}
for (int i = 0; i < countCallingNode - 1; i++) {
out.add(node);
}
return out;
}
/**Override the default toString method.
*
* @return - a String represenation of this
*/
@Override
public String toString() {
return "BitStream<" + this.getSize() + ", " +
DataConverter.convertBoolToBin(this.data) + ">";
}
}
| [
"[email protected]"
] | |
a47289b0d4d79038dc68427345df0a8d894daae7 | b40591ea380eced5360cc9f30e55a766f3a66585 | /qunaer/App/src/main/java/com/mqunar/contacts/basis/impl/common/CollectContactsError.java | 3eec26fcc55129fb5af725fe12a5d66bdc60315a | [] | no_license | PoseidonMRT/UserfulCodeResource | 08935f4155ac7567fc279300a03f80337f9a5516 | 040dacc22c236fde06f650c46c5cfeb8d52171c0 | refs/heads/master | 2022-10-09T13:00:48.616694 | 2019-04-19T02:42:45 | 2019-04-19T02:42:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 147 | java | package com.mqunar.contacts.basis.impl.common;
public class CollectContactsError {
public CollectContactsError(Exception exception) {
}
}
| [
"[email protected]"
] | |
447dec91a1bef465ca6000e862b1247c6ce0086f | e86950ce3438ff3234f51813c8f3c198480d388e | /CouponsSystem/src/com/couponssystem/exception/PurchaseCouponException.java | e44f7188e5a5c21b0bf325aa54d66a1ae29b350a | [] | no_license | eladh11/jb-coupon-system | cb5ddc0f0344b62668daefe2349a80c9e95af76e | ad737d50cfb666cb65d37ae587910f51401df2c7 | refs/heads/master | 2022-12-04T06:38:05.090833 | 2020-08-25T14:21:40 | 2020-08-25T14:21:40 | 276,123,931 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 192 | java | package com.couponssystem.exception;
public class PurchaseCouponException extends Exception {
public PurchaseCouponException(String message) {
System.out.println(message);
}
}
| [
"elad@DESKTOP-STB7G6P"
] | elad@DESKTOP-STB7G6P |
5c06225e64f228d59c4e4ddcfe15f738ecf8a362 | 0546669bbbcb91f1eb5e2198c6c0b86f1339cbd9 | /spring-boot-resteasy/src/main/java/com/harshit/resteasy/dao/ProductRepository.java | 86a9dc1cc2d962409642e7eab3dbe381d6387656 | [] | no_license | Group9FSDBATCH/capstoneproject | 1081fc69ba9523a3ffaa4e820a108dc268ec4ea0 | 78c710d6bb7ad2534ed01e6fe2e8fddf5d708975 | refs/heads/master | 2023-04-24T03:57:16.302290 | 2021-05-18T13:31:33 | 2021-05-18T13:31:33 | 368,537,424 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 672 | java | package com.harshit.resteasy.dao;
import com.harshit.resteasy.entity.Product;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestParam;
@CrossOrigin
public interface ProductRepository extends JpaRepository<Product,Long> {
Page<Product> findByCategoryId(@Param("id") Long id, Pageable pageable);
Page<Product> findByNameContaining(@RequestParam("name")String name, Pageable pageable);
}
| [
"[email protected]"
] | |
5d599be7dc7e1559b8551124ebd04ee1addbcc30 | 76816fba2b79af8b88a7a6a24ce7edf1992d500b | /core/src/com/stasique/game/sprites/Tube.java | c67d07337c1bda7213cd80b76d1b029d15c7efa4 | [] | no_license | Kollejio/FlappyBird | 5589c40a88b94173523c6ce3eefd5f40041ec52a | 28474611106eb3bf6ce5ac38041cbff5114d928b | refs/heads/master | 2020-04-13T17:01:47.620800 | 2018-12-27T21:46:11 | 2018-12-27T21:46:11 | 163,337,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,453 | java | package com.stasique.game.sprites;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import java.util.Random;
/**
* Created by ceasefire on 02.11.2018
*/
public class Tube{
// ширина трубы
public static final int TUBE_WIDTH = 52;
// диапазон отклонений
private static final int FLUCTUATION = 140;
// высота просвета
private static final int TUBE_GAP = 100;
// нижняя граница просвета
private static final int LOWEST_OPENING = 120;
private Texture topTube, bottomTube;
private Vector2 posTopTube, posBotTube;
// границы для модели столкновения труб
private Rectangle boundsTop, boundsBot;
private Random rand;
public Tube(float x){
topTube = new Texture("toptube.png");
bottomTube = new Texture("bottomtube.png");
rand = new Random();
// рандомим верхнюю трубу
posTopTube = new Vector2(x, rand.nextInt(FLUCTUATION) + TUBE_GAP + LOWEST_OPENING);
// нижняя труба:
posBotTube = new Vector2(x, posTopTube.y - TUBE_GAP - bottomTube.getHeight());
// граница для верхней трубы
boundsTop = new Rectangle(posTopTube.x, posTopTube.y, topTube.getWidth(), topTube.getHeight());
// граница для нижней трубы
boundsBot = new Rectangle(posBotTube.x, posBotTube.y, bottomTube.getWidth(), bottomTube.getHeight());
}
// движение трубы
public void reposition(float x){
posTopTube.set(x, rand.nextInt(FLUCTUATION) + TUBE_GAP + LOWEST_OPENING);
posBotTube.set(x, posTopTube.y - TUBE_GAP - bottomTube.getHeight());
boundsTop.setPosition(posTopTube.x, posTopTube.y);
boundsBot.setPosition(posBotTube.x, posBotTube.y);
}
public boolean collides(Rectangle player){
return player.overlaps(boundsTop) || player.overlaps(boundsBot);
}
public void dispose(){
topTube.dispose();
bottomTube.dispose();
}
public Texture getBottomTube() {
return bottomTube;
}
public Texture getTopTube() {
return topTube;
}
public Vector2 getPosTopTube() {
return posTopTube;
}
public Vector2 getPosBotTube() {
return posBotTube;
}
}
| [
"[email protected]"
] | |
2b42b994ce4184e5429d528723186d339047e946 | da79217a10d7d79e535e78b479a9e609dbf12888 | /src/main/java/netcracker/school/dao/CategoryDAO.java | e5a9bd0836a0e01887552565a4801f9b398ac170 | [] | no_license | whitelamer/zadanie_library | 734ceac6da8c3e9bd8a2973c4667995385a37a27 | 9e44cee491383e31536b022a2117a09a7d193ebf | refs/heads/master | 2021-01-12T11:27:42.920098 | 2016-12-21T19:17:34 | 2016-12-21T19:17:34 | 72,931,054 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 138 | java | package netcracker.school.dao;
import netcracker.school.models.Category;
public interface CategoryDAO extends AbstractDao<Category> {
}
| [
"[email protected]"
] | |
771deaff55ff44422a1c124a19f7b47933a3c6e6 | d37140a0e1ff78014729ec2adb7a14f86e633dd6 | /day10/代码/main/java/com/example/dell/myapplication/Fragment/AppointCourseFragment.java | 00c43baf22c68c84f2f7e20aa9cca1b149b0a33e | [] | no_license | lan1998/HomeWork | 219e97e7a4cb220901b58447e500b3d5b55982cb | c0df07a5561b84592db39f03dcf74500357b1ba7 | refs/heads/master | 2022-11-09T09:58:02.441229 | 2020-06-16T16:33:19 | 2020-06-16T16:33:19 | 268,294,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.example.dell.myapplication.Fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.example.dell.myapplication.R;
/**
* A simple {@link Fragment} subclass.
*/
public class AppointCourseFragment extends Fragment {
public AppointCourseFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_appoint_course, container, false);
}
}
| [
"[email protected]"
] | |
96c8611d989cfffe8608b17ae3a7cdbff1ac79f5 | c81c1a9d6cc43ced8a013e36146b7b8e4ba1c635 | /projects61B/NBody/NBody.java | a607b2a7007cf22a869012f82fe34ddaf80273d6 | [] | no_license | amandrell/Projects | 89e8398de84c2093b2f56c90a1172be41bde7509 | 1cd618c275de5e8b09a9a07e63077846b37fde30 | refs/heads/master | 2021-05-02T05:58:01.364196 | 2018-04-21T03:36:43 | 2018-04-21T03:36:43 | 120,850,362 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,682 | java | import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Locale;
import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.*;
public class NBody {
public static Planet[] inplanets;
public static double xxVel;
public static double yyVel
public static void main(String[] args) {
double T = Double.parseDouble(args[0]);
double dt = Double.parseDouble(args[1]);
String filename = args[2];
/* reads in the radius of universe and array of planets */
Planet[] inplanets = readPlanets(filename);
double inradius = readRadius(filename);
//read in inplanets && inradius;
//sets universe scale
StdDraw.setScale(-(inradius), inradius);
/* Clears the drawing window. */
StdDraw.clear();
StdDraw.picture(0, 0, "images/starfield.jpg");
/* Shows the drawing to the screen. */
StdDraw.show();
/* draws each planet in respective positions */
for (int i = 0; i < inplanets.length; i += 1)
inplanets[i].draw();
StdDraw.enableDoubleBuffering();
int timevariable = 0;
double[] xForces = new double[inplanets.length];
double[] yForces = new double[inplanets.length];
while (timevariable != T) {
for (int i = 0; i < inplanets.length; i +=1) {
/* calculates net X, Y force for each planet */
double xForce = inplanets[i].calcNetForceExertedByX(inplanets);
double yForce = inplanets[i].calcNetForceExertedByY(inplanets);
xForces[i] = xForce;
yForces[i] = yForce;
}
for (int i = 0; i < inplanets.length; i += 1) {
inplanets[i].update(dt, xForces[i], yForces[i]);
}
StdDraw.clear();
StdDraw.picture(0, 0, "images/starfield.jpg");
for (int i = 0; i < inplanets.length; i += 1) {
inplanets[i].draw();
}
StdDraw.show();
StdDraw.pause(10);
timevariable += dt;
}
StdOut.printf("%d\n", inplanets.length);
StdOut.printf("%.2e\n", inradius);
for (int i = 0; i < inplanets.length; i++) {
StdOut.printf("%11.4e %11.4e %11.4e %11.4e %11.4e %12s\n",
inplanets[i].xxPos, inplanets[i].yyPos, inplanets[i].xxVel,
inplanets[i].yyVel, inplanets[i].mass, inplanets[i].imgFileName);
}
StdAudio.play("audio/2001.mid");
}
public static double readRadius(String filename) {
/* returns the radius of the universe in specified universe*/
In fileobject = new In(filename);
double num_planets;
double universe_radius;
num_planets = Double.parseDouble(fileobject.readLine());
universe_radius = Double.parseDouble(fileobject.readLine());
return universe_radius;
}
public static Planet[] readPlanets(String filename) {
/* returns an array of the planets in specified universe */
String planet;
String str;
double xxPos;
double yyPos;
double xxVel;
double yyVel;
double mass;
String imgFileName;
In fileobject = new In(filename);
int num_planets = fileobject.readInt();
Planet[] planets = new Planet[num_planets];
fileobject.readDouble();
int index = 0;
while (index < num_planets) {
xxPos = fileobject.readDouble();
yyPos = fileobject.readDouble();
xxVel = fileobject.readDouble();
yyVel = fileobject.readDouble();
mass = fileobject.readDouble();
imgFileName = fileobject.readString();
Planet new_planet = new Planet(xxPos, yyPos, xxVel, yyVel, mass, imgFileName);
planets[index] = new_planet;
index += 1;
}
return planets;
}
}
| [
"[email protected]"
] | |
1087b018d8057629d05c46f721cc2041157095da | 85f4feaf567d78f31c45c8d881827810e34631dc | /spring-cloud-eureka/product-catalog/src/main/java/com/example/productcatalog/conf/jackson/XmlDataTableRequestDtoMixin.java | fa03aecb97212bf674406ea94a9e32314d0b146f | [] | no_license | ajay-kmr/spring-cloud | e986146b14a5185fc6625d9d8af44620225e9b36 | 580e127f73f379566e88536e1b15dbd9fc79c69b | refs/heads/master | 2020-03-24T19:13:59.420320 | 2018-08-20T16:13:31 | 2018-08-20T16:13:31 | 142,912,707 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,067 | java | package com.example.productcatalog.conf.jackson;
import com.example.productcatalog.dto.DataTableRequestDTO;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.Collection;
@XmlRootElement(name = "response")
@XmlAccessorType(value = XmlAccessType.PROPERTY)
public class XmlDataTableRequestDtoMixin<T> extends DataTableRequestDTO<T> {
@Override
@XmlTransient
public T getQuery() {
return super.getQuery();
}
@Override
@JsonSetter("query")
@JacksonXmlProperty(localName = "query")
public void setQuery(T query) {
//Do Nothing
}
@Override
@JsonInclude(JsonInclude.Include.NON_EMPTY)
// @XmlElement(name = "data-item")
@JacksonXmlProperty(localName = "query-item")
public T getDataForXmlAsSingleNode() {
//Do Nothing as the Mixin is used for separating annotation only..
// It does not perform any business logic or code injection
return null;
}
/**
* If u want to create any field that needs to be included in XML and not in JSON,
* then simply create a method which should not start with get and apply appropriate annotations of JaxB
*
* @return
*/
@Override
@JsonInclude(JsonInclude.Include.NON_EMPTY)
// @XmlElementWrapper(name = "data-items")
// @XmlElement(name = "item")
@JacksonXmlElementWrapper(localName = "query-items")
@JacksonXmlProperty(localName = "item")
public Collection getDataForXmlAsCollection() {
//Do Nothing as the Mixin is used for separating annotation only..
// It does not perform any business logic or code injection
return null;
}
}
| [
"[email protected]"
] | |
5a3c2c7db6b075d89b6ce3f8dcca52503ea459ce | 7560d3fe1bdd9c95377b8701a32ba4dc58208b0b | /model/src/main/java/cuifua/vo/hosp/DepartmentVo.java | aa797a7646fbea19f56fb4b80353c9ffb5463380 | [] | no_license | cuifua/07_HospitalDemo | b21250e6251d403f602dac280aac4f2caccb9110 | 0821912c3a94f0d609e935d622ef69fab0de9e88 | refs/heads/master | 2023-07-10T14:15:07.572805 | 2021-08-17T06:45:29 | 2021-08-17T06:45:29 | 397,128,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 509 | java | package cuifua.vo.hosp;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(description = "Department")
public class DepartmentVo {
@ApiModelProperty(value = "科室编号")
private String depcode;
@ApiModelProperty(value = "科室名称")
private String depname;
@ApiModelProperty(value = "下级节点")
private List<DepartmentVo> children;
}
| [
"[email protected]"
] | |
50623ff81fa1b271d3e1946aa8be09e51e3dd460 | 230feba97ea96e88be283d6df1e3bdcaea2dcf19 | /src/main/java/com/graduation/project/configurer/Swagger2Configurer.java | 8fc12b015b045b38af5e0362e931f8e4957e4cc0 | [] | no_license | xuqisheng/graducation_lyt | 2989a7be260d79f185b7a0a95cf02ab84bcf5ae1 | 137d72cbc69ce8e9d7a91e5ed2abd211b2c46ed8 | refs/heads/master | 2021-09-10T15:15:48.802717 | 2018-03-28T10:20:58 | 2018-03-28T10:20:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,391 | java | package com.graduation.project.configurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author nickChen
* @since 2018-1-17
*/
@Configuration
@EnableSwagger2
public class Swagger2Configurer {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
// 指定controller存放的目录路径
.apis(RequestHandlerSelectors.basePackage("com.graduation.project.web"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
// 文档标题
.title("NickChen's Blog Docket")
// 文档描述
.description("描述")
.termsOfServiceUrl("网址")
.version("v1")
.build();
}
}
| [
"[email protected]"
] | |
0bc2975619b8fff7a88d8d755a28e427fbc40cb0 | 097d0bf022f989b88bfb9b914cc41bdfc759905a | /04_Methods/src/com/abhi/cj/ArithmeticApp.java | f27d03102f47fe67402d8041462a6b4d8dba6ecd | [] | no_license | abhinay-developer/JAVA-DEVELOPMENT | 801b7b16145cd86d5aeac0ac43aa3220ce962f6d | a87e64c14c32220f7d0e6f8dc7ce84e40a16cf51 | refs/heads/main | 2023-05-29T01:06:09.979512 | 2021-06-13T15:22:11 | 2021-06-13T15:22:11 | 370,559,441 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 265 | java | package com.abhi.cj;
public class ArithmeticApp {
public static void main(String[] args) {
Arithmetic arithmetic=new Arithmetic();
arithmetic.add1(10, 20);
arithmetic.add2();
arithmetic.add3(10, 20);
arithmetic.add4();
}
}
| [
"[email protected]"
] | |
faa956b4c1fa874e3b41225345db8add39042dda | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Chart/5/org/jfree/chart/renderer/xy/AbstractXYItemRenderer_getBaseItemLabelGenerator_372.java | 9ac73d8191f90b4bfef4b8fee35f22cdac28e87f | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,147 | java |
org jfree chart render
base creat link item render xyitemrender
implement
abstract item render abstractxyitemrender abstract render abstractrender
return base item label gener
gener possibl code code
item label gener xyitemlabelgener base item label gener getbaseitemlabelgener
base item label gener baseitemlabelgener
| [
"[email protected]"
] | |
b1ee6cae86300d2e95f2fdcb5f62a5f610d5953d | 110134ddd2c9a977b11ab777954e526a03dea5e7 | /src/com/hern/service/impl/CartServiceImpl.java | 627b123fce630697aafc973e8645d18a1fc3dfb5 | [] | no_license | songzhaoheng/Hern-Shop | ace319c93d382ecbad71225694b7169d6b515739 | a7dded0c90603b4ddde46e3dcba1e7367f0764b0 | refs/heads/master | 2022-12-26T11:04:31.869701 | 2020-03-04T15:08:22 | 2020-03-04T15:08:22 | 241,898,411 | 0 | 0 | null | 2022-12-16T15:25:26 | 2020-02-20T14:00:37 | JavaScript | UTF-8 | Java | false | false | 1,593 | java | package com.hern.service.impl;
import com.hern.entity.Cart;
import com.hern.mapper.CartMapper;
import com.hern.service.ICartService;
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 java.util.List;
@Service
public class CartServiceImpl implements ICartService {
@Autowired
private CartMapper cartMapper;
@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Exception.class)
@Override
public Integer addGoodsToCart(Cart cart) {
Integer rs = cartMapper.addCart(cart);
return rs;
}
@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
@Override
public Cart findCartByUserId(Integer userId, Integer goodsId) {
return cartMapper.findCartByUserId(userId, goodsId);
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Exception.class)
@Override
public Integer updateCart(Cart cart) {
return cartMapper.updateCart(cart);
}
@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
@Override
public List<Cart> findCartByUserId(Integer userId) {
return cartMapper.findCartListByUserId(userId);
}
@Transactional(propagation=Propagation.REQUIRED,rollbackFor=Exception.class)
@Override
public Integer deleteCart(Integer cartId) {
return cartMapper.deleteCart(cartId);
}
@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
@Override
public Cart findCartById(Integer cartId) {
return cartMapper.findCartById(cartId);
}
}
| [
"23369"
] | 23369 |
0c8510387078fadc3daecb52259c4075ff66ed0f | c9baf16dee0416806f21f486657c5a5e7e584048 | /app/src/main/java/com/example/newspaperapplication/MyRecyclerAdapter.java | 3aa3a68131908c798dd968b570285a83ef9c80a3 | [] | no_license | silvar1122/Trending-News-App | 59f8d75ec7185ee4f25078620e4786c7e9b22250 | ecf51f7c0dcadd9a018fc1281dce2286675af838 | refs/heads/master | 2023-02-03T05:16:21.332155 | 2020-12-24T09:43:10 | 2020-12-24T09:43:10 | 323,693,823 | 1 | 0 | null | 2020-12-24T09:43:11 | 2020-12-22T17:39:49 | Java | UTF-8 | Java | false | false | 2,849 | java | package com.example.newspaperapplication;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import de.hdodenhof.circleimageview.CircleImageView;
public class MyRecyclerAdapter extends RecyclerView.Adapter<MyRecyclerAdapter.viewHolder>{
Context context;
ArrayList<Model>theDays;
public MyRecyclerAdapter(Context context, ArrayList<Model> theDays) {
this.context = context;
this.theDays = theDays;
}
@NonNull
@Override
public viewHolder onCreateViewHolder(@NonNull ViewGroup parent, final int viewType) {
LayoutInflater inflater=LayoutInflater.from(parent.getContext());
View view=inflater.inflate(R.layout.row_item,parent,false);
return new viewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull viewHolder holder, final int position) {
Model model=theDays.get(position);
holder.the_image.setImageResource(model.getThe_image());
holder.description.setText(model.getDescription());
holder.date.setText(model.getDate());
holder.linearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(position==0){
Intent intent=new Intent(context,Fruits.class);
context.startActivity(intent);
}
else if(position==1){
Intent intent=new Intent(context,Series.class);
context.startActivity(intent);
}
else if(position==2){
Intent intent=new Intent(context,Coronavirus.class);
context.startActivity(intent);
}
else {
Intent intent=new Intent(context,Infinix.class);
context.startActivity(intent);
}
}
});
}
@Override
public int getItemCount() {
return theDays.size();
}
class viewHolder extends RecyclerView.ViewHolder {
TextView description,date;
ImageView the_image;
LinearLayout linearLayout;
public viewHolder(@NonNull View itemView) {
super(itemView);
description=itemView.findViewById(R.id.description);
date=itemView.findViewById(R.id.date);
the_image=itemView.findViewById(R.id.the_image);
linearLayout=itemView.findViewById(R.id.the_news);
}
}
}
| [
"[email protected]"
] | |
3f8bc835bd8a44b1dc6ccd7d6f5bd033a915e60e | 62faa058c143b305d9eaffbec8d4da7b38e095c0 | /src/java/fr/paris/lutece/portal/service/mailinglist/MailingListRemovalListenerService.java | ae0239d2d86c0ea72d21d7273fbd530a9b640b45 | [] | permissive | dominiquesalasvega/lutece-core | c3d4c37d3513e6773c2e248288b576577e01aa60 | ca28d51f03a2ca65508e4d8411b6da655e31b643 | refs/heads/master | 2020-06-17T16:17:49.268072 | 2020-05-15T00:09:32 | 2020-05-15T00:09:32 | 195,974,016 | 1 | 0 | BSD-3-Clause | 2019-07-09T09:11:32 | 2019-07-09T09:11:32 | null | UTF-8 | Java | false | false | 2,403 | java | /*
* Copyright (c) 2002-2017, Mairie de Paris
* 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
* and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice
* and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* 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 HOLDERS 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.
*
* License 1.0
*/
package fr.paris.lutece.portal.service.mailinglist;
import fr.paris.lutece.portal.service.spring.SpringContextService;
import fr.paris.lutece.portal.service.util.RemovalListenerService;
/**
* MailingListRemovalListenerService
*/
public final class MailingListRemovalListenerService
{
private static final String BEAN_MAILINGLIST_REMOVAL_SERVICE = "mailinglistRemovalService";
/**
* Private constructor
*/
private MailingListRemovalListenerService( )
{
}
/**
* Returns the removal service
*
* @return The removal service
*/
public static RemovalListenerService getService( )
{
return (RemovalListenerService) SpringContextService.getBean( BEAN_MAILINGLIST_REMOVAL_SERVICE );
}
}
| [
"[email protected]"
] | |
aba9ef2e41772a548f179b66d97e29c8c9919790 | 5851de2fd99abc4e47dac67c8d71e330e08a8f27 | /app/src/main/java/com/example/myapplication/NotificationActivity123.java | db6af251f158e4de9bc828a88b8f19f3a9e3d2d6 | [] | no_license | keepItProject/Finalinshallah | e526de5bdbf8094bb0d5dce1dd780bf0c510b2aa | 57b31fb068b5d849d7c4f0b76267231e8a35a90b | refs/heads/master | 2022-05-27T19:31:17.699398 | 2020-05-02T19:07:49 | 2020-05-02T19:07:49 | 259,437,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.example.myapplication;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class NotificationActivity123 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notification123);
}
}
| [
"[email protected]"
] | |
0c8ca5e6d1b23dd9e6f46c82f313693c42571bcb | f8c1d26a4943d671c1ad3c97f49ec12c644d6b47 | /NavigationDemo/app/src/main/java/com/example/navigationdemo/ui/share/ShareViewModel.java | bb97cf99cfa97c237062523164e8cedb2d16b2ad | [] | no_license | sanasheeraz/1804F1Android | 3d75c66e5923f7ad7b87cc67a073d908975c58f6 | 64824e84deaef754ed046307788dd9b1243059f8 | refs/heads/master | 2023-03-28T22:45:05.059205 | 2021-04-14T09:51:11 | 2021-04-14T09:51:11 | 335,579,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 453 | java | package com.example.navigationdemo.ui.share;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
public class ShareViewModel extends ViewModel {
private MutableLiveData<String> mText;
public ShareViewModel() {
mText = new MutableLiveData<>();
mText.setValue("This is share fragment");
}
public LiveData<String> getText() {
return mText;
}
} | [
"[email protected]"
] | |
7c9cef39602587c84fa4d5eabdd930f6f735e6a8 | 93f3578669fb0d0030a550316aebe0d7b4221631 | /admin-supplychain/src/main/java/cn/com/glsx/supplychain/controller/GpsDeviceController.java | ec26c5aab68e80e0aec8590181c8af8b4a34c4f0 | [] | no_license | shanghaif/supplychain | 4d7de62809b6c88ac5080a85a77fc4bf3d856db8 | c36c771b0304c5739de98bdfc322c0082a9e523d | refs/heads/master | 2023-02-09T19:01:35.562699 | 2021-01-05T09:39:11 | 2021-01-05T09:39:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,695 | java | package cn.com.glsx.supplychain.controller;
import cn.com.glsx.framework.core.beans.ResponseEntity;
import cn.com.glsx.framework.core.beans.ResultEntity;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.supplychain.config.SupplyadminProperty;
import cn.com.glsx.supplychain.enums.ErrorCodeEnum;
import cn.com.glsx.supplychain.model.DeviceInfoGpsPreimport;
import cn.com.glsx.supplychain.remote.DeviceManagerAdminRemote;
import cn.com.glsx.supplychain.util.ExcelReads;
import cn.com.glsx.supplychain.util.ExcelUtils;
import cn.com.glsx.supplychain.util.ImportedResult;
import cn.com.glsx.supplychain.vo.CheckImportDataVo;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.oreframework.boot.security.UserInfoHolder;
import org.oreframework.boot.security.cas.User;
import org.oreframework.commons.office.poi.zslin.utils.ExcelUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSON;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* Gps设备入库管理
*
* @author leiming
*/
@RestController
@RequestMapping("gpsDeviceInfo")
public class GpsDeviceController {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private UserInfoHolder userInfoHolder;
@Autowired
private SupplyadminProperty supplyadminProperty;
@Autowired
private DeviceManagerAdminRemote deviceManagerAdminRemote;
/**
* <br>
* <b>功能:</b>Gps设备入库导入模版<br>
* <b>日期:</b> 2018-11-16<br>
*
* @param response
*/
@RequestMapping(value = "/gpsDeviceDownloadTemplate", method = RequestMethod.GET)
public void gpsDeviceDownloadTemplate(HttpServletResponse response) {
try {
OutputStream os = response.getOutputStream();
String str = "";
String name = "";
str = "GPS入库管理列表.xlsx";
name = "templates/templateGpsDeviceImport.xlsx";
response.reset();
response.setHeader("Content-Disposition", "attachment; filename=\""
+ new String(str.getBytes("GBK"), "iso8859-1") + "\"");
response.setContentType("application/octet-stream;charset=UTF-8");
ExcelUtils.downloadExcelTemplate(os, name);
} catch (Exception e) {
logger.error("下载Excle模版出错:", e);
}
return;
}
/**
* gps出入库导入校验
*
* @param
* @param
*/
@ResponseBody
@RequestMapping(value = "/preGpsDeviceImportCheck")
public ResponseEntity<ImportedResult> preGpsDeviceImportCheck(
@RequestParam(value = "file") MultipartFile files) {
logger.warn("gps出入库导入校验");
ResponseEntity<ImportedResult> responseEntity = new ResponseEntity<ImportedResult>();
List<ImportedResult> importList = new ArrayList<ImportedResult>();
ImportedResult importedResult = new ImportedResult();
importedResult.setIsImported(0);
importedResult.setCause("导入成功");
long totalCount = 0;
long failCount = 0;
long successCount = 0;
String allowNum = supplyadminProperty.getOpAllowNum();
Integer opAllowNum = 0;
if (!StringUtils.isEmpty(allowNum)) {
opAllowNum = Integer.parseInt(allowNum);
}
// 这里可以支持多文件上传
if (files != null) {
BufferedOutputStream bw = null;
try {
String fileName = files.getOriginalFilename();
// 判断是否有文件且是否为图片文件
if (fileName != null
&& !"".equalsIgnoreCase(fileName.trim())
&& (FilenameUtils.getExtension(fileName.trim()).equals(
"xls") || FilenameUtils.getExtension(
fileName.trim()).equals("xlsx"))) {
// 可以选择把文件保存到服务器,创建输出文件对象
String strUploadFile = supplyadminProperty.getUploadPath()
+ UUID.randomUUID().toString() + "."
+ FilenameUtils.getExtension(fileName);
File outFile = new File(strUploadFile);
// 文件到输出文件对象
FileUtils.copyInputStreamToFile(files.getInputStream(),
outFile);
List<DeviceInfoGpsPreimport> resultList = new ArrayList<DeviceInfoGpsPreimport>();
// 获得输入流
InputStream input = files.getInputStream();
List<Object> list = null;
try {
list = ExcelReads.getInstance().readExcel2Objs(input,
DeviceInfoGpsPreimport.class, 0, 0);
} catch (Exception e) {
importedResult.setIsImported(4);
importedResult.setCause("请使用有效模板导入数据");
importList.add(importedResult);
responseEntity.setData(importList);
return responseEntity;
}
if (list == null || list.size() == 0) {
importedResult.setIsImported(4);
importedResult.setCause("请使用有效模板导入数据");
importList.add(importedResult);
responseEntity.setData(importList);
return responseEntity;
}
if (opAllowNum == 0) {
opAllowNum = 5000;
}
totalCount = list.size();
if (totalCount > opAllowNum) {
importedResult.setIsImported(3);
importedResult.setCause("模版中最大允许导入" + opAllowNum
+ "条,请修改数据重新再导!");
importList.add(importedResult);
responseEntity.setData(importList);
logger.warn("导入异常...");
return responseEntity;
}
for (Object device : list) {
DeviceInfoGpsPreimport bean = (DeviceInfoGpsPreimport) device;
resultList.add(bean);
}
RpcResponse<CheckImportDataVo> response = deviceManagerAdminRemote
.checkImportGpsDevceList(resultList);
ErrorCodeEnum errCodeEnum = (ErrorCodeEnum) response
.getError();
if (errCodeEnum != null) {
importedResult.setIsImported(4);
importedResult.setCause(errCodeEnum.getDescrible());
importList.add(importedResult);
responseEntity.setData(importList);
return responseEntity;
}
List<DeviceInfoGpsPreimport> successList = response
.getResult().getGpsPreImportSuccessList();
List<DeviceInfoGpsPreimport> failList = response
.getResult().getGpsPreImportFailList();
failCount = failList.size();
successCount = successList.size();
importedResult.setSuccessCount(successCount);
importedResult.setFailCount(failCount);
importedResult.setTotalCount(totalCount);
// 保存数据
if (successList != null && successList.size() > 0) {
String json = JSON.toJSONString(successList);
importedResult.setIsImported(1);
importedResult.setMsg(json);
}
if (failList != null && failList.size() > 0) {
String name = UUID.randomUUID().toString() + "."
+ FilenameUtils.getExtension(fileName);
String url = supplyadminProperty.getDownloadPath()
+ name;
ExcelUtil.getInstance().exportObj2Excel(url, failList,
DeviceInfoGpsPreimport.class);
String reUrl = supplyadminProperty.getDomain() + name;
importedResult.setUrl(reUrl);
logger.warn("导入结束......,总数:" + totalCount + " 成功:"
+ successCount + " 失败:" + failCount);
}
} else {
importedResult
.setCause("上传文件只支持.xls与.xlsx格式,请另存为兼容格式Excel再上传");
importedResult.setIsImported(2);
importList.add(importedResult);
responseEntity.setData(importList);
logger.warn("导出结束...");
return responseEntity;
}
} catch (Exception e) {
logger.error("导入操作异常",e.getMessage());
} finally {
try {
if (bw != null) {
bw.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
importList.add(importedResult);
responseEntity.setData(importList);
return responseEntity;
}
@SuppressWarnings({ "static-access", "deprecation" })
@RequestMapping(value = "/deviceImport")
@ResponseBody
public ResultEntity<Integer> gpsDeviceImport(
@RequestBody List<DeviceInfoGpsPreimport> gpsPreImports) {
User user = userInfoHolder.getUser();
String userName = user != null ? user.getRealname() : "admin";
RpcResponse<Integer> response = null;
ErrorCodeEnum errCodeEnum = null;
response = deviceManagerAdminRemote.importGpsDeviceList(userName,
gpsPreImports);
errCodeEnum = (ErrorCodeEnum) response.getError();
if (errCodeEnum != null) {
response.setMessage(errCodeEnum.getDescrible());
}
return ResultEntity.result(response);
}
@RequestMapping("listDeviceGpsPreimport")
public ResultEntity<RpcPagination<DeviceInfoGpsPreimport>> pageDeviceInfoGpsPreimport(
@RequestBody RpcPagination<DeviceInfoGpsPreimport> pagination) {
RpcResponse<RpcPagination<DeviceInfoGpsPreimport>> response = deviceManagerAdminRemote
.pageGpsDeviceList(pagination);
ErrorCodeEnum errCodeEnum = (ErrorCodeEnum) response.getError();
if (errCodeEnum == null) {
response.setMessage("查询成功");
} else {
response.setMessage(errCodeEnum.getDescrible());
}
return ResultEntity.result(response);
}
}
| [
"[email protected]"
] | |
33a59ef4e5cc1cd49f14d414b28568f1d2bd7092 | cf46b2b01b51fb20f8620f6a3ad3bfa476efb7f7 | /AlarmNotification/src/AlarmNotification/java/com/proryv/alarmnotification/wcf/neurospeech/KeyValueOfintstring.java | 1f52fe259e98cc573fb18b5d0e91e9cc22e1d28c | [] | no_license | Kobuntu/AlarmsAndroid | 8c5d50b6a502537ec3be980a3ea486a498c77cbf | 52d83d16503b54b3ad8e6e166b53186e5f8da578 | refs/heads/master | 2020-12-15T09:04:08.973226 | 2020-01-20T09:39:31 | 2020-01-20T09:39:31 | 235,055,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,875 | java | package com.proryv.alarmnotification.wcf.neurospeech;
import com.neurospeech.wsclient.*;
import org.w3c.dom.*;
public class KeyValueOfintstring extends WSObject implements android.os.Parcelable
{
private Integer _Key;
public Integer getKey(){
return _Key;
}
public void setKey(Integer value){
_Key = value;
}
private String _Value;
public String getValue(){
return _Value;
}
public void setValue(String value){
_Value = value;
}
public static KeyValueOfintstring loadFrom(Element root) throws Exception
{
if(root==null){
return null;
}
KeyValueOfintstring result = new KeyValueOfintstring();
result.load(root);
return result;
}
protected void load(Element root) throws Exception
{
this.setKey(WSHelper.getInteger(root,"Key",false));
this.setValue(WSHelper.getString(root,"Value",false));
}
public Element toXMLElement(WSHelper ws, Element root)
{
Element e = ws.createElement("ns5:KeyValueOfintstring");
fillXML(ws,e);
return e;
}
public void fillXML(WSHelper ws,Element e)
{
ws.addChild(e,"ns5:Key",String.valueOf(_Key),false);
ws.addChild(e,"ns5:Value",String.valueOf(_Value),false);
}
public int describeContents(){ return 0; }
public void writeToParcel(android.os.Parcel out, int flags)
{
out.writeValue(_Key);
out.writeValue(_Value);
}
void readFromParcel(android.os.Parcel in)
{
_Key = (Integer)in.readValue(null);
_Value = (String)in.readValue(null);
}
public static final android.os.Parcelable.Creator<KeyValueOfintstring> CREATOR = new android.os.Parcelable.Creator<KeyValueOfintstring>()
{
public KeyValueOfintstring createFromParcel(android.os.Parcel in)
{
KeyValueOfintstring tmp = new KeyValueOfintstring();
tmp.readFromParcel(in);
return tmp;
}
public KeyValueOfintstring[] newArray(int size)
{
return new KeyValueOfintstring[size];
}
}
;
}
| [
"[email protected]"
] | |
04bf352402cfe78d721a526a7193e2469d15a08f | a956baafd427b14a4a45d327f71f984cbad7a5ad | /app/src/main/java/kui/com/greenkiondo/Home.java | 87464d7506c4c5ae288ca747c0782ef004a9619f | [] | no_license | Kui-M/GreenKiondo | c04469b853f5fc88f1332d648783e100682e67e7 | 028a4a2763808a4f18a86b37407830e0071f0335 | refs/heads/master | 2021-08-30T23:22:00.530396 | 2017-12-19T20:16:22 | 2017-12-19T20:16:22 | 111,772,400 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package kui.com.greenkiondo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class Home extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
}
| [
"[email protected]"
] | |
b58ab5dca4854f4e1d0ae732eaa5c0d7b78e65df | 8da06d3ad989d0092d7761a81f2ec184e0989f7d | /d2cmall-provider/d2cmall-msg/d2cmall-msg-api/src/main/java/com/d2c/msg/service/ErrorLogService.java | 6ecb921c631541ea11c7458cffde4df1f17a7396 | [] | no_license | RoJinnSennSei/my_mall | e5234c631a30b17f2ffbfd4614ef9e8dc04a9869 | dbec98edac0e679906668be1d5f37ea13f46975b | refs/heads/master | 2020-04-08T15:48:40.090961 | 2018-11-14T10:04:36 | 2018-11-14T10:04:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 376 | java | package com.d2c.msg.service;
import com.d2c.common.api.page.PageModel;
import com.d2c.common.api.page.PageResult;
import com.d2c.msg.model.ErrorLog;
import com.d2c.msg.query.ErrorLogSearcher;
public interface ErrorLogService {
ErrorLog insert(ErrorLog errorLog);
PageResult<ErrorLog> findBySearcher(PageModel pager, ErrorLogSearcher searcher);
int delete(Long id);
}
| [
"[email protected]"
] | |
b2e664bfc5568c70f886e18294c728ba79888727 | b2ee7426b9a747cc5be0947522b9aaa7d3f6123a | /src/main/java/com/stackroute/pe3/MatrixAddition.java | 2849365b09654cd512636768589e91db7abb31b6 | [] | no_license | smashour/java-PE3 | 07e34d32035e37b6da8bf5d6a381b1a6456a484d | 4a0a4082a91c5631d7d76781dcd494cf937cadbc | refs/heads/master | 2020-05-20T10:46:04.639252 | 2019-05-09T04:04:42 | 2019-05-09T04:04:42 | 185,532,380 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,356 | java |
//program to compute the addition of two matrix, Read the number of rows and columns
//as input, also the values of each matrix
package com.stackroute.pe3;
import java.util.Scanner;
public class MatrixAddition {
int m,n;
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("enter no of rows & columns in matrix");
int m=input.nextInt();//scanning rows
int n=input.nextInt(); //scanning columns
int[][] a=new int[m][n];
int[][] b=new int[m][n];
int[][] c=new int[m][n];
System.out.println("enter first matrix");
for (int i=0;i<m;i++)
{
for (int j=0;j<n;j++){
a[i][j]=input.nextInt();
}
}
System.out.println("enter second matrix");
for (int i=0;i<m;i++)
{
for (int j=0;j<n;j++){
b[i][j]=input.nextInt();
}
}
for (int i=0;i<m;i++) //matrix addition
{
for (int j=0;j<n;j++){
c[i][j]=a[i][j]+b[i][j];
}
}
//printing matrix after addition
for (int i=0;i<m;i++)
{
for (int j=0;j<n;j++){
System.out.println(c[i][j]+" ");
}
System.out.println();
}
}
}
| [
"[email protected]"
] | |
ce7c3fc597365fd54dc8bc1fc9a4016d17b76fdb | 5f82aae041ab05a5e6c3d9ddd8319506191ab055 | /Projects/Time/26/JodaTimeContrib/gwt/src/test/gwt/org/joda/time/convert/TestReadablePartialConverter.java | 031075d12a71da3320de30ea146d7d8f760e500d | [
"Apache-2.0"
] | permissive | lingming/prapr_data | e9ddabdf971451d46f1ef2cdbee15ce342a6f9dc | be9ababc95df45fd66574c6af01122ed9df3db5d | refs/heads/master | 2023-08-14T20:36:23.459190 | 2021-10-17T13:49:39 | 2021-10-17T13:49:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,236 | java | /*
* Copyright 2001-2005 Stephen Colebourne
*
* 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.joda.time.convert;
// Removed for GWT import java.lang.reflect.Constructor;
// Removed for GWT import java.lang.reflect.Field;
// Removed for GWT import java.lang.reflect.Modifier;
import java.util.Arrays;
import org.joda.time.gwt.JodaGwtTestCase;
import static org.joda.time.gwt.TestConstants.*;
//import junit.framework.TestSuite;
import org.joda.time.Chronology;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeZone;
import org.joda.time.ReadablePartial;
import org.joda.time.TimeOfDay;
import org.joda.time.YearMonthDay;
import org.joda.time.base.BasePartial;
import org.joda.time.chrono.BuddhistChronology;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.chrono.JulianChronology;
/**
* This class is a Junit unit test for ReadablePartialConverter.
*
* @author Stephen Colebourne
*/
public class TestReadablePartialConverter extends JodaGwtTestCase {
// Removed for GWT private static final DateTimeZone UTC = DateTimeZone.UTC;
// Removed for GWT private static final DateTimeZone PARIS = DateTimeZone.forID("Europe/Paris");
// Removed for GWT private static final Chronology ISO_PARIS = ISOChronology.getInstance(PARIS);
private static Chronology JULIAN;
private static Chronology ISO;
private static Chronology BUDDHIST;
private DateTimeZone zone = null;
/* Removed for GWT public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
} */
/* Removed for GWT public static TestSuite suite() {
return new TestSuite(TestReadablePartialConverter.class);
} */
/* Removed for GWT public TestReadablePartialConverter(String name) {
super(name);
} */
protected void gwtSetUp() throws Exception {
super.gwtSetUp();
JULIAN = JulianChronology.getInstance();
ISO = ISOChronology.getInstance();
BUDDHIST = BuddhistChronology.getInstance();
}
//-----------------------------------------------------------------------
/* //BEGIN GWT IGNORE
public void testSingleton() throws Exception {
Class cls = ReadablePartialConverter.class;
assertEquals(false, Modifier.isPublic(cls.getModifiers()));
assertEquals(false, Modifier.isProtected(cls.getModifiers()));
assertEquals(false, Modifier.isPrivate(cls.getModifiers()));
Constructor con = cls.getDeclaredConstructor((Class[]) null);
assertEquals(1, cls.getDeclaredConstructors().length);
assertEquals(true, Modifier.isProtected(con.getModifiers()));
Field fld = cls.getDeclaredField("INSTANCE");
assertEquals(false, Modifier.isPublic(fld.getModifiers()));
assertEquals(false, Modifier.isProtected(fld.getModifiers()));
assertEquals(false, Modifier.isPrivate(fld.getModifiers()));
}
//END GWT IGNORE */
//-----------------------------------------------------------------------
public void testSupportedType() throws Exception {
assertEquals(ReadablePartial.class, ReadablePartialConverter.INSTANCE.getSupportedType());
}
//-----------------------------------------------------------------------
public void testGetChronology_Object_Zone() throws Exception {
assertEquals(ISO_PARIS, ReadablePartialConverter.INSTANCE.getChronology(new TimeOfDay(123L), PARIS));
assertEquals(ISO, ReadablePartialConverter.INSTANCE.getChronology(new TimeOfDay(123L), DateTimeZone.getDefault()));
assertEquals(ISO, ReadablePartialConverter.INSTANCE.getChronology(new TimeOfDay(123L), (DateTimeZone) null));
}
public void testGetChronology_Object_Chronology() throws Exception {
assertEquals(JULIAN, ReadablePartialConverter.INSTANCE.getChronology(new TimeOfDay(123L, BUDDHIST), JULIAN));
assertEquals(JULIAN, ReadablePartialConverter.INSTANCE.getChronology(new TimeOfDay(123L), JULIAN));
assertEquals(BUDDHIST.withUTC(), ReadablePartialConverter.INSTANCE.getChronology(new TimeOfDay(123L, BUDDHIST), (Chronology) null));
}
//-----------------------------------------------------------------------
public void testGetPartialValues() throws Exception {
TimeOfDay tod = new TimeOfDay();
int[] expected = new int[] {1, 2, 3, 4};
int[] actual = ReadablePartialConverter.INSTANCE.getPartialValues(tod, new TimeOfDay(1, 2, 3, 4), ISOChronology.getInstance(PARIS));
assertEquals(true, Arrays.equals(expected, actual));
try {
ReadablePartialConverter.INSTANCE.getPartialValues(tod, new YearMonthDay(2005, 6, 9), JULIAN);
fail();
} catch (IllegalArgumentException ex) {}
try {
ReadablePartialConverter.INSTANCE.getPartialValues(tod, new MockTOD(), JULIAN);
fail();
} catch (IllegalArgumentException ex) {}
}
static class MockTOD extends BasePartial {
protected DateTimeField getField(int index, Chronology chrono) {
switch (index) {
case 0:
return chrono.hourOfDay();
case 1:
return chrono.minuteOfHour();
case 2:
return chrono.year();
case 3:
return chrono.era();
}
return null;
}
public int size() {
return 4;
}
}
//-----------------------------------------------------------------------
public void testToString() {
assertEquals("Converter[org.joda.time.ReadablePartial]", ReadablePartialConverter.INSTANCE.toString());
}
}
| [
"[email protected]"
] | |
8637aa543d4527ef6c7caba9ad3fb9b34afce5ab | e28dd69cadca0c25ab78d74156813e7bcd53bac9 | /src/by/it/dilkevich/jd01_06/TaskC1.java | ea008f144bc1a44e00c90ef1a40625d3e40b67e4 | [] | no_license | jekson0702/JD2019-05-13 | 4cb1f11a80d26306be9617c8c75c04848ea06b05 | 5184aa81c7b7192841453091f33d85a1f8b30c3a | refs/heads/master | 2020-05-26T03:08:14.573688 | 2019-07-08T01:59:12 | 2019-07-08T01:59:12 | 188,086,194 | 1 | 0 | null | 2019-05-22T17:41:06 | 2019-05-22T17:41:06 | null | UTF-8 | Java | false | false | 1,660 | java | package by.it.dilkevich.jd01_06;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class TaskC1 {
public static void main(String[] args) {
printTextAlign(Poem.text);
}
private static void printTextAlign(String text) {
StringBuilder sb = new StringBuilder(text);
String[] mas = text.split("\\n");
int [] countOfSpaces = new int[mas.length];
Pattern pattern = Pattern.compile("\\s");
int maxLenght = 0;
int neededSpaces = 0;
for (int i = 0; i < mas.length; i++) {
if(mas[i].length() > maxLenght)
maxLenght = mas[i].length();
}
for (int i = 0; i < mas.length; i++) {
Matcher matcher = pattern.matcher(mas[i]);
while (matcher.find()){
countOfSpaces[i]++;
}
}
for (int i = 0; i < mas.length; i++) {
String [] mas1 = mas[i].split(" ");
int length = 0;
for (int i1 = 0; i1 < mas1.length; i1++) {
length += mas1[i1].length();
}
while (length <maxLenght){
for (int j = 0; j < mas1.length-1; j++) {
mas1[j] = mas1[j].concat(" ");
length = length + 1;
if(length == maxLenght)
break;
}
}
mas[i] = "";
for (int j = 0; j < mas1.length; j++) {
mas[i] = mas[i].concat(mas1[j]);
}
}
for (String s :
mas) {
System.out.println(s);
}
}
}
| [
"[email protected]"
] | |
6b5766b3da786a05aa572ea8088025ac8f0b29ea | ec5cae71aaa5adb044e2d8e3f1e2905862e694eb | /java/device/iothub-java-client/src/test/java/tests/unit/com/microsoft/azure/iothub/IotHubStatusCodeTest.java | 7afacd2a0f1979dd0e1d29aef37b73477601c89f | [
"MIT"
] | permissive | arduino-libraries/azure-iot-sdks | bc623edcb3d58507e73cdf7e61c1fe23e3fce791 | 5ae6c9d07e3dbb4ab236bd7e6f202849a2c48a3c | refs/heads/master | 2021-01-16T22:19:01.570584 | 2019-07-25T07:57:47 | 2019-07-25T07:57:47 | 47,642,835 | 3 | 3 | NOASSERTION | 2019-07-25T07:57:48 | 2015-12-08T18:59:32 | C++ | UTF-8 | Java | false | false | 6,037 | java | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
package tests.unit.com.microsoft.azure.iothub;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import com.microsoft.azure.iothub.IotHubStatusCode;
import org.junit.Test;
/** Unit tests for IotHubStatusCode. */
public class IotHubStatusCodeTest
{
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsOkCorrectly()
{
final int httpsStatus = 200;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus = IotHubStatusCode.OK;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsOkEmptyCorrectly()
{
final int httpsStatus = 204;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus = IotHubStatusCode.OK_EMPTY;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsBadFormatCorrectly()
{
final int httpsStatus = 400;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus = IotHubStatusCode.BAD_FORMAT;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsUnauthorizedCorrectly()
{
final int httpsStatus = 401;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus = IotHubStatusCode.UNAUTHORIZED;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsTooManyDevicesCorrectly()
{
final int httpsStatus = 403;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus =
IotHubStatusCode.TOO_MANY_DEVICES;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsHubOrDeviceNotFoundCorrectly()
{
final int httpsStatus = 404;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus =
IotHubStatusCode.HUB_OR_DEVICE_ID_NOT_FOUND;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsPreconditionFailedCorrectly()
{
final int httpsStatus = 412;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus =
IotHubStatusCode.PRECONDITION_FAILED;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsThrottledCorrectly()
{
final int httpsStatus = 429;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus = IotHubStatusCode.THROTTLED;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsInternalServerErrorCorrectly()
{
final int httpsStatus = 500;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus =
IotHubStatusCode.INTERNAL_SERVER_ERROR;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_001: [The function shall convert the given HTTPS status code to the corresponding IoT Hub status code.]
@Test
public void getIotHubStatusCodeMapsServerBusyCorrectly()
{
final int httpsStatus = 503;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus = IotHubStatusCode.SERVER_BUSY;
assertThat(testStatus, is(expectedStatus));
}
// Tests_SRS_IOTHUBSTATUSCODE_11_002: [If the given HTTPS status code does not map to an IoT Hub status code, the function return status code ERROR.]
@Test
public void getIotHubStatusCodeMapsOtherStatusCodeToError()
{
final int httpsStatus = -1;
IotHubStatusCode testStatus =
IotHubStatusCode.getIotHubStatusCode(httpsStatus);
final IotHubStatusCode expectedStatus = IotHubStatusCode.ERROR;
assertThat(testStatus, is(expectedStatus));
}
}
| [
"[email protected]"
] | |
87e3328c6ff6603165744db3b18d2576a54cf890 | dcecbc089153a7bb2b96aebb1867c35474478ece | /app/src/main/java/com/feiyou/headstyle/presenter/NoteTypePresenter.java | b49bf5e3d8852b55b5a4c83cd642edab315da3d5 | [] | no_license | djp0507/newheadstyle | d77396af1876b617c4722cb588bca7ef43a0ca7f | 4cccf90d2226947e39acf459c3b73ff3681251eb | refs/heads/master | 2020-04-25T03:54:20.668498 | 2019-02-25T10:31:32 | 2019-02-25T10:31:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 201 | java | package com.feiyou.headstyle.presenter;
/**
* Created by iflying on 2018/1/9.
*/
public interface NoteTypePresenter {
void getNoteTypeData(String topicId, int page, int type, String userId);
}
| [
"[email protected]"
] | |
a3c48aa71c51b353fefc1ebf89bcc8e0191a746a | 8099fe2ad2864db6611cda61ab0512fb573e84ed | /Java/OPSJLib/src/ops/QualityOfService.java | fbae1e4bdd39f75b91d3173f201f1b95765b419f | [] | no_license | LelleAnd/ops | 9cd8ff9df80eee6bec77fd84997d6e369fa11f3c | 54625a6b0acc51b0564c8d72d0ea51a53a192284 | refs/heads/master | 2023-05-15T09:21:37.858471 | 2022-10-11T20:46:48 | 2022-10-11T20:46:48 | 51,955,990 | 10 | 9 | null | 2020-11-27T08:42:11 | 2016-02-17T21:18:05 | Java | UTF-8 | Java | false | false | 930 | java | /**
*
* Copyright (C) 2006-2009 Anton Gravestam.
*
* This file is part of OPS (Open Publish Subscribe).
*
* OPS (Open Publish Subscribe) 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 3 of the License, or
* (at your option) any later version.
* OPS (Open Publish Subscribe) 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 OPS (Open Publish Subscribe). If not, see <http://www.gnu.org/licenses/>.
*/
package ops;
public class QualityOfService
{
public QualityOfService()
{
}
}
| [
"anton.gravestam@bfec6ad8-f234-11dd-ac65-f74f249cfaac"
] | anton.gravestam@bfec6ad8-f234-11dd-ac65-f74f249cfaac |
bfbd23183f28b08c8ab3542e1dd072ffb1ca7383 | 27cda5e6fb5da7ae2dea91450ca1082bcaa55424 | /Source/Java/ImagingCommon/main/src/java/gov/va/med/imaging/notifications/NotificationConfiguration.java | 8672456a7477a5b0ec1b4e68d91eb50f807a8dee | [
"Apache-2.0"
] | permissive | VHAINNOVATIONS/Telepathology | 85552f179d58624e658b0b266ce83e905480acf2 | 989c06ccc602b0282c58c4af3455c5e0a33c8593 | refs/heads/master | 2021-01-01T19:15:40.693105 | 2015-11-16T22:39:23 | 2015-11-16T22:39:23 | 32,991,526 | 3 | 9 | null | null | null | null | UTF-8 | Java | false | false | 3,853 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gov.va.med.imaging.notifications;
import gov.va.med.imaging.facade.configuration.AbstractBaseFacadeConfiguration;
import gov.va.med.imaging.facade.configuration.FacadeConfigurationFactory;
import gov.va.med.imaging.facade.configuration.exceptions.CannotLoadConfigurationException;
/**
*
* @author Jon Louthian
*/
public class NotificationConfiguration extends AbstractBaseFacadeConfiguration
{
private static NotificationConfiguration config = null;
private static final String DEFAULT_VIX_STARTUP_SUBJECT = "VIX restarted";
private static final String DEFAULT_VIX_STARTUP_MESSAGE = "The VIX server has restarted";
private boolean notificationEnabled;
private String localSiteNumber;
private String vixStartupSubject;
private String vixStartupMessage;
/**
* @return the vixStartupSubject
*/
public String getVixStartupSubject() {
return isNullOrEmpty(vixStartupSubject) ? DEFAULT_VIX_STARTUP_SUBJECT : vixStartupSubject;
}
/**
* @param vixStartupSubject the vixStartupSubject to set
*/
public void setVixStartupSubject(String vixStartupSubject) {
this.vixStartupSubject = vixStartupSubject;
}
/**
* @return the vixStartupMessage
*/
public String getVixStartupMessage() {
return isNullOrEmpty(vixStartupMessage) ? DEFAULT_VIX_STARTUP_MESSAGE : vixStartupMessage;
}
/**
* @param vixStartupMessage the vixStartupMessage to set
*/
public void setVixStartupMessage(String vixStartupMessage) {
this.vixStartupMessage = vixStartupMessage;
}
/**
* @return the localSiteNumber
*/
public String getLocalSiteNumber() {
return localSiteNumber;
}
/**
* @param localSiteNumber the localSiteNumber to set
*/
public void setLocalSiteNumber(String localSiteNumber) {
this.localSiteNumber = localSiteNumber;
}
/**
* @return the notificationsEnabled
*/
public boolean isNotificationEnabled() {
return notificationEnabled;
}
/**
* @param notificationsEnabled the notificationsEnabled to set
*/
public void setNotificationEnabled(boolean notificationEnabled) {
this.notificationEnabled = notificationEnabled;
}
@Override
public AbstractBaseFacadeConfiguration loadDefaultConfiguration()
{
this.setVixStartupSubject(DEFAULT_VIX_STARTUP_SUBJECT);
this.setVixStartupMessage(DEFAULT_VIX_STARTUP_MESSAGE);
this.setNotificationEnabled(true);
return this;
}
public synchronized static NotificationConfiguration getConfiguration()
{
try
{
return FacadeConfigurationFactory.getConfigurationFactory().getConfiguration(
NotificationConfiguration.class);
}
catch(CannotLoadConfigurationException clcX)
{
return null;
}
}
private boolean isNullOrEmpty(String s) {
if (s == null)
return true;
if (s.equals(""))
return true;
return false;
}
public static void main(String[] args) {
if (args.length != 2)
{
printUsage();
return;
}
NotificationConfiguration defaultConfig = getConfiguration();
defaultConfig.setLocalSiteNumber(args[0]);
boolean notificationEnabled = Boolean.parseBoolean(args[1]);
defaultConfig.setNotificationEnabled(notificationEnabled);
defaultConfig.storeConfiguration();
}
private static void printUsage() {
System.out.println("This program requires two arguments: local_site_number enable_notifications.");
System.out.println("enable_notifications can be true or false.");
}
}
| [
"[email protected]"
] | |
f73d43b473917276d9baf3add2334aaaff5b10a4 | 40665051fadf3fb75e5a8f655362126c1a2a3af6 | /Bernardo-MG-dice-notation-java/22cc67bc7dcb57ef935ad76d215ef38cfd92f0ae/14/ITDefaultDiceNotationExpressionParserException.java | ebd90abc28a2e8580ae2056d1d552186a341db59 | [] | no_license | fermadeiral/StyleErrors | 6f44379207e8490ba618365c54bdfef554fc4fde | d1a6149d9526eb757cf053bc971dbd92b2bfcdf1 | refs/heads/master | 2020-07-15T12:55:10.564494 | 2019-10-24T02:30:45 | 2019-10-24T02:30:45 | 205,546,543 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,339 | java | /**
* Copyright 2014-2019 the original author or authors
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.bernardomg.tabletop.dice.test.integration.parser.exception;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.Executable;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import com.bernardomg.tabletop.dice.parser.DefaultDiceNotationExpressionParser;
/**
* Integration tests for {@code DefaultDiceNotationExpressionParser}, checking
* that it throws exceptions when required.
*
* @author Bernardo Martínez Garrido
*/
@RunWith(JUnitPlatform.class)
public final class ITDefaultDiceNotationExpressionParserException {
/**
* Default constructor.
*/
public ITDefaultDiceNotationExpressionParserException() {
super();
}
/**
* Verifies that an empty text causes an exception.
*/
@Test
public final void testParse_Empty() {
final Executable closure;
closure = () -> new DefaultDiceNotationExpressionParser().parse("");
Assertions.assertThrows(Exception.class, closure);
}
/**
* Verifies that an invalid text causes an exception.
*/
@Test
public final void testParse_Invalid() {
final Executable closure;
closure = () -> new DefaultDiceNotationExpressionParser().parse("abc");
Assertions.assertThrows(Exception.class, closure);
}
/**
* Verifies that a partially valid text causes an exception.
*/
@Test
public final void testParse_PartiallyValid() {
final Executable closure;
closure = () -> new DefaultDiceNotationExpressionParser().parse("6d6y");
Assertions.assertThrows(Exception.class, closure);
}
}
| [
"[email protected]"
] | |
f7ce460f262c70f7a6eb6aa538c3bb6417aaed5f | 069761cf23542f8bd7fc0e169df0f9326f588bc1 | /src/com/airline/controllers/AddPilot.java | bde1fa9f1c4ef8ccfed874743f0d99672c36b739 | [] | no_license | eren35can/RestWebServiceExample | 59a5221e9d9b2f261b82a5536eb898e250375285 | fece8ee61dfc6bf138fbe2ec9c5871e4b933a87f | refs/heads/master | 2020-06-25T19:36:41.539174 | 2019-07-29T07:57:31 | 2019-07-29T07:57:31 | 199,403,294 | 0 | 0 | null | null | null | null | ISO-8859-3 | Java | false | false | 1,498 | java | package com.airline.controllers;
import java.io.IOException;
import javax.ejb.EJB;
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 com.airline.models.Pilot;
import com.airline.models.PilotRank;
import com.airline.service.PilotService;
/**
* Servlet implementation class AddPilot
*/
@WebServlet("/AddPilot")
public class AddPilot extends HttpServlet {
private static final long serialVersionUID = 1L;
@EJB
PilotService ps;
/**
* @see HttpServlet#HttpServlet()
*/
public AddPilot() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Pilot p = new Pilot();
p.setFirstName("eren");
p.setLastName("güleç");
p.setPilotRank(PilotRank.Captain);
p.setPilotLicense(199675);
ps.addPilot(p);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}
}
| [
"[email protected]"
] | |
bc041b31109da986ab9c2f78ff9e23ab49086df8 | e985d6ba0f54eb7e15967cc71b2c9c57f6cd1101 | /src/main/java/com/expenseManager/ExpenseManagerAPI/service/ExpenseServiceImpl.java | 2fb5276db9ada7a799d54c9d1ef791c65462bb28 | [] | no_license | alpozkanm/Expense-Manager-API | 75ce9530e5c264fd10ac9948418705904af8efb1 | e7809f54906775983c2a33d1efa80ed1fe54051f | refs/heads/master | 2021-02-05T05:21:12.870621 | 2020-03-02T10:54:26 | 2020-03-02T10:54:26 | 243,748,815 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,052 | java | package com.expenseManager.ExpenseManagerAPI.service;
import com.expenseManager.ExpenseManagerAPI.domain.Expense;
import com.expenseManager.ExpenseManagerAPI.repositories.ExpenseRepository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ExpenseServiceImpl implements ExpenseService {
@Autowired
ExpenseRepository expenseRepository;
@Override
public List<Expense> findAll() {
return expenseRepository.findAll();
}
@Override
public List<Expense> findByMonthAndYear(String month, int year) {
return expenseRepository.findByMonthAndYear(month, year);
}
@Override
public void saveOrUpdateExpense(Expense expense) {
expenseRepository.save(expense);
}
@Override
public void deleteExpense(String id) {
expenseRepository.delete(id);
}
@Override
public List<Expense> findByYear(int year) {
return expenseRepository.findByYear(year);
}
}
| [
"26024533@A00102586"
] | 26024533@A00102586 |
b2565ce681ab64257f86b5453369bdb2fb42e159 | 9062c52a62d54c5e2555140693026ed726ae3d7c | /023SpringBootMybatisAnnotations/src/main/java/com/learning/demoDiff/service/DemoDiffService.java | c0d47291adbf9b4cb314d45cf57e22af857927dd | [] | no_license | imomi329/SpringBoot-Learning | 1fc62d4633e84148cd453489f84fe771b7c6ce21 | f943c2735775cc0dde23a62cfc9c70e0c2096d00 | refs/heads/master | 2022-06-26T16:47:51.947501 | 2020-06-21T05:45:29 | 2020-06-21T05:45:29 | 130,181,017 | 1 | 1 | null | 2022-06-17T01:44:44 | 2018-04-19T08:06:34 | Java | UTF-8 | Java | false | false | 598 | java | package com.learning.demoDiff.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.learning.demo.bean.Demo;
import com.learning.demoDiff.mapper.DemoDiffMapper;
@Service
public class DemoDiffService {
@Autowired
private DemoDiffMapper demoMapper;
/**
* #{} 和 ${} 的區別?
*
* @return
*/
public List<Demo> selectByName1(String name) {
return demoMapper.selectByName1(name);
}
public List<Demo> selectByName2(String name) {
return demoMapper.selectByName2(name);
}
}
| [
"[email protected]"
] | |
1d8e6326580f6272af266585214018eb532f657e | 930c207e245c320b108e9699bbbb036260a36d6a | /BRICK-RDF4J/generatedCode/src/main/java/brickschema/org/schema/_1_0_2/Brick/Cooling_Discharge_Air_Temperature_Proportional_Band_Setpoint.java | a066c438ba33d4f50d31beda84de795f9212b016 | [] | no_license | InnovationSE/BRICK-Generated-By-OLGA | 24d278f543471e1ce622f5f45d9e305790181fff | 7874dfa450a8a2b6a6f9927c0f91f9c7d2abd4d2 | refs/heads/master | 2021-07-01T14:13:11.302860 | 2017-09-21T12:44:17 | 2017-09-21T12:44:17 | 104,251,784 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,137 | java | /**
* This file is automatically generated by OLGA
* @author OLGA
* @version 1.0
*/
package brickschema.org.schema._1_0_2.Brick;
import brick.global.util.GLOBAL;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import java.math.BigDecimal;
import javax.xml.datatype.XMLGregorianCalendar;
import java.util.Date;
import brickschema.org.schema._1_0_2.Brick.Proportional_Band_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Setpoint;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Supply_Air_Temperature_Cooling_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Discharge_Air_Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Discharge_Air;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Supply_Air;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Setpoint;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Supply_Air_Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Setpoint;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Supply_Air;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Discharge_Air;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Discharge_Air_Temperature_Cooling_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Discharge_Air_Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Discharge_Air;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Supply_Air;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Setpoint;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Supply_Air_Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Temperature_Setpoint;
import brickschema.org.schema._1_0_2.Brick.Setpoint;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Supply_Air;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Discharge_Air;
import brickschema.org.schema._1_0_2.Brick.UndefinedMeasurement;
import brickschema.org.schema._1_0_2.Brick.MeasurementProperty;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
import brickschema.org.schema._1_0_2.Brick.Air;
import brickschema.org.schema._1_0_2.Brick.Resource;
import brickschema.org.schema._1_0_2.Brick.Point;
import brickschema.org.schema._1_0_2.BrickFrame.TagSet;
public class Cooling_Discharge_Air_Temperature_Proportional_Band_Setpoint implements ICooling_Discharge_Air_Temperature_Proportional_Band_Setpoint {
IRI newInstance;
public Cooling_Discharge_Air_Temperature_Proportional_Band_Setpoint(String namespace, String instanceId) {
super();
newInstance = GLOBAL.factory.createIRI(namespace, instanceId);
GLOBAL.model.add(newInstance, RDF.TYPE, GLOBAL.factory.createIRI("https://brickschema.org/schema/1.0.2/Brick#Cooling_Discharge_Air_Temperature_Proportional_Band_Setpoint"));
}
public IRI iri()
{
return newInstance;
}
}
| [
"[email protected]"
] | |
70450895d5e829c4fdad781ecf58064cba51edd2 | fbed30ac52a2509bf63f63eba0ece1ff6ec087da | /desenvolvimentoJava/src/main/java/one/innovation/digital/desenvolvimentoBasicoECollections/desenvolvimentoBasicoEmJava/construtores/exerciciosDeContrutor/ContrutorCarro.java | 3c00d82ecbdf7f07b20bb280f535915e49636cfd | [] | no_license | DouglasTSam/DigitalInnovationOne | 1380a974e184d9f6849897d4ede3944e1dd52c71 | 06b37c0fe17577b8238d04004db256196149ba85 | refs/heads/main | 2023-06-02T10:48:48.056974 | 2021-06-29T01:52:05 | 2021-06-29T01:52:05 | 357,275,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package one.innovation.digital.desenvolvimentoBasicoECollections.desenvolvimentoBasicoEmJava.construtores.exerciciosDeContrutor;
public class ContrutorCarro {
private String marca;
private String modelo;
private String ano;
private String varianteCor;
public ContrutorCarro(String marca, String modelo, String ano){
this.marca = marca;
this.modelo = modelo;
this.ano = ano;
}
public String getVariante(){
return varianteCor;
}
public void setVariante(String varianteCor){
this.varianteCor = varianteCor;
}
public String getMarca(){
return marca;
}
public String getModelo() {
return modelo;
}
public String getAno(){
return ano;
}
public void setCarro(String marca, String modelo, String ano){
this.marca = marca;
this.modelo = modelo;
this.ano = ano;
}
}
| [
"[email protected]"
] | |
deec956126f7e38ae3a6045d0d9ad9d2beae9a66 | 8180631f0e33df1fabfeefd4d1808eb29e49f141 | /ecafeteria.app.backoffice.console/src/main/java/eapli/ecafeteria/app/backoffice/console/presentation/meals/CheckMealRatingsUI.java | 47f02a7e089872f54de3fd0338ff0a5b92f9bac9 | [] | no_license | Fuel4us/JavaJPA | 8df73af5725700c5b656169fd4a2b9ba80fa11fc | f8f0b6dab97d5c5af1c1da1da88205057dabc027 | refs/heads/master | 2020-03-21T19:44:10.261476 | 2018-06-28T04:52:38 | 2018-06-28T04:52:38 | 138,966,911 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package eapli.ecafeteria.app.backoffice.console.presentation.meals;
import eapli.ecafeteria.application.meals.CheckMealRatingsController;
import eapli.ecafeteria.domain.meals.Meal;
import eapli.framework.presentation.console.AbstractUI;
import eapli.framework.presentation.console.SelectWidget;
/**
*
* @author @João [email protected]
*/
public class CheckMealRatingsUI extends AbstractUI {
/**
* Instance variable.
*/
private final CheckMealRatingsController controller = new CheckMealRatingsController();
/**
* Do Show.
* @return
*/
@Override
protected boolean doShow() {
if (controller.getMealsOfBookings().isEmpty()) {
System.out.println("There are no bookings or meals.");
return true;
}
final SelectWidget<Meal> selector = new SelectWidget<>("\n-> Select one meal to see its ratings:\n", controller.getMealsOfBookings());
selector.show();
final Meal selectedMeal = selector.selectedElement();
int numOfRatings = controller.getNumberOfRatings(selectedMeal);
if (numOfRatings == 0) {
return true;
}
System.out.println("\n## RATING INFO of the Meal with the ID " + selectedMeal.getId() + ":\n");
System.out.println("\n-> Number of Ratings: " + numOfRatings);
System.out.println("\n-> Average Score: " + controller.getAverage(selectedMeal));
System.out.println("\n-> Comments: " + controller.getComments(selectedMeal));
return true;
}
/**
* HeadLine.
* @return
*/
@Override
public String headline() {
return "Check meal rating";
}
}
| [
"[email protected]"
] | |
39a0b674d94904955b3d7fbe6ec42cd3d13f4dc5 | b04ed715f569aa4158968ddc6f77e7c421f2bc61 | /src/tests/java/htsjdk/samtools/SamPairUtilTest.java | dcb8ee11908dbfeba5dbc65c2880ad74fe60a0d0 | [] | no_license | fjolidon/htsjdk | 42e07ebba65c7395725146f586620fee0a5a18fb | 9ffede35c2cbe93cbd8da2f682ffd681b3dce2c6 | refs/heads/master | 2021-01-15T09:42:54.790284 | 2015-07-09T12:30:08 | 2015-07-09T12:30:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,611 | java | /*
* The MIT License
*
* Copyright (c) 2013 The Broad Institute
*
* 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.
*/
package htsjdk.samtools;
import htsjdk.samtools.SamPairUtil.SetMateInfoIterator;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.ArrayList;
import java.util.List;
public class SamPairUtilTest {
@Test(dataProvider = "testGetPairOrientation")
public void testGetPairOrientation(final String testName,
final int read1Start, final int read1Length, final boolean read1Reverse,
final int read2Start, final int read2Length, final boolean read2Reverse,
final SamPairUtil.PairOrientation expectedOrientation) {
final SAMFileHeader header = new SAMFileHeader();
header.addSequence(new SAMSequenceRecord("chr1", 100000000));
final SAMRecord rec1 = makeSamRecord(header, read1Start, read1Length, read1Reverse, true);
final SAMRecord rec2 = makeSamRecord(header, read2Start, read2Length, read2Reverse, false);
SamPairUtil.setMateInfo(rec1, rec2, true);
Assert.assertEquals(SamPairUtil.getPairOrientation(rec1), expectedOrientation, testName + " first end");
Assert.assertEquals(SamPairUtil.getPairOrientation(rec2), expectedOrientation, testName + " second end");
}
@Test(dataProvider = "testSetMateInfoMateCigar")
public void testSetMateInfoMateCigar(final String testName,
final int read1Start, final boolean read1Reverse, final String read1Cigar,
final int read2Start, final boolean read2Reverse, final String read2Cigar) {
final SAMFileHeader header = new SAMFileHeader();
header.addSequence(new SAMSequenceRecord("chr1", 100000000));
final SAMRecord rec1 = makeSamRecord2(header, read1Start, read1Reverse, read1Cigar, true);
final SAMRecord rec2 = makeSamRecord2(header, read2Start, read2Reverse, read2Cigar, false);
SamPairUtil.setMateInfo(rec1, rec2, true);
Assert.assertEquals(SAMUtils.getMateCigarString(rec1), rec2.getCigarString(), testName + " first end");
Assert.assertEquals(SAMUtils.getMateCigarString(rec2), rec1.getCigarString(), testName + " second end");
}
private void testSetMateInfoMateCigarOnSupplementalsAddRecord(final List<SAMRecord> records, final List<String> mateCigarList, final SAMRecord record, final String mateCigar) {
records.add(record);
mateCigarList.add(mateCigar);
}
@Test(dataProvider = "testSetMateInfoMateCigarOnSupplementals")
public void testSetMateInfoMateCigarOnSupplementals(final String testName,
final int read1Start, final boolean read1Reverse, final String read1Cigar,
final int read1SupplementalStart, final boolean read1SupplementalReverse, final String read1SupplementalCigar,
final int read2Start, final boolean read2Reverse, final String read2Cigar,
final int read2SupplementalStart, final boolean read2SupplementalReverse, final String read2SupplementalCigar
) {
final SAMFileHeader header = new SAMFileHeader();
header.addSequence(new SAMSequenceRecord("chr1", 100000000));
final List<SAMRecord> records = new ArrayList<SAMRecord>();
final List<String> mateCigarList = new ArrayList<String>();
final SAMRecord rec;
int numIterations = 10;
boolean isPaired = (0 < read1Start && 0 < read2Start);
for (int i = 0; i < numIterations; i++) {
final String readName = "READ" + i;
testSetMateInfoMateCigarOnSupplementalsAddRecord(records, mateCigarList, makeSamRecord3(header, read1Start, read1Reverse, read1Cigar, true, readName, isPaired, false), read2Cigar);
if (0 < read1SupplementalStart) {
testSetMateInfoMateCigarOnSupplementalsAddRecord(records, mateCigarList, makeSamRecord3(header, read1SupplementalStart, read1SupplementalReverse, read1SupplementalCigar, true, readName, isPaired, true), read2Cigar);
}
if (0 < read2Start) {
testSetMateInfoMateCigarOnSupplementalsAddRecord(records, mateCigarList, makeSamRecord3(header, read2Start, read2Reverse, read2Cigar, false, readName, isPaired, false), read1Cigar);
}
if (0 < read2SupplementalStart) {
testSetMateInfoMateCigarOnSupplementalsAddRecord(records, mateCigarList, makeSamRecord3(header, read2SupplementalStart, read2SupplementalReverse, read2SupplementalCigar, false, readName, isPaired, true), read1Cigar);
}
}
// Count the number of mate cigars we expect to add
int expectedNumberOfMateCigarsAdded = 0;
for (final String mateCigar : mateCigarList) {
if (null != mateCigar) expectedNumberOfMateCigarsAdded++;
}
int i = 0;
SetMateInfoIterator iterator = new SetMateInfoIterator(records.iterator(), true);
while (iterator.hasNext()) {
final SAMRecord record = iterator.next();
final Cigar mateCigar = SAMUtils.getMateCigar(record);
final String mateCigarString = (null == mateCigar) ? null : mateCigar.toString();
Assert.assertEquals(mateCigarString, mateCigarList.get(i), testName);
i++;
}
Assert.assertEquals(expectedNumberOfMateCigarsAdded, iterator.getNumMateCigarsAdded(), testName);
iterator.close();
}
private SAMRecord makeSamRecord(final SAMFileHeader header, final int alignmentStart, final int readLength,
final boolean reverse, final boolean firstOfPair) {
final SAMRecord rec = new SAMRecord(header);
rec.setReferenceIndex(0);
final StringBuilder sb = new StringBuilder();
final byte[] quals = new byte[readLength];
for (int i = 0; i < readLength; ++i) {
sb.append("A");
quals[i] = 20;
}
rec.setReadString(sb.toString());
rec.setBaseQualities(quals);
rec.setAlignmentStart(alignmentStart);
rec.setCigarString(readLength + "M");
rec.setReadPairedFlag(true);
rec.setReadNegativeStrandFlag(reverse);
if (firstOfPair) rec.setFirstOfPairFlag(true);
else rec.setSecondOfPairFlag(true);
return rec;
}
private SAMRecord makeSamRecord2(final SAMFileHeader header, final int alignmentStart, boolean reverse,
String cigarString, final boolean firstOfPair) {
return makeSamRecord3(header, alignmentStart, reverse, cigarString, firstOfPair, null, true, false);
}
private SAMRecord makeSamRecord3(final SAMFileHeader header, final int alignmentStart, boolean reverse,
String cigarString, final boolean firstOfPair, final String name, final boolean isPaired, final boolean isSupplemental) {
final SAMRecord rec = new SAMRecord(header);
final StringBuilder sb = new StringBuilder();
final Cigar cigar = TextCigarCodec.decode(cigarString);
final int readLength = cigar.getReadLength();
rec.setReferenceIndex(0);
final byte[] quals = new byte[readLength];
for (int i = 0; i < readLength; ++i) {
sb.append("A");
quals[i] = 20;
}
rec.setReadString(sb.toString());
rec.setBaseQualities(quals);
rec.setAlignmentStart(alignmentStart);
rec.setCigar(cigar);
rec.setReadNegativeStrandFlag(reverse);
if (isPaired) {
rec.setReadPairedFlag(true);
if (firstOfPair) rec.setFirstOfPairFlag(true);
else rec.setSecondOfPairFlag(true);
}
if (null != name) rec.setReadName(name);
rec.setSupplementaryAlignmentFlag(isSupplemental);
return rec;
}
@DataProvider(name = "testGetPairOrientation")
public Object[][] testGetPairOrientationDataProvider() {
/**
* @param testName
* @param read1Start
* @param read1Length
* @param read1Reverse
* @param read2Start
* @param read2Length
* @param read2Reverse
* @param expectedOrientation
*/
return new Object[][]{
{"normal innie", 1, 100, false, 500, 100, true, SamPairUtil.PairOrientation.FR},
{"overlapping innie", 1, 100, false, 50, 100, true, SamPairUtil.PairOrientation.FR},
{"second end enclosed innie", 1, 100, false, 50, 50, true, SamPairUtil.PairOrientation.FR},
{"first end enclosed innie", 1, 50, false, 1, 100, true, SamPairUtil.PairOrientation.FR},
{"completely overlapping innie", 1, 100, false, 1, 100, true, SamPairUtil.PairOrientation.FR},
{"normal outie", 1, 100, true, 500, 100, false, SamPairUtil.PairOrientation.RF},
{"nojump outie", 1, 100, true, 101, 100, false, SamPairUtil.PairOrientation.RF},
{"forward tandem", 1, 100, true, 500, 100, true, SamPairUtil.PairOrientation.TANDEM},
{"reverse tandem", 1, 100, false, 500, 100, false, SamPairUtil.PairOrientation.TANDEM},
{"overlapping forward tandem", 1, 100, true, 50, 100, true, SamPairUtil.PairOrientation.TANDEM},
{"overlapping reverse tandem", 1, 100, false, 50, 100, false, SamPairUtil.PairOrientation.TANDEM},
{"second end enclosed forward tandem", 1, 100, true, 50, 50, true, SamPairUtil.PairOrientation.TANDEM},
{"second end enclosed reverse tandem", 1, 100, false, 50, 50, false, SamPairUtil.PairOrientation.TANDEM},
{"first end enclosed forward tandem", 1, 50, true, 1, 100, true, SamPairUtil.PairOrientation.TANDEM},
{"first end enclosed reverse tandem", 1, 50, false, 1, 100, false, SamPairUtil.PairOrientation.TANDEM},
};
}
@DataProvider(name = "testSetMateInfoMateCigar")
public Object[][] testSetMateInfoMateCigarDataProvider() {
/**
* @param testName
* @param read1Start
* @param read1Reverse
* @param read1Cigar
* @param read2Start
* @param read2Reverse
* @param read2Cigar
*/
return new Object[][]{
{"50M/50M", 1, false, "50M", 500, true, "50M"},
{"50M/25M5I20M", 1, false, "50M", 500, true, "25M5I20M"},
{"25M5I20M/50M", 1, false, "25M5I20M", 500, true, "50M"},
{"50M/25M5D20M", 1, false, "50M", 500, true, "25M5D20M"},
{"25M5D20M/50M", 1, false, "25M5D20M", 500, true, "50M"},
};
}
@DataProvider(name = "testSetMateInfoMateCigarOnSupplementals")
public Object[][] testSetMateInfoMateCigarOnSupplementalsDataProvider() {
/**
* @param testName
* @param read1Start
* @param read1Reverse
* @param read1Cigar
* @param read1SupplementalStart
* @param read1SupplementalReverse
* @param read1SupplementalCigar
* @param read2Start
* @param read2Reverse
* @param read2Cigar
* @param read2SupplementalStart
* @param read2SupplementalReverse
* @param read2SupplementalCigar
* */
return new Object[][]{
{"fragment", 1, false, "50M", -1, false, null, -1, false, null, -1, false, null},
{"fragment with supplemental", 1, false, "50M", 10, false, "50M", -1, false, null, -1, false, null},
{"pair", 1, false, "50M", -1, false, null, 1, false, "20M", -1, false, null},
{"pair first supplemental", 1, false, "50M", 10, false, "50M", 1, false, "20M", -1, false, null},
{"pair second supplemental", 1, false, "50M", -1, false, null, 1, false, "20M", 10, false, "50M"},
{"pair both supplemental", 1, false, "50M", 10, false, "50M", 1, false, "20M", 10, false, "50M"}
};
}
}
| [
"[email protected]"
] | |
528885418c37d0746d3d69ce838157801ddd9513 | bbec8620c22c209c8b53c2b8f8a8ab8204f91c1b | /HomeMap/app/src/main/java/com/example/laiji/homemap/MainActivity.java | 637968c5430d54c7cb0c248afb1cc7882a65eb24 | [] | no_license | laiyuchenrushuang/HomeMap | f41536d131cdab249396b0db241fd31a3af45cd5 | 6b87101a3a014fda6e991778bbe4eb28db91477f | refs/heads/master | 2020-05-03T09:32:31.881336 | 2019-03-30T12:42:34 | 2019-03-30T12:42:34 | 178,556,704 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,598 | java | package com.example.laiji.homemap;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
public class MainActivity extends BaseActivity {
private static final String TAG = "[lylog]";
public LYGPSManager mLygpsManager;
public LocationClient mLocationClient = null;
public LaiyuView mLaiyuView;
double longitude;
double latitude;
TextView mText;
double viewW , viewH;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mText = findViewById(R.id.text);
mLaiyuView = findViewById(R.id.laiyuview);
viewW = getWindowManager().getDefaultDisplay().getWidth();
viewH = getWindowManager().getDefaultDisplay().getHeight();
Log.d(TAG, "w: "+viewW+ " h:"+viewH);
initView();
}
private void initView() {
// initGPSManager();
mLocationClient = new LocationClient(getApplicationContext());
mLocationClient.registerLocationListener(new BDAbstractLocationListener() {
@Override
public void onReceiveLocation(BDLocation location) {
longitude = location.getLongitude();//jingdu
latitude = location.getLatitude();//weidu
String addr = location.getAddrStr(); //获取详细地址信息
String country = location.getCountry(); //获取国家
String province = location.getProvince(); //获取省份
String city = location.getCity(); //获取城市
String district = location.getDistrict(); //获取区县
String street = location.getStreet(); //获取街道信息
//showToast(addr +" "+country+" "+province+" "+city+" "+district+" "+street+" "+latitude);
runOnUiThread(new Runnable() {
@Override
public void run() {
mText.setText("经度 =" + longitude + " 纬度 =" + latitude);
mLaiyuView.setXY(longitude, latitude);
LYPoint p = new LYPoint();
p.x = (float) (viewW-Math.abs(latitude-30.496829)*viewW/0.000050);
p.y = (float) (Math.abs(104.029511-longitude)*viewH/0.000370);
if (Utils.mListpoint.size() <= 10) {
showToast(" x ="+p.x + " y="+p.y);
Utils.mListpoint.add(p);
}else{
showToast(" has ten point ");
mLaiyuView.invalidate();
}
}
});
}
});
LocationClientOption option = new LocationClientOption();
option.setIsNeedAddress(true);
option.setCoorType("bd09ll");
option.setScanSpan(1000);
option.setOpenGps(true);
option.setLocationNotify(true);
option.setIgnoreKillProcess(false);
option.SetIgnoreCacheException(false);
option.setWifiCacheTimeOut(5 * 60 * 1000);
option.setEnableSimulateGps(false);
mLocationClient.setLocOption(option);
mLocationClient.start();
}
private void initGPSManager() {
mLygpsManager = new LYGPSManager(this);
}
} | [
"[email protected]"
] | |
6cdbe42dfe6590685a2d88fbc5137f03e6b5d9a2 | f604836b69552452121c03a2298a338ef8335dbf | /app/src/main/java/multiple/contacts/com/multiplecontacts/ContactListAdapter.java | bcb7811fecfb73c98845b7533a71e13feb17a6af | [] | no_license | devnitish29/MultiContacts | ac6be3b4b53b1998754188c771b97658acfdc3c4 | 0c1a2cbba92dfbe2dee65a42e16af8364a546589 | refs/heads/master | 2021-08-11T07:53:32.648733 | 2017-11-13T10:55:00 | 2017-11-13T10:55:00 | 110,536,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,107 | java | package multiple.contacts.com.multiplecontacts;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import java.util.ArrayList;
/**
* Created by Nitish Singh on 7/3/17.
*/
public class ContactListAdapter extends BaseAdapter {
private static LayoutInflater inflater = null;
Context mContext;
ArrayList<String> nameList;
ArrayList<String> numberList;
public ContactListAdapter(ArrayList<String> nameList, ArrayList<String> numberList, Context context) {
this.mContext = context;
this.nameList = nameList;
this.numberList = numberList;
inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public int getCount() {
return numberList.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ContactsViewHolder contactsViewHolder = new ContactsViewHolder();
View view = convertView;
int type = getItemViewType(position);
if(convertView == null){
view = inflater.inflate(R.layout.item_contacts, parent, false);
contactsViewHolder.txtName = (TextView) view.findViewById(R.id.txtName);
contactsViewHolder.txtNumber = (TextView) view.findViewById(R.id.txtNo);
view.setTag(contactsViewHolder);
} else {
contactsViewHolder = (ContactsViewHolder) view.getTag();
}
if(numberList.size() > 0 || nameList.size() > 0 ){
contactsViewHolder.txtName.setText(nameList.get(position));
contactsViewHolder.txtNumber.setText(numberList.get(position));
}
return view;
}
static class ContactsViewHolder {
TextView txtName;
TextView txtNumber;
}
}
| [
"[email protected]"
] | |
2eb3d07df4166b1bbc299697cb3874892044e97b | 92ff969cbc09d9920f8077c98032af013ff9b0de | /backend/src/main/java/com/ingressoapp/ingresso/controller/EventController.java | da71347feca56041034b3fe4955580db101aae46 | [] | no_license | adsmetrocamp/T-03 | 88537b17ef82d9ccb685dac2ed0b5675ac3ff058 | 24353025433032810b52f8e90a4ca594dd565461 | refs/heads/master | 2023-08-24T08:54:08.839363 | 2021-10-04T22:01:32 | 2021-10-04T22:01:32 | 408,615,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,507 | java | package com.ingressoapp.ingresso.controller;
import com.ingressoapp.ingresso.dto.EventCategoryDto;
import com.ingressoapp.ingresso.dto.EventRequest;
import com.ingressoapp.ingresso.dto.EventResponse;
import com.ingressoapp.ingresso.model.Event;
import com.ingressoapp.ingresso.model.EventCategory;
import com.ingressoapp.ingresso.repository.EventCategoryRepository;
import com.ingressoapp.ingresso.repository.EventRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.ValidationException;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/events")
@Valid
public class EventController {
@Autowired
private EventCategoryRepository eventCategoryRepository;
@Autowired
private EventRepository eventRepository;
@GetMapping()
private List<EventCategoryDto> getAllEvents() {
return eventCategoryRepository.findAll().stream().map(EventCategoryDto::toResponse)
.collect(Collectors.toList());
}
@PostMapping()
private EventResponse addEvent(@Valid @RequestBody EventRequest eventRequest) {
Event eventToCreate = eventRequest.toEvent();
eventToCreate.setId(null);
Optional<EventCategory> findCategoryById = eventCategoryRepository.findById(eventRequest.getCategoryId());
if (!findCategoryById.isPresent()) {
throw new ValidationException("Não foi possível encontrar a categoria selecionada. Pode ser que a mesma tenha sido excluída");
}
eventToCreate.setCategory(findCategoryById.get());
return EventResponse.toResponse(eventRepository.save(eventToCreate));
}
@PutMapping("/{id}")
private EventResponse updateEvent(@Valid @RequestBody EventRequest eventRequest, @PathVariable("id") UUID id) {
Event eventToCreate = eventRequest.toEvent();
eventToCreate.setId(id);
Optional<EventCategory> findCategoryById = eventCategoryRepository.findById(eventRequest.getCategoryId());
if (!findCategoryById.isPresent()) {
throw new ValidationException("Não foi possível encontrar a categoria selecionada. Pode ser que a mesma tenha sido excluída");
}
eventToCreate.setCategory(findCategoryById.get());
return EventResponse.toResponse(eventRepository.save(eventToCreate));
}
}
| [
"[email protected]"
] | |
660d10fa4aae85f78de658a9b91acd384e240270 | 36628f43065db9cc7c2ca8f0d4635d7f44018d50 | /First10NaturalNoPrint.java | f6d3f12a5dd1b9020bf64eba713f14934e2f0153 | [] | no_license | AdityaKaushik121/Java-Programs | 4bd41ffaaedd63a86b104e693891eb64f7fa645c | b231bc48279e4dc01632aba6633b92c6a442cd4c | refs/heads/master | 2020-12-08T22:03:15.281005 | 2020-01-10T18:55:39 | 2020-01-10T18:55:39 | 233,108,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 220 | java | package saurav_programs;
public class First10NaturalNoPrint {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i=1; i<=10;i++){
System.out.println(i);
}
}
}
| [
"[email protected]"
] | |
e70bb31355cabe5f785e298acb072e1e6eb34d03 | 27d5dbdbd1d86bc6a6ac2cef53379b443f864dda | /nicespinner/src/main/java/com/chengtech/nicespinner/NiceSpinnerAdapter.java | 3686925621605f07a58a28ff1dd9f44659174675 | [] | no_license | chengtech/Application1 | ce7dc31b55d1a04ecbcb02fb07ed5f79f7fc1640 | 63bfb2b630f246ae7635a4a8304b8d4906d9c257 | refs/heads/master | 2020-12-02T19:42:15.224362 | 2018-02-12T06:53:57 | 2018-02-12T06:53:57 | 96,377,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 878 | java | package com.chengtech.nicespinner;
import android.content.Context;
import java.util.List;
/**
* @author angelo.marchesin
*/
public class NiceSpinnerAdapter<T> extends NiceSpinnerBaseAdapter {
private final List<T> mItems;
public NiceSpinnerAdapter(Context context, List<T> items, int textColor, int backgroundSelector) {
super(context, textColor, backgroundSelector);
mItems = items;
}
@Override
public int getCount() {
return mItems.size() - 1;
}
@Override
public T getItem(int position) {
if (position >= mSelectedIndex) {
return mItems.get(position + 1);
} else {
return mItems.get(position);
}
}
@Override
public T getItemInDataset(int position) {
if (mItems.size()==0)
return null;
return mItems.get(position);
}
} | [
"[email protected]"
] | |
cddff3ef9454470220f235e6c8567cd9103a8a12 | 89991cdc5ceac6a315dc6422064eb46bebad5250 | /com/joggle/src/main/java/com/scd/joggle/pojo/po/CommunityPo.java | 23ae2f8215f124e01e00ba3f3994642ec95cac20 | [] | no_license | xiaoxian075/MySpringCloud | 8350d34d565a995761f536c247d77e8b8dad666e | a7d00a9bdec7aa08f15cf768626bb27243b1ebf0 | refs/heads/master | 2020-03-07T21:48:24.121347 | 2018-04-04T09:55:09 | 2018-04-04T09:55:09 | 127,737,522 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 734 | java | package com.scd.joggle.pojo.po;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class CommunityPo{
private long id;
/**
* 标题
*/
private String title;
/**
* 类型 1:学习教育 2:美食分享 3:生活健康 4:健身健美
*/
private int type;
/**
* url
*/
private String url;
/**
* 是否点赞 0:末点赞 1:已点赞
*/
private int hasPraise;
/**
* 点击量
*/
private long hitNum;
/**
* 点赞量
*/
private long praiseNum;
/**
* 创建时间
*/
private long createTime;
/**
* 更新时间
*/
private long updateTime;
}
| [
"[email protected]"
] | |
fce9efc303d157cbb65ad36d38b4417e99c3d535 | 799f38022329e676a24b7ffb3e78f3d1b6dde4e5 | /src/main/java/fr/diginamic/TP6/ISurface.java | 0b3f3be93438ee2df279636a768c45213bc75065 | [] | no_license | yonelT/approche-objet | 150667f05f6d48491ff83ed0ebd051a1a76eeeec | 5d61cb282ab4d73702ea9be7ad2e1448d9fe161f | refs/heads/master | 2020-05-16T10:02:52.504433 | 2019-04-30T14:29:01 | 2019-04-30T14:29:01 | 182,968,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 100 | java | package fr.diginamic.TP6;
public interface ISurface {
public double calculerSurface();
}
| [
"[email protected]"
] | |
64c1a6f455935e6bae99084b20c1669460b76a80 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mobileqqi/classes.jar/ftq.java | 38882ac682f475f4547c6f62859fb176f0f461b5 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 2,480 | java | import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.filemanager.activity.fileviewer.troopfile.TroopFileViewerActivity;
import com.tencent.mobileqq.filemanager.app.FMObserver;
import com.tencent.mobileqq.filemanager.core.FileManagerDataCenter;
import com.tencent.mobileqq.filemanager.data.FileManagerEntity;
import com.tencent.mobileqq.filemanager.util.FileManagerUtil;
import com.tencent.qphone.base.util.QLog;
public class ftq
extends FMObserver
{
public ftq(TroopFileViewerActivity paramTroopFileViewerActivity) {}
protected void a()
{
this.a.f();
}
protected void a(long paramLong1, long paramLong2, String paramString, int paramInt)
{
paramString = this.a.b.a().a(paramLong1, paramString, paramInt, paramLong2);
if (paramString == null) {}
while (paramLong2 != paramString.nSessionId) {
return;
}
QLog.i("<FileAssistant>TroopFileViewerActivity", 1, "<FileAssistant>TroopFileViewerActivity OnFileTransferStart: mEntity[" + FileManagerUtil.a(this.a.a) + "]");
this.a.f();
}
protected void a(boolean paramBoolean, long paramLong1, long paramLong2, String paramString, int paramInt)
{
if ((paramLong2 != this.a.a.nSessionId) && (paramLong2 != this.a.a.nRelatedSessionId)) {
return;
}
this.a.f();
}
protected void a(boolean paramBoolean, long paramLong1, long paramLong2, String paramString1, int paramInt1, int paramInt2, String paramString2)
{
QLog.d("<FileAssistant>TroopFileViewerActivity", 1, "<FileAssistant>TroopFileViewerActivityOnFileTransferEnd, isSuccess[" + paramBoolean + "] uniseq[" + paramLong1 + "] nSessionId[" + paramLong2 + "] errCode[" + paramInt2 + "] retMsg[" + paramString2 + "] mEntify:" + FileManagerUtil.a(this.a.a));
if (this.a.b.a().a(paramLong2) == null) {
QLog.e("<FileAssistant>TroopFileViewerActivity", 1, "queryEntity is null,nSessionId[" + paramLong2 + "]");
}
for (;;)
{
return;
if (paramBoolean) {
FileManagerUtil.a(paramLong2);
}
while (paramLong2 == this.a.a.nSessionId)
{
this.a.f();
return;
FileManagerUtil.a(paramLong2, paramInt2, paramString2);
}
}
}
protected void b()
{
this.a.f();
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mobileqqi\classes2.jar
* Qualified Name: ftq
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
1e14b840373e97a4c2b4a8f0b62272cf6e39398c | 415d4ed306ef6338ac64b8fffbc54f7cebf7edd1 | /src/main/java/pe/edu/upeu/sysgru/controller/LineaPlanController.java | e682e12a7ae6912b813b770950837778d05427e5 | [] | no_license | AlexanderCm1/sgru-backend-deploy | 25bba6ac77faae21298270f0f715bdae7dae0b46 | 3901cf378f3662a0240164790706721486616639 | refs/heads/main | 2023-02-08T03:58:41.264982 | 2020-12-24T16:40:45 | 2020-12-24T16:40:45 | 324,198,910 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 889 | java | package pe.edu.upeu.sysgru.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import pe.edu.upeu.sysgru.entity.LineaPlan;
import pe.edu.upeu.sysgru.service.LineaPlanService;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@CrossOrigin(origins = "*", allowedHeaders = "*")
@RestController
@RequestMapping(value = "/api/lineas_plan", produces = MediaType.APPLICATION_JSON_VALUE)
public class LineaPlanController {
@Autowired
LineaPlanService lineaPlanService;
@GetMapping("{id}")
public Map<String, List<LineaPlan>> getLineasPlan(@PathVariable int id){
Map<String,List<LineaPlan>> lineasPlan = new HashMap<>();
lineasPlan.put("lineas_plan",lineaPlanService.getLineasPlan(id));
return lineasPlan;
}
}
| [
"[email protected]"
] | |
539919eb37888d2c1659a4f507b8babb677159a2 | addb53299fc70a9ecb0a06b9b206a3ae92defd13 | /Jellyfish.Parser.v2/src/jellyfish/matcher/input/InputTokenList.java | 42d0ccd204d60299b81a13f2525c1e3712ede902 | [] | no_license | amjed/Universal-Structured-Language-Parser | a393901e81b5a29c6b761676c54aaccea29a2c0c | 38f098453f363d5a9e1d36240e342a19209c3df5 | refs/heads/master | 2021-01-25T07:34:30.510937 | 2011-02-10T09:07:14 | 2011-02-10T09:07:14 | 1,357,912 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,328 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package jellyfish.matcher.input;
import java.util.*;
import java.util.ArrayList;
/**
*
* @author Xevia
*/
public class InputTokenList implements List<InputToken> {
private List<InputToken> list;
public InputTokenList(int capacity) {
this.list = new ArrayList<InputToken>(capacity);
}
public InputTokenList() {
this.list = new ArrayList<InputToken>();
}
public <T> T[] toArray(T[] a) {
return list.toArray(a);
}
public Object[] toArray() {
return list.toArray();
}
public List<InputToken> subList(int fromIndex, int toIndex) {
return list.subList(fromIndex, toIndex);
}
public int size() {
return list.size();
}
public InputToken set(int index, InputToken element) {
return null;
}
public boolean retainAll(Collection<?> c) {
return list.retainAll(c);
}
public boolean removeAll(Collection<?> c) {
return list.removeAll(c);
}
public InputToken remove(int index) {
return list.remove(index);
}
public boolean remove(Object o) {
return list.remove((InputToken)o);
}
public ListIterator<InputToken> listIterator(int index) {
return list.listIterator(index);
}
public ListIterator<InputToken> listIterator() {
return list.listIterator();
}
public int lastIndexOf(Object o) {
return list.lastIndexOf(o);
}
public Iterator<InputToken> iterator() {
return list.iterator();
}
public boolean isEmpty() {
return list.isEmpty();
}
public int indexOf(Object o) {
return list.indexOf(o);
}
@Override
public int hashCode() {
return list.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final InputTokenList other = (InputTokenList) obj;
if (this.list != other.list && (this.list == null || !this.list.equals(other.list))) {
return false;
}
return true;
}
public InputToken get(int index) {
return list.get(index);
}
public boolean equals(InputToken o) {
return list.equals(o);
}
public boolean containsAll(Collection<?> c) {
return list.containsAll(c);
}
public boolean contains(Object o) {
return list.contains((InputToken)o);
}
public void clear() {
list.clear();
}
public boolean addAll(int index, Collection<? extends InputToken> c) {
// return list.addAll(index, c);
return false;
}
public boolean addAll(Collection<? extends InputToken> c) {
// return list.addAll(c);
return false;
}
public void add(int index, InputToken element) {
// list.add(index, element);
}
public boolean add(InputToken e) {
if (list.isEmpty() || !e.isWildCard() || !list.get(list.size()-1).isWildCard())
return list.add(e);
else
return false;
}
@Override
public String toString() {
return list.toString();
}
}
| [
"Umran@.(none)"
] | Umran@.(none) |
3d3f64b0f8154a22f09294584882e04b44138846 | e5c86efbfc39614c0eac2e945765e71e58b14f28 | /src/main/java/framevpm/learning/approaches/Approach.java | 83cc59f5afe69048542bde134dfafc33f3b71a68 | [
"Apache-2.0"
] | permissive | electricalwind/framevpm | 021fe31b5614b0e6202c9277454d54287611cae2 | 6d33cc33a1234e5e3c4da37c12cf949a6b89a73b | refs/heads/master | 2020-03-19T12:10:57.647631 | 2018-08-17T15:40:38 | 2018-08-17T15:40:38 | 136,501,905 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,095 | java | package framevpm.learning.approaches;
import framevpm.learning.Classifiers;
import framevpm.learning.model.ApproachResult;
import framevpm.learning.model.Experiment;
import framevpm.learning.model.ExperimentResult;
import framevpm.learning.model.classmodel.ClassModel;
import weka.classifiers.Classifier;
import weka.core.Instance;
import weka.core.Instances;
import weka.filters.Filter;
import weka.filters.supervised.instance.SMOTE;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public abstract class Approach {
protected final List<Experiment> experiments;
public final ClassModel model;
protected LinkedHashMap<String, Instances[]> preparedInstances;
public Approach(List<Experiment> experiments, ClassModel model) {
this.experiments = experiments;
this.model = model;
preparedInstances = new LinkedHashMap<>();
}
public abstract void prepareInstances();
public ApproachResult runWith(String classifierName, boolean smote) {
Map<String, Map<String, ExperimentResult>> resultMap = new LinkedHashMap<>();
final int[] i = {0};
preparedInstances.forEach((experiment, instances) -> {
try {
Classifier classifier = Classifiers.getClassifier(classifierName);
Instances training;
if (smote) {
Filter filter = new SMOTE();
filter.setInputFormat(instances[0]);
training = Filter.useFilter(instances[0], filter);
} else {
training = instances[0];
}
classifier.buildClassifier(training);
Map<String, ExperimentResult> experimentResultMap = new LinkedHashMap<>();
Experiment experimentdata = experiments.get(i[0]);
final int[] j = {0};
experimentdata.getTesting().keySet().forEach(fileMetaInf -> {
if (model.correspondingToTypeFile(fileMetaInf.getType()) != null) {
try {
Instance testingInstance = instances[1].instance(j[0]);
double[] dist = classifier.distributionForInstance(testingInstance);
double classif = classifier.classifyInstance(testingInstance);
experimentResultMap.put(fileMetaInf.getFile(), new ExperimentResult(dist, classif, fileMetaInf, testingInstance.classValue()));
} catch (Exception e) {
e.printStackTrace();
} finally {
j[0]++;
}
}
});
resultMap.put(experiment, experimentResultMap);
} catch (Exception e) {
e.printStackTrace();
} finally {
i[0]++;
}
});
return new ApproachResult(getApproachName(), smote, classifierName, resultMap);
}
public abstract String getApproachName();
}
| [
"[email protected]"
] | |
2a70234ed87ebf7ed3ceec8b6bce1b9dfa142393 | b4294132e02c1eb0fd083030d80562561fb22dda | /src/main/java/frc/robot/commands/elevator/MoveElevatorPosition.java | 535d7d637a4e8fb340ef2268371bf2a4ff7e39be | [] | no_license | HarkerRobo/SummerRoboCode2018 | b135436eb2d0e0751224470319f84e146c44e93e | 7f0ad983fc7d70b568e7ed7b226b4ffb0263204f | refs/heads/master | 2020-03-20T03:19:03.980584 | 2019-04-13T16:35:27 | 2019-04-13T16:35:27 | 137,142,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package frc.robot.commands.elevator;
import frc.robot.Robot;
import frc.robot.RobotMap;
import com.ctre.phoenix.motorcontrol.FeedbackDevice;
import edu.wpi.first.wpilibj.command.Command;
/**
* Moves the elevator to a given position using PID.
* @author Finn Frankis
* @version 6/14/18
*/
public class MoveElevatorPosition extends Command
{
/**
* The intended final position for the elevator.
*
*/
private double position;
/**
* Creates a new MoveElevatorPosition.
* @param position the position to move to
*/
public MoveElevatorPosition(double position)
{
requires(Robot.el);
}
/**
* Initializes the command with necessary sensors.
*/
public void initialize()
{
Robot.el.getBottomRightTalon().configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative, RobotMap.PRIMARY_PID_INDEX);
}
/**
* Executes the command given the position to which the elevator should move.
*
*/
@Override
// public void execute() { Robot.el.moveElevatorPosition(position); }
/**
* Determines whether the command is complete.
*
* @return true if the command is complete; false otherwise
*/
protected boolean isFinished() { return true; }
}
| [
"[email protected]"
] | |
181365da878183ab3cb7370da0041af8535930ba | c883f1650ecb8d4350f786cb5e830f5daf6fe6db | /app/src/main/java/com/franzco/sudoku/AppCompatPreferenceActivity.java | 0a01933d19f6a1c3f27a4f139ec63bc16bdad377 | [] | no_license | NtsFranz/SudokuSolver | 423b4c9d50c91292b7cf75285b4a40e1306d09e9 | 14fe89dab13bdd3078b74065b988ac103c110110 | refs/heads/master | 2021-01-10T15:01:49.937757 | 2016-03-02T02:32:44 | 2016-03-02T02:32:44 | 48,245,592 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,992 | java | package com.franzco.sudoku;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
/**
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
* to be used with AppCompat.
*/
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
private AppCompatDelegate mDelegate;
@Override
protected void onCreate(Bundle savedInstanceState) {
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
getDelegate().onPostCreate(savedInstanceState);
}
public ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
public void setSupportActionBar(@Nullable Toolbar toolbar) {
getDelegate().setSupportActionBar(toolbar);
}
@Override
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
getDelegate().setContentView(layoutResID);
}
@Override
public void setContentView(View view) {
getDelegate().setContentView(view);
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().setContentView(view, params);
}
@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().addContentView(view, params);
}
@Override
protected void onPostResume() {
super.onPostResume();
getDelegate().onPostResume();
}
@Override
protected void onTitleChanged(CharSequence title, int color) {
super.onTitleChanged(title, color);
getDelegate().setTitle(title);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
getDelegate().onConfigurationChanged(newConfig);
}
@Override
protected void onStop() {
super.onStop();
getDelegate().onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
getDelegate().onDestroy();
}
public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
private AppCompatDelegate getDelegate() {
if (mDelegate == null) {
mDelegate = AppCompatDelegate.create(this, null);
}
return mDelegate;
}
}
| [
"[email protected]"
] | |
70a1852612c76dcd492167649bb723a89eb8440b | fade0fef5ae6e9d840aaee636e7f5f761a2ebd68 | /nagger/src/main/java/com/lubarov/daniel/nagger/model/Alert.java | 96b6e2c580fbc7c6fb0c58dfbb84aef5f767a881 | [] | no_license | dlubarov/daniel | b986f9e3df87c21024bd30e00fd2adb9f3b39a84 | 7eed652995cd922b806f25391fe2000599cd3bb7 | refs/heads/master | 2021-01-17T09:19:50.808058 | 2019-01-09T03:36:44 | 2019-01-09T03:36:44 | 7,437,086 | 0 | 0 | null | 2013-03-06T06:49:11 | 2013-01-04T08:01:21 | Java | UTF-8 | Java | false | false | 618 | java | package com.lubarov.daniel.nagger.model;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
public class Alert {
private static final int MAX_CHECKS_TO_STORE = 20;
public String uuid;
public String name;
public String description;
public String command;
public String frequency;
public Set<String> tags = new HashSet<>();
public Set<String> recipientUuids = new HashSet<>();
public LinkedList<Check> checks = new LinkedList<>();
public void addCheck(Check check) {
if (checks.size() >= MAX_CHECKS_TO_STORE)
checks.removeFirst();
checks.add(check);
}
}
| [
"[email protected]"
] | |
0e6dbf539e76ca0974be4532e001ab00c556dde6 | b799f86ebcd9832833470b99f9c92e1351d01d97 | /app/src/main/java/com/pu/gouthelper/adapter/DrugSearchAdapter.java | 7dd61613863d2bccdc3ba95d5cedc595eaab9656 | [] | no_license | gongyaju/gout | 4916c2fb1c585e433e629fb532288ff0cbadc460 | 01f9f415d65b17f2ebb01594c8ec6495dcc0bc40 | refs/heads/master | 2020-05-22T04:15:45.253732 | 2016-11-26T01:58:07 | 2016-11-26T01:58:07 | 61,945,568 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,325 | java | package com.pu.gouthelper.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.pu.gouthelper.R;
import com.pu.gouthelper.bean.GoutDrug;
import java.util.List;
/**
* drug查找
*/
public class DrugSearchAdapter extends BaseAdapter {
private List<GoutDrug> mlist;
private Context context;
public DrugSearchAdapter(Context context, List<GoutDrug> mlist) {
this.mlist = mlist;
this.context = context;
}
@Override
public int getCount() {
return mlist.size();
}
@Override
public Object getItem(int position) {
return mlist.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
GoutDrug entity = mlist.get(position);
convertView = LayoutInflater.from(context).inflate(R.layout.item_search_list, null);
TextView search_tv_info = (TextView) convertView.findViewById(R.id.search_tv_info);
search_tv_info.setText(entity.getTitle());
return convertView;
}
}
| [
"[email protected]"
] | |
947b99efbbbc11c99f5f6cfd7ce2aba06ffa2d60 | 0bb3949cabb51a400b849f91f66f0c9ee90d7261 | /Multithreading/Test.java | b2030130767a382c9b072bcbcad008dc50996a02 | [] | no_license | sifathasib/java-newgen | e46db78ff2afdc6c3a36dfd1d33dd2b2e69613aa | bdb1d78ae1506eed82b27e0e97980536385d4e3b | refs/heads/main | 2023-08-26T05:59:14.906499 | 2021-09-30T11:34:51 | 2021-09-30T11:34:51 | 408,381,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | import java.lang.Thread;
import java.lang.Runnable;
class A {
public static void main(String[] args) {
System.out.println("hello");
}
}
class Test extends A{
public static void main(String args[]){
Test t = new Test();
System.out.println("world");
}
}
| [
"[email protected]"
] | |
3408b0dc7cb31ac411f08b16c0155b8713568b0f | 16435878ec235617cce6b6422eeaeb27d3009131 | /src/main/java/com/opencart/test/handler/OcFilterGroupDescriptionHandler.java | edf1eec2cd622065b498490209ec7922316a27f9 | [] | no_license | gmai2006/opencarttest | fa2207f35046ba636ffef8107a4a6e9ffc57b1bb | b73df234af5bd431b56d038c4aec7aa5383ff1ce | refs/heads/main | 2023-09-02T20:01:51.767075 | 2021-10-16T07:40:18 | 2021-10-16T07:40:18 | 417,754,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,154 | java | /**
* %% Copyright (C) 2021 DataScience 9 LLC %% 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
*
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* <p>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. #L%
*
* <p>This code is 100% AUTO generated. Please do not modify it DIRECTLY If you need new features or
* function or changes please update the templates then submit the template through our web
* interface.
*/
package com.opencart.test.handler;
import com.opencart.test.dao.JpaDao;
import com.opencart.test.entity.OcFilterGroupDescription;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Named;
// @Stateless
@Named("OcFilterGroupDescriptionHandler")
public class OcFilterGroupDescriptionHandler
extends DelimiterFileHandler<OcFilterGroupDescription> {
@Inject
@Named("DefaultJpaDao")
public OcFilterGroupDescriptionHandler(final JpaDao dao) {
super(dao);
}
@Override
protected OcFilterGroupDescription parseLine(List<String> headers, List<String> tokens) {
OcFilterGroupDescription record = new OcFilterGroupDescription();
for (int i = 0; i < tokens.size(); i++) {
switch (headers.get(i)) {
case "filterGroupId":
record.setFilterGroupId(java.lang.Integer.valueOf((tokens.get(i))));
break;
case "languageId":
record.setLanguageId(java.lang.Integer.valueOf((tokens.get(i))));
break;
case "name":
record.setName(tokens.get(i));
break;
default:
logger.severe("Unknown col " + headers.get(i));
}
}
return record;
}
}
| [
"[email protected]"
] | |
5dc55dfbf5d23321f36dd07fe7b1bc89b900004e | 444f30b6117d3f44b807788d44b5c0ec9c0571b7 | /Eclipse/TestThread/src/TestThread/TesThread02.java | 8e0fcccf8b7f9eef77c63579632e1e576c659c4e | [] | no_license | DongHuaLu/java | c62094468ce1a319a5481c0fb080280ac08dcc81 | b8152331ad0afcc885d922c61d6df3c56e582113 | refs/heads/master | 2020-05-18T09:08:41.160675 | 2013-09-07T03:16:09 | 2013-09-07T03:16:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 494 | java | package TestThread;
public class TesThread02 {
public static void main(String[] args) {
new TesThread02().be();
}
public void be(){
Thread tt=new Thread(new TestThreadx(),"abc");
tt.start();
for (int i=0;i<100;i++){
System.out.println(Thread.currentThread().getName()+i);
}
}
class TestThreadx implements Runnable{
@Override
public void run() {
for(int i=0;i<100;i++){
System.out.println(Thread.currentThread().getName()+i);
}
}
}
}
| [
"[email protected]"
] | |
fb1215cb026494eafd2db23323462defe56592d1 | 0388594866bcdd360428c74c069c9891595c21f9 | /app/src/main/java/com/digitalhouse/fragments/NoticiaFragment.java | 7533f2f59ff8a64cd081591a2e508b320c6bdae0 | [] | no_license | gongar19/vene | 32fb3d7009aea3195d6730ad23255acf3bac4316 | e1d014c8c0630b4bbb52ef79d7f88ffd12602496 | refs/heads/master | 2020-04-05T08:40:01.695990 | 2018-11-08T15:07:44 | 2018-11-08T15:07:44 | 156,723,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,055 | java | package com.digitalhouse.fragments;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
/**
* A simple {@link Fragment} subclass.
*/
public class NoticiaFragment extends Fragment{
private String TAG = MainActivity.class.getSimpleName();
private ArrayList<Noticia> noticias = new ArrayList<>();
private RecyclerView recyclerViewNoticias;
public NoticiaFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_noticia, container, false);
recyclerViewNoticias = view.findViewById(R.id.recyclerViewNoticias);
new GetNoticias().execute();
return view;
}
@SuppressLint("StaticFieldLeak")
private class GetNoticias extends AsyncTask<Void, Void, ArrayList<Noticia>> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected ArrayList<Noticia> doInBackground(Void... arg0) {
HttpHandler sh = new HttpHandler();
// Making a request to url and getting responseç
String url = "\n" +
"https://newsapi.org/v2/top-headlines?country=ar&apiKey=8b141017cf6848908829489044ed6f71";
String jsonStr = sh.makeServiceCall(url);
Log.e(TAG, "Response from url: " + jsonStr);
if (jsonStr != null) {
try {
JSONObject jsonObj = new JSONObject(jsonStr);
// Getting JSON Array node
JSONArray noticiasJSON = jsonObj.getJSONArray("articles");
// looping through All Entidades
for (Integer i = 0; i < noticiasJSON.length(); i++) {
JSONObject e = noticiasJSON.getJSONObject(i);
String autor = e.getString("author");
String titulo = e.getString("title");
String descripcion = e.getString("description");
String urlNoticia = e.getString("url");
String urlImage = e.getString("urlToImage");
if(urlImage.startsWith("//")){
urlImage = "http:"+urlImage;
}
String publicado = e.getString("publishedAt");
String contenido = e.getString("content");
Noticia noticia = new Noticia(autor,titulo,descripcion,urlNoticia,urlImage,publicado,contenido);
noticias.add(noticia);
}
} catch (final JSONException e) {
}
} else {
}
return noticias;
}
@Override
protected void onPostExecute(ArrayList<Noticia> result) {
super.onPostExecute(result);
traerDatos();
}
}
public void traerDatos(){
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getContext(),LinearLayoutManager.VERTICAL,false);
recyclerViewNoticias.setHasFixedSize(true);
NoticiasAdaptador adaptador = new NoticiasAdaptador(noticias);
recyclerViewNoticias.setAdapter(adaptador);
recyclerViewNoticias.setLayoutManager(layoutManager);
}
}
| [
"[email protected]"
] | |
61b9cbb751e56a373e1a7285e4e86d0f9e8c00e1 | c423c4a708efa3147698bf8b6e7e3499544085db | /app/src/main/java/com/mitranetpars/sportmagazine/adapters/ProductsListAdapter.java | 23b97f2abbb38deead7095674ad0a6a87e013c21 | [] | no_license | hamed1361554/sportmagazine-android | 95db3bb0c4458b7dab02711d8e87ca4817957fd0 | 00eda8a5648c576e3661210e359bc9748cd86972 | refs/heads/master | 2020-07-04T12:03:38.867338 | 2017-01-13T16:07:24 | 2017-01-13T16:07:24 | 67,793,099 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,646 | java | package com.mitranetpars.sportmagazine.adapters;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.mitranetpars.sportmagazine.CartListFragment;
import com.mitranetpars.sportmagazine.SportMagazineApplication;
import com.mitranetpars.sportmagazine.cart.CartHelper;
import com.mitranetpars.sportmagazine.R;
import com.mitranetpars.sportmagazine.common.SecurityEnvironment;
import com.mitranetpars.sportmagazine.common.dto.product.Product;
import com.mitranetpars.sportmagazine.utils.ImageUtils;
import com.mitranetpars.sportmagazine.widgets.ShapedCheckBox;
import com.satsuware.usefulviews.LabelledSpinner;
import java.util.ArrayList;
/**
* Created by Hamed on 12/2/2016.
*/
public class ProductsListAdapter extends ArrayAdapter<Product> {
private int layoutResourceId;
private ArrayList<Product> data = null;
private LayoutInflater inflater = null;
private FragmentManager fragmentManager;
private int replacementID;
private int productionType;
private boolean showForViewOnly;
public ProductsListAdapter(Context context, int layoutResourceId, ArrayList<Product> data) {
super(context, layoutResourceId, data);
this.layoutResourceId = layoutResourceId;
this.data = data;
this.inflater = ((Activity)context).getLayoutInflater();
this.showForViewOnly = false;
this.productionType = SecurityEnvironment.<SecurityEnvironment>getInstance().getUser().getProductionType();
}
public void setFragmentManager(FragmentManager fm){
this.fragmentManager = fm;
}
public void setReplacementID(int id){
this.replacementID = id;
}
public void setShowForViewOnly(boolean flag){
this.showForViewOnly = flag;
}
@NonNull
@Override
public View getView(int position, View convertView, @NonNull final ViewGroup parent) {
ProductHolder holder = null;
if(convertView == null)
{
convertView = inflater.inflate(layoutResourceId, parent, false);
holder = new ProductHolder();
holder.holderProductImage = (ImageView)convertView.findViewById(R.id.product_list_item_image);
holder.holderProductName = (TextView)convertView.findViewById(R.id.product_list_item_name);
holder.holderProductPrice = (TextView)convertView.findViewById(R.id.product_list_item_price);
//holder.holderProductComment = (TextView)convertView.findViewById(R.id.product_list_item_comment);
holder.holderProductQuantity = (TextView)convertView.findViewById(R.id.product_list_item_quantity_tv);
holder.sizesLabelledSpinner = (LabelledSpinner)convertView.findViewById(R.id.product_list_size_selector);
holder.brandsLabelledSpinner = (LabelledSpinner)convertView.findViewById(R.id.product_list_brand_selector);
holder.addToCart = (ImageView)convertView.findViewById(R.id.product_list_item_add_to_cart);
holder.plusQuantity = (ImageView)convertView.findViewById(R.id.product_list_item_cart_plus);
holder.minusQuantity = (ImageView)convertView.findViewById(R.id.product_list_item_cart_minus);
holder.colorsLinearLayout = (LinearLayout)convertView.findViewById(R.id.product_list_item_additional_colors);
convertView.setTag(holder);
}
else
{
holder = (ProductHolder)convertView.getTag();
}
final Product product = data.get(position);
String imageString = product.getImage();
if (imageString != null && imageString != "") {
holder.holderProductImage.setImageBitmap(ImageUtils.decodeFromBase64(imageString));
}
holder.holderProductName.setText(product.getName());
holder.holderProductPrice.setText(String.valueOf(product.getPrice()));
//holder.holderProductComment.setText(product.getComment());
holder.holderProductQuantity.setText("1");
holder.addToCart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View parentView = (View)v.getParent();
TextView quantityTextView =
(TextView)parentView.findViewById(R.id.product_list_item_quantity_tv);
LinearLayout colors =
(LinearLayout) parentView.findViewById(R.id.product_list_item_additional_colors);
for (int i = 0; i < colors.getChildCount(); i++){
ShapedCheckBox cb = (ShapedCheckBox) colors.getChildAt(i);
if (cb.isChecked()){
product.SelectedColor = i;
break;
}
}
if (product.SelectedColor < 0) {
Toast.makeText(getContext(), R.string.select_color, Toast.LENGTH_SHORT).show();
return;
}
LabelledSpinner sizesSpinner =
(LabelledSpinner) parentView.findViewById(R.id.product_list_size_selector);
product.SelectedSize = sizesSpinner.getSpinner().getSelectedItemPosition();
LabelledSpinner brandsSpinner =
(LabelledSpinner) parentView.findViewById(R.id.product_list_brand_selector);
product.SelectedBrand = brandsSpinner.getSpinner().getSelectedItemPosition();
CartHelper.getCart().add(product, Integer.parseInt(quantityTextView.getText().toString()));
showShoppingCart();
}
});
holder.plusQuantity.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View parentView = (View)v.getParent();
TextView quantityTextView =
(TextView)parentView.findViewById(R.id.product_list_item_quantity_tv);
int newQuantity = Integer.parseInt(quantityTextView.getText().toString()) + 1;
if (newQuantity > 999999){
return;
}
quantityTextView.setText(String.valueOf(newQuantity));
parentView = (View)parentView.getParent();
LinearLayout colors =
(LinearLayout) parentView.findViewById(R.id.product_list_item_additional_colors);
for (int i = 0; i < colors.getChildCount(); i++){
ShapedCheckBox cb = (ShapedCheckBox) colors.getChildAt(i);
if (cb.isChecked()){
product.SelectedColor = i;
break;
}
}
LabelledSpinner sizesSpinner =
(LabelledSpinner) parentView.findViewById(R.id.product_list_size_selector);
product.SelectedSize = sizesSpinner.getSpinner().getSelectedItemPosition();
LabelledSpinner brandsSpinner =
(LabelledSpinner) parentView.findViewById(R.id.product_list_brand_selector);
product.SelectedBrand = brandsSpinner.getSpinner().getSelectedItemPosition();
if (CartHelper.getCart().getProducts().contains(product)) {
CartHelper.getCart().update(product, newQuantity);
}else {
CartHelper.getCart().add(product, newQuantity);
}
}
});
holder.minusQuantity.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
View parentView = (View)v.getParent();
TextView quantityTextView =
(TextView)parentView.findViewById(R.id.product_list_item_quantity_tv);
int newQuantity = Integer.parseInt(quantityTextView.getText().toString()) - 1;
if (newQuantity < 1){
return;
}
quantityTextView.setText(String.valueOf(newQuantity));
parentView = (View)parentView.getParent();
LinearLayout colors =
(LinearLayout) parentView.findViewById(R.id.product_list_item_additional_colors);
for (int i = 0; i < colors.getChildCount(); i++){
ShapedCheckBox cb = (ShapedCheckBox) colors.getChildAt(i);
if (cb.isChecked()){
product.SelectedColor = i;
break;
}
}
LabelledSpinner sizesSpinner =
(LabelledSpinner) parentView.findViewById(R.id.product_list_size_selector);
product.SelectedSize = sizesSpinner.getSpinner().getSelectedItemPosition();
LabelledSpinner brandsSpinner =
(LabelledSpinner) parentView.findViewById(R.id.product_list_brand_selector);
product.SelectedBrand = brandsSpinner.getSpinner().getSelectedItemPosition();
if (CartHelper.getCart().getProducts().contains(product)) {
CartHelper.getCart().update(product, newQuantity);
}else {
CartHelper.getCart().add(product, newQuantity);
}
}
});
holder.sizesLabelledSpinner.setItemsArray(product.getSizesArray());
holder.brandsLabelledSpinner.setItemsArray(product.getBrandsArray());
holder.colorsLinearLayout.removeAllViews();
int counter = 0;
for (String color: product.getColorsArray()){
int c = Integer.parseInt(color);
int col = Color.rgb(Color.red(c), Color.green(c), Color.blue(c));
ShapedCheckBox checkBox = new ShapedCheckBox(SportMagazineApplication.getContext(), null);
checkBox.setText("CC");
checkBox.setBackgroundColor(col);
checkBox.setTextColor(col);
checkBox.setTag(color);
checkBox.setEnabled(!this.showForViewOnly);
checkBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
colorCheckBoxClicked(v);
}
});
holder.colorsLinearLayout.addView(checkBox);
if (product.SelectedColor >= 0 && product.SelectedColor == counter){
checkBox.setChecked(true);
}
counter += 1;
}
if (product.SelectedBrand >= 0){
holder.brandsLabelledSpinner.getSpinner().setSelection(product.SelectedBrand);
}
if (product.SelectedSize >= 0){
holder.sizesLabelledSpinner.getSpinner().setSelection(product.SelectedSize);
}
if (this.showForViewOnly){
holder.minusQuantity.setEnabled(false);
holder.plusQuantity.setEnabled(false);
holder.addToCart.setVisibility(View.INVISIBLE);
holder.brandsLabelledSpinner.setEnabled(false);
holder.sizesLabelledSpinner.setEnabled(false);
holder.brandsLabelledSpinner.getSpinner().setEnabled(false);
holder.sizesLabelledSpinner.getSpinner().setEnabled(false);
} else {
if (this.productionType == 1 && product.wholesale_type == 0){
holder.addToCart.setVisibility(View.INVISIBLE);
} else {
holder.addToCart.setVisibility(View.VISIBLE);
}
holder.minusQuantity.setEnabled(true);
holder.plusQuantity.setEnabled(true);
holder.brandsLabelledSpinner.setEnabled(true);
holder.sizesLabelledSpinner.setEnabled(true);
holder.brandsLabelledSpinner.getSpinner().setEnabled(true);
holder.sizesLabelledSpinner.getSpinner().setEnabled(true);
}
return convertView;
}
private void showShoppingCart() {
Fragment fragment = new CartListFragment();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.addToBackStack(null);
transaction.replace(this.replacementID, fragment, null);
transaction.commitAllowingStateLoss();
}
private void colorCheckBoxClicked(View v){
ShapedCheckBox clicked = (ShapedCheckBox) v;
if (!clicked.isChecked()) return;
LinearLayout parent =
(LinearLayout) v.getParent();
for (int i = 0; i < parent.getChildCount(); i++){
ShapedCheckBox cb = (ShapedCheckBox) parent.getChildAt(i);
if (v.getTag() == cb.getTag()) continue;
cb.setChecked(false);
}
}
private class ProductHolder
{
ImageView holderProductImage;
TextView holderProductName;
TextView holderProductPrice;
//TextView holderProductComment;
TextView holderProductQuantity;
LabelledSpinner sizesLabelledSpinner;
LabelledSpinner brandsLabelledSpinner;
ImageView addToCart;
ImageView plusQuantity;
ImageView minusQuantity;
LinearLayout colorsLinearLayout;
}
}
| [
"[email protected]"
] | |
5bbf3a8a6e1d36dec678f948f6bf0888e57eeed3 | b36e88ec8a7b39ea8c9d2001f3b31940387eaed5 | /exercises/html-text-converter/java/src/test/java/katas/HtmlTextConverterTest.java | 2c08c3354a7e00611c7a47ded3c58f53096273d3 | [] | no_license | paucls/legacy-code-refactoring-workshop | 59499c7d2e6f43f15fed1d463d486a079b2766c6 | de8cacd4fef9fcf03006fc698338e51734882330 | refs/heads/master | 2022-12-05T16:57:21.370863 | 2019-10-17T16:21:04 | 2019-10-17T16:21:04 | 213,056,676 | 0 | 1 | null | 2022-11-16T12:40:53 | 2019-10-05T19:10:20 | Java | UTF-8 | Java | false | false | 289 | java | package katas;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class HtmlTextConverterTest {
@Test
public void foo() {
HtmlTextConverter converter = new HtmlTextConverter("foo");
assertEquals("fixme", converter.getFilename());
}
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.