blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | 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 132 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 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
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);
}
} | [
"ujjawalgayakwad@hotmail.com"
] | ujjawalgayakwad@hotmail.com |
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);
}
}
| [
"ZhouYangGaoGao@163.com"
] | ZhouYangGaoGao@163.com |
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;
}
}
}
| [
"“2531595185@qq.com”"
] | “2531595185@qq.com” |
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();
}
} | [
"jeyagandhi@in.ibm.com"
] | jeyagandhi@in.ibm.com |
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
*/ | [
"jiangchuna@126.com"
] | jiangchuna@126.com |
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;
}
}
| [
"zinoviy23@gmail.com"
] | zinoviy23@gmail.com |
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 {
}
| [
"jun59@163.com"
] | jun59@163.com |
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);
}
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
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
| [
"vignalf@gmail.com"
] | vignalf@gmail.com |
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;
}
| [
"bastian@MacBook-Pro-de-Bastian.local"
] | bastian@MacBook-Pro-de-Bastian.local |
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;
}
}
| [
"italosiqueira@gmail.com"
] | italosiqueira@gmail.com |
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";
}
}
| [
"kim772882@gmail.com"
] | kim772882@gmail.com |
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");
}
}
}
| [
"alexandr.v.andreev@gmail.com"
] | alexandr.v.andreev@gmail.com |
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;
}
}
| [
"ajay.ishan06@gmail.com"
] | ajay.ishan06@gmail.com |
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.
}
} | [
"dclems@the-mac.local"
] | dclems@the-mac.local |
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;
}
| [
"1356114236@qq.com"
] | 1356114236@qq.com |
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>{
}
| [
"shardik95@ccs.neu.edu"
] | shardik95@ccs.neu.edu |
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());
}
}
| [
"davide.marcandelli@gmail.com"
] | davide.marcandelli@gmail.com |
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> {
}
| [
"whitelamer@mail.ru"
] | whitelamer@mail.ru |
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;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
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);
}
}
| [
"pauline.muchigi@strathmore.edu"
] | pauline.muchigi@strathmore.edu |
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) {
}
}
| [
"1044176601@qq.com"
] | 1044176601@qq.com |
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";
}
}
| [
"596164874@qq.com"
] | 596164874@qq.com |
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);
}
| [
"16a51a0239ratna@gmail.com"
] | 16a51a0239ratna@gmail.com |
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 |
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];
}
}
;
}
| [
"odon0188@gmail.com"
] | odon0188@gmail.com |
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();
}
}
| [
"wbb@ihotel.cn"
] | wbb@ihotel.cn |
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);
}
}
| [
"1531757421@QQ.com"
] | 1531757421@QQ.com |
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 );
}
}
| [
"pierrelevy@users.noreply.github.com"
] | pierrelevy@users.noreply.github.com |
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;
}
}
| [
"amandrell@berkeley.edu"
] | amandrell@berkeley.edu |
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 |
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) + ">";
}
}
| [
"j.warchocki@student.tudelft.nl"
] | j.warchocki@student.tudelft.nl |
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;
}
}
| [
"Andre.Ponnouradjane@non.schneider-electric.com"
] | Andre.Ponnouradjane@non.schneider-electric.com |
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"}
};
}
}
| [
"zhihuang@icsil1noteb176.epfl.ch"
] | zhihuang@icsil1noteb176.epfl.ch |
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
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
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);
}
}
| [
"3064741443@qq.com"
] | 3064741443@qq.com |
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);
}
| [
"vicleo566@163.com"
] | vicleo566@163.com |
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);
}
}
}
| [
"dmitryilkievicz@gmail.com"
] | dmitryilkievicz@gmail.com |
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;
}
} | [
"sana278.a@gmail.com"
] | sana278.a@gmail.com |
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();
}
}
}
| [
"sherin.mashour@gmail.com"
] | sherin.mashour@gmail.com |
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);
}
| [
"512710257@qq.com"
] | 512710257@qq.com |
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);
}
}
}
| [
"elizasenkoro@gmail.com"
] | elizasenkoro@gmail.com |
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);
}
}
| [
"louis.chen@finsage.com.tw"
] | louis.chen@finsage.com.tw |
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);
}
}
| [
"maramaldajan@gmail.com"
] | maramaldajan@gmail.com |
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);
}
}
| [
"fer.madeiral@gmail.com"
] | fer.madeiral@gmail.com |
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());
}
}
| [
"2890268106@qq.com"
] | 2890268106@qq.com |
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);
}
}
| [
"erencangulec@gmail.com"
] | erencangulec@gmail.com |
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 |
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 |
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);
}
} | [
"383209920@qq.com"
] | 383209920@qq.com |
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;
}
}
| [
"douglas.netf@gmail.com"
] | douglas.netf@gmail.com |
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);
}
} | [
"122469892@qq.com"
] | 122469892@qq.com |
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.");
}
}
| [
"ctitton@vitelnet.com"
] | ctitton@vitelnet.com |
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;
}
}
| [
"nitishkumar.singh@tarento.com"
] | nitishkumar.singh@tarento.com |
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 Pereira_1150478@isep.ipp.pt
*/
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";
}
}
| [
"1150478@isep.ipp.pt"
] | 1150478@isep.ipp.pt |
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));
}
}
| [
"damonb@microsoft.com"
] | damonb@microsoft.com |
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));
}
}
| [
"adsmetrocamp.cps@gmail.com"
] | adsmetrocamp.cps@gmail.com |
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;
}
}
| [
"victorcampos@upeu.edu.pe"
] | victorcampos@upeu.edu.pe |
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;
}
| [
"xiaoxian075@126.com"
] | xiaoxian075@126.com |
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) |
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);
}
}
| [
"garciagonzalo19@gmail.com"
] | garciagonzalo19@gmail.com |
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; }
}
| [
"finn@teachmy.com"
] | finn@teachmy.com |
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();
}
| [
"yonel.toussay@gmail.com"
] | yonel.toussay@gmail.com |
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;
}
}
| [
"359451222@qq.com"
] | 359451222@qq.com |
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;
}
}
| [
"gmai2006@gmail.com"
] | gmai2006@gmail.com |
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);
}
}
}
}
| [
"dlu@suzhoukada.com"
] | dlu@suzhoukada.com |
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);
}
}
| [
"daniel@lubarov.com"
] | daniel@lubarov.com |
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();
}
| [
"matthieu@jimenez.lu"
] | matthieu@jimenez.lu |
49259023854fb8f018cdcedfe41cd59fe2608e41 | dec841ce431c03bcf5b1454eab34de21a35376a5 | /slick2d/src/org/newdawn/slick/util/DefaultLogSystem.java | 50f106f8a040edfec2e6c6f8d135228ce8b16045 | [] | no_license | guts2014/Geeksoc | 277b74ea57964ebd177d29a3cb7eddee444dd374 | a24d19a9e933bdbe5675b9afc5e54f35bfc3ed10 | refs/heads/master | 2016-09-05T11:37:55.748602 | 2014-10-17T15:57:05 | 2014-10-17T15:57:05 | 25,053,159 | 0 | 1 | null | 2014-10-11T23:06:18 | 2014-10-10T21:05:17 | Java | UTF-8 | Java | false | false | 1,951 | java | package org.newdawn.slick.util;
import java.io.PrintStream;
import java.util.Date;
/**
* The default implementation that just spits the messages out to stdout
*
* @author kevin
*/
public class DefaultLogSystem implements LogSystem {
/** The output stream for dumping the log out on */
public static PrintStream out = System.out;
/**
* Log an error
*
* @param message
* The message describing the error
* @param e
* The exception causing the error
*/
public void error(String message, Throwable e) {
error(message);
error(e);
}
/**
* Log an error
*
* @param e
* The exception causing the error
*/
public void error(Throwable e) {
out.println(new Date() + " ERROR:" + e.getMessage());
e.printStackTrace(out);
}
/**
* Log an error
*
* @param message
* The message describing the error
*/
public void error(String message) {
out.println(new Date() + " ERROR:" + message);
}
/**
* Log a warning
*
* @param message
* The message describing the warning
*/
public void warn(String message) {
out.println(new Date() + " WARN:" + message);
}
/**
* Log an information message
*
* @param message
* The message describing the infomation
*/
public void info(String message) {
out.println(new Date() + " INFO:" + message);
}
/**
* Log a debug message
*
* @param message
* The message describing the debug
*/
public void debug(String message) {
out.println(new Date() + " DEBUG:" + message);
}
/**
* Log a warning with an exception that caused it
*
* @param message
* The message describing the warning
* @param e
* The cause of the warning
*/
public void warn(String message, Throwable e) {
warn(message);
e.printStackTrace(out);
}
}
| [
"robert.wilson1717@gmail.com"
] | robert.wilson1717@gmail.com |
ee5663a9712a1baed7f46d449f4a41497bf89de7 | 1ccc1a98266347c88a49c3d3a05c472413350b9d | /webapi-prototype-main/src/main/java/com/jurin_n/infrastructure/persistence/JPAPracticeRecordRepository.java | 6c32d560685660f9f81c7529bd8b3eda588372f4 | [] | no_license | jurin-n/webapi-prototype | a30cd5692e329279df9b2deb8740d4e3fc65fe24 | 913890fb71c74a516c27fbf68d379e3666a07364 | refs/heads/master | 2021-01-10T09:32:04.111618 | 2016-04-18T12:46:02 | 2016-04-18T12:46:02 | 49,761,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,671 | java | package com.jurin_n.infrastructure.persistence;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import com.jurin_n.domain.model.practice.plan.PracticePlan;
import com.jurin_n.domain.model.practice.record.PracticeRecord;
import com.jurin_n.domain.model.practice.record.PracticeRecordId;
import com.jurin_n.domain.model.practice.record.PracticeRecordRepository;
@Stateless
public class JPAPracticeRecordRepository implements PracticeRecordRepository {
@PersistenceContext
private EntityManager em;
public JPAPracticeRecordRepository(EntityManager em) {
setEntityManager(em);
}
public JPAPracticeRecordRepository() {
super();
}
public void setEntityManager(EntityManager em){
if(this.em != null){
Class<?> c = this.getClass();
throw new IllegalStateException(
"EntityManager instance 'em' is not null."
+ "This Method "+ c.getName() + ".setEntityManager"
+" is for Using Unit Test.");
}
this.em = em;
}
@Override
public void add(PracticeRecord aPracticeRecord) {
em.persist(aPracticeRecord);
}
@Override
public List<PracticeRecord> getAll() {
TypedQuery<PracticeRecord> query
= em.createNamedQuery("PracticeRecord.FIND_ALL",PracticeRecord.class);
return query.getResultList();
}
@Override
public PracticeRecordId nextIdentity() {
return new PracticeRecordId(
java.util.UUID.randomUUID().toString().toUpperCase()
);
}
@Override
public PracticeRecord getRecordById(PracticeRecordId practiceRecordId) {
return em.find(PracticeRecord.class,practiceRecordId);
}
}
| [
"jurin.nakano@gmail.com"
] | jurin.nakano@gmail.com |
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;
}
}
| [
"ntsluebbers@gmail.com"
] | ntsluebbers@gmail.com |
b7fd2817615ac86f0699f57c2e68be1c37d0bee2 | 0fe584cfa8328da62502a47aae25b41a425937f0 | /src/com/xsis/day1/Practice05.java | 6fac16be1dd1d135d7e68d4c574c9dc786ce7ae4 | [] | no_license | waway5/batch-219 | 5f131a04f56acc675f14732122767d0c1aefc797 | 985f6594424676a52c70031f5bb8489fcd851844 | refs/heads/master | 2020-08-27T01:03:16.265789 | 2019-10-24T03:38:24 | 2019-10-24T03:38:24 | 217,200,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 601 | java | package com.xsis.day1;
import java.util.Scanner;
public class Practice05 {
public static void main(String[] args) {
double literPerkilo, totalJarakTempuh, totalLiter;
Scanner scan = new Scanner(System.in);
System.out.print("Total Jarak Tempuh : ");
totalJarakTempuh = scan.nextDouble();
System.out.print("Total Bensin yang dipakai : ");
totalLiter = scan.nextDouble();
// calculate satu liter per kilo nya
literPerkilo = totalJarakTempuh / totalLiter;
System.out.println("Satu Liter per kilo : "+ literPerkilo);
}
}
| [
"muhammadjuwanda5@gmail.com"
] | muhammadjuwanda5@gmail.com |
04cc7bec370bf8b1893f5fdbdaf9147844371f0a | 6e8d2feb77880cd03356086b22eaf7f4b597113d | /AgentApp/Backend/src/main/java/rent/app/controller/ws/client/CarTransmissionClient.java | 7ce304db0bd976410c5dc86582727b1e80cd2f39 | [] | no_license | majakesin/XML-Tim-18 | b33a6f7d3aa1b8210075010fc6eeefe7ce35c797 | 1de9c6d28ca6e25b2432710b71572d944ab0aea0 | refs/heads/master | 2022-12-14T05:29:37.099758 | 2020-09-08T09:29:30 | 2020-09-08T09:29:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package rent.app.controller.ws.client;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;
import rent.app.controller.ws.generate.CarTransmissionRequest;
import rent.app.controller.ws.generate.SoapResponse;
import javax.xml.bind.JAXBElement;
public class CarTransmissionClient extends WebServiceGatewaySupport {
public SoapResponse handleCarTransmission(CarTransmissionRequest request){
try{
JAXBElement<SoapResponse> jax = (JAXBElement<SoapResponse>) getWebServiceTemplate()
.marshalSendAndReceive(request);
SoapResponse c = jax.getValue();
return c;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
| [
"ercegovacmarko@yahoo.com"
] | ercegovacmarko@yahoo.com |
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
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
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());
}
}
| [
"paucls@gmail.com"
] | paucls@gmail.com |
8296f1be8782da3a31c1de4232db93e88b1083ec | b100a617f36da70cc03a22086caa62efffb9b4e1 | /src/main/java/hu/adam/project_inventory/App.java | 8aed9bc5537f2916ee003c34e1433f7b08d56993 | [] | no_license | 593304/project-inventory | ecbba07d6fbc2a62673d9fc36991116d900a3c09 | 35cb436c5750dad7d3dd6c605cc18489913dc945 | refs/heads/master | 2020-03-15T16:00:59.866658 | 2018-08-04T09:07:58 | 2018-08-04T09:07:58 | 132,226,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 505 | java | package hu.adam.project_inventory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@SpringBootApplication
@EnableWebMvc
public class App extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
| [
"adam.593304@gmail.com"
] | adam.593304@gmail.com |
65ed08b88381d8f5e2e1a35d1564e201f0635fe9 | a560dfb092baaa4317c85f505ad21e55750e5638 | /hileco-drpc-http/src/test/java/com/hileco/drpc/http/HttpModuleDRPCTest.java | 3c44a376efcb341e761377fe353d4a5ab65cc1f0 | [] | no_license | rmoorman/hileco-drpc | ae1379c740863eaa07695d6c8de346704fcc9ed4 | bba1cf6f88e45af5319982fde6d638a2ddc1c2f7 | refs/heads/master | 2021-01-18T14:40:12.023500 | 2015-02-07T16:42:36 | 2015-02-07T16:42:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,273 | java | package com.hileco.drpc.http;
import com.hileco.drpc.core.spec.ServiceConnector;
import com.hileco.drpc.http.subscription.CacheSubscriptionStore;
import com.hileco.drpc.http.router.RouterServer;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
/**
* @author Philipp Gayret
*/
public class HttpModuleDRPCTest {
private static final Logger LOG = LoggerFactory.getLogger(HttpModuleDRPCTest.class);
public static final int DRPC_INTERVAL_MS = 100;
public static final int PORT_BASE_RANGE_SERVICES = 8300;
public static final int PORT_BASE_RANGE_CLIENTS = 8400;
public static final int PORT_ROUTER = 8500;
public static final String ROUTER_URL = "http://localhost:" + PORT_ROUTER;
public static final String HOST = "localhost";
public static interface SampleService {
public Integer calculate(Integer a, Integer b);
}
@Ignore
@Test
public void startAll() throws Exception {
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(100);
CacheSubscriptionStore subscriptionStore = new CacheSubscriptionStore();
RouterServer routerServer = new RouterServer(subscriptionStore);
routerServer.start(PORT_ROUTER);
LOG.info("Spawning services");
for (int index = 0; index < 10; index++) {
Client client = new Client(ROUTER_URL, HOST, PORT_BASE_RANGE_SERVICES + index);
client.publish(SampleService.class, Integer.toString(index), (a, b) -> a + b);
}
LOG.info("Spawning clients");
for (int index = 0; index < 1; index++) {
Client client = new Client(ROUTER_URL, HOST, PORT_BASE_RANGE_CLIENTS + index);
scheduler.scheduleAtFixedRate(() -> {
ServiceConnector<SampleService> connector = client.connector(SampleService.class);
connector.drpc(d -> d.calculate(1, 2), r -> LOG.info("Obtained a result: {}", r));
}, DRPC_INTERVAL_MS, DRPC_INTERVAL_MS, TimeUnit.MILLISECONDS);
}
LOG.info("Sleeping");
Thread.sleep(10000);
}
}
| [
"pgayret@gmail.com"
] | pgayret@gmail.com |
980332b2e8b084e9a27680ecf112ade18486a63d | e28cdc6e5e9fab4e313e115fbcab85da5b01d3e0 | /src/main/java/com/mballem/curso/boot/web/controller/FuncionarioController.java | ae2d76968df6f420ab39d655738ad7ac90f4cdfd | [] | no_license | arivaldonsilva/udemy-demo-mvc-ari2 | 4226cc9a0b768f6c49ff69391a1dd54c700d5c65 | 45eb068afb0a5b91119fd07daa3641d88062351c | refs/heads/master | 2020-05-17T05:40:16.673145 | 2019-04-25T19:14:00 | 2019-04-25T19:14:00 | 183,540,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,151 | java | package com.mballem.curso.boot.web.controller;
import java.time.LocalDate;
import java.util.List;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.convert.JodaTimeConverters.DateTimeToDateConverter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.mballem.curso.boot.domain.Cargo;
import com.mballem.curso.boot.domain.Funcionario;
import com.mballem.curso.boot.domain.UF;
import com.mballem.curso.boot.service.CargoService;
import com.mballem.curso.boot.service.FuncionarioService;
import com.mballem.curso.boot.web.validator.FuncionarioValidator;
@Controller
@RequestMapping("funcionarios")
public class FuncionarioController {
@Autowired
private FuncionarioService funcionarioService;
@Autowired
private CargoService cargoService;
@InitBinder
public void initBinder(WebDataBinder binder) {
binder.addValidators(new FuncionarioValidator());
}
@GetMapping("/cadastrar")
public String cadastrar(Funcionario funcionario) {
return "funcionario/cadastro";
}
@GetMapping("/listar")
public String listar(ModelMap model) {
model.addAttribute("funcionarios", funcionarioService.buscarTodos());
return "funcionario/lista";
}
@PostMapping("/salvar")
public String salvar(@Valid Funcionario funcionario, BindingResult results, RedirectAttributes attr) {
if(results.hasErrors()) {
return "funcionario/cadastro";
}
funcionarioService.salvar(funcionario);
attr.addFlashAttribute("success", "Funcionário salvo com sucesso");
return "redirect:/funcionarios/cadastrar";
}
@GetMapping("/editar/{id}")
public String preEditar(@PathVariable("id") Long id, ModelMap model) {
model.addAttribute("funcionario", funcionarioService.buscarPorId(id));
return "funcionario/cadastro";
}
@PostMapping("/editar")
public String editar(@Valid Funcionario funcionario, BindingResult results, RedirectAttributes attr) {
if(results.hasErrors()) {
return "funcionario/cadastro";
}
funcionarioService.editar(funcionario);
attr.addFlashAttribute("success", "Funcionário atualizado com sucesso!");
return "redirect:/funcionarios/cadastrar";
}
@GetMapping("/excluir/{id}")
public String excluir(@PathVariable("id") Long id, RedirectAttributes attr) {
funcionarioService.excluir(id);
attr.addFlashAttribute("success", "Funcionário excluído com sucesso!");
return "redirect:/funcionarios/listar";
}
@GetMapping("/buscar/nome")
public String getPorNome(@RequestParam("nome") String nome, ModelMap model) {
model.addAttribute("funcionarios", funcionarioService.buscarPorNome(nome));
return "funcionario/lista";
}
@GetMapping("/buscar/cargo")
public String getPorCargo(@RequestParam("cargo") Long cargo, ModelMap model) {
model.addAttribute("funcionarios", funcionarioService.buscarPorCargo(cargo));
return "funcionario/lista";
}
@GetMapping("/buscar/data")
public String getPorData(
@RequestParam("entrada") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate entrada,
@RequestParam("saida") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate saida,
ModelMap model) {
model.addAttribute("funcionarios", funcionarioService.buscarPorDatas(entrada, saida));
return "funcionario/lista";
}
@ModelAttribute("cargos")
public List<Cargo> getCargos(){
return cargoService.buscarTodos();
}
@ModelAttribute("ufs")
public UF[] getUFs(){
return UF.values();
}
}
| [
"arivaldon.silva@gmail.com"
] | arivaldon.silva@gmail.com |
9369ddc984edefd03eace97ec98bfac31505d370 | c647fd579a0be09b01c3e8cda61273be469c1244 | /devlibs/asmsources/org/objectweb/asm/Symbol.java | db0a9cfa60e802047e21971d6eeb23ac35d65c71 | [] | no_license | valoeghese/EnigmaRefactorTool | 28559cee6ddc8c808b7663a2a6180f3bd6f88a1d | f6132519b6a1b6008394f16ad0516d14cb9855d7 | refs/heads/master | 2020-12-13T14:39:20.412250 | 2020-01-23T08:36:31 | 2020-01-23T08:36:31 | 234,447,579 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,732 | java | //
// Decompiled by Procyon v0.5.36
//
package org.objectweb.asm;
abstract class Symbol
{
static final int CONSTANT_CLASS_TAG = 7;
static final int CONSTANT_FIELDREF_TAG = 9;
static final int CONSTANT_METHODREF_TAG = 10;
static final int CONSTANT_INTERFACE_METHODREF_TAG = 11;
static final int CONSTANT_STRING_TAG = 8;
static final int CONSTANT_INTEGER_TAG = 3;
static final int CONSTANT_FLOAT_TAG = 4;
static final int CONSTANT_LONG_TAG = 5;
static final int CONSTANT_DOUBLE_TAG = 6;
static final int CONSTANT_NAME_AND_TYPE_TAG = 12;
static final int CONSTANT_UTF8_TAG = 1;
static final int CONSTANT_METHOD_HANDLE_TAG = 15;
static final int CONSTANT_METHOD_TYPE_TAG = 16;
static final int CONSTANT_DYNAMIC_TAG = 17;
static final int CONSTANT_INVOKE_DYNAMIC_TAG = 18;
static final int CONSTANT_MODULE_TAG = 19;
static final int CONSTANT_PACKAGE_TAG = 20;
static final int BOOTSTRAP_METHOD_TAG = 64;
static final int TYPE_TAG = 128;
static final int UNINITIALIZED_TYPE_TAG = 129;
static final int MERGED_TYPE_TAG = 130;
final int index;
final int tag;
final String owner;
final String name;
final String value;
final long data;
int info;
Symbol(final int index, final int tag, final String owner, final String name, final String value, final long data) {
this.index = index;
this.tag = tag;
this.owner = owner;
this.name = name;
this.value = value;
this.data = data;
}
int getArgumentsAndReturnSizes() {
if (this.info == 0) {
this.info = Type.getArgumentsAndReturnSizes(this.value);
}
return this.info;
}
}
| [
"valoeghesemods@gmail.com"
] | valoeghesemods@gmail.com |
e995dc1a71e246bd15ed64104ef96f8c1298fcb1 | d352d1f57cfd741efd6559ecd4c5882d2dbd4f26 | /config-model/src/main/java/com/yahoo/vespa/model/content/storagecluster/PersistenceProducer.java | dabfbd4f75d4df2a7240ff78e1c93d5684c0125d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | hshukla/vespa | 69b154388bda4f374370883f8c50360a3ad55f0c | d618d1442bc1963de08e843ef14c49f12ae7e9d9 | refs/heads/master | 2020-05-18T09:48:45.357329 | 2019-04-30T22:17:59 | 2019-04-30T22:17:59 | 184,333,759 | 0 | 0 | Apache-2.0 | 2019-04-30T21:26:04 | 2019-04-30T21:26:04 | null | UTF-8 | Java | false | false | 1,815 | java | // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.content.storagecluster;
import com.yahoo.vespa.config.content.PersistenceConfig;
import com.yahoo.vespa.model.builder.xml.dom.ModelElement;
import com.yahoo.vespa.model.utils.Duration;
/**
* Serves engines config for storage clusters.
*/
public class PersistenceProducer implements PersistenceConfig.Producer {
public static class Builder {
public PersistenceProducer build(ModelElement element) {
ModelElement persistence = element.getChild("engine");
if (persistence == null) {
return new PersistenceProducer();
}
return new PersistenceProducer(
persistence.childAsBoolean("fail-partition-on-error"),
persistence.childAsDuration("recovery-time"),
persistence.childAsDuration("revert-time"));
}
}
Boolean failOnError;
Duration recoveryPeriod;
Duration revertTimePeriod;
public PersistenceProducer() {}
public PersistenceProducer(Boolean failOnError, Duration recoveryPeriod, Duration revertTimePeriod) {
this.failOnError = failOnError;
this.recoveryPeriod = recoveryPeriod;
this.revertTimePeriod = revertTimePeriod;
}
@Override
public void getConfig(PersistenceConfig.Builder builder) {
if (failOnError != null) {
builder.fail_partition_on_error(failOnError);
}
if (recoveryPeriod != null) {
builder.keep_remove_time_period((int)recoveryPeriod.getSeconds());
}
if (revertTimePeriod != null) {
builder.revert_time_period((int)revertTimePeriod.getSeconds());
}
}
}
| [
"bratseth@yahoo-inc.com"
] | bratseth@yahoo-inc.com |
bc0eea8dc87c56be792c93f3b03b9f44e9a02e90 | 24db43827d836550b76c5cbe11ec41edefc7ef74 | /org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java | b4d22e655f7c31aa55d0c116a291a7d6a0b8fc01 | [] | no_license | chengkande/javasrc | f8f0380f7a7fa0e0cde86da023f574413303be13 | 2adbcfc6dddafe0daf3f03143361557e620a0d9b | refs/heads/master | 2021-01-20T20:18:14.383584 | 2016-06-23T12:37:30 | 2016-06-23T12:37:30 | 61,803,806 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package org.omg.PortableInterceptor.ORBInitInfoPackage;
/**
* org/omg/PortableInterceptor/ORBInitInfoPackage/InvalidName.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
* Thursday, December 18, 2014 5:09:39 PM PST
*/
public final class InvalidName extends org.omg.CORBA.UserException
{
public InvalidName ()
{
super(InvalidNameHelper.id());
} // ctor
public InvalidName (String $reason)
{
super(InvalidNameHelper.id() + " " + $reason);
} // ctor
} // class InvalidName
| [
"chengkande@qq.com"
] | chengkande@qq.com |
c64eff9de87cf48edf85cc1d9f1b5e3f33e6b14b | baf90c1c17b165188676b9bb46f4eb66b85f20c9 | /app/src/main/java/com/example/siyeon/project/Levelup.java | aa60f6bbda4c8e4a00769e0151eac7cfdf6787ac | [] | no_license | ggongchi765/monster_scheduler | c77b7a88b452d04bfb5dab905ede53b91abd0916 | 5bedfc0567a2d07d2debe18bedd1c2de579788d5 | refs/heads/master | 2023-01-19T14:06:10.870157 | 2020-11-18T09:52:41 | 2020-11-18T09:52:41 | 313,889,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 511 | java | package com.example.siyeon.project;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
public class Levelup{
private Context context;
public Levelup(Context context)
{
this.context=context;
}
public void callFunction( ) {
final Dialog diglog = new Dialog(context);
diglog.requestWindowFeature(Window.FEATURE_NO_TITLE);
diglog.setContentView(R.layout.level_up);
diglog.show();
}
}
| [
"ggongchi765@gmail.com"
] | ggongchi765@gmail.com |
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;
}
}
| [
"hamed.zekri@gmail.com"
] | hamed.zekri@gmail.com |
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");
}
}
| [
"sifathasib@gmail.com"
] | sifathasib@gmail.com |
7e4022af15973f501f53f06abea35a314c81b94b | 9d0650df0c1216ad9e50a7b8dad85e0231c0ab6a | /PIII-master/FlyBook/src/backend/managers/FlightManager.java | 804ab36159a2d37ac707d30cae3799b37dcbc450 | [] | no_license | persa188/flybook | 41c93e5078e83f5a92898f5d0057b16339815287 | 32ec15e1226b897497c62f27db7a2865e660255b | refs/heads/master | 2020-06-02T07:54:18.323245 | 2016-09-15T00:07:14 | 2016-09-15T00:07:14 | 37,269,020 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,981 | java | /**
*
*/
package backend.managers;
import java.io.IOException;
import java.util.ArrayList;
import backend.exceptions.InvalidCSVFormatException;
import backend.exceptions.NoSuchEntryException;
/**
* A manager of Flights.
* Stores Flights.
* Can upload Flights from csv (same format as handout).
* Can also output a csv file (same format as handout).
* This class is a singleton.
* @author xiaxiuqi
*
*/
public class FlightManager extends Manager<String, FlightInfo> {
/**
* The actual singleton instance. We create this as soon as the app
* starts up because we will need this for sure, so we might as well
* create it.
*/
private static final FlightManager instance = new FlightManager();
// private static int NUMBERINDEX = 0;
// private static int DEPARTINDEX = 1;
// private static int ARRIVEINDEX = 2;
// private static int AIRLINEINDEX = 3;
// private static int ORIGININDEX = 4;
// private static int DESTINDEX = 5;
// private static int PRICEINDEX = 6;
/** The name of this database for exception messages **/
private final String DBNAME = "FlightDB";
/**
* Retrieve the one and only instance of FlightDB
* @return The only instance of FlightDB
*/
public static FlightManager getInstance() {
return instance;
}
/**
* Creates a new empty FlightDB
*/
private FlightManager() {
super();
}
// /**
// * Creates a new flightDB by loading the data from the specified path
// * @param path The path of the csv file to load data from.
// * The file must be formatted according to the specifications in the
// * Phase 2 handout.
// * @throws IOException Error in reading the CSV file
// */
// private FlightDB(String path) throws IOException{
// // First make an empty instance and set it to be the only instance
// this();
// // Load data into it
// load(path);
// }
/* (non-Javadoc)
* @see backend.Database#parseLine(java.lang.String)
*/
@Override
public FlightInfo parseLine(String line)
throws InvalidCSVFormatException {
// // Split the line into comma-delimited tokens
// String [] tokens = line.split(",");
//
// // Create a new Flight with the required information
// FlightInfo newFlight;
// try {
// newFlight = new FlightInfo(
// tokens[NUMBERINDEX],
// tokens[DEPARTINDEX],
// tokens[ARRIVEINDEX],
// tokens[AIRLINEINDEX],
// tokens[ORIGININDEX],
// tokens[DESTINDEX],
// Integer.parseInt(tokens[PRICEINDEX]));
// } catch (ArrayIndexOutOfBoundsException e) {
// // If the the indices are out of bounds the csv line is probably
// // not formatted correctly
// throw new InvalidCSVFormatException(DBNAME);
// }
/*
* Design note: For FlightDB, I put the parsing code in the constructor
* for FlightInfo so that BookingsDB can also access the same parsing
* code. This is a compromise solution betwen two options:
* 1) Put all the parsing code in all the DatabaseEntries
* Problem: There is no way to specify a constructor in interfaces
* If we made it a method instead, we would need an instance
* of a DatabaseEntry just to be able to call the parseLine
* method from it. It's also not possible to make an interface
* specify a static method
* 2) Put all the parsing code in all the subclasses of Database
* Problem: One database cannot access the parsing method in another
* because it would require an instance of the other database.
* it's also not possible to make an abstract static method
* in the Database parent class
*/
try {
return new FlightInfo(line);
}
catch(InvalidCSVFormatException e) {
// re-throw the exception with the name of this database
throw new InvalidCSVFormatException(DBNAME);
}
}
/**
* This method will be used by Daniel's Search
* to get data from this FlightDB as an ArrayList
* @return All the flights in the database as an ArrayList of Flights
*/
public ArrayList<FlightInfo> getAllFlights(){
// Add all the values in the records map to a new ArrayList
ArrayList<FlightInfo> allFlights = new ArrayList<FlightInfo>();
for(FlightInfo f: dataTable.values()) {
// Make a new copy of each flight as we add them to the list
allFlights.add(new FlightInfo(f));
}
// Safe to return since everything is a copy, not the original
return allFlights;
}
/**
* Updates a flights info
* @param key
* @param updatedEntry
* @throws NoSuchEntryException if no flight with that key exists
*/
public void setFlight(String key, FlightInfo updatedEntry) throws NoSuchEntryException{
setEntry(key, new FlightInfo(updatedEntry));
}
}
| [
"dev.persaud@mail.utoronto.ca"
] | dev.persaud@mail.utoronto.ca |
31c81d8d381045cff050e4e5b070e780d49caeea | 1f32d84bbcad4f6ee4555a5c911fece8fcc61fe1 | /src/main/java/com/edao/codes/patterns/iterator/t3/PancakeHouseMenuIterator.java | 55f02618547691d1a9d06ec27c97b07062e89bef | [] | no_license | elevendao/jdao | 13c946ed0641c67a5e7364dbc06388e2bff11dd4 | ca3dce2e4786ae6ff92df933b2f6a5a594fb4831 | refs/heads/master | 2021-01-18T13:03:19.815552 | 2017-03-09T13:36:28 | 2017-03-09T13:36:28 | 84,333,741 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,167 | java | /**
* 版权所有:elevendao
* 项目名称:demo
* 创建者: Leo
* 创建日期: 2015年10月5日
* 文件说明:
* 最近修改者:Leo
* 最近修改日期:2015年10月5日
*/
package com.edao.codes.patterns.iterator.t3;
import java.util.ArrayList;
import java.util.Iterator;
/**
* @author Leo
*
*/
public class PancakeHouseMenuIterator implements Iterator {
ArrayList items;
int position = 0;
/**
*
*/
public PancakeHouseMenuIterator(ArrayList items) {
this.items = items;
}
/* (non-Javadoc)
* @see com.edao.codes.patterns.iterator.t2.Iterator#hasNext()
*/
@Override
public boolean hasNext() {
if (position<items.size()) {
return true;
}
return false;
}
/* (non-Javadoc)
* @see com.edao.codes.patterns.iterator.t2.Iterator#next()
*/
@Override
public Object next() {
Object obj = items.get(position);
position = position + 1;
return obj;
}
/* (non-Javadoc)
* @see java.util.Iterator#remove()
*/
@Override
public void remove() {
if (position <= 0) {
throw new IllegalStateException("You can't remove an item until you've done at least one next()");
}
items.remove(position);
}
}
| [
"liushuai2005@gmail.com"
] | liushuai2005@gmail.com |
0f99927e78fc2561a563442fc63626a0c164447c | 76da3da7fccba7cff538e469c9f238a6e6ed0359 | /src/com/calculator/expressionsolver/Tan.java | f7e1cbfb9e44d37045273e43f5304e5747591818 | [] | no_license | sumit1511/ExpressionSolver | ad2ba0ddade6b4a53c7b2b054039f47bf4b3cc77 | ce4cdfe3b7870002a38869370d1611c4e4330778 | refs/heads/master | 2021-01-14T16:53:55.197496 | 2020-02-25T05:40:45 | 2020-02-25T05:40:45 | 242,686,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 291 | java | package com.calculator.expressionsolver;
public class Tan extends MainSolver {
public Tan()
{
super();
}
public double expressionEvaluate(int signed,double ...exp1)
{
// Math.tan(Math.toRadians(exp1[0]));
return signed*Math.tan(exp1[0]);
}
}
| [
"SumitKumarBangar@corp.fairisaac.com"
] | SumitKumarBangar@corp.fairisaac.com |
b120c1a719b71a48001ead55b81c582311c95dd8 | 2bc2eadc9b0f70d6d1286ef474902466988a880f | /branches/mule-3-lifecycle/tests/integration/src/test/java/org/mule/module/xml/functional/JXPathExpressionTestCase.java | dbacdc477fc4f942fab5c4112f84d307d2928fa9 | [] | no_license | OrgSmells/codehaus-mule-git | 085434a4b7781a5def2b9b4e37396081eaeba394 | f8584627c7acb13efdf3276396015439ea6a0721 | refs/heads/master | 2022-12-24T07:33:30.190368 | 2020-02-27T19:10:29 | 2020-02-27T19:10:29 | 243,593,543 | 0 | 0 | null | 2022-12-15T23:30:00 | 2020-02-27T18:56:48 | null | UTF-8 | Java | false | false | 1,298 | java | /*
* $Id$
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.module.xml.functional;
import java.text.MessageFormat;
import java.util.Properties;
public class JXPathExpressionTestCase extends AbstractXmlPropertyExtractorTestCase
{
public static final String MESSAGE = "<endpoint>{0}</endpoint>";
public JXPathExpressionTestCase()
{
super(true);
}
protected Properties getStartUpProperties()
{
Properties p = new Properties();
p.setProperty("selector.expression", "/endpoint");
p.setProperty("selector.evaluator", "jxpath");
return p;
}
protected Object getMatchMessage() throws Exception
{
return documentFor("matchingEndpoint1");
}
protected Object getErrorMessage() throws Exception
{
return documentFor("missingEndpoint");
}
protected String documentFor(String name) throws Exception
{
return MessageFormat.format(MESSAGE, name);
}
}
| [
"rossmason@bf997673-6b11-0410-b953-e057580c5b09"
] | rossmason@bf997673-6b11-0410-b953-e057580c5b09 |
9806e19e8c1536a6d9f119f8dd2942513cabbfc7 | deb7fe94bf3ea0bbddcdb7ccec60522d23ae5a78 | /src/main/java/question/Ch08_Recursion_and_Dynamic_Programming/Q8_12_Eight_Queens/Question.java | 2220b0f4505f2259f6fc612e3ca3790752ffa2e6 | [] | no_license | jadefromkorea/algorithm | 86757905ca760269d0643d618996b182fe447d46 | 51a4e3d1414d5811ef23ab4be7a1601df0f1e47c | refs/heads/master | 2022-12-28T19:14:22.172849 | 2020-10-18T08:53:22 | 2020-10-18T08:53:22 | 305,060,062 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,749 | java | package question.Ch08_Recursion_and_Dynamic_Programming.Q8_12_Eight_Queens;
import java.util.ArrayList;
public class Question {
public static int GRID_SIZE = 8;
/* Check if (row1, column1) is a valid spot for a queen by checking if there
* is a queen in the same column or diagonal. We don't need to check it for queens
* in the same row because the calling placeQueen only attempts to place one queen at
* a time. We know this row is empty.
*/
public static boolean checkValid(Integer[] columns, int row1, int column1) {
for (int row2 = 0; row2 < row1; row2++) {
int column2 = columns[row2];
/* Check if (row2, column2) invalidates (row1, column1) as a queen spot. */
/* Check if rows have a queen in the same column */
if (column1 == column2) {
return false;
}
/* Check diagonals: if the distance between the columns equals the distance
* between the rows, then they’re in the same diagonal. */
int columnDistance = Math.abs(column2 - column1);
int rowDistance = row1 - row2; // row1 > row2, so no need to use absolute value
if (columnDistance == rowDistance) {
return false;
}
}
return true;
}
public static void placeQueens(int row, Integer[] columns, ArrayList<Integer[]> results) {
if (row == GRID_SIZE) { // Found valid placement
results.add(columns.clone());
} else {
for (int col = 0; col < GRID_SIZE; col++) {
if (checkValid(columns, row, col)) {
columns[row] = col; // Place queen
placeQueens(row + 1, columns, results);
}
}
}
}
public static void clear(Integer[] columns) {
for (int i = 0; i < GRID_SIZE; i++) {
columns[i] = -1;
}
}
public static void printBoard(Integer[] columns) {
drawLine();
for(int i = 0; i < GRID_SIZE; i++){
System.out.print("|");
for (int j = 0; j < GRID_SIZE; j++){
if (columns[i] == j) {
System.out.print("Q|");
} else {
System.out.print(" |");
}
}
System.out.print("\n");
drawLine();
}
System.out.println("");
}
private static void drawLine() {
StringBuilder line = new StringBuilder();
for (int i=0;i<GRID_SIZE*2+1;i++)
line.append('-');
System.out.println(line.toString());
}
public static void printBoards(ArrayList<Integer[]> boards) {
for (int i = 0; i < boards.size(); i++) {
Integer[] board = boards.get(i);
printBoard(board);
}
}
public static void main(String[] args) {
ArrayList<Integer[]> results = new ArrayList<Integer[]>();
Integer[] columns = new Integer[GRID_SIZE];
clear(columns);
placeQueens(0, columns, results);
printBoards(results);
System.out.println(results.size());
}
}
| [
"jadefromkorea@gmail.com"
] | jadefromkorea@gmail.com |
766a589226d8c17676feca4256505c4583257f94 | d2824524d2ab11d34ea7e940a6a9525762721590 | /AutoOntologyGen/src/main/java/sap/corp/emea/Sparql_Test.java | 287310f1df8b536ef57b4f48fd45b826bf079d62 | [] | no_license | badarinath-katti/SAP-DFKI | 1b5382910057c769907cc855f1385a8d12e003c6 | 3ce311132981615ed2e4e876d8e3145b2586559d | refs/heads/master | 2021-05-18T05:24:07.245423 | 2020-03-29T21:07:04 | 2020-03-29T21:07:04 | 251,130,722 | 0 | 0 | null | 2020-03-29T20:53:51 | 2020-03-29T20:45:30 | C# | UTF-8 | Java | false | false | 4,451 | java | package sap.corp.emea;
import java.io.InputStream;
import org.apache.jena.ontology.OntModel;
import org.apache.jena.query.Query;
import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.query.QueryFactory;
import org.apache.jena.query.QuerySolution;
import org.apache.jena.query.ResultSet;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.util.FileManager;
public class Sparql_Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
Model model = ModelFactory.createDefaultModel();
InputStream in = FileManager.get().open("sp.owl");
model.read( in, "RDF/XML");
OntModel ontModel = ModelFactory.createOntologyModel();
in = FileManager.get().open("sp.owl");
in = FileManager.get().open("RescomInformationModel.owl");
ontModel.read( in, "RDF/XML");
String QueryString1 = "PREFIX : <http://emea.global.corp.sap/rescom#> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "+
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>"+
"SELECT ?PressInstance ((abs(?Press_XCoOrdValue - ?LowerShellWarehouse_XCoOrdValue))"+
"+(abs(?Press_XCoOrdValue - ?UpperShellWarehouse_XCoOrdValue)) +(abs(?Press_XCoOrdValue - ?CircuitBoardWarehouse_XCoOrdValue))"+
"+(abs(?Press_XCoOrdValue - ?IndustrialCamera_XCoOrdValue))+(abs(?Press_XCoOrdValue - ?RFIDReader_XCoOrdValue)) as ?CumulativeDistance)"+
"WHERE{ ?LowerShellWarehouseInstance :hasPositionX ?XCoOrdInst_LS; rdf:type :rescom_resources_LowerShellProvider. ?XCoOrdInst_LS :Value ?LowerShellWarehouse_XCoOrdValue."+
"?UpperShellWarehouseInstance :hasPositionX ?XCoOrdInst_US; rdf:type :rescom_resources_UpperShellProvider. ?XCoOrdInst_US :Value ?UpperShellWarehouse_XCoOrdValue."+
"?CircuitBoardWarehouseInstance :hasPositionX ?XCoOrdInst_CB; rdf:type :rescom_resources_CircuitBoardProvider. ?XCoOrdInst_CB :Value ?CircuitBoardWarehouse_XCoOrdValue."+
"?IndustrialCameraInstance :hasPositionX ?XCoOrdInst_Camera; rdf:type :rescom_resources_IndustrialCamera. ?XCoOrdInst_Camera :Value ?IndustrialCamera_XCoOrdValue."+
"?RFIDReaderInstance :hasPositionX ?XCoOrdInst_RFIDReader; rdf:type :rescom_resources_RFIDReader. ?XCoOrdInst_RFIDReader :Value ?RFIDReader_XCoOrdValue."+
"{ SELECT ?PressInstance ?Press_XCoOrdValue WHERE{ ?PressInstance :hasPositionX ?XCoOrdInst_Press; rdf:type :rescom_capability_abstracts_Assembler. ?XCoOrdInst_Press :Value ?Press_XCoOrdValue.} } }"+
"order by asc(?CumulativeDistance) limit 1";
String queryStr = "PREFIX : <http://www.semanticweb.org/d065085/ontologies/2018/9/untitled-ontology-81#> "+
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> "+
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "+
"SELECT ?PressInstance ((abs(?Press_XCoOrdValue - ?LowerShellWarehouse_XCoOrdValue)) "+
"+(abs(?Press_XCoOrdValue - ?UpperShellWarehouse_XCoOrdValue)) +(abs(?Press_XCoOrdValue - ?CircuitBoardWarehouse_XCoOrdValue))"+
"+(abs(?Press_XCoOrdValue - ?IndustrialCamera_XCoOrdValue))+(abs(?Press_XCoOrdValue - ?RFIDReader_XCoOrdValue)) as ?CumulativeDistance)"+
"WHERE{ ?LowerShellWarehouseInstance :xCoOrd ?LowerShellWarehouse_XCoOrdValue; rdf:type :LowerShellWarehouse."+
"?UpperShellWarehouseInstance :xCoOrd ?UpperShellWarehouse_XCoOrdValue; rdf:type :UpperShellWarehouse."+
"?CircuitBoardWarehouseInstance :xCoOrd ?CircuitBoardWarehouse_XCoOrdValue; rdf:type :CircuitBoardWareHouse."+
"?IndustrialCameraInstance :xCoOrd ?IndustrialCamera_XCoOrdValue; rdf:type :Camera."+
"?RFIDReaderInstance :xCoOrd ?RFIDReader_XCoOrdValue; rdf:type :RFIDReader."+
"{SELECT ?PressInstance ?Press_XCoOrdValue WHERE{ ?PressInstance :xCoOrd ?Press_XCoOrdValue;rdf:type :PressMachine.}}}"+
"ORDER BY asc(?CumulativeDistance) limit 3";
Query query = QueryFactory.create(QueryString1);
QueryExecution queryExec = QueryExecutionFactory.create(QueryString1, ontModel);
try{
ResultSet results = queryExec.execSelect();
while(results.hasNext()){
QuerySolution solution = results.next();
System.out.println(solution.toString());
System.out.println(solution.getResource("?PressInstance"));
}
}
finally{
}
}
}
| [
"badarinath.katti@sap.com"
] | badarinath.katti@sap.com |
d392f43f5c847ff838a0f2020472ece8abed1472 | a189b77d72f0bcbd26eee27d31ad71202ab3d5ee | /CoinChange.java | acbcbe5aff853670aefdc4eb55f9ba2f603088eb | [] | no_license | bahuljain/Leet-Code | e21f67bb4db9e457a79e3b411dc59c55c1b15d6c | 04777d690a962d0ad6f4bcc368f9f5da6eb44523 | refs/heads/master | 2016-08-12T01:59:16.687140 | 2016-01-31T15:05:53 | 2016-01-31T15:05:53 | 45,647,651 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 591 | java | public class Solution {
public int coinChange(int[] coins, int amount) {
if (amount <= 0) return 0;
if (coins.length == 0) return -1;
int[] min = new int[amount + 1]; min[0] = 0;
for(int i = 1; i <= amount; i++) {
int m = Integer.MAX_VALUE;
for(int j = coins.length - 1; j >= 0; j--) {
int coin = coins[j];
if(i - coin < 0 || min[i - coin] == -1) {
continue;
} else {
m = Math.min(m, 1 + min[i-coin]);
}
}
min[i] = (m == Integer.MAX_VALUE) ? -1 : m;
}
return min[amount];
}
}
| [
"bkj2111@columbia.edu"
] | bkj2111@columbia.edu |
38c9f806d8b080e3569691ed5b184084ce3cf25a | 8f362e22b0bd0a3e1294df90e13791c6bceb1bef | /src/uk/dangrew/dinosaurs/game/actions/movement/Movement.java | ec811e7471d21f0f47d71f9f5bdae0c3ef268591 | [
"Apache-2.0"
] | permissive | DanGrew/Dinosaurs | 829d1fd6371b617f3a58356d8aab10fb9e141650 | e21ff4519ed97ae85bf2c4845150e591525d9d1e | refs/heads/main | 2023-02-24T20:39:23.880864 | 2021-01-25T17:56:07 | 2021-01-25T17:56:07 | 328,762,490 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java |
package uk.dangrew.dinosaurs.game.actions.movement;
import java.util.function.BiFunction;
import uk.dangrew.dinosaurs.game.world.World;
import uk.dangrew.dinosaurs.game.world.WorldLocation;
/**
* Types of movement permitted by the player.
*/
public enum Movement {
UP(
"Up",
(l, w) -> l.translate(0, -1, w)
),
RIGHT(
"Right",
(l, w) -> l.translate(1, 0, w)
),
DOWN(
"Down",
(l, w) -> l.translate(0, 1, w)
),
LEFT(
"Left",
(l, w) -> l.translate(-1, 0, w)
);
private final String displayName;
private final BiFunction<WorldLocation, World, WorldLocation> rawMoverFunction;
private Movement(String displayName, BiFunction<WorldLocation, World, WorldLocation> rawMoverFunction) {
this.displayName = displayName;
this.rawMoverFunction = rawMoverFunction;
}
public WorldLocation move(WorldLocation worldLocation, World world) {
return rawMoverFunction.apply(worldLocation, world);
}
public String displayName() {
return displayName;
}
}
| [
"danielanthonygrew@gmail.com"
] | danielanthonygrew@gmail.com |
8758043c30d109c1fb82d9a83060dc3e9dd031fe | 6decdca2dad070710376fe62aaf83eb0dec92482 | /collection/src/cn/dan/util/Iterator.java | 82e79ff1b723f11b79d97f19fb0616f475dab296 | [] | no_license | JaneDan/practice | 5941b7db6866d0a9a293e48198d5a26f99e5bde8 | 1a64daed34c36776093863c88c6b5be6f1456cec | refs/heads/master | 2016-08-12T20:31:18.037405 | 2015-12-02T12:49:31 | 2015-12-02T12:49:31 | 47,067,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 113 | java | package cn.dan.util;
public interface Iterator<E> {
boolean hasNext();
E next();
void remove();
}
| [
"lnpu_sunzj@163.com"
] | lnpu_sunzj@163.com |
05e53c43c76321184d30805ec4495cc5df254f1e | eb6b020ed9520a7a875b8c581254ba62e03033ce | /app/src/main/java/com/example/android/mapvoyage/MainActivity.java | 1dbc4eef5de4f65d9f56f7af149699d1c0dfa391 | [] | no_license | edashota426/MapVoyage | fe23373d6c061805e986a3e2192db8e6e288c7af | 7af553480875a97ed7043610bf2fa526b4fa3212 | refs/heads/master | 2021-08-08T22:38:26.051991 | 2017-11-11T14:05:12 | 2017-11-11T14:05:12 | 110,350,123 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,212 | java | package com.example.android.mapvoyage;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void showMap1 (View v) {
Uri geoLocation = Uri.parse("google.streetview:cbll=47.6267071,-122.2424512");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("com.google.android.apps.maps");
intent.setData(geoLocation);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
public void showMap2 (View v) {
Uri geoLocation = Uri.parse("google.streetview:cbll=37.4351932,-122.1404567");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("com.google.android.apps.maps");
intent.setData(geoLocation);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
}
}
| [
"edashota426@gmail.com"
] | edashota426@gmail.com |
c0233b1fec7cbaa603046023197d0ed6b2fba7e0 | 447520f40e82a060368a0802a391697bc00be96f | /apks/banking_set2/com.advantage.RaiffeisenBank/source/com/thinkdesquared/banking/helpers/ui/IPagingBaseAdapter.java | afad914149a57c2e909a99ae141ec4a1d205aab9 | [
"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 | 297 | java | package com.thinkdesquared.banking.helpers.ui;
import java.util.List;
public abstract interface IPagingBaseAdapter<T>
{
public abstract void addMoreItems(int paramInt, List<T> paramList);
public abstract void addMoreItems(List<T> paramList);
public abstract void removeAllItems();
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
9ad511bc73bfd9ac28dd3c58ea53d94441ab5c47 | 0aece160ed556c1b97bfd2638bc99634fd35744d | /Spring-Data-JPA/src/main/java/br/com/fiap/springdatajpa/dto/customer/PhoneDTO.java | 1777797f9ed9e5c058168c3d4168f57ae4983c23 | [] | no_license | ronaldoleitte1975/trabalho-final-persistencia-34scj | b8caef468a127beb0a1e69eb9fd31657af58668a | 39b79113911cd86e133073ffd814d0b374f4d5d8 | refs/heads/master | 2022-07-09T14:02:47.041160 | 2019-07-07T19:06:56 | 2019-07-07T19:06:56 | 194,278,134 | 0 | 6 | null | 2022-06-21T01:21:51 | 2019-06-28T13:25:47 | Java | UTF-8 | Java | false | false | 349 | java | package br.com.fiap.springdatajpa.dto.customer;
public class PhoneDTO {
public PhoneDTO() {
}
public PhoneDTO(String number) {
this.number = number;
}
private String number;
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
}
| [
"you@example.com"
] | you@example.com |
65bd1ad1f2b68a5ac2957fafac6fe7a84424eb42 | 4d39e1bc34193629f7222f2cc03b6926eee9332b | /AppPilotoJ2ee6/src/br/com/topsys/dao/TipoClienteDAO.java | 987e571a189b990eef32a1cea026c86ba6e15bb0 | [] | no_license | topazio/AppPilotoJ2ee6 | ed8daa047f7c2caacb71592dcfe5b7fec1d1b859 | 0015ca5ece6f0445665a7f662e35bd21eb428224 | refs/heads/master | 2021-01-18T15:23:44.304938 | 2011-12-05T00:36:10 | 2011-12-05T00:36:10 | 2,910,394 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 656 | java | package br.com.topsys.dao;
import java.util.ArrayList;
import java.util.List;
import br.com.topsys.database.TSDataBaseBrokerIf;
import br.com.topsys.database.factory.TSDataBaseBrokerFactory;
import br.com.topsys.model.TipoClienteModel;
public class TipoClienteDAO {
@SuppressWarnings("unchecked")
public List<TipoClienteModel> pesquisarTodos() {
//TSDataBaseBrokerIf broker = TSDataBaseBrokerFactory.getDataBaseBrokerIf();
// broker.setPropertySQL("tipoclientedao.pesquisarTodos");
//return broker.getCollectionBean(TipoClienteModel.class,"id","descricao");
return new ArrayList<TipoClienteModel>();
}
}
| [
"andre.topazio@gmail.com"
] | andre.topazio@gmail.com |
bce42eb5009a0007c914333bf94b758008a669ca | a40dad4afecd0db0b4dadbfeb01fdb707b7013d5 | /src/main/java/mvc/controller/TestController.java | fa149f2ea2a0143afeb19e48f499ca17750faa3a | [] | no_license | seawaylee/SpringInAction4th | 374a27195ba772bb141d8c3d83c6868ef5970f8d | 3e9976efc8a2da78eed0ee8720027e0029af153b | refs/heads/master | 2021-01-11T20:27:21.164509 | 2017-04-11T11:52:13 | 2017-04-11T11:52:13 | 79,118,729 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,713 | java | package mvc.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.json.JsonObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Map;
/**
* @author NikoBelic
* @create 2017/3/29 21:54
*/
@Controller
@RequestMapping(value = "/mvc")
public class TestController
{
/**
* 测试启动
*
* @Author SeawayLee
* @Date 2017/03/29 22:08
*/
@ResponseBody
@RequestMapping(value = "/")
public Object helloMVC(HttpServletRequest request, HttpServletResponse response)
{
return "Let's Go";
}
/**
* 测试Content-Type
*
* @Author SeawayLee
* @Date 2017/03/29 22:24
*/
@ResponseBody
@RequestMapping(value = "/testContentType", consumes = "text/html;charset=utf-8", produces = "application/json;charset=utf-8", params = {"patientId"}, headers = {"ABC"})
public Object testContentType(HttpServletRequest request, HttpServletResponse response, String patientId)
{
return patientId + "\n" + request.getContentType();
}
/**
* 这种参数接收方式,实质上是UrlParam
* UrlParam一定会导致中文乱码,除非客户端手动将中文URLEncode
*
* @Author SeawayLee
* @Date 2017/03/29 22:49
*/
@ResponseBody
@RequestMapping(value = "/getJson1", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
public Object getJson1(HttpServletRequest request, HttpServletResponse response, String patientId, String patientName) throws UnsupportedEncodingException
{
System.out.println(patientName);
return new Patient(patientId, patientName);
}
/**
* @ReuqestBody 指明被注解的参数是请求的body,可以是一个json结构,只要双方字符集统一,不会出现中文乱码
* @Author SeawayLee
* @Date 2017/03/29 23:14
*/
@ResponseBody
@RequestMapping(value = "/getJson2", method = RequestMethod.POST, produces = "application/json")
public Object getJson2(HttpServletRequest request, @RequestBody JSONObject patientJson) throws UnsupportedEncodingException
{
System.out.println(patientJson);
return patientJson;
}
/**
* 和上面一样
* @Author SeawayLee
* @Date 2017/03/29 23:16
*/
@ResponseBody
@RequestMapping(value = "/getJson3", method = RequestMethod.POST, produces = "application/json")
public Object getJson3(HttpServletRequest request, @RequestBody Map<String, String> params) throws UnsupportedEncodingException
{
System.out.println(params);
return params;
}
/**
* 如果请求参数中既有json,又有独立的参数,客户端需要将数据以表单的形式提交
* @Author SeawayLee
* @Date 2017/03/29 23:36
*/
@ResponseBody
@RequestMapping(value = "/getJson4", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
public Object getJson4(HttpServletRequest request, @RequestParam(required = true) String patientJson,@RequestParam(required = false) String city) throws UnsupportedEncodingException
{
System.out.println(patientJson);
System.out.println(city);
return patientJson;
}
/**
* 同上
* @Author SeawayLee
* @Date 2017/03/29 23:40
*/
@ResponseBody
@RequestMapping(value = "/getJson5", method = RequestMethod.POST, produces = "application/json;charset=utf-8")
public Object getJson5(HttpServletRequest request) throws UnsupportedEncodingException
{
String patientJson = request.getParameter("patientJson");
String city = request.getParameter("city");
System.out.println(patientJson);
System.out.println(city);
return patientJson;
}
class Patient implements Serializable
{
private String patientId;
private String patientName;
public Patient(String patientId, String patientName) {
this.patientId = patientId;
this.patientName = patientName;
}
public String getPatientId() {
return patientId;
}
public void setPatientId(String patientId) {
this.patientId = patientId;
}
public String getPatientName() {
return patientName;
}
public void setPatientName(String patientName) {
this.patientName = patientName;
}
}
}
| [
"511958060@qq.com"
] | 511958060@qq.com |
3be4620524925d15c07f8ba6e14ce61c0648c975 | 5e231c2ecfea4e7303b360bbfbf5d60da5862f7b | /Printing numbers in inverse right angle triangle/Main.java | 21102cb447b4096c8bee5eae6d8fd20ed8cbc69a | [] | no_license | Manali-006/Playground | a1fb35f394f423cd546e9dcb090ee5cf5bbf81d7 | 399845f23a3c7ed8835634c2ae4dd9d0717430a2 | refs/heads/master | 2020-05-18T19:11:57.550526 | 2019-08-03T05:24:54 | 2019-08-03T05:24:54 | 184,603,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 485 | java | import java.util.Scanner;
class Main{
public static void main (String[] args){
// Type your code here
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int val = n;
for(int curr_row = 1; curr_row <= n; curr_row++)
{
// Handle numbers for each row
for(int curr_col = val; curr_col >= 1; curr_col--)
{
System.out.print(curr_col);
}
val--;
System.out.println();
}
}
} | [
"50208565+Manali-006@users.noreply.github.com"
] | 50208565+Manali-006@users.noreply.github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.