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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8be86fd9cd330f6dff9d05e8e447a1684d480bb9 | 1c785b15245b122d974c300e5004de60056ef55d | /projects/gpd/plugins/ru.runa.gpd.form.ftl/src/ru/runa/gpd/htmleditor/editors/HTMLDoubleClickStrategy.java | 95778aa938b8a8cbe01b65d7295ed7a203290bb7 | [] | no_license | kuimovvg/RunaWFE-4.x | 13e58f873d0fb751751a10294473d18b394a4b17 | 9b7d34f1e402d963213efda9dab9c305b090db0d | refs/heads/trunk | 2020-12-25T20:30:53.442175 | 2015-07-29T16:03:24 | 2015-07-29T16:03:24 | 39,517,577 | 0 | 0 | null | 2015-07-22T16:36:09 | 2015-07-22T16:36:08 | null | UTF-8 | Java | false | false | 2,282 | java | package ru.runa.gpd.htmleditor.editors;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ITextDoubleClickStrategy;
import org.eclipse.jface.text.ITextViewer;
public class HTMLDoubleClickStrategy implements ITextDoubleClickStrategy {
protected ITextViewer fText;
public void doubleClicked(ITextViewer part) {
int pos = part.getSelectedRange().x;
if (pos < 0)
return;
fText = part;
if (!selectComment(pos)) {
selectWord(pos);
}
}
protected boolean selectComment(int caretPos) {
IDocument doc = fText.getDocument();
int startPos, endPos;
try {
int pos = caretPos;
char c = ' ';
while (pos >= 0) {
c = doc.getChar(pos);
if (c == '\\') {
pos -= 2;
continue;
}
if (c == Character.LINE_SEPARATOR || c == '\"' || c=='<' || c=='>')
break;
--pos;
}
if (c != '\"')
return false;
startPos = pos;
pos = caretPos;
int length = doc.getLength();
c = ' ';
while (pos < length) {
c = doc.getChar(pos);
if (c == Character.LINE_SEPARATOR || c == '\"' || c=='<' || c=='>')
break;
++pos;
}
if (c != '\"')
return false;
endPos = pos;
int offset = startPos + 1;
int len = endPos - offset;
fText.setSelectedRange(offset, len);
return true;
} catch (BadLocationException x) {
}
return false;
}
protected boolean selectWord(int caretPos) {
IDocument doc = fText.getDocument();
int startPos, endPos;
try {
int pos = caretPos;
char c;
while (pos >= 0) {
c = doc.getChar(pos);
if (!Character.isJavaIdentifierPart(c))
break;
--pos;
}
startPos = pos;
pos = caretPos;
int length = doc.getLength();
while (pos < length) {
c = doc.getChar(pos);
if (!Character.isJavaIdentifierPart(c))
break;
++pos;
}
endPos = pos;
selectRange(startPos, endPos);
return true;
} catch (BadLocationException x) {
}
return false;
}
private void selectRange(int startPos, int stopPos) {
int offset = startPos + 1;
int length = stopPos - offset;
fText.setSelectedRange(offset, length);
}
} | [
"gritsenko_s@999c22fd-c5eb-e245-b5be-d41808c6d2cd"
] | gritsenko_s@999c22fd-c5eb-e245-b5be-d41808c6d2cd |
20b3b0f7315a42ac8ca0b19fb4190cab1c4a415a | 21cc908c06949e4e00e5f82ca6b9fbe991a6ea17 | /src/com/ibm/dp/service/StockTransferService.java | b4da6fd19bc96f19195344e3aeed1a1e9a12d83f | [] | no_license | Beeru1/DPDTH_New | b93cca6a2dc99b64de242b024f3e48327102d3fc | 80e3b364bb7634841e47fa41df7d3e633baedf72 | refs/heads/master | 2021-01-12T06:54:25.644819 | 2016-12-19T11:57:08 | 2016-12-19T11:57:08 | 76,858,059 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,002 | java | package com.ibm.dp.service;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import com.ibm.dp.beans.StockTransferFormBean;
import com.ibm.dp.dto.DistributorDTO;
import com.ibm.dp.dto.DistributorDetailsDTO;
import com.ibm.dp.dto.InterSSDTransferDTO;
import com.ibm.dp.exception.DPServiceException;
import com.ibm.virtualization.recharge.exception.DAOException;
/**
* @author Mohammad Aslam
*/
public interface StockTransferService {
public List<DistributorDTO> getFromDistributors(long accountId) throws DPServiceException, DAOException, SQLException;
public List<DistributorDTO> getToDistributors(long accountId) throws DPServiceException, DAOException, SQLException;
public List<DistributorDetailsDTO> getTransferDetails(long accountId, long fromDistId, long toDistId) throws DPServiceException, DAOException, SQLException;
public String getDCNumber() throws DPServiceException, DAOException, SQLException;
public String submitTransferDetails(StockTransferFormBean stfb, List<DistributorDetailsDTO> distributorDetailsList, long accountId) throws DPServiceException, DAOException, SQLException;
public String getContactNameForAccontId(long accountId) throws DPServiceException, DAOException, SQLException;
public List getSerailNumberList(long accountId, long productId) throws DPServiceException, DAOException, SQLException;
public List<InterSSDTransferDTO> interSSDTrans(Long accountId) throws DPServiceException, DAOException, SQLException;
public Map interSSDTransDetails(String trans_no,String transType,String transsubtype,int circle_id) throws DPServiceException, DAOException, SQLException;
//public List<InterSSDTransferDTO> distList(int circle_id) throws DPServiceException, DAOException, SQLException;
public String hirarchyTransfer(List<InterSSDTransferDTO> list) throws DPServiceException, DAOException, SQLException;
//public InterSSDTransferDTO getCurrentDist(String str) throws DPServiceException, DAOException, SQLException;
}
| [
"sgurugub@in.ibm.com"
] | sgurugub@in.ibm.com |
41f458d201ca036a3665af1498c787bf353cc2a4 | cccbc4b07ba32dba83c27557b99350620edbf999 | /src/main/java/com/algaworks/brewer/controller/UsuariosController.java | d2e0dcd3845008861ca379cba8ffc0263c2c11fc | [] | no_license | lucasbarrossantos/brewer | 7ec3b85edcc6f9cb4931c4bbc195bf92509b1c8e | 969b4ffafdc81244f21d4b92ab3bee7853fee8c6 | refs/heads/master | 2021-06-18T21:34:16.782766 | 2019-08-28T01:56:52 | 2019-08-28T01:56:52 | 204,824,134 | 0 | 0 | null | 2021-04-30T20:26:15 | 2019-08-28T01:44:45 | JavaScript | UTF-8 | Java | false | false | 379 | java | package com.algaworks.brewer.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/usuarios")
public class UsuariosController {
@GetMapping("/novo")
public String novo() {
return "usuario/cadastro-usuario";
}
} | [
"lucas-barros28@hotmail.com"
] | lucas-barros28@hotmail.com |
99e0ca314042badf373cf1cfea9ff8860d269f56 | b0d7ca2e5f19a4676c903b70d526e3e8080ea0e3 | /src/main/java/br/ufpa/labes/spm/repository/ConnectionRepository.java | a6fbd34f83e4baa20fc2ad034f4710912e270a45 | [] | no_license | Lakshamana/spm | 366f425e66d40a50c1248eb47a677315639555df | ba98a47557f196fa1429670e52549c188bbf00a1 | refs/heads/master | 2022-12-25T08:58:03.366441 | 2019-10-03T15:04:16 | 2019-10-03T15:04:16 | 170,921,469 | 0 | 0 | null | 2022-12-16T05:03:13 | 2019-02-15T20:03:02 | Java | UTF-8 | Java | false | false | 370 | java | package br.ufpa.labes.spm.repository;
import br.ufpa.labes.spm.domain.Connection;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the Connection entity.
*/
@SuppressWarnings("unused")
@Repository
public interface ConnectionRepository extends JpaRepository<Connection, Long> {
}
| [
"guitrompa1@gmail.com"
] | guitrompa1@gmail.com |
3a7278303af2141a23eb77614d358eb5f51d8193 | 3a64f07a0240597d10651ea731e5c0be9a76674e | /eclipse/frag2demo/src/edu/cs4730/frag2demo/textActivity.java | 7f0c9683919c6e50392494e8bf8ea21f8865bfee | [
"Apache-2.0"
] | permissive | JimSeker/ui | 9f50327fa72b0328b229f7c399874b7565dbb895 | ff388e01c32ba36c42b4a2a385db4882c2825fee | refs/heads/master | 2023-09-04T09:50:55.154765 | 2023-08-29T17:08:09 | 2023-08-29T17:08:09 | 17,833,557 | 37 | 38 | null | null | null | null | UTF-8 | Java | false | false | 1,991 | java | package edu.cs4730.frag2demo;
import android.support.v4.app.FragmentActivity;
//import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;
public class textActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_text);
// Show the Up button in the action bar.
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB) {
getActionBar().setHomeButtonEnabled(true);
}
// savedInstanceState is non-null when there is fragment state
// saved from previous configurations of this activity
// (e.g. when rotating the screen from portrait to landscape).
// In this case, the fragment will automatically be re-added
// to its container so we don't need to manually add it.
// For more information, see the Fragments API guide at:
//
// http://developer.android.com/guide/components/fragments.html
//
if (savedInstanceState == null) {
// Create the detail fragment and add it to the activity
// using a fragment transaction.
textFrag fragment = new textFrag();
getSupportFragmentManager().beginTransaction()
.add(R.id.text_container, fragment).commit();
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
Intent upIntent = new Intent(this, Fd2.class);
// This ID represents the Home or Up button. In the case of this
// activity, the Up button is shown. Use NavUtils to allow users
// to navigate up one level in the application structure. For
// more details, see the Navigation pattern on Android Design:
//
// http://developer.android.com/design/patterns/navigation.html#up-vs-back
//
NavUtils.navigateUpTo(this, upIntent);
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"seker@uwyo.edu"
] | seker@uwyo.edu |
d26e20fa7db53d1a9a2648f80bb8cfa4f2bc5093 | 5a84bd6ea7fb03510def5ffe7c5556802c4d2ef2 | /Spring_With_JDBC/src/main/java/com/face/service/UserService.java | b8aef2e4640f0bdf55d87b3e73acc5394505a2f9 | [] | no_license | AMMUTI/JAVA_PROJECTS | 652a9694ac59e020bfa32dc37faaf98c1802bce0 | 5d3e8f757e3e43c3772e68c63093c6584ef8d277 | refs/heads/master | 2022-12-23T05:18:43.558858 | 2019-12-10T03:31:58 | 2019-12-10T03:31:58 | 210,356,475 | 0 | 0 | null | 2022-12-16T04:39:10 | 2019-09-23T13:02:03 | Java | UTF-8 | Java | false | false | 185 | java | package com.face.service;
import com.face.model.Login;
import com.face.model.User;
public interface UserService {
void register(User user);
User validateUser(Login login);
}
| [
"noreply@github.com"
] | AMMUTI.noreply@github.com |
07624c15658e25e11346d78098d6ddb1b98b3b16 | e9887d5dcf82e6a0aa3270ad9fe0fd8f3ff78e9b | /src/main/java/ru/entel/smiu/msg/ConfigData.java | 7684daa85c3cfdd9b8d7ba9b33f288d1ecd6c7df | [] | no_license | Farades/DataDealer | d2fa9968a0ce5e4ed591cd03066bc373f1db11bf | 7029a205498c21779a9902ee5ac4471315ef7ba2 | refs/heads/master | 2018-12-28T04:20:16.073697 | 2016-02-17T12:05:37 | 2016-02-17T12:05:37 | 41,495,957 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 814 | java | package ru.entel.smiu.msg;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class ConfigData {
private Map<String, String> properties = new HashMap<>();
private Set<DeviceConfPackage> devices = new HashSet<>();
public ConfigData(Map<String, String> properties, Set<DeviceConfPackage> devices) {
this.properties = properties;
this.devices = devices;
}
public Map<String, String> getProperties() {
return properties;
}
public void setProperties(Map<String, String> properties) {
this.properties = properties;
}
public Set<DeviceConfPackage> getDevices() {
return devices;
}
public void setDevices(Set<DeviceConfPackage> devices) {
this.devices = devices;
}
}
| [
"creg2007@gmail.com"
] | creg2007@gmail.com |
28f6afd50fd35e6a629b945ae74715bc2bf61339 | a3e9de23131f569c1632c40e215c78e55a78289a | /alipay/alipay_sdk/src/main/java/com/alipay/api/request/KoubeiCateringDishCookSyncRequest.java | d597612823c3a67c33a6e488a45c7d6b93e89b66 | [] | no_license | P79N6A/java_practice | 80886700ffd7c33c2e9f4b202af7bb29931bf03d | 4c7abb4cde75262a60e7b6d270206ee42bb57888 | refs/heads/master | 2020-04-14T19:55:52.365544 | 2019-01-04T07:39:40 | 2019-01-04T07:39:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,983 | java | package com.alipay.api.request;
import com.alipay.api.domain.KoubeiCateringDishCookSyncModel;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.KoubeiCateringDishCookSyncResponse;
import com.alipay.api.AlipayObject;
/**
* ALIPAY API: koubei.catering.dish.cook.sync request
*
* @author auto create
* @since 1.0, 2018-10-10 16:35:00
*/
public class KoubeiCateringDishCookSyncRequest implements AlipayRequest<KoubeiCateringDishCookSyncResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 口碑菜品中心菜谱同步api
*/
private String bizContent;
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getReturnUrl() {
return this.returnUrl;
}
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "koubei.catering.dish.cook.sync";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<KoubeiCateringDishCookSyncResponse> getResponseClass() {
return KoubeiCateringDishCookSyncResponse.class;
}
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
public AlipayObject getBizModel() {
return this.bizModel;
}
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
| [
"jiaojianjun1991@gmail.com"
] | jiaojianjun1991@gmail.com |
f3b80e06a12ec9a4d808002df762b5ea48a6baf2 | 2c4d272231795ed635dedc74ffc198ae4ed43660 | /src/main/java/com/saurabh/apigateway/config/LocaleConfiguration.java | 5e0d7c2e91f5293b872fe980a5f1abd9bde34fa5 | [] | no_license | 100rabh/apigateway | a636ceeaadc5141d4cc16899fa764a4c8ccdcfe1 | 8a22e6a0ec8285642daa18b16913187c2a0a7b46 | refs/heads/master | 2021-08-26T07:29:42.993089 | 2017-11-17T09:23:33 | 2017-11-17T09:23:33 | 111,084,590 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,396 | java | package com.saurabh.apigateway.config;
import io.github.jhipster.config.locale.AngularCookieLocaleResolver;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
@Configuration
public class LocaleConfiguration extends WebMvcConfigurerAdapter implements EnvironmentAware {
@Override
public void setEnvironment(Environment environment) {
// unused
}
@Bean(name = "localeResolver")
public LocaleResolver localeResolver() {
AngularCookieLocaleResolver cookieLocaleResolver = new AngularCookieLocaleResolver();
cookieLocaleResolver.setCookieName("NG_TRANSLATE_LANG_KEY");
return cookieLocaleResolver;
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
localeChangeInterceptor.setParamName("language");
registry.addInterceptor(localeChangeInterceptor);
}
}
| [
"saurabh.rawat@kelltontech.com"
] | saurabh.rawat@kelltontech.com |
b57c1fcc5bbb8ae14ef98fb7b4e4c306e4850c94 | d67219096979725c05f3d02a2cfd8c6420233af5 | /at.medevit.elexis.impfplan.ui/src/at/medevit/elexis/impfplan/ui/VaccinationEffectCheckboxTreeViewer.java | a72d82f46b8e46dd5ac7d3205c158222bcb07e7e | [] | no_license | jntme/elexis-3-base | b2543e799b81702c7f8a79f0fdca55de1cdaca18 | a1f5222a585de40ca8529ae2a39dec5c09b13fb8 | refs/heads/master | 2021-01-21T10:22:28.681959 | 2017-03-01T13:42:52 | 2017-03-01T14:05:48 | 83,418,140 | 0 | 0 | null | 2017-02-28T10:10:25 | 2017-02-28T10:10:25 | null | UTF-8 | Java | false | false | 3,467 | java | package at.medevit.elexis.impfplan.ui;
import java.util.Arrays;
import java.util.List;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ICheckStateProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewerColumn;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import at.medevit.elexis.impfplan.model.DiseaseDefinitionModel;
import at.medevit.elexis.impfplan.model.DiseaseDefinitionModel.DiseaseDefinition;
import ch.elexis.core.constants.StringConstants;
public class VaccinationEffectCheckboxTreeViewer extends CheckboxTreeViewer
implements ICheckStateProvider {
private String initialCheckedElements = "";
public VaccinationEffectCheckboxTreeViewer(Composite parent, int style,
String initialCheckedElements){
super(parent, style);
this.initialCheckedElements =
(initialCheckedElements != null) ? initialCheckedElements : StringConstants.EMPTY;
GridData gd_tree = new GridData(SWT.FILL, SWT.TOP, true, false);
gd_tree.heightHint = 200;
getTree().setLayoutData(gd_tree);
getTree().setHeaderVisible(false);
getTree().setLinesVisible(true);
TreeViewerColumn col = new TreeViewerColumn(this, SWT.NONE);
col.getColumn().setWidth(225);
setContentProvider(new DiseaseTreeContentProvider());
setLabelProvider(new DiseaseTreeLabelProvider());
setInput(DiseaseDefinitionModel.getDiseaseDefinitions());
setCheckStateProvider(this);
}
public String getCheckedElementsAsCommaSeparatedString(){
Object[] checkedElements = getCheckedElements();
List<Object> list = Arrays.asList(checkedElements);
return list.stream().map(o -> (DiseaseDefinition) o).map(o -> o.getATCCode())
.reduce((u, t) -> u + StringConstants.COMMA + t).get();
}
private class DiseaseTreeContentProvider implements ITreeContentProvider {
@Override
public void dispose(){}
@Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput){}
@Override
public Object[] getElements(Object inputElement){
return DiseaseDefinitionModel.getDiseaseDefinitions().toArray();
}
@Override
public Object[] getChildren(Object parentElement){
return null;
}
@Override
public Object getParent(Object element){
return (DiseaseDefinition) element;
}
@Override
public boolean hasChildren(Object element){
return false;
}
}
private class DiseaseTreeLabelProvider implements ILabelProvider {
@Override
public void addListener(ILabelProviderListener listener){}
@Override
public void dispose(){}
@Override
public boolean isLabelProperty(Object element, String property){
return false;
}
@Override
public void removeListener(ILabelProviderListener listener){}
@Override
public Image getImage(Object element){
return null;
}
@Override
public String getText(Object element){
return ((DiseaseDefinition) element).getDiseaseLabel();
}
}
@Override
public boolean isChecked(Object element){
DiseaseDefinition dd = (DiseaseDefinition) element;
return initialCheckedElements.contains(dd.getATCCode());
}
@Override
public boolean isGrayed(Object element){
return false;
}
}
| [
"marco@descher.at"
] | marco@descher.at |
02afd2139a3b61a0ad8c4d2bc4cb80df72ab50c0 | a6da15de1e0be4d721e0a7869e6659846d9973fd | /src/main/java/com/dongchuanzhe/preuser/entity/Nation.java | 5dd8362469c9160150a4c41bfe271d66bf031514 | [] | no_license | dcz0209/dongchuanzhe-preuser | 936587f2375d578d3bafc5a14107da2e1ddace9e | 3a82d0d576bb51f59dc5ac09045c017278199464 | refs/heads/master | 2021-03-26T14:15:32.041216 | 2020-03-16T13:51:57 | 2020-03-16T13:51:57 | 247,711,392 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package com.dongchuanzhe.preuser.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 城市字典表
* </p>
*
* @author dcz
* @since 2020-03-03
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Nation implements Serializable {
private static final long serialVersionUID=1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 编码
*/
private String code;
private String province;
private String city;
private String district;
private String parent;
}
| [
"dcz0209@qq.com"
] | dcz0209@qq.com |
9388ae45ab4df4d91156f5de42bd3f73e7541fff | 2c8730a2fd5620b8b7d51bca7f5358a4d837dd8c | /web/rest-ui/src/main/java/org/artifactory/ui/rest/model/artifacts/browse/treebrowser/action/CopyArtifact.java | 853c95abdbefbf6fadb4e3946cb8ceb37da0e513 | [] | no_license | deanbitan/jfrogTrunk_12152015 | bf08d1afb578812af12262b64bb8c0e766c1d5fd | d6bd0d41b5e240c7aad870e68e2d90790ea3ea65 | refs/heads/master | 2021-01-10T11:55:10.619946 | 2015-12-08T15:45:49 | 2015-12-08T15:45:49 | 48,036,304 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,089 | java | /*
* Artifactory is a binaries repository manager.
* Copyright (C) 2012 JFrog Ltd.
*
* Artifactory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Artifactory is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Artifactory. If not, see <http://www.gnu.org/licenses/>.
*/
package org.artifactory.ui.rest.model.artifacts.browse.treebrowser.action;
import org.artifactory.rest.common.model.artifact.BaseArtifact;
/**
* @author Chen Keinan
*/
public class CopyArtifact extends BaseArtifact {
private String targetRepoKey;
private String targetPath;
private boolean dryRun;
private boolean suppressLayouts;
private boolean failFast;
public CopyArtifact() {
}
public boolean isDryRun() {
return dryRun;
}
public void setDryRun(boolean dryRun) {
this.dryRun = dryRun;
}
public boolean isSuppressLayouts() {
return suppressLayouts;
}
public void setSuppressLayouts(boolean suppressLayouts) {
this.suppressLayouts = suppressLayouts;
}
public boolean isFailFast() {
return failFast;
}
public void setFailFast(boolean failFast) {
this.failFast = failFast;
}
public String getTargetRepoKey() {
return targetRepoKey;
}
public void setTargetRepoKey(String targetRepoKey) {
this.targetRepoKey = targetRepoKey;
}
public String getTargetPath() {
return targetPath;
}
public void setTargetPath(String targetPath) {
this.targetPath = targetPath;
}
public CopyArtifact(String name) {
super(name);
}
}
| [
"oferh@2c6c46e5-621b-0410-92f3-c2a4854cd828"
] | oferh@2c6c46e5-621b-0410-92f3-c2a4854cd828 |
4c1ead6ae0511c1b2d19ec275bae3364216e5675 | 6238ea13425638779d4794cd47785da5f7bf052d | /src/main/java/com/diyiliu/web/controller/TestController.java | f1dda917f08a865a53ea7907602e1a2b87683d38 | [] | no_license | diyiliu/admin | be14d9042f11a56f2458e982e824d642d58db2ab | 92876944c75e54f9c5d563ff2407768022a57275 | refs/heads/master | 2021-01-21T04:41:16.385433 | 2016-07-28T03:27:20 | 2016-07-28T03:27:20 | 55,219,817 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,707 | java | package com.diyiliu.web.controller;
import com.diyiliu.support.other.Pagination;
import com.diyiliu.support.other.PaginationHelper;
import com.diyiliu.support.util.CommonUtil;
import com.diyiliu.web.controller.base.BaseController;
import com.diyiliu.web.entity.Test;
import com.diyiliu.web.entity.User;
import com.diyiliu.web.service.UserService;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Description: TestController
* Author: DIYILIU
* Update: 2016-03-14 11:19
*/
@Controller
@RequestMapping(value = "/test")
public class TestController extends BaseController{
@Resource
private UserService userService;
@RequestMapping
public void test(HttpServletResponse response) throws IOException {
response.getWriter().write("hello!");
}
@RequestMapping(value = "/1")
public Test test1(Test test) {
return test;
}
@RequestMapping(value = "/2")
public void test2(User user) {
System.out.println(user.getId());
}
@RequestMapping(value = "/form")
public String form(User user, HttpServletResponse response) throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("user", user);
//map.put("array", a);
ObjectMapper objectMapper = new ObjectMapper();
response.getWriter().write(objectMapper.writeValueAsString(map));
return null;
}
@ResponseBody
@RequestMapping(value = "/table")
public String table( Pagination pagination, @RequestParam(required = false) String search) {
PaginationHelper.page(pagination.getOffset(), pagination.getLimit());
List<User> list = userService.selectUsers(CommonUtil.isEmpty(search) ? null : search.trim());
pagination.setTotal(PaginationHelper.getCount());
pagination.setRows(list);
return toJson(pagination);
}
@ResponseBody
@RequestMapping(value = "/dynamicQuery")
public String selectBySql() {
String sql = "SELECT" +
" t.*" +
" FROM" +
" city t" +
" INNER JOIN country c ON t.CountryCode = c.`Code`" +
" AND c.`Name` = 'china'";
List<Map> list = userService.selectBySql(sql);
return toJson(list);
}
}
| [
"572772828@qq.com"
] | 572772828@qq.com |
b12b326c905656f2828ff53b55184562eb9113e5 | a86354a5ae6a1445a77d2159dbeb68488ca50646 | /app/MySelfAPP/app/src/main/java/com/myself/app/view/HttpTestActivity.java | 1793c6fb26c45e749c1fd0692fe0b6ea4c5f6a93 | [] | no_license | JessicaZhuJ/MySelfProject | 139f8255494836202dfad7eef95b92185b85fae7 | b79a3b89f82e19516f3d2969ed440d7acb39dc82 | refs/heads/master | 2020-06-02T16:34:30.850736 | 2018-02-10T02:04:13 | 2018-02-10T02:04:56 | 94,098,420 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,200 | java | package com.myself.app.view;
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.myself.app.R;
import com.myself.app.databinding.ActivityHttpTestBinding;
import com.myself.app.utils.Utils;
import com.myself.app.viewModel.HttpTestViewModel;
import java.util.Observable;
/**
* http测试
* Created by zhujl on 2017/6/20 0020.
*/
public class HttpTestActivity extends BaseRxActivity {
private static final String TAG = "HttpTestActivity";
private Context context;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
context = this;
initBinding();
}
private void initBinding() {
ActivityHttpTestBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_http_test);
HttpTestViewModel viewModel = new HttpTestViewModel(this);
binding.setHttpTestViewModel(viewModel);
setupObservable(viewModel, this);
}
@Override
public void update(Observable o, Object arg) {
if (o instanceof HttpTestViewModel){
}
}
}
| [
"zhujl@e-sinhai.com"
] | zhujl@e-sinhai.com |
bfb4113895a72e4baf5b6f4519ce837b274e0a14 | 5daea348c482df46721b88feded27b5127e1af55 | /app/src/main/java/com/example/exampleproject/module/update/domain/usercase/UpdateUserCase.java | b67ddae74fdd1dfbc23294fde3925b978b77f1d2 | [] | no_license | chaymm/ExampleProject | 06729ac0128a24da4f96bc5a0c2298601aee24e4 | b636a59f8e982c6f26907e49131bde8b15ed53d2 | refs/heads/master | 2021-04-29T07:10:00.856841 | 2017-10-26T03:10:50 | 2017-10-26T03:10:50 | 77,971,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 524 | java | package com.example.exampleproject.module.update.domain.usercase;
import io.reactivex.Observable;
/**
* 用例接口
* Created by chang on 2017/3/13.
*/
public interface UpdateUserCase {
/**
* 下载应用APK
*
* @param fileDir 目标目录
* @param fileName 目标文件名
* @param url 下载地址
* @return
*/
Observable<String> getAppApk(String fileDir, String fileName, String url);
/**
* 取消下载OBD APK
*/
void cancelDownloadAppApk();
}
| [
"37070352@qq.com"
] | 37070352@qq.com |
0fbb949f9dbc9bcb6dccf1f39cccfe64aa6f56f9 | 6a32bf1cf2ad1deaf6a47ab4fc113aad352cdf2b | /src/minecraft/me/imfr0zen/guiapi/listeners/TextListener.java | b2d0b098e1feb9df0c07aa93233f8583ecafe303 | [] | no_license | holdhands/WizardsWandClient | 7fcc284f579946db8ae2875a5ee4fb6d5ae2f065 | da0894f7d1b88bb2e3a232f9cc0f8f4e33e9965f | refs/heads/master | 2021-01-13T17:06:19.496857 | 2016-11-03T19:33:28 | 2016-11-03T19:33:28 | 72,530,823 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 419 | java | package me.imfr0zen.guiapi.listeners;
/**
*
* Used by {@link me.imfr0zen.guiapi.components.GuiTextField}
* @author ImFr0zen
*
*/
public interface TextListener {
/**
* Gets called when entering a character
* @param key
* @param text
*/
void keyTyped(char key, String text);
/**
* Gets called when pressing enter or
* @param text
*/
void stringEntered(String text);
}
| [
"jaspersmit2801@gmail.com"
] | jaspersmit2801@gmail.com |
5f3408b14922267a870c7215c37c6c1edc480b48 | bb8a4b5236076be3a946bd5a18f334e8566b13d5 | /src/Proxy/CGLibProxy/main.java | f73179dcffd88c44093bcd852fc261fe002004c7 | [] | no_license | adamhand/testall | 1ab74216c0c87ef45f2d63c655619eb4cda3a10a | 754473aa61e220d5d3071d6c5fa0adcf466167b2 | refs/heads/master | 2022-11-03T01:31:32.432191 | 2020-01-04T04:21:43 | 2020-01-04T04:21:43 | 162,571,081 | 0 | 0 | null | 2022-10-04T23:49:22 | 2018-12-20T11:35:11 | Java | UTF-8 | Java | false | false | 278 | java | package Proxy.CGLibProxy;
import Proxy.StaticProxy.Hello;
import Proxy.StaticProxy.HelloImp;
public class main {
public static void main(String[] args) {
HelloImp helloImp = CGLibProxy.getInstance().getProxy(HelloImp.class);
helloImp.say("Jack");
}
}
| [
"adaihand@163.com"
] | adaihand@163.com |
47085cdaee1bd1a8e4c8887eec4768153357eee7 | db8bfa9a734bbd533c5be4050d8cd4d78acf1d7e | /src/main/java/com/cafe24/mysite/vo/CommentVo.java | 062921e955a66cb3ffe1fcf9cde6e85cbd85f1f8 | [] | no_license | Choi2/mysite3-mybatis | 767f2f0b82895b347c2a83dbe5568f809dac4428 | de2a1aa7915a95eb0c31533fb3de944fc026bd6b | refs/heads/master | 2021-04-12T08:33:31.733917 | 2018-06-11T05:40:55 | 2018-06-11T05:40:55 | 126,331,777 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,118 | java | package com.cafe24.mysite.vo;
import java.util.Date;
public class CommentVo {
private long no;
private String content;
private Date regDate;
private long boardNo;
private long userNo;
private String name;
public long getNo() {
return no;
}
public void setNo(long no) {
this.no = no;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getRegDate() {
return regDate;
}
public void setRegDate(Date regDate) {
this.regDate = regDate;
}
public long getBoardNo() {
return boardNo;
}
public void setBoardNo(long boardNo) {
this.boardNo = boardNo;
}
public long getUserNo() {
return userNo;
}
public void setUserNo(long userNo) {
this.userNo = userNo;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "CommentVo [no=" + no + ", content=" + content + ", regDate=" + regDate + ", boardNo=" + boardNo
+ ", userNo=" + userNo + "]";
}
}
| [
"bit@DESKTOP-9194ESD"
] | bit@DESKTOP-9194ESD |
af5ed0f712c4ea74c46d66925657115e5b70144b | 7d0ed9cacf4e48baf0aa25d4a8d2de4af6387b33 | /android/os/Parcelable.java | 50e50eb7a5dbac6c84da6b2dc05df3d2c65f6139 | [
"Apache-2.0"
] | permissive | yuanliwei/Monkey-Repl | fba5a773fcc88c5de48436a5c2529686ece40e33 | 381bd7da3591d83628a54ea7d1760712cbe0ad13 | refs/heads/master | 2022-07-05T09:45:17.077556 | 2022-06-24T01:16:40 | 2022-06-24T01:16:40 | 195,626,675 | 7 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,157 | java |
package android.os;
import android.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
public interface Parcelable {
@IntDef(flag = true, prefix = { "PARCELABLE_" }, value = { PARCELABLE_WRITE_RETURN_VALUE,
PARCELABLE_ELIDE_DUPLICATES, })
@Retention(RetentionPolicy.SOURCE)
public @interface WriteFlags {
}
public static final int PARCELABLE_WRITE_RETURN_VALUE = 0x0001;
public static final int PARCELABLE_ELIDE_DUPLICATES = 0x0002;
@IntDef(flag = true, prefix = { "CONTENTS_" }, value = { CONTENTS_FILE_DESCRIPTOR, })
@Retention(RetentionPolicy.SOURCE)
public @interface ContentsFlags {
}
public static final int CONTENTS_FILE_DESCRIPTOR = 0x0001;
public @ContentsFlags int describeContents();
public void writeToParcel(Parcel dest, @WriteFlags int flags);
public interface Creator<T> {
public T createFromParcel(Parcel source);
public T[] newArray(int size);
}
public interface ClassLoaderCreator<T> extends Creator<T> {
public T createFromParcel(Parcel source, ClassLoader loader);
}
}
| [
"891789592@qq.com"
] | 891789592@qq.com |
ac077de673230015b8d8df5a34772a5142d73f0f | 396185bd8e8e76d048e5c48e8f62ed7386579adb | /src/quote/QuoteModule.java | 75b6d6d15529d8a48e6dafafb8c7a29ceea91963 | [
"MIT"
] | permissive | joshloh/Tsukihi | e558703abfef664d0e1a21150a30d94d26ea31f7 | ba38dbedd6b99098e2b0f6fe97d18011c553d209 | refs/heads/master | 2021-04-26T22:23:41.970319 | 2018-08-29T05:22:04 | 2018-08-29T05:22:04 | 124,083,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,294 | java | package quote;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.StringTokenizer;
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
import tsukihi.Module;
import tsukihi.Tsukihi;
/**
* Extension of the Module class
* @author joshuafloh
*
*/
public class QuoteModule extends Module
{
// Maps authors to a list of their quotes
Map<String, List<String>> quotes;
public QuoteModule(Tsukihi tsukihi)
{
super(tsukihi);
quotes = new HashMap<String, List<String>>();
createQuotes();
}
/**
* Initialises the quotes map, should be called before the module does anything else
*/
private void createQuotes()
{
List<String> haliQuotes = Arrays.asList(
"250g is half a kilo",
"I'm supposed to be at work right now",
"I need to go to work",
"Take a bowl of steam",
"cheatah stripes",
"Why am I just not a lesbian",
"You can get conjunctivitis from looking at someone's eye",
"Stop touching me, Emmanuel!",
"I have so much work to do",
"*kisses Kelsey on the cheek*",
"Argh! There's so much to do"
);
List<String> emmaQuotes = Arrays.asList(
"Githib",
"waht i dont get is how to write the code",
"i think to solve global warming we just need lots of huge fans, that cool air or maybe put icecubes into oceans?",
"jumping off a parachute",
"How is killing people evil",
"wat are odd numbers again?",
"How do you get on to Heroku? Is it GitHub?",
"What if it's some ISIS porn?",
"WAIT HOW ARE BINARYSEARCH AND QUICK SORT DIFFERENT??",
"When loop",
"what religion was jesus?",
"What the fuck is beef? Does it come from cows?",
"do we need to know for ISE",
"The sink that the dishwasher is in",
"The world revolves around me",
"Do you practise not killing people",
"Do I have a spouse? What's a spouse?",
"I AM THE SUN",
"You can be a mother but not like... be a mother while being a mother",
"anyone here knows the msyteries of a toilet?",
"The ocean isn't blue",
"I'd be your daddy for MnMs",
"Can you read with your ears closed?",
"Does that look circumcised? Or is it like, Jewish?",
"I should buy some gluten free water for her",
"I'm young for my age",
"What is Bendigo Bank, is it a bank?",
"Do you practice shaving and waxing on a dumpling?",
"I watch TV shows in my headphones",
"Genocide is okay as long as it's not the entire race",
"Which part of a butt cheek is concave and which is convex?",
"black is just a really dark white right?",
"Cheese is not savory",
"You cant get pregnant the first time you have sex",
"I don't mind being 20 at least it makes me wisdomer than you",
"What language do they speak in Holland? Hollish?",
"if the course has a 25% fail rate does that mean that 25% of the class will fail it, or 25% of people in that class don't pass?",
"Lasagna is a cake"
);
List<String> dentonQuotes = Arrays.asList(
"it has been confirmed that Aiden is in fact a male",
"I wonder what happen if some official document had something like This product can support three (4) people",
"HOLY SHIT, YOU CAN LEGIT OPEN CODE WITH EXCEL",
"Literally everything in the world already exists",
"Is it acceptable to submit the essay in a format such as plaintext or PowerPoint?",
"phew, that was clost. I almost lost zero marks",
"public Vector<Vector<Vector>> Topovots",
"```java\n"
+ "if (SeeWhetherASingleSegmentIsAlreadyInTopovots(left, Topovots.get(i).get(j)) || SeeWhetherASingleSegmentIsAlreadyInTopovots(right, Topovots.get(i).get(j)))\r\n" +
"if ((left.get(0).GetLine() == Topovots.get(i).get(j).get(0).GetLine() && left.get(0).GetFile() == Topovots.get(i).get(j).get(0).GetFile()) || (right.get(0).GetLine() == Topovots.get(i).get(j).get(0).GetLine()) && right.get(0).GetFile() == Topovots.get(i).get(j).get(0).GetFile())\r\n" +
"{\r\n" +
" return;\r\n" +
"}```",
"When I can almost recite the 15 minute version of Rapper's Delight, but I can't remember what functional requirements are",
"But is being on fire a disease?");
quotes.put("hali", haliQuotes);
quotes.put("emma", emmaQuotes);
quotes.put("denton", dentonQuotes);
}
@Override
public List<String> createInvokers()
{
return Arrays.asList("hali", "emma", "denton");
}
@Override
public List<String> createDescriptions()
{
return Arrays.asList("sends a random quote from Hali","sends a random quote from Emmanuel","sends a random quote from Denton");
}
@Override
public void commandReceived(MessageReceivedEvent e, String invoker, StringTokenizer st)
{
List<String> messages = quotes.get(invoker);
if (messages == null)
{
tsukihi.print(invoker + " invokes the quotes module, but quotes module has no such quote author");
return;
}
int upper = messages.size();
Random rand = new Random();
int n = rand.nextInt(upper);
e.getChannel().sendMessage("\"" + messages.get(n) + "\"\n - " + invoker).queue();
}
} | [
"joshuafloh@gmail.com"
] | joshuafloh@gmail.com |
bd5bb62ec02f0112e0c7015be09ceaa055257c42 | 3533f707ea0cce93b8e98fb2109f4ea7cd4db46f | /game-common/src/main/java/com/iterror/game/common/tcp/protocol/TypeMetainfo.java | f9bed6076322eea6f042dc485ac5168d01085ee0 | [] | no_license | hzsuwang/game-server | a808cf06fc82161f1ee493cfb8e4c3ecf9494a6e | 13d63b002122c142411bf1495dacfdadc94b4ece | refs/heads/master | 2021-01-20T08:34:33.280870 | 2017-09-23T09:46:38 | 2017-09-23T09:46:38 | 101,565,521 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 120 | java | /**
*
*/
package com.iterror.game.common.tcp.protocol;
public interface TypeMetainfo {
Class<?> find(int value);
}
| [
"hzsuwang@163.com"
] | hzsuwang@163.com |
82b1b37071857d1bb14cee2072bc4b12c2131b9c | f912f0fe9b865a18b5bc31fe62c7eb8d97d108db | /workspace/at.jku.weiner.c.parser/emf-gen/at/jku/weiner/c/parser/parser/SpecifierQualifierList.java | 80595c366879db12af1e1a9d541fb83092e3beec | [] | no_license | timeraider4u/kefax | 44db2c63ea85e10a5157436bb2dabd742b590032 | 7e46c1730f561d1b76017f0ddb853c94dbb93cd6 | refs/heads/master | 2020-04-16T01:58:01.195430 | 2016-10-30T22:08:29 | 2016-10-30T22:08:29 | 41,462,260 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,179 | java | /**
*/
package at.jku.weiner.c.parser.parser;
import fr.inria.atlanmod.neoemf.core.PersistentEObject;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Specifier Qualifier List</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link at.jku.weiner.c.parser.parser.SpecifierQualifierList#getTypeSpecifier <em>Type Specifier</em>}</li>
* <li>{@link at.jku.weiner.c.parser.parser.SpecifierQualifierList#getTypeQualifier <em>Type Qualifier</em>}</li>
* </ul>
* </p>
*
* @see at.jku.weiner.c.parser.parser.ParserPackage#getSpecifierQualifierList()
* @model
* @extends PersistentEObject
* @generated
*/
public interface SpecifierQualifierList extends PersistentEObject
{
/**
* Returns the value of the '<em><b>Type Specifier</b></em>' containment reference list.
* The list contents are of type {@link at.jku.weiner.c.parser.parser.TypeSpecifier}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Type Specifier</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Type Specifier</em>' containment reference list.
* @see at.jku.weiner.c.parser.parser.ParserPackage#getSpecifierQualifierList_TypeSpecifier()
* @model containment="true"
* @generated
*/
EList<TypeSpecifier> getTypeSpecifier();
/**
* Returns the value of the '<em><b>Type Qualifier</b></em>' containment reference list.
* The list contents are of type {@link at.jku.weiner.c.parser.parser.TypeQualifier}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Type Qualifier</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Type Qualifier</em>' containment reference list.
* @see at.jku.weiner.c.parser.parser.ParserPackage#getSpecifierQualifierList_TypeQualifier()
* @model containment="true"
* @generated
*/
EList<TypeQualifier> getTypeQualifier();
} // SpecifierQualifierList
| [
"timeraider@gmx.at"
] | timeraider@gmx.at |
421867a4569c75f82ae7e710fd2f6c34b5aa8fae | a0ec3afa584fcf29e83d6d0f28fe62cd03457600 | /src/com/atenea/components/FileLoaderImpl.java | 965632cddcf8a7ab94f9b05c866b8f1b863f66aa | [] | no_license | jliebana/atenea | f490212ba4e9fd507160f9299f3de7f5b16d5869 | 4c3f1a26e522dc52b56fdbc027d4e0bcfad60334 | refs/heads/master | 2021-01-10T09:50:38.700745 | 2015-10-04T12:55:53 | 2015-10-04T12:55:53 | 43,635,023 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | package com.atenea.components;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.atenea.core.api.FileLoader;
/**
* Simple class to load the liked words
* @author jliebana
*
*/
public class FileLoaderImpl implements FileLoader {
@Override
public List<String> loadLikedWords(String path) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(path));
List<String> likedWords = new ArrayList<String>();
String line = br.readLine();
String[] words = (line!=null)?line.split(","):new String[0];
for(String current : words){
likedWords.add(current);
}
br.close();
return likedWords;
}
}
| [
"kuu.kuu@gmail.com"
] | kuu.kuu@gmail.com |
6d1dfeb72e8de807938cfc023631b68b903eb62a | e3183e9b80e51e289a5046070aee88f8bcd889ff | /src/main/java/Apache/server/PartsServer.java | a9f6b465a06dd0588786e9e8930de9a5dba6c9a4 | [
"Apache-2.0"
] | permissive | angleheart/apache | c8c6c028ea2d3a10f6f12a24f02351461bd259bb | 9473d3d3f1e07ecc7b3c67e23d0c45306be5dd93 | refs/heads/master | 2023-08-03T16:32:35.301169 | 2021-09-15T03:52:19 | 2021-09-15T03:52:19 | 387,284,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | package Apache.server;
import Apache.server.database.PartDatabase;
import static Apache.util.JSONTransformer.toJson;
import static spark.Spark.get;
class PartsServer {
static void init(){
get("/parts/:mfg/:number", (req, res) -> {
System.out.println("[GET] /parts/" + req.params(":mfg") + "/" + req.params(":number"));
try (PartDatabase partDatabase = new PartDatabase()) {
return toJson(partDatabase.getParts(req.params(":mfg"), req.params(":number")));
} catch (Exception e) {
e.printStackTrace();
}
return null;
});
}
}
| [
"angleheart@protonmail.com"
] | angleheart@protonmail.com |
39f09f27ab03d84707f3ce3322411f9764ac7f5d | 9a8a037442dbb2d24b22e00583fc5927dcb4db22 | /fulldev/src/main/java/com/example/fulldev/vo/Paging.java | b013ff81494279ba589a6b4a783edd0d8867c32b | [] | no_license | jianlongIT/fulldev | a7696e3555dc82d6f53291822a51e011a4748f9a | 92443403f57d6e8f16efac95ebf29eb65fd6fb82 | refs/heads/master | 2023-05-13T06:26:48.147538 | 2021-05-24T10:26:30 | 2021-05-24T10:26:30 | 370,312,004 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,481 | java | package com.example.fulldev.vo;
import org.springframework.data.domain.Page;
import java.util.List;
public class Paging<T> {
private Long total;//总数量
private Integer count;//当前数据条数
private Integer page;//页码
private Integer totalPage;//总共多少页
private List<T> items;//详细数据
public Paging(Page<T> pageT) {
this.initPageParameters(pageT);
this.items = pageT.getContent();
}
void initPageParameters(Page<T> pageT) {
this.total = pageT.getTotalElements();
this.count = pageT.getSize();
this.page = pageT.getNumber();
this.totalPage = pageT.getTotalPages();
}
public Paging() {
}
public Long getTotal() {
return total;
}
public void setTotal(Long total) {
this.total = total;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getTotalPage() {
return totalPage;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
public List<T> getItems() {
return items;
}
public void setItems(List<T> items) {
this.items = items;
}
}
| [
"328852120@qq.com"
] | 328852120@qq.com |
7b92c6cf83445de9297e26be0f40eab5da2d8597 | f75ec49c4a55e733ce394e843d53fd8bab3345f6 | /src/main/java/com/example/demo/OExitCodeMapper.java | 3cee1860cf00fe01258faab0e8f55f413b4f803f | [] | no_license | Comet0313/Spring_Batch | 526f42abcaf90fcace2e5f441052e25b737a3efa | c596bdface0a93551fc1cecca2a3223046e57b37 | refs/heads/master | 2023-02-10T04:36:31.197897 | 2021-01-07T06:41:38 | 2021-01-07T06:41:38 | 327,526,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,010 | java | package com.example.demo;
import java.util.HashMap;
import java.util.Map;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.launch.support.ExitCodeMapper;
import org.springframework.stereotype.Component;
/**
* <p>
*定义在作业结束时返回的ExitStatu和ExitCode(数值)之间的关联的类。
*
* <p>
*除了正常终止(0),警告终止(1)和异常终止(9)外,正常终止分支可以使用100 --119,警告终止分支可以使用120 --139。
*如果返回异常终止(9),则将停止执行整个作业网络。
*/
@Component
public class OExitCodeMapper implements ExitCodeMapper {
/** 正常终止ExitStatus */
public static final ExitStatus EXITSTATUS_SUCCESS_0 = ExitStatus.COMPLETED;
/** 正常终止ExitCode */
static int EXITCODE_SUCCESS_0 = 0;
/** 警告终止ExitStatus */
public static final ExitStatus EXITSTATUS_WARNING_1 = ExitStatus.FAILED;
/** 警告终止ExitCode */
static int EXITCODE_WARNING_1 = 1;
/** 异常终止ExitStatus */
public static final ExitStatus EXITSTATUS_FAILURE_9 = ExitStatus.UNKNOWN;
/** 异常终止ExitCode */
static int EXITCODE_FAILURE_9 = 9;
/** 例示用MyStatusExitStatus */
public static final ExitStatus EXITSTATUS_MYSTATUS_100 = new ExitStatus("MYSTATUS");
/** 例示用MyStatusExitCode */
static int EXITCODE_MYSTATUS_100 = 100;
private Map<String, Integer> mapping;
public OExitCodeMapper() {
mapping = new HashMap<>();
mapping.put(EXITSTATUS_SUCCESS_0.getExitCode(), EXITCODE_SUCCESS_0);
mapping.put(EXITSTATUS_WARNING_1.getExitCode(), EXITCODE_WARNING_1);
mapping.put(EXITSTATUS_FAILURE_9.getExitCode(), EXITCODE_FAILURE_9);
mapping.put(ExitCodeMapper.JOB_NOT_PROVIDED, EXITCODE_FAILURE_9);
mapping.put(ExitCodeMapper.NO_SUCH_JOB, EXITCODE_FAILURE_9);
mapping.put(EXITSTATUS_MYSTATUS_100.getExitCode(), EXITCODE_MYSTATUS_100);
}
@Override
public int intValue(String exitCode) {
return mapping.get(exitCode).intValue();
}
} | [
"alvin.sun.stock@gmail.com"
] | alvin.sun.stock@gmail.com |
b41d093b4c68c598f39e9ef30f5835fda5ab364f | ce29ae639da37c571cbbeac622b5d4ec67fcc58c | /fe/generated-sources/gen-java/com/cloudera/impala/thrift/TResetMetadataResponse.java | ed5221fdb762e7faca0a79b4e0a15bad78642d94 | [
"Apache-2.0"
] | permissive | dayutianfei/impala-Q | 703de4a0f6581401734b27b1f947ac1db718cb2e | 46af5ff8bf3e80999620db7bf0c9ffc93c8e5950 | refs/heads/master | 2021-01-10T11:54:57.584647 | 2016-02-17T15:39:09 | 2016-02-17T15:39:09 | 48,152,335 | 0 | 1 | null | 2016-03-09T17:02:07 | 2015-12-17T04:29:58 | C++ | UTF-8 | Java | false | true | 12,094 | java | /**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.cloudera.impala.thrift;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TResetMetadataResponse implements org.apache.thrift.TBase<TResetMetadataResponse, TResetMetadataResponse._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TResetMetadataResponse");
private static final org.apache.thrift.protocol.TField RESULT_FIELD_DESC = new org.apache.thrift.protocol.TField("result", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new TResetMetadataResponseStandardSchemeFactory());
schemes.put(TupleScheme.class, new TResetMetadataResponseTupleSchemeFactory());
}
public TCatalogUpdateResult result; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
RESULT((short)1, "result");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // RESULT
return RESULT;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.RESULT, new org.apache.thrift.meta_data.FieldMetaData("result", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCatalogUpdateResult.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TResetMetadataResponse.class, metaDataMap);
}
public TResetMetadataResponse() {
}
public TResetMetadataResponse(
TCatalogUpdateResult result)
{
this();
this.result = result;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public TResetMetadataResponse(TResetMetadataResponse other) {
if (other.isSetResult()) {
this.result = new TCatalogUpdateResult(other.result);
}
}
public TResetMetadataResponse deepCopy() {
return new TResetMetadataResponse(this);
}
@Override
public void clear() {
this.result = null;
}
public TCatalogUpdateResult getResult() {
return this.result;
}
public TResetMetadataResponse setResult(TCatalogUpdateResult result) {
this.result = result;
return this;
}
public void unsetResult() {
this.result = null;
}
/** Returns true if field result is set (has been assigned a value) and false otherwise */
public boolean isSetResult() {
return this.result != null;
}
public void setResultIsSet(boolean value) {
if (!value) {
this.result = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case RESULT:
if (value == null) {
unsetResult();
} else {
setResult((TCatalogUpdateResult)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case RESULT:
return getResult();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case RESULT:
return isSetResult();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof TResetMetadataResponse)
return this.equals((TResetMetadataResponse)that);
return false;
}
public boolean equals(TResetMetadataResponse that) {
if (that == null)
return false;
boolean this_present_result = true && this.isSetResult();
boolean that_present_result = true && that.isSetResult();
if (this_present_result || that_present_result) {
if (!(this_present_result && that_present_result))
return false;
if (!this.result.equals(that.result))
return false;
}
return true;
}
@Override
public int hashCode() {
HashCodeBuilder builder = new HashCodeBuilder();
boolean present_result = true && (isSetResult());
builder.append(present_result);
if (present_result)
builder.append(result);
return builder.toHashCode();
}
public int compareTo(TResetMetadataResponse other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
TResetMetadataResponse typedOther = (TResetMetadataResponse)other;
lastComparison = Boolean.valueOf(isSetResult()).compareTo(typedOther.isSetResult());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetResult()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, typedOther.result);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("TResetMetadataResponse(");
boolean first = true;
sb.append("result:");
if (this.result == null) {
sb.append("null");
} else {
sb.append(this.result);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (result == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'result' was not present! Struct: " + toString());
}
// check for sub-struct validity
if (result != null) {
result.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TResetMetadataResponseStandardSchemeFactory implements SchemeFactory {
public TResetMetadataResponseStandardScheme getScheme() {
return new TResetMetadataResponseStandardScheme();
}
}
private static class TResetMetadataResponseStandardScheme extends StandardScheme<TResetMetadataResponse> {
public void read(org.apache.thrift.protocol.TProtocol iprot, TResetMetadataResponse struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // RESULT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.result = new TCatalogUpdateResult();
struct.result.read(iprot);
struct.setResultIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, TResetMetadataResponse struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.result != null) {
oprot.writeFieldBegin(RESULT_FIELD_DESC);
struct.result.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TResetMetadataResponseTupleSchemeFactory implements SchemeFactory {
public TResetMetadataResponseTupleScheme getScheme() {
return new TResetMetadataResponseTupleScheme();
}
}
private static class TResetMetadataResponseTupleScheme extends TupleScheme<TResetMetadataResponse> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TResetMetadataResponse struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
struct.result.write(oprot);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TResetMetadataResponse struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.result = new TCatalogUpdateResult();
struct.result.read(iprot);
struct.setResultIsSet(true);
}
}
}
| [
"dayutianfei@gmail.com"
] | dayutianfei@gmail.com |
1f220c0637eea54835cc2c7b2d54bd9d4e25a8dd | b3f6f9560bad04edffb05748cd73112a67bbb999 | /src/test/java/org/mapuna/ch8/GoodAsyncTest.java | c6221c48f0377ca15e892c1493746ee07db3041e | [] | no_license | mapuna/RxJ | 37cc638f709a302f614fe2e334d5c70ab28d64ed | cb5fd4866e2c6069a27ddc5e5f286a2eca0e3479 | refs/heads/master | 2020-03-27T01:17:42.217964 | 2018-08-22T10:55:05 | 2018-08-22T10:55:05 | 145,696,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 698 | java | package org.mapuna.ch8;
import io.reactivex.subscribers.TestSubscriber;
import org.junit.jupiter.api.Test;
import org.mapuna.utils.Helpers;
import org.mapuna.utils.Supers;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
class GoodAsyncTest {
@Test
void theRightWayToTest() throws TimeoutException {
TestSubscriber<Supers> testSubscriber = Helpers.heroes().test();
if (!testSubscriber.awaitTerminalEvent(2, TimeUnit.SECONDS)) {
throw new TimeoutException("It timed out!");
}
testSubscriber
.assertComplete()
.assertNoErrors()
.assertValueCount(520);
}
}
| [
"mapuna@gmail.com"
] | mapuna@gmail.com |
1720631e4f8ee61e1fb3708a72894d5f9dd7b5fe | 434b8ff337d282d31e56e65ff1720d3556048b5b | /sdm/src/java/association/Limbs.java | 8c5bcd828b4f5029ed417a6139bd1f70d7367dd4 | [] | no_license | yann-gael/design-patterns | 3e75ca8d7d4e0d6339abf7ba3a97f44cec060fb8 | bb099a4b999cad0d87d6b1ee1b929ae24c950b1c | refs/heads/master | 2020-03-27T15:59:18.730263 | 2018-08-31T15:48:27 | 2018-08-31T15:48:27 | 146,752,565 | 0 | 0 | null | 2018-08-31T14:49:27 | 2018-08-30T13:18:48 | Java | UTF-8 | Java | false | false | 214 | java | package src.java.association;
public class Limbs {
int count;
Limbs(int count)
{
this.count = count;
}
void showAll()
{
System.out.println("Limbs count: " + count);
}
}
| [
"satnamsingh8404@gmail.com"
] | satnamsingh8404@gmail.com |
583f8ac8d19d3a175ef00f70ccd77d9fbc33f060 | 5b702a3077eb590e0f62c46d5ad00d3e14b0cd46 | /src/test/java/org/cs362/dominion/App_ESTest_scaffolding.java | e06cbd224e6a12b9b871aec042f79baf4f5b4bf7 | [] | no_license | bomberm/DominionFinal | 863a90fa1bddca468066b7ff8ff80ace291af708 | cde5c470a347531138e2ccb5340b42ca1b0d2f68 | refs/heads/master | 2021-01-18T21:36:06.857979 | 2017-03-19T23:02:25 | 2017-03-19T23:02:25 | 84,371,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,259 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sun Mar 12 23:58:06 GMT 2017
*/
package org.cs362.dominion;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class App_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
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.cs362.dominion.App";
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();
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
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() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("os.name", "Linux");
java.lang.System.setProperty("java.awt.headless", "true");
java.lang.System.setProperty("user.home", "/home/mrayan");
java.lang.System.setProperty("java.home", "/usr/lib/jvm/java-8-oracle/jre");
java.lang.System.setProperty("user.dir", "/home/mrayan/Documents/CS362/MavenCompile/Dominion");
java.lang.System.setProperty("java.io.tmpdir", "/tmp");
java.lang.System.setProperty("line.separator", "\n");
java.lang.System.setProperty("java.specification.version", "1.8");
java.lang.System.setProperty("awt.toolkit", "sun.awt.X11.XToolkit");
java.lang.System.setProperty("file.encoding", "UTF-8");
java.lang.System.setProperty("file.separator", "/");
java.lang.System.setProperty("java.awt.graphicsenv", "sun.awt.X11GraphicsEnvironment");
java.lang.System.setProperty("java.awt.printerjob", "sun.print.PSPrinterJob");
java.lang.System.setProperty("java.class.path", "/tmp/EvoSuite_pathingJar6238295734786678373.jar");
java.lang.System.setProperty("java.class.version", "52.0");
java.lang.System.setProperty("java.endorsed.dirs", "/usr/lib/jvm/java-8-oracle/jre/lib/endorsed");
java.lang.System.setProperty("java.ext.dirs", "/usr/lib/jvm/java-8-oracle/jre/lib/ext:/usr/java/packages/lib/ext");
java.lang.System.setProperty("java.library.path", "lib");
java.lang.System.setProperty("java.runtime.name", "Java(TM) SE Runtime Environment");
java.lang.System.setProperty("java.runtime.version", "1.8.0_121-b13");
java.lang.System.setProperty("java.specification.name", "Java Platform API Specification");
java.lang.System.setProperty("java.specification.vendor", "Oracle Corporation");
java.lang.System.setProperty("java.vendor", "Oracle Corporation");
java.lang.System.setProperty("java.vendor.url", "http://java.oracle.com/");
java.lang.System.setProperty("java.version", "1.8.0_121");
java.lang.System.setProperty("java.vm.info", "mixed mode");
java.lang.System.setProperty("java.vm.name", "Java HotSpot(TM) 64-Bit Server VM");
java.lang.System.setProperty("java.vm.specification.name", "Java Virtual Machine Specification");
java.lang.System.setProperty("java.vm.specification.vendor", "Oracle Corporation");
java.lang.System.setProperty("java.vm.specification.version", "1.8");
java.lang.System.setProperty("java.vm.vendor", "Oracle Corporation");
java.lang.System.setProperty("java.vm.version", "25.121-b13");
java.lang.System.setProperty("os.arch", "amd64");
java.lang.System.setProperty("os.version", "4.4.0-64-generic");
java.lang.System.setProperty("path.separator", ":");
java.lang.System.setProperty("user.country", "US");
java.lang.System.setProperty("user.language", "en");
java.lang.System.setProperty("user.name", "mrayan");
java.lang.System.setProperty("user.timezone", "America/Los_Angeles");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(App_ESTest_scaffolding.class.getClassLoader() ,
"org.cs362.dominion.App"
);
}
private static void resetClasses() {
}
}
| [
"bomberm@oregonstate.edu"
] | bomberm@oregonstate.edu |
a722264472fd96e6decf19c023e806da06e9c9d6 | 98b1ecdd525bc8b76e59b44624c2b3d1aa6ace93 | /springboot01/src/main/java/com/cyx/anno/config/JavaConfigB.java | ab43d56124b2ad90ddf1b204a510cd93e9ff0b32 | [] | no_license | jy02426305/springBootTest | ea97299d08def09e23abf6ad295ef8171e7335e2 | 36636aa1a70481d50ef6df6865af23fdc9b1a169 | refs/heads/master | 2022-07-27T13:18:34.077197 | 2022-05-24T02:12:02 | 2022-05-24T02:12:02 | 178,917,510 | 2 | 0 | null | 2022-03-31T18:47:31 | 2019-04-01T17:54:36 | HTML | UTF-8 | Java | false | false | 322 | java | package com.cyx.anno.config;
import com.cyx.anno.impl.Buick;
import com.cyx.anno.Car;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaConfigB {
@Bean("buick")
public Car Buick(){
return new Buick();
}
}
| [
"88042711@qq.com"
] | 88042711@qq.com |
41d938036b7b29d444b2745eecaea37c44e146a0 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/mt/prnpap/dm/MT_PRNPAP_3304_LDM.java | 4daa94ee9d08a9938c18bb9dfe3b1f3b3299f43b | [] | 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 | 4,887 | java | /***************************************************************************************************
* 파일명 : .java
* 기능 : 독자우대-구독신청
* 작성일자 : 2007-05-22
* 작성자 : 김대섭
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.mt.prnpap.dm;
import java.sql.*;
import oracle.jdbc.driver.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.mt.prnpap.ds.*;
import chosun.ciis.mt.prnpap.rec.*;
/**
*
*/
public class MT_PRNPAP_3304_LDM extends somo.framework.db.BaseDM implements java.io.Serializable{
public String cmpy_cd;
public String issu_dt;
public String fac_clsf;
public MT_PRNPAP_3304_LDM(){}
public MT_PRNPAP_3304_LDM(String cmpy_cd, String issu_dt, String fac_clsf){
this.cmpy_cd = cmpy_cd;
this.issu_dt = issu_dt;
this.fac_clsf = fac_clsf;
}
public void setCmpy_cd(String cmpy_cd){
this.cmpy_cd = cmpy_cd;
}
public void setIssu_dt(String issu_dt){
this.issu_dt = issu_dt;
}
public void setFac_clsf(String fac_clsf){
this.fac_clsf = fac_clsf;
}
public String getCmpy_cd(){
return this.cmpy_cd;
}
public String getIssu_dt(){
return this.issu_dt;
}
public String getFac_clsf(){
return this.fac_clsf;
}
public String getSQL(){
return "{ call MISMAT.SP_MT_PRNPAP_3304_L(? ,? ,? ,? ,? ,? ,?) }";
}
public void setParams(CallableStatement cstmt, BaseDM bdm) throws SQLException{
MT_PRNPAP_3304_LDM dm = (MT_PRNPAP_3304_LDM)bdm;
cstmt.registerOutParameter(1, Types.VARCHAR);
cstmt.registerOutParameter(2, Types.VARCHAR);
cstmt.setString(3, dm.cmpy_cd);
cstmt.setString(4, dm.issu_dt);
cstmt.setString(5, dm.fac_clsf);
cstmt.registerOutParameter(6, OracleTypes.CURSOR);
cstmt.registerOutParameter(7, OracleTypes.CURSOR);
}
public BaseDataSet createDataSetObject(){
return new chosun.ciis.mt.prnpap.ds.MT_PRNPAP_3304_LDataSet();
}
public void print(){
System.out.println("SQL = " + this.getSQL());
System.out.println("cmpy_cd = [" + getCmpy_cd() + "]");
System.out.println("issu_dt = [" + getIssu_dt() + "]");
System.out.println("fac_clsf = [" + getFac_clsf() + "]");
}
}
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리 및 결과확인 검사시 사용하십시오.
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 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 fac_clsf = req.getParameter("fac_clsf");
if( fac_clsf == null){
System.out.println(this.toString+" : fac_clsf is null" );
}else{
System.out.println(this.toString+" : fac_clsf is "+fac_clsf );
}
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.checkString(req.getParameter("cmpy_cd"));
String issu_dt = Util.checkString(req.getParameter("issu_dt"));
String fac_clsf = Util.checkString(req.getParameter("fac_clsf"));
----------------------------------------------------------------------------------------------------*//*----------------------------------------------------------------------------------------------------
Web Tier에서 한글처리와 동시에 req.getParameter() 처리시 사용하십시오.
String cmpy_cd = Util.Uni2Ksc(Util.checkString(req.getParameter("cmpy_cd")));
String issu_dt = Util.Uni2Ksc(Util.checkString(req.getParameter("issu_dt")));
String fac_clsf = Util.Uni2Ksc(Util.checkString(req.getParameter("fac_clsf")));
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DM 파일의 변수를 설정시 사용하십시오.
dm.setCmpy_cd(cmpy_cd);
dm.setIssu_dt(issu_dt);
dm.setFac_clsf(fac_clsf);
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Wed Mar 08 17:53:16 KST 2017 */ | [
"DLCOM000@172.16.30.11"
] | DLCOM000@172.16.30.11 |
f0c8047b802ed2e8792552139b6408a574df5129 | 1e6d00fb0b454ccf690e571a0bfda456c21329f7 | /src/main/java/com/reimia/xmlResolve2/XmlUtil.java | d6970d21e3f232c9c6834177520d0d2876cb5296 | [] | no_license | Reimia/mdzz | b24bcc6c072aacf964674a14d3bad6bb97d37bf4 | 9932235b2719ee073e327e0d15f813c5a18e6630 | refs/heads/master | 2022-06-30T10:59:52.848579 | 2021-04-20T02:57:27 | 2021-04-20T02:57:27 | 216,738,268 | 0 | 0 | null | 2022-06-17T02:47:09 | 2019-10-22T06:23:51 | Java | UTF-8 | Java | false | false | 7,267 | java | /**
* XmlUtil.java
* <p>
* 功 能:XML工具类
* 类 名:XmlUtil
* <p>
* version date author content
* ───────────────────────────────────────
* V1.0.0 2016年1月11日 hqhan creation
* <p>
* Copyright (c) 2016 ZJFT corporation All Rights Reserved.
*/
package com.reimia.xmlResolve2;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
/**
* XML工具类
*
* @author hqhan
* @time 2016年1月11日下午1:42:34
*/
public class XmlUtil {
/**
* xml文件编码
**/
public static final String ENCODING = "UTF-8";
/**
* 创建xml内存树
*
* @return xml内存树
* @author hqhan
* @time 2016年1月11日下午1:46:16
*/
public static Document createEmptyDocument() {
return DocumentHelper.createDocument();
}
/**
* xml文件 → xml内存树
*
* @param filePath
* @return xml内存树
* @throws Exception
* @author hqhan
* @time 2016年1月11日下午1:46:49
*/
public static Document createDocumentFromFile(String filePath) throws Exception {
if (filePath == null) {
throw new Exception("parameter of filePath is null");
}
SAXReader saxReader = new SAXReader();
return saxReader.read(new File(filePath));
}
/**
* xml文本 → xml内存树
*
* @param xmlText
* @return xml内存树
* @throws Exception
* @author hqhan
* @time 2016年1月11日下午1:47:16
*/
public static Document createDocumentFromText(String xmlText) throws Exception {
if (xmlText == null) {
throw new Exception("parameter of xmlText is null");
}
return DocumentHelper.parseText(xmlText);
}
/**
* xml内存树 → xml文件
*
* @param document xml内存树
* @param filePath 文件路径
* @throws Exception
*/
public static void saveDocumentToFile(Document document, String filePath) throws Exception {
// create file if no such one
File file = new File(filePath);
if (!file.exists()) {
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
}
file.createNewFile();
}
// save document
XMLWriter xmlWriter = null;
try {
OutputFormat format = OutputFormat.createPrettyPrint();
format.setEncoding(XmlUtil.ENCODING);
xmlWriter = new XMLWriter(new FileOutputStream(filePath), format);
document.normalize();
xmlWriter.write(document);
} finally {
try {
if (xmlWriter != null) {
xmlWriter.close();
xmlWriter = null;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
/**
* 删除指定元素所有的子元素
*
* @param element 指定元素
*/
@SuppressWarnings("unchecked")
public static void removeChildElements(Element element) {
List<Element> childElements = element.elements();
int childElementsSize = childElements.size();
for (int i = 0; i < childElementsSize; i++) {
element.remove(childElements.get(i));
}
}
/**
* 删除指定元素所有指定名称的子元素
*
* @param element 指定元素
* @param childElementName 指定需要删除的子元素的名称
*/
@SuppressWarnings("unchecked")
public static void removeChildElements(Element element, String childElementName) {
List<Element> childElements = element.elements(childElementName);
int childElementsSize = childElements.size();
for (int i = 0; i < childElementsSize; i++) {
element.remove(childElements.get(i));
}
}
/**
* 给指定元素设置属性(属性名和属性值均非null)
*
* @param element 指定元素
* @param attributeName 属性名
* @param attributeValue 属性值
*/
@SuppressWarnings("unchecked")
public static void setAttribute(Element element, String attributeName, String attributeValue) {
// do nothing if name or value of element is null
if (attributeName == null || attributeValue == null) {
return;
}
// if element already has attribute with name <code>attributeName</code>,
// set its value with <code>attributeValue</code>
List<Attribute> attributes = element.attributes();
for (Attribute attribute : attributes) {
if (attribute.getName().equals(attributeName)) {
attribute.setValue(attributeValue);
return;
}
}
// element doesn't have any attribute with name <code>attributeName</code>, so add one
element.addAttribute(attributeName, attributeValue);
}
/**
* 根据xPath获取元素列表
*
* @param document
* @param xPath
* @return
*/
@SuppressWarnings("unchecked")
public static List<Element> selectElements(Document document, String xPath) {
return document.selectNodes(xPath);
}
/**
* 根据xPath获取单一元素
*
* @param document
* @param xPath
* @return
*/
public static Element selectSingleElement(Document document, String xPath) {
return (Element) document.selectSingleNode(xPath);
}
/**
* 获取给定元素的所有子元素
*
* @param element 给定元素
* @return
*/
@SuppressWarnings("unchecked")
public static List<Element> selectChildElements(Element element) {
return element.elements();
}
/**
* 获取给定元素的所有指定名称的子元素
*
* @param element 给定元素
* @param childElementName 指定的子元素名称
* @return
*/
@SuppressWarnings("unchecked")
public static List<Element> selectChildElements(Element element, String childElementName) {
return element.elements(childElementName);
}
/**
* 获取元素所有的属性值列表
*
* @param element
* @return
* @author hqhan
* @time 2016年1月11日下午1:48:00
*/
@SuppressWarnings("unchecked")
public static List<Attribute> getAttributesOfElement(Element element) {
return element.attributes();
}
/**
* 根据属性名获取给定元素的属性值
*
* @param element 给定元素
* @param attributeName 属性名
* @return 属性不存在或属性值为空:空字符串; 否则:属性值
*/
public static String getAttrValOfElement(Element element, String attributeName) {
String attributeValue = element.attributeValue(attributeName);
return attributeValue == null ? "" : attributeValue;
}
}
| [
"zhangsiyu@zjft.com"
] | zhangsiyu@zjft.com |
3e66db0956af79e655fd4856f072f4b9190203b2 | bed08818b2f76d2822cd1cab8c32707479d9eb9c | /src/java/com/siniak/finaltask/command/CreateSearchedPersonCommand.java | 737e0607ce73c78c7afddbfb49aa51589ed6d0f0 | [] | no_license | nepp503/FinalTask | fb0d04f9965b4a5c7eb56b1bff8d349ec36d1923 | 51e01f69295eeb815df9517cab9cb2779d717a4a | refs/heads/master | 2020-05-23T09:33:06.239876 | 2019-05-30T22:20:16 | 2019-05-30T22:20:16 | 186,707,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,971 | java | package com.siniak.finaltask.command;
import com.siniak.finaltask.controller.Router;
import com.siniak.finaltask.entity.SearchedPerson;
import com.siniak.finaltask.exception.ServiceException;
import com.siniak.finaltask.service.LoadImageService;
import com.siniak.finaltask.service.SearchedPersonService;
import com.siniak.finaltask.controller.SessionRequestContent;
import org.apache.logging.log4j.Level;
import static com.siniak.finaltask.util.AttributeParameterPathConstant.*;
public class CreateSearchedPersonCommand implements Command {
@Override
public Router execute(SessionRequestContent content) {
SearchedPersonService service = new SearchedPersonService();
Router router = new Router();
try {
SearchedPerson person = service.create(createSearchedPerson(content));
content.setSessionAttribute(SEARCHED_PERSON_ATTR, person);
router.setRedirect();
router.setPage(SEARCHED_PERSON_PAGE);
} catch (ServiceException e) {
logger.log(Level.ERROR, e);
content.setRequestAttribute(ERROR_MESSAGE_ATTR, e);
router.setPage(ERROR_PAGE);
}finally {
service.finishService();
}
return router;
}
private SearchedPerson createSearchedPerson(SessionRequestContent content) throws ServiceException {
SearchedPerson person = new SearchedPerson();
LoadImageService loadService = new LoadImageService();
person.setFirstName(content.getParameter(FIRSTNAME_PARAMETR));
person.setLastName(content.getParameter(LASTNAME_PARAMETR));
person.setBirthPlace(content.getParameter(BIRTH_PLACE_PARAMETR));
person.setSearchArea(content.getParameter(SEARCH_AREA_PARAMETR));
person.setSpecialSigns(content.getParameter(SPECIAl_SIGNS_PARAMETR));
person.setPhoto(loadService.loadImage(content.getParts(), content.getContextPath()));
return person;
}
}
| [
"nepp503@gmail.com"
] | nepp503@gmail.com |
e58ffe282b1f06fde9d8127cc08755c4bf97d476 | 75f064295452f3d2e2ef22b6af39072d828aa59b | /src/lab2/exread.java | ce0a8ab09a8b8ded0e80cf92edfefa9f43fcd33b | [] | no_license | kasineeboontawe/s361211760023 | aa8c7bbf81f0de160e4a1d73b2a0ffaf64b4603c | b52a1b971710f8c04b83bea66467625bef5c4bfa | refs/heads/master | 2020-03-21T15:00:15.660765 | 2018-10-16T05:08:27 | 2018-10-16T05:08:27 | 138,688,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | package lab2;
import java.io.IOException;
public class exread {
public static void main(String[] args)throws IOException {
// char c ;
// System.out.println(2);
// c = (char) System.in.read();
// System.out.println(3+c);
System.out.println("How own are you? : ");
int age = 0;
age =(int)System.in.read();
System.out.println("your are "+age+" ywars old");
}
}
| [
"boontawekasinee@gmail.com"
] | boontawekasinee@gmail.com |
5c0de57e4c409641b12f040f74d41d3fed7affc0 | 57e3b78af3b11f21443ec9b9fd78d2e890439383 | /sorting/priorityqueue/MaxPQ.java | 8062ee26b1f621dd96c5022c136cddba6acbe29c | [] | no_license | Pythephant/algs4 | dd9890829f41f26fc5f62b621403e1c10ea65e52 | 0c8bbed07339df2c49cbd87bb7ce44e0eae6c1c1 | refs/heads/master | 2020-03-11T08:27:11.548238 | 2018-06-19T08:05:04 | 2018-06-19T08:05:04 | 129,884,130 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,533 | java | package sorting.priorityqueue;
import java.util.Arrays;
import edu.princeton.cs.algs4.StdOut;
import edu.princeton.cs.algs4.StdRandom;
import sorting.elementarysorts.Example;
public class MaxPQ<Key extends Comparable<Key>> {
private Key[] pq;
private int N;
public MaxPQ(int maxN) {
N = 0;
pq = (Key[]) new Comparable[maxN + 1];
}
public int size() {
return N;
}
public boolean isEmpty() {
return N == 0;
}
public void insert(Key key) {
ensureCapability();
N++;
pq[N] = key;
swim(N);
}
public Key delMax() {
Key max = pq[1];
Example.exch(pq, 1, N);
pq[N] = null;
N--;
sink(1);
return max;
}
public void swim(int k) {
while (k > 1 && Example.less(pq[k / 2], pq[k])) {
Example.exch(pq, k / 2, k);
k = k / 2;
}
}
public void sink(int k) {
while (2 * k <= N) {
int j = 2 * k;
if (j < N && Example.less(pq[j], pq[j + 1]))
j++;
if (!Example.less(pq[k], pq[j]))
break;
Example.exch(pq, k, j);
k = j;
}
}
private void ensureCapability() {
if (N >= pq.length - 1) {
Key[] temp = (Key[]) new Comparable[2 * N + 1];
for (int i = 0; i < pq.length; i++) {
temp[i] = pq[i];
}
pq = temp;
}
}
public static void main(String[] args) {
int n = 10;
Integer[] arr = new Integer[n];
MaxPQ pq = new MaxPQ<Integer>(n);
for(int i=0;i<arr.length;i++){
arr[i] = StdRandom.uniform(n);
pq.insert(arr[i]);
}
StdOut.println(Arrays.toString(arr));
while(pq.isEmpty()==false){
StdOut.print(pq.delMax()+" ");
}
}
}
| [
"jason_wujiakun@yeah.net"
] | jason_wujiakun@yeah.net |
be6293b9901ae1a24d11ae2a07aef31e2ff63cff | 4055c4766dc397dd93cdcec249f944d8ba6e5d59 | /inventory/src/test/java/com/ecommerceapp/inventory/unit/repository/InventoryRepositoryTest.java | 0ce1f32f412ce12292a2e8de86c6ea83a44f2ad5 | [
"Apache-2.0"
] | permissive | Gilgalard/EcommerceApp | 84228dbd1599a83f5b1c1606758c036f59269686 | 9b825fbc32f13021121f5919dec2f11d52b7b881 | refs/heads/master | 2023-03-03T07:31:20.820752 | 2021-01-15T13:08:38 | 2021-01-15T13:08:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,828 | java | package com.ecommerceapp.inventory.unit.repository;
import com.ecommerceapp.inventory.model.Category;
import com.ecommerceapp.inventory.model.Product;
import com.ecommerceapp.inventory.repository.InventoryRepository;
import java.util.List;
import java.util.Optional;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
import org.springframework.data.mongodb.core.MongoTemplate;
@DataMongoTest
@ExtendWith(MongoSpringExtension.class)
class InventoryRepositoryTest {
@Autowired private MongoTemplate mongoTemplate;
@Autowired private InventoryRepository repository;
public MongoTemplate getMongoTemplate() {
return mongoTemplate;
}
@Test
@DisplayName("Save product - success")
@MongoDataFile(value = "sample.json", classType = Product.class, collectionName = "Product")
void testSaveProductSuccess() {
// Create a test Product
String productName = "Dark Souls 3";
Integer quantity = 20;
Category category = Category.VIDEOGAMES;
Product productToBeInserted = new Product(productName, quantity, category);
// Persist the product to MongoDB
Product savedProduct = repository.save(productToBeInserted);
// Retrieve the product
Optional<Product> loadedProduct = repository.findById(savedProduct.getId());
// Validations
Assertions.assertTrue(loadedProduct.isPresent());
loadedProduct.ifPresent(
product -> {
Assertions.assertEquals(productName, product.getName());
Assertions.assertEquals(
quantity, product.getQuantity(), "Product quantity should be " + quantity);
Assertions.assertEquals(
category, product.getCategory(), "Product category should be " + category.toString());
});
}
@Test
@DisplayName("Find All Products - Success")
@MongoDataFile(value = "sample.json", classType = Product.class, collectionName = "Product")
void testFindAllProductsSuccess() {
List<Product> products = repository.findAll();
products.forEach(System.out::println);
Assertions.assertEquals(2, products.size(), "Should be two products in the database");
}
@Test
@DisplayName("Find Product - Success")
@MongoDataFile(value = "sample.json", classType = Product.class, collectionName = "Products")
void testFindProductSuccess() {
String productName = "Dark Souls 3";
Integer quantity = 20;
Category category = Category.VIDEOGAMES;
Product newProduct = new Product(productName, quantity, category);
// Persist the product to MongoDB
Product savedProduct = repository.save(newProduct);
Optional<Product> returnedProduct = repository.findById(newProduct.getId());
Assertions.assertTrue(returnedProduct.isPresent());
returnedProduct.ifPresent(
p -> {
Assertions.assertEquals(p.getName(), newProduct.getName());
Assertions.assertEquals(p.getQuantity(), newProduct.getQuantity());
Assertions.assertEquals(p.getCategory(), newProduct.getCategory());
});
}
@Test
@DisplayName("Find Product - Not Found")
@MongoDataFile(value = "sample.json", classType = Product.class, collectionName = "Product")
void testFindProductNotFound() {
Optional<Product> product = repository.findById("99");
Assertions.assertFalse(product.isPresent());
}
@Test
@DisplayName("Test Update Success")
@MongoDataFile(value = "sample.json", classType = Product.class, collectionName = "Product")
void testUpdateSuccess() {
// Retrieve the first product
Optional<Product> product = Optional.ofNullable(repository.findAll().get(0));
Assertions.assertTrue(product.isPresent(), "Product should be present");
// Add an entry to the review and save
Product productToUpdate = product.get();
productToUpdate.setName("Samsung TV 42º Led");
repository.save(productToUpdate);
// Retrieve the product again and validate it
Optional<Product> updatedProduct = repository.findById(product.get().getId());
Assertions.assertTrue(updatedProduct.isPresent(), "Product should be present");
Assertions.assertEquals(
"Samsung TV 42º Led", updatedProduct.get().getName(), "The product name should be updated");
}
@Test
@DisplayName("Test Delete Success")
@MongoDataFile(value = "sample.json", classType = Product.class, collectionName = "Product")
void testDeleteSuccess() {
repository.deleteById("1");
// Confirm that it is no longer in the database
Optional<Product> returnedProduct = repository.findById("1");
Assertions.assertFalse(returnedProduct.isPresent());
}
}
| [
"fernandoadt1@gmail.com"
] | fernandoadt1@gmail.com |
25b270f1091c31a043a5352729e24bf04b8b5937 | c5866513c1f332d0df6ac10b3cb0e5a4b8183093 | /src/main/java/leetcode1_100/AddTwoNumbers.java | 5dab1f0024e98eada1325525f924d24cc413e14a | [] | no_license | livolleyball/Leetcode | c62f7a917a05f11ebac4dc282e28b59a852a9a83 | 6584cc3d510302bf39f276c57ada18f6b605b915 | refs/heads/master | 2020-03-29T20:10:34.642708 | 2019-01-27T10:52:32 | 2019-01-27T10:52:32 | 150,299,350 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,219 | java | package leetcode1_100;
public class AddTwoNumbers {
/*
给定两个非空链表来表示两个非负整数。位数按照逆序方式存储,它们的每个节点只存储单个数字。将两数相加返回一个新的链表。
你可以假设除了数字 0 之外,这两个数字都不会以零开头。
*/
public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
ListNode dummyHead = new ListNode(0);
ListNode p = l1, q = l2,
curr = dummyHead;
int carry = 0;//进位
//
while (p != null || q != null) {
int x = (p != null) ? p.val : 0;
int y = (q != null) ? q.val : 0;
int sum = x + y + carry;
carry = sum / 10;
System.out.println(curr);
curr.next = new ListNode(sum % 10);
curr = curr.next;
if (p != null) p = p.next;
if (q != null) q = q.next;
}
if (carry > 0) {
curr.next = new ListNode(carry);
}
return dummyHead.next;
}
public static void main(String[] args){
}
}
class ListNode {
int val;
ListNode next;
public ListNode(int x) {
val = x;
}
}
| [
"lihm@lihmdeMacBook-Pro.local"
] | lihm@lihmdeMacBook-Pro.local |
47381db89f7e8de5c912b573e04e9cf10bee7f1d | 76ee3cba60425c28cd90ad70f72ca72ef03e6e8b | /library-consumer/src/main/java/com/libraryevent/config/LibraryEventConsumerConfig.java | 8174d6f53ab4f15c95814f966be3d8c8c7bd31df | [
"Apache-2.0"
] | permissive | vsinghofficial/spring-kafka | ac99d4032a5ade669f7d4004fc4a92b2b65264b8 | 45fe975e1bf727c120ec4c5ce39e958bb4d0403f | refs/heads/main | 2023-03-12T01:51:46.207003 | 2021-03-02T14:00:40 | 2021-03-02T14:00:40 | 343,785,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,801 | java | package com.libraryevent.config;
import java.util.HashMap;
import java.util.Map;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.kafka.ConcurrentKafkaListenerContainerFactoryConfigurer;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.dao.RecoverableDataAccessException;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;
import org.springframework.retry.RetryPolicy;
import org.springframework.retry.backoff.FixedBackOffPolicy;
import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.retry.support.RetryTemplate;
import com.libraryevent.service.LibraryEventService;
import lombok.extern.slf4j.Slf4j;
@Configuration
@EnableKafka
@Slf4j
public class LibraryEventConsumerConfig {
@Autowired
private KafkaProperties properties;
@Autowired
private LibraryEventService libraryEventService;
@Bean("kafkaListenerContainerFactory")
ConcurrentKafkaListenerContainerFactory<?, ?> kafkaListenerContainerFactory(
ConcurrentKafkaListenerContainerFactoryConfigurer configurer,
ObjectProvider<ConsumerFactory<Object, Object>> kafkaConsumerFactory) {
ConcurrentKafkaListenerContainerFactory<Object, Object> factory = new ConcurrentKafkaListenerContainerFactory<>();
configurer.configure(factory, kafkaConsumerFactory
.getIfAvailable(() -> new DefaultKafkaConsumerFactory<>(this.properties.buildConsumerProperties())));
factory.setConcurrency(3);
// factory.getContainerProperties().setAckMode(AckMode.MANUAL);
factory.setErrorHandler((thrownException, data) -> {
log.info("Exception is consumer config {} and the record is {}", thrownException.getMessage(), data);
// persist
});
factory.setRecoveryCallback(context -> {
if (context.getLastThrowable().getCause() instanceof RecoverableDataAccessException) {
// invoke recovery logic
log.info("Inside recover section logic");
// Arrays.asList(context.attributeNames()).stream().forEach(attribute -> {
// System.out.println("Name : "+attribute +" , value : "+ context.getAttribute(attribute));
// });
@SuppressWarnings("unchecked")
ConsumerRecord<Integer, String> consumerRecord = (ConsumerRecord<Integer, String>) context
.getAttribute("record");
libraryEventService.handleRecover(consumerRecord);
} else {
log.info("inside non recoverable logic");
throw new RuntimeException(context.getLastThrowable().getMessage());
}
return null;
});
factory.setRetryTemplate(retryTemplate());
return factory;
}
@Bean
public RetryTemplate retryTemplate() {
FixedBackOffPolicy backOffPolicy = new FixedBackOffPolicy();
backOffPolicy.setBackOffPeriod(1000);
RetryTemplate retryTemplate = new RetryTemplate();
retryTemplate.setRetryPolicy(retryPolicy());
retryTemplate.setBackOffPolicy(backOffPolicy);
return retryTemplate;
}
@Bean
public RetryPolicy retryPolicy() {
// SimpleRetryPolicy policy = new SimpleRetryPolicy();
// policy.setMaxAttempts(3);
Map<Class<? extends Throwable>, Boolean> retryableExceptions = new HashMap<>();
retryableExceptions.put(IllegalArgumentException.class, false);
retryableExceptions.put(RecoverableDataAccessException.class, true);
SimpleRetryPolicy policy = new SimpleRetryPolicy(3, retryableExceptions, true);
return policy;
}
}
| [
"singhvimal56@gmail.com"
] | singhvimal56@gmail.com |
9a66fbcf5b95d6e6da13321283f68076854d3359 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/33/33_c69311043fa5aa32dcb37266edc1fcdca4d84cf9/ComplexPolynomialTest/33_c69311043fa5aa32dcb37266edc1fcdca4d84cf9_ComplexPolynomialTest_t.java | 7bf458f2fd9bafc938b8a48822a13738bcd8cb4f | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 15,197 | java | package com.codemelon.polynomial;
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.LinkedList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import com.codemelon.math.Complex;
/**
* @author Marshall Farrier
* @my.created Sep 17, 2013
* @my.edited Sep 17, 2013
*/
public class ComplexPolynomialTest {
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
/**
* Test method for {@link com.codemelon.polynomial.ComplexPolynomial#ComplexPolynomial(java.util.List)}.
*/
@Test
public void testComplexPolynomial() {
LinkedList<Complex> input = new LinkedList<Complex>();
input.add(Complex.ZERO);
input.add(Complex.ONE);
input.add(Complex.ZERO);
ComplexPolynomial p = new ComplexPolynomial(input);
assertEquals("Polynomial has degree 1", p.degree(), 1);
assertTrue("coefficient 0 is 0.0", p.coefficient(0).equalWithinDelta(Complex.ZERO));
assertTrue("coefficient 1 is 1.0", p.coefficient(1).equalWithinDelta(Complex.ONE));
assertTrue("coefficient 20 is 0.0", p.coefficient(20).equalWithinDelta(Complex.ZERO));
}
/**
* Test method for {@link com.codemelon.polynomial.ComplexPolynomial#fromDegree(int)}.
*/
@Test
public void testFromDegree() {
ComplexPolynomial p1 = ComplexPolynomial.fromDegree(-1);
ComplexPolynomial p2 = ComplexPolynomial.fromDegree(0);
ComplexPolynomial p3 = ComplexPolynomial.fromDegree(8);
assertEquals("Zero polynomial has correct degree", p1.degree(), -1);
assertEquals("Constant polynomial has correct degree", p2.degree(), 0);
assertEquals("Larger polynomial has correct degree", p3.degree(), 8);
assertTrue("Zero polynomial has constant coefficient 0.0",
p1.coefficient(0).equalWithinDelta(Complex.ZERO));
assertTrue("Constant polynomial has constant coefficient 1.0",
p2.coefficient(0).equalWithinDelta(Complex.ONE));
assertTrue("Larger polynomial has constant coefficient 1.0",
p3.coefficient(0).equalWithinDelta(Complex.ONE));
assertTrue("Zero polynomial has 0.0 as coefficient 8",
p1.coefficient(8).equalWithinDelta(Complex.ZERO));
assertTrue("Constant polynomial has 0.0 as coefficient 8",
p2.coefficient(8).equalWithinDelta(Complex.ZERO));
assertTrue("Larger polynomial has 1.0 as coefficient 8",
p3.coefficient(8).equalWithinDelta(Complex.ONE));
assertTrue("Larger polynomial has 0.0 as coefficient 8",
p3.coefficient(9).equalWithinDelta(Complex.ZERO));
}
/**
* Test method for {@link com.codemelon.polynomial.ComplexPolynomial#plus(com.codemelon.polynomial.ComplexPolynomial)}.
*/
@Test
public void testPlus() {
Complex[] coefficients = { new Complex(2.0, 2.0), new Complex(1.0, 1.0) };
ComplexPolynomial p1 = new ComplexPolynomial(Arrays.asList(coefficients));
ComplexPolynomial p2 = ComplexPolynomial.fromDegree(2);
ComplexPolynomial result = p1.plus(p2);
Complex[] resultCoefficients = { new Complex(3.0, 2.0), new Complex(2.0, 1.0),
Complex.ONE };
assertEquals("p1 plus p2 correct degree", result.degree(), 2);
assertTrue("p1 plus p2 correct constant coefficient",
result.coefficient(0).equalWithinDelta(resultCoefficients[0]));
assertTrue("p1 plus p2 correct coefficient 1",
result.coefficient(1).equalWithinDelta(resultCoefficients[1]));
assertTrue("p1 plus p2 correct coefficient 2",
result.coefficient(2).equalWithinDelta(resultCoefficients[2]));
assertTrue("p1 plus p2 correct coefficient 3",
result.coefficient(3).equalWithinDelta(Complex.ZERO));
result = p2.plus(p1);
assertTrue("p2 plus p1 correct constant coefficient",
result.coefficient(0).equalWithinDelta(resultCoefficients[0]));
assertTrue("p2 plus p1 correct coefficient 1",
result.coefficient(1).equalWithinDelta(resultCoefficients[1]));
assertTrue("p2 plus p1 correct coefficient 2",
result.coefficient(2).equalWithinDelta(resultCoefficients[2]));
assertTrue("p2 plus p1 correct coefficient 3",
result.coefficient(3).equalWithinDelta(Complex.ZERO));
}
/**
* Test method for {@link com.codemelon.polynomial.ComplexPolynomial#minus(com.codemelon.polynomial.ComplexPolynomial)}.
*/
@Test
public void testMinus() {
Complex[] coefficients = { new Complex(2.0, 2.0), new Complex(1.0, 1.0) };
ComplexPolynomial p1 = new ComplexPolynomial(Arrays.asList(coefficients));
ComplexPolynomial p2 = ComplexPolynomial.fromDegree(2);
ComplexPolynomial result = p1.minus(p2);
Complex[] resultCoefficients = { new Complex(1.0, 2.0), new Complex(0.0, 1.0),
new Complex(-1.0, 0.0), new Complex(-1.0, -2.0), new Complex(0.0, -1.0),
Complex.ONE};
assertEquals("p1 plus p2 correct degree", result.degree(), 2);
assertTrue("p1 plus p2 correct constant coefficient",
result.coefficient(0).equalWithinDelta(resultCoefficients[0]));
assertTrue("p1 plus p2 correct coefficient 1",
result.coefficient(1).equalWithinDelta(resultCoefficients[1]));
assertTrue("p1 plus p2 correct coefficient 2",
result.coefficient(2).equalWithinDelta(resultCoefficients[2]));
assertTrue("p1 plus p2 correct coefficient 3",
result.coefficient(3).equalWithinDelta(Complex.ZERO));
result = p2.minus(p1);
assertTrue("p2 plus p1 correct constant coefficient",
result.coefficient(0).equalWithinDelta(resultCoefficients[3]));
assertTrue("p2 plus p1 correct coefficient 1",
result.coefficient(1).equalWithinDelta(resultCoefficients[4]));
assertTrue("p2 plus p1 correct coefficient 2",
result.coefficient(2).equalWithinDelta(resultCoefficients[5]));
assertTrue("p2 plus p1 correct coefficient 3",
result.coefficient(3).equalWithinDelta(Complex.ZERO));
}
/**
* Test method for {@link com.codemelon.polynomial.ComplexPolynomial#times(com.codemelon.polynomial.ComplexPolynomial)}.
*/
@Test
public void testTimesSchool() {
// real coefficients
Complex[] p1Coefficients = { new Complex(3.0, 0.0), new Complex(2.0, 0.0),
Complex.ONE };
Complex[] p2Coefficients = { new Complex(2.0, 0.0), Complex.ONE };
ComplexPolynomial p1 = new ComplexPolynomial(Arrays.asList(p1Coefficients));
ComplexPolynomial p2 = new ComplexPolynomial(Arrays.asList(p2Coefficients));
ComplexPolynomial result = p1.times(p2);
assertTrue("p1 times p2 correct coefficient 0", result.coefficient(0).equalWithinDelta(new Complex(6.0, 0.0)));
assertTrue("p1 times p2 correct coefficient 1", result.coefficient(1).equalWithinDelta(new Complex(7.0, 0.0)));
assertTrue("p1 times p2 correct coefficient 2", result.coefficient(2).equalWithinDelta(new Complex(4.0, 0.0)));
assertTrue("p1 times p2 correct coefficient 3", result.coefficient(3).equalWithinDelta(new Complex(1.0, 0.0)));
assertTrue("p1 times p2 correct coefficient 4", result.coefficient(4).equalWithinDelta(new Complex(0.0, 0.0)));
result = p2.times(p1);
assertTrue("p2 times p1 correct coefficient 0", result.coefficient(0).equalWithinDelta(new Complex(6.0, 0.0)));
assertTrue("p2 times p1 correct coefficient 1", result.coefficient(1).equalWithinDelta(new Complex(7.0, 0.0)));
assertTrue("p2 times p1 correct coefficient 2", result.coefficient(2).equalWithinDelta(new Complex(4.0, 0.0)));
assertTrue("p2 times p1 correct coefficient 3", result.coefficient(3).equalWithinDelta(new Complex(1.0, 0.0)));
assertTrue("p2 times p1 correct coefficient 4", result.coefficient(4).equalWithinDelta(new Complex(0.0, 0.0)));
// complex coefficients
Complex[] p3Coefficients = { Complex.fromPolar(2.0, Math.PI / 8),
Complex.fromPolar(1.0, 3.0 * Math.PI / 8) };
Complex[] p4Coefficients = { Complex.fromPolar(2.0, Math.PI / 8),
Complex.fromPolar(1.0, 3.0 * Math.PI / 8).negative() };
ComplexPolynomial p3 = new ComplexPolynomial(Arrays.asList(p3Coefficients));
ComplexPolynomial p4 = new ComplexPolynomial(Arrays.asList(p4Coefficients));
result = p3.times(p4);
assertTrue("p3 times p4 correct coefficient 0", result.coefficient(0)
.equalWithinDelta(Complex.fromPolar(4.0, Math.PI / 4)));
assertTrue("p3 times p4 correct coefficient 1", result.coefficient(1).equalWithinDelta(Complex.ZERO));
assertTrue("p3 times p4 correct coefficient 2", result.coefficient(2)
.equalWithinDelta(Complex.fromPolar(1.0, 3.0 * Math.PI / 4).negative()));
assertTrue("p3 times p4 correct coefficient 3", result.coefficient(3).equalWithinDelta(Complex.ZERO));
}
/**
* Test method for {@link com.codemelon.polynomial.ComplexPolynomial#times(com.codemelon.polynomial.ComplexPolynomial)}.
* This fails when the result degree is > 8. Some coefficients differ significantly
* from the correct value, so it doesn't seem to be just rounding problems.
*/
@Test
public void testTimesFourier() {
Complex[] p1Coefficients = { Complex.ONE, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ZERO, Complex.ONE };
Complex[] p2Coefficients = { Complex.ONE, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ZERO, Complex.ONE.negative() };
int resultDegree = 10;
ComplexPolynomial p1 = new ComplexPolynomial(p1Coefficients);
ComplexPolynomial p2 = new ComplexPolynomial(p2Coefficients);
ComplexPolynomial product = p1.times(p2);
assertEquals("correct degree", resultDegree, product.degree());
assertTrue("constant coefficient is 1", product.coefficient(0).equalWithinDelta(Complex.ONE));
for (int i = 1; i < resultDegree; i++) {
assertTrue("coefficient " + i + " is 0", product.coefficient(i).equalWithinDelta(Complex.ZERO));
}
assertTrue("coefficient " + resultDegree + " is -1", product.coefficient(resultDegree)
.equalWithinDelta(Complex.ONE.negative()));
}
/**
* Test method for {@link com.codemelon.polynomial.ComplexPolynomial#evaluate(com.codemelon.math.Complex)}.
*/
@Test
public void testEvaluate() {
// Test real coefficients
Complex[] realCoefficients = { new Complex(3.0, 0.0), new Complex(2.0, 0.0), Complex.ONE};
ComplexPolynomial p = new ComplexPolynomial(Arrays.asList(realCoefficients));
Complex c = Complex.fromPolar(1.0, Math.PI / 4.0);
Complex answer = p.evaluate(c);
assertTrue("Correct answer using real coefficient polynomial",
answer.equalWithinDelta(new Complex(3.0 + Math.sqrt(2.0), 1.0 + Math.sqrt(2.0))));
// Test complex coefficients
Complex[] complexCoefficients = { new Complex(1.0, 1.0), Complex.fromPolar(1.0, 3 * Math.PI / 4.0),
Complex.ZERO, Complex.fromPolar(1.0, Math.PI / 4.0) };
p = new ComplexPolynomial(Arrays.asList(complexCoefficients));
answer = p.evaluate(c);
assertTrue("Correct answer using complex coefficient polynomial",
answer.equalWithinDelta(new Complex(-1.0, 1.0)));
}
@Test
public void testRecursiveFFT() {
// Test case from CLRS, p. 914
Complex[] coefficients = { Complex.ZERO, Complex.ONE, new Complex(2.0, 0.0),
new Complex(3.0, 0.0) };
Complex[] values = ComplexPolynomial.recursiveFFT(coefficients);
assertTrue("Correct value for angle 0", values[0].equalWithinDelta(new Complex(6.0, 0.0)));
assertTrue("Correct value for angle PI / 2", values[1].equalWithinDelta(new Complex(-2.0, -2.0)));
assertTrue("Correct value for angle PI", values[2].equalWithinDelta(new Complex(-2.0, 0.0)));
assertTrue("Correct value for angle 3 * PI / 2", values[3].equalWithinDelta(new Complex(-2.0, 2.0)));
// Test case for 1 + x^5
Complex[] c2 = { Complex.ONE, Complex.ZERO, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ONE, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ZERO, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ZERO, Complex.ZERO, Complex.ZERO };
values = ComplexPolynomial.recursiveFFT(c2);
double theta = Math.PI / 8.0;
double sinTheta = Math.sin(theta);
double cosTheta = Math.cos(theta);
double oneOverSqrtTwo = 1.0 / Math.sqrt(2.0);
Complex[] expectedValues2 = {
new Complex(2.0, 0.0), // 0
new Complex(1.0 - sinTheta, cosTheta), // 1
new Complex(1.0 - oneOverSqrtTwo, -oneOverSqrtTwo), // 2
new Complex(1.0 + cosTheta, -sinTheta), // 3
new Complex(1.0, 1.0), // 4
new Complex(1.0 - cosTheta, -sinTheta), // 5
new Complex(1.0 + oneOverSqrtTwo, -oneOverSqrtTwo), //6
new Complex(1.0 + sinTheta, cosTheta), //7
Complex.ZERO, //8
new Complex(1.0 + sinTheta, -cosTheta), //9
new Complex(1.0 + oneOverSqrtTwo, oneOverSqrtTwo), //10
new Complex(1.0 - cosTheta, sinTheta), //11
new Complex(1.0, -1.0), //12
new Complex(1.0 + cosTheta, sinTheta), //13
new Complex(1.0 - oneOverSqrtTwo, oneOverSqrtTwo), //14
new Complex(1.0 - sinTheta, -cosTheta) // 15
};
for (int i = 0; i < expectedValues2.length; i++) {
assertTrue("Case 2: Correct value for angle " + i + "*PI/8",
values[i].equalWithinDelta(expectedValues2[i]));
}
}
@Test
public void testRecursiveFFTInverse() {
// reverse of test cases for recursiveFFT
Complex[] values = { new Complex(6.0, 0.0), new Complex(-2.0, -2.0), new Complex(-2.0, 0.0),
new Complex(-2.0, 2.0) };
Complex[] coefficients = ComplexPolynomial.recursiveFFTInverse(values);
assertTrue("Correct coefficient 0", coefficients[0].equalWithinDelta(Complex.ZERO));
assertTrue("Correct coefficient 1", coefficients[1].equalWithinDelta(Complex.ONE));
assertTrue("Correct coefficient 2", coefficients[2].equalWithinDelta(new Complex(2.0, 0.0)));
assertTrue("Correct coefficient 3", coefficients[3].equalWithinDelta(new Complex(3.0, 0.0)));
// Test case for 1 + x^5
Complex[] expected2 = { Complex.ONE, Complex.ZERO, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ONE, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ZERO, Complex.ZERO, Complex.ZERO,
Complex.ZERO, Complex.ZERO, Complex.ZERO, Complex.ZERO };
double theta = Math.PI / 8.0;
double sinTheta = Math.sin(theta);
double cosTheta = Math.cos(theta);
double oneOverSqrtTwo = 1.0 / Math.sqrt(2.0);
Complex[] values2 = {
new Complex(2.0, 0.0), // 0
new Complex(1.0 - sinTheta, cosTheta), // 1
new Complex(1.0 - oneOverSqrtTwo, -oneOverSqrtTwo), // 2
new Complex(1.0 + cosTheta, -sinTheta), // 3
new Complex(1.0, 1.0), // 4
new Complex(1.0 - cosTheta, -sinTheta), // 5
new Complex(1.0 + oneOverSqrtTwo, -oneOverSqrtTwo), //6
new Complex(1.0 + sinTheta, cosTheta), //7
Complex.ZERO, //8
new Complex(1.0 + sinTheta, -cosTheta), //9
new Complex(1.0 + oneOverSqrtTwo, oneOverSqrtTwo), //10
new Complex(1.0 - cosTheta, sinTheta), //11
new Complex(1.0, -1.0), //12
new Complex(1.0 + cosTheta, sinTheta), //13
new Complex(1.0 - oneOverSqrtTwo, oneOverSqrtTwo), //14
new Complex(1.0 - sinTheta, -cosTheta) // 15
};
coefficients = ComplexPolynomial.recursiveFFTInverse(values2);
for (int i = 0; i < expected2.length; i++) {
assertTrue("Case 2: Correct coefficient " + i,
coefficients[i].equalWithinDelta(expected2[i]));
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
bb9c5035c6222754ca90577ffd49abfc88f101d8 | dfa69d770c803a89200508dcab96615a4fba2aef | /homework-12-ck2860/src/Homework12/Sorts.java | b46cac6e918887bcc6a1cf0ace366cbd29364d5a | [] | no_license | ck2860/Java-Projects | 087904cc871d3b6b00964698113b358cbb3f4fbb | 1852048e317a1276b9e3f9a201acef0e42d272fa | refs/heads/main | 2023-08-29T08:49:01.312907 | 2021-10-06T16:28:14 | 2021-10-06T16:28:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,709 | java | /* SWEN-601
* Condy Kan
* ck2860@rit.edu
*/
package Homework12;
/**
* Answering #1 of homework12
*/
import static Homework12.SortUtilities.*; // imports entire method/class from SortUtilities to here
public class Sorts {
/**
* The insertionSort method is to perform an in place sort on an array passed in as a parameter.
*
* @param array an array
*/
public static void insertionSort(int[] array) {
for (int i = 1; i < array.length; i++) { //loops through each value in the array
int index = i; // assigns index to i. So every time it exits out, index would be 1 again.
while (index > 0 && array[index] < array[index - 1]) { // tests if the value at the index is smaller than the value before at the index then we swap them.
swap(array, index, index - 1); //calling the swap method to swap two values in the array
index--; // decrement so it goes backward to check the value before it exits out and moves on to the next index.
}
}
}
/**
* This function would call divide method to divide unsorted array
* then call mergeSort recursively for both sub-arrays
*
* @param array an unsorted array
* @return merged array.
*/
public static int[] mergeSort(int[] array) {
if (array.length < 2) {
return array;
} else {
int[][] arrays = divide(array); // divide into two arrays first //arrays[0] = first array, arrays[1] = second array
int[] sortedArrayOne = mergeSort(arrays[0]); // then call the mergeSort function secondly then divide into two arrays then base call-- keeps two arrays (if the length is 1).
int[] sortedArrayTwo = mergeSort(arrays[1]); // then call this mergeSort function then divide into two arrays etc.. then base call -- keep two arrays.
return merge(sortedArrayOne, sortedArrayTwo);
}
}
/**
* bubbleSort is one of sorting algorithm that loops from index 0 to length-2 and
* compares each value at index i to the value at index i +1;
* If the values are out of orders, we would use swap function to swap them then
* recursively call bubbleSort until it reaches array.length-2.
*
* @param array an array
* @return an sorted array
*/
public static int[] bubbleSort(int[] array) {
boolean swapFlag = true;
while (swapFlag) {
swapFlag = false;
for (int i = 0; i <= array.length - 2; i++) {
if (array[i] > array[i + 1]) {
swap(array, i, (i + 1));
swapFlag = true;
}
}
}
return array;
}
/**
* The recursive quickSort algorithm, would return the array if the array is less than 0.
* The pivot is always at the index 9.
* It loops once over the array and count the values that are less than, equal to, and greater than the pivot.
* Uses the counts from the previous step to create the arrays o hold all of the values
* then loop over again and copy into the the array.
* After copying the values into the correct arrays and call recursively.
*
* @param array
* @returna array
*/
public static int[] quickSort(int[] array) {
int[] leftArray;
int[] rightArray;
int[] middleArray;
if (array.length < 2) { //base case
return array;
} else {
int lessArrayCounter = 0;
int greatArrayCounter = 0;
int equalArrayCounter = 0;
for (int i = 0; i < array.length; i++) {
if (array[i] == array[0]) {
equalArrayCounter++;
} else if (array[i] < array[0]) {
lessArrayCounter++;
} else {
greatArrayCounter++;
}
}
leftArray = new int[lessArrayCounter];
rightArray = new int[greatArrayCounter];
middleArray = new int[equalArrayCounter];
// copy array into three different arrays (less, equal, and greater)
// this loop will finish before counters become 0
for (int i = 0; i < array.length; i++) {
if (array[i] == array[0]) {
middleArray[middleArray.length - equalArrayCounter] = array[i];
equalArrayCounter--;
} else if (array[i] < array[0]) {
leftArray[leftArray.length - lessArrayCounter] = array[i];
lessArrayCounter--;
} else {
rightArray[rightArray.length - greatArrayCounter] = array[i];
greatArrayCounter--;
}
}
return SortUtilities.cat(quickSort(leftArray), middleArray, quickSort(rightArray)); //recursive case
}
}
public static int [] selectionSort (int [] array){
// int copy1 [] = array;
for (int i = 0; i < array.length-1; i++){ // for the index
int small = i;
for (int j = i + 1; j < array.length; j++){
if (array[j] < array[small]){
small = j;
// swap(array, array[small], array[i]);
// int temp = copy[small];
// copy[small] = copy[i];
// copy[i] = temp;
}
}
if (small != i) {
// int temp = array[small];
// array[small] = array[i];
// array[i] = temp;
swap(array, small, i);
}
}
return array;
}
public static void heapSort (int array[]){
int n = array.length;
for (int i = n/2-1; i >=0;i--) {
heapify(array, n, i);
}
for (int j = n-1; j>=0; j--){
int temp = array[0];
array[0] = array[j];
array[j] = temp;
heapify(array, j, 0);
}
}
public static void heapify(int array[], int n, int i){
int largest = i;
int l = 2*i +1;
int r = 2*i +2;
if (l < n && array[l] > array[largest])
largest = l;
if(r < n && array[r] > array[largest])
largest = r;
if (largest != i) {
int swap = array[i];
array[i] = array[largest];
array[largest] = swap;
heapify(array, n, largest);
}
}
}
| [
"noreply@github.com"
] | ck2860.noreply@github.com |
84dbc66516e743782f5378a7a3c9d9138bb92f70 | 88717a39df1c53635217a82e9f319534ec9caed3 | /app/src/test/java/com/example/qthjen/newspaper/ExampleUnitTest.java | fea61e1c5f1b1848562c54ec2f67adbf3e2ae315 | [] | no_license | thjen/Newspaper | 6cb7ed543846fb5d39b2ac5502655180b2eadd7a | 3096fb01e6412d5cdd782b77e9806845ba4fd8c5 | refs/heads/master | 2021-01-02T08:50:50.815740 | 2017-08-01T18:41:31 | 2017-08-01T18:41:31 | 99,081,752 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package com.example.qthjen.newspaper;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"thjenxxxno6@gmail.com"
] | thjenxxxno6@gmail.com |
7f5eb199e99939128a489da6b4357c4b66c31260 | 2aa998bb7e3ddf92ba4bd421d3cdf0a02c8b756b | /src/DAO/impl/NotaImple.java | 0a629fcf7633893578989fce8cd9b2efdd209b4e | [] | no_license | Chillaso/Hibernate | 9240055bb221830f39f50d4ee0963d0dccab5909 | a235f8270da9259bd9011760198ca7cdd9840679 | refs/heads/master | 2021-04-30T15:29:44.476835 | 2018-02-26T20:18:57 | 2018-02-26T20:18:57 | 121,241,381 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,953 | java | package DAO.impl;
//@author chillaso
import DAO.NotaDAO;
import Modelo.Nota;
import Util.HibernateUtil;
import java.util.Collection;
import org.hibernate.Criteria;
import org.hibernate.FetchMode;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
public class NotaImple implements NotaDAO{
@Override
public Collection<Nota> getAll()
{
Session s = HibernateUtil.getSessionFactory().openSession();
s.beginTransaction();
Criteria c = s.createCriteria(Nota.class);
Collection<Nota> notas = (Collection<Nota>) c.list();
return notas;
}
@Override
public Collection<Nota> filtrarNota(String asig, String alum, int nota, int comparador)
{
Session s = HibernateUtil.getSessionFactory().openSession();
s.beginTransaction();
Criteria c=null;
if(asig.isEmpty()) asig="%";
if(alum.isEmpty()) alum="%";
if(nota==-1)
{
//ilike no case sensitive
c = s.createCriteria(Nota.class, "n")
.createAlias("n.id_alum", "al") //El de java
.createAlias("n.id_asig", "as")
.setFetchMode("id_asig", FetchMode.JOIN)
.setFetchMode("id_alum", FetchMode.JOIN)
.add(Restrictions.ilike("al.nombre", "%"+alum+"%"))
.add(Restrictions.ilike("as.nombre", "%"+asig+"%"))
.add(Restrictions.gt("nota", nota));
}
else
{
switch (comparador) {
//MENOR QUE
case -2:
c = s.createCriteria(Nota.class, "n")
.createAlias("n.id_alum", "al")
.createAlias("n.id_asig", "as")
.setFetchMode("id_asig", FetchMode.JOIN)
.setFetchMode("id_alum", FetchMode.JOIN)
.add(Restrictions.ilike("al.nombre", "%"+alum+"%"))
.add(Restrictions.ilike("as.nombre", "%"+asig+"%"))
.add(Restrictions.lt("nota", nota));
break;
//MENOR IGUAL QUE
case -1:
c = s.createCriteria(Nota.class, "n")
.createAlias("n.id_alum", "al")
.createAlias("n.id_asig", "as")
.setFetchMode("id_asig", FetchMode.JOIN)
.setFetchMode("id_alum", FetchMode.JOIN)
.add(Restrictions.ilike("al.nombre", "%"+alum+"%"))
.add(Restrictions.ilike("as.nombre", "%"+asig+"%"))
.add(Restrictions.le("nota", nota));
break;
//IGUAL
case 0:
c = s.createCriteria(Nota.class, "n")
.createAlias("n.id_alum", "al")
.createAlias("n.id_asig", "as")
.setFetchMode("id_asig", FetchMode.JOIN)
.setFetchMode("id_alum", FetchMode.JOIN)
.add(Restrictions.ilike("al.nombre", "%"+alum+"%"))
.add(Restrictions.ilike("as.nombre", "%"+asig+"%"))
.add(Restrictions.eq("nota", nota));
break;
//MAYOR IGUAL QUE
case 1:
c = s.createCriteria(Nota.class, "n")
.createAlias("n.id_alum", "al")
.createAlias("n.id_asig", "as")
.setFetchMode("id_asig", FetchMode.JOIN)
.setFetchMode("id_alum", FetchMode.JOIN)
.add(Restrictions.ilike("al.nombre", "%"+alum+"%"))
.add(Restrictions.ilike("as.nombre", "%"+asig+"%"))
.add(Restrictions.ge("nota", nota));
break;
//MAYOR QUE
case 2:
c = s.createCriteria(Nota.class, "n")
.createAlias("n.id_alum", "al")
.createAlias("n.id_asig", "as")
.setFetchMode("id_asig", FetchMode.JOIN)
.setFetchMode("id_alum", FetchMode.JOIN)
.add(Restrictions.ilike("al.nombre", "%"+alum+"%"))
.add(Restrictions.ilike("as.nombre", "%"+asig+"%"))
.add(Restrictions.gt("nota", nota));
break;
}
}
Collection<Nota> notas = (Collection<Nota>) c.list();
s.close();
return notas;
}
@Override
public void update(Nota nota)
{
Session s = HibernateUtil.getSessionFactory().openSession();
s.beginTransaction();
s.update(nota);
s.getTransaction().commit();
s.close();
}
@Override
public void insert(Nota nota)
{
Session s = HibernateUtil.getSessionFactory().openSession();
s.beginTransaction();
s.save(nota);
s.getTransaction().commit();
s.close();
}
}
| [
"carlete2@hotmail.com"
] | carlete2@hotmail.com |
830af9a656994453d4275d1a1d1c29a34cc638c2 | ce9ed863458199bb435d3a39a5f864e4401cef60 | /test/com/projectbd/dao/test/UsuarioDaoTest.java | 30f4999869c29a62bcb7d381c78a8f7ef704a667 | [] | no_license | HeitorCabriela/Gerecom | c2f5e610bd9177dcbc14c2b1f1e1350184952bf8 | 100c2f0a0100e29cbdb8e2e6665c431d39029afb | refs/heads/master | 2016-09-05T08:52:31.338389 | 2012-09-29T00:43:54 | 2012-09-29T00:43:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,981 | java | package com.projectbd.dao.test;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import com.projectbd.dao.RepositoryException;
import com.projectbd.dao.UsuarioDao;
import com.projectbd.entity.Usuario;
public class UsuarioDaoTest {
private UsuarioDao dao;
private Usuario usuario;
@Before
public void setUp() throws Exception {
usuario = new Usuario();
dao = new UsuarioDao();
}
@Test
public void testSave() throws RepositoryException{
usuario.setNome("Heitor");
usuario.setLogin("heitor");
usuario.setSenha("t5gerge");
dao.save(usuario);
Assert.assertEquals(dao.findByName("Heitor").getNome(),"Heitor");
}
@Ignore
public void testUpdate()throws RepositoryException{
usuario.setNome("Paulo");
usuario.setLogin("pauloneto");
usuario.setSenha("231074");
dao.save(usuario);
usuario.setSenha("894523");
dao.update(usuario);
Assert.assertTrue(dao.findId(1).getSenha().equals("894523"));
}
@Ignore
public void testDelete()throws RepositoryException{
usuario.setNome("Paulo");
usuario.setLogin("pauloneto");
usuario.setSenha("231074");
dao.save(usuario);
dao.delete(usuario);
Assert.assertTrue(dao.findAll().size() == 0);
}
@Ignore
public void testFindAll()throws RepositoryException {
usuario.setNome("Paulo");
usuario.setLogin("pauloneto");
usuario.setSenha("231074");
dao.save(usuario);
Assert.assertTrue(dao.findAll().size() == 1);
}
@Ignore
public void testFindByName()throws RepositoryException{
usuario.setNome("Paulo");
usuario.setLogin("pauloneto");
usuario.setSenha("231074");
dao.save(usuario);
Assert.assertTrue(dao.findByName("Paulo").equals(usuario));
}
@Ignore
public void testFindId()throws RepositoryException{
usuario.setNome("Paulo");
usuario.setLogin("pauloneto");
usuario.setSenha("231074");
dao.save(usuario);
Assert.assertTrue(dao.findId(1).getSenha().equals("231074"));
}
}
| [
"Heitor@Heitor-PC.(none)"
] | Heitor@Heitor-PC.(none) |
3b6475585467300ad41d6f4c812d48e7c42c42cf | d01da6b4fe565d7edb7c317bde916a9b5ff973cf | /app/src/main/java/com/farmerbb/taskbar/util/ToastFrameworkImpl.java | 4576741fa375eb438e22c528b865ff691df964d5 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] | permissive | farmerbb/Taskbar | 4771990576fa842b5f825e3fe6784482b13cf264 | 30c79846692719a670963e18687ad1947aa45433 | refs/heads/master | 2023-08-04T12:06:21.846083 | 2022-02-22T17:07:40 | 2022-02-22T17:07:40 | 64,976,505 | 719 | 147 | Apache-2.0 | 2023-06-04T05:17:44 | 2016-08-05T00:41:01 | Java | UTF-8 | Java | false | false | 1,508 | java | /* Copyright 2017 Braden Farmer
*
* 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.farmerbb.taskbar.util;
import android.annotation.SuppressLint;
import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;
import com.farmerbb.taskbar.R;
class ToastFrameworkImpl implements ToastInterface {
private final Toast toast;
@SuppressLint("ShowToast")
ToastFrameworkImpl(Context context, String message, int length) {
int offset = context.getResources().getDimensionPixelSize(R.dimen.tb_toast_y_offset);
if(U.getCurrentApiVersion() > 29.0 && U.isDesktopModeActive(context)) {
offset = offset + U.getNavbarHeight(context);
}
toast = Toast.makeText(context, message, length);
toast.setGravity(Gravity.BOTTOM | Gravity.CENTER_VERTICAL, 0, offset);
}
@Override
public void show() {
toast.show();
}
@Override
public void cancel() {
toast.cancel();
}
}
| [
"farmerbb@gmail.com"
] | farmerbb@gmail.com |
59b5efccd0b103daf90728ad90b39bbdc4950408 | 60476a37e21bc07b4925fa57849d689dc9dcc1cb | /shengda-cloud-provider/provider-cloud-mdc/src/main/java/com/shengda/provider/service/BrandService.java | 4cc5b0837e5d80cc8573be0de8c46d7f447dab8e | [] | permissive | nanase-takesi/spring-cloud-master | 600e984c9a1be622f0ac99f7f4b9b0c63eec6876 | 3f24e379cdb65d0402596736f41652495075a758 | refs/heads/master | 2022-07-25T03:53:55.165815 | 2020-03-23T09:15:21 | 2020-03-23T09:15:21 | 159,612,171 | 0 | 1 | Apache-2.0 | 2018-12-25T10:45:08 | 2018-11-29T05:26:25 | Java | UTF-8 | Java | false | false | 544 | java | package com.shengda.provider.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.shengda.provider.model.domain.Brand;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shengda.query.BrandQuery;
import com.shengda.vo.BrandVo;
/**
* @author takesi
* @date 2020-03-19
*/
public interface BrandService extends IService<Brand> {
/**
* 分页查询品牌信息
*
* @param brandQuery brandQuery
* @return IPage<BrandVo>
*/
IPage<BrandVo> list(BrandQuery brandQuery);
}
| [
"nanasetakesi@yahoo.co.jp"
] | nanasetakesi@yahoo.co.jp |
2d7ccd1541b90e80f63653a752d11109fb9caac0 | 57fb901cdecf427bed150573dd960b087068e7ce | /src/main/java/com/gpg/dto/FacturNQDto.java | edbe52127474430a9c17c77a8425c97a73686a69 | [] | no_license | nesrinnn/nesrine | 3a981fb6ef490a564ee5f61877a258cb1d13b11b | c7e0d5b2cc806b1e87f555ae1e1a0bf8a661dead | refs/heads/master | 2023-08-16T23:03:58.137714 | 2021-09-27T12:01:42 | 2021-09-27T12:01:42 | 410,881,559 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,121 | java | package com.gpg.dto;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.gpg.entities.Facture_Provider;
import com.gpg.entities.Product;
import com.gpg.entities.ProductItem;
import com.gpg.entities.Provider;
import com.gpg.entities.Status;
import com.gpg.repository.FactureNQRepository;
import com.gpg.repository.ProductItemRepo;
import com.gpg.repository.ProductRepo;
import com.gpg.repository.ProviderNormalRepo;
public class FacturNQDto {
private String num;
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate date_facture;
@JsonDeserialize(using = LocalDateDeserializer.class)
private LocalDate date_echeance;
private float totTtc;
private List<ProductItemDto> productItem = new ArrayList<>();
private float totTva;
private float totHt;
private String email;
private String pdfName;
private String rib;
private String nomBanque;
private String numCarte;
public String getRib() {
return rib;
}
public void setRib(String rib) {
this.rib = rib;
}
public String getNomBanque() {
return nomBanque;
}
public void setNomBanque(String nomBanque) {
this.nomBanque = nomBanque;
}
public String getNumCarte() {
return numCarte;
}
public void setNumCarte(String numCarte) {
this.numCarte = numCarte;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public String getPdfName() {
return pdfName;
}
public void setPdfName(String pdfName) {
this.pdfName = pdfName;
}
public FacturNQDto() {
}
public List<ProductItemDto> getProductItem() {
return productItem;
}
public void setProductItem(List<ProductItemDto> productItem) {
this.productItem = productItem;
}
public Facture_Provider FactureNQDtoToFactureNQ(FacturNQDto factureNQ, FactureNQRepository fq, ProviderNormalRepo pp,
ProductRepo productRepo, ProductItemRepo productItemRepo) {
Provider provider = pp.findByEmail(email).orElseThrow(() -> new IllegalArgumentException("Id not found"));
ProductItemDto pp1 = new ProductItemDto();
List<ProductItem> liste = new ArrayList<>();
factureNQ.getProductItem().forEach(l -> {
if (productRepo.findByReference(l.getReference()).isPresent()
&& productRepo.findByName(l.getName()).isPresent()
&& productRepo.findByPrice(l.getPrice()).isPresent()) {
Product prod = productRepo.findByName(l.getName())
.orElseThrow(() -> new UsernameNotFoundException("Not pp found: "));
ProductItem pp2 = new ProductItem(l.getTottva(),l.getTotttc(),l.getTotht(),l.getQte(), prod);
liste.add(pp2);
}
else if(productRepo.findByReference(l.getReference()).isPresent()
&& productRepo.findByName(l.getName()).isPresent()
&& !(productRepo.findByPrice(l.getPrice()).isPresent())) {
Product prod = productRepo.findByName(l.getName())
.orElseThrow(() -> new UsernameNotFoundException("Not pp found: "));
prod.setPrice(l.getPrice());
ProductItem pp2 = new ProductItem(l.getTottva(),l.getTotttc(),l.getTotht(),l.getQte(), prod);
liste.add(pp2);
}
else {
ProductItem pp2 = pp1.convert(l);
liste.add(pp2);
productItemRepo.save(pp2);
}
});
Facture_Provider facture = new Facture_Provider(factureNQ.getNum(), factureNQ.getDate_facture(),
factureNQ.getDate_echeance(), factureNQ.getTotTtc(),Status.Non_Payee,false,false,
factureNQ.getTotTva(), factureNQ.getTotHt(), liste, factureNQ.getRib(), factureNQ.getNumCarte(),
factureNQ.getNomBanque(),factureNQ.getPdfName(),provider);
return facture;
}
public LocalDate getDate_facture() {
return date_facture;
}
public void setDate_facture(LocalDate date_facture) {
this.date_facture = date_facture;
}
public LocalDate getDate_echeance() {
return date_echeance;
}
public void setDate_echeance(LocalDate date_echeance) {
this.date_echeance = date_echeance;
}
public float getTotTtc() {
return totTtc;
}
public void setTotTtc(float totTtc) {
this.totTtc = totTtc;
}
public float getTotTva() {
return totTva;
}
public void setTotTva(float totTva) {
this.totTva = totTva;
}
public float getTotHt() {
return totHt;
}
public void setTotHt(float totHt) {
this.totHt = totHt;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public FacturNQDto(String num, LocalDate date_facture, LocalDate date_echeance, float totTtc,
List<ProductItemDto> productItem, float totTva, float totHt, String email, String pdf) {
this.num = num;
this.date_facture = date_facture;
this.date_echeance = date_echeance;
this.totTtc = totTtc;
this.productItem = productItem;
this.totTva = totTva;
this.totHt = totHt;
this.pdfName = pdf;
this.email = email;
}
}
| [
"werdinesrine97@gmail.com"
] | werdinesrine97@gmail.com |
c0e115718a7019001d0473dfc9d21874a58b8ea8 | 673006389a2216555fc0f03fd3b3757f78a02454 | /Web_Cat-master/Core/src/org/webcat/core/EOManager.java | c14245c4e5835f8a9c50c79cbc96bcd2cef61c80 | [] | no_license | manasigore/my-projects | d2be7576ab4ccd1697dfaada577b90703704babf | e2add29036388a9d7ffc2e4519d8e85ffb5386cb | refs/heads/master | 2020-03-19T03:47:49.472749 | 2018-06-08T20:24:09 | 2018-06-08T20:24:09 | 135,763,670 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,717 | java | /*==========================================================================*\
| $Id: EOManager.java,v 1.6 2014/06/16 16:01:32 stedwar2 Exp $
|*-------------------------------------------------------------------------*|
| Copyright (C) 2006-2011 Virginia Tech
|
| This file is part of Web-CAT.
|
| Web-CAT is free software; you can redistribute it and/or modify
| it under the terms of the GNU Affero General Public License as published
| by the Free Software Foundation; either version 3 of the License, or
| (at your option) any later version.
|
| Web-CAT is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU Affero General Public License
| along with Web-CAT; if not, see <http://www.gnu.org/licenses/>.
\*==========================================================================*/
package org.webcat.core;
import org.apache.log4j.Logger;
import org.webcat.woextensions.WCEC;
import com.webobjects.eoaccess.EOUtilities;
import com.webobjects.eocontrol.EOEditingContext;
import com.webobjects.eocontrol.EOEnterpriseObject;
import com.webobjects.eocontrol.EORelationshipManipulation;
import com.webobjects.foundation.NSArray;
import com.webobjects.foundation.NSDictionary;
import com.webobjects.foundation.NSKeyValueCoding;
import com.webobjects.foundation.NSMutableArray;
import com.webobjects.foundation.NSMutableDictionary;
import er.extensions.eof.ERXEC;
//-------------------------------------------------------------------------
/**
* This interface defines common features for classes that encapsulate an EO
* that is managed in its own editing context so that it can be saved/managed
* independently of the client editing context from which it is being
* accessed. The intent is to allow a single object (managed by this
* container) to be independently saved to the database, separate from all
* the other objects related to it.
*
* @author Stephen Edwards
* @author Last changed by $Author: stedwar2 $
* @version $Revision: 1.6 $, $Date: 2014/06/16 16:01:32 $
*/
public interface EOManager
extends NSKeyValueCoding,
EORelationshipManipulation
{
// ----------------------------------------------------------
/**
* This inner class encapsulates an internal editing context that
* might need to change over time, if the old editing context accumulates
* errors that need to be dumped.
*/
public static class ECManager
{
// ----------------------------------------------------------
/**
* Create a new ECManager with a new internal editing context.
*/
public ECManager()
{
ec = WCEC.newAutoLockingEditingContext();
}
// ----------------------------------------------------------
/**
* Get a copy of the given object in the given editing context.
* @param <T> The type of the object to be localized, which could
* be a concrete EO class
* @param context The editing context to localize to
* @param object The EO to transfer into the EC. If the given
* object is not an EOEnterpriseObject, it is returned unchanged.
* If the object is an NSArray or NSDictionary, a copy with
* localized internal values is returned.
* @return A local instance of the given object
*/
public static <T> T localize(EOEditingContext context, T object)
{
if (object == null)
{
return object;
}
else if (object instanceof EOEnterpriseObject)
{
if (((EOEnterpriseObject)object).editingContext() == context)
{
return object;
}
else
{
@SuppressWarnings("unchecked")
T resultAsT = (T)EOUtilities.localInstanceOfObject(
context, (EOEnterpriseObject)object);
return resultAsT;
}
}
else if (object instanceof NSDictionary)
{
NSMutableDictionary<?, ?> result =
((NSDictionary<?, ?>)object).mutableClone();
for (Object key : result.allKeys())
{
result.takeValueForKey(
localize(context, result.valueForKey((String)key)),
(String)key);
}
@SuppressWarnings("unchecked")
T resultAsT = (T)result;
return resultAsT;
}
else if (object instanceof NSArray)
{
@SuppressWarnings("unchecked")
NSMutableArray<Object> result =
((NSArray<Object>)object).mutableClone();
for (int i = 0; i < result.count(); i++)
{
result.set(i, localize(context, result.objectAtIndex(i)));
}
@SuppressWarnings("unchecked")
T resultAsT = (T)result;
return resultAsT;
}
else
{
return object;
}
}
// ----------------------------------------------------------
/**
* Get a copy of the given object in the internal editing context.
* @param <T> The type of the object to be localized, which could
* be a concrete EO class
* @param object The EO to transfer into the EC. If the given
* object is not an EOEnterpriseObject, it is returned unchanged.
* If the object is an NSArray or NSDictionary, a copy with
* localized internal values is returned.
* @return A local instance of the given object
*/
protected <T> T localize(T object)
{
return localize(ec, object);
}
// ----------------------------------------------------------
/**
* Calls saveChanges() on the internal editing context, returning
* null on success or an appropriate Exception object on failure.
* This method allows the caller to decide what to do when saving
* fails.
* @return The exception that occurred, if saving fails, or null
* on success.
*/
public Exception tryToSaveChanges()
{
Exception result = null;
try
{
ec.saveChanges();
}
catch (Exception e)
{
result = e;
}
return result;
}
// ----------------------------------------------------------
/**
* Calls saveChanges() on the internal editing context. If any
* error occurs, it throws away the old editing context and
* creates a new one. Assumes that the editing context is currently
* locked by the caller, and leaves it locked after completion.
* If a new editing context is created, the given EO (which presumably
* already exists in the current EC) is imported into the new
* context, and then returned. Otherwise, the EO is returned
* unchanged.
* @param eo The primary EO of interest
* @return eo in the current editing context (imported into a
* new editing context if the old one is thrown away).
*/
public EOEnterpriseObject saveChanges(EOEnterpriseObject eo)
{
Exception err = tryToSaveChanges();
if (err != null)
{
log.info("Exception in saveChanges(); throwing away old EC",
err);
// Something happened, so try replacing the old context
// with a new one.
ERXEC newContext = WCEC.newAutoLockingEditingContext();
eo = EOUtilities.localInstanceOfObject(newContext, eo);
newContext.refreshObject(eo);
// Now try to clean up the old one
try
{
// Try to clean up the broken editing context, if possible
ec.dispose();
}
catch (Exception ee)
{
// if there is an error, ignore it since we're not going
// to use this ec any more anyway
}
// Finally do the replacement
ec = newContext;
}
return eo;
}
// ----------------------------------------------------------
/**
* Revert the internal editing context, throwing away any
* pending changes.
*/
public void revert()
{
ec.revert();
}
// ----------------------------------------------------------
/**
* Refresh all objects in the internal editing context.
*/
public void refreshAllObjects()
{
ec.refreshAllObjects();
}
// ----------------------------------------------------------
/**
* Releases the inner EOEditContext.
*/
public void dispose()
{
ec.dispose();
}
//~ Instance/static variables .........................................
private ERXEC ec;
static Logger log = Logger.getLogger(ECManager.class);
}
}
| [
"manasi.gore490@gmail.com"
] | manasi.gore490@gmail.com |
fbbb4e0f4bc516ab56010fa869692cc4131adf91 | f1f5734f383d227a8cebd553fe5d6e2b3b470633 | /net/divinerpg/blocks/vethea/BlockVetheaMetalCage.java | c2298ba655a21883402138da0c9fbb4438331468 | [
"MIT"
] | permissive | mazetar/Divine-Rpg | eec230de679b8187e9ecbef54d439e3287f219e1 | ed865743547265e8d085e9c370229be8a3d8789a | refs/heads/master | 2016-09-05T20:35:28.769169 | 2013-10-04T19:12:13 | 2013-10-04T19:12:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package net.divinerpg.blocks.vethea;
import net.minecraft.block.material.Material;
public class BlockVetheaMetalCage extends BlockVethea {
public BlockVetheaMetalCage(int par1, int par2, Material par3) {
super(par1, par2, par3);
}
@Override
public boolean isOpaqueCube() {
return false;
}
}
| [
"admin@mazetar.com"
] | admin@mazetar.com |
97fc1033f43902d325f90e3995251b8e44f4fcff | e705ea3a001ed23604fb2b4d85da04fc1a97b81b | /Answers/_153_FindMinimuminRotatedSortedArray.java | 6fa3e3b3fdb9feb9971a22a6ad7992ac2d555fd8 | [] | no_license | shitterlmj2016/Leetcode_java | 4b8f81f0f6338751222b45fe2b711082495396e4 | 92b2d6a83a8bfb49f3ea1bae6e641912d2160873 | refs/heads/master | 2020-04-15T22:54:46.831100 | 2019-04-15T03:05:15 | 2019-04-15T03:05:15 | 165,088,940 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,436 | java | /**
* 本代码来自 Cspiration,由 @Cspiration 提供
* 题目来源:http://leetcode.com
* - Cspiration 致力于在 CS 领域内帮助中国人找到工作,让更多海外国人受益
* - 现有课程:Leetcode Java 版本视频讲解(1-900题)(上)(中)(下)三部
* - 算法基础知识(上)(下)两部;题型技巧讲解(上)(下)两部
* - 节省刷题时间,效率提高2-3倍,初学者轻松一天10题,入门者轻松一天20题
* - 讲师:Edward Shi
* - 官方网站:https://cspiration.com
* - 版权所有,转发请注明出处
*/
public class _153_FindMinimuminRotatedSortedArray {
/**
* 153. Find Minimum in Rotated Sorted Array
* Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
*
4 5 6 7 0 1 2
4 5 6 0 1 2 3
2 1
* time : O(logn)
* space : O(1);
* @param nums
* @return
*/
public int findMin(int[] nums) {
if (nums == null || nums.length == 0) return -1;
int start = 0;
int end = nums.length - 1;
while (start + 1 < end) {
int mid = (end - start) / 2 + start;
if (nums[mid] < nums[end]) {
end = mid;
} else {
start = mid + 1;
}
}
if (nums[start] < nums[end]) return nums[start];
else return nums[end];
}
}
| [
"xchuang1995@163.com"
] | xchuang1995@163.com |
0c355d3e21b80e92635c4583b030609048052e9c | dcd79fb224e72374e826542a2f59b7d923c5e81d | /ComputerStorePOS/src/main/java/com/aiden/computerstorepos/factories/Impl/MonitorFactoriesImpl.java | 40235cc486df7e1de885a96ad836905ab22492e9 | [] | no_license | 211121614/ComputerStorePOS | d4a89b6ed81b3338bab63066969b88367fc0d493 | 682d97fb09b2b04aa7e35be133604593e6333cf7 | refs/heads/master | 2021-01-13T00:37:08.452590 | 2016-04-07T22:03:24 | 2016-04-07T22:03:24 | 55,374,143 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,237 | 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 com.aiden.computerstorepos.factories.Impl;
import com.aiden.computerstorepos.domain.Monitor;
import com.aiden.computerstorepos.domain.Monitor;
import com.aiden.computerstorepos.factories.MonitorFactories;
import java.io.Serializable;
import java.util.UUID;
/**
*
* @author Aidem
*/
public class MonitorFactoriesImpl implements MonitorFactories{
private static MonitorFactoriesImpl factory = null;
private MonitorFactoriesImpl() {
}
public static MonitorFactoriesImpl getInstance(){
if(factory ==null)
factory = new MonitorFactoriesImpl();
return factory;
}
@Override
public Monitor createMonitor(String productNumber,int stock, String description,double price) {
Monitor cpu = new Monitor
.Builder()
.id(UUID.randomUUID().toString())
.productNumber(productNumber)
.stock(stock)
.description(description)
.price(price)
.build();
return cpu;
}
}
| [
"aidenpage@gmail.com"
] | aidenpage@gmail.com |
1a349f7ebeec6040d4f88d1cde68baae281b7b8f | 8930f5db5076887515bddfde5755604763475f5f | /src/main/java/org/jxq/utility/check/Preconditions.java | f74a282e66d5d6889cf7e4c30eec7b1c1b6433a9 | [
"Apache-2.0"
] | permissive | 809662683/utility | 1cb0d95f28baad3686f74b3472da316200dc3e62 | 5b3eb5d0b02ad5f1e73b819b180c4f3a40597b10 | refs/heads/master | 2021-05-28T05:18:59.406613 | 2014-09-03T14:08:21 | 2014-09-03T14:08:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,490 | java | package org.jxq.utility.check;
import java.util.Collection;
public final class Preconditions {
public static void checkArgument(boolean expression) {
if (!expression) {
throw new IllegalArgumentException();
}
}
public static void checkArgument(boolean expression, Object errorMessage) {
if (!expression) {
throw new IllegalArgumentException(String.valueOf(errorMessage));
}
}
public static void checkArgument(boolean expression,
String errorMessageTemplate, Object... errorMessageArgs) {
if (!expression) {
throw new IllegalArgumentException(format(errorMessageTemplate,
errorMessageArgs));
}
}
public static void checkState(boolean expression) {
if (!expression) {
throw new IllegalStateException();
}
}
public static void checkState(boolean expression, Object errorMessage) {
if (!expression) {
throw new IllegalStateException(String.valueOf(errorMessage));
}
}
public static void checkState(boolean expression,
String errorMessageTemplate, Object... errorMessageArgs) {
if (!expression) {
throw new IllegalStateException(format(errorMessageTemplate,
errorMessageArgs));
}
}
public static <T> T checkNotNull(T reference) {
if (reference == null) {
throw new NullPointerException();
}
return reference;
}
public static <T> T checkNotNull(T reference, Object errorMessage) {
if (reference == null) {
throw new NullPointerException(String.valueOf(errorMessage));
}
return reference;
}
public static <T> T checkNotNull(T reference, String errorMessageTemplate,
Object... errorMessageArgs) {
if (reference == null) {
throw new NullPointerException(format(errorMessageTemplate,
errorMessageArgs));
}
return reference;
}
public static <T extends Iterable<?>> T checkContentsNotNull(T iterable) {
if (containsOrIsNull(iterable)) {
throw new NullPointerException();
}
return iterable;
}
public static <T extends Iterable<?>> T checkContentsNotNull(T iterable,
Object errorMessage) {
if (containsOrIsNull(iterable)) {
throw new NullPointerException(String.valueOf(errorMessage));
}
return iterable;
}
public static <T extends Iterable<?>> T checkContentsNotNull(T iterable,
String errorMessageTemplate, Object... errorMessageArgs) {
if (containsOrIsNull(iterable)) {
throw new NullPointerException(format(errorMessageTemplate,
errorMessageArgs));
}
return iterable;
}
private static boolean containsOrIsNull(Iterable<?> iterable) {
if (iterable == null) {
return true;
}
if ((iterable instanceof Collection)) {
Collection<?> collection = (Collection<?>) iterable;
try {
return collection.contains(null);
} catch (NullPointerException e) {
return false;
}
}
for (Object element : iterable) {
if (element == null) {
return true;
}
}
return false;
}
public static void checkElementIndex(int index, int size) {
checkElementIndex(index, size, "index");
}
public static void checkElementIndex(int index, int size, String desc) {
checkArgument(size >= 0, "negative size: %s",
new Object[] { Integer.valueOf(size) });
if (index < 0) {
throw new IndexOutOfBoundsException(format(
"%s (%s) must not be negative", new Object[] { desc,
Integer.valueOf(index) }));
}
if (index >= size) {
throw new IndexOutOfBoundsException(format(
"%s (%s) must be less than size (%s)", new Object[] { desc,
Integer.valueOf(index), Integer.valueOf(size) }));
}
}
public static void checkPositionIndex(int index, int size) {
checkPositionIndex(index, size, "index");
}
public static void checkPositionIndex(int index, int size, String desc) {
checkArgument(size >= 0, "negative size: %s",
new Object[] { Integer.valueOf(size) });
if (index < 0) {
throw new IndexOutOfBoundsException(format(
"%s (%s) must not be negative", new Object[] { desc,
Integer.valueOf(index) }));
}
if (index > size) {
throw new IndexOutOfBoundsException(format(
"%s (%s) must not be greater than size (%s)",
new Object[] { desc, Integer.valueOf(index),
Integer.valueOf(size) }));
}
}
public static void checkPositionIndexes(int start, int end, int size) {
checkPositionIndex(start, size, "start index");
checkPositionIndex(end, size, "end index");
if (end < start) {
throw new IndexOutOfBoundsException(
format("end index (%s) must not be less than start index (%s)",
new Object[] { Integer.valueOf(end),
Integer.valueOf(start) }));
}
}
static String format(String template, Object... args) {
StringBuilder builder = new StringBuilder(template.length() + 16
* args.length);
int templateStart = 0;
int i = 0;
while (i < args.length) {
int placeholderStart = template.indexOf("%s", templateStart);
if (placeholderStart == -1) {
break;
}
builder.append(template.substring(templateStart, placeholderStart));
builder.append(args[(i++)]);
templateStart = placeholderStart + 2;
}
builder.append(template.substring(templateStart));
if (i < args.length) {
builder.append(" [");
builder.append(args[(i++)]);
while (i < args.length) {
builder.append(", ");
builder.append(args[(i++)]);
}
builder.append("]");
}
return builder.toString();
}
}
| [
"jxqlovejava@163.com"
] | jxqlovejava@163.com |
f8bfbe705e7b37510bb9066b6e6ddfca11dd7923 | 076827e550da5b8a310bf84bbcea54d1012541cb | /app/src/main/java/com/hqbb/duanzi/widget/glide/CorpDrawableBuilder.java | 1603068a39a03b9752de81dad173adc3779b928a | [] | no_license | soldiers1989/qianniu | d426386f104b3570d651f17939ab2ae3b208ba32 | 41888d50090138fddecc3b4993bcbbec8c2b9647 | refs/heads/master | 2020-04-05T06:49:03.037709 | 2018-10-29T09:31:44 | 2018-10-29T09:31:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,769 | java | package com.hqbb.duanzi.widget.glide;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
import java.util.ArrayList;
import java.util.List;
/**
* 默认图片生成器
* 指定背景颜色和默认原图之后,根据imageView尺寸大小自动生成该大小的默认图片
* <p/>
* Created by ling(quan.ling@hotmail.com) on 16/5/11.
*/
public class CorpDrawableBuilder {
private static class HolderClass {
private static CorpDrawableBuilder ourInstance = new CorpDrawableBuilder();
}
private static CorpDrawableBuilder getInstance() {
return HolderClass.ourInstance;
}
private List<CorpSizeMatcher.MatcherFactory> matchers = new ArrayList<>();
private CorpDrawableBuilder() {
matchers.add(new DefaultMatcherFactory());
}
/**
* @param context 设备上下文
* @param resId 默认图片ID
* @param bgColor 背景颜色
* @return 占位符Drawable
*/
public static Drawable build(Context context, @DrawableRes int resId, int bgColor) {
return build(context.getResources().getDrawable(resId), bgColor);
}
/**
* @param origin 默认图Drawable
* @param bgColor 背景颜色
* @return 占位符Drawable
*/
public static Drawable build(Drawable origin, int bgColor) {
return new CorpDrawableBuilder.CorpDrawable(origin, bgColor, CorpDrawableBuilder.getInstance());
}
Rect getMatcherBounds(Drawable origin, Rect bounds) {
Rect rect = null;
for (int i = matchers.size() - 1; i >= 0; i--) {
CorpSizeMatcher matcher = matchers.get(i).getMatcher(origin, bounds);
if (matcher == null) {
continue;
}
rect = matcher.getBounds(origin, bounds);
if (rect != null) {
break;
}
}
return rect;
}
static class CorpDrawable extends Drawable {
CorpDrawableBuilder mDrawableBuilder;
Drawable mOriginDrawable;
int mBgColor;
public CorpDrawable(Drawable originDrawable, int color, CorpDrawableBuilder builder) {
mOriginDrawable = originDrawable;
mBgColor = color;
mDrawableBuilder = builder;
}
@Override
public void draw(Canvas canvas) {
canvas.drawColor(mBgColor);
mOriginDrawable.draw(canvas);
}
@Override
public void setAlpha(int alpha) {
mOriginDrawable.setAlpha(alpha);
}
@Override
public void setColorFilter(ColorFilter colorFilter) {
mOriginDrawable.setColorFilter(colorFilter);
}
@Override
public int getOpacity() {
return mOriginDrawable.getOpacity();
}
@Override
protected boolean onLevelChange(int level) {
if (mOriginDrawable != null && mOriginDrawable.setLevel(level)) {
updateLayerBounds(getBounds());
return true;
}
return super.onLevelChange(level);
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
updateLayerBounds(bounds);
}
private void updateLayerBounds(Rect bounds) {
mOriginDrawable.setBounds(mDrawableBuilder.getMatcherBounds(mOriginDrawable, bounds));
}
}
private static class DefaultMatcherFactory extends CorpSizeMatcher.MatcherFactory {
private static final float percent = 0.4f;
@Override
public CorpSizeMatcher getMatcher(Drawable origin, Rect bounds) {
return new CorpSizeMatcher() {
@Override
public Rect getBounds(Drawable origin, Rect bounds) {
float factor = (float) origin.getIntrinsicWidth() / origin.getMinimumHeight();
int w, h;
if (factor > (float) bounds.width() / bounds.height()) {
w = (int) (bounds.right * percent);
h = (int) (w / factor);
} else {
h = (int) (bounds.bottom * percent);
w = (int) (h * factor);
}
Rect rect = new Rect();
rect.left = (bounds.width() - w) / 2;
rect.right = rect.left + w;
rect.top = (bounds.height() - h) / 2;
rect.bottom = rect.top + h;
return rect;
}
};
}
}
}
| [
"495926158@qq.com"
] | 495926158@qq.com |
8ed1d1c6b6452c9319f82148dac507636a84b77a | 7d622de6755c886df7c014551f5eb5624378ea74 | /src/edu/arizona/cs/mrpkm/kmeridx/KmerIndexBuilderPartitioner.java | 8de8e1d47159360890fcdf76c43c04480c7f8ebc | [] | no_license | iychoi/MR-PKM | f0c8caf7e3bfb3a1b47d8449ed7b893113d8885f | 903f04c17326c92c73389b52e3e430bd04b706f9 | refs/heads/master | 2020-05-19T09:35:50.544923 | 2015-05-08T09:52:59 | 2015-05-08T09:52:59 | 22,664,930 | 1 | 1 | null | 2015-05-06T19:25:06 | 2014-08-06T01:06:16 | Java | UTF-8 | Java | false | false | 5,092 | java | package edu.arizona.cs.mrpkm.kmeridx;
import edu.arizona.cs.mrpkm.types.kmerrangepartition.KmerRangePartition;
import edu.arizona.cs.mrpkm.types.kmerrangepartition.KmerRangePartitioner;
import edu.arizona.cs.mrpkm.types.namedoutputs.NamedOutputs;
import edu.arizona.cs.mrpkm.types.histogram.KmerHistogram;
import edu.arizona.cs.mrpkm.readididx.KmerHistogramHelper;
import edu.arizona.cs.mrpkm.types.hadoop.CompressedIntArrayWritable;
import edu.arizona.cs.mrpkm.types.hadoop.CompressedSequenceWritable;
import edu.arizona.cs.mrpkm.types.hadoop.MultiFileCompressedSequenceWritable;
import edu.arizona.cs.mrpkm.helpers.SequenceHelper;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Partitioner;
/**
*
* @author iychoi
*/
public class KmerIndexBuilderPartitioner extends Partitioner<MultiFileCompressedSequenceWritable, CompressedIntArrayWritable> implements Configurable {
private static final Log LOG = LogFactory.getLog(KmerIndexBuilderPartitioner.class);
private Configuration conf;
private boolean initialized = false;
private NamedOutputs namedOutputs = null;
private KmerIndexBuilderConfig builderConfig = null;
private KmerRangePartition[][] partitions;
private CompressedSequenceWritable[][] partitionEndKeys;
@Override
public void setConf(Configuration conf) {
this.conf = conf;
}
@Override
public Configuration getConf() {
return this.conf;
}
private void initialize() throws IOException {
this.namedOutputs = new NamedOutputs();
this.namedOutputs.loadFrom(conf);
this.builderConfig = new KmerIndexBuilderConfig();
this.builderConfig.loadFrom(conf);
if (this.builderConfig.getKmerSize() <= 0) {
throw new RuntimeException("kmer size has to be a positive value");
}
this.partitions = new KmerRangePartition[this.namedOutputs.getSize()][];
this.partitionEndKeys = new CompressedSequenceWritable[this.namedOutputs.getSize()][];
}
private void initialize(int fileID, int numReduceTasks) throws IOException {
if(this.partitionEndKeys[fileID] == null) {
KmerHistogram histogram = null;
// search index file
String filename = this.namedOutputs.getRecordFromID(fileID).getFilename();
Path histogramHadoopPath = new Path(this.builderConfig.getHistogramPath(), KmerHistogramHelper.makeHistogramFileName(filename));
FileSystem fs = histogramHadoopPath.getFileSystem(this.conf);
if (fs.exists(histogramHadoopPath)) {
histogram = new KmerHistogram();
histogram.loadFrom(histogramHadoopPath, fs);
} else {
throw new IOException("k-mer histogram is not found in given paths");
}
KmerRangePartitioner partitioner = new KmerRangePartitioner(this.builderConfig.getKmerSize(), numReduceTasks);
this.partitions[fileID] = partitioner.getHistogramPartitions(histogram.getSortedRecords(), histogram.getKmerCount());
this.partitionEndKeys[fileID] = new CompressedSequenceWritable[numReduceTasks];
for (int i = 0; i < this.partitions[fileID].length; i++) {
try {
this.partitionEndKeys[fileID][i] = new CompressedSequenceWritable(this.partitions[fileID][i].getPartitionEndKmer());
} catch (IOException ex) {
throw new RuntimeException(ex.toString());
}
}
}
}
@Override
public int getPartition(MultiFileCompressedSequenceWritable key, CompressedIntArrayWritable value, int numReduceTasks) {
if(!this.initialized) {
try {
initialize();
this.initialized = true;
} catch (IOException ex) {
throw new RuntimeException(ex.toString());
}
}
try {
initialize(key.getFileID(), numReduceTasks);
} catch (IOException ex) {
throw new RuntimeException(ex.toString());
}
int partition = getPartitionIndex(key);
if(partition < 0) {
throw new RuntimeException("partition failed");
}
return partition;
}
private int getPartitionIndex(MultiFileCompressedSequenceWritable key) {
int fileID = key.getFileID();
for(int i=0;i<this.partitionEndKeys[fileID].length;i++) {
int comp = SequenceHelper.compareSequences(key.getCompressedSequence(), this.partitionEndKeys[fileID][i].getCompressedSequence());
if(comp <= 0) {
return i;
}
}
return -1;
}
}
| [
"iychoi@email.arizona.edu"
] | iychoi@email.arizona.edu |
f337a7972410689fc40bde3c03399e3a6ba588f8 | 33f15faccdfbb43683e92ef1368b96114675cb0f | /src/main/java/com/miaoshaproject/error/BusinessException.java | f9a4250f47c69d690130bc73371548e4536f7717 | [] | no_license | liweijiee/miaosha | 82bb3b733ad0983ca22c54291326cb03efcba213 | b6c14aeee5e052a3eaa2df23c3d3004a01941bb0 | refs/heads/master | 2020-05-07T08:24:38.839117 | 2019-04-09T10:30:50 | 2019-04-09T10:30:50 | 180,326,532 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 826 | java | package com.miaoshaproject.error;
//包装器业务异常类实现(设计模式)
public class BusinessException extends Exception implements CommonError {
private CommonError commonError;
public BusinessException(CommonError commonError){
super();
this.commonError = commonError;
}
public BusinessException(CommonError commonError,String errMsg){
super();
this.commonError = commonError;
this.commonError.setErrMsg(errMsg);
}
@Override
public int getErrCode() {
return this.commonError.getErrCode();
}
@Override
public String getErrMsg() {
return this.commonError.getErrMsg();
}
@Override
public CommonError setErrMsg(String errMsg) {
this.commonError.setErrMsg(errMsg);
return this;
}
}
| [
"930435463@qq.com"
] | 930435463@qq.com |
44523d5f5a2fd9a9beb60060a5ebf98ff063af16 | 74e25d792b5d69be26321674b2444134fee0d537 | /Backend/java/oblectclass/Person.java | c076dda1d29e824c98acecae9756b19a41b71caf | [] | no_license | PoojaChikgoudar/TY_CG_HTD_BangloreNovember_JFS_POOJACHIKGOUDAR | 9a0402a3941d3fda1b7a466d503507f1032ff283 | cefb80efd49522c4580dbbc3ba641ab05a316fd5 | refs/heads/master | 2022-07-05T12:50:38.212686 | 2020-01-18T08:44:18 | 2020-01-18T08:44:18 | 225,846,134 | 0 | 0 | null | 2022-06-21T02:37:02 | 2019-12-04T11:01:04 | Java | UTF-8 | Java | false | false | 278 | java |
public class Person {
String name;
public Person(String name) {
super();
this.name = name;
}
@Override
protected void finalize() throws Throwable {
// TODO Auto-generated method stub
System.out.println("Finalize method is called");
super.finalize();
}
}
| [
"poojachdl639@gmail.com"
] | poojachdl639@gmail.com |
d00c2e5714d712d3dad7f16bbf788151fddc8eed | 8d275de8a0ef91c38ec614e451b7f60d309f4cd3 | /wms-orders/src/main/java/com/amazonservices/mws/orders/_2013_09_01/util/XMLGregorianCalendarUtil.java | 07648377bb5424dddeeb65b84a3b3df088ecb65c | [] | no_license | owengoodluck/JavaLib2 | 3d6ed543a3d94dad89c221c3be324baf7f8a3bf9 | c1e5576729c826929da3a60017d1faf6ca56b706 | refs/heads/master | 2021-01-10T05:19:53.303106 | 2016-02-25T14:02:21 | 2016-02-25T14:02:21 | 51,063,234 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,255 | java | package com.amazonservices.mws.orders._2013_09_01.util;
import java.util.Calendar;
import java.util.Date;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
public class XMLGregorianCalendarUtil {
public static Date xmlDate2Date(XMLGregorianCalendar cal){
if(cal!=null){
return cal.toGregorianCalendar().getTime();
}else{
return null;
}
}
public static XMLGregorianCalendar dateToXmlDate(Date date){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
DatatypeFactory dtf = null;
try {
dtf = DatatypeFactory.newInstance();
} catch (DatatypeConfigurationException e) {
}
XMLGregorianCalendar dateType = dtf.newXMLGregorianCalendar();
dateType.setYear(cal.get(Calendar.YEAR));
dateType.setMonth(cal.get(Calendar.MONTH)+1);
dateType.setDay(cal.get(Calendar.DAY_OF_MONTH));
dateType.setHour(cal.get(Calendar.HOUR_OF_DAY));
dateType.setMinute(cal.get(Calendar.MINUTE));
dateType.setSecond(cal.get(Calendar.SECOND));
return dateType;
}
}
| [
"owen.goodluck@gmail.com"
] | owen.goodluck@gmail.com |
d6572f031ab5be190583a1aba20455e29319049a | 21308b22752fa44eb1b2defc5c47dd0baacb7f97 | /src/com/netease/service/protocol/meta/MessageList.java | 98c714173cafabedb69b1c3ac0005474371f6124 | [] | no_license | littletanker/engagement_int_1.8 | 4a8084bc39e5854fb901e2c2f05044b30120a847 | 1abdc3d2de6cb478a0f873a534f78fbb7d0ceeec | refs/heads/master | 2020-12-25T21:56:17.320115 | 2015-01-15T07:47:56 | 2015-01-15T07:47:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package com.netease.service.protocol.meta;
import java.util.List;
/**
* 聊天列表
*/
public class MessageList {
public List<MessageInfo> msgList ;//消息列表
public int count ;//每次取的个数
public int intimacy ;//亲密度
public String portraitUrl192 ;//用户192x192头像裁剪图url
public String nick ;//昵称
public SpecialGift[] specialGifts ;//特殊礼物列表
public boolean isYixinFriend;//是否易信好友
public MessageInfo[] fireMsgList;//被焚消息列表
public ChatSkillInfo[] chatSkills;//对方(女性)的聊天技
}
| [
"happylishang@163.com"
] | happylishang@163.com |
e9fe7d3d98c4cbe4b42416a57cf70061c3723236 | 50c6d06dbd477cc6fd75e3cf1984ead6a4590e85 | /springboot-base/src/main/java/com/ke/shiro/RedisCache.java | dc4c8c1ae3fab74e479b4de2baf1985bf34d637c | [] | no_license | 17734576784/mygit | 48614454be2e807c856348df9cda64000a07d0cd | 0ba93f276eec66248f49410a50c355257374f8c2 | refs/heads/master | 2022-12-22T10:40:16.886384 | 2019-08-14T06:50:34 | 2019-08-14T06:50:34 | 147,448,423 | 1 | 1 | null | 2022-12-16T08:47:50 | 2018-09-05T02:30:27 | Java | UTF-8 | Java | false | false | 3,472 | java | /**
* @Title: RedisCache.java
* @Package com.ke.shiro
* @Description: TODO(用一句话描述该文件做什么)
* @author dbr
* @date 2018年12月21日 下午7:06:13
* @version V1.0
*/
package com.ke.shiro;
import java.util.Collection;
import java.util.Set;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.springframework.stereotype.Component;
import com.ke.utils.Constant;
import com.ke.utils.JedisUtils;
import com.ke.utils.SerializeUtils;
/**
* @ClassName: RedisCache
* @Description: TODO(这里用一句话描述这个类的作用)
* @author dbr
* @date 2018年12月21日 下午7:06:13
*
*/
@Component
public class RedisCache<K, V> implements Cache<K, V> {
private byte[] getByteKey(K k){
if(k instanceof String){
String key = Constant.CACHE_PREFIX + k;
return key.getBytes();
}else {
return SerializeUtils.serialize(k);
}
}
/** (非 Javadoc)
* <p>Title: clear</p>
* <p>Description: </p>
* @throws CacheException
* @see org.apache.shiro.cache.Cache#clear()
*/
@Override
public void clear() throws CacheException {
// TODO Auto-generated method stub
}
/** (非 Javadoc)
* <p>Title: get</p>
* <p>Description: </p>
* @param arg0
* @return
* @throws CacheException
* @see org.apache.shiro.cache.Cache#get(java.lang.Object)
*/
@SuppressWarnings("unchecked")
@Override
public V get(K k) throws CacheException {
// TODO Auto-generated method stub
System.out.println("redis读取");
byte[] value = JedisUtils.get(getByteKey(k));
if (value != null) {
return (V) SerializeUtils.deserialize(value);
}
return null;
}
/** (非 Javadoc)
* <p>Title: keys</p>
* <p>Description: </p>
* @return
* @see org.apache.shiro.cache.Cache#keys()
*/
@Override
public Set<K> keys() {
// TODO Auto-generated method stub
return null;
}
/** (非 Javadoc)
* <p>Title: put</p>
* <p>Description: </p>
* @param arg0
* @param arg1
* @return
* @throws CacheException
* @see org.apache.shiro.cache.Cache#put(java.lang.Object, java.lang.Object)
*/
@Override
public V put(K k, V v) throws CacheException {
// TODO Auto-generated method stub
byte[] key = getByteKey(k);
byte[] value = SerializeUtils.serialize(v);
JedisUtils.set(key, value);
JedisUtils.expire(key, Constant.CACHE_TIME_OUT);
return v;
}
/** (非 Javadoc)
* <p>Title: remove</p>
* <p>Description: </p>
* @param arg0
* @return
* @throws CacheException
* @see org.apache.shiro.cache.Cache#remove(java.lang.Object)
*/
@SuppressWarnings("unchecked")
@Override
public V remove(K k) throws CacheException {
// TODO Auto-generated method stub
byte[] key = getByteKey(k);
byte[] value = JedisUtils.get(key);
JedisUtils.del(key);
if(value != null) {
return (V) SerializeUtils.deserialize(value);
}
return null;
}
/** (非 Javadoc)
* <p>Title: size</p>
* <p>Description: </p>
* @return
* @see org.apache.shiro.cache.Cache#size()
*/
@Override
public int size() {
// TODO Auto-generated method stub
return 0;
}
/** (非 Javadoc)
* <p>Title: values</p>
* <p>Description: </p>
* @return
* @see org.apache.shiro.cache.Cache#values()
*/
@Override
public Collection<V> values() {
// TODO Auto-generated method stub
return null;
}
}
| [
"17734576784@163.com"
] | 17734576784@163.com |
b7af0795b4bba28d6332db14141c8d30fb9d6567 | 4b9e2b99c5c5e3fe936ed5b7efe6abf72ff19c75 | /src/org/jppf/example/concurrentjobs/package-info.java | 164185806bdc2d26cc71e69f9e57d847a016ac34 | [] | no_license | jaymdq/Paralela-y-Distribuida---FINAL | 44495a74bf619ab840d52a8daf5db13209a4cd2d | 70663de127f670f9b95b6febbd65cb2ae8e5e2a4 | refs/heads/master | 2021-01-17T16:00:37.091976 | 2016-05-30T12:13:49 | 2016-05-30T12:13:49 | 59,510,651 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | /*
* JPPF.
* Copyright (C) 2005-2015 JPPF Team.
* http://www.jppf.org
*
* 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.
*/
/**
* Code for the Concurrent Jobs demo.
*/
package org.jppf.example.concurrentjobs;
| [
"bcaimmi@gmail.com"
] | bcaimmi@gmail.com |
94a9a66d37f8cb048d1b90a9bdcc6cd1a6b517bf | 0e12d0154387cee41d2ee018ded55ca3d150160e | /app/src/main/java/com/example/pablojeria/pruebacuatrorest/prueba/PRestaurant.java | 79382cdf3d521d6e5ef184ec6efc5ba77ef72d45 | [] | no_license | PabloJeria8/PruebaCuatroRest | aa3d6f1406f449754586c59946f190f548058a7d | bdd82e6abc9774217942313385a5df69afc51ef4 | refs/heads/master | 2021-05-07T03:06:01.639844 | 2017-11-15T00:48:32 | 2017-11-15T00:48:32 | 110,636,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,204 | java | package com.example.pablojeria.pruebacuatrorest.prueba;
import com.example.pablojeria.pruebacuatrorest.models.PRestaurantCollections;
public class PRestaurant {
private int has_total;
private PRestaurantCollections[] collections;
private String share_url;
private int has_more;
private String display_text;
public int getHas_total() {
return this.has_total;
}
public void setHas_total(int has_total) {
this.has_total = has_total;
}
public PRestaurantCollections[] getCollections() {
return this.collections;
}
public void setCollections(PRestaurantCollections[] collections) {
this.collections = collections;
}
public String getShare_url() {
return this.share_url;
}
public void setShare_url(String share_url) {
this.share_url = share_url;
}
public int getHas_more() {
return this.has_more;
}
public void setHas_more(int has_more) {
this.has_more = has_more;
}
public String getDisplay_text() {
return this.display_text;
}
public void setDisplay_text(String display_text) {
this.display_text = display_text;
}
}
| [
"pablo.jeria8@gmail.com"
] | pablo.jeria8@gmail.com |
1704a9902521e4a43847bf9ead58ac424c21d994 | 77d81a7185b0e5983aaf16e6221dff301b5acfa6 | /algorithm-boj/src/bfs_dfs/BOJ_2178_미로탐색.java | 10dcbd61b8f3b93d3a5d90ee333842acfd05ec65 | [] | no_license | iyoungman/algorithm-java | 21567ced48ef791ed98569358b05d99276e5f28d | 74966eb80261ddb5e5f0992f2fc8f6981dd95ec7 | refs/heads/master | 2020-05-30T20:16:45.107600 | 2020-03-12T09:28:07 | 2020-03-12T09:28:07 | 189,944,460 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,936 | java | package bfs_dfs;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
/**
* Created by YoungMan on 2019-06-17.
* https://www.acmicpc.net/problem/2178
* 최단경로 -> BFS
* 항상 도착위치로 이동할 수 있는 경우만 입력으로 주어진다.
*/
public class BOJ_2178_미로탐색 {
private static int[][] map;
private static int[][] visit;
private static int[] xMove = {0, 0, -1, 1};//순서대로 상하좌우
private static int[] yMove = {-1, 1, 0, 0};//순서대로 상하좌우
private static Queue<Integer> xQueue = new LinkedList<Integer>();
private static Queue<Integer> yQueue = new LinkedList<Integer>();
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();//행
int m = scanner.nextInt();//열
map = new int[n][m];
visit = new int[n][m];
//입력
for (int i = 0; i < n; i++) {
String str = scanner.next();
for (int j = 0; j < str.length(); j++) {
map[i][j] = str.charAt(j) - '0';
}
}
bfs(n, m);
System.out.println(visit[n-1][m-1]);
}
private static void bfs(int n, int m) {
visit[0][0] = 1;
checkUpDownLeftRight(0,0);
while (visit[n-1][m-1] == 0) {
int frontX = xQueue.poll();
int frontY = yQueue.poll();
checkUpDownLeftRight(frontX, frontY);
}
}
private static void checkUpDownLeftRight(int x, int y) {
for (int i = 0; i < xMove.length; i++) {//상하좌우 검사
int tempX = x + xMove[i];
int tempY = y + yMove[i];
if (checkArrayIndexOut(tempX, tempY))
continue;
if (map[tempX][tempY] == 1 && visit[tempX][tempY] == 0) {//길이 맞으면서 아직 방문하지 않았다면
xQueue.offer(tempX);
yQueue.offer(tempY);
visit[tempX][tempY] = visit[x][y] + 1;//전것의 + 1
}
}
}
private static boolean checkArrayIndexOut(int x, int y) {
return x < 0 || x >= map.length || y < 0 || y >= map[0].length;
}
}
| [
"hsl9546@gmail.com"
] | hsl9546@gmail.com |
7ce2b518f4b810847d42ae1a2616dbf23826f472 | 931a135fb6a3792c2dd99311fd550f4e48684f19 | /VerifyooBL/src/Data/Comparison/CompareResultGeneric.java | f59f03d2a6fce420fd4b77f28d203251ae1f2a5a | [] | no_license | rc59/VerifyooLogic | 7898d172dbc8c36887f6279f0a31326907728b60 | bf7f56182aaecbdb0639c165faa9b87205676b65 | refs/heads/master | 2021-01-12T02:46:59.338180 | 2017-01-04T06:49:54 | 2017-01-04T06:49:54 | 78,100,985 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 781 | java | package Data.Comparison;
import Data.Comparison.Abstract.CompareResultAbstract;
import Logic.Utils.Utils;
public class CompareResultGeneric extends CompareResultAbstract {
public CompareResultGeneric(String name, double value, double originalValue, double internalMean, double popMean, double popSd, double internalSd, double internalSdUserOnly) {
Name = name;
Value = value;
OriginalValue = originalValue;
Mean = internalMean;
PopMean = popMean;
StandardDev = popSd;
InternalStandardDev = internalSd;
InternalStandardDevUserOnly = internalSdUserOnly;
double boundaryAdj = Utils.GetInstance().GetUtilsGeneral().GetBoundaryAdj(Name);
Weight = Utils.GetInstance().GetUtilsStat().CalcWeight(internalMean, internalSd, popMean, popSd, boundaryAdj);
}
}
| [
"dalal.roy@gmail.com"
] | dalal.roy@gmail.com |
1f75596eeb380380769b5c43cc42fae45572be09 | a93737f3b1d6999d3081436d748d24a094a0eac4 | /app/src/main/java/com/github/itswisdomagain/developers/UserProfileActivity.java | 29270e3d0238f5be94611e7419c183cba93cfdad | [] | no_license | itswisdomagain/ALC | 8f55216ea89908f54af8389b6c8b5a897ec9f60e | 4b75dafc7bb7ed00ca8ddc788752f45a24c7985c | refs/heads/master | 2021-01-22T18:57:43.813308 | 2017-03-16T00:58:09 | 2017-03-16T00:58:09 | 85,136,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,205 | java | package com.github.itswisdomagain.developers;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.view.View;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import java.util.Locale;
import de.hdodenhof.circleimageview.CircleImageView;
public class UserProfileActivity extends AppCompatActivity {
String url;
String username;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_user_profile);
String location = getIntent().getExtras().getString("location");
String language = getIntent().getExtras().getString("language");
String image = getIntent().getExtras().getString("image");
username = getIntent().getExtras().getString("username");
url = getIntent().getExtras().getString("url");
SpannableString content = new SpannableString(url);
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
if (language != null && location != null) {
((TextView)findViewById(R.id.tvSummary)).
setText(language.concat(" developer, ").concat(location).toUpperCase(Locale.ENGLISH));
}
((TextView)findViewById(R.id.tvUsername)).setText(username);
((TextView)findViewById(R.id.tvUrl)).setText(content);
Picasso.with(UserProfileActivity.this).load(image).noFade().into((CircleImageView)findViewById(R.id.profile_image));
}
public void shareButtonClicked(View v)
{
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, String.format(Locale.ENGLISH,
"Check out this awesome developer %s, %s.", username, url));
sendIntent.setType("text/plain");
startActivity(sendIntent);
}
public void profileUrlClicked(View v)
{
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
}
| [
"wisdom.arerosuoghene@gmail.com"
] | wisdom.arerosuoghene@gmail.com |
671a5eeaa2cf71418cf0676e033763a15a8fd11d | 902314c845b0aa1a2e95c8f27a28e468cf6305d1 | /experimental/src/main/java/edu/iu/daal_subgraph/GraphLoadTask.java | 150bdd68562860a122cc45bed4c90d3eeadd558a | [
"Apache-2.0"
] | permissive | kyhhdm/harp | 6d26aac91994f3b114babeb6705c58381d40a2b9 | b966a79eedf14852460dba524b318bba1142b9bc | refs/heads/master | 2020-09-02T15:46:06.081682 | 2018-12-20T01:25:15 | 2018-12-20T01:25:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,412 | java | /*
* Copyright 2013-2017 Indiana University
*
* 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 edu.iu.daal_subgraph;
import edu.iu.harp.partition.Partition;
import edu.iu.harp.resource.IntArray;
import edu.iu.harp.schdynamic.Task;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
* @brief modified for conversion between sahad and fascia graph format
*/
public class GraphLoadTask implements Task<String, ArrayList<Partition<IntArray>>>{
protected static final Log LOG = LogFactory.getLog(GraphLoadTask.class);
private Configuration conf;
public GraphLoadTask(Configuration conf){
this.conf = conf;
}
private int vert_num_local = 0;
private int adjacent_local_num = 0;
private int max_v_id = 0;
@Override
public ArrayList<Partition<IntArray>> run(String input) throws Exception {
// TODO Auto-generated method stub
String fileName = (String) input;
ArrayList<Partition<IntArray>> partialGraphDataList = new ArrayList<Partition<IntArray>>();
Path pointFilePath = new Path(fileName);
FileSystem fs =pointFilePath.getFileSystem(conf);
FSDataInputStream in = fs.open(pointFilePath);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
try {
String line ="";
while((line=br.readLine())!=null){
line = line.trim();
String splits[] = line.split("\\s+");
String keyText = splits[0];
int key = Integer.parseInt(keyText);
if( splits.length == 2){
String valueText = splits[1];
String[] itr = valueText.split(",");
int length = itr.length;
int[] intValues = new int[length];
max_v_id = key > max_v_id? key: max_v_id;
vert_num_local++;
adjacent_local_num += length;
for(int i=0; i< length; i++){
intValues[i]= Integer.parseInt(itr[i]);
}
Partition<IntArray> partialgraph = new Partition<IntArray>(key, new IntArray(intValues, 0, length));
partialGraphDataList.add(partialgraph);
}
}
} finally {
in.close();
}
return partialGraphDataList;
}
int get_vert_num_local() {
return vert_num_local;
}
int get_adjacent_local_num() {
return adjacent_local_num;
}
int get_max_v_id() {
return max_v_id;
}
}
| [
"lc37@indiana.edu"
] | lc37@indiana.edu |
bef29f083c84c79edc9b51f56348ec0351c58b31 | ad5a78d7a0af9deaf916bd674d555f4862872429 | /code/src/testing/structure_tests_into_given_when_then/solution/CruiseControlTest.java | b8a792793193560660518fabf888f3f746bb8576 | [] | no_license | memopena/JavaByComparison | 39bb6f7e9e070eea3f3c06addf6242ed8c90c48d | 59ca51a6c1114f01f8137027badc37f98865dd3f | refs/heads/master | 2020-09-20T13:09:30.221926 | 2019-11-27T18:12:51 | 2019-11-27T18:12:51 | 224,490,571 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,228 | java | /***
* Excerpted from "Java By Comparison",
* published by The Pragmatic Bookshelf.
* Copyrights apply to this code. It may not be used to create training material,
* courses, books, articles, and the like. Contact us if you are in doubt.
* We make no guarantees that this code is fit for any purpose.
* Visit http://www.pragmaticprogrammer.com/titles/javacomp for more book information.
***/
package testing.structure_tests_into_given_when_then.solution;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import testing.expected_before_actual_value.CruiseControl;
import testing.expected_before_actual_value.SpeedPreset;
class CruiseControlTest {
@Test
void setPlanetarySpeedIs7667() {
CruiseControl cruiseControl = new CruiseControl();
cruiseControl.setPreset(SpeedPreset.PLANETARY_SPEED);
Assertions.assertTrue(7667 == cruiseControl.getTargetSpeedKmh());
}
}
class Other {
void otherTest() {
// given
CruiseControl cruiseControl = new CruiseControl();
// when
cruiseControl.setPreset(SpeedPreset.PLANETARY_SPEED);
// then
Assertions.assertTrue(7667 == cruiseControl.getTargetSpeedKmh());
}
}
| [
"guillermo.pena@wolterskluwer.com"
] | guillermo.pena@wolterskluwer.com |
e4247ee5e4f1ae309296cb4053847167f09ec23f | e1b7337903340be36d5c3f91b50fa45642312300 | /ReactNativeApp/myApp/node_modules/react-native-firebase/android/build/generated/not_namespaced_r_class_sources/debug/generateDebugRFile/out/android/support/fragment/R.java | 57c546d631bbee594a4595f0635caed8999adfd2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | FarhanKasmani/KYChain | 784a1135fba3aa68409aad792f5471e20fef4644 | 0c1e0f5741d7fa0050a99993d2fce276a4c13403 | refs/heads/master | 2022-12-22T07:18:03.792286 | 2020-03-16T20:57:22 | 2020-03-16T20:57:22 | 176,812,334 | 3 | 0 | null | 2022-12-10T21:51:47 | 2019-03-20T20:31:56 | Python | UTF-8 | Java | false | false | 11,443 | 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 android.support.fragment;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static int alpha = 0x7f04002b;
public static int coordinatorLayoutStyle = 0x7f040063;
public static int font = 0x7f04007b;
public static int fontProviderAuthority = 0x7f04007d;
public static int fontProviderCerts = 0x7f04007e;
public static int fontProviderFetchStrategy = 0x7f04007f;
public static int fontProviderFetchTimeout = 0x7f040080;
public static int fontProviderPackage = 0x7f040081;
public static int fontProviderQuery = 0x7f040082;
public static int fontStyle = 0x7f040083;
public static int fontVariationSettings = 0x7f040084;
public static int fontWeight = 0x7f040085;
public static int keylines = 0x7f040095;
public static int layout_anchor = 0x7f040098;
public static int layout_anchorGravity = 0x7f040099;
public static int layout_behavior = 0x7f04009a;
public static int layout_dodgeInsetEdges = 0x7f04009b;
public static int layout_insetEdge = 0x7f04009c;
public static int layout_keyline = 0x7f04009d;
public static int statusBarBackground = 0x7f0400ef;
public static int ttcIndex = 0x7f040122;
}
public static final class color {
private color() {}
public static int notification_action_color_filter = 0x7f06003e;
public static int notification_icon_bg_color = 0x7f06003f;
public static int ripple_material_light = 0x7f06004a;
public static int secondary_text_default_material_light = 0x7f06004c;
}
public static final class dimen {
private dimen() {}
public static int compat_button_inset_horizontal_material = 0x7f08004c;
public static int compat_button_inset_vertical_material = 0x7f08004d;
public static int compat_button_padding_horizontal_material = 0x7f08004e;
public static int compat_button_padding_vertical_material = 0x7f08004f;
public static int compat_control_corner_material = 0x7f080050;
public static int compat_notification_large_icon_max_height = 0x7f080051;
public static int compat_notification_large_icon_max_width = 0x7f080052;
public static int notification_action_icon_size = 0x7f08005c;
public static int notification_action_text_size = 0x7f08005d;
public static int notification_big_circle_margin = 0x7f08005e;
public static int notification_content_margin_start = 0x7f08005f;
public static int notification_large_icon_height = 0x7f080060;
public static int notification_large_icon_width = 0x7f080061;
public static int notification_main_column_padding_top = 0x7f080062;
public static int notification_media_narrow_margin = 0x7f080063;
public static int notification_right_icon_size = 0x7f080064;
public static int notification_right_side_padding_top = 0x7f080065;
public static int notification_small_icon_background_padding = 0x7f080066;
public static int notification_small_icon_size_as_large = 0x7f080067;
public static int notification_subtext_size = 0x7f080068;
public static int notification_top_pad = 0x7f080069;
public static int notification_top_pad_large_text = 0x7f08006a;
}
public static final class drawable {
private drawable() {}
public static int notification_action_background = 0x7f090055;
public static int notification_bg = 0x7f090056;
public static int notification_bg_low = 0x7f090057;
public static int notification_bg_low_normal = 0x7f090058;
public static int notification_bg_low_pressed = 0x7f090059;
public static int notification_bg_normal = 0x7f09005a;
public static int notification_bg_normal_pressed = 0x7f09005b;
public static int notification_icon_background = 0x7f09005c;
public static int notification_template_icon_bg = 0x7f09005d;
public static int notification_template_icon_low_bg = 0x7f09005e;
public static int notification_tile_bg = 0x7f09005f;
public static int notify_panel_notification_icon_bg = 0x7f090060;
}
public static final class id {
private id() {}
public static int action_container = 0x7f0c000b;
public static int action_divider = 0x7f0c000d;
public static int action_image = 0x7f0c000e;
public static int action_text = 0x7f0c0014;
public static int actions = 0x7f0c0015;
public static int async = 0x7f0c0019;
public static int blocking = 0x7f0c001a;
public static int bottom = 0x7f0c001b;
public static int chronometer = 0x7f0c0023;
public static int end = 0x7f0c002b;
public static int forever = 0x7f0c0035;
public static int icon = 0x7f0c0039;
public static int icon_group = 0x7f0c003a;
public static int info = 0x7f0c003c;
public static int italic = 0x7f0c003d;
public static int left = 0x7f0c003e;
public static int line1 = 0x7f0c003f;
public static int line3 = 0x7f0c0040;
public static int none = 0x7f0c0046;
public static int normal = 0x7f0c0047;
public static int notification_background = 0x7f0c0048;
public static int notification_main_column = 0x7f0c0049;
public static int notification_main_column_container = 0x7f0c004a;
public static int right = 0x7f0c0050;
public static int right_icon = 0x7f0c0051;
public static int right_side = 0x7f0c0052;
public static int start = 0x7f0c0072;
public static int tag_transition_group = 0x7f0c0077;
public static int tag_unhandled_key_event_manager = 0x7f0c0078;
public static int tag_unhandled_key_listeners = 0x7f0c0079;
public static int text = 0x7f0c007a;
public static int text2 = 0x7f0c007b;
public static int time = 0x7f0c007e;
public static int title = 0x7f0c007f;
public static int top = 0x7f0c0082;
}
public static final class integer {
private integer() {}
public static int status_bar_notification_info_maxnum = 0x7f0d0005;
}
public static final class layout {
private layout() {}
public static int notification_action = 0x7f0f001f;
public static int notification_action_tombstone = 0x7f0f0020;
public static int notification_template_custom_big = 0x7f0f0027;
public static int notification_template_icon_group = 0x7f0f0028;
public static int notification_template_part_chronometer = 0x7f0f002c;
public static int notification_template_part_time = 0x7f0f002d;
}
public static final class string {
private string() {}
public static int status_bar_notification_info_overflow = 0x7f150046;
}
public static final class style {
private style() {}
public static int TextAppearance_Compat_Notification = 0x7f1600f7;
public static int TextAppearance_Compat_Notification_Info = 0x7f1600f8;
public static int TextAppearance_Compat_Notification_Line2 = 0x7f1600fa;
public static int TextAppearance_Compat_Notification_Time = 0x7f1600fd;
public static int TextAppearance_Compat_Notification_Title = 0x7f1600ff;
public static int Widget_Compat_NotificationActionContainer = 0x7f160170;
public static int Widget_Compat_NotificationActionText = 0x7f160171;
public static int Widget_Support_CoordinatorLayout = 0x7f160172;
}
public static final class styleable {
private styleable() {}
public static int[] ColorStateListItem = { 0x7f04002b, 0x101031f, 0x10101a5 };
public static int ColorStateListItem_alpha = 0;
public static int ColorStateListItem_android_alpha = 1;
public static int ColorStateListItem_android_color = 2;
public static int[] CoordinatorLayout = { 0x7f040095, 0x7f0400ef };
public static int CoordinatorLayout_keylines = 0;
public static int CoordinatorLayout_statusBarBackground = 1;
public static int[] CoordinatorLayout_Layout = { 0x10100b3, 0x7f040098, 0x7f040099, 0x7f04009a, 0x7f04009b, 0x7f04009c, 0x7f04009d };
public static int CoordinatorLayout_Layout_android_layout_gravity = 0;
public static int CoordinatorLayout_Layout_layout_anchor = 1;
public static int CoordinatorLayout_Layout_layout_anchorGravity = 2;
public static int CoordinatorLayout_Layout_layout_behavior = 3;
public static int CoordinatorLayout_Layout_layout_dodgeInsetEdges = 4;
public static int CoordinatorLayout_Layout_layout_insetEdge = 5;
public static int CoordinatorLayout_Layout_layout_keyline = 6;
public static int[] FontFamily = { 0x7f04007d, 0x7f04007e, 0x7f04007f, 0x7f040080, 0x7f040081, 0x7f040082 };
public static int FontFamily_fontProviderAuthority = 0;
public static int FontFamily_fontProviderCerts = 1;
public static int FontFamily_fontProviderFetchStrategy = 2;
public static int FontFamily_fontProviderFetchTimeout = 3;
public static int FontFamily_fontProviderPackage = 4;
public static int FontFamily_fontProviderQuery = 5;
public static int[] FontFamilyFont = { 0x1010532, 0x101053f, 0x1010570, 0x1010533, 0x101056f, 0x7f04007b, 0x7f040083, 0x7f040084, 0x7f040085, 0x7f040122 };
public static int FontFamilyFont_android_font = 0;
public static int FontFamilyFont_android_fontStyle = 1;
public static int FontFamilyFont_android_fontVariationSettings = 2;
public static int FontFamilyFont_android_fontWeight = 3;
public static int FontFamilyFont_android_ttcIndex = 4;
public static int FontFamilyFont_font = 5;
public static int FontFamilyFont_fontStyle = 6;
public static int FontFamilyFont_fontVariationSettings = 7;
public static int FontFamilyFont_fontWeight = 8;
public static int FontFamilyFont_ttcIndex = 9;
public static int[] GradientColor = { 0x101020b, 0x10101a2, 0x10101a3, 0x101019e, 0x1010512, 0x1010513, 0x10101a4, 0x101019d, 0x1010510, 0x1010511, 0x1010201, 0x10101a1 };
public static int GradientColor_android_centerColor = 0;
public static int GradientColor_android_centerX = 1;
public static int GradientColor_android_centerY = 2;
public static int GradientColor_android_endColor = 3;
public static int GradientColor_android_endX = 4;
public static int GradientColor_android_endY = 5;
public static int GradientColor_android_gradientRadius = 6;
public static int GradientColor_android_startColor = 7;
public static int GradientColor_android_startX = 8;
public static int GradientColor_android_startY = 9;
public static int GradientColor_android_tileMode = 10;
public static int GradientColor_android_type = 11;
public static int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static int GradientColorItem_android_color = 0;
public static int GradientColorItem_android_offset = 1;
}
}
| [
"farhankasmani956@gmail.com"
] | farhankasmani956@gmail.com |
ff5f996b5d4e3b92df2b94720244da748aa2affe | db97ce70bd53e5c258ecda4c34a5ec641e12d488 | /src/main/java/com/alipay/api/response/AlipayOpenMiniInnerbaseinfoQueryResponse.java | 871f7f820735850cfe5910a9e41738334b7fec50 | [
"Apache-2.0"
] | permissive | smitzhang/alipay-sdk-java-all | dccc7493c03b3c937f93e7e2be750619f9bed068 | a835a9c91e800e7c9350d479e84f9a74b211f0c4 | refs/heads/master | 2022-11-23T20:32:27.041116 | 2020-08-03T13:03:02 | 2020-08-03T13:03:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,757 | java | package com.alipay.api.response;
import java.util.Date;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.open.mini.innerbaseinfo.query response.
*
* @author auto create
* @since 1.0, 2020-07-28 20:35:20
*/
public class AlipayOpenMiniInnerbaseinfoQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 3757694886664755216L;
/**
* 小程序别名,简称
*/
@ApiField("app_alias_name")
private String appAliasName;
/**
* 类目Id列表
*/
@ApiField("app_category_ids")
private String appCategoryIds;
/**
* 小程序应用描述
*/
@ApiField("app_desc")
private String appDesc;
/**
* 小程序英文名称
*/
@ApiField("app_english_name")
private String appEnglishName;
/**
* 手淘开放平台鉴权key,支付宝不需要
*/
@ApiField("app_key")
private String appKey;
/**
* 小程序应用logo图标
*/
@ApiField("app_logo")
private String appLogo;
/**
* 小程序名称
*/
@ApiField("app_name")
private String appName;
/**
* 小程序简介
*/
@ApiField("app_slogan")
private String appSlogan;
/**
* 小程序类型,TINYAPP_TEMPLATE,TINYAPP_NORMAL,TINYAPP_PLUGIN
*/
@ApiField("app_sub_type")
private String appSubType;
/**
* 小程序所属主体信息
*/
@ApiField("dev_id")
private String devId;
/**
* 小程序主体创建时间
*/
@ApiField("gmt_create")
private Date gmtCreate;
/**
* 小程序主体更新时间
*/
@ApiField("gmt_modified")
private Date gmtModified;
/**
* 小程序Id
*/
@ApiField("mini_app_id")
private String miniAppId;
/**
* 应用创建来源,alipay = 支付宝,taobao = 淘宝
*/
@ApiField("origin")
private String origin;
/**
* 小程序主体信息
*/
@ApiField("owner_entity")
private String ownerEntity;
/**
* 小程序客服邮箱
*/
@ApiField("service_email")
private String serviceEmail;
/**
* 小程序客服电话
*/
@ApiField("service_phone")
private String servicePhone;
public void setAppAliasName(String appAliasName) {
this.appAliasName = appAliasName;
}
public String getAppAliasName( ) {
return this.appAliasName;
}
public void setAppCategoryIds(String appCategoryIds) {
this.appCategoryIds = appCategoryIds;
}
public String getAppCategoryIds( ) {
return this.appCategoryIds;
}
public void setAppDesc(String appDesc) {
this.appDesc = appDesc;
}
public String getAppDesc( ) {
return this.appDesc;
}
public void setAppEnglishName(String appEnglishName) {
this.appEnglishName = appEnglishName;
}
public String getAppEnglishName( ) {
return this.appEnglishName;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public String getAppKey( ) {
return this.appKey;
}
public void setAppLogo(String appLogo) {
this.appLogo = appLogo;
}
public String getAppLogo( ) {
return this.appLogo;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getAppName( ) {
return this.appName;
}
public void setAppSlogan(String appSlogan) {
this.appSlogan = appSlogan;
}
public String getAppSlogan( ) {
return this.appSlogan;
}
public void setAppSubType(String appSubType) {
this.appSubType = appSubType;
}
public String getAppSubType( ) {
return this.appSubType;
}
public void setDevId(String devId) {
this.devId = devId;
}
public String getDevId( ) {
return this.devId;
}
public void setGmtCreate(Date gmtCreate) {
this.gmtCreate = gmtCreate;
}
public Date getGmtCreate( ) {
return this.gmtCreate;
}
public void setGmtModified(Date gmtModified) {
this.gmtModified = gmtModified;
}
public Date getGmtModified( ) {
return this.gmtModified;
}
public void setMiniAppId(String miniAppId) {
this.miniAppId = miniAppId;
}
public String getMiniAppId( ) {
return this.miniAppId;
}
public void setOrigin(String origin) {
this.origin = origin;
}
public String getOrigin( ) {
return this.origin;
}
public void setOwnerEntity(String ownerEntity) {
this.ownerEntity = ownerEntity;
}
public String getOwnerEntity( ) {
return this.ownerEntity;
}
public void setServiceEmail(String serviceEmail) {
this.serviceEmail = serviceEmail;
}
public String getServiceEmail( ) {
return this.serviceEmail;
}
public void setServicePhone(String servicePhone) {
this.servicePhone = servicePhone;
}
public String getServicePhone( ) {
return this.servicePhone;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
b85ff155e0b6a9e86e9e003a1aecd630221b3f3c | b3bc811a51bace08c951e2c85a02f0ab3ed5cbe6 | /src/main/java/pl/lodz/pas/librarianrest/web/controllers/SelfController.java | 7ed5c108b0c692b2faec77ac3275de6ba7b929da | [] | no_license | lupuuss/LibrarianRest | 4e27b6591a4b32d15c328de5f637c4cefd01ccf9 | 05ef61919a04d17e31d397587230e3003e763acd | refs/heads/master | 2023-02-16T16:41:47.410373 | 2021-01-18T00:35:04 | 2021-01-18T00:35:04 | 329,132,487 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,990 | java | package pl.lodz.pas.librarianrest.web.controllers;
import pl.lodz.pas.librarianrest.Utils;
import pl.lodz.pas.librarianrest.web.controllers.objects.BookCopyRequest;
import pl.lodz.pas.librarianrest.web.controllers.objects.MagazineCopyRequest;
import pl.lodz.pas.librarianrest.services.LendingsService;
import pl.lodz.pas.librarianrest.services.UsersService;
import pl.lodz.pas.librarianrest.services.exceptions.ServiceException;
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import java.util.List;
@Named
@Stateless
@Path("self")
public class SelfController {
@Inject
private UsersService usersService;
@Inject
private LendingsService lendingsService;
@Context
private SecurityContext context;
@GET
@Path("user")
public Response getUser() {
var principle = context.getUserPrincipal();
if (principle == null) return Response.status(Response.Status.UNAUTHORIZED).build();
var user = usersService.getUserByLogin(principle.getName());
return Response.ok(user).build();
}
@GET
@Path("lending")
public Response getLendings() {
var principle = context.getUserPrincipal();
if (principle == null) return Response.status(Response.Status.UNAUTHORIZED).build();
var lendings = lendingsService.getLendingsForUser(principle.getName());
return Response
.ok(lendings)
.build();
}
@POST
@Path("lending")
public Response lendElements(@NotNull List<String> ids) throws ServiceException {
var principle = context.getUserPrincipal();
if (principle == null) return Response.status(Response.Status.UNAUTHORIZED).build();
if (ids.contains(null) || !ids.stream().allMatch(Utils::isValidUuid)) {
return Response.status(Response.Status.BAD_REQUEST).build();
}
var lendings = lendingsService.lendCopiesByIds(principle.getName(), ids);
return Response.ok(lendings).build();
}
@POST
@Path("lock/book")
public Response lockBook(@NotNull @Valid BookCopyRequest request) throws ServiceException {
var principle = context.getUserPrincipal();
if (principle == null) return Response.status(Response.Status.UNAUTHORIZED).build();
var lock = lendingsService.lockBook(
request.getIsbn(),
principle.getName(),
request.getState()
);
return Response.ok(lock).build();
}
@POST
@Path("lock/magazine")
public Response lockMagazine(@NotNull @Valid MagazineCopyRequest request) throws ServiceException {
var principle = context.getUserPrincipal();
if (principle == null) return Response.status(Response.Status.UNAUTHORIZED).build();
var lock = lendingsService.lockMagazine(
request.getIssn(),
request.getIssue(),
principle.getName(),
request.getState()
);
return Response.ok(lock).build();
}
@DELETE
@Path("lock/book/{id}")
public Response unlockBook(@PathParam("id") String id) {
return unlockElement(id);
}
@DELETE
@Path("lock/magazine/{id}")
public Response unlockMagazine(@PathParam("id") String id) {
return unlockElement(id);
}
private Response unlockElement(String id) {
var principle = context.getUserPrincipal();
if (!Utils.isValidUuid(id)) {
return Response.status(Response.Status.BAD_REQUEST).build();
}
if (principle == null) return Response.status(Response.Status.UNAUTHORIZED).build();
lendingsService.unlockCopy(principle.getName(), id);
return Response.ok().build();
}
}
| [
"224250@edu.p.lodz.pl"
] | 224250@edu.p.lodz.pl |
653d827e557b9121b6b47bc2a64605cc6a6b6c81 | fd43af6079d239eab4caacd27551b814087f2c1c | /cliente/src/publicar/WebServicesService.java | d619d0c83103bb64d870d8b479c09408af74388a | [] | no_license | sdkd17/pruebaWS | 7f13bebc82fa8082defc2ef4cf7899f8f0bed40c | 1267eff5d601e7e0fec37fb4d6e8f85f3bc74fea | refs/heads/master | 2021-07-21T00:13:47.696312 | 2017-10-29T13:44:19 | 2017-10-29T13:44:19 | 108,735,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,996 | java |
package publicar;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by the JAX-WS RI.
* JAX-WS RI 2.2.9-b130926.1035
* Generated source version: 2.2
*
*/
@WebServiceClient(name = "WebServicesService", targetNamespace = "http://publicar/", wsdlLocation = "http://192.168.0.3:9130/publicador?wsdl")
public class WebServicesService
extends Service
{
private final static URL WEBSERVICESSERVICE_WSDL_LOCATION;
private final static WebServiceException WEBSERVICESSERVICE_EXCEPTION;
private final static QName WEBSERVICESSERVICE_QNAME = new QName("http://publicar/", "WebServicesService");
static {
URL url = null;
WebServiceException e = null;
try {
url = new URL("http://192.168.0.3:9130/publicador?wsdl");
} catch (MalformedURLException ex) {
e = new WebServiceException(ex);
}
WEBSERVICESSERVICE_WSDL_LOCATION = url;
WEBSERVICESSERVICE_EXCEPTION = e;
}
public WebServicesService() {
super(__getWsdlLocation(), WEBSERVICESSERVICE_QNAME);
}
public WebServicesService(WebServiceFeature... features) {
super(__getWsdlLocation(), WEBSERVICESSERVICE_QNAME, features);
}
public WebServicesService(URL wsdlLocation) {
super(wsdlLocation, WEBSERVICESSERVICE_QNAME);
}
public WebServicesService(URL wsdlLocation, WebServiceFeature... features) {
super(wsdlLocation, WEBSERVICESSERVICE_QNAME, features);
}
public WebServicesService(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public WebServicesService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns WebServices
*/
@WebEndpoint(name = "WebServicesPort")
public WebServices getWebServicesPort() {
return super.getPort(new QName("http://publicar/", "WebServicesPort"), WebServices.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns WebServices
*/
@WebEndpoint(name = "WebServicesPort")
public WebServices getWebServicesPort(WebServiceFeature... features) {
return super.getPort(new QName("http://publicar/", "WebServicesPort"), WebServices.class, features);
}
private static URL __getWsdlLocation() {
if (WEBSERVICESSERVICE_EXCEPTION!= null) {
throw WEBSERVICESSERVICE_EXCEPTION;
}
return WEBSERVICESSERVICE_WSDL_LOCATION;
}
}
| [
"sergiopilu@hotmail.com"
] | sergiopilu@hotmail.com |
eca128c20d4c2e027c40223d216a023d14eacfd6 | 609c6633bf456f50a39394d93a69b9c3e9084666 | /src/test/java/me/alidg/errors/adapter/attributes/ExceptionsTest.java | 9856293667b7a8e091196b4fc665d0d70d585a3d | [
"Apache-2.0"
] | permissive | mona-mohamadinia/errors-spring-boot-starter | 32e187bad6838c22038934da85ad87993ceb2d9c | cda3a7b25c075e1a80e40f7e9bf84bcd1a569147 | refs/heads/master | 2020-04-29T08:44:01.821935 | 2019-04-04T16:12:23 | 2019-04-04T16:12:23 | 175,996,778 | 2 | 0 | null | 2019-03-16T16:33:35 | 2019-03-16T16:33:35 | null | UTF-8 | Java | false | false | 1,305 | java | package me.alidg.errors.adapter.attributes;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.HashMap;
import java.util.Map;
import static me.alidg.Params.p;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Unit tests for {@link Exceptions} class.
*
* @author Ali Dehghani
*/
@RunWith(JUnitParamsRunner.class)
public class ExceptionsTest {
@Test
@Parameters(method = "provideParams")
public void refineUnknownException_ShouldMapTheStatusCodeToExceptionAsExpected(Object code, String expected) {
Map<String, Object> attributes = null;
if (code != null) {
attributes = new HashMap<>();
attributes.put("status", code);
}
assertThat(Exceptions.refineUnknownException(attributes).getClass().getSimpleName())
.isEqualTo(expected);
}
private Object[] provideParams() {
return p(
p("dqd", "IllegalStateException"),
p(null, "IllegalStateException"),
p(12, "IllegalStateException"),
p(401, "UnauthorizedException"),
p(403, "ForbiddenException"),
p(404, "HandlerNotFoundException")
);
}
}
| [
"noreply@github.com"
] | mona-mohamadinia.noreply@github.com |
a0ddba2bd88e1ea6065d804a52732e13ef8ba502 | 98dd399efd89bd4a6d380075d98ba9bcfc1feabf | /REST_demo/src/main/java/ru/softlab/REST_demo/service/LibraryService.java | eaa0fad01913ab6058e163871b9f0d05958195a5 | [] | no_license | Unforgiven/ReactJS_demo | dfc02f16c004fe3efd79ad607119d89553611a69 | 1fea6b8024ea35344cc504a94f346840f0249083 | refs/heads/main | 2023-06-03T03:14:12.659069 | 2021-06-21T10:53:58 | 2021-06-21T10:53:58 | 378,887,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,667 | java | package ru.softlab.REST_demo.service;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
import ru.softlab.REST_demo.domain.Book;
import ru.softlab.REST_demo.repos.BookRepo;
import java.util.List;
@Service
public class LibraryService {
@Autowired
BookRepo bookRepo;
public LibraryService() {
}
public ResponseEntity<Iterable<Book>> findAll() {
return new ResponseEntity<>(bookRepo.findAll(), HttpStatus.OK);
}
public ResponseEntity<Book> findById(Long id) {
return new ResponseEntity<>(bookRepo.findById(id).get(), HttpStatus.OK);
}
public ResponseEntity<List<Book>> findByAuthor(String author) {
return new ResponseEntity<>(bookRepo.findByAuthor(author), HttpStatus.OK);
}
public ResponseEntity<Book> create(Book book) {
return new ResponseEntity<>(bookRepo.save(book), HttpStatus.CREATED);
}
public ResponseEntity<Book> update(Book book) {
return new ResponseEntity<>(bookRepo.save(book), HttpStatus.OK);
}
public String delete(Long id) {
JSONObject jsonObject = new JSONObject();
try {
bookRepo.delete(bookRepo.findById(id).get());
jsonObject.put("message", "Book was deleted");
}
catch (Exception e) {
e.printStackTrace();
}
return jsonObject.toString();
}
}
| [
"noreply@github.com"
] | Unforgiven.noreply@github.com |
706435f09ce8b037b242f23728789f483227760b | b27eac6fbf2b7b743957fe2f903cc5284e1d37a4 | /app/src/androidTest/java/com/aac/wsg/alyssa/ApplicationTest.java | 5f849b0251ae57dd5607034ebd0b4940a8cbb71e | [] | no_license | froyo-yoyo/alyssa | d41cf3f94e7a9e76a8e9fd255dc4e80d62c8b4cc | ecbe707b35d626b1e0b898e0e92f460541b2651c | refs/heads/master | 2021-01-01T04:44:55.011471 | 2016-06-04T22:48:44 | 2016-06-04T22:48:44 | 59,345,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 349 | java | package com.aac.wsg.alyssa;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
} | [
"yamihotaru16@gmail.com"
] | yamihotaru16@gmail.com |
e24ccc5e93766803d02ee48c90df054328165cf7 | 823977034599455d1be91496e7f6b0753665a993 | /android/hackathonovo/app/src/main/java/eu/hackathonovo/data/storage/SecureSharedPreferences.java | 53cc69e58efbbc49d938b81f27275b3bc56f832d | [
"CC-BY-4.0",
"CC-BY-3.0",
"Apache-2.0"
] | permissive | tinoba/do-you-even-code | 528fff151c4b06bd983798862fd705890c947c26 | 71516c43a2873e18650168c9bc11b3a55572e109 | refs/heads/master | 2021-01-16T19:37:07.772891 | 2017-05-21T08:14:15 | 2017-05-21T08:14:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,894 | java | package eu.hackathonovo.data.storage;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.Settings;
import android.support.annotation.Nullable;
import android.util.Base64;
import java.util.Map;
import java.util.Set;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.PBEParameterSpec;
import static android.provider.Settings.Secure.ANDROID_ID;
public final class SecureSharedPreferences implements SharedPreferences {
private static final String UTF8 = "utf-8";
private static final String ENCRYPTION_DECRYPTION_METHOD = "PBEWithMD5AndDES";
private static final int ITERATION_COUNT = 20;
private final char[] pbePassword;
protected Context context;
private SharedPreferences preferences;
public SecureSharedPreferences(final Context context, final SharedPreferences delegate, final String secret) {
this.preferences = delegate;
this.context = context;
this.pbePassword = secret.toCharArray();
}
public Editor edit() {
return new Editor();
}
/**
* NOT SUPPORTED
*/
@Override
public Map<String, ?> getAll() {
throw new UnsupportedOperationException();
}
@Override
public boolean getBoolean(final String key, final boolean defValue) {
final String v = preferences.getString(key, null);
return v != null ? Boolean.parseBoolean(decrypt(v)) : defValue;
}
@Override
public float getFloat(final String key, final float defValue) {
final String v = preferences.getString(key, null);
return v != null ? Float.parseFloat(decrypt(v)) : defValue;
}
@Override
public int getInt(final String key, final int defValue) {
final String v = preferences.getString(key, null);
return v != null ? Integer.parseInt(decrypt(v)) : defValue;
}
@Override
public long getLong(final String key, final long defValue) {
final String v = preferences.getString(key, null);
return v != null ? Long.parseLong(decrypt(v)) : defValue;
}
@Override
public String getString(final String key, final String defValue) {
final String v = preferences.getString(key, null);
return v != null ? decrypt(v) : defValue;
}
/**
* NOT SUPPORTED
*/
@Nullable
@Override
public Set<String> getStringSet(final String key, final Set<String> defValues) {
throw new UnsupportedOperationException();
}
@Override
public boolean contains(final String s) {
return preferences.contains(s);
}
@Override
public void registerOnSharedPreferenceChangeListener(final OnSharedPreferenceChangeListener onSharedPreferenceChangeListener) {
preferences.registerOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
}
@Override
public void unregisterOnSharedPreferenceChangeListener(final OnSharedPreferenceChangeListener onSharedPreferenceChangeListener) {
preferences.unregisterOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
}
/**
* Encrypts value using PBE with MD5 and DES.
*
* @param value value to be encrypted.
* @return encrypted value.
*/
private String encrypt(final String value) {
try {
final byte[] bytes = value != null ? value.getBytes(UTF8) : new byte[0];
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ENCRYPTION_DECRYPTION_METHOD);
SecretKey key = keyFactory.generateSecret(new PBEKeySpec(pbePassword));
Cipher pbeCipher = Cipher.getInstance(ENCRYPTION_DECRYPTION_METHOD);
pbeCipher.init(Cipher.ENCRYPT_MODE, key, new PBEParameterSpec(
Settings.Secure.getString(context.getContentResolver(), ANDROID_ID).getBytes(UTF8), ITERATION_COUNT));
return new String(Base64.encode(pbeCipher.doFinal(bytes), Base64.NO_WRAP), UTF8);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* Decrypts encrypted value using PBE with MD5 and DES.
*
* @param value value to be decrypted.
* @return original value.
*/
private String decrypt(final String value) {
try {
final byte[] bytes = value != null ? Base64.decode(value, Base64.DEFAULT) : new byte[0];
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ENCRYPTION_DECRYPTION_METHOD);
SecretKey key = keyFactory.generateSecret(new PBEKeySpec(pbePassword));
Cipher pbeCipher = Cipher.getInstance(ENCRYPTION_DECRYPTION_METHOD);
pbeCipher.init(Cipher.DECRYPT_MODE, key,
new PBEParameterSpec(Settings.Secure.getString(context.getContentResolver(), ANDROID_ID).getBytes(UTF8),
ITERATION_COUNT));
return new String(pbeCipher.doFinal(bytes), UTF8);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private final class Editor implements SharedPreferences.Editor {
SharedPreferences.Editor delegate;
Editor() {
this.delegate = SecureSharedPreferences.this.preferences.edit();
}
@Override
public Editor putBoolean(String key, boolean value) {
delegate.putString(key, encrypt(Boolean.toString(value)));
return this;
}
@Override
public Editor putFloat(String key, float value) {
delegate.putString(key, encrypt(Float.toString(value)));
return this;
}
@Override
public Editor putInt(String key, int value) {
delegate.putString(key, encrypt(Integer.toString(value)));
return this;
}
@Override
public Editor putLong(String key, long value) {
delegate.putString(key, encrypt(Long.toString(value)));
return this;
}
@Override
public Editor putString(String key, String value) {
delegate.putString(key, encrypt(value));
return this;
}
@Override
public SharedPreferences.Editor putStringSet(String key, Set<String> values) {
delegate.putStringSet(key, values);
return this;
}
@Override
public void apply() {
delegate.apply();
}
@Override
public Editor clear() {
delegate.clear();
return this;
}
@Override
public boolean commit() {
return delegate.commit();
}
@Override
public Editor remove(String s) {
delegate.remove(s);
return this;
}
}
}
| [
"embalint8@gmail.com"
] | embalint8@gmail.com |
3b00e815a0921aa2387f4deca60b1c8eeb10acff | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/digits/313d572e1f050451c688b97510efa105685fa275a8442f9119ce9b3f85f46e234cdf03593568e19798aed6b79c66f45c97be937d09b6ff9544f0f59162538575/000/mutations/2506/digits_313d572e_000.java | cf2efc7b4b2fbe3828de3a395263223b3d820891 | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,726 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class digits_313d572e_000 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
digits_313d572e_000 mainClass = new digits_313d572e_000 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
IntObj given = new IntObj (), digit10 = new IntObj (), digit9 =
new IntObj (), digit8 = new IntObj (), digit7 = new IntObj (), digit6 =
new IntObj (), digit5 = new IntObj (), digit4 = new IntObj (), digit3 =
new IntObj (), digit2 = new IntObj (), digit1 = new IntObj ();
output += (String.format ("\nEnter an interger > "));
given.value = scanner.nextInt ();
if (given.value >= 1 && given.value < 10) {
digit10.value = given.value % 10;
output +=
(String.format
("\n%d\nThat's all, have a nice day!\n", digit10.value));
}
if (given.value >= 10 && given.value < 100) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
output +=
(String.format
("\n%d\n%d\nThat's all, have a nice day!\n", digit10.value,
digit9.value));
}
if (given.value >= 100 && given.value < 1000) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = (given.value / 100) % 10;
output +=
(String.format ("\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value));
}
if (given.value >= 1000 && given.value < 10000) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = 1000 % 10;
digit7.value = (given.value / 1000) % 10;
output +=
(String.format ("\n%d\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value,
digit7.value));
}
if (given.value >= 10000 && given.value < 100000) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = (given.value / 100) % 10;
digit7.value = (given.value / 1000) % 10;
digit6.value = (given.value / 10000) % 10;
output +=
(String.format
("\n%d\n%d\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value, digit7.value,
digit6.value));
}
if (given.value >= 100000 && given.value < 1000000) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = (given.value / 100) % 10;
digit7.value = (given.value / 1000) % 10;
digit6.value = (given.value / 10000) % 10;
digit5.value = (given.value / 100000) % 10;
output +=
(String.format
("\n%d\n%d\n%d\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value, digit7.value,
digit6.value, digit5.value));
}
if (given.value >= 1000000 && given.value < 10000000) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = (given.value / 100) % 10;
digit7.value = (given.value / 1000) % 10;
digit6.value = (given.value / 10000) % 10;
digit5.value = (given.value / 100000) % 10;
digit4.value = (given.value / 1000000) % 10;
output +=
(String.format
("\n%d\n%d\n%d\n%d\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value, digit7.value,
digit6.value, digit5.value, digit4.value));
}
if (given.value >= 10000000 && given.value < 100000000) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = (given.value / 100) % 10;
digit7.value = (given.value / 1000) % 10;
digit6.value = (given.value / 10000) % 10;
digit5.value = (given.value / 100000) % 10;
digit4.value = (given.value / 1000000) % 10;
digit3.value = (given.value / 10000000) % 10;
output +=
(String.format
("\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value, digit7.value,
digit6.value, digit5.value, digit4.value, digit3.value));
}
if (given.value >= 100000000 && given.value < 1000000000) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = (given.value / 100) % 10;
digit7.value = (given.value / 1000) % 10;
digit6.value = (given.value / 10000) % 10;
digit5.value = (given.value / 100000) % 10;
digit4.value = (given.value / 1000000) % 10;
digit3.value = (given.value / 10000000) % 10;
digit2.value = (given.value / 100000000) % 10;
output +=
(String.format
("\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value, digit7.value,
digit6.value, digit5.value, digit4.value, digit3.value,
digit2.value));
}
if (given.value >= 1000000000 && given.value < 10000000000L) {
digit10.value = given.value % 10;
digit9.value = (given.value / 10) % 10;
digit8.value = (given.value / 100) % 10;
digit7.value = (given.value / 1000) % 10;
digit6.value = (given.value / 10000) % 10;
digit5.value = (given.value / 100000) % 10;
digit4.value = (given.value / 1000000) % 10;
digit3.value = (given.value / 10000000) % 10;
digit2.value = (given.value / 100000000) % 10;
digit1.value = (given.value / 1000000000) % 10;
output +=
(String.format
("\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%d\nThat's all, have a nice day!\n",
digit10.value, digit9.value, digit8.value, digit7.value,
digit6.value, digit5.value, digit4.value, digit3.value,
digit2.value, digit1.value));
}
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
12031f7dd4bde25ccc7d3233675b8af14a48f123 | 59638113d8ecbebc065258f042fff8be7361b346 | /이분탐색/BOJ1654_랜선자르기.java | 0d5c609c80cf0feba9800eff84f77a16d7dda719 | [] | no_license | cheonghwakim/Algo_study | ac4b03384eed97c41fd7b35222aada973115a8ee | f0331b0ef158e2b776cb3aecb6c6c4ca35347d52 | refs/heads/master | 2023-06-16T11:28:13.834500 | 2021-07-13T23:49:06 | 2021-07-13T23:49:06 | 288,377,016 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,098 | java | package boj;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
// 이분 탐색 (int 범위 -2^31 ~ 2^31)
public class BOJ1654_랜선자르기 {
static int K, stick[], max;
static long N, answer;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
K = Integer.parseInt(st.nextToken());
N = Long.parseLong(st.nextToken());
stick = new int[K];
for (int i = 0; i < K; i++) {
stick[i] = Integer.parseInt(br.readLine());
max = max < stick[i] ? stick[i] : max;
}
long start = 1;
long end = max;
long middle;
while(start <= end) {
middle = (start + end) / 2;
long cnt = 0;
for (int i = 0; i < K; i++) {
cnt += stick[i] / middle;
}
if(cnt < N)
end = middle - 1;
else if (cnt >= N) {
start = middle + 1;
answer = answer < middle ? middle : answer;
}
}
System.out.println(answer);
}
}
| [
"cheonghwakim@github.com"
] | cheonghwakim@github.com |
3665cfa09016f89979673a36a71d64f38c5a5a4d | 1442d060199e0bee7067a4ad38abf8bdc1d1b03b | /mvc2tp/src/modele/businesslogiclayer/NoteDAO.java | 30a983a0c010788fccdd2e2b29cf0e1cac0f72b8 | [] | no_license | DevGoodlink/my-jee-tutos | d4eadcea8b38144286b03b6a06fb613dea141d6d | 55707f5ffb322eb7e92428f7dc9fa9e23f0c2387 | refs/heads/master | 2020-12-02T19:21:47.542505 | 2017-07-06T15:31:04 | 2017-07-06T15:31:04 | 96,330,747 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 912 | java | package modele.businesslogiclayer;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import modele.persistencelayer.*;
import modele.persistencelayer.entity.*;
public class NoteDAO {
public ArrayList<Note> findByNumInsEle(String numIns){
ArrayList<Note> notes=new ArrayList<Note>();
Connection con=ConnectionUtil.getConnection();
try {
PreparedStatement ps=con.prepareStatement("select * from Note where numIns=?");
ps.setString(1,numIns);
ResultSet rs=ps.executeQuery();
while(rs.next()){
Note note=new Note();
note.setIdNote(rs.getInt("idNote"));
note.setNumIns(rs.getString("numIns"));
note.setNomMat(rs.getString("nomMat"));
note.setNoteMat(rs.getFloat("noteMat"));
notes.add(note);
}
} catch (SQLException e) {
e.printStackTrace();
}
return notes;
}
}
| [
"goodlink.fes@gmail.com"
] | goodlink.fes@gmail.com |
2288ae98fcb808ab2dc2113e0b9648186a7cb0bb | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_27346.java | 45e29861ae15c5727a1fc99d67252fd05450d76a | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,411 | java | @Nullable private static Intent getReleases(@NonNull Context context,@NonNull Uri uri,boolean isEnterprise){
List<String> segments=uri.getPathSegments();
if (segments != null && segments.size() > 2) {
if (uri.getPathSegments().get(2).equals("releases")) {
String owner=segments.get(0);
String repo=segments.get(1);
String tag=uri.getLastPathSegment();
if (tag != null && !repo.equalsIgnoreCase(tag)) {
if (TextUtils.isDigitsOnly(tag)) {
return ReleasesListActivity.getIntent(context,owner,repo,InputHelper.toLong(tag),isEnterprise);
}
else {
return ReleasesListActivity.getIntent(context,owner,repo,tag,isEnterprise);
}
}
return ReleasesListActivity.getIntent(context,owner,repo);
}
else if (segments.size() > 3 && segments.get(3).equalsIgnoreCase("releases")) {
String owner=segments.get(1);
String repo=segments.get(2);
String tag=uri.getLastPathSegment();
if (tag != null && !repo.equalsIgnoreCase(tag)) {
if (TextUtils.isDigitsOnly(tag)) {
return ReleasesListActivity.getIntent(context,owner,repo,InputHelper.toLong(tag),isEnterprise);
}
else {
return ReleasesListActivity.getIntent(context,owner,repo,tag,isEnterprise);
}
}
return ReleasesListActivity.getIntent(context,owner,repo);
}
return null;
}
return null;
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
2245afc4b22e6401d940c6aa5f4738f128db503b | 40ed3f90a78fc07c1d43f642f18bc5be5098efe6 | /src/main/java/com/gnz48/zzt/util/IpUtil.java | 54a97bc8adb8151795d0c114011e03d0d91f28d2 | [] | no_license | p845591892/zztyyh | e3b6cf3c5a98ef5ea9a225901b4817d424d45ff5 | 197df34305e9f781b87c2cbad53ee8cd117d097d | refs/heads/master | 2022-09-22T23:15:35.801466 | 2019-10-21T02:02:36 | 2019-10-21T02:02:36 | 164,361,032 | 5 | 0 | null | 2022-09-01T23:01:19 | 2019-01-07T01:13:48 | JavaScript | UTF-8 | Java | false | false | 1,465 | java | package com.gnz48.zzt.util;
import java.net.InetAddress;
import java.net.UnknownHostException;
import javax.servlet.http.HttpServletRequest;
public class IpUtil {
public static String getIpAddr(HttpServletRequest request) {
String ipAddress = request.getHeader("x-forwarded-for");
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
String localIp = "127.0.0.1";
String localIpv6 = "0:0:0:0:0:0:0:1";
if (ipAddress.equals(localIp) || ipAddress.equals(localIpv6)) {
// 根据网卡取本机配置的IP
InetAddress inet = null;
try {
inet = InetAddress.getLocalHost();
ipAddress = inet.getHostAddress();
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
}
// 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割
String ipSeparate = ",";
int ipLength = 15;
if (ipAddress != null && ipAddress.length() > ipLength) {
if (ipAddress.indexOf(ipSeparate) > 0) {
ipAddress = ipAddress.substring(0, ipAddress.indexOf(ipSeparate));
}
}
return ipAddress;
}
}
| [
"847109667@qq.com"
] | 847109667@qq.com |
952567c00ecb87975aa997b182dd7beb8c6f5047 | 2c7992509a15273b1e2df26556fb033fe8aee411 | /src/main/java/com/packt/webstore/config/SecurityConfig.java | 7febce705117c9f2a76e7102eb61c266454cc744 | [] | no_license | cllcagri/WebStore | 1dee6bda791a88541c5198eb8dc6bd5bb5c39960 | 1dc634aa6296ee7f02a5071d195952a92d04fa1b | refs/heads/master | 2023-03-02T14:07:13.215902 | 2021-01-27T20:16:08 | 2021-01-27T20:16:08 | 333,546,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,590 | java | package com.packt.webstore.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("Mehmet").password("{noop}pa55word").roles("USER");
auth.inMemoryAuthentication().withUser("admin").password("{noop}root").roles("USER", "ADMIN");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.formLogin().loginPage("/login")
.usernameParameter("userId")
.passwordParameter("password");
http.formLogin().defaultSuccessUrl("/products/add")
.failureUrl("/login?error");
http.logout().logoutSuccessUrl("/login?logout");
http.exceptionHandling().accessDeniedPage("/login?accessDenied");
http.authorizeRequests().antMatchers("/").permitAll()
.antMatchers("/**/add").access("hasRole('ADMIN')")
.antMatchers("**/products/**").access("hasRole('USER')");
http.csrf().disable();
}
}
| [
"c.cagriyilmaz@gmail.com"
] | c.cagriyilmaz@gmail.com |
1c30432c846c4617cb2456b70ac0e8e9c3a97a6a | fd796097ccc3963db643f21e9840a648f14a1c64 | /lab02-Cyclometer/Cyclometer.java | 86bbeaa159ffafc96f8663ef13a2110fdc8b3842 | [] | no_license | luckyyjoyce/CSE2 | 115ffee2f83249f2ca395e663667627fadcbce7b | e761116090c57b8246f7bdcf8ba51cfdb0fc46b7 | refs/heads/master | 2021-01-01T05:51:38.733320 | 2015-04-30T19:46:39 | 2015-04-30T19:46:39 | 29,736,447 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,626 | java | ///////////////////////////
//Ruoting Li
//Jan 30th, 2015
//CSE002
//Cyclometer Java Program
//
// first compile the program
// javac Cyclometer.java
// run the program
// java Cyclometer//
// define a class
public class Cyclometer{
// add main method
public static void main(String[ ] args) {
// my input data
int secsTrip1=480; //the seconds for the first trip
int secsTrip2=3220; //the seconds for the second trip
int countsTrip1=1561; //the counts for the first trip
int countsTrip2=9037; //the counts for the second trip
double wheelDiameter=27.0,
PI=3.14159,
feetPerMile=5280,
inchesPerFoot=12,
secondsPerMinute=60;
double distanceTrip1, distanceTrip2,totalDistance;
System.out.println("Trip 1 took "+(secsTrip1/secondsPerMinute)+" minutes and had " + countsTrip1 + " counts.");
System.out.println("Trip 2 took "+(secsTrip2/secondsPerMinute)+" minutes and had " + countsTrip2 + " counts.");
distanceTrip1=countsTrip1*wheelDiameter*PI;
// Above gives distance in inches
//(for each count, a rotation of the wheel travels
//the diameter in inches times PI)
distanceTrip1/=inchesPerFoot*feetPerMile; // Gives distance in miles
distanceTrip2=countsTrip2*wheelDiameter*PI/inchesPerFoot/feetPerMile;
totalDistance=distanceTrip1+distanceTrip2;
//Print out the output data.
System.out.println("Trip 1 was "+distanceTrip1+" miles");
System.out.println("Trip 2 was "+distanceTrip2+" miles");
System.out.println("The total distance was "+totalDistance+" miles");
} //end of main method
} //end of class
| [
"rul218@lehigh.edu"
] | rul218@lehigh.edu |
b682ad5f5215f6b5c16ed4777e1b9b660d18c568 | e9d11cd6e94873f0f66aa5018c590d9e56325d39 | /app/src/main/java/com/example/abdullahkucuk/fruittuin/Global/Session.java | 10d313bc3830bf0edbe2bef65760f3c54e72fdd0 | [] | no_license | AKucuk/fruittuin | aa8f85334fb68b52774a07280d9448caeb6740dc | 8c3b397ddccd89db724c9ccdedcfa9588df0e41e | refs/heads/master | 2021-05-04T03:33:50.552333 | 2017-01-28T08:13:16 | 2017-01-28T08:13:16 | 70,744,298 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,814 | java | package com.example.abdullahkucuk.fruittuin.Global;
import java.io.Serializable;
import java.util.Date;
import java.util.UUID;
/**
* Created by pplom on 19-12-2016.
*/
public class Session implements Serializable {
private UUID id;
private String name;
private int age;
private Date dateStart;
private Date dateEnd;
private String location;
private String rating;
private String feedback;
private int progressIndex;
public Session() {
id = UUID.randomUUID();
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Date getDateStart() {
return dateStart;
}
public void setDateStart(Date dateStart) {
this.dateStart = dateStart;
}
public Date getDateEnd() {
return dateEnd;
}
public void setDateEnd(Date dateEnd) {
this.dateEnd = dateEnd;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getRating() {
return rating;
}
public void setRating(String rating) {
this.rating = rating;
}
public String getFeedback() {
return feedback;
}
public void setFeedback(String feedback) {
this.feedback = feedback;
}
public int getProgressIndex() {
return progressIndex;
}
public void setProgressIndex(int progressIndex) {
this.progressIndex = progressIndex;
}
}
| [
"pplomp84@live.nl"
] | pplomp84@live.nl |
9a9fb14a5ec8986bbb3faf5ebdf31d0a38720a3a | 573a66e4f4753cc0f145de8d60340b4dd6206607 | /JS-CS-Detection-byExample/Dataset (ALERT 5 GB)/357876/2014.11.04/cgeo-market_20141104/cgeo-market_20141104/main/src/cgeo/geocaching/sorting/TerrainComparator.java | 9bbb5f76f1e25237017e6d4716c0d49074fec03f | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | mkaouer/Code-Smells-Detection-in-JavaScript | 3919ec0d445637a7f7c5f570c724082d42248e1b | 7130351703e19347884f95ce6d6ab1fb4f5cfbff | refs/heads/master | 2023-03-09T18:04:26.971934 | 2022-03-23T22:04:28 | 2022-03-23T22:04:28 | 73,915,037 | 8 | 3 | null | 2023-02-28T23:00:07 | 2016-11-16T11:47:44 | null | UTF-8 | Java | false | false | 473 | java | package cgeo.geocaching.sorting;
import cgeo.geocaching.Geocache;
/**
* sorts caches by terrain rating
*
*/
public class TerrainComparator extends AbstractCacheComparator {
@Override
protected boolean canCompare(final Geocache cache) {
return cache.getTerrain() != 0.0;
}
@Override
protected int compareCaches(final Geocache cache1, final Geocache cache2) {
return Float.compare(cache1.getTerrain(), cache2.getTerrain());
}
}
| [
"mmkaouer@umich.edu"
] | mmkaouer@umich.edu |
4619bc66c5d6472892c9470be9a02e02c713d384 | f6b19c46a99077a261ee19b3cfd73b33dc65aa4f | /src/com/longshine/cams/fk/server/mmj/MMJTest.java | aa07b9cb6950a189543138fd34729c18c7446dfc | [] | no_license | LWZXS/fkweb3 | 95a90dd9bb58472c950db58b72ee2986e750a58b | 7f66347c0923a63b05a12df1b3f3b653bc6287db | refs/heads/master | 2020-05-15T23:40:57.508419 | 2018-07-26T15:29:02 | 2018-07-26T15:29:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,885 | java | package com.longshine.cams.fk.server.mmj;
import com.longshine.cams.fk.server.FK_JLMMJ.VO_FK_MMJ_JLYCSFRZ_REQ_BD;
import com.longshine.cams.fk.server.FK_JLMMJ.VO_FK_MMJ_JLYCSFRZ_RES_BD;
import com.longshine.cams.fk.server.FK_JLMMJ.VO_FK_MMJ_YCKZ_REQ_BD;
import com.longshine.cams.fk.server.FK_JLMMJ.VO_FK_MMJ_YCKZ_RES_BD;
import com.longshine.cams.fk.structs.FKTask;
import net.sf.json.JSONObject;
public class MMJTest {
public static void main(String[] args) throws Exception{
int num=2;
VO_FK_MMJ_JLYCSFRZ_RES_BD jlycsfrz_res=new VO_FK_MMJ_JLYCSFRZ_RES_BD();
VO_FK_MMJ_JLYCSFRZ_REQ_BD jlycsfrz_req=new VO_FK_MMJ_JLYCSFRZ_REQ_BD();
jlycsfrz_req.setFSYZ("abcd12345");
jlycsfrz_req.setMYZT(1L);
FKTask v_task=new FKTask();
v_task.TASKID="fk1-1234-abcd";
JSONObject jsonObject = JSONObject.fromObject(jlycsfrz_req);
// System.out.println(jsonObject.toString());
long startTime=System.currentTimeMillis();
for (int i=0;i<num ;i++) {
jlycsfrz_res = MMJFkUtil.getMMJ_JLYCSFRZ(jlycsfrz_req, v_task);
}
System.out.println("秒:"+( System.currentTimeMillis() - startTime )/1000);
//////////////////////////////////////////////////////////////
///////////////////////////////////////////////////
VO_FK_MMJ_YCKZ_RES_BD yckz_res=new VO_FK_MMJ_YCKZ_RES_BD();
VO_FK_MMJ_YCKZ_REQ_BD yckz_req=new VO_FK_MMJ_YCKZ_REQ_BD();
yckz_req.setAQMKXLH("aQMKXLH");
yckz_req.setFSYZ("FSYZ");
yckz_req.setKZMLSJ("981D8EE88ACFA013");
yckz_req.setMMJSJS("MMMMMMMMMMMMM");
yckz_req.setMYZT(1L);
jsonObject = JSONObject.fromObject(yckz_req);
startTime=System.currentTimeMillis();
for (int i=0;i<num ;i++) {
yckz_res=MMJFkUtil.getMMJ_YCKZ(yckz_req, v_task);
}
System.out.println("秒:"+( System.currentTimeMillis() - startTime )/1000);
System.out.println(jlycsfrz_res);
}
}
| [
"gsn2004gdgz@163.com"
] | gsn2004gdgz@163.com |
3989d9df7986202ee5299d42a3e903c5805bb093 | 79d081703d7516e474be2da97ee6419a5320b6ff | /src/everyday/fractionToDecimal/Solution.java | 9e1d15a937faca631d2bf55b153a0158e07b9362 | [] | no_license | ITrover/Algorithm | e22494ca4c3b2e41907cc606256dcbd1d173886d | efa4eecc7e02754078d284269556657814cb167c | refs/heads/master | 2022-05-26T01:48:28.956693 | 2022-04-01T11:58:24 | 2022-04-01T11:58:24 | 226,656,770 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,787 | java | package everyday.fractionToDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* @author itrover
* 166. 分数到小数 https://leetcode-cn.com/problems/fraction-to-recurring-decimal/
* 长除法
*/
class Solution {
public String fractionToDecimal(int numerator, int denominator) {
long numeratorLong = numerator;
long denominatorLong = denominator;
// 能整除,直接返回结果
if (numeratorLong % denominatorLong == 0) {
return String.valueOf(numeratorLong / denominatorLong);
}
// 负数的情况
StringBuilder sb = new StringBuilder();
if (numeratorLong < 0 ^ denominatorLong < 0) {
sb.append('-');
}
// 整数部分
numeratorLong = Math.abs(numeratorLong);
denominatorLong = Math.abs(denominatorLong);
long integerPart = numeratorLong / denominatorLong;
sb.append(integerPart);
sb.append('.');
// 小数部分
StringBuilder fractionPart = new StringBuilder();
Map<Long, Integer> remainderIndexMap = new HashMap<>();
long remainder = numeratorLong % denominatorLong;
int index = 0;
while (remainder != 0 && !remainderIndexMap.containsKey(remainder)) {
remainderIndexMap.put(remainder, index);
remainder *= 10;
fractionPart.append(remainder / denominatorLong);
remainder %= denominatorLong;
index++;
}
// 有循环
if (remainder != 0) {
int insertIndex = remainderIndexMap.get(remainder);
fractionPart.insert(insertIndex, '(');
fractionPart.append(')');
}
sb.append(fractionPart.toString());
return sb.toString();
}
}
| [
"1172610139@qq.com"
] | 1172610139@qq.com |
fa5b53420dca52fb7ae1e62cffeab198e1d44352 | 8e65148fc5334566b393743d19db2fd20ffbc873 | /.svn/pristine/6c/6ce0c4cf030d898085f756d33492b4a233333cb6.svn-base | 7fb4320a10ac8322e0d50449ea80ee8977b09bec | [] | no_license | wangtao12138/charge-customer | 7af506c038f52deabb894bff9b34ef6b1c7374a0 | d567e5eebbbe062bab756219c20eb78b0b9e9a83 | refs/heads/master | 2020-04-08T10:57:49.258091 | 2018-11-27T06:45:13 | 2018-11-27T06:45:13 | 159,288,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 636 | package cn.com.cdboost.charge.customer.vo.info;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* @author wt
* @desc
* @create in 2018/8/15
**/
@Getter
@Setter
public class CustomerInfoListInfo implements Serializable{
private String customerState;
private String customerContact;
private String remainAmount;
private String remainCnt;
private String chargeCount;
private String alipayNickName="";
private String customerName="";
private String cardId="";
private String updateTime;
private String customerGuid;
private String projectName;
}
| [
"770320215@qq.com"
] | 770320215@qq.com | |
cc8e8d673b9aa859ba41ab67d91bb2514bf74a19 | 5fbd13ba1b608422600516ec7641416244efc1ca | /src/main/java/com/vkart/controller/AdminController.java | 488ac3c414e3232adfa6f5968f1f3a12a6704fea | [] | no_license | vikashnitp26/vkart | 1b227667abc90d7a4a8be21feb7fb67f95e5cf96 | 4763c6c8234ba8b5959f43a85ae297bc48624c52 | refs/heads/master | 2022-12-21T12:41:18.052123 | 2019-08-05T03:52:51 | 2019-08-05T03:52:51 | 200,572,487 | 0 | 0 | null | 2022-12-16T11:07:37 | 2019-08-05T03:02:14 | Java | UTF-8 | Java | false | false | 3,855 | java | package com.vkart.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.google.gson.Gson;
import com.vkart.dao.DealDAO;
import com.vkart.dao.ProductDAO;
import com.vkart.model.Deal;
import com.vkart.model.Product;
@Controller
public class AdminController {
@Autowired
private ProductDAO pDao;
@Autowired
private DealDAO dDao;
@RequestMapping(value="/area", method=RequestMethod.GET)
public @ResponseBody String noticeProductRequest(Model model) {
System.out.println("Admin Controller hit");
List<Product> list = pDao.getAllProducts();
Gson gson = new Gson();
String json;
json = gson.toJson(list);
return json;
}
@RequestMapping(value="/allDeal", method=RequestMethod.GET)
public @ResponseBody String noticeDealRequest(Model model) {
System.out.println("Admin Controller hit");
List<Deal> list = dDao.getAllDeal();
Gson gson = new Gson();
String json;
json = gson.toJson(list);
return json;
}
@RequestMapping(value="/removeProduct", method=RequestMethod.GET)
public @ResponseBody String removeProductHandler( @RequestParam("proID") String p_id,Model model) {
System.out.println("Product Deletion Initiated");
pDao.removeProduct(p_id);
System.out.println("Product Deletion Successful!!!");
return ("You have successfully DELETED 1 old product!");
}
@RequestMapping(value="/removeDeal", method=RequestMethod.GET)
public @ResponseBody String removeDealHandler( @RequestParam("dealId") int dealId,Model model) {
System.out.println("Deal Deletion Initiated");
dDao.removeDeal(dealId);
System.out.println("Deal Deletion Successful!!!");
return ("You have successfully DELETED 1 old Deal!");
}
@RequestMapping(value="/addingProduct", method=RequestMethod.GET)
public @ResponseBody String addProductHandler( @RequestParam("pro") String p,Model model) {
System.out.println("Product Insertion Initiated");
Gson gson = new Gson();
Product product=(Product)gson.fromJson(p, Product.class);
if(product.getPrice()>499)
product.setdCharge(0);
else
product.setdCharge(99);
pDao.addProduct(product);
System.out.println("Product Insertion Successful!!!");
return ("You have successfully ADDED 1 new product!");
}
@RequestMapping(value="/addingDeal", method=RequestMethod.GET)
public @ResponseBody String addDealHandler( @RequestParam("deal") String p,Model model) {
System.out.println("Deal Insertion Initiated"+p);
Gson gson = new Gson();
Deal deal=(Deal)gson.fromJson(p, Deal.class);
dDao.addDeal(deal);
System.out.println("Deal Insertion Successful!!!");
return ("You have successfully ADDED 1 new Deal!");
}
@RequestMapping(value="/updatingProduct", method=RequestMethod.GET)
public @ResponseBody String updateProductHandler( @RequestParam("pro") String p,Model model) {
System.out.println("Product Updation Initiated");
Gson gson = new Gson();
pDao.addProduct(gson.fromJson(p, Product.class));
System.out.println("Product Updation Successful!!!");
return ("You have successfully ADDED 1 new product!");
}
@RequestMapping(value="/updatingDeal", method=RequestMethod.GET)
public @ResponseBody String updateDealHandler( @RequestParam("deal") String p,Model model) {
System.out.println("Deal Updation Initiated");
Gson gson = new Gson();
dDao.addDeal(gson.fromJson(p, Deal.class));
System.out.println("Deal Updation Successful!!!");
return ("You have successfully ADDED 1 new Deal!");
}
}
| [
"vikashnitp26@gmail.com"
] | vikashnitp26@gmail.com |
e87af26a16e1b1e5fc9a65a4634c5607486a03e1 | 56bc93b2b97ebe94b5f977540988de307ea21013 | /gp-search/gp-search-service/src/main/java/cn/gpmall/search/service/impl/ItemListServiceImpl.java | 567225c04d8fae4eccd1e10be300018b0bca5ea0 | [] | no_license | qhUser/GraduationProject | 25f04bba6224dc6db2ff4b9a52ea65a05224cf70 | 586c54825842ac6cb337b1488595a918907e4775 | refs/heads/master | 2021-05-25T12:28:14.197629 | 2020-04-07T12:52:17 | 2020-04-07T12:52:17 | 253,754,663 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,315 | java | package cn.gpmall.search.service.impl;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.gpmall.common.mapper.AComDao;
import cn.gpmall.common.mapper.OrderDao;
import cn.gpmall.common.pojo.ACom;
import cn.gpmall.common.pojo.AEvaluate;
import cn.gpmall.common.pojo.AOrderlist;
import cn.gpmall.common.pojo.Page;
import cn.gpmall.common.pojo.UserComment;
import cn.gpmall.search.service.ItemListService;
@Service
public class ItemListServiceImpl implements ItemListService {
@Autowired
private AComDao acomDao;
@Autowired
private OrderDao orderDao;
@Override
public List<ACom> getItemList(String keyword, Integer page) {
Page pa=new Page(page,8);
pa.setKeyword(keyword);
List<ACom> list=acomDao.getItemList(pa);
Iterator it=list.iterator();
while(it.hasNext()) {
ACom ac=(ACom) it.next();
Integer id=ac.getId();
String photo=acomDao.getUrl(id);
ac.setPhotoUrl(photo);
}
return list;
}
@Override
public Integer getSumCount(String keyword) {
int count=acomDao.getSumCount(keyword);
return count;
}
@Override
public ACom getDetails(Integer id) { //查询商品详情
ACom ac=new ACom();
ac=acomDao.getDetails(id);
String url=acomDao.getUrl(id);
ac.setPhotoUrl(url);
return ac;
}
@Override//加价
public void addPrice(Integer itemid, Integer userid, Double nowprice) {
//第一步:更改商品当前价格,商品id,当前价格
acomDao.addPrice(itemid,nowprice);
//第二步:生成订单表:传入用户信息,返回订单编号
AOrderlist order=new AOrderlist();
Date date=new Date();
order.setCreatedate(date);
order.setUserid(userid);
orderDao.addOrder(order); //返回了订单编号
//第三步:生成订单-商品表 传入商品id,订单id,和商品价格
orderDao.addOrderCom(itemid,order.getId(),nowprice);
}
@Override //缴纳保证金
public String checkBail(Integer id) {
//第一步,判定余额是否够
Double money= acomDao.checkMoney(id);
//第二步,缴纳保证金
if(money>=200) {
try {
acomDao.checkBail(id);
return "OK";
} catch (Exception e) {
return "NoMoney";
}
}else {
return "NoMoney";
}
}
@Override
public UserComment userComment(Integer itemid) {
//第一步,找到商品供应商
Integer suppId=acomDao.getUserById(itemid);
String name=acomDao.getUserName(suppId);
//第二步,根据商品供应商id,找到所有对应的评价表
List<AEvaluate> list=acomDao.getEvaluate(suppId);//根据供应商id,找到对应的评价表
//第三步,将所有评价表内容的评分取出来,求平均值
Iterator it=list.iterator();
int sum=0; //总分
double aver;
DecimalFormat df=new DecimalFormat("#.0");//限制小数一位
while(it.hasNext()) {
AEvaluate evaluate=new AEvaluate();
evaluate=(AEvaluate) it.next();
sum+=evaluate.getMark();
}
double i=list.size();
aver=sum/i;//获得平均分
String average=df.format(aver);
UserComment userComment=new UserComment();
userComment.setAverager(average);
userComment.setList(list);
userComment.setUserName(name);
return userComment;
}
}
| [
"1254483440@qq.com"
] | 1254483440@qq.com |
b70d87abd4c8fba28f52d1f1ede46ab49de10c2d | 8a7c75dae0be905bc34fbece94e3bf4b60e01051 | /Android/parsed/parsed/app/src/main/java/com/example/app/Entry.java | 4edf0b10baad6e9012dd25f80c8e388258b2e94d | [] | no_license | adburke/CPMD | d57201a2230d497e899ad0598bb73c5b477ae109 | b1fa37721cb0faf6a7504c361533976d946bcf69 | refs/heads/master | 2020-12-01T11:40:37.394966 | 2014-05-02T13:37:29 | 2014-05-02T13:37:29 | 18,340,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,530 | java | /*
* Project: parsed
*
* Package: app
*
* Author: aaronburke
*
* Date: 4 15, 2014
*/
package com.example.app;
import java.io.Serializable;
import java.util.UUID;
/**
* Created by aaronburke on 4/15/14.
*/
public class Entry implements Serializable {
private String name;
private String message;
private Number number;
private String parseObjId;
private String mUUID;
public Entry(String name, String message, Number number) {
this.name = name;
this.message = message;
this.number = number;
this.parseObjId = "";
this.mUUID = UUID.randomUUID().toString();
}
public Entry(String name, String message, Number number, String parseObjectId, String mUUID) {
this.name = name;
this.message = message;
this.number = number;
this.parseObjId = parseObjectId;
this.mUUID = mUUID;
}
public String getName() {
return name;
}
public String getMessage() {
return message;
}
public Number getNumber() {
return number;
}
public String getParseObjId() {
return parseObjId;
}
public String getUUID() { return mUUID;}
public void setName(String name) {
this.name = name;
}
public void setMessage(String message) {
this.message = message;
}
public void setNumber(Number number) {
this.number = number;
}
public void setParseObjId(String objId) {
this.parseObjId = objId;
}
}
| [
"adburke@fullsail.edu"
] | adburke@fullsail.edu |
82d9802c8c1129376c991014a33e80c619b00fc5 | 9141939ba0cb3ac8f0a73d43e7124aeb278fc5af | /app/src/main/java/com/example/myapplication/LiveList/LiveListEntity.java | 159aeb481f33a925526f2ad78fdbe37838d4577a | [] | no_license | lvwanjie/dd_test_project | d205ea4fce9396ecf1d659dec65faa0379f7d6c5 | 3595fce9821700ee8dd12b59193c5664bb7faa0c | refs/heads/master | 2020-09-28T17:29:16.791762 | 2020-07-30T11:33:47 | 2020-07-30T11:33:47 | 226,824,494 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package com.example.myapplication.LiveList;
import java.util.List;
public class LiveListEntity {
public List<LiveListItemEntity> liveList;
}
| [
"lvwanjie@dangdang.com"
] | lvwanjie@dangdang.com |
441c151be0a2778eae2115663a2b550a868e4e97 | 9f2517784e49cf1d205c0f10b181e1fd598c952d | /src/main/java/com/test/cdap/plugins/batchsink/ReferencePluginConfig.java | 6073d63a7d4a8431aa9a4a6eda46408a31e34ca5 | [] | no_license | Manjesh80/cdap-plugin | 65e84a8c834709d3236adbb466dcb5ec153d1ed4 | 92772bcef8dbbf50af0c168c1c16812a3e32253b | refs/heads/master | 2021-01-11T23:05:07.505584 | 2017-02-13T15:10:11 | 2017-02-13T15:10:11 | 78,544,746 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 706 | java | package com.test.cdap.plugins.batchsink;
import co.cask.cdap.api.annotation.Description;
import co.cask.cdap.api.annotation.Name;
import co.cask.cdap.api.plugin.PluginConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Author: mg153v (Manjesh Gowda). Creation Date: 1/27/2017.
*/
public class ReferencePluginConfig extends PluginConfig {
private static final Logger LOG = LoggerFactory.getLogger(ReferencePluginConfig.class);
@Name(Constants.Reference.REFERENCE_NAME)
@Description(Constants.Reference.REFERENCE_NAME_DESCRIPTION)
public String referenceName;
public ReferencePluginConfig(String referenceName) {
this.referenceName = referenceName;
}
} | [
"mg153v@us.att.com"
] | mg153v@us.att.com |
91f9c750101c1bcdf33423bc572f623d04cb68ef | 0c7d39a8903d77e799e5c8b0e46db2f56e855da7 | /it.univaq.disim.uncertainty.filesystem/src/filesystem/Sync.java | c4d5197dbeefc1ce00f3d3af9f43b4bdc8f5a4f0 | [] | no_license | stefanodifrancesco/uncertainty | 4398a57e8b94ee9108435f4c3541b4273cb20e21 | 532fa4c84d8efd45db80b3b4a6a26df3d512b4b4 | refs/heads/master | 2020-03-24T01:18:21.094300 | 2018-09-07T09:39:41 | 2018-09-07T09:39:41 | 142,330,210 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,088 | java | /**
*/
package filesystem;
import filesystem.filesystem_uncertainty.aSync;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Sync</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link filesystem.Sync#getSource <em>Source</em>}</li>
* <li>{@link filesystem.Sync#getTarget <em>Target</em>}</li>
* </ul>
*
* @see filesystem.FilesystemPackage#getSync()
* @model annotation="gmf.link source='source' target='target' style='dot' width='2'"
* @generated
*/
public interface Sync extends aSync {
/**
* Returns the value of the '<em><b>Source</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Source</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Source</em>' reference.
* @see #setSource(File)
* @see filesystem.FilesystemPackage#getSync_Source()
* @model
* @generated
*/
File getSource();
/**
* Sets the value of the '{@link filesystem.Sync#getSource <em>Source</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Source</em>' reference.
* @see #getSource()
* @generated
*/
void setSource(File value);
/**
* Returns the value of the '<em><b>Target</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Target</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Target</em>' reference.
* @see #setTarget(File)
* @see filesystem.FilesystemPackage#getSync_Target()
* @model
* @generated
*/
File getTarget();
/**
* Sets the value of the '{@link filesystem.Sync#getTarget <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Target</em>' reference.
* @see #getTarget()
* @generated
*/
void setTarget(File value);
} // Sync
| [
"8914928+stefanodifrancesco@users.noreply.github.com"
] | 8914928+stefanodifrancesco@users.noreply.github.com |
fe14a5d53ceb234c1b932ade877fe855cb1c8259 | 0290fe4f34a7b622faf7ae0e7c4403c7ab926a71 | /module_3/src/main/java/com/alevel/dao/OperationsDao.java | c7601f588f7278dac762b95baea970ea53119607 | [] | no_license | Diana-Kylymnyk/nix_7 | 1bd661db8c5449d0efdb12318e2409758addc82b | 836d45dbac15f17dcd12f937706cde4df79b9d4d | refs/heads/master | 2023-08-27T21:18:25.939616 | 2021-11-09T19:34:35 | 2021-11-09T19:34:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 452 | java | package com.alevel.dao;
import com.alevel.entity.*;
import java.util.List;
public interface OperationsDao {
void createOperation(Operations operation);
Accounts getAccountById(Long id);
ExpenseCategory getExpenseCategoryByName(String name);
IncomeCategory getIncomeCategoryByName(String name);
User getUserByPhoneNumber(String phoneNumber);
void addOperationCategories(List<OperationCategories> operationCategories);
}
| [
"Kylymnyk.n@gmail.com"
] | Kylymnyk.n@gmail.com |
152db52c5ef7e12450afb4a502625d7e7d753639 | 6cec3ef986cff4af3c17b6ffe77a1cbc714ad6e8 | /kafka-connect-hbase/src/main/java/com/tw/consumer/resources/PropertyResources.java | caaf1c892793bb86c3faee58a9623e696bc53bd4 | [] | no_license | classicriver/mygit | 74de209f3fef194d5fc6feb4a926377142f74959 | 65e84b748ca61bc3374f4b9862aca40ee529e9ba | refs/heads/master | 2022-11-27T15:00:14.071834 | 2021-01-08T08:30:29 | 2021-01-08T08:30:29 | 96,191,797 | 1 | 0 | null | 2022-10-19T00:56:22 | 2017-07-04T08:00:17 | Java | UTF-8 | Java | false | false | 769 | java | package com.tw.consumer.resources;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
*
* @author xiesc
* @TODO Property文件加载类
* @time 2018年7月20日
* @version 1.0
*/
public abstract class PropertyResources implements Resources{
protected final Properties pro = new Properties();
protected PropertyResources(){
load();
}
@Override
public void load() {
// TODO Auto-generated method stub
try(InputStream stream = PropertyResources.class.getClassLoader().getResourceAsStream(getProFileName())) {
pro.load(stream);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
protected abstract String getProFileName();
}
| [
"xiesongchi@brc.com.cn"
] | xiesongchi@brc.com.cn |
898093806d732404662a1f3adbd01a909a015b43 | fda2b9a08451622b931a04afdd0f31b6c49e2636 | /src/edu/mit/media/funf/probe/builtin/OrientationSensorProbe.java | 6b1d5fd6fd5550c3821baaa6001142f20a44b65d | [] | no_license | HeinrichHartmann/FunfSensingFramework | d6244da565a46c105f8538af8a1942cbef75a107 | b61515b68ff3fa5cb9971d02e507725576270621 | refs/heads/master | 2020-03-27T23:10:19.038488 | 2012-04-24T21:19:03 | 2012-04-24T21:19:03 | 8,355,686 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,625 | java | /**
* Funf: Open Sensing Framework
* Copyright (C) 2010-2011 Nadav Aharony, Wei Pan, Alex Pentland.
* Acknowledgments: Alan Gardner
* Contact: nadav@media.mit.edu
*
* This file is part of Funf.
*
* Funf is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* Funf is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Funf. If not, see <http://www.gnu.org/licenses/>.
*/
package edu.mit.media.funf.probe.builtin;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Bundle;
import edu.mit.media.funf.probe.SensorProbe;
import edu.mit.media.funf.probe.builtin.ProbeKeys.OrientationSensorKeys;
public class OrientationSensorProbe extends SensorProbe implements OrientationSensorKeys {
public int getSensorType() {
return Sensor.TYPE_ORIENTATION;
}
public String[] getRequiredFeatures() {
return new String[]{
"android.hardware.sensor.gyroscope"
};
}
public String[] getValueNames() {
return new String[] {
AZIMUTH, PITCH, ROLL
};
}
@Override
protected long getDefaultDuration() {
return 15L;
}
@Override
protected long getDefaultPeriod() {
return 180L;
}
}
| [
"alan.gardner@gmail.com"
] | alan.gardner@gmail.com |
558077118ebd4ea27fef6f4412a11eda2c3beffb | a4a51084cfb715c7076c810520542af38a854868 | /src/main/java/com/shopee/app/react/modules/ui/login/LoginModule.java | b1c19bd224b58cb9f7eacc260ede1148c666ae38 | [] | no_license | BharathPalanivelu/repotest | ddaf56a94eb52867408e0e769f35bef2d815da72 | f78ae38738d2ba6c9b9b4049f3092188fabb5b59 | refs/heads/master | 2020-09-30T18:55:04.802341 | 2019-12-02T10:52:08 | 2019-12-02T10:52:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,203 | java | package com.shopee.app.react.modules.ui.login;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.UiThreadUtil;
import com.facebook.react.module.annotations.ReactModule;
import com.shopee.app.react.c;
import com.shopee.app.react.modules.base.ReactBaseLifecycleModule;
@ReactModule(name = "GALogin")
public class LoginModule extends ReactBaseLifecycleModule<a> {
protected static final String NAME = "GALogin";
public String getName() {
return NAME;
}
public LoginModule(ReactApplicationContext reactApplicationContext) {
super(reactApplicationContext);
}
public a initHelper(c cVar) {
return new a();
}
@ReactMethod
public void showLoginScreen(final int i, final String str, final Promise promise) {
UiThreadUtil.runOnUiThread(new Runnable() {
public void run() {
if (LoginModule.this.isMatchingReactTag(i)) {
((a) LoginModule.this.getHelper()).a(LoginModule.this.getCurrentActivity(), str, promise);
}
}
});
}
}
| [
"noiz354@gmail.com"
] | noiz354@gmail.com |
979a7a49a20b50f3954a680204d94aa30f94b04f | 257eb0da6e50fedd6d2541d89ed4f1c0aaca16ef | /src/com/gcstudios/entities/Weapon.java | 0a0ad1ac2743386ba388fdb95ec360fe9e2624b7 | [
"MIT"
] | permissive | RenilsonMedeiros/Game_01-Clone_Zelda | 09cc9c4877792f79db51845380a97c02f53a2a8d | 764a206013189a64fcdd15648150f5ce92ddf3e3 | refs/heads/master | 2022-11-15T09:00:12.490984 | 2020-05-06T20:31:53 | 2020-05-06T20:31:53 | 259,180,251 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 842 | java | package com.gcstudios.entities;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import com.gcstudios.main.Game;
import com.gcstudios.world.Camera;
public class Weapon extends Entity {
private int frames = 0, maxFrames = 30, index = 0, maxIndex = 1;
private BufferedImage[] sprites;
public Weapon(int x, int y, int width, int height, BufferedImage sprite) {
super(x, y, width, height, sprite);
sprites = new BufferedImage[2];
sprites[0] = Game.spritesheet.getSprite(7*16, 0, 16, 16);
sprites[1] = Game.spritesheet.getSprite(8*16, 0, 16, 16);
}
public void tick() {
frames++;
if(frames == maxFrames) {
frames = 0;
index++;
if(index > maxIndex) index = 0;
}
}
public void render(Graphics g) {
g.drawImage(sprites[index], this.getX() - Camera.x, this.getY() - Camera.y, null);
}
}
| [
"renilsonsilva@aluno.uema.br"
] | renilsonsilva@aluno.uema.br |
30ee729c045936db96d6b874aca84e330a8107c9 | 80373d3dd37cb3c9cd7f311c3375f2739e2dee8f | /Lote01/Java/Prj_Lot0107022019/src/exercicios_lote01/Lt01_EstSeqEx03.java | 68649883eb56895be72e96589272ff5fe52fe8a1 | [] | no_license | william-carvalho12/logicadeprogramacao | 6e1be42fa8f74e15df91157ed6ec04868fb451d9 | df65e59eca27fe0c6fbd1d9076dc335fb9ae806c | refs/heads/master | 2020-03-30T08:22:53.742444 | 2019-07-10T01:58:07 | 2019-07-10T01:58:07 | 151,010,561 | 1 | 1 | null | null | null | null | ISO-8859-1 | Java | false | false | 762 | java | /* 3. Receba a base e a altura de um triângulo. Calcule e mostre a sua área.
****************************************
Objetivo: Terceiro exercício em java
Programador: Bruno Pallin, William V. Carvalho, Daniel Mota
Data da Criação: 12/02/2019
****************************************
*/
package exercicios_lote01;
import javax.swing.JOptionPane;
public class Lt01_EstSeqEx03 {
public static void main (String args[]) {
double base, altura, area;
base = Double.parseDouble(JOptionPane.showInputDialog("Insira a base do Triângulo:"));
altura = Double.parseDouble(JOptionPane.showInputDialog("Insira a altura do triângulo"));
area = (base*altura)/2;
JOptionPane.showMessageDialog(null, "A área do quadrado é: " + area);
}
}
| [
"43732623+Bruno-Pallin@users.noreply.github.com"
] | 43732623+Bruno-Pallin@users.noreply.github.com |
aa50d55fa82a34b536845ce5edefe221cb5877a2 | 4e92b9d82c8987359438c51592d409cd283f470e | /src/1091_Shortest_Path_in_Binary_Matrix/Java/Solution.java | cfd1e74395c857747a97400db8bf917eda638f16 | [] | no_license | qianmarv/leetcode | 4de375088ffb299a2ff223c9e14eba938df2240b | 1e3cd45612885c13cad390f99fb9503320dd17a5 | refs/heads/master | 2022-08-08T04:43:07.831172 | 2022-07-31T00:29:41 | 2022-07-31T00:29:41 | 136,700,113 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,210 | java | class Solution {
//Runtime: 28 ms, faster than 26.02%
//Memory Usage: 40.8 MB, less than 60.99%
public int shortestPathBinaryMatrix(int[][] grid) {
int N = grid.length;
int count = 0;
Queue<Pair<Integer, Integer>> queue = new LinkedList<>();
queue.offer(new Pair<>(0,0));
int[][] directions = new int[][]{
{-1,-1},{-1,0},{-1,1},
{0,-1},{0,1},
{1,-1},{1,0},{1,1}
};
while(!queue.isEmpty()){
int size = queue.size();
count++;
while(size-- > 0){
Pair<Integer, Integer> pos = queue.poll();
int i = pos.getKey(), j = pos.getValue();
if(grid[i][j] == 1) continue;
if(i == N-1 && j == N-1) return count;
grid[i][j] = 1;
for(int[] direction: directions){
int m = direction[0] + i;
int n = direction[1] + j;
if(m >= 0 && m < N &&
n >= 0 && n < N ){
queue.add(new Pair<>(m,n));
}
}
}
}
return -1;
}
}
| [
"qianmarv@gmail.com"
] | qianmarv@gmail.com |
9505781fd77d217e7ef6ff6520df0f5e56dacf76 | 59c003e80435fb5540a1d9841e440b72f4ba902e | /polymorphism/honda.java | 3255b7a92bc6d315d8d1f72318e6aa7ea4a20ddf | [] | no_license | 9Alpha9/Pertemuan-10-Polymorphism | d533f85aa705119bec7720bb2dd73f9e4bb7085f | 14d1c0e1215b92b4b1a8949c3312f666eae054a2 | refs/heads/master | 2020-05-22T12:35:18.674102 | 2019-05-13T06:15:02 | 2019-05-13T06:15:02 | 186,343,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 256 | java | package polymorphism;
public class honda extends motor {
public honda(int jumlah, String tipe) {
super(jumlah, tipe);
}
@Override
public int TotalBeli() {
return super.getJumlah()*21000000;
}
}
| [
"noreply@github.com"
] | 9Alpha9.noreply@github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.