blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
131 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
9.45M
extension
stringclasses
32 values
content
stringlengths
3
9.45M
authors
listlengths
1
1
author_id
stringlengths
0
313
eba1a5b34ba4b8cf81f081cde636e3f2e5d47f20
62ae7ebff4d19c1464cce84bd68073a0b84cdbb9
/src/main/java/gov/lanl/micot/application/rdt/algorithm/ep/mip/assignment/scenario/ScenarioLineInUseAssignmentFactory.java
ca6a4886aea079b9e8e6919d50a7dfee17f00bcf
[ "BSD-2-Clause" ]
permissive
bluejuniper/micot
9bf14153eac5f940906ac55ab7110f64008f0e01
7c505ed98c77f0ce798ff2803a65f1ca307f0fef
refs/heads/master
2020-04-03T23:10:48.991302
2018-10-30T20:42:25
2018-10-30T20:42:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,912
java
package gov.lanl.micot.application.rdt.algorithm.ep.mip.assignment.scenario; import java.util.Collection; import gov.lanl.micot.infrastructure.ep.model.ElectricPowerFlowConnection; import gov.lanl.micot.infrastructure.ep.model.ElectricPowerModel; import gov.lanl.micot.infrastructure.ep.model.ElectricPowerNode; import gov.lanl.micot.infrastructure.model.Scenario; import gov.lanl.micot.infrastructure.model.ScenarioAttribute; import gov.lanl.micot.infrastructure.optimize.mathprogram.assignment.ScenarioAssignmentFactory; import gov.lanl.micot.application.rdt.algorithm.AlgorithmConstants; import gov.lanl.micot.application.rdt.algorithm.ep.mip.variable.scenario.ScenarioLineUseVariableFactory; import gov.lanl.micot.application.rdt.algorithm.ep.mip.variable.scenario.ScenarioSwitchVariableFactory; import gov.lanl.micot.application.rdt.algorithm.ep.mip.variable.scenario.ScenarioVariableFactoryUtility; import gov.lanl.micot.util.math.solver.Solution; import gov.lanl.micot.util.math.solver.Variable; import gov.lanl.micot.util.math.solver.exception.NoVariableException; import gov.lanl.micot.util.math.solver.exception.VariableExistsException; import gov.lanl.micot.util.math.solver.mathprogram.MathematicalProgram; /** * Assignments for whether or not a line is used * * @author Russell Bent */ public class ScenarioLineInUseAssignmentFactory extends ScenarioAssignmentFactory<ElectricPowerNode, ElectricPowerModel> { /** * Constructor * * @param numberOfIncrements * @param incrementSize */ public ScenarioLineInUseAssignmentFactory(Collection<Scenario> scenarios) { super(scenarios); } @Override public void performAssignment(ElectricPowerModel model, MathematicalProgram problem, Solution solution) throws VariableExistsException, NoVariableException { ScenarioLineUseVariableFactory variableFactory = new ScenarioLineUseVariableFactory(getScenarios()); for (ElectricPowerFlowConnection edge : model.getFlowConnections()) { if (edge.getAttribute(AlgorithmConstants.IS_USED_KEY) == null || !(edge.getAttribute(AlgorithmConstants.IS_USED_KEY) instanceof ScenarioAttribute)) { edge.setAttribute(AlgorithmConstants.IS_USED_KEY, new ScenarioAttribute()); } for (Scenario scenario : getScenarios()) { Variable variable = variableFactory.getVariable(problem, edge, scenario); if (ScenarioVariableFactoryUtility.doCreateLineUseScenarioVariable(edge, scenario)) { int isUsed = solution.getValueInt(variable); edge.getAttribute(AlgorithmConstants.IS_USED_KEY, ScenarioAttribute.class).addEntry(scenario, isUsed); } else { int isUsed = ScenarioVariableFactoryUtility.getLineUseScenarioConstant(edge, scenario); edge.getAttribute(AlgorithmConstants.IS_USED_KEY, ScenarioAttribute.class).addEntry(scenario, isUsed); } } } } }
[ "rbent@lanl.gov" ]
rbent@lanl.gov
ae7b2262a73fb5cddda47ffc308e0bf231e901ca
6c942e2ae10ab4d808dee2557903c918b6053cbe
/functions/util/DBOpenHelper.java
d281f71811867e46a279644bc4623e6ca9e6d0d1
[]
no_license
yshenc/Simple-App-for-Library
6f881117efab249e8b551d80d884ae0bee8604b5
87fa298bbf0e27274be7d77de48fd8eaab2a7463
refs/heads/master
2020-04-12T21:03:26.410150
2018-12-21T20:17:02
2018-12-21T20:17:02
162,753,979
0
0
null
null
null
null
UTF-8
Java
false
false
627
java
package group4.wpilibrary.util; /** * Created by User on 12/2/2017. */ import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; /** * Class used to open database file */ public class DBOpenHelper extends SQLiteOpenHelper { public DBOpenHelper(Context context, String path, int version){ super(context, path, null, version); } @Override public void onCreate(SQLiteDatabase db) { } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } }
[ "noreply@github.com" ]
yshenc.noreply@github.com
034d0fd17de8f9e9518183d44b1efe89acd7e7f7
635c402628aa0898dbae2ec33bd76450ce7ddcae
/buc-batch-cron-kpi-planning/src/main/java/kr/or/cmcnu/bucbatch/jobconfig/JobConfiguration.java
7922082f1109b51a23dbdca849889883df84ac44
[]
no_license
ixon69/STS_old
e5171a8e4c067e3c4e8dbfc303bf180dfdb68c4b
3e9d68ee315265d514a23964f5afd75c6d518ede
refs/heads/master
2023-01-06T14:36:59.117640
2020-11-02T23:19:20
2020-11-02T23:19:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,388
java
package kr.or.cmcnu.bucbatch.jobconfig; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.sql.DataSource; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.batch.MyBatisBatchItemWriter; import org.mybatis.spring.batch.MyBatisCursorItemReader; import org.mybatis.spring.batch.MyBatisPagingItemReader; import org.mybatis.spring.batch.builder.MyBatisBatchItemWriterBuilder; import org.mybatis.spring.batch.builder.MyBatisCursorItemReaderBuilder; import org.mybatis.spring.batch.builder.MyBatisPagingItemReaderBuilder; import org.springframework.batch.core.Job; import org.springframework.batch.core.Step; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; import org.springframework.batch.core.configuration.annotation.JobScope; import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; import org.springframework.batch.core.configuration.annotation.StepScope; import org.springframework.batch.item.ItemProcessor; import org.springframework.batch.item.ItemReader; import org.springframework.batch.item.ItemWriter; import org.springframework.batch.repeat.RepeatStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import kr.or.cmcnu.bucbatch.jobconfig.runidIncrementer.UniqueRunIdIncrementer; import kr.or.cmcnu.bucbatch.model.CommonDataset; import kr.or.cmcnu.bucbatch.processor.ConvertDatasetProcessor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @Slf4j @Configuration @EnableBatchProcessing public class JobConfiguration { @Autowired private JobBuilderFactory jobs; @Autowired private StepBuilderFactory steps; @Bean public Job job(@Qualifier("step0") Step step0, @Qualifier("step1") Step step1) { return jobs.get("KPI-1") .start(step0) .next(step1) .incrementer(new UniqueRunIdIncrementer()) .build(); } @Bean public Step step0(@Qualifier("tSqlSessionFactory") SqlSessionFactory sqlSessionFactory) { return steps.get("step1") .tasklet((contribution, chunkContext) -> { try (SqlSession session = sqlSessionFactory.openSession()) { session.delete("TargetMapper.deleteCommonDataset"); session.commit(); } return RepeatStatus.FINISHED; }) .build(); } @Bean protected Step step1(ItemReader<HashMap> reader, ItemProcessor<HashMap, List<CommonDataset>> processor, ItemWriter<List<CommonDataset>> writer) { return steps.get("step1") .<HashMap, List<CommonDataset>> chunk(10) .reader(reader) .processor(processor) .writer(writer) .build(); } @Bean @JobScope public MyBatisCursorItemReader<HashMap> reader(@Qualifier("sSqlSessionFactory") SqlSessionFactory sqlSessionFactory, @Value("#{jobParameters[fromdd]}") String fromdd, @Value("#{jobParameters[todd]}") String todd) { Map<String, Object> parameterValues = new HashMap<>(); parameterValues.put("fromdd", fromdd); parameterValues.put("todd", todd); return new MyBatisCursorItemReaderBuilder<HashMap>() .sqlSessionFactory(sqlSessionFactory) .queryId("SourceMapper.selectMonthKPI") .parameterValues(parameterValues) .build(); } @Bean public ItemProcessor<HashMap, List<CommonDataset>> processor() { return new ConvertDatasetProcessor(); } @Bean public MyBatisBatchItemWriter<List<CommonDataset>> writer(@Qualifier("tSqlSessionFactory") SqlSessionFactory sqlSessionFactory) { return new MyBatisBatchItemWriterBuilder<List<CommonDataset>>() .sqlSessionFactory(sqlSessionFactory) .assertUpdates(false) .statementId("TargetMapper.insertCommonDataset") .build(); } }
[ "ixon69@gmail.com" ]
ixon69@gmail.com
02ccafb40c4e4b17d635b7cfbbddbd8f855940e7
ef4c121214d9654fe513840385180a259034ab24
/src/main/java/com/nieyue/comments/RequestToMethdoItemUtils.java
d68eb57d23eec59bb078dfff315bb93ad9330974
[]
no_license
nieyue/WeiXinProject
00832cd86c4e986116cfa31806e04cce70b0b1b7
03508f26d629425ac4fad1b326125b3f3379c189
refs/heads/master
2021-07-15T08:48:16.848378
2018-11-13T08:29:14
2018-11-13T08:29:14
135,840,863
0
1
null
null
null
null
UTF-8
Java
false
false
6,061
java
package com.nieyue.comments; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.context.annotation.Configuration; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition; import org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition; import org.springframework.web.servlet.mvc.method.RequestMappingInfo; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import javassist.ClassClassPath; import javassist.ClassPool; import javassist.CtClass; import javassist.CtMethod; import javassist.bytecode.CodeAttribute; import javassist.bytecode.LocalVariableAttribute; import javassist.bytecode.MethodInfo; /** * 获取请求列表 * @author 聂跃 * @date 2017年7月20日 */ @Configuration public class RequestToMethdoItemUtils { /** * 获取请求信息列表 * */ public List<RequestToMethodItem> getRequestToMethodItemList(HttpServletRequest request) { ServletContext servletContext = request.getSession().getServletContext(); if (servletContext == null) { return null; } WebApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext); //请求url和处理方法的映射 List<RequestToMethodItem> requestToMethodItemList = new ArrayList<RequestToMethodItem>(); //获取所有的RequestMapping Map<String, HandlerMapping> allRequestMappings = BeanFactoryUtils.beansOfTypeIncludingAncestors(appContext, HandlerMapping.class, true, false); for (HandlerMapping handlerMapping : allRequestMappings.values()) { //本项目只需要RequestMappingHandlerMapping中的URL映射 if (handlerMapping instanceof RequestMappingHandlerMapping) { RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) handlerMapping; Map<RequestMappingInfo, HandlerMethod> handlerMethods = requestMappingHandlerMapping.getHandlerMethods(); for (Map.Entry<RequestMappingInfo, HandlerMethod> requestMappingInfoHandlerMethodEntry : handlerMethods.entrySet()) { RequestMappingInfo requestMappingInfo = requestMappingInfoHandlerMethodEntry.getKey(); HandlerMethod mappingInfoValue = requestMappingInfoHandlerMethodEntry.getValue(); RequestMethodsRequestCondition methodCondition = requestMappingInfo.getMethodsCondition(); Set<RequestMethod> requestTypeObject = methodCondition.getMethods(); List<RequestMethod> requestType=new ArrayList<RequestMethod>(requestTypeObject); PatternsRequestCondition patternsCondition = requestMappingInfo.getPatternsCondition(); String requestUrl = (String) (patternsCondition.getPatterns().toArray())[0]; String controllerName = mappingInfoValue.getBeanType().getSimpleName(); String requestMethodName = mappingInfoValue.getMethod().getName(); // Class<?>[] methodParamTypes = mappingInfoValue.getMethod().getParameterTypes(); String methodParamTypes = getMethodParams(mappingInfoValue.getBeanType().getName().toString(),requestMethodName); //System.out.println(mappingInfoValue); RequestToMethodItem item = new RequestToMethodItem(controllerName, requestMethodName, requestType, requestUrl,methodParamTypes); requestToMethodItemList.add(item ); } break; } } return requestToMethodItemList; } /** * @param className 类名 * @param methodName 方法名 * @return 该方法的声明部分 * @author nieyue * 创建时间:2017年3月8日 上午11:47:16 * 功能:返回一个方法的声明部分,包括参数类型和参数名 */ private String getMethodParams(String className,String methodName){ String result=""; try{ ClassPool pool=ClassPool.getDefault(); ClassClassPath classPath = new ClassClassPath(this.getClass()); pool.insertClassPath(classPath); CtMethod cm =pool.getMethod(className, methodName); // 使用javaassist的反射方法获取方法的参数名 MethodInfo methodInfo = cm.getMethodInfo(); CodeAttribute codeAttribute = methodInfo.getCodeAttribute(); LocalVariableAttribute attr = (LocalVariableAttribute) codeAttribute.getAttribute(LocalVariableAttribute.tag); result=cm.getName() + "("; if (attr == null) { return result + ")"; } CtClass[] pTypes=cm.getParameterTypes(); String[] paramNames = new String[pTypes.length]; int pos = Modifier.isStatic(cm.getModifiers()) ? 0 : 1; for (int i = 0; i < paramNames.length; i++) { //System.err.println( attr.variableName(i + pos)); if(!pTypes[i].getSimpleName().startsWith("Http")){ result += pTypes[i].getSimpleName(); paramNames[i] = attr.variableName(i + pos); result += " " + paramNames[i]+","; } } if(result.endsWith(",")){ result=result.substring(0, result.length()-1); } result+=")"; }catch(Exception e){ e.printStackTrace(); } return result; } }
[ "278076304@qq.com" ]
278076304@qq.com
a64629433dd80b298a7114b486ba52c27d2899a0
5180faa3a5f7c7816cab9a93e9a85b2321bec614
/app/src/main/java/com/example/studikasussisi/View/MainActivity.java
026193957134356a92e6fe10e6d2f078a4754cdb
[]
no_license
zharfanantha/StudiKasusSisi
29c794b30c8d5efb182229d83957153745069451
505e2898ab91f790c1de6a9f2f5d0f58b8a7901a
refs/heads/master
2020-09-06T10:57:31.530678
2019-11-08T07:15:04
2019-11-08T07:15:04
220,403,294
0
0
null
null
null
null
UTF-8
Java
false
false
2,288
java
package com.example.studikasussisi.View; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import com.example.studikasussisi.Adapter.MainAdapter; import com.example.studikasussisi.R; import com.example.studikasussisi.Repository.Model.HomeMenu; import com.example.studikasussisi.ViewModel.MainViewModel; import java.util.List; public class MainActivity extends AppCompatActivity implements MainAdapter.Listener { MainViewModel mainViewModel; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final RecyclerView recyclerView = findViewById(R.id.recyclerview); Toolbar toolbar = findViewById(R.id.toolbar); TextView toolbarText = findViewById(R.id.toolbar_text); toolbarText.setText("Home"); toolbarText.setTextColor(Color.WHITE); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new GridLayoutManager(this, 2)); mainViewModel = ViewModelProviders.of(this).get(MainViewModel.class); mainViewModel.getmHomeMenu().observe(this, new Observer<List<HomeMenu>>() { @Override public void onChanged(List<HomeMenu> homeMenus) { MainAdapter adapter = new MainAdapter(homeMenus, MainActivity.this, MainActivity.this); recyclerView.setAdapter(adapter); } }); } @Override public void onClick(int position) { if (position == 0) { Intent intent = new Intent(MainActivity.this, CreateActivity.class); startActivity(intent); } else if (position == 1) { Intent intent = new Intent(MainActivity.this, ReadActivity.class); startActivity(intent); } else { Toast.makeText(this, "position "+position, Toast.LENGTH_SHORT).show(); } } }
[ "after.dear@gmail.com" ]
after.dear@gmail.com
71a809a561469f32b87b4985e470aef4846c1872
8b89a7e9d00c853c3b83ce6afb45cc185a214034
/jenme-core/src/main/java/com/cantonsoft/core/account/user/UserSettingService.java
525d246c8fb7c844f097c8fa2e1a6529e87bb137
[]
no_license
shifre/lib
e78f44ac38e459d9d4e25900870c8085f4e5bb30
21f3ed9c78d95d62b5f8f32e9ed94cd3ee2a815a
refs/heads/master
2020-03-08T05:04:10.814237
2018-04-05T16:14:46
2018-04-05T16:14:46
127,938,523
0
0
null
null
null
null
UTF-8
Java
false
false
1,793
java
package com.cantonsoft.core.account.user; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import com.cantonsoft.core.account.user.dao.UserSettingDao; import com.cantonsoft.core.account.user.model.UserSetting; import com.cantonsoft.core.common.event.EventRegister; import com.cantonsoft.framework.event.Event; import com.cantonsoft.framework.event.IEventDispatcher; import com.cantonsoft.framework.validation.IValidationDirector; @Service @Lazy public class UserSettingService { @Autowired private IEventDispatcher eventDispatcher; @Autowired private UserSettingDao userSettingDao; @Autowired private IValidationDirector vDirector; public void save(String domain, Long userId, String type, String value) { UserSetting setting = new UserSetting(); setting.setDomain(domain); setting.setUserId(userId); setting.setType(type); setting.setValue(value); vDirector.findValidator("user.setting").validate(setting); UserSetting entity = userSettingDao.findByDomainAndUserIdAndType(domain, userId, type); if (null == entity) { entity = setting; userSettingDao.save(entity); } else { entity.setValue(value); userSettingDao.save(entity); } eventDispatcher.dispatch(new Event(EventRegister.USERSETTING_CHANGE, entity, entity)); } public Map<String, String> getUserSettings(String domain, Long userId) { List<UserSetting> list = userSettingDao.findByDomainAndUserId(domain, userId); Map<String, String> ret = new HashMap<String, String>(); for (UserSetting setting : list) { ret.put(setting.getType(), setting.getValue()); } return ret; } }
[ "864892298@qq.com" ]
864892298@qq.com
7e0d8434b48297f35732528321ee6d9b7778aa80
295484a3b871970a0cdd29bb68f3bfcdd05c0064
/Desktop/Projects/SpringAngularMicroserviceApp/gateway/src/test/java/com/subbu/gateway/web/rest/AccountResourceIT.java
fb818b0e39ae6da8a7a4b1dcabd74ddcc6a2e395
[]
no_license
SubbuDaduluri/devapptest
47b93c032c8926c0a4103f116f6f980672f56511
391cb0dc319276038f53a8bd34bba964a6eaa6f1
refs/heads/master
2023-06-06T10:07:17.366636
2021-04-04T11:16:22
2021-04-04T11:16:22
380,711,432
0
0
null
null
null
null
UTF-8
Java
false
false
33,142
java
package com.subbu.gateway.web.rest; import com.subbu.gateway.GatewayApp; import com.subbu.gateway.config.Constants; import com.subbu.gateway.domain.User; import com.subbu.gateway.repository.AuthorityRepository; import com.subbu.gateway.repository.UserRepository; import com.subbu.gateway.security.AuthoritiesConstants; import com.subbu.gateway.service.UserService; import com.subbu.gateway.service.dto.PasswordChangeDTO; import com.subbu.gateway.service.dto.UserDTO; import com.subbu.gateway.web.rest.vm.KeyAndPasswordVM; import com.subbu.gateway.web.rest.vm.ManagedUserVM; import org.apache.commons.lang3.RandomStringUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; import org.springframework.transaction.annotation.Transactional; import java.time.Instant; import java.util.*; import static org.assertj.core.api.Assertions.assertThat; import static com.subbu.gateway.web.rest.AccountResourceIT.TEST_USER_LOGIN; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Integration tests for the {@link AccountResource} REST controller. */ @AutoConfigureMockMvc @WithMockUser(value = TEST_USER_LOGIN) @SpringBootTest(classes = GatewayApp.class) public class AccountResourceIT { static final String TEST_USER_LOGIN = "test"; @Autowired private UserRepository userRepository; @Autowired private AuthorityRepository authorityRepository; @Autowired private UserService userService; @Autowired private PasswordEncoder passwordEncoder; @Autowired private MockMvc restAccountMockMvc; @Test @WithUnauthenticatedMockUser public void testNonAuthenticatedUser() throws Exception { restAccountMockMvc.perform(get("/api/authenticate") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string("")); } @Test public void testAuthenticatedUser() throws Exception { restAccountMockMvc.perform(get("/api/authenticate") .with(request -> { request.setRemoteUser(TEST_USER_LOGIN); return request; }) .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().string(TEST_USER_LOGIN)); } @Test public void testGetExistingAccount() throws Exception { Set<String> authorities = new HashSet<>(); authorities.add(AuthoritiesConstants.ADMIN); UserDTO user = new UserDTO(); user.setLogin(TEST_USER_LOGIN); user.setFirstName("john"); user.setLastName("doe"); user.setEmail("john.doe@jhipster.com"); user.setImageUrl("http://placehold.it/50x50"); user.setLangKey("en"); user.setAuthorities(authorities); userService.createUser(user); restAccountMockMvc.perform(get("/api/account") .accept(MediaType.APPLICATION_JSON)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE)) .andExpect(jsonPath("$.login").value(TEST_USER_LOGIN)) .andExpect(jsonPath("$.firstName").value("john")) .andExpect(jsonPath("$.lastName").value("doe")) .andExpect(jsonPath("$.email").value("john.doe@jhipster.com")) .andExpect(jsonPath("$.imageUrl").value("http://placehold.it/50x50")) .andExpect(jsonPath("$.langKey").value("en")) .andExpect(jsonPath("$.authorities").value(AuthoritiesConstants.ADMIN)); } @Test public void testGetUnknownAccount() throws Exception { restAccountMockMvc.perform(get("/api/account") .accept(MediaType.APPLICATION_PROBLEM_JSON)) .andExpect(status().isInternalServerError()); } @Test @Transactional public void testRegisterValid() throws Exception { ManagedUserVM validUser = new ManagedUserVM(); validUser.setLogin("test-register-valid"); validUser.setPassword("password"); validUser.setFirstName("Alice"); validUser.setLastName("Test"); validUser.setEmail("test-register-valid@example.com"); validUser.setImageUrl("http://placehold.it/50x50"); validUser.setLangKey(Constants.DEFAULT_LANGUAGE); validUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); assertThat(userRepository.findOneByLogin("test-register-valid").isPresent()).isFalse(); restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(validUser))) .andExpect(status().isCreated()); assertThat(userRepository.findOneByLogin("test-register-valid").isPresent()).isTrue(); } @Test @Transactional public void testRegisterInvalidLogin() throws Exception { ManagedUserVM invalidUser = new ManagedUserVM(); invalidUser.setLogin("funky-log(n");// <-- invalid invalidUser.setPassword("password"); invalidUser.setFirstName("Funky"); invalidUser.setLastName("One"); invalidUser.setEmail("funky@example.com"); invalidUser.setActivated(true); invalidUser.setImageUrl("http://placehold.it/50x50"); invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(invalidUser))) .andExpect(status().isBadRequest()); Optional<User> user = userRepository.findOneByEmailIgnoreCase("funky@example.com"); assertThat(user.isPresent()).isFalse(); } @Test @Transactional public void testRegisterInvalidEmail() throws Exception { ManagedUserVM invalidUser = new ManagedUserVM(); invalidUser.setLogin("bob"); invalidUser.setPassword("password"); invalidUser.setFirstName("Bob"); invalidUser.setLastName("Green"); invalidUser.setEmail("invalid");// <-- invalid invalidUser.setActivated(true); invalidUser.setImageUrl("http://placehold.it/50x50"); invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(invalidUser))) .andExpect(status().isBadRequest()); Optional<User> user = userRepository.findOneByLogin("bob"); assertThat(user.isPresent()).isFalse(); } @Test @Transactional public void testRegisterInvalidPassword() throws Exception { ManagedUserVM invalidUser = new ManagedUserVM(); invalidUser.setLogin("bob"); invalidUser.setPassword("123");// password with only 3 digits invalidUser.setFirstName("Bob"); invalidUser.setLastName("Green"); invalidUser.setEmail("bob@example.com"); invalidUser.setActivated(true); invalidUser.setImageUrl("http://placehold.it/50x50"); invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(invalidUser))) .andExpect(status().isBadRequest()); Optional<User> user = userRepository.findOneByLogin("bob"); assertThat(user.isPresent()).isFalse(); } @Test @Transactional public void testRegisterNullPassword() throws Exception { ManagedUserVM invalidUser = new ManagedUserVM(); invalidUser.setLogin("bob"); invalidUser.setPassword(null);// invalid null password invalidUser.setFirstName("Bob"); invalidUser.setLastName("Green"); invalidUser.setEmail("bob@example.com"); invalidUser.setActivated(true); invalidUser.setImageUrl("http://placehold.it/50x50"); invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE); invalidUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(invalidUser))) .andExpect(status().isBadRequest()); Optional<User> user = userRepository.findOneByLogin("bob"); assertThat(user.isPresent()).isFalse(); } @Test @Transactional public void testRegisterDuplicateLogin() throws Exception { // First registration ManagedUserVM firstUser = new ManagedUserVM(); firstUser.setLogin("alice"); firstUser.setPassword("password"); firstUser.setFirstName("Alice"); firstUser.setLastName("Something"); firstUser.setEmail("alice@example.com"); firstUser.setImageUrl("http://placehold.it/50x50"); firstUser.setLangKey(Constants.DEFAULT_LANGUAGE); firstUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); // Duplicate login, different email ManagedUserVM secondUser = new ManagedUserVM(); secondUser.setLogin(firstUser.getLogin()); secondUser.setPassword(firstUser.getPassword()); secondUser.setFirstName(firstUser.getFirstName()); secondUser.setLastName(firstUser.getLastName()); secondUser.setEmail("alice2@example.com"); secondUser.setImageUrl(firstUser.getImageUrl()); secondUser.setLangKey(firstUser.getLangKey()); secondUser.setCreatedBy(firstUser.getCreatedBy()); secondUser.setCreatedDate(firstUser.getCreatedDate()); secondUser.setLastModifiedBy(firstUser.getLastModifiedBy()); secondUser.setLastModifiedDate(firstUser.getLastModifiedDate()); secondUser.setAuthorities(new HashSet<>(firstUser.getAuthorities())); // First user restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(firstUser))) .andExpect(status().isCreated()); // Second (non activated) user restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(secondUser))) .andExpect(status().isCreated()); Optional<User> testUser = userRepository.findOneByEmailIgnoreCase("alice2@example.com"); assertThat(testUser.isPresent()).isTrue(); testUser.get().setActivated(true); userRepository.save(testUser.get()); // Second (already activated) user restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(secondUser))) .andExpect(status().is4xxClientError()); } @Test @Transactional public void testRegisterDuplicateEmail() throws Exception { // First user ManagedUserVM firstUser = new ManagedUserVM(); firstUser.setLogin("test-register-duplicate-email"); firstUser.setPassword("password"); firstUser.setFirstName("Alice"); firstUser.setLastName("Test"); firstUser.setEmail("test-register-duplicate-email@example.com"); firstUser.setImageUrl("http://placehold.it/50x50"); firstUser.setLangKey(Constants.DEFAULT_LANGUAGE); firstUser.setAuthorities(Collections.singleton(AuthoritiesConstants.USER)); // Register first user restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(firstUser))) .andExpect(status().isCreated()); Optional<User> testUser1 = userRepository.findOneByLogin("test-register-duplicate-email"); assertThat(testUser1.isPresent()).isTrue(); // Duplicate email, different login ManagedUserVM secondUser = new ManagedUserVM(); secondUser.setLogin("test-register-duplicate-email-2"); secondUser.setPassword(firstUser.getPassword()); secondUser.setFirstName(firstUser.getFirstName()); secondUser.setLastName(firstUser.getLastName()); secondUser.setEmail(firstUser.getEmail()); secondUser.setImageUrl(firstUser.getImageUrl()); secondUser.setLangKey(firstUser.getLangKey()); secondUser.setAuthorities(new HashSet<>(firstUser.getAuthorities())); // Register second (non activated) user restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(secondUser))) .andExpect(status().isCreated()); Optional<User> testUser2 = userRepository.findOneByLogin("test-register-duplicate-email"); assertThat(testUser2.isPresent()).isFalse(); Optional<User> testUser3 = userRepository.findOneByLogin("test-register-duplicate-email-2"); assertThat(testUser3.isPresent()).isTrue(); // Duplicate email - with uppercase email address ManagedUserVM userWithUpperCaseEmail = new ManagedUserVM(); userWithUpperCaseEmail.setId(firstUser.getId()); userWithUpperCaseEmail.setLogin("test-register-duplicate-email-3"); userWithUpperCaseEmail.setPassword(firstUser.getPassword()); userWithUpperCaseEmail.setFirstName(firstUser.getFirstName()); userWithUpperCaseEmail.setLastName(firstUser.getLastName()); userWithUpperCaseEmail.setEmail("TEST-register-duplicate-email@example.com"); userWithUpperCaseEmail.setImageUrl(firstUser.getImageUrl()); userWithUpperCaseEmail.setLangKey(firstUser.getLangKey()); userWithUpperCaseEmail.setAuthorities(new HashSet<>(firstUser.getAuthorities())); // Register third (not activated) user restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(userWithUpperCaseEmail))) .andExpect(status().isCreated()); Optional<User> testUser4 = userRepository.findOneByLogin("test-register-duplicate-email-3"); assertThat(testUser4.isPresent()).isTrue(); assertThat(testUser4.get().getEmail()).isEqualTo("test-register-duplicate-email@example.com"); testUser4.get().setActivated(true); userService.updateUser((new UserDTO(testUser4.get()))); // Register 4th (already activated) user restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(secondUser))) .andExpect(status().is4xxClientError()); } @Test @Transactional public void testRegisterAdminIsIgnored() throws Exception { ManagedUserVM validUser = new ManagedUserVM(); validUser.setLogin("badguy"); validUser.setPassword("password"); validUser.setFirstName("Bad"); validUser.setLastName("Guy"); validUser.setEmail("badguy@example.com"); validUser.setActivated(true); validUser.setImageUrl("http://placehold.it/50x50"); validUser.setLangKey(Constants.DEFAULT_LANGUAGE); validUser.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); restAccountMockMvc.perform( post("/api/register") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(validUser))) .andExpect(status().isCreated()); Optional<User> userDup = userRepository.findOneWithAuthoritiesByLogin("badguy"); assertThat(userDup.isPresent()).isTrue(); assertThat(userDup.get().getAuthorities()).hasSize(1) .containsExactly(authorityRepository.findById(AuthoritiesConstants.USER).get()); } @Test @Transactional public void testActivateAccount() throws Exception { final String activationKey = "some activation key"; User user = new User(); user.setLogin("activate-account"); user.setEmail("activate-account@example.com"); user.setPassword(RandomStringUtils.random(60)); user.setActivated(false); user.setActivationKey(activationKey); userRepository.saveAndFlush(user); restAccountMockMvc.perform(get("/api/activate?key={activationKey}", activationKey)) .andExpect(status().isOk()); user = userRepository.findOneByLogin(user.getLogin()).orElse(null); assertThat(user.getActivated()).isTrue(); } @Test @Transactional public void testActivateAccountWithWrongKey() throws Exception { restAccountMockMvc.perform(get("/api/activate?key=wrongActivationKey")) .andExpect(status().isInternalServerError()); } @Test @Transactional @WithMockUser("save-account") public void testSaveAccount() throws Exception { User user = new User(); user.setLogin("save-account"); user.setEmail("save-account@example.com"); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); userRepository.saveAndFlush(user); UserDTO userDTO = new UserDTO(); userDTO.setLogin("not-used"); userDTO.setFirstName("firstname"); userDTO.setLastName("lastname"); userDTO.setEmail("save-account@example.com"); userDTO.setActivated(false); userDTO.setImageUrl("http://placehold.it/50x50"); userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); restAccountMockMvc.perform( post("/api/account") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(userDTO))) .andExpect(status().isOk()); User updatedUser = userRepository.findOneWithAuthoritiesByLogin(user.getLogin()).orElse(null); assertThat(updatedUser.getFirstName()).isEqualTo(userDTO.getFirstName()); assertThat(updatedUser.getLastName()).isEqualTo(userDTO.getLastName()); assertThat(updatedUser.getEmail()).isEqualTo(userDTO.getEmail()); assertThat(updatedUser.getLangKey()).isEqualTo(userDTO.getLangKey()); assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); assertThat(updatedUser.getImageUrl()).isEqualTo(userDTO.getImageUrl()); assertThat(updatedUser.getActivated()).isEqualTo(true); assertThat(updatedUser.getAuthorities()).isEmpty(); } @Test @Transactional @WithMockUser("save-invalid-email") public void testSaveInvalidEmail() throws Exception { User user = new User(); user.setLogin("save-invalid-email"); user.setEmail("save-invalid-email@example.com"); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); userRepository.saveAndFlush(user); UserDTO userDTO = new UserDTO(); userDTO.setLogin("not-used"); userDTO.setFirstName("firstname"); userDTO.setLastName("lastname"); userDTO.setEmail("invalid email"); userDTO.setActivated(false); userDTO.setImageUrl("http://placehold.it/50x50"); userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); restAccountMockMvc.perform( post("/api/account") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(userDTO))) .andExpect(status().isBadRequest()); assertThat(userRepository.findOneByEmailIgnoreCase("invalid email")).isNotPresent(); } @Test @Transactional @WithMockUser("save-existing-email") public void testSaveExistingEmail() throws Exception { User user = new User(); user.setLogin("save-existing-email"); user.setEmail("save-existing-email@example.com"); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); userRepository.saveAndFlush(user); User anotherUser = new User(); anotherUser.setLogin("save-existing-email2"); anotherUser.setEmail("save-existing-email2@example.com"); anotherUser.setPassword(RandomStringUtils.random(60)); anotherUser.setActivated(true); userRepository.saveAndFlush(anotherUser); UserDTO userDTO = new UserDTO(); userDTO.setLogin("not-used"); userDTO.setFirstName("firstname"); userDTO.setLastName("lastname"); userDTO.setEmail("save-existing-email2@example.com"); userDTO.setActivated(false); userDTO.setImageUrl("http://placehold.it/50x50"); userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); restAccountMockMvc.perform( post("/api/account") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(userDTO))) .andExpect(status().isBadRequest()); User updatedUser = userRepository.findOneByLogin("save-existing-email").orElse(null); assertThat(updatedUser.getEmail()).isEqualTo("save-existing-email@example.com"); } @Test @Transactional @WithMockUser("save-existing-email-and-login") public void testSaveExistingEmailAndLogin() throws Exception { User user = new User(); user.setLogin("save-existing-email-and-login"); user.setEmail("save-existing-email-and-login@example.com"); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); userRepository.saveAndFlush(user); UserDTO userDTO = new UserDTO(); userDTO.setLogin("not-used"); userDTO.setFirstName("firstname"); userDTO.setLastName("lastname"); userDTO.setEmail("save-existing-email-and-login@example.com"); userDTO.setActivated(false); userDTO.setImageUrl("http://placehold.it/50x50"); userDTO.setLangKey(Constants.DEFAULT_LANGUAGE); userDTO.setAuthorities(Collections.singleton(AuthoritiesConstants.ADMIN)); restAccountMockMvc.perform( post("/api/account") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(userDTO))) .andExpect(status().isOk()); User updatedUser = userRepository.findOneByLogin("save-existing-email-and-login").orElse(null); assertThat(updatedUser.getEmail()).isEqualTo("save-existing-email-and-login@example.com"); } @Test @Transactional @WithMockUser("change-password-wrong-existing-password") public void testChangePasswordWrongExistingPassword() throws Exception { User user = new User(); String currentPassword = RandomStringUtils.random(60); user.setPassword(passwordEncoder.encode(currentPassword)); user.setLogin("change-password-wrong-existing-password"); user.setEmail("change-password-wrong-existing-password@example.com"); userRepository.saveAndFlush(user); restAccountMockMvc.perform(post("/api/account/change-password") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO("1"+currentPassword, "new password"))) ) .andExpect(status().isBadRequest()); User updatedUser = userRepository.findOneByLogin("change-password-wrong-existing-password").orElse(null); assertThat(passwordEncoder.matches("new password", updatedUser.getPassword())).isFalse(); assertThat(passwordEncoder.matches(currentPassword, updatedUser.getPassword())).isTrue(); } @Test @Transactional @WithMockUser("change-password") public void testChangePassword() throws Exception { User user = new User(); String currentPassword = RandomStringUtils.random(60); user.setPassword(passwordEncoder.encode(currentPassword)); user.setLogin("change-password"); user.setEmail("change-password@example.com"); userRepository.saveAndFlush(user); restAccountMockMvc.perform(post("/api/account/change-password") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO(currentPassword, "new password"))) ) .andExpect(status().isOk()); User updatedUser = userRepository.findOneByLogin("change-password").orElse(null); assertThat(passwordEncoder.matches("new password", updatedUser.getPassword())).isTrue(); } @Test @Transactional @WithMockUser("change-password-too-small") public void testChangePasswordTooSmall() throws Exception { User user = new User(); String currentPassword = RandomStringUtils.random(60); user.setPassword(passwordEncoder.encode(currentPassword)); user.setLogin("change-password-too-small"); user.setEmail("change-password-too-small@example.com"); userRepository.saveAndFlush(user); String newPassword = RandomStringUtils.random(ManagedUserVM.PASSWORD_MIN_LENGTH - 1); restAccountMockMvc.perform(post("/api/account/change-password") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO(currentPassword, newPassword))) ) .andExpect(status().isBadRequest()); User updatedUser = userRepository.findOneByLogin("change-password-too-small").orElse(null); assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); } @Test @Transactional @WithMockUser("change-password-too-long") public void testChangePasswordTooLong() throws Exception { User user = new User(); String currentPassword = RandomStringUtils.random(60); user.setPassword(passwordEncoder.encode(currentPassword)); user.setLogin("change-password-too-long"); user.setEmail("change-password-too-long@example.com"); userRepository.saveAndFlush(user); String newPassword = RandomStringUtils.random(ManagedUserVM.PASSWORD_MAX_LENGTH + 1); restAccountMockMvc.perform(post("/api/account/change-password") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO(currentPassword, newPassword))) ) .andExpect(status().isBadRequest()); User updatedUser = userRepository.findOneByLogin("change-password-too-long").orElse(null); assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); } @Test @Transactional @WithMockUser("change-password-empty") public void testChangePasswordEmpty() throws Exception { User user = new User(); String currentPassword = RandomStringUtils.random(60); user.setPassword(passwordEncoder.encode(currentPassword)); user.setLogin("change-password-empty"); user.setEmail("change-password-empty@example.com"); userRepository.saveAndFlush(user); restAccountMockMvc.perform(post("/api/account/change-password") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(new PasswordChangeDTO(currentPassword, ""))) ) .andExpect(status().isBadRequest()); User updatedUser = userRepository.findOneByLogin("change-password-empty").orElse(null); assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword()); } @Test @Transactional public void testRequestPasswordReset() throws Exception { User user = new User(); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); user.setLogin("password-reset"); user.setEmail("password-reset@example.com"); userRepository.saveAndFlush(user); restAccountMockMvc.perform(post("/api/account/reset-password/init") .content("password-reset@example.com") ) .andExpect(status().isOk()); } @Test @Transactional public void testRequestPasswordResetUpperCaseEmail() throws Exception { User user = new User(); user.setPassword(RandomStringUtils.random(60)); user.setActivated(true); user.setLogin("password-reset-upper-case"); user.setEmail("password-reset-upper-case@example.com"); userRepository.saveAndFlush(user); restAccountMockMvc.perform(post("/api/account/reset-password/init") .content("password-reset-upper-case@EXAMPLE.COM") ) .andExpect(status().isOk()); } @Test public void testRequestPasswordResetWrongEmail() throws Exception { restAccountMockMvc.perform( post("/api/account/reset-password/init") .content("password-reset-wrong-email@example.com")) .andExpect(status().isOk()); } @Test @Transactional public void testFinishPasswordReset() throws Exception { User user = new User(); user.setPassword(RandomStringUtils.random(60)); user.setLogin("finish-password-reset"); user.setEmail("finish-password-reset@example.com"); user.setResetDate(Instant.now().plusSeconds(60)); user.setResetKey("reset key"); userRepository.saveAndFlush(user); KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM(); keyAndPassword.setKey(user.getResetKey()); keyAndPassword.setNewPassword("new password"); restAccountMockMvc.perform( post("/api/account/reset-password/finish") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(keyAndPassword))) .andExpect(status().isOk()); User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null); assertThat(passwordEncoder.matches(keyAndPassword.getNewPassword(), updatedUser.getPassword())).isTrue(); } @Test @Transactional public void testFinishPasswordResetTooSmall() throws Exception { User user = new User(); user.setPassword(RandomStringUtils.random(60)); user.setLogin("finish-password-reset-too-small"); user.setEmail("finish-password-reset-too-small@example.com"); user.setResetDate(Instant.now().plusSeconds(60)); user.setResetKey("reset key too small"); userRepository.saveAndFlush(user); KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM(); keyAndPassword.setKey(user.getResetKey()); keyAndPassword.setNewPassword("foo"); restAccountMockMvc.perform( post("/api/account/reset-password/finish") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(keyAndPassword))) .andExpect(status().isBadRequest()); User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null); assertThat(passwordEncoder.matches(keyAndPassword.getNewPassword(), updatedUser.getPassword())).isFalse(); } @Test @Transactional public void testFinishPasswordResetWrongKey() throws Exception { KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM(); keyAndPassword.setKey("wrong reset key"); keyAndPassword.setNewPassword("new password"); restAccountMockMvc.perform( post("/api/account/reset-password/finish") .contentType(MediaType.APPLICATION_JSON) .content(TestUtil.convertObjectToJsonBytes(keyAndPassword))) .andExpect(status().isInternalServerError()); } }
[ "Test@gmail.com" ]
Test@gmail.com
dbdedfa428ce17d418514ff63cea962ba3b38ece
8121cf65a8d9a8c2e09c9c77b80b3e0d2e2a6358
/sample/src/main/java/com/github/jorgecastilloprz/corleone/sample/domain/model/SerializableGameCollection.java
75d62ac396c728a56f1b6da160640e84abfb848f
[ "Apache-2.0" ]
permissive
mkodekar/Corleone
7ce4ac72531efdc2696a0c86100adf1530b16133
ec6dd44fa712f8cab92694ba67a34e879226b4fd
refs/heads/master
2021-01-18T17:27:39.843463
2015-04-02T16:56:11
2015-04-02T16:56:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,053
java
/* * Copyright (C) 2015 Jorge Castillo Pérez * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.jorgecastilloprz.corleone.sample.domain.model; import java.util.List; import org.parceler.Parcel; /** * @author Jorge Castillo Pérez */ @Parcel public class SerializableGameCollection { List<Game> games; public SerializableGameCollection() { /* Needed for parceler */ } public SerializableGameCollection(List<Game> games) { this.games = games; } public List<Game> getGames() { return games; } }
[ "jorge.castillo.prz@gmail.com" ]
jorge.castillo.prz@gmail.com
b5b4e523f9d17a8c6b2b78a809a51ced649d3fe2
24f0c4efe67be3830f6be327943d7a984f7b0e7c
/exercicios/src/oo/polimorfismo/JantarMain.java
34c4edbdb66bed6c99e8ccd2cafeca07f61a4d43
[]
no_license
KailanySousa/CursoJava
b8c8ce2c5deaa872972c8f1ee5e48b34900d9298
37859b461b9c175f4738e71f3a6b939811fb6036
refs/heads/main
2023-07-21T14:34:45.383263
2021-08-18T02:51:47
2021-08-18T02:51:47
370,533,584
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package oo.polimorfismo; public class JantarMain { public static void main(String[] args) { Pessoa convidado = new Pessoa(99.65); System.out.println(convidado.getPeso()); Arroz arroz = new Arroz(0.25); convidado.comer(arroz); System.out.println(convidado.getPeso()); Feijao feijao = new Feijao(0.100); convidado.comer(feijao); System.out.println(convidado.getPeso()); Sorvete sorvete = new Sorvete(0.150); convidado.comer(sorvete); System.out.println(convidado.getPeso()); } }
[ "kailany-sousa2010@hotmail.com" ]
kailany-sousa2010@hotmail.com
65391e815438163f3dadad4d034533746308fa0c
712ba019d5e064fef9f02725e8457ff0b7e66923
/common/common-beansUtils/src/main/java/com/yw/common/beansUtils/entity/DeviceModelAttEntity.java
8c5440dbe963fad5bce76c0dbbc883cc7c6fbff7
[]
no_license
zhangyu0914/web
ef0d89034081d43eca69f749f74acaf4c712644f
3e2e2c9a1083df62a616978193c245e0c786eefa
refs/heads/master
2021-08-19T14:01:21.450895
2017-11-26T14:08:31
2017-11-26T14:08:31
112,086,944
0
0
null
null
null
null
UTF-8
Java
false
false
2,200
java
package com.yw.common.beansUtils.entity; import java.sql.Timestamp; import org.hibernate.validator.constraints.Length; import com.yw.common.beansUtils.dto.DeviceModelAttDto; import com.yw.common.beansUtils.entity.BaseEntity; /** *<pre> * 功 能: 设备与型号属性表 * 涉及版本: V1.0.0 * 创 建 者: Vickey * 日 期: 2017-03-15 15:56:17 * Q Q: 308053847 *</pre> */ public class DeviceModelAttEntity extends BaseEntity { private static final long serialVersionUID = -2979129154696L; @Length(min=0, max=50, message = "WEBPLATFORM.DEVICEMODELATT.FKDEVICETID") private String fkDeviceTid;// 设备外键ID @Length(min=0, max=50, message = "WEBPLATFORM.DEVICEMODELATT.FKMODELATTTID") private String fkModelAttTid;// 型号属性外键ID @Length(min=0, max=100, message = "WEBPLATFORM.DEVICEMODELATT.ATTVALUE") private String attValue;// 属性值 /****以下是表中不存在的属性定义*******************************************************************************/ /****V1.0.0版本*******************************************************************************/ //无参构造方法 public DeviceModelAttEntity() { super(); } //TID参数构造方法 public DeviceModelAttEntity(String tid) { super(); this.setTid(tid); } public DeviceModelAttEntity(String tid, String fkDeviceTid, String fkModelAttTid, String attValue) { super(); this.setTid(tid); this.fkDeviceTid = fkDeviceTid; this.fkModelAttTid = fkModelAttTid; this.attValue = attValue; } public DeviceModelAttEntity(DeviceModelAttDto data) { super(); if (data != null) { } } public DeviceModelAttEntity(String tid, String attValue) { this.setTid(tid); this.setAttValue(attValue); } public String getFkDeviceTid() { return fkDeviceTid; } public void setFkDeviceTid(String fkDeviceTid) { this.fkDeviceTid = fkDeviceTid; } public String getFkModelAttTid() { return fkModelAttTid; } public void setFkModelAttTid(String fkModelAttTid) { this.fkModelAttTid = fkModelAttTid; } public String getAttValue() { return attValue; } public void setAttValue(String attValue) { this.attValue = attValue; } }
[ "1129373045@qq.com" ]
1129373045@qq.com
8da4e4438e817c323c994ba6f6832825cfec76a3
d7141d608abe449634286fc8ef00934f12801557
/src/ticketsystem/ticketsystem-dao/src/main/java/com/flyloong/ticketsystem/dao/model/FlRole.java
a01195bfa24e7284832f5a699a667ec2f25aea49
[]
no_license
sunqianlong/ticketSystem
6404843207ebf01df5b4571f9f11c987e1dc4ab4
7e8673e0e9aefa296ce8812aaf928ee379c365aa
refs/heads/master
2021-04-06T11:08:52.109777
2018-04-16T13:24:01
2018-04-16T13:24:01
124,901,510
1
2
null
2018-03-16T13:41:16
2018-03-12T14:26:59
null
UTF-8
Java
false
false
2,661
java
package com.flyloong.ticketsystem.dao.model; import java.io.Serializable; import java.util.Date; public class FlRole implements Serializable { private Long id; private String roleName; private Date createDate; private Date modifyDate; private static final long serialVersionUID = 1L; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getRoleName() { return roleName; } public void setRoleName(String roleName) { this.roleName = roleName; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public Date getModifyDate() { return modifyDate; } public void setModifyDate(Date modifyDate) { this.modifyDate = modifyDate; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", roleName=").append(roleName); sb.append(", createDate=").append(createDate); sb.append(", modifyDate=").append(modifyDate); sb.append("]"); return sb.toString(); } @Override public boolean equals(Object that) { if (this == that) { return true; } if (that == null) { return false; } if (getClass() != that.getClass()) { return false; } FlRole other = (FlRole) that; return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) && (this.getRoleName() == null ? other.getRoleName() == null : this.getRoleName().equals(other.getRoleName())) && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate())) && (this.getModifyDate() == null ? other.getModifyDate() == null : this.getModifyDate().equals(other.getModifyDate())); } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode()); result = prime * result + ((getModifyDate() == null) ? 0 : getModifyDate().hashCode()); return result; } }
[ "qianlong.sql@alibaba-inc.com" ]
qianlong.sql@alibaba-inc.com
d5191f0d2f244ff3f0777f04f762cad9849bbf7d
3bdaff2fe4411f2e94365233f7b27efbaf6f4ee0
/main/java/com/designModel/adapter/Targetable.java
95f1ca45a72d6de2f7b17ba08ea4a6ea8b85dc9d
[]
no_license
bbzhanshi999/javainterview
c58ff9bfa577617613203ddfd8e5d38a7d1d5167
694fe57b39751afd8c3c72956a43ce86b44ab5bd
refs/heads/master
2021-01-20T02:33:50.466707
2018-08-12T06:36:16
2018-08-12T06:36:16
89,425,144
0
0
null
null
null
null
UTF-8
Java
false
false
177
java
package com.designModel.adapter; /** * Created by Administrator on 2017/3/28 0028. */ public interface Targetable { public void method1(); public void method2(); }
[ "bbzhanshi999@163.com" ]
bbzhanshi999@163.com
9a9f1ca43932315be7a32a916d85f3f554d429fd
bc72bec7fa9c573772dba6f224af9878f9dfda9f
/src/main/java/com/github/revival/common/entity/mob/projectile/EntityMetadataThrowable.java
69fd1975268a85df2298b4b22a9f74c632eeccbb
[ "CC-BY-4.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
UtahRapter/FossilArcheology1.7
6505a26a20e8540e68d396b49c52340d42ea7e38
051b1f7c125eda8f8051645595383a884cc0f383
refs/heads/master
2020-11-30T14:08:07.728974
2016-02-15T16:27:42
2016-02-15T16:27:42
51,873,568
1
0
null
2016-02-16T21:59:37
2016-02-16T21:59:37
null
UTF-8
Java
false
false
795
java
package com.github.revival.common.entity.mob.projectile; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; public class EntityMetadataThrowable extends EntityThrowable { public EntityMetadataThrowable(World world) { super(world); } public EntityMetadataThrowable(World world, EntityLivingBase entityLivingBase) { super(world, entityLivingBase); } public EntityMetadataThrowable(World world, double x, double y, double z) { super(world); } @Override protected void onImpact(MovingObjectPosition p_70184_1_) { } public String getTexture() { return ""; } }
[ "alex.rowlands" ]
alex.rowlands
1ee62b72262d3d5aefc9f65abf795867c37783ba
43472d4fd7597940a2c622bf11a69c2620df878a
/src/Main.java
ad46857e9b53510f29e701364d8ea9b87a09dd27
[]
no_license
kitlawes/website-downloader
64de7deba1f38755b51a8dc5bc88c8b6be06196e
f6da2dc1383f711d310780a7fedfc4febba53e83
refs/heads/master
2020-04-01T18:04:36.705119
2018-10-18T15:07:02
2018-10-18T15:07:02
153,469,955
0
0
null
null
null
null
UTF-8
Java
false
false
244
java
class Main { public static void main(String[] args) { WebsiteDownloader downloader = new WebsiteDownloader(); downloader.downloadSimplifiedWebPage("https://www.mathsisfun.com/puzzles/lying-about-their-age.html"); } }
[ "kitlawes@hotmail.com" ]
kitlawes@hotmail.com
12e638cdb5cbcdbfbe3c4e3415005ef302e688e4
7a9fd9948f83987cff49a6d57e02c3dc605b67ae
/couponSystemSpring/src/main/java/com/couponSystem/controllers/AdminController.java
2368480dcb3da33fdf3a08a9c7e06997fc1a198a
[]
no_license
mendi8345/CouponSystemSpring
db9add4cb6d4fba09e83f96b6c239846ffe174bf
ad368c8e34a966514454ebc86f90d36f26bc2b24
refs/heads/master
2022-03-04T15:50:07.596344
2019-11-07T16:05:23
2019-11-07T16:05:23
208,362,071
1
0
null
2022-02-10T03:04:22
2019-09-13T23:25:43
Java
UTF-8
Java
false
false
9,002
java
package com.couponSystem.controllers; import java.util.List; import javax.annotation.Resource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.couponSystem.exeptions.InvalidTokenException; import com.couponSystem.javabeans.Company; import com.couponSystem.javabeans.Customer; import com.couponSystem.javabeans.Income; import com.couponSystem.service.AdminService; import com.couponSystem.service.IncomeService; import com.couponSystem.utils.Tokens; @RestController @RequestMapping("/admin") public class AdminController { @Autowired private IncomeService incomeService; @Resource private Tokens tokens; public AdminService getAdminService(String token) { try { if (this.tokens.getTokens().containsKey(token)) { AdminService adminService = (AdminService) this.tokens.getTokens().get(token).getCouponClient(); return adminService; } else { throw new InvalidTokenException("Invalid token: ", token); } } catch (InvalidTokenException e) { System.out.println(e.getMessage()); } return null; } @PostMapping("/createCompany/{token}") public ResponseEntity<String> createCompany(@RequestBody Company company, @PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { return new ResponseEntity<>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } adminService.createCompany(company); ResponseEntity<String> result = new ResponseEntity<String>("company created " + company.toString(), HttpStatus.OK); return result; } @DeleteMapping("/deleteCompany/{id}/{token}") public ResponseEntity<String> removeCompany(@PathVariable long id, @PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { return new ResponseEntity<>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } adminService.removeCompany(id); ResponseEntity<String> result = new ResponseEntity<String>("company with id " + id + " deleted Successfully ", HttpStatus.OK); return result; } @PostMapping("/updateCompany/{token}") public ResponseEntity<String> updateCompany(@PathVariable String token, @RequestParam long id, @RequestParam String email, @RequestParam String password) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { System.out.println("111111111111111"); return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } adminService.updateCompany(id, email, password); ResponseEntity<String> result = new ResponseEntity<String>(adminService.getCompany(id).toString(), HttpStatus.OK); return result; } @GetMapping("/getCompany/{id}/{token}") public ResponseEntity<?> getCompany(@PathVariable long id, @PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { System.out.println("111111111111111"); return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } Company company = adminService.getCompany(id); ResponseEntity<Company> result = new ResponseEntity<Company>(company, HttpStatus.OK); return result; } @GetMapping("/getAllCompanies/{token}") public ResponseEntity<?> getAllCompanies(@PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { System.out.println("111111111111111"); // return new ResponseEntity<String>("Invalid token to Admin: " + token, // HttpStatus.UNAUTHORIZED); } ResponseEntity<List<Company>> result = new ResponseEntity<List<Company>>(adminService.getAllCompany(), HttpStatus.OK); return result; } @PostMapping("/createCustomer/{token}") public ResponseEntity<String> createCustomer(@RequestBody Customer customer, @PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { System.out.println("111111111111111"); return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } adminService.insertCustomer(customer); ResponseEntity<String> result = new ResponseEntity<String>("customer created " + customer, HttpStatus.OK); return result; } @DeleteMapping("/deleteCustomer/{id}/{token}") public ResponseEntity<String> removeCustomer(@PathVariable long id, @PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { System.out.println("111111111111111"); return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } adminService.removeCustomer(id); ResponseEntity<String> result = new ResponseEntity<String>("customer with id " + id + " deleted Successfully ", HttpStatus.OK); return result; } @PostMapping("/updateCustomer/{token}/") public ResponseEntity<String> updateCustomer(@PathVariable String token, @RequestParam long id, @RequestParam String password) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } Customer customer = null; customer = adminService.getCustomer(id); customer.setPassword(password); adminService.updateCustomer(customer); ResponseEntity<String> result = new ResponseEntity<String>(customer.toString(), HttpStatus.OK); return result; } @GetMapping("/getCustomer/{id}/{token}") public ResponseEntity<?> getCompamy(@PathVariable long id, @PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { System.out.println("111111111111111"); return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } Customer customer = adminService.getCustomer(id); ResponseEntity<Customer> result = new ResponseEntity<Customer>(customer, HttpStatus.OK); return result; } @GetMapping("/getAllCustomers/{token}") public ResponseEntity<?> getAllCompamy(@PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { System.out.println("111111111111111"); return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } ResponseEntity<List<Customer>> result = new ResponseEntity<List<Customer>>(adminService.getAllCustomer(), HttpStatus.OK); return result; } @GetMapping("/viewAllIncome/{token}") public ResponseEntity<?> viewAllIncome(@PathVariable String token) { AdminService adminService = getAdminService(token); if (adminService == null) { return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } ResponseEntity<List<Income>> result = new ResponseEntity<List<Income>>(this.incomeService.viewAllIncome(), HttpStatus.OK); return result; } @GetMapping("/viewIncomeByCustomerId/{id}/{token}") public ResponseEntity<String> viewIncomeByCustomer(@PathVariable long id, @PathVariable String token) { AdminService adminService = getAdminService(token); if (adminService == null) { return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } ResponseEntity<String> result = new ResponseEntity<String>( "Total Customer Income = " + this.incomeService.viewIncomeByCustomer(id) + " shekels", HttpStatus.OK); return result; } @GetMapping("/viewIncomeByCompanyId/{id}/{token}") public ResponseEntity<String> viewIncomeByCompany(@PathVariable long id, @PathVariable String token) throws Exception { AdminService adminService = getAdminService(token); if (adminService == null) { return new ResponseEntity<String>("Invalid token to Admin: " + token, HttpStatus.UNAUTHORIZED); } ResponseEntity<String> result = new ResponseEntity<String>( "Total Company Income = " + this.incomeService.viewIncomeByCompany(id) + " shekels", HttpStatus.OK); return result; } }
[ "mendi8345@gmail.com" ]
mendi8345@gmail.com
c7222be3fd28a09d3906098d24ff6eb3e39d9032
c17d5c4e2c2c3343a65e47b45bc3257f5a6aeed3
/temp/src/minecraft_server/net/minecraft/src/EntityWither.java
92768aee1f0d478f2fbe8671825cee45685fd432
[]
no_license
errygg/minecraft_modding
b728546027a45a1d5215a92b8b0732217d19373b
02b565ca78b6dd154050e96d1a4c8099fe10f475
refs/heads/master
2021-01-23T07:03:32.629087
2013-05-31T03:44:55
2013-05-31T03:44:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
18,524
java
package net.minecraft.src; import java.util.List; import net.minecraft.src.Block; import net.minecraft.src.DamageSource; import net.minecraft.src.Entity; import net.minecraft.src.EntityAIArrowAttack; import net.minecraft.src.EntityAIHurtByTarget; import net.minecraft.src.EntityAILookIdle; import net.minecraft.src.EntityAINearestAttackableTarget; import net.minecraft.src.EntityAISwimming; import net.minecraft.src.EntityAIWander; import net.minecraft.src.EntityAIWatchClosest; import net.minecraft.src.EntityArrow; import net.minecraft.src.EntityLiving; import net.minecraft.src.EntityMob; import net.minecraft.src.EntityPlayer; import net.minecraft.src.EntityWitherAttackFilter; import net.minecraft.src.EntityWitherSkull; import net.minecraft.src.EnumCreatureAttribute; import net.minecraft.src.IEntitySelector; import net.minecraft.src.IRangedAttackMob; import net.minecraft.src.Item; import net.minecraft.src.MathHelper; import net.minecraft.src.NBTTagCompound; import net.minecraft.src.PotionEffect; import net.minecraft.src.World; public class EntityWither extends EntityMob implements IRangedAttackMob { private float[] field_82220_d = new float[2]; private float[] field_82221_e = new float[2]; private float[] field_82217_f = new float[2]; private float[] field_82218_g = new float[2]; private int[] field_82223_h = new int[2]; private int[] field_82224_i = new int[2]; private int field_82222_j; private static final IEntitySelector field_82219_bJ = new EntityWitherAttackFilter(); public EntityWither(World p_i5065_1_) { super(p_i5065_1_); this.func_70606_j(this.func_70667_aM()); this.field_70750_az = "/mob/wither.png"; this.func_70105_a(0.9F, 4.0F); this.field_70178_ae = true; this.field_70697_bw = 0.6F; this.func_70661_as().func_75495_e(true); this.field_70714_bg.func_75776_a(0, new EntityAISwimming(this)); this.field_70714_bg.func_75776_a(2, new EntityAIArrowAttack(this, this.field_70697_bw, 40, 20.0F)); this.field_70714_bg.func_75776_a(5, new EntityAIWander(this, this.field_70697_bw)); this.field_70714_bg.func_75776_a(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.field_70714_bg.func_75776_a(7, new EntityAILookIdle(this)); this.field_70715_bh.func_75776_a(1, new EntityAIHurtByTarget(this, false)); this.field_70715_bh.func_75776_a(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 30.0F, 0, false, false, field_82219_bJ)); this.field_70728_aV = 50; } protected void func_70088_a() { super.func_70088_a(); this.field_70180_af.func_75682_a(16, new Integer(100)); this.field_70180_af.func_75682_a(17, new Integer(0)); this.field_70180_af.func_75682_a(18, new Integer(0)); this.field_70180_af.func_75682_a(19, new Integer(0)); this.field_70180_af.func_75682_a(20, new Integer(0)); } public void func_70014_b(NBTTagCompound p_70014_1_) { super.func_70014_b(p_70014_1_); p_70014_1_.func_74768_a("Invul", this.func_82212_n()); } public void func_70037_a(NBTTagCompound p_70037_1_) { super.func_70037_a(p_70037_1_); this.func_82215_s(p_70037_1_.func_74762_e("Invul")); this.field_70180_af.func_75692_b(16, Integer.valueOf(this.field_70734_aK)); } protected String func_70639_aQ() { return "mob.wither.idle"; } protected String func_70621_aR() { return "mob.wither.hurt"; } protected String func_70673_aS() { return "mob.wither.death"; } public void func_70636_d() { if(!this.field_70170_p.field_72995_K) { this.field_70180_af.func_75692_b(16, Integer.valueOf(this.field_70734_aK)); } this.field_70181_x *= 0.6000000238418579D; double var4; double var6; double var8; if(!this.field_70170_p.field_72995_K && this.func_82203_t(0) > 0) { Entity var1 = this.field_70170_p.func_73045_a(this.func_82203_t(0)); if(var1 != null) { if(this.field_70163_u < var1.field_70163_u || !this.func_82205_o() && this.field_70163_u < var1.field_70163_u + 5.0D) { if(this.field_70181_x < 0.0D) { this.field_70181_x = 0.0D; } this.field_70181_x += (0.5D - this.field_70181_x) * 0.6000000238418579D; } double var2 = var1.field_70165_t - this.field_70165_t; var4 = var1.field_70161_v - this.field_70161_v; var6 = var2 * var2 + var4 * var4; if(var6 > 9.0D) { var8 = (double)MathHelper.func_76133_a(var6); this.field_70159_w += (var2 / var8 * 0.5D - this.field_70159_w) * 0.6000000238418579D; this.field_70179_y += (var4 / var8 * 0.5D - this.field_70179_y) * 0.6000000238418579D; } } } if(this.field_70159_w * this.field_70159_w + this.field_70179_y * this.field_70179_y > 0.05000000074505806D) { this.field_70177_z = (float)Math.atan2(this.field_70179_y, this.field_70159_w) * 57.295776F - 90.0F; } super.func_70636_d(); int var20; for(var20 = 0; var20 < 2; ++var20) { this.field_82218_g[var20] = this.field_82221_e[var20]; this.field_82217_f[var20] = this.field_82220_d[var20]; } int var21; for(var20 = 0; var20 < 2; ++var20) { var21 = this.func_82203_t(var20 + 1); Entity var3 = null; if(var21 > 0) { var3 = this.field_70170_p.func_73045_a(var21); } if(var3 != null) { var4 = this.func_82214_u(var20 + 1); var6 = this.func_82208_v(var20 + 1); var8 = this.func_82213_w(var20 + 1); double var10 = var3.field_70165_t - var4; double var12 = var3.field_70163_u + (double)var3.func_70047_e() - var6; double var14 = var3.field_70161_v - var8; double var16 = (double)MathHelper.func_76133_a(var10 * var10 + var14 * var14); float var18 = (float)(Math.atan2(var14, var10) * 180.0D / 3.1415927410125732D) - 90.0F; float var19 = (float)(-(Math.atan2(var12, var16) * 180.0D / 3.1415927410125732D)); this.field_82220_d[var20] = this.func_82204_b(this.field_82220_d[var20], var19, 40.0F); this.field_82221_e[var20] = this.func_82204_b(this.field_82221_e[var20], var18, 10.0F); } else { this.field_82221_e[var20] = this.func_82204_b(this.field_82221_e[var20], this.field_70761_aq, 10.0F); } } boolean var22 = this.func_82205_o(); for(var21 = 0; var21 < 3; ++var21) { double var23 = this.func_82214_u(var21); double var5 = this.func_82208_v(var21); double var7 = this.func_82213_w(var21); this.field_70170_p.func_72869_a("smoke", var23 + this.field_70146_Z.nextGaussian() * 0.30000001192092896D, var5 + this.field_70146_Z.nextGaussian() * 0.30000001192092896D, var7 + this.field_70146_Z.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); if(var22 && this.field_70170_p.field_73012_v.nextInt(4) == 0) { this.field_70170_p.func_72869_a("mobSpell", var23 + this.field_70146_Z.nextGaussian() * 0.30000001192092896D, var5 + this.field_70146_Z.nextGaussian() * 0.30000001192092896D, var7 + this.field_70146_Z.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D); } } if(this.func_82212_n() > 0) { for(var21 = 0; var21 < 3; ++var21) { this.field_70170_p.func_72869_a("mobSpell", this.field_70165_t + this.field_70146_Z.nextGaussian() * 1.0D, this.field_70163_u + (double)(this.field_70146_Z.nextFloat() * 3.3F), this.field_70161_v + this.field_70146_Z.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); } } } protected void func_70619_bc() { int var1; if(this.func_82212_n() > 0) { var1 = this.func_82212_n() - 1; if(var1 <= 0) { this.field_70170_p.func_72885_a(this, this.field_70165_t, this.field_70163_u + (double)this.func_70047_e(), this.field_70161_v, 7.0F, false, this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")); this.field_70170_p.func_82739_e(1013, (int)this.field_70165_t, (int)this.field_70163_u, (int)this.field_70161_v, 0); } this.func_82215_s(var1); if(this.field_70173_aa % 10 == 0) { this.func_70691_i(10); } } else { super.func_70619_bc(); int var12; for(var1 = 1; var1 < 3; ++var1) { if(this.field_70173_aa >= this.field_82223_h[var1 - 1]) { this.field_82223_h[var1 - 1] = this.field_70173_aa + 10 + this.field_70146_Z.nextInt(10); if(this.field_70170_p.field_73013_u >= 2) { int var10001 = var1 - 1; int var10003 = this.field_82224_i[var1 - 1]; this.field_82224_i[var10001] = this.field_82224_i[var1 - 1] + 1; if(var10003 > 15) { float var2 = 10.0F; float var3 = 5.0F; double var4 = MathHelper.func_82716_a(this.field_70146_Z, this.field_70165_t - (double)var2, this.field_70165_t + (double)var2); double var6 = MathHelper.func_82716_a(this.field_70146_Z, this.field_70163_u - (double)var3, this.field_70163_u + (double)var3); double var8 = MathHelper.func_82716_a(this.field_70146_Z, this.field_70161_v - (double)var2, this.field_70161_v + (double)var2); this.func_82209_a(var1 + 1, var4, var6, var8, true); this.field_82224_i[var1 - 1] = 0; } } var12 = this.func_82203_t(var1); if(var12 > 0) { Entity var14 = this.field_70170_p.func_73045_a(var12); if(var14 != null && var14.func_70089_S() && this.func_70068_e(var14) <= 900.0D && this.func_70685_l(var14)) { this.func_82216_a(var1 + 1, (EntityLiving)var14); this.field_82223_h[var1 - 1] = this.field_70173_aa + 40 + this.field_70146_Z.nextInt(20); this.field_82224_i[var1 - 1] = 0; } else { this.func_82211_c(var1, 0); } } else { List var13 = this.field_70170_p.func_82733_a(EntityLiving.class, this.field_70121_D.func_72314_b(20.0D, 8.0D, 20.0D), field_82219_bJ); for(int var16 = 0; var16 < 10 && !var13.isEmpty(); ++var16) { EntityLiving var5 = (EntityLiving)var13.get(this.field_70146_Z.nextInt(var13.size())); if(var5 != this && var5.func_70089_S() && this.func_70685_l(var5)) { if(var5 instanceof EntityPlayer) { if(!((EntityPlayer)var5).field_71075_bZ.field_75102_a) { this.func_82211_c(var1, var5.field_70157_k); } } else { this.func_82211_c(var1, var5.field_70157_k); } break; } var13.remove(var5); } } } } if(this.func_70638_az() != null) { this.func_82211_c(0, this.func_70638_az().field_70157_k); } else { this.func_82211_c(0, 0); } if(this.field_82222_j > 0) { --this.field_82222_j; if(this.field_82222_j == 0 && this.field_70170_p.func_82736_K().func_82766_b("mobGriefing")) { var1 = MathHelper.func_76128_c(this.field_70163_u); var12 = MathHelper.func_76128_c(this.field_70165_t); int var15 = MathHelper.func_76128_c(this.field_70161_v); boolean var18 = false; for(int var17 = -1; var17 <= 1; ++var17) { for(int var19 = -1; var19 <= 1; ++var19) { for(int var7 = 0; var7 <= 3; ++var7) { int var20 = var12 + var17; int var9 = var1 + var7; int var10 = var15 + var19; int var11 = this.field_70170_p.func_72798_a(var20, var9, var10); if(var11 > 0 && var11 != Block.field_71986_z.field_71990_ca && var11 != Block.field_72102_bH.field_71990_ca && var11 != Block.field_72104_bI.field_71990_ca) { var18 = this.field_70170_p.func_94578_a(var20, var9, var10, true) || var18; } } } } if(var18) { this.field_70170_p.func_72889_a((EntityPlayer)null, 1012, (int)this.field_70165_t, (int)this.field_70163_u, (int)this.field_70161_v, 0); } } } if(this.field_70173_aa % 20 == 0) { this.func_70691_i(1); } } } public void func_82206_m() { this.func_82215_s(220); this.func_70606_j(this.func_70667_aM() / 3); } public void func_70110_aj() {} public int func_70658_aO() { return 4; } private double func_82214_u(int p_82214_1_) { if(p_82214_1_ <= 0) { return this.field_70165_t; } else { float var2 = (this.field_70761_aq + (float)(180 * (p_82214_1_ - 1))) / 180.0F * 3.1415927F; float var3 = MathHelper.func_76134_b(var2); return this.field_70165_t + (double)var3 * 1.3D; } } private double func_82208_v(int p_82208_1_) { return p_82208_1_ <= 0?this.field_70163_u + 3.0D:this.field_70163_u + 2.2D; } private double func_82213_w(int p_82213_1_) { if(p_82213_1_ <= 0) { return this.field_70161_v; } else { float var2 = (this.field_70761_aq + (float)(180 * (p_82213_1_ - 1))) / 180.0F * 3.1415927F; float var3 = MathHelper.func_76126_a(var2); return this.field_70161_v + (double)var3 * 1.3D; } } private float func_82204_b(float p_82204_1_, float p_82204_2_, float p_82204_3_) { float var4 = MathHelper.func_76142_g(p_82204_2_ - p_82204_1_); if(var4 > p_82204_3_) { var4 = p_82204_3_; } if(var4 < -p_82204_3_) { var4 = -p_82204_3_; } return p_82204_1_ + var4; } private void func_82216_a(int p_82216_1_, EntityLiving p_82216_2_) { this.func_82209_a(p_82216_1_, p_82216_2_.field_70165_t, p_82216_2_.field_70163_u + (double)p_82216_2_.func_70047_e() * 0.5D, p_82216_2_.field_70161_v, p_82216_1_ == 0 && this.field_70146_Z.nextFloat() < 0.0010F); } private void func_82209_a(int p_82209_1_, double p_82209_2_, double p_82209_4_, double p_82209_6_, boolean p_82209_8_) { this.field_70170_p.func_72889_a((EntityPlayer)null, 1014, (int)this.field_70165_t, (int)this.field_70163_u, (int)this.field_70161_v, 0); double var9 = this.func_82214_u(p_82209_1_); double var11 = this.func_82208_v(p_82209_1_); double var13 = this.func_82213_w(p_82209_1_); double var15 = p_82209_2_ - var9; double var17 = p_82209_4_ - var11; double var19 = p_82209_6_ - var13; EntityWitherSkull var21 = new EntityWitherSkull(this.field_70170_p, this, var15, var17, var19); if(p_82209_8_) { var21.func_82343_e(true); } var21.field_70163_u = var11; var21.field_70165_t = var9; var21.field_70161_v = var13; this.field_70170_p.func_72838_d(var21); } public void func_82196_d(EntityLiving p_82196_1_, float p_82196_2_) { this.func_82216_a(0, p_82196_1_); } public boolean func_70097_a(DamageSource p_70097_1_, int p_70097_2_) { if(this.func_85032_ar()) { return false; } else if(p_70097_1_ == DamageSource.field_76369_e) { return false; } else if(this.func_82212_n() > 0) { return false; } else { Entity var3; if(this.func_82205_o()) { var3 = p_70097_1_.func_76364_f(); if(var3 instanceof EntityArrow) { return false; } } var3 = p_70097_1_.func_76346_g(); if(var3 != null && !(var3 instanceof EntityPlayer) && var3 instanceof EntityLiving && ((EntityLiving)var3).func_70668_bt() == this.func_70668_bt()) { return false; } else { if(this.field_82222_j <= 0) { this.field_82222_j = 20; } for(int var4 = 0; var4 < this.field_82224_i.length; ++var4) { this.field_82224_i[var4] += 3; } return super.func_70097_a(p_70097_1_, p_70097_2_); } } } protected void func_70628_a(boolean p_70628_1_, int p_70628_2_) { this.func_70025_b(Item.field_82792_bS.field_77779_bT, 1); } protected void func_70623_bb() { this.field_70708_bq = 0; } public boolean func_70067_L() { return !this.field_70128_L; } public int func_70968_i() { return this.field_70180_af.func_75679_c(16); } protected void func_70069_a(float p_70069_1_) {} public void func_70690_d(PotionEffect p_70690_1_) {} protected boolean func_70650_aV() { return true; } public int func_70667_aM() { return 300; } public int func_82212_n() { return this.field_70180_af.func_75679_c(20); } public void func_82215_s(int p_82215_1_) { this.field_70180_af.func_75692_b(20, Integer.valueOf(p_82215_1_)); } public int func_82203_t(int p_82203_1_) { return this.field_70180_af.func_75679_c(17 + p_82203_1_); } public void func_82211_c(int p_82211_1_, int p_82211_2_) { this.field_70180_af.func_75692_b(17 + p_82211_1_, Integer.valueOf(p_82211_2_)); } public boolean func_82205_o() { return this.func_70968_i() <= this.func_70667_aM() / 2; } public EnumCreatureAttribute func_70668_bt() { return EnumCreatureAttribute.UNDEAD; } public void func_70078_a(Entity p_70078_1_) { this.field_70154_o = null; } }
[ "erik@imbutechnologies.com" ]
erik@imbutechnologies.com
58f6536a5a408b6893412877d723ea62b51e355a
3e8a6caad792fb50917b605ec4029660708fdcd9
/app/src/main/java/com/diego/lina/sistemadealmacenes/FirmaEnFragment.java
cac9bf8c792de24b8247971899625428c1aeff20
[]
no_license
DiegoAltamirano13/Sistema_Android
942bee9331a62c4a77e5fbb3efaab003f0f51552
31d826f14320882bf5e4f35925119c8cf296bafc
refs/heads/master
2022-08-20T05:28:31.219052
2020-05-25T15:32:07
2020-05-25T15:32:07
266,815,260
0
0
null
null
null
null
UTF-8
Java
false
false
2,187
java
package com.diego.lina.sistemadealmacenes; import android.content.Context; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import com.diego.lina.sistemadealmacenes.ClassCanvas.ClassCanvas; public class FirmaEnFragment extends Fragment { private ClassCanvas canvas; Button btn_aceptar, btn_limpiar ; Bitmap bitmaps; public FirmaEnFragment() { } public static FirmaEnFragment newInstance(String param1, String param2) { FirmaEnFragment fragment = new FirmaEnFragment(); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View fragmento = inflater.inflate(R.layout.fragment_firma_en, container, false); btn_aceptar = fragmento.findViewById(R.id.firma_aceptar); btn_aceptar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { canvas.Guardar(); ImportFragment rp = new ImportFragment(); FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.replace(R.id.contenedor, rp); transaction.addToBackStack(null); transaction.commit(); } }); btn_limpiar = fragmento.findViewById(R.id.Limpiar); btn_limpiar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { canvas.Limpiar(); } }); canvas = fragmento.findViewById(R.id.view); return fragmento; } //public void Limpiar(View view) { // canvas.Limpiar(); //} //public void Guardar2(View view){ // canvas.Guardar(); //} }
[ "arcuos1113@gmail.com" ]
arcuos1113@gmail.com
d6c105e428155efa3f9c0a8bb2ab893da5283a67
b2e40df9da0e78c26666240715fb0fadacba1991
/app/src/main/java/com/tanishqbhatia/truthordare/utils/constants/WebsiteCons.java
cc419175a8ed763f3f608e9650b9d1384debd463
[]
no_license
tanishqbhatia/TruthorDare
7a0407b9531e0769f25c76f9ce24d13b0b9d2616
c3aaa07ea4ed9fc40e4f1bbe7c68209c95983162
refs/heads/master
2021-01-16T17:57:30.485699
2017-09-05T12:14:04
2017-09-05T12:14:04
100,026,172
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package com.tanishqbhatia.truthordare.utils.constants; import com.tanishqbhatia.truthordare.App; import com.tanishqbhatia.truthordare.R; /** * Created by Tanishq Bhatia on 16-08-2017 at 11:47. * Email address : crash0er@gmail.com * Contact number : +919780702709 */ public class WebsiteCons { public static final String WEBSITE_URL_ORIGINAL = App.get().getResources().getString(R.string.website_url); public static final String IDENTIFY = "identify.php"; public static final String GET_USER_HEADER = "getUserHeader.php"; public static final String GET_USER_POSTS = "getUserPosts.php"; }
[ "crash0er@gmail.com" ]
crash0er@gmail.com
9d44a5a51190da6997c4d467b36013f24ac0e5b3
f4cbde8a1599f3e57c5a27abae88ba1e8c21db1d
/app/src/main/java/btp/psychosocialeducationapp/ViewHolder.java
0578a379aab66918762bd0a313ff8bdf3b36cb85
[]
no_license
kartik95/BTP-InformationCapsule
5faed84f14736b2212b83c79ec75ae6f69ef2a25
6cb7373e92aeb00723d6bb268e715394871b3c11
refs/heads/master
2021-01-19T10:45:57.795466
2017-02-16T19:30:50
2017-02-16T19:30:50
82,216,169
0
0
null
null
null
null
UTF-8
Java
false
false
833
java
package btp.psychosocialeducationapp; /** * Created by gkartik on 7/2/17. */ import android.media.Image; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.AdapterView; import android.widget.ImageView; import android.widget.TextView; public abstract class ViewHolder extends RecyclerView.ViewHolder{ public TextView title; public ImageView image; public TextView date; public CardView cardView; public ViewHolder(View view) { super(view); this.title = (TextView) view.findViewById(R.id.title); this.image = (ImageView) view.findViewById(R.id.thumbnail); this.date = (TextView) view.findViewById(R.id.date); this.cardView = (CardView) view.findViewById(R.id.cardView); } }
[ "kartik13050@iiitd.ac.in" ]
kartik13050@iiitd.ac.in
6bff436155cf2769e8b14e637abc0d568c32e5c0
7b78a4fc49a1177c7db2a84cc7c1c74449fe08c7
/src/com/remote_interface/ILogService.java
4bd9cb0aa4a39ca7461f4b579bf631e32893d492
[]
no_license
TerenceZH/IOSCommon
4b39d46ac5443f2ba95821c23850653d1fcfd1f5
2d88fbcdb99fe5febeb1d868503eb8aa27619f5d
refs/heads/master
2021-01-20T12:01:07.258327
2014-12-23T14:55:49
2014-12-23T14:55:49
null
0
0
null
null
null
null
GB18030
Java
false
false
989
java
package com.remote_interface; import java.rmi.Remote; import java.rmi.RemoteException; import java.util.ArrayList; import com.model.Log; public interface ILogService extends Remote{ /** * 查找日志 所有时间string 格式 yyyy-MM-dd * @param startTime * @param endTime * @param type * @return 不存在返回 空array * @throws RemoteException */ public ArrayList<Log> queryLog(String startTime,String endTime,String type)throws RemoteException; /** * 查找日志 * @param type * @return * @throws RemoteException */ public ArrayList<Log> queryLog(String type)throws RemoteException; /** * 查找日志 * @param startTime * @param endTime * @return * @throws RemoteException */ public ArrayList<Log> queryLog(String startTime,String endTime)throws RemoteException; /** * 所有 * @return * @throws RemoteException */ public ArrayList<Log> queryLog() throws RemoteException; }
[ "Administrator@172.17.133.197" ]
Administrator@172.17.133.197
3f69915f937ccba5d04e87430201b060df6e7f25
456e5df877c8b7b786c8bbdee9066aa4480f92d3
/CoreNLP/src/edu/stanford/nlp/loglinear/model/GraphicalModel.java
be15771fe861e117ca5235245fbee35aab50f9ba
[]
no_license
matthewgarber/COSI_134_Final
763882c4b25fe6fe4192c4f3986b33931b6217d1
5dbadc01af73fc7068b0a156d383f6f126dae1e5
refs/heads/master
2021-01-12T06:59:42.702118
2016-12-19T20:13:39
2016-12-19T20:13:39
76,886,459
0
0
null
null
null
null
UTF-8
Java
false
false
13,279
java
package edu.stanford.nlp.loglinear.model; import edu.stanford.nlp.loglinear.model.proto.GraphicalModelProto; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.*; import java.util.function.Function; /** * Created on 8/7/15. * @author keenon * <p> * A basic graphical model representation: Factors and Variables. This should be a fairly familiar interface to anybody * who's taken a basic PGM course (eg https://www.coursera.org/course/pgm). The key points: * - Stitching together feature factors * - Attaching metadata to everything, so that different sections of the program can communicate in lots of unplanned * ways. For now, the planned meta-data is a lot of routing and status information to do with LENSE. * <p> * This is really just the data structure, and inference lives elsewhere and must use public interfaces to access these * models. We just provide basic utility functions here, and barely do that, because we pass through directly to maps * wherever appropriate. */ public class GraphicalModel { public Map<String, String> modelMetaData = new HashMap<>(); public List<Map<String, String>> variableMetaData = new ArrayList<>(); public Set<Factor> factors = new HashSet<>(); /** * A single factor in this graphical model. ConcatVectorTable can be reused multiple times if the same graph (or different * ones) and this is the glue object that tells a model where the factor lives, and what it is connected to. */ public static class Factor { public ConcatVectorTable featuresTable; public int[] neigborIndices; public Map<String, String> metaData = new HashMap<>(); /** * DO NOT USE. FOR SERIALIZATION ONLY. */ private Factor() { } public Factor(ConcatVectorTable featuresTable, int[] neighborIndices) { this.featuresTable = featuresTable; this.neigborIndices = neighborIndices; } /** * @return the factor meta-data, by reference */ public Map<String, String> getMetaDataByReference() { return metaData; } /** * Does a deep comparison, using equality with tolerance checks against the vector table of values. * * @param other the factor to compare to * @param tolerance the tolerance to accept in differences * @return whether the two factors are within tolerance of one another */ public boolean valueEquals(Factor other, double tolerance) { return Arrays.equals(neigborIndices, other.neigborIndices) && metaData.equals(other.metaData) && featuresTable.valueEquals(other.featuresTable, tolerance); } public GraphicalModelProto.Factor.Builder getProtoBuilder() { GraphicalModelProto.Factor.Builder builder = GraphicalModelProto.Factor.newBuilder(); for (int neighbor : neigborIndices) { builder.addNeighbor(neighbor); } builder.setFeaturesTable(featuresTable.getProtoBuilder()); builder.setMetaData(GraphicalModel.getProtoMetaDataBuilder(metaData)); return builder; } public static Factor readFromProto(GraphicalModelProto.Factor proto) { Factor factor = new Factor(); factor.featuresTable = ConcatVectorTable.readFromProto(proto.getFeaturesTable()); factor.metaData = GraphicalModel.readMetaDataFromProto(proto.getMetaData()); factor.neigborIndices = new int[proto.getNeighborCount()]; for (int i = 0; i < factor.neigborIndices.length; i++) { factor.neigborIndices[i] = proto.getNeighbor(i); } return factor; } /** * Duplicates this factor. * * @return a copy of the factor */ public Factor cloneFactor() { Factor clone = new Factor(); clone.neigborIndices = neigborIndices.clone(); clone.featuresTable = featuresTable.cloneTable(); clone.metaData.putAll(metaData); return clone; } } /** * @return a reference to the model meta-data */ public Map<String, String> getModelMetaDataByReference() { return modelMetaData; } /** * Gets the metadata for a variable. Creates blank metadata if does not exists, then returns that. Pass by reference. * * @param variableIndex the variable number, 0 indexed, to retrieve * @return the metadata map corresponding to that variable number */ public synchronized Map<String, String> getVariableMetaDataByReference(int variableIndex) { while (variableIndex >= variableMetaData.size()) { variableMetaData.add(new HashMap<>()); } return variableMetaData.get(variableIndex); } /** * This is the preferred way to add factors to a graphical model. Specify the neighbors, their dimensions, and a * function that maps from variable assignments to ConcatVector's of features, and this function will handle the * data flow of constructing and populating a factor matching those specifications. * <p> * IMPORTANT: assignmentFeaturizer must be REPEATABLE and NOT HAVE SIDE EFFECTS * This is because it is actually stored as a lazy closure until the full featurized vector is needed, and then it * is created, used, and discarded. It CAN BE CALLED MULTIPLE TIMES, and must always return the same value in order * for behavior of downstream systems to be defined. * * @param neighborIndices the names of the variables, as indices * @param neighborDimensions the sizes of the neighbor variables, corresponding to the order in neighborIndices * @param assignmentFeaturizer a function that maps from an assignment to the variables, represented as an array of * assignments in the same order as presented in neighborIndices, to a ConcatVector of * features for that assignment. * @return a reference to the created factor. This can be safely ignored, as the factor is already saved in the model */ public Factor addFactor(int[] neighborIndices, int[] neighborDimensions, Function<int[], ConcatVector> assignmentFeaturizer) { ConcatVectorTable features = new ConcatVectorTable(neighborDimensions); for (int[] assignment : features) { features.setAssignmentValue(assignment, () -> assignmentFeaturizer.apply(assignment)); } return addFactor(features, neighborIndices); } /** * Creates an instantiated factor in this graph, with neighborIndices representing the neighbor variables by integer * index. * * @param featureTable the feature table to use to drive the value of the factor * @param neighborIndices the indices of the neighboring variables, in order * @return a reference to the created factor. This can be safely ignored, as the factor is already saved in the model */ public Factor addFactor(ConcatVectorTable featureTable, int[] neighborIndices) { assert (featureTable.getDimensions().length == neighborIndices.length); Factor factor = new Factor(featureTable, neighborIndices); factors.add(factor); return factor; } /** * @return an array of integers, indicating variable sizes given by each of the factors in the model */ public int[] getVariableSizes() { if (factors.size() == 0) { return new int[0]; } int maxVar = 0; for (Factor f : factors) { for (int n : f.neigborIndices) { if (n > maxVar) maxVar = n; } } int[] sizes = new int[maxVar + 1]; for (int i = 0; i < sizes.length; i++) { sizes[i] = -1; } for (Factor f : factors) { for (int i = 0; i < f.neigborIndices.length; i++) { sizes[f.neigborIndices[i]] = f.featuresTable.getDimensions()[i]; } } return sizes; } /** * Writes the protobuf version of this graphical model to a stream. reversible with readFromStream(). * * @param stream the output stream to write to * @throws IOException passed through from the stream */ public void writeToStream(OutputStream stream) throws IOException { getProtoBuilder().build().writeDelimitedTo(stream); } /** * Static function to deserialize a graphical model from an input stream. * * @param stream the stream to read from, assuming protobuf encoding * @return a new graphical model * @throws IOException passed through from the stream */ public static GraphicalModel readFromStream(InputStream stream) throws IOException { return readFromProto(GraphicalModelProto.GraphicalModel.parseDelimitedFrom(stream)); } /** * @return the proto builder corresponding to this GraphicalModel */ public GraphicalModelProto.GraphicalModel.Builder getProtoBuilder() { GraphicalModelProto.GraphicalModel.Builder builder = GraphicalModelProto.GraphicalModel.newBuilder(); builder.setMetaData(getProtoMetaDataBuilder(modelMetaData)); for (Map<String, String> metaData : variableMetaData) { builder.addVariableMetaData(getProtoMetaDataBuilder(metaData)); } for (Factor factor : factors) { builder.addFactor(factor.getProtoBuilder()); } return builder; } /** * Recreates an in-memory GraphicalModel from a proto serialization, recursively creating all the ConcatVectorTable's * and ConcatVector's in memory as well. * * @param proto the proto to read * @return an in-memory GraphicalModel */ public static GraphicalModel readFromProto(GraphicalModelProto.GraphicalModel proto) { if (proto == null) return null; GraphicalModel model = new GraphicalModel(); model.modelMetaData = readMetaDataFromProto(proto.getMetaData()); model.variableMetaData = new ArrayList<>(); for (int i = 0; i < proto.getVariableMetaDataCount(); i++) { model.variableMetaData.add(readMetaDataFromProto(proto.getVariableMetaData(i))); } for (int i = 0; i < proto.getFactorCount(); i++) { model.factors.add(Factor.readFromProto(proto.getFactor(i))); } return model; } /** * Check that two models are deeply value-equivalent, down to the concat vectors inside the factor tables, within * some tolerance. Mostly useful for testing. * * @param other the graphical model to compare against. * @param tolerance the tolerance to accept when comparing concat vectors for value equality. * @return whether the two models are tolerance equivalent */ public boolean valueEquals(GraphicalModel other, double tolerance) { if (!modelMetaData.equals(other.modelMetaData)) { return false; } if (!variableMetaData.equals(other.variableMetaData)) { return false; } // compare factor sets for equality Set<Factor> remaining = new HashSet<>(); remaining.addAll(factors); for (Factor otherFactor : other.factors) { Factor match = null; for (Factor factor : remaining) { if (factor.valueEquals(otherFactor, tolerance)) { match = factor; break; } } if (match == null) return false; else remaining.remove(match); } return remaining.size() <= 0; } /** * Displays a list of factors, by neighbor. * * @return a formatted list of factors, by neighbor */ @Override public String toString() { String s = "{"; for (Factor f : factors) { s += "\n\t" + Arrays.toString(f.neigborIndices) + "@" + f; } s += "\n}"; return s; } /** * The point here is to allow us to save a copy of the model with a current set of factors and metadata mappings, * which can come in super handy with gameplaying applications. The cloned model doesn't instantiate the feature * thunks inside factors, those are just taken over individually. * * @return a clone */ public GraphicalModel cloneModel() { GraphicalModel clone = new GraphicalModel(); clone.modelMetaData.putAll(modelMetaData); for (int i = 0; i < variableMetaData.size(); i++) { if (variableMetaData.get(i) != null) { clone.getVariableMetaDataByReference(i).putAll(variableMetaData.get(i)); } } for (Factor f : factors) { clone.factors.add(f.cloneFactor()); } return clone; } //////////////////////////////////////////////////////////////////////////// // PRIVATE IMPLEMENTATION //////////////////////////////////////////////////////////////////////////// private static GraphicalModelProto.MetaData.Builder getProtoMetaDataBuilder(Map<String, String> metaData) { GraphicalModelProto.MetaData.Builder builder = GraphicalModelProto.MetaData.newBuilder(); for (String key : metaData.keySet()) { builder.addKey(key); builder.addValue(metaData.get(key)); } return builder; } private static Map<String, String> readMetaDataFromProto(GraphicalModelProto.MetaData proto) { Map<String, String> metaData = new HashMap<>(); for (int i = 0; i < proto.getKeyCount(); i++) { metaData.put(proto.getKey(i), proto.getValue(i)); } return metaData; } }
[ "mgarber@brandeis.edu" ]
mgarber@brandeis.edu
0261b882793d4aaf4636959a465fbc5e7aa7e254
a1ae20e063cc0d53b42a46dcc5fcad895b5733ab
/sp-mtcmcs/src/test/java/com/kedacom/jkzx/mtcmcs/AppTest.java
0edadbd79b32b3e9b24ac1e123798e7fe98032ff
[]
no_license
sunlingfeng-daren/sp-parent-1.0.0
8108ac0cdb1159451b71cf0541723ad6d8f94a0d
621f30779bada1f0eb67d898f1c9df2b19472237
refs/heads/master
2021-01-24T06:34:44.093524
2014-11-14T11:23:45
2014-11-14T11:23:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
651
java
package com.kedacom.jkzx.mtcmcs; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } }
[ "sunlingfeng@jldaren.com" ]
sunlingfeng@jldaren.com
f193df21d508535ccbcc26b88d033a3c8c353b20
ef6fead2bf1aaedbef0707b5ad900c1bfe52e0eb
/yjy/src/main/java/com/yjy998/common/entity/Contract.java
b9b24f6a6ab3b0dc2ee5f27982bd92a7ebffa0df
[]
no_license
summerEnd/Svmuu
431f404a90c7d3b53162952b28d4012ef6a3a2f2
e9ec97bcbcafa52175c4490dd7be7f751334ff7e
refs/heads/master
2021-01-23T08:57:01.926816
2015-07-15T10:16:06
2015-07-15T10:16:06
33,851,430
0
0
null
null
null
null
UTF-8
Java
false
false
1,007
java
package com.yjy998.common.entity; import java.io.Serializable; public class Contract implements Serializable { public String contract_name; public String uid; public String verify_date; public String new_rate; public String contract_no; public String prod_id; public String cash_amount; public String apply_amount; public String fee_type; public String type; public String contract_type; public String verify_user; public String real_end_time; public String real_end_remark; public String id; public String rate; public String update_time; public String verify_status; public String end_time; public String trade_amount; public String start_time; public String add_time; public String quan_amount; public static String getType(String type) { if ("2".equals(type)) { return "T+N"; } else if ("3".equals(type)) { return "T+9"; } return null; } }
[ "771509565@qq.com" ]
771509565@qq.com
2ec7ec3e7df9c49cd1ed73fd982ddbb5af410798
2b2a9bf893cb5d9454b16fbc6d7bd2343742d27d
/src/main/java/com/shallowan/seckill/rabbitmq/SeckillMessage.java
5697bb30e06bbdf272d4143a63b0d52248d1632d
[ "Apache-2.0" ]
permissive
461907095/newSeckills
b7be08546ccc083bd3d3dbf06a04468a6ec872c7
aa87dc217f27d347339af6846ff258eb505f56ed
refs/heads/master
2022-06-27T16:53:34.751772
2019-08-09T02:10:22
2019-08-09T02:10:22
201,368,678
1
0
Apache-2.0
2022-06-17T02:20:55
2019-08-09T01:54:47
Java
UTF-8
Java
false
false
437
java
package com.shallowan.seckill.rabbitmq; import com.shallowan.seckill.domain.SeckillUser; import lombok.Data; /** * @author ShallowAn */ @Data public class SeckillMessage { private SeckillUser seckillUser; private long goodsId; @Override public String toString() { return "SeckillMessage{" + "seckillUser=" + seckillUser + ", goodsId=" + goodsId + '}'; } }
[ "liupei521@live.com" ]
liupei521@live.com
186f80d6b51f264e05ee529fa8ea291a8c9ac0b8
8312fc87643ad88b8663f2758a86152510052734
/app/src/main/java/com/jonnyb/wtf/constants/Constants.java
4a3d0a3497c4b5a749d8ba0b611cb2d4f80fc7dc
[]
no_license
MarcelHarvan/FoodTR
587d60e21d0dfbcd20a0143133f17032ec42dc42
9eabb86f24dc26dd95d8d235b3a1fe8ce9cd1a59
refs/heads/master
2021-05-06T12:50:04.814456
2017-12-05T14:03:44
2017-12-05T14:03:44
113,189,474
0
0
null
null
null
null
UTF-8
Java
false
false
800
java
package com.jonnyb.wtf.constants; /** * Created by jonnyb on 11/21/16. */ public class Constants { public final static String GET_FOOD_TRUCKS = "http://192.168.0.143:3005/api/v1/foodtruck"; public final static String GET_REVIEWS = "http://192.168.0.143:3005/api/v1/foodtruck/reviews/"; public final static String REGISTER = "http://192.168.0.143:3005/api/v1/account/register"; public final static String LOGIN = "http://192.168.0.143:3005/api/v1/account/login"; public final static String ADD_REVIEW = "http://192.168.0.143:3005/api/v1/foodtruck/reviews/add/"; public final static String ADD_TRUCK = "http://192.168.0.143:3005/api/v1/foodtruck/add"; public final static String AUTH_TOKEN = "AuthToken"; public final static String IS_LOGGED_IN = "IsLoggedIn"; }
[ "marcel.harvan@gmail.com" ]
marcel.harvan@gmail.com
e97c5754c924fa4f9fca7ac1e0885cc0b1838e92
4a5f24baf286458ddde8658420faf899eb22634b
/aws-java-sdk-directconnect/src/main/java/com/amazonaws/services/directconnect/model/transform/DeleteDirectConnectGatewayAssociationRequestProtocolMarshaller.java
aa5a8baa767fa98a0922a053e20f2cbc95e16163
[ "Apache-2.0" ]
permissive
gopinathrsv/aws-sdk-java
c2876eaf019ac00714724002d91d18fadc4b4a60
97b63ab51f2e850d22e545154e40a33601790278
refs/heads/master
2021-05-14T17:18:16.335069
2017-12-29T19:49:30
2017-12-29T19:49:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,003
java
/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.directconnect.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.Request; import com.amazonaws.http.HttpMethodName; import com.amazonaws.services.directconnect.model.*; import com.amazonaws.transform.Marshaller; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * DeleteDirectConnectGatewayAssociationRequest Marshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class DeleteDirectConnectGatewayAssociationRequestProtocolMarshaller implements Marshaller<Request<DeleteDirectConnectGatewayAssociationRequest>, DeleteDirectConnectGatewayAssociationRequest> { private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.AWS_JSON).requestUri("/") .httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true) .operationIdentifier("OvertureService.DeleteDirectConnectGatewayAssociation").serviceName("AmazonDirectConnect").build(); private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory; public DeleteDirectConnectGatewayAssociationRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) { this.protocolFactory = protocolFactory; } public Request<DeleteDirectConnectGatewayAssociationRequest> marshall( DeleteDirectConnectGatewayAssociationRequest deleteDirectConnectGatewayAssociationRequest) { if (deleteDirectConnectGatewayAssociationRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { final ProtocolRequestMarshaller<DeleteDirectConnectGatewayAssociationRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller( SDK_OPERATION_BINDING, deleteDirectConnectGatewayAssociationRequest); protocolMarshaller.startMarshalling(); DeleteDirectConnectGatewayAssociationRequestMarshaller.getInstance().marshall(deleteDirectConnectGatewayAssociationRequest, protocolMarshaller); return protocolMarshaller.finishMarshalling(); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
3294aa43e815ba5ca64a52a9790ee876883e7fb4
6b6621b2a37f4c915c101513546d634fc802c2b3
/javaweb/pycTest/src/main/java/com/chinasoft/hellWorld.java
1d6e1e0efaefbee5389ebc2f72d37ccd47c47b47
[]
no_license
1505236831/yun
b676dcbea92829f40b7a8710cc32dfd2372a9a10
4fbe03088e44ada14f6e8ceaee66751a43bafeb0
refs/heads/master
2022-12-23T20:19:36.858764
2020-02-17T06:02:45
2020-02-17T06:02:45
241,023,573
0
0
null
null
null
null
UTF-8
Java
false
false
103
java
package com.chinasoft; public class hellWorld { public static void main(String[] args) { } }
[ "1505236831@qq.com" ]
1505236831@qq.com
5e0fd706f74361fb323e5370fc9454a0ae0b685a
01b23223426a1eb84d4f875e1a6f76857d5e8cd9
/icefaces/tags/icefaces-1.7.0-DR3a/icefaces/component/src/com/icesoft/faces/component/panelcollapsible/PanelCollapsibleRenderer.java
1e14c8dfc1cdeec8d87924bca8a47a28f9025ec9
[]
no_license
numbnet/icesoft
8416ac7e5501d45791a8cd7806c2ae17305cdbb9
2f7106b27a2b3109d73faf85d873ad922774aeae
refs/heads/master
2021-01-11T04:56:52.145182
2016-11-04T16:43:45
2016-11-04T16:43:45
72,894,498
0
0
null
null
null
null
UTF-8
Java
false
false
4,601
java
package com.icesoft.faces.component.panelcollapsible; import java.io.IOException; import java.util.Iterator; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.FacesException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Element; import com.icesoft.faces.component.util.CustomComponentUtils; import com.icesoft.faces.context.DOMContext; import com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer; import com.icesoft.faces.renderkit.dom_html_basic.FormRenderer; import com.icesoft.faces.renderkit.dom_html_basic.HTML; public class PanelCollapsibleRenderer extends DomBasicRenderer { private static Log log = LogFactory.getLog(PanelCollapsibleRenderer.class); public boolean getRendersChildren() { return true; } public void encodeBegin(FacesContext facesContext, UIComponent uiComponent) throws IOException { PanelCollapsible panelCollapsible = (PanelCollapsible) uiComponent; DOMContext domContext = DOMContext.attachDOMContext(facesContext, uiComponent); if (!domContext.isInitialized()) { Element rootSpan = domContext.createElement(HTML.DIV_ELEM); domContext.setRootNode(rootSpan); setRootElementId(facesContext, rootSpan, uiComponent); } Element root = (Element) domContext.getRootNode(); String style = panelCollapsible.getStyle(); if (style != null) { root.setAttribute(HTML.STYLE_ATTR, style); } root.setAttribute(HTML.CLASS_ATTR, panelCollapsible.getStyleClass()); //create "header" div and append to the parent, don't render any children yet Element header = (Element) domContext.createElement(HTML.DIV_ELEM); header.setAttribute(HTML.CLASS_ATTR, panelCollapsible.getHeaderClass()); root.appendChild(header); //create "contents" div and append to the parent, don't render any children yet Element contents = (Element) domContext.createElement(HTML.DIV_ELEM); contents.setAttribute(HTML.CLASS_ATTR, panelCollapsible.getContentClass()); root.appendChild(contents); //add click handler if not disabled and toggleOnClick is set to true if (panelCollapsible.isToggleOnClick() && !panelCollapsible.isDisabled()) { FormRenderer.addHiddenField(facesContext, uiComponent.getClientId(facesContext)+ "Expanded"); UIComponent form = findForm(uiComponent); if(form == null) { throw new FacesException("PanelCollapsible must be contained within a form"); } header.setAttribute(HTML.ONCLICK_ATTR, "document.forms['"+ form.getClientId(facesContext) +"']" + "['"+ uiComponent.getClientId(facesContext)+ "Expanded"+"'].value='"+ panelCollapsible.isExpanded()+"'; " + "iceSubmit(document.forms['"+ form.getClientId(facesContext) +"'],this,event); return false;"); } } public void encodeChildren(FacesContext facesContext, UIComponent uiComponent) throws IOException { validateParameters(facesContext, uiComponent, null); PanelCollapsible panelCollapsible = (PanelCollapsible) uiComponent; DOMContext domContext = DOMContext.getDOMContext(facesContext, uiComponent); //if headerfacet found, get the header div and render all its children UIComponent headerFacet = uiComponent.getFacet("header"); if(headerFacet != null){ Element header = (Element)domContext.getRootNode().getFirstChild(); domContext.setCursorParent(header); CustomComponentUtils.renderChild(facesContext,headerFacet); } //if expanded get the content div and render all its children if (panelCollapsible.isExpanded()) { Element contents = (Element)domContext.getRootNode().getFirstChild().getNextSibling(); domContext.setCursorParent(contents); Iterator children = uiComponent.getChildren().iterator(); while (children.hasNext()) { UIComponent nextChild = (UIComponent) children.next(); if (nextChild.isRendered()) { encodeParentAndChildren(facesContext, nextChild); } } } domContext.stepOver(); } }
[ "ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74" ]
ken.fyten@8668f098-c06c-11db-ba21-f49e70c34f74
6850ad6cc3c918ee27024c00f711db96df6c7ba4
d386d46280b3077b5111530645d319235d506e4e
/GozareshHazineDaramadActivity.java
1022a49a87c9db87f51f9388474b6ec578ab0470
[]
no_license
slashramin/Android_Accounting
d96d99b61f97b4c027a9112caf4e1c5fce8638f7
beade48080b2935dd783045fd05aa6254f2c3407
refs/heads/master
2020-07-02T01:36:21.426995
2016-11-21T06:47:34
2016-11-21T06:47:34
74,331,308
1
0
null
null
null
null
UTF-8
Java
false
false
15,281
java
package moradi.ramin; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; import java.util.Locale; import android.app.Activity; import android.app.Dialog; import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.ListView; import android.widget.TextView; public class GozareshHazineDaramadActivity extends Activity { EditText editTextAzTarikh; EditText editTextTaTarikh; Button buttonNemayeshGozaresh; Button buttonBazgasht; String Kind = ""; DatabaseManager db; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // TODO Auto-generated method stub setContentView(R.layout.gozaresh_hazine_daramad_layout); Intent intent = getIntent(); Kind = intent.getStringExtra("Kind"); db = new DatabaseManager(this); final Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/ANegaarBold.ttf"); editTextAzTarikh = (EditText) findViewById(R.id.EditTextAzTarikh); editTextTaTarikh = (EditText) findViewById(R.id.editTextTaTarikh); editTextAzTarikh.setTypeface(tf); editTextTaTarikh.setTypeface(tf); buttonNemayeshGozaresh = (Button) findViewById(R.id.buttonNemayeshGozaresh); buttonBazgasht = (Button) findViewById(R.id.ButtonBazgasht); buttonNemayeshGozaresh.setTypeface(tf); buttonBazgasht.setTypeface(tf); editTextAzTarikh.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub final Dialog d = new Dialog(GozareshHazineDaramadActivity.this); d.setContentView(R.layout.tarikh_dialog); final TextView textViewRoz = (TextView) d.findViewById(R.id.TextViewRoz); final TextView textViewMah = (TextView) d.findViewById(R.id.TextViewMah); final TextView textViewSal = (TextView) d.findViewById(R.id.textViewSal); textViewRoz.setTypeface(tf); textViewMah.setTypeface(tf); textViewSal.setTypeface(tf); final Locale loc = new Locale("en_US"); final SolarCalendar sc = new SolarCalendar(); String tarikhEmroz = String.valueOf(sc.year) + "/" + String.format(loc, "%02d", sc.month) + "/" + String.format(loc, "%02d", sc.date); d.setTitle(sc.strWeekDay + " " + tarikhEmroz); textViewRoz.setText(String.format(loc, "%02d", sc.date)); textViewMah.setText(String.format(loc, "%02d", sc.month)); textViewSal.setText(String.valueOf(sc.year)); Button buttonUpRoz = (Button) d.findViewById(R.id.ButtonUpRoz); Button buttonUpMah = (Button) d.findViewById(R.id.ButtonUpMah); Button buttonUpSal = (Button) d.findViewById(R.id.buttonUpSal); buttonUpRoz.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer day = Integer.parseInt(textViewRoz.getText().toString()); day += 1; if (day < 32) { textViewRoz.setText(String.format(loc, "%02d", day)); } } }); buttonUpMah.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer month = Integer.parseInt(textViewMah.getText().toString()); month += 1; if (month < 13) { textViewMah.setText(String.format(loc, "%02d", month)); } } }); buttonUpSal.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer year = Integer.parseInt(textViewSal.getText().toString()); year += 1; textViewSal.setText(year.toString()); } }); Button buttonDownRoz = (Button) d.findViewById(R.id.ButtonDownRoz); Button buttonDownMah = (Button) d.findViewById(R.id.ButtonDownMah); Button buttonDownSal = (Button) d.findViewById(R.id.ButtonDownSal); buttonDownRoz.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer day = Integer.parseInt(textViewRoz.getText().toString()); day -= 1; if (day > 0) { textViewRoz.setText(String.format(loc, "%02d", day)); } } }); buttonDownMah.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer month = Integer.parseInt(textViewMah.getText().toString()); month -= 1; if (month > 0) { textViewMah.setText(String.format(loc, "%02d", month)); } } }); buttonDownSal.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer year = Integer.parseInt(textViewSal.getText().toString()); year -= 1; if (year > 0) textViewSal.setText(year.toString()); } }); Button buttonTaeid = (Button) d.findViewById(R.id.buttonTaeid); Button buttonEnseraf = (Button) d.findViewById(R.id.buttonEnseraf); buttonTaeid.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub String tarikheEntekhabShode = textViewSal.getText() + "/" + textViewMah.getText() + "/" + textViewRoz.getText(); editTextAzTarikh.setText(tarikheEntekhabShode); d.dismiss(); } }); buttonEnseraf.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub d.dismiss(); } }); d.show(); } }); editTextTaTarikh.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub final Dialog d = new Dialog(GozareshHazineDaramadActivity.this); d.setContentView(R.layout.tarikh_dialog); final TextView textViewRoz = (TextView) d.findViewById(R.id.TextViewRoz); final TextView textViewMah = (TextView) d.findViewById(R.id.TextViewMah); final TextView textViewSal = (TextView) d.findViewById(R.id.textViewSal); textViewRoz.setTypeface(tf); textViewMah.setTypeface(tf); textViewSal.setTypeface(tf); final Locale loc = new Locale("en_US"); final SolarCalendar sc = new SolarCalendar(); String tarikhEmroz = String.valueOf(sc.year) + "/" + String.format(loc, "%02d", sc.month) + "/" + String.format(loc, "%02d", sc.date); d.setTitle(sc.strWeekDay + " " + tarikhEmroz); textViewRoz.setText(String.format(loc, "%02d", sc.date)); textViewMah.setText(String.format(loc, "%02d", sc.month)); textViewSal.setText(String.valueOf(sc.year)); Button buttonUpRoz = (Button) d.findViewById(R.id.ButtonUpRoz); Button buttonUpMah = (Button) d.findViewById(R.id.ButtonUpMah); Button buttonUpSal = (Button) d.findViewById(R.id.buttonUpSal); buttonUpRoz.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer day = Integer.parseInt(textViewRoz.getText().toString()); day += 1; if (day < 32) { textViewRoz.setText(String.format(loc, "%02d", day)); } } }); buttonUpMah.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer month = Integer.parseInt(textViewMah.getText().toString()); month += 1; if (month < 13) { textViewMah.setText(String.format(loc, "%02d", month)); } } }); buttonUpSal.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer year = Integer.parseInt(textViewSal.getText().toString()); year += 1; textViewSal.setText(year.toString()); } }); Button buttonDownRoz = (Button) d.findViewById(R.id.ButtonDownRoz); Button buttonDownMah = (Button) d.findViewById(R.id.ButtonDownMah); Button buttonDownSal = (Button) d.findViewById(R.id.ButtonDownSal); buttonDownRoz.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer day = Integer.parseInt(textViewRoz.getText().toString()); day -= 1; if (day > 0) { textViewRoz.setText(String.format(loc, "%02d", day)); } } }); buttonDownMah.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer month = Integer.parseInt(textViewMah.getText().toString()); month -= 1; if (month > 0) { textViewMah.setText(String.format(loc, "%02d", month)); } } }); buttonDownSal.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub Integer year = Integer.parseInt(textViewSal.getText().toString()); year -= 1; if (year > 0) textViewSal.setText(year.toString()); } }); Button buttonTaeid = (Button) d.findViewById(R.id.buttonTaeid); Button buttonEnseraf = (Button) d.findViewById(R.id.buttonEnseraf); buttonTaeid.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub String tarikheEntekhabShode = textViewSal.getText() + "/" + textViewMah.getText() + "/" + textViewRoz.getText(); editTextTaTarikh.setText(tarikheEntekhabShode); d.dismiss(); } }); buttonEnseraf.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub d.dismiss(); } }); d.show(); } }); buttonNemayeshGozaresh.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub List<HazineDaramad> list_hazine_daramad = db.getHazineDaramadbyTarikhAndKind(editTextAzTarikh.getText().toString(), editTextTaTarikh.getText().toString(), Kind); ListViewAdapter adapter; ArrayList<HazineDaramad> arraylist = new ArrayList<HazineDaramad>(); for (int i = 0; i < list_hazine_daramad.size(); i++) { HazineDaramad h = new HazineDaramad(); Double mablagh = Double.parseDouble(list_hazine_daramad.get(i).mablagh); h.mablagh = NumberFormat.getNumberInstance(Locale.US).format(mablagh); h.nameDastebandi = list_hazine_daramad.get(i).nameDastebandi; h.Tarikh = list_hazine_daramad.get(i).Tarikh; arraylist.add(h); } ListView listViewGozareshHazineDarmad = (ListView) findViewById(R.id.listViewGozareshHazineDarmad); adapter = new ListViewAdapter(GozareshHazineDaramadActivity.this, arraylist, Kind, getAssets()); listViewGozareshHazineDarmad.setAdapter(adapter); } }); } }
[ "noreply@github.com" ]
slashramin.noreply@github.com
8bdd3cd196c466c0bd058d75fd0a78964ef49df9
4353b6b14ee2f02bc920d3bec24c2944362f93f7
/workspace/testproject/src/km_Entities/NotificationType.java
0a2cc76bc5feac676ca47afa0ccf63ae778d1466
[]
no_license
FloLod/gittest
a17099b5bbf3a79190a998a73feddbde06591809
6d84f2aa328f288bd13853d564eaf3fb9f45f06b
refs/heads/master
2021-01-12T05:23:30.281256
2017-01-07T18:42:48
2017-01-07T18:42:48
77,917,738
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
-- ----------------------------------------------------- -- Table `Waterfall`.`NotificationType` -- ----------------------------------------------------- DROP TABLE IF EXISTS `Waterfall`.`NotificationType` ; CREATE TABLE IF NOT EXISTS `Waterfall`.`NotificationType` ( `NotificationTypeID` INT NOT NULL , `Name` VARCHAR(45) NULL , PRIMARY KEY (`NotificationTypeID`) ) ENGINE = InnoDB;
[ "Loddy@169.254.204.79" ]
Loddy@169.254.204.79
c4bd5e12afd60e3e95345e27b32ac1365ca1fc08
0ed269b6c91fab76d408c97d6c203c32eeac582d
/app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/androidx/transition/R.java
13dbb6b7ca28683d1ce6094d636c223efba41ddc
[]
no_license
mahmoudbakar/HyperPayDemo
f8eadb83b51ef28792b1e999f6742ec40a4a0427
dfcfb2fcc6e4516fc99d05125f2dc72083c1f966
refs/heads/master
2020-06-25T10:05:03.108255
2019-07-28T11:27:09
2019-07-28T11:27:09
199,277,278
0
0
null
null
null
null
UTF-8
Java
false
false
11,116
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package androidx.transition; public final class R { private R() {} public static final class attr { private attr() {} public static final int alpha = 0x7f030028; public static final int font = 0x7f0300f8; public static final int fontProviderAuthority = 0x7f0300fa; public static final int fontProviderCerts = 0x7f0300fb; public static final int fontProviderFetchStrategy = 0x7f0300fc; public static final int fontProviderFetchTimeout = 0x7f0300fd; public static final int fontProviderPackage = 0x7f0300fe; public static final int fontProviderQuery = 0x7f0300ff; public static final int fontStyle = 0x7f030100; public static final int fontVariationSettings = 0x7f030101; public static final int fontWeight = 0x7f030102; public static final int ttcIndex = 0x7f030212; } public static final class color { private color() {} public static final int notification_action_color_filter = 0x7f05009f; public static final int notification_icon_bg_color = 0x7f0500a0; public static final int ripple_material_light = 0x7f0500ad; public static final int secondary_text_default_material_light = 0x7f0500af; } public static final class dimen { private dimen() {} public static final int compat_button_inset_horizontal_material = 0x7f060066; public static final int compat_button_inset_vertical_material = 0x7f060067; public static final int compat_button_padding_horizontal_material = 0x7f060068; public static final int compat_button_padding_vertical_material = 0x7f060069; public static final int compat_control_corner_material = 0x7f06006a; public static final int compat_notification_large_icon_max_height = 0x7f06006b; public static final int compat_notification_large_icon_max_width = 0x7f06006c; public static final int notification_action_icon_size = 0x7f0600d9; public static final int notification_action_text_size = 0x7f0600da; public static final int notification_big_circle_margin = 0x7f0600db; public static final int notification_content_margin_start = 0x7f0600dc; public static final int notification_large_icon_height = 0x7f0600dd; public static final int notification_large_icon_width = 0x7f0600de; public static final int notification_main_column_padding_top = 0x7f0600df; public static final int notification_media_narrow_margin = 0x7f0600e0; public static final int notification_right_icon_size = 0x7f0600e1; public static final int notification_right_side_padding_top = 0x7f0600e2; public static final int notification_small_icon_background_padding = 0x7f0600e3; public static final int notification_small_icon_size_as_large = 0x7f0600e4; public static final int notification_subtext_size = 0x7f0600e5; public static final int notification_top_pad = 0x7f0600e6; public static final int notification_top_pad_large_text = 0x7f0600e7; } public static final class drawable { private drawable() {} public static final int notification_action_background = 0x7f0700b1; public static final int notification_bg = 0x7f0700b2; public static final int notification_bg_low = 0x7f0700b3; public static final int notification_bg_low_normal = 0x7f0700b4; public static final int notification_bg_low_pressed = 0x7f0700b5; public static final int notification_bg_normal = 0x7f0700b6; public static final int notification_bg_normal_pressed = 0x7f0700b7; public static final int notification_icon_background = 0x7f0700b8; public static final int notification_template_icon_bg = 0x7f0700b9; public static final int notification_template_icon_low_bg = 0x7f0700ba; public static final int notification_tile_bg = 0x7f0700bb; public static final int notify_panel_notification_icon_bg = 0x7f0700bc; } public static final class id { private id() {} public static final int action_container = 0x7f08000f; public static final int action_divider = 0x7f080011; public static final int action_image = 0x7f080012; public static final int action_text = 0x7f080018; public static final int actions = 0x7f080019; public static final int async = 0x7f08002c; public static final int blocking = 0x7f080034; public static final int chronometer = 0x7f08004f; public static final int forever = 0x7f08008d; public static final int ghost_view = 0x7f08008f; public static final int icon = 0x7f0800a9; public static final int icon_group = 0x7f0800aa; public static final int info = 0x7f0800ae; public static final int italic = 0x7f0800af; public static final int line1 = 0x7f0800b6; public static final int line3 = 0x7f0800b7; public static final int normal = 0x7f0800d2; public static final int notification_background = 0x7f0800d3; public static final int notification_main_column = 0x7f0800d4; public static final int notification_main_column_container = 0x7f0800d5; public static final int parent_matrix = 0x7f0800e3; public static final int right_icon = 0x7f080100; public static final int right_side = 0x7f080101; public static final int save_image_matrix = 0x7f080104; public static final int save_non_transition_alpha = 0x7f080105; public static final int save_scale_type = 0x7f080106; public static final int tag_transition_group = 0x7f080137; public static final int tag_unhandled_key_event_manager = 0x7f080138; public static final int tag_unhandled_key_listeners = 0x7f080139; public static final int text = 0x7f08013c; public static final int text2 = 0x7f08013d; public static final int time = 0x7f080147; public static final int title = 0x7f080148; public static final int transition_current_scene = 0x7f080153; public static final int transition_layout_save = 0x7f080154; public static final int transition_position = 0x7f080155; public static final int transition_scene_layoutid_cache = 0x7f080156; public static final int transition_transform = 0x7f080157; } public static final class integer { private integer() {} public static final int status_bar_notification_info_maxnum = 0x7f09001e; } public static final class layout { private layout() {} public static final int notification_action = 0x7f0b0032; public static final int notification_action_tombstone = 0x7f0b0033; public static final int notification_template_custom_big = 0x7f0b003a; public static final int notification_template_icon_group = 0x7f0b003b; public static final int notification_template_part_chronometer = 0x7f0b003f; public static final int notification_template_part_time = 0x7f0b0040; } public static final class string { private string() {} public static final int status_bar_notification_info_overflow = 0x7f0e00fc; } public static final class style { private style() {} public static final int TextAppearance_Compat_Notification = 0x7f0f0148; public static final int TextAppearance_Compat_Notification_Info = 0x7f0f0149; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f014b; public static final int TextAppearance_Compat_Notification_Time = 0x7f0f014e; public static final int TextAppearance_Compat_Notification_Title = 0x7f0f0150; public static final int Widget_Compat_NotificationActionContainer = 0x7f0f01ff; public static final int Widget_Compat_NotificationActionText = 0x7f0f0200; } public static final class styleable { private styleable() {} public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030028 }; public static final int ColorStateListItem_android_color = 0; public static final int ColorStateListItem_android_alpha = 1; public static final int ColorStateListItem_alpha = 2; public static final int[] FontFamily = { 0x7f0300fa, 0x7f0300fb, 0x7f0300fc, 0x7f0300fd, 0x7f0300fe, 0x7f0300ff }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderCerts = 1; public static final int FontFamily_fontProviderFetchStrategy = 2; public static final int FontFamily_fontProviderFetchTimeout = 3; public static final int FontFamily_fontProviderPackage = 4; public static final int FontFamily_fontProviderQuery = 5; public static final int[] FontFamilyFont = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300f8, 0x7f030100, 0x7f030101, 0x7f030102, 0x7f030212 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_android_ttcIndex = 3; public static final int FontFamilyFont_android_fontVariationSettings = 4; public static final int FontFamilyFont_font = 5; public static final int FontFamilyFont_fontStyle = 6; public static final int FontFamilyFont_fontVariationSettings = 7; public static final int FontFamilyFont_fontWeight = 8; public static final int FontFamilyFont_ttcIndex = 9; public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 }; public static final int GradientColor_android_startColor = 0; public static final int GradientColor_android_endColor = 1; public static final int GradientColor_android_type = 2; public static final int GradientColor_android_centerX = 3; public static final int GradientColor_android_centerY = 4; public static final int GradientColor_android_gradientRadius = 5; public static final int GradientColor_android_tileMode = 6; public static final int GradientColor_android_centerColor = 7; public static final int GradientColor_android_startX = 8; public static final int GradientColor_android_startY = 9; public static final int GradientColor_android_endX = 10; public static final int GradientColor_android_endY = 11; public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 }; public static final int GradientColorItem_android_color = 0; public static final int GradientColorItem_android_offset = 1; } }
[ "Haojiang3150cc" ]
Haojiang3150cc
f18223d03e2e7d6f0853a6acaf320eb8181ea97f
128da67f3c15563a41b6adec87f62bf501d98f84
/com/emt/proteus/duchampopt/__tcf_306037.java
e1a1857e91b291ac2ae47afd587b105680aba7ad
[]
no_license
Creeper20428/PRT-S
60ff3bea6455c705457bcfcc30823d22f08340a4
4f6601fb0dd00d7061ed5ee810a3252dcb2efbc6
refs/heads/master
2020-03-26T03:59:25.725508
2018-08-12T16:05:47
2018-08-12T16:05:47
73,244,383
0
0
null
null
null
null
UTF-8
Java
false
false
1,644
java
/* */ package com.emt.proteus.duchampopt; /* */ /* */ import com.emt.proteus.runtime.api.Env; /* */ import com.emt.proteus.runtime.api.Frame; /* */ import com.emt.proteus.runtime.api.Function; /* */ import com.emt.proteus.runtime.api.ImplementedFunction; /* */ import com.emt.proteus.runtime.library.strings._ZNSsD1Ev; /* */ /* */ public final class __tcf_306037 extends ImplementedFunction /* */ { /* */ public static final int FNID = 1843; /* 12 */ public static final Function _instance = new __tcf_306037(); /* 13 */ public final Function resolve() { return _instance; } /* */ /* 15 */ public __tcf_306037() { super("__tcf_306037", 1, false); } /* */ /* */ public int execute(int paramInt) /* */ { /* 19 */ call(paramInt); /* 20 */ return 0; /* */ } /* */ /* */ public int execute(Env paramEnv, Frame paramFrame, int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt, int paramInt4) /* */ { /* 25 */ int i = paramFrame.getI32(paramArrayOfInt[paramInt4]); /* 26 */ paramInt4 += 2; /* 27 */ paramInt3--; /* 28 */ call(i); /* 29 */ return paramInt4; /* */ } /* */ /* */ /* */ /* */ /* */ public static void call(int paramInt) /* */ { /* */ try /* */ { /* 39 */ _ZNSsD1Ev.call(464228); /* 40 */ return; /* */ } /* */ finally {} /* */ } /* */ } /* Location: /home/jkim13/Desktop/emediatrack/codejar_s.jar!/com/emt/proteus/duchampopt/__tcf_306037.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "kimjoey79@gmail.com" ]
kimjoey79@gmail.com
f4171dbe1d5251fde3ada05a7f7d11ace1018eb6
40c500ec0ea4b8f89f83d2e45d0c4978cef94dd6
/1/src/by/epam/unit04/main/Task01.java
0d4da868613cf217a616402a5ba9dab292e3f2e3
[]
no_license
vlad-zankevich/Unit04Zankevich
413958b9d31af2df051ca9fa32471d49b49748c2
8e9778e055d2507f730e5912c16eff20e0b557e9
refs/heads/main
2023-05-11T12:30:42.444401
2021-06-01T18:59:57
2021-06-01T18:59:57
370,399,296
0
0
null
null
null
null
UTF-8
Java
false
false
1,079
java
package by.epam.unit04.main; import java.util.Random; public class Task01 { public static void main(String[] args) { //Here a sequence of numbers is initiated: Random rand = new Random(); int n = rand.nextInt(1000); int[] mas = new int[n]; for (int i = 0; i < mas.length; i++) { mas[i] = rand.nextInt(); } //here the number of even numbers in the array is counted int q = 0; for (int i = 0; i < mas.length; i++) { if (mas[i] % 2 == 0) { q++; } } if (q == 0) { System.out.println("There are no even numbers in this sequence"); }else { int a = 0; int[] mas2 = new int[q]; for (int i = 0; i < mas.length; i++) { if (mas[i] % 2 == 0) { mas2[a] = mas[i]; a++; } } for (int j = 0; j < mas2.length; j++) { System.out.println(mas2[j]); } } } }
[ "vlad.zankevich@gmail.com" ]
vlad.zankevich@gmail.com
36ced3e4407b0fc74d1c12b7d68e6a5caddda0cf
f6e92ad7d3c59a6b0fa760ccda514579c69eceba
/diadasbruxas.java
59641e7db8223d78b8865186589c26ce6c62f7c2
[]
no_license
rodrigoTigre/Java
8b2eba29c1f5482a6ad7632b1a8179bb62078664
2313b73a5423c6a9c8b3fcdcf47ade6bc46079ed
refs/heads/master
2021-05-15T12:49:42.866379
2018-04-23T15:02:07
2018-04-23T15:02:07
108,434,239
0
0
null
null
null
null
ISO-8859-3
Java
false
false
402
java
package porjecto2; import java.io.*; public class diadasbruxas { public static void main(String[] args)throws IOException { String C=""; System.out.println("digite doçura ou travessura"); InputStreamReader LerS = new InputStreamReader (System.in); BufferedReader GuardaS = new BufferedReader (LerS); C = GuardaS.readLine(); System.out.printf("digitou:"+ C, args); } }
[ "noreply@github.com" ]
rodrigoTigre.noreply@github.com
31a77772e4748479d52ddd19f54e96bc8e85c28d
577e34fabbd0d65cf7e9f9b3a51f2400b2783864
/Reading_TTC_Excel/src/train/test/one/reading/excel/test/ReadTestTwo.java
23879e12d83565759b34863eb299a00fc5bc7886
[]
no_license
pankajnimgade/JavaCoding_tutorials
862e92466cd12a7bc735acb654e0bc94370b32f4
ad9f94710d36ffb7b4b2fb7e3c166ecf92dddcdf
refs/heads/master
2021-01-14T10:26:48.847619
2017-04-06T22:45:11
2017-04-06T22:45:11
49,960,638
0
0
null
null
null
null
UTF-8
Java
false
false
11,293
java
package train.test.one.reading.excel.test; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import train.test.one.reading.excel.module.classes.ColumnNameConstants; import train.test.one.reading.excel.module.classes.Station; import java.io.File; import java.io.FileInputStream; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Iterator; /** * Created by Pankaj Nimgade on 24-01-2016. */ public class ReadTestTwo { private static final String PATH = "\\Reading_TTC_Excel\\excel_files\\TestOneTrain.xlsx"; public static void main(String[] args) { try { Path paths = Paths.get(""); String project_Path = paths.toAbsolutePath().toString(); String excel_file_path = project_Path + PATH; File file = new File(excel_file_path); if (file != null) { if (file.exists()) { System.out.println("train schedule exists: " + file.exists()); readGivenExcelFile(file); } else { System.out.println("train schedule exists: " + file.exists()); } } } catch (Exception e) { e.printStackTrace(); } } private static void readGivenExcelFile(File file) { try { FileInputStream fileInputStream = new FileInputStream(file); Workbook workbook = new XSSFWorkbook(fileInputStream); Sheet sheet = workbook.getSheetAt(0); Row topRow_record = sheet.getRow(0); Iterator<Row> rowIterator = sheet.rowIterator(); boolean first_row = true; while (rowIterator.hasNext()) { Row currentRow = rowIterator.next(); if (!first_row) { Station station = new Station(); populateStationObject(station, topRow_record, currentRow); } else { first_row = false; } } } catch (Exception e) { e.printStackTrace(); } } private static Station populateStationObject(Station station, Row topRow_record, Row currentRow) { Iterator<Cell> cellIterator = currentRow.cellIterator(); Iterator<Cell> cellIterator_top_Row = topRow_record.cellIterator(); while (cellIterator.hasNext()) { Cell cell_Top_Row = cellIterator_top_Row.next(); Cell cell_Current_Row = cellIterator.next(); String text = getStringFromGivenCell(cell_Top_Row); int current_cell_position = cell_Top_Row.getColumnIndex(); Cell myCell = null; switch (text) { case ColumnNameConstants.STATION_NAME: myCell = currentRow.getCell(current_cell_position); station.setStation_Name(getStringFromGivenCell(myCell)); break; case ColumnNameConstants._id: myCell = currentRow.getCell(current_cell_position); station.setStation_ID(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.FIRST_TRAIN_NORTHBOUND: myCell = currentRow.getCell(current_cell_position); station.setFirst_Train_Northbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.LAST_TRAIN_NORTHBOUND: myCell = currentRow.getCell(current_cell_position); station.setLast_Train_Northbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.FIRST_TRAIN_SOUTHBOUND: myCell = currentRow.getCell(current_cell_position); station.setFirst_Train_Southbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.LAST_TRAIN_SOUTHBOUND: myCell = currentRow.getCell(current_cell_position); station.setLast_Train_Southbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.FIRST_TRAIN_EASTBOUND: myCell = currentRow.getCell(current_cell_position); station.setFirst_Train_Eastbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.LAST_TRAIN_EASTBOUND: myCell = currentRow.getCell(current_cell_position); station.setLast_Train_Eastbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.FIRST_TRAIN_WESTBOUND: myCell = currentRow.getCell(current_cell_position); station.setFirst_Train_Westbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.LAST_TRAIN_WESTBOUND: myCell = currentRow.getCell(current_cell_position); station.setLast_Train_Westbound(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.ACCESSIBLE: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setAccessible(true); } } break; case ColumnNameConstants.PRESTO_ENABLED: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setPresto_Enabled(true); } } break; case ColumnNameConstants.TOKEN_VENDING_MACHINE: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setToken_Vending_Machine(true); } } break; case ColumnNameConstants.PASSENGER_PICK_UP_AND_DROP_OFF: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setPassenger_Pick_up_and_Drop_off(true); } } break; case ColumnNameConstants.BICYCLE_REPAIR_STOP: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setBicycle_Repair_Stop(true); } } break; case ColumnNameConstants.WASHROOMS: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setWashrooms(true); } } break; case ColumnNameConstants.WI_FI_ENABLED: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setWi_fi_Enabled(true); } } break; case ColumnNameConstants.PASS_VENDING_MACHINE: myCell = currentRow.getCell(current_cell_position); if (getStringFromGivenCell(myCell) != null) { if (getStringFromGivenCell(myCell).contentEquals("Yes")) { station.setPass_Vending_Machine(true); } } break; case ColumnNameConstants.PLATFORM_TYPE: myCell = currentRow.getCell(current_cell_position); station.setPlatform_Type(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.STATION_OVERVIEW: myCell = currentRow.getCell(current_cell_position); station.setStation_Overview(getStringFromGivenCell(myCell)); break; case ColumnNameConstants.PARKING: myCell = currentRow.getCell(current_cell_position); station.setParking(getStringFromGivenCell(myCell)); System.out.println(""+getStringFromGivenCell(myCell)); break; case ColumnNameConstants.LATITUDE: myCell = currentRow.getCell(current_cell_position); station.setLatitude(getStringFromGivenCell(myCell)); System.out.println(""+getStringFromGivenCell(myCell)); break; case ColumnNameConstants.LONGITUDE: myCell = currentRow.getCell(current_cell_position); station.setLongitude(getStringFromGivenCell(myCell)); System.out.println(""+getStringFromGivenCell(myCell)); break; case ColumnNameConstants.DETAILS: break; } } // System.out.println("Station: " + station.toString()); System.out.println("##################################################################"); return station; } private static String getStringFromGivenCell(Cell cell) { String cell_Text = null; if (cell != null) { switch (cell.getCellType()) { case Cell.CELL_TYPE_BLANK: cell_Text = null; break; case Cell.CELL_TYPE_BOOLEAN: cell_Text = null; break; case Cell.CELL_TYPE_ERROR: cell_Text = null; break; case Cell.CELL_TYPE_FORMULA: cell_Text = null; break; case Cell.CELL_TYPE_NUMERIC: cell_Text = String.valueOf(cell.getNumericCellValue()); break; case Cell.CELL_TYPE_STRING: cell_Text = cell.getStringCellValue(); break; } }else{ System.out.println("cell is null"); } // System.out.println("" + cell_Text); return cell_Text; } }
[ "pankaj.nimgade@gmail.com" ]
pankaj.nimgade@gmail.com
a418aa5245f68da407e9b7823f9ab61a360b9ecf
3907b78638c3cb0d6a3270b66f71dcbc51a3d55f
/app/src/main/java/com/dfr/myfirstapp/SelectGame.java
e0fc29f511e32bd85310dac8be1308a9675b67c3
[]
no_license
RojasDiego/MyFirstApp
7904a9572c29017b9226ddc6ff51ecac9db8e7f7
2e3b21d35e5c3bf8ba85deffd4c1c8519becec7c
refs/heads/master
2021-09-14T17:21:54.220364
2018-05-16T15:23:57
2018-05-16T15:23:57
111,027,706
0
0
null
null
null
null
UTF-8
Java
false
false
1,419
java
package com.dfr.myfirstapp; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.dfr.myfirstapp.model.GameTask; import com.dfr.myfirstapp.response.GameResponse; public class SelectGame extends AppCompatActivity implements GameTask.onGameListener{ ViewPager viewPager; gameAdapter viewPagerAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_select_game); viewPager = findViewById(R.id.pagerGame); selectGame(); } public void selectGame(){ GameTask gameTask = new GameTask(); gameTask.setOngameListener(this); String url = getResources().getString(R.string.gameLink); gameTask.execute(url); } @Override public void insertData(GameResponse gameResponse) { String[] fotos = new String[gameResponse.getGame().size()]; String[] titulo = new String[gameResponse.getGame().size()]; int i = 0; for (Game f: gameResponse.getGame() ) { System.out.println(f.getImg()); fotos[i] = f.getImg(); titulo[i] = f.getName(); i++; } viewPagerAdapter = new gameAdapter(SelectGame.this,fotos,titulo); viewPager.setAdapter(viewPagerAdapter); } }
[ "diegorrojas@hotmail.com" ]
diegorrojas@hotmail.com
319c8ff4cf670511996aa72c5265edb7dcb051f5
adf6edcaef13b4e260023a7492f77ec6ccd6f74b
/quick-text-similarity/src/main/java/com/quick/text/Test4Excel/util/ExcelLogs.java
8a47378deede91eb36055cb75dcc6249640072d5
[]
no_license
vector4wang/ai-java-quick
783ff72b885186e7fa8df2c44b904c6f4843bbc7
ab5408bfeb0f9f815354178c75ce9f54928aafba
refs/heads/master
2021-09-15T04:12:48.197902
2018-05-25T15:36:58
2018-05-25T15:36:58
107,648,268
2
3
null
null
null
null
UTF-8
Java
false
false
1,192
java
package com.quick.text.Test4Excel.util; import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; public class ExcelLogs { private Boolean hasError; private List<ExcelLog> logList; /** * */ public ExcelLogs() { super(); hasError = false; } /** * @return the hasError */ public Boolean getHasError() { return hasError; } /** * @param hasError * the hasError to set */ public void setHasError(Boolean hasError) { this.hasError = hasError; } /** * @return the logList */ public List<ExcelLog> getLogList() { return logList; } public List<ExcelLog> getErrorLogList() { List<ExcelLog> errList = new ArrayList<>(); for (ExcelLog log : this.logList) { if (log != null && StringUtils.isNotBlank(log.getLog())) { errList.add(log); } } return errList; } /** * @param logList * the logList to set */ public void setLogList(List<ExcelLog> logList) { this.logList = logList; } }
[ "vector.wang@hirede.com" ]
vector.wang@hirede.com
2056a343cca6aa989d8947044afd2b1d6d95f296
1ee9dc55b18996513cf4adb3deb83c4416ccef64
/Проект/back/src/main/java/teamScanner/service/AdminRestService.java
1b9164a98bb7befc94578df78e0e1a69e5545c85
[]
no_license
StasMalikov/TeamScanner
18b7ce9e2f8047392b4827dc20037c2f3e2afe7a
12fdfdedbc0a0fff1e8dea8ff68e1af056dffea0
refs/heads/master
2022-12-21T22:13:30.081134
2020-11-24T10:44:09
2020-11-24T10:44:09
244,719,528
0
1
null
2022-10-30T10:19:37
2020-03-03T19:09:02
Java
UTF-8
Java
false
false
716
java
package teamScanner.service; import org.springframework.http.ResponseEntity; import teamScanner.dto.AdminUserDto; import teamScanner.dto.StringDTO; import teamScanner.dto.UserStatusDTO; import java.util.List; public interface AdminRestService { AdminUserDto getModerByLogin(StringDTO stringDTO); List<AdminUserDto> getModers(); List<AdminUserDto> getUsers(); List<AdminUserDto> getAdmins(); AdminUserDto getUserByLogin(StringDTO stringDTO); AdminUserDto setRole(UserStatusDTO userStatusDTO); AdminUserDto removeRole(UserStatusDTO userStatusDTO); ResponseEntity<AdminUserDto> getREA(AdminUserDto object); ResponseEntity<List<AdminUserDto>> getRELA(List<AdminUserDto> object); }
[ "39596470+AleksandrVolkov@users.noreply.github.com" ]
39596470+AleksandrVolkov@users.noreply.github.com
0ec16426b6743687dd53564bb90e17e0eda65d5b
f477299b76dccc98c352e6e5eb7a497680f4582c
/src/test/java/com/cj/community/BlockingQueueTests.java
88c6f9ecf2be6707a8bc491546d84d9c9e36b907
[]
no_license
cj7iearth/community
1fe1e417cf8298528c5800b75aa254dace5482d3
a8220a73605956ae059c5386d6f59bb62e58df00
refs/heads/master
2022-06-22T02:28:48.420484
2020-05-29T07:39:17
2020-05-29T07:39:17
254,125,469
2
0
null
2022-06-21T03:10:02
2020-04-08T15:22:47
Java
UTF-8
Java
false
false
1,536
java
package com.cj.community; import java.util.Random; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; public class BlockingQueueTests { public static void main(String[] args) { BlockingQueue queue = new ArrayBlockingQueue(10); new Thread(new Producer(queue)).start(); new Thread(new Consumer(queue)).start(); new Thread(new Consumer(queue)).start(); new Thread(new Consumer(queue)).start(); } } class Producer implements Runnable{ private BlockingQueue<Integer> queue; public Producer(BlockingQueue<Integer> queue){ this.queue = queue; } @Override public void run() { try { for (int i = 0; i < 100; i++){ Thread.sleep(20); queue.put(i); System.out.println(Thread.currentThread().getName() + "生产:" + queue.size()); } } catch (Exception e){ e.printStackTrace(); } } } class Consumer implements Runnable{ private BlockingQueue<Integer> queue; public Consumer(BlockingQueue<Integer> queue){ this.queue = queue; } @Override public void run() { try { while (true){ Thread.sleep(new Random().nextInt(1000)); queue.take(); System.out.println(Thread.currentThread().getName() + "消费:" + queue.size()); } } catch (Exception e){ e.printStackTrace(); } } }
[ "453272889@qq.com" ]
453272889@qq.com
e68e247dceaa73d0dfb4b20f832682bbd5eac734
b31770c14809a7a9ac2f074593f21fea026d6a47
/Last.fmMusicPlay/src/by/deniotokiari/lastfmmusicplay/content/contract/vk/WallTrackContract.java
20551b11d328a02075d364b121660eafa3a6a84d
[]
no_license
deniotokiari/last-fm-player
fe12be729703b998317fec550880d7bf26b60706
97479ea6d9397a8d2d8d9ced36ac4fb9a20370f8
refs/heads/master
2016-08-03T02:35:01.902192
2013-04-03T13:03:19
2013-04-03T13:03:19
32,111,080
0
0
null
null
null
null
UTF-8
Java
false
false
1,594
java
package by.deniotokiari.lastfmmusicplay.content.contract.vk; import android.net.Uri; import android.provider.BaseColumns; public class WallTrackContract { public static final String AUTHORITY = "by.deniotokiari.lastfmmusicplay.provider.WallTracksProvider"; public static final Uri URI_WALL_TRACKS = Uri.parse("content://" + AUTHORITY + "/wall_tracks"); public static final Uri URI_NEWS_TRACKS = Uri.parse("content://" + AUTHORITY + "/news_tracks"); public static final String TABLE_NAME_WALL_TRACKS = "WALL_TRACKS"; public static final String TABLE_NAME_NEWS_TRACKS = "NEWS_TRACKS"; public static final class Columns implements BaseColumns { public static final String TRACK_ID = _ID; public static final String TITLE = "TITLE"; public static final String ARTIST = "ARTIST"; public static final String ALBUM = "ALBUM"; } public static final int INDEX_ID = 0; public static final int INDEX_TITLE = 1; public static final int INDEX_ARTIST = 2; public static final int INDEX_ALBUM = 3; private static String createTableTemplate = "CREATE TABLE %s " + " (" + Columns.TRACK_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + Columns.TITLE + " VARCHAR, " + Columns.ARTIST + " VARCHAR, " + Columns.ALBUM + " VARCHAR" + ")"; private static String dropTableTemplate = "DROP TABLE IF EXISTS %s"; public static String createTable(String tableName) { return String.format(createTableTemplate, tableName); } public static String dropTable(String tableName) { return String.format(dropTableTemplate, tableName); } }
[ "Deniotokiari@gmail.com@397e6121-fa18-f7b4-d6d9-1ca89dd935f4" ]
Deniotokiari@gmail.com@397e6121-fa18-f7b4-d6d9-1ca89dd935f4
3fa1de0c28c904dfacdca9084cce10e0cb826d3e
d42f573ec74170d82da9413747913728c072a3a1
/app/src/main/java/lab02/ListAdapter.java
6019f948ac5e42c3f9522efc81aa13a3ae6fe7dd
[]
no_license
Silwest/Mobilne
3dec80ecfe0a2b5a38f03c7962222b3eb68fc827
c0109027535857081e32d19265b4b1346e343f94
refs/heads/master
2021-01-13T08:34:06.215963
2014-04-10T16:40:10
2014-04-10T16:40:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,122
java
package lab02; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.example.myapplication2.app.R; import java.util.List; import lab02.database.Tasks; /** * Created by Silwest on 09.04.14. */ public class ListAdapter extends ArrayAdapter<Tasks> { private final Context context; private final List<Tasks> entryList; public ListAdapter(Context context, List<Tasks> entryList) { super(context, R.layout.lab02_main, entryList); this.context = context; this.entryList = entryList; } @Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.lab02_main, parent, false); TextView entryText = (TextView) view.findViewById(R.id.lab02_text); entryText.setText(entryList.get(position).getText()); return view; } }
[ "silwestpol@gmail.com" ]
silwestpol@gmail.com
bd96261d53ed28d61c8bee57d8f8e395e2b89ea7
24bb16fa5d14ec7dcf9a5b8ee3ef16293b0462fa
/Série5/src/serie5/Forme.java
ec32406b955b76097dd5c5d9c8651f54b00f143c
[]
no_license
IESNTI/2B-Q1-Java
04db9e44ec63fe831bdd43c39c51b6014a037acb
c2037337da011006131deb52e4f938bf92354e07
refs/heads/master
2020-08-04T07:55:05.231653
2019-12-16T20:29:47
2019-12-16T20:29:47
212,063,912
0
0
null
null
null
null
UTF-8
Java
false
false
147
java
package serie5; /** * Forme */ interface Forme { public double aire(); public double volume(); abstract public String getForme(); }
[ "contact@emiliendevos.be" ]
contact@emiliendevos.be
2af416855e4c927a4ec7d6664da0e23c4ed30ed2
330822c273c38d3f7e0e83d5afecd074059ddcbc
/src/main/java/com/nnlight/listeners/FileChangeListener.java
609c0b36a2278d1da73c25a185578221cfcbcb74
[]
no_license
sktt1cleanlove/SwicthModule
2b738c054805dcf0f0b82824c9a9a3783dc35aa7
25db6306db53554e8871f9250a763faef1450b45
refs/heads/master
2022-02-18T05:18:29.978348
2019-08-30T06:30:09
2019-08-30T06:30:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package com.nnlight.listeners; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import static com.nnlight.Main.*; /** * @Auther: maopch * @Date: 2019/8/15 * @Description: 文件名修改监听 */ public class FileChangeListener implements DocumentListener { @Override public void insertUpdate(DocumentEvent e) { updateText(); } @Override public void removeUpdate(DocumentEvent e) { updateText(); } @Override public void changedUpdate(DocumentEvent e) {} private void updateText() { String filename = fileNameText.getText(); fileText.setText(absolutePath + filename); } }
[ "maopc@nnlighting.com" ]
maopc@nnlighting.com
ea0a448f72d1eca259889503877dc053eceaf48a
3080a53da18aab675af711d091794a4bc262f185
/src/main/java/sdp/progetto/classi/thread/Propagator.java
ebf34d85cfa69bd8bed28014e8949e0624e08dca
[]
no_license
Vexac6/Smart-City-Simulator
76241d6615af0eeb642afe534f36fb170b818c37
f01c591fc2ed533c1fb285044a6b8f9f894f6a88
refs/heads/main
2023-06-24T03:42:53.464544
2021-07-23T08:32:41
2021-07-23T08:32:41
388,732,017
0
0
null
null
null
null
UTF-8
Java
false
false
880
java
package sdp.progetto.classi.thread; import com.google.protobuf.GeneratedMessageV3; /** Un thread che si occupa semplicemente di inoltrare un messaggio **/ public abstract class Propagator extends Thread { /** Il manager che provvede a fornire il canale di comunicazione **/ protected final QueueManager manager; /** Il messaggio di rete da propagare **/ protected final GeneratedMessageV3 message; /** Costruttore generico **/ public Propagator(QueueManager manager, GeneratedMessageV3 message) { this.manager = manager; this.message = message; start(); } @Override public void run() { propagate(); } /** * Abstract: La funzione deve invocare la grpc adatta a trasmettere un * messaggio di rete di un certo tipo al nodo successivo **/ protected abstract void propagate(); }
[ "o91vexac@gmail.com" ]
o91vexac@gmail.com
4c8f4960cf85ec6e37f83a8397fd33292f031881
d43b40e9b1018bf3b6817cd70f6031bd5b704d6b
/src/edu/nyu/cs/engine/index/utils/IndexerType.java
1f87788fc6bf869bf01af4b5fb5e38367301ffad
[]
no_license
elevenlee/WebSearchEngine
008238acab40d1086c442831a9e85f113a4e698a
7eddaf125d6657733155a735431885899bc7b604
refs/heads/master
2021-01-10T20:54:39.633649
2014-12-15T02:44:18
2014-12-15T02:44:18
27,294,845
1
0
null
null
null
null
UTF-8
Java
false
false
762
java
package edu.nyu.cs.engine.index.utils; /** * @author shenli * <p> * The {@code IndexerType} enum represents the search indexer type. */ public enum IndexerType { /** * The indexes contain all appearance terms with scanning the while corpus. */ FULLSCAN, /** * The indexes contain the inverted map that all terms with the documents they appear in. */ INVERTED_DOCONLY, /** * The indexes contain the inverted map that all terms with their occurrences in documents. */ INVERTED_OCCURRENCE, /** * The indexer contain the inverted map that all terms with their occurrences in documents but with the * resulting postings lists compressed. */ INVERTED_COMPRESSED; }
[ "sl3268@nyu.edu" ]
sl3268@nyu.edu
eaa9f392e521aee9ed00d7713a5dfc0c2b8fa434
727b799154fcc0e19ff4b0f1b5972742521f3b0c
/Create a Flexible and Adaptive User Interface in Android with Java/Part2/MyFragmentApp/app/src/main/java/com/mutwakilmo/myfragmentapp/Controllers/Fragments/MainFragment.java
3b08280f5ea85ed2071b347f5330c9b3474b7954
[]
no_license
mutwakilmo/Openclassrooms-
62f067ddf87af23351545d62824ff079090ba126
ff2447d17cbed9c9553a6a9eb75ee5b3a32bf972
refs/heads/master
2020-12-29T06:22:34.399875
2020-02-15T17:57:12
2020-02-15T17:57:12
238,489,496
0
0
null
null
null
null
UTF-8
Java
false
false
2,142
java
package com.mutwakilmo.myfragmentapp.Controllers.Fragments; import android.content.Context; import android.os.Bundle; import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.mutwakilmo.myfragmentapp.R; public class MainFragment extends Fragment implements View.OnClickListener { // Declare callback private OnButtonClickedListener mCallback; // Declare our interface that will be implemented by any container activity public interface OnButtonClickedListener { public void onButtonClicked(View view); } // -------------- @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout of MainFragment View result=inflater.inflate(R.layout.fragment_main, container, false); // Set onClickListener to buttons result.findViewById(R.id.fragment_main_button_happy).setOnClickListener(this); result.findViewById(R.id.fragment_main_button_sad).setOnClickListener(this); result.findViewById(R.id.fragment_main_button_horrible).setOnClickListener(this); return result; } @Override public void onAttach(Context context) { super.onAttach(context); // Call the method that creating callback after being attached to parent activity this.createCallbackToParentActivity(); } // -------------- // ACTIONS // -------------- @Override public void onClick(View v) { // Spread the click to the parent activity mCallback.onButtonClicked(v); } // -------------- // FRAGMENT SUPPORT // -------------- // Create callback to parent activity private void createCallbackToParentActivity(){ try { // Parent activity will automatically subscribe to callback mCallback = (OnButtonClickedListener) getActivity(); } catch (ClassCastException e) { throw new ClassCastException(e.toString()+ " must implement OnButtonClickedListener"); } } }
[ "mutwakilmo@gmail.com" ]
mutwakilmo@gmail.com
d8ec5a551c5d65260fba6a4614e082bb28e18b89
5018c91f32e0f0fa961372604a910d9691c0a611
/xiu/AppStore/dp_admin/src/main/java/com/coship/sdp/sce/dp/util/ApkParserUtil.java
328c7ea2d8a22e7cba4da9947ee04fdad1f32a9b
[]
no_license
kolenxiao/work
fe90e34d89840c1336efaf18b1fb0f01d0b4ae10
9547d22c03374dc0ef9502a52aa24b111a6a21e3
refs/heads/master
2016-09-06T04:36:32.523484
2014-08-14T01:30:15
2014-08-14T01:31:14
19,730,068
1
2
null
null
null
null
UTF-8
Java
false
false
13,820
java
/* * 文件名称:ApkParserUtil.java * 版 权:Shenzhen Coship Electronics Co.,Ltd. Copyright 2010-2020, All rights reserved * 描 述:<概要描述> * 创 建 人:JiangJinfeng/906974 * 创建时间:2012-11-14 * * 修改记录:1.<修改时间> <修改人> <修改描述> * 2.<修改时间> <修改人> <修改描述> */ package com.coship.sdp.sce.dp.util; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.security.cert.X509Certificate; import java.util.Formatter; import java.util.Locale; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import sun.security.pkcs.PKCS7; import sun.security.pkcs.ParsingException; import android.content.res.AXmlResourceParser; import android.util.TypedValue; /** * apk安装包解析工具类 * @author ShaoZhuyu/903588 * @version [版本号, 2012-11-14] * @since [产品/模块版本] */ public class ApkParserUtil { private static final String CERT = "CERT.RSA"; private static final String ANDROIDMANIFEST = "AndroidManifest.xml"; private static final float RADIX_MULTS[] = { 0.00390625F, 3.051758E-005F, 1.192093E-007F, 4.656613E-010F }; private static final String DIMENSION_UNITS[] = { "px", "dip", "sp", "pt", "in", "mm", "", "" }; private static final String FRACTION_UNITS[] = { "%", "%p", "", "", "", "", "", "" }; /** * 测试方法 * @param args [参数说明] * @return void [返回类型说明] * @exception throws [违例类型] [违例说明] */ public static void main(String[] args) { File apkFile = new File("F:/TVappstore1.apk"); parser(apkFile); } /** * 解析方法 * @param apk * @return [参数说明] * @return ApkInfo [返回类型说明] * @exception throws [违例类型] [违例说明] */ public static ApkInfo parser(File apk) { ApkInfo apkInfo = new ApkInfo(); ZipFile zf = null; InputStream in = null; try { in = new BufferedInputStream(new FileInputStream(apk)); zf = new ZipFile(apk); ZipInputStream zin = new ZipInputStream(in); ZipEntry ze; while ((ze = zin.getNextEntry()) != null) { if (ze.isDirectory()) { } else { String zeFileName = ze.getName(); int index = zeFileName.lastIndexOf("/") + 1; index = (index == -1 ? 0 : index); zeFileName = zeFileName.substring(index); // 解析apk中CERT.RSA if (CERT.equals(zeFileName)) { InputStream inputEntry = zf.getInputStream(ze); PKCS7 pkcs7 = new PKCS7(inputEntry); X509Certificate publicKey = pkcs7.getCertificates()[0]; // 设置公钥 apkInfo.setPublicKey(publicKey); } // 解析apk中的AndroidManifest.xml文件,获取包名、版本编号、版本名称、运行最低sdk版本编码 if (ANDROIDMANIFEST.endsWith(zeFileName)) { InputStream inputEntry = zf.getInputStream(ze); AXmlResourceParser parser = new AXmlResourceParser(); parser.open(inputEntry); StringBuffer xmlBuffer = new StringBuffer(); StringBuilder indent = new StringBuilder(10); final String indentStep = " "; while (true) { int type = parser.next(); if (type == XmlPullParser.END_DOCUMENT) { break; } switch (type) { case XmlPullParser.START_DOCUMENT: { log("<?xml version=\"1.0\" encoding=\"utf-8\"?>", xmlBuffer); break; } case XmlPullParser.START_TAG: { log("%s<%s%s", xmlBuffer, indent, getNamespacePrefix(parser .getPrefix()), parser.getName()); indent.append(indentStep); int namespaceCountBefore = parser .getNamespaceCount(parser .getDepth() - 1); int namespaceCount = parser .getNamespaceCount(parser .getDepth()); for (int i = namespaceCountBefore; i != namespaceCount; ++i) { log("%sxmlns:%s=\"%s\"", xmlBuffer, indent, parser.getNamespacePrefix(i), parser.getNamespaceUri(i)); } for (int i = 0; i != parser .getAttributeCount(); ++i) { log("%s%s%s=\"%s\"", xmlBuffer, indent, getNamespacePrefix(parser .getAttributePrefix(i)), parser.getAttributeName(i), getAttributeValue(parser, i)); } log("%s>", xmlBuffer, indent); break; } case XmlPullParser.END_TAG: { indent.setLength(indent.length() - indentStep.length()); log("%s</%s%s>", xmlBuffer, indent, getNamespacePrefix(parser .getPrefix()), parser.getName()); break; } case XmlPullParser.TEXT: { log("%s%s", xmlBuffer, indent, parser.getText()); break; } } } parser.close(); String xmlStr = xmlBuffer.toString(); StringReader read = new StringReader(xmlStr); InputSource source = new InputSource(read); DocumentBuilderFactory buildFactory = DocumentBuilderFactory .newInstance(); DocumentBuilder builder = buildFactory .newDocumentBuilder(); Document document = builder.parse(source); Element manifestElement = document.getDocumentElement(); String versionCodeStr = manifestElement .getAttribute("android:versionCode"); String versionName = manifestElement .getAttribute("android:versionName"); String packageName = manifestElement .getAttribute("package"); System.out.println("versionCodeStr=" + versionCodeStr); System.out.println("versionName=" + versionName); System.out.println("packageName=" + packageName); apkInfo.setVersionCode(Integer.valueOf(versionCodeStr)); apkInfo.setVersionName(versionName); apkInfo.setPackageName(packageName); NodeList usesSdk = manifestElement .getElementsByTagName("uses-sdk"); if (usesSdk != null && usesSdk.getLength() > 0) { Node usesSdkNode = usesSdk.item(0); NamedNodeMap namedNodeMap = usesSdkNode .getAttributes(); Node minSdkVersionNode = namedNodeMap .getNamedItem("android:minSdkVersion"); System.out.println("minSdkVersionNode=" + minSdkVersionNode.getNodeValue()); apkInfo.setMinSdkVersion(Integer .valueOf(minSdkVersionNode.getNodeValue())); } document = null; source = null; read = null; } } } zin.closeEntry(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (ParsingException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (XmlPullParserException e) { e.printStackTrace(); } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } in = null; } } return apkInfo; } private static String getNamespacePrefix(String prefix) { if (prefix == null || prefix.length() == 0) { return ""; } return prefix + ":"; } private static String getAttributeValue(AXmlResourceParser parser, int index) { int type = parser.getAttributeValueType(index); int data = parser.getAttributeValueData(index); if (type == TypedValue.TYPE_STRING) { return parser.getAttributeValue(index); } if (type == TypedValue.TYPE_ATTRIBUTE) { return String.format("?%s%08X", getPackage(data), data); } if (type == TypedValue.TYPE_REFERENCE) { return String.format("@%s%08X", getPackage(data), data); } if (type == TypedValue.TYPE_FLOAT) { return String.valueOf(Float.intBitsToFloat(data)); } if (type == TypedValue.TYPE_INT_HEX) { return String.format("0x%08X", data); } if (type == TypedValue.TYPE_INT_BOOLEAN) { return data != 0 ? "true" : "false"; } if (type == TypedValue.TYPE_DIMENSION) { return Float.toString(complexToFloat(data)) + DIMENSION_UNITS[data & TypedValue.COMPLEX_UNIT_MASK]; } if (type == TypedValue.TYPE_FRACTION) { return Float.toString(complexToFloat(data)) + FRACTION_UNITS[data & TypedValue.COMPLEX_UNIT_MASK]; } if (type >= TypedValue.TYPE_FIRST_COLOR_INT && type <= TypedValue.TYPE_LAST_COLOR_INT) { return String.format("#%08X", data); } if (type >= TypedValue.TYPE_FIRST_INT && type <= TypedValue.TYPE_LAST_INT) { return String.valueOf(data); } return String.format("<0x%X, type 0x%02X>", data, type); } private static String getPackage(int id) { if (id >>> 24 == 1) { return "android:"; } return ""; } private static void log(String format, StringBuffer xmlBuffer, Object... arguments) { Formatter formatter = new Formatter(); formatter.format(Locale.getDefault(), format, arguments); xmlBuffer.append(formatter.toString()); } public static float complexToFloat(int complex) { return (float) (complex & 0xFFFFFF00) * RADIX_MULTS[(complex >> 4) & 3]; } }
[ "xiaoyingping@coship.com" ]
xiaoyingping@coship.com
6a723e5d3cd955794179398e3ef9ee232a8ef7dc
cdfd0a10a7d08f8943e2372fc33614d2a94de0f5
/disk-app/app-admin/src/main/java/com/yunip/controller/user/FileManagerController.java
32c9440991d76033348c04125151af39cf7d1555
[]
no_license
Tureen/disk
82c8ef60066de01b6da28ad72ab4d83cf3f8d829
a5008882be68f102e89a6519f01196038bc73259
refs/heads/master
2021-07-25T13:00:36.828520
2017-11-02T17:04:23
2017-11-02T17:04:23
109,295,098
0
0
null
null
null
null
UTF-8
Java
false
false
1,405
java
/* * 描述:文件管理控制器层 * 创建人:jian.xiong * 创建时间:2016-5-4 */ package com.yunip.controller.user; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import com.yunip.constant.SysContant; import com.yunip.controller.base.BaseController; import com.yunip.model.user.Admin; import com.yunip.utils.pwd.Des; import com.yunip.utils.pwd.Md5; import com.yunip.web.common.Authority; /** * 文件管理控制器层 */ @Controller @RequestMapping("/fileManager") public class FileManagerController extends BaseController{ /** * 列表 */ @Authority("P20") @RequestMapping("/list") public String list(HttpServletRequest request, ModelMap modelMap){ Admin admin = this.getMyinfo(request); if(admin != null){ try { Des desObj = new Des(); String identity = desObj.strEnc(admin.getMobile(), SysContant.desKey, null, null); modelMap.put("identity", identity); modelMap.put("token", Md5.encodeByMd5(identity + SysContant.md5Key)); }catch (Exception e) { e.printStackTrace(); } } return "fileManager/list"; } }
[ "469568595@qq.com" ]
469568595@qq.com
a637e8f3ccd714c7c14e853f6f541bfccf25a7bc
0eb105d13403c143b7d3bd8cc56423eed0e71c60
/src/main/java/com/mossle/bpm/service/BpmConfFormService.java
af286111d37d976aff81b6128312675d58dc969d
[ "Apache-2.0" ]
permissive
GilBert1987/Rolmex
b83a861ab2e28ea6f06f41552668f6f6a5f47d26
a6bb7a15e68c4e37a5588324724a35a2b340d581
refs/heads/master
2021-10-23T08:51:54.685765
2019-03-16T05:02:27
2019-03-16T05:02:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,558
java
package com.mossle.bpm.service; import java.util.List; import javax.annotation.Resource; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.mossle.bpm.persistence.domain.BpmConfBase; import com.mossle.bpm.persistence.domain.BpmConfForm; import com.mossle.bpm.persistence.domain.BpmConfNode; import com.mossle.bpm.persistence.manager.BpmConfBaseManager; import com.mossle.bpm.persistence.manager.BpmConfFormManager; import com.mossle.bpm.persistence.manager.BpmConfNodeManager; import com.mossle.humantask.persistence.domain.TaskDefBase; import com.mossle.humantask.persistence.manager.TaskDefBaseManager; import com.mossle.spi.humantask.TaskDefinitionConnector; @Service @Transactional(readOnly=true) public class BpmConfFormService { private static org.slf4j.Logger logger = LoggerFactory.getLogger(BpmConfFormService.class); private BpmConfFormManager bpmConfFormManager; private BpmConfNodeManager bpmConfNodeManager; private TaskDefinitionConnector taskDefinitionConnector; private BpmConfBaseManager bpmConfBaseManager; private TaskDefBaseManager taskDefBaseManager; @Transactional(readOnly=false) public void batchSaveForm(String bpmConfBaseId,String formValue,Long[] checkNodes){ String codes = ""; //先删除已经配置的节点 String hql = "delete from BpmConfForm where bpmConfNode.id=?"; for(Long node : checkNodes){ bpmConfFormManager.batchUpdate(hql, node); BpmConfNode bpmConfNode = bpmConfNodeManager.get(node); String code = bpmConfNode.getCode(); codes += "'"+code+"',"; BpmConfForm bpmConfForm = new BpmConfForm(); bpmConfForm.setValue(formValue); bpmConfForm.setType(1); bpmConfForm.setStatus(1); bpmConfForm.setBpmConfNode(bpmConfNode); bpmConfFormManager.save(bpmConfForm); } codes = codes.substring(0, codes.length()-1); BpmConfBase bpmConfBase = bpmConfBaseManager.get(Long.parseLong(bpmConfBaseId)); if(bpmConfBase != null){ String processDefinitionId = bpmConfBase.getProcessDefinitionId(); String hqlTaskDelBase = "from TaskDefBase where processDefinitionId=? and code in("+codes+")"; List<TaskDefBase> taskDefBaseList = taskDefBaseManager.find(hqlTaskDelBase, processDefinitionId); logger.debug("批量配置表单,查询task_def_base表结果"+taskDefBaseList.size()); for(TaskDefBase taskDefBase : taskDefBaseList){ taskDefBase.setFormKey(formValue); taskDefBase.setFormType("external"); taskDefBaseManager.save(taskDefBase); } }else{ logger.error("批量配置表单操作:bpmConfBase对象为null"); } } //------------------------------------------------------------------------------ @Resource public void setBpmConfNodeManager(BpmConfNodeManager bpmConfNodeManager) { this.bpmConfNodeManager = bpmConfNodeManager; } @Resource public void setBpmConfFormManager(BpmConfFormManager bpmConfFormManager) { this.bpmConfFormManager = bpmConfFormManager; } @Resource public void setTaskDefinitionConnector(TaskDefinitionConnector taskDefinitionConnector) { this.taskDefinitionConnector = taskDefinitionConnector; } @Resource public void setBpmConfBaseManager(BpmConfBaseManager bpmConfBaseManager) { this.bpmConfBaseManager = bpmConfBaseManager; } @Resource public void setTaskDefBaseManager(TaskDefBaseManager taskDefBaseManager) { this.taskDefBaseManager = taskDefBaseManager; } }
[ "linlin198703@163.com" ]
linlin198703@163.com
a4a887291882b323ac005778bad95fdcd6122b81
65fa4b350ff58201fd09f2bc1555ef2ad7ef4b0f
/escalade/escalade-consumer/src/main/java/fr/rasen/escalade/consumer/contract/dao/DepartementDao.java
e52463e56d72670a9d4e071360664218c22e81dd
[]
no_license
rasengseb/projet6
f64d4442ec5fee839c6e62863eb788a51d4fe186
d7638e14d2ffc1566f363e5bda228c9451bbec89
refs/heads/master
2022-12-07T14:18:42.259826
2020-08-30T14:30:28
2020-08-30T14:30:28
237,821,675
0
0
null
2022-11-24T07:44:22
2020-02-02T19:08:48
Java
UTF-8
Java
false
false
193
java
package fr.rasen.escalade.consumer.contract.dao; import fr.rasen.escalade.model.bean.Departement; import java.util.List; public interface DepartementDao { List<Departement> getAll(); }
[ "deathseb@gmail.com" ]
deathseb@gmail.com
2376788ba3c4dbaf22f0c836f3d3e43d75f5f89e
e369d9879042675c259345e9d83c99fabb27de64
/NS_Client201901/src/com/bansi/webservices/samples/io/Console.java
5f009bed6df4e1dc8f7b151df9c857ea180424d6
[]
no_license
zbansi/intretech_netsuite
609d59949a36e080841a5341812005df414a79d6
17d56760fd8b920a378e373c4ab021877ece7315
refs/heads/master
2021-06-26T00:31:19.500230
2019-06-06T01:59:49
2019-06-06T01:59:49
154,297,224
0
0
null
2020-10-13T10:51:34
2018-10-23T09:06:33
Java
UTF-8
Java
false
false
2,008
java
package com.bansi.webservices.samples.io; import java.util.Scanner; import static com.netsuite.suitetalk.client.common.utils.CommonUtils.isEmptyString; import static com.bansi.webservices.samples.utils_2019_1.PrintUtils.printPrompt; /** * <p>Console for reading inputs from a user.</p> * <p>© 2017 NetSuite Inc. All rights reserved.</p> */ public class Console { private static java.io.Console systemConsole; private static Scanner scanner; /* * This static block initializes a suitable console. * If there is a native console available (e.g. user uses native command line in Windows) then this system * console is used. But if the native console is not available (e.g. application is executed from IDE) then * some alternative way of reading inputs is used but it does not hide a password entered by the user. */ static { systemConsole = System.console(); if (systemConsole == null) { scanner = new Scanner(System.in); } } public static String readLine() { if (systemConsole != null) { return systemConsole.readLine(); } return readFromScanner(); } public static String readPassword() { if (systemConsole != null) { return new String(systemConsole.readPassword()); } return readFromScanner(); } public static String readLine(String prompt) { printPrompt(prompt); return readLine(); } public static String readLine(String prompt, String defaultValue) { String readValue = readLine(prompt); if (isEmptyString(readValue.trim())) { return defaultValue; } return readValue; } public static String readPassword(String prompt) { printPrompt(prompt); return readPassword(); } private static String readFromScanner() { if (scanner == null) { return null; } return scanner.nextLine(); } }
[ "alonjune@gmail.com" ]
alonjune@gmail.com
ebc0e707c739b629614770cd331906dbae6ff838
70a6f21a7d2a9ba44f2f5024194cb8a7e7b45e05
/genomizer-server-tester/src/util/ProcessFeedbackData.java
cf9e60a02a33efeaa04d88d5a98d7d1c08f1353b
[]
no_license
genomizer/genomizer-server
7ad700dc464e570eafc8646b7b4cda4502c4e802
ae9cf8c39acc8faad65ce766cf00ce82d61ab2f9
refs/heads/develop
2021-01-01T15:31:04.488960
2015-12-01T13:03:18
2015-12-01T13:03:18
19,137,589
1
2
null
2015-12-01T04:24:50
2014-04-25T07:18:30
Java
UTF-8
Java
false
false
1,587
java
package util; /** * @author c11dkn * @version 1.0 * 16 May 2014 */ public class ProcessFeedbackData { public String experimentName; public String PID; public String status; public String author; public String[] outputFiles; public long timeAdded; public long timeStarted; public long timeFinished; public ProcessFeedbackData(String experimentName,String PID, String status, String author , String[] outputFiles, long timeAdded, long timeFinished, long timeStarted) { this.experimentName = experimentName; this.PID = PID; this.status = status; this.author = author; this.outputFiles = outputFiles; this.timeAdded = timeAdded; this.timeFinished = timeFinished; this.timeStarted = timeStarted; } // TODO: Where is this code even used ? (OO) // public static ProcessFeedbackData[] getExample() { // String[] names = { "Kalle", "Pelle", "Anna", "Nils", "Olle" }; // String[] statuses = { "Finished", "Crashed", "Started", "Waiting"}; // Random rand = new Random(); // ProcessFeedbackData[] data = new ProcessFeedbackData[10]; // for(int i=0; i<10; i++) { // String expName = "experiment" + i; // String author = names[rand.nextInt(5)]; // String status = statuses[rand.nextInt(4)]; // String[] files = new String[] {"file1","file2","file3"}; // data[i] = new ProcessFeedbackData(expName, status, author, files, 100,100,0); // } // return data; // } }
[ "c05mgv@cs.umu.se" ]
c05mgv@cs.umu.se
a1aa80d33e3b8298979637e02617fff2959c62cf
ec7154a3e4adaea35680196a1f6ac18f6dbe8c23
/src/donnu/zolotarev/SpaceShip/GameState/IParentScene.java
5945a9b2be7404b338328a65681d1ff6b84d6dfd
[ "Apache-2.0" ]
permissive
nonconforme/SpaceshipsBattle
41c1c2918c3bcb988877b92743ae38d3ea552a5c
281dde777fedb89153b3cdf8876956f2eaf3efba
refs/heads/master
2020-12-25T19:50:35.048314
2015-04-10T11:27:04
2015-04-10T11:27:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
424
java
package donnu.zolotarev.SpaceShip.GameState; public interface IParentScene { public static final String STATUS_CODE = "code"; public static final int EXIT_WIN = 0; public static final int EXIT_USER = -1; public static final int EXIT_DIE= 1; int EXIT_SHOP = 2; public static final int EXIT_RESTART = 3; public void returnToParentScene(int statusCode); public void restart(int statusCode); }
[ "zahar.zolotarev@gmail.com" ]
zahar.zolotarev@gmail.com
b34c0bd08fc2a741eeee7ba623960b2d873aaab7
7a76838d738be65d601f164cb5a97b699be1da2b
/spring-batch-in-action/getting-started/getting-started/spring-batch-example/src/main/java/com/jinm/example/ch07/flat/DefaultFlatFileFooterCallback.java
9c74290527f08b4408141dd4a9a3ce38e9044d58
[ "Apache-2.0" ]
permissive
jinminer/spring-batch
fafdedec5de3198aa0c05353a26f0238b396bebc
f2e29682f882c8656b283030279e95ebcf08868a
refs/heads/master
2022-12-22T21:04:27.438433
2019-10-08T16:58:10
2019-10-08T16:58:10
209,073,938
1
1
Apache-2.0
2022-12-16T01:35:27
2019-09-17T14:18:30
Java
UTF-8
Java
false
false
524
java
/** * */ package com.jinm.example.ch07.flat; import java.io.IOException; import java.io.Writer; import org.springframework.batch.item.file.FlatFileFooterCallback; /** * * 2013-9-20上午09:14:05 */ public class DefaultFlatFileFooterCallback implements FlatFileFooterCallback { /* (non-Javadoc) * @see org.springframework.batch.item.file.FlatFileFooterCallback#writeFooter(java.io.Writer) */ @Override public void writeFooter(Writer writer) throws IOException { writer.write("##credit 201310 end."); } }
[ "jinm@uxunchina.com" ]
jinm@uxunchina.com
0a8a78b2084d6d8a35c15d0caef5c47983a3ad61
e128eae6e1ee6080fdd31699daebbe19a5def299
/M3LectureCode/Pair.java
ff12635e5cc2b56a6f497d0fe322f60c7fc7beac
[]
no_license
ericyan3000/CS111C
4d41af014f0c59f582e728c36cf405f3c657cf97
f3ad0ae591c33f71a48a8ad9063333683d166cae
refs/heads/master
2020-12-22T05:34:25.112664
2020-05-13T07:41:52
2020-05-13T07:41:52
236,684,208
0
0
null
null
null
null
UTF-8
Java
false
false
1,551
java
public class Pair<T extends Comparable<? super T>> implements Comparable<Pair<T>>{ private T item1, item2; public Pair(T item1, T item2) { this.item1 = item1; this.item2 = item2; } public T getItem1() { return item1; } public T getItem2() { return item2; } public void setItem1(T item1) { this.item1 = item1; } public void setItem2(T item2) { this.item2 = item2; } @Override public String toString() { return "[" + item1.toString() + ", " + item2.toString() + "]"; } public boolean sameItems() { return item1.equals(item2); } @Override public boolean equals(Object obj) { if(obj instanceof Pair<?>) { Pair<?> otherPair = (Pair<?>) obj; return item1.equals(otherPair.item1) && item2.equals(otherPair.item2); } else { return false; } } @Override public int compareTo(Pair<T> otherPair) { if(this.item1.compareTo(otherPair.item1) < 0) { // this item1 is smaller than the other item1 return -1; // any negative number } else if(this.item1.compareTo(otherPair.item1) > 0) { // this item1 is greater than the other item1 return 1; // any positive number } else { // this.item1.compareTo(otherPair.item1) == 0 if(this.item2.compareTo(otherPair.item2) < 0) { // this item2 is smaller than the other item2 return -1; // any negative number } else if(this.item2.compareTo(otherPair.item2) > 0) { // this item2 is greater than the other item2 return 1; // any positive number } else { // this.item2.compareTo(otherPair.item2) == 0 return 0; } } } }
[ "ericyan3000@gmail.com" ]
ericyan3000@gmail.com
f46974882cdf05f0819aebe696717684193d9f2e
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/JxPath-22/org.apache.commons.jxpath.ri.model.dom.DOMNodePointer/BBC-F0-opt-80/13/org/apache/commons/jxpath/ri/model/dom/DOMNodePointer_ESTest_scaffolding.java
95d8ee92548d9a45e8ff02af76ecb298e5c89bb7
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
20,842
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Oct 20 18:52:55 GMT 2021 */ package org.apache.commons.jxpath.ri.model.dom; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class DOMNodePointer_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.jxpath.ri.model.dom.DOMNodePointer"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(DOMNodePointer_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.jxpath.Variables", "org.apache.html.dom.HTMLLinkElementImpl", "org.apache.html.dom.HTMLPreElementImpl", "org.apache.wml.dom.WMLEmElementImpl", "org.apache.commons.jxpath.ri.model.beans.PropertyPointer", "org.apache.commons.jxpath.ri.model.beans.BeanPointer", "org.apache.commons.jxpath.util.BasicTypeConverter", "org.apache.wml.dom.WMLPrevElementImpl", "org.apache.wml.WMLUElement", "org.apache.html.dom.HTMLTextAreaElementImpl", "org.apache.wml.WMLIElement", "org.apache.html.dom.HTMLHeadingElementImpl", "org.apache.html.dom.HTMLLIElementImpl", "org.apache.commons.jxpath.ri.model.NodeIterator", "org.apache.html.dom.HTMLFrameSetElementImpl", "org.apache.commons.jxpath.ri.compiler.CoreOperationCompare", "org.apache.commons.jxpath.ExpressionContext", "org.apache.commons.jxpath.ri.model.dom.DOMAttributePointer", "org.apache.wml.dom.WMLAccessElementImpl", "org.apache.html.dom.HTMLBodyElementImpl", "org.apache.wml.dom.WMLHeadElementImpl", "org.apache.commons.jxpath.ri.model.beans.CollectionPointer", "org.apache.wml.WMLCardElement", "org.apache.wml.WMLOneventElement", "org.apache.commons.jxpath.JXPathContext", "org.apache.wml.WMLNoopElement", "org.apache.html.dom.HTMLTableSectionElementImpl", "org.apache.wml.WMLBrElement", "org.apache.commons.jxpath.ri.compiler.TreeCompiler", "org.apache.html.dom.HTMLHeadElementImpl", "org.apache.wml.dom.WMLNoopElementImpl", "org.apache.wml.dom.WMLOptionElementImpl", "org.apache.commons.jxpath.ri.model.dom.DOMNodeIterator", "org.apache.commons.jxpath.ri.model.beans.NullPointer", "org.apache.html.dom.HTMLElementImpl", "org.apache.commons.jxpath.ri.compiler.NodeTest", "org.apache.wml.WMLElement", "org.apache.wml.WMLAElement", "org.apache.wml.dom.WMLImgElementImpl", "org.apache.html.dom.HTMLScriptElementImpl", "org.apache.html.dom.HTMLBaseElementImpl", "org.apache.wml.WMLTimerElement", "org.apache.commons.jxpath.ri.model.NodePointerFactory", "org.apache.html.dom.HTMLMenuElementImpl", "org.apache.html.dom.HTMLFormControl", "org.apache.wml.dom.WMLSetvarElementImpl", "org.apache.wml.WMLBigElement", "org.apache.html.dom.HTMLOptionElementImpl", "org.apache.html.dom.HTMLFrameElementImpl", "org.apache.wml.dom.WMLSelectElementImpl", "org.apache.commons.jxpath.ri.model.beans.CollectionPointerFactory", "org.apache.html.dom.HTMLDirectoryElementImpl", "org.apache.html.dom.HTMLTableCaptionElementImpl", "org.apache.html.dom.HTMLObjectElementImpl", "org.apache.commons.jxpath.BasicVariables", "org.apache.wml.WMLDoElement", "org.apache.html.dom.HTMLFormElementImpl", "org.apache.commons.jxpath.JXPathAbstractFactoryException", "org.apache.commons.jxpath.JXPathInvalidAccessException", "org.apache.commons.jxpath.ri.compiler.CoreOperationEqual", "org.apache.html.dom.HTMLSelectElementImpl", "org.apache.commons.jxpath.ri.model.NodePointer", "org.apache.commons.jxpath.ri.model.VariablePointer$1", "org.apache.commons.jxpath.ri.compiler.CoreOperation", "org.apache.html.dom.HTMLAppletElementImpl", "org.apache.wml.dom.WMLPostfieldElementImpl", "org.apache.wml.dom.WMLRefreshElementImpl", "org.apache.wml.WMLWmlElement", "org.apache.wml.WMLTdElement", "org.apache.wml.WMLMetaElement", "org.apache.html.dom.HTMLStyleElementImpl", "org.apache.commons.jxpath.ri.model.container.ContainerPointer", "org.apache.html.dom.HTMLHtmlElementImpl", "org.apache.html.dom.HTMLImageElementImpl", "org.apache.wml.dom.WMLMetaElementImpl", "org.apache.commons.jxpath.ri.axes.RootContext", "org.apache.commons.jxpath.ri.axes.InitialContext", "org.apache.html.dom.HTMLAnchorElementImpl", "org.apache.html.dom.HTMLMapElementImpl", "org.apache.wml.dom.WMLInputElementImpl", "org.apache.commons.jxpath.ri.JXPathContextReferenceImpl", "org.apache.wml.dom.WMLBrElementImpl", "org.apache.commons.jxpath.util.TypeUtils$1", "org.apache.wml.dom.WMLOneventElementImpl", "org.apache.commons.jxpath.ri.model.dom.DOMAttributeIterator", "org.apache.html.dom.HTMLUListElementImpl", "org.apache.wml.dom.WMLWmlElementImpl", "org.apache.wml.WMLInputElement", "org.apache.wml.WMLPrevElement", "org.apache.html.dom.HTMLLabelElementImpl", "org.apache.wml.WMLAnchorElement", "org.apache.html.dom.HTMLTableColElementImpl", "org.apache.wml.WMLAccessElement", "org.apache.commons.jxpath.ri.model.VariablePointerFactory", "org.apache.commons.jxpath.util.TypeUtils", "org.apache.html.dom.HTMLAreaElementImpl", "org.apache.commons.jxpath.JXPathTypeConversionException", "org.apache.wml.WMLTrElement", "org.apache.wml.WMLFieldsetElement", "org.apache.wml.WMLRefreshElement", "org.apache.wml.WMLOptgroupElement", "org.apache.commons.jxpath.ri.compiler.NodeNameTest", "org.apache.wml.WMLTableElement", "org.apache.wml.dom.WMLCardElementImpl", "org.apache.wml.WMLHeadElement", "org.apache.commons.jxpath.Pointer", "org.apache.html.dom.HTMLCollectionImpl", "org.apache.commons.jxpath.ri.compiler.Expression", "org.apache.wml.dom.WMLAnchorElementImpl", "org.apache.wml.dom.WMLTrElementImpl", "org.apache.wml.dom.WMLStrongElementImpl", "org.apache.commons.jxpath.Function", "org.apache.html.dom.HTMLHRElementImpl", "org.apache.wml.WMLPostfieldElement", "org.apache.html.dom.HTMLOptGroupElementImpl", "org.apache.wml.WMLDocument", "org.apache.commons.jxpath.JXPathInvalidSyntaxException", "org.apache.wml.dom.WMLUElementImpl", "org.apache.wml.WMLOptionElement", "org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer", "org.apache.wml.dom.WMLBElementImpl", "org.apache.wml.dom.WMLTableElementImpl", "org.apache.wml.WMLPElement", "org.apache.html.dom.HTMLTableRowElementImpl", "org.apache.html.dom.HTMLButtonElementImpl", "org.apache.html.dom.HTMLModElementImpl", "org.apache.commons.jxpath.ri.model.VariablePointer", "org.apache.wml.WMLSmallElement", "org.apache.commons.jxpath.ri.model.dynamic.DynamicPointerFactory", "org.apache.html.dom.HTMLDListElementImpl", "org.apache.commons.jxpath.ri.QName", "org.apache.wml.dom.WMLDocumentImpl", "org.apache.html.dom.HTMLBRElementImpl", "org.apache.commons.jxpath.CompiledExpression", "org.apache.commons.jxpath.NodeSet", "org.apache.html.dom.HTMLIFrameElementImpl", "org.apache.wml.dom.WMLIElementImpl", "org.apache.html.dom.HTMLTableElementImpl", "org.apache.wml.WMLGoElement", "org.apache.html.dom.HTMLLegendElementImpl", "org.apache.commons.jxpath.JXPathNotFoundException", "org.apache.wml.dom.WMLTimerElementImpl", "org.apache.commons.jxpath.ri.model.dom.NamespacePointer", "org.apache.html.dom.HTMLFontElementImpl", "org.apache.wml.WMLEmElement", "org.apache.commons.jxpath.ExceptionHandler", "org.apache.html.dom.HTMLQuoteElementImpl", "org.apache.html.dom.HTMLDocumentImpl", "org.apache.commons.jxpath.util.TypeConverter", "org.apache.wml.WMLStrongElement", "org.apache.html.dom.HTMLParamElementImpl", "org.apache.commons.jxpath.ri.compiler.NameAttributeTest", "org.apache.commons.jxpath.ri.compiler.ProcessingInstructionTest", "org.apache.wml.dom.WMLDoElementImpl", "org.apache.wml.dom.WMLSmallElementImpl", "org.apache.wml.dom.WMLGoElementImpl", "org.apache.wml.WMLImgElement", "org.apache.html.dom.HTMLFieldSetElementImpl", "org.apache.commons.jxpath.ri.NamespaceResolver", "org.apache.html.dom.HTMLTableCellElementImpl", "org.apache.wml.WMLSetvarElement", "org.apache.commons.jxpath.AbstractFactory", "org.apache.wml.WMLSelectElement", "org.apache.wml.WMLTemplateElement", "org.apache.wml.dom.WMLTemplateElementImpl", "org.apache.commons.jxpath.ri.Compiler", "org.apache.wml.dom.WMLFieldsetElementImpl", "org.apache.wml.dom.WMLBigElementImpl", "org.apache.html.dom.HTMLDivElementImpl", "org.apache.wml.dom.WMLOptgroupElementImpl", "org.apache.html.dom.HTMLMetaElementImpl", "org.apache.commons.jxpath.Functions", "org.apache.commons.jxpath.ri.model.beans.BeanPointerFactory", "org.apache.html.dom.HTMLInputElementImpl", "org.apache.commons.jxpath.util.ClassLoaderUtil", "org.apache.commons.jxpath.ri.compiler.NodeTypeTest", "org.apache.html.dom.HTMLOListElementImpl", "org.apache.wml.dom.WMLAElementImpl", "org.apache.wml.dom.WMLPElementImpl", "org.apache.commons.jxpath.JXPathException", "org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer", "org.apache.html.dom.HTMLIsIndexElementImpl", "org.apache.wml.dom.WMLElementImpl", "org.apache.commons.jxpath.PackageFunctions", "org.apache.wml.dom.WMLTdElementImpl", "org.apache.html.dom.HTMLParagraphElementImpl", "org.apache.html.dom.HTMLTitleElementImpl", "org.apache.commons.jxpath.ri.model.dom.DOMNamespaceIterator", "org.apache.wml.WMLBElement", "org.apache.html.dom.HTMLBaseFontElementImpl", "org.apache.commons.jxpath.ri.EvalContext", "org.apache.commons.jxpath.JXPathFunctionNotFoundException", "org.apache.commons.jxpath.ri.model.container.ContainerPointerFactory", "org.apache.commons.jxpath.ri.model.dom.DOMNodePointer", "org.apache.commons.jxpath.ri.compiler.Operation", "org.apache.commons.jxpath.ri.model.beans.NullPropertyPointer" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(DOMNodePointer_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.jxpath.ri.model.NodePointer", "org.apache.commons.jxpath.ri.model.dom.DOMNodePointer", "org.apache.commons.jxpath.util.BasicTypeConverter", "org.apache.commons.jxpath.util.TypeUtils$1", "org.apache.commons.jxpath.util.TypeUtils", "org.apache.wml.dom.WMLElementImpl", "org.apache.wml.dom.WMLBElementImpl", "org.apache.wml.dom.WMLNoopElementImpl", "org.apache.wml.dom.WMLAElementImpl", "org.apache.wml.dom.WMLSetvarElementImpl", "org.apache.wml.dom.WMLAccessElementImpl", "org.apache.wml.dom.WMLStrongElementImpl", "org.apache.wml.dom.WMLPostfieldElementImpl", "org.apache.wml.dom.WMLDoElementImpl", "org.apache.wml.dom.WMLWmlElementImpl", "org.apache.wml.dom.WMLTrElementImpl", "org.apache.wml.dom.WMLGoElementImpl", "org.apache.wml.dom.WMLBigElementImpl", "org.apache.wml.dom.WMLAnchorElementImpl", "org.apache.wml.dom.WMLTimerElementImpl", "org.apache.wml.dom.WMLSmallElementImpl", "org.apache.wml.dom.WMLOptgroupElementImpl", "org.apache.wml.dom.WMLHeadElementImpl", "org.apache.wml.dom.WMLTdElementImpl", "org.apache.wml.dom.WMLFieldsetElementImpl", "org.apache.wml.dom.WMLImgElementImpl", "org.apache.wml.dom.WMLRefreshElementImpl", "org.apache.wml.dom.WMLOneventElementImpl", "org.apache.wml.dom.WMLInputElementImpl", "org.apache.wml.dom.WMLPrevElementImpl", "org.apache.wml.dom.WMLTableElementImpl", "org.apache.wml.dom.WMLMetaElementImpl", "org.apache.wml.dom.WMLTemplateElementImpl", "org.apache.wml.dom.WMLBrElementImpl", "org.apache.wml.dom.WMLOptionElementImpl", "org.apache.wml.dom.WMLUElementImpl", "org.apache.wml.dom.WMLPElementImpl", "org.apache.wml.dom.WMLSelectElementImpl", "org.apache.wml.dom.WMLEmElementImpl", "org.apache.wml.dom.WMLIElementImpl", "org.apache.wml.dom.WMLCardElementImpl", "org.apache.wml.dom.WMLDocumentImpl", "org.apache.commons.jxpath.ri.QName", "org.apache.commons.jxpath.ri.model.VariablePointer", "org.apache.commons.jxpath.PackageFunctions", "org.apache.commons.jxpath.JXPathContext", "org.apache.commons.jxpath.JXPathContextFactory", "org.apache.commons.jxpath.util.ClassLoaderUtil", "org.apache.commons.jxpath.ri.JXPathContextFactoryReferenceImpl", "org.apache.commons.jxpath.ri.compiler.TreeCompiler", "org.apache.commons.jxpath.ri.model.beans.CollectionPointerFactory", "org.apache.commons.jxpath.ri.model.beans.BeanPointerFactory", "org.apache.commons.jxpath.ri.model.dynamic.DynamicPointerFactory", "org.apache.commons.jxpath.ri.model.VariablePointerFactory", "org.apache.commons.jxpath.ri.model.dom.DOMPointerFactory", "org.jdom.Document", "org.apache.commons.jxpath.ri.model.jdom.JDOMPointerFactory", "org.apache.commons.jxpath.ri.model.dynabeans.DynaBeanPointerFactory", "org.apache.commons.jxpath.ri.model.container.ContainerPointerFactory", "org.apache.commons.jxpath.ri.JXPathContextReferenceImpl$1", "org.apache.commons.jxpath.ri.JXPathContextReferenceImpl", "org.apache.commons.jxpath.util.ValueUtils", "org.apache.commons.jxpath.JXPathBasicBeanInfo$1", "org.apache.commons.jxpath.JXPathBasicBeanInfo", "org.apache.commons.jxpath.JXPathIntrospector", "org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer", "org.apache.commons.jxpath.ri.model.beans.BeanPointer", "org.apache.commons.jxpath.ri.NamespaceResolver", "org.apache.commons.jxpath.JXPathException", "org.apache.html.dom.HTMLDocumentImpl", "org.apache.commons.jxpath.ri.model.dom.NamespacePointer", "org.apache.html.dom.HTMLElementImpl", "org.apache.html.dom.HTMLBaseFontElementImpl", "org.apache.html.dom.HTMLImageElementImpl", "org.apache.commons.jxpath.ri.compiler.NodeTest", "org.apache.commons.jxpath.ri.compiler.NodeNameTest", "org.apache.html.dom.HTMLTableCellElementImpl", "org.apache.commons.jxpath.BasicVariables", "org.apache.commons.jxpath.ri.model.beans.NullPointer", "org.apache.commons.jxpath.ri.model.VariablePointer$1", "org.apache.html.dom.HTMLSelectElementImpl", "org.apache.html.dom.HTMLObjectElementImpl", "org.apache.html.dom.HTMLHeadElementImpl", "org.apache.html.dom.HTMLFrameElementImpl", "org.apache.html.dom.HTMLTableElementImpl", "org.apache.html.dom.HTMLIsIndexElementImpl", "org.apache.html.dom.HTMLFieldSetElementImpl", "org.apache.commons.jxpath.ri.compiler.ProcessingInstructionTest", "org.apache.html.dom.HTMLDListElementImpl", "org.apache.html.dom.HTMLBodyElementImpl", "org.apache.html.dom.HTMLAnchorElementImpl", "org.apache.commons.jxpath.ri.model.dom.DOMNamespaceIterator", "org.apache.html.dom.HTMLTableSectionElementImpl", "org.apache.html.dom.HTMLHtmlElementImpl", "org.apache.commons.jxpath.ri.model.dom.DOMAttributeIterator", "org.apache.commons.jxpath.ri.model.dom.DOMNodeIterator", "org.apache.commons.jxpath.ri.compiler.NodeTypeTest", "org.apache.html.dom.HTMLQuoteElementImpl", "org.apache.html.dom.HTMLParamElementImpl", "org.apache.html.dom.HTMLLegendElementImpl", "org.apache.html.dom.HTMLLabelElementImpl", "org.apache.html.dom.HTMLInputElementImpl", "org.apache.html.dom.HTMLPreElementImpl", "org.apache.html.dom.HTMLLinkElementImpl", "org.apache.html.dom.HTMLOptionElementImpl", "org.apache.html.dom.HTMLStyleElementImpl", "org.apache.html.dom.HTMLButtonElementImpl", "org.apache.html.dom.HTMLTitleElementImpl", "org.apache.html.dom.HTMLBRElementImpl", "org.apache.html.dom.HTMLFrameSetElementImpl", "org.apache.html.dom.HTMLUListElementImpl", "org.apache.html.dom.HTMLLIElementImpl", "org.apache.html.dom.HTMLAppletElementImpl", "org.apache.html.dom.HTMLTableRowElementImpl", "org.apache.html.dom.HTMLOListElementImpl", "org.apache.html.dom.HTMLIFrameElementImpl", "org.apache.html.dom.HTMLScriptElementImpl", "org.apache.html.dom.HTMLTextAreaElementImpl", "org.apache.html.dom.HTMLAreaElementImpl", "org.apache.html.dom.HTMLMapElementImpl", "org.apache.html.dom.HTMLMenuElementImpl", "org.apache.html.dom.HTMLModElementImpl", "org.apache.html.dom.HTMLHRElementImpl", "org.apache.html.dom.HTMLParagraphElementImpl", "org.apache.html.dom.HTMLMetaElementImpl", "org.apache.html.dom.HTMLOptGroupElementImpl", "org.apache.html.dom.HTMLTableColElementImpl", "org.apache.html.dom.HTMLFontElementImpl", "org.apache.html.dom.HTMLDirectoryElementImpl", "org.apache.html.dom.HTMLBaseElementImpl", "org.apache.html.dom.NameNodeListImpl", "org.apache.html.dom.HTMLFormElementImpl", "org.apache.html.dom.HTMLDivElementImpl", "org.apache.html.dom.HTMLHeadingElementImpl", "org.apache.commons.jxpath.JXPathNotFoundException", "org.apache.html.dom.HTMLTableCaptionElementImpl", "org.apache.html.dom.HTMLCollectionImpl", "org.apache.commons.jxpath.ri.model.beans.PropertyIterator", "org.apache.commons.jxpath.ri.model.beans.BeanAttributeIterator", "org.apache.commons.jxpath.ri.model.beans.PropertyPointer", "org.apache.commons.jxpath.ri.model.beans.NullPropertyPointer", "org.apache.commons.jxpath.ri.model.dom.DOMAttributePointer", "org.apache.commons.jxpath.ri.model.beans.CollectionPointer", "org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer", "org.apache.html.dom.CollectionIndex" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
8d06ff21359850eb28b725138a47d292cf4a9cb8
e20d992ccb783b8901a06cc3b2b13d2536d4f4d4
/password-manager-api/src/main/java/model/User.java
2b5a49808239e19b710d7e404a87f433ff6a5cff
[]
no_license
mohammad-abdulkhaliq/bugfree-tribble
48b7c8687d1808bb6f49c4332900978c4fca68a1
96c085b4e7aa8ef14f26c6c7db40f7dd1601a348
refs/heads/master
2020-04-06T05:22:26.098530
2014-01-12T21:49:35
2014-01-12T21:49:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,052
java
package model; import util.RSA; public class User implements Comparable<User> { private int id; private final String email; private final String password; private RSA rsaInstance; public User(int id, String email, String password) { this.id = id; this.email = email; this.password = password; } public User(String email, String password) { this.email = email; this.password = password; } public int getId() { return id; } public String getEmail() { return email; } public String getPassword() { return password; } @Override public int compareTo(User user) { //return this.getId() > user.getId() ? 1 : this.getId() == user.getId() ? 0 : -1; return ((this.getEmail().compareTo(user.getEmail())) & (this.getPassword().compareTo(user.getPassword()))); } public RSA getRsaInstance() { return rsaInstance; } public void setRsaInstance(RSA rsaInstance) { this.rsaInstance = rsaInstance; } }
[ "mohammad28march1993@gmail.com" ]
mohammad28march1993@gmail.com
ef34672aa89fb01625c9bfebd799ee0e07b4366b
12be2d3e318a5a4f7cebf95a366556c434ff379e
/phoss-smp-backend/src/main/java/com/helger/phoss/smp/domain/businesscard/ISMPBusinessCard.java
005e97c301034d3d653940dcfaee6faaeffb9e48
[]
no_license
vcgato29/phoss-smp
095e29a6d133a65bf110dd1a45bbc927053d39ed
e0684b16892825b41a1e4f28c2671131444ad6ca
refs/heads/master
2020-06-17T06:53:10.648209
2019-07-03T19:37:47
2019-07-03T19:37:47
195,836,728
1
0
null
2019-07-08T15:08:57
2019-07-08T15:08:57
null
UTF-8
Java
false
false
2,279
java
/** * Copyright (C) 2015-2019 Philip Helger and contributors * philip[at]helger[dot]com * * The Original Code is Copyright The PEPPOL project (http://www.peppol.eu) * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package com.helger.phoss.smp.domain.businesscard; import java.io.Serializable; import java.util.Comparator; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import com.helger.commons.annotation.MustImplementEqualsAndHashcode; import com.helger.commons.annotation.Nonempty; import com.helger.commons.annotation.ReturnsMutableCopy; import com.helger.commons.collection.impl.ICommonsList; import com.helger.commons.id.IHasID; import com.helger.pd.businesscard.v3.PD3BusinessCardType; import com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroup; /** * This interface represents a single SMP business card for a certain service * group. * <p> * The files in this package are licensed under Apache 2.0 license * </p> * * @author Philip Helger */ @MustImplementEqualsAndHashcode public interface ISMPBusinessCard extends IHasID <String>, Serializable { /** * @return The service group which this business card should handle. */ @Nonnull ISMPServiceGroup getServiceGroup (); /** * @return The ID of the service group to which this business card belongs. * Never <code>null</code>. */ @Nonnull @Nonempty default String getServiceGroupID () { return getServiceGroup ().getID (); } /** * @return A copy of all {@link SMPBusinessCardEntity} objects. Never * <code>null</code>. */ @Nonnull @ReturnsMutableCopy ICommonsList <SMPBusinessCardEntity> getAllEntities (); /** * @return The number of contained entities. Always &ge; 0. */ @Nonnegative int getEntityCount (); /** * @return This business card as a JAXB object for the REST interface. Never * <code>null</code>. */ @Nonnull PD3BusinessCardType getAsJAXBObject (); @Nonnull static Comparator <ISMPBusinessCard> comparator () { return Comparator.comparing (ISMPBusinessCard::getServiceGroupID); } }
[ "philip@helger.com" ]
philip@helger.com
78e3b03908cc6816f37050a47bc2094a9cedd685
3ac6a75e6ef6dce95113c3318c5746f8642520a4
/limits-service/src/main/java/com/inter/microservices/limitsservice/LimitsServiceApplication.java
4654c1aee0fbdf136dcd21f91c1431f71f4395b9
[]
no_license
rahulkr484/Microservices
162d76877db15067b48b230e7767e4d417dea349
f08a92ba32c5c62f48bc1bd29f178c14d4d04791
refs/heads/master
2022-12-05T09:17:28.468648
2020-08-13T11:07:47
2020-08-13T11:07:47
287,202,025
0
0
null
null
null
null
UTF-8
Java
false
false
344
java
package com.inter.microservices.limitsservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class LimitsServiceApplication { public static void main(String[] args) { SpringApplication.run(LimitsServiceApplication.class, args); } }
[ "rahulrel484@gmail.com" ]
rahulrel484@gmail.com
2594097fe619afc1a41aac3e4d085ab1477766ca
433f6bc02a886ecdf2e1f02e2823b039c9d5a9f6
/pidome-pidome-client/src/org/pidome/client/system/scenes/components/mainstage/displays/controls/CommandToggleButton.java
1d8b79d74b1e5becf8e3c5053d40d271f3d64f4b
[]
no_license
vendor-vandor/pidome-unofficial
58d29895cb21571c7d9a5efb4493c5a475ae5472
d1b15bf85085452a664c2892ffb26260df441007
refs/heads/master
2021-01-10T02:11:03.588741
2016-03-04T01:04:24
2016-03-04T01:04:24
53,095,614
2
0
null
null
null
null
UTF-8
Java
false
false
7,630
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.pidome.client.system.scenes.components.mainstage.displays.controls; import javafx.application.Platform; import javafx.beans.value.ObservableValue; import javafx.geometry.Pos; import javafx.scene.control.Toggle; import javafx.scene.control.ToggleButton; import javafx.scene.control.ToggleGroup; import javafx.scene.layout.Pane; import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import javafx.scene.shape.Rectangle; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.pidome.client.config.DisplayConfig; import org.pidome.client.system.domotics.components.devices.Device; import org.pidome.client.system.domotics.components.devices.DeviceValueChangeEvent; import org.pidome.client.system.domotics.components.devices.DeviceValueChangeListener; import org.pidome.client.system.scenes.ComponentDimensions; /** * * @author John Sirach */ public class CommandToggleButton extends DeviceCmd implements DeviceValueChangeListener { static Logger LOG = LogManager.getLogger(CommandToggleButton.class); ToggleButton button = new ToggleButton(); ToggleGroup group = new ToggleGroup(); Rectangle indicator = new Rectangle(); Boolean serverData = false; Device device; ComponentDimensions dimensions = new ComponentDimensions(); double width = 100 * DisplayConfig.getHeightRatio(); double height = 40 * DisplayConfig.getHeightRatio(); VBox interfaceButton; public CommandToggleButton(Device device) { this.device = device; button.setFocusTraversable(false); } @Override void build() { boolean lastKnownCmd = (boolean)device.getLastCmd(groupName, setName); button.getStyleClass().add("unknown"); button.setWrapText(true); indicator.getStyleClass().add("unknown"); if (lastKnownCmd == false || lastKnownCmd == true) { for (String id : this.cmdSet.keySet()) { button.getStyleClass().remove("unknown"); indicator.getStyleClass().remove("unknown"); if (lastKnownCmd == false && this.cmdSet.get(id).get("type").equals("off")){ button.setText((String) this.cmdSet.get(id).get("label")); button.setSelected(false); button.getStyleClass().add("off"); indicator.getStyleClass().add("off"); } else if (lastKnownCmd == true && this.cmdSet.get(id).get("type").equals("on")) { button.setText((String) this.cmdSet.get(id).get("label")); button.setSelected(true); button.getStyleClass().add("on"); indicator.getStyleClass().add("on"); } } } if (button.getText().equals("")) { button.setText("Unknown"); button.getStyleClass().add("unknown"); indicator.getStyleClass().add("unknown"); } button.setToggleGroup(group); group.selectedToggleProperty().addListener((ObservableValue<? extends Toggle> ov, Toggle toggle, Toggle new_toggle) -> { if (new_toggle != null && serverData == false) { ToggleButton pressed = (ToggleButton) group.getSelectedToggle(); if (pressed != null) { for (String id : cmdSet.keySet()) { if (cmdSet.get(id).get("type").equals("on")) { device.sendCommand(groupName, setName, true, ""); } } } } if (toggle != null && serverData == false) { for (String id : cmdSet.keySet()) { if (cmdSet.get(id).get("type").equals("off")) { device.sendCommand(groupName, setName, false, ""); } } } serverData = false; }); buildButton(); } @Override public void handleDeviceValueChange(DeviceValueChangeEvent event) { switch (event.getEventType()) { case DeviceValueChangeEvent.VALUECHANGED: final String eventSet = event.getSet(); final Object eventValue = event.getValue(); LOG.debug("Received: {}, data: {}, {}", DeviceValueChangeEvent.VALUECHANGED, eventSet, eventValue); if (eventSet.equals(setName)) { serverData = true; for(final String id:cmdSet.keySet()){ if (this.cmdSet.get(id).get("type").equals("on") && (boolean) eventValue == true) { Platform.runLater(() -> { button.setText((String) cmdSet.get(id).get("label")); button.getStyleClass().remove("unknown"); indicator.getStyleClass().remove("unknown"); button.setSelected(true); button.getStyleClass().remove("off"); indicator.getStyleClass().remove("off"); button.getStyleClass().add("on"); indicator.getStyleClass().add("on"); }); } else if (this.cmdSet.get(id).get("type").equals("off") && (boolean) eventValue == false) { Platform.runLater(() -> { button.setText((String) cmdSet.get(id).get("label")); button.getStyleClass().remove("unknown"); indicator.getStyleClass().remove("unknown"); button.setSelected(false); button.getStyleClass().remove("on"); indicator.getStyleClass().remove("on"); button.getStyleClass().add("off"); indicator.getStyleClass().add("off"); }); } } serverData = false; } break; } } void buildButton() { interfaceButton = new VBox(); interfaceButton.setPrefSize(width, height); interfaceButton.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); interfaceButton.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); interfaceButton.setAlignment(Pos.CENTER); interfaceButton.getStyleClass().add("devicebutton"); interfaceButton.getChildren().add(button); button.setPrefSize(width, height - (12 * dimensions.heightRatio)); button.setFocusTraversable(false); indicator.setWidth(width - (26 * dimensions.widthRatio)); indicator.setHeight(6 * dimensions.heightRatio); indicator.getStyleClass().add("indicator"); interfaceButton.getChildren().add(indicator); device.addDeviceValueEventListener(this, groupName, setName); } @Override public final Pane getInterface() { return getButton(); } public VBox getButton() { return interfaceButton; } @Override public final void removeListener() { device.removeDeviceValueEventListener(this, groupName, setName); } }
[ "vandor319@gmail.com" ]
vandor319@gmail.com
db7cd42243625e11294743d1c8d48ed47b2a5499
625f6598a4f92ba54c650a3024755d9e92be96b4
/WaitNotifyEx/src/com/naver/WriterTherad.java
d2dc5751401ccba32ff5f773d994f74e46b22f5e
[]
no_license
cksgur59/javastudy
53cb7e37942780872cf814f09bf5577f39425769
dc959523971b7ea9af6c50d928e942dea811b65a
refs/heads/main
2023-01-23T05:57:41.233887
2020-12-07T08:39:32
2020-12-07T08:39:32
303,949,655
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
320
java
package com.naver; public class WriterTherad extends Thread{ private Board board; public WriterTherad() { // TODO Auto-generated constructor stub } public WriterTherad(Board board) { super(); this.board = board; } @Override public void run() { board.setTodayPost("¿À´Ã Áøµµ ³¡"); } }
[ "cksgur59@gmail.com" ]
cksgur59@gmail.com
9c15e8c17b6d917cf858ccf6a00e8d75e852cf63
63152c4f60c3be964e9f4e315ae50cb35a75c555
/mllib/target/java/org/apache/spark/ml/ann/FeedForwardTrainer.java
8800cc710c1046b7cc7bb4629fd27cabbbe25288
[ "EPL-1.0", "Classpath-exception-2.0", "LicenseRef-scancode-unicode", "BSD-3-Clause", "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-free-unknown", "GCC-exception-3.1", "LGPL-2.0-or-later", "CDDL-1.0", "MIT", "CC-BY-SA-3.0", "NAIST-2003", "LGPL-2.1-only", "LicenseRef-scancode-other-copyleft", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-other-permissive", "GPL-2.0-only", "Apache-2.0", "LicenseRef-scancode-public-domain", "CPL-1.0", "CC-PDDC", "EPL-2.0", "CDDL-1.1", "BSD-2-Clause", "CC0-1.0", "Python-2.0", "LicenseRef-scancode-unknown" ]
permissive
PowersYang/spark-cn
76c407d774e35d18feb52297c68c65889a75a002
06a0459999131ee14864a69a15746c900e815a14
refs/heads/master
2022-12-11T20:18:37.376098
2020-03-30T09:48:22
2020-03-30T09:48:22
219,248,341
0
0
Apache-2.0
2022-12-05T23:46:17
2019-11-03T03:55:17
HTML
UTF-8
Java
false
false
2,658
java
package org.apache.spark.ml.ann; /** * MLlib-style trainer class that trains a network given the data and topology * <p> * param: topology topology of ANN * param: inputSize input size * param: outputSize output size */ class FeedForwardTrainer implements scala.Serializable { // not preceding public FeedForwardTrainer (org.apache.spark.ml.ann.Topology topology, int inputSize, int outputSize) { throw new RuntimeException(); } /** * Sets the LBFGS optimizer * <p> * @return LBGS optimizer */ public org.apache.spark.mllib.optimization.LBFGS LBFGSOptimizer () { throw new RuntimeException(); } /** * Sets the SGD optimizer * <p> * @return SGD optimizer */ public org.apache.spark.mllib.optimization.GradientDescent SGDOptimizer () { throw new RuntimeException(); } /** * Returns seed * @return (undocumented) */ public long getSeed () { throw new RuntimeException(); } /** * Returns weights * @return (undocumented) */ public org.apache.spark.ml.linalg.Vector getWeights () { throw new RuntimeException(); } public int inputSize () { throw new RuntimeException(); } public int outputSize () { throw new RuntimeException(); } /** * Sets the gradient * <p> * @param value gradient * @return trainer */ public org.apache.spark.ml.ann.FeedForwardTrainer setGradient (org.apache.spark.mllib.optimization.Gradient value) { throw new RuntimeException(); } /** * Sets seed * @param value (undocumented) * @return (undocumented) */ public org.apache.spark.ml.ann.FeedForwardTrainer setSeed (long value) { throw new RuntimeException(); } /** * Sets the stack size * <p> * @param value stack size * @return trainer */ public org.apache.spark.ml.ann.FeedForwardTrainer setStackSize (int value) { throw new RuntimeException(); } /** * Sets the updater * <p> * @param value updater * @return trainer */ public org.apache.spark.ml.ann.FeedForwardTrainer setUpdater (org.apache.spark.mllib.optimization.Updater value) { throw new RuntimeException(); } /** * Sets weights * <p> * @param value weights * @return trainer */ public org.apache.spark.ml.ann.FeedForwardTrainer setWeights (org.apache.spark.ml.linalg.Vector value) { throw new RuntimeException(); } /** * Trains the ANN * <p> * @param data RDD of input and output vector pairs * @return model */ public org.apache.spark.ml.ann.TopologyModel train (org.apache.spark.rdd.RDD<scala.Tuple2<org.apache.spark.ml.linalg.Vector, org.apache.spark.ml.linalg.Vector>> data) { throw new RuntimeException(); } }
[ "577790911@qq.com" ]
577790911@qq.com
39d04a51a1ad118fe3b8f9f163f293a33076d6a4
e7dc41399c522bebefad93f10bd915619fc26648
/common/src/main/java/com/wo56/business/cm/vo/CmUserInfo.java
f3a7c8053abc563978df269171214bb96f0311cd
[]
no_license
mlj0381/test3
d022f5952ab086bc7be3dbc81569b7f1b3631e99
669b461e06550e60313bc634c7a384b9769f154a
refs/heads/master
2020-03-17T01:44:41.166126
2017-08-03T02:57:52
2017-08-03T02:57:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,182
java
package com.wo56.business.cm.vo; // Generated 2016-5-31 11:23:42 by Hibernate Tools 3.4.0.CR1 import java.util.Date; /** * CmUserInfo generated by hbm2java */ public class CmUserInfo implements java.io.Serializable { private long userId; private Integer userType; private String loginAcct; private String loginPwd; private String userName; private Integer state; // private String orgCode; // private Long orgId; private Long opId; private Date createTime; private String dataSource; private Integer loginType; private String userPic;//头像 private String openId; private Integer channelType; public String getOpenId() { return openId; } public void setOpenId(String openId) { this.openId = openId; } public Integer getChannelType() { return channelType; } public void setChannelType(Integer channelType) { this.channelType = channelType; } public String getUserPic() { return userPic; } public void setUserPic(String userPic) { this.userPic = userPic; } public CmUserInfo() { } public CmUserInfo(long userId) { this.userId = userId; } public CmUserInfo(long userId, Integer userType, String loginAcct, String loginPwd, String userName, Integer state, Long opId, Date createTime, Date updateTime, Integer isLogin, String userPhone, String dataSource) { this.userId = userId; this.userType = userType; this.loginAcct = loginAcct; this.loginPwd = loginPwd; this.userName = userName; this.state = state; // this.orgCode = orgCode; // this.orgId = orgId; // this.tenantId = tenantId; // this.tenantCode = tenantCode; this.opId = opId; this.createTime = createTime; this.dataSource = dataSource; } public long getUserId() { return this.userId; } public void setUserId(long userId) { this.userId = userId; } public Integer getUserType() { return this.userType; } public void setUserType(Integer userType) { this.userType = userType; } public String getLoginAcct() { return this.loginAcct; } public void setLoginAcct(String loginAcct) { this.loginAcct = loginAcct; } public String getLoginPwd() { return this.loginPwd; } public void setLoginPwd(String loginPwd) { this.loginPwd = loginPwd; } public String getUserName() { return this.userName; } public void setUserName(String userName) { this.userName = userName; } public Integer getState() { return this.state; } public void setState(Integer state) { this.state = state; } public Long getOpId() { return this.opId; } public void setOpId(Long opId) { this.opId = opId; } public Date getCreateTime() { return this.createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getDataSource() { return this.dataSource; } public void setDataSource(String dataSource) { this.dataSource = dataSource; } public Integer getLoginType() { return loginType; } public void setLoginType(Integer loginType) { this.loginType = loginType; } }
[ "yunqi@DESKTOP-FS7ABO9" ]
yunqi@DESKTOP-FS7ABO9
04dd6387c8ad361981bbccc55e482cf4464e2dc3
9d32980f5989cd4c55cea498af5d6a413e08b7a2
/A1_7_1_1/src/main/java/com/mediatek/common/voicecommand/IVoiceCommandListener.java
e77597e76898e5e8efa34d3ea000e1f4ea424274
[]
no_license
liuhaosource/OppoFramework
e7cc3bcd16958f809eec624b9921043cde30c831
ebe39acabf5eae49f5f991c5ce677d62b683f1b6
refs/heads/master
2023-06-03T23:06:17.572407
2020-11-30T08:40:07
2020-11-30T08:40:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
11,702
java
package com.mediatek.common.voicecommand; import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.os.IInterface; import android.os.RemoteException; /* JADX ERROR: NullPointerException in pass: ExtractFieldInit java.lang.NullPointerException at jadx.core.utils.BlockUtils.isAllBlocksEmpty(BlockUtils.java:546) at jadx.core.dex.visitors.ExtractFieldInit.getConstructorsList(ExtractFieldInit.java:221) at jadx.core.dex.visitors.ExtractFieldInit.moveCommonFieldsInit(ExtractFieldInit.java:121) at jadx.core.dex.visitors.ExtractFieldInit.visit(ExtractFieldInit.java:46) at jadx.core.dex.visitors.ExtractFieldInit.visit(ExtractFieldInit.java:42) at jadx.core.dex.visitors.ExtractFieldInit.visit(ExtractFieldInit.java:42) at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:12) at jadx.core.ProcessClass.process(ProcessClass.java:32) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200) */ public interface IVoiceCommandListener extends IInterface { public static abstract class Stub extends Binder implements IVoiceCommandListener { private static final String DESCRIPTOR = "com.mediatek.common.voicecommand.IVoiceCommandListener"; static final int TRANSACTION_onVoiceCommandNotified = 1; private static class Proxy implements IVoiceCommandListener { private IBinder mRemote; /* JADX ERROR: Method load error jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 00e8 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.<init>(android.os.IBinder):void, dex: at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.ProcessClass.process(ProcessClass.java:29) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200) Caused by: java.lang.IllegalArgumentException: bogus opcode: 00e8 at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227) at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234) at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581) at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74) at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104) ... 7 more */ Proxy(android.os.IBinder r1) { /* // Can't load method instructions: Load method exception: bogus opcode: 00e8 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.<init>(android.os.IBinder):void, dex: */ throw new UnsupportedOperationException("Method not decompiled: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.<init>(android.os.IBinder):void"); } /* JADX ERROR: Method load error jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 00e5 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.asBinder():android.os.IBinder, dex: at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.ProcessClass.process(ProcessClass.java:29) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200) Caused by: java.lang.IllegalArgumentException: bogus opcode: 00e5 at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227) at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234) at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581) at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74) at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104) ... 7 more */ public android.os.IBinder asBinder() { /* // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.asBinder():android.os.IBinder, dex: */ throw new UnsupportedOperationException("Method not decompiled: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.asBinder():android.os.IBinder"); } /* JADX ERROR: Method load error jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 00e9 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.onVoiceCommandNotified(int, int, android.os.Bundle):void, dex: at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.ProcessClass.process(ProcessClass.java:29) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200) Caused by: java.lang.IllegalArgumentException: bogus opcode: 00e9 at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227) at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234) at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581) at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74) at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104) ... 7 more */ public void onVoiceCommandNotified(int r1, int r2, android.os.Bundle r3) throws android.os.RemoteException { /* // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.onVoiceCommandNotified(int, int, android.os.Bundle):void, dex: */ throw new UnsupportedOperationException("Method not decompiled: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.Proxy.onVoiceCommandNotified(int, int, android.os.Bundle):void"); } public String getInterfaceDescriptor() { return Stub.DESCRIPTOR; } } /* JADX ERROR: Method load error jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 00e9 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.<init>():void, dex: at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.ProcessClass.process(ProcessClass.java:29) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200) Caused by: java.lang.IllegalArgumentException: bogus opcode: 00e9 at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227) at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234) at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581) at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74) at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104) ... 6 more */ public Stub() { /* // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.<init>():void, dex: */ throw new UnsupportedOperationException("Method not decompiled: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.<init>():void"); } /* JADX ERROR: Method load error jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 00e9 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.onTransact(int, android.os.Parcel, android.os.Parcel, int):boolean, dex: at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248) at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:254) at jadx.core.ProcessClass.process(ProcessClass.java:29) at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292) at jadx.api.JavaClass.decompile(JavaClass.java:62) at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200) Caused by: java.lang.IllegalArgumentException: bogus opcode: 00e9 at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227) at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234) at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581) at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74) at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104) ... 6 more */ public boolean onTransact(int r1, android.os.Parcel r2, android.os.Parcel r3, int r4) throws android.os.RemoteException { /* // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.onTransact(int, android.os.Parcel, android.os.Parcel, int):boolean, dex: */ throw new UnsupportedOperationException("Method not decompiled: com.mediatek.common.voicecommand.IVoiceCommandListener.Stub.onTransact(int, android.os.Parcel, android.os.Parcel, int):boolean"); } public static IVoiceCommandListener asInterface(IBinder obj) { if (obj == null) { return null; } IInterface iin = obj.queryLocalInterface(DESCRIPTOR); if (iin == null || !(iin instanceof IVoiceCommandListener)) { return new Proxy(obj); } return (IVoiceCommandListener) iin; } public IBinder asBinder() { return this; } } void onVoiceCommandNotified(int i, int i2, Bundle bundle) throws RemoteException; }
[ "dstmath@163.com" ]
dstmath@163.com
0f5d6dbb844b9431a1e230f22bc79e9acfefa6e7
373b19b8234708c28d900190e255d143456a9254
/src/main/java/dev/atanu/ecom/cart/feign/ProductSvcFeign.java
3470aa9108db2a88433483d71742f97f9f0a4449
[]
no_license
atanubhowmick/ecom-cart-svc
1b2471d0cd00d6ff9cb38394702b080cb9a259d6
8ac62d8f90b8d4d6e2ab3bcd1474c022320036cb
refs/heads/master
2023-04-16T10:11:09.476076
2021-05-04T06:49:20
2021-05-04T06:49:20
254,174,144
0
0
null
null
null
null
UTF-8
Java
false
false
1,294
java
/** * */ package dev.atanu.ecom.cart.feign; import java.util.List; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import dev.atanu.ecom.cart.dto.GenericResponse; import dev.atanu.ecom.cart.dto.ProductDetails; import dev.atanu.ecom.cart.dto.QueryPageable; /** * @author Atanu Bhowmick * */ @FeignClient("product-svc") public interface ProductSvcFeign { @GetMapping(value = "/api/product/get-by-id/{product-id}", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<GenericResponse<ProductDetails>> getProductById(@PathVariable("product-id") Long productId); @PostMapping(value = "/api/product/view", produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<GenericResponse<List<ProductDetails>>> productsBySpecification( @RequestParam(value = "isListRequired", required = false) boolean isListRequired, @RequestBody QueryPageable queryPageable); }
[ "mail2atanu007@gmail.com" ]
mail2atanu007@gmail.com
7268b4f6b98f02fb45fbcd5ece627abc5b3c8ec2
b387ace3d2a737a7c36ae66afba08b1f33282e83
/src/main/java/com/douzone/springcontainer/videosystem/BlankDisc.java
5dac44b60704e187ef885f215e63098da3ea9895
[]
no_license
dudehs6726/springcontainer
2bf55dd594ede683f7bb863fac431627635edaeb
2abfb2397b8a541dce7dd5654268df0b63cd90c8
refs/heads/master
2020-04-29T20:40:33.633695
2019-03-20T01:44:12
2019-03-20T01:44:12
176,390,749
0
0
null
null
null
null
UTF-8
Java
false
false
973
java
package com.douzone.springcontainer.videosystem; import java.util.List; public class BlankDisc implements DigitalVideoDisc { private String title; private String studio; private List<String> actors; public BlankDisc() { } public BlankDisc(String title, String studio) { this.title = title; this.studio = studio; } public BlankDisc(String title, String studio, List<String> actors) { this.title = title; this.studio = studio; this.actors = actors; } public void setTitle(String title) { this.title = title; } public void setStudio(String studio) { this.studio = studio; } public void setActors(List<String> actors) { this.actors = actors; } @Override public void play() { System.out.println("Playing Movie " + studio + "'s " + title); } @Override public String toString() { return "BlankDisc [title=" + title + ", studio=" + studio + ", actors=" + actors + "]"; } }
[ "BIT@DESKTOP-SU5SFCR" ]
BIT@DESKTOP-SU5SFCR
8759c3944b1a503016f75d32d9de7d5643007d0d
cede2706fa22c492eb975f12c8a964bdbcfcc5c5
/TestSerialization.java
48ffdf8e5c4bdf706c7a2369e843270e49c582ce
[]
no_license
pyla-sailaja/files
8b3359162d5883a1de6b09e891ea2ca8ce4c0a2b
bb3730354436ac653345c9cb69d0d72efda3b148
refs/heads/master
2022-11-25T00:55:25.213102
2020-01-17T11:21:17
2020-01-17T11:21:17
230,598,303
0
0
null
2022-11-24T06:19:31
2019-12-28T11:03:32
Java
UTF-8
Java
false
false
1,042
java
class Employee implements java.io.Serializable { int empid; String ename; double salary; public Employee(){} public Employee(int empid,String ename,double salary) { this.empid=empid; this.ename=ename; this.salary=salary; } public void setEmpid(int empid) { this.empid=empid; } public void setEname(String ename) { this.ename=ename; } public void setSalary(double salary) { this.salary=salary; } public int getEmpid() { return empid; } public String getEname() { return ename; } public double getSalary() { return salary; } } class TestSerialization { public static void main(String[] args) { Employee e=new Employee(786,"john miller",25000.00); try(FileOutputStream fos = new FileOutputStream("emp.dat"); ObjectOutputStream oos = new ObjectOutputStream(fos);) { oos.writeObject(e); } catch(IOException ex) { System.out.println(ex); } } }
[ "noreply@github.com" ]
pyla-sailaja.noreply@github.com
f38ad3546e45d5bd860fe4aed1928a254c0f3491
80e77ae5bde4a1d741f841909a61261393fc3a1b
/src/main/java/com/sinosoft/wateradmin/cmd/service/IGisService.java
202c041913c4c2540bc2436ae4b3ffdac8aa308d
[]
no_license
xiaojunjava/WaterAdmin
d69b6d8628a4a1f4289e4339659158456fb5e89b
3a038941439fb3bfdd8a183d36e1f367dd06163c
refs/heads/master
2021-09-03T16:08:44.212681
2018-01-10T09:45:45
2018-01-10T09:45:45
113,955,883
0
0
null
null
null
null
UTF-8
Java
false
false
688
java
package com.sinosoft.wateradmin.cmd.service; import com.sinosoft.wateradmin.cmd.bean.ShipMonitor; import java.util.List; import java.util.Map; /** * Gis相关(指挥调度用) Service * @author lkj */ public interface IGisService { /** * gis缓存的存储及序列化操作 * @throws Exception */ public void doGisRequest() throws Exception; /** *获取所有正在执法的人的实时坐标 * @return * @throws Exception */ public Map getNowPeopleGis() throws Exception; /** * 获取所有目标实时移动中的坐标(车/船) * @param saType * @return * @throws Exception */ public Map getNowSaGis(String saType) throws Exception; }
[ "caojunweigoodman@yahoo.com" ]
caojunweigoodman@yahoo.com
14861dbfd9d1ba1d0d2c65d87c2cb6108b93b417
f316aacac514cbf309918f148c45106193d983d8
/app/src/main/java/com/example/pw_iot/DeviceListActivity.java
9b1c50cdbf8cae7bf3565054eaee5608758aeab8
[]
no_license
KewenC/BlueTest
7c8953ea342e9a3f7b13589930a3953a0e70fd30
057c7c5a3430490faf6a4e3c07ad290aa54ee1a9
refs/heads/master
2020-04-29T02:13:45.018387
2019-03-15T06:02:20
2019-03-15T06:02:20
175,758,665
0
0
null
null
null
null
GB18030
Java
false
false
10,072
java
/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.pw_iot; import android.app.Activity; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothManager; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.pm.PackageManager; import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.Window; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /* * DeviceListActivity这一界面为蓝牙搜索对话框界面 */ public class DeviceListActivity extends Activity { private BluetoothAdapter mBluetoothAdapter; // private BluetoothAdapter mBtAdapter; private TextView mEmptyList; public static final String TAG = "DeviceListActivity"; List<BluetoothDevice> deviceList; private DeviceAdapter deviceAdapter; private ServiceConnection onService = null; Map<String, Integer> devRssiValues; private static final long SCAN_PERIOD = 10000; // 10 seconds private Handler mHandler; private boolean mScanning; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "onCreate"); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.title_bar); setContentView(R.layout.device_list); android.view.WindowManager.LayoutParams layoutParams = this.getWindow().getAttributes(); layoutParams.gravity = Gravity.TOP; layoutParams.y = 200; mHandler = new Handler(); /** * hasSystemFeature(参数):判断本机是否支持参数名所指定的特性 * PackageManager.FEATURE_BLUETOOTH_LE:本机支持与远程ble设备进行数据传输 */ if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) { Toast.makeText(this, "本机不支持BLE", Toast.LENGTH_SHORT).show(); finish(); } // 创建一个蓝牙适配器,在>=18版本的api中,创建一个蓝牙适配器需要通过BluetoothManager来创建 final BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE); mBluetoothAdapter = bluetoothManager.getAdapter(); // 通过创建的蓝牙适配器检查本机是否支持BLE功能 if (mBluetoothAdapter == null) { Toast.makeText(this, "本机不支持BLE", Toast.LENGTH_SHORT).show(); finish(); return; } populateList(); mEmptyList = (TextView) findViewById(R.id.empty); Button cancelButton = (Button) findViewById(R.id.btn_cancel); cancelButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { /** * 只有在10秒钟之后开启的子线程里面讲mScanning赋值为false了,而在子线程中按钮的文字被置成了scan, * 所以可以通过此标志来得出此时按钮上的文字为scan,若要点击按钮,那么就会执行scan操作 */ if (mScanning == false) scanLeDevice(true); /** * 如果mScanning!=false,那么可以判断出当前按钮上的文字为cancle, * 所以下面就必须执行cancle对应的操作 */ else finish(); } }); } private void populateList() { /* Initialize device list container */ Log.d(TAG, "populateList"); deviceList = new ArrayList<BluetoothDevice>(); deviceAdapter = new DeviceAdapter(this, deviceList); devRssiValues = new HashMap<String, Integer>(); ListView newDevicesListView = (ListView) findViewById(R.id.new_devices); newDevicesListView.setAdapter(deviceAdapter); // 点击列表项,对应的蓝牙设备的mac地址通过intent被传送到MainActivity页面 newDevicesListView.setOnItemClickListener(mDeviceClickListener); scanLeDevice(true); } private void scanLeDevice(final boolean enable) { final Button cancelButton = (Button) findViewById(R.id.btn_cancel); if (enable) { // 10s钟之后开始执行Runnable里面的函数体 mHandler.postDelayed(new Runnable() { @Override public void run() { System.out.println("停止搜索ble"); mScanning = false; mBluetoothAdapter.stopLeScan(mLeScanCallback); cancelButton.setText(R.string.scan); } }, 10000); // 进入if函数体之后首先会执行下面的三行代码,10秒钟以后会开启一个子线程,在子线程里面执行上面Runnable里面的内容 mScanning = true; mBluetoothAdapter.startLeScan(mLeScanCallback); cancelButton.setText(R.string.cancel); } else { mScanning = false; mBluetoothAdapter.stopLeScan(mLeScanCallback); cancelButton.setText(R.string.scan); } } private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { runOnUiThread(new Runnable() { @Override public void run() { runOnUiThread(new Runnable() { @Override public void run() { addDevice(device, rssi); } }); } }); } }; private void addDevice(BluetoothDevice device, int rssi) { boolean deviceFound = false; for (BluetoothDevice listDev : deviceList) { if (listDev.getAddress().equals(device.getAddress())) { deviceFound = true; break; } } devRssiValues.put(device.getAddress(), rssi); if (!deviceFound) { deviceList.add(device); mEmptyList.setVisibility(View.GONE); deviceAdapter.notifyDataSetChanged(); } } @Override public void onStart() { super.onStart(); IntentFilter filter = new IntentFilter(BluetoothDevice.ACTION_FOUND); filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED); filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED); } @Override public void onStop() { super.onStop(); mBluetoothAdapter.stopLeScan(mLeScanCallback); } @Override protected void onDestroy() { super.onDestroy(); mBluetoothAdapter.stopLeScan(mLeScanCallback); } private OnItemClickListener mDeviceClickListener = new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { BluetoothDevice device = deviceList.get(position); // 如果本机蓝牙正在搜索,那么就将其停止搜索 mBluetoothAdapter.stopLeScan(mLeScanCallback); Bundle b = new Bundle(); /** * key:BluetoothDevice.EXTRA_DEVICE——是一个字符串 * value:deviceList.get(position).getAddress()—— * 所选择列表项所对应的ble蓝牙设备的mac地址 */ b.putString(BluetoothDevice.EXTRA_DEVICE, deviceList.get(position).getAddress()); // 通过intent将key和value值传送到MainActivity页面 Intent result = new Intent(); result.putExtras(b); setResult(Activity.RESULT_OK, result); finish(); } }; protected void onPause() { super.onPause(); scanLeDevice(false); } class DeviceAdapter extends BaseAdapter { Context context; List<BluetoothDevice> devices; LayoutInflater inflater; public DeviceAdapter(Context context, List<BluetoothDevice> devices) { this.context = context; inflater = LayoutInflater.from(context); this.devices = devices; } @Override public int getCount() { return devices.size(); } @Override public Object getItem(int position) { return devices.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewGroup vg; if (convertView != null) { vg = (ViewGroup) convertView; } else { vg = (ViewGroup) inflater.inflate(R.layout.device_element, null); } BluetoothDevice device = devices.get(position); final TextView tvadd = ((TextView) vg.findViewById(R.id.address)); final TextView tvname = ((TextView) vg.findViewById(R.id.name)); final TextView tvpaired = (TextView) vg.findViewById(R.id.paired); final TextView tvrssi = (TextView) vg.findViewById(R.id.rssi); tvrssi.setVisibility(View.VISIBLE); byte rssival = (byte) devRssiValues.get(device.getAddress()).intValue(); if (rssival != 0) { tvrssi.setText("Rssi = " + String.valueOf(rssival)); } tvname.setText(device.getName()); tvadd.setText(device.getAddress()); if (device.getBondState() == BluetoothDevice.BOND_BONDED) { Log.i(TAG, "device::" + device.getName()); tvname.setTextColor(Color.WHITE); tvadd.setTextColor(Color.WHITE); tvpaired.setTextColor(Color.GRAY); tvpaired.setVisibility(View.VISIBLE); tvpaired.setText(R.string.paired); tvrssi.setVisibility(View.VISIBLE); tvrssi.setTextColor(Color.WHITE); } else { tvname.setTextColor(Color.WHITE); tvadd.setTextColor(Color.WHITE); tvpaired.setVisibility(View.GONE); tvrssi.setVisibility(View.VISIBLE); tvrssi.setTextColor(Color.WHITE); } return vg; } } private void showMessage(String msg) { Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); } }
[ "chenkw@coocent.net" ]
chenkw@coocent.net
8db8ca625b0580e15de475c71ebd247e1c96d5b3
a9d7dc1eb54708d1857511f323a132f587692e62
/flowaccount-android-client/src/main/java/org/openapitools/client/model/ReferencedByMe.java
46c259c893c3244c097ff904ff2420eff729524d
[]
no_license
flowaccount/flowaccount-openapi-sdk
e529df8f2443c1093f76c10faf0d294da49294c7
0dd180140bb0792a138495a98b22eb3dcbd603cb
refs/heads/master
2023-01-11T04:04:21.959857
2021-12-10T05:46:25
2021-12-10T05:46:25
252,394,052
10
5
null
2022-12-31T08:36:10
2020-04-02T08:10:04
Java
UTF-8
Java
false
false
5,855
java
/** * FlowAccount Open API * # Introduction **Servers Production** <site>Site:</site> https://www.flowaccount.com <site>Api url:</site> https://openapi.flowaccount.com/v1 **Beta test** <site>Site:</site> http://sandbox-new.flowaccount.com/ <site>Api url:</site> https://openapi.flowaccount.com/test **PostMan Collection** <site>Link:</site> https://www.getpostman.com/collections/01e7c68d7093e2092a64 * * The version of the OpenAPI document: 2-oas3 * Contact: developer_support@flowaccount.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package org.openapitools.client.model; import io.swagger.annotations.*; import com.google.gson.annotations.SerializedName; @ApiModel(description = "") public class ReferencedByMe { @SerializedName("referenceId") private Integer referenceId = null; @SerializedName("referenceDocumentType") private Integer referenceDocumentType = null; @SerializedName("referenceDocumentSerial") private String referenceDocumentSerial = null; @SerializedName("documentId") private Integer documentId = null; @SerializedName("documentSerial") private Integer documentSerial = null; @SerializedName("type") private Integer type = 1; /** * ID เอกสารฉบับนี้ **/ @ApiModelProperty(value = "ID เอกสารฉบับนี้") public Integer getReferenceId() { return referenceId; } public void setReferenceId(Integer referenceId) { this.referenceId = referenceId; } /** * ประเภทของเอกสารฉบับนี้ **/ @ApiModelProperty(value = "ประเภทของเอกสารฉบับนี้") public Integer getReferenceDocumentType() { return referenceDocumentType; } public void setReferenceDocumentType(Integer referenceDocumentType) { this.referenceDocumentType = referenceDocumentType; } /** * เลขที่เอกสารฉบับนี้ **/ @ApiModelProperty(value = "เลขที่เอกสารฉบับนี้") public String getReferenceDocumentSerial() { return referenceDocumentSerial; } public void setReferenceDocumentSerial(String referenceDocumentSerial) { this.referenceDocumentSerial = referenceDocumentSerial; } /** * ID เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้ **/ @ApiModelProperty(value = "ID เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้") public Integer getDocumentId() { return documentId; } public void setDocumentId(Integer documentId) { this.documentId = documentId; } /** * เลขที่เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้ **/ @ApiModelProperty(value = "เลขที่เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้") public Integer getDocumentSerial() { return documentSerial; } public void setDocumentSerial(Integer documentSerial) { this.documentSerial = documentSerial; } /** **/ @ApiModelProperty(value = "") public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ReferencedByMe referencedByMe = (ReferencedByMe) o; return (this.referenceId == null ? referencedByMe.referenceId == null : this.referenceId.equals(referencedByMe.referenceId)) && (this.referenceDocumentType == null ? referencedByMe.referenceDocumentType == null : this.referenceDocumentType.equals(referencedByMe.referenceDocumentType)) && (this.referenceDocumentSerial == null ? referencedByMe.referenceDocumentSerial == null : this.referenceDocumentSerial.equals(referencedByMe.referenceDocumentSerial)) && (this.documentId == null ? referencedByMe.documentId == null : this.documentId.equals(referencedByMe.documentId)) && (this.documentSerial == null ? referencedByMe.documentSerial == null : this.documentSerial.equals(referencedByMe.documentSerial)) && (this.type == null ? referencedByMe.type == null : this.type.equals(referencedByMe.type)); } @Override public int hashCode() { int result = 17; result = 31 * result + (this.referenceId == null ? 0: this.referenceId.hashCode()); result = 31 * result + (this.referenceDocumentType == null ? 0: this.referenceDocumentType.hashCode()); result = 31 * result + (this.referenceDocumentSerial == null ? 0: this.referenceDocumentSerial.hashCode()); result = 31 * result + (this.documentId == null ? 0: this.documentId.hashCode()); result = 31 * result + (this.documentSerial == null ? 0: this.documentSerial.hashCode()); result = 31 * result + (this.type == null ? 0: this.type.hashCode()); return result; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ReferencedByMe {\n"); sb.append(" referenceId: ").append(referenceId).append("\n"); sb.append(" referenceDocumentType: ").append(referenceDocumentType).append("\n"); sb.append(" referenceDocumentSerial: ").append(referenceDocumentSerial).append("\n"); sb.append(" documentId: ").append(documentId).append("\n"); sb.append(" documentSerial: ").append(documentSerial).append("\n"); sb.append(" type: ").append(type).append("\n"); sb.append("}\n"); return sb.toString(); } }
[ "new90.store@gmail.com" ]
new90.store@gmail.com
434f1440a0e7bd99c43813183af68d7a53f72c97
c990cdea34444b9e78508ec6738d65882d4f7967
/java/service/NotificationsManager.java
599b46b9d355feccfb9d99bf9064f39d49358a4e
[]
no_license
Lagosa/TutorUp
f547b7973b1a761be32e5c28362c16b215a27ad0
4aee9c14b5547b92b23ad8fccba89bcfaa4f80d1
refs/heads/main
2023-08-29T10:13:57.155271
2021-11-01T14:39:58
2021-11-01T14:39:58
423,498,880
0
0
null
null
null
null
UTF-8
Java
false
false
3,006
java
package itreact.tutorup.server.service; import itreact.tutorup.server.db.DatabaseFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.Map; public class NotificationsManager { public static NotificationsManager ourInstance = new NotificationsManager(); public static NotificationsManager getInstance(){return ourInstance;} private final Logger log = LoggerFactory.getLogger(RequestsManager.class); private final String className = "[NotificationManager] "; public void save(int userid, String from, String title, String description, String link, String page)throws SQLException{ DatabaseFactory.getNotificationsDao().saveNotification(userid,from, title,description,link, page); } public List<Map<String, Object>> listNotificationsFromUser(int userId)throws SQLException{ List<Map<String,Object>> notifications = DatabaseFactory.getNotificationsDao().listNotificationsFromUser(userId); return notifications; } public List<Map<String, Object>> listNotificationsFromUser(String userName)throws SQLException{ List<Map<String,Object>> notifications = DatabaseFactory.getNotificationsDao().listNotificationsFromUser(userName); if (notifications.size() < 10) { notifications.addAll(DatabaseFactory.getNotificationsDao().listNotificationsWithStatusSentFromUser(userName, (10 - notifications.size()))); } return notifications; } public void markNotificationSent(int id)throws SQLException{ DatabaseFactory.getNotificationsDao().changeStatus(id, "SENT"); } public List<Map<String,Object>> listAMAResults( int requestId, int nrResults)throws SQLException { List<Map<String, Object>> results = new ArrayList<>(); Map<String,Object> aMAResult ; log.debug(className+"Filling list with AMA results..."); for(int i=0;i<nrResults;i++){ log.debug(className+"Getting ids from db for requestid: {} and offer number {}",requestId,i); aMAResult = DatabaseFactory.getNotificationsDao().listAMAResultsIds(requestId,i); log.debug(className+"Getting offer for id: {}",aMAResult.get("offerId")); results.add(OffersManager.getInstance().findOfferById((int)aMAResult.get("offerId"))); log.debug(className+""); markNotificationSent((int)aMAResult.get("notificationId")); } results = SearchManager.getInstance().attachUsers(results,"tutorId"); return results; } public List<Map<String, Object>> getNotificationsFromUser(int id)throws SQLException { List<Map<String, Object>> result = listNotificationsFromUser(id); for(Map<String,Object> notification: result){ markNotificationSent((int)notification.get("id")); } return result; } }
[ "noreply@github.com" ]
Lagosa.noreply@github.com
bcbbbc6c8d92746f1b2c82c844c2367e52e3d857
42944292f197c2f8fe587de9578777fae0dc05d5
/android/app/src/main/java/com/friendify/MainActivity.java
20f79158b63cfe64dde80031acddc440858c10b3
[]
no_license
0Calories/friendify
f157bc3adf13edd94e16f58c9b33b6066febc062
1072d45bdea25de8e8c86cb44070bd9e1e11dece
refs/heads/master
2021-07-04T20:39:38.254686
2019-09-14T06:47:28
2019-09-14T06:47:28
208,401,539
0
0
null
2020-12-11T20:44:09
2019-09-14T06:51:48
JavaScript
UTF-8
Java
false
false
363
java
package com.friendify; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "Friendify"; } }
[ "root@v1044-wn-rt-b-133-132.campus-dynamic.uwaterloo.ca" ]
root@v1044-wn-rt-b-133-132.campus-dynamic.uwaterloo.ca
1e8a8a3f31bc0db19f84b2dbed2db234a0dbdfe1
f8c797c0bd16fd1aec44677d5e33d59abb65404f
/mon-backend/src/main/java/ru/ursip/webservice/monitoring/utils/report/excel/ExcelCurrentPeriodAvgPriceDocumentCreator.java
ceaada2e07e497766f831c78a330d75aad877358
[]
no_license
CEBEP87/MySimpleCode
4af3cd32750680620842ca27cb4553bc06d2f287
394cb3c780606d1e67acb56cee0a442db798b3a1
refs/heads/master
2020-03-15T06:52:09.441283
2018-10-21T06:39:03
2018-10-21T06:39:03
132,017,113
0
0
null
null
null
null
UTF-8
Java
false
false
35,315
java
package ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.utils.report.excel; import org.apache.commons.lang3.ObjectUtils; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.xssf.streaming.SXSSFWorkbook; import ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.model.Period; import ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.model.Resource; import ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.model.ResourceSection; import ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.model.report.ReportSettings; import ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.model.report.ReportTableHeadColumn; import ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.utils.report.ReportConfiguration; import ru.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.webservice.monitoring.utils.report.ReportDocTypeProperties; import java.io.IOException; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; /** * Формирование Excel - документа содерржащие средние цены по ресурсам в периоде * * @author samsonov * @since 15.03.2017 */ public class ExcelCurrentPeriodAvgPriceDocumentCreator { /** * Количество столбцов в таблице */ private static int maxTableColumn = 0; /** * Настройки отчета */ private static ReportSettings settings = null; /** * Результирующий Excel - документ */ private static Workbook resultExcel = null; /** * Excel - лист */ private static Sheet sheet; /** * Основной стиль ячеек в таблице */ private static CellStyle tableInfoStyle = null; /** * Дополнительный стиль ячеек в таблице */ private static CellStyle extraTableInfoStyle = null; /** * Дополнительный стиль ячеек в таблице для колонки ТСН */ private static CellStyle TSNTableInfoStyle = null; /** * Дополнительный стиль ячеек в таблице для колонки price */ private static CellStyle PriceTableInfoStyle = null; /** * Создание отчета * * @param resourcesPeriod - список ресурсов в периоде со средним значением цен * @param sections - список разделов * @param period - период * @param docType - тип отчета * @return - excel отчет */ public static Workbook createNewExcelDocument(Map<Resource, Double> resourcesPeriod, List<ResourceSection> sections, Period period, ReportDocTypeProperties docType) throws IOException { // создание результирующего report файла в памяти // resultExcel = new HSSFWorkbook(); resultExcel = new SXSSFWorkbook(); // Получаем настройки отчета settings = ReportConfiguration.getReportSettings(docType); List<ReportTableHeadColumn> reportTableHeadColumn = settings.getTableHeadColumns(); maxTableColumn = reportTableHeadColumn.size(); // Добавляем в заголовок таблицы информацию о текущем периоде List<String> reportTableTitle = settings.getTitleList(); int lastTitleIndex = reportTableTitle.size() - 1; // Информация о периоде // Формируем строку с информацией о периоде Calendar cal = Calendar.getInstance(); cal.setTime(period.getDateTill()); String lastTitleStringRow = reportTableTitle.get(lastTitleIndex) + " " + period.getName() + " " + cal.get(Calendar.YEAR) + " год"; reportTableTitle.remove(lastTitleIndex); reportTableTitle.add(lastTitleStringRow); settings.setTitleList(reportTableTitle); // создание листа с названием sheet = resultExcel.createSheet(settings.getDocName()); // счетчик для строк int rowNum = 0; //создание шапки if (settings.getServiceList() != null) { rowNum = createService(rowNum); } //Создание заголовка таблицы if (settings.getTitleList() != null) { rowNum = createTitle(rowNum); } //Создание заголовка таблицы if (settings.getTableHeadColumns() != null) { // создаем стиль для ячейки tableInfoStyle = resultExcel.createCellStyle(); setUpTableInfoStyle(resultExcel); extraTableInfoStyle = resultExcel.createCellStyle(); TSNTableInfoStyle = resultExcel.createCellStyle(); PriceTableInfoStyle=resultExcel.createCellStyle(); setUpExtraTableInfoStyle(resultExcel); setUpTsnTableInfoStyle(resultExcel); setUpPriceTableInfoStyle(resultExcel); List<Row> tableHeadRows = createHeadTableRows(rowNum); rowNum = tableHeadRows.get(tableHeadRows.size() - 1).getRowNum(); //Установка стилей для заголовка таблицы for (Row currentRow : tableHeadRows) { setUpHeaderTableStyle(resultExcel, currentRow); } //Создание строки с номерами rowNum = createNumericTableRow(rowNum); //Установка стилей для строки нумерации Row numericRow = sheet.getRow(rowNum); setUpNumericTableStyle(resultExcel, numericRow); //Счетчик записи цен поставщиков int countResourcePeriod = 0; List<Resource> list=new ArrayList<Resource>(); for (Resource resource : resourcesPeriod.keySet()) { list.add(resource); } List<Resource> sortedList = list.stream() .sorted( (e1, e2) -> { String[] s1 = e1.getCodeTSN().split("\\."); String[] s3 = e2.getCodeTSN().split("\\."); if ((e1.getCodeTSN().contains("."))& (e2.getCodeTSN().contains("."))){ String[] s2 = s1[1].split("\\-"); String[] s4 = s3[1].split("\\-"); int result; result = s1[0].compareTo(s3[0]); if (result != 0) return result; result = s2[0].compareTo(s4[0]); if (result != 0) return result; result = s2[1].compareTo(s4[1]); if (result != 0) return result; return Integer.valueOf(s2[2]).compareTo(Integer.valueOf(s4[2])); } else{ return Integer.valueOf(s1[0]).compareTo(Integer.valueOf(s3[0])); } } ) .collect(Collectors.toList()); for (ResourceSection currentSections : sections) { Row resourceSectionRow = createTableSectionRow(++rowNum, currentSections); //Установка стилей для строки информации о ресурсы в периоде setUpSectionInfoStyle(resultExcel, resourceSectionRow); rowNum = resourceSectionRow.getRowNum(); for (Resource resource : sortedList) { if (resource.getResourceSection().getId() == currentSections.getId()) { Row resourcePeriodRow = createTableRow(++rowNum, resource, resourcesPeriod.get(resource), ++countResourcePeriod); //Установка стилей для строки информации о ресурсы в периоде setUpResourcePeriodInfoStyle(resourcePeriodRow); rowNum = resourcePeriodRow.getRowNum(); } } } } if (settings.getFooterList() != null) { createFooterRow(++rowNum); } sheet.setColumnWidth(0, 2000); sheet.setColumnWidth(1, 3000); sheet.setColumnWidth(2, 3500); sheet.setColumnWidth(3, 5000); sheet.setColumnWidth(4, 10000); sheet.setColumnWidth(5, 3000); sheet.setColumnWidth(6, 3000); sheet.setColumnWidth(7, 3000); sheet.setColumnWidth(8, 3000); sheet.setColumnWidth(9, 3000); sheet.getPrintSetup().setPaperSize(PrintSetup.A4_PAPERSIZE); sheet.getPrintSetup().setLandscape(true); sheet.getPrintSetup().setScale((short) 100); return resultExcel; } /** * Создание строк со служебной информацией * * @param rowNum - номер последней заполненной строки * @return - номер последней заполненной строки */ private static int createService(int rowNum) { int endRow = rowNum; for (String strRow : settings.getServiceList()) { Row currentRow = sheet.createRow(++endRow); currentRow.createCell(0).setCellValue(strRow); sheet.addMergedRegion(new CellRangeAddress(endRow, endRow, 0, settings.getTableHeadColumns().size() - 1)); setUpServiceStyle(resultExcel, currentRow); } //Делаем отступ от служебной информации если она была задана в настройках if (settings.getServiceList().size() > 0) ++endRow; return endRow; } /** * Создание строк заголовка для таблицы * * @param rowNum - номер последней заполненной строки * @return - номер последней заполненной строки */ private static int createTitle(int rowNum) { int endRow = rowNum; for (String strRow : settings.getTitleList()) { Row currentRow = sheet.createRow(++endRow); currentRow.createCell(0).setCellValue(strRow); sheet.addMergedRegion(new CellRangeAddress(endRow, endRow, 0, settings.getTableHeadColumns().size() - 1)); setUpTitleStyle(resultExcel, currentRow); } //Делаем отступ от заголовка таблицы если он был задан в настройках if (settings.getTitleList().size() > 0) ++endRow; return endRow; } /** * Формирование строки заголовка * * @param rowNum - номер строки * @return - строки заголовка */ private static List<Row> createHeadTableRows(int rowNum) { List<Row> result = new ArrayList<>(); int endRow = rowNum; int colIndex = 0; // Row headRow = sheet.createRow(endRow); int countTableRows = 0; for (ReportTableHeadColumn currentColumn : settings.getTableHeadColumns()) { int currentColumnCountRows = currentColumn.getRows().size(); if (countTableRows <= currentColumnCountRows) { countTableRows = currentColumnCountRows; } } for (int i = 0; i < countTableRows; i++) { Row headRow = sheet.createRow(endRow); result.add(headRow); endRow++; } for (ReportTableHeadColumn currentColumn : settings.getTableHeadColumns()) { int currentRow = rowNum; for (String currentRowString : currentColumn.getRows()) { sheet.getRow(currentRow).createCell(colIndex).setCellValue(currentRowString); currentRow++; } colIndex++; } mergeEmptyCells(result); return result; } /** * Слияние пустых ячеек в одну * (В случае если строк <=2) * * @param rowList - список строк * @return - true - если было хотя бы одно объединение, иначе - false */ private static boolean mergeEmptyCells(List<Row> rowList) { boolean result = false; int rowCount = rowList.size(); int cellCount = rowList.get(0).getLastCellNum(); boolean[][] mergedMap = new boolean[rowCount][cellCount]; for (int i = 0; i < rowCount; i++) { for (int j = 0; j < cellCount; j++) { String cellStr = rowList.get(i).getCell(j).getStringCellValue(); if (!cellStr.equals("")) { boolean merged = true; int countRowMerged = 1; int countColMerged = 1; int rowN = i + 1; int colN = j + 1; boolean isRowMerged = false; boolean isColMerged = false; while (merged) { mergedMap[rowN - 1][j] = true; if (rowN < rowCount && settings.getTableHeadColumns().get(j).getRows().get(rowN).equals("") && !mergedMap[rowN][j]) { mergedMap[rowN][j] = true; countRowMerged++; rowN++; isRowMerged = true; } else merged = false; } if (isRowMerged) { CellRangeAddress hRange = new CellRangeAddress(rowList.get(i).getRowNum(), rowList.get(rowN - 1).getRowNum(), j, j); sheet.addMergedRegion(hRange); result = true; } else { merged = true; while (merged) { mergedMap[i][colN - 1] = true; if (colN < maxTableColumn && settings.getTableHeadColumns().get(colN).getRows().get(i).equals("") && !mergedMap[i][colN]) { mergedMap[i][colN] = true; countColMerged++; colN++; isColMerged = true; } else merged = false; } if (isColMerged) { CellRangeAddress hRange = new CellRangeAddress(rowList.get(i).getRowNum(), rowList.get(i).getRowNum(), j, colN - 1); sheet.addMergedRegion(hRange); result = true; } } } } } return result; } /** * Создание строки с номерами * * @param rowNum - номер строки * @return - номер строки */ private static int createNumericTableRow(int rowNum) { int endRow = rowNum; Row headRow = sheet.getRow(endRow); Row numericRow = sheet.createRow(++endRow); ; for (int i = 0; i < headRow.getPhysicalNumberOfCells(); i++) { numericRow.createCell(i).setCellValue(i + 1); } return endRow; } /** * Формирование строки с информацией о ресурсе в периоде * * @param rowNum - номер последней заполненной строки * @param resource - информация о ресурсе в периоде * @param avgValue - средняя цена для ресурса * @param countResourcePeriod - счетчик ресурсов в периоде в таблице * @return - строка с информацией о ресурсы в периоде */ private static Row createTableRow(int rowNum, Resource resource, Double avgValue, int countResourcePeriod) { Row infoRow = sheet.createRow(rowNum); for (int i = 0; i < maxTableColumn; i++) { infoRow.createCell(i).setCellValue(""); } infoRow.getCell(0).setCellValue(countResourcePeriod); double currentRublPrice = 0d; if (ObjectUtils.notEqual(resource, null)) { if (ObjectUtils.notEqual(resource.getCodeTSN(), null)) { infoRow.getCell(1).setCellValue(resource.getCodeTSN()); } if (ObjectUtils.notEqual(resource.getCodeOKP(), null)) { infoRow.getCell(2).setCellValue(resource.getCodeOKP()); } if (ObjectUtils.notEqual(resource.getCodeOKPD(), null)) { infoRow.getCell(3).setCellValue(resource.getCodeOKPD()); } if (ObjectUtils.notEqual(resource.getName(), null)) { infoRow.getCell(4).setCellValue(resource.getName()); } if (ObjectUtils.notEqual(resource.getMeasure(), null)) { if (ObjectUtils.notEqual(resource.getMeasure().getCode(), null)) { infoRow.getCell(5).setCellValue(resource.getMeasure().getCode()); } } if (ObjectUtils.notEqual(avgValue, null)) { currentRublPrice = avgValue / 100d; infoRow.getCell(6).setCellValue(new BigDecimal(currentRublPrice).setScale(2, RoundingMode.HALF_UP).doubleValue()); } } return infoRow; } /** * Формирование строки с информацией о разделе * * @param rowNum - номер последней заполненной строки * @param resourceSection - информация о разделе * @return - строка с информацией о разделе */ private static Row createTableSectionRow(int rowNum, ResourceSection resourceSection) { Row infoRow = sheet.createRow(rowNum); for (int i = 0; i < maxTableColumn; i++) { infoRow.createCell(i).setCellValue(""); } if ((ObjectUtils.notEqual(resourceSection.getName(), null))&& (ObjectUtils.notEqual(resourceSection.getSectionRoot(), null))) { infoRow.getCell(4).setCellValue(resourceSection.getName()); } return infoRow; } /** * Формирование строки с информацией футера * * @param rowNum - номер последней заполненной строки * @return - номер строки */ private static int createFooterRow(int rowNum) { int endRow = rowNum; SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy"); for (String strRow : settings.getFooterList()) { Row currentRow = sheet.createRow(++endRow); if (strRow.contains("[data]")) { StringBuilder sb = new StringBuilder(strRow); strRow = sb.substring(0, sb.indexOf("[")); Date currentDate = new Date(); currentRow.createCell(2).setCellValue(sdf.format(currentDate)); } currentRow.createCell(0).setCellValue(strRow); sheet.addMergedRegion(new CellRangeAddress(endRow, endRow, 0, 1)); setUpFooterStyle(resultExcel, currentRow); } return endRow; } /** * Установка настроек для информации о ресурсе в периоде * * @param row - строка для установки стиля */ private static void setUpResourcePeriodInfoStyle(Row row) { for (int i = 0; i < row.getPhysicalNumberOfCells(); i++) { // применяем созданный выше стиль к каждой ячейке row.getCell(i).setCellStyle(tableInfoStyle); } row.getCell(0).setCellStyle(extraTableInfoStyle); row.getCell(5).setCellStyle(TSNTableInfoStyle); row.getCell(6).setCellStyle(PriceTableInfoStyle); } /** * Установка настроек для информации о ресурсе в периоде * * @param workbook - exсel файл */ private static void setUpTableInfoStyle(Workbook workbook) { // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); font.setFontHeightInPoints(settings.getTableHeadFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт tableInfoStyle.setFont(font); //применяем к стилю вырванивание текста по центру tableInfoStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); tableInfoStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); //Создание рамки tableInfoStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); tableInfoStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); tableInfoStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); tableInfoStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); //Установка переноса tableInfoStyle.setWrapText(true); } /** * Установка настроек для едениц изменерия ТСН * * @param workbook - exсel файл */ /** * Установка настроек для информации о ресурсе в периоде * * @param workbook - exсel файл */ private static void setUpExtraTableInfoStyle(Workbook workbook) { // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); font.setFontHeightInPoints(settings.getTableHeadFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт extraTableInfoStyle.setFont(font); //применяем к стилю вырванивание текста по центру extraTableInfoStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); extraTableInfoStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); //Создание рамки extraTableInfoStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); extraTableInfoStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); extraTableInfoStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); extraTableInfoStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); //Установка переноса extraTableInfoStyle.setWrapText(true); } /** * Установка настроек для информации о ед изм ТСН * * @param workbook - exсel файл */ private static void setUpTsnTableInfoStyle(Workbook workbook) { // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); font.setFontHeightInPoints(settings.getTableHeadFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт TSNTableInfoStyle.setFont(font); //применяем к стилю вырванивание текста по центру TSNTableInfoStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); TSNTableInfoStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); //Создание рамки TSNTableInfoStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); TSNTableInfoStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); TSNTableInfoStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); TSNTableInfoStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); //Установка переноса TSNTableInfoStyle.setWrapText(true); } /** * Установка настроек для информации о цене * * @param workbook - exсel файл */ private static void setUpPriceTableInfoStyle(Workbook workbook) { // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); font.setFontHeightInPoints(settings.getTableHeadFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт PriceTableInfoStyle.setFont(font); //применяем к стилю вырванивание текста по центру PriceTableInfoStyle.setAlignment(HSSFCellStyle.ALIGN_RIGHT); PriceTableInfoStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); //Создание рамки PriceTableInfoStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); PriceTableInfoStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); PriceTableInfoStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); PriceTableInfoStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); //Установка переноса PriceTableInfoStyle.setWrapText(true); } /** * Установка настроек для информации о разделе ресурса * * @param workbook - exсel файл * @param row - строка для установки стиля */ private static void setUpSectionInfoStyle(Workbook workbook, Row row) { // создаем стиль для ячейки CellStyle style = workbook.createCellStyle(); // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); font.setFontHeightInPoints(settings.getTableHeadFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт style.setFont(font); //применяем к стилю вырванивание текста по центру style.setAlignment(HSSFCellStyle.ALIGN_RIGHT); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_JUSTIFY); //Создание рамки style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); //Установка переноса style.setWrapText(true); int k = row.getPhysicalNumberOfCells(); // проходим по всем ячейкам этой строки for (int i = 0; i < row.getPhysicalNumberOfCells(); i++) { // применяем созданный выше стиль к каждой ячейке row.getCell(i).setCellStyle(style); } } /** * Установка настроек служебной информации * * @param workbook - exсel файл * @param row - строка для установки стиля */ private static void setUpServiceStyle(Workbook workbook, Row row) { // создаем стиль для ячейки CellStyle style = workbook.createCellStyle(); //Вырванивание текста по правой стороне style.setAlignment(HSSFCellStyle.ALIGN_RIGHT); // создаем шрифт Font font = workbook.createFont(); // указываем, что хоти его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); font.setFontHeightInPoints(settings.getFooterFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт style.setFont(font); row.getCell(0).setCellStyle(style); } /** * Установка настроек служебной информации * * @param workbook - exсel файл * @param row - строка для установки стиля */ private static void setUpFooterStyle(Workbook workbook, Row row) { // создаем стиль для ячейки CellStyle style = workbook.createCellStyle(); //Вырванивание текста по правой стороне style.setAlignment(HSSFCellStyle.ALIGN_LEFT); // создаем шрифт Font font = workbook.createFont(); // указываем, что хоти его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); font.setFontHeightInPoints(settings.getFooterFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт style.setFont(font); row.getCell(0).setCellStyle(style); if (row.getCell(2) != null) { row.getCell(2).setCellStyle(style); } } /** * Установка настрроек служебной информации * * @param workbook - exсel файл * @param row - строка для установки стиля */ private static void setUpTitleStyle(Workbook workbook, Row row) { // создаем стиль для ячейки CellStyle style = workbook.createCellStyle(); //Вырванивание текста по центру style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); font.setFontHeightInPoints(settings.getTitleTableFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт style.setFont(font); //Установка переноса style.setWrapText(true); row.getCell(0).setCellStyle(style); } /** * Установка настроек для заголовка таблицы * * @param workbook - exсel файл * @param row - строка для установки стиля */ private static void setUpHeaderTableStyle(Workbook workbook, Row row) { // создаем стиль для ячейки CellStyle style = workbook.createCellStyle(); // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); font.setFontHeightInPoints(settings.getTableHeadFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт style.setFont(font); //применяем к стилю вырванивание текста по центру style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); //Создание рамки style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); //Установка переноса style.setWrapText(true); // проходим по всем ячейкам этой строки for (int i = 0; i < row.getPhysicalNumberOfCells(); i++) { // применяем созданный выше стиль к каждой ячейке row.getCell(i).setCellStyle(style); } } /** * Установка настроек для нумерации заголовка таблицы * * @param workbook - exсel файл * @param row - строка для установки стиля */ private static void setUpNumericTableStyle(Workbook workbook, Row row) { // создаем стиль для ячейки CellStyle style = workbook.createCellStyle(); // создаем шрифт Font font = workbook.createFont(); // указываем, что хотим его видеть жирным font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); font.setFontHeightInPoints(settings.getTableHeadFontSize()); font.setFontName(settings.getFontName()); // применяем к стилю шрифт style.setFont(font); //применяем к стилю вырванивание текста по центру style.setAlignment(HSSFCellStyle.ALIGN_CENTER); style.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP); //Создание рамки style.setBorderBottom(HSSFCellStyle.BORDER_THIN); style.setBorderTop(HSSFCellStyle.BORDER_THIN); style.setBorderRight(HSSFCellStyle.BORDER_THIN); style.setBorderLeft(HSSFCellStyle.BORDER_THIN); // проходим по всем ячейкам этой строки for (int i = 0; i < row.getPhysicalNumberOfCells(); i++) { // применяем созданный выше стиль к каждой ячейке row.getCell(i).setCellStyle(style); } } }
[ "blackmesa944@gmail.com" ]
blackmesa944@gmail.com
77d635d1f8e5e9e6ea66e161ad9da80ea1d212b1
18e61026f72e41e8279cf31cce2a1eaf34687747
/src/main/java/com/ws/samples/client/rabbit/CountRabbits.java
e6e0964c908bd3043427f4251a71332447355f46
[]
no_license
albertoruvel/java-web-services-samples
700401c8a02cb2986bb95cfab95dd720d6632303
7951f04e4617dd0f9be76f6ed3cf040251e7d424
refs/heads/master
2016-08-12T06:49:34.248686
2016-04-19T23:47:50
2016-04-19T23:47:50
54,415,584
0
0
null
null
null
null
UTF-8
Java
false
false
1,124
java
package com.ws.samples.client.rabbit; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for countRabbits complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="countRabbits"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="arg0" type="{http://www.w3.org/2001/XMLSchema}int"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "countRabbits", propOrder = { "arg0" }) public class CountRabbits { protected int arg0; /** * Gets the value of the arg0 property. * */ public int getArg0() { return arg0; } /** * Sets the value of the arg0 property. * */ public void setArg0(int value) { this.arg0 = value; } }
[ "jose.rubalcaba@softtek.com" ]
jose.rubalcaba@softtek.com
67d72b0a37bf9424e58909409c06b1b31c1d9077
4a434c9680555cc1dc99dd88121fa4ccf881c6d3
/src/main/java/datastructure/linkedlist/BubbleSort.java
6a256e6dffcac68eac141709e502ff91db3ad721
[]
no_license
Mohitrajranu/JavaMongoDbAlgo
6560b7365d85063b2ec637a72688b00c0c87b668
1c453149465231ac60af67587cb2b21ee6512c87
refs/heads/master
2023-04-29T16:47:49.591142
2020-03-10T05:11:57
2020-03-10T05:11:57
246,213,633
1
0
null
2023-04-14T17:49:17
2020-03-10T05:11:28
Java
UTF-8
Java
false
false
1,170
java
package datastructure.linkedlist; /** * Created by jananiravi on 11/14/15. */ public class BubbleSort { private static int listToSort[] = new int[] {3, 5, 6, 8, 10, 1, 2, 4, 7, 9}; public static void main(String[] args) { print(listToSort); bubbleSort(listToSort); } public static void print(int[] listToSort) { for (int el : listToSort) { System.out.print(el + ","); } System.out.println(); } public static void swap(int[] listToSort, int iIndex, int jIndex) { int temp = listToSort[iIndex]; listToSort[iIndex] = listToSort[jIndex]; listToSort[jIndex] = temp; } public static void bubbleSort(int[] listToSort) { for (int i = 0; i < listToSort.length; i++) { boolean swapped = false; for (int j = listToSort.length - 1; j > i; j--) { if (listToSort[j] < listToSort[j - 1]) { swap(listToSort, j, j - 1); swapped = true; } } print(listToSort); if (!swapped) { break; } } } }
[ "mohitraj.ranu@gmail.com" ]
mohitraj.ranu@gmail.com
b3db1b825e781870355bfc8ce478ebaac39eadbf
540e6e9a0ab05cb4f6583201e8a50db3b889bd38
/part06-Part06_03.MessagingService/src/main/java/Message.java
8d0afe4302cf552a29f83fd880543b0d02629cf2
[]
no_license
TungstenRain/mooc_fi_java_programming_i
61480d26fd51a006f24c42fa8329370f86205181
a3e7efaf9610fe38bae97015b41be2ae930133d7
refs/heads/main
2023-09-04T08:25:52.928789
2021-10-07T14:10:44
2021-10-07T14:10:44
407,660,836
0
0
null
null
null
null
UTF-8
Java
false
false
1,502
java
import java.util.Objects; public class Message { // Variables private String sender; private String content; // Constructors /** * Construct the Message * @param sender * @param content */ public Message(String sender, String content) { this.sender = sender; this.content = content; } // Methods /** * Get the sender * @return String: the sender */ public String getSender() { return sender; } /** * Get the content * @return String: the content */ public String getContent() { return content; } /** * Return the Message * @return String: in the following format * [sender]: [content] */ public String toString() { return this.sender + ": " + this.content; } // created using the "insert code" feature of NetBeans @Override /** * Determine if this equals an object */ public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Message other = (Message) obj; if (!Objects.equals(this.sender, other.sender)) { return false; } if (!Objects.equals(this.content, other.content)) { return false; } return true; } }
[ "frank.olson@gmail.com" ]
frank.olson@gmail.com
dbbd4009b1d1f3655cce0d3a4f87a4c2251ebada
131f5e7f3bceb893bfcb4bcf9cc8df33f99f46e5
/src/main/java/graphics/renderer/DebugRenderer.java
0f473f3212ff579550a56da276af7cb6ae668f5c
[ "MIT" ]
permissive
GitWither/Azurite
38ec74f222c439858fee3814e0389f5bba64b28f
6a1941458178ece4887664ff05efb73b6d76f1f3
refs/heads/main
2023-03-16T14:38:44.525461
2021-03-12T16:06:46
2021-03-12T16:06:46
347,122,379
0
0
MIT
2021-03-12T16:05:12
2021-03-12T16:05:12
null
UTF-8
Java
false
false
1,764
java
package graphics.renderer; import ecs.Component; import ecs.GameObject; import graphics.Framebuffer; import graphics.Shader; import graphics.Window; import util.Assets; import util.debug.DebugLine; import util.debug.DebugPrimitive; import static org.lwjgl.opengl.GL11.glLineWidth; public class DebugRenderer extends Renderer<DebugRenderBatch> { /** * Create a shader * * @return the created shader */ @Override protected Shader createShader() { return Assets.getShader("src/assets/shaders/default.glsl"); } /** * Create a framebuffer * * @return the created fbo */ @Override protected Framebuffer createFramebuffer() { return Framebuffer.createDefault(); } /** * Upload the required uniforms * * @param shader the shader */ @Override protected void uploadUniforms(Shader shader) { shader.uploadMat4f("uProjection", Window.currentScene.camera().getProjectionMatrix()); shader.uploadMat4f("uView", Window.currentScene.camera().getViewMatrix()); } /** * Prepare for rendering. Do anything like setting background here. */ @Override protected void prepare() { glLineWidth(3); } @Override public void add(GameObject gameObject) { for (Component c : gameObject.getComponents()) { DebugPrimitive[] primitives = c.debug(); if (primitives != null) for (DebugPrimitive primitive : primitives) { for (DebugLine line : primitive.getLines()) addLine(line); } } } private void addLine(DebugLine l) { for (DebugRenderBatch batch : batches) { if (batch.addLine(l)) { return; } } // If unable to add to previous batch, create a new one DebugRenderBatch newBatch = new DebugRenderBatch(10, -10); newBatch.start(); batches.add(newBatch); newBatch.addLine(l); } }
[ "njk777400@gmail.com" ]
njk777400@gmail.com
0b696d4fb838746996abe130a2959bf292c57abd
db29e154f9f7b5ddfed2325c00d9e830945f359f
/src/session9/a_bankaccount/BankAccount.java
36b4c2d0e35806c76d35e20cb9e6b52dfdd6b6be
[]
no_license
Vindemoeller/OOP_F21
ce5a25987b1995817beb15223370acdc679992a4
41c3c1cebcab5189133762e44e5f7c3335b70a03
refs/heads/main
2023-09-06T02:30:41.076518
2021-11-24T11:38:15
2021-11-24T11:38:15
416,700,739
0
0
null
null
null
null
UTF-8
Java
false
false
832
java
package session9.a_bankaccount; public class BankAccount { private int balance; public BankAccount(int balance) { this.balance = balance; } public int getBalance() { return balance; } public void withdraw(int amount) { if (amount <= 0) { String msg = "Amount must be positive."; throw new IllegalArgumentException(msg); } if (amount >= balance) { String msg = "Amount must be less than balance."; throw new IllegalArgumentException(msg); } balance = balance - amount; } public void deposit(int amount) { if (amount <= 0) { String msg = "Amount must be positive."; throw new IllegalArgumentException(msg); } balance = balance + amount; } }
[ "andresmasegosa@gmail.com" ]
andresmasegosa@gmail.com
79d89f9cdd1dd121aa6c8b1caa2e1936ddbac40b
a6d9f486f4d1e77cd39f7109c0aca3643e524a44
/src/main/java/com/mpangoEngine/core/dao/impl/FarmDaoImpl.java
d42c889e54bee8a3816c7a2be727b6444ca75bb3
[]
no_license
mulutu/mpangoFarmEngine
99089442a9ced4ff5ad2e9f37e67fe87dab73644
b062655a03fe5bd9c0e9fb9f4469eda3212822fd
refs/heads/master
2022-07-16T17:46:30.713096
2020-08-24T18:47:34
2020-08-24T18:47:34
152,759,833
0
0
null
null
null
null
UTF-8
Java
false
false
3,316
java
package com.mpangoEngine.core.dao.impl; import java.sql.Types; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import javax.sql.DataSource; import javax.transaction.Transactional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.support.JdbcDaoSupport; import org.springframework.stereotype.Component; import com.mpangoEngine.core.dao.FarmDao; import com.mpangoEngine.core.model.Farm; @Component @Transactional public class FarmDaoImpl extends JdbcDaoSupport implements FarmDao { public static final Logger logger = LoggerFactory.getLogger(FarmDaoImpl.class); @Autowired private JdbcTemplate jdbcTemplate; @Autowired public FarmDaoImpl(DataSource dataSource) { super(); setDataSource(dataSource); } @Override public Farm findFarmById(int id) { String query = "SELECT * FROM farm WHERE id = ?"; Farm farm = (Farm) jdbcTemplate.queryForObject(query, new Object[] { id }, new BeanPropertyRowMapper(Farm.class)); return farm; } @Override public List<Farm> findAllById(int userId) { // TODO Auto-generated method stub return null; } @Override public List<Farm> findAllFarmsByUserId(int userId) { String query = "SELECT id, date_created, description, farm_name, location, size, user_id FROM farm WHERE user_id =" + userId; List<Farm> farms = new ArrayList<Farm>(); List<Map<String, Object>> rows = jdbcTemplate.queryForList(query); for (Map<String, Object> row : rows) { Farm farmObj = new Farm(); farmObj.setId( (int) row.get("id")); farmObj.setDateCreated((Date) row.get("date_created")); farmObj.setDescription((String) row.get("description")); farmObj.setFarmName((String) row.get("farm_name")); farmObj.setLocation((String) row.get("location")); farmObj.setSize((int) row.get("size")); farmObj.setUserId((int) row.get("user_id")); farms.add(farmObj); } return farms; } @Override public int save(Farm farm) { logger.debug("FarmDaoImpl->save() >>> Farm {} ", farm); String Query = "INSERT INTO farm " + "(`id`, `date_created`, `description`, `farm_name`, `location`, `size`, `user_id`) " + "VALUES (?, ?, ?, ?, ?, ? ,?)"; Object[] params = { farm.getId(), new Date(), farm.getDescription(), farm.getFarmName(), farm.getLocation(), farm.getSize(), farm.getUserId() }; int[] types = { Types.INTEGER, Types.DATE, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER }; return getJdbcTemplate().update( Query, params, types ); } @Override public int updateFarm(Farm farm) { logger.debug("FarmDaoImpl->save() >>> Farm {} ", farm); String Query = " UPDATE farm " + " SET description=?, farm_name=?, location=?, size=?" + " WHERE id=?"; Object[] params = { farm.getDescription(), farm.getFarmName(), farm.getLocation(), farm.getSize(), farm.getId() }; int[] types = { Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER }; return getJdbcTemplate().update( Query, params, types ); } }
[ "mulutujackson@gmail.com" ]
mulutujackson@gmail.com
750543822aabc6d834d318ded463f83b1c7bae37
0d32e8299bbcecc8a70a9cedb700c6c996a30c4a
/src/main/java/com/officelife/core/planning/Reduction.java
bca849a12afdee60c812653137eb1a82d243d4b2
[]
no_license
LowWeiLin/OfficeSimulatorThing
1522f40390b634e3afe01bf3ce36b4d3062e277b
56b986cf2dede2dee65cd54b11077cf0fce010ef
refs/heads/master
2018-10-06T12:06:19.103971
2018-06-22T14:01:22
2018-06-22T14:01:22
56,149,997
0
0
null
2017-05-05T13:02:03
2016-04-13T12:31:47
PLpgSQL
UTF-8
Java
false
false
200
java
package com.officelife.core.planning; import com.officelife.core.WorldState; /** * Defines how the world is reduced into facts. */ public interface Reduction { Facts reduce(WorldState state); }
[ "noreply@github.com" ]
LowWeiLin.noreply@github.com
4cbc7c9dc5a17c3eeb8fc0fabb38b128c7d94a58
c9e4e70a871e37ea54726431353ca2fc17e240ef
/app/src/main/java/com/example/practicals/service.java
e141b44ba7ebc0f522c4b4699883ea3e8e4d6c31
[]
no_license
sagarsanjaysutar/droid-stack
4409a7c8dd556bf79613aad5e78ae9cc9323f761
4cf2f0422d8d761407b94062f3f6f95265567fe7
refs/heads/master
2023-02-15T15:32:34.063639
2021-01-12T11:12:54
2021-01-12T11:12:54
328,715,715
2
0
null
null
null
null
UTF-8
Java
false
false
2,033
java
package com.example.practicals; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationManagerCompat; import android.app.Notification; import android.app.NotificationManager; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.TextView; public class service extends AppCompatActivity { private static final String CHANNEL_ID = "" ; TextView t1,t2,t3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_service); getReference(); startServices(); showNotification(); } void startServices() { t1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Success","---startservice called"); startService(new Intent(service.this,service_class.class)); } }); t2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Success","---stopService called"); stopService(new Intent(service.this,service_class.class)); } }); } void showNotification() { NotificationCompat.Builder build = new NotificationCompat.Builder(this,"My Notidication").setContentTitle("Practicals").setContentText("This is a custom notification.").setSmallIcon(R.drawable.blur); NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); manager.notify(1,build.build()); } void getReference(){ t1 = findViewById(R.id.servicetextView24); t2 = findViewById(R.id.servicetextView25); t3 = findViewById(R.id.servicetextView26); } }
[ "sutarsagarsanjay@gmail.com" ]
sutarsagarsanjay@gmail.com
e511c9a71c85f702158107e1c24488fb93424949
66a6c3a22383baf06da277d732b0633644d8f1a4
/app/src/main/java/com/msy/globalaccess/data/db/ScenicListBeanDao.java
0c75a7d4e156b30eb388094d77c537aee22bd664
[ "Apache-2.0" ]
permissive
hxy493045049/GlobalAccess
9a1ba8548f73b90d1bb8abd7d9ca53247fe05856
2e3a661cd33b67ec9721d46b527e72cea0325161
refs/heads/master
2021-04-26T22:59:16.676628
2019-11-06T11:30:42
2019-11-06T11:30:42
123,909,299
0
0
null
null
null
null
UTF-8
Java
false
false
6,517
java
package com.msy.globalaccess.data.db; import android.database.Cursor; import android.database.sqlite.SQLiteStatement; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; import com.msy.globalaccess.data.bean.scenic.ScenicListBean; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "SCENIC_LIST_BEAN". */ public class ScenicListBeanDao extends AbstractDao<ScenicListBean, Long> { public static final String TABLENAME = "SCENIC_LIST_BEAN"; /** * Properties of entity ScenicListBean.<br/> * Can be used for QueryBuilder and for referencing column names. */ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property ScenicId = new Property(1, String.class, "scenicId", false, "SCENIC_ID"); public final static Property ScenicName = new Property(2, String.class, "scenicName", false, "SCENIC_NAME"); public final static Property IsOrderTicket = new Property(3, String.class, "isOrderTicket", false, "IS_ORDER_TICKET"); public final static Property PscenicId = new Property(4, String.class, "pscenicId", false, "PSCENIC_ID"); public final static Property IsAcc = new Property(5, String.class, "isAcc", false, "IS_ACC"); } public ScenicListBeanDao(DaoConfig config) { super(config); } public ScenicListBeanDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"SCENIC_LIST_BEAN\" (" + // "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id "\"SCENIC_ID\" TEXT," + // 1: scenicId "\"SCENIC_NAME\" TEXT," + // 2: scenicName "\"IS_ORDER_TICKET\" TEXT," + // 3: isOrderTicket "\"PSCENIC_ID\" TEXT," + // 4: pscenicId "\"IS_ACC\" TEXT);"); // 5: isAcc } /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"SCENIC_LIST_BEAN\""; db.execSQL(sql); } @Override protected final void bindValues(DatabaseStatement stmt, ScenicListBean entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String scenicId = entity.getScenicId(); if (scenicId != null) { stmt.bindString(2, scenicId); } String scenicName = entity.getScenicName(); if (scenicName != null) { stmt.bindString(3, scenicName); } String isOrderTicket = entity.getIsOrderTicket(); if (isOrderTicket != null) { stmt.bindString(4, isOrderTicket); } String pscenicId = entity.getPscenicId(); if (pscenicId != null) { stmt.bindString(5, pscenicId); } String isAcc = entity.getIsAcc(); if (isAcc != null) { stmt.bindString(6, isAcc); } } @Override protected final void bindValues(SQLiteStatement stmt, ScenicListBean entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String scenicId = entity.getScenicId(); if (scenicId != null) { stmt.bindString(2, scenicId); } String scenicName = entity.getScenicName(); if (scenicName != null) { stmt.bindString(3, scenicName); } String isOrderTicket = entity.getIsOrderTicket(); if (isOrderTicket != null) { stmt.bindString(4, isOrderTicket); } String pscenicId = entity.getPscenicId(); if (pscenicId != null) { stmt.bindString(5, pscenicId); } String isAcc = entity.getIsAcc(); if (isAcc != null) { stmt.bindString(6, isAcc); } } @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); } @Override public ScenicListBean readEntity(Cursor cursor, int offset) { ScenicListBean entity = new ScenicListBean( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // scenicId cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // scenicName cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // isOrderTicket cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // pscenicId cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5) // isAcc ); return entity; } @Override public void readEntity(Cursor cursor, ScenicListBean entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setScenicId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setScenicName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setIsOrderTicket(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setPscenicId(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setIsAcc(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); } @Override protected final Long updateKeyAfterInsert(ScenicListBean entity, long rowId) { entity.setId(rowId); return rowId; } @Override public Long getKey(ScenicListBean entity) { if(entity != null) { return entity.getId(); } else { return null; } } @Override public boolean hasKey(ScenicListBean entity) { return entity.getId() != null; } @Override protected final boolean isEntityUpdateable() { return true; } }
[ "shawn0729@foxmail.com" ]
shawn0729@foxmail.com
a7c4b59ace87372179349105d8d290bd482b1b39
393aa76573571dc52d530f5589f9fcbbfe73e797
/src/main/java/com/comment/core/UnicomResponseEnums.java
cb61ab8b5f0606c5bd238ae3fe390a3a63c72a59
[]
no_license
liuhaiying1/Comment
48ac94745b406b07140b2d5e976b5ed912bdcffc
6c00a9d1050541b61f6856318dda716b2c7ae6b5
refs/heads/master
2020-05-25T22:47:44.550646
2019-05-22T11:12:52
2019-05-22T11:12:52
186,784,638
0
0
null
null
null
null
UTF-8
Java
false
false
2,036
java
package com.comment.core; public enum UnicomResponseEnums { SYSTEM_ERROR("-001","系统异常"), BAD_REQUEST("-002","错误的请求参数"), NOT_FOUND("-003","找不到请求路径!"), CONNECTION_ERROR("-004","网络连接请求失败!"), METHOD_NOT_ALLOWED("-005","不合法的请求方式"), DATABASE_ERROR("-004","数据库异常"), BOUND_STATEMENT_NOT_FOUNT("-006","找不到方法!"), REPEAT_REGISTER("001","重复注册"), NO_USER_EXIST("002","用户不存在"), INVALID_PASSWORD("003","密码错误"), NO_PERMISSION("004","非法请求!"), SUCCESS_OPTION("005","操作成功!"), NOT_MATCH("-007","用户名和密码不匹配"), FAIL_GETDATA("-008","获取信息失败"), BAD_REQUEST_TYPE("-009","错误的请求类型"), INVALID_MOBILE("010","无效的手机号码"), INVALID_EMAIL("011","无效的邮箱"), INVALID_GENDER("012","无效的性别"), REPEAT_MOBILE("014","已存在此手机号"), REPEAT_EMAIL("015","已存在此邮箱地址"), NO_RECORD("016","没有查到相关记录"), LOGIN_SUCCESS("017","登陆成功"), LOGOUT_SUCCESS("018","已退出登录"), SENDEMAIL_SUCCESS("019","邮件已发送,请注意查收"), EDITPWD_SUCCESS("020","修改密码成功"), No_FileSELECT("021","未选择文件"), FILEUPLOAD_SUCCESS("022","上传成功"), NOLOGIN("023","未登陆"), ILLEGAL_ARGUMENT("024","参数不合法"), ERROR_IDCODE("025","验证码不正确"), REPEAT_LOGINNAME("026","已存在此用户名"), REPEAT_BUSSINESSNAME("026","已存在此店名"); private String code; private String msg; private UnicomResponseEnums(String code, String msg) { this.code = code; this.msg = msg; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getMsg() { return msg; } public void setMsg(String msg) { this.msg = msg; } }
[ "2825402859@qq.com" ]
2825402859@qq.com
38b4ba9f2cdd75ebc8f5a1bf098486422ce7bd81
e256586ad421a792dfdc0018e682cf22d0d3c4b4
/src/Graphe/TestLecture.java
6b2f8ed6129b6c96080eff34860ecd972dee90bd
[]
no_license
Synam7236/TP6JAVA
36cd37499387db8208b0603b48ba41392dea16b8
1188525e0aa5242f08fd4ce80cd7cde62d4a4959
refs/heads/master
2020-03-12T15:32:22.078312
2018-04-23T12:22:31
2018-04-23T12:22:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
package Graphe; import java.io.File; import java.io.ObjectInputStream; import java.io.FileInputStream; class TestLecture { public static void main(String[] args){ try { File fichier = new File("/tmp/maville.ser") ; // ouverture d'un flux sur un fichier ObjectInputStream ois = new ObjectInputStream(new FileInputStream(fichier)) ; // désérialization de l'objet Map map = new Map(); Vertex brest = (Vertex)ois.readObject() ; Vertex rennes = (Vertex)ois.readObject() ; Vertex rouen = (Vertex)ois.readObject() ; Vertex paris = (Vertex)ois.readObject() ; Vertex leMans = (Vertex)ois.readObject() ; Vertex tours = (Vertex)ois.readObject() ; Vertex angers = (Vertex)ois.readObject() ; Vertex poitiers = (Vertex)ois.readObject() ; Vertex nantes = (Vertex)ois.readObject() ; map.add(brest); map.add(rennes); map.add(rouen); map.add(paris); map.add(leMans); map.add(tours); map.add(angers); map.add(poitiers); map.add(nantes); // Pour vérification for(Vertex v : map.townList){ System.out.println(v); } ois.close(); } catch (Exception e) { System.out.println (e) ; } } }
[ "synam7236@gmail.com" ]
synam7236@gmail.com
e48fa35b18182849b748143005af28f2008d9ede
af38d51d253e8ba35665891820cb65a5d8b74587
/app/src/main/java/com/db/funnelmeterchart/MainActivity.java
ec2a39c2b984c6f31a39da825460cc12345c0b6f
[ "Apache-2.0" ]
permissive
dhaval-android/funnel_meter_chartview
2319cb9257fe67cb487116da780cc30828a2cdbb
251d7a702c90685b63d544e51edf8ae4c572ed55
refs/heads/master
2020-07-28T15:11:35.811959
2019-09-25T18:47:28
2019-09-25T18:47:28
209,447,822
6
0
Apache-2.0
2019-09-25T18:47:29
2019-09-19T02:44:04
Java
UTF-8
Java
false
false
2,253
java
package com.db.funnelmeterchart; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.AppCompatEditText; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import com.db.funnel_meterchartview.FunnelChartData; import com.db.funnel_meterchartview.FunnelChartView; import com.db.funnel_meterchartview.MeterChartView; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { private FunnelChartView funnelChart; private MeterChartView meterChart; private AppCompatEditText mEdtVal; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initView(); initListener(); updateFunnelChartData(); } private void initView() { funnelChart = findViewById(R.id.funnelChart); meterChart = findViewById(R.id.meterChart); mEdtVal = findViewById(R.id.mEdtVal); } private void initListener() { mEdtVal.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { } @Override public void afterTextChanged(Editable editable) { if (mEdtVal.getText() != null && mEdtVal.getText().toString().length() > 0) { meterChart.rotateHand(Float.parseFloat(mEdtVal.getText().toString().trim())); } else { meterChart.rotateHand(0f); } } }); } //Dummy Data for funnel Chart private void updateFunnelChartData() { ArrayList<FunnelChartData> mDataSet = new ArrayList<>(); mDataSet.add(new FunnelChartData("#FF5733", "Chart Data 1")); mDataSet.add(new FunnelChartData("#DAF7A6", "Chart Data 2")); mDataSet.add(new FunnelChartData("#CE93D8", "Chart Data 3")); mDataSet.add(new FunnelChartData("#4DB6AC", "Chart Data 4")); funnelChart.setmDataSet(mDataSet); } }
[ "dhaval.solanki54@gmail.com" ]
dhaval.solanki54@gmail.com
e0be55b2d83b8a9372240223caa9081c6a5857eb
26a41203694014098e96a7bdb38ef641439b68f2
/microservices/appliance-maintenance-management/android-application/app/src/main/java/com/appl_maint_mngt/repair_report/views/RepairReportView.java
e5dcc5903eb33f940897f3324216475709f7e355
[ "Apache-2.0" ]
permissive
Kyledmw/student-projects
42035d41cb4db04ef47e783d32424903436f5c8a
766ef9d4b879c8c2d2086c2abe0fa224e2e051c6
refs/heads/master
2021-09-06T22:42:01.507696
2018-02-12T18:51:41
2018-02-12T18:51:41
100,615,064
0
0
null
null
null
null
UTF-8
Java
false
false
5,109
java
package com.appl_maint_mngt.repair_report.views; import android.app.Activity; import android.support.v7.widget.CardView; import android.view.View; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; import com.appl_maint_mngt.R; import com.appl_maint_mngt.common.utility.TimestampFormatter; import com.appl_maint_mngt.maintenance_schedule.models.interfaces.IMaintenanceScheduleReadable; import com.appl_maint_mngt.pending_maintenance_scheduling.models.interfaces.IPendingMaintenanceScheduleReadable; import com.appl_maint_mngt.pending_maintenance_scheduling.views.utility.PendingMaintenanceSchedulingListAdapter; import com.appl_maint_mngt.repair_report.models.RepairReport; import com.appl_maint_mngt.repair_report.models.interfaces.IRepairReportReadable; import com.appl_maint_mngt.repair_report.views.interfaces.IRepairReportView; import java.util.ArrayList; import java.util.List; import java.util.Locale; /** * Created by Kyle on 11/04/2017. */ public class RepairReportView implements IRepairReportView { private TextView titleTV; private TextView descriptionValueTV; private TextView durationValueTV; private TextView onsiteTV; private TextView costTV; private Button diagnosticReportBtn; private CardView maintenanceScheduleCV; private TextView maintSchedStartTimeTV; private TextView maintSchedEndTimeTV; private TextView maintSchedStatusTV; private CardView pendingMaintSchedCV; private ListView pendingMaintSchedLV; private PendingMaintenanceSchedulingListAdapter listAdapter; public RepairReportView(Activity parent) { titleTV = (TextView) parent.findViewById(R.id.repair_report_textview_title); descriptionValueTV = (TextView) parent.findViewById(R.id.repair_report_textview_value_description); durationValueTV = (TextView) parent.findViewById(R.id.repair_report_textview_value_duration); onsiteTV = (TextView) parent.findViewById(R.id.repair_report_textview_value_onsite); costTV = (TextView) parent.findViewById(R.id.repair_report_textview_value_cost); diagnosticReportBtn = (Button) parent.findViewById(R.id.repair_report_button_diagnostic_report); maintenanceScheduleCV = (CardView) parent.findViewById(R.id.repair_report_cardview_maint_sched); maintSchedStartTimeTV = (TextView) parent.findViewById(R.id.repair_report_textview_maint_sched_value_start_time); maintSchedEndTimeTV = (TextView) parent.findViewById(R.id.repair_report_textview_maint_sched_value_end_time); maintSchedStatusTV = (TextView) parent.findViewById(R.id.repair_report_textview_maint_sched_value_status); pendingMaintSchedCV = (CardView) parent.findViewById(R.id.repair_report_cardview_pending_maint_sched); pendingMaintSchedLV = (ListView) parent.findViewById(R.id.repair_report_listview_pending_maint_sched); listAdapter = new PendingMaintenanceSchedulingListAdapter(parent, new ArrayList<IPendingMaintenanceScheduleReadable>()); pendingMaintSchedLV.setAdapter(listAdapter); } @Override public void update(IRepairReportReadable repairReport) { titleTV.setText(repairReport.getTitle()); descriptionValueTV.setText(repairReport.getDescription()); durationValueTV.setText(String.format(Locale.ENGLISH, "%d", repairReport.getEstimatedDurationHours())); onsiteTV.setText(String.format(Locale.ENGLISH, "%b", repairReport.isOnSite())); costTV.setText(repairReport.getCost().toString()); } @Override public void setDiagnosticReportOnClickListener(View.OnClickListener listener) { diagnosticReportBtn.setOnClickListener(listener); } @Override public void enableDiagnosticReportButton() { diagnosticReportBtn.setEnabled(true); } @Override public void disableDiagnosticReportButton() { diagnosticReportBtn.setEnabled(false); } @Override public void updateMaintenanceSchedule(IMaintenanceScheduleReadable maintenanceSchedule) { maintSchedStartTimeTV.setText(new TimestampFormatter().format(maintenanceSchedule.getStartTime())); maintSchedEndTimeTV.setText(new TimestampFormatter().format(maintenanceSchedule.getEndTime())); maintSchedStatusTV.setText(maintenanceSchedule.getScheduleStatus().toString()); } @Override public void showMaintenanceSchedule() { maintenanceScheduleCV.setVisibility(View.VISIBLE); } @Override public void hideMaintenanceSchedule() { maintenanceScheduleCV.setVisibility(View.INVISIBLE); } @Override public void updatePendingMaintenanceSchedules(List<IPendingMaintenanceScheduleReadable> list) { listAdapter.clear(); listAdapter.addAll(list); listAdapter.notifyDataSetChanged(); } @Override public void showPendingMaintenanceSchedules() { pendingMaintSchedCV.setVisibility(View.VISIBLE); } @Override public void hidePendingMaintenanceSchedules() { pendingMaintSchedCV.setVisibility(View.INVISIBLE); } }
[ "kyle.d.m.williamson@gmail.com" ]
kyle.d.m.williamson@gmail.com
7fa3e4fb24f881603761d803eb849f0b33acc023
ec5e147a87683823be4c6cf46d6bab4403a29d57
/demoproject/drmdemo/src/main/java/com/bokecc/sdk/mobile/demo/drm/MainActivity.java
816816882c76ce63975a2a5983a7b9d3d9785d15
[]
no_license
ladddd/VOD_Android_DRM_SDK
3da8e281236d60b4e259a1d20fafd440a8b47b4e
7a87c86515a1f34a41c6d7baab992701f1fffba2
refs/heads/master
2020-03-17T20:04:18.519311
2018-05-15T03:01:18
2018-05-15T03:01:18
133,891,993
0
0
null
null
null
null
UTF-8
Java
false
false
7,124
java
package com.bokecc.sdk.mobile.demo.drm; import android.Manifest; import android.annotation.SuppressLint; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.ActionBar.TabListener; import android.app.AlertDialog; import android.app.FragmentTransaction; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content.pm.PackageManager; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.content.ContextCompat; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.Toast; import com.bokecc.sdk.mobile.demo.drm.download.DownloadFragment; import com.bokecc.sdk.mobile.demo.drm.download.DownloadListActivity; import com.bokecc.sdk.mobile.demo.drm.download.DownloadService; import com.bokecc.sdk.mobile.demo.drm.downloadutil.DownloadController; import com.bokecc.sdk.mobile.demo.drm.downloadutil.DownloaderWrapper; import com.bokecc.sdk.mobile.demo.drm.play.PlayFragment; import com.bokecc.sdk.mobile.demo.drm.util.ConfigUtil; import com.bokecc.sdk.mobile.demo.drm.util.DataSet; import com.bokecc.sdk.mobile.demo.drm.util.LogcatHelper; import com.bokecc.sdk.mobile.download.Downloader; import com.bokecc.sdk.mobile.util.DWSdkStorage; import com.bokecc.sdk.mobile.util.DWStorageUtil; import com.bokecc.sdk.mobile.util.HttpUtil; import com.bokecc.sdk.mobile.util.HttpUtil.HttpLogLevel; /** * * Demo主界面,包括播放、上传、下载三个标签页 * * @author CC视频 * */ @SuppressLint("NewApi") public class MainActivity extends FragmentActivity implements TabListener { private ViewPager viewPager; private static String[] TAB_TITLE = {"播放", "下载"}; private TabFragmentPagerAdapter adapter; private static String[] PERMISSIONS_STORAGE = { Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { //进入到这里代表没有权限. ActivityCompat.requestPermissions(this, PERMISSIONS_STORAGE, 1); } LogcatHelper.getInstance(this).start(); HttpUtil.LOG_LEVEL = HttpLogLevel.DETAIL; viewPager = (ViewPager) this.findViewById(R.id.pager); initView(); //初始化数据库和下载数据 DownloadController.init(); //启动后台下载service Intent intent = new Intent(this, DownloadService.class); startService(intent); initDWStorage(); // 针对动态密钥的本地下载、播放的接口进行初始化 } private void initDWStorage() { DWSdkStorage myDWSdkStorage = new DWSdkStorage() { private SharedPreferences sp = getApplicationContext().getSharedPreferences("mystorage", MODE_PRIVATE); @Override public void put(String key, String value) { Editor editor = sp.edit(); editor.putString(key, value); editor.commit(); } @Override public String get(String key) { return sp.getString(key, ""); } }; DWStorageUtil.setDWSdkStorage(myDWSdkStorage); } private void initView() { final ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); adapter = new TabFragmentPagerAdapter(getSupportFragmentManager()); viewPager.setAdapter(adapter); for (int i = 0; i < ConfigUtil.MAIN_FRAGMENT_MAX_TAB_SIZE;i++){ Tab tab = actionBar.newTab(); tab.setText(TAB_TITLE[i]).setTabListener(this); actionBar.addTab(tab); } viewPager.setOnPageChangeListener(new OnPageChangeListener() { @Override public void onPageSelected(int arg0) { actionBar.setSelectedNavigationItem(arg0); } @Override public void onPageScrolled(int arg0, float arg1, int arg2) {} @Override public void onPageScrollStateChanged(int arg0) {} }); } public static class TabFragmentPagerAdapter extends FragmentPagerAdapter{ private Fragment[] fragments; public TabFragmentPagerAdapter(FragmentManager fm) { super(fm); fragments = new Fragment[]{new PlayFragment(), new DownloadFragment()}; } @Override public Fragment getItem(int position) { return fragments[position]; } @Override public int getCount() { return ConfigUtil.MAIN_FRAGMENT_MAX_TAB_SIZE; } } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.downloadItem: startActivity(new Intent(getApplicationContext(), DownloadListActivity.class)); break; case R.id.accountInfo: startActivity(new Intent(getApplicationContext(), AccountInfoActivity.class)); break; } return super.onOptionsItemSelected(item); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return super.onCreateOptionsMenu(menu); } @Override public void onTabSelected(Tab tab, FragmentTransaction ft) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(Tab tab, FragmentTransaction ft) { } @Override public void onTabReselected(Tab tab, FragmentTransaction ft) { } @Override public void onBackPressed() { Log.i("data", "save data... ..."); DataSet.saveDownloadData(); LogcatHelper.getInstance(this).stop(); if (hasDownloadingTask()) { showDialog(); } else { super.onBackPressed(); } } private boolean hasDownloadingTask() { for (DownloaderWrapper wrapper: DownloadController.downloadingList) { if (wrapper.getStatus() == Downloader.DOWNLOAD || wrapper.getStatus() == Downloader.WAIT) { return true; } } return false; } @Override protected void onDestroy() { super.onDestroy(); } private void showDialog() { AlertDialog dialog = new AlertDialog.Builder(this) .setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { DownloadController.setBackDownload(true); finish(); } }).setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { stopDownloadService(); DownloadController.setBackDownload(false); finish(); } }).setTitle("有正在下载的任务,是否需要后台下载?") .create(); dialog.show(); } private void stopDownloadService() { Intent intent = new Intent(this, DownloadService.class); stopService(intent); } }
[ "550399108@qq.com" ]
550399108@qq.com
1889eecd3e46a0a8c597e5120683245c5e41c6a9
3c96465f320f6fe179555ff2d1d4e20f365e1733
/src/ShuaTi/Malache.java
8adab76bbe905182aa95ff7744b97b3d87d38ad3
[]
no_license
weiqiangpeng/shuati
41043174da66165c84845ec5f82ab2e7cdd4aef6
c359d027216697c7b30b8e7b1fb9be32b0c20229
refs/heads/master
2020-05-05T07:40:30.104183
2019-04-06T13:01:22
2019-04-06T13:01:22
179,833,522
0
0
null
null
null
null
UTF-8
Java
false
false
1,591
java
package ShuaTi; public class Malache { //求最长回文子字符串的经典算法,马拉车算法 public String malacher(String s) { //s:是给定的字符串,求其最长回文子字符串 if(s.length() <=1) return s; //进行预处理,将s首位和中间填充特殊字符# StringBuilder sb = new StringBuilder(); sb.append("#"); for (int i = 0; i < s.length(); i++) { sb.append(s.charAt(i)); sb.append("#"); } String new_str = sb.toString(); System.out.println("预处理后的字符串为:"+new_str); int max_center = 0; int max_right = 0; int[] len = new int[new_str.length()]; len[0] = 1; for(int j=1;j<new_str.length();j++) { boolean is_kuozhan = false; if(j<max_right) { int left_side = 2 *max_center - j; if(j+len[left_side] > max_right) { len[j] = max_right - j + 1; is_kuozhan = true; } else { len[j] = len[left_side]; } }else { is_kuozhan = true; } if(is_kuozhan) { while(j-len[j]>=0 && j+len[j]<new_str.length() && new_str.charAt(j-len[j]) == new_str.charAt(j+len[j])) len[j] ++ ; if(len[j] > len[max_center]) { max_center = j; max_right = max_center + len[j] -1; } } } StringBuilder res = new StringBuilder(); for(int i=max_center-(len[max_center]-1)+1;i<=max_center+(len[max_center]-1);i+=2) { res.append(new_str.charAt(i)); } return res.toString(); } public static void main(String[] args) { String s = "abbcbbabbbbbba"; Malache obj = new Malache(); String res = obj.malacher(s); System.out.println(res); } }
[ "183265965@qq.com" ]
183265965@qq.com
91f4f6ef93430802332d09fb530e328289e51a6c
3de7933a2de85d4c6dea8af10dbf7fa73152a1b0
/src/main/java/com/niit/controller/HomeController.java
5e8b502cda686be8696e544d49fa0d80eb731632
[]
no_license
TieyabaKhatoon/Angels
451435294b5e69b4d4d602ffab4daf9b1065230d
8f4390339386d60757dbea6a018159536ee206ad
refs/heads/master
2020-05-30T08:34:59.540745
2017-03-02T07:11:15
2017-03-02T07:11:15
83,643,722
0
0
null
null
null
null
UTF-8
Java
false
false
2,284
java
/*package com. niit.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; import com.niit.model.Product; @Controller public class HomeController { @RequestMapping(value="/",method=RequestMethod.GET) public String show(){ return"form"; } // @RequestMapping(value="/data",method=RequestMethod.POST) // public ModelAndView demo(@RequestParam("productname")String name,@RequestParam("productdescription")String desp){ // ModelAndView mv=new ModelAndView("data"); // mv.addObject("data","This product name is "+name+" and the description of the product is "+desp); // return mv; // // } // // @RequestMapping(value="/data",method=RequestMethod.POST) // public ModelAndView demo(@RequestParam(value="productname",defaultValue="ProductName")String name,@RequestParam("productdescription")String desp){ // ModelAndView mv=new ModelAndView("data"); // mv.addObject("data","This product name is "+name+" and the description of the product is "+desp); // return mv; // // } // @RequestMapping(value="/data",method=RequestMethod.POST) // public ModelAndView demo(@RequestParam Map<String,String>var){ // String name=var.get("productname"); // String desp=var.get("productdescription"); // ModelAndView mv=new ModelAndView("data"); // mv.addObject("data","This product name is "+name+" and the description of the product is "+desp); // return mv; // // } // @RequestMapping(value="/data",method=RequestMethod.POST) // public ModelAndView demo(@RequestParam(value="productname")String pn,@RequestParam(value="productdescription")String pd){ // Product p=new Product(); // p.setProductname(pn); // p.setProductdescription(pd); // ModelAndView mv=new ModelAndView("data"); // mv.addObject("p",p); // return mv; // // } @RequestMapping(value="/data",method=RequestMethod.POST) public ModelAndView demo(@ModelAttribute("p")Product pro){ ModelAndView mv=new ModelAndView("data"); mv.addObject(pro); return mv; } } */
[ "message4sana@gmail.com" ]
message4sana@gmail.com
1f48f3e3abb950165b4b30fddf6dbcf73f4a96cb
6b9db5c418da8dfaf69ab0cc5ace73c4bbdd8ea1
/core-api/src/main/java/org/axonframework/samples/trader/api/users/LineItemQtyInCartUpdatedEvent.java
16869b77ea6439c70241050f5758fe0b0b5358ff
[]
no_license
ikozolovska/EMT-Store
74cac1dc7528bf17e9f84b6d2bd4c3baabd7d073
6074fe8d99412650fa878f3e425376b142135c55
refs/heads/master
2021-04-29T10:01:36.424982
2016-09-11T17:14:10
2016-09-11T17:14:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
696
java
package org.axonframework.samples.trader.api.users; import org.axonframework.samples.trader.api.product.ProductId; /** * Created by DELL-PC on 5/29/2016. */ public class LineItemQtyInCartUpdatedEvent { private UserId userId; private ProductId productId; private int productQuantity; public LineItemQtyInCartUpdatedEvent(UserId userId, ProductId productId, int productQuantity) { this.userId = userId; this.productId = productId; this.productQuantity = productQuantity; } public ProductId getProductId() { return productId; } public int getProductQuantity() { return productQuantity; } public UserId getUserId() { return userId; } }
[ "mateapopovska@gmail.com" ]
mateapopovska@gmail.com
ba5bd6bbd9402ca3be645d97d9cba848e7a34f2b
d9698132c798c025d568d61696aa80576ee7f776
/src/com/mingda/action/info/editor/IdcarditeranceAction.java
0a3e04f8cea25ed8d1f46919b2d9b82f55ce47fc
[]
no_license
jilinsheng/summer
daa801e7842c83cf4e3d6467316f753cf087c26f
512097b22e0efb28db2cf87062c6b7a427d64025
refs/heads/master
2021-01-20T02:47:27.228375
2014-12-12T16:45:39
2014-12-12T16:45:39
null
0
0
null
null
null
null
ISO-8859-7
Java
false
false
2,032
java
package com.mingda.action.info.editor; import java.io.PrintWriter; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.hibernate.Session; import com.mingda.common.SessionFactory; import com.mingda.common.log4j.Log4jApp; public class IdcarditeranceAction extends Action { @SuppressWarnings("deprecation") public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { String memberid = request.getParameter("memberid"); String paperid = request.getParameter("paperid"); Log4jApp.logger("Ιν·έΦ€ΊΕ " + memberid); Session session = SessionFactory.getSession(); Connection con = session.connection(); String temp = ""; try { if (memberid == null || memberid.equals("")) { } else { temp = " mem.member_id <>'" + memberid + "' and "; } response.setContentType("text/html"); response.setCharacterEncoding("GB18030"); PrintWriter out = response.getWriter(); ResultSet rs = null; PreparedStatement ps = con .prepareStatement("select count(1) from info_t_family fam , info_t_member mem where fam.status=1 and mem.family_id= fam.family_id and " + temp + " mem.paperid='" + paperid + "'"); rs = ps.executeQuery(); if (rs.next()) { out.println(rs.getString(1)); } out.flush(); out.close(); } catch (SQLException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } finally { try { if (con != null) { con.close(); } session.close(); } catch (SQLException e) { e.printStackTrace(); } } return null; } }
[ "geogle_jia@126.com" ]
geogle_jia@126.com
ad451b2b9bd8e0486e17b1ba6ca6429b73fe855a
09e8aa864c439b70cb9b9b27de0bcaf972a01967
/src/main/java/com/pvub/sabre/model/Tax___.java
1d7ee536cd78f2b786102b62f128df41ec082481
[]
no_license
pvub/SabreDiscovery
913cb8ca7d34bbcde4df7196bfa15104eeb98157
e41b08c06be31e159b414a532c38c13c5cbfa53a
refs/heads/master
2021-01-10T21:42:05.451896
2014-09-04T04:06:26
2014-09-04T04:06:26
23,269,448
2
0
null
null
null
null
UTF-8
Java
false
false
2,161
java
package com.pvub.sabre.model; import javax.annotation.Generated; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @Generated("org.jsonschema2pojo") public class Tax___ { @SerializedName("CurrencyCode") @Expose private String currencyCode; @SerializedName("DecimalPlaces") @Expose private Integer decimalPlaces; @SerializedName("TaxCode") @Expose private String taxCode; @SerializedName("Amount") @Expose private Double amount; public String getCurrencyCode() { return currencyCode; } public void setCurrencyCode(String currencyCode) { this.currencyCode = currencyCode; } public Tax___ withCurrencyCode(String currencyCode) { this.currencyCode = currencyCode; return this; } public Integer getDecimalPlaces() { return decimalPlaces; } public void setDecimalPlaces(Integer decimalPlaces) { this.decimalPlaces = decimalPlaces; } public Tax___ withDecimalPlaces(Integer decimalPlaces) { this.decimalPlaces = decimalPlaces; return this; } public String getTaxCode() { return taxCode; } public void setTaxCode(String taxCode) { this.taxCode = taxCode; } public Tax___ withTaxCode(String taxCode) { this.taxCode = taxCode; return this; } public Double getAmount() { return amount; } public void setAmount(Double amount) { this.amount = amount; } public Tax___ withAmount(Double amount) { this.amount = amount; return this; } @Override public String toString() { return ToStringBuilder.reflectionToString(this); } @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } @Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other); } }
[ "pvub@yahoo.com" ]
pvub@yahoo.com
40da8f6cca0156d5cde2f2208ba1208a9398b087
ce8b79235f47d500d6077e792a97a3c424755aa4
/SpringMVC/SpringMvcJspExample/src/main/java/com/endava/mvc/model/User.java
1976ac1b5c8c7ef20280bd304edd761bfb391730
[]
no_license
RaduU92/Graduates2015
e47f7c3c47c6529649d35147d67e907a0bdb65a4
bafe9e759225cd5fe773f310d02eaec38e5ee9af
refs/heads/master
2021-03-12T21:54:48.405245
2015-08-26T06:10:02
2015-08-26T06:10:02
39,880,178
0
0
null
null
null
null
UTF-8
Java
false
false
610
java
package com.endava.mvc.model; /** * Created by cudrescu on 8/3/2015. */ public class User { private String firstName; private String lastName; private int age; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
[ "Radu.Ursu@Endava.com" ]
Radu.Ursu@Endava.com
b28feecf20bbc5bd85243b53d0670261ad869fa3
a53476db88f5a53c1d1e80c837916260d18171a4
/src/main/java/com/shin1ogawa/controller/ds/AsyncController.java
4808fe2ff62a53d89db832115d93e77390ef60e7
[]
no_license
shin1ogawa/appengine-checkup
43699e96d59ed376f30674ae71d8b64ef1dd2284
b724a2fe262766f818d1efe20df6196f06cd946d
refs/heads/master
2021-03-12T21:59:41.575704
2010-01-24T09:39:45
2010-01-24T09:39:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,135
java
package com.shin1ogawa.controller.ds; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import org.apache.commons.lang.StringUtils; import org.slim3.controller.Controller; import org.slim3.controller.Navigation; import org.slim3.datastore.Datastore; import org.slim3.datastore.EntityQuery; import com.google.appengine.api.datastore.Entity; import com.google.appengine.api.datastore.EntityTranslator; import com.google.appengine.api.datastore.FetchOptions; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.KeyFactory; import com.google.appengine.api.datastore.PbUtil; import com.google.appengine.api.datastore.Query; import com.google.appengine.api.datastore.Query.FilterOperator; import com.google.apphosting.api.ApiProxy; import com.google.apphosting.api.DatastorePb; import com.google.apphosting.api.ApiProxy.ApiConfig; import com.google.apphosting.api.ApiProxy.Delegate; import com.google.apphosting.api.ApiProxy.Environment; import com.google.storage.onestore.v3.OnestoreEntity.EntityProto; /** * クエリを非同期で複数実行する。 * @author shin1ogawa */ public class AsyncController extends Controller { private static final String KIND = "OrCombinationTest"; @Override protected Navigation run() { try { runInternal(); return null; } catch (IOException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } catch (ExecutionException e) { throw new RuntimeException(e); } } Navigation runInternal() throws IOException, InterruptedException, ExecutionException { super.response.setContentType("text/plain"); super.response.setCharacterEncoding("utf-8"); PrintWriter w = super.response.getWriter(); String q = super.asString("q"); if (StringUtils.equals(q, "sync2357")) { w.println("sync2357"); sync2357(w); } else if (StringUtils.equals(q, "async2357")) { w.println("async2357"); async2357(w); } else if (StringUtils.equals(q, "asyncMany")) { w.println("asyncMany:" + asInteger("c")); asyncMany(w, asInteger("c")); } else if (StringUtils.equals(q, "setUp")) { w.println("setUp:" + asInteger("c")); setUpTestData(w, asInteger("c")); } response.flushBuffer(); return null; } void sync2357(PrintWriter w) { EntityQuery q2 = Datastore.query(KIND).filter("mod2", FilterOperator.EQUAL, true).offset(0).limit( 1000).prefetchSize(1000); EntityQuery q3 = Datastore.query(KIND).filter("mod3", FilterOperator.EQUAL, true).offset(0).limit( 1000).prefetchSize(1000); EntityQuery q5 = Datastore.query(KIND).filter("mod5", FilterOperator.EQUAL, true).offset(0).limit( 1000).prefetchSize(1000); EntityQuery q7 = Datastore.query(KIND).filter("mod7", FilterOperator.EQUAL, true).offset(0).limit( 1000).prefetchSize(1000); long start = System.currentTimeMillis(); List<Entity> r3 = q3.asList(); List<Entity> r5 = q5.asList(); List<Entity> r7 = q7.asList(); List<Entity> r2 = q2.asList(); long end = System.currentTimeMillis(); @SuppressWarnings("unchecked") List<Entity> merged = merge(Arrays.asList(r2, r3, r5, r7)); w.println("count=" + merged.size() + ", " + (end - start) + "[ms]"); } void async2357(PrintWriter w) throws InterruptedException, ExecutionException { Query q2 = new Query(KIND).addFilter("mod2", FilterOperator.EQUAL, true); Query q3 = new Query(KIND).addFilter("mod3", FilterOperator.EQUAL, true); Query q5 = new Query(KIND).addFilter("mod5", FilterOperator.EQUAL, true); Query q7 = new Query(KIND).addFilter("mod7", FilterOperator.EQUAL, true); FetchOptions fetchOptions = FetchOptions.Builder.withOffset(0).limit(1000).prefetchSize(1000); long start = System.currentTimeMillis(); List<List<Entity>> lists = asyncQuery(Arrays.asList(q2, q3, q5, q7), fetchOptions); long end = System.currentTimeMillis(); w.println("count=" + merge(lists).size() + ", " + (end - start) + "[ms]"); } void asyncMany(PrintWriter w, int count) throws InterruptedException, ExecutionException { List<Query> queries = new ArrayList<Query>(); for (int i = 0; i < count; i++) { Query q = new Query(KIND).addFilter("mod2", FilterOperator.EQUAL, true); queries.add(q); } FetchOptions fetchOptions = FetchOptions.Builder.withOffset(0).limit(1000).prefetchSize(1000); w.println("query count=" + queries.size()); long start = System.currentTimeMillis(); List<List<Entity>> lists = asyncQuery(queries, fetchOptions); long end = System.currentTimeMillis(); w.println("count=" + merge(lists).size() + ", " + (end - start) + "[ms]"); } List<Entity> merge(List<List<Entity>> lists) { Map<Key, Entity> map = new HashMap<Key, Entity>(); for (List<Entity> list : lists) { for (Entity entity : list) { if (map.containsKey(entity.getKey()) == false) { map.put(entity.getKey(), entity); } } } return new ArrayList<Entity>(map.values()); } /** * 複数のクエリを非同期で実行し、全てのクエリの結果のリストを返す。 * <p>マージはしないので、重複を排除する処理は呼び出し元で行うこと。</p> * @param queries * @param fetchOptions * @return 全てのクエリの結果。 * @throws InterruptedException * @throws ExecutionException */ static List<List<Entity>> asyncQuery(List<Query> queries, FetchOptions fetchOptions) throws InterruptedException, ExecutionException { @SuppressWarnings("unchecked") Delegate<Environment> delegate = ApiProxy.getDelegate(); Environment env = ApiProxy.getCurrentEnvironment(); ApiConfig config = new ApiProxy.ApiConfig(); config.setDeadlineInSeconds(5.0); List<Future<byte[]>> futures = new ArrayList<Future<byte[]>>(queries.size()); for (Query query : queries) { futures.add(delegate.makeAsyncCall(env, "datastore_v3", "RunQuery", PbUtil .toQueryRequestPb(query, fetchOptions).toByteArray(), config)); } List<List<Entity>> lists = new ArrayList<List<Entity>>(); for (Future<byte[]> future : futures) { DatastorePb.QueryResult rPb = new DatastorePb.QueryResult(); rPb.mergeFrom(future.get()); Iterator<EntityProto> it = rPb.resultIterator(); List<Entity> entities = new ArrayList<Entity>(); while (it.hasNext()) { entities.add(EntityTranslator.createFromPb(it.next())); } lists.add(entities); } return lists; } void setUpTestData(PrintWriter w, int start) { List<Entity> list = new ArrayList<Entity>(); int number = start; for (int i = 0; i < 100; i++) { Entity e = new Entity(KeyFactory.createKey(KIND, Long.valueOf(number))); e.setProperty("mod2", number % 2 == 0); e.setProperty("mod3", number % 3 == 0); e.setProperty("mod5", number % 5 == 0); e.setProperty("mod7", number % 7 == 0); number++; list.add(e); } w.println(start + " to " + (number - 1)); Datastore.put(list); } }
[ "shin1ogawa@gmail.com" ]
shin1ogawa@gmail.com
3665e17a49c6619ddc33148f96d3577c26289f3d
5c598c6a7cb4315ca15e5cd52a809183b5283036
/src/com/alipay/api/response/AlipayPassSyncAddResponse.java
ca85e59f9f92e74a0394b96de9f4d69a17368646
[]
no_license
bobstack11/country-
3b08ab4642d169dc0d6438f3913b03ee0428b1c4
edda879189e9f96d09d531ef0ec434a2ed9a6a7f
refs/heads/master
2021-07-25T13:00:22.272735
2017-11-03T06:04:39
2017-11-03T06:04:39
109,350,895
0
0
null
2017-11-03T06:04:39
2017-11-03T04:08:38
Java
UTF-8
Java
false
false
924
java
package com.alipay.api.response; import com.alipay.api.AlipayResponse; import com.alipay.api.internal.mapping.ApiField; public class AlipayPassSyncAddResponse extends AlipayResponse { private static final long serialVersionUID = 8831446953373262565L; @ApiField("biz_result") private String bizResult; @ApiField("error_code") private String errorCode; @ApiField("success") private Boolean success; public void setBizResult(String bizResult) { this.bizResult = bizResult; } public String getBizResult() { return this.bizResult; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getErrorCode() { return this.errorCode; } public void setSuccess(Boolean success) { this.success = success; } public Boolean getSuccess() { return this.success; } }
[ "bobo@windows10.microdone.cn" ]
bobo@windows10.microdone.cn
8b77db97093f36555f7edd4e5ec689d02f081e48
1a3583220a2bfe7d8931711639d76d053fde5e10
/base/core/src/main/java/de/websplatter/muchor/Constants.java
ef8cb58b19cd34e0e8b9258f021edb89715c29bd
[]
no_license
McIntozh/MuChOr
3bf8a818ce6552f7870f07263b111596df69162d
ecd4a98bda2201c08ab909d519ca363506c8f227
refs/heads/master
2022-05-31T08:46:52.155703
2019-07-29T06:42:06
2019-07-29T06:42:06
90,370,058
1
1
null
2022-05-20T20:51:38
2017-05-05T11:43:02
Java
UTF-8
Java
false
false
538
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package de.websplatter.muchor; /** * * @author Dennis Schwarz <McIntozh@gmx.net> */ public class Constants { public static final String ORDER_PARTY_INVOICE = "INV"; public static final String ORDER_PARTY_SHIPPING = "SHP"; public static final String ORDER_CHARGE_SHIPPING = "SHP"; public static final String ORDER_CHARGE_PAYMENT = "PAY"; }
[ "McIntozh@gmx.net" ]
McIntozh@gmx.net
856b385a5e7ed4f471edeeb9da29a42af9d5bc3a
63f579466b611ead556cb7a257d846fc88d582ed
/XDRValidator/src/main/java/org/hl7/v3/StrucDocFootnoteRef.java
e90f2b415c5de874559e1d9fd1660ff769827ee3
[]
no_license
svalluripalli/soap
14f47b711d63d4890de22a9f915aed1bef755e0b
37d7ea683d610ab05477a1fdb4e329b5feb05381
refs/heads/master
2021-01-18T20:42:09.095152
2014-05-07T21:16:36
2014-05-07T21:16:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,460
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.05.07 at 05:07:17 PM EDT // package org.hl7.v3; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlIDREF; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * <p>Java class for StrucDoc.FootnoteRef complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="StrucDoc.FootnoteRef"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}ID" /> * &lt;attribute name="language" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" /> * &lt;attribute name="styleCode" type="{http://www.w3.org/2001/XMLSchema}NMTOKENS" /> * &lt;attribute name="IDREF" use="required" type="{http://www.w3.org/2001/XMLSchema}IDREF" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "StrucDoc.FootnoteRef") public class StrucDocFootnoteRef { @XmlAttribute(name = "ID") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; @XmlAttribute(name = "language") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "NMTOKEN") protected String language; @XmlAttribute(name = "styleCode") @XmlSchemaType(name = "NMTOKENS") protected List<String> styleCode; @XmlAttribute(name = "IDREF", required = true) @XmlIDREF @XmlSchemaType(name = "IDREF") protected Object idref; /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getID() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setID(String value) { this.id = value; } /** * Gets the value of the language property. * * @return * possible object is * {@link String } * */ public String getLanguage() { return language; } /** * Sets the value of the language property. * * @param value * allowed object is * {@link String } * */ public void setLanguage(String value) { this.language = value; } /** * Gets the value of the styleCode property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the styleCode property. * * <p> * For example, to add a new item, do as follows: * <pre> * getStyleCode().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getStyleCode() { if (styleCode == null) { styleCode = new ArrayList<String>(); } return this.styleCode; } /** * Gets the value of the idref property. * * @return * possible object is * {@link Object } * */ public Object getIDREF() { return idref; } /** * Sets the value of the idref property. * * @param value * allowed object is * {@link Object } * */ public void setIDREF(Object value) { this.idref = value; } }
[ "konkapv@NCI-01874632-L.nci.nih.gov" ]
konkapv@NCI-01874632-L.nci.nih.gov
a84d819ef44058400d03bf889f0d8953e727b666
916ecb7bcd6be0625a26aa77c697b5c979d72003
/src/chapter6/Marker.java
f5299dc144d1f0397891194c30a41f3ae6070fa4
[]
no_license
Ryulth/EffectiveJava-3-E
8087e547a069f2f81236188c969195c7b9ab1ef2
3f0ca727b6ed56777f8b683d211acb4e573fdc63
refs/heads/master
2020-04-23T15:01:36.557509
2019-03-05T18:01:00
2019-03-05T18:01:00
171,250,801
1
1
null
2019-02-19T05:39:48
2019-02-18T09:10:22
Java
UTF-8
Java
false
false
839
java
package chapter6; import java.lang.annotation.*; import java.lang.reflect.*; /* marker annotation */ @Retention(RetentionPolicy.RUNTIME) @interface MyMarker { } class Marker { /* annotate the method using marker. * Notice that no { } is needed */ //@Vehicle2 @MyMarker public static void myMethod(Object obj) { System.out.println(obj.getClass()); try { Method m = obj.getClass().getMethod("myMethod"); /* specify if the annotation is present */ if(m.isAnnotationPresent(MyMarker.class)) System.out.println("MyMarker is present"); } catch(NoSuchMethodException exc) { System.out.println("Method not found..!!"); } } public static void main(String args[]) { myMethod(new Marker()); } }
[ "adboy94@khu.ac.kr" ]
adboy94@khu.ac.kr
e499bc8f86f54a5035f8ed2bf348c0a9dee81015
f33df7894795a85d3e8706c999feabd2066d3086
/src/main/Viterbi.java
5255cbd04fbc4bc48f0d2ce66eb29604d3cb2cba
[]
no_license
AlexQianYi/HMM_Viterbi
243e646938379497e5ffac72472c32c4d71f9769
6b14ae0e4941ba5afd65e5e1956953cfa4869af8
refs/heads/master
2020-03-15T01:57:50.930078
2018-05-03T00:19:50
2018-05-03T00:19:50
131,906,371
0
0
null
null
null
null
UTF-8
Java
false
false
3,862
java
package main; public class Viterbi { private int length = 0; private int[] Obverse = null; private double[][] emission = {{0.6, 0.2, 0.2}, {0.2, 0.6, 0.2}, {0.2, 0.2, 0.6}}; private double[][] transition = {{0.6666667, 0.1666667, 0.1666667}, {0.1666667, 0.6666667, 0.1666667}, {0.1666667, 0.1666667, 0.6666667}}; private int[] PredResult = null; private int[][] path = null; public Viterbi(int l, int[] input) { this.length = l; this.Obverse = new int[length]; this.Obverse = input; this.PredResult = new int[length]; this.path = new int[3][length]; } public double runViterbi() { double temp_result = 0.0; int tempLength = this.length; double tempPosD1 = 0.0; double tempPosD2 = 0.0; double tempPosD3 = 0.0; int tempLabel = 0; int maxPos = 0; if(tempLength == 0) { return temp_result; }else { tempLabel = this.Obverse[0]-1; System.out.println(tempLabel); tempPosD1 = emission[0][tempLabel]; tempPosD2 = emission[1][tempLabel]; tempPosD3 = emission[2][tempLabel]; //temp_result = saveResult(tempPosD1, tempPosD2, tempPosD3, 0); tempLength --; int i = 1; while(tempLength > 0) { //System.out.println(i); tempPosD1 = iterViterbi(tempPosD1, tempPosD2, tempPosD3, this.Obverse[i]-1, 0, i); tempPosD2 = iterViterbi(tempPosD1, tempPosD2, tempPosD3, this.Obverse[i]-1, 1, i); tempPosD3 = iterViterbi(tempPosD1, tempPosD2, tempPosD3, this.Obverse[i]-1, 2, i); temp_result = saveResult(tempPosD1, tempPosD2, tempPosD3, i); tempLength --; i++; } } if(tempPosD1 >= tempPosD2 && tempPosD1 >= tempPosD3) { maxPos = 1; }else if(tempPosD2 >= tempPosD1 && tempPosD2 >= tempPosD3) { maxPos = 2; }else { maxPos = 3; } recursion(maxPos); return temp_result; } private double iterViterbi(double lastD1, double lastD2, double lastD3, int label, int Di, int i) { double result = 0.0; double tempPosD1Di = 0.0; double tempPosD2Di = 0.0; double tempPosD3Di = 0.0; // P(D1)*P(D1->Di)*P(label|Di) tempPosD1Di = lastD1 * this.transition[0][Di]*emission[Di][label]; // P(D2)*P(D2->Di)*P(label|Di) tempPosD2Di = lastD2 * this.transition[1][Di]*emission[Di][label]; // P(D3)*P(D3->Di)*P(label|Di) tempPosD3Di = lastD3 * this.transition[2][Di]*emission[Di][label]; if(tempPosD1Di >= tempPosD2Di && tempPosD1Di >= tempPosD3Di) { this.path[Di][i] = 1; }else if(tempPosD2Di >= tempPosD1Di && tempPosD2Di >= tempPosD3Di) { this.path[Di][i] = 2; }else { this.path[Di][i] = 3; } return Math.max(tempPosD1Di, Math.max(tempPosD2Di, tempPosD3Di)); } private void recursion(int x) { int temp = x; for(int i=length-1; i>1; i--) { if(this.path[0][i] == temp) { this.PredResult[i] = 1; temp = 1; continue; }else if(this.path[1][0] == temp) { this.PredResult[i] = 2; temp = 2; continue; }else { this.PredResult[i] = 3; temp = 3; continue; } } } private double saveResult(double PosD1, double PosD2, double PosD3, int label) { if(PosD1 >= PosD2 && PosD1 >= PosD3) { this.PredResult[label] = 1; return PosD1; } else if(PosD2 >= PosD1 && PosD2 >= PosD3) { this.PredResult[label] = 2; return PosD2; }else { this.PredResult[label] = 3; return PosD3; } } public static void main(String[] args) { Label_Seq read = new Label_Seq("src/main/diceSequences.txt"); int num = 6; for (int i=0; i<num; i++) { int len = read.length[i]; int[] seq = new int[len]; System.arraycopy(read.array[i], 0, seq, 0, len); Viterbi vit = new Viterbi(len, seq); double result = 0.0; result = vit.runViterbi(); for(int j=1; j<len; j++) { System.out.print(vit.PredResult[j]); } System.out.println(""); System.out.println(result); System.out.println(""); } } }
[ "q563875735@gmail.com" ]
q563875735@gmail.com
e5338995e62638ff40a41c760ad17545f3a223bf
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/hd/affr/dm/HD_AFFR_6011_ADM.java
c03ccd1f9cc883e1bf634d39b4b90ec0cad370d8
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
32,190
java
/*************************************************************************************************** * 파일명 : .java * 기능 : 독자우대-구독신청 * 작성일자 : 2007-05-22 * 작성자 : 김대섭 ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.hd.affr.dm; import java.sql.*; import oracle.jdbc.driver.*; import somo.framework.db.*; import somo.framework.util.*; import chosun.ciis.hd.affr.ds.*; import chosun.ciis.hd.affr.rec.*; /** * */ public class HD_AFFR_6011_ADM extends somo.framework.db.BaseDM implements java.io.Serializable{ public String mode; public String cmpy_cd; public String emp_no; public String certi_clsf; public String occr_dt; public String seq; public String aplc_dt; public String aplc_seq; public String issu_num_shet; public String usag; public String remk; public String cntc_plac; public String email; public String korn_flnm; public String prn; public String dept_cd; public String dty_cd; public String posi_cd; public String dirc_incmg_posi; public String chce_posi_clsf; public String in_cmpy_dt; public String busi_trip_purp; public String busi_trip_area; public String busi_trip_frdt; public String busi_trip_todt; public String engl_flnm; public String engl_bidt; public String engl_dept_posi; public String engl_in_cmpy_dt; public String engl_now_dt; public String engl_busi_trip_purp; public String engl_busi_trip_area; public String engl_busi_trip_frdt; public String engl_busi_trip_todt; public String issu_dt; public String issu_clsf; public String issu_no; public String uipadd; public String uid; public String now_dt; public HD_AFFR_6011_ADM(){} public HD_AFFR_6011_ADM(String mode, String cmpy_cd, String emp_no, String certi_clsf, String occr_dt, String seq, String aplc_dt, String aplc_seq, String issu_num_shet, String usag, String remk, String cntc_plac, String email, String korn_flnm, String prn, String dept_cd, String dty_cd, String posi_cd, String dirc_incmg_posi, String chce_posi_clsf, String in_cmpy_dt, String busi_trip_purp, String busi_trip_area, String busi_trip_frdt, String busi_trip_todt, String engl_flnm, String engl_bidt, String engl_dept_posi, String engl_in_cmpy_dt, String engl_now_dt, String engl_busi_trip_purp, String engl_busi_trip_area, String engl_busi_trip_frdt, String engl_busi_trip_todt, String issu_dt, String issu_clsf, String issu_no, String uipadd, String uid, String now_dt){ this.mode = mode; this.cmpy_cd = cmpy_cd; this.emp_no = emp_no; this.certi_clsf = certi_clsf; this.occr_dt = occr_dt; this.seq = seq; this.aplc_dt = aplc_dt; this.aplc_seq = aplc_seq; this.issu_num_shet = issu_num_shet; this.usag = usag; this.remk = remk; this.cntc_plac = cntc_plac; this.email = email; this.korn_flnm = korn_flnm; this.prn = prn; this.dept_cd = dept_cd; this.dty_cd = dty_cd; this.posi_cd = posi_cd; this.dirc_incmg_posi = dirc_incmg_posi; this.chce_posi_clsf = chce_posi_clsf; this.in_cmpy_dt = in_cmpy_dt; this.busi_trip_purp = busi_trip_purp; this.busi_trip_area = busi_trip_area; this.busi_trip_frdt = busi_trip_frdt; this.busi_trip_todt = busi_trip_todt; this.engl_flnm = engl_flnm; this.engl_bidt = engl_bidt; this.engl_dept_posi = engl_dept_posi; this.engl_in_cmpy_dt = engl_in_cmpy_dt; this.engl_now_dt = engl_now_dt; this.engl_busi_trip_purp = engl_busi_trip_purp; this.engl_busi_trip_area = engl_busi_trip_area; this.engl_busi_trip_frdt = engl_busi_trip_frdt; this.engl_busi_trip_todt = engl_busi_trip_todt; this.issu_dt = issu_dt; this.issu_clsf = issu_clsf; this.issu_no = issu_no; this.uipadd = uipadd; this.uid = uid; this.now_dt = now_dt; } public void setMode(String mode){ this.mode = mode; } public void setCmpy_cd(String cmpy_cd){ this.cmpy_cd = cmpy_cd; } public void setEmp_no(String emp_no){ this.emp_no = emp_no; } public void setCerti_clsf(String certi_clsf){ this.certi_clsf = certi_clsf; } public void setOccr_dt(String occr_dt){ this.occr_dt = occr_dt; } public void setSeq(String seq){ this.seq = seq; } public void setAplc_dt(String aplc_dt){ this.aplc_dt = aplc_dt; } public void setAplc_seq(String aplc_seq){ this.aplc_seq = aplc_seq; } public void setIssu_num_shet(String issu_num_shet){ this.issu_num_shet = issu_num_shet; } public void setUsag(String usag){ this.usag = usag; } public void setRemk(String remk){ this.remk = remk; } public void setCntc_plac(String cntc_plac){ this.cntc_plac = cntc_plac; } public void setEmail(String email){ this.email = email; } public void setKorn_flnm(String korn_flnm){ this.korn_flnm = korn_flnm; } public void setPrn(String prn){ this.prn = prn; } public void setDept_cd(String dept_cd){ this.dept_cd = dept_cd; } public void setDty_cd(String dty_cd){ this.dty_cd = dty_cd; } public void setPosi_cd(String posi_cd){ this.posi_cd = posi_cd; } public void setDirc_incmg_posi(String dirc_incmg_posi){ this.dirc_incmg_posi = dirc_incmg_posi; } public void setChce_posi_clsf(String chce_posi_clsf){ this.chce_posi_clsf = chce_posi_clsf; } public void setIn_cmpy_dt(String in_cmpy_dt){ this.in_cmpy_dt = in_cmpy_dt; } public void setBusi_trip_purp(String busi_trip_purp){ this.busi_trip_purp = busi_trip_purp; } public void setBusi_trip_area(String busi_trip_area){ this.busi_trip_area = busi_trip_area; } public void setBusi_trip_frdt(String busi_trip_frdt){ this.busi_trip_frdt = busi_trip_frdt; } public void setBusi_trip_todt(String busi_trip_todt){ this.busi_trip_todt = busi_trip_todt; } public void setEngl_flnm(String engl_flnm){ this.engl_flnm = engl_flnm; } public void setEngl_bidt(String engl_bidt){ this.engl_bidt = engl_bidt; } public void setEngl_dept_posi(String engl_dept_posi){ this.engl_dept_posi = engl_dept_posi; } public void setEngl_in_cmpy_dt(String engl_in_cmpy_dt){ this.engl_in_cmpy_dt = engl_in_cmpy_dt; } public void setEngl_now_dt(String engl_now_dt){ this.engl_now_dt = engl_now_dt; } public void setEngl_busi_trip_purp(String engl_busi_trip_purp){ this.engl_busi_trip_purp = engl_busi_trip_purp; } public void setEngl_busi_trip_area(String engl_busi_trip_area){ this.engl_busi_trip_area = engl_busi_trip_area; } public void setEngl_busi_trip_frdt(String engl_busi_trip_frdt){ this.engl_busi_trip_frdt = engl_busi_trip_frdt; } public void setEngl_busi_trip_todt(String engl_busi_trip_todt){ this.engl_busi_trip_todt = engl_busi_trip_todt; } public void setIssu_dt(String issu_dt){ this.issu_dt = issu_dt; } public void setIssu_clsf(String issu_clsf){ this.issu_clsf = issu_clsf; } public void setIssu_no(String issu_no){ this.issu_no = issu_no; } public void setUipadd(String uipadd){ this.uipadd = uipadd; } public void setUid(String uid){ this.uid = uid; } public void setNow_dt(String now_dt){ this.now_dt = now_dt; } public String getMode(){ return this.mode; } public String getCmpy_cd(){ return this.cmpy_cd; } public String getEmp_no(){ return this.emp_no; } public String getCerti_clsf(){ return this.certi_clsf; } public String getOccr_dt(){ return this.occr_dt; } public String getSeq(){ return this.seq; } public String getAplc_dt(){ return this.aplc_dt; } public String getAplc_seq(){ return this.aplc_seq; } public String getIssu_num_shet(){ return this.issu_num_shet; } public String getUsag(){ return this.usag; } public String getRemk(){ return this.remk; } public String getCntc_plac(){ return this.cntc_plac; } public String getEmail(){ return this.email; } public String getKorn_flnm(){ return this.korn_flnm; } public String getPrn(){ return this.prn; } public String getDept_cd(){ return this.dept_cd; } public String getDty_cd(){ return this.dty_cd; } public String getPosi_cd(){ return this.posi_cd; } public String getDirc_incmg_posi(){ return this.dirc_incmg_posi; } public String getChce_posi_clsf(){ return this.chce_posi_clsf; } public String getIn_cmpy_dt(){ return this.in_cmpy_dt; } public String getBusi_trip_purp(){ return this.busi_trip_purp; } public String getBusi_trip_area(){ return this.busi_trip_area; } public String getBusi_trip_frdt(){ return this.busi_trip_frdt; } public String getBusi_trip_todt(){ return this.busi_trip_todt; } public String getEngl_flnm(){ return this.engl_flnm; } public String getEngl_bidt(){ return this.engl_bidt; } public String getEngl_dept_posi(){ return this.engl_dept_posi; } public String getEngl_in_cmpy_dt(){ return this.engl_in_cmpy_dt; } public String getEngl_now_dt(){ return this.engl_now_dt; } public String getEngl_busi_trip_purp(){ return this.engl_busi_trip_purp; } public String getEngl_busi_trip_area(){ return this.engl_busi_trip_area; } public String getEngl_busi_trip_frdt(){ return this.engl_busi_trip_frdt; } public String getEngl_busi_trip_todt(){ return this.engl_busi_trip_todt; } public String getIssu_dt(){ return this.issu_dt; } public String getIssu_clsf(){ return this.issu_clsf; } public String getIssu_no(){ return this.issu_no; } public String getUipadd(){ return this.uipadd; } public String getUid(){ return this.uid; } public String getNow_dt(){ return this.now_dt; } public String getSQL(){ return "{ call MISHDL.SP_HD_AFFR_6011_A(? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,? ,?) }"; } public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{ HD_AFFR_6011_ADM dm = (HD_AFFR_6011_ADM)bdm; cstmt.registerOutParameter(1, Types.VARCHAR); cstmt.registerOutParameter(2, Types.VARCHAR); cstmt.setString(3, dm.mode); cstmt.setString(4, dm.cmpy_cd); cstmt.setString(5, dm.emp_no); cstmt.setString(6, dm.certi_clsf); cstmt.setString(7, dm.occr_dt); cstmt.setString(8, dm.seq); cstmt.setString(9, dm.aplc_dt); cstmt.setString(10, dm.aplc_seq); cstmt.setString(11, dm.issu_num_shet); cstmt.setString(12, dm.usag); cstmt.setString(13, dm.remk); cstmt.setString(14, dm.cntc_plac); cstmt.setString(15, dm.email); cstmt.setString(16, dm.korn_flnm); cstmt.setString(17, dm.prn); cstmt.setString(18, dm.dept_cd); cstmt.setString(19, dm.dty_cd); cstmt.setString(20, dm.posi_cd); cstmt.setString(21, dm.dirc_incmg_posi); cstmt.setString(22, dm.chce_posi_clsf); cstmt.setString(23, dm.in_cmpy_dt); cstmt.setString(24, dm.busi_trip_purp); cstmt.setString(25, dm.busi_trip_area); cstmt.setString(26, dm.busi_trip_frdt); cstmt.setString(27, dm.busi_trip_todt); cstmt.setString(28, dm.engl_flnm); cstmt.setString(29, dm.engl_bidt); cstmt.setString(30, dm.engl_dept_posi); cstmt.setString(31, dm.engl_in_cmpy_dt); cstmt.setString(32, dm.engl_now_dt); cstmt.setString(33, dm.engl_busi_trip_purp); cstmt.setString(34, dm.engl_busi_trip_area); cstmt.setString(35, dm.engl_busi_trip_frdt); cstmt.setString(36, dm.engl_busi_trip_todt); cstmt.setString(37, dm.issu_dt); cstmt.setString(38, dm.issu_clsf); cstmt.setString(39, dm.issu_no); cstmt.setString(40, dm.uipadd); cstmt.setString(41, dm.uid); cstmt.setString(42, dm.now_dt); } public BaseDataSet createDataSetObject(){ return new chosun.ciis.hd.affr.ds.HD_AFFR_6011_ADataSet(); } public void print(){ System.out.println("mode = " + getMode()); System.out.println("cmpy_cd = " + getCmpy_cd()); System.out.println("emp_no = " + getEmp_no()); System.out.println("certi_clsf = " + getCerti_clsf()); System.out.println("occr_dt = " + getOccr_dt()); System.out.println("seq = " + getSeq()); System.out.println("aplc_dt = " + getAplc_dt()); System.out.println("aplc_seq = " + getAplc_seq()); System.out.println("issu_num_shet = " + getIssu_num_shet()); System.out.println("usag = " + getUsag()); System.out.println("remk = " + getRemk()); System.out.println("cntc_plac = " + getCntc_plac()); System.out.println("email = " + getEmail()); System.out.println("korn_flnm = " + getKorn_flnm()); System.out.println("prn = " + getPrn()); System.out.println("dept_cd = " + getDept_cd()); System.out.println("dty_cd = " + getDty_cd()); System.out.println("posi_cd = " + getPosi_cd()); System.out.println("dirc_incmg_posi = " + getDirc_incmg_posi()); System.out.println("chce_posi_clsf = " + getChce_posi_clsf()); System.out.println("in_cmpy_dt = " + getIn_cmpy_dt()); System.out.println("busi_trip_purp = " + getBusi_trip_purp()); System.out.println("busi_trip_area = " + getBusi_trip_area()); System.out.println("busi_trip_frdt = " + getBusi_trip_frdt()); System.out.println("busi_trip_todt = " + getBusi_trip_todt()); System.out.println("engl_flnm = " + getEngl_flnm()); System.out.println("engl_bidt = " + getEngl_bidt()); System.out.println("engl_dept_posi = " + getEngl_dept_posi()); System.out.println("engl_in_cmpy_dt = " + getEngl_in_cmpy_dt()); System.out.println("engl_now_dt = " + getEngl_now_dt()); System.out.println("engl_busi_trip_purp = " + getEngl_busi_trip_purp()); System.out.println("engl_busi_trip_area = " + getEngl_busi_trip_area()); System.out.println("engl_busi_trip_frdt = " + getEngl_busi_trip_frdt()); System.out.println("engl_busi_trip_todt = " + getEngl_busi_trip_todt()); System.out.println("issu_dt = " + getIssu_dt()); System.out.println("issu_clsf = " + getIssu_clsf()); System.out.println("issu_no = " + getIssu_no()); System.out.println("uipadd = " + getUipadd()); System.out.println("uid = " + getUid()); System.out.println("now_dt = " + getNow_dt()); } } /*---------------------------------------------------------------------------------------------------- Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오. String mode = req.getParameter("mode"); if( mode == null){ System.out.println(this.toString+" : mode is null" ); }else{ System.out.println(this.toString+" : mode is "+mode ); } String cmpy_cd = req.getParameter("cmpy_cd"); if( cmpy_cd == null){ System.out.println(this.toString+" : cmpy_cd is null" ); }else{ System.out.println(this.toString+" : cmpy_cd is "+cmpy_cd ); } String emp_no = req.getParameter("emp_no"); if( emp_no == null){ System.out.println(this.toString+" : emp_no is null" ); }else{ System.out.println(this.toString+" : emp_no is "+emp_no ); } String certi_clsf = req.getParameter("certi_clsf"); if( certi_clsf == null){ System.out.println(this.toString+" : certi_clsf is null" ); }else{ System.out.println(this.toString+" : certi_clsf is "+certi_clsf ); } String occr_dt = req.getParameter("occr_dt"); if( occr_dt == null){ System.out.println(this.toString+" : occr_dt is null" ); }else{ System.out.println(this.toString+" : occr_dt is "+occr_dt ); } String seq = req.getParameter("seq"); if( seq == null){ System.out.println(this.toString+" : seq is null" ); }else{ System.out.println(this.toString+" : seq is "+seq ); } String aplc_dt = req.getParameter("aplc_dt"); if( aplc_dt == null){ System.out.println(this.toString+" : aplc_dt is null" ); }else{ System.out.println(this.toString+" : aplc_dt is "+aplc_dt ); } String aplc_seq = req.getParameter("aplc_seq"); if( aplc_seq == null){ System.out.println(this.toString+" : aplc_seq is null" ); }else{ System.out.println(this.toString+" : aplc_seq is "+aplc_seq ); } String issu_num_shet = req.getParameter("issu_num_shet"); if( issu_num_shet == null){ System.out.println(this.toString+" : issu_num_shet is null" ); }else{ System.out.println(this.toString+" : issu_num_shet is "+issu_num_shet ); } String usag = req.getParameter("usag"); if( usag == null){ System.out.println(this.toString+" : usag is null" ); }else{ System.out.println(this.toString+" : usag is "+usag ); } String remk = req.getParameter("remk"); if( remk == null){ System.out.println(this.toString+" : remk is null" ); }else{ System.out.println(this.toString+" : remk is "+remk ); } String cntc_plac = req.getParameter("cntc_plac"); if( cntc_plac == null){ System.out.println(this.toString+" : cntc_plac is null" ); }else{ System.out.println(this.toString+" : cntc_plac is "+cntc_plac ); } String email = req.getParameter("email"); if( email == null){ System.out.println(this.toString+" : email is null" ); }else{ System.out.println(this.toString+" : email is "+email ); } String korn_flnm = req.getParameter("korn_flnm"); if( korn_flnm == null){ System.out.println(this.toString+" : korn_flnm is null" ); }else{ System.out.println(this.toString+" : korn_flnm is "+korn_flnm ); } String prn = req.getParameter("prn"); if( prn == null){ System.out.println(this.toString+" : prn is null" ); }else{ System.out.println(this.toString+" : prn is "+prn ); } String dept_cd = req.getParameter("dept_cd"); if( dept_cd == null){ System.out.println(this.toString+" : dept_cd is null" ); }else{ System.out.println(this.toString+" : dept_cd is "+dept_cd ); } String dty_cd = req.getParameter("dty_cd"); if( dty_cd == null){ System.out.println(this.toString+" : dty_cd is null" ); }else{ System.out.println(this.toString+" : dty_cd is "+dty_cd ); } String posi_cd = req.getParameter("posi_cd"); if( posi_cd == null){ System.out.println(this.toString+" : posi_cd is null" ); }else{ System.out.println(this.toString+" : posi_cd is "+posi_cd ); } String dirc_incmg_posi = req.getParameter("dirc_incmg_posi"); if( dirc_incmg_posi == null){ System.out.println(this.toString+" : dirc_incmg_posi is null" ); }else{ System.out.println(this.toString+" : dirc_incmg_posi is "+dirc_incmg_posi ); } String chce_posi_clsf = req.getParameter("chce_posi_clsf"); if( chce_posi_clsf == null){ System.out.println(this.toString+" : chce_posi_clsf is null" ); }else{ System.out.println(this.toString+" : chce_posi_clsf is "+chce_posi_clsf ); } String in_cmpy_dt = req.getParameter("in_cmpy_dt"); if( in_cmpy_dt == null){ System.out.println(this.toString+" : in_cmpy_dt is null" ); }else{ System.out.println(this.toString+" : in_cmpy_dt is "+in_cmpy_dt ); } String busi_trip_purp = req.getParameter("busi_trip_purp"); if( busi_trip_purp == null){ System.out.println(this.toString+" : busi_trip_purp is null" ); }else{ System.out.println(this.toString+" : busi_trip_purp is "+busi_trip_purp ); } String busi_trip_area = req.getParameter("busi_trip_area"); if( busi_trip_area == null){ System.out.println(this.toString+" : busi_trip_area is null" ); }else{ System.out.println(this.toString+" : busi_trip_area is "+busi_trip_area ); } String busi_trip_frdt = req.getParameter("busi_trip_frdt"); if( busi_trip_frdt == null){ System.out.println(this.toString+" : busi_trip_frdt is null" ); }else{ System.out.println(this.toString+" : busi_trip_frdt is "+busi_trip_frdt ); } String busi_trip_todt = req.getParameter("busi_trip_todt"); if( busi_trip_todt == null){ System.out.println(this.toString+" : busi_trip_todt is null" ); }else{ System.out.println(this.toString+" : busi_trip_todt is "+busi_trip_todt ); } String engl_flnm = req.getParameter("engl_flnm"); if( engl_flnm == null){ System.out.println(this.toString+" : engl_flnm is null" ); }else{ System.out.println(this.toString+" : engl_flnm is "+engl_flnm ); } String engl_bidt = req.getParameter("engl_bidt"); if( engl_bidt == null){ System.out.println(this.toString+" : engl_bidt is null" ); }else{ System.out.println(this.toString+" : engl_bidt is "+engl_bidt ); } String engl_dept_posi = req.getParameter("engl_dept_posi"); if( engl_dept_posi == null){ System.out.println(this.toString+" : engl_dept_posi is null" ); }else{ System.out.println(this.toString+" : engl_dept_posi is "+engl_dept_posi ); } String engl_in_cmpy_dt = req.getParameter("engl_in_cmpy_dt"); if( engl_in_cmpy_dt == null){ System.out.println(this.toString+" : engl_in_cmpy_dt is null" ); }else{ System.out.println(this.toString+" : engl_in_cmpy_dt is "+engl_in_cmpy_dt ); } String engl_now_dt = req.getParameter("engl_now_dt"); if( engl_now_dt == null){ System.out.println(this.toString+" : engl_now_dt is null" ); }else{ System.out.println(this.toString+" : engl_now_dt is "+engl_now_dt ); } String engl_busi_trip_purp = req.getParameter("engl_busi_trip_purp"); if( engl_busi_trip_purp == null){ System.out.println(this.toString+" : engl_busi_trip_purp is null" ); }else{ System.out.println(this.toString+" : engl_busi_trip_purp is "+engl_busi_trip_purp ); } String engl_busi_trip_area = req.getParameter("engl_busi_trip_area"); if( engl_busi_trip_area == null){ System.out.println(this.toString+" : engl_busi_trip_area is null" ); }else{ System.out.println(this.toString+" : engl_busi_trip_area is "+engl_busi_trip_area ); } String engl_busi_trip_frdt = req.getParameter("engl_busi_trip_frdt"); if( engl_busi_trip_frdt == null){ System.out.println(this.toString+" : engl_busi_trip_frdt is null" ); }else{ System.out.println(this.toString+" : engl_busi_trip_frdt is "+engl_busi_trip_frdt ); } String engl_busi_trip_todt = req.getParameter("engl_busi_trip_todt"); if( engl_busi_trip_todt == null){ System.out.println(this.toString+" : engl_busi_trip_todt is null" ); }else{ System.out.println(this.toString+" : engl_busi_trip_todt is "+engl_busi_trip_todt ); } String issu_dt = req.getParameter("issu_dt"); if( issu_dt == null){ System.out.println(this.toString+" : issu_dt is null" ); }else{ System.out.println(this.toString+" : issu_dt is "+issu_dt ); } String issu_clsf = req.getParameter("issu_clsf"); if( issu_clsf == null){ System.out.println(this.toString+" : issu_clsf is null" ); }else{ System.out.println(this.toString+" : issu_clsf is "+issu_clsf ); } String issu_no = req.getParameter("issu_no"); if( issu_no == null){ System.out.println(this.toString+" : issu_no is null" ); }else{ System.out.println(this.toString+" : issu_no is "+issu_no ); } String uipadd = req.getParameter("uipadd"); if( uipadd == null){ System.out.println(this.toString+" : uipadd is null" ); }else{ System.out.println(this.toString+" : uipadd is "+uipadd ); } String uid = req.getParameter("uid"); if( uid == null){ System.out.println(this.toString+" : uid is null" ); }else{ System.out.println(this.toString+" : uid is "+uid ); } String now_dt = req.getParameter("now_dt"); if( now_dt == null){ System.out.println(this.toString+" : now_dt is null" ); }else{ System.out.println(this.toString+" : now_dt is "+now_dt ); } ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 req.getParameter() 처리시 사용하십시오. String mode = Util.checkString(req.getParameter("mode")); String cmpy_cd = Util.checkString(req.getParameter("cmpy_cd")); String emp_no = Util.checkString(req.getParameter("emp_no")); String certi_clsf = Util.checkString(req.getParameter("certi_clsf")); String occr_dt = Util.checkString(req.getParameter("occr_dt")); String seq = Util.checkString(req.getParameter("seq")); String aplc_dt = Util.checkString(req.getParameter("aplc_dt")); String aplc_seq = Util.checkString(req.getParameter("aplc_seq")); String issu_num_shet = Util.checkString(req.getParameter("issu_num_shet")); String usag = Util.checkString(req.getParameter("usag")); String remk = Util.checkString(req.getParameter("remk")); String cntc_plac = Util.checkString(req.getParameter("cntc_plac")); String email = Util.checkString(req.getParameter("email")); String korn_flnm = Util.checkString(req.getParameter("korn_flnm")); String prn = Util.checkString(req.getParameter("prn")); String dept_cd = Util.checkString(req.getParameter("dept_cd")); String dty_cd = Util.checkString(req.getParameter("dty_cd")); String posi_cd = Util.checkString(req.getParameter("posi_cd")); String dirc_incmg_posi = Util.checkString(req.getParameter("dirc_incmg_posi")); String chce_posi_clsf = Util.checkString(req.getParameter("chce_posi_clsf")); String in_cmpy_dt = Util.checkString(req.getParameter("in_cmpy_dt")); String busi_trip_purp = Util.checkString(req.getParameter("busi_trip_purp")); String busi_trip_area = Util.checkString(req.getParameter("busi_trip_area")); String busi_trip_frdt = Util.checkString(req.getParameter("busi_trip_frdt")); String busi_trip_todt = Util.checkString(req.getParameter("busi_trip_todt")); String engl_flnm = Util.checkString(req.getParameter("engl_flnm")); String engl_bidt = Util.checkString(req.getParameter("engl_bidt")); String engl_dept_posi = Util.checkString(req.getParameter("engl_dept_posi")); String engl_in_cmpy_dt = Util.checkString(req.getParameter("engl_in_cmpy_dt")); String engl_now_dt = Util.checkString(req.getParameter("engl_now_dt")); String engl_busi_trip_purp = Util.checkString(req.getParameter("engl_busi_trip_purp")); String engl_busi_trip_area = Util.checkString(req.getParameter("engl_busi_trip_area")); String engl_busi_trip_frdt = Util.checkString(req.getParameter("engl_busi_trip_frdt")); String engl_busi_trip_todt = Util.checkString(req.getParameter("engl_busi_trip_todt")); String issu_dt = Util.checkString(req.getParameter("issu_dt")); String issu_clsf = Util.checkString(req.getParameter("issu_clsf")); String issu_no = Util.checkString(req.getParameter("issu_no")); String uipadd = Util.checkString(req.getParameter("uipadd")); String uid = Util.checkString(req.getParameter("uid")); String now_dt = Util.checkString(req.getParameter("now_dt")); ----------------------------------------------------------------------------------------------------*//*---------------------------------------------------------------------------------------------------- Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오. String mode = Util.Uni2Ksc(Util.checkString(req.getParameter("mode"))); String cmpy_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("cmpy_cd"))); String emp_no = Util.Uni2Ksc(Util.checkString(req.getParameter("emp_no"))); String certi_clsf = Util.Uni2Ksc(Util.checkString(req.getParameter("certi_clsf"))); String occr_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("occr_dt"))); String seq = Util.Uni2Ksc(Util.checkString(req.getParameter("seq"))); String aplc_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("aplc_dt"))); String aplc_seq = Util.Uni2Ksc(Util.checkString(req.getParameter("aplc_seq"))); String issu_num_shet = Util.Uni2Ksc(Util.checkString(req.getParameter("issu_num_shet"))); String usag = Util.Uni2Ksc(Util.checkString(req.getParameter("usag"))); String remk = Util.Uni2Ksc(Util.checkString(req.getParameter("remk"))); String cntc_plac = Util.Uni2Ksc(Util.checkString(req.getParameter("cntc_plac"))); String email = Util.Uni2Ksc(Util.checkString(req.getParameter("email"))); String korn_flnm = Util.Uni2Ksc(Util.checkString(req.getParameter("korn_flnm"))); String prn = Util.Uni2Ksc(Util.checkString(req.getParameter("prn"))); String dept_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("dept_cd"))); String dty_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("dty_cd"))); String posi_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("posi_cd"))); String dirc_incmg_posi = Util.Uni2Ksc(Util.checkString(req.getParameter("dirc_incmg_posi"))); String chce_posi_clsf = Util.Uni2Ksc(Util.checkString(req.getParameter("chce_posi_clsf"))); String in_cmpy_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("in_cmpy_dt"))); String busi_trip_purp = Util.Uni2Ksc(Util.checkString(req.getParameter("busi_trip_purp"))); String busi_trip_area = Util.Uni2Ksc(Util.checkString(req.getParameter("busi_trip_area"))); String busi_trip_frdt = Util.Uni2Ksc(Util.checkString(req.getParameter("busi_trip_frdt"))); String busi_trip_todt = Util.Uni2Ksc(Util.checkString(req.getParameter("busi_trip_todt"))); String engl_flnm = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_flnm"))); String engl_bidt = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_bidt"))); String engl_dept_posi = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_dept_posi"))); String engl_in_cmpy_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_in_cmpy_dt"))); String engl_now_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_now_dt"))); String engl_busi_trip_purp = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_busi_trip_purp"))); String engl_busi_trip_area = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_busi_trip_area"))); String engl_busi_trip_frdt = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_busi_trip_frdt"))); String engl_busi_trip_todt = Util.Uni2Ksc(Util.checkString(req.getParameter("engl_busi_trip_todt"))); String issu_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("issu_dt"))); String issu_clsf = Util.Uni2Ksc(Util.checkString(req.getParameter("issu_clsf"))); String issu_no = Util.Uni2Ksc(Util.checkString(req.getParameter("issu_no"))); String uipadd = Util.Uni2Ksc(Util.checkString(req.getParameter("uipadd"))); String uid = Util.Uni2Ksc(Util.checkString(req.getParameter("uid"))); String now_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("now_dt"))); ----------------------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------------------- Web Tier에서 DM 파일의 변수를 설정시 사용하십시오. dm.setMode(mode); dm.setCmpy_cd(cmpy_cd); dm.setEmp_no(emp_no); dm.setCerti_clsf(certi_clsf); dm.setOccr_dt(occr_dt); dm.setSeq(seq); dm.setAplc_dt(aplc_dt); dm.setAplc_seq(aplc_seq); dm.setIssu_num_shet(issu_num_shet); dm.setUsag(usag); dm.setRemk(remk); dm.setCntc_plac(cntc_plac); dm.setEmail(email); dm.setKorn_flnm(korn_flnm); dm.setPrn(prn); dm.setDept_cd(dept_cd); dm.setDty_cd(dty_cd); dm.setPosi_cd(posi_cd); dm.setDirc_incmg_posi(dirc_incmg_posi); dm.setChce_posi_clsf(chce_posi_clsf); dm.setIn_cmpy_dt(in_cmpy_dt); dm.setBusi_trip_purp(busi_trip_purp); dm.setBusi_trip_area(busi_trip_area); dm.setBusi_trip_frdt(busi_trip_frdt); dm.setBusi_trip_todt(busi_trip_todt); dm.setEngl_flnm(engl_flnm); dm.setEngl_bidt(engl_bidt); dm.setEngl_dept_posi(engl_dept_posi); dm.setEngl_in_cmpy_dt(engl_in_cmpy_dt); dm.setEngl_now_dt(engl_now_dt); dm.setEngl_busi_trip_purp(engl_busi_trip_purp); dm.setEngl_busi_trip_area(engl_busi_trip_area); dm.setEngl_busi_trip_frdt(engl_busi_trip_frdt); dm.setEngl_busi_trip_todt(engl_busi_trip_todt); dm.setIssu_dt(issu_dt); dm.setIssu_clsf(issu_clsf); dm.setIssu_no(issu_no); dm.setUipadd(uipadd); dm.setUid(uid); dm.setNow_dt(now_dt); ----------------------------------------------------------------------------------------------------*/ /* 작성시간 : Wed Mar 18 17:57:06 KST 2009 */
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11