blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9e3c5416b464a96a075c6d833e412ee40d71be98 | 0a917e8cc3350b12269a702ec3c734e750e4c05c | /demo/src/main/java/com/xx/demo/web/action/admin/AdminClassessAction.java | c290e2db60c0b5afcfc4b4e5d3ce4912c3420b24 | [] | no_license | tiejiang/handletravel-server | ac399e688316c33f5f791586e2897d43b67cf6a8 | 5a457185c5b05c45ee9209838983d350aaa7f182 | refs/heads/master | 2021-01-15T08:19:31.019862 | 2017-08-07T10:20:41 | 2017-08-07T10:20:41 | 99,565,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,425 | java | package com.xx.demo.web.action.admin;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import com.alonew.core.commons.page.AjaxObject;
import com.alonew.core.commons.page.Page;
import com.xx.demo.biz.logic.LogicFactory;
import com.xx.demo.common.utils.LoggerManager;
import com.xx.demo.model.pojo.Classes;
import com.xx.demo.web.action.base.AdminAction;
/**
* 系統簽字分类管理Action
*
* @author chlingm
*
*/
public class AdminClassessAction extends AdminAction {
private static final long serialVersionUID = 2820359414533485571L;
private List<Classes> classesList;
private Long id;
private Long[] ids;
private Classes classes;
private Page page;
/**
* 列表显示
*
* @return
*/
public String list() {
// 获取分页信息
Map<String, Object> condition = new HashMap<String, Object>();
orderField = StringUtils.isBlank(orderField) ? "classestime" : orderField;
orderDirection = StringUtils.isBlank(orderDirection) ? "desc" : orderDirection;
condition.put("orderField", orderField);
condition.put("orderDirection", orderDirection);
if (classes != null) {
if (StringUtils.isNotBlank(classes.getClassesname())) {
condition.put("classesname", classes.getClassesname());
}
}
page = this.fetchPageParams();
long totalCount = LogicFactory.getClassessLogic()
.countClassessByCondition(condition);
page.setTotalCount(totalCount);
int start = (page.getPageNum() - 1) * page.getNumPerPage();
condition.put("start", start);
condition.put("num", page.getNumPerPage());
classesList = LogicFactory.getClassessLogic()
.getClassesListByCondition(
condition);
return "list";
}
public String add() {
return "add";
}
/**
* 新增
*
* @return
*/
public String insert() {
try {
//校验
if (StringUtils.isEmpty(classes.getClassesname())) {
return this.ajaxDoneError("###名称为必填项###");
}
Map<String, Object> condition = new HashMap<String, Object>();
condition.put("classesname", classes.getClassesname());
Long count = LogicFactory.getClassessLogic()
.countClassessByCondition(condition);
if (count > 0) {
return this.ajaxDoneError("###名称已存在,请更换姓名###");
}
classes.setClassestime(new Date());
LogicFactory.getClassessLogic().createClasses(classes);
return this.ajaxDoneSuccess("添加成功");
} catch (Exception e) {
LoggerManager.def.error("Classes insert errors:", e);
e.printStackTrace();
return this.ajaxDoneError("添加失败");
}
}
public String edit() {
classes = LogicFactory.getClassessLogic().getClassesById(id);
return "edit";
}
public String update() {
try {
if (StringUtils.isEmpty(classes.getClassesname())) {
return this.ajaxDoneError("###名称为必填项###");
}
LogicFactory.getClassessLogic().updateClasses(classes);
this.print(AjaxObject.newOk("修改成功!").toString());
} catch (Exception e) {
LoggerManager.def.error("classes update errors:", e);
this.print(AjaxObject.newError(e.getMessage()).setCallbackType("")
.toString());
}
return "list";
}
public String del() {
if (ids == null || ids.length == 0) {
return this.ajaxDoneError("###未选择对象###");
}
try {
LogicFactory.getClassessLogic().deleteClassesById(ids);
return this.ajaxDoneSuccess("删除成功");
} catch (Exception e) {
LoggerManager.def.error("Classes delete errors:", e);
return this.ajaxDoneError("删除失败:" + e.getMessage());
}
}
public long selectnum(){
long num = 0;
return num;
}
public List<Classes> getClassesList() {
return classesList;
}
public void setClassesList(List<Classes> classesList) {
this.classesList = classesList;
}
public Classes getClasses() {
return classes;
}
public void setClasses(Classes classes) {
this.classes = classes;
}
public Page getPage() {
return page;
}
public void setPage(Page page) {
this.page = page;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long[] getIds() {
return ids;
}
public void setIds(Long[] ids) {
this.ids = ids;
}
} | [
"315904145@qq.com"
] | 315904145@qq.com |
2c1b4d8f2ae6acf0dfab15cf137e3fe6b7df8dab | de2626d7ac52eae413f823464678f1d3807180ad | /org.jrebirth/archetype/src/main/resources/archetype-resources/src/main/java/ui/SampleView.java | ecdf7b8946ee829875bae7dd7c587c57602d0c6a | [
"Apache-2.0"
] | permissive | cherry-wb/JRebirth | b54d123ea44d35f8aa9f764d7635d63da2aa4c50 | 61886f0c28bc0293a7a5714f13f11a5a2bd8ebc6 | refs/heads/master | 2020-12-11T08:09:21.664156 | 2013-11-02T09:50:18 | 2013-11-02T09:50:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,226 | java | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.ui;
import javafx.scene.control.Button;
import javafx.scene.control.LabelBuilder;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPaneBuilder;
import org.jrebirth.core.exception.CoreException;
import org.jrebirth.core.ui.AbstractView;
import org.jrebirth.core.ui.annotation.OnMouse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The class <strong>SampleView</strong>.
*
* @author
*/
public final class SampleView extends AbstractView<SampleModel, BorderPane, SampleController> {
/** The class logger. */
private static final Logger LOGGER = LoggerFactory.getLogger(SampleView.class);
/** Button used to trigger the SampleCommand. */
@OnMouse(OnMouse.MouseType.Clicked)
private Button defaultCommand;
/** Button used to trigger the SampleUICommand. */
private Button uiCommand;
/** Button used to trigger the SamplePoolCommand. */
private Button pooledCommand;
/**
* Default Constructor.
*
* @param model the controls view model
*
* @throws CoreException if build fails
*/
public SampleView(final SampleModel model) throws CoreException {
super(model);
}
/**
* {@inheritDoc}
*/
@Override
protected void initView() {
this.defaultCommand = new Button("Trigger a default Command into JIT");
this.uiCommand = new Button("Trigger an UI Command into JAT");
this.pooledCommand = new Button("Trigger a pooled Command into JTP");
getRootNode().setCenter(
LabelBuilder.create()
.text("JRebirth Sample")
.build()
);
getRootNode().setBottom(FlowPaneBuilder.create().children(
this.defaultCommand,
this.uiCommand,
this.pooledCommand
).build());
}
/**
* {@inheritDoc}
*/
@Override
public void start() {
LOGGER.debug("Start the Sample View");
// Custom code to process when the view is displayed the first time
}
/**
* {@inheritDoc}
*/
@Override
public void reload() {
LOGGER.debug("Reload the Sample View");
// Custom code to process when the view is displayed the 1+n time
}
/**
* {@inheritDoc}
*/
@Override
public void hide() {
LOGGER.debug("Hide the Sample View");
// Custom code to process when the view is hidden
}
/**
* Return the button that trigger the default command.
*
* @return the button that trigger the default command
*/
Button getDefaultCommand() {
return this.defaultCommand;
}
/**
* Return the button that trigger the UI command.
*
* @return the button that trigger the UI command
*/
Button getUiCommand() {
return this.uiCommand;
}
/**
* Return the button that trigger the pooled command.
*
* @return the button that trigger the pooled command
*/
Button getPooledCommand() {
return this.pooledCommand;
}
} | [
"sebastien.bordes@jrebirth.org"
] | sebastien.bordes@jrebirth.org |
522bb9ecd06a2f317a47f23c4be761ffc8f0307e | 4f31c254e125dede3e185697a05328f130a17bca | /src/com/baskarks/design/patterns/behavioral/state/DrivingMode.java | 7a6bed68da260c65f1011a84689f108e78503ad0 | [] | no_license | BaskarKS/JavaDesignPatterns | 345e04f1fa9dc94be8e0baa54cd61e188996a3ce | 49af74f1d7260681fb5c488f47514e8b2a9fdb6c | refs/heads/master | 2020-12-23T19:22:45.333566 | 2020-11-27T04:29:10 | 2020-11-27T04:29:10 | 237,246,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package com.baskarks.design.patterns.behavioral.state;
public class DrivingMode implements ITravelMode {
@Override
public Object getEta() {
System.out.println("Calculating ETA (driving)");
return 1;
}
@Override
public Object getDirection() {
System.out.println("Calculating Direction (driving)");
return 1;
}
}
| [
"baskarks@gmail.com"
] | baskarks@gmail.com |
f3cd18a300b161317cba7bf4e226161cd680185d | 1346c8b7af5a6cba67206962bbd40a636a82c63d | /kie-drools-wb-parent/kie-drools-wb-webapp/src/test/java/org/kie/workbench/drools/client/KieDroolsWorkbenchEntryPointTest.java | 90c86b44ef9698f3c4b0340cd80536be42ce7069 | [
"Apache-2.0"
] | permissive | zengxijin/kie-wb-distributions | d6a9dfb4bbbd7f88c71f006b29dfbbfa5b3def02 | 2e89769ffe61f992c958506caaebdda2fb407c70 | refs/heads/master | 2021-01-19T20:05:34.371215 | 2017-04-13T14:29:43 | 2017-04-15T12:36:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,493 | java | /*
* Copyright 2016 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kie.workbench.drools.client;
import java.util.ArrayList;
import java.util.List;
import com.google.gwtmockito.GwtMockitoTestRunner;
import org.guvnor.common.services.shared.config.AppConfigService;
import org.jboss.errai.ioc.client.container.SyncBeanManager;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.kie.workbench.common.screens.social.hp.config.SocialConfigurationService;
import org.kie.workbench.common.services.shared.service.PlaceManagerActivityService;
import org.kie.workbench.common.workbench.client.authz.PermissionTreeSetup;
import org.kie.workbench.common.workbench.client.menu.DefaultWorkbenchFeaturesMenusHelper;
import org.kie.workbench.common.workbench.client.admin.DefaultAdminPageHelper;
import org.kie.workbench.drools.client.home.HomeProducer;
import org.kie.workbench.drools.client.resources.i18n.AppConstants;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.uberfire.client.mvp.ActivityBeansCache;
import org.uberfire.client.workbench.Workbench;
import org.uberfire.client.workbench.widgets.menu.WorkbenchMenuBarPresenter;
import org.uberfire.ext.security.management.client.ClientUserSystemManager;
import org.uberfire.mocks.CallerMock;
import org.uberfire.mocks.ConstantsAnswerMock;
import org.uberfire.mocks.IocTestingUtils;
import org.uberfire.mvp.Command;
import org.uberfire.workbench.model.menu.MenuItem;
import org.uberfire.workbench.model.menu.Menus;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
@RunWith(GwtMockitoTestRunner.class)
public class KieDroolsWorkbenchEntryPointTest {
@Mock
private AppConfigService appConfigService;
private CallerMock<AppConfigService> appConfigServiceCallerMock;
@Mock
private PlaceManagerActivityService pmas;
private CallerMock<PlaceManagerActivityService> pmasCallerMock;
@Mock
private ActivityBeansCache activityBeansCache;
@Mock
private HomeProducer homeProducer;
@Mock
private SocialConfigurationService socialConfigurationService;
private CallerMock<SocialConfigurationService> socialConfigurationServiceCallerMock;
@Mock
private DefaultWorkbenchFeaturesMenusHelper menusHelper;
@Mock
protected ClientUserSystemManager userSystemManager;
@Mock
protected WorkbenchMenuBarPresenter menuBar;
@Mock
protected SyncBeanManager iocManager;
@Mock
protected Workbench workbench;
@Mock
protected PermissionTreeSetup permissionTreeSetup;
@Mock
protected DefaultAdminPageHelper adminPageHelper;
private KieDroolsWorkbenchEntryPoint kieDroolsWorkbenchEntryPoint;
@Before
public void setup() {
doNothing().when( pmas ).initActivities( anyList() );
doReturn( Boolean.TRUE ).when( socialConfigurationService ).isSocialEnable();
doAnswer( invocationOnMock -> {
( ( Command ) invocationOnMock.getArguments()[0] ).execute();
return null;
} ).when( userSystemManager ).waitForInitialization( any( Command.class ) );
appConfigServiceCallerMock = new CallerMock<>( appConfigService );
socialConfigurationServiceCallerMock = new CallerMock<>( socialConfigurationService );
pmasCallerMock = new CallerMock<>( pmas );
kieDroolsWorkbenchEntryPoint = spy( new KieDroolsWorkbenchEntryPoint( appConfigServiceCallerMock,
pmasCallerMock,
activityBeansCache,
homeProducer,
socialConfigurationServiceCallerMock,
menusHelper,
userSystemManager,
menuBar,
iocManager,
workbench,
permissionTreeSetup,
adminPageHelper ) );
mockMenuHelper();
mockConstants();
IocTestingUtils.mockIocManager( iocManager );
doNothing().when( kieDroolsWorkbenchEntryPoint ).hideLoadingPopup();
}
@Test
public void initTest() {
kieDroolsWorkbenchEntryPoint.init();
verify( workbench ).addStartupBlocker( KieDroolsWorkbenchEntryPoint.class );
verify( homeProducer ).init();
}
@Test
public void setupMenuTest() {
kieDroolsWorkbenchEntryPoint.setupMenu();
ArgumentCaptor<Menus> menusCaptor = ArgumentCaptor.forClass( Menus.class );
verify( menuBar ).addMenus( menusCaptor.capture() );
Menus menus = menusCaptor.getValue();
assertEquals( 5, menus.getItems().size() );
assertEquals( kieDroolsWorkbenchEntryPoint.constants.home(), menus.getItems().get( 0 ).getCaption() );
assertEquals( kieDroolsWorkbenchEntryPoint.constants.authoring(), menus.getItems().get( 1 ).getCaption() );
assertEquals( kieDroolsWorkbenchEntryPoint.constants.deploy(), menus.getItems().get( 2 ).getCaption() );
assertEquals( kieDroolsWorkbenchEntryPoint.constants.extensions(), menus.getItems().get( 3 ).getCaption() );
verify( menusHelper ).addRolesMenuItems();
verify( menusHelper ).addWorkbenchViewModeSwitcherMenuItem();
verify( menusHelper ).addWorkbenchConfigurationMenuItem();
verify( menusHelper ).addUtilitiesMenuItems();
verify( workbench ).removeStartupBlocker( KieDroolsWorkbenchEntryPoint.class );
}
@Test
public void getDeploymentViewsTest() {
List<? extends MenuItem> deploymentMenuItems = kieDroolsWorkbenchEntryPoint.getDeploymentViews();
assertEquals( 1, deploymentMenuItems.size() );
assertEquals( kieDroolsWorkbenchEntryPoint.constants.ExecutionServers(), deploymentMenuItems.get( 0 ).getCaption() );
}
private void mockMenuHelper() {
final ArrayList<MenuItem> menuItems = new ArrayList<>();
menuItems.add( mock( MenuItem.class ) );
doReturn( menuItems ).when( menusHelper ).getHomeViews( anyBoolean() );
doReturn( menuItems ).when( menusHelper ).getAuthoringViews();
doReturn( menuItems ).when( menusHelper ).getExtensionsViews();
}
private void mockConstants() {
kieDroolsWorkbenchEntryPoint.constants = mock( AppConstants.class, new ConstantsAnswerMock() );
}
}
| [
"christian.sadilek@gmail.com"
] | christian.sadilek@gmail.com |
0e4e19e8fd604da5abeab55f8ee38ad4e88f2c9a | 46ff044f1727f4a8f1ec8d8184793fa5136348f1 | /99 OUTROS COD/src/sobreStringsDevmedia/Listagem13.java | db1f32ba317891ffd96e439b608bfb9688ad468c | [] | no_license | josemalcher/Curso-JAVA-1-Loiane | 744516ce152c6d5cee41402ca70e3ae3e500108a | 7532dfc41926ac12f71407f4f15f3c00bd5bbb9b | refs/heads/master | 2020-04-06T07:10:14.620808 | 2016-08-30T01:56:50 | 2016-08-30T01:56:50 | 63,444,105 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 596 | java | package sobreStringsDevmedia;
public class Listagem13 {
/*
* Método replace
*
* Retorna um novo objeto contendo a string original com um trecho
* especificado substituído por outra expressão indicada. Esse método deixa
* a string original inalterada. A versão sobrecarregada do método replace
* permite substituir substrings em vez de caracteres individuais.
*
* Listagem 13: Exemplo do método replace
*/
public static void main(String[] args) {
String nome = "mesquita";
String nomeAlterado = nome.replace('e', 'o');
System.out.println(nomeAlterado);
}
}
| [
"malcher.malch@gmail.com"
] | malcher.malch@gmail.com |
90518b9a774232a41e71f1e7efd34aef7e6d2010 | f0568343ecd32379a6a2d598bda93fa419847584 | /modules/dfp_axis/src/main/java/com/google/api/ads/dfp/axis/v201208/LineItemError.java | a82031e5344e306bad11e80573a256b0d4277959 | [
"Apache-2.0"
] | permissive | frankzwang/googleads-java-lib | bd098b7b61622bd50352ccca815c4de15c45a545 | 0cf942d2558754589a12b4d9daa5902d7499e43f | refs/heads/master | 2021-01-20T23:20:53.380875 | 2014-07-02T19:14:30 | 2014-07-02T19:14:30 | 21,526,492 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,321 | java | /**
* LineItemError.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.dfp.axis.v201208;
/**
* A catch-all error that lists all generic errors associated with
* LineItem.
*/
public class LineItemError extends com.google.api.ads.dfp.axis.v201208.ApiError implements java.io.Serializable {
/* The error reason represented by an enum. */
private com.google.api.ads.dfp.axis.v201208.LineItemErrorReason reason;
public LineItemError() {
}
public LineItemError(
java.lang.String fieldPath,
java.lang.String trigger,
java.lang.String errorString,
java.lang.String apiErrorType,
com.google.api.ads.dfp.axis.v201208.LineItemErrorReason reason) {
super(
fieldPath,
trigger,
errorString,
apiErrorType);
this.reason = reason;
}
/**
* Gets the reason value for this LineItemError.
*
* @return reason * The error reason represented by an enum.
*/
public com.google.api.ads.dfp.axis.v201208.LineItemErrorReason getReason() {
return reason;
}
/**
* Sets the reason value for this LineItemError.
*
* @param reason * The error reason represented by an enum.
*/
public void setReason(com.google.api.ads.dfp.axis.v201208.LineItemErrorReason reason) {
this.reason = reason;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof LineItemError)) return false;
LineItemError other = (LineItemError) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.reason==null && other.getReason()==null) ||
(this.reason!=null &&
this.reason.equals(other.getReason())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getReason() != null) {
_hashCode += getReason().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(LineItemError.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201208", "LineItemError"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("reason");
elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201208", "reason"));
elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v201208", "LineItemError.Reason"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"jradcliff@google.com"
] | jradcliff@google.com |
91fe11289a41fa07416a83bb32c2586f8b526d4b | 97d869cd74778327a02b72813be62686e2c24ab7 | /org.eclipse.xtext.graph/src/org/eclipse/xtext/graph/RailroadSynchronizer.java | afad54ec4be293ec8f9d71f427bf479245881286 | [] | no_license | JanKoehnlein/Xtext-Syntax-View | 9c24346dd021ec56c10b217e10d9117ffa1c6541 | cdd5a575300c9e937133552aa7129276c7e12586 | refs/heads/master | 2020-03-29T15:38:47.160277 | 2010-10-07T10:48:53 | 2010-10-07T10:48:53 | 870,153 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,598 | java | package org.eclipse.xtext.graph;
import org.eclipse.draw2d.IFigure;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.swt.graphics.Font;
import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.xtext.graph.actions.RailroadSelectionLinker;
import org.eclipse.xtext.graph.trafo.Xtext2RailroadTransformer;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.ui.editor.XtextEditor;
import org.eclipse.xtext.ui.editor.model.IXtextDocument;
import org.eclipse.xtext.ui.editor.model.IXtextModelListener;
import org.eclipse.xtext.util.concurrent.IUnitOfWork;
import com.google.inject.Inject;
import com.google.inject.Singleton;
/**
* Synchronizes the railroad diagram view with the active editor.
*
* @author koehnlein
*/
@Singleton
public class RailroadSynchronizer implements IPartListener, IXtextModelListener {
@Inject
private RailroadView view;
@Inject
private Xtext2RailroadTransformer transformer;
@Inject
private RailroadSelectionLinker selectionLinker;
private IXtextDocument lastActiveDocument;
private Font font;
public void partActivated(IWorkbenchPart part) {
updateView(part);
}
private void updateView(IWorkbenchPart part) {
if (part instanceof XtextEditor) {
XtextEditor xtextEditor = (XtextEditor) part;
IXtextDocument xtextDocument = xtextEditor.getDocument();
if (xtextDocument != lastActiveDocument) {
selectionLinker.setXtextEditor(xtextEditor);
final IFigure contents = xtextDocument.readOnly(new IUnitOfWork<IFigure, XtextResource>() {
public IFigure exec(XtextResource resource) throws Exception {
return createFigure(resource);
}
});
if (contents != null) {
view.setContents(contents);
if (lastActiveDocument != null) {
lastActiveDocument.removeModelListener(this);
}
lastActiveDocument = xtextDocument;
lastActiveDocument.addModelListener(this);
}
}
}
}
private IFigure createFigure(XtextResource state) {
EList<EObject> contents = state.getContents();
if (!contents.isEmpty()) {
EObject rootObject = contents.get(0);
return transformer.transform(rootObject);
}
return null;
}
public void partBroughtToTop(IWorkbenchPart part) {
}
public void partClosed(IWorkbenchPart part) {
}
public void partDeactivated(IWorkbenchPart part) {
}
public void partOpened(IWorkbenchPart part) {
}
public void modelChanged(XtextResource resource) {
view.setContents(createFigure(resource));
}
public Font getFont() {
return font;
}
}
| [
"jan.koehnlein@itemis.de"
] | jan.koehnlein@itemis.de |
efcd7c2a551c2810304355ff2de147e8e48a48e0 | d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb | /PROMISE/archives/poi/3.0/org/apache/poi/hssf/record/formula/BoolPtg.java | 0a07e1f08f0d4fee0e231b323ecffb464a200c55 | [] | no_license | hvdthong/DEFECT_PREDICTION | 78b8e98c0be3db86ffaed432722b0b8c61523ab2 | 76a61c69be0e2082faa3f19efd76a99f56a32858 | refs/heads/master | 2021-01-20T05:19:00.927723 | 2018-07-10T03:38:14 | 2018-07-10T03:38:14 | 89,766,606 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,300 | java | Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hssf.record.formula;
import org.apache.poi.hssf.model.Workbook;
import org.apache.poi.hssf.record.RecordInputStream;
/**
* Boolean (boolean)
* Stores a (java) boolean value in a formula.
* @author Paul Krause (pkrause at soundbite dot com)
* @author Andrew C. Oliver (acoliver at apache dot org)
* @author Jason Height (jheight at chariot dot net dot au)
*/
public class BoolPtg
extends Ptg
{
public final static int SIZE = 2;
public final static byte sid = 0x1d;
private boolean field_1_value;
private BoolPtg() {
}
public BoolPtg(RecordInputStream in)
{
field_1_value = (in.readByte() == 1);
}
public BoolPtg(String formulaToken) {
field_1_value = (formulaToken.equals("TRUE"));
}
public void setValue(boolean value)
{
field_1_value = value;
}
public boolean getValue()
{
return field_1_value;
}
public void writeBytes(byte [] array, int offset)
{
array[ offset + 0 ] = sid;
array[ offset + 1 ] = (byte) (field_1_value ? 1 : 0);
}
public int getSize()
{
return SIZE;
}
public String toFormulaString(Workbook book)
{
return field_1_value ? "TRUE" : "FALSE";
}
public byte getDefaultOperandClass() {return Ptg.CLASS_VALUE;}
public Object clone() {
BoolPtg ptg = new BoolPtg();
ptg.field_1_value = field_1_value;
return ptg;
}
}
| [
"hvdthong@github.com"
] | hvdthong@github.com |
7d150613f072ca28425a4dcc7861a2252fb35cab | e89d45f9e6831afc054468cc7a6ec675867cd3d7 | /src/main/java/com/microsoft/graph/requests/extensions/DeviceComplianceScriptDeviceStateCollectionResponse.java | 7e0672f1fb9592f3ffeaf87e4b7d602b391d21ce | [
"MIT"
] | permissive | isabella232/msgraph-beta-sdk-java | 67d3b9251317f04a465042d273fe533ef1ace13e | 7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8 | refs/heads/dev | 2023-03-12T05:44:24.349020 | 2020-11-19T15:51:17 | 2020-11-19T15:51:17 | 318,158,544 | 0 | 0 | MIT | 2021-02-23T20:48:09 | 2020-12-03T10:37:46 | null | UTF-8 | Java | false | false | 2,746 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.extensions;
import com.microsoft.graph.models.extensions.DeviceComplianceScriptDeviceState;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.microsoft.graph.serializer.AdditionalDataManager;
import com.microsoft.graph.serializer.IJsonBackedObject;
import com.microsoft.graph.serializer.ISerializer;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Device Compliance Script Device State Collection Response.
*/
public class DeviceComplianceScriptDeviceStateCollectionResponse implements IJsonBackedObject {
/**
* The list of DeviceComplianceScriptDeviceState within this collection page
*/
@SerializedName("value")
@Expose
public java.util.List<DeviceComplianceScriptDeviceState> value;
/**
* The URL to the next page of this collection, or null
*/
@SerializedName("@odata.nextLink")
@Expose(serialize = false)
public String nextLink;
private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this);
@Override
public final AdditionalDataManager additionalDataManager() {
return additionalDataManager;
}
/**
* The raw representation of this class
*/
private JsonObject rawObject;
/**
* The serializer
*/
private ISerializer serializer;
/**
* Gets the raw representation of this class
*
* @return the raw representation of this class
*/
public JsonObject getRawObject() {
return rawObject;
}
/**
* Gets serializer
*
* @return the serializer
*/
protected ISerializer getSerializer() {
return serializer;
}
/**
* Sets the raw JSON object
*
* @param serializer the serializer
* @param json the JSON object to set this object to
*/
public void setRawObject(final ISerializer serializer, final JsonObject json) {
this.serializer = serializer;
rawObject = json;
if (json.has("value")) {
final JsonArray array = json.getAsJsonArray("value");
for (int i = 0; i < array.size(); i++) {
value.get(i).setRawObject(serializer, (JsonObject) array.get(i));
}
}
}
}
| [
"GraphTooling@service.microsoft.com"
] | GraphTooling@service.microsoft.com |
885a5f1868935932363b61ad6b9e2a38bde97c84 | 85a078e4d25b1e1319b291af7997fb151d9812b5 | /junit002udemy/src/test/java/com/in28002/junit/junit002/controllertesting/ControllerTest.java | 67176841b47977fcc64c7b25d6561bce7a5cfbda | [] | no_license | JohnQ1981/mockitoandjunitinSpringBoot001 | a345e6413e1fa4382be0dc9fcec2fbc91c64a8df | c7c8c9990f3ce022379b0445313215e5c5a26df2 | refs/heads/master | 2023-04-04T09:22:51.519358 | 2021-04-04T17:29:32 | 2021-04-04T17:29:32 | 353,568,560 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,473 | java | package com.in28002.junit.junit002.controllertesting;
import static org.junit.jupiter.api.Assertions.*;
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.web.servlet.WebMvcTest;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.RequestBuilder;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import com.in28002.junit.junit002.controller.Controller;
@ExtendWith(SpringExtension.class)
@WebMvcTest(Controller.class)
class ControllerTest {
@Autowired
private MockMvc mockMvc;
@Test
void helloWorld_basic() throws Exception {
//call GET request/"hello"/
RequestBuilder request= MockMvcRequestBuilders
.get("/hello")
.accept(MediaType.APPLICATION_JSON);
MvcResult result= mockMvc.perform(request)
.andExpect(status().isOk())
.andExpect(content().string("Hello World"))
.andReturn();
// verify "Hello World
assertEquals("Hello World", result.getResponse().getContentAsString());
}
}
| [
"ikram1981@gmail.com"
] | ikram1981@gmail.com |
cd83c107eedb62ab0b92d7e8c65cb1d5164ada4c | 5458caf845278e6abce475dd688ac953d9085cbc | /core/src/z/debug/TargetPoint.java | 7514824ec0813b70ef4fc63c6df8baba02f95be6 | [
"Apache-2.0"
] | permissive | AntumDeluge/StendhalArcClient | a75af5dcacfa9274db18ee22157e4aaf81c5e4be | 70d9c37d1b4112349e4dbabc3206204b4446d6d0 | refs/heads/main | 2023-06-23T21:10:35.775931 | 2021-07-29T14:59:08 | 2021-07-29T14:59:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,048 | java | package z.debug;
import arc.ai.utils.Location;
import arc.math.geom.Vec2;
/**
*
*/
public class TargetPoint implements Location<Vec2> {
public Vec2 pos = new Vec2();
public float angle = 90;
public TargetPoint(float x, float y) {
pos.set(x, y);
}
public void setPos (float x, float y) {
pos.set(x, y);
}
public void setAngle(float angle) {
this.angle = angle;
}
@Override
public Vec2 getPosition() {
return pos;
}
@Override
public float getOrientation() {
return angle;
}
@Override
public void setOrientation(float orientation) {
this.angle += orientation;
// if (angle > 360) angle = 0;
// if (angle < 0) angle = 360;
}
@Override
public float vectorToAngle(Vec2 vector) {
return vector.angle();
}
@Override
public Vec2 angleToVector(Vec2 outVector, float angle) {
return null;
}
@Override
public Location<Vec2> newLocation() {
return null;
}
}
| [
"32406374+zonesgame@users.noreply.github.com"
] | 32406374+zonesgame@users.noreply.github.com |
5a1633000d64d39d9af0eda2e904980658ddfc7d | 79e4da87d5cd334d449d6819bbfe10e24fe9f14c | /kontroll-api/kontroll-ui/src/main/java/com/tmt/kontroll/ui/page/configuration/impl/components/form/ReadonlyConfigurator.java | 5302bce74c8f4680a892f8b5e73e6150c3f19d84 | [] | no_license | SergDerbst/Kontroll | 0a1a9563dfc83cba361a6999ff978b0996f9e484 | 6b07b8a511ba4b0b4bd7522efdce08cc9dd5c0dd | refs/heads/master | 2021-01-11T00:11:13.768181 | 2015-04-19T11:28:42 | 2015-04-19T11:28:42 | 15,509,212 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 800 | java | package com.tmt.kontroll.ui.page.configuration.impl.components.form;
import java.lang.annotation.Annotation;
import com.tmt.kontroll.ui.page.configuration.PageSegmentConfigurator;
import com.tmt.kontroll.ui.page.configuration.annotations.components.form.controls.Readonly;
import com.tmt.kontroll.ui.page.segments.PageSegment;
/**
* Configures {@link PageSegment}s annotated with {@link Readonly}. Essentially,
* it will just add an empty attribute <code>readonly</code> to it.
*
* @author SergDerbst
*
*/
public class ReadonlyConfigurator extends PageSegmentConfigurator {
@Override
protected Class<? extends Annotation> getAnnotationType() {
return Readonly.class;
}
@Override
public void configure(final PageSegment segment) {
segment.getAttributes().put("readonly", "");
}
}
| [
"sergio.weigel@gmail.com"
] | sergio.weigel@gmail.com |
6e0214a878915336fa0119bfc897fa514d110c95 | 139960e2d7d55e71c15e6a63acb6609e142a2ace | /mobile_app1/module820/src/main/java/module820packageJava0/Foo62.java | ce809ec92947265652ffac01a2224eed61ebd1eb | [
"Apache-2.0"
] | permissive | uber-common/android-build-eval | 448bfe141b6911ad8a99268378c75217d431766f | 7723bfd0b9b1056892cef1fef02314b435b086f2 | refs/heads/master | 2023-02-18T22:25:15.121902 | 2023-02-06T19:35:34 | 2023-02-06T19:35:34 | 294,831,672 | 83 | 7 | Apache-2.0 | 2021-09-24T08:55:30 | 2020-09-11T23:27:37 | Java | UTF-8 | Java | false | false | 566 | java | package module820packageJava0;
import java.lang.Integer;
public class Foo62 {
Integer int0;
Integer int1;
Integer int2;
public void foo0() {
new module820packageJava0.Foo61().foo9();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
public void foo6() {
foo5();
}
public void foo7() {
foo6();
}
public void foo8() {
foo7();
}
public void foo9() {
foo8();
}
}
| [
"oliviern@uber.com"
] | oliviern@uber.com |
395c20d168da50daeb55f6bc9cec672d3f8c983b | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project1/src/test/java/org/gradle/test/performance1_1/Test1_26.java | 6be66d841415e3578884d2678026740967fc3c0c | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 285 | java | package org.gradle.test.performance1_1;
import static org.junit.Assert.*;
public class Test1_26 {
private final Production1_26 production = new Production1_26("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
f3aae9a1fb20a625e1e42d9f0dc2030a473c1469 | 03628fd6912fc113959358833d3093d0b299c638 | /src/main/java/hackerrank/ctci/BubbleSort.java | 37d3fba39468b01e0b355b309cb189f376b7f8ae | [
"MIT"
] | permissive | choirunisa49/hackerrank | 2be2a45d5499477db32492ab49d8fa824fe907a3 | 64e815c5a4c3142200d2c0b764ba3ec529e2a208 | refs/heads/master | 2021-06-07T15:44:58.079565 | 2016-10-23T03:22:46 | 2016-10-23T03:22:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,421 | java | package hackerrank.ctci;
import java.util.Scanner;
/**
* https://www.hackerrank.com/challenges/ctci-bubble-sort
*/
public class BubbleSort {
private static void bubbleSort(int[] a) {
int numberOfSwaps = 0;
for (int i = 0; i < a.length; i++) {
// Track number of elements swapped during a single array traversal
for (int j = 0; j < a.length - 1; j++) {
// Swap adjacent elements if they are in decreasing order
if (a[j] > a[j + 1]) {
swap(a, j, j + 1);
numberOfSwaps++;
}
}
// If no elements were swapped during a traversal, array is sorted
if (numberOfSwaps == 0) {
break;
}
}
System.out.println(String.format("Array is sorted in %d swaps.", numberOfSwaps));
System.out.println(String.format("First Element: %d", a[0]));
System.out.println(String.format("Last Element: %d", a[a.length - 1]));
}
private static void swap(int[] a, int i, int j) {
int tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
a[i] = in.nextInt();
}
bubbleSort(a);
}
}
| [
"fredy.wijaya@gmail.com"
] | fredy.wijaya@gmail.com |
88cd9bf704acedd0c146e18ade074f89c06c341a | 914cd8b59592d49daa5fad665c44b94bc8cc45d6 | /RPC/Netty/netty/netty-demo/src/main/java/com/lwj/_07_netty_chat/NettyChatClientHandler.java | dc7179f77172a7d8d6f5000da692517b9347fe44 | [
"Apache-2.0"
] | permissive | networkcv/Framework | 29699c94c6939bfe0132039f59bf50842a858ce2 | 350b6fb49569d0161fb9b493fc9dfb48cfc0e0db | refs/heads/master | 2023-08-18T04:01:02.252636 | 2023-07-18T05:57:36 | 2023-07-18T05:57:36 | 219,328,092 | 3 | 2 | Apache-2.0 | 2023-08-31T17:23:02 | 2019-11-03T16:11:20 | Java | UTF-8 | Java | false | false | 530 | java | package com.lwj._07_netty_chat;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
/**
* 聊天室处理类
*/
public class NettyChatClientHandler extends SimpleChannelInboundHandler<String> {
/**
* 通道读取就绪事件
*
* @param ctx
* @param msg
* @throws Exception
*/
@Override
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
System.out.println(msg);
}
}
| [
"networkcavalry@gmail.com"
] | networkcavalry@gmail.com |
2b794c7c0d9582ff2e892cf40b0bfc970aa0eb1e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/32/32_bea65c4fe5880282ef12f2db70f18a6eb1c40a9c/TreasureMapOOTest/32_bea65c4fe5880282ef12f2db70f18a6eb1c40a9c_TreasureMapOOTest_t.java | 9567b82ca6a7172289fac00a364440a9abb01fd6 | [] | 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 | 3,690 | java | package com.francesc.treasuremap;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.francesc.treasuremap.oo.Map;
import com.francesc.treasuremap.oo.Point;
import com.francesc.treasuremap.oo.TreasureMapIterative;
import com.francesc.treasuremap.oo.TreasureMapRecursive;
/**
*
* @author Francesc Quiones Gispert
* @date 12/09/2012
*
* I developed the OO approach to demonstrate my OO knowledge. I don't
* know my mistake but this approach is much slower, 10 times, than the
* basic type approach
*
*/
public class TreasureMapOOTest {
private int[][] mapTest = { { 'X', '-', '-' }, { '-', '-', '-' },
{ '-', '-', 'X' } };
private int[][] mapResult = { { 1, 1, 0 }, { 1, 2, 1 }, { 0, 1, 1 } };
/**
* Test if TreasureMap solves mapTest as mapResult expected
*/
@Test
public void testTreasureMapSolve() {
TreasureMapIterative t = new TreasureMapIterative(mapTest);
// t.setMap(mapTest);
t.solve();
for (int i = 0; i < mapResult.length; i++) {
for (int j = 0; j < mapResult[i].length; j++) {
Point p = (Point) t.getMap().get(i).get(j);
assertTrue(mapResult[i][j] == p.getNumTreasures());
}
}
}
/**
* Test if TreasureMapRecursive solves mapTest as mapResult expected
*/
@Test
public void testTreasureMapRecursive() {
TreasureMapRecursive t = new TreasureMapRecursive(mapTest);
t.solve();
for (int i = 0; i < mapResult.length; i++) {
for (int j = 0; j < mapResult[i].length; j++) {
Point p = (Point) t.getMap().get(i).get(j);
assertTrue(mapResult[i][j] == p.getNumTreasures());
}
}
}
/**
* Test if there is any runtime exception
*/
@Test
public void testTreasureMapIterativeSolveAutoGenerated() {
TreasureMapIterative t = new TreasureMapIterative(10, 10, 0.9);
t.populate();
t.solve();
t = new TreasureMapIterative(0, 0, 0.9);
t.populate();
t.solve();
}
/**
* Test to be sure that a null map cannot be used
*/
@Test
public void testTreasureMapFailIfMapNull() {
boolean ex = false;
TreasureMapIterative t = null;
try {
t = new TreasureMapIterative(null);
} catch (NullPointerException e) {
ex = true;
}
assertTrue(ex);
}
/**
* Test to ensure that no exceptions are thrown
*/
@Test
public void testTreasureMapRecursiveAutoGenerated() {
TreasureMapRecursive t = new TreasureMapRecursive(10, 10, 0.9);
t.populate();
t.solve();
t = new TreasureMapRecursive(0, 0, 0.9);
t.populate();
t.solve();
}
/**
* Test to know the performance
*/
@Test
public void testTreasureMapPerformance() {
Map treasureMap = null;
// Stress with iterative approach
treasureMap = new TreasureMapIterative(1000, 1000, 0.9);
treasureMap.populate();
treasureMap.solve();
// System.out.println(treasureMap);
// Stress with recursive approach
treasureMap = new TreasureMapRecursive(1000, 1000, 0.9);
treasureMap.populate();
treasureMap.solve();
}
/**
* Test to check if point is in map grid
*/
@Test
public void testTreasureMapIInGrid() {
Map t = new TreasureMapIterative(mapTest);
for (int i = 0; i < mapTest.length; i++) {
for (int j = 0; j < mapTest[i].length; j++) {
assertTrue(t.isInGrid(i, j));
}
}
assertFalse(t.isInGrid(-1, 1));
assertFalse(t.isInGrid(-1, -1));
assertFalse(t.isInGrid(1, -1));
assertFalse(t.isInGrid(mapTest.length, mapTest[0].length));
assertFalse(t.isInGrid(mapTest.length, mapTest[0].length - 1));
assertFalse(t.isInGrid(mapTest.length - 1, mapTest[0].length));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c5562ba29aaa0d00835e814aedbe1141ee40cba3 | 70e16d746b9a3c6ec2628bff7c986c9ea4ccf0df | /lib_zxing/lib_zxing_core/src/main/java/com/google/zxing/datamatrix/encoder/ErrorCorrection.java | dad1fd06dcd1abc4dae542930dee6b1d62b41ce9 | [] | no_license | 66668/FastQrcode3 | 9e1020bdfe4c17fb92dd401c9ade1a96e171c2fa | d2bbc751349cf2b9e887de68ec2891ed4af1e4fb | refs/heads/master | 2020-06-29T21:23:32.503807 | 2019-08-08T04:12:08 | 2019-08-08T04:12:08 | 200,628,505 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,204 | java | /*
* Copyright 2006 Jeremias Maerki.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this string_b 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.google.zxing.datamatrix.encoder;
/**
* Error Correction Code for ECC200.
*/
public final class ErrorCorrection {
/**
* Lookup table which factors to use for which number of error correction codewords.
* See FACTORS.
*/
private static final int[] FACTOR_SETS
= {5, 7, 10, 11, 12, 14, 18, 20, 24, 28, 36, 42, 48, 56, 62, 68};
/**
* Precomputed polynomial factors for ECC 200.
*/
private static final int[][] FACTORS = {
{228, 48, 15, 111, 62},
{23, 68, 144, 134, 240, 92, 254},
{28, 24, 185, 166, 223, 248, 116, 255, 110, 61},
{175, 138, 205, 12, 194, 168, 39, 245, 60, 97, 120},
{41, 153, 158, 91, 61, 42, 142, 213, 97, 178, 100, 242},
{156, 97, 192, 252, 95, 9, 157, 119, 138, 45, 18, 186, 83, 185},
{83, 195, 100, 39, 188, 75, 66, 61, 241, 213, 109, 129, 94, 254, 225, 48, 90, 188},
{15, 195, 244, 9, 233, 71, 168, 2, 188, 160, 153, 145, 253, 79, 108, 82, 27, 174, 186, 172},
{52, 190, 88, 205, 109, 39, 176, 21, 155, 197, 251, 223, 155, 21, 5, 172,
254, 124, 12, 181, 184, 96, 50, 193},
{211, 231, 43, 97, 71, 96, 103, 174, 37, 151, 170, 53, 75, 34, 249, 121,
17, 138, 110, 213, 141, 136, 120, 151, 233, 168, 93, 255},
{245, 127, 242, 218, 130, 250, 162, 181, 102, 120, 84, 179, 220, 251, 80, 182,
229, 18, 2, 4, 68, 33, 101, 137, 95, 119, 115, 44, 175, 184, 59, 25,
225, 98, 81, 112},
{77, 193, 137, 31, 19, 38, 22, 153, 247, 105, 122, 2, 245, 133, 242, 8,
175, 95, 100, 9, 167, 105, 214, 111, 57, 121, 21, 1, 253, 57, 54, 101,
248, 202, 69, 50, 150, 177, 226, 5, 9, 5},
{245, 132, 172, 223, 96, 32, 117, 22, 238, 133, 238, 231, 205, 188, 237, 87,
191, 106, 16, 147, 118, 23, 37, 90, 170, 205, 131, 88, 120, 100, 66, 138,
186, 240, 82, 44, 176, 87, 187, 147, 160, 175, 69, 213, 92, 253, 225, 19},
{175, 9, 223, 238, 12, 17, 220, 208, 100, 29, 175, 170, 230, 192, 215, 235,
150, 159, 36, 223, 38, 200, 132, 54, 228, 146, 218, 234, 117, 203, 29, 232,
144, 238, 22, 150, 201, 117, 62, 207, 164, 13, 137, 245, 127, 67, 247, 28,
155, 43, 203, 107, 233, 53, 143, 46},
{242, 93, 169, 50, 144, 210, 39, 118, 202, 188, 201, 189, 143, 108, 196, 37,
185, 112, 134, 230, 245, 63, 197, 190, 250, 106, 185, 221, 175, 64, 114, 71,
161, 44, 147, 6, 27, 218, 51, 63, 87, 10, 40, 130, 188, 17, 163, 31,
176, 170, 4, 107, 232, 7, 94, 166, 224, 124, 86, 47, 11, 204},
{220, 228, 173, 89, 251, 149, 159, 56, 89, 33, 147, 244, 154, 36, 73, 127,
213, 136, 248, 180, 234, 197, 158, 177, 68, 122, 93, 213, 15, 160, 227, 236,
66, 139, 153, 185, 202, 167, 179, 25, 220, 232, 96, 210, 231, 136, 223, 239,
181, 241, 59, 52, 172, 25, 49, 232, 211, 189, 64, 54, 108, 153, 132, 63,
96, 103, 82, 186}};
private static final int MODULO_VALUE = 0x12D;
private static final int[] LOG;
private static final int[] ALOG;
static {
//Create log and antilog table
LOG = new int[256];
ALOG = new int[255];
int p = 1;
for (int i = 0; i < 255; i++) {
ALOG[i] = p;
LOG[p] = i;
p *= 2;
if (p >= 256) {
p ^= MODULO_VALUE;
}
}
}
private ErrorCorrection() {
}
/**
* Creates the ECC200 error correction for an encoded message.
*
* @param codewords the codewords
* @param symbolInfo information about the symbol to be encoded
* @return the codewords with interleaved error correction.
*/
public static String encodeECC200(String codewords, SymbolInfo symbolInfo) {
if (codewords.length() != symbolInfo.getDataCapacity()) {
throw new IllegalArgumentException(
"The number of codewords does not match the selected symbol");
}
StringBuilder sb = new StringBuilder(symbolInfo.getDataCapacity() + symbolInfo.getErrorCodewords());
sb.append(codewords);
int blockCount = symbolInfo.getInterleavedBlockCount();
if (blockCount == 1) {
String ecc = createECCBlock(codewords, symbolInfo.getErrorCodewords());
sb.append(ecc);
} else {
sb.setLength(sb.capacity());
int[] dataSizes = new int[blockCount];
int[] errorSizes = new int[blockCount];
int[] startPos = new int[blockCount];
for (int i = 0; i < blockCount; i++) {
dataSizes[i] = symbolInfo.getDataLengthForInterleavedBlock(i + 1);
errorSizes[i] = symbolInfo.getErrorLengthForInterleavedBlock(i + 1);
startPos[i] = 0;
if (i > 0) {
startPos[i] = startPos[i - 1] + dataSizes[i];
}
}
for (int block = 0; block < blockCount; block++) {
StringBuilder temp = new StringBuilder(dataSizes[block]);
for (int d = block; d < symbolInfo.getDataCapacity(); d += blockCount) {
temp.append(codewords.charAt(d));
}
String ecc = createECCBlock(temp.toString(), errorSizes[block]);
int pos = 0;
for (int e = block; e < errorSizes[block] * blockCount; e += blockCount) {
sb.setCharAt(symbolInfo.getDataCapacity() + e, ecc.charAt(pos++));
}
}
}
return sb.toString();
}
private static String createECCBlock(CharSequence codewords, int numECWords) {
return createECCBlock(codewords, 0, codewords.length(), numECWords);
}
private static String createECCBlock(CharSequence codewords, int start, int len, int numECWords) {
int table = -1;
for (int i = 0; i < FACTOR_SETS.length; i++) {
if (FACTOR_SETS[i] == numECWords) {
table = i;
break;
}
}
if (table < 0) {
throw new IllegalArgumentException(
"Illegal number of error correction codewords specified: " + numECWords);
}
int[] poly = FACTORS[table];
char[] ecc = new char[numECWords];
for (int i = 0; i < numECWords; i++) {
ecc[i] = 0;
}
for (int i = start; i < start + len; i++) {
int m = ecc[numECWords - 1] ^ codewords.charAt(i);
for (int k = numECWords - 1; k > 0; k--) {
if (m != 0 && poly[k] != 0) {
ecc[k] = (char) (ecc[k - 1] ^ ALOG[(LOG[m] + LOG[poly[k]]) % 255]);
} else {
ecc[k] = ecc[k - 1];
}
}
if (m != 0 && poly[0] != 0) {
ecc[0] = (char) ALOG[(LOG[m] + LOG[poly[0]]) % 255];
} else {
ecc[0] = 0;
}
}
char[] eccReversed = new char[numECWords];
for (int i = 0; i < numECWords; i++) {
eccReversed[i] = ecc[numECWords - i - 1];
}
return String.valueOf(eccReversed);
}
}
| [
"sjy0118atsn@163.com"
] | sjy0118atsn@163.com |
cb507e0e03b113d5d784d1a2c14b4d46fad50489 | acd7cff1d4892900d0721190d78eac09a649a047 | /src/by/it/plehanova/jd01_09/Patterns.java | d16fd5e60c38a335783a706c74f9b5ca325693a4 | [] | no_license | Konstantinchik/Java-course | 968a1d59472f91d4e6c5bcdb6eb1df3059681d65 | 381e159562e03b7dcd4e7dc7e18a85d3f19390fb | refs/heads/main | 2023-03-24T17:29:49.276214 | 2021-03-19T19:56:05 | 2021-03-19T19:56:05 | 349,524,807 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package by.it.plehanova.jd01_09;
public class Patterns {
static final String OPERATION = "[-+*/]";
static final String SCALAR = "\\-?[0-9]+(.?[0-9]+)?";
static final String VECTOR = "\\{((\\-?[0-9]+(.?[0-9]+)?)\\,?)+}";
static final String MATRIX = "\\{((\\{((\\-?[0-9]+(.?[0-9]+)?)\\,?)+})\\,?)+}";
}
| [
"kgluschenko83@gmail.com"
] | kgluschenko83@gmail.com |
82132902de72faf436799c1fefce200312500f92 | 720290954035d5c0a55c4610f47249ece7f41ea2 | /ThirdServer/src/main/java/com/prostate/sms/service/SmsService.java | bf57c909eb5cc87a716f1649cbb1f41ceaf8e873 | [] | no_license | MaxCoderCh/Sicmed | ff553d5ebc51d5e71e1379166dd7977d42553905 | 4beededf51b2a88f087efd42305f6b86f5412622 | refs/heads/master | 2022-09-12T03:24:33.580720 | 2019-05-31T06:01:55 | 2019-05-31T06:01:55 | 145,105,349 | 1 | 0 | null | 2022-09-01T22:49:45 | 2018-08-17T10:08:48 | JavaScript | UTF-8 | Java | false | false | 997 | java | package com.prostate.sms.service;
import com.github.qcloudsms.httpclient.HTTPException;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.ArrayList;
@Service
public interface SmsService {
/**
* 指定模板单发短信
*/
boolean singleSendByTemplate(String nationCode, String phoneNumber, int templateId, ArrayList<String> param) throws HTTPException, IOException;
/**
* 指定模板群发短信
*/
boolean multiSendByTemplate(String nationCode, ArrayList<String> phoneNumbers, int templateId, ArrayList<String> params) throws HTTPException, IOException;
/**
* 单发短信
*/
boolean singleSend(int type, String nationCode, String phoneNumber, String msg) throws HTTPException, IOException;
/**
* 群发短信
*/
boolean multiSend(int type, String nationCode, ArrayList<String> phoneNumbers, ArrayList<String> params, String msg) throws HTTPException, IOException;
}
| [
"MaxCoderCh@users.noreply.github.com"
] | MaxCoderCh@users.noreply.github.com |
f8310795c1704905ae43d90b307312abf4a470d1 | e4f25de38052f504f39cf12f27af3693d9fc1fb4 | /app/src/main/java/com/zf/weisport/ui/callback/IForgetPsdCallback.java | b4931f3b029a20bbb6225a116b86b9b338ccd65f | [] | no_license | githubBanana/iWeiDong | fc1d91f0436f7c5981bcd163112a6b3b840e10d3 | bd7c1591be60587569f04ba84e8009dd69504b29 | refs/heads/master | 2020-07-31T00:15:06.348592 | 2016-09-28T10:04:34 | 2016-09-28T10:04:34 | 67,212,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.zf.weisport.ui.callback;
/**
* @version V1.0 <描述当前版本功能>
* @author: Xs
* @date: 2016-09-07 10:52
* @email Xs.lin@foxmail.com
*/
public interface IForgetPsdCallback extends IBaseCallback{
/**
* 获取验证码结果状态回调
*/
void onGetVerifyCodesStaus(boolean isSuccess);
}
| [
"784843867@qq.com"
] | 784843867@qq.com |
d1056965a8acf2f09cbf510beeaa7d6378621b46 | f54068400a19f41c26880b2a4a9683145f10f35f | /FEC_Mobile_Backend-master/src/main/java/vn/com/unit/fe_credit/service/ApplyNowService.java | 7044e46919dc9948003831d6d611000b69a613a8 | [] | no_license | saubhagya1987/myproj6 | 2b2933147c2cf1e23740048897d0dadadab7c1bd | 5691e3992aaab5bf76c691a898bd368c8d832b0a | refs/heads/master | 2020-03-18T18:01:08.296442 | 2018-05-27T17:26:47 | 2018-05-27T17:26:47 | 135,066,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 574 | java | package vn.com.unit.fe_credit.service;
import java.util.List;
import vn.com.unit.fe_credit.bean.ApplyNowBean;
import vn.com.unit.fe_credit.entity.ApplyNow;
public interface ApplyNowService {
List<Object[]> search(ApplyNowBean bean);
Integer countSearch(ApplyNowBean bean);
void saveApplyNow(ApplyNow entity);
ApplyNowBean searchEx(ApplyNowBean bean);
ApplyNow findById(Long id);
List<ApplyNow> searchApplyNow(long customerId, Long loanId, String product, long status) throws Exception;
void exportCSVToVTiger(ApplyNowBean applyNowBean) throws Exception;
}
| [
"saubhagya.bapu@gmail.com"
] | saubhagya.bapu@gmail.com |
dfc7eb324f9cd4b03f7ded43b1522afb36438125 | 012af20870157a3c84623e09eadf636b1c3b793b | /speechrecorder/src/main/java/ipsk/apps/speechrecorder/prompting/StopPromptPlaybackAction.java | a52f0874f605471b264bac2ebe0cc662a063afe2 | [] | no_license | naseem91/SpeechRecorderSBT | 77c7e129676ffe39da28cc39e1ddc4bb3cfc6407 | 002fd9fb341ca162495c274da94d0e348a283b52 | refs/heads/master | 2020-03-19T18:36:42.967724 | 2018-06-10T14:51:30 | 2018-06-10T14:51:30 | 136,816,898 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,028 | java | // Speechrecorder
// (c) Copyright 2012
// Institute of Phonetics and Speech Processing,
// Ludwig-Maximilians-University, Munich, Germany
//
//
// This file is part of Speechrecorder
//
//
// Speechrecorder 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, version 3 of the License.
//
// Speechrecorder 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 Speechrecorder. If not, see <http://www.gnu.org/licenses/>.
/*
* Date : Jul 1, 2005
* Author: K.Jaensch, klausj@phonetik.uni-muenchen.de
*/
package ipsk.apps.speechrecorder.prompting;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
/**
* @author K.Jaensch, klausj@phonetik.uni-muenchen.de
*
*/
public class StopPromptPlaybackAction extends AbstractAction {
private static final long serialVersionUID = 1L;
public final static String ACTION_COMMAND = new String("stop_prompt_playback");
//public final static String SHORT_DESCRIPTION_VAL=new String("Start prompt playback");
private Prompter prompter;
private Icon icon;
/**
*
*/
public StopPromptPlaybackAction(Prompter prompter,Icon icon) {
super();
this.prompter=prompter;
this.icon=icon;
putValue(Action.ACTION_COMMAND_KEY, ACTION_COMMAND);
resetIcon();
}
public void resetIcon(){
putValue(Action.SMALL_ICON,icon);
putValue(Action.NAME,null);
}
public String getActionCommand() {
return (String) getValue(Action.ACTION_COMMAND_KEY);
}
public void actionPerformed(ActionEvent arg0) {
prompter.stop();
}
}
| [
"naseemmahasneh1991@gmail.com"
] | naseemmahasneh1991@gmail.com |
64f240630b3fd6f87dcdef23de2ef56325f72717 | d99e6aa93171fafe1aa0bb39b16c1cc3b63c87f1 | /stress/src/main/java/com/stress/sub0/sub2/sub6/Class786.java | eb31f3393dc3580da2dee3570612b203c1964f1e | [] | no_license | jtransc/jtransc-examples | 291c9f91c143661c1776ddb7a359790caa70a37b | f44979531ac1de72d7af52545c4a9ef0783a0d5b | refs/heads/master | 2021-01-17T13:19:55.535947 | 2017-09-13T06:31:25 | 2017-09-13T06:31:25 | 51,407,684 | 14 | 4 | null | 2017-07-04T10:18:40 | 2016-02-09T23:11:45 | Java | UTF-8 | Java | false | false | 386 | java | package com.stress.sub0.sub2.sub6;
import com.jtransc.annotation.JTranscKeep;
@JTranscKeep
public class Class786 {
public static final String static_const_786_0 = "Hi, my num is 786 0";
static int static_field_786_0;
int member_786_0;
public void method786()
{
System.out.println(static_const_786_0);
}
public void method786_1(int p0, String p1)
{
System.out.println(p1);
}
}
| [
"soywiz@gmail.com"
] | soywiz@gmail.com |
3082c5169413ced86e46f4aea389b1b0aa94f915 | 7187f68aa2b8fef7ccd03dc5b69dff480323cec2 | /cartographer/src/test/java/org/commonjava/cartographer/testutil/TestCartoCoreProvider.java | b9377d77c381bc7771d5a2eee1d1de80a342e204 | [] | no_license | jsenko/cartographer | 866e67a2793d2e5369e4c9c0a2519fadc99f969a | 5164078399d36b67ddb55ed9f7df26b2ef44919d | refs/heads/master | 2021-01-13T12:46:36.175479 | 2016-10-24T20:50:22 | 2016-10-24T20:50:22 | 72,440,234 | 0 | 0 | null | 2016-10-31T13:44:22 | 2016-10-31T13:44:22 | null | UTF-8 | Java | false | false | 5,656 | java | /**
* Copyright (C) 2013 Red Hat, Inc. (jdcasey@commonjava.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.
*/
package org.commonjava.cartographer.testutil;
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Default;
import javax.enterprise.inject.Produces;
import org.apache.commons.io.FileUtils;
import org.commonjava.maven.atlas.graph.RelationshipGraphException;
import org.commonjava.maven.atlas.graph.RelationshipGraphFactory;
import org.commonjava.maven.atlas.graph.spi.neo4j.FileNeo4jConnectionFactory;
import org.commonjava.maven.galley.auth.MemoryPasswordManager;
import org.commonjava.maven.galley.cache.FileCacheProviderConfig;
import org.commonjava.maven.galley.event.NoOpFileEventManager;
import org.commonjava.maven.galley.io.NoOpTransferDecorator;
import org.commonjava.maven.galley.nfc.NoOpNotFoundCache;
import org.commonjava.maven.galley.spi.auth.PasswordManager;
import org.commonjava.maven.galley.spi.event.FileEventManager;
import org.commonjava.maven.galley.spi.io.TransferDecorator;
import org.commonjava.maven.galley.spi.nfc.NotFoundCache;
import org.commonjava.maven.galley.spi.transport.LocationExpander;
import org.commonjava.maven.galley.testing.core.cdi.TestData;
import org.commonjava.maven.galley.transport.NoOpLocationExpander;
import org.commonjava.maven.galley.transport.htcli.Http;
import org.commonjava.maven.galley.transport.htcli.HttpImpl;
import org.junit.rules.TemporaryFolder;
import org.slf4j.LoggerFactory;
@ApplicationScoped
public class TestCartoCoreProvider
{
private final File dbDir;
private final File cacheDir;
private NoOpFileEventManager fileEvents;
private NoOpTransferDecorator transferDecorator;
private NoOpLocationExpander locationExpander;
private NoOpNotFoundCache nfc;
private PasswordManager passwords;
private Http http;
private final Set<File> toDelete = new HashSet<File>();
private FileCacheProviderConfig cacheProviderConfig;
private FileNeo4jConnectionFactory connectionFactory;
private RelationshipGraphFactory graphFactory;
public TestCartoCoreProvider()
throws IOException
{
dbDir = newTempFile( "database" );
cacheDir = newTempFile( "cache" );
}
public TestCartoCoreProvider( final TemporaryFolder temp )
throws IOException
{
dbDir = temp.newFolder( "database" );
cacheDir = temp.newFolder( "cache" );
setup();
}
@PostConstruct
public void setup()
throws IOException
{
cacheProviderConfig = new FileCacheProviderConfig( cacheDir );
fileEvents = new NoOpFileEventManager();
transferDecorator = new NoOpTransferDecorator();
locationExpander = new NoOpLocationExpander();
nfc = new NoOpNotFoundCache();
connectionFactory = new FileNeo4jConnectionFactory( dbDir, false );
graphFactory = new RelationshipGraphFactory( connectionFactory );
passwords = new MemoryPasswordManager();
http = new HttpImpl( passwords );
}
private File newTempFile( final String name )
throws IOException
{
final File dir = File.createTempFile( name, ".dir" );
FileUtils.forceDelete( dir );
dir.mkdirs();
toDelete.add( dir );
return dir;
}
@Produces
@Default
@TestData
public NotFoundCache getNotFoundCache()
{
return nfc;
}
@Produces
@Default
@TestData
public FileCacheProviderConfig getCacheProviderConfig()
{
return cacheProviderConfig;
}
@Produces
@Default
@TestData
public PasswordManager getPasswordManager()
{
return passwords;
}
@Produces
@Default
@TestData
public LocationExpander getLocationExpander()
{
return locationExpander;
}
@Produces
@Default
@TestData
public Http getHttp()
{
return http;
}
@Produces
@Default
@TestData
public FileEventManager getFileEventManager()
{
return fileEvents;
}
@Produces
@Default
@TestData
public TransferDecorator getTransferDecorator()
{
return transferDecorator;
}
@Produces
@Default
@TestData
public RelationshipGraphFactory getGraphFactory()
throws IOException
{
return graphFactory;
}
@PreDestroy
public void shutdown()
throws IOException, RelationshipGraphException
{
graphFactory.close();
for ( final File dir : toDelete )
{
if ( dir.exists() )
{
try
{
FileUtils.forceDelete( dir );
}
catch ( final IOException e )
{
LoggerFactory.getLogger( getClass() )
.error( e.getMessage(), e );
}
}
}
}
}
| [
"jdcasey@commonjava.org"
] | jdcasey@commonjava.org |
98b615005b0cba3e882c3663d8a7478ce28f6586 | c598fde67b77e9d962d64dab360560c97fcb1cf8 | /Chap03/Max3.java | 12b9ffc7121975a3fff718ae0403b77d84269319 | [] | no_license | OctopusLian/MingJieJava | d739eb8fbd7392127a94ae74af03c42e44239f45 | 84a3eee2a891ee509e8a901239dcaa72858f4977 | refs/heads/master | 2022-03-20T08:31:32.894584 | 2019-12-17T14:02:18 | 2019-12-17T14:02:18 | 166,926,566 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | // 计算三个整数值中的最大值
import java.util.Scanner;
class Max3 {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
System.out.print("整数a:"); int a = stdIn.nextInt();
System.out.print("整数b:"); int b = stdIn.nextInt();
System.out.print("整数c:"); int c = stdIn.nextInt();
int max = a;
if (b > max) max = b;
if (c > max) max = c;
System.out.println("最大值是" + max + "。");
}
}
| [
"zoctopus@qq.com"
] | zoctopus@qq.com |
9f4d121fa46e0274e1d781a3b919c8ba5f7cc6c0 | 1faf3d7f807cb75f575232693868a1107b7b2d15 | /bus-health/src/main/java/org/aoju/bus/health/common/windows/PerfDataUtils.java | f864422ce12ea109b116d4b921383a06e18992af | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | yangheqingvip/bus | 77f14ffa5637fd139eeb03134b038f6f4cd41502 | e90e890e3706747561454d4aa238a8db67a35a29 | refs/heads/master | 2020-09-22T18:33:06.154944 | 2019-12-01T15:26:46 | 2019-12-01T15:26:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,721 | java | /*
* The MIT License
*
* Copyright (c) 2017 aoju.org All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.aoju.bus.health.common.windows;
import com.sun.jna.platform.win32.BaseTSD.DWORD_PTR;
import com.sun.jna.platform.win32.*;
import com.sun.jna.platform.win32.Pdh.PDH_RAW_COUNTER;
import com.sun.jna.platform.win32.WinDef.DWORD;
import com.sun.jna.platform.win32.WinDef.DWORDByReference;
import com.sun.jna.platform.win32.WinDef.LONGLONGByReference;
import com.sun.jna.platform.win32.WinNT.HANDLEByReference;
import org.aoju.bus.health.Builder;
import org.aoju.bus.logger.Logger;
/**
* Helper class to centralize the boilerplate portions of PDH counter setup and
* allow applications to easily add, query, and remove counters.
*
* @author Kimi Liu
* @version 5.2.9
* @since JDK 1.8+
*/
public final class PerfDataUtils {
private static final DWORD_PTR PZERO = new DWORD_PTR(0);
private static final DWORDByReference PDH_FMT_RAW = new DWORDByReference(new DWORD(Pdh.PDH_FMT_RAW));
private static final Pdh PDH = Pdh.INSTANCE;
private static final boolean IS_VISTA_OR_GREATER = VersionHelpers.IsWindowsVistaOrGreater();
private PerfDataUtils() {
}
/**
* Create a Performance Counter
*
* @param object The object/path for the counter
* @param instance The instance of the counter, or null if no instance
* @param counter The counter name
* @return A PerfCounter object encapsulating the object, instance, and counter
*/
public static PerfCounter createCounter(String object, String instance, String counter) {
return new PerfCounter(object, instance, counter);
}
/**
* Update a query and get the timestamp
*
* @param query The query to update all counters in
* @return The update timestamp of the first counter in the query
*/
public static long updateQueryTimestamp(WinNT.HANDLEByReference query) {
LONGLONGByReference pllTimeStamp = new LONGLONGByReference();
int ret = IS_VISTA_OR_GREATER ? PDH.PdhCollectQueryDataWithTime(query.getValue(), pllTimeStamp)
: PDH.PdhCollectQueryData(query.getValue());
// Due to race condition, initial update may fail with PDH_NO_DATA.
int retries = 0;
while (ret == PdhMsg.PDH_NO_DATA && retries++ < 3) {
// Exponential fallback.
Builder.sleep(1 << retries);
ret = IS_VISTA_OR_GREATER ? PDH.PdhCollectQueryDataWithTime(query.getValue(), pllTimeStamp)
: PDH.PdhCollectQueryData(query.getValue());
}
if (ret != WinError.ERROR_SUCCESS) {
Logger.warn("Failed to update counter. Error code: {}", String.format(Builder.formatError(ret)));
return 0L;
}
// Perf Counter timestamp is in local time
return IS_VISTA_OR_GREATER ? Builder.filetimeToUtcMs(pllTimeStamp.getValue().longValue(), true)
: System.currentTimeMillis();
}
/**
* Open a pdh query
*
* @param q pointer to the query
* @return true if successful
*/
public static boolean openQuery(HANDLEByReference q) {
int ret = PDH.PdhOpenQuery(null, PZERO, q);
if (ret != WinError.ERROR_SUCCESS) {
Logger.error("Failed to open PDH Query. Error code: {}", String.format(Builder.formatError(ret)));
return false;
}
return true;
}
/**
* Close a pdh query
*
* @param q pointer to the query
* @return true if successful
*/
public static boolean closeQuery(HANDLEByReference q) {
return WinError.ERROR_SUCCESS == PDH.PdhCloseQuery(q.getValue());
}
/**
* Get value of pdh counter
*
* @param counter The counter to get the value of
* @return long value of the counter, or negative value representing an error
* code
*/
public static long queryCounter(WinNT.HANDLEByReference counter) {
PDH_RAW_COUNTER counterValue = new PDH_RAW_COUNTER();
int ret = PDH.PdhGetRawCounterValue(counter.getValue(), PDH_FMT_RAW, counterValue);
if (ret != WinError.ERROR_SUCCESS) {
Logger.warn("Failed to get counter. Error code: {}", String.format(Builder.formatError(ret)));
return ret;
}
return counterValue.FirstValue;
}
/**
* Adds a pdh counter to a query
*
* @param query Pointer to the query to add the counter
* @param path String name of the PerfMon counter
* @param p Pointer to the counter
* @return true if successful
*/
public static boolean addCounter(WinNT.HANDLEByReference query, String path, WinNT.HANDLEByReference p) {
int ret = IS_VISTA_OR_GREATER ? PDH.PdhAddEnglishCounter(query.getValue(), path, PZERO, p)
: PDH.PdhAddCounter(query.getValue(), path, PZERO, p);
if (ret != WinError.ERROR_SUCCESS) {
Logger.warn("Failed to add PDH Counter: {}, Error code: {}", path,
String.format(Builder.formatError(ret)));
return false;
}
return true;
}
/**
* Remove a pdh counter
*
* @param p pointer to the counter
* @return true if successful
*/
public static boolean removeCounter(HANDLEByReference p) {
return WinError.ERROR_SUCCESS == PDH.PdhRemoveCounter(p.getValue());
}
public static class PerfCounter {
private String object;
private String instance;
private String counter;
public PerfCounter(String objectName, String instanceName, String counterName) {
this.object = objectName;
this.instance = instanceName;
this.counter = counterName;
}
/**
* @return Returns the object.
*/
public String getObject() {
return object;
}
/**
* @return Returns the instance.
*/
public String getInstance() {
return instance;
}
/**
* @return Returns the counter.
*/
public String getCounter() {
return counter;
}
/**
* Returns the path for this counter
*
* @return A string representing the counter path
*/
public String getCounterPath() {
StringBuilder sb = new StringBuilder();
sb.append('\\').append(object);
if (instance != null) {
sb.append('(').append(instance).append(')');
}
sb.append('\\').append(counter);
return sb.toString();
}
}
}
| [
"839536@qq.com"
] | 839536@qq.com |
93a0d43b0c6f6b459eb827a3449a1b15dffe11cf | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_85/Testnull_8454.java | 2613b5716c517c96b7b3d1231842cbf4d77c07e6 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 304 | java | package org.gradle.test.performancenull_85;
import static org.junit.Assert.*;
public class Testnull_8454 {
private final Productionnull_8454 production = new Productionnull_8454("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
0c2e8fc65bd308b8fd443d4b077903cb561e6878 | 9a52fe3bcdd090a396e59c68c63130f32c54a7a8 | /sources/com/google/android/gms/internal/drive/zzbb.java | 11410869375159c35d84740c9d1c230250fb5960 | [] | no_license | mzkh/LudoKing | 19d7c76a298ee5bd1454736063bc392e103a8203 | ee0d0e75ed9fa8894ed9877576d8e5589813b1ba | refs/heads/master | 2022-04-25T06:08:41.916017 | 2020-04-14T17:00:45 | 2020-04-14T17:00:45 | 255,670,636 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,224 | java | package com.google.android.gms.internal.drive;
import android.app.Activity;
import android.content.Context;
import android.content.IntentSender;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.common.api.internal.TaskApiCall;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.drive.CreateFileActivityOptions;
import com.google.android.gms.drive.Drive.zza;
import com.google.android.gms.drive.DriveClient;
import com.google.android.gms.drive.DriveId;
import com.google.android.gms.drive.OpenFileActivityOptions;
import com.google.android.gms.drive.TransferPreferences;
import com.google.android.gms.tasks.Task;
public final class zzbb extends DriveClient {
public zzbb(@NonNull Activity activity, @Nullable zza zza) {
super(activity, zza);
}
public zzbb(@NonNull Context context, @Nullable zza zza) {
super(context, zza);
}
public final Task<DriveId> getDriveId(@NonNull String str) {
Preconditions.checkNotNull(str, "resourceId must not be null");
return doRead((TaskApiCall<A, TResult>) new zzbc<A,TResult>(this, str));
}
public final Task<TransferPreferences> getUploadPreferences() {
return doRead((TaskApiCall<A, TResult>) new zzbd<A,TResult>(this));
}
public final Task<IntentSender> newCreateFileActivityIntentSender(CreateFileActivityOptions createFileActivityOptions) {
return doRead((TaskApiCall<A, TResult>) new zzbg<A,TResult>(this, createFileActivityOptions));
}
public final Task<IntentSender> newOpenFileActivityIntentSender(OpenFileActivityOptions openFileActivityOptions) {
return doRead((TaskApiCall<A, TResult>) new zzbf<A,TResult>(this, openFileActivityOptions));
}
public final Task<Void> requestSync() {
return doWrite((TaskApiCall<A, TResult>) new zzbh<A,TResult>(this));
}
public final Task<Void> setUploadPreferences(@NonNull TransferPreferences transferPreferences) {
Preconditions.checkNotNull(transferPreferences, "transferPreferences cannot be null.");
return doWrite((TaskApiCall<A, TResult>) new zzbe<A,TResult>(this, transferPreferences));
}
}
| [
"mdkhnmm@amazon.com"
] | mdkhnmm@amazon.com |
8050e80963dc6adfc15d38da8dd590797357a66b | c9e0a37bd7ac00224ce017ded3b5fce20c553631 | /src/main/java/com/astraltear/batch/schedule/RunScheduler.java | 20d23ed29ce0fc692b27fe88cf90aca8596aaf70 | [] | no_license | astraltear/SpringBatchExam | 074de0f299c21e2b7c0edd8be4defd279880dc83 | 8a26056e9cd925e679a17756bede39324a5d8cae | refs/heads/master | 2020-04-21T00:57:40.549476 | 2016-09-09T02:12:47 | 2016-09-09T02:12:47 | 67,203,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 963 | java | package com.astraltear.batch.schedule;
import java.util.Date;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class RunScheduler {
@Autowired
private JobLauncher jobLauncher;
@Autowired
private Job job;
public void run() {
try {
String dateParam = new Date().toString();
JobParameters param = new JobParametersBuilder().addString("date", dateParam).toJobParameters();
System.out.println(dateParam);
JobExecution execution = jobLauncher.run(job, param);
System.out.println("exis status:"+execution.getStatus());
} catch(Exception e) {
e.printStackTrace();
}
}
}
| [
"astraltear@gmail.com"
] | astraltear@gmail.com |
0d0a939e701b548f82ecc59e1fe5083bb013f6e5 | bb13907de0911a1c03f1a32a7ea16740234abf1c | /src/main/java/com/emc/fapi/jaxws/v4_3_1/GetAvailablePluginVersionsResponse.java | 065cfb08e38e7538f27b74c6bc0615fd8a98c052 | [] | no_license | noamda/fal431 | 9287e95fa2bacdace92e65b16ec6985ce2ded29c | dad30667424970fba049df3ba2c2023b82b9276e | refs/heads/master | 2021-01-21T14:25:10.211169 | 2016-06-20T08:55:43 | 2016-06-20T08:58:33 | 58,481,483 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,447 | java | package com.emc.fapi.jaxws.v4_3_1;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "getAvailablePluginVersionsResponse", propOrder = {"_return"})
public class GetAvailablePluginVersionsResponse {
@XmlElement(name = "return")
protected List<String> _return;
public GetAvailablePluginVersionsResponse() {
}
public GetAvailablePluginVersionsResponse(List<String> _return) {
this._return = _return;
}
public List<String> getReturn() {
if (this._return == null) {
this._return = new ArrayList();
}
return this._return;
}
public boolean equals(Object obj) {
if (!(obj instanceof GetAvailablePluginVersionsResponse)) {
return false;
}
GetAvailablePluginVersionsResponse otherObj = (GetAvailablePluginVersionsResponse) obj;
return this._return == otherObj._return ? true : this._return != null ? this._return.equals(otherObj._return) : false;
}
public int hashCode() {
return this._return != null ? this._return.hashCode() : 0;
}
public String toString() {
return "GetAvailablePluginVersionsResponse [_return=" + this._return + "]";
}
}
| [
"style.daniel@gmail.com"
] | style.daniel@gmail.com |
920bce0ed87a6f25577e727ac343d5e22c1b3c19 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project11/src/test/java/org/gradle/test/performance11_3/Test11_225.java | ce1f723f3e13fc5a143ff783527e2f01bced998d | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance11_3;
import static org.junit.Assert.*;
public class Test11_225 {
private final Production11_225 production = new Production11_225("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
73522d46cbb685ee52c271ade16aba31ae1434ce | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_23b63ca87d5a3fb80bbcc7bf9536ab1325a9271f/TestUISpecs/5_23b63ca87d5a3fb80bbcc7bf9536ab1325a9271f_TestUISpecs_s.java | 48da95918c364077c7b4c5eca0537e9459a2734f | [] | 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 | 6,138 | java | package org.collectionspace.chain.csp.webui.main;
import static org.junit.Assert.*;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.io.IOUtils;
import org.collectionspace.bconfigutils.bootstrap.BootstrapConfigController;
import org.collectionspace.chain.controller.ChainServlet;
import org.collectionspace.chain.util.json.JSONUtils;
import org.json.JSONObject;
import org.junit.Test;
import org.mortbay.jetty.HttpHeaders;
import org.mortbay.jetty.testing.HttpTester;
import org.mortbay.jetty.testing.ServletTester;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestUISpecs {
private static final Logger log=LoggerFactory.getLogger(TestUISpecs.class);
// XXX refactor
protected InputStream getResource(String name) {
String path=getClass().getPackage().getName().replaceAll("\\.","/")+"/"+name;
return Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
}
// XXX refactor
private String getResourceString(String name) throws IOException {
InputStream in=getResource(name);
return IOUtils.toString(in);
}
// XXX refactor into other copy of this method
private ServletTester setupJetty() throws Exception {
BootstrapConfigController config_controller=new BootstrapConfigController(null);
config_controller.addSearchSuffix("test-config-loader2.xml");
config_controller.go();
String base=config_controller.getOption("services-url");
ServletTester tester=new ServletTester();
tester.setContextPath("/chain");
tester.addServlet(ChainServlet.class, "/*");
tester.addServlet("org.mortbay.jetty.servlet.DefaultServlet", "/");
tester.setAttribute("storage","service");
tester.setAttribute("store-url",base+"/cspace-services/");
log.info(base);
tester.setAttribute("config-filename","default.xml");
tester.start();
return tester;
}
private HttpTester jettyDo(ServletTester tester,String method,String path,String data) throws IOException, Exception {
HttpTester request = new HttpTester();
HttpTester response = new HttpTester();
request.setMethod(method);
request.setHeader("Host","tester");
request.setURI(path);
request.setVersion("HTTP/1.0");
if(data!=null)
request.setContent(data);
response.parse(tester.getResponses(request.generate()));
return response;
}
@Test public void testUISpec() throws Exception {
ServletTester jetty=setupJetty();
// Collection-Object
HttpTester response=jettyDo(jetty,"GET","/chain/objects/uispec",null);
assertEquals(200,response.getStatus());
JSONObject generated=new JSONObject(response.getContent());
JSONObject comparison=new JSONObject(getResourceString("collection-object.uispec"));
log.info(response.getContent());
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Intake
response=jettyDo(jetty,"GET","/chain/intake/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("intake.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Acquisition
response=jettyDo(jetty,"GET","/chain/acquisition/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("acquisition.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Person
response=jettyDo(jetty,"GET","/chain/person/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("person.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Organization
response=jettyDo(jetty,"GET","/chain/organization/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("organization-authority.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Object tab
response=jettyDo(jetty,"GET","/chain/object-tab/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("object-tab.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// UserDetails tab
response=jettyDo(jetty,"GET","/chain/users/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("users.uispec"));
//assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Loanin tab
response=jettyDo(jetty,"GET","/chain/loanin/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("loanin.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Loanout tab
response=jettyDo(jetty,"GET","/chain/loanout/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("loanout.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Roles tab
response=jettyDo(jetty,"GET","/chain/role/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("roles.uispec"));
//assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
// Find-Edit
response=jettyDo(jetty,"GET","/chain/find-edit/uispec",null);
assertEquals(200,response.getStatus());
generated=new JSONObject(response.getContent());
comparison=new JSONObject(getResourceString("find-edit.uispec"));
assertTrue(JSONUtils.checkJSONEquivOrEmptyStringKey(generated,comparison));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
379e5f16fec9dcf43cbd65a1abf8216208ec6257 | 5ef0b4d230dc5243225d149efb44cdcdd2ffea9d | /trunk/tm/src/tm/javaLang/ast/CatchRecoveryFactory.java | 38805136db433815a7b1448d0b5673977ad9795c | [
"Apache-2.0"
] | permissive | kai-zhu/the-teaching-machine-and-webwriter | 3d3b3dfdecd61e0fb2146b44c42d6467489fd94f | 67adf8f41bb475108c285eb0894906cb0878849c | refs/heads/master | 2021-01-16T20:47:55.620437 | 2016-05-23T12:38:03 | 2016-05-23T12:38:12 | 61,149,759 | 1 | 0 | null | 2016-06-14T19:22:57 | 2016-06-14T19:22:57 | null | UTF-8 | Java | false | false | 2,818 | java | // Copyright 1998--2010 Michael Bruce-Lockhart and Theodore S. Norvell
//
// 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 tm.javaLang.ast;
import tm.clc.ast.ClcRecoveryFactory;
import tm.clc.ast.TypeNode;
import tm.interfaces.Datum;
import tm.javaLang.datum.PointerDatum;
import tm.utilities.Assert;
import tm.virtualMachine.AbruptCompletionStatus;
import tm.virtualMachine.Recovery;
import tm.virtualMachine.VMState;
/**
* <p>Title: The Teaching Machine</p>
* <p>Description: </p>
* <p>Company: Memorial University</p>
* @author Theodore Norvell
* @version 1.0
*/
public class CatchRecoveryFactory extends ClcRecoveryFactory {
private TypeNode parameterType ;
public CatchRecoveryFactory( TypeNode parameterType ) {
this.parameterType = parameterType ;
}
public Recovery makeRecovery( VMState vms ) {
return new CatchRecovery( vms ) ; }
public String getDescription() {
return "CatchRecoveryFactory "+parameterType.getTypeString() ; }
private class CatchRecovery extends ClcRecovery {
public CatchRecovery( VMState vms ) {
super( vms ) ;}
public boolean canHandle(AbruptCompletionStatus acs) {
if( acs instanceof ThrowCompletionStatus ) {
Datum thrownDatum = ((ThrowCompletionStatus)acs).thrownDatum ;
Assert.check( thrownDatum instanceof PointerDatum ) ;
PointerDatum ptr = (PointerDatum) thrownDatum ;
Datum thrownObject = ptr.deref() ;
return JavaLangASTUtilities.assignableReferenceType(
(TyJava) thrownDatum.getType(),
(TyJava) parameterType ) ; }
else {
return false; }
}
public void handle(AbruptCompletionStatus acs) {
super.handle( acs );
/*Although there is no explicet pop of this argument list,
when a catch-clause ends it will jump out to the finally
part of the try which should pop the argument list. */
vms.pushNewArgumentList();
vms.addArgument( ((ThrowCompletionStatus)acs).thrownDatum );
}
}
} | [
"theodore.norvell@gmail.com"
] | theodore.norvell@gmail.com |
bad4a3fe3d5a57d115080b2b519397e956014034 | a43d4202628ecb52e806d09f0f3dc1f5bab3ef4f | /src/main/java/pnc/mesadmin/dto/GetNRMInfo/GetNRMInfoResDStoreInfo.java | d907ac3d2033046ad083d4f7356bf0a935033333 | [] | no_license | pnc-mes/base | b88583929e53670340a704f848e4e9e2027f1334 | 162135b8752b4edc397b218ffd26664929f6920d | refs/heads/main | 2023-01-07T22:06:10.794300 | 2020-10-27T07:47:20 | 2020-10-27T07:47:20 | 307,621,190 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 755 | java | package pnc.mesadmin.dto.GetNRMInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
/**
* Created by zhaochao on 2017/10/25.
*/
public class GetNRMInfoResDStoreInfo implements Serializable{
@JsonProperty("StoreRd")
private int StoreRd;
@JsonProperty("StoreName")
private String StoreName;
@JsonIgnore
public int getStoreRd() {
return StoreRd;
}
@JsonIgnore
public void setStoreRd(int storeRd) {
StoreRd = storeRd;
}
@JsonIgnore
public String getStoreName() {
return StoreName;
}
@JsonIgnore
public void setStoreName(String storeName) {
StoreName = storeName;
}
}
| [
"95887577@qq.com"
] | 95887577@qq.com |
38ba034d9d9d1aca2dd4e126488de9f142b3776e | 12abfb825da5799e2124127ae63b18d49f4731ea | /app/src/main/java/com/lcworld/shopdemo/tsq/ui/main/adapter/TabVideoAdapter.java | ad1babcd1066a357913d508b7b0b0d11158105fc | [] | no_license | WooYu/HuRongShang | 040d9292aa3757201cceaf867d36b9f208a6e35e | 8ccebbeed0576ce3733d1f7cfabbf2174b173c6f | refs/heads/master | 2020-03-10T13:25:11.105775 | 2018-04-14T12:19:53 | 2018-04-14T12:19:53 | 129,399,806 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 966 | java | package com.lcworld.shopdemo.tsq.ui.main.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.ArrayList;
public class TabVideoAdapter extends FragmentPagerAdapter {
private ArrayList<String> tabArr;
private ArrayList<Fragment> fragmentList;
public TabVideoAdapter(FragmentManager fm, ArrayList<Fragment> fragmentList, ArrayList<String> tabArr) {
super(fm);
this.tabArr = tabArr;
this.fragmentList = fragmentList;
}
public void setTabArr(ArrayList<String> tabArr) {
this.tabArr = tabArr;
}
@Override
public Fragment getItem(int position) {
return fragmentList.get(position);
}
@Override
public int getCount() {
return tabArr.size();
}
@Override
public CharSequence getPageTitle(int position) {
return tabArr.get(position);
}
}
| [
"wuyu@lcworld-inc.com"
] | wuyu@lcworld-inc.com |
ba841bfe574e294e71363afd3ebd9be3e8ca83d3 | 8804cd548b00c5289fdfd5ad973a733b24d29b25 | /scamper-chat-client-base/src/main/java/com/mastfrog/scamper/chat/base/NicknameChangedHandler.java | 02d83d71242e3a176360447414d3d456556003b1 | [] | no_license | timboudreau/scamper-chat | 26532e71d8d71e07c7db13ab79beeb3b7bcc8faa | 8b95f4bc7e4b8f15de2981b7d0906b8e2922e63c | refs/heads/master | 2022-06-03T14:48:55.561751 | 2022-05-16T23:12:07 | 2022-05-16T23:12:07 | 29,330,622 | 15 | 4 | null | null | null | null | UTF-8 | Java | false | false | 828 | java | package com.mastfrog.scamper.chat.base;
import com.google.inject.Inject;
import com.mastfrog.scamper.Message;
import com.mastfrog.scamper.MessageHandler;
import com.mastfrog.scamper.chat.api.NameChangeNotification;
import com.mastfrog.scamper.chat.spi.Client;
import io.netty.channel.ChannelHandlerContext;
/**
*
* @author Tim Boudreau
*/
final class NicknameChangedHandler extends MessageHandler<Void, NameChangeNotification> {
private final Client client;
@Inject
NicknameChangedHandler(Client client) {
super(NameChangeNotification.class);
this.client = client;
}
@Override
public Message<Void> onMessage(Message<NameChangeNotification> data, ChannelHandlerContext ctx) {
client.onUserNicknameChanged(data.body.oldName, data.body.newName);
return null;
}
}
| [
"tim@timboudreau.com"
] | tim@timboudreau.com |
a4b0eb5a81afc1c6ab7520ee192920e1a6bbf99e | e6d716fde932045d076ab18553203e2210c7bc44 | /bluesky-pentaho-kettle/engine/src/main/java/org/pentaho/di/core/AddUndoPositionInterface.java | 86dd1bab3b8f608a4a9628b2060dc60b7146a741 | [] | no_license | BlueCodeBoy/bluesky | d04032e6c0ce87a18bcbc037191ca20d03aa133e | 6fc672455b6047979527da9ba8e3fc220d5cee37 | refs/heads/master | 2020-04-18T10:47:20.434313 | 2019-01-25T03:30:47 | 2019-01-25T03:30:47 | 167,478,568 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,180 | java | /*! ******************************************************************************
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com
*
*******************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
package org.pentaho.di.core;
import org.pentaho.di.core.gui.Point;
import org.pentaho.di.core.gui.UndoInterface;
public interface AddUndoPositionInterface {
public void addUndoPosition(UndoInterface undoInterface, Object[] obj, int[] pos, Point[] prev, Point[] curr);
}
| [
"pp@gmail.com"
] | pp@gmail.com |
48fa7bba8c5fe7214b5f46387ed6a9b6c8717cc0 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-new-fitness/results/XWIKI-13546-6-30-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage-opt/org/xwiki/mail/internal/configuration/SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.java | 8f43a5ec2aa27feb67f4970d18e0a0a20ffefcc5 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,183 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Oct 28 13:36:49 UTC 2021
*/
package org.xwiki.mail.internal.configuration;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.xwiki.mail.internal.configuration.SendMailConfigClassDocumentConfigurationSource";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
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.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader() ,
"com.xpn.xwiki.XWikiException",
"org.xwiki.component.phase.Initializable",
"org.xwiki.model.internal.reference.AbstractStringEntityReferenceSerializer",
"org.xwiki.model.reference.EntityReference",
"org.xwiki.model.reference.SpaceReference",
"org.xwiki.component.phase.Disposable",
"org.xwiki.component.phase.InitializationException",
"org.xwiki.component.manager.ComponentLifecycleException",
"org.apache.commons.lang3.StringUtils",
"com.xpn.xwiki.objects.ObjectInterface",
"com.xpn.xwiki.objects.BaseCollection",
"org.xwiki.component.annotation.Role",
"org.xwiki.configuration.internal.AbstractDocumentConfigurationSource$1",
"org.xwiki.cache.CacheFactory",
"org.xwiki.model.EntityType",
"org.xwiki.model.reference.EntityReferenceSerializer",
"org.xwiki.model.internal.reference.LocalizedStringEntityReferenceSerializer",
"org.xwiki.cache.config.CacheConfiguration",
"org.xwiki.model.internal.reference.StringReferenceSeparators",
"org.xwiki.wiki.manager.WikiManagerException",
"org.xwiki.model.internal.reference.DefaultStringEntityReferenceSerializer",
"org.xwiki.component.util.DefaultParameterizedType",
"org.xwiki.observation.EventListener",
"com.xpn.xwiki.objects.ElementInterface",
"org.xwiki.wiki.descriptor.WikiDescriptorManager",
"org.xwiki.observation.ObservationManager",
"org.xwiki.component.annotation.Component",
"org.xwiki.properties.ConverterManager",
"org.xwiki.text.StringUtils",
"org.xwiki.component.manager.ComponentLookupException",
"org.xwiki.mail.internal.configuration.SendMailConfigClassDocumentConfigurationSource",
"org.xwiki.model.reference.LocalDocumentReference",
"org.xwiki.configuration.internal.AbstractConfigurationSource",
"org.xwiki.cache.CacheManager",
"org.xwiki.model.reference.RegexEntityReference",
"com.xpn.xwiki.objects.BaseObject",
"org.xwiki.model.internal.reference.StringReferenceSeparators$3",
"org.xwiki.model.internal.reference.StringReferenceSeparators$4",
"org.xwiki.model.internal.reference.StringReferenceSeparators$1",
"org.xwiki.model.internal.reference.StringReferenceSeparators$2",
"org.xwiki.model.reference.PartialEntityReference",
"com.xpn.xwiki.objects.BaseElement",
"org.xwiki.wiki.descriptor.WikiDescriptor",
"org.xwiki.configuration.internal.AbstractDocumentConfigurationSource",
"org.xwiki.model.reference.DocumentReference",
"org.xwiki.observation.event.Event",
"com.xpn.xwiki.XWikiContext",
"org.xwiki.configuration.ConfigurationSource",
"org.xwiki.model.reference.WikiReference",
"org.xwiki.cache.CacheException",
"org.xwiki.cache.Cache"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("javax.inject.Provider", false, SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader()));
mock(Class.forName("org.slf4j.Logger", false, SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader()));
mock(Class.forName("org.xwiki.cache.CacheManager", false, SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader()));
mock(Class.forName("org.xwiki.model.reference.EntityReferenceSerializer", false, SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader()));
mock(Class.forName("org.xwiki.observation.ObservationManager", false, SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader()));
mock(Class.forName("org.xwiki.properties.ConverterManager", false, SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader()));
mock(Class.forName("org.xwiki.wiki.descriptor.WikiDescriptorManager", false, SendMailConfigClassDocumentConfigurationSource_ESTest_scaffolding.class.getClassLoader()));
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
27c691c2eacda13ff5344048d3498c9402d3db1f | 421f0a75a6b62c5af62f89595be61f406328113b | /generated_tests/no_seeding/102_squirrel-sql-net.sourceforge.squirrel_sql.fw.util.beanwrapper.DimensionWrapper-1.0-2/net/sourceforge/squirrel_sql/fw/util/beanwrapper/DimensionWrapper_ESTest.java | a18a971cf370df6d04734fcb50c3ac0d3bf7e431 | [] | no_license | tigerqiu712/evosuite-model-seeding-empirical-evaluation | c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6 | 11a920b8213d9855082d3946233731c843baf7bc | refs/heads/master | 2020-12-23T21:04:12.152289 | 2019-10-30T08:02:29 | 2019-10-30T08:02:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 686 | java | /*
* This file was automatically generated by EvoSuite
* Mon Oct 28 15:17:27 GMT 2019
*/
package net.sourceforge.squirrel_sql.fw.util.beanwrapper;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true)
public class DimensionWrapper_ESTest extends DimensionWrapper_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pderakhshanfar@bsr01.win.tue.nl"
] | pderakhshanfar@bsr01.win.tue.nl |
a249c73180398f888116fd8963d689b22e8e1dd1 | 08b1f1b915d31ecb2e65420969ab366d997915e1 | /simp_ser/src/main/java/com/mpri/aio/system/utils/BadWordUtil.java | 54c71167fa5eb326948c6d927ca623a24753ae57 | [] | no_license | ruokeweb/simp_tmp | 7705b6acc93b866900565f7de4cc1af015bd02f5 | d232cf63a57793a94bbdc49ebfa6391e3ac29ba2 | refs/heads/master | 2021-01-02T13:43:20.007616 | 2020-02-11T01:36:40 | 2020-02-11T01:36:40 | 239,646,322 | 0 | 0 | null | 2020-02-11T00:57:52 | 2020-02-11T00:57:52 | null | UTF-8 | Java | false | false | 9,210 | java | package com.mpri.aio.system.utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.io.IOUtils;
import org.springframework.core.io.ClassPathResource;
/**
* 敏感字符过滤
* @author Cary
* @date 2019年5月29日
*/
public class BadWordUtil {
private static List<String> words;
private static Map<String,String> wordMap;
private final static int minMatchTYpe = 1; //最小匹配规则
private final static int maxMatchType = 2; //最大匹配规则
static{
ClassPathResource resource = new ClassPathResource("dictionary.txt");
try {
InputStream inputStream = resource.getInputStream();
BadWordUtil.words = IOUtils.readLines(inputStream,"UTF-8");
addBadWordToHashMap(BadWordUtil.words);
} catch (IOException e) {
//e.printStackTrace();
}
}
public static List<String> readTxtByLine(File file){
List<String> keyWordSet = new ArrayList<String>();
if(!file.exists()){ //文件流是否存在
return keyWordSet;
}
BufferedReader reader=null;
String temp=null;
FileInputStream fileInputStream = null;
//int line=1;
try{
//reader=new BufferedReader(new FileReader(file));这样在web运行的时候,读取会乱码
fileInputStream = new FileInputStream(file);
reader=new BufferedReader(new InputStreamReader(fileInputStream,"UTF-8"));
fileInputStream.close();
while((temp=reader.readLine())!=null){
//System.out.println("line"+line+":"+temp);
keyWordSet.add(temp);
//line++;
}
} catch(Exception e){
// e.printStackTrace();
} finally{
try{
if(reader!=null){
reader.close();
}
}catch(Exception e){
// e.printStackTrace();
}
}
return keyWordSet;
}
/**
* 检查文字中是否包含敏感字符,检查规则如下:<br>
* @param txt
* @param beginIndex
* @param matchType
* @return,如果存在,则返回敏感词字符的长度,不存在返回0
* @version 1.0
*/
@SuppressWarnings({ "rawtypes"})
public static int checkBadWord(String txt,int beginIndex,int matchType){
boolean flag = false; //敏感词结束标识位:用于敏感词只有1位的情况
int matchFlag = 0; //匹配标识数默认为0
char word = 0;
Map nowMap = wordMap;
for(int i = beginIndex; i < txt.length() ; i++){
word = txt.charAt(i);
nowMap = (Map) nowMap.get(word); //获取指定key
if(nowMap != null){ //存在,则判断是否为最后一个
matchFlag++; //找到相应key,匹配标识+1
if("1".equals(nowMap.get("isEnd"))){ //如果为最后一个匹配规则,结束循环,返回匹配标识数
flag = true; //结束标志位为true
if(minMatchTYpe == matchType){ //最小规则,直接返回,最大规则还需继续查找
break;
}
}
}
else{ //不存在,直接返回
break;
}
}
/*“粉饰”匹配词库:“粉饰太平”竟然说是敏感词
* “个人”匹配词库:“个人崇拜”竟然说是敏感词
* if(matchFlag < 2 && !flag){
matchFlag = 0;
}*/
if(!flag){
matchFlag = 0;
}
return matchFlag;
}
/**
* 判断文字是否包含敏感字符
* @param txt 文字
* @param matchType 匹配规则 1:最小匹配规则,2:最大匹配规则
* @return 若包含返回true,否则返回false
* @version 1.0
*/
public static boolean isContaintBadWord(String txt,int matchType){
boolean flag = false;
for(int i = 0 ; i < txt.length() ; i++){
int matchFlag = checkBadWord(txt, i, matchType); //判断是否包含敏感字符
if(matchFlag > 0){ //大于0存在,返回true
flag = true;
}
}
return flag;
}
/**
* 替换敏感字字符
* @param txt
* @param matchType
* @param replaceChar 替换字符,默认*
* @version 1.0
*/
public static String replaceBadWord(String txt,int matchType,String replaceChar){
String resultTxt = txt;
Set<String> set = getBadWord(txt, matchType); //获取所有的敏感词
Iterator<String> iterator = set.iterator();
String word = null;
String replaceString = null;
while (iterator.hasNext()) {
word = iterator.next();
replaceString = getReplaceChars(replaceChar, word.length());
resultTxt = resultTxt.replaceAll(word, replaceString);
}
return resultTxt;
}
/**
* 获取文字中的敏感词
* @param txt 文字
* @param matchType 匹配规则 1:最小匹配规则,2:最大匹配规则
* @return
* @version 1.0
*/
public static Set<String> getBadWord(String txt , int matchType){
Set<String> sensitiveWordList = new HashSet<String>();
for(int i = 0 ; i < txt.length() ; i++){
int length = checkBadWord(txt, i, matchType); //判断是否包含敏感字符
if(length > 0){ //存在,加入list中
sensitiveWordList.add(txt.substring(i, i+length));
i = i + length - 1; //减1的原因,是因为for会自增
}
}
return sensitiveWordList;
}
/**
* 获取替换字符串
* @param replaceChar
* @param length
* @return
* @version 1.0
*/
private static String getReplaceChars(String replaceChar,int length){
String resultReplace = replaceChar;
for(int i = 1 ; i < length ; i++){
resultReplace += replaceChar;
}
return resultReplace;
}
/**
* TODO 将我们的敏感词库构建成了一个类似与一颗一颗的树,这样我们判断一个词是否为敏感词时就大大减少了检索的匹配范围。
* @param keyWordSet 敏感词库
* @author yqwang0907
* @date 2018年2月28日下午5:28:08
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
private static void addBadWordToHashMap(List<String> keyWordSet) {
wordMap = new HashMap(keyWordSet.size()); //初始化敏感词容器,减少扩容操作
String key = null;
Map nowMap = null;
Map<String, String> newWorMap = null;
//迭代keyWordSet
Iterator<String> iterator = keyWordSet.iterator();
while(iterator.hasNext()){
key = iterator.next(); //关键字
nowMap = wordMap;
for(int i = 0 ; i < key.length() ; i++){
char keyChar = key.charAt(i); //转换成char型
Object wordMap = nowMap.get(keyChar); //获取
if(wordMap != null){ //如果存在该key,直接赋值
nowMap = (Map) wordMap;
}
else{ //不存在则,则构建一个map,同时将isEnd设置为0,因为他不是最后一个
newWorMap = new HashMap<String,String>();
newWorMap.put("isEnd", "0"); //不是最后一个
nowMap.put(keyChar, newWorMap);
nowMap = newWorMap;
}
if(i == key.length() - 1){
nowMap.put("isEnd", "1"); //最后一个
}
}
}
}
public static void main(String[] args) {
//Set<String> s = BadWordUtil.words;
//Map<String,String> map = BadWordUtil.wordMap;
System.out.println("敏感词的数量:" + BadWordUtil.wordMap.size());
String string = "太多的伤感情怀也许只局限于饲养基地 荧幕中的情节,主人公尝试着去用某种方式渐渐的很潇洒地释自杀指南怀那些自己经历的伤感。"
+ "然后法轮功 我们的扮演的角色就是跟随着主人公的喜红客联盟 怒哀乐而过于牵强的把自己的情感也附加于银幕情节中,然后感动就流泪,"
+ "难过就躺在某一个人的怀里尽情的阐述心扉或者手机卡复制器一个人一杯红酒一部电影在夜三级片 深人静的晚上,关上电话静静的发呆着。";
System.out.println("待检测语句字数:" + string.length());
long beginTime = System.currentTimeMillis();
Set<String> set = BadWordUtil.getBadWord(string, 2);
BadWordUtil.isContaintBadWord(string, 2);
String ss=BadWordUtil.replaceBadWord(string, 2,"*");
long endTime = System.currentTimeMillis();
System.out.println("语句中包含敏感词的个数为:" + set.size() + "。包含:" + set);
System.out.println("总共消耗时间为:" + (endTime - beginTime));
System.out.println("语句被替换为:" + ss);
}
}
| [
"carypiggy@gmail.com"
] | carypiggy@gmail.com |
89ebce6122f4010378723b25b2c5446d90b966a9 | 18da61c9913642d3f4a8d982e2963df9b5a40df3 | /spring-boot-demo/src/main/java/io/sample/springboot_demo/controller/HelloController.java | 288e873e18766f22bd6d31b7a7198d7bb0cb263c | [] | no_license | kickccat/SpringBoot2 | 85a0957743841951c78d80b95cf6777233252487 | 2f5ac4275ceca62459bfef5fe5dd54023f2f2cd0 | refs/heads/master | 2020-03-24T07:41:08.708894 | 2018-09-21T13:02:58 | 2018-09-21T13:02:58 | 142,571,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,873 | java | package io.sample.springboot_demo.controller;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/api/v0")
public class HelloController {
//
// private final Book book;
//
// @Autowired
// public HelloController(Book book) {
// this.book = book;
// }
@GetMapping("/sayHello")
public String hello() {
return "Hello Spring Boot";
}
@GetMapping("/books")
public Object getAll(@RequestParam("page") int page, @RequestParam(value = "size", defaultValue = "10") int size) {
Map<String, Object> book = new HashMap<>();
book.put("Name", "World");
book.put("Author", "John");
book.put("ISBN", "aabbcc");
Map<String, Object> book2 = new HashMap<>();
book2.put("Name", "Earth");
book2.put("Author", "Alice");
book2.put("ISBN", "ddffgg");
List<Map> contents = new ArrayList<>();
contents.add(book);
contents.add(book2);
Map<String, Object> pageMap = new HashMap<>();
pageMap.put("page", page);
pageMap.put("size", size);
pageMap.put("content", contents);
return pageMap;
}
/**
* @return book
* @Param id
*/
@GetMapping("/books/{id}")
public Object getById(@PathVariable("id") long id) {
return null;
}
@PostMapping("/books")
public Object addBook(@RequestParam("name") String name, @RequestParam("author") String author,
@RequestParam("isbn") String isbn) {
Map<String, Object> book = new HashMap<>();
book.put("Name", name);
book.put("Author", author);
book.put("ISBN", isbn);
return book;
}
} | [
"kickccat@hotmail.com"
] | kickccat@hotmail.com |
25f18fc7e52a71cec8c549e49d52842105575cc6 | b64135180c89c4fea5021d8062a2b8f0952a6983 | /treat-business/src/main/user/com/navigate/treat/service/ReportServiceFront.java | 62455e2db22655a1f1bc6571c6adcecf0048a662 | [] | no_license | hackpros/treat | 69cfa9f57601c96c26903c457c4a3aaaa4083eb6 | b63467c22058db83838716cc294d7cc8d0455efd | refs/heads/master | 2021-01-15T08:40:40.772554 | 2016-09-22T05:18:48 | 2016-09-22T05:18:48 | 60,266,949 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | package com.navigate.treat.service;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.ui.ModelMap;
import com.navigate.treat.api.IReportServiceFront;
import com.navigate.treat.beans.basic.Report;
import com.navigate.treat.io.report.request.ReportReq;
import com.navigate.treat.service.basic.impl.ReportService;
import com.navigate.treat.util.SpringBeanUtils;
@Service
public class ReportServiceFront implements IReportServiceFront {
@Resource
ReportService reportService;
@Override
public Object saveReport(ReportReq reportReq) {
Report report = new Report();
SpringBeanUtils.copyProperties(reportReq, report);
return new ModelMap().addAttribute("status", reportService.insertSelective(report) > 0);
}
}
| [
"fans_2046@126.com"
] | fans_2046@126.com |
c917db1dca2952e66043adab0b1730b8af27fb05 | 5b2c309c903625b14991568c442eb3a889762c71 | /classes/android/support/v4/view/cs.java | 378073dffded5967080f5beafd54ff99dc72a055 | [] | no_license | iidioter/xueqiu | c71eb4bcc53480770b9abe20c180da693b2d7946 | a7d8d7dfbaf9e603f72890cf861ed494099f5a80 | refs/heads/master | 2020-12-14T23:55:07.246659 | 2016-10-08T08:56:27 | 2016-10-08T08:56:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,694 | java | package android.support.v4.view;
import android.os.Build.VERSION;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.support.v4.d.d;
import android.support.v4.d.e;
import android.support.v4.d.f;
import android.view.View.BaseSavedState;
public final class cs
extends View.BaseSavedState
{
public static final Parcelable.Creator<cs> CREATOR;
int a;
Parcelable b;
ClassLoader c;
static
{
Object localObject = new e() {};
if (Build.VERSION.SDK_INT >= 13) {}
for (localObject = new f((e)localObject);; localObject = new d((e)localObject))
{
CREATOR = (Parcelable.Creator)localObject;
return;
}
}
cs(Parcel paramParcel, ClassLoader paramClassLoader)
{
super(paramParcel);
ClassLoader localClassLoader = paramClassLoader;
if (paramClassLoader == null) {
localClassLoader = getClass().getClassLoader();
}
this.a = paramParcel.readInt();
this.b = paramParcel.readParcelable(localClassLoader);
this.c = localClassLoader;
}
public cs(Parcelable paramParcelable)
{
super(paramParcelable);
}
public final String toString()
{
return "FragmentPager.SavedState{" + Integer.toHexString(System.identityHashCode(this)) + " position=" + this.a + "}";
}
public final void writeToParcel(Parcel paramParcel, int paramInt)
{
super.writeToParcel(paramParcel, paramInt);
paramParcel.writeInt(this.a);
paramParcel.writeParcelable(this.b, paramInt);
}
}
/* Location: E:\apk\xueqiu2\classes-dex2jar.jar!\android\support\v4\view\cs.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"1776098770@qq.com"
] | 1776098770@qq.com |
1393201a792e4a9b9ebc02a0472bf905afeceb0d | 2f9a3fc0e60371a2af624b3b91f8caeaac9f83f4 | /exercises/week5/exercise1/tailoredrecommendations/src/test/java/academy/everyonecodes/endpoints/TailoredRecommendationsEndpointTest.java | db41787602133f9f6384731f2d62d7233c14c676 | [] | no_license | Alex3m/springboot-module | 49c1f08b6179286b4e752a818d2bbd5762044dd4 | 7d29b8065e0297eecc785033d40134fb37a62367 | refs/heads/master | 2022-06-23T03:49:59.106614 | 2020-05-07T18:31:52 | 2020-05-07T18:31:52 | 246,024,872 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,533 | java | package academy.everyonecodes.endpoints;
import academy.everyonecodes.data.Movie;
import academy.everyonecodes.data.TailoredRecommendation;
import academy.everyonecodes.services.TailoredRecommendationsStore;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.web.client.TestRestTemplate;
import java.util.List;
import static org.mockito.Mockito.*;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
@SpringBootTest(webEnvironment = RANDOM_PORT)
class TailoredRecommendationsEndpointTest {
@Autowired
TestRestTemplate restTemplate;
@MockBean
TailoredRecommendationsStore store;
String url = "/tailoredrecommendations";
String userUuid = "user";
TailoredRecommendation recommendation = new TailoredRecommendation(userUuid, new Movie("title", "synopsis"));
@Test
void get() {
String userUuid = "user";
restTemplate.getForObject(url + "/" + userUuid, List.class);
verify(store).getRecommendationsForUser(userUuid);
}
@Test
void post() {
restTemplate.postForObject(url, recommendation, TailoredRecommendation.class);
verify(store).postRecommendation(recommendation);
}
} | [
"apetrov8911@gmail.com"
] | apetrov8911@gmail.com |
63d46edf1e1418ee3bfb664516ebe4ad5273152e | 7e1511cdceeec0c0aad2b9b916431fc39bc71d9b | /flakiness-predicter/input_data/original_tests/ninjaframework-ninja/nonFlakyMethods/ninja.servlet.ContextImplTest-testGetInputStreamEnforcingOfCorrectEncoding.java | c85ad14e4efa9f0f78d6d6e73b23d5854fa54dd7 | [
"BSD-3-Clause"
] | permissive | Taher-Ghaleb/FlakeFlagger | 6fd7c95d2710632fd093346ce787fd70923a1435 | 45f3d4bc5b790a80daeb4d28ec84f5e46433e060 | refs/heads/main | 2023-07-14T16:57:24.507743 | 2021-08-26T14:50:16 | 2021-08-26T14:50:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | /**
* Make sure the correct character encoding is set before the inputStream is returned. Otherwise we might get strange default encodings from the servlet engine.
*/
@Test public void testGetInputStreamEnforcingOfCorrectEncoding() throws Exception {
context.init(httpServletRequest,httpServletResponse);
context.getInputStream();
verify(httpServletRequest).setCharacterEncoding(anyString());
}
| [
"aalsha2@masonlive.gmu.edu"
] | aalsha2@masonlive.gmu.edu |
76e4256b26504c1e48b3a69b4152d0b4117101fb | 47782b1ad69a9c23207d801001ffe3b3340057e9 | /yelp/yelp-domain/src/main/java/com/yelp/debug/MockAdmin.java | c61e93e031b1c3a89d19d6ef6f3410b610f04886 | [] | no_license | supernebula/yelp-j | 8e2b5f86770e15e8d13c896d15d623b7dcfe9bd2 | d59308c1af02c673cf258acbd24ad48de10cc3db | refs/heads/master | 2020-04-17T03:23:36.340788 | 2019-04-07T06:02:34 | 2019-04-07T06:02:34 | 166,180,934 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | package com.yelp.debug;
public class MockAdmin {
public static final String USERNAME = "admin1";
public static final String PASSWORD = "123456";
public static final String ROLE = "admin";
}
| [
"supernebula@126.com"
] | supernebula@126.com |
f0639e2d2ca171a4c598fdf7008ca3a024d21fed | ea70cddc0962a1e347042d3709251c09a3788029 | /log4j2-elasticsearch2-bulkprocessor/src/main/java/org/appenders/log4j2/elasticsearch/bulkprocessor/BulkProcessorDelegate.java | 34193c7673e5e0daaad6cfe64bde8a6ca35951ec | [
"MIT"
] | permissive | TheDevOps/log4j2-elasticsearch | e64abfd980151871259f247ef5057c9364449776 | a63c38c1cb49ac3fc946d303555a8b530dd31ea1 | refs/heads/master | 2020-04-05T12:48:33.060274 | 2018-11-09T15:47:10 | 2018-11-09T15:47:10 | 156,881,349 | 0 | 0 | MIT | 2018-11-09T15:31:20 | 2018-11-09T15:31:20 | null | UTF-8 | Java | false | false | 1,779 | java | package org.appenders.log4j2.elasticsearch.bulkprocessor;
/*-
* #%L
* log4j-elasticsearch
* %%
* Copyright (C) 2017 Rafal Foltynski
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* #L%
*/
import org.appenders.log4j2.elasticsearch.BatchEmitter;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.bulk.BulkProcessor;
import org.elasticsearch.action.index.IndexRequest;
public class BulkProcessorDelegate implements BatchEmitter {
private final BulkProcessor bulkProcessor;
public BulkProcessorDelegate(BulkProcessor bulkProcessor) {
this.bulkProcessor = bulkProcessor;
}
@Override
public void add(Object batchItem) {
bulkProcessor.add((IndexRequest) batchItem);
}
}
| [
"r.foltynski@gmail.com"
] | r.foltynski@gmail.com |
66ba51992c77f5a7c2a24ae6644025c973fac4dd | 746572ba552f7d52e8b5a0e752a1d6eb899842b9 | /JDK8Source/src/main/java/org/omg/CORBA/TRANSACTION_MODE.java | 5500df9f5642696d166c330bb05552fc921d3c3d | [] | no_license | lobinary/Lobinary | fde035d3ce6780a20a5a808b5d4357604ed70054 | 8de466228bf893b72c7771e153607674b6024709 | refs/heads/master | 2022-02-27T05:02:04.208763 | 2022-01-20T07:01:28 | 2022-01-20T07:01:28 | 26,812,634 | 7 | 5 | null | null | null | null | UTF-8 | Java | false | false | 3,232 | java | /***** Lobxxx Translate Finished ******/
/*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.omg.CORBA;
/**
* The CORBA <code>TRANSACTION_MODE</code> exception is thrown
* by the client ORB if it detects a mismatch between the
* InvocationPolicy in the IOR and the chosen invocation path
* (i.e, direct or routed invocation).
* It contains a minor code, which gives information about
* what caused the exception, and a completion status. It may also contain
* a string describing the exception.
* The OMG CORBA core 2.4 specification has details.
*
* <p>
* 如果客户机ORB检测到IOR中的InvocationPolicy与所选择的调用路径(即直接调用或路由调用)之间不匹配,则抛出CORBA <code> TRANSACTION_MODE </code>异
* 常。
* 它包含一个次要代码,它提供了导致异常的原因以及完成状态的信息。它还可以包含描述异常的字符串。 OMG CORBA核心2.4规范有细节。
*
*
* @see <A href="../../../../technotes/guides/idl/jidlExceptions.html">documentation on
* Java IDL exceptions</A>
*/
public final class TRANSACTION_MODE extends SystemException {
/**
* Constructs a <code>TRANSACTION_MODE</code> exception with a default
* minor code of 0, a completion state of CompletionStatus.COMPLETED_NO,
* and a null description.
* <p>
* 构造具有默认次要代码0,完成状态CompletionStatus.COMPLETED_NO和空描述的<code> TRANSACTION_MODE </code>异常。
*
*/
public TRANSACTION_MODE() {
this("");
}
/**
* Constructs a <code>TRANSACTION_MODE</code> exception with the specified
* description message, a minor code of 0, and a completion state of
* COMPLETED_NO.
* <p>
* 使用指定的描述消息构造一个<code> TRANSACTION_MODE </code>异常,次要代码为0,完成状态为COMPLETED_NO。
*
*
* @param s the String containing a detail message
*/
public TRANSACTION_MODE(String s) {
this(s, 0, CompletionStatus.COMPLETED_NO);
}
/**
* Constructs a <code>TRANSACTION_MODE</code> exception with the specified
* minor code and completion status.
* <p>
* 构造具有指定的次要代码和完成状态的<code> TRANSACTION_MODE </code>异常。
*
*
* @param minor the minor code
* @param completed the completion status
*/
public TRANSACTION_MODE(int minor, CompletionStatus completed) {
this("", minor, completed);
}
/**
* Constructs a <code>TRANSACTION_MODE</code> exception with the specified
* description message, minor code, and completion status.
* <p>
* 使用指定的描述消息,次要代码和完成状态构造<code> TRANSACTION_MODE </code>异常。
*
* @param s the String containing a description message
* @param minor the minor code
* @param completed the completion status
*/
public TRANSACTION_MODE(String s, int minor, CompletionStatus completed) {
super(s, minor, completed);
}
}
| [
"919515134@qq.com"
] | 919515134@qq.com |
665bac737c0ec93354f3907aa49d8f16ffd532f4 | 95b93c921adf5c09793c41a7f0104374201212ab | /ws-Client/src/main/java/demo/spring/service_large/SayHi31.java | e773b59714080eacfd44f7616e64a7801f7ca459 | [] | no_license | yhjhoo/WS-CXF-AuthTest | d6ad62bdf95af7f4832f16ffa242785fc0a93eb8 | ded10abaefdc2e8b3b32becdc6f5781471acf27f | refs/heads/master | 2020-06-15T02:21:42.204025 | 2015-04-08T00:05:02 | 2015-04-08T00:05:02 | 33,409,007 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,299 | java |
package demo.spring.service_large;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for sayHi31 complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="sayHi31">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="arg0" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sayHi31", propOrder = {
"arg0"
})
public class SayHi31 {
protected String arg0;
/**
* Gets the value of the arg0 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getArg0() {
return arg0;
}
/**
* Sets the value of the arg0 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setArg0(String value) {
this.arg0 = value;
}
}
| [
"yhjhoo@163.com"
] | yhjhoo@163.com |
4c63f0d031960795cc1b9e6a009aa646fc64fbe5 | 4fa85f247feb4452ef4ec0677c80861af1ead38a | /app/src/test/java/com/example/xwf/hsia06fragmentdemo/ExampleUnitTest.java | 42c9d462b28b386e2d6512b907ffd0c5730d1689 | [] | no_license | swordman20/Hsia06FragmentDemo | af75067fbb175cfea7e0331d1eae3daf2d6bdcba | 006a6b5d0b914ad058fdeb585c52eae950156787 | refs/heads/master | 2021-01-10T18:51:53.659665 | 2016-05-10T10:00:29 | 2016-05-10T10:00:29 | 58,449,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 327 | java | package com.example.xwf.hsia06fragmentdemo;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"xwf@XWFdeMacBook-Pro.local"
] | xwf@XWFdeMacBook-Pro.local |
9332cc8277e50cf76a6c74c1e1e6f194aedc03e8 | 6a32bf1cf2ad1deaf6a47ab4fc113aad352cdf2b | /src/minecraft/com/github/holdhands/WizardsWand/ttf/TTFManager.java | 68af840cb49771c74d547deb43ebf5b6dc7b250d | [] | 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 | 2,184 | java | package com.github.holdhands.WizardsWand.ttf;
import java.awt.Font;
public class TTFManager {
private static TTFManager theTTFManager = new TTFManager();
public static TTFManager getInstance(){
return theTTFManager;
}
private TTFRenderer panelTitleFont = null;
private TTFRenderer buttonExtraFont = null;
private TTFRenderer standardFont = null;
private TTFRenderer modListFont = null;
private TTFRenderer chatFont = null;
private TTFRenderer waypointFont = null;
private TTFRenderer largeFont = null;
private TTFRenderer xLargeFont = null;
private TTFRenderer LogoMainFont = null;
public TTFRenderer getStandardFont(){
if(standardFont == null){
standardFont = new TTFRenderer("Arial", Font.PLAIN, 18);
}
return standardFont;
}
public TTFRenderer getPanelTitleFont(){
if(panelTitleFont == null){
panelTitleFont = new TTFRenderer("Arial", Font.PLAIN, 23);
}
return panelTitleFont;
}
public TTFRenderer getButtonExtraFont(){
if(buttonExtraFont == null){
buttonExtraFont = new TTFRenderer("Arial", Font.PLAIN, 16);
}
return buttonExtraFont;
}
public TTFRenderer getModListFont(){
if(modListFont == null){
modListFont = new TTFRenderer("Arial", Font.PLAIN, 20);
}
return modListFont;
}
public TTFRenderer getChatFont(){
if(chatFont == null){
chatFont = new TTFRenderer("Arial", Font.PLAIN, 19);
}
return chatFont;
}
public TTFRenderer getWaypointFont(){
if(waypointFont == null){
waypointFont = new TTFRenderer("Arial", Font.PLAIN, 40);
}
return waypointFont;
}
public TTFRenderer getLargeFont(){
if(largeFont == null){
largeFont = new TTFRenderer("Arial", Font.PLAIN, 30);
}
return largeFont;
}
public TTFRenderer getLargeItalicFont(){
if(largeFont == null){
largeFont = new TTFRenderer("Arial", Font.ITALIC, 30);
}
return largeFont;
}
public TTFRenderer getLogoMainFont(){
if(LogoMainFont == null){
LogoMainFont = new TTFRenderer("Arial", Font.PLAIN, 100);
}
return LogoMainFont;
}
public TTFRenderer getXLargeFont(){
if(xLargeFont == null){
xLargeFont = new TTFRenderer("Arial", Font.PLAIN, 45);
}
return xLargeFont;
}
}
| [
"jaspersmit2801@gmail.com"
] | jaspersmit2801@gmail.com |
06ad993cbd3ade45556ef115f742cd175335f6ee | ef12a03a0dd66aafb20a2847c851fbd44dc45bc8 | /my-date-compare/src/main/java/com/app/StreamSort.java | 0a8d37ba92f5c26b02246005e43df103f83afc78 | [] | no_license | softwareengineerhub/learning | 24727a07e646a134c9d4db9d424ba546f90c0b52 | dc572f685ffdf8f356ee82b1d28ad940871d05fb | refs/heads/master | 2023-07-27T04:16:26.988338 | 2022-11-10T09:40:46 | 2022-11-10T09:40:46 | 179,563,742 | 0 | 0 | null | 2023-09-05T21:58:38 | 2019-04-04T19:28:55 | Java | UTF-8 | Java | false | false | 444 | java | package com.app;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.OptionalLong;
public class StreamSort {
public static void main(String[] args) {
List<Long> list = new ArrayList<>();
list.add(2L);
list.add(7L);
list.add(1L);
Optional<Long> res = list.stream().sorted().findFirst();
long tt=res.get();
System.out.println(tt);
}
}
| [
"denis.prokopiuk@yahoo.com"
] | denis.prokopiuk@yahoo.com |
bbf810b273d912d55a64a8efdd3bbe42d2b5705c | db5e2811d3988a5e689b5fa63e748c232943b4a0 | /jadx/sources/o/C1618.java | dba8012f708bccbff53b56cb98c124daa163b79a | [] | no_license | ghuntley/TraceTogether_1.6.1.apk | 914885d8be7b23758d161bcd066a4caf5ec03233 | b5c515577902482d741cabdbd30f883a016242f8 | refs/heads/master | 2022-04-23T16:59:33.038690 | 2020-04-27T05:44:49 | 2020-04-27T05:44:49 | 259,217,124 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 439 | java | package o;
/* renamed from: o.ʇɪ reason: contains not printable characters */
final /* synthetic */ class C1618 implements C2018 {
/* renamed from: ɩ reason: contains not printable characters */
static final C2018 f8537 = new C1618();
private C1618() {
}
/* renamed from: Ι reason: contains not printable characters */
public final Object m9361() {
return Boolean.valueOf(C1366.m8481());
}
}
| [
"ghuntley@ghuntley.com"
] | ghuntley@ghuntley.com |
a6ad228f27466593a9cff912e382b26e8d0c2388 | 14a873505a9a7aa4586ce9e55b467025cf2edbfc | /src/main/java/org/semanticwb/datamanager/SWBScriptEngine.java | 857705a8e429f48a772a208747d2e80135d5b0d9 | [] | no_license | csaorl/SWBDatamanager | 9fc0e0d03cfd970be3a60de7324714d37c70f744 | a50bcc8c69a7d2db09a284dc9a9535704ddd6543 | refs/heads/master | 2020-06-28T02:52:46.997904 | 2019-10-03T16:57:49 | 2019-10-03T16:57:49 | 200,125,596 | 0 | 0 | null | 2019-08-01T22:14:50 | 2019-08-01T22:14:50 | null | UTF-8 | Java | false | false | 6,409 | 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 org.semanticwb.datamanager;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import java.util.Set;
import javax.script.Bindings;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
import org.semanticwb.datamanager.datastore.SWBDataStore;
import org.semanticwb.datamanager.filestore.SWBFileSource;
import org.semanticwb.datamanager.script.ScriptObject;
/**
*
* @author javiersolis
*/
public interface SWBScriptEngine
{
/**
*
* @return
*/
public String getAppName();
/**
* Regresa configuracion de cache
* @return boolean
*/
public boolean getDSCache();
/**
*
*/
public void chechUpdates();
/**
*
* @param script
* @return
* @throws ScriptException
*/
public Object eval(String script) throws ScriptException;
/**
*
* @param script
* @return
* @throws ScriptException
*/
public Object eval(Reader script) throws ScriptException;
/**
* Busca los objetos SWBDataProcessor relacionados a un especifico DataSource y una accion
* @param dataSource
* @param action
* @return Lista de SWBDataProcessor o null si no hay SWBDataService relacionados
*/
public Set<SWBDataProcessor> findDataProcessors(String dataSource, String action);
/**
* Busca los objetos SWBDataService relacionados a un especifico DataSource y una accion
* @param dataSource
* @param action
* @return Lista de SWBDataService o null si no hay SWBDataService relacionados
*/
public Set<SWBDataService> findDataServices(String dataSource, String action);
/**
*
* @param name
* @return
*/
public SWBDataSource getDataSource(String name);
/**
*
* @param name
* @param modelid
* @return
*/
public SWBDataSource getDataSource(String name, String modelid);
/**
*
* @return
*/
public Set<String> getDataSourceNames();
/**
*
* @param name
* @return
*/
public SWBDataStore getDataStore(String name);
/**
*
* @param name
* @return
*/
public SWBFileSource getFileSource(String name);
/**
*
* @return
*/
public ScriptEngine getNativeScriptEngine();
/**
*
* @return
*/
public ScriptObject getScriptObject();
/**
*
* @param dataSource
* @param action
* @param method
* @param obj
* @param trxParams - Transaction Params
* @return
*/
public DataObject invokeDataProcessors(String dataSource, String action, String method, DataObject obj, DataObject trxParams);
/**
*
* @param dataSource
* @param action
* @param request
* @param response
*/
public void invokeDataServices(String dataSource, String action, DataObject request, DataObject response, DataObject trxParams);
/**
*
*/
public void reloadScriptEngine();
/**
*
*/
public void reloadAllScriptEngines();
/**
*
*/
public void needsReloadAllScriptEngines();
/**
*
*/
public void needsReloadScriptEngine();
/**
*
* @return
*/
public boolean isNeedsReloadScriptEngine();
/**
*
* @return
*/
public Bindings getUserBindings();
/**
*
* @return
*/
public DataObject getUser();
/**
*
* @param role
* @return
*/
public boolean hasUserRole(String role);
/**
*
* @param roles
* @return
*/
public boolean hasUserAnyRole(String... roles);
/**
*
* @param roles
* @return
*/
public boolean hasUserAnyRole(List<String> roles);
/**
*
* @param group
* @return
*/
public boolean hasUserGroup(String group);
/**
*
*/
public void removeUserPermissionCache();
/**
*
* @param permission
* @return
*/
public boolean hasUserPermission(String permission);
/**
*
* @param key
* @return
*/
public Object getContextData(String key);
/**
*
* @param key
* @param data
* @return
*/
public Object setContextData(String key, Object data);
/**
*
* @return
*/
public SWBScriptUtils getUtils();
/**
*
*/
public void close();
/**
*
* @return
*/
public boolean isClosed();
/**
*
* @return
*/
public long getId();
/**
* return DataObject fetch Object based on Id (Auto discover DataSource)
* @param id
* @return
* @throws java.io.IOException
*/
public DataObject fetchObjectById(String id) throws IOException;
/**
* return DataObject get Object from cache based on Id (Auto discover DataSource)
* @param id
* @return
*/
public DataObject getObjectById(String id);
/**
* Disable DataProcessors, DataServices and DataTransformations
* @param disabledDataTransforms boolean
*/
public void setDisabledDataTransforms(boolean disabledDataTransforms);
/**
* return true if is disable DataProcessors, DataServices and DataTransformations
* @return boolean
*/
public boolean isDisabledDataTransforms();
/**
* Gets global configuration data eng.config
* @return DataObject
*/
public DataObject getConfigData();
/**
* Gets global data eng.data
* @return
*/
public DataObject getData();
/**
* Gets the source path of the script
* @return String
*/
public String getSource();
/**
* Compile the code
* @param code String
* @return String with the error or null if ok
*/
public String compile(String code);
/**
* Get processMgr Instance
* @return
*/
public ProcessMgr getProcessMgr();
/**
* Get Server ContntextPath
* @return
*/
public String getContextPath();
}
| [
"softjei@gmail.com"
] | softjei@gmail.com |
fd53c5d6f986c340bc66ec59ed13b5261ef35fe8 | 6e498099b6858eae14bf3959255be9ea1856f862 | /src/com/facebook/buck/distributed/build_client/SynchronizedBuildPhase.java | 69759b7ac75b98265593e70060b9d944c6e07d19 | [
"Apache-2.0"
] | permissive | Bonnie1312/buck | 2dcfb0791637db675b495b3d27e75998a7a77797 | 3cf76f426b1d2ab11b9b3d43fd574818e525c3da | refs/heads/master | 2020-06-11T13:29:48.660073 | 2019-06-26T19:59:32 | 2019-06-26T21:06:24 | 193,979,660 | 2 | 0 | Apache-2.0 | 2019-09-22T07:23:56 | 2019-06-26T21:24:33 | Java | UTF-8 | Java | false | false | 3,195 | java | /*
* Copyright 2018-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.distributed.build_client;
import com.facebook.buck.core.build.distributed.synchronization.impl.RemoteBuildRuleSynchronizer;
import com.facebook.buck.core.util.log.Logger;
import com.facebook.buck.distributed.StampedeLocalBuildStatusEvent;
import com.facebook.buck.event.BuckEventBus;
/** Util class that contains orchestration code for synchronized build phase. */
public class SynchronizedBuildPhase {
private static final Logger LOG = Logger.get(SynchronizedBuildPhase.class);
/**
* Performs a local build that waits for build nodes to finish remotely before proceeding locally.
* Deals with cleanup if local or distributed build fails.
*
* @throws InterruptedException
*/
public static void run(
DistBuildRunner distBuildRunner,
LocalBuildRunner synchronizedBuildRunner,
RemoteBuildRuleSynchronizer remoteBuildRuleSynchronizer,
boolean localBuildFallbackEnabled,
BuckEventBus eventBus)
throws InterruptedException {
LOG.info("Starting synchronized build phase.");
eventBus.post(new StampedeLocalBuildStatusEvent("waiting"));
// Ensure build engine blocks when it hits a build rule that hasn't finished remotely.
remoteBuildRuleSynchronizer.switchToAlwaysWaitingMode();
synchronizedBuildRunner.runLocalBuildAsync();
LOG.info("Waiting for local synchronized build or distributed build to finish.");
synchronizedBuildRunner.getBuildPhaseLatch().await();
if (distBuildRunner.finishedSuccessfully()) {
LOG.info("Distributed build finished before local build. Waiting for local build..");
synchronizedBuildRunner.waitUntilFinished();
} else if (synchronizedBuildRunner.isFinished()) {
LOG.info("Local synchronized build finished before distributed build.");
distBuildRunner.cancelAsLocalBuildFinished(
synchronizedBuildRunner.finishedSuccessfully(), synchronizedBuildRunner.getExitCode());
} else {
LOG.info("Distributed build failed before local build.");
if (localBuildFallbackEnabled) {
LOG.info("Falling back to local synchronized build. Waiting for it to finish..");
eventBus.post(new StampedeLocalBuildStatusEvent("fallback", "Local Build"));
synchronizedBuildRunner.waitUntilFinished();
} else {
LOG.info("Killing local synchronized build as local fallback not enabled.");
synchronizedBuildRunner.cancelAndWait(
"Distributed build failed, and fallback not enabled.");
}
}
LOG.info("Local synchronized build phase has finished.");
}
}
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
2b67dd184b2949ef1d65e84ad44a5da2726d955e | eea475d4cd67ff7c5cfbeb376eb70b1e947a2309 | /JavaImprove/src/main/java/com/wugy/spring/annotation/aop/AspectProxy.java | 37794a56d4821b5c7ac5bdd9eb04913043226030 | [] | no_license | wugy11/favorite-base | e4334ca0fc59d1f010d5f645cf92ae18faf27603 | dd16c7ddf0dfea7b3c88dca60ef683d9f93bab41 | refs/heads/master | 2022-06-05T17:49:53.631162 | 2017-12-28T05:20:25 | 2017-12-28T05:20:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,351 | java | package com.wugy.spring.annotation.aop;
import java.lang.reflect.Method;
import com.wugy.spring.annotation.aop.proxy.Proxy;
import com.wugy.spring.annotation.aop.proxy.ProxyChain;
/**
* 切面代理
*
* @author devotion
*/
public abstract class AspectProxy implements Proxy {
@Override
public final Object doProxy(ProxyChain proxyChain) throws Throwable {
Object result = null;
Class<?> cls = proxyChain.getTargetClass();
Method method = proxyChain.getTargetMethod();
Object[] params = proxyChain.getMethodParams();
begin();
try {
if (intercept(cls, method, params)) {
before(cls, method, params);
result = proxyChain.doProxyChain();
after(cls, method, params, result);
} else {
result = proxyChain.doProxyChain();
}
} catch (Exception e) {
e.printStackTrace();
error(cls, method, params, e);
throw e;
} finally {
end();
}
return result;
}
public void begin() {
}
public boolean intercept(Class<?> cls, Method method, Object[] params) throws Throwable {
return true;
}
public void before(Class<?> cls, Method method, Object[] params) throws Throwable {
}
public void after(Class<?> cls, Method method, Object[] params, Object result) throws Throwable {
}
public void error(Class<?> cls, Method method, Object[] params, Throwable e) {
}
public void end() {
}
}
| [
"303054578@qq.com"
] | 303054578@qq.com |
d116c5045b002d78fd1b8b0d18b12eb70d5a133a | 533ff159f125813460432c8d43956788e6da045f | /Zemose/ZemoseRegionAdminFiles/sources/android/support/design/widget/CutoutDrawable.java | 7aed639c416f96ea4594c8f666a23bcf2ba3fa35 | [] | no_license | AitoApps/AndroidWorks | 7747b084e84b8ad769f4552e8b2691d9cdec3f06 | 3c6c7d17f085ee3aa714e66f13fec2a4d8663ca3 | refs/heads/master | 2022-03-14T10:57:59.215113 | 2019-12-06T17:03:24 | 2019-12-06T17:03:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,947 | java | package android.support.design.widget;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.graphics.drawable.Drawable.Callback;
import android.graphics.drawable.GradientDrawable;
import android.os.Build.VERSION;
import android.support.annotation.NonNull;
import android.view.View;
class CutoutDrawable extends GradientDrawable {
private final RectF cutoutBounds;
private final Paint cutoutPaint = new Paint(1);
private int savedLayer;
CutoutDrawable() {
setPaintStyles();
this.cutoutBounds = new RectF();
}
private void setPaintStyles() {
this.cutoutPaint.setStyle(Style.FILL_AND_STROKE);
this.cutoutPaint.setColor(-1);
this.cutoutPaint.setXfermode(new PorterDuffXfermode(Mode.DST_OUT));
}
/* access modifiers changed from: 0000 */
public boolean hasCutout() {
return !this.cutoutBounds.isEmpty();
}
/* access modifiers changed from: 0000 */
public void setCutout(float left, float top, float right, float bottom) {
if (left != this.cutoutBounds.left || top != this.cutoutBounds.top || right != this.cutoutBounds.right || bottom != this.cutoutBounds.bottom) {
this.cutoutBounds.set(left, top, right, bottom);
invalidateSelf();
}
}
/* access modifiers changed from: 0000 */
public void setCutout(RectF bounds) {
setCutout(bounds.left, bounds.top, bounds.right, bounds.bottom);
}
/* access modifiers changed from: 0000 */
public void removeCutout() {
setCutout(0.0f, 0.0f, 0.0f, 0.0f);
}
public void draw(@NonNull Canvas canvas) {
preDraw(canvas);
super.draw(canvas);
canvas.drawRect(this.cutoutBounds, this.cutoutPaint);
postDraw(canvas);
}
private void preDraw(@NonNull Canvas canvas) {
Callback callback = getCallback();
if (useHardwareLayer(callback)) {
((View) callback).setLayerType(2, null);
} else {
saveCanvasLayer(canvas);
}
}
private void saveCanvasLayer(@NonNull Canvas canvas) {
if (VERSION.SDK_INT >= 21) {
this.savedLayer = canvas.saveLayer(0.0f, 0.0f, (float) canvas.getWidth(), (float) canvas.getHeight(), null);
return;
}
this.savedLayer = canvas.saveLayer(0.0f, 0.0f, (float) canvas.getWidth(), (float) canvas.getHeight(), null, 31);
}
private void postDraw(@NonNull Canvas canvas) {
if (!useHardwareLayer(getCallback())) {
canvas.restoreToCount(this.savedLayer);
}
}
private boolean useHardwareLayer(Callback callback) {
return callback instanceof View;
}
}
| [
"me.salmanponnani@gmail.com"
] | me.salmanponnani@gmail.com |
2c3bd36eae47bb1153de03388b7eaa27313e4ae0 | c11c132b0a81cb900418ef8da5a2ff5d5ceaa8dd | /web/src/main/java/com/zwl/filter/TokenFilter.java | bd85e533dfb9847784e86abac241eaa19dde9ee2 | [] | no_license | weiliangzhou/mall-boot | fbe2da33106c7fafe8024d8f26bc5e4130ae5ee5 | 24a0ad057857479d21fa3d17b065200941d544d0 | refs/heads/master | 2020-04-18T21:24:55.498828 | 2019-01-27T03:21:49 | 2019-01-27T03:21:49 | 167,764,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,133 | java | package com.zwl.filter;
import com.alibaba.fastjson.JSON;
import com.zwl.model.baseresult.Result;
import com.zwl.model.baseresult.ResultCodeEnum;
import com.zwl.model.po.TokenModel;
import com.zwl.serviceimpl.RedisTokenManagerImpl;
import com.zwl.util.ThreadVariable;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* @author 二师兄超级帅
* @Title: TokenFilter
* @ProjectName parent
* @Description: token过滤器
* @date 2018/7/615:26
*/
@Order(1)
// 重点
@WebFilter(filterName = "tokenFilter", urlPatterns = "/wx/*")
@Slf4j
public class TokenFilter implements Filter {
@Autowired
private RedisTokenManagerImpl manager;
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest h_request = (HttpServletRequest) request;
String token = request.getParameter("token");
String requestURL = h_request.getRequestURL().toString();
log.info("<<token>>请求url:" + requestURL + " token:" + token);
ThreadVariable.clearThreadVariable();
// 注册、登录、注册短信、首页、回调 不需要token
if (requestURL.contains("/pay_notify.do") || requestURL.contains("/information/getInformationList") || requestURL.contains("/wx/gift/getGiftQrCode")) {
chain.doFilter(request, response);
return;
}
if (requestURL.contains("/information/getInformationInfo")) {
chain.doFilter(request, response);
return;
}
if (requestURL.contains("/user/authorization")) {
chain.doFilter(request, response);
return;
}
if (requestURL.contains("/task/task")) {
chain.doFilter(request, response);
return;
}
if (requestURL.contains("/qr/getQRCode") || requestURL.contains("/qr/getH5QrCode")) {
chain.doFilter(request, response);
return;
}
if (requestURL.contains(" /wx/gzh/sendFormId") || requestURL.contains(" /wx/gzh/getFormId")) {
chain.doFilter(request, response);
return;
}
//测试图片上传
if (requestURL.contains("/wx/file/upload")) {
chain.doFilter(request, response);
return;
}
//H5支付
if (requestURL.contains("/wx/product/H5Buy") || requestURL.contains("/wx/pay/auth/pay.do")) {
chain.doFilter(request, response);
return;
}
// 获取微信js api 权限 跟 h5登录权限
if (requestURL.contains("/wx/gzh/getGzhJsApiToken") || requestURL.contains("/wx/user/h5WeChatLogin")) {
chain.doFilter(request, response);
return;
}
//发送验证码
if (requestURL.contains("/wx/user/sendMsgCode") || requestURL.contains("/wx/user/checkCode")) {
chain.doFilter(request, response);
return;
}
//获取视频列表
if (requestURL.contains("/wx/video/getVideoList")) {
chain.doFilter(request, response);
return;
}
//根据id获取视频
if (requestURL.contains("/wx/video/getVideoInfoById")) {
chain.doFilter(request, response);
return;
}
//获取banner列表
if (requestURL.contains("/wx/banner/getBannerList")) {
chain.doFilter(request, response);
return;
}
//获取图标列表
if (requestURL.contains("/wx/icon/getIconList")) {
chain.doFilter(request, response);
return;
}
//套课程
if (requestURL.contains("/classset/getPageAllClass") || requestURL.contains("/classset/setpAddBrowseCount") ||
requestURL.contains("/classset/getById")) {
chain.doFilter(request, response);
return;
}
//节课程
if (requestURL.contains("/classinfo/getPageByClassSetId") || requestURL.contains("/classinfo/getById")
|| requestURL.contains("/classinfo/setpAddBrowseCount")) {
chain.doFilter(request, response);
return;
}
//分享绑定上下级关系
if (requestURL.contains("/user/shareRelation")) {
chain.doFilter(request, response);
return;
}
//获取商品列表 ||根据id获取商品详情
if (requestURL.contains("/product/getProductList") || requestURL.contains("/product/getProductById")) {
chain.doFilter(request, response);
return;
}
//微信页面轮播图
if (requestURL.contains("/wx/banner/selectBanner")) {
chain.doFilter(request, response);
return;
}
//线下活动签到
if (requestURL.contains("/wx/offlineActivity/signIn") || requestURL.contains("/wx/salon/signIn")) {
chain.doFilter(request, response);
return;
}
//线下、沙龙主题详情购买
if (requestURL.contains("/wx/offlineActivity/getOfflineActivityThemeList") || requestURL.contains("/wx/salon/getSalonThemeList")) {
chain.doFilter(request, response);
return;
}
//线下、沙龙主题详情购买
if (requestURL.contains("/wx/offlineActivity/getOfflineActivityThemeDetailByThemeId")) {
chain.doFilter(request, response);
return;
}
//操作员登陆
if (requestURL.contains("/wx/offlineActivity/offlineLogin") || requestURL.contains("/wx/salon/offlineLogin")) {
chain.doFilter(request, response);
return;
}
//线下、沙龙主题详情介绍页
if (requestURL.contains("/wx/offlineActivity/getActivityCodeDetail") || requestURL.contains("/wx/salon/getSalonThemeDetailByThemeId")) {
chain.doFilter(request, response);
return;
}
//获取书籍list
if (requestURL.contains("/wx/gift/getGiftList")||requestURL.contains("/wx/gift/getGiftDetailById")) {
chain.doFilter(request, response);
return;
}
//是否可分享
if (requestURL.contains("/wx/user/isShare")) {
chain.doFilter(request, response);
return;
}
// 验证token
// 这里token如果接收有空格的地方,,那就是+号没有处理好。。可以考虑变成%2B
if (StringUtils.isBlank(token)) {
Result result = new Result();
result.setCode("900");
response.setCharacterEncoding("UTF-8");
response.getWriter().println(JSON.toJSONString(result));
return;
}
token = token.replaceAll(" ", "+");
TokenModel model = manager.getToken(token);
if (manager.checkToken(model)) {
// 如果token验证成功,将token对应的用户id存在request中,便于之后注入
// request.setAttribute(Constants.CURRENT_USER_ID, model.getName());
// app请求就一次,所有session没有用处 除非pc
// session.setAttribute(Constants.CURRENT_USER_ID,
// model.getuserId());
chain.doFilter(request, response);
} else {
// 如果验证token失败
Result result = new Result();
result.setCode("900");
response.setCharacterEncoding("UTF-8");
response.getWriter().println(JSON.toJSONString(result));
return;
}
}
@Override
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub
}
} | [
"382308664@qq.com"
] | 382308664@qq.com |
3db63060da318646b525add46dc26ad82b3e90e9 | 3688066c31f046c356ca80d92f46113aaf898e3c | /ch7_7/src/main/java/com/wisely/ch7_7/Ch77Application.java | ca1ba76e92f005f4fc745d461a47081aedb63cb4 | [] | no_license | CrazySzg/JavaEE_And_SpringBoot | 1936125ee9d3c14cba4dba8fcab4e454ad610460 | 9c6dea7d9933f7bddbd51e1316e7c40e07897167 | refs/heads/master | 2021-01-01T06:56:47.372285 | 2017-07-18T00:23:17 | 2017-07-18T00:23:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 694 | java | package com.wisely.ch7_7;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class Ch77Application {
@RequestMapping(value = "/search", produces = {MediaType.APPLICATION_JSON_VALUE})
public Person search(String personName) {
return new Person(personName, 32, "hefei");
}
public static void main(String[] args) {
SpringApplication.run(Ch77Application.class, args);
}
}
| [
"shining-glory@qq.com"
] | shining-glory@qq.com |
f489f60597997331b92ffa4aa89d1ef87b6d477a | f758a5e562e119e22acb980b8436699f46a0cbf4 | /sdkcompat/v193/com/google/idea/sdkcompat/general/BaseSdkCompat.java | fb8e94d0a96d64bcb03fd82d8f67619f29956b9d | [
"Apache-2.0"
] | permissive | KrauseStefan/intellij | f5e8ef950475abd3fd9bb66643d77ddd1f57a3cf | 1f38798185db048f551cbb6f81409628f5ebb9f7 | refs/heads/master | 2022-09-09T15:45:25.140004 | 2020-05-21T18:26:28 | 2020-05-21T18:27:14 | 267,018,873 | 0 | 0 | Apache-2.0 | 2020-05-26T10:58:31 | 2020-05-26T10:58:30 | null | UTF-8 | Java | false | false | 4,697 | java | package com.google.idea.sdkcompat.general;
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
import com.intellij.dvcs.branch.BranchType;
import com.intellij.dvcs.branch.DvcsBranchManager;
import com.intellij.dvcs.branch.DvcsBranchSettings;
import com.intellij.find.findUsages.CustomUsageSearcher;
import com.intellij.find.findUsages.FindUsagesOptions;
import com.intellij.icons.AllIcons;
import com.intellij.ide.projectView.TreeStructureProvider;
import com.intellij.ide.projectView.ViewSettings;
import com.intellij.ide.scratch.ScratchesNamedScope;
import com.intellij.ide.util.treeView.AbstractTreeNode;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.extensions.ProjectExtensionPointName;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.projectRoots.SdkAdditionalData;
import com.intellij.openapi.projectRoots.SdkType;
import com.intellij.openapi.projectRoots.impl.ProjectJdkImpl;
import com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.psi.PsiElement;
import com.intellij.ui.EditorNotifications;
import com.intellij.usages.Usage;
import com.intellij.util.Processor;
import java.util.Collection;
import javax.annotation.Nullable;
import javax.swing.Icon;
/** Provides SDK compatibility shims for base plugin API classes, available to all IDEs. */
public final class BaseSdkCompat {
private BaseSdkCompat() {}
/** #api193: made public in 2020.1. */
@Nullable
@SuppressWarnings("rawtypes")
public static ProjectExtensionPointName<EditorNotifications.Provider> getEditorNotificationsEp() {
return null;
}
/** #api193: constructor changed in 2020.1. */
public static class DvcsBranchManagerAdapter extends DvcsBranchManager {
protected DvcsBranchManagerAdapter(
Project project, DvcsBranchSettings settings, BranchType[] branchTypes) {
super(settings, branchTypes);
}
}
/** #api193: wildcard generics added in 2020.1. */
public abstract static class CustomUsageSearcherAdapter extends CustomUsageSearcher {
/** #api193: wildcard generics added in 2020.1. */
@Override
public void processElementUsages(
PsiElement element, Processor<Usage> processor, FindUsagesOptions options) {
doProcessElementUsages(element, processor, options);
}
protected abstract void doProcessElementUsages(
PsiElement element, Processor<? super Usage> processor, FindUsagesOptions options);
}
/** #api193: wildcard generics added in 2020.1. */
@SuppressWarnings({"rawtypes", "unchecked"}) // #api193: wildcard generics added in 2020.1
public interface TreeStructureProviderAdapter extends TreeStructureProvider {
@Nullable
default Object doGetData(Collection<AbstractTreeNode<?>> selected, String dataId) {
return null;
}
@Nullable
@Override
default Object getData(Collection<AbstractTreeNode> selected, String dataId) {
return doGetData((Collection) selected, dataId);
}
@Override
default Collection<AbstractTreeNode> modify(
AbstractTreeNode parent, Collection<AbstractTreeNode> children, ViewSettings settings) {
return doModify(parent, (Collection) children, settings);
}
Collection<AbstractTreeNode<?>> doModify(
AbstractTreeNode<?> parent,
Collection<AbstractTreeNode<?>> children,
ViewSettings settings);
}
/** #api193: changed in 2020.1. */
public static final String SCRATCHES_SCOPE_NAME = ScratchesNamedScope.NAME;
/** #api193: 'project' param removed in 2020.1. */
public static void setTemplateTesting(Project project, Disposable parentDisposable) {
TemplateManagerImpl.setTemplateTesting(project, parentDisposable);
}
/** #api193: changed in 2020.1. */
@Nullable
public static String getActiveToolWindowId(Project project) {
return ToolWindowManager.getActiveId();
}
/** Compat class for {@link AllIcons}. */
public static final class AllIconsCompat {
private AllIconsCompat() {}
/** #api193: changed in 2020.1. */
public static final Icon collapseAll = AllIcons.General.CollapseAll;
}
/** #api193: SdkConfigurationUtil changed in 2020.1. */
public static ProjectJdkImpl createSdk(
Collection<? extends Sdk> allSdks,
VirtualFile homeDir,
SdkType sdkType,
@Nullable SdkAdditionalData additionalData,
@Nullable String customSdkSuggestedName) {
return SdkConfigurationUtil.createSdk(
allSdks.toArray(new Sdk[0]), homeDir, sdkType, additionalData, customSdkSuggestedName);
}
}
| [
"copybara-worker@google.com"
] | copybara-worker@google.com |
ec9eb57329d6bc8bfef7bdd0e0e534297d97dba8 | 42816ebebe8e29e53f1a651a836ed51abf76bcf4 | /Display/src/main/java/ru/usachev/display/logiweb/service/RestService.java | f3a8fc12f4dc5ec7163810b551f8c5b673db4876 | [] | no_license | alexusachev1999/ModuleProject | fcacd72f300280e06a25747b153e372897b30eb9 | 759fe59e6cc4f24f96a7fd0684cfd67e726dedf0 | refs/heads/master | 2023-06-03T19:28:03.650754 | 2021-06-22T09:29:47 | 2021-06-22T09:29:47 | 375,293,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 458 | java | package ru.usachev.display.logiweb.service;
import ru.usachev.display.logiweb.dto.DisplayDTO;
import ru.usachev.display.logiweb.dto.DriverDTO;
import ru.usachev.display.logiweb.dto.OrderDTO;
import ru.usachev.display.logiweb.dto.TruckDTO;
import java.util.List;
public interface RestService {
List<DriverDTO> getDriversForDisplay();
List<TruckDTO> getTrucksForDisplay();
List<OrderDTO> getOrdersForDisplay();
DisplayDTO getDisplayDTO();
}
| [
"sashulya.usachev@list.ru"
] | sashulya.usachev@list.ru |
a040c54a27dca17a977b67d6eba636d65c3e809d | caa2efc6c09b2a69943b173dec19952a213fd7ae | /odin-core/src/test/java/com/purplepip/odin/math/LessThanTest.java | 55a40d9c595371b8038c2f01715d12d6cf89cd28 | [
"MIT",
"Apache-2.0"
] | permissive | ianhomer/odin | 83963bf214442f696782c96222b432f40cefa15c | ac3e4a5ddbe5c441fc9fb22fa5f06a996ec1454c | refs/heads/main | 2021-10-19T22:27:29.709053 | 2020-11-15T17:37:40 | 2020-11-15T17:37:40 | 79,387,599 | 6 | 0 | NOASSERTION | 2021-10-05T21:04:08 | 2017-01-18T21:44:23 | Java | UTF-8 | Java | false | false | 1,224 | java | /*
* Copyright (c) 2017 the original author or authors. All Rights Reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.purplepip.odin.math;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.jupiter.api.Test;
class LessThanTest {
@Test
void testLessThan() {
Whole two = Wholes.TWO;
Bound lessThanTwo = LessThan.lessThan(two);
assertTrue(lessThanTwo.lt(two));
assertFalse(lessThanTwo.lt(Wholes.ONE));
}
@Test
void testFloor() {
Whole two = Wholes.TWO;
Bound lessThanTwo = LessThan.lessThan(two);
assertEquals(Wholes.ONE, lessThanTwo.floor(Wholes.ONE));
}
} | [
"ian.homer@gmail.com"
] | ian.homer@gmail.com |
f0f671e834172d7d8bde1b6df5431ead05926772 | 36274fd7b83aece1e761626b5c8a333f87b2b1c4 | /glarimy-leaves/src/main/java/com/glarimy/leaves/api/EmployeeNotFoundException.java | 6f85138b6e33c6c3a887636d081649b62e49782f | [] | no_license | glarimy/spring-boot-rest | cc920f46bf0c9ee08ed88e1ae29f4da033b2706f | 604ce4ad612cda945ff2b9f53dfeffe21a05e3a1 | refs/heads/master | 2020-04-07T20:07:15.743751 | 2019-02-22T08:10:19 | 2019-02-22T08:10:19 | 158,675,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package com.glarimy.leaves.api;
@SuppressWarnings("serial")
public class EmployeeNotFoundException extends LeaveManagementException {
public EmployeeNotFoundException() {
// TODO Auto-generated constructor stub
}
public EmployeeNotFoundException(String message) {
super(message);
// TODO Auto-generated constructor stub
}
public EmployeeNotFoundException(Throwable cause) {
super(cause);
// TODO Auto-generated constructor stub
}
public EmployeeNotFoundException(String message, Throwable cause) {
super(message, cause);
// TODO Auto-generated constructor stub
}
public EmployeeNotFoundException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
// TODO Auto-generated constructor stub
}
}
| [
"krishna@glarimy.com"
] | krishna@glarimy.com |
6dc73451ccd426d2eb97765fc29d182a76e5826c | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/apache/shardingsphere/opentracing/hook/OpenTracingSQLExecutionHookTest.java | 9d0469da0043f70b57e13b802a4b501b69575477 | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 6,809 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.opentracing.hook;
import ShardingTags.COMPONENT_NAME;
import ShardingTags.DB_BIND_VARIABLES;
import Tags.COMPONENT;
import Tags.DB_INSTANCE;
import Tags.DB_STATEMENT;
import Tags.DB_TYPE;
import Tags.PEER_HOSTNAME;
import Tags.PEER_PORT;
import Tags.SPAN_KIND;
import Tags.SPAN_KIND_CLIENT;
import io.opentracing.ActiveSpan;
import io.opentracing.mock.MockSpan;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import org.apache.shardingsphere.core.executor.ShardingExecuteDataMap;
import org.apache.shardingsphere.core.executor.hook.SPISQLExecutionHook;
import org.apache.shardingsphere.core.executor.hook.SQLExecutionHook;
import org.apache.shardingsphere.core.metadata.datasource.DataSourceMetaData;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.Test;
import org.mockito.Mockito;
public final class OpenTracingSQLExecutionHookTest extends BaseOpenTracingHookTest {
private final SQLExecutionHook sqlExecutionHook = new SPISQLExecutionHook();
private ActiveSpan activeSpan;
@Test
public void assertExecuteSuccessForTrunkThread() {
DataSourceMetaData dataSourceMetaData = Mockito.mock(DataSourceMetaData.class);
Mockito.when(dataSourceMetaData.getHostName()).thenReturn("localhost");
Mockito.when(dataSourceMetaData.getPort()).thenReturn(8888);
sqlExecutionHook.start(createRouteUnit("success_ds", "SELECT * FROM success_tbl;", Arrays.<Object>asList("1", 2)), dataSourceMetaData, true, null);
sqlExecutionHook.finishSuccess();
MockSpan actual = getActualSpan();
Assert.assertThat(actual.operationName(), CoreMatchers.is("/Sharding-Sphere/executeSQL/"));
Map<String, Object> actualTags = actual.tags();
Assert.assertThat(actualTags.get(COMPONENT.getKey()), CoreMatchers.<Object>is(COMPONENT_NAME));
Assert.assertThat(actualTags.get(SPAN_KIND.getKey()), CoreMatchers.<Object>is(SPAN_KIND_CLIENT));
Assert.assertThat(actualTags.get(PEER_HOSTNAME.getKey()), CoreMatchers.<Object>is("localhost"));
Assert.assertThat(actualTags.get(PEER_PORT.getKey()), CoreMatchers.<Object>is(8888));
Assert.assertThat(actualTags.get(DB_TYPE.getKey()), CoreMatchers.<Object>is("sql"));
Assert.assertThat(actualTags.get(DB_INSTANCE.getKey()), CoreMatchers.<Object>is("success_ds"));
Assert.assertThat(actualTags.get(DB_STATEMENT.getKey()), CoreMatchers.<Object>is("SELECT * FROM success_tbl;"));
Assert.assertThat(actualTags.get(DB_BIND_VARIABLES.getKey()), CoreMatchers.<Object>is("[1, 2]"));
Mockito.verify(activeSpan, Mockito.times(0)).deactivate();
}
@Test
public void assertExecuteSuccessForBranchThread() {
DataSourceMetaData dataSourceMetaData = Mockito.mock(DataSourceMetaData.class);
Mockito.when(dataSourceMetaData.getHostName()).thenReturn("localhost");
Mockito.when(dataSourceMetaData.getPort()).thenReturn(8888);
sqlExecutionHook.start(createRouteUnit("success_ds", "SELECT * FROM success_tbl;", Arrays.<Object>asList("1", 2)), dataSourceMetaData, false, ShardingExecuteDataMap.getDataMap());
sqlExecutionHook.finishSuccess();
MockSpan actual = getActualSpan();
Assert.assertThat(actual.operationName(), CoreMatchers.is("/Sharding-Sphere/executeSQL/"));
Map<String, Object> actualTags = actual.tags();
Assert.assertThat(actualTags.get(COMPONENT.getKey()), CoreMatchers.<Object>is(COMPONENT_NAME));
Assert.assertThat(actualTags.get(SPAN_KIND.getKey()), CoreMatchers.<Object>is(SPAN_KIND_CLIENT));
Assert.assertThat(actualTags.get(PEER_HOSTNAME.getKey()), CoreMatchers.<Object>is("localhost"));
Assert.assertThat(actualTags.get(PEER_PORT.getKey()), CoreMatchers.<Object>is(8888));
Assert.assertThat(actualTags.get(DB_TYPE.getKey()), CoreMatchers.<Object>is("sql"));
Assert.assertThat(actualTags.get(DB_INSTANCE.getKey()), CoreMatchers.<Object>is("success_ds"));
Assert.assertThat(actualTags.get(DB_STATEMENT.getKey()), CoreMatchers.<Object>is("SELECT * FROM success_tbl;"));
Assert.assertThat(actualTags.get(DB_BIND_VARIABLES.getKey()), CoreMatchers.<Object>is("[1, 2]"));
Mockito.verify(activeSpan).deactivate();
}
@Test
public void assertExecuteFailure() {
DataSourceMetaData dataSourceMetaData = Mockito.mock(DataSourceMetaData.class);
Mockito.when(dataSourceMetaData.getHostName()).thenReturn("localhost");
Mockito.when(dataSourceMetaData.getPort()).thenReturn(8888);
sqlExecutionHook.start(createRouteUnit("failure_ds", "SELECT * FROM failure_tbl;", Collections.emptyList()), dataSourceMetaData, true, null);
sqlExecutionHook.finishFailure(new RuntimeException("SQL execution error"));
MockSpan actual = getActualSpan();
Assert.assertThat(actual.operationName(), CoreMatchers.is("/Sharding-Sphere/executeSQL/"));
Map<String, Object> actualTags = actual.tags();
Assert.assertThat(actualTags.get(COMPONENT.getKey()), CoreMatchers.<Object>is(COMPONENT_NAME));
Assert.assertThat(actualTags.get(SPAN_KIND.getKey()), CoreMatchers.<Object>is(SPAN_KIND_CLIENT));
Assert.assertThat(actualTags.get(PEER_HOSTNAME.getKey()), CoreMatchers.<Object>is("localhost"));
Assert.assertThat(actualTags.get(PEER_PORT.getKey()), CoreMatchers.<Object>is(8888));
Assert.assertThat(actualTags.get(DB_TYPE.getKey()), CoreMatchers.<Object>is("sql"));
Assert.assertThat(actualTags.get(DB_INSTANCE.getKey()), CoreMatchers.<Object>is("failure_ds"));
Assert.assertThat(actualTags.get(DB_STATEMENT.getKey()), CoreMatchers.<Object>is("SELECT * FROM failure_tbl;"));
Assert.assertThat(actualTags.get(DB_BIND_VARIABLES.getKey()), CoreMatchers.<Object>is(""));
assertSpanError(RuntimeException.class, "SQL execution error");
Mockito.verify(activeSpan, Mockito.times(0)).deactivate();
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
4c968d6e1a46f9d5aa81b268c9ef264a7bae3eba | bfce217db2a898dea7bed12553068337287d5efa | /app/src/main/java/app/zingo/mysolite/Custom/CustomGridView.java | c63384ab6ffea264f8136388125d4b0a7b00d37b | [] | no_license | zingohotels/MysoliteEMS | e8341c45bafb520254ddf5250e1fdd0da0207368 | f3c2b8d39b340a0f570e700ddef9a8334c1e8329 | refs/heads/master | 2023-01-03T14:10:26.268127 | 2020-11-05T06:05:17 | 2020-11-05T06:05:17 | 298,346,166 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 809 | java | package app.zingo.mysolite.Custom;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
/**
* Created by ZingoHotels Tech on 29-09-2018.
*/
public class CustomGridView extends GridView {
public CustomGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomGridView(Context context) {
super(context);
}
public CustomGridView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
| [
"nishar@zingohotels.com"
] | nishar@zingohotels.com |
cf20e3d80c7c22e785792af419face812221b183 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Spring/Spring10806.java | 00e895822390c2649a68c6ee6dbabb6076d30a1c | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 395 | java | @Test
public void filterWithHttpPut() {
ServerWebExchange exchange = MockServerWebExchange.from(
MockServerHttpRequest.put("/")
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE)
.body("_method=DELETE"));
this.filter.filter(exchange, this.filterChain).block(Duration.ZERO);
assertEquals(HttpMethod.PUT, this.filterChain.getHttpMethod());
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
db0ac6435fd5e78e13c239e7c30c94825a3937fb | 182e2061ae7e36ce4c6ffacb71b2fdf4c6f01a01 | /common/src/main/java/com/topjet/common/utils/ObjectUtils.java | 76f93adf92e94fe2821e55290d2e330f1ef999d6 | [] | no_license | yygood1000/ph_project | 6e7918cde4aa18b30a935981c99a5f63d231ebdd | 7f0454240dec6fd308faf7192b96f5b90ae462c8 | refs/heads/master | 2020-04-05T04:02:42.515525 | 2018-11-07T11:24:38 | 2018-11-07T11:24:38 | 156,535,754 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,785 | java | package com.topjet.common.utils;
import java.util.ArrayList;
import java.util.List;
/**
* 集合数据/数据数据转换
* 对象比较
*/
public class ObjectUtils {
private ObjectUtils() {
throw new AssertionError();
}
/**
* compare two object
*
* @param actual
* @param expected
* @return if both are null, return true
*/
public static boolean isEquals(Object actual, Object expected) {
return actual == expected || (actual == null ? expected == null : actual.equals(expected));
}
/**
* compare two object
*
* @param actual
* @param expected
* @return if both are null, return true
*/
public static boolean isEqualsClass(Object actual, Class expected) {
if (actual == null)
return false;
return actual.getClass().equals(expected);
}
/**
* null Object to empty string
*
* @param str
* @return
*/
public static String nullStrToEmpty(Object str) {
return (str == null ? "" : (str instanceof String ? (String) str : str.toString()));
}
/**
* convert long array to Long array
*
* @param source
* @return
*/
public static Long[] transformLongArray(long[] source) {
Long[] destin = new Long[source.length];
for (int i = 0; i < source.length; i++) {
destin[i] = source[i];
}
return destin;
}
/**
* convert Long array to long array
*
* @param source
* @return
*/
public static long[] transformLongArray(Long[] source) {
long[] destin = new long[source.length];
for (int i = 0; i < source.length; i++) {
destin[i] = source[i];
}
return destin;
}
/**
* convert int array to Integer array
*
* @param source
* @return
*/
public static Integer[] transformIntArray(int[] source) {
Integer[] destin = new Integer[source.length];
for (int i = 0; i < source.length; i++) {
destin[i] = source[i];
}
return destin;
}
/**
* convert Integer array to int array
*
* @param source
* @return
*/
public static int[] transformIntArray(Integer[] source) {
int[] destin = new int[source.length];
for (int i = 0; i < source.length; i++) {
destin[i] = source[i];
}
return destin;
}
/**
* compare two object
*
* @param v1
* @param v2
* @return
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public static <V> int compare(V v1, V v2) {
return v1 == null ? (v2 == null ? 0 : -1) : (v2 == null ? 1 : ((Comparable) v1).compareTo(v2));
}
/**
* @param objects
* @return
*/
public static boolean isEmpty(Object... objects) {
return objects == null || objects.length == 0;
}
/**
* @param objects
* @return
*/
public static int nonemptyCount(Object... objects) {
int nonemptyCount = 0;
if (!ArrayUtils.isEmpty(objects)) {
for (Object obj : objects) {
if (obj != null) {
nonemptyCount++;
}
}
}
return nonemptyCount;
}
/**
* 将N个对象转换为数组返回
*/
@SafeVarargs
public static <U> List<U> nonemptyItems(U... objects) {
List<U> nonemptyItems = null;
if (!ArrayUtils.isEmpty(objects)) {
nonemptyItems = new ArrayList<U>();
for (U obj : objects) {
if (obj != null) {
nonemptyItems.add(obj);
}
}
}
return nonemptyItems;
}
}
| [
"yygood1000@163.com"
] | yygood1000@163.com |
46c19cf11afd5fd678b2039c11a2856dac3e84ce | 70a7b11bc27cbabfbc0db3db3aa119fe674c7977 | /src/main/java/com/zb/app/common/cons/ResultCode.java | 48b606e443cf7209fcba21c8bb6f4e9af5987ec0 | [] | no_license | lkemin/travel.b2b | b97a3560432268a71f9014c0012fb6fdf9768986 | b0829fa41ef74fc45894a8d034c60a7c70b51052 | refs/heads/master | 2020-06-17T20:46:46.811185 | 2019-01-13T15:54:21 | 2019-01-13T15:54:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,724 | java | /*
* Copyright 2014-2017 ZuoBian.com All right reserved. This software is the confidential and proprietary information of
* ZuoBian.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you entered into with ZuoBian.com.
*/
package com.zb.app.common.cons;
/**
* @author zxc Jun 19, 2014 10:28:31 AM
*/
public enum ResultCode {
// 成功
SUCCESS(0),
// 失败
ERROR(1),
// 未登录
NEED_LOGIN(2),
// 重复提交
SUBMITED(3),
// 重定向
FORBIDDEN(4),
// 心跳
HEARTBEAT(6),
// 错误数据格式
ERROR_FORMAT(10);
public int value;
private ResultCode(int value) {
this.value = value;
}
public int getValue() {
return value;
}
public boolean isSuccess() {
return this == SUCCESS;
}
public boolean isError() {
return this == ERROR;
}
public boolean isNeedLogin() {
return this == NEED_LOGIN;
}
public boolean isSubmited() {
return this == SUBMITED;
}
public static boolean isSuccess(int value) {
return SUCCESS.getValue() == value;
}
public static boolean isError(int value) {
return ERROR.getValue() == value;
}
public static boolean isNeedLogin(int value) {
return NEED_LOGIN.getValue() == value;
}
public static boolean isSubmited(int value) {
return SUBMITED.getValue() == value;
}
public static ResultCode getEnum(int value) {
for (ResultCode code : values()) {
if (value == code.getValue()) return code;
}
return null;
}
}
| [
"zhangxiongcai337@gmail.com"
] | zhangxiongcai337@gmail.com |
d622cad68f7cbf47d2f3e79b3edb94adeb220b57 | 9fb404066fa8da452488970427ff69781ae5ab2b | /Piggy/src/howbuy/android/piggy/widget/FixedSpeedScroller.java | cf609ed6639a236a4eaf773e31f6942a3b3e670a | [] | no_license | heatork/piggy | 572fa60771001dc585aa414594a135f07ee6784f | 24a2945fd779a8b555eb29a065e78f3d6bebcba5 | refs/heads/master | 2020-12-27T15:27:10.139374 | 2015-04-04T14:43:06 | 2015-04-04T14:43:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,059 | java | package howbuy.android.piggy.widget;
import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;
public class FixedSpeedScroller extends Scroller {
public static final int defaultDuration=250;//
public static final int customDuration=1000;
private int mDuration = 1000;
public FixedSpeedScroller(Context context) {
super(context);
}
public FixedSpeedScroller(Context context, Interpolator interpolator) {
super(context, interpolator);
}
@Override
public void startScroll(int startX, int startY, int dx, int dy, int duration) {
// Ignore received duration, use fixed one instead
// if (mDuration==250) {
// mDuration=duration;
// }
super.startScroll(startX, startY, dx, dy, mDuration);
}
@Override
public void startScroll(int startX, int startY, int dx, int dy) {
// Ignore received duration, use fixed one instead
super.startScroll(startX, startY, dx, dy);
}
public void setmDuration(int time) {
mDuration = time;
}
public int getmDuration() {
return mDuration;
}
} | [
"liaojiejie8@gmail.com"
] | liaojiejie8@gmail.com |
a46736d5b9aa89fd8c78beb56f390c3d862ff186 | b06acf556b750ac1fa5b28523db7188c05ead122 | /IfcModel/src/ifc2x3tc1/IfcDateAndTime.java | 4ef2c6a95bc103dac34e539f4f48a89730b6c0cb | [] | no_license | christianharrington/MDD | 3500afbe5e1b1d1a6f680254095bb8d5f63678ba | 64beecdaed65ac22b0047276c616c269913afd7f | refs/heads/master | 2021-01-10T21:42:53.686724 | 2012-12-17T03:27:05 | 2012-12-17T03:27:05 | 6,157,471 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,345 | java | /**
*/
package ifc2x3tc1;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Ifc Date And Time</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link ifc2x3tc1.IfcDateAndTime#getDateComponent <em>Date Component</em>}</li>
* <li>{@link ifc2x3tc1.IfcDateAndTime#getTimeComponent <em>Time Component</em>}</li>
* </ul>
* </p>
*
* @see ifc2x3tc1.Ifc2x3tc1Package#getIfcDateAndTime()
* @model
* @generated
*/
public interface IfcDateAndTime extends IfcDateTimeSelect, IfcObjectReferenceSelect {
/**
* Returns the value of the '<em><b>Date Component</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Date Component</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Date Component</em>' reference.
* @see #setDateComponent(IfcCalendarDate)
* @see ifc2x3tc1.Ifc2x3tc1Package#getIfcDateAndTime_DateComponent()
* @model
* @generated
*/
IfcCalendarDate getDateComponent();
/**
* Sets the value of the '{@link ifc2x3tc1.IfcDateAndTime#getDateComponent <em>Date Component</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Date Component</em>' reference.
* @see #getDateComponent()
* @generated
*/
void setDateComponent(IfcCalendarDate value);
/**
* Returns the value of the '<em><b>Time Component</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Time Component</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Time Component</em>' reference.
* @see #setTimeComponent(IfcLocalTime)
* @see ifc2x3tc1.Ifc2x3tc1Package#getIfcDateAndTime_TimeComponent()
* @model
* @generated
*/
IfcLocalTime getTimeComponent();
/**
* Sets the value of the '{@link ifc2x3tc1.IfcDateAndTime#getTimeComponent <em>Time Component</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Time Component</em>' reference.
* @see #getTimeComponent()
* @generated
*/
void setTimeComponent(IfcLocalTime value);
} // IfcDateAndTime
| [
"t.didriksen@gmail.com"
] | t.didriksen@gmail.com |
b054ccf2fb747068b8936a3878b6b0f217ef5527 | cddd66e1387a7a70f563112ee8968cc05ae4099c | /app/src/main/java/com/app/elixir/makkhankitchen/Model/OrderDetailModelArraySub.java | 00815436b193ac5d75eda05369d0a3fcd0caee9e | [] | no_license | Ravikumawat1990/MKVerson2 | 8b7a2b717d68ff36fad50495f6d3a1849fb8d91b | 47e24f6f9cf5bb5c49387af3b778e4e4ec9722ef | refs/heads/master | 2020-12-03T00:44:40.276873 | 2017-07-03T06:11:15 | 2017-07-03T06:11:15 | 96,075,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package com.app.elixir.makkhankitchen.Model;
import com.google.gson.annotations.SerializedName;
/**
* Created by NetSupport on 08-10-2016.
*/
public class OrderDetailModelArraySub {
@SerializedName("cCustomerName")
public String cCustomerName;
@SerializedName("cMobile")
public String cMobile;
@SerializedName("cEmail")
public String cEmail;
@SerializedName("nShippingAddressID")
public String nShippingAddressID;
@SerializedName("nBillingAddressID")
public String nBillingAddressID;
@SerializedName("cAddressLine1")
public String cAddressLine1;
}
| [
"kravi@elixirinfo.com"
] | kravi@elixirinfo.com |
6eb99305842af2a82d01b2984ea419e1cac86d53 | 2799f342a48aba73540d537aa3636082db843196 | /app/src/main/java/com/example/ghost/giaodienmau/model/DanhGia.java | 7d4830d0e4e58a99b4fc45bfeba25a2b314f2e89 | [] | no_license | quanghn96/My-identity | 0708c9c34c994347d219af121da55c6dfe715996 | 5149637960e2752697b51e0111138207e0725adc | refs/heads/master | 2021-09-20T04:08:45.373686 | 2018-08-03T09:36:38 | 2018-08-03T09:36:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 817 | java | package com.example.ghost.giaodienmau.model;
/**
* Created by namxathu on 08/05/2018.
*/
public class DanhGia
{
private String sao;
private String noidung;
private String username;
public DanhGia(String sao, String noidung,String username) {
this.sao = sao;
this.noidung = noidung;
this.username = username;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public DanhGia() {
}
public String getSao() {
return sao;
}
public void setSao(String sao) {
this.sao = sao;
}
public String getNoidung() {
return noidung;
}
public void setNoidung(String noidung) {
this.noidung = noidung;
}
}
| [
"root@localhost.localdomain"
] | root@localhost.localdomain |
7136c7ae5fd5ca5b11e938085be4a07d15a903f3 | 62f726eed7dffccefd34467d021733f31c557831 | /studentsApp-Servlets-JDBC/src/com/jspiders/studentsapp/servlets/LoginServlet.java | b268926978ce8d2e0f0411937f76d347472c6d19 | [] | no_license | praveen4students/java_javaee_workspace | b0ae532bb41d98185c71ee7a6690bd6af9c6a919 | 1acbd347773540c7cee449fa7dd3953fd91c50e4 | refs/heads/master | 2021-09-13T02:52:04.161217 | 2018-04-24T03:40:33 | 2018-04-24T03:40:33 | 106,991,864 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,676 | java | package com.jspiders.studentsapp.servlets;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.mysql.jdbc.Driver;
public class LoginServlet extends HttpServlet {
RequestDispatcher dispatcher =null;
@Override
protected void doPost(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException {
//Get the Form Data
String regnoVal = req.getParameter("regno");
String passVal = req.getParameter("pass");
/* II. Authenticate the Credentials by
* interacting with DB & Generate
* the Response
*/
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
//1. Load the Driver
//Driver Class : com.mysql.jdbc.Driver
Driver driverRef = new Driver();
DriverManager.registerDriver(driverRef);
//2. Get the DB Connection via Driver
String dbUrl = "jdbc:mysql://localhost:3306/studentsapp_db?user=j2ee&password=j2ee";
con = DriverManager.getConnection(dbUrl);
//3. Issue SQL Queries via Connection
String query = " select * from "+
" students_info si, "+
" guardian_info gi, "+
" students_otherinfo soi "+
" where si.regno = gi.regno "+
" and si.regno = soi.regno "+
" and soi.regno = ? "+
" and soi.password = ? ";
System.out.println("Query : "+query);
pstmt = con.prepareStatement(query);
pstmt.setInt(1, Integer.parseInt(regnoVal) );
pstmt.setString(2, passVal);
rs = pstmt.executeQuery();
//4. Process the Results returned by SQL Queries
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
if(rs.next())
{
//Valid credentials
//I. Create a Session
HttpSession session = req.getSession(true);
//Time in Sec.
session.setMaxInactiveInterval(1*60);
session.setAttribute("userName", regnoVal);
session.setAttribute("isAdmin", rs.getString("soi.isadmin"));
System.out.println("Session ID ---> "+session.getId());
int regnum = rs.getInt("regno");
String fNM = rs.getString("firstname");
String mNM = rs.getString("middlename");
String lNM = rs.getString("lastname");
String gfNM = rs.getString("gi.gfirstname");
String gmNM = rs.getString("gi.gmiddlename");
String glNM = rs.getString("gi.glastname");
String isAdmin = rs.getString("soi.isadmin");
dispatcher=req.getRequestDispatcher("headerPage");
dispatcher.include(req, resp);
out.println("<html>");
out.println("<body>");
if(isAdmin.equals("Y")){
String url = "./allStudentsView";
String encodedUrl = resp.encodeURL(url);
out.println("<a href=\""+encodedUrl+"\">Click Here</a> to View All Students Info");
out.print("<BR>");
}
out.println("<table>");
out.println("<tr bgcolor=\"green\">");
out.println("<td>Reg. No.</td>");
out.println("<td>First Name</td>");
out.println("<td>Middle Name</td>");
out.println("<td>Last Name</td>");
out.println("<td>G First Name</td> ");
out.println("<td>G Middle Name</td>");
out.println("<td>G Last Name</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td>"+regnum+"</td>");
out.println("<td>"+fNM+"</td>");
out.println("<td>"+mNM+"</td> ");
out.println("<td>"+lNM+"</td>");
out.println("<td>"+gfNM+"</td>");
out.println("<td>"+gmNM+"</td> ");
out.println("<td>"+glNM+"</td>");
out.println("</tr>");
out.println("</table>");
dispatcher=req.getRequestDispatcher("Footer.html");
dispatcher.include(req, resp);
}else{
out.print("<font color=\"red\">");
out.println("In-Valid User Name / Password");
out.print("</font>");
dispatcher=req.getRequestDispatcher("Login.html");
dispatcher.include(req, resp);
}
out.println("</body>");
out.println("</html>");
} catch (Exception e) {
e.printStackTrace();
} finally{
//5. Close All JDBC Objects
try
{
if(con!=null){
con.close();
}
if(pstmt!=null){
pstmt.close();
}
if(rs!=null){
rs.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}//End of outer try-catch block
}//End of doPost
}//End of Class
| [
"praveen.dyamappa@gmail.com"
] | praveen.dyamappa@gmail.com |
e0e2fcd82d920e8508ac8d75a241259b90f32ab6 | e6b083da7bf50b20cd3e67da6111f877f6e964f5 | /swagger-manjunath-java/src/main/java/io/swagger/api/impl/UserApiServiceImpl.java | f399b4a29a794c99a193fa6bd64bc4661a3b5f41 | [] | no_license | swbhoi/java-apis | f08a6f7b931d39fd54b568aa8fd4de07e9651144 | ef17a05b0405c9e2d5dedd823d90fe9332c0f59b | refs/heads/master | 2021-01-23T12:26:22.368221 | 2018-02-26T07:21:42 | 2018-02-26T07:21:42 | 61,774,788 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,788 | java | package io.swagger.api.impl;
import io.swagger.api.*;
import io.swagger.model.*;
import com.sun.jersey.multipart.FormDataParam;
import io.swagger.model.User;
import java.util.*;
import java.util.List;
import io.swagger.api.NotFoundException;
import java.io.InputStream;
import com.sun.jersey.core.header.FormDataContentDisposition;
import com.sun.jersey.multipart.FormDataParam;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JaxRSServerCodegen", date = "2017-04-20T00:49:05.561-04:00")
public class UserApiServiceImpl extends UserApiService {
@Override
public Response createUser(User body,SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response createUsersWithListInput(List<User> body,SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response loginUser(String username,String password,SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response logoutUser(SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response getUserByName(String username,SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response updateUser(String username,User body,SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
@Override
public Response deleteUser(String username,SecurityContext securityContext)
throws NotFoundException {
// do some magic!
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
}
}
| [
"swbhoi@gmail.com"
] | swbhoi@gmail.com |
5954bcd7e398a4c3ae4141bdea024d39912be116 | 9d8d9e394bec2ec8486b692fe85214e9adfc5f06 | /server/src/main/java/com/cezarykluczynski/stapi/server/magazine/mapper/MagazineBaseRestMapper.java | f25a65fdffabbfb4cbca682d284902af33969c7f | [
"MIT"
] | permissive | cezarykluczynski/stapi | a343e688c7e8ce86601c9c0a71e2445cfbd9b0b9 | 1729aae76ae161b0dff50d9124e337b67c934da0 | refs/heads/master | 2023-06-09T16:18:03.000465 | 2023-06-08T19:11:30 | 2023-06-08T19:11:30 | 70,270,193 | 128 | 17 | MIT | 2023-02-04T21:35:35 | 2016-10-07T17:55:21 | Groovy | UTF-8 | Java | false | false | 887 | java | package com.cezarykluczynski.stapi.server.magazine.mapper;
import com.cezarykluczynski.stapi.model.magazine.dto.MagazineRequestDTO;
import com.cezarykluczynski.stapi.model.magazine.entity.Magazine;
import com.cezarykluczynski.stapi.server.common.mapper.RequestSortRestMapper;
import com.cezarykluczynski.stapi.server.configuration.MapstructConfiguration;
import com.cezarykluczynski.stapi.server.magazine.dto.MagazineRestBeanParams;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper(config = MapstructConfiguration.class, uses = {RequestSortRestMapper.class})
public interface MagazineBaseRestMapper {
MagazineRequestDTO mapBase(MagazineRestBeanParams magazineRestBeanParams);
com.cezarykluczynski.stapi.client.rest.model.MagazineBase mapBase(Magazine magazine);
List<com.cezarykluczynski.stapi.client.rest.model.MagazineBase> mapBase(List<Magazine> magazineList);
}
| [
"cezary.kluczynski@gmail.com"
] | cezary.kluczynski@gmail.com |
0da418d97a717ab901a8ad08d06d82a6e902c990 | f8d783cef3b74a7a757de7f8b1b0a327fe0dfcd8 | /extra/cloud-lsmt-cube/src/test/java/io/activej/cube/bean/DataItemResultString.java | cb57152fc35c7e1e0e026c85ae61a922bfd9e12e | [
"Apache-2.0"
] | permissive | zhangtianxiao/activej | 976e37fab5b2d5163a08e9a461868411d1ac4a32 | 2282081c587d1598545ff64956dca22b01786120 | refs/heads/master | 2023-06-24T08:51:37.427514 | 2021-07-23T06:55:42 | 2021-07-23T09:59:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,661 | java | package io.activej.cube.bean;
import io.activej.aggregation.measure.Measure;
import java.util.Map;
import java.util.stream.Stream;
import static io.activej.aggregation.fieldtype.FieldTypes.ofLong;
import static io.activej.aggregation.measure.Measures.sum;
import static io.activej.common.collection.CollectionUtils.keysToMap;
public class DataItemResultString {
public String key1;
public int key2;
public long metric1;
public long metric2;
public long metric3;
public DataItemResultString() {
}
public DataItemResultString(String key1, int key2, long metric1, long metric2, long metric3) {
this.key1 = key1;
this.key2 = key2;
this.metric1 = metric1;
this.metric2 = metric2;
this.metric3 = metric3;
}
public static final Map<String, Class<?>> DIMENSIONS =
keysToMap(Stream.of("key1", "key2"), k -> k.equals("key1") ? String.class : int.class);
public static final Map<String, Measure> METRICS =
keysToMap(Stream.of("metric1", "metric2", "metric3"), k -> sum(ofLong()));
@Override
@SuppressWarnings({"EqualsWhichDoesntCheckParameterClass", "RedundantIfStatement"})
public boolean equals(Object o) {
DataItemResultString that = (DataItemResultString) o;
if (!key1.equals(that.key1)) return false;
if (key2 != that.key2) return false;
if (metric1 != that.metric1) return false;
if (metric2 != that.metric2) return false;
if (metric3 != that.metric3) return false;
return true;
}
@Override
public String toString() {
return "DataItemResultString{" +
"key1='" + key1 + '\'' +
", key2=" + key2 +
", metric1=" + metric1 +
", metric2=" + metric2 +
", metric3=" + metric3 +
'}';
}
}
| [
"dmitry@activej.io"
] | dmitry@activej.io |
9f4b79eef96efd0675c39ee27c9236771326017e | 2937e29ae02d953807d924d27fd832a11c7ac6ee | /java-web/src/main/java/bitcamp/ex06/Servlet03.java | 44c00b261be917a9be1bf948863e7b23f2c64fe9 | [] | no_license | jeonjinwook/bitcamp-java-2018-12 | ebbcc5732bd42fa3547b74d6591e415aac4c63de | d6bd2e2721bb18ce7be7bdc24f30cdd6f0073dfc | refs/heads/master | 2021-08-06T18:46:42.587398 | 2019-10-23T14:00:25 | 2019-10-23T14:00:25 | 163,650,666 | 0 | 0 | null | 2020-04-30T12:44:13 | 2018-12-31T08:00:39 | Java | UTF-8 | Java | false | false | 1,654 | java | // 서블릿 초기화 파라미터 - 애노테이션으로 설정하기
package bitcamp.ex06;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// 서블릿이 사용할 값을 DD 설정으로 지정할 수 있다.
//
@SuppressWarnings("serial")
@WebServlet(
value="/ex06/s3",
loadOnStartup=1,
initParams= {
@WebInitParam(name="jdbc.driver", value="org.mariadb.jdbc.Driver"),
@WebInitParam(name="jdbc.url", value="jdbc:mariadb://localhost/bitcampdb"),
@WebInitParam(name="jdbc.username", value="bitcamp"),
@WebInitParam(name="jdbc.password", value="1111")
})
public class Servlet03 extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// 서블릿 DD 설정 값을 꺼내려면 ServletConfig 객체가 있어야 한다.
ServletConfig config = this.getServletConfig();
resp.setContentType("text/plain;charset=UTF-8");
PrintWriter out = resp.getWriter();
out.printf("driver=%s\n", config.getInitParameter("jdbc.driver"));
out.printf("url=%s\n", config.getInitParameter("jdbc.url"));
out.printf("username=%s\n", config.getInitParameter("jdbc.username"));
out.printf("password=%s\n", config.getInitParameter("jdbc.password"));
}
}
| [
"sambosoft@naver.com"
] | sambosoft@naver.com |
197876c619fbeac2bfc0cb8e71a5e99e16811812 | 73458087c9a504dedc5acd84ecd63db5dfcd5ca1 | /src/com/baidu/sapi2/share/a$a.java | 4ea57d9b8ec711901e7338953a691694c5765ce3 | [] | no_license | jtap60/com.estr | 99ff2a6dd07b02b41a9cc3c1d28bb6545e68fb27 | 8b70bf2da8b24c7cef5973744e6054ef972fc745 | refs/heads/master | 2020-04-14T02:12:20.424436 | 2018-12-30T10:56:45 | 2018-12-30T10:56:45 | 163,578,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 472 | java | package com.baidu.sapi2.share;
import com.baidu.sapi2.SapiAccountManager;
import com.baidu.sapi2.SapiAccountManager.SilentShareListener;
final class a$a
implements Runnable
{
public void run()
{
if (SapiAccountManager.getSilentShareListener() != null) {
SapiAccountManager.getSilentShareListener().onSilentShare();
}
}
}
/* Location:
* Qualified Name: com.baidu.sapi2.share.a.a
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
7b0e32f314d3246ca31bc2682521f24571b8c90b | f56d545a335d8ed1a42801792f3a61ea1b751afd | /src/main/java/be/pxl/student/dao/LabelDao.java | 9ee40e5a6aa9d21a67aace6cb5787cd517654d54 | [] | no_license | custersnele/BudgetPlannerUsecase | 2a2c2134167ab00a84f22ee606df627852e6cc5a | 8be407a0a9e2f7b8874c3faaff5fcc5b3e422f71 | refs/heads/master | 2021-01-06T17:06:47.392439 | 2020-06-14T07:11:24 | 2020-06-14T07:11:24 | 241,410,206 | 1 | 1 | null | 2020-02-18T16:26:51 | 2020-02-18T16:26:50 | null | UTF-8 | Java | false | false | 285 | java | package be.pxl.student.dao;
import be.pxl.student.entity.Label;
import java.util.List;
public interface LabelDao {
Label findLabelByName(String name);
Label findLabelById(long id);
List<Label> findAllLabels();
void saveLabel(Label label);
void removeLabel(Label label);
}
| [
"custersnele@gmail.com"
] | custersnele@gmail.com |
e38761e01a43a450a723d975bbe7e2efa98caeb2 | 0c1b1e818748e849e5f97cd0bdb627c95713f231 | /src/main/java/joshie/mariculture/magic/jewelry/parts/MaterialPearlGold.java | b0fe64f2eea74e454fd5616d396efb14ed172be9 | [
"MIT"
] | permissive | Mazdallier/Mariculture | aa3ffb68106d225cf7bed94972eaf9dd50dc20eb | c662b94c98db2759bdd71903f92d671d14954406 | refs/heads/master | 2021-01-18T01:31:36.470324 | 2014-09-25T03:20:54 | 2014-09-25T03:20:54 | 24,681,555 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,661 | java | package joshie.mariculture.magic.jewelry.parts;
import joshie.lib.helpers.ItemHelper;
import joshie.mariculture.core.Core;
import joshie.mariculture.core.lib.PearlColor;
import joshie.mariculture.magic.jewelry.ItemJewelry.JewelryType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
public class MaterialPearlGold extends JewelryMaterial {
@Override
public String getColor() {
return joshie.lib.util.Text.YELLOW;
}
@Override
public int onKill(LivingDeathEvent event, EntityPlayer player) {
if (player.worldObj.rand.nextInt(50) == 0) {
ItemHelper.spawnItem(event.entity.worldObj, (int) event.entity.posX, (int) event.entity.posY, (int) event.entity.posZ, new ItemStack(Items.gold_nugget));
return 2;
} else return 0;
}
@Override
public int getExtraEnchantments(JewelryType type) {
return type == JewelryType.BRACELET ? 2 : type == JewelryType.RING ? 0 : 1;
}
@Override
public int getMaximumEnchantmentLevel(JewelryType type) {
return type == JewelryType.BRACELET ? 5 : 4;
}
@Override
public float getRepairModifier(JewelryType type) {
return 2.0F;
}
@Override
public float getHitsModifier(JewelryType type) {
return 1.0F;
}
@Override
public float getDurabilityModifier(JewelryType type) {
return 0.8F;
}
@Override
public ItemStack getCraftingItem(JewelryType type) {
return new ItemStack(Core.pearls, 1, PearlColor.GOLD);
}
}
| [
"joshjackwildman@gmail.com"
] | joshjackwildman@gmail.com |
13b5b08da8ae2f8a465e5e744b19129daba12934 | 3a9930d29eccd9ce62f273e90fcb448f718f882e | /Maven_start1/src/main/java/Analyzer/RetryAnalyzer.java | 606051a07c8126ffee9298b7e75d49ae0625eef1 | [] | no_license | Imdadulhoque1992/DemoRepo | 31d692bf5593539099eced5fd79c4c917cd776f6 | aa8f2cdda4faee4da7a51a4dfe6cadae2b89d74b | refs/heads/master | 2020-04-29T10:16:39.921245 | 2019-04-06T18:22:36 | 2019-04-06T18:22:36 | 176,056,170 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 292 | java | package Analyzer;
import org.testng.IRetryAnalyzer;
import org.testng.ITestResult;
public class RetryAnalyzer implements IRetryAnalyzer {
int count=0;
int retryLimit=3;
public boolean retry(ITestResult result) {
if(count<retryLimit) {
count++;
return true;
}
return false;
}
}
| [
"you@example.com"
] | you@example.com |
608b50813035d48d08f4649b799b2c40cc22d097 | 3cd63aba77b753d85414b29279a77c0bc251cea9 | /main/plugins/org.talend.designer.components.libs/libs_src/talend-mscrm/src/main/java/com/microsoft/schemas/crm/_2011/contracts/impl/ArrayOfArrayOfPropagationOwnershipOptionsDocumentImpl.java | bdd8538a3571eef86ee49a93ab8eb36f0ff97f1b | [
"Apache-2.0"
] | permissive | 195858/tdi-studio-se | 249bcebb9700c6bbc8905ccef73032942827390d | 4fdb5cfb3aeee621eacfaef17882d92d65db42c3 | refs/heads/master | 2021-04-06T08:56:14.666143 | 2018-10-01T14:11:28 | 2018-10-01T14:11:28 | 124,540,962 | 1 | 0 | null | 2018-10-01T14:11:29 | 2018-03-09T12:59:25 | Java | UTF-8 | Java | false | false | 4,654 | java | /*
* An XML document type.
* Localname: ArrayOfArrayOfPropagationOwnershipOptions
* Namespace: http://schemas.microsoft.com/crm/2011/Contracts
* Java type: com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptionsDocument
*
* Automatically generated - do not modify.
*/
package com.microsoft.schemas.crm._2011.contracts.impl;
/**
* A document containing one ArrayOfArrayOfPropagationOwnershipOptions(@http://schemas.microsoft.com/crm/2011/Contracts) element.
*
* This is a complex type.
*/
public class ArrayOfArrayOfPropagationOwnershipOptionsDocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptionsDocument
{
private static final long serialVersionUID = 1L;
public ArrayOfArrayOfPropagationOwnershipOptionsDocumentImpl(org.apache.xmlbeans.SchemaType sType)
{
super(sType);
}
private static final javax.xml.namespace.QName ARRAYOFARRAYOFPROPAGATIONOWNERSHIPOPTIONS$0 =
new javax.xml.namespace.QName("http://schemas.microsoft.com/crm/2011/Contracts", "ArrayOfArrayOfPropagationOwnershipOptions");
/**
* Gets the "ArrayOfArrayOfPropagationOwnershipOptions" element
*/
public com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions getArrayOfArrayOfPropagationOwnershipOptions()
{
synchronized (monitor())
{
check_orphaned();
com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions target = null;
target = (com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions)get_store().find_element_user(ARRAYOFARRAYOFPROPAGATIONOWNERSHIPOPTIONS$0, 0);
if (target == null)
{
return null;
}
return target;
}
}
/**
* Tests for nil "ArrayOfArrayOfPropagationOwnershipOptions" element
*/
public boolean isNilArrayOfArrayOfPropagationOwnershipOptions()
{
synchronized (monitor())
{
check_orphaned();
com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions target = null;
target = (com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions)get_store().find_element_user(ARRAYOFARRAYOFPROPAGATIONOWNERSHIPOPTIONS$0, 0);
if (target == null) return false;
return target.isNil();
}
}
/**
* Sets the "ArrayOfArrayOfPropagationOwnershipOptions" element
*/
public void setArrayOfArrayOfPropagationOwnershipOptions(com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions arrayOfArrayOfPropagationOwnershipOptions)
{
generatedSetterHelperImpl(arrayOfArrayOfPropagationOwnershipOptions, ARRAYOFARRAYOFPROPAGATIONOWNERSHIPOPTIONS$0, 0, org.apache.xmlbeans.impl.values.XmlObjectBase.KIND_SETTERHELPER_SINGLETON);
}
/**
* Appends and returns a new empty "ArrayOfArrayOfPropagationOwnershipOptions" element
*/
public com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions addNewArrayOfArrayOfPropagationOwnershipOptions()
{
synchronized (monitor())
{
check_orphaned();
com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions target = null;
target = (com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions)get_store().add_element_user(ARRAYOFARRAYOFPROPAGATIONOWNERSHIPOPTIONS$0);
return target;
}
}
/**
* Nils the "ArrayOfArrayOfPropagationOwnershipOptions" element
*/
public void setNilArrayOfArrayOfPropagationOwnershipOptions()
{
synchronized (monitor())
{
check_orphaned();
com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions target = null;
target = (com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions)get_store().find_element_user(ARRAYOFARRAYOFPROPAGATIONOWNERSHIPOPTIONS$0, 0);
if (target == null)
{
target = (com.microsoft.schemas.crm._2011.contracts.ArrayOfArrayOfPropagationOwnershipOptions)get_store().add_element_user(ARRAYOFARRAYOFPROPAGATIONOWNERSHIPOPTIONS$0);
}
target.setNil();
}
}
}
| [
"dmytro.chmyga@synapse.com"
] | dmytro.chmyga@synapse.com |
c9778f366608d25288ab3b349020c40f4d22b52d | 8915f07e55d3e50ec1913d0189b491dd1c360982 | /plugin_tooling/src-lang/melnorme/lang/tooling/parser/lexer/CharacterLexingRule.java | 74ea0623e785d73b2569e96c5e3f999a6d80680e | [] | no_license | RustDT/RustDT | 6dc7e3585329a8b1b828ba29cc7c2c7c10fa4e43 | 62179ea8443fc0692b70fb678ea5e5d575be1dc1 | refs/heads/master | 2022-06-10T05:20:50.048145 | 2018-03-07T14:50:52 | 2018-03-07T14:50:52 | 30,254,331 | 455 | 89 | null | 2018-03-02T12:30:22 | 2015-02-03T17:08:55 | Java | UTF-8 | Java | false | false | 2,930 | java | /*******************************************************************************
* Copyright (c) 2015 Bruno Medeiros and other Contributors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Bruno Medeiros - initial API and implementation
*******************************************************************************/
package melnorme.lang.tooling.parser.lexer;
import melnorme.lang.utils.parse.ICharacterReader;
import melnorme.lang.utils.parse.LexingUtils;
public class CharacterLexingRule extends LexingUtils implements IPredicateLexingRule {
@Override
public boolean doEvaluate(ICharacterReader reader) {
if(!consumeStart(reader)) {
return false;
}
if(!consumeBody(reader)) {
return false;
}
if(!consumeEnd(reader)) {
return false;
}
return true;
}
protected boolean consumeStart(ICharacterReader reader) {
return reader.tryConsume('\'');
}
protected boolean consumeBody(ICharacterReader reader) {
if(reader.tryConsume((char) 0x5c)) {
return reader.tryConsume('\'') || reader.tryConsume('\"') ||
consumeCommonEscape(reader) || consumeUnicodeEscapeSequence(reader);
};
if(reader.lookaheadIsEOS() || reader.lookahead() == '\'') {
return false;
}
if(reader.lookahead() == 0) {
return false; // Should the null character really not be allowed?
}
return reader.consumeAny();
}
protected boolean consumeEnd(ICharacterReader reader) {
return reader.tryConsume('\'');
}
protected static char[] COMMON_ESCAPES = { 0x5c, 'n' , 'r' , 't' , '0' };
protected boolean consumeCommonEscape(ICharacterReader reader) {
for(char ch : COMMON_ESCAPES) {
if(reader.tryConsume(ch)) {
return true;
}
}
if(consumeHexEscapeSequence(reader)) {
return true;
}
return false;
}
protected boolean consumeHexEscapeSequence(ICharacterReader reader) {
if(reader.lookahead(0) == 'x'
&& isHexDigit(reader.lookahead(1)) && isHexDigit(reader.lookahead(2))) {
reader.consumeAmount(3);
return true;
}
return false;
}
protected boolean consumeUnicodeEscapeSequence(ICharacterReader reader) {
if(reader.tryConsume('u')) {
while(true) {
int la = reader.lookahead();
// This is not accurate to any spec, but is good enough.
if(la == '{' || la == '}' || isHexDigit(la)) {
reader.consume();
} else {
break;
}
}
return true;
}
return false;
}
public static boolean isHexDigit(int ch) {
if(ch >= '0' && ch <= '9') {
return true;
}
if((ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F')) {
return true;
}
return false;
}
} | [
"bruno.do.medeiros@gmail.com"
] | bruno.do.medeiros@gmail.com |
c1b61e531f9bbd83371b8adb47e146767732c3bd | af606a04ed291e8c9b1e500739106a926e205ee2 | /aliyun-java-sdk-unimkt/src/main/java/com/aliyuncs/unimkt/model/v20181212/DeleteRuleRequest.java | 4b32e3fb672d8e5053bd3d31402c64fbdc507059 | [
"Apache-2.0"
] | permissive | xtlGitHub/aliyun-openapi-java-sdk | a733f0a16c8cc493cc28062751290f563ab73ace | f60c71de2c9277932b6549c79631b0f03b11cc36 | refs/heads/master | 2023-09-03T13:56:50.071024 | 2021-11-10T11:53:25 | 2021-11-10T11:53:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,296 | java | /*
* 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.aliyuncs.unimkt.model.v20181212;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.unimkt.Endpoint;
/**
* @author auto create
* @version
*/
public class DeleteRuleRequest extends RpcAcsRequest<DeleteRuleResponse> {
private String messageKey;
private String adRule;
private String business;
private String message;
private String userId;
private String originSiteUserId;
private String environment;
private String appName;
private String tenantId;
private String userSite;
private String ruleId;
private String status;
public DeleteRuleRequest() {
super("UniMkt", "2018-12-12", "DeleteRule", "1.0.0");
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}
public String getMessageKey() {
return this.messageKey;
}
public void setMessageKey(String messageKey) {
this.messageKey = messageKey;
if(messageKey != null){
putQueryParameter("MessageKey", messageKey);
}
}
public String getAdRule() {
return this.adRule;
}
public void setAdRule(String adRule) {
this.adRule = adRule;
if(adRule != null){
putBodyParameter("AdRule", adRule);
}
}
public String getBusiness() {
return this.business;
}
public void setBusiness(String business) {
this.business = business;
if(business != null){
putQueryParameter("Business", business);
}
}
public String getMessage() {
return this.message;
}
public void setMessage(String message) {
this.message = message;
if(message != null){
putQueryParameter("Message", message);
}
}
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
if(userId != null){
putQueryParameter("UserId", userId);
}
}
public String getOriginSiteUserId() {
return this.originSiteUserId;
}
public void setOriginSiteUserId(String originSiteUserId) {
this.originSiteUserId = originSiteUserId;
if(originSiteUserId != null){
putQueryParameter("OriginSiteUserId", originSiteUserId);
}
}
public String getEnvironment() {
return this.environment;
}
public void setEnvironment(String environment) {
this.environment = environment;
if(environment != null){
putQueryParameter("Environment", environment);
}
}
public String getAppName() {
return this.appName;
}
public void setAppName(String appName) {
this.appName = appName;
if(appName != null){
putQueryParameter("AppName", appName);
}
}
public String getTenantId() {
return this.tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
if(tenantId != null){
putQueryParameter("TenantId", tenantId);
}
}
public String getUserSite() {
return this.userSite;
}
public void setUserSite(String userSite) {
this.userSite = userSite;
if(userSite != null){
putQueryParameter("UserSite", userSite);
}
}
public String getRuleId() {
return this.ruleId;
}
public void setRuleId(String ruleId) {
this.ruleId = ruleId;
if(ruleId != null){
putQueryParameter("RuleId", ruleId);
}
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
if(status != null){
putQueryParameter("Status", status);
}
}
@Override
public Class<DeleteRuleResponse> getResponseClass() {
return DeleteRuleResponse.class;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
43661bf5675bc5b835d925ae030d66907088270e | 1dff4b9816588af53eed89728d1aa46d189e8d9c | /PentahoDataTransferService/src/main/java/com/safasoft/pentaho/datatrans/src/dao/ApplMstKecamatanDAO.java | b58e9855cb0fbe08c6ff580a2ad7f3fb7882dab9 | [] | no_license | awaludinhamid/MobileSurveyRest | 0ee530ab426f337ec2ac4026d6f52e1925d449b0 | 1d7346de050682fe5785cd8d78cedee59fe05805 | refs/heads/master | 2021-07-05T17:16:10.500647 | 2017-09-29T07:44:42 | 2017-09-29T07:44:42 | 105,227,771 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 283 | java | package com.safasoft.pentaho.datatrans.src.dao;
import org.springframework.stereotype.Repository;
import com.safasoft.pentaho.datatrans.src.bean.ApplMstKecamatan;
@Repository("applMstKecamatanDAO")
public class ApplMstKecamatanDAO extends BaseDAO<ApplMstKecamatan> {
}
| [
"ahamid.dimaha@gmail.com"
] | ahamid.dimaha@gmail.com |
269686987042ef29f75bdfd8a936a62f0d5cfe8b | c577f5380b4799b4db54722749cc33f9346eacc1 | /BugSwarm/square-wire-44981818/buggy_files/wire-compiler/src/test/java/com/squareup/wire/logger/StringWireLogger.java | d914404b1b6949fe6d721eb01bdfb2ee654458e9 | [] | no_license | tdurieux/BugSwarm-dissection | 55db683fd95f071ff818f9ca5c7e79013744b27b | ee6b57cfef2119523a083e82d902a6024e0d995a | refs/heads/master | 2020-04-30T17:11:52.050337 | 2019-05-09T13:42:03 | 2019-05-09T13:42:03 | 176,972,414 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 803 | java | package com.squareup.wire.logger;
import com.squareup.wire.OutputArtifact;
/**
* Created by zundel on 12/23/14.
*/
public class StringWireLogger implements WireLogger {
private boolean isQuiet = false;
private StringBuilder buffer = new StringBuilder();
@Override
public void setQuiet(boolean isQuiet) {
this.isQuiet = isQuiet;
}
@Override public void error(String message) {
buffer.append(message);
buffer.append('\n');
}
@Override public void artifact(OutputArtifact artifact) {
buffer.append(artifact.getArtifactFile().toString());
buffer.append('\n');
}
@Override public void info(String message) {
if (!isQuiet) {
buffer.append(message);
buffer.append('\n');
}
}
public String getLog() {
return buffer.toString();
}
}
| [
"durieuxthomas@hotmail.com"
] | durieuxthomas@hotmail.com |
78b5163404df31ef908976c142a40873b58021bb | 2ebe6e87a7f96bbee2933103a4f43f46ea239996 | /src/main/java/com/xceptance/xlt/report/external/reportObject/Table.java | 6badb937fe12a9f6a1f532196626eb91bf4f33cc | [
"Apache-2.0",
"LGPL-2.0-or-later",
"BSD-3-Clause",
"EPL-1.0",
"CDDL-1.1",
"EPL-2.0",
"MPL-2.0",
"MIT",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Xceptance/XLT | b4351c915d8c66d918b02a6c71393a151988be46 | c6609f0cd9315217727d44b3166f705acc4da0b4 | refs/heads/develop | 2023-08-18T18:20:56.557477 | 2023-08-08T16:04:16 | 2023-08-08T16:04:16 | 237,251,821 | 56 | 12 | Apache-2.0 | 2023-09-01T14:52:25 | 2020-01-30T16:13:24 | Java | UTF-8 | Java | false | false | 3,362 | java | /*
* Copyright (c) 2005-2023 Xceptance Software Technologies GmbH
*
* 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.xceptance.xlt.report.external.reportObject;
import java.util.ArrayList;
import java.util.List;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* @author matthias.ullrich
*/
@XStreamAlias("table")
public class Table
{
@XStreamAlias("title")
private String title;
@XStreamAlias("headRow")
private Row headRow;
@XStreamAlias("bodyRows")
private List<Row> bodyRows;
@XStreamAlias("maxCols")
private int maxCols = -1;
/**
* Adds a body row to the end of the table.
*
* @param row
* the row to add
*/
public void addRow(final Row row)
{
if (row != null)
{
if (bodyRows == null)
{
bodyRows = new ArrayList<Row>();
}
bodyRows.add(row);
}
}
/**
* Sets all body rows at once.
*
* @param bodyRows
* the body rows
*/
public void setBodyRows(final List<Row> bodyRows)
{
this.bodyRows = bodyRows;
}
/**
* Returns all the body rows as a list.
*
* @return the body rows
*/
public List<Row> getBodyRows()
{
return bodyRows;
}
/**
* Sets the head row.
*
* @param row
* the head row
*/
public void setHeadRow(final Row row)
{
if (row != null)
{
headRow = row;
}
}
/**
* Returns the head row.
*
* @return the head row
*/
public Row getHeadRow()
{
return headRow;
}
/**
* Sets the table title.
*
* @param title
* the title
*/
public void setTitle(final String title)
{
this.title = title;
}
/**
* Returns the table title.
*
* @return the title
*/
public String getTitle()
{
return title;
}
/**
* Returns the highest cell count in all the table rows.
*
* @return highest cell count in table rows
*/
public int getMaxCols()
{
int maxCols_tmp = 0;
if (headRow != null)
{
maxCols_tmp = Math.max(headRow.size(), maxCols_tmp);
}
if (bodyRows != null)
{
for (final Row row : bodyRows)
{
maxCols_tmp = Math.max(row.size(), maxCols_tmp);
}
}
return maxCols_tmp;
}
/**
* Call this method when table building is finished. Will internally store the highest cell count in all the table
* rows.
*/
public void finish()
{
if (maxCols < 0)
{
maxCols = getMaxCols();
}
}
}
| [
"4639399+jowerner@users.noreply.github.com"
] | 4639399+jowerner@users.noreply.github.com |
c6a83c298d8e5f37807af5818f66b51b291664db | dba87418d2286ce141d81deb947305a0eaf9824f | /sources/com/google/android/gms/measurement/AppMeasurementJobService.java | 513886329bbbd9dc64cce0f762ff0c11fceea3d0 | [] | no_license | Sluckson/copyOavct | 1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6 | d20597e14411e8607d1d6e93b632d0cd2e8af8cb | refs/heads/main | 2023-03-09T12:14:38.824373 | 2021-02-26T01:38:16 | 2021-02-26T01:38:16 | 341,292,450 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,647 | java | package com.google.android.gms.measurement;
import android.annotation.TargetApi;
import android.app.job.JobParameters;
import android.app.job.JobService;
import android.content.Intent;
import androidx.annotation.MainThread;
import com.google.android.gms.measurement.internal.zzju;
import com.google.android.gms.measurement.internal.zzjy;
@TargetApi(24)
/* compiled from: com.google.android.gms:play-services-measurement@@17.5.0 */
public final class AppMeasurementJobService extends JobService implements zzjy {
private zzju<AppMeasurementJobService> zza;
private final zzju<AppMeasurementJobService> zza() {
if (this.zza == null) {
this.zza = new zzju<>(this);
}
return this.zza;
}
public final boolean onStopJob(JobParameters jobParameters) {
return false;
}
public final void zza(Intent intent) {
}
@MainThread
public final void onCreate() {
super.onCreate();
zza().zza();
}
@MainThread
public final void onDestroy() {
zza().zzb();
super.onDestroy();
}
public final boolean onStartJob(JobParameters jobParameters) {
return zza().zza(jobParameters);
}
@MainThread
public final boolean onUnbind(Intent intent) {
return zza().zzb(intent);
}
@MainThread
public final void onRebind(Intent intent) {
zza().zzc(intent);
}
public final boolean zza(int i) {
throw new UnsupportedOperationException();
}
@TargetApi(24)
public final void zza(JobParameters jobParameters, boolean z) {
jobFinished(jobParameters, false);
}
}
| [
"lucksonsurprice94@gmail.com"
] | lucksonsurprice94@gmail.com |
adf6386b8293224315d904bff10fc79df700473c | ce3894dbbfbb6ce0e932361ac8af1b9a5ab55997 | /app/src/main/java/com/kk/taurus/avplayer/cover/CompleteCover.java | 67fdf05cf7a32ce5d1bcc7477ac8927b6ec89a10 | [
"Apache-2.0"
] | permissive | taoism-o/PlayerBase | d217098273024a764947b7888001b8aa7fc2d878 | 63de0704b71e719d69ddf54d6429d99bde55709c | refs/heads/master | 2020-03-21T12:53:26.983500 | 2018-06-20T07:13:56 | 2018-06-20T07:13:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,514 | java | /*
* Copyright 2017 jiajunhui<junhui_jia@163.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kk.taurus.avplayer.cover;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.kk.taurus.avplayer.R;
import com.kk.taurus.avplayer.play.DataInter;
import com.kk.taurus.playerbase.event.OnPlayerEventListener;
import com.kk.taurus.playerbase.player.IPlayer;
import com.kk.taurus.playerbase.receiver.BaseCover;
import com.kk.taurus.playerbase.receiver.ICover;
import com.kk.taurus.playerbase.receiver.IReceiverGroup;
import com.kk.taurus.playerbase.receiver.PlayerStateGetter;
/**
* Created by Taurus on 2018/4/20.
*/
public class CompleteCover extends BaseCover {
private TextView mReplay;
private TextView mNext;
public CompleteCover(Context context) {
super(context);
}
@Override
public void onReceiverBind() {
super.onReceiverBind();
mReplay = findViewById(R.id.tv_replay);
mNext = findViewById(R.id.tv_next);
mReplay.setOnClickListener(mOnClickListener);
mNext.setOnClickListener(mOnClickListener);
setNextState(false);
getGroupValue().registerOnGroupValueUpdateListener(mOnGroupValueUpdateListener);
}
@Override
protected void onCoverAttachedToWindow() {
super.onCoverAttachedToWindow();
if(getGroupValue().getBoolean(DataInter.Key.KEY_COMPLETE_SHOW)){
setPlayCompleteState(true);
}
}
@Override
protected void onCoverDetachedToWindow() {
super.onCoverDetachedToWindow();
setCoverVisibility(View.GONE);
}
@Override
public void onReceiverUnBind() {
super.onReceiverUnBind();
getGroupValue().unregisterOnGroupValueUpdateListener(mOnGroupValueUpdateListener);
}
private IReceiverGroup.OnGroupValueUpdateListener mOnGroupValueUpdateListener =
new IReceiverGroup.OnGroupValueUpdateListener() {
@Override
public String[] filterKeys() {
return new String[]{DataInter.Key.KEY_IS_HAS_NEXT};
}
@Override
public void onValueUpdate(String key, Object value) {
if(key.equals(DataInter.Key.KEY_IS_HAS_NEXT)){
setNextState((Boolean) value);
}
}
};
private View.OnClickListener mOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.tv_replay:
requestReplay(null);
break;
case R.id.tv_next:
notifyReceiverEvent(DataInter.Event.EVENT_CODE_REQUEST_NEXT, null);
break;
}
setPlayCompleteState(false);
}
};
private void setNextState(boolean state){
mNext.setVisibility(state?View.VISIBLE:View.GONE);
}
private void setPlayCompleteState(boolean state){
setCoverVisibility(state?View.VISIBLE:View.GONE);
getGroupValue().putBoolean(DataInter.Key.KEY_COMPLETE_SHOW, state);
}
@Override
public void onPlayerEvent(int eventCode, Bundle bundle) {
switch (eventCode){
case OnPlayerEventListener.PLAYER_EVENT_ON_DATA_SOURCE_SET:
setPlayCompleteState(false);
break;
case OnPlayerEventListener.PLAYER_EVENT_ON_PLAY_COMPLETE:
setPlayCompleteState(true);
break;
}
}
@Override
public void onErrorEvent(int eventCode, Bundle bundle) {
}
@Override
public void onReceiverEvent(int eventCode, Bundle bundle) {
}
@Override
public View onCreateCoverView(Context context) {
return View.inflate(context, R.layout.layout_complete_cover, null);
}
@Override
public int getCoverLevel() {
return ICover.COVER_LEVEL_MEDIUM;
}
}
| [
"309812983@qq.com"
] | 309812983@qq.com |
5d06f73afc365a6a725ca2213d00c1da65741071 | 6d8cb7dd55e817e896fe4efc4f383fd7423109c9 | /TestSpringEvent/src/main/java/实例一/EmailEvent.java | 63ddb87f7051e8892de8dd8fb2024d2d6b2e4fe1 | [] | no_license | xujunmeng/Test-Project-master | 4ae66a27d849d495c116a97a52046053cdb31c82 | 92787bfb1c276658b3098085ae4670130ec8ab2d | refs/heads/master | 2022-12-21T20:16:52.328399 | 2020-07-23T06:33:27 | 2020-07-23T06:33:27 | 124,840,814 | 0 | 0 | null | 2022-12-16T05:32:53 | 2018-03-12T06:01:29 | Java | UTF-8 | Java | false | false | 712 | java | package 实例一;
import org.springframework.context.ApplicationEvent;
/**
* Created by james on 2017/7/7.
*/
public class EmailEvent extends ApplicationEvent {
private String address;
private String text;
public EmailEvent(Object source) {
super(source);
}
public EmailEvent(String address, String text) {
super(address);
this.address = address;
this.text = text;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
| [
"xujunmeng2012@163.com"
] | xujunmeng2012@163.com |
e2fe170762fb54331c38f0a4e66a506ea13fbe1c | 5cfaeebdc7c50ca23ee368fa372d48ed1452dfeb | /xd-ucenter-model2b/src/main/java/com/xiaodou/userCenter/module/selfTaught/response/StUserInfoResponse.java | 0fd1cf3c45e4e969e16825f46e906e54c687fd4f | [] | no_license | zdhuangelephant/xd_pro | c8c8ff6dfcfb55aead733884909527389e2c8283 | 5611b036968edfff0b0b4f04f0c36968333b2c3b | refs/heads/master | 2022-12-23T16:57:28.306580 | 2019-12-05T06:05:43 | 2019-12-05T06:05:43 | 226,020,526 | 0 | 2 | null | 2022-12-16T02:23:20 | 2019-12-05T05:06:27 | JavaScript | UTF-8 | Java | false | false | 6,219 | java | package com.xiaodou.userCenter.module.selfTaught.response;
import java.util.List;
import com.alibaba.fastjson.TypeReference;
import com.google.common.collect.Lists;
import com.xiaodou.common.annotation.ShowField;
import com.xiaodou.common.util.StringUtils;
import com.xiaodou.common.util.warp.FastJsonUtil;
import com.xiaodou.userCenter.module.selfTaught.model.StOfficialInfo;
import com.xiaodou.userCenter.module.selfTaught.model.StUserInfo;
import com.xiaodou.userCenter.module.selfTaught.model.StUserInfo.StMedal;
import com.xiaodou.userCenter.response.BaseUserModel;
/**
* @description 小逗自考用户响应信息
* @version 1.0
* @waste
*/
public class StUserInfoResponse extends BaseUserModel {
public StUserInfoResponse() {}
@ShowField
private String major = StringUtils.EMPTY;// 用户已选专业专业(typeCode)
@ShowField
private String sign = StringUtils.EMPTY; // 签名
@ShowField
private List<String> picList = Lists.newArrayList();// 图片
@ShowField
private String medalId = StringUtils.EMPTY;// 勋章id
@ShowField
private String medalName = StringUtils.EMPTY;// 勋章名称
@ShowField
private String medalImg = StringUtils.EMPTY;// 勋章图片
/* 导入用户数据 start */
@ShowField
private String realName = StringUtils.EMPTY;// 真实姓名
@ShowField
private String officialGender = StringUtils.EMPTY;// 官方导入性别
@ShowField
private String identificationCardCode = StringUtils.EMPTY;// 身份证号
@ShowField
private String admissionCardCode = StringUtils.EMPTY; // 准考证号
@ShowField
private String majorName = StringUtils.EMPTY; // 专业名称
@ShowField
private String degreeLevel = StringUtils.EMPTY; // 学习层次
@ShowField
private String merchant = StringUtils.EMPTY; // 学习机构
/* 导入用户数据 end */
public String getMajor() {
return major;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getOfficialGender() {
return officialGender;
}
public void setOfficialGender(String officialGender) {
this.officialGender = officialGender;
}
public void setMajor(String major) {
this.major = major;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getMedalId() {
return medalId;
}
public void setMedalId(String medalId) {
this.medalId = medalId;
}
public String getMedalName() {
return medalName;
}
public void setMedalName(String medalName) {
this.medalName = medalName;
}
public List<String> getPicList() {
return picList;
}
public void setPicList(List<String> picList) {
this.picList = picList;
}
public String getMedalImg() {
return medalImg;
}
public void setMedalImg(String medalImg) {
this.medalImg = medalImg;
}
public String getIdentificationCardCode() {
return identificationCardCode;
}
public void setIdentificationCardCode(String identificationCardCode) {
this.identificationCardCode = identificationCardCode;
}
public String getAdmissionCardCode() {
return admissionCardCode;
}
public void setAdmissionCardCode(String admissionCardCode) {
this.admissionCardCode = admissionCardCode;
}
public String getMajorName() {
return majorName;
}
public void setMajorName(String majorName) {
this.majorName = majorName;
}
public String getDegreeLevel() {
return degreeLevel;
}
public void setDegreeLevel(String degreeLevel) {
this.degreeLevel = degreeLevel;
}
public String getMerchant() {
return merchant;
}
public void setMerchant(String merchant) {
this.merchant = merchant;
}
@Override
public void initModuleInfo(String moduleInfo) {
if (StringUtils.isJsonNotBlank(moduleInfo)) {
StUserInfo userInfo = FastJsonUtil.fromJson(moduleInfo, StUserInfo.class);
if (null != userInfo) {
if (StringUtils.isNotBlank(userInfo.getMajor())) major = userInfo.getMajor();
if (StringUtils.isNotBlank(userInfo.getSign())) sign = userInfo.getSign(); // 签名
if (StringUtils.isNotBlank(userInfo.getMedal())) {// 勋章
StMedal stMedal = FastJsonUtil.fromJson(userInfo.getMedal(), StMedal.class);
medalId = stMedal.getMedalId();
medalName = stMedal.getMedalName();
medalImg = stMedal.getMedalImg();
}
if (StringUtils.isNotBlank(userInfo.getPicList()))
picList =
FastJsonUtil.fromJsons(userInfo.getPicList(), new TypeReference<List<String>>() {});// 图片
}
}
}
@Override
public boolean checkInfo() {
if (StringUtils.isNotBlank(major)) return true;
return false;
}
@Override
protected void initOfficialInfo(String officialInfo) {
if (StringUtils.isJsonNotBlank(officialInfo)) {
StOfficialInfo stOfficialInfo = FastJsonUtil.fromJson(officialInfo, StOfficialInfo.class);
if (null != stOfficialInfo) {
if (StringUtils.isNotBlank(stOfficialInfo.getIdentificationCardCode()))
identificationCardCode = stOfficialInfo.getIdentificationCardCode();
if (StringUtils.isNotBlank(stOfficialInfo.getAdmissionCardCode()))
admissionCardCode = stOfficialInfo.getAdmissionCardCode();
if (StringUtils.isNotBlank(stOfficialInfo.getMajorName()))
majorName = stOfficialInfo.getMajorName();
if (StringUtils.isNotBlank(stOfficialInfo.getDegreeLevel()))
degreeLevel = stOfficialInfo.getDegreeLevel();
if (StringUtils.isNotBlank(stOfficialInfo.getMerchant()))
merchant = stOfficialInfo.getMerchant();
if (StringUtils.isNotBlank(stOfficialInfo.getRealName()))
realName = stOfficialInfo.getRealName();
if (StringUtils.isNotBlank(stOfficialInfo.getOfficialGender()))
officialGender = stOfficialInfo.getOfficialGender();
}
}
}
}
| [
"zedong.huang@bitmain.com"
] | zedong.huang@bitmain.com |
d40cb895b1b632921a6f50bce0523467f0bd129f | a66a4d91639836e97637790b28b0632ba8d0a4f9 | /src/generators/generatorframe/view/ButtonPanel.java | 4acf1c963aa732ce112b3fa602fe680539843eda | [] | no_license | roessling/animal-av | 7d0ba53dda899b052a6ed19992fbdfbbc62cf1c9 | 043110cadf91757b984747750aa61924a869819f | refs/heads/master | 2021-07-13T05:31:42.223775 | 2020-02-26T14:47:31 | 2020-02-26T14:47:31 | 206,062,707 | 0 | 2 | null | 2020-10-13T15:46:14 | 2019-09-03T11:37:11 | Java | UTF-8 | Java | false | false | 5,083 | java | package generators.generatorframe.view;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import generators.generatorframe.view.image.GetIcon;
import javax.swing.AbstractButton;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import translator.TranslatableGUIElement;
public class ButtonPanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
// private TranslatableGUIElement trans;
// new global variables
private AbstractButton b;
private AbstractButton f;
// private int zoomCounter = 0;
public ButtonPanel(String back, String forward,
TranslatableGUIElement trans) {
super();
super.setLayout(new BorderLayout());
super.setBackground(Color.WHITE);
// this.trans = trans;
GetIcon get = new GetIcon();
if (back.compareTo("") != 0) {
final AbstractButton backB = trans.generateJButton(back);
backB.setIcon(get.createBackIcon(false));
backB.setName(back);
backB.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 10));
backB.setPreferredSize(new Dimension(118, 30));
backB.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
goToTab(backB.getName());
}
});
b = backB;
super.add(backB, BorderLayout.WEST);
}
if (forward.compareTo("") != 0) {
final AbstractButton forwardB = trans.generateJButton(forward);
forwardB.setName(forward);
forwardB.setIcon(get.createForwardIcon(false));
forwardB.setHorizontalTextPosition(SwingConstants.LEFT);
forwardB.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 10));
forwardB.setPreferredSize(new Dimension(118, 30));
forwardB.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
goToTab(forwardB.getName());
}
});
f = forwardB;
super.add(forwardB, BorderLayout.EAST);
}
}
public void goToTab(String name) {
Component parent = getParent();
while (!(parent instanceof AlgoTabPanel))
parent = parent.getParent();
((AlgoTabPanel) parent).setTab(name);
}
/**
* zooms the buttons
*
* @param zoomIn
* if true zooms in, if flase zooms out
*/
public void zoom(boolean zoomIn, int zoomCounter ) {
Font f1;
Font f2;
Dimension dim;
if (b != null) {
f1 = b.getFont();
dim = b.getSize();
if (zoomIn) {
if (f1.getSize() < 24)
f1 = new Font(f1.getName(), f1.getStyle(), f1.getSize() + 2);
if (dim.getWidth() < 198)
dim.setSize(dim.getWidth() + 15, dim.getHeight() + 5);
} else {
if (f1.getSize() > 10)
f1 = new Font(f1.getName(), f1.getStyle(), f1.getSize() - 2);
if (dim.getWidth() > 118)
dim.setSize(dim.getWidth() - 15, dim.getHeight() - 5);
}
b.setFont(f1);
if (dim.getWidth() < 118 + zoomCounter * 15)
dim.setSize(118 + zoomCounter * 15, dim.getHeight());
if (dim.getHeight() < 30 + zoomCounter * 5)
dim.setSize(dim.getWidth(), 30 + zoomCounter * 5);
b.setPreferredSize(dim);
b.setSize(dim);
}
if (f != null) {
f2 = f.getFont();
dim = f.getSize();
if (zoomIn) {
if (f2.getSize() < 24)
f2 = new Font(f2.getName(), f2.getStyle(), f2.getSize() + 2);
if (dim.getWidth() < 198)
dim.setSize(dim.getWidth() + 15, dim.getHeight() + 5);
} else {
if (f2.getSize() > 10)
f2 = new Font(f2.getName(), f2.getStyle(), f2.getSize() - 2);
if (dim.getWidth() > 118)
dim.setSize(dim.getWidth() - 15, dim.getHeight() - 5);
}
f.setFont(f2);
if (dim.getWidth() < 118 + zoomCounter * 15)
dim.setSize(118 + zoomCounter * 15, dim.getHeight());
if (dim.getHeight() < 30 + zoomCounter * 5)
dim.setSize(dim.getWidth(), 30 + zoomCounter * 5);
f.setPreferredSize(dim);
f.setSize(dim);
}
dim = this.getSize();
if (zoomIn) {
if (dim.getWidth() <= 1000) {
dim.setSize(dim.getWidth() + 20, dim.getHeight() + 20);
}
} else {
if (dim.getWidth() >= 700) {
dim.setSize(dim.getWidth() - 20, dim.getHeight() - 20);
}
}
if (dim.getWidth() < 636 + zoomCounter * 20)
dim.setSize(636 + zoomCounter * 20, dim.getHeight());
if (dim.getHeight() < 30 + zoomCounter * 20)
dim.setSize(dim.getWidth(), 30 + zoomCounter * 20);
this.setSize(dim);
// this.repaint();
}
}
| [
"guido@tk.informatik.tu-darmstadt.de"
] | guido@tk.informatik.tu-darmstadt.de |
5f3ab1108b9c5d5acb38f7f030fbbf750e01eb34 | ec9fbee3cd6fc119c1d15f5649aa30ef36280460 | /src/main/java/com/vnext/w15jdk8/lambda/FilterEmployeeForAge.java | 2df00e9219f346e062cb38746e4d5aaa29cafc8b | [] | no_license | leochn/javaBase | 3e6709ea6520801ac8385de96678657c51ea222d | 458a37a28886166145c257c755e26ca4b676bad9 | refs/heads/master | 2023-07-27T03:43:28.758274 | 2020-09-18T02:48:40 | 2020-09-18T02:48:40 | 120,416,776 | 1 | 0 | null | 2023-07-16T14:52:43 | 2018-02-06T07:18:39 | Java | UTF-8 | Java | false | false | 265 | java | package com.vnext.w15jdk8.lambda;
/**
* @author leo
* @version 2018/2/26 22:11
* @since 1.0.0
*/
public class FilterEmployeeForAge implements MyPredicate<Employee>{
@Override
public boolean test(Employee t) {
return t.getAge() <= 35;
}
}
| [
"appchn@163.com"
] | appchn@163.com |
71df96d4bfbf8e309e30d2b68f2713d7fec47306 | 437fa87a34a5521291ce650d046601dbf8d88c5e | /com/dark/rs2/content/stoneRing.java | 839d3e66b62d10eb904ba1e620e75ae716d3271d | [] | no_license | royalsora/src | f42fe699785bb6a31f3d491d39da260e82bb069d | 6f86d9a4e69745c92e05033f8d969ff53d653b96 | refs/heads/Branch1 | 2020-06-15T11:52:11.160779 | 2016-11-27T19:45:13 | 2016-11-27T19:45:13 | 75,297,238 | 0 | 0 | null | 2016-12-01T13:54:35 | 2016-12-01T13:54:34 | null | UTF-8 | Java | false | false | 4,297 | java | package com.dark.rs2.content;
import com.dark.core.util.Utility;
import com.dark.rs2.content.combat.Combat.CombatTypes;
import com.dark.rs2.entity.Entity;
import com.dark.rs2.entity.Location;
import com.dark.rs2.entity.player.Player;
import com.dark.rs2.entity.player.PlayerConstants;
import com.dark.rs2.entity.player.controllers.Controller;
import com.dark.rs2.entity.player.controllers.ControllerManager;
import com.dark.rs2.entity.player.net.out.impl.SendMessage;
import com.dark.rs2.entity.player.net.out.impl.SendSidebarInterface;
public class stoneRing {
public static class StoneRingController extends Controller {
@Override
public boolean allowMultiSpells() {
return false;
}
@Override
public boolean allowPvPCombat() {
return false;
}
@Override
public boolean canAttackNPC() {
return false;
}
@Override
public boolean canAttackPlayer(Player p, Player p2) {
return false;
}
@Override
public boolean canClick() {
return false;
}
@Override
public boolean canDrink(Player p) {
return false;
}
@Override
public boolean canEat(Player p) {
return false;
}
@Override
public boolean canEquip(Player p, int id, int slot) {
return false;
}
@Override
public boolean canLogOut() {
return false;
}
@Override
public boolean canMove(Player p) {
return false;
}
@Override
public boolean canSave() {
return false;
}
@Override
public boolean canTalk() {
return true;
}
@Override
public boolean canTeleport() {
return false;
}
@Override
public boolean canTrade() {
return false;
}
@Override
public boolean canUseCombatType(Player p, CombatTypes type) {
return false;
}
@Override
public boolean canUsePrayer(Player p, int id) {
return false;
}
@Override
public boolean canUseSpecialAttack(Player p) {
return false;
}
@Override
public Location getRespawnLocation(Player player) {
return PlayerConstants.HOME;
}
@Override
public boolean isSafe(Player player) {
return false;
}
@Override
public void onControllerInit(Player p) {
}
@Override
public void onDeath(Player p) {
}
@Override
public void onDisconnect(Player p) {
}
@Override
public void onTeleport(Player p) {
}
@Override
public void tick(Player p) {
}
@Override
public String toString() {
return "Easter ring";
}
@Override
public boolean transitionOnWalk(Player p) {
return true;
}
@Override
public void onKill(Player player, Entity killed) {
}
@Override
public boolean canUnequip(Player player) {
return true;
}
@Override
public boolean canDrop(Player player) {
return false;
}
}
public static final int EASTER_RING_ID = 6583;
public static final int UNMORPH_INTERFACE_ID = 6014;
public static final Controller STONE_RING_CONTROLLER = new StoneRingController();
public static final int[] EGG_IDS = { 2188 };
public static void cancel(Player player) {
player.setController(ControllerManager.DEFAULT_CONTROLLER);
player.setNpcAppearanceId((short) -1);
player.setAppearanceUpdateRequired(true);
int[] tabs = (int[]) player.getAttributes().get("tabs");
for (int i = 0; i < tabs.length; i++) {
player.getClient().queueOutgoingPacket(new SendSidebarInterface(i, tabs[i]));
}
player.getClient().queueOutgoingPacket(new SendMessage("You morph back into a human."));
}
public static final boolean canEquip(Player player) {
if (!player.getController().equals(ControllerManager.DEFAULT_CONTROLLER)) {
player.getClient().queueOutgoingPacket(new SendMessage("You cannot do this here."));
return false;
}
return true;
}
public static void init(Player player) {
player.setNpcAppearanceId((short) EGG_IDS[Utility.randomNumber(EGG_IDS.length)]);
player.setController(STONE_RING_CONTROLLER);
player.getMovementHandler().reset();
int[] tabs = player.getInterfaceManager().getTabs().clone();
player.getAttributes().set("tabs", tabs);
for (int i = 0; i < tabs.length; i++) {
player.getClient().queueOutgoingPacket(new SendSidebarInterface(i, -1));
}
player.getClient().queueOutgoingPacket(new SendSidebarInterface(3, 6014));
player.getClient().queueOutgoingPacket(new SendMessage("You morph into an Easter egg."));
}
}
| [
"woofacebook@live.com"
] | woofacebook@live.com |
6b12486b6cf89b8ed779b585390ce1e34aabfa56 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /dt-oc-info-20220829/src/main/java/com/aliyun/dt_oc_info20220829/models/GetOcIcInvestmentResponse.java | f272add53ac605891a648ef321b3346c8abeaca8 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 1,394 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.dt_oc_info20220829.models;
import com.aliyun.tea.*;
public class GetOcIcInvestmentResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("statusCode")
@Validation(required = true)
public Integer statusCode;
@NameInMap("body")
@Validation(required = true)
public GetOcIcInvestmentResponseBody body;
public static GetOcIcInvestmentResponse build(java.util.Map<String, ?> map) throws Exception {
GetOcIcInvestmentResponse self = new GetOcIcInvestmentResponse();
return TeaModel.build(map, self);
}
public GetOcIcInvestmentResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public GetOcIcInvestmentResponse setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
return this;
}
public Integer getStatusCode() {
return this.statusCode;
}
public GetOcIcInvestmentResponse setBody(GetOcIcInvestmentResponseBody body) {
this.body = body;
return this;
}
public GetOcIcInvestmentResponseBody getBody() {
return this.body;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
4e5f1b471997a6a40ecff5edb96d54158ade817f | 6b1bd439c4146dc2545cb53e0ee612f7393b7c89 | /movie-store/src/main/java/org/movie/store/MovieStoreApplication.java | 926f1ea5fc46cd785a295a95151c090b89472c7f | [] | no_license | krishh13/CustomerPortal | 939caeb886f6829508d190a744b4448d69d88c7e | acfc465dd3eaef22b9af24fef92f917ce000bb76 | refs/heads/master | 2020-04-04T06:53:06.424976 | 2018-11-01T18:55:29 | 2018-11-01T18:55:29 | 155,760,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,222 | java | package org.movie.store;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//@EnableAutoConfiguration
// @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class,
// HibernateJpaAutoConfiguration.class })
@SpringBootApplication
@EnableWebMvc
// @EnableJpaRepositories(basePackages = "org.movie.store.repository")
public class MovieStoreApplication {
public static void main(String[] args) {
SpringApplication.run(MovieStoreApplication.class, args);
}
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurerAdapter() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("http://localhost:8080");
// registry.addMapping("/**").allowedOrigins("*"); // allows all
// origins
}
};
}
} | [
"reddygari.saikrishna@gmail.com"
] | reddygari.saikrishna@gmail.com |
2675c54713b946e3ccffedbf0ed1f65ba43f297a | efbdcde9dbd2338f5a2a01a476b0abb06d8e993d | /src/main/java/com/springboot/angular/service/dto/AdminUserDTO.java | 89f9a28b1cb8aac35651ac09d94fb418a8f12d6e | [] | no_license | MahmoudAbdulaziz1/springboot-angular | d7dc8a4e79c950fcae28ebfd0c6f41f0aca66467 | 03de2343c7892080928dfb3ccbe2221f79971522 | refs/heads/main | 2023-05-14T09:37:00.949680 | 2021-06-08T21:28:11 | 2021-06-08T21:28:11 | 375,149,797 | 0 | 0 | null | 2021-06-08T21:35:40 | 2021-06-08T21:27:44 | Java | UTF-8 | Java | false | false | 4,563 | java | package com.springboot.angular.service.dto;
import com.springboot.angular.config.Constants;
import com.springboot.angular.domain.Authority;
import com.springboot.angular.domain.User;
import java.time.Instant;
import java.util.Set;
import java.util.stream.Collectors;
import javax.validation.constraints.*;
/**
* A DTO representing a user, with his authorities.
*/
public class AdminUserDTO {
private Long id;
@NotBlank
@Pattern(regexp = Constants.LOGIN_REGEX)
@Size(min = 1, max = 50)
private String login;
@Size(max = 50)
private String firstName;
@Size(max = 50)
private String lastName;
@Email
@Size(min = 5, max = 254)
private String email;
@Size(max = 256)
private String imageUrl;
private boolean activated = false;
@Size(min = 2, max = 10)
private String langKey;
private String createdBy;
private Instant createdDate;
private String lastModifiedBy;
private Instant lastModifiedDate;
private Set<String> authorities;
public AdminUserDTO() {
// Empty constructor needed for Jackson.
}
public AdminUserDTO(User user) {
this.id = user.getId();
this.login = user.getLogin();
this.firstName = user.getFirstName();
this.lastName = user.getLastName();
this.email = user.getEmail();
this.activated = user.isActivated();
this.imageUrl = user.getImageUrl();
this.langKey = user.getLangKey();
this.createdBy = user.getCreatedBy();
this.createdDate = user.getCreatedDate();
this.lastModifiedBy = user.getLastModifiedBy();
this.lastModifiedDate = user.getLastModifiedDate();
this.authorities = user.getAuthorities().stream().map(Authority::getName).collect(Collectors.toSet());
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getImageUrl() {
return imageUrl;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public boolean isActivated() {
return activated;
}
public void setActivated(boolean activated) {
this.activated = activated;
}
public String getLangKey() {
return langKey;
}
public void setLangKey(String langKey) {
this.langKey = langKey;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Instant getCreatedDate() {
return createdDate;
}
public void setCreatedDate(Instant createdDate) {
this.createdDate = createdDate;
}
public String getLastModifiedBy() {
return lastModifiedBy;
}
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
public Instant getLastModifiedDate() {
return lastModifiedDate;
}
public void setLastModifiedDate(Instant lastModifiedDate) {
this.lastModifiedDate = lastModifiedDate;
}
public Set<String> getAuthorities() {
return authorities;
}
public void setAuthorities(Set<String> authorities) {
this.authorities = authorities;
}
// prettier-ignore
@Override
public String toString() {
return "AdminUserDTO{" +
"login='" + login + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", email='" + email + '\'' +
", imageUrl='" + imageUrl + '\'' +
", activated=" + activated +
", langKey='" + langKey + '\'' +
", createdBy=" + createdBy +
", createdDate=" + createdDate +
", lastModifiedBy='" + lastModifiedBy + '\'' +
", lastModifiedDate=" + lastModifiedDate +
", authorities=" + authorities +
"}";
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
2a9425203272545078d22d3573cf1dedaadd3ee4 | 58e8e71ed9bae0a61267d0b782a32f5bf8b8a171 | /backend/insurance-checkout-api/src/main/java/com/lambdasys/insurance/checkout/listener/PaymentPaidListener.java | bb47669ddc7357f53b0f9a8912b99215f983fb39 | [] | no_license | leoluzh/insurance | 8236bbdd80776f131fdbed81a1bfc40adcb45e09 | c56bb9997eafa47d38f9f47a638268d513a695dc | refs/heads/master | 2023-04-13T17:23:31.277067 | 2021-04-30T03:46:27 | 2021-04-30T03:46:27 | 362,990,708 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | package com.lambdasys.insurance.checkout.listener;
import com.lambdasys.insurance.checkout.entity.CheckoutEntity;
import com.lambdasys.insurance.checkout.service.CheckoutService;
import com.lambdasys.insurance.checkout.streaming.PaymentPaidSink;
import com.hatanaka.ecommerce.payment.event.PaymentCreatedEvent;
import lombok.RequiredArgsConstructor;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;
@Component
@RequiredArgsConstructor
public class PaymentPaidListener {
private final CheckoutService checkoutService;
@StreamListener(PaymentPaidSink.INPUT)
public void handler(PaymentCreatedEvent paymentCreatedEvent) {
checkoutService.updateStatus(paymentCreatedEvent.getCheckoutCode().toString(), CheckoutEntity.Status.APPROVED);
}
}
| [
"leonardo.l.fernandes@gmail.com"
] | leonardo.l.fernandes@gmail.com |
5eb91a29ab15569f69ab6029c46ac0a940051693 | d16f17f3b9d0aa12c240d01902a41adba20fad12 | /src/leetcode/leetcode21xx/leetcode2144/Solution.java | cbb14d9b31db2e5e79f957d6251d2c0f0e957dae | [] | no_license | redsun9/leetcode | 79f9293b88723d2fd123d9e10977b685d19b2505 | 67d6c16a1b4098277af458849d352b47410518ee | refs/heads/master | 2023-06-23T19:37:42.719681 | 2023-06-09T21:11:39 | 2023-06-09T21:11:39 | 242,967,296 | 38 | 3 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package leetcode.leetcode21xx.leetcode2144;
import java.util.Arrays;
public class Solution {
public int minimumCost(int[] cost) {
Arrays.sort(cost);
int ans = 0;
for (int j : cost) ans += j;
for (int i = cost.length - 3; i >= 0; i -= 3) ans -= cost[i];
return ans;
}
}
| [
"mokeev.vladimir@gmail.com"
] | mokeev.vladimir@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.