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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df673ceb45175b641429fcbbfa9fa7cd9c141a27 | 5cd2ff397ace4a77f9c078ca1ed54f059738ddac | /app/src/main/java/com/tjut/mianliao/data/cache/CacheBannerInfo.java | c9faf2721e3d88c4f9894c354f1daf21efcfaf04 | [] | no_license | wongainia/Mianliao2 | 31025ce77c68775741ff4ad504a3c3d82450762a | d1a999b990816a5a5a747ad31d7c2eea1ffa7d0d | refs/heads/master | 2022-01-10T20:58:21.758730 | 2019-05-14T22:35:31 | 2019-05-14T22:35:31 | 186,710,163 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 519 | java | package com.tjut.mianliao.data.cache;
import com.tjut.mianliao.data.BannerInfo;
public class CacheBannerInfo extends BannerInfo{
public static final String TABLE_NAME = "cache_banner_info";
public static final String _ID = "_id";
public static final String PLATE = "plate";
public static final String ID = "id";
public static final String IMAGE = "image";
// BannerData
public static final String TYPE = "type";
public static final String DATA = "data";
public int _id ;
}
| [
"dengyuanming@dengyuanming"
] | dengyuanming@dengyuanming |
4265fa63b662bcf904c7f20a9a2f4db85401f057 | c1bb1bb5ffeb28f21e3854c3e3e5ebf6d3894c21 | /01-策略模式-SimuDuck/src/cn/vincent/test/MiniDuckSimulator.java | 0c069a86b1efcaba068f011520e253de81e50db7 | [] | no_license | wsws0521/IDEA-Vincent-HeadFirst-Pattern | bcbfefec4d570d81c860246f465e41e77a48935f | 15648b92953b771e2ee8da6668ca768980499964 | refs/heads/master | 2023-08-18T00:07:53.887294 | 2023-07-23T04:26:11 | 2023-07-23T04:26:11 | 245,391,249 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package cn.vincent.test;
import cn.vincent.behavior.service.FlyableRedheadImpl;
import cn.vincent.ducks.MallardDuck;
import cn.vincent.supperclass.BaseDuck;
public class MiniDuckSimulator {
public static void main(String[] args) {
// TODO Auto-generated method stub
BaseDuck model = new MallardDuck();
model.performFly();
model.setFlyBehavior(new FlyableRedheadImpl());
model.performFly();
}
}
| [
"623540439@qq.com"
] | 623540439@qq.com |
80f6dccbb8221dba5d4404c4349f40bda5ce695f | 04aa234f02383652af51d593803d42c3a2fbf7b8 | /app/src/main/java/com/sematec/proj1/TaskSec5Adapter.java | 9cdb0588b6c7e6131c65ea4a03b5dfc6fb82ca46 | [] | no_license | anddev98/Proj1 | 48d80b0d1c33507d51edad0fed6e884cf4c55ad2 | 2cfd2ecd554e085d0def2e5656b55453ac56ee9b | refs/heads/master | 2020-12-23T01:00:59.698381 | 2020-03-26T18:44:33 | 2020-03-26T18:44:33 | 236,984,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,280 | java | package com.sematec.proj1;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class TaskSec5Adapter extends RecyclerView.Adapter<TaskSec5Adapter.TestViewHolder> {
ArrayList<String> itemMenu;
TaskSec5Adapter (ArrayList<String> list){
itemMenu = list;
}
@NonNull
@Override
public TestViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View v = inflater.inflate(R.layout.task_sec5_recycler_item,parent,false);
TestViewHolder holder = new TestViewHolder(v);
return holder;
}
@Override
public void onBindViewHolder(@NonNull TestViewHolder holder, int position) {
String itemmenu = itemMenu.get(position);
holder.txtItem.setText(itemmenu);
}
@Override
public int getItemCount() {
return itemMenu.size();
}
public class TestViewHolder extends RecyclerView.ViewHolder{
TextView txtItem;
View viewItem;
public TestViewHolder(@NonNull final View itemView) {
super(itemView);
txtItem = itemView.findViewById(R.id.txtItem);
viewItem = itemView.findViewById(R.id.viewItem);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int itemPosition = getAdapterPosition();
switch (itemPosition){
case 0:
Intent intent = new Intent(itemView.getContext(),TaskImplicitIntentActivity.class);
itemView.getContext().startActivity(intent);
break;
case 1:
intent = new Intent(itemView.getContext(),TaskProfileSec4Activity.class);
itemView.getContext().startActivity(intent);
break;
}
}
});
}
}
}
| [
"you@example.com"
] | you@example.com |
97236a455e9c3c1817c1039e2d0968bede8e5135 | efd54286d87371d6305fc0a754a9a9ef2147955b | /src/net/ememed/user2/entity/OtherLoginInfo.java | 5237ed1191337547b8955381cd034aef14ae782b | [] | no_license | eltld/user | 3127b1f58ab294684eba3ff27446da14f2b51da0 | f5087033d4da190856627a98fe532e158465aa60 | refs/heads/master | 2020-12-03T10:26:45.629899 | 2015-04-30T10:22:14 | 2015-04-30T10:22:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 623 | java | package net.ememed.user2.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class OtherLoginInfo implements Serializable{
private int success;
private String errormsg;
private OtherLoginEntry data;
public int getSuccess() {
return success;
}
public void setSuccess(int success) {
this.success = success;
}
public String getErrormsg() {
return errormsg;
}
public void setErrormsg(String errormsg) {
this.errormsg = errormsg;
}
public OtherLoginEntry getData() {
return data;
}
public void setData(OtherLoginEntry data) {
this.data = data;
}
}
| [
"happyjie.1988@163.com"
] | happyjie.1988@163.com |
2a53b3114915827d56c01af70fce421f51e06e61 | d3a023f0fe3b166fa0e7e60d1f17125b85014174 | /customer-service/src/main/java/com/example/demo/controllers/CustomerController.java | facef0747663e2f34b9043743b14b587f00aad2c | [] | no_license | vatsanTraining/spring_jan_2021 | b0a6fcb2c8a62bd3b9368955d1105d8ccf2010f1 | 6dbb246cb38539be06abc340e8ed23d64a01624f | refs/heads/master | 2023-02-25T02:20:58.613676 | 2021-01-25T13:58:14 | 2021-01-25T13:58:14 | 328,093,414 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 953 | java | package com.example.demo.controllers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import com.example.demo.domain.Customer;
@RestController
@CrossOrigin(origins = "*")
public class CustomerController {
@Autowired
private Customer customer;
@GetMapping(path = "/api/v1/customers")
public Customer getCustomer() {
return this.customer;
}
@GetMapping(path = "/api/v1/customers/{id}")
public Customer getCustomerById(@PathVariable("id") int id) throws InterruptedException {
if(id < 7) {
return this.customer;
} else {
Thread.sleep(7000);
this.customer.setCustomerName("Delayed Customer");
return this.customer;
}
}
}
| [
"vatsank@gmail.com"
] | vatsank@gmail.com |
f1e8fd04fdfd12a608c71879dc7a9a3be6686981 | 36f11aea4016d8fec2611b651dbdc92f489ea350 | /nacid/src/com/nacid/bl/impl/users/UserGroupMembershipForEditImpl.java | f5af003790627e3bd3e69ec2cead8d1b5375f09a | [
"MIT"
] | permissive | governmentbg/NACID-DOCTORS-TITLES | a91eecfee6d6510ace5499a18c4dbe25680743be | 72b79b14af654573e5d23e0048adeac20d06696a | refs/heads/master | 2022-12-03T22:39:48.965063 | 2020-08-28T07:11:13 | 2020-08-28T07:11:13 | 281,618,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package com.nacid.bl.impl.users;
import java.util.Set;
import com.nacid.bl.external.users.ExtUserGroupMembershipForEdit;
import com.nacid.bl.users.UserGroupMembershipForEdit;
import com.nacid.data.users.UserGroupMembershipRecord;
public class UserGroupMembershipForEditImpl extends UserGroupMembershipImpl implements UserGroupMembershipForEdit, ExtUserGroupMembershipForEdit {
public UserGroupMembershipForEditImpl(UserGroupMembershipRecord record) {
super(record);
}
public Set<Integer> getOperationIds() {
return operationIds;
}
}
| [
"vcankova@nacid.bg"
] | vcankova@nacid.bg |
bacdf360232bb3cdd30f792aaa4758d7bf479755 | fdf21b6e668e5e9d4779926d3020496d8f46cfc7 | /SAREF-Jackson-JsonLd/generatedCode/src/main/java/www/w3/org/_2006/time/MonthOfYear.java | dc4e9bc30062d931448505b65f76eaff6b137b0f | [] | no_license | InnovationSE/SAREF-Generated-By-OLGA | 3a25c2d492ab200854875536d9ec94b46e5c7ea2 | 7ccb8919ecd1cce5722d731f59ad51883bb21f7f | refs/heads/master | 2020-12-02T19:50:32.737757 | 2017-09-11T16:28:08 | 2017-09-11T16:28:08 | 96,397,363 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,957 | java | /**
* This file is automatically generated by OLGA
* @author OLGA
* @version 1.0
*/
package www.w3.org._2006.time;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldId;
import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldProperty;
import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldType;
import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldLink;
import ioinformarics.oss.jackson.module.jsonld.annotation.JsonldPropertyType;
import saref.jsonld.util.RefId;
import www.w3.org._2006.time.DateTimeDescription;
import www.w3.org._2006.time.GeneralDateTimeDescription;
import www.w3.org._2006.time.TemporalPosition;
import www.opengis.net.def.uom.ISO_8601._0.Gregorian.Gregorian;
import www.w3.org._2002._07.owl.IThing;
import www.w3.org._2006.time.unitMonth;
public class MonthOfYear implements IMonthOfYear {
Map<String, List<RefId>> relations;
public MonthOfYear(String id) {
super();
this.id = "http://www.w3.org/2006/time#" + id;
relations = new HashMap<String, List<RefId>>();
monthOfYearMaxThing = new ArrayList<>();
unitTypeExactlyThing = new ArrayList<>();
timeZoneMaxThing = new ArrayList<>();
dayOfWeekMaxThing = new ArrayList<>();
hasTRSExactlyThing = new ArrayList<>();
}
@JsonldId
public String id;
@JsonIgnore
public RefId getRefId()
{
return new RefId(id);
}
@JsonInclude(Include.NON_NULL)
@JsonProperty("@type")
public String getType()
{
return "http://www.w3.org/2006/time#MonthOfYear";
}
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#month", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#month")
public String month;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#month", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#month")
public javax.xml.datatype.XMLGregorianCalendar month_XMLGregorianCalendar;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#day", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#day")
public javax.xml.datatype.XMLGregorianCalendar day_XMLGregorianCalendar;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#year", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#year")
public javax.xml.datatype.XMLGregorianCalendar year_XMLGregorianCalendar;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#day", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#day")
public String day_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#dayOfYear", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#dayOfYear")
public String dayOfYear_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#hour", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#hour")
public String hour_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#week", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#week")
public String week_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#month", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#month")
public String month_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#minute", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#minute")
public String minute_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#year", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#year")
public String year_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldPropertyType(id = "http://www.w3.org/2006/time#second", type = "owl:DatatypeProperty")
@JsonProperty("http://www.w3.org/2006/time#second")
public String second_String;
@JsonInclude(Include.NON_EMPTY)
@JsonldProperty("http://www.w3.org/2006/time#unitType")
private List<RefId> unitTypeunitMonth;
public void addunitType(unitMonth parameter)
{
unitTypeunitMonth.add(parameter.getRefId());
}
@JsonInclude(Include.NON_EMPTY)
@JsonldProperty("http://www.w3.org/2006/time#hasTRS")
private List<RefId> hasTRSGregorian;
public void addhasTRS(Gregorian parameter)
{
hasTRSGregorian.add(parameter.getRefId());
}
@JsonInclude(Include.NON_EMPTY)
@JsonldProperty("http://www.w3.org/2006/time#monthOfYear")
private List<RefId> monthOfYearMaxThing;
public void addmonthOfYearMax1(IThing parameter)
{
monthOfYearMaxThing.add(parameter.getRefId());
}
@JsonInclude(Include.NON_EMPTY)
@JsonldProperty("http://www.w3.org/2006/time#unitType")
private List<RefId> unitTypeExactlyThing;
public void addunitTypeExactly1(IThing parameter)
{
unitTypeExactlyThing.add(parameter.getRefId());
}
@JsonInclude(Include.NON_EMPTY)
@JsonldProperty("http://www.w3.org/2006/time#timeZone")
private List<RefId> timeZoneMaxThing;
public void addtimeZoneMax1(IThing parameter)
{
timeZoneMaxThing.add(parameter.getRefId());
}
@JsonInclude(Include.NON_EMPTY)
@JsonldProperty("http://www.w3.org/2006/time#dayOfWeek")
private List<RefId> dayOfWeekMaxThing;
public void adddayOfWeekMax1(IThing parameter)
{
dayOfWeekMaxThing.add(parameter.getRefId());
}
@JsonInclude(Include.NON_EMPTY)
@JsonldProperty("http://www.w3.org/2006/time#hasTRS")
private List<RefId> hasTRSExactlyThing;
public void addhasTRSExactly1(IThing parameter)
{
hasTRSExactlyThing.add(parameter.getRefId());
}
@JsonInclude(Include.NON_EMPTY)
@JsonProperty("http://www.w3.org/2006/time#hasTRS")
public List<RefId> gethasTRSGregorian()
{
return hasTRSGregorian;
}
@JsonInclude(Include.NON_EMPTY)
@JsonProperty("http://www.w3.org/2006/time#monthOfYear")
public List<RefId> getmonthOfYearThing()
{
return monthOfYearMaxThing;
}
@JsonInclude(Include.NON_EMPTY)
@JsonProperty("http://www.w3.org/2006/time#unitType")
public List<RefId> getunitTypeThing()
{
return unitTypeExactlyThing;
}
@JsonInclude(Include.NON_EMPTY)
@JsonProperty("http://www.w3.org/2006/time#timeZone")
public List<RefId> gettimeZoneThing()
{
return timeZoneMaxThing;
}
@JsonInclude(Include.NON_EMPTY)
@JsonProperty("http://www.w3.org/2006/time#dayOfWeek")
public List<RefId> getdayOfWeekThing()
{
return dayOfWeekMaxThing;
}
}
| [
"Andre.Ponnouradjane@non.schneider-electric.com"
] | Andre.Ponnouradjane@non.schneider-electric.com |
3f08a01febff28585876c5a30a0194ec102d0b9f | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Log4j/Log4j2042.java | cda4335aaef265d92aa774c1ba8e52ab5734970b | [] | 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 | 874 | java | @Test
public void testInitialize_Name_ClassLoader_URI() throws Exception {
ctx = Configurator.initialize("Test1", null, new File("target/test-classes/log4j2-config.xml").toURI());
LogManager.getLogger("org.apache.test.TestConfigurator");
Configuration config = ctx.getConfiguration();
assertNotNull("No configuration", config);
assertEquals("Incorrect Configuration.", CONFIG_NAME, config.getName());
final Map<String, Appender> map = config.getAppenders();
assertNotNull("Appenders map should not be null.", map);
assertThat(map, hasSize(greaterThan(0)));
assertThat("Wrong configuration", map, hasKey("List"));
Configurator.shutdown(ctx);
config = ctx.getConfiguration();
assertEquals("Unexpected Configuration.", NullConfiguration.NULL_NAME, config.getName());
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
7d1c91a56f9ca7039f9f04f5fd2863f7e7bb173b | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/test/org/powermock/core/transformers/SuppressStaticInitializerMockTransformerTest.java | 6ddd5ce0ac1866c158754c9940ab4f62d7768731 | [] | 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 | 2,880 | java | /**
* Copyright 2017 the original author or authors.
*
* 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.powermock.core.transformers;
import TransformStrategy.CLASSLOADER;
import org.hamcrest.CoreMatchers;
import org.junit.Assume;
import org.junit.Test;
import org.powermock.core.MockRepository;
import org.powermock.core.test.MockClassLoaderFactory;
import org.powermock.reflect.Whitebox;
import powermock.test.support.MainMockTransformerTestSupport;
public class SuppressStaticInitializerMockTransformerTest extends AbstractBaseMockTransformerTest {
public SuppressStaticInitializerMockTransformerTest(final TransformStrategy strategy, final MockTransformerChain mockTransformerChain, final MockClassLoaderFactory mockClassloaderFactory) {
super(strategy, mockTransformerChain, mockClassloaderFactory);
}
@Test
public void should_suppress_static_initialization_if_class_is_added_to_mock_repository() throws Exception {
Assume.assumeThat(strategy, CoreMatchers.equalTo(CLASSLOADER));
String className = MainMockTransformerTestSupport.StaticInitialization.class.getName();
MockRepository.addSuppressStaticInitializer(className);
Class<?> clazz = loadWithMockClassLoader(className);
Object value = Whitebox.getInternalState(clazz, "value");
assertThat(value).as("Value not initialized").isNull();
}
@Test
public void should_not_suppress_static_initialization_if_class_is_not_added_to_mock_repository() throws Exception {
Assume.assumeThat(strategy, CoreMatchers.equalTo(CLASSLOADER));
Class<?> clazz = loadWithMockClassLoader(MainMockTransformerTestSupport.StaticInitialization.class.getName());
Object value = Whitebox.getInternalState(clazz, "value");
assertThat(value).as("Value initialized").isNotNull();
}
@Test
public void should_not_suppress_static_initialization_if_class_is_added_to_mock_repository_but_strategy_not_classloader() throws Exception {
Assume.assumeThat(strategy, CoreMatchers.not(CoreMatchers.equalTo(CLASSLOADER)));
Class<?> clazz = loadWithMockClassLoader(MainMockTransformerTestSupport.StaticInitialization.class.getName());
Object value = Whitebox.getInternalState(clazz, "value");
assertThat(value).as("Value initialized").isNotNull();
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
a291a9d2b5ceacb1be15239868109607a6749050 | 85a4b0610a0d288376df12cb569e74490ed50e02 | /backend/src/main/java/com/ecommerce/config/WebSecurityConfig.java | a57e607102368b45faf5407b1f1487347f896088 | [
"MIT"
] | permissive | denis554/E-Commerce-Full-Stack | a40d9a3e3dcc3e829d6840baa7f9dab136902907 | c0130ca28445f2782a426cbf952a0624ba54dda9 | refs/heads/master | 2020-04-30T13:41:49.960719 | 2017-10-21T17:08:53 | 2017-10-21T17:08:53 | 172,616,494 | 1 | 0 | MIT | 2019-02-26T01:44:14 | 2019-02-26T01:44:14 | null | UTF-8 | Java | false | false | 1,498 | java | package com.ecommerce.config;
import com.ecommerce.tools.security.JwtFilter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
@Configuration
@EnableAutoConfiguration
@ComponentScan
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public FilterRegistrationBean jwtFilter() {
final FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(new JwtFilter());
registrationBean.addUrlPatterns("/checkout/**", "/admin/**");
return registrationBean;
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.headers().cacheControl();
http
.csrf().disable()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
.authorizeRequests()
.antMatchers(
"/books/**", "/ebooks/**", "/audiobooks/**", "/customer/**", "/register/**", "/order/**"
).permitAll()
.antMatchers("/auth").permitAll();
http.headers().cacheControl();
}
}
| [
"denisignatenko554@gmail.com"
] | denisignatenko554@gmail.com |
6cb034bf989eb3767e2ecfbd401e6a2a8f0a5c45 | b0322dd984d25e12a9eeb6fedb344ad764f9306b | /learn-kafka/src/main/java/com/jsonyao/cs/api/interceptor/CustomConsumerInterceptor.java | 206df6a6406473516d3253b778cdfdb53dbac200 | [] | no_license | JsonYaoo/kafka-test | 24c83126a0a2c37344f305ffd37b2fcc69bdec6a | 3c11289041ede19e71659e28e10e0eb0a9ae3c19 | refs/heads/master | 2023-03-03T05:38:20.986159 | 2021-02-10T09:52:44 | 2021-02-10T09:52:44 | 336,457,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,623 | java | package com.jsonyao.cs.api.interceptor;
import org.apache.kafka.clients.consumer.ConsumerInterceptor;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.common.TopicPartition;
import java.util.Map;
/**
* Kafka自定义消费者拦截器
*/
public class CustomConsumerInterceptor implements ConsumerInterceptor<String, String> {
/**
* 消费消息前拦截器
* @param consumerRecords
* @return
*/
@Override
public ConsumerRecords<String, String> onConsume(ConsumerRecords<String, String> consumerRecords) {
System.err.println("------ 消费者前置处理器,接收消息 --------");
return consumerRecords;
}
/**
* 消息消费完毕提交前拦截器: 默认配置了每5s轮训一次是否提交, 所有也会每5s执行该拦截器
* @param map
*/
@Override
public void onCommit(Map<TopicPartition, OffsetAndMetadata> map) {
map.forEach((tp, offSet) -> {
System.err.println("消费者处理完成," + "分区:" + tp + ", 偏移量:" + offSet);
});
}
/**
* 消费者关闭拦截器: 手工关闭的不会执行, 只有代码自动关闭的才会
*/
@Override
public void close() {
System.err.println("----------- 消费者已关闭 ----------");
}
/**
* 消费者初始化拦截器
* @param map
*/
@Override
public void configure(Map<String, ?> map) {
System.err.println("----------- 消费者初始化完成 ----------");
}
}
| [
"yaocs2@midea.com"
] | yaocs2@midea.com |
ec7e7ec90745c08446882bf059fbb1cbcc27c09d | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.unifiedtelemetry-UnifiedTelemetry/sources/X/AnonymousClass6g.java | a49ed7f5b2a50aa8108ea283ff19b2334fcf9f5a | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 586 | java | package X;
import com.google.common.annotations.GwtIncompatible;
import java.io.IOException;
import java.io.ObjectOutputStream;
@GwtIncompatible
/* renamed from: X.6g reason: invalid class name */
public final class AnonymousClass6g {
public static <E> void A00(AnonymousClass34<E> r2, ObjectOutputStream objectOutputStream) throws IOException {
objectOutputStream.writeInt(r2.entrySet().size());
for (AbstractC0181Ug ug : r2.entrySet()) {
objectOutputStream.writeObject(ug.A01());
objectOutputStream.writeInt(ug.A00());
}
}
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
3279c4671b8543fd0b87f626b1d85a6ae6f7e800 | 44308a812aadf60910509d94de39e8a511d6e91e | /app/src/main/java/com/android/internal/colorextraction/types/ExtractionType.java | 8047ad054b2d6d86d681697c7c3b394b44a383a0 | [] | no_license | longyinzaitian/Android27Source | 31e01e83bc891e3602484b91b7eab325a22747ce | 9b982c844adbfd54f92facb7e4caf46ee40e2692 | refs/heads/master | 2020-03-08T15:54:54.433791 | 2018-04-10T09:44:25 | 2018-04-10T09:44:25 | 128,224,765 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,854 | java | /*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.android.internal.colorextraction.types;
import android.app.WallpaperColors;
import com.android.internal.colorextraction.ColorExtractor;
/**
* Interface to allow various color extraction implementations.
*/
public interface ExtractionType {
/**
* Executes color extraction by reading WallpaperColors and setting
* main and secondary colors on GradientColors.
*
* Extraction is expected to happen with 3 different gradient types:
* Normal, with the main extracted colors
* Dark, with extra contrast
* ExtraDark, for places where GAR is mandatory, like the emergency dialer
*
* @param inWallpaperColors where to read from
* @param outGradientColorsNormal object that should receive normal colors
* @param outGradientColorsDark object that should receive dark colors
* @param outGradientColorsExtraDark object that should receive extra dark colors
*/
void extractInto(WallpaperColors inWallpaperColors,
ColorExtractor.GradientColors outGradientColorsNormal,
ColorExtractor.GradientColors outGradientColorsDark,
ColorExtractor.GradientColors outGradientColorsExtraDark);
}
| [
"1536132397@qq.com"
] | 1536132397@qq.com |
41030921da518eb1de18b608b0903a1e5a2f4197 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Quartz/Quartz510.java | c92ff5bbd54700266196d26dfc2aefe3ff87e5b8 | [] | 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 | 489 | java | public DailyTimeIntervalTriggerImpl(String name, String group, Date startTime,
Date endTime, TimeOfDay startTimeOfDay, TimeOfDay endTimeOfDay,
IntervalUnit intervalUnit, int repeatInterval) {
super(name, group);
setStartTime(startTime);
setEndTime(endTime);
setRepeatIntervalUnit(intervalUnit);
setRepeatInterval(repeatInterval);
setStartTimeOfDay(startTimeOfDay);
setEndTimeOfDay(endTimeOfDay);
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
4cfe54a3eda4e19be5eb7f15a83bed4ba0e67bd4 | 30fcfe8493b9e87dec79f3760a38cb7e9517b367 | /src/main/java/com/hendisantika/blog/service/NotificationServiceImpl.java | f1b114a3c983118dd2a5de42ff3c96bd11fa4bf7 | [] | no_license | hendisantika/mvc-blog | 8000f733c99926fe80f8dd5e44d8ab220223f9b0 | 605efc8ee02202f2afef12f87f1147ccb51f3fd1 | refs/heads/master | 2022-06-04T22:54:46.190786 | 2021-05-29T00:56:34 | 2021-05-29T00:56:34 | 98,977,456 | 0 | 1 | null | 2021-05-28T13:19:15 | 2017-08-01T08:20:23 | Java | UTF-8 | Java | false | false | 1,928 | java | package com.hendisantika.blog.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* User: hendisantika
* Email: hendisantika@gmail.com
* Telegram : @hendisantika34
* Date: 8/1/17
* Time: 5:02 PM
* To change this template use File | Settings | File Templates.
*/
@Service
public class NotificationServiceImpl implements NotificationService{
public static final String NOTIFY_MSG_SESSION_KEY = "siteNotificationMessages";
@Autowired
private HttpSession httpSession;
@Override
public void addInfoMessage(String msg) {
addNotificationMessage(NotificationMessageType.INFO, msg);
}
@Override
public void addErrorMessage(String msg) {
addNotificationMessage(NotificationMessageType.ERROR, msg);
}
private void addNotificationMessage(NotificationMessageType type, String msg) {
List<NotificationMessage> notifyMessages = (List<NotificationMessage>)
httpSession.getAttribute(NOTIFY_MSG_SESSION_KEY);
if (notifyMessages == null) {
notifyMessages = new ArrayList<NotificationMessage>();
}
notifyMessages.add(new NotificationMessage(type, msg));
httpSession.setAttribute(NOTIFY_MSG_SESSION_KEY, notifyMessages);
}
public enum NotificationMessageType {
INFO,
ERROR
}
public class NotificationMessage {
NotificationMessageType type;
String text;
public NotificationMessage(NotificationMessageType type, String text) {
this.type = type;
this.text = text;
}
public NotificationMessageType getType() {
return type;
}
public String getText() {
return text;
}
}
}
| [
"hendisantika@gmail.com"
] | hendisantika@gmail.com |
7d532f96c389cd3718ead7574208b3c94f6b512b | bd0a160ae9df2695d400080604f3bb944493e369 | /src/main/java/com/enfernuz/quik/lua/rpc/api/messages/GetQuoteLevel2.java | 516abf5627e0658b9447e961a92a969835db6e05 | [] | no_license | Enfernuz/quik-lua-rpc-java-client | c2380301d31445fd671577cf1db8f82318af1fe7 | 7dbe225f60c671af91a08eb9ad02e94a5ce4e956 | refs/heads/master | 2023-06-22T02:24:40.449136 | 2022-04-04T03:37:22 | 2022-04-04T03:37:22 | 109,439,391 | 7 | 7 | null | 2023-06-14T22:51:31 | 2017-11-03T20:22:31 | Java | UTF-8 | Java | false | false | 6,106 | java | package com.enfernuz.quik.lua.rpc.api.messages;
import com.enfernuz.quik.lua.rpc.api.RemoteProcedure;
import com.enfernuz.quik.lua.rpc.api.RpcArgs;
import com.enfernuz.quik.lua.rpc.api.RpcResult;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import lombok.*;
import lombok.experimental.NonFinal;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Objects;
public final class GetQuoteLevel2 implements RemoteProcedure {
private GetQuoteLevel2() {}
@JsonPropertyOrder({Args.CLASS_CODE, Args.SEC_CODE})
@EqualsAndHashCode
public static final class Args implements RpcArgs<GetQuoteLevel2> {
private static final String CLASS_CODE = "class_code";
private static final String SEC_CODE = "sec_code";
@JsonProperty(CLASS_CODE)
private final String classCode;
@JsonProperty(SEC_CODE)
private final String secCode;
@Builder
private Args(@NonNull final String classCode, @NonNull final String secCode) {
this.classCode = classCode;
this.secCode = secCode;
}
@JsonIgnore
public String getClassCode() {
return classCode;
}
@JsonIgnore
public String getSecCode() {
return secCode;
}
@NotNull
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add(CLASS_CODE, classCode)
.add(SEC_CODE, secCode)
.toString();
}
}
@Value
public static class Result implements RpcResult<GetQuoteLevel2> {
private static final String BID_COUNT = "bid_count";
private static final String OFFER_COUNT = "offer_count";
private static final String BIDS = "bids";
private static final String OFFERS = "offers";
String bidCount;
String offerCount;
List<QuoteEntry> bids;
List<QuoteEntry> offers;
@Getter(AccessLevel.NONE)
@NonFinal
private transient int hashCode;
@Getter(AccessLevel.NONE)
@NonFinal
private transient String asString;
@JsonCreator
@Builder
private Result(
@JsonProperty(value = BID_COUNT, required = true) @NonNull final String bidCount,
@JsonProperty(value = OFFER_COUNT, required = true) @NonNull final String offerCount,
@JsonProperty(value = BIDS, required = true) @NonNull final Iterable<? extends QuoteEntry> bids,
@JsonProperty(value = OFFERS, required = true) @NonNull final Iterable<? extends QuoteEntry> offers) {
this.bidCount = bidCount;
this.offerCount = offerCount;
this.bids = ImmutableList.copyOf(bids);
this.offers = ImmutableList.copyOf(offers);
}
@Override
public boolean equals(final Object o) {
if (o == this) {
return true;
} else if ( !(o instanceof Result) ) {
return false;
} else {
final Result result = (Result) o;
return Objects.equals(bidCount, result.bidCount) &&
Objects.equals(offerCount, result.offerCount) &&
Objects.equals(bids, result.bids) &&
Objects.equals(offers, result.offers);
}
}
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = Objects.hash(bidCount, offerCount, bids, offers);
}
return hashCode;
}
@NotNull
@Override
public String toString() {
if (asString == null) {
asString = MoreObjects.toStringHelper(this)
.add(BID_COUNT, bidCount)
.add(OFFER_COUNT, offerCount)
.add(BIDS, bids)
.add(OFFERS, offers)
.toString();
}
return asString;
}
}
@Value
public static class QuoteEntry {
private static final String PRICE = "price";
private static final String QUANTITY = "quantity";
String price;
String quantity;
@Getter(AccessLevel.NONE)
@NonFinal
private transient int hashCode;
@Getter(AccessLevel.NONE)
@NonFinal
private transient String asString;
@JsonCreator
@Builder
private QuoteEntry(
@JsonProperty(value = PRICE, required = true) @NonNull final String price,
@JsonProperty(value = QUANTITY, required = true) @NonNull final String quantity) {
this.price = price;
this.quantity = quantity;
}
@Override
public boolean equals(final Object o) {
if (o == this) {
return true;
} else if ( !(o instanceof QuoteEntry) ) {
return false;
} else {
final QuoteEntry that = (QuoteEntry) o;
return Objects.equals(price, that.price) &&
Objects.equals(quantity, that.quantity);
}
}
@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = Objects.hash(price, quantity);
}
return hashCode;
}
@NotNull
@Override
public String toString() {
if (asString == null) {
asString = MoreObjects.toStringHelper(this)
.add(PRICE, price)
.add(QUANTITY, quantity)
.toString();
}
return asString;
}
}
}
| [
"asnerushev@gmail.com"
] | asnerushev@gmail.com |
b55be3d863c3ac5e674e55b9c9ccc21b52a8942b | 836f0aef423040a92b9608db40ea6b2c55957fba | /app/src/main/java/com/emobi/bjaindoc/services/WebServicesCallBack.java | 307ee381157cde74da9ad44813dfafeddc3b25cb | [] | no_license | vishwakarmasunil68/BjainDoc | 328dc0753449492d42a5e484b4bff701969f02a4 | 65e9293dc26075c37c976350ac5371066edaf40d | refs/heads/master | 2021-01-01T18:45:31.193300 | 2017-07-26T13:48:24 | 2017-07-26T13:48:24 | 98,427,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 163 | java | package com.emobi.bjaindoc.services;
/**
* Created by sunil on 29-12-2016.
*/
public interface WebServicesCallBack {
public void onGetMsg(String[] msg);
}
| [
"Sunil112!((#"
] | Sunil112!((# |
96266271330f7a1140ab3e88127fc313ef95fb56 | e2ff875beb65a9a6b2d16f10682a01c6e92f65f8 | /src/main/java/com/autonavi/ae/gmap/gloverlay/GLRouteProperty.java | e785e9e180e33cd1ef5e052c50c6a0d21cc60530 | [] | no_license | gaoluhua99/hud20220723 | 3f56abce85e3348b116801a88148530ac23cd35c | 803a209919d63001f998a61d17072b0f8e5c0e05 | refs/heads/master | 2023-03-15T23:55:24.290183 | 2021-03-12T04:13:37 | 2021-03-12T04:13:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,568 | java | package com.autonavi.ae.gmap.gloverlay;
public class GLRouteProperty {
public EAMapRouteTexture euRouteTexture;
public boolean isCanCovered;
public boolean isLineExtract;
public boolean isUseCap;
public boolean isUseColor;
public int mBgColor;
public int mBgResId;
public int mBorderLineWidth;
public float mCapX1;
public float mCapX2;
public float mCapY1;
public float mCapY2;
public int mFilledColor;
public int mFilledResId;
public float mGLStart;
public int mLineWidth;
public boolean mShowArrow = false;
public int mSimple3DFillResId = -1;
public float mSimple3DGLStart;
public float mSimple3DTextureLen;
public float mSimple3DX1;
public float mSimple3DX2;
public float mSimple3DY1;
public float mSimple3DY2;
public float mTextureLen;
public float mX1;
public float mX2;
public float mY1;
public float mY2;
public boolean mbTexPreMulAlpha = false;
public enum EAMapRouteTexture {
AMAP_ROUTE_TEXTURE_NONAVI,
AMAP_ROUTE_TEXTURE_NAVI,
AMAP_ROUTE_TEXTURE_DEFAULT,
AMAP_ROUTE_TEXTURE_OPEN,
AMAP_ROUTE_TEXTURE_AMBLE,
AMAP_ROUTE_TEXTURE_JAM,
AMAP_ROUTE_TEXTURE_CONGESTED,
AMAP_ROUTE_TEXTURE_ARROW,
AMAP_ROUTE_TEXTURE_CHARGE,
AMAP_ROUTE_TEXTURE_FREE,
AMAP_ROUTE_TEXTURE_LIMIT,
AMAP_ROUTE_TEXTURE_SLOWER,
AMAP_ROUTE_TEXTURE_FASTER,
AMAP_ROUTE_TEXTURE_WRONG,
AMAP_ROUTE_TEXTURE_FERRY,
AMAP_ROUTE_TEXTURE_NUMBER
}
}
| [
"tommpat163@163.com"
] | tommpat163@163.com |
f2c76af15bf2de367a7a6578196530d79c5c2883 | 7ef841751c77207651aebf81273fcc972396c836 | /dstream/src/main/java/com/loki/dstream/stubs/SampleClass6560.java | 7999560830e5171c6e28d433fdfd8d2ed60a6f60 | [] | no_license | SergiiGrechukha/ModuleApp | e28e4dd39505924f0d36b4a0c3acd76a67ed4118 | 00e22d51c8f7100e171217bcc61f440f94ab9c52 | refs/heads/master | 2022-05-07T13:27:37.704233 | 2019-11-22T07:11:19 | 2019-11-22T07:11:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package com.loki.dstream.stubs;
public class SampleClass6560 {
private SampleClass6561 sampleClass;
public SampleClass6560(){
sampleClass = new SampleClass6561();
}
public String getClassName() {
return sampleClass.getClassName();
}
} | [
"sergey.grechukha@gmail.com"
] | sergey.grechukha@gmail.com |
96d5a2d6bb867d49ab9b2666bf4a8afc4d3c75c2 | b10216d6f660e8925afeef8d378301bd59fb1bce | /Microservice/microservice-list/src/test/java/fr/yr/site/controller/ListTailleControllerTest.java | a9687de53dac418de93b943a21bb7e7c161e2a20 | [] | no_license | YoannR09/Projet_12_OC | 8e82305ebe04f8f6caf90bc483e871fbc8964c14 | 1c498676b342275ac383414df2a56eef07139b62 | refs/heads/master | 2022-04-28T19:03:15.746182 | 2020-03-20T14:13:04 | 2020-03-20T14:13:04 | 222,722,539 | 0 | 0 | null | 2022-04-22T21:47:22 | 2019-11-19T15:01:59 | Java | UTF-8 | Java | false | false | 3,926 | java | package fr.yr.site.controller;
import fr.yr.site.dao.ListTailleDao;
import fr.yr.site.model.ListTaille;
import javassist.NotFoundException;
import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.mockito.stubbing.Answer;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
public class ListTailleControllerTest {
private ListTailleController controller;
private Logger logger;
private ListTailleDao dao;
@Test
public void findById(){
//GIVEN
ListTaille lt = new ListTaille();
lt.setId(1);
when(dao.findById(anyInt())).thenReturn(lt);
// WHEN
ListTaille ltTest = controller.findById(1);
//THEN
assertEquals(ltTest.getId(),new Integer(1));
when(dao.findById(anyInt()))
.then((Answer<Void>) invocationOnMock -> {
throw new NotFoundException("Erreur");
});
assertNull(controller.findById(2));
}
@Test
public void findByCategorieId(){
//GIVEN
List<ListTaille> vList = new ArrayList<>();
ListTaille lt1 = new ListTaille();
lt1.setId(1);
ListTaille lt2 = new ListTaille();
lt2.setId(2);
vList.add(lt1);
vList.add(lt2);
when(dao.findByArticleId(anyInt())).thenReturn(vList);
// WHEN
List<ListTaille> vListTest = controller.findByCategorieId(2);
//THEN
assertEquals(vListTest.size(),2);
when(dao.findByArticleId(anyInt()))
.then((Answer<Void>) invocationOnMock -> {
throw new NotFoundException("Erreur");
});
assertNull(controller.findByCategorieId(2));
}
@Test
public void add(){
// GIVEN
ListTaille lt = new ListTaille();
lt.setId(4);
List<ListTaille> vList = new ArrayList<>();
reset(dao);
when(dao.save(any(ListTaille.class))).then((Answer<Void>) invocationOnMock -> {
vList.add(lt);
return null;
});
// WHEN
controller.add(lt);
// THEN
assertEquals(vList.size(),1);
when(dao.save(any(ListTaille.class))).then((Answer<Void>) invocationOnMock -> {
throw new NotFoundException("Erreur");
});
controller.add(lt);
assertEquals(vList.size(),1);
}
@Test
public void deleteByArticleId(){
// GIVEN
ListTaille lt = new ListTaille();
lt.setId(4);
List<ListTaille> vList = new ArrayList<>();
vList.add(lt);
reset(dao);
doAnswer((Answer<Void>) invocationOnMock -> {
vList.remove(0);
return null;
}).when(dao).deleteByArticleId(anyInt());
// WHEN
controller.deleteByArticleId(4);
// THEN
assertEquals(vList.size(),0);
vList.add(lt);
doAnswer((Answer<Void>) invocationOnMock -> {
throw new NotFoundException("Erreur");
}).when(dao).deleteById(anyInt());
controller.add(lt);
assertEquals(vList.size(),1);
}
@Before
public void init(){
controller = new ListTailleControllerFake();
dao = mock(ListTailleDao.class);
logger = mock(Logger.class);
doNothing().when(logger).warn(anyString());
doNothing().when(logger).error(anyString());
}
public class ListTailleControllerFake extends ListTailleController {
@Override
protected Logger getLogger() {
return logger;
}
@Override
protected ListTailleDao getDao() {
return dao;
}
}
}
| [
"el-rambo-poto@hotmail.fr"
] | el-rambo-poto@hotmail.fr |
8dd82ecaea6d8942448ab180a62e622127514ac5 | fd49852c3426acf214b390c33927b5a30aeb0e0a | /aosp/javalib/android/app/IActivityPendingResult$Default.java | 30641f966ee12d401dd18dfb1a9a325b771187b9 | [] | no_license | HanChangHun/MobilePlus-Prototype | fb72a49d4caa04bce6edb4bc060123c238a6a94e | 3047c44a0a2859bf597870b9bf295cf321358de7 | refs/heads/main | 2023-06-10T19:51:23.186241 | 2021-06-26T08:28:58 | 2021-06-26T08:28:58 | 333,411,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 526 | java | package android.app;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
public class Default implements IActivityPendingResult {
public IBinder asBinder() {
return null;
}
public boolean sendResult(int paramInt, String paramString, Bundle paramBundle) throws RemoteException {
return false;
}
}
/* Location: /home/chun/Desktop/temp/!/android/app/IActivityPendingResult$Default.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/ | [
"ehwjs1914@naver.com"
] | ehwjs1914@naver.com |
79346572b981bcf7db3b068078117c07610ca0d6 | 7ccf7340e2998b8453f7624818cc421793942243 | /src/main/java/act/event/EventListenerClassFinder.java | fa21ee07d943b3ad3b4d6e36fe27f04daac437f4 | [
"Apache-2.0"
] | permissive | leeaee/actframework | 22b62f013356341392228c54b0d354931282f7f1 | 5fd4950e8150c2c50186cf3678a81b1b9f826918 | refs/heads/master | 2021-05-01T23:50:40.898388 | 2017-01-10T07:55:13 | 2017-01-10T07:55:13 | 77,368,248 | 0 | 0 | null | 2016-12-26T08:00:50 | 2016-12-26T08:00:49 | null | UTF-8 | Java | false | false | 2,225 | java | package act.event;
import act.ActComponent;
import act.app.App;
import act.app.event.AppEvent;
import act.app.event.AppEventId;
import act.app.event.AppEventListener;
import act.util.SubTypeFinder;
import org.osgl.$;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.EventObject;
@ActComponent
public class EventListenerClassFinder extends SubTypeFinder<ActEventListener> {
public EventListenerClassFinder() {
super(ActEventListener.class);
}
@Override
protected void found(final Class<? extends ActEventListener> target, final App app) {
final EventBus bus = app.eventBus();
ParameterizedType ptype = null;
Type superType = target.getGenericSuperclass();
while (ptype == null) {
if (superType instanceof ParameterizedType) {
ptype = (ParameterizedType) superType;
} else {
if (Object.class == superType) {
logger.warn("Event listener registration failed: cannot find generic information for %s", target.getName());
return;
}
superType = ((Class) superType).getGenericSuperclass();
}
}
Type[] ca = ptype.getActualTypeArguments();
for (Type t : ca) {
if (t instanceof Class) {
final Class tc = (Class) t;
if (AppEvent.class.isAssignableFrom(tc)) {
AppEvent prototype = $.cast($.newInstance(tc, app));
AppEventListener listener = $.cast(app.getInstance(target));
app.eventBus().bind(AppEventId.values()[prototype.id()], listener);
} else if (ActEvent.class.isAssignableFrom(tc)) {
app.eventBus().bind(AppEventId.START, new AppEventListenerBase() {
@Override
public void on(EventObject event) throws Exception {
ActEventListener listener = app.getInstance(target);
bus.bind(tc, listener);
}
});
return;
}
}
}
}
}
| [
"greenlaw110@gmail.com"
] | greenlaw110@gmail.com |
7c559107fa771fdbb889c93ff5e01a2ee0e2336f | 09534c278861e04441712475790c08fe0b92f279 | /app/src/main/java/com/walktour/gui/report/template/BusinessTemplateModel.java | ce1bb69570877859cd9b6ec8a55d67cb86063b6c | [] | no_license | copslock/Walktour4 | 077eee3500387abd9a8b74727dd3c5727cc11384 | 46b7e77e2a5e54c4f2a83f23448f7031c8b37537 | refs/heads/master | 2023-07-17T13:05:58.825418 | 2019-08-20T07:12:35 | 2019-08-20T07:12:35 | 397,678,508 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,443 | java | package com.walktour.gui.report.template;
import com.walktour.Utils.StringUtil;
import org.xmlpull.v1.XmlPullParser;
import java.util.LinkedList;
import java.util.List;
public class BusinessTemplateModel extends BaseTemplateModel {
private String businessName="";
private String businessNameEN="";
private List<StyleTemplateModel> styles=new LinkedList<StyleTemplateModel>();
public BusinessTemplateModel() {
super();
level=2;
}
public String getShowBusinessName() {
if (StringUtil.getLanguage().equalsIgnoreCase("cn")) {
return this.getBusinessNameCN();
} else
return this.getBusinessNameEN();
}
public String getBusinessNameCN() {
return businessName;
}
public void setBusinessNameCN(String businessName) {
this.businessName = businessName;
}
public String getBusinessNameEN() {
return businessNameEN;
}
public void setBusinessNameEN(String businessNameEN) {
this.businessNameEN = businessNameEN;
}
public List<StyleTemplateModel> getStyles() {
return styles;
}
public void parseXml(XmlPullParser parser) throws Exception {
int eventType = parser.getEventType();
String tagName = "";
while (eventType != XmlPullParser.END_DOCUMENT) {
switch (eventType) {
case XmlPullParser.START_DOCUMENT:
tagName = parser.getName();
break;
case XmlPullParser.START_TAG:
tagName = parser.getName();
if (tagName.equalsIgnoreCase("business")) {
for (int i = 0; i < parser.getAttributeCount(); i++) {
String attName = parser.getAttributeName(i);
String attValue = parser.getAttributeValue(i);
if (attName.equalsIgnoreCase("level")) {
this.setLevel(Integer.parseInt(attValue));
} else if (attName.equalsIgnoreCase("code")) {
this.setCode(attValue);
} else if (attName.equalsIgnoreCase("businessName")) {
this.setBusinessNameCN(attValue);
} else if (attName.equalsIgnoreCase("businessNameEN")) {
this.setBusinessNameEN(attValue);
}
}
}else if(tagName.equalsIgnoreCase("style")){
StyleTemplateModel styleModel=new StyleTemplateModel();
styleModel.parseXml(parser);
this.getStyles().add(styleModel);
}
break;
case XmlPullParser.END_TAG:
tagName = parser.getName();
if (tagName.equalsIgnoreCase("business")) {
return;
}
break;
}
eventType = parser.next();
}
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((businessName == null) ? 0 : businessName.hashCode());
result = prime * result + ((businessNameEN == null) ? 0 : businessNameEN.hashCode());
result = prime * result + ((styles == null) ? 0 : styles.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
BusinessTemplateModel other = (BusinessTemplateModel) obj;
if (businessName == null) {
if (other.businessName != null)
return false;
} else if (!businessName.equals(other.businessName))
return false;
if (businessNameEN == null) {
if (other.businessNameEN != null)
return false;
} else if (!businessNameEN.equals(other.businessNameEN))
return false;
if (styles == null) {
if (other.styles != null)
return false;
} else if (!styles.equals(other.styles))
return false;
return true;
}
}
| [
"15015912346@163.com"
] | 15015912346@163.com |
b62251a9c2afa5ea3666ff4dad9eb35011a4f00d | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/LANG-39b-1-29-SPEA2-WeightedSum:TestLen:CallDiversity/org/apache/commons/lang3/StringUtils_ESTest.java | cee0f03e34b76def0dd7647b88cf3b18210a54e1 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 820 | java | /*
* This file was automatically generated by EvoSuite
* Mon Apr 06 14:19:55 UTC 2020
*/
package org.apache.commons.lang3;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.apache.commons.lang3.StringUtils;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class StringUtils_ESTest extends StringUtils_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
String[] stringArray0 = new String[2];
stringArray0[0] = "@ oRHrsVctoc";
// Undeclared exception!
StringUtils.replaceEach("@ oRHrsVctoc", stringArray0, stringArray0);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
66a7a74f5ce872eb01098660d201c851145d98f7 | 07490456008c59d78e549932164cbb4892512c23 | /nsjp-dto/src/main/java/mx/gob/segob/nsjp/dto/catalogo/CatDiscriminanteWSDTO.java | d4070127e34e438d0456f8ac84f4c985e1843820 | [] | no_license | RichichiDomotics/poder-judicial | 80d713177aaa846c812a3822df53cd14b9e50871 | a288862a3e50cfe6b943d5b353ccce5ed6e88e46 | refs/heads/master | 2016-09-06T21:52:39.734925 | 2015-03-28T06:02:59 | 2015-03-28T06:02:59 | 33,019,991 | 0 | 1 | null | null | null | null | WINDOWS-1250 | Java | false | false | 2,284 | java | /**
*
*/
package mx.gob.segob.nsjp.dto.catalogo;
import mx.gob.segob.nsjp.dto.base.GenericWSDTO;
/**
* DTO de intercambio entre sistemas para transportar los datos básicos del Catalogo de Discriminante.
*
* @author GustavoBP
* @version 1.0
*/
public class CatDiscriminanteWSDTO extends GenericWSDTO {
private Long catDiscriminanteId;
private Long distritoId;
private String clave;
private String nombre;
private Short tipo;
public CatDiscriminanteWSDTO(){
super();
}
public CatDiscriminanteWSDTO(Long catDiscriminanteId,
Long catDistritoId, String claveDiscriminante,
String nombreDisc, Short tipo) {
super();
this.catDiscriminanteId = catDiscriminanteId;
this.distritoId = catDistritoId;
this.clave = claveDiscriminante;
this.nombre = nombreDisc;
this.tipo = tipo;
}
/**
* @param catDiscriminanteId
* @param claveDiscriminante
*/
public CatDiscriminanteWSDTO(Long catDiscriminanteId,
String claveDiscriminante) {
super();
this.catDiscriminanteId = catDiscriminanteId;
this.clave = claveDiscriminante;
}
/**
* @return the catDiscriminanteId
*/
public Long getCatDiscriminanteId() {
return catDiscriminanteId;
}
/**
* @return the catDistrito
*/
public Long getDistritoId() {
return distritoId;
}
/**
* @return the claveDiscriminante
*/
public String getClave() {
return clave;
}
/**
* @return the nombreDisc
*/
public String getNombre() {
return nombre;
}
/**
* @return the tipo
*/
public Short getTipo() {
return tipo;
}
/**
* @param catDiscriminanteId the catDiscriminanteId to set
*/
public void setCatDiscriminanteId(Long catDiscriminanteId) {
this.catDiscriminanteId = catDiscriminanteId;
}
/**
* @param catDistrito the catDistrito to set
*/
public void setDistritoId(Long catDistritoId) {
this.distritoId = catDistritoId;
}
/**
* @param claveDiscriminante the claveDiscriminante to set
*/
public void setClave(String claveDiscriminante) {
this.clave = claveDiscriminante;
}
/**
* @param nombreDisc the nombreDisc to set
*/
public void setNombre(String nombreDisc) {
this.nombre = nombreDisc;
}
/**
* @param tipo the tipo to set
*/
public void setTipo(Short tipo) {
this.tipo = tipo;
}
}
| [
"larryconther@gmail.com"
] | larryconther@gmail.com |
e19716a873fc876aa4595c78770640576a27a746 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/digits/08c7ea4ac39aa6a5ab206393bb4412de9d2c365ecdda9c1b391be963c1811014ed23d2722d7433b8e8a95305eee314d39da4950f31e01f9147f90af91a5c433a/000/mutations/2517/digits_08c7ea4a_000.java | eac3637a58cac56ec4a08fbd9ed68069624c0392 | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,652 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class digits_08c7ea4a_000 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
digits_08c7ea4a_000 mainClass = new digits_08c7ea4a_000 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
IntObj num = new IntObj (), numl = new IntObj (), n = new IntObj (), d0 =
new IntObj (), d1 = new IntObj (), d2 = new IntObj (), d3 =
new IntObj (), d4 = new IntObj (), d5 = new IntObj (), d6 =
new IntObj (), d7 = new IntObj (), d8 = new IntObj (), d9 =
new IntObj ();
output += (String.format ("\nEnter an integer > "));
num.value = scanner.nextInt ();
numl.value = num.value;
n.value = 0;
while (numl.value > 0) {
n.value += 1;
numl.value = numl.value / 10;
}
d0.value = num.value % 10;
num.value = (num.value - d0.value) / 10;
d1.value = num.value % 10;
num.value = 9;
d2.value = num.value % 10;
num.value = (num.value - d2.value) / 10;
d3.value = num.value % 10;
num.value = (num.value - d3.value) / 10;
d4.value = num.value % 10;
num.value = (num.value - d4.value) / 10;
d5.value = num.value % 10;
num.value = (num.value - d5.value) / 10;
d6.value = num.value % 10;
num.value = (num.value - d6.value) / 10;
d7.value = num.value % 10;
num.value = (num.value - d7.value) / 10;
d8.value = num.value % 10;
num.value = (num.value - d8.value) / 10;
d9.value = num.value % 10;
num.value = (num.value - d9.value) / 10;
output += (String.format ("%d\n", d0.value));
if (n.value > 1) {
output += (String.format ("%d\n", d1.value));
}
if (n.value > 2) {
output += (String.format ("%d\n", d2.value));
}
if (n.value > 3) {
output += (String.format ("%d\n", d3.value));
}
if (n.value > 4) {
output += (String.format ("%d\n", d4.value));
}
if (n.value > 5) {
output += (String.format ("%d\n", d5.value));
}
if (n.value > 6) {
output += (String.format ("%d\n", d6.value));
}
if (n.value > 7) {
output += (String.format ("%d\n", d7.value));
}
if (n.value > 8) {
output += (String.format ("%d\n", d8.value));
}
if (n.value > 9) {
output += (String.format ("%d\n", d9.value));
}
output += (String.format ("That's all, have a nice day!\n"));
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
88f25db1f35d74652b55818f93f618d618a75796 | 74e94b19b8a9748558bbaa2b86d4e7c6db835e2f | /core/common/src/test/java/com/comcast/redirector/common/util/UrlUtilsTest.java | 9c30eb4036a37084493130bbb844c72e118f370d | [
"Apache-2.0"
] | permissive | Comcast/redirector | b236567e2bae687e0189c2cdc45731dd8c055a1a | 6770fe01383bc7ea110c7c8e14c137212ebc0ba1 | refs/heads/master | 2021-03-27T20:48:38.988332 | 2019-09-26T08:39:18 | 2019-09-26T08:39:18 | 80,451,996 | 10 | 13 | Apache-2.0 | 2019-09-26T08:39:19 | 2017-01-30T18:50:31 | Java | UTF-8 | Java | false | false | 1,648 | java | /*
* Copyright 2017 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* 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.
*
* @author Alexander Ievstratiev (oievstratiev@productengine.com)
*/
package com.comcast.redirector.common.util;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
public class UrlUtilsTest {
@Test
public void testBuildUrl() throws Exception {
String expectedString = "http://localhost:10540/redirector/data/index.html";
String actualString = UrlUtils.buildUrl("http://localhost:10540/redirector/" , "/data/index.html");
Assert.assertEquals(expectedString, actualString);
actualString = UrlUtils.buildUrl("http://localhost:10540/redirector" , "data/index.html");
Assert.assertEquals(expectedString, actualString);
actualString = UrlUtils.buildUrl("http://localhost:10540/redirector/" , "data/index.html");
Assert.assertEquals(expectedString, actualString);
actualString = UrlUtils.buildUrl("http://localhost:10540/redirector" , "/data/index.html");
Assert.assertEquals(expectedString, actualString);
}
} | [
"mailtojp@gmail.com"
] | mailtojp@gmail.com |
edc45f16ad7c97171d7e79931ae1aed265bee6b7 | ccf82688f082e26cba5fc397c76c77cc007ab2e8 | /Mage.Tests/src/test/java/org/mage/test/cards/single/eld/RobberOfTheRichTest.java | a658ebbe87c68f9c0632f2d6075b77c140b0ca02 | [
"MIT"
] | permissive | magefree/mage | 3261a89320f586d698dd03ca759a7562829f247f | 5dba61244c738f4a184af0d256046312ce21d911 | refs/heads/master | 2023-09-03T15:55:36.650410 | 2023-09-03T03:53:12 | 2023-09-03T03:53:12 | 4,158,448 | 1,803 | 1,133 | MIT | 2023-09-14T20:18:55 | 2012-04-27T13:18:34 | Java | UTF-8 | Java | false | false | 1,801 | java | package org.mage.test.cards.single.eld;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author TheElk801
*/
public class RobberOfTheRichTest extends CardTestPlayerBase {
private static final String robber = "Robber of the Rich";
private static final String passage = "Whitesun's Passage";
private static final String blackguard = "Bane Alley Blackguard";
@Test
public void testRobber() {
removeAllCardsFromLibrary(playerB);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
addCard(Zone.BATTLEFIELD, playerA, robber);
addCard(Zone.LIBRARY, playerB, passage);
addCard(Zone.HAND, playerB, "Mountain", 3);
attack(1, playerA, robber, playerB);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, passage);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertLife(playerA, 20 + 5);
assertGraveyardCount(playerB, passage, 1);
}
@Test
public void testRobberWithOtherRogue() {
removeAllCardsFromLibrary(playerB);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
addCard(Zone.BATTLEFIELD, playerA, robber);
addCard(Zone.BATTLEFIELD, playerA, blackguard);
addCard(Zone.LIBRARY, playerB, passage, 5);
addCard(Zone.HAND, playerB, "Mountain");
attack(1, playerA, robber, playerB);
attack(3, playerA, blackguard, playerB);
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, passage);
setStrictChooseMode(true);
setStopAt(3, PhaseStep.END_TURN);
execute();
assertLife(playerA, 20 + 5);
assertGraveyardCount(playerB, passage, 1);
}
}
| [
"theelk801@gmail.com"
] | theelk801@gmail.com |
2ed1995d20e52febd317d978cff33d48c9dec1b4 | 5cbd61c34f79b99724b886d6c140cdfc2235d6e9 | /schemacrawler-api/src/main/java/schemacrawler/schema/SchemaReference.java | fa12c17a27562f52ac89973724d8bd0707ab10fb | [] | no_license | WolfyD/SchemaCrawler | c6be5b3d64720355f5d4bd6dce8da540e16175c7 | bd18a81c91f41d989c58442ce067d5b99f0aebf1 | refs/heads/master | 2020-04-15T14:20:07.540430 | 2019-01-08T05:10:43 | 2019-01-08T05:10:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,807 | java | /*
========================================================================
SchemaCrawler
http://www.schemacrawler.com
Copyright (c) 2000-2019, Sualeh Fatehi <sualeh@hotmail.com>.
All rights reserved.
------------------------------------------------------------------------
SchemaCrawler 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.
SchemaCrawler and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0, GNU General Public License
v3 or GNU Lesser General Public License v3.
You may elect to redistribute this code under any of these licenses.
The Eclipse Public License is available at:
http://www.eclipse.org/legal/epl-v10.html
The GNU General Public License v3 and the GNU Lesser General Public
License v3 are available at:
http://www.gnu.org/licenses/
========================================================================
*/
package schemacrawler.schema;
import static sf.util.Utility.convertForComparison;
import static sf.util.Utility.isBlank;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import schemacrawler.utility.Identifiers;
public final class SchemaReference
implements Schema
{
private static final long serialVersionUID = -5309848447599233878L;
private final String catalogName;
private final String schemaName;
private transient String fullName;
private final Map<String, Object> attributeMap = new HashMap<>();
public SchemaReference()
{
this(null, null);
}
public SchemaReference(final String catalogName, final String schemaName)
{
this.catalogName = catalogName;
this.schemaName = schemaName;
}
@Override
public int compareTo(final NamedObject otherSchemaRef)
{
if (otherSchemaRef == null)
{
return -1;
}
else
{
return convertForComparison(getFullName())
.compareTo(convertForComparison(otherSchemaRef.getFullName()));
}
}
@Override
public boolean equals(final Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final SchemaReference other = (SchemaReference) obj;
if (attributeMap == null)
{
if (other.attributeMap != null)
{
return false;
}
}
else if (!attributeMap.equals(other.attributeMap))
{
return false;
}
if (catalogName == null)
{
if (other.catalogName != null)
{
return false;
}
}
else if (!catalogName.equals(other.catalogName))
{
return false;
}
if (schemaName == null)
{
if (other.schemaName != null)
{
return false;
}
}
else if (!schemaName.equals(other.schemaName))
{
return false;
}
return true;
}
/**
* {@inheritDoc}
*/
@Override
public final <T> T getAttribute(final String name)
{
return getAttribute(name, (T) null);
}
/**
* {@inheritDoc}
*/
@Override
public final <T> T getAttribute(final String name, final T defaultValue)
{
final Object attributeValue = attributeMap.get(name);
if (attributeValue == null)
{
return defaultValue;
}
else
{
try
{
return (T) attributeValue;
}
catch (final ClassCastException e)
{
return defaultValue;
}
}
}
/**
* {@inheritDoc}
*/
@Override
public final Map<String, Object> getAttributes()
{
return Collections.unmodifiableMap(attributeMap);
}
@Override
public String getCatalogName()
{
return catalogName;
}
@Override
public String getFullName()
{
buildFullName();
return fullName;
}
@Override
public String getName()
{
return schemaName;
}
@Override
public String getRemarks()
{
return "";
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasAttribute(final String name)
{
return attributeMap.containsKey(name);
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result
+ (attributeMap == null? 0: attributeMap.hashCode());
result = prime * result + (catalogName == null? 0: catalogName.hashCode());
result = prime * result + (schemaName == null? 0: schemaName.hashCode());
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean hasRemarks()
{
return false;
}
/**
* {@inheritDoc}
*/
@Override
public final <T> Optional<T> lookupAttribute(final String name)
{
return Optional.of(getAttribute(name));
}
/**
* {@inheritDoc}
*/
@Override
public final void removeAttribute(final String name)
{
if (!isBlank(name))
{
attributeMap.remove(name);
}
}
/**
* {@inheritDoc}
*/
@Override
public final void setAttribute(final String name, final Object value)
{
if (!isBlank(name))
{
if (value == null)
{
attributeMap.remove(name);
}
else
{
attributeMap.put(name, value);
}
}
}
@Override
public String toString()
{
return getFullName();
}
@Override
public List<String> toUniqueLookupKey()
{
return new ArrayList<>(Arrays.asList(catalogName, schemaName));
}
private void buildFullName()
{
if (fullName != null)
{
return;
}
final Identifiers identifiers = Identifiers.identifiers()
.withIdentifierQuoteString("\"").build();
fullName = identifiers.quoteFullName(this);
}
}
| [
"sualeh@hotmail.com"
] | sualeh@hotmail.com |
64170a09b61fda4ac28e0be684cce4c4cc8ebd91 | 5fb9d5cd069f9df099aed99516092346ee3cf91a | /jira/src/main/java/org/teiid/test/teiid4455/sql/ExampleOfSelect.java | 9dedc2652099723a8e1c73f41e66ef7a09d19cb4 | [] | no_license | kylinsoong/teiid-test | 862e238e055481dfb14fb84694b316ae74174467 | ea5250fa372c7153ad6e9a0c344fdcfcf10800cc | refs/heads/master | 2021-04-19T00:31:41.173819 | 2017-10-09T06:41:00 | 2017-10-09T06:41:00 | 35,716,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 952 | java | package org.teiid.test.teiid4455.sql;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.sql.lang.Select;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.GroupSymbol;
public class ExampleOfSelect {
public static void main(String[] args) {
GroupSymbol group = new GroupSymbol("A", "Accounts.PRODUCT");
ElementSymbol id = new ElementSymbol("ID", group);
id.setType(DataTypeManager.DefaultDataClasses.STRING);
ElementSymbol symbol = new ElementSymbol("SYMBOL", group);
symbol.setType(DataTypeManager.DefaultDataClasses.STRING);
ElementSymbol name = new ElementSymbol("COMPANY_NAME", group);
symbol.setType(DataTypeManager.DefaultDataClasses.STRING);
Select select = new Select();
select.addSymbol(id);
select.addSymbol(symbol);
select.addSymbol(name);
System.out.println(select);
}
}
| [
"kylinsoong.1214@gmail.com"
] | kylinsoong.1214@gmail.com |
6c3983c65e675433968be2f5a357c90f6654856f | 30e7f2ef9dc19f8ed89aed849bdbb2a38e126a0a | /src/main/java/org/sola/common/NumberUtility.java | 74e62ec6ca800025241331393f00ee7ab0509b68 | [] | no_license | SOLA-NIGERIA-APPO/common | 3040323c8056e0cd1917cac35b0822fcb486a63a | d9aecf7d1c681ef52db8c1869adad15adb3a5c9f | refs/heads/master | 2016-10-19T17:23:34.828782 | 2014-12-05T16:17:28 | 2014-12-05T16:17:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,292 | java | /**
* ******************************************************************************************
* Copyright (C) 2012 - Food and Agriculture Organization of the United Nations (FAO).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,this list
* of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,this list
* of conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
* 3. Neither the name of FAO nor the names of its contributors may be used to endorse or
* promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,STRICT LIABILITY,OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *********************************************************************************************
*/
package org.sola.common;
public class NumberUtility {
/**
* Returns the rounded double number with a given precision.
*
* @param number Number to round
* @param precision The precision of rounding
* @return Rounded double with a given precision.
*/
public static double roundDouble(double number, int precision) {
int temp = (int) ((number * Math.pow(10, precision)));
return (((double) temp) / Math.pow(10, precision));
}
}
| [
"armcdowell@hotmail.com"
] | armcdowell@hotmail.com |
3123cd3b92d4a8fec23214b092f0fdb45a5338e6 | 4729436d43e2eea66778ef630ea4c05fbc2a47e2 | /spring-security-oauth2-server-ldap/src/test/java/com/hendisantika/springsecurityoauth2serverldap/SpringSecurityOauth2ServerLdapApplicationTests.java | 02526e50288805bc28046a10cadd8bb16c20b047 | [] | no_license | hendisantika/SpringSecurityOAuth2LDAP | f5d921ee0b8fb7fd8d92e1eb0ccea69fe1ed6128 | ba037b966109d77bae04d7bfba14f58fb331664f | refs/heads/master | 2022-06-18T00:14:13.258343 | 2022-06-04T03:41:48 | 2022-06-04T03:41:48 | 238,330,566 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 272 | java | package com.hendisantika.springsecurityoauth2serverldap;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringSecurityOauth2ServerLdapApplicationTests {
@Test
void contextLoads() {
}
}
| [
"hendisantika@gmail.com"
] | hendisantika@gmail.com |
90eb891109c90dc8e5e1de75a10035c7ebdc9523 | 038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad | /schemaOrgGson/src/org/kyojo/schemaorg/m3n4/gson/core/container/IsVariantOfDeserializer.java | 1ca20b75c1fe708af0d3eaa116f97e9782fcc170 | [
"Apache-2.0"
] | permissive | nagaikenshin/schemaOrg | 3dec1626781913930da5585884e3484e0b525aea | 4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8 | refs/heads/master | 2021-06-25T04:52:49.995840 | 2019-05-12T06:22:37 | 2019-05-12T06:22:37 | 134,319,974 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,050 | java | package org.kyojo.schemaorg.m3n4.gson.core.container;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import org.kyojo.gson.JsonDeserializationContext;
import org.kyojo.gson.JsonDeserializer;
import org.kyojo.gson.JsonElement;
import org.kyojo.gson.JsonParseException;
import org.kyojo.schemaorg.m3n4.core.impl.IS_VARIANT_OF;
import org.kyojo.schemaorg.m3n4.core.Container.IsVariantOf;
import org.kyojo.schemaorg.m3n4.gson.DeserializerTemplate;
public class IsVariantOfDeserializer implements JsonDeserializer<IsVariantOf> {
public static Map<String, Field> fldMap = new HashMap<>();
@Override
public IsVariantOf deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context)
throws JsonParseException {
if(jsonElement.isJsonPrimitive()) {
return new IS_VARIANT_OF(jsonElement.getAsString());
}
return DeserializerTemplate.deserializeSub(jsonElement, type, context,
new IS_VARIANT_OF(), IsVariantOf.class, IS_VARIANT_OF.class, fldMap);
}
}
| [
"nagai@nagaikenshin.com"
] | nagai@nagaikenshin.com |
8cc5b3b3652e8cc1987e7e818cea3456d757b0e5 | be5aeb3d2a4099aa5e9caeab6841b495ff8ae214 | /2.JavaCore/src/com/javarush/task/task20/task2001/Solution.java | 55cd43bc4b4cc89cf2a4e9b0a3fbe02ebc626b31 | [] | no_license | bass-2000/JavaRush_tasks | 14da58e3ab6b3106f4d71ec9027d822d9ed53b08 | 6ca70f3021edf6404b12f4bc99800ff94c376509 | refs/heads/master | 2020-03-21T03:40:10.705370 | 2018-12-17T07:26:41 | 2018-12-17T07:26:41 | 138,067,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,079 | java | package com.javarush.task.task20.task2001;
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/*
Читаем и пишем в файл: Human
*/
public class Solution {
public static void main(String[] args) {
//исправьте outputStream/inputStream в соответствии с путем к вашему реальному файлу
try {
File your_file_name = File.createTempFile("your_file_name", null);
OutputStream outputStream = new FileOutputStream(your_file_name);
InputStream inputStream = new FileInputStream(your_file_name);
Human ivanov = new Human("Ivanov", new Asset("home", 999_999.99), new Asset("car", 2999.99));
ivanov.save(outputStream);
outputStream.flush();
Human somePerson = new Human();
somePerson.load(inputStream);
inputStream.close();
//check here that ivanov equals to somePerson - проверьте тут, что ivanov и somePerson равны
} catch (IOException e) {
//e.printStackTrace();
System.out.println("Oops, something wrong with my file");
} catch (Exception e) {
//e.printStackTrace();
System.out.println("Oops, something wrong with save/load method");
}
}
public static class Human {
public String name;
public List<Asset> assets = new ArrayList<>();
public Human() {
}
public Human(String name, Asset... assets) {
this.name = name;
if (assets != null) {
this.assets.addAll(Arrays.asList(assets));
}
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Human human = (Human) o;
if (name != null ? !name.equals(human.name) : human.name != null) return false;
return assets != null ? assets.equals(human.assets) : human.assets == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (assets != null ? assets.hashCode() : 0);
return result;
}
public void save(OutputStream outputStream) throws Exception {
PrintWriter printWriter = new PrintWriter(outputStream);
printWriter.println(name);//первая строка сейва
if (!assets.isEmpty()) {
printWriter.println("yes"); //вторая строка - наличие активов
for (Asset asset : assets) {
printWriter.println(asset.getName()); //третья строка
printWriter.println(String.valueOf(asset.getPrice())); //четвертая строка
}
}
else printWriter.println("no");
printWriter.close();
}
public void load(InputStream inputStream) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
this.name = reader.readLine();//1 строка
String areThereAssets = reader.readLine();//2 строка
if (areThereAssets.equals("yes")) {
String line;
StringBuilder sb = new StringBuilder();
while ((line = reader.readLine()) != null) {
sb.append(line).append(System.getProperty("line.separator"));//считываю построчно с разделителями строк
}
String[] splitted = sb.toString().split(System.getProperty("line.separator"));
for (int i = 0; i < splitted.length; i = i + 2){ //0, 2, 4
assets.add(new Asset(splitted[i], Double.parseDouble(splitted[i+1])));
}
}
reader.close();
}
}
}
| [
"bass-2000@yandex.ru"
] | bass-2000@yandex.ru |
f8653ce6035ab1ceee3fc2e4d20fcb525e71b097 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-ws/results/XWIKI-14263-113-7-Single_Objective_GGA-WeightedSum/org/xwiki/container/servlet/filters/internal/SetHTTPHeaderFilter_ESTest.java | 90525474ecfcc5720ffe400a01f0bbfaef80c74a | [
"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 | 589 | java | /*
* This file was automatically generated by EvoSuite
* Wed Apr 01 04:56:38 UTC 2020
*/
package org.xwiki.container.servlet.filters.internal;
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(useVFS = true, useJEE = true)
public class SetHTTPHeaderFilter_ESTest extends SetHTTPHeaderFilter_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
f7f3e262f75861bc28dc02456a08410dd7c9fc74 | 94420e1830713a858e6d8146f52a3db724bf73fa | /design-patterns/src/main/java/com/bucur/solid/open_closed/after/Addition.java | 9b9dab12d74fc18bd19558d87c9d6b82552d3529 | [] | no_license | cosminbucur/sda-group11 | 2c484450a7ead615668cb11e80cf193e622b77a3 | b8a5ca8281ea278304d160abda1402f60da4e29b | refs/heads/master | 2022-11-08T01:32:52.561265 | 2020-08-06T14:01:45 | 2020-08-06T14:01:45 | 195,676,785 | 3 | 0 | null | 2022-10-30T04:00:55 | 2019-07-07T17:03:31 | Java | UTF-8 | Java | false | false | 455 | java | package com.bucur.solid.open_closed.after;
public class Addition implements IOperation {
private double firstOperand;
private double secondOperand;
private double result;
public Addition(double firstOperand, double secondOperand) {
this.firstOperand = firstOperand;
this.secondOperand = secondOperand;
}
@Override
public void performOperation() {
this.result = firstOperand + secondOperand;
}
}
| [
"cosmin.bucur@orange.com"
] | cosmin.bucur@orange.com |
1cd6f2ee908f0de7ff9538f6a9e0617872a6de56 | bd7d4e2720410d8b532ca43f09b56a16e5078170 | /src/main/java/io/github/vampirestudios/hgm/core/Laptop.java | 0cc3095a7d76afb2023a316b19dff8d7bea0cdfb | [
"MIT",
"CC0-1.0"
] | permissive | vampire-studios/HuskysGadgetMod-Fabric | 88d3d88f65c36f052d1651a366bd9314a2bcb885 | 841f19e40e13da3ed93f36dbd1cd0723d27ab2f4 | refs/heads/master | 2023-05-01T16:53:00.720709 | 2019-08-13T13:58:08 | 2019-08-13T13:58:08 | 200,518,737 | 0 | 1 | NOASSERTION | 2019-08-10T22:22:03 | 2019-08-04T16:53:55 | Java | UTF-8 | Java | false | false | 432 | java | package io.github.vampirestudios.hgm.core;
import io.github.vampirestudios.hgm.block.entity.LaptopBlockEntity;
import io.github.vampirestudios.hgm.core.operation_systems.NeonOS;
public class Laptop extends BaseDevice {
private static Laptop instance = new Laptop();
public static final TaskBar taskBar = new TaskBar(instance);
public Laptop() {
super(new LaptopBlockEntity(), new NeonOS(taskBar));
}
}
| [
"sindrefagerheim53@gmail.com"
] | sindrefagerheim53@gmail.com |
30666c1acd90ffc86df94b8eeebc95c18088118e | 49005e95a50bbcb78aff2695a452b781640116b0 | /citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/party/pagemode/PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl.java | f34e48ef7addb83bb8566666450877bd36da7999 | [
"Apache-2.0"
] | permissive | PentestinGxRoot/cia | cada163ca23c2a7c9bfa39b8068be4059298c648 | b5eff7894fb68fb0f0b20e8f703b503682e8f37e | refs/heads/master | 2022-08-11T13:11:48.031303 | 2017-07-05T11:36:46 | 2017-07-05T11:36:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,603 | java | /*
* Copyright 2014 James Pether Sörling
*
* 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.
*
* $Id$
* $HeadURL$
*/
package com.hack23.cia.web.impl.ui.application.views.user.party.pagemode;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Service;
import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup;
import com.hack23.cia.web.impl.ui.application.action.ViewAction;
import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartDataManager;
import com.hack23.cia.web.impl.ui.application.views.common.dataseriesfactory.api.PartyDataSeriesFactory;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews;
import com.vaadin.ui.Layout;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.Panel;
import com.vaadin.v7.ui.HorizontalLayout;
import com.vaadin.v7.ui.VerticalLayout;
/**
* The Class PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl.
*/
@Service
public final class PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl extends AbstractPartyRankingPageModContentFactoryImpl {
/** The Constant CHARTS. */
private static final String CHARTS = "Charts:";
/** The Constant NAME. */
public static final String NAME = UserViews.PARTY_RANKING_VIEW_NAME;
/** The chart data manager. */
@Autowired
private ChartDataManager chartDataManager;
/** The data series factory. */
@Autowired
private PartyDataSeriesFactory dataSeriesFactory;
/**
* Instantiates a new party ranking current government charts page mod
* content factory impl.
*/
public PartyRankingCurrentGovernmentChartsPageModContentFactoryImpl() {
super();
}
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout panelContent = createPanelContent();
final String pageId = getPageId(parameters);
getPartyRankingMenuItemFactory().createPartyRankingMenuBar(menuBar);
final HorizontalLayout chartLayout = new HorizontalLayout();
chartLayout.setSizeFull();
chartDataManager.createChartPanel(chartLayout,dataSeriesFactory.createChartTimeSeriesCurrentGovernmentByParty(),"Current Government");
panelContent.addComponent(chartLayout);
panel.setCaption(NAME + "::" + CHARTS + parameters);
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARTY_RANKING_VIEW, ApplicationEventGroup.USER, NAME,
parameters, pageId);
return panelContent;
}
@Override
public boolean matches(final String page, final String parameters) {
return NAME.equals(page) && !StringUtils.isEmpty(parameters) && parameters.contains(PageMode.CHARTS.toString())
&& parameters.contains(ChartIndicators.CURRENTGOVERMENTPARTIES.toString());
}
}
| [
"pether.sorling@gmail.com"
] | pether.sorling@gmail.com |
19280478590ebe2fc29e2d37b086adff14884097 | fca9096ae40e7b3311358e4ee92cc512f6811e71 | /src/com/cw/wizbank/newmessage/MessageModule.java | 83fd52dfd11cc24fc774a699f624c8cae4e97e0d | [] | no_license | Conanjun/HK_CPDT | 0c3d1c00d8c3c02b5493cb3168e84e0693633d12 | 0cb797aff03fd4e8c24458c8f78d71a19c788829 | refs/heads/master | 2022-12-27T16:45:37.746697 | 2019-06-17T14:21:16 | 2019-06-17T14:21:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,889 | java | package com.cw.wizbank.newmessage;
import java.io.File;
import java.io.IOException;
import java.sql.SQLException;
import com.cw.wizbank.ServletModule;
import com.cw.wizbank.accesscontrol.AccessControlWZB;
import com.cw.wizbank.qdb.dbUtils;
import com.cw.wizbank.qdb.qdbException;
import com.cw.wizbank.util.cwException;
import com.cw.wizbank.newmessage.entity.*;
import com.cwn.wizbank.security.AclFunction;
import com.cwn.wizbank.utils.CommonLog;
public class MessageModule extends ServletModule {
MessageModuleParam modParam;
public static final String MOD_NAME = "message_module";
public static final String FTN_MESSAGE_MGT = AclFunction.FTN_AMD_MESSAGE_TEMPLATE_MAIN;
public static final String UPD_SUCCESS = "GEN003";
public static final String UPD_FAIL = "GEN006";
public static final String NOT_TO_VIEW = "1136";
public MessageModule() {
super();
modParam = new MessageModuleParam();
param = modParam;
}
public void process() throws SQLException, IOException, cwException {
if (this.prof == null || this.prof.usr_ent_id == 0) {
//发邮件
if( param.getCmd().equalsIgnoreCase("send_msg") ) {
MessageService.sendMessage(con, modParam.msg_id, static_env);
out.println("end");
return;
} else {
response.sendRedirect(static_env.URL_SESSION_TIME_OUT);
}
} else {
try {
MessageService msgService = new MessageService();
AccessControlWZB acl = new AccessControlWZB();
// list
if (param.getCmd().equalsIgnoreCase("get_msg_template_list") || param.getCmd().equalsIgnoreCase("get_msg_template_list_xml")) {
if (!AccessControlWZB.hasRolePrivilege(prof.current_role, new String []{AclFunction.FTN_AMD_MESSAGE_TEMPLATE_MAIN})) {
sysMsg = getErrorMsg("ACL002", param.getUrl_failure());
return;
}
StringBuffer xml = new StringBuffer("");
xml.append(msgService.getAllTemplate2Xml(con, modParam, prof));
resultXml = formatXML(xml.toString(), MOD_NAME);
}
// view
else if (param.getCmd().equalsIgnoreCase("get_msg_template_view") || param.getCmd().equalsIgnoreCase("get_msg_template_view_xml")) {
if (!AccessControlWZB.hasRolePrivilege(prof.current_role, new String []{AclFunction.FTN_AMD_MESSAGE_TEMPLATE_MAIN})) {
sysMsg = getErrorMsg("ACL002", param.getUrl_failure());
return;
}
String xml = "";
if (modParam.getMtp_id() > 0) {
xml = msgService.getTemplateDetailXML(con, modParam.getMtp_id(), ("message_template_upd.xsl").equalsIgnoreCase(modParam.getStylesheet()));
} else {
sysMsg = getErrorMsg(NOT_TO_VIEW, param.getUrl_failure());
return;
}
resultXml = formatXML(xml, MOD_NAME);
}
// update template
else if (param.getCmd().equalsIgnoreCase("upd_msg_template")) {
if (!AccessControlWZB.hasRolePrivilege(prof.current_role, new String []{AclFunction.FTN_AMD_MESSAGE_TEMPLATE_MAIN})) {
sysMsg = getErrorMsg("ACL002", param.getUrl_failure());
return;
}
String saveDirPath = "";
long mtpId = 0;
if (modParam.getMtp_id() > 0) {
mtpId = modParam.getMtp_id();
if (MessageTemplate.isExist(con, mtpId)) {
msgService.updateTemplate(con, wizbini, prof, modParam, multi);
sysMsg = getErrorMsg(UPD_SUCCESS, param.getUrl_success());
} else {
sysMsg = getErrorMsg(UPD_FAIL, param.getUrl_failure());
return;
}
}
try {
File dir = new File(saveDirPath);
if (!dir.exists()) {
dir.mkdirs();
}
dbUtils.copyDir(tmpUploadPath, saveDirPath);
} catch (qdbException e) {
CommonLog.error(e.getMessage(),e);
throw new cwException(e.getMessage());
}
if (mtpId > 0) {
modParam.setMtp_id(mtpId);
}
}
}catch (Exception e) {
CommonLog.error(e.getMessage(),e);
}
}
}
}
| [
"13450871516@163.com"
] | 13450871516@163.com |
31c590c1dde0c1a518dc6e2704b43f0eae20a744 | 209b4f34c2f89a762f78193675bd8addf76620bb | /PlayerVideo/app/src/main/java/p067c/google/p134b/p135a/Splitter.java | 2fe8b5135fc4ae0d788c0e6eadf1afbd1e374f41 | [] | no_license | xingchongzhu/apktool | 1b0ed3ced42cb28fa072439785e744370963aee6 | 3c2d79368f32e323168d0a2a59c6b73fc83d4d56 | refs/heads/main | 2023-08-13T11:31:12.616682 | 2021-09-14T12:00:39 | 2021-09-14T12:00:39 | 404,994,078 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,698 | java | package p067c.google.p134b.p135a;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/* renamed from: c.a.b.a.i */
public final class Splitter {
/* access modifiers changed from: private */
/* renamed from: a */
public final CharMatcher f9747a;
/* access modifiers changed from: private */
/* renamed from: b */
public final boolean f9748b;
/* renamed from: c */
private final C1324c f9749c;
/* access modifiers changed from: private */
/* renamed from: d */
public final int f9750d;
/* renamed from: c.a.b.a.i$a */
/* compiled from: Splitter */
static class C1321a implements C1324c {
/* renamed from: a */
final /* synthetic */ CharMatcher f9751a;
/* renamed from: c.a.b.a.i$a$a */
/* compiled from: Splitter */
class C1322a extends C1323b {
C1322a(Splitter iVar, CharSequence charSequence) {
super(iVar, charSequence);
}
/* access modifiers changed from: 0000 */
/* renamed from: e */
public int mo8111e(int i) {
return i + 1;
}
/* access modifiers changed from: 0000 */
/* renamed from: f */
public int mo8112f(int i) {
return C1321a.this.f9751a.mo8102c(this.f9753c, i);
}
}
C1321a(CharMatcher bVar) {
this.f9751a = bVar;
}
/* renamed from: b */
public C1323b mo8109a(Splitter iVar, CharSequence charSequence) {
return new C1322a(iVar, charSequence);
}
}
/* renamed from: c.a.b.a.i$b */
/* compiled from: Splitter */
private static abstract class C1323b extends AbstractIterator<String> {
/* renamed from: c */
final CharSequence f9753c;
/* renamed from: d */
final CharMatcher f9754d;
/* renamed from: e */
final boolean f9755e;
/* renamed from: f */
int f9756f = 0;
/* renamed from: g */
int f9757g;
protected C1323b(Splitter iVar, CharSequence charSequence) {
this.f9754d = iVar.f9747a;
this.f9755e = iVar.f9748b;
this.f9757g = iVar.f9750d;
this.f9753c = charSequence;
}
/* access modifiers changed from: protected */
/* renamed from: d */
public String mo8096a() {
int i;
int i2 = this.f9756f;
while (true) {
int i3 = this.f9756f;
if (i3 == -1) {
return (String) mo8097b();
}
int f = mo8112f(i3);
if (f == -1) {
f = this.f9753c.length();
this.f9756f = -1;
} else {
this.f9756f = mo8111e(f);
}
int i4 = this.f9756f;
if (i4 == i2) {
int i5 = i4 + 1;
this.f9756f = i5;
if (i5 > this.f9753c.length()) {
this.f9756f = -1;
}
} else {
while (i2 < f && this.f9754d.mo8103e(this.f9753c.charAt(i2))) {
i2++;
}
while (i > i2 && this.f9754d.mo8103e(this.f9753c.charAt(i - 1))) {
f = i - 1;
}
if (!this.f9755e || i2 != i) {
int i6 = this.f9757g;
} else {
i2 = this.f9756f;
}
}
}
int i62 = this.f9757g;
if (i62 == 1) {
i = this.f9753c.length();
this.f9756f = -1;
while (i > i2 && this.f9754d.mo8103e(this.f9753c.charAt(i - 1))) {
i--;
}
} else {
this.f9757g = i62 - 1;
}
return this.f9753c.subSequence(i2, i).toString();
}
/* access modifiers changed from: 0000 */
/* renamed from: e */
public abstract int mo8111e(int i);
/* access modifiers changed from: 0000 */
/* renamed from: f */
public abstract int mo8112f(int i);
}
/* renamed from: c.a.b.a.i$c */
/* compiled from: Splitter */
private interface C1324c {
/* renamed from: a */
Iterator<String> mo8109a(Splitter iVar, CharSequence charSequence);
}
private Splitter(C1324c cVar) {
this(cVar, false, CharMatcher.m11632f(), Integer.MAX_VALUE);
}
/* renamed from: d */
public static Splitter m11660d(char c) {
return m11661e(CharMatcher.m11631d(c));
}
/* renamed from: e */
public static Splitter m11661e(CharMatcher bVar) {
C1320g.m11650i(bVar);
return new Splitter(new C1321a(bVar));
}
/* renamed from: g */
private Iterator<String> m11662g(CharSequence charSequence) {
return this.f9749c.mo8109a(this, charSequence);
}
/* renamed from: f */
public List<String> mo8108f(CharSequence charSequence) {
C1320g.m11650i(charSequence);
Iterator g = m11662g(charSequence);
ArrayList arrayList = new ArrayList();
while (g.hasNext()) {
arrayList.add(g.next());
}
return Collections.unmodifiableList(arrayList);
}
private Splitter(C1324c cVar, boolean z, CharMatcher bVar, int i) {
this.f9749c = cVar;
this.f9748b = z;
this.f9747a = bVar;
this.f9750d = i;
}
}
| [
"hczh02@royole.com"
] | hczh02@royole.com |
cc94469624b3fa91fd56ca150d01de970552e738 | 7f64d769865cab67a76ce084f030f01b6498bc64 | /src/lec17/v4/BalanceButton.java | 55e486e002442778240268954c5d0b5e1866a4c4 | [] | no_license | Fall2019COMP401-001/Lec17 | 198897809adb588375262db347e39f0736407031 | 0c03203d5f11f7ffa828770b86f826c5055fb52f | refs/heads/master | 2020-09-08T04:16:54.658868 | 2019-11-11T16:19:07 | 2019-11-11T16:19:07 | 221,013,962 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package lec17.v4;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
public class BalanceButton extends JButton implements ActionListener {
private Account account;
public BalanceButton(Account account) {
super("Balance");
this.account = account;
addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent arg0) {
System.out.println("Current balance is: " + account.getBalance());
}
}
| [
"kmp@cs.unc.edu"
] | kmp@cs.unc.edu |
90a233d719010ae58a6da22b930a1cdfd8e6ec9c | 349de604fa3b72a9fc4097b749ef7efe8546b71a | /travelagency-wicket/src/test/java/ca/travelagency/components/javascript/ConfirmDialogTest.java | 49379bd63968de0188733468a17345bab5cd5ab0 | [
"Apache-2.0"
] | permissive | Intelliware/travelagency-heroku | 347e9d2a28a4918580c7fb1a447304400710b37c | 70252b7d889fcbf2b7536ce09021da9528cfcc44 | refs/heads/master | 2021-01-10T19:50:53.610422 | 2014-01-21T17:05:15 | 2014-01-21T17:05:15 | 16,108,008 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,003 | java | /**
* Copyright (C) 2010 - 2014 VREM Software Development <VREMSoftwareDevelopment@gmail.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 ca.travelagency.components.javascript;
import org.apache.wicket.Component;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class ConfirmDialogTest {
@Mock private Component component;
private static final String THIS_MY_MESSAGE = "THIS MY MESSAGE";
private ConfirmDialog fixture;
@Before
public void setUp() throws Exception {
fixture = new ConfirmDialog(THIS_MY_MESSAGE);
}
@Test
public void testPreconditionJS() throws Exception {
// execute
CharSequence actual = fixture.getPrecondition(component);
// validate
Assert.assertEquals(ConfirmDialog.PREFIX+THIS_MY_MESSAGE+ConfirmDialog.POSTFIX, actual.toString());
}
@Test
public void testEmptyJS() throws Exception {
// execute & validate
Assert.assertNull(fixture.getAfterHandler(component));
Assert.assertNull(fixture.getBeforeHandler(component));
Assert.assertNull(fixture.getBeforeSendHandler(component));
Assert.assertNull(fixture.getCompleteHandler(component));
Assert.assertNull(fixture.getFailureHandler(component));
Assert.assertNull(fixture.getSuccessHandler(component));
}
}
| [
"VREMSoftwareDevelopment@gmail.com"
] | VREMSoftwareDevelopment@gmail.com |
c1091b54b741aa42e7e80253fcc3a7974251d22c | 895ea02e9fbbbddccd2f550769600608a5ce26bf | /CoreGraph/src/au/gov/asd/tac/constellation/graph/schema/SchemaAttributeUtilities.java | d5e8428dde7c1e5637b1dd8de8e6727e20f4d214 | [
"Apache-2.0"
] | permissive | sol695510/constellation | 8e26a739a8ae09755f1ff2061206d13566d8b432 | 9ab9e0cc3a0bb673204d74d5b017453a882845a0 | refs/heads/master | 2020-12-19T13:40:11.523350 | 2020-03-16T22:31:41 | 2020-03-16T22:31:41 | 226,787,694 | 1 | 0 | Apache-2.0 | 2019-12-20T00:16:47 | 2019-12-09T04:54:54 | null | UTF-8 | Java | false | false | 7,229 | java | /*
* Copyright 2010-2019 Australian Signals Directorate
*
* 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 au.gov.asd.tac.constellation.graph.schema;
import au.gov.asd.tac.constellation.graph.GraphElementType;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* A collection of utilities for interrogation of all available
* {@link SchemaAttribute} objects.
*
* @author cygnus_x-1
*/
public class SchemaAttributeUtilities {
private static final Collection<SchemaAttribute> SCHEMA_VERTEX_ATTRIBUTES = new ArrayList<>();
private static final Collection<SchemaAttribute> SCHEMA_TRANSACTION_ATTRIBUTES = new ArrayList<>();
private static synchronized void buildAttributes() {
if (SCHEMA_VERTEX_ATTRIBUTES.isEmpty() || SCHEMA_TRANSACTION_ATTRIBUTES.isEmpty()) {
SchemaConceptUtilities.getAttributes().forEach((conceptClass, schemaAttributes) -> {
schemaAttributes.forEach(schemaAttribute -> {
switch (schemaAttribute.getElementType()) {
case VERTEX:
SCHEMA_VERTEX_ATTRIBUTES.add(schemaAttribute);
break;
case TRANSACTION:
SCHEMA_TRANSACTION_ATTRIBUTES.add(schemaAttribute);
break;
}
});
});
}
}
/**
* Get all {@link SchemaAttribute} objects for the specified
* {@link GraphElementType}.
*
*
* @param elementType The element type
* @return A {@link List} of all discovered {@link SchemaAttribute}.
*/
@SuppressWarnings("unchecked") // unchecked cast error cause by Empty set : this is fine.
public static Collection<SchemaAttribute> getAttributes(final GraphElementType elementType) {
buildAttributes();
switch (elementType) {
case VERTEX:
return Collections.unmodifiableCollection(SCHEMA_VERTEX_ATTRIBUTES);
case TRANSACTION:
return Collections.unmodifiableCollection(SCHEMA_TRANSACTION_ATTRIBUTES);
default:
return Collections.EMPTY_SET;
}
}
/**
* Get all {@link SchemaAttribute} from the SchemaConcept of the specified
* {@link Class}.
*
* @param elementType The element type
* @param fromConcept The SchemaConcept from which to retrieve
* {@link SchemaAttribute} objects.
* @return A {@link List} of all discovered {@link SchemaAttribute}.
*/
public static Collection<SchemaAttribute> getAttributes(final GraphElementType elementType, Class<? extends SchemaConcept> fromConcept) {
if (fromConcept == null) {
return getAttributes(elementType);
}
final Set<Class<? extends SchemaConcept>> conceptList = new HashSet<>();
conceptList.add(fromConcept);
return getAttributes(elementType, conceptList);
}
/**
* Find all {@link SchemaAttribute} instances held by the specified List of
* SchemaConcept instances, removing any overridden types along the way.
*
* @param elementType The element type
* @param fromConcepts A {@link List} of {@link Class} objects for the set
* of SchemaConcept from which you want held {@link SchemaAttribute}
* objects.
* @return A {@link Collection} of {@link SchemaAttribute}.
*/
public static Collection<SchemaAttribute> getAttributes(final GraphElementType elementType, Set<Class<? extends SchemaConcept>> fromConcepts) {
if (fromConcepts == null) {
return getAttributes(elementType);
}
// Add all the types from all the concepts that match the desired concept classes
final Set<SchemaAttribute> attributes = new HashSet<>();
SchemaConceptUtilities.getAttributes().forEach((conceptClass, schemaAttributes) -> {
if (fromConcepts.contains(conceptClass)) {
schemaAttributes.forEach(schemaAttribute -> {
if (elementType.equals(schemaAttribute.getElementType())) {
attributes.add(schemaAttribute);
}
});
}
});
return Collections.unmodifiableCollection(attributes);
}
/**
* Get a {@link SchemaAttribute} held by a registered {@link SchemaConcept}
* by name. Note that if more than one type exists with the specified name,
* then one will be chosen arbitrarily.
*
* @param elementType The element type
* @param name A {@link String} representing the name of the
* {@link SchemaAttribute} you wish to find.
* @return A {@link SchemaAttribute} with the specified name if it could be
* found, otherwise null.
*/
public static SchemaAttribute getAttribute(final GraphElementType elementType, String name) {
return getAttribute(elementType, name, null);
}
/**
* Get a {@link SchemaAttribute} held by the {@link SchemaConcept} of the
* specified {@link Class} by name. Note that if more than one type exists
* in the specified concepts with the specified name, then one will be
* chosen arbitrarily.
*
* @param elementType The element type
* @param name A {@link String} representing the name of the
* {@link SchemaAttribute} you wish to find.
* @param fromConcept A {@link Class} object describing the
* {@link SchemaConcept} you wish to search against.
* @return A {@link SchemaAttribute} with the specified name if it could be
* found, otherwise null.
*/
public static SchemaAttribute getAttribute(final GraphElementType elementType, String name, Class<? extends SchemaConcept> fromConcept) {
if (name == null) {
return null;
}
for (SchemaAttribute schemaAttribute : getAttributes(elementType, fromConcept)) {
if (schemaAttribute.getName().equals(name)
|| schemaAttribute.toString().equals(name)) {
return schemaAttribute;
}
}
return null;
}
/**
* Checks if a given {@link SchemaAttribute} has been discovered.
*
* @param attribute The {@link SchemaAttribute} to look for.
* @return True if the {@link SchemaAttribute} was found, false otherwise.
*/
public static boolean containsType(final SchemaAttribute attribute) {
return getAttributes(attribute.getElementType()).stream()
.anyMatch(schemaAttribute -> schemaAttribute.equals(attribute));
}
}
| [
"39325530+arcturus2@users.noreply.github.com"
] | 39325530+arcturus2@users.noreply.github.com |
21fbc39c7fdc8d7344583d83c7fbfa09be6fd44a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_c80ebd8504dbc3865a56ee1724c5d467e38acb38/ClientListener/17_c80ebd8504dbc3865a56ee1724c5d467e38acb38_ClientListener_t.java | 63e6851bfb2dc3370cef98c8319d2bddaa9f9991 | [] | 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 | 982 | java | package client;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;
import java.nio.ByteBuffer;
import java.util.Map;
public class ClientListener extends Thread {
private final Map<Byte, Location> players;
DatagramSocket socket;
public ClientListener(Map<Byte, Location> players) throws SocketException {
this.players = players;
socket = new DatagramSocket(4445);
}
@Override
public void run() {
while (true) {
byte[] buf = new byte[256];
DatagramPacket packet = new DatagramPacket(buf, buf.length);
try {
socket.receive(packet);
byte[] data = packet.getData();
if (data[0] != 0) {
ByteBuffer bb = ByteBuffer.wrap(data, 1, data.length - 1);
int x = bb.getInt();
int y = bb.getInt();
players.put(data[0], new Location(x, y));
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
a0d4171051591b31b95dd9490e770bd64cd64d2b | ea6e3c324cf36d9b59a14598bb619a7a8f14329e | /quarkus-extension/operator/src/main/java/io/automatiko/engine/quarkus/operator/ops/CustomResourceOperations.java | 5201606e917d33b4d9c044c01d6ffb1e39a28a2c | [
"Apache-2.0"
] | permissive | automatiko-io/automatiko-engine | 9eaf3a8f5945e645ca704aa317c97c32ea4011da | af7e315d73895798b8b8bdd0fa5d7fcce64d289d | refs/heads/main | 2023-08-24T21:25:17.045726 | 2023-08-16T08:20:56 | 2023-08-16T08:41:53 | 332,492,696 | 60 | 7 | Apache-2.0 | 2023-09-14T00:44:40 | 2021-01-24T16:06:36 | Java | UTF-8 | Java | false | false | 1,596 | java | package io.automatiko.engine.quarkus.operator.ops;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import io.fabric8.kubernetes.client.CustomResource;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.dsl.Gettable;
import io.fabric8.kubernetes.client.dsl.Replaceable;
import io.fabric8.kubernetes.client.dsl.Resource;
@ApplicationScoped
public class CustomResourceOperations {
@Inject
KubernetesClient kube;
@SuppressWarnings({ "rawtypes" })
public void updateCustomResource(CustomResource<?, ?> resource) {
Replaceable r = kube.resource(resource).inNamespace(resource.getMetadata().getNamespace())
.lockResourceVersion(resource.getMetadata().getResourceVersion());
r.replace();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
public void updateCustomResourceStatus(CustomResource<?, ?> resource) {
Resource r = kube.resources(resource.getClass()).inNamespace(resource.getMetadata().getNamespace())
.withName(resource.getMetadata().getName());
CustomResource fromServer = (CustomResource) ((Gettable) r.fromServer()).get();
fromServer.setStatus(resource.getStatus());
r.patchStatus();
}
@SuppressWarnings({ "rawtypes" })
public void deleteCustomResource(CustomResource<?, ?> resource) {
Resource r = kube.resources(resource.getClass()).inNamespace(resource.getMetadata().getNamespace())
.withName(resource.getMetadata().getName());
r.delete();
}
}
| [
"swiderski.maciej@gmail.com"
] | swiderski.maciej@gmail.com |
4cac03e6f35746ab6437583af5bcd02e65d252b6 | 7b5a53da2e91940d772ab69c026731a3f84d6fd7 | /src/main/java/il/ac/bgu/cs/bp/bpjs/execution/listeners/BProgramRunnerListener.java | 7712bed54681cd22ab8983dc5f41a4d13cebb7a3 | [
"MIT"
] | permissive | bThink-BGU/BPjs | 1e12f3e13fde4571b3091ecdc92038a539b88bd8 | b900678c808d4516e894d2d1c8f8887b09e89f64 | refs/heads/develop | 2023-07-23T03:06:46.346012 | 2023-07-18T20:49:30 | 2023-07-18T20:49:30 | 77,818,834 | 39 | 12 | MIT | 2023-09-04T01:04:20 | 2017-01-02T07:54:41 | Java | UTF-8 | Java | false | false | 3,103 | java | package il.ac.bgu.cs.bp.bpjs.execution.listeners;
import il.ac.bgu.cs.bp.bpjs.model.BProgram;
import il.ac.bgu.cs.bp.bpjs.execution.BProgramRunner;
import il.ac.bgu.cs.bp.bpjs.model.BThreadSyncSnapshot;
import il.ac.bgu.cs.bp.bpjs.model.BEvent;
/**
* An object interested in the life-cycle of a {@link BProgram} being run by a {@link BProgramRunner}.
* @author michael
*/
public interface BProgramRunnerListener {
/**
* Called before the BProgram is started (pre-setup).
*
* @param bprog The BProgram about to start
*/
void starting(BProgram bprog);
/**
* Called when the {@link BProgram} {@code bp} was started.
*
* @param bp The BProgram started.
*/
void started( BProgram bp );
/**
* Called when a BProgram cannot advance, and is waiting for external events
* to continue. For this to happen, the BProgram has to be in daemon mode.
*
* @param bp The BProgram informing the change.
*
* @see BProgram#setWaitForExternalEvents(boolean)
*/
void superstepDone( BProgram bp );
/**
* Called when the {@link BProgram} {@code bp} ends.
*
* @param bp The BProgram ended.
*/
void ended( BProgram bp );
/**
* Called when a b-thread in the {@link BProgram} has made a failed assertion.
* This means that the program is in violation of some of its requirements.
* @param bp The program where the failed assertion happened.
* @param theFailedAssertion Details about the assertion that failed.
*/
void assertionFailed( BProgram bp, il.ac.bgu.cs.bp.bpjs.model.SafetyViolationTag theFailedAssertion);
/**
* Called when a BThread is added to a b-program.
* @param bp the program the thread was added to.
* @param theBThread the new BThread
*/
void bthreadAdded( BProgram bp, BThreadSyncSnapshot theBThread );
/**
* Called when a BThread is removed from a b-program.
* @param bp the program the thread was removed from.
* @param theBThread the removed BThread
*/
void bthreadRemoved( BProgram bp, BThreadSyncSnapshot theBThread );
/**
* Called when a BThread has ran to completion.
* @param bp the b-program in which {@code theBThread} ran.
* @param theBThread the done BThread
*/
void bthreadDone( BProgram bp, BThreadSyncSnapshot theBThread);
/**
* Called when a b-program selects an event.
* @param bp The b-program the event was selected in.
* @param theEvent the new event selected.
*/
void eventSelected( BProgram bp, BEvent theEvent );
/**
* Called when the b-program code makes an error, e.g. attempts to invoke
* methods on {@code null}.
* @param bp the offending b-program
* @param ex the exception that was thrown because of the offense.
*/
default void error( BProgram bp, Exception ex ) {
}
/**
* Called when the b-program was halted.
* @param bp the b-program that was halted.
*/
void halted(BProgram bp);
}
| [
"mich.barsinai@gmail.com"
] | mich.barsinai@gmail.com |
6be1d33c868b8387dffe581bca4af2c7d6f44bc4 | a11760be0761891b298895ac6c496a50acbcbd80 | /NIM_Android_UIKit-master/src/com/netease/nim/uikit/recent/holder/CommonRecentViewHolder.java | 49fafcc69d968d3fc552a063b4f5472f04e03c46 | [] | no_license | zuoni1018/Zxqy2 | 467f4e7271724b7dcf7e015fbd2ec46852241614 | afb31399e835828c511f628eb7ecc801af4b4350 | refs/heads/master | 2021-05-15T10:11:24.922159 | 2018-01-31T03:04:47 | 2018-01-31T03:05:04 | 108,233,803 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,949 | java | package com.netease.nim.uikit.recent.holder;
import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseQuickAdapter;
import com.netease.nim.uikit.core.NimUIKitImpl;
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.RecentContact;
public class CommonRecentViewHolder extends RecentViewHolder {
CommonRecentViewHolder(BaseQuickAdapter adapter) {
super(adapter);
}
@Override
protected String getContent(RecentContact recent) {
return descOfMsg(recent);
}
@Override
protected String getOnlineStateContent(RecentContact recent) {
if (recent.getSessionType() == SessionTypeEnum.P2P && NimUIKitImpl.enableOnlineState()) {
return NimUIKitImpl.getOnlineStateContentProvider().getSimpleDisplay(recent.getContactId());
} else {
return super.getOnlineStateContent(recent);
}
}
String descOfMsg(RecentContact recent) {
if (recent.getMsgType() == MsgTypeEnum.text) {
return recent.getContent();
} else if (recent.getMsgType() == MsgTypeEnum.tip) {
String digest = null;
if (getCallback() != null) {
digest = getCallback().getDigestOfTipMsg(recent);
}
if (digest == null) {
digest = NimUIKitImpl.getRecentCustomization().getDefaultDigest(recent);
}
return digest;
} else if (recent.getAttachment() != null) {
String digest = null;
if (getCallback() != null) {
digest = getCallback().getDigestOfAttachment(recent, recent.getAttachment());
}
if (digest == null) {
digest = NimUIKitImpl.getRecentCustomization().getDefaultDigest(recent);
}
return digest;
}
return "[未知]";
}
}
| [
"767450430@qq.com"
] | 767450430@qq.com |
7dcc379d09cc87a7c379a96ca2b7a4e2de2c792d | 254292bbb95222cd6a97eae493e28b5a63c14a9d | /spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/PluginFeatures.java | f1665578c2a174e130e3f7cfe36dbd3fa708d9f3 | [
"Apache-2.0"
] | permissive | pikefeier/springboot | 0e881a59ceefd3ae1991e83a0ad4a4d787831097 | 2fb23ab250f095dec39bf5e4d114c26d51467142 | refs/heads/master | 2023-01-09T02:51:23.939848 | 2019-12-30T12:19:14 | 2019-12-30T12:19:14 | 230,909,567 | 0 | 0 | Apache-2.0 | 2022-12-27T14:51:00 | 2019-12-30T12:10:46 | Java | UTF-8 | Java | false | false | 1,019 | java | /*
* Copyright 2012-2015 the original author or authors.
*
* 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.springframework.boot.gradle;
import org.gradle.api.Project;
/**
* A specific set of {@code org.gradle.api.Plugin} features applied via the
* {@code SpringBootPlugin}.
*
* @author Phillip Webb
*/
public interface PluginFeatures {
/**
* Apply the features to the specified project.
*
* @param project the project to apply features to
*/
void apply(Project project);
}
| [
"945302777@qq.com"
] | 945302777@qq.com |
c50eaeb0a0f535b6ee2edcaac20994c885c988f6 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/serge-rider--dbeaver/0cecaf1ddbad7e25ce0a07e34c65d0d11bcd5a6d/before/StatisticsPresentation.java | 40d9f0e8c2a2ab6a900cc0505c2b1af99c5d8da4 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,514 | java | /*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2016 Serge Rieder (serge@jkiss.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jkiss.dbeaver.ui.controls.resultset.view;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.DBDAttributeBinding;
import org.jkiss.dbeaver.model.data.DBDDisplayFormat;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.controls.resultset.AbstractPresentation;
import org.jkiss.dbeaver.ui.controls.resultset.IResultSetController;
import org.jkiss.dbeaver.ui.controls.resultset.ResultSetCopySettings;
import org.jkiss.dbeaver.ui.controls.resultset.ResultSetRow;
/**
* Execution statistics presentation.
* Special internal presentation for execution statistics visualization.
*/
public class StatisticsPresentation extends AbstractPresentation {
private Table table;
@Override
public void createPresentation(@NotNull IResultSetController controller, @NotNull Composite parent) {
super.createPresentation(controller, parent);
UIUtils.createHorizontalLine(parent);
table = new Table(parent, SWT.MULTI | SWT.FULL_SELECTION);
table.setLinesVisible(true);
table.setHeaderVisible(true);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
UIUtils.createTableColumn(table, SWT.LEFT, "Name");
UIUtils.createTableColumn(table, SWT.LEFT, "Value");
}
@Override
public Control getControl() {
return table;
}
@Override
public void refreshData(boolean refreshMetadata, boolean append, boolean keepState) {
table.removeAll();
ResultSetRow row = controller.getModel().getRow(0);
java.util.List<DBDAttributeBinding> visibleAttributes = controller.getModel().getVisibleAttributes();
for (int i = 0; i < visibleAttributes.size(); i++) {
DBDAttributeBinding attr = visibleAttributes.get(i);
Object value = row.getValues()[i];
TableItem item = new TableItem(table, SWT.LEFT);
item.setText(0, attr.getName());
item.setText(1, DBUtils.getDefaultValueDisplayString(value, DBDDisplayFormat.UI));
}
UIUtils.packColumns(table);
}
@Override
public void formatData(boolean refreshData) {
}
@Override
public void clearMetaData() {
}
@Override
public void updateValueView() {
}
@Override
public void changeMode(boolean recordMode) {
}
@Nullable
@Override
public DBDAttributeBinding getCurrentAttribute() {
return null;
}
@Nullable
@Override
public String copySelectionToString(ResultSetCopySettings settings) {
return null;
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
943c715f893f7d8ef074b970006b6b511b14217a | 990a7dd8e4e11d4f2c9e302323611b65f9a9999c | /app/src/main/java/cn/meshee/freechat/ui/presenter/MeFgPresenter.java | 6f1c67a02a3e2761ff355b0ad18b909edd1a8dee | [
"MIT"
] | permissive | minibeep/freeChat | 1d816c9055be468ec72d7ea2268b3cc6c3f096ba | 401f5c87707f5135fd794d37bf1bc26732d2c845 | refs/heads/master | 2020-03-21T22:53:08.302870 | 2018-06-24T12:29:40 | 2018-06-24T12:29:40 | 139,153,127 | 1 | 0 | MIT | 2018-06-29T13:31:40 | 2018-06-29T13:31:40 | null | UTF-8 | Java | false | false | 1,168 | java | package cn.meshee.freechat.ui.presenter;
import com.bumptech.glide.Glide;
import cn.meshee.freechat.R;
import cn.meshee.freechat.ijk.LiveResource;
import cn.meshee.freechat.model.UserInfo;
import cn.meshee.freechat.ui.base.BaseActivity;
import cn.meshee.freechat.ui.base.BasePresenter;
import cn.meshee.freechat.ui.view.IMeFgView;
import cn.meshee.freechat.util.AppUtils;
import cn.meshee.freechat.util.UIUtils;
public class MeFgPresenter extends BasePresenter<IMeFgView> {
private UserInfo mUserInfo;
private boolean isFirst = true;
public MeFgPresenter(BaseActivity context) {
super(context);
}
public void loadUserInfo() {
mUserInfo = AppUtils.getUserInfo();
fillView();
}
public void fillView() {
if (mUserInfo != null) {
Glide.with(mContext).load(mUserInfo.getPortraitUri()).centerCrop().into(getView().getIvHeader());
getView().getTvAccount().setText(UIUtils.getString(R.string.my_chat_account, mUserInfo.getUserId()));
getView().getTvName().setText(mUserInfo.getName());
}
}
public UserInfo getUserInfo() {
return mUserInfo;
}
}
| [
"johndoe@example.com"
] | johndoe@example.com |
6c301acfd41ac6e6a5909969d491a1c4871916da | cd1e60af5201413ddbdaa56c58e1d0600bc4af35 | /userinfocenter/src/main/java/com/elise/userinfocenter/pojo/CityPOJO.java | 8ef51d55453fbb382cb61fd9a0ab6158ad0298f6 | [] | no_license | franywhy/projects | 6b3fe268709c7239536da802e57f9f1630688061 | 965b2b0938f8c3620299b52055035f522559fa5c | refs/heads/master | 2020-04-18T01:14:13.551295 | 2019-01-23T02:49:00 | 2019-01-23T02:49:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,465 | java | package com.elise.userinfocenter.pojo;
import java.io.PipedReader;
import java.io.Serializable;
import java.util.List;
/**
* Created by DL on 2018/1/23.
*/
public class CityPOJO implements Serializable {
//id
private Long cityId;
//父id
private Long parentId;
//城市编码
private String cityCode;
//城市名称
private String cityName;
//状态,0启用,1不启用
private Integer status;
//子城市列表
private List<CityPOJO> childrenCityList;
public Long getCityId() {
return cityId;
}
public void setCityId(Long cityId) {
this.cityId = cityId;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getCityCode() {
return cityCode;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public List<CityPOJO> getChildrenCityList() {
return childrenCityList;
}
public void setChildrenCityList(List<CityPOJO> childrenCityList) {
this.childrenCityList = childrenCityList;
}
}
| [
"longduyuan@hengqijy.com"
] | longduyuan@hengqijy.com |
d46b7e2f077140f936c4076c9579c0844997d6d0 | b6298b6427aa127dc0195e8532bcc1595b5d2634 | /order2b/order2b-client/src/main/java/com/iwhalecloud/retail/order2b/dto/response/PastWeekOrderAmountRespDTO.java | 9f42664446dd5c110ca8f8cd9654f50059a0b843 | [] | no_license | chenmget/spring-cloud-demo | 2ecbdeeb5102dc7523ef9fc59a405fc5c77bf6ad | 0b4100973d2f6525883e0e73f000ac6e9c0b9060 | refs/heads/release | 2022-07-17T13:41:20.595393 | 2020-04-02T07:40:19 | 2020-04-02T07:40:19 | 249,857,665 | 1 | 3 | null | 2022-06-29T18:02:22 | 2020-03-25T01:23:07 | Java | UTF-8 | Java | false | false | 623 | java | package com.iwhalecloud.retail.order2b.dto.response;
import lombok.Data;
import java.io.Serializable;
/**
* 获取过去一周的订单销售额 返回对象
*/
@Data
public class PastWeekOrderAmountRespDTO implements Serializable {
private static final long serialVersionUID = 147849639463665456L;
private String orderDate; // 订单日期 yyyy-MM-dd
private float timeStamp; // yyyy-MM-dd日期时间戳
private float orderAmount; // 该日期内的 订单销售额
private String desc;
private String proportion; //环比
private int upOrDown; // 1:上升 -1:下降 0:没变化
}
| [
"0027007822@iwhalecloud.com"
] | 0027007822@iwhalecloud.com |
96c2afd677edc19a4935ff25b2e3da23716d38ea | 3c469b0f8944e70cb2ed573fd555651aae0c9ba9 | /bitms-rpc/bitms-rpc-provider/src/main/java/com/blocain/bitms/monitor/mapper/MonitorMatchFundMapper.java | d054c434d5b62a72b7d0b2e62f6cb24cd6141dd2 | [] | no_license | edby/backend | 05fe622889fa38dedc26b21c6cb39bf10cec9377 | 0b9e1799f68741f36a7797b85afd267d383b9327 | refs/heads/master | 2020-03-14T22:36:43.495367 | 2018-05-02T07:26:08 | 2018-05-02T07:26:08 | 131,824,956 | 3 | 5 | null | 2018-05-02T08:58:57 | 2018-05-02T08:58:57 | null | UTF-8 | Java | false | false | 945 | java | package com.blocain.bitms.monitor.mapper;
import com.blocain.bitms.monitor.entity.MonitorMatchFund;
import com.blocain.bitms.orm.annotation.MyBatisDao;
import com.blocain.bitms.orm.core.GenericMapper;
import com.blocain.bitms.trade.stockinfo.entity.StockInfo;
import java.util.List;
/**
* 交易总账监控表 持久层接口
* <p>File:MonitorMatchFundMapper.java </p>
* <p>Title: MonitorMatchFundMapper </p>
* <p>Description:MonitorMatchFundMapper </p>
* <p>Copyright: Copyright (c) May 26, 2015</p>
* <p>Company: BloCain</p>
*
* @author Playguy
* @version 1.0
*/
@MyBatisDao
public interface MonitorMatchFundMapper extends GenericMapper<MonitorMatchFund> {
/**
* 交易总账监控列表
*
* @param monitorMatchFund
* @return
*/
List<MonitorMatchFund> findMonitorMatchFundList(MonitorMatchFund monitorMatchFund);
List<StockInfo> selectByCurType();
MonitorMatchFund findRiskInfo();
}
| [
"3042645110@qq.com"
] | 3042645110@qq.com |
83711f2560a28cf697429337064da849620684f5 | 0562762cd07ffeb9c9b72026f204545efc19531f | /nextfilm_order/src/main/java/com/next/jiangzh/springboot/nextfilmorder/NextfilmOrderApplication.java | beebb280cdbc617655983338dcc5534c57279d10 | [] | no_license | jiangzhnext/springcloud_nextfilm | 5ee104927e2dc6c337c8258cddd45eb6e4d26813 | bebd67d65a63d82959060157ee8888e996fc103f | refs/heads/master | 2022-06-29T11:35:34.750494 | 2019-08-30T04:20:47 | 2019-08-30T04:20:47 | 196,728,332 | 0 | 1 | null | 2022-06-21T01:26:47 | 2019-07-13T14:04:08 | Java | UTF-8 | Java | false | false | 590 | java | package com.next.jiangzh.springboot.nextfilmorder;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
@MapperScan(basePackages = {"com.next.jiangzh.springboot.nextfilmorder.dao.mapper"})
public class NextfilmOrderApplication {
public static void main(String[] args) {
SpringApplication.run(NextfilmOrderApplication.class, args);
}
}
| [
"jiangzh@sina.com"
] | jiangzh@sina.com |
561385b9cd37803f5f90821128fc0283f13e3a14 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/4/4_41131c80259ccccda5544a5f2c41305293c069bc/SameJSONAs/4_41131c80259ccccda5544a5f2c41305293c069bc_SameJSONAs_t.java | 65b75faf673348ff438498be9f2fdf165c2331fb | [] | 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,825 | java | package uk.co.datumedge.hamcrest.json;
import static uk.co.datumedge.hamcrest.json.JSONArrayAssertComparator.actualJSONArraySameAsExpected;
import static uk.co.datumedge.hamcrest.json.JSONObjectAssertComparator.actualJSONObjectSameAsExpected;
import java.io.PrintWriter;
import java.io.StringWriter;
import org.hamcrest.Description;
import org.hamcrest.Factory;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Matcher that asserts that one JSON document is the same as another.
*
* @param <T>
* the type of the JSON document. This is typically {@code JSONObject}, {@code JSONArray} or {@code String}.
*/
public final class SameJSONAs<T> extends TypeSafeDiagnosingMatcher<T> {
private final T expected;
private final JSONComparator<T> comparator;
public SameJSONAs(T expected, JSONComparator<T> comparator) {
this.expected = expected;
this.comparator = comparator;
}
@Override
public void describeTo(Description description) {
description.appendValue(expected.toString());
}
@Override
protected boolean matchesSafely(T actual, Description mismatchDescription) {
try {
JSONComparisonResult result = comparator.compare(expected, actual);
if (result.failed()) {
mismatchDescription.appendDescriptionOf(result);
}
return result.passed();
} catch (JSONException e) {
StringWriter out = new StringWriter();
e.printStackTrace(new PrintWriter(out));
mismatchDescription.appendText(out.toString());
return false;
}
}
/**
* Creates a matcher that allows any element ordering within JSON arrays. For example,
* <code>{"fib":[0,1,1,2,3]}</code> will match <code>{"fib":[3,1,0,2,1]}</code>.
*
* @return the configured matcher
*/
public SameJSONAs<T> allowingAnyArrayOrdering() {
return new SameJSONAs<T>(expected, comparator.butAllowingAnyArrayOrdering());
}
/**
* Creates a matcher that allows fields not present in the expected JSON document. For example, if the expected
* document is
<pre>{
"name" : "John Smith",
"address" : {
"street" : "29 Acacia Road"
}
}</pre>
* then the following document will match:
<pre>{
"name" : "John Smith",
"age" : 34,
"address" : {
"street" : "29 Acacia Road",
"city" : "Huddersfield"
}
}</pre>
*
* All array elements must exist in both documents, so the expected document
<pre>[
{ "name" : "John Smith" }
]</pre>
* will not match the actual document
<pre>[
{ "name" : "John Smith" },
{ "name" : "Bob Jones" }
]</pre>
*
* @return the configured matcher
*/
public SameJSONAs<T> allowingExtraUnexpectedFields() {
return new SameJSONAs<T>(expected, comparator.butAllowingExtraUnexpectedFields());
}
/**
* Creates a matcher that compares {@code JSONObject}s.
*
* @param expected the expected {@code JSONObject} instance
* @return the {@code Matcher} instance
*/
@Factory
public static SameJSONAs<JSONObject> sameJSONObjectAs(JSONObject expected) {
return new SameJSONAs<JSONObject>(expected, actualJSONObjectSameAsExpected());
}
/**
* Creates a matcher that compares {@code JSONArray}s.
*
* @param expected the expected {@code JSONArray} instance
* @return the {@code Matcher} instance
*/
@Factory
public static SameJSONAs<JSONArray> sameJSONArrayAs(JSONArray expected) {
return new SameJSONAs<JSONArray>(expected, actualJSONArraySameAsExpected());
}
@Factory
public static Matcher<? super JSONArray> sameJSONArrayAs(JSONArray expected, JSONComparator<JSONArray> jsonComparator) {
return new SameJSONAs<JSONArray>(expected, jsonComparator);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
04a4be4be61d50864426384e76695292fac6adf2 | ef1d87b64da817da712227fb869b2fd23b32e8a7 | /bus-oauth/src/main/java/org/aoju/bus/oauth/provider/FacebookProvider.java | 9521b4b4908432c5b809ae4e72b795e5cc9caed0 | [
"MIT"
] | permissive | Touhousupports/bus | b4a91563df2118d4b52a7c1345a8eb9c21380fd9 | e2e3951b9921d7a92c7e0fdce24781e08b588f00 | refs/heads/master | 2022-11-22T09:26:18.088266 | 2020-07-17T02:17:43 | 2020-07-17T02:17:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,188 | java | /*********************************************************************************
* *
* The MIT License (MIT) *
* *
* Copyright (c) 2015-2020 aoju.org and other contributors. *
* *
* 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.oauth.provider;
import com.alibaba.fastjson.JSONObject;
import org.aoju.bus.cache.metric.ExtendCache;
import org.aoju.bus.core.lang.Normal;
import org.aoju.bus.core.lang.exception.AuthorizedException;
import org.aoju.bus.oauth.Builder;
import org.aoju.bus.oauth.Context;
import org.aoju.bus.oauth.Registry;
import org.aoju.bus.oauth.magic.AccToken;
import org.aoju.bus.oauth.magic.Callback;
import org.aoju.bus.oauth.magic.Property;
/**
* Facebook登录
*
* @author Kimi Liu
* @version 6.0.3
* @since JDK 1.8+
*/
public class FacebookProvider extends AbstractProvider {
public FacebookProvider(Context context) {
super(context, Registry.FACEBOOK);
}
public FacebookProvider(Context context, ExtendCache extendCache) {
super(context, Registry.FACEBOOK, extendCache);
}
@Override
public AccToken getAccessToken(Callback callback) {
JSONObject object = JSONObject.parseObject(doPostAuthorizationCode(callback.getCode()));
this.checkResponse(object);
return AccToken.builder()
.accessToken(object.getString("access_token"))
.expireIn(object.getIntValue("expires_in"))
.tokenType(object.getString("token_type"))
.build();
}
@Override
public Property getUserInfo(AccToken accToken) {
JSONObject object = JSONObject.parseObject(doGetUserInfo(accToken));
this.checkResponse(object);
return Property.builder()
.rawJson(object)
.uuid(object.getString("id"))
.username(object.getString("name"))
.nickname(object.getString("name"))
.avatar(getUserPicture(object))
.location(object.getString("locale"))
.email(object.getString("email"))
.gender(Normal.Gender.getGender(object.getString("gender")))
.token(accToken)
.source(source.toString())
.build();
}
private String getUserPicture(JSONObject object) {
String picture = null;
if (object.containsKey("picture")) {
JSONObject pictureObj = object.getJSONObject("picture");
pictureObj = pictureObj.getJSONObject("data");
if (null != pictureObj) {
picture = pictureObj.getString("url");
}
}
return picture;
}
/**
* 返回获取userInfo的url
*
* @param accToken 用户token
* @return 返回获取userInfo的url
*/
@Override
public String userInfoUrl(AccToken accToken) {
return Builder.fromUrl(source.userInfo())
.queryParam("access_token", accToken.getAccessToken())
.queryParam("fields", "id,name,birthday,gender,hometown,email,devices,picture.width(400)")
.build();
}
/**
* 检查响应内容是否正确
*
* @param object 请求响应内容
*/
private void checkResponse(JSONObject object) {
if (object.containsKey("error")) {
throw new AuthorizedException(object.getJSONObject("error").getString("message"));
}
}
}
| [
"839536@qq.com"
] | 839536@qq.com |
bbbd8061824a3378ec851c3f6a4c98a310048c49 | f77c2af0463f8cbeaecaff3701314ce73fe3863c | /src/main/java/com/basic/算法/剑指offer/矩形覆盖.java | 92df9edfd810faf516a9ebbfc8b7fec1ceef47c6 | [] | no_license | chenchenxiao/JavaNote | a096e86b3861b87035919d33445ca4a18ee3f260 | 7d6047258e8d2b50d19cc4188535e241b9ebd786 | refs/heads/master | 2022-06-08T06:20:11.831829 | 2021-07-26T07:48:25 | 2021-07-26T07:48:25 | 130,634,130 | 1 | 0 | null | 2022-05-25T03:53:03 | 2018-04-23T03:18:18 | Java | UTF-8 | Java | false | false | 375 | java | package com.basic.算法.剑指offer;
/**
* @author Blse
* @date 2018/12/17
* @description 也就是斐波那契数列问题
*/
public class 矩形覆盖 {
public int RectCover(int n) {
if (n <= 0) {
return 0;
}
if (n == 1 || n == 2) {
return 1;
}
return RectCover(n - 1) + RectCover(n - 2);
}
}
| [
"123456789"
] | 123456789 |
dfdf805b36e6f93239c54a54f529d78282e32f98 | c37a7d60a060b7de5384ee217be74c80db137abd | /xtoon-service/xtoon-sys/xtoon-sys-server/src/main/java/com/xtoon/cloud/sys/domain/specification/TenantCreateSpecification.java | 153ca51186e38fd6f1b5dad3c03ecf5f86289e50 | [
"Apache-2.0"
] | permissive | hademen/xtoon-cloud-ddd | 289219dd649839ace121a0e5b2e86e3678b5802e | cb213756ecc233246aef891adc64bd54cafad9de | refs/heads/master | 2023-06-10T20:34:39.967437 | 2021-07-05T15:12:47 | 2021-07-05T15:12:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 972 | java | package com.xtoon.cloud.sys.domain.specification;
import com.xtoon.cloud.common.core.domain.AbstractSpecification;
import com.xtoon.cloud.sys.domain.model.tenant.Tenant;
import com.xtoon.cloud.sys.domain.model.tenant.TenantRepository;
/**
* 租户创建Specification
*
* @author haoxin
* @date 2021-03-29
**/
public class TenantCreateSpecification extends AbstractSpecification<Tenant> {
private TenantRepository tenantRepository;
public TenantCreateSpecification(TenantRepository tenantRepository) {
this.tenantRepository = tenantRepository;
}
@Override
public boolean isSatisfiedBy(Tenant tenant) {
if (tenantRepository.find(tenant.getTenantName()) != null) {
throw new IllegalArgumentException("租户名称已存在");
}
if (tenantRepository.find(tenant.getTenantCode()) != null) {
throw new IllegalArgumentException("租户编码已存在");
}
return true;
}
}
| [
"525899665@qq.com"
] | 525899665@qq.com |
de4b8c4789ff3f83fa06d1df0d375fbb3f2cff77 | 0f9f5af5b7b5dee01defbced9d31c4a14d8154c0 | /devx-core/src/main/java/com/devx/core/handler/GlobalErrorInfoHandler.java | 4a180d74cda1140cc06c7120f94a82123a20a394 | [] | no_license | dwj1979/devX-cloud | 7af484859bb32b6a98a354ccc14f6f314b149f01 | 99b5f03a24fe9ab5447e543b5078a4fec8918d52 | refs/heads/master | 2021-05-11T10:24:02.449262 | 2017-12-15T10:06:22 | 2017-12-15T10:06:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,632 | java | package com.devx.core.handler;
import com.devx.core.enums.ErrorInfo;
import com.devx.core.enums.GlobalErrorInfoEnum;
import com.devx.core.exception.DataFilterException;
import com.devx.core.exception.GlobalErrorInfoException;
import com.devx.core.response.ResultBody;
import com.devx.core.response.ResultGenerator;
import com.devx.core.utils.MessageUtils;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.util.StringUtils;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import java.util.List;
import java.util.Set;
/**
* 统一错误码异常处理
* <p>
* Created by sungang on 2017/5/19.
*/
@Slf4j
@RestControllerAdvice
public class GlobalErrorInfoHandler {
@Value("${show-exception}")
private Boolean showException = false;
private static Logger logger = LoggerFactory.getLogger(GlobalErrorInfoHandler.class);
/**
* 全局系统异常
* @param request
* @param exception
* @return
*/
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(value = RuntimeException.class)
public ResultBody errorHandlerOverJson(HttpServletRequest request, RuntimeException exception) {
logger.error("全局异常:{}", exception.getMessage());
if (showException){
exception.printStackTrace();
}
ResultBody result = new ResultBody(GlobalErrorInfoEnum.INTERNAL_SERVER_ERROR);
return result;
}
/**
* 全局系统异常
* @param request
* @param exception
* @return
*/
// @ResponseStatus(HttpStatus.OK)
// @ExceptionHandler(value = AccessDeniedException.class)
// public ResultBody errorHandlerOverJson(HttpServletRequest request, AccessDeniedException exception) {
// logger.error("全局异常:{}", exception.getMessage());
// if (showException){
// exception.printStackTrace();
// }
// return ResultGenerator.genFailResult(GlobalErrorInfoEnum.INTERNAL_SERVER_ERROR.getCode(),"没有权限!");
// }
//
// /**
// * 认证异常
// * @param request
// * @param exception
// * @return
// */
// @ResponseStatus(HttpStatus.OK)
// @ExceptionHandler(value = AuthenticationException.class)
// public ResultBody errorAuthenticationException(HttpServletRequest request, AuthenticationException exception){
// logger.error("认证失败:{}", exception.getMessage());
// if (showException){
// exception.printStackTrace();
// }
// return ResultGenerator.genFailResult(GlobalErrorInfoEnum.INTERNAL_SERVER_ERROR.getCode(),exception.getMessage());
// }
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(value = DataFilterException.class)
public ResultBody errorDataFilterException(HttpServletRequest request, DataFilterException exception){
logger.error("数据权限过滤失败:{}", exception.getMessage());
if (showException){
exception.printStackTrace();
}
return ResultGenerator.genFailResult(GlobalErrorInfoEnum.INTERNAL_SERVER_ERROR.getCode(),exception.getMessage());
}
/**
* 配置对象参数注解解析失败
* @param e
* @return
*/
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(MethodArgumentNotValidException.class)
public ResultBody handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
logger.error("参数验证失败", e);
if (showException){
e.printStackTrace();
}
BindingResult bindingResult = e.getBindingResult();
List<FieldError> errors = bindingResult.getFieldErrors();
StringBuffer sb = new StringBuffer();
for(FieldError error : errors){
String field = error.getField();
String code = error.getDefaultMessage();
String message = String.format("%s:%s", field, code);
sb.append(message).append(",");
}
ResultBody result = new ResultBody();
result.setCode(HttpStatus.INTERNAL_SERVER_ERROR.toString());
result.setMessage(sb.toString());
return result;
}
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(ConstraintViolationException.class)
public ResultBody handleConstraintViolationException(ConstraintViolationException e) {
logger.error("参数验证失败", e);
if (showException){
e.printStackTrace();
}
Set<ConstraintViolation<?>> violations = e.getConstraintViolations();
StringBuffer sb = new StringBuffer();
for(ConstraintViolation error : violations){
String code = error.getMessage();
String message = String.format("%s", code);
sb.append(message).append(",");
}
ResultBody result = new ResultBody();
result.setCode(HttpStatus.INTERNAL_SERVER_ERROR.toString());
result.setMessage(sb.toString());
return result;
}
/**
* GlobalErrorInfoException 系统异常
* @param request
* @param exception
* @return
*/
@ResponseStatus(HttpStatus.OK)
@ExceptionHandler(value = GlobalErrorInfoException.class)
public ResultBody handleGlobalErrorInfoException(HttpServletRequest request, GlobalErrorInfoException exception) {
logger.error("GlobalErrorInfoException 错误消息:{}", exception.getMessage());
if (showException){
exception.printStackTrace();
}
ErrorInfo errorInfo = exception.getErrorInfo();
getMessage(errorInfo, exception.getArgs());
ResultBody result = new ResultBody(errorInfo);
return result;
}
private void getMessage(ErrorInfo errorInfo, Object... agrs) {
String message = null;
if (!StringUtils.isEmpty(errorInfo.getCode())) {
message = MessageUtils.message(errorInfo.getCode(), agrs);
}
if (message == null) {
message = errorInfo.getMessage();
}
errorInfo.setMessage(message);
}
} | [
"1120sungang@gmail.com"
] | 1120sungang@gmail.com |
ac1c2dc878d8384dcf2f6e7a4a33bc63a3012aae | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_1008793.java | 9b75122eb9b6fe06924bc64b3bf98dec33624700 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 811 | java | @RequestMapping("/list") @ResponseBody public String list(@ModelAttribute MchInfo mchInfo,Integer pageIndex,Integer pageSize){
PageModel pageModel=new PageModel();
int count=mchInfoService.count(mchInfo);
if (count <= 0) return JSON.toJSONString(pageModel);
List<MchInfo> mchInfoList=mchInfoService.getMchInfoList((pageIndex - 1) * pageSize,pageSize,mchInfo);
if (!CollectionUtils.isEmpty(mchInfoList)) {
JSONArray array=new JSONArray();
for ( MchInfo mi : mchInfoList) {
JSONObject object=(JSONObject)JSONObject.toJSON(mi);
object.put("createTime",DateUtil.date2Str(mi.getCreateTime()));
array.add(object);
}
pageModel.setList(array);
}
pageModel.setCount(count);
pageModel.setMsg("ok");
pageModel.setRel(true);
return JSON.toJSONString(pageModel);
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
f50cf65d1e893e4a8a0a53a96927495b89b3dc91 | c6aa94983f3c8f82954463af3972ae06b30396a7 | /springcloud_alibaba/spring-cloud-alibaba-nacos-discovery/src/main/java/org/springframework/cloud/alibaba/nacos/endpoint/NacosDiscoveryEndpoint.java | 18f649ad31953b662cc46f6992c6cf414d00b96f | [
"Apache-2.0"
] | permissive | dobulekill/jun_springcloud | f01358caacb1b04f57908dccc6432d0a5e17745e | 33248f65301741ed97a24b978a5c22d5d6c052fb | refs/heads/master | 2023-01-24T13:24:59.282130 | 2020-11-25T17:30:47 | 2020-11-25T17:30:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,156 | java | /*
* Copyright (C) 2018 the original author or authors.
*
* 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.springframework.cloud.alibaba.nacos.endpoint;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.nacos.api.naming.NamingService;
import com.alibaba.nacos.api.naming.pojo.ServiceInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties;
/**
* Endpoint for nacos discovery, get nacos properties and subscribed services
* @author Wujun
*/
@Endpoint(id = "nacos-discovery")
public class NacosDiscoveryEndpoint {
private static final Logger LOGGER = LoggerFactory
.getLogger(NacosDiscoveryEndpoint.class);
@Autowired
private NacosDiscoveryProperties nacosDiscoveryProperties;
/**
* @return nacos discovery endpoint
*/
@ReadOperation
public Map<String, Object> nacosDiscovery() {
Map<String, Object> result = new HashMap<>();
result.put("NacosDiscoveryProperties", nacosDiscoveryProperties);
NamingService namingService = nacosDiscoveryProperties.namingServiceInstance();
List<ServiceInfo> subscribe = Collections.emptyList();
try {
subscribe = namingService.getSubscribeServices();
}
catch (Exception e) {
LOGGER.error("get subscribe services from nacos fail,", e);
}
result.put("subscribe", subscribe);
return result;
}
} | [
"wujun728@hotmail.com"
] | wujun728@hotmail.com |
70c0f31e4eac34f0ad8aa252d3ade23942c9193e | 967502523508f5bb48fdaac93b33e4c4aca20a4b | /aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesisfirehose/model/transform/RecordJsonUnmarshaller.java | bcbd7b6e4776f7ed1b5c6e245f5074c7072ae602 | [
"Apache-2.0",
"JSON"
] | permissive | hanjk1234/aws-sdk-java | 3ac0d8a9bf6f7d9bf1bc5db8e73a441375df10c0 | 07da997c6b05ae068230401921860f5e81086c58 | refs/heads/master | 2021-01-17T18:25:34.913778 | 2015-10-23T03:20:07 | 2015-10-23T03:20:07 | 44,951,249 | 1 | 0 | null | 2015-10-26T06:53:25 | 2015-10-26T06:53:24 | null | UTF-8 | Java | false | false | 2,664 | java | /*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.kinesisfirehose.model.transform;
import java.util.Map;
import java.util.Map.Entry;
import com.amazonaws.services.kinesisfirehose.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;
import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;
/**
* Record JSON Unmarshaller
*/
public class RecordJsonUnmarshaller implements
Unmarshaller<Record, JsonUnmarshallerContext> {
public Record unmarshall(JsonUnmarshallerContext context) throws Exception {
Record record = new Record();
int originalDepth = context.getCurrentDepth();
String currentParentElement = context.getCurrentParentElement();
int targetDepth = originalDepth + 1;
JsonToken token = context.getCurrentToken();
if (token == null)
token = context.nextToken();
if (token == VALUE_NULL)
return null;
while (true) {
if (token == null)
break;
if (token == FIELD_NAME || token == START_OBJECT) {
if (context.testExpression("Data", targetDepth)) {
context.nextToken();
record.setData(ByteBufferJsonUnmarshaller.getInstance()
.unmarshall(context));
}
} else if (token == END_ARRAY || token == END_OBJECT) {
if (context.getLastParsedParentElement() == null
|| context.getLastParsedParentElement().equals(
currentParentElement)) {
if (context.getCurrentDepth() <= originalDepth)
break;
}
}
token = context.nextToken();
}
return record;
}
private static RecordJsonUnmarshaller instance;
public static RecordJsonUnmarshaller getInstance() {
if (instance == null)
instance = new RecordJsonUnmarshaller();
return instance;
}
}
| [
"aws@amazon.com"
] | aws@amazon.com |
7ec10997ad85fce83bd176831649e8e118aff406 | 9254e7279570ac8ef687c416a79bb472146e9b35 | /live-20161101/src/main/java/com/aliyun/live20161101/models/SetLiveStreamDelayConfigResponse.java | 92e74f8bd2da1af3dfe251c240eb0106a39394bc | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,143 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.live20161101.models;
import com.aliyun.tea.*;
public class SetLiveStreamDelayConfigResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("body")
@Validation(required = true)
public SetLiveStreamDelayConfigResponseBody body;
public static SetLiveStreamDelayConfigResponse build(java.util.Map<String, ?> map) throws Exception {
SetLiveStreamDelayConfigResponse self = new SetLiveStreamDelayConfigResponse();
return TeaModel.build(map, self);
}
public SetLiveStreamDelayConfigResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public SetLiveStreamDelayConfigResponse setBody(SetLiveStreamDelayConfigResponseBody body) {
this.body = body;
return this;
}
public SetLiveStreamDelayConfigResponseBody getBody() {
return this.body;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
7b96dbbe49aa8eedf5ff729d119dc0d31f71a722 | 6b19524c2db316c1bae52a24f8b37fd6969b9400 | /gateway/engine/policies/src/test/java/io/apiman/gateway/engine/policies/BasicAuthenticationConfigTest.java | 859d49b60657cdc29924fc13061a9d33a9a153eb | [
"Apache-2.0"
] | permissive | apiman/apiman | feb59b437485080425105c8597ff01f3df4a7697 | 347f4a8de4d3f9feea7a4daa01cec7d12f654a0d | refs/heads/master | 2023-08-31T23:50:25.742996 | 2023-08-25T19:22:58 | 2023-08-25T19:22:58 | 12,319,410 | 846 | 440 | Apache-2.0 | 2023-09-14T17:09:49 | 2013-08-23T09:29:20 | Java | UTF-8 | Java | false | false | 5,260 | java | /*
* Copyright 2014 JBoss 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 io.apiman.gateway.engine.policies;
import io.apiman.gateway.engine.policies.config.BasicAuthenticationConfig;
import io.apiman.gateway.engine.policies.config.basicauth.PasswordHashAlgorithmType;
import org.junit.Assert;
import org.junit.Test;
/**
* Unit test.
*
* @author eric.wittmann@redhat.com
*/
@SuppressWarnings({ "nls", "javadoc" })
public class BasicAuthenticationConfigTest {
/**
* Test method for {@link io.apiman.gateway.engine.policies.BasicAuthenticationPolicy#parseConfiguration(java.lang.String)}.
*/
@Test
public void testParseConfiguration() {
BasicAuthenticationPolicy policy = new BasicAuthenticationPolicy();
// Basic properties
String config =
"{\r\n" +
" \"realm\" : \"TestRealm\",\r\n" +
" \"forwardIdentityHttpHeader\" : \"X-Authenticated-Identity\",\r\n" +
" \"requireTransportSecurity\" : true,\r\n" +
" \"requireBasicAuth\" : true\r\n" +
"}";
Object parsed = policy.parseConfiguration(config);
Assert.assertNotNull(parsed);
Assert.assertEquals(BasicAuthenticationConfig.class, parsed.getClass());
BasicAuthenticationConfig parsedConfig = (BasicAuthenticationConfig) parsed;
Assert.assertEquals("TestRealm", parsedConfig.getRealm());
Assert.assertEquals("X-Authenticated-Identity", parsedConfig.getForwardIdentityHttpHeader());
Assert.assertEquals(Boolean.TRUE, parsedConfig.isRequireTransportSecurity());
Assert.assertEquals(Boolean.TRUE, parsedConfig.getRequireBasicAuth());
// Static identities
config =
"{\r\n" +
" \"realm\" : \"TestRealm\",\r\n" +
" \"forwardIdentityHttpHeader\" : \"X-Authenticated-Identity\",\r\n" +
" \"staticIdentity\" : {\r\n" +
" \"identities\" : [\r\n" +
" { \"username\" : \"ckent\", \"password\" : \"ckent123!\" },\r\n" +
" { \"username\" : \"bwayne\", \"password\" : \"bwayne123!\" },\r\n" +
" { \"username\" : \"dprince\", \"password\" : \"dprince123!\" }\r\n" +
" ]\r\n" +
" }\r\n" +
"}";
parsed = policy.parseConfiguration(config);
parsedConfig = (BasicAuthenticationConfig) parsed;
Assert.assertNotNull(parsedConfig.getStaticIdentity());
Assert.assertEquals(3, parsedConfig.getStaticIdentity().getIdentities().size());
Assert.assertEquals("bwayne", parsedConfig.getStaticIdentity().getIdentities().get(1).getUsername());
Assert.assertEquals("bwayne123!", parsedConfig.getStaticIdentity().getIdentities().get(1).getPassword());
// Multiple IP addresses
config =
"{\r\n" +
" \"realm\" : \"TestRealm\",\r\n" +
" \"forwardIdentityHttpHeader\" : \"X-Authenticated-Identity\",\r\n" +
" \"ldapIdentity\" : {\r\n" +
" \"url\" : \"ldap://example.org:389\",\r\n" +
" \"dnPattern\" : \"cn=${username},dc=overlord,dc=org\"\r\n" +
" }\r\n" +
"}";
parsed = policy.parseConfiguration(config);
parsedConfig = (BasicAuthenticationConfig) parsed;
Assert.assertNotNull(parsedConfig.getLdapIdentity());
Assert.assertEquals("ldap://example.org:389", parsedConfig.getLdapIdentity().getUrl());
Assert.assertEquals("cn=${username},dc=overlord,dc=org", parsedConfig.getLdapIdentity().getDnPattern());
// Multiple IP addresses
config =
"{\r\n" +
" \"realm\" : \"TestRealm\",\r\n" +
" \"jdbcIdentity\" : {\r\n" +
" \"datasourcePath\" : \"jdbc/TestAuthDS\",\r\n" +
" \"query\" : \"SELECT * FROM users WHERE username = ? AND password = ?\",\r\n" +
" \"hashAlgorithm\" : \"SHA1\"\r\n" +
" }\r\n" +
"}";
parsed = policy.parseConfiguration(config);
parsedConfig = (BasicAuthenticationConfig) parsed;
Assert.assertNotNull(parsedConfig.getJdbcIdentity());
Assert.assertEquals("jdbc/TestAuthDS", parsedConfig.getJdbcIdentity().getDatasourcePath());
Assert.assertEquals("SELECT * FROM users WHERE username = ? AND password = ?", parsedConfig.getJdbcIdentity().getQuery());
Assert.assertEquals(PasswordHashAlgorithmType.SHA1, parsedConfig.getJdbcIdentity().getHashAlgorithm());
}
}
| [
"eric.wittmann@gmail.com"
] | eric.wittmann@gmail.com |
e97ff169058e2a29defe084bce2bff6367da79d2 | 30c6c9cea8575b84e76a87bdac936472fb8e0a0e | /PronunciationJourney/sunaostudiopronunciationapp/app/src/main/java/com/betterlife/pronunciationjourney/model/WordObject.java | 9b5f6881e7c07f11be3da77ca145092436d72a65 | [] | no_license | Trung1234/AndroidApp | f40d2251efba30501000ac6b9927bf7a537699de | 67079b9ee1511fca33050a9e842a81549a059d36 | refs/heads/master | 2020-04-16T19:26:32.995782 | 2019-01-15T14:00:40 | 2019-01-15T14:00:40 | 165,859,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,480 | java | package com.betterlife.pronunciationjourney.model;
import java.io.Serializable;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.Required;
/**
* Created by HauDo on 3/2/2018.
*/
public class WordObject extends RealmObject implements Serializable {
@PrimaryKey
@Required
private String word;
private String splelling;
private String mean;
private String example;
private String urlAudio;
public WordObject() {
}
public WordObject(String word, String splelling, String mean, String example, String url) {
this.word = word;
this.splelling = splelling;
this.mean = mean;
this.example = example;
this.urlAudio = url;
}
public String getWord() {
return word;
}
public void setWord(String word) {
this.word = word;
}
public String getSplelling() {
return splelling;
}
public void setSplelling(String splelling) {
this.splelling = splelling;
}
public String getMean() {
return mean;
}
public void setMean(String mean) {
this.mean = mean;
}
public String getExample() {
return example;
}
public void setExample(String example) {
this.example = example;
}
public String getUrlAudio() {
return urlAudio;
}
public void setUrlAudio(String urlAudio) {
this.urlAudio = urlAudio;
}
}
| [
"you@example.com"
] | you@example.com |
de5ec2b887dd888ded236d09bca2c3b2704c16a7 | d5e92c180f35adfb8cc713ee09e9ed9b3d8b79b2 | /4-11/src/Scanner分割.java | fb93b7d0cf90b8e8274b4e66357b5f3df93e61e4 | [] | no_license | WE-hai/java_work | 4dd0e2670c884a3b01f73e73ef4cde4a9eeaefc3 | adad119b1d8d07545e19b8b4c16be476255cf4aa | refs/heads/master | 2022-11-17T09:01:00.160594 | 2020-09-13T12:42:15 | 2020-09-13T12:42:15 | 217,520,082 | 0 | 0 | null | 2022-11-16T08:29:45 | 2019-10-25T11:34:36 | JavaScript | UTF-8 | Java | false | false | 530 | java | import java.io.*;
import java.util.Scanner;
public class Scanner分割 {
public static void main(String[] args) throws IOException {
try (InputStream is = new FileInputStream("有中文的文件.txt")) {
try (Reader reader = new InputStreamReader(is, "UTF-8")) {
try (Scanner scanner = new Scanner(reader)) {
while (scanner.hasNext()) {
System.out.println(scanner.next());
}
}
}
}
}
}
| [
"943239470@qq.com"
] | 943239470@qq.com |
23612591b99d3ec4d958669207a988ee158327e0 | c20a1a02e1ba02e5a6e6ed2409c0fd7777900aa8 | /src/com/vladsch/MissingInActions/actions/pattern/ToggleHighlightProjectViewAction.java | 429e8cb3c7c0300fc0a2ef5defc78cee5e745ca9 | [
"Apache-2.0"
] | permissive | vsch/MissingInActions | b42e5b21f24c76fe3a5cb2898101646228070d46 | 6baeafd552faffd6467776996db977f012eebd18 | refs/heads/master | 2023-06-20T05:45:24.814618 | 2023-04-23T19:06:23 | 2023-04-23T19:06:23 | 73,871,339 | 47 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,216 | java | // Copyright 2016-2023 2023 Vladimir Schneider <vladimir.schneider@gmail.com> Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
package com.vladsch.MissingInActions.actions.pattern;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ToggleAction;
import com.intellij.openapi.project.DumbAware;
import com.vladsch.MissingInActions.Plugin;
import com.vladsch.MissingInActions.actions.CaretSearchAwareAction;
import com.vladsch.MissingInActions.settings.ApplicationSettings;
import org.jetbrains.annotations.NotNull;
public class ToggleHighlightProjectViewAction extends ToggleAction implements DumbAware, CaretSearchAwareAction {
@Override
public boolean isSelected(@NotNull final AnActionEvent e) {
return ApplicationSettings.getInstance().isHighlightProjectViewNodes();
}
@Override
public void setSelected(@NotNull final AnActionEvent e, final boolean state) {
Plugin.getInstance().setHighlightProjectViewNodes(state);
}
@Override
public void update(@NotNull final AnActionEvent e) {
e.getPresentation().setEnabled(true);
super.update(e);
}
}
| [
"vladimir.schneider@gmail.com"
] | vladimir.schneider@gmail.com |
40fd8d939e9378af9b0e2fb834ed22a27088e0da | 48a2135f2f05fc09c1bc367ef594ee9f704a4289 | /ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/email/domain/OvhAccount.java | bf8151cb64d927edd3059358c9111c7632a64641 | [
"BSD-3-Clause"
] | permissive | UrielCh/ovh-java-sdk | 913c1fbd4d3ea1ff91de8e1c2671835af67a8134 | e41af6a75f508a065a6177ccde9c2491d072c117 | refs/heads/master | 2022-09-27T11:15:23.115006 | 2022-09-02T04:41:33 | 2022-09-02T04:41:33 | 87,030,166 | 13 | 4 | BSD-3-Clause | 2022-09-02T04:41:34 | 2017-04-03T01:59:23 | Java | UTF-8 | Java | false | false | 630 | java | package net.minidev.ovh.api.email.domain;
/**
* Account List
*/
public class OvhAccount {
/**
* Size of your account in bytes
*
* canBeNull && readOnly
*/
public Long size;
/**
* Name of account
*
* canBeNull && readOnly
*/
public String accountName;
/**
* Name of domain
*
* canBeNull && readOnly
*/
public String domain;
/**
* If true your account is blocked
*
* canBeNull && readOnly
*/
public Boolean isBlocked;
/**
* Account description
*
* canBeNull && readOnly
*/
public String description;
/**
* Email
*
* canBeNull && readOnly
*/
public String email;
}
| [
"uriel.chemouni@gmail.com"
] | uriel.chemouni@gmail.com |
fb3dd9713e1d41773e46ef9dab04a18d1205b267 | ec5ee0c75640206efcb7f7bc4a3f46f0a55b7652 | /src/main/java/com/bitmovin/api/sdk/encoding/manifests/dash/periods/PeriodListQueryParams.java | 27626cb55080e318b968e4830cc56c0b062f8c49 | [
"MIT"
] | permissive | mcherif/bitmovinexp | eb831c18b041c9c86f6d9520b1028dc9b2ea72f6 | d4d746794f26c8e9692c834e63d5d19503693bbf | refs/heads/main | 2023-04-30T08:14:33.171375 | 2021-05-11T11:19:04 | 2021-05-11T11:19:04 | 368,218,598 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 778 | java | package com.bitmovin.api.sdk.encoding.manifests.dash.periods;
import java.util.Date;
import java.util.HashMap;
import com.bitmovin.api.sdk.model.*;
public class PeriodListQueryParams extends HashMap<String, Object> {
public Integer getOffset() {
return (Integer) this.get("offset");
}
/**
* @param offset Index of the first item to return, starting at 0. Default is 0 (optional)
*/
public void setOffset(Integer offset) {
this.put("offset", offset);
}
public Integer getLimit() {
return (Integer) this.get("limit");
}
/**
* @param limit Maximum number of items to return. Default is 25, maximum is 100 (optional)
*/
public void setLimit(Integer limit) {
this.put("limit", limit);
}
}
| [
"openapi@bitmovin.com"
] | openapi@bitmovin.com |
7c97902028715c1f44590614890a639e95bd3a14 | e51266ffa12c28213c4dd64a647d923f731c7bcf | /report/src/main/java/com/provys/report/jooxml/report/RowImpl.java | fb60cc2772554aef6cb2a4d629b067e05c76e396 | [] | no_license | MichalStehlikCz/JOOXML | 2cc57bd60f38231ccb671fbfd4884d18d8ba9dd8 | 2155ba74ae8b72d46c67037373151cd26b66571f | refs/heads/master | 2021-12-15T01:50:45.642359 | 2019-07-17T05:39:24 | 2019-07-17T05:39:24 | 161,041,507 | 0 | 0 | null | 2021-12-14T21:16:19 | 2018-12-09T13:20:21 | Java | UTF-8 | Java | false | false | 1,083 | java | package com.provys.report.jooxml.report;
import com.provys.report.jooxml.workbook.RowProperties;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
public class RowImpl implements Row {
final private int rowIndex;
@Nullable
final private RowProperties rowProperties;
@Nonnull
final private List<AreaCell> cells;
RowImpl(int rowIndex, @Nullable RowProperties rowProperties, Collection<AreaCell> cells) {
this.rowIndex = rowIndex;
this.rowProperties = rowProperties;
this.cells = new ArrayList<>(cells);
}
@Override
public int getRowIndex() {
return rowIndex;
}
@Nonnull
@Override
public Optional<RowProperties> getRowProperties() {
return Optional.ofNullable(rowProperties);
}
@Nonnull
@Override
public List<AreaCell> getCells() {
return Collections.unmodifiableList(cells);
}
@Nonnull
@Override
public Iterator<AreaCell> iterator() {
return Collections.unmodifiableList(cells).iterator();
}
}
| [
"michal.stehlik.cz@gmail.com"
] | michal.stehlik.cz@gmail.com |
bbf7271918550cb61c46a12096585dc785269954 | 7b6566e085578ed60aba653c0e8bd0cdb011e4aa | /interactive_engine/src/frontend/compiler/src/main/java/com/alibaba/maxgraph/compiler/optimizer/LogicalPlanOptimizer.java | 0ef6af6aad2ae44d070c7c7bae3d0397f43e8ed4 | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"BSL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-elastic-license-2018",
"LicenseRef-scancode-other-permissive"
] | permissive | LDA111222/GraphScope | e2dd96b87cc73dc49dd09488fbb167ec92f550af | b485408919af470be1c4a267571a81fd08cca9cf | refs/heads/main | 2023-05-03T19:42:52.869888 | 2021-05-17T08:16:34 | 2021-05-17T08:16:34 | 368,792,494 | 1 | 0 | Apache-2.0 | 2021-05-19T08:11:40 | 2021-05-19T08:11:39 | null | UTF-8 | Java | false | false | 4,106 | java | /**
* Copyright 2020 Alibaba Group Holding Limited.
*
* 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.alibaba.maxgraph.compiler.optimizer;
import com.alibaba.maxgraph.common.util.CompilerConstant;
import com.alibaba.maxgraph.compiler.api.schema.GraphSchema;
import com.alibaba.maxgraph.compiler.dfs.DfsTraversal;
import com.alibaba.maxgraph.compiler.logical.LogicalPlanBuilder;
import com.alibaba.maxgraph.compiler.logical.LogicalQueryPlan;
import com.alibaba.maxgraph.compiler.tree.TreeBuilder;
import com.alibaba.maxgraph.compiler.tree.TreeManager;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
public class LogicalPlanOptimizer {
private final OptimizeConfig optimizeConfig;
private final boolean globalPullGraphFlag;
private final GraphSchema schema;
private final long snapshotId;
private final boolean lambdaEnableFlag;
public LogicalPlanOptimizer(OptimizeConfig optimizeConfig,
boolean globalPullGraphFlag,
GraphSchema schema,
long snapshotId) {
this(optimizeConfig, globalPullGraphFlag, schema, snapshotId, false);
}
public LogicalPlanOptimizer(OptimizeConfig optimizeConfig,
boolean globalPullGraphFlag,
GraphSchema schema,
long snapshotId,
boolean lambdaEnableFlag) {
this.optimizeConfig = optimizeConfig;
this.globalPullGraphFlag = globalPullGraphFlag;
this.schema = schema;
this.snapshotId = snapshotId;
this.lambdaEnableFlag = lambdaEnableFlag;
}
public QueryFlowManager build(GraphTraversal traversal) {
TreeBuilder treeBuilder = TreeBuilder.newTreeBuilder(schema, optimizeConfig, lambdaEnableFlag);
TreeManager treeManager = treeBuilder.build(traversal);
if (this.globalPullGraphFlag) {
treeManager.getQueryConfig().addProperty(CompilerConstant.QUERY_GRAPH_PULL_ENABLE, true);
}
treeManager.optimizeTree();
LogicalQueryPlan logicalQueryPlan = LogicalPlanBuilder.newBuilder().build(treeManager);
logicalQueryPlan = logicalQueryPlan.chainOptimize();
QueryFlowBuilder queryFlowBuilder = new QueryFlowBuilder();
QueryFlowManager queryFlowManager = queryFlowBuilder.prepareQueryFlow(logicalQueryPlan, snapshotId);
queryFlowManager.validQueryFlow();
return queryFlowManager;
}
/**
* Build dfs traversal to query flow
*
* @param dfsTraversal The given dfs traversal
* @return The result query flow
*/
public QueryFlowManager build(DfsTraversal dfsTraversal) {
TreeBuilder treeBuilder = TreeBuilder.newTreeBuilder(schema, optimizeConfig, this.lambdaEnableFlag);
treeBuilder.setDisableBarrierOptimizer(true);
TreeManager treeManager = dfsTraversal.buildDfsTree(treeBuilder, schema);
if (this.globalPullGraphFlag) {
treeManager.getQueryConfig().addProperty(CompilerConstant.QUERY_GRAPH_PULL_ENABLE, true);
}
LogicalQueryPlan logicalQueryPlan = LogicalPlanBuilder.newBuilder().build(treeManager);
logicalQueryPlan = logicalQueryPlan.chainOptimize();
QueryFlowBuilder queryFlowBuilder = new QueryFlowBuilder();
QueryFlowManager queryFlowManager = queryFlowBuilder.prepareQueryFlow(logicalQueryPlan, snapshotId);
queryFlowManager.validQueryFlow();
return queryFlowManager;
}
}
| [
"linzhu.ht@alibaba-inc.com"
] | linzhu.ht@alibaba-inc.com |
972131c7b3704c2fa67d6daf8aef739dfb2fbb49 | a3eaa38e4b5f00dfc800710cc2019488d38600f8 | /src/main/java/com/cmz/concurrent/design/BoundedBufferVC.java | d581286a18038c6a921525f495a1799c1a0ac0d9 | [] | no_license | chmzh/utils | 60a98f497c315bfa54f3cb834f8ba58d7a348600 | 36e59b1b0a2894a21fa4a2d863b54382da843ca2 | refs/heads/master | 2020-12-24T19:50:36.563688 | 2017-05-13T04:27:49 | 2017-05-13T04:27:49 | 56,132,747 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,895 | java | package com.cmz.concurrent.design;
public final class BoundedBufferVC implements BoundedBuffer {
private Object[] array_; // the elements
private int putPtr_ = 0; // circular indices
private int takePtr_ = 0;
private int emptySlots_; // slot counts
private int usedSlots_ = 0;
private int waitingPuts_ = 0; // counts of waiting threads
private int waitingTakes_ = 0;
private Object putMonitor_ = new Object(); // waiting threads
private Object takeMonitor_ = new Object();
public BoundedBufferVC(int capacity)
throws IllegalArgumentException {
if (capacity <= 0) throw new IllegalArgumentException();
array_ = new Object[capacity];
emptySlots_ = capacity;
}
public int count() { return usedSlots_; }
public int capacity() { return array_.length; }
public void put(Object x) {
synchronized(putMonitor_) { // specialized exchange code
while (emptySlots_ <= 0) {
++waitingPuts_;
try { putMonitor_.wait(); }
catch(InterruptedException ex) {};
--waitingPuts_;
}
--emptySlots_;
array_[putPtr_] = x;
putPtr_ = (putPtr_ + 1) % array_.length;
}
synchronized(takeMonitor_) { // directly notify
++usedSlots_;
if (waitingTakes_ > 0)
takeMonitor_.notify();
}
}
public Object take() { // symmetric to put
Object old = null; // return value
synchronized(takeMonitor_) {
while (usedSlots_ <= 0) {
++waitingTakes_;
try { takeMonitor_.wait(); }
catch(InterruptedException ex) {};
--waitingTakes_;
}
--usedSlots_;
old = array_[takePtr_];
array_[takePtr_] = null;
takePtr_ = (takePtr_ + 1) % array_.length;
}
synchronized(putMonitor_) {
++emptySlots_;
if (waitingPuts_ > 0)
putMonitor_.notify();
}
return old;
}
}
| [
"sd@dfh.com"
] | sd@dfh.com |
83e8402655d40bd4ceeae18b04bd05f1bd5c249c | 5ecd15baa833422572480fad3946e0e16a389000 | /framework/MCS-Open/subsystems/runtime/main/api/java/com/volantis/mcs/integration/transcoder/Transforce.java | 59c915e083040618d3b4ef152f2dd7f10ebd6056 | [] | no_license | jabley/volmobserverce | 4c5db36ef72c3bb7ef20fb81855e18e9b53823b9 | 6d760f27ac5917533eca6708f389ed9347c7016d | refs/heads/master | 2021-01-01T05:31:21.902535 | 2009-02-04T02:29:06 | 2009-02-04T02:29:06 | 38,675,289 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,272 | java | /*
This file is part of Volantis Mobility Server.
Volantis Mobility Server is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Volantis Mobility Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Volantis Mobility Server. If not, see <http://www.gnu.org/licenses/>.
*/
/* ----------------------------------------------------------------------------
* (c) Volantis Systems Ltd 2003.
* ----------------------------------------------------------------------------
*/
package com.volantis.mcs.integration.transcoder;
import com.volantis.mcs.integration.TransforceURLParameterProvider;
/**
* This transcoder is designed to support the PictureIQ TransForce server.
*/
public class Transforce extends ParameterizedTranscoder {
/**
* Initializes the new instance.
*/
public Transforce() {
super(TransforceURLParameterProvider.SINGLETON);
}
}
/*
===========================================================================
Change History
===========================================================================
$Log$
18-Jan-05 6705/1 allan VBM:2005011708 Remove the height from the width parameter
08-Dec-04 6416/3 ianw VBM:2004120703 New Build
08-Dec-04 6416/1 ianw VBM:2004120703 New Build
01-Dec-04 6356/1 geoff VBM:2004112205 MCS Transcoder Transforce plugin
15-Nov-04 6205/1 claire VBM:2004111501 Correcting port parameter constant
04-Nov-04 6109/2 philws VBM:2004072013 Update the convertImageURLTo... pipeline processes to utilize the current pluggable asset transcoder's parameter names
29-Jul-04 4991/1 byron VBM:2004070510 VTS classes need renaming in MCS to ICS
26-Sep-03 1454/1 philws VBM:2003092401 Provide asset transcoder plugin API and configuration-selectable standard implementations
===========================================================================
*/
| [
"iwilloug@b642a0b7-b348-0410-9912-e4a34d632523"
] | iwilloug@b642a0b7-b348-0410-9912-e4a34d632523 |
60a6c9d81e1659d1570a4699147daf79b199fb3c | 95a54e3f3617bf55883210f0b5753b896ad48549 | /java_src/com/google/android/exoplayer2/metadata/MetadataDecoderFactory.java | 8b8004115f4ef9eef9cb720ee6008e18801e86d0 | [] | no_license | aidyk/TagoApp | ffc5a8832fbf9f9819f7f8aa7af29149fbab9ea5 | e31a528c8f931df42075fc8694754be146eddc34 | refs/heads/master | 2022-12-22T02:20:58.486140 | 2021-05-16T07:42:02 | 2021-05-16T07:42:02 | 325,695,453 | 3 | 1 | null | 2022-12-16T00:32:10 | 2020-12-31T02:34:45 | Smali | UTF-8 | Java | false | false | 4,150 | java | package com.google.android.exoplayer2.metadata;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.util.MimeTypes;
public interface MetadataDecoderFactory {
public static final MetadataDecoderFactory DEFAULT = new MetadataDecoderFactory() {
/* class com.google.android.exoplayer2.metadata.MetadataDecoderFactory.AnonymousClass1 */
@Override // com.google.android.exoplayer2.metadata.MetadataDecoderFactory
public boolean supportsFormat(Format format) {
String str = format.sampleMimeType;
return MimeTypes.APPLICATION_ID3.equals(str) || MimeTypes.APPLICATION_EMSG.equals(str) || MimeTypes.APPLICATION_SCTE35.equals(str);
}
/* JADX WARNING: Removed duplicated region for block: B:17:0x0038 */
/* JADX WARNING: Removed duplicated region for block: B:19:0x0040 */
/* JADX WARNING: Removed duplicated region for block: B:21:0x0046 */
/* JADX WARNING: Removed duplicated region for block: B:23:0x004c */
@Override // com.google.android.exoplayer2.metadata.MetadataDecoderFactory
/* Code decompiled incorrectly, please refer to instructions dump. */
public com.google.android.exoplayer2.metadata.MetadataDecoder createDecoder(com.google.android.exoplayer2.Format r3) {
/*
r2 = this;
java.lang.String r3 = r3.sampleMimeType
int r0 = r3.hashCode()
r1 = -1248341703(0xffffffffb597d139, float:-1.1311269E-6)
if (r0 == r1) goto L_0x002a
r1 = 1154383568(0x44ce7ed0, float:1651.9629)
if (r0 == r1) goto L_0x0020
r1 = 1652648887(0x62816bb7, float:1.1936958E21)
if (r0 == r1) goto L_0x0016
goto L_0x0034
L_0x0016:
java.lang.String r0 = "application/x-scte35"
boolean r3 = r3.equals(r0)
if (r3 == 0) goto L_0x0034
r3 = 2
goto L_0x0035
L_0x0020:
java.lang.String r0 = "application/x-emsg"
boolean r3 = r3.equals(r0)
if (r3 == 0) goto L_0x0034
r3 = 1
goto L_0x0035
L_0x002a:
java.lang.String r0 = "application/id3"
boolean r3 = r3.equals(r0)
if (r3 == 0) goto L_0x0034
r3 = 0
goto L_0x0035
L_0x0034:
r3 = -1
L_0x0035:
switch(r3) {
case 0: goto L_0x004c;
case 1: goto L_0x0046;
case 2: goto L_0x0040;
default: goto L_0x0038;
}
L_0x0038:
java.lang.IllegalArgumentException r3 = new java.lang.IllegalArgumentException
java.lang.String r0 = "Attempted to create decoder for unsupported format"
r3.<init>(r0)
throw r3
L_0x0040:
com.google.android.exoplayer2.metadata.scte35.SpliceInfoDecoder r3 = new com.google.android.exoplayer2.metadata.scte35.SpliceInfoDecoder
r3.<init>()
return r3
L_0x0046:
com.google.android.exoplayer2.metadata.emsg.EventMessageDecoder r3 = new com.google.android.exoplayer2.metadata.emsg.EventMessageDecoder
r3.<init>()
return r3
L_0x004c:
com.google.android.exoplayer2.metadata.id3.Id3Decoder r3 = new com.google.android.exoplayer2.metadata.id3.Id3Decoder
r3.<init>()
return r3
switch-data {0->0x004c, 1->0x0046, 2->0x0040, }
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.exoplayer2.metadata.MetadataDecoderFactory.AnonymousClass1.createDecoder(com.google.android.exoplayer2.Format):com.google.android.exoplayer2.metadata.MetadataDecoder");
}
};
MetadataDecoder createDecoder(Format format);
boolean supportsFormat(Format format);
}
| [
"ai@AIs-MacBook-Pro.local"
] | ai@AIs-MacBook-Pro.local |
76f555fde14a3437ad7039c22f54411c6673e0aa | 25a91c33745c6b4476ea6cc67b8c12d1cf10c472 | /TIJ4/src/za/co/coach/learning/tij/io/RecoverCADState.java | ac82c23085f3cd7d7409cb4ab4623c7da09f5391 | [] | no_license | kumbirai/Learning | f3148b90c8d532316397d87b3027d5efff801d5e | 73573e416acf26c069a5f5240532e940b4a8fafa | refs/heads/master | 2021-01-15T17:07:12.084262 | 2013-01-03T09:31:14 | 2013-01-03T09:31:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,228 | java | package za.co.coach.learning.tij.io;
//: za.co.coach.learning.tij.io/RecoverCADState.java
// Restoring the state of the pretend CAD system.
// {RunFirst: StoreCADState}
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.List;
public class RecoverCADState {
@SuppressWarnings("unchecked")
public static void main(String[] args) throws Exception {
ObjectInputStream in = new ObjectInputStream(new FileInputStream("CADState.out"));
// Read in the same order they were written:
List<Class<? extends Shape>> shapeTypes = (List<Class<? extends Shape>>) in.readObject();
Line.deserializeStaticState(in);
List<Shape> shapes = (List<Shape>) in.readObject();
System.out.println(shapes);
}
} /* Output:
[class Circlecolor[1] xPos[58] yPos[55] dim[93]
, class Squarecolor[0] xPos[61] yPos[61] dim[29]
, class Linecolor[3] xPos[68] yPos[0] dim[22]
, class Circlecolor[1] xPos[7] yPos[88] dim[28]
, class Squarecolor[0] xPos[51] yPos[89] dim[9]
, class Linecolor[3] xPos[78] yPos[98] dim[61]
, class Circlecolor[1] xPos[20] yPos[58] dim[16]
, class Squarecolor[0] xPos[40] yPos[11] dim[22]
, class Linecolor[3] xPos[4] yPos[83] dim[6]
, class Circlecolor[1] xPos[75] yPos[10] dim[42]
]
*///:~
| [
"kumbirai@gmail.com"
] | kumbirai@gmail.com |
305d00f6a22b368dffa6d4dd2f9a762657a2eed4 | d3e046f5608495e2aa561f3677e005325d0783c1 | /src/main/java/io/jaegertracing/qe/rest/model/Dependency.java | 3a0e754b086020eca805b9cd512233db1193e5e5 | [] | no_license | objectiser/jaeger-java-test | 2edcda16d6b6e306f2e8f75e9b6ee204ec11f9ce | 7e713e3907a1ab2bed29799abced593e27202d8a | refs/heads/master | 2021-01-21T12:52:46.998948 | 2017-08-22T12:30:14 | 2017-08-22T12:30:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package io.jaegertracing.qe.rest.model;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
/**
* @author Jeeva Kandasamy (jkandasa)
*/
@Getter
@ToString
@NoArgsConstructor
public class Dependency {
private String parent;
private String child;
private Long callCount;
} | [
"jkandasa@redhat.com"
] | jkandasa@redhat.com |
7a27eaaf249b22a91601806865fcbcab6ddcfbc8 | f6d28c54d76c3c4ce18d184f2c55253ae511e9af | /PcmEventv4/src/fr/cactuscata/pcmeventv4/command/simplecmd/warp/WarpFile.java | 5a8bfbf2ffa4519d50826a35b88a23f6547b7022 | [] | no_license | CactusCata/PcmEventv4 | 307a139b1e29c7d2b381a0417ea4a64c7543226b | 6ea7051653e36a9702d036acb959f599f40bc015 | refs/heads/master | 2020-05-04T17:36:50.243523 | 2019-04-03T15:28:56 | 2019-04-03T15:28:56 | 179,318,487 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 6,322 | java | package fr.cactuscata.pcmeventv4.command.simplecmd.warp;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import fr.cactuscata.pcmeventv4.utils.bukkit.LocationSerializer;
import fr.cactuscata.pcmeventv4.utils.bukkit.PrefixMessage;
import fr.cactuscata.pcmeventv4.utils.bukkit.file.FileUtils;
/**
* <p>
* Cette classe permet tout le fonctionnement des warps comme :
* <ul>
* <li>{@link SetWarpCmd}</li>
* <li>{@link WarpCmd}</li>
* <li>{@link DelWarpCmd}</li>
* <li>{@link WarpInfoCmd}</li>
* <li>{@link WarpsCmd}</li>
* </ul>
* <p>
* Lorsque le plugin démarre toutes les informations du fichier
* {@code warps.yml} sont récupérés via {@link WarpFile#init()} et sont placés
* dans l'objet {@link Map} avec comme clef l'objet {@link String} et comme
* valeur {@link CLocation} qui permettra par la suite de savoir si le warp dans
* lequel on veut aller se trouve dans le même monde et affiche un message
* d'erreur si le monde est innacessible.
* </p>
* <p>
* Lorsque le plugin s'éteint, toutes les informations mises dans l'object
* {@link Map} seront écrites dans le ficher {@code warps.yml}. <strong>Cela
* veut donc dire que si une modification est faite dans le fichier
* {@code warps.yml} pendant que le plugin est allumé, elle ne sera pas prise en
* compte !</strong>
* </p>
*
* @author CactusCata
* @version 2.5.1
* @since 2.0.0
* @see SetWarpCmd WarpCmd DelWarpCmd WarpInfoCmd WarpsCmd CLocation.
*/
public final class WarpFile extends FileUtils {
private static final long serialVersionUID = 1L;
private final Map<String, CLocation> warps = new HashMap<>();
/**
* Méthode qui permet d'instancier la super-class.
*/
public WarpFile() {
super("warps.yml");
super.init();
}
protected final void init(final FileConfiguration config) {
config.getKeys(false).forEach(key -> this.warps.put(key,
new CLocation(LocationSerializer.locationFromString(config.getString(key)))));
}
/**
* Teleport {@link org.bukkit.entity.Player} to warp location.
*
* @param warpName
* Name of the warp.
* @param player
* Player
*/
public final void teleport(final String warpName, final Player player) {
final CLocation cLocation = this.warps.get(warpName);
if (!cLocation.isCorrectWorld) {
player.sendMessage(
PrefixMessage.PREFIX + "Le warp '" + warpName + "' donne normalement accès au monde du nom \""
+ cLocation.worldName + "\" mais celui-ci n'est pas accèssible !");
} else {
player.teleport(cLocation.location, TeleportCause.PLUGIN);
player.sendMessage(PrefixMessage.PREFIX + "Vous avez bien été téléporté au warp '" + warpName + "' !");
}
}
/**
* Check if warp exist.
*
* @param warpName
* Used for check if the warp exist.
* @return The game contains a warp with this name.
*/
public final boolean notExist(final String warpName) {
return this.getAllWarps().get(warpName) == null;
}
/**
* Get Location of a warp.
*
* @param warpName
* The name of the warp.
* @return The {@link org.bukkit.Location}.
*/
public final Location getLocationWarp(final String warpName) {
return this.getAllWarps().get(warpName).location;
}
/**
* Get the name of the world form a wawrp name.
*
* @param warpName
* The name of the warp.
* @return The world name.
*/
public final String getWorldName(final String warpName) {
return this.getAllWarps().get(warpName).worldName;
}
/**
* Add new warp.
*
* @param warpName
* The name of the new warp.
* @param location
* The Location of the warp.
*/
public final void addNewWarp(final String warpName, final Location location) {
this.getAllWarps().put(warpName, new CLocation(location));
}
/**
* Remove a warp with his name.
*
* @param warpName
* The name of the warp to delete.
*/
public final void removeWarp(final String warpName) {
this.getAllWarps().remove(warpName);
}
/**
* Get all warps.
*
* @return A {@link java.util.Map} with {@link String} like key and
* {@link CLocation} with value.
*/
public final Map<String, CLocation> getAllWarps() {
return this.warps;
}
/**
* Get amount of the warps.
*
* @return amount of the warp.
*/
public final int getNumberWarp() {
return this.warps.size();
}
public final void updateFile(final FileConfiguration config) {
for (final String warpsNames : this.getAllWarps().keySet()) {
final CLocation clocation = this.getAllWarps().get(warpsNames);
config.set(warpsNames, clocation.worldName + ", " + clocation.x + ", " + clocation.y + ", " + clocation.z
+ ", " + clocation.yaw + ", " + clocation.pitch);
}
}
/**
* This class is a security for object {@link Location}, the world can create
* error if they not exist.
*
* @author CactusCata
* @version 2.5.4
* @since 2.2.0
*
*/
private final class CLocation {
private final String worldName;
private final double x, y, z;
private final float yaw, pitch;
private final Location location;
private final boolean isCorrectWorld;
private CLocation(final Location location) {
this(location.getWorld().getName(), location.getX(), location.getY(), location.getZ(), location.getYaw(),
location.getPitch());
}
private CLocation(final String worldName, final double x, final double y, final double z, final float yaw,
final float pitch) {
this.worldName = worldName;
this.x = x;
this.y = y;
this.z = z;
this.yaw = yaw;
this.pitch = pitch;
final World world = Bukkit.getWorld(worldName);
if (world != null) {
this.location = new Location(world, x, y, z, yaw, pitch);
this.isCorrectWorld = true;
} else {
this.location = new Location(Bukkit.getWorlds().get(0), x, y, z, yaw, pitch);
this.isCorrectWorld = false;
}
}
}
}
| [
"adam.chareyre.1999@gmail.com"
] | adam.chareyre.1999@gmail.com |
1070edce8dc8c33ea561451d75b755a7d59972a4 | 73c5f5a5545036967df0d5ddf2cbfaa97fbe49ed | /src/src/com/rapidminer/operator/learner/functions/kernel/rvm/kernel/KernelCauchy.java | 490fea015d127982565916073f91369c70ccaf3d | [] | no_license | hejiming/rapiddataminer | 74b103cb4523ccba47150045c165dc384cf7d38f | 177e15fa67dee28b311f6d9176bbfeedae6672e2 | refs/heads/master | 2021-01-10T11:35:48.036839 | 2015-12-31T12:29:43 | 2015-12-31T12:29:43 | 48,233,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,700 | java | /*
* RapidMiner
*
* Copyright (C) 2001-2008 by Rapid-I and the contributors
*
* Complete list of developers available at our web site:
*
* http://rapid-i.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*/
package com.rapidminer.operator.learner.functions.kernel.rvm.kernel;
/**
* Cauchy kernel:
* K(x, y) = 1 / (1 + lengthScale^{-2} * ||x - y||^2)
*
* @author Piotr Kasprzak, Ingo Mierswa
* @version $Id: KernelCauchy.java,v 1.3 2008/05/09 19:23:26 ingomierswa Exp $
*/
public class KernelCauchy extends KernelRadial {
private static final long serialVersionUID = 4933996037410512408L;
/** Constructor(s) */
public KernelCauchy() {}
public KernelCauchy(double lengthScale) {
super(lengthScale);
}
/** evaluate kernel */
public double eval(double[] x, double[] y) {
double result = 1.0d / (1.0d + Math.pow(lengthScale, -2) * norm2(x, y));
return result;
}
public String toString() {
return "chauchy kernel [lengthScale = " + lengthScale + "]";
}
}
| [
"dao.xiang.cun@163.com"
] | dao.xiang.cun@163.com |
8a8b8256cb440aca84a9e2e7ede2ee10811a630f | 5bc4400f0b1cedc14ecbbf35ee13ecd528347f77 | /src/main/java/LeetCode/Tree/LeetCode230_Sol2.java | ed10d1541e5b423d74f658230414cf84d4e6d2cb | [] | no_license | SLYJason/OJ-ALG | 6de4ab14434b02f86fa21b00d5c636fffa324150 | ecfd4bb6ee9e1c254bee1cfd143be82f02f6ec69 | refs/heads/master | 2023-07-06T06:57:21.943147 | 2023-06-21T05:21:25 | 2023-06-21T05:21:25 | 133,293,420 | 0 | 0 | null | 2022-09-06T02:04:40 | 2018-05-14T02:15:18 | Java | UTF-8 | Java | false | false | 491 | java | package LeetCode.Tree;
import java.util.Stack;
import Shared.TreeNode;
public class LeetCode230_Sol2 {
// Solution 2: iterative
public int kthSmallest(TreeNode root, int k) {
Stack<TreeNode> stack = new Stack();
while(true) {
while(root != null) {
stack.push(root);
root = root.left;
}
root = stack.pop();
if(--k == 0) return root.val;
root = root.right;
}
}
}
| [
"songly91.6.1@gmail.com"
] | songly91.6.1@gmail.com |
039ad67792aae505ca5ced4db7012f6500bb4dad | 13ba8c64547d09585957b4a8427e8749c2c1f7d2 | /src/state_pattern/TV.java | 20469eff26863ca1d4d7a6fe48c4364733106ffd | [] | no_license | potarichard/designpatterns | 3d8983756dd71d76c91be670f9d14434389dffd5 | 158c938a5adb031d96c966c98cde7bc6c1621c86 | refs/heads/master | 2022-12-19T14:50:51.317314 | 2020-10-02T16:17:39 | 2020-10-02T16:17:39 | 300,669,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package state_pattern;
public class TV
{
private State on_off_state;
public State stream_state;
public State getOffOnState() { return on_off_state; }
public void setOffOnState(State state) { this.on_off_state = state; }
public void setOnOffState(State state)
{
this.on_off_state = state;
}
public void pressButton0()
{
on_off_state.pressSwitch(this);
}
}
| [
"richard.i.pota@gmail.com"
] | richard.i.pota@gmail.com |
68263b2a9d6a887ba65e3a3f672333d195c215f6 | 6ad7fe2f5d93e83b322347653dc81a91af69649a | /hibernate-jta/src/test/java/com/orm/hibernate/jta/fetching/CartesianProduct.java | 717037751f165f9b6fb5d14ac6a11c1463cf5d82 | [] | no_license | AnatolVishnyakov/hibernate | 9ed0285a241766530c268a7da0d0f9d74f647c89 | 8dea245e05b5279f4745437ba99b5f25faa9181b | refs/heads/master | 2022-09-11T17:18:39.607764 | 2022-05-25T15:49:20 | 2022-05-25T15:49:20 | 219,286,415 | 0 | 0 | null | 2022-09-08T01:13:04 | 2019-11-03T10:52:58 | Java | UTF-8 | Java | false | false | 1,953 | java | package com.orm.hibernate.jta.fetching;
import com.orm.hibernate.jta.env.JPATest;
import com.orm.hibernate.jta.model.fetching.cartesianproduct.Bid;
import com.orm.hibernate.jta.model.fetching.cartesianproduct.Item;
import com.orm.hibernate.jta.model.fetching.cartesianproduct.User;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import javax.persistence.EntityManager;
import javax.transaction.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Random;
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class CartesianProduct extends JPATest {
private Item createdItem;
@Override
public void configurePersistenceUnit() throws Exception {
configurePersistenceUnit("FetchingCartesianProductPU");
System.setProperty("keepSchema", "true");
}
@BeforeEach
void initDataSet() throws SystemException, NotSupportedException, HeuristicRollbackException, HeuristicMixedException, RollbackException {
final UserTransaction tx = TM.getUserTransaction();
tx.begin();
final EntityManager em = JPA.createEntityManager();
final User seller = new User("JohnDoe");
em.persist(seller);
createdItem = new Item("Original Name", new Date(), seller);
em.persist(createdItem);
for (int i = 0; i < 3; i++) {
final Bid bid = new Bid(createdItem, BigDecimal.valueOf(new Random().nextDouble()));
em.persist(bid);
createdItem.getImages().add("image-" + UUID.randomUUID().toString());
}
tx.commit();
em.close();
}
@Test
void cartesianProduct() {
final EntityManager em = JPA.createEntityManager();
final Item item = em.find(Item.class, createdItem.getId());
em.detach(item);
assertEquals(item.getImages().size(), 3);
assertEquals(item.getBids().size(), 3);
}
}
| [
"malfenius@gmail.com"
] | malfenius@gmail.com |
3a4b00621e9c129aafd49cce2842ffcbc4c938d7 | 980ae28f7eb4f7533fb1fc9bf817ca71af59f1a8 | /src/main/java/com/erp/security/service/UsuarioService.java | 648c50395184dc2b83c40b168187ee5aed88a77d | [] | no_license | fsergio-santos/erp | 065f4f296bcdfdef29f91b2d7889e1c12a2f282b | 335f1ce6f748a2cbfbc8138966275ccf878d9800 | refs/heads/master | 2023-08-18T12:18:52.172062 | 2020-03-12T12:51:24 | 2020-03-12T12:51:24 | 218,395,427 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | package com.erp.security.service;
import java.util.List;
import java.util.Optional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.erp.config.util.service.GenericService;
import com.erp.security.model.Usuario;
import com.erp.security.repository.filtro.UsuarioFiltro;
public interface UsuarioService extends GenericService<Usuario, Long>{
Optional<Usuario> findUsuarioByEmail(String email);
Usuario updateRegistroUsuario(Usuario usuario);
Usuario findUsuarioAtivoPeloEmail(String email);
Usuario findByIdUsuarioRoleAndPermissions(Long id);
Page<Usuario> listUsuarioWithPagination(UsuarioFiltro usuarioFiltro, Pageable pageable);
List<String> getUsuarioFromSessionRegistry();
}
| [
"fsergio.santos@hotmail.com"
] | fsergio.santos@hotmail.com |
c1dfcf36857b1ee7dc4aabc84335f81acfffd7e2 | f6b4b242b3954fae10d22b777fb5888885c8f66a | /src/main/java/mx/infotec/dads/insight/util/DateCalculatorFactory.java | 32803e948d046b4f2b995ed495e6ccd40203fcd0 | [] | no_license | dads-software-brotherhood/insight-report | 4e4ecca651e0166e42e4139183354d8c667d97e8 | 42997d22541d814f4621169f80c83615f1c4218e | refs/heads/master | 2021-01-17T18:13:44.110757 | 2016-07-09T00:04:57 | 2016-07-09T00:04:57 | 62,923,762 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,591 | java | package mx.infotec.dads.insight.util;
import java.util.HashSet;
import java.util.Set;
import org.joda.time.LocalDate;
import net.objectlab.kit.datecalc.common.DateCalculator;
import net.objectlab.kit.datecalc.common.DefaultHolidayCalendar;
import net.objectlab.kit.datecalc.common.HolidayHandlerType;
import net.objectlab.kit.datecalc.joda.LocalDateKitCalculatorsFactory;
/**
* Date Calculator Factory se utiliza para crear una instancia de DateCalculator
* en toda la aplicación.
*
* @author Daniel Cortes Pichardo
*
*/
public class DateCalculatorFactory {
private static DateCalculator<LocalDate> dateCalculator = null;
private DateCalculatorFactory() {
}
/**
* Regresa una instancia de dateCalculator para que sea utilizada en todo el
* sistema.
*
* @return DateCalculator <LocalDate> del sistema
*/
public static DateCalculator<LocalDate> getCurrentInstance() {
if (dateCalculator == null) {
return getConfiguration();
} else {
return dateCalculator;
}
}
private static DateCalculator<LocalDate> getConfiguration() {
DateCalculator<LocalDate> dateCalculator;
Set<LocalDate> holidays = new HashSet<>();
holidays.add(new LocalDate(2009, 12, 25));
DefaultHolidayCalendar<LocalDate> holidayCalendar = new DefaultHolidayCalendar<>(holidays);
LocalDateKitCalculatorsFactory.getDefaultInstance().registerHolidays("example", holidayCalendar);
dateCalculator = LocalDateKitCalculatorsFactory.getDefaultInstance().getDateCalculator("example",
HolidayHandlerType.FORWARD);
return dateCalculator;
}
}
| [
"daniel.cortes.pichardo@gmail.com"
] | daniel.cortes.pichardo@gmail.com |
cd4c80d2b7df56d19a9ec5bce622c0beda5c5892 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/am/e.java | bae976cb5a265ad4edf522a9d7cf3ed4f34b581d | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 347 | java | package com.tencent.mm.am;
import com.tencent.mm.protocal.protobuf.uu;
public abstract interface e
{
public abstract void a(uu paramuu1, uu paramuu2, uu paramuu3);
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes4.jar
* Qualified Name: com.tencent.mm.am.e
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
1ed789d3a16a96b705b2791abf9381cc7c6cbf63 | 8a98577c5995449677ede2cbe1cc408c324efacc | /Big_Clone_Bench_files_used/bcb_reduced/3/selected/1927062.java | 38e0169c58d13e69ffdf81a26485b67c2716aee8 | [
"MIT"
] | permissive | pombredanne/lsh-for-source-code | 9363cc0c9a8ddf16550ae4764859fa60186351dd | fac9adfbd98a4d73122a8fc1a0e0cc4f45e9dcd4 | refs/heads/master | 2020-08-05T02:28:55.370949 | 2017-10-18T23:57:08 | 2017-10-18T23:57:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,391 | java | package urjc.ScrumMaster.client.init;
import com.google.gwt.json.client.JSONBoolean;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.events.CloseClientEvent;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.ButtonItem;
import com.smartgwt.client.widgets.form.fields.PasswordItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.form.fields.events.KeyPressEvent;
import com.smartgwt.client.widgets.form.fields.events.KeyPressHandler;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import urjc.ScrumMaster.client.ScrumMasterPanel;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.Window;
import urjc.ScrumMaster.client.product.ProductListPanel;
/**
* Generate a pannel.
* @author Eduardo Rodrigo
*/
public class InitPanel extends ScrumMasterPanel {
private ButtonItem button = new ButtonItem("Accept", constants.accept());
/**
* Constructor of the class.
*/
public InitPanel() {
super();
setSize("50%", "50%");
init();
}
/**
* Start the panel.
*/
private void init() {
createWindowCenter(windowPrincipal, 380, 120, constants.authentication());
windowPrincipal.addItem(addForm());
windowPrincipal.addItem(errorMessage);
windowPrincipal.addCloseClickHandler(new CloseClickHandler() {
public void onCloseClick(CloseClientEvent event) {
windowPrincipal.destroy();
}
});
windowPrincipal.show();
}
/**
* Create a form that asks the user for credentials
* @return
*/
private DynamicForm addForm() {
final DynamicForm form = new DynamicForm();
form.setAlign(Alignment.CENTER);
form.setAutoFocus(true);
form.setNumCols(2);
form.setMargin(10);
final TextItem usernameItem = new TextItem("fName");
usernameItem.setTitle(constants.username());
usernameItem.setRequired(true);
usernameItem.setSelectOnFocus(true);
usernameItem.setWrapTitle(false);
usernameItem.setColSpan(1);
usernameItem.setStartRow(false);
usernameItem.setEndRow(true);
PasswordItem passwordItem = new PasswordItem("fPassword");
passwordItem.setTitle(constants.password());
passwordItem.setRequired(true);
passwordItem.setWrapTitle(false);
passwordItem.setColSpan(1);
passwordItem.setStartRow(false);
passwordItem.setEndRow(true);
passwordItem.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
if (event.getKeyName().equals("Enter")) {
clicked(form);
}
}
});
button = createButton();
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
clicked(form);
}
});
form.setFields(usernameItem, passwordItem, button);
return form;
}
private void clicked(DynamicForm form) {
if (form.getValueAsString("fPassword").equals("null")) {
showError(385, 165, constants.errorPass(), windowPrincipal, ERROR);
} else {
try {
String cifrado = encryptPassword(form.getValueAsString("fPassword"));
checkPassword(form.getValueAsString("fName"), cifrado);
} catch (NoSuchAlgorithmException ex) {
init();
}
}
}
/**
* Encrypt the password received.
* @param password
* @return
* @throws NoSuchAlgorithmException
*/
private String encryptPassword(String password) throws NoSuchAlgorithmException {
MessageDigest encript = MessageDigest.getInstance("MD5");
encript.update(password.getBytes());
byte[] b = encript.digest();
int size = b.length;
StringBuffer h = new StringBuffer(size);
for (int i = 0; i < size; i++) {
h.append(b[i]);
}
return h.toString();
}
private void checkPassword(final String Username, final String password) {
username = Username;
pwd = password;
String url = "http://localhost:8080/ScrumMasterServer/ScrumMasterServlet?user=" + Username + "&password=" + password;
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
try {
Request request = builder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
Window.alert("¡Couldn't connect to server!");
}
public void onResponseReceived(Request request, Response response) {
parseJsonData(response.getText());
}
});
} catch (RequestException e) {
e.printStackTrace();
}
}
private void parseJsonData(String json) {
JSONValue value = JSONParser.parse(json);
JSONObject productsObj = value.isObject();
boolean Paso = productsObj.get("paso").isBoolean().booleanValue();
if (Paso) {
try {
windowPrincipal.destroy();
RootPanel.get().add(new ElectionPanel(username));
RootPanel.get().add(new ProductListPanel(username, canvasPrincipal));
} catch (Exception ex) {
init();
}
} else {
showError(385, 165, constants.incorrectPass(), windowPrincipal, ERROR);
}
}
}
| [
"nishima@mymail.vcu.edu"
] | nishima@mymail.vcu.edu |
6a6ccbe95721983adbbb122b07f9c3a3dedd2642 | d2402ea937a0330e92ccaf6e1bfd8fc02e1b29c9 | /src/com/ms/silverking/cloud/dht/net/DebugMessageDump.java | 07855ba4c2020e21cf4299d6b25d00210589ac68 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | duyangzhou/SilverKing | b8880e0527eb6b5d895da4dbcf7a600b8a7786d8 | b1b582f96d3771c01bf8239c64e99869f54bb3a1 | refs/heads/master | 2020-04-29T19:34:13.958262 | 2019-07-25T17:48:17 | 2019-07-25T17:48:17 | 176,359,498 | 0 | 0 | Apache-2.0 | 2019-03-18T19:55:08 | 2019-03-18T19:55:08 | null | UTF-8 | Java | false | false | 3,724 | java | package com.ms.silverking.cloud.dht.net;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import com.ms.silverking.cloud.dht.client.ChecksumType;
import com.ms.silverking.cloud.dht.common.MessageType;
import com.ms.silverking.id.UUIDBase;
import com.ms.silverking.io.StreamParser;
import com.ms.silverking.text.StringUtil;
public class DebugMessageDump {
private final MessageType messageType;
public DebugMessageDump(MessageType messageType) {
this.messageType = messageType;
}
public void debug(File dumpFile) throws IOException {
MessageGroup mg;
mg = parse(dumpFile);
//System.out.println(mg);
//mg.displayForDebug(true);
for (MessageGroupKVEntry entry : mg.getPutValueKeyIterator(ChecksumType.MD5)) {
System.out.println("Entry:\t"+ entry);
}
}
public MessageGroup parse(File dumpFile) throws IOException {
return parse(StreamParser.parseFileLines(dumpFile));
}
public MessageGroup parse(List<String> lines) {
List<ByteBuffer> buffers;
buffers = getBuffers(lines);
return new MessageGroup(messageType,
0, // options
new UUIDBase(0, 0),
0L, // context
buffers.toArray(new ByteBuffer[0]),
new byte[6], // originator
0, // deadlineRelativeMillis
ForwardingMode.DO_NOT_FORWARD); // forward
}
private List<ByteBuffer> getBuffers(List<String> lines) {
List<ByteBuffer> buffers;
int i;
buffers = new ArrayList<>(lines.size() / 2);
i = 0;
while (i < lines.size()) {
BufferInfo bufferInfo;
ByteBuffer buf;
bufferInfo = new BufferInfo(lines.get(i));
buf = StringUtil.hexStringToByteBuffer(lines.get(i + 1));
//System.out.println(bufferInfo +"\t"+ buf);
buffers.add(buf);
i += 2;
}
return buffers;
}
class BufferInfo {
final int index;
final int pos;
final int lim;
final int cap;
//0 java.nio.HeapByteBuffer[pos=0 lim=1794 cap=1794]
BufferInfo(String s) {
int i;
s = s.replace(']', ' ').replace('[', ' ');
index = Integer.parseInt(s.split("\\s+")[0]);
i = s.indexOf("=") + 1;
pos = Integer.parseInt(s.substring(i).split("\\s+")[0]);
i = s.indexOf("=", i) + 1;
lim = Integer.parseInt(s.substring(i).split("\\s+")[0]);
i = s.indexOf("=", i) + 1;
cap = Integer.parseInt(s.substring(i).split("\\s+")[0]);
}
@Override
public String toString() {
return String.format("%d\tpos=%d lim=%d cap=%d", index, pos, lim, cap);
}
}
/**
* @param args
*/
public static void main(String[] args) {
try {
if (args.length != 2) {
System.out.println("Usage: <MessageType> <dumpFile>");
} else {
DebugMessageDump dmd;
MessageType messageType;
File dumpFile;
messageType = MessageType.valueOf(args[0]);
dumpFile = new File(args[1]);
dmd = new DebugMessageDump(messageType);
dmd.debug(dumpFile);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"Benjamin.Holst@morganstanley.com"
] | Benjamin.Holst@morganstanley.com |
fab26128a36fd5d3529b809cc3adebe77284586f | 519de3b9fca2d6f905e7f3498884094546432c30 | /kk-4.x/external/smack/src/org/jivesoftware/smack/util/ReaderListener.java | 16aa21e63a4f43e07abad325e4a2d57cd21fa2f9 | [] | no_license | hongshui3000/mt5507_android_4.4 | 2324e078190b97afbc7ceca22ec1b87b9367f52a | 880d4424989cf91f690ca187d6f0343df047da4f | refs/heads/master | 2020-03-24T10:34:21.213134 | 2016-02-24T05:57:53 | 2016-02-24T05:57:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,200 | java | /**
* $RCSfile$
* $Revision: #1 $
* $Date: 2014/10/13 $
*
* Copyright 2003-2007 Jive Software.
*
* 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 org.jivesoftware.smack.util;
/**
* Interface that allows for implementing classes to listen for string reading
* events. Listeners are registered with ObservableReader objects.
*
* @see ObservableReader#addReaderListener
* @see ObservableReader#removeReaderListener
*
* @author Gaston Dombiak
*/
public interface ReaderListener {
/**
* Notification that the Reader has read a new string.
*
* @param str the read String
*/
public abstract void read(String str);
}
| [
"342981011@qq.com"
] | 342981011@qq.com |
4d8aac625f41dd7c27928b1091daa7d52cbae955 | 7d63688ca3c1ee5d1240decd975044f701cdd136 | /src/main/java/invokeAny/Main.java | 7b3711de63b7e4ebb773447db175b16aa679db70 | [] | no_license | lllyl2012/concurrenceExecutorFramework | e629c21375d1b78c691b9f1bec84d483847fe337 | 65379661ba75fbdd76569a5d579eba8620e1a927 | refs/heads/master | 2021-04-12T03:58:12.383280 | 2018-03-20T08:04:29 | 2018-03-20T08:04:29 | 125,981,725 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,215 | java | package invokeAny;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* 运行多个任务并处理第一个结果
* invokeAny();
* @author soft01
*
*/
public class Main {
public static void main(String[] args) {
String username = "test";
String password="test";
UserValidator userV1 = new UserValidator("ldap","1234556");
UserValidator userV2 = new UserValidator("gogoing","666666");
TaskValidator ldap = new TaskValidator(userV1,username,password);
TaskValidator dbTask = new TaskValidator(userV2,username,password);
List<TaskValidator> taskList = new ArrayList<TaskValidator>();
taskList.add(ldap);
taskList.add(dbTask);
ExecutorService executor = Executors.newCachedThreadPool();
String result;
try {
result = executor.invokeAny(taskList);
System.out.println("result:"+result);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
executor.shutdown();
System.out.println("end");
}
}
| [
"229707363@qq.com"
] | 229707363@qq.com |
135e406a5241f76bf08ab69d62e6e9f6360a68b3 | de05dff4cc5b8fb97dfbb857bad2394ed8f79ae4 | /src/jd/nutils/Screen.java | 2d0c23ef0a58be242cea4a539486694112de5a2c | [] | no_license | thiagocrestani/jdownloader-service | 3a6c4929b808eb596c66f156812310701f4508eb | 2d24d86bb97a1e5f93feb474f688a6a289447553 | refs/heads/master | 2020-12-24T18:12:38.941947 | 2010-11-16T13:34:57 | 2010-11-16T13:34:57 | 35,786,842 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,423 | java | // jDownloader - Downloadmanager
// Copyright (C) 2009 JD-Team support@jdownloader.org
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.nutils;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Toolkit;
public class Screen {
/**
* Liefert einen Punkt zurueck, mit dem eine Komponente auf eine andere
* zentriert werden kann
*
* @param parent
* Die Komponente, an der ausgerichtet wird
* @param child
* Die Komponente die ausgerichtet werden soll
* @return Ein Punkt, mit dem diese Komponente mit der setLocation Methode
* zentriert dargestellt werden kann
*/
public static Point getCenterOfComponent(Component parent, Component child) {
Point center;
if (parent == null || !parent.isShowing()) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
int width = screenSize.width;
int height = screenSize.height;
center = new Point(width / 2, height / 2);
} else {
center = parent.getLocationOnScreen();
center.x += parent.getWidth() / 2;
center.y += parent.getHeight() / 2;
}
// Dann Auszurichtende Komponente in die Berechnung einfliessen lassen
center.x -= child.getWidth() / 2;
center.y -= child.getHeight() / 2;
return center;
}
public static Point getDockBottomRight(Component child) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
return new Point((int) (screenSize.getWidth() - child.getWidth()), (int) (screenSize.getHeight() - child.getHeight() - 60));
}
}
| [
"dpsenner@gmail.com"
] | dpsenner@gmail.com |
b91c97fa6629e4ef3919ba48ede51d014d8e184f | 57ec97caae6a381196ded23caa48bf3197eee0dd | /happylifeplat-transaction-admin/src/main/java/com/happylifeplat/transaction/admin/service/recover/JdbcRecoverTransactionServiceImpl.java | 74a082c3e1dd3efb503c55665c67cbfacd3f8102 | [
"Apache-2.0"
] | permissive | JackCaptain1015/HappyLifePlafTransactionStudy | 7c1edad272402ce430f8d96d3a56b38b97b59bff | d0efb0037566e60d685ff524a7b62c9768418faf | refs/heads/master | 2021-05-05T21:23:23.638814 | 2017-12-28T02:14:29 | 2017-12-28T02:14:29 | 115,574,925 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 6,985 | java | /*
*
* Copyright 2017-2018 549477611@qq.com(xiaoyu)
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 this distribution; if not, see <http://www.gnu.org/licenses/>.
*
*/
package com.happylifeplat.transaction.admin.service.recover;
import com.happylifeplat.transaction.admin.helper.PageHelper;
import com.happylifeplat.transaction.admin.page.CommonPager;
import com.happylifeplat.transaction.admin.page.PageParameter;
import com.happylifeplat.transaction.admin.query.RecoverTransactionQuery;
import com.happylifeplat.transaction.admin.service.RecoverTransactionService;
import com.happylifeplat.transaction.admin.vo.TransactionRecoverVO;
import com.happylifeplat.transaction.common.bean.TransactionInvocation;
import com.happylifeplat.transaction.common.exception.TransactionException;
import com.happylifeplat.transaction.common.holder.DateUtils;
import com.happylifeplat.transaction.common.holder.DbTypeUtils;
import com.happylifeplat.transaction.common.holder.RepositoryPathUtils;
import com.happylifeplat.transaction.common.serializer.ObjectSerializer;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* <p>Description: .</p>
* jdbc实现
*
* @author xiaoyu(Myth)
* @version 1.0
* @date 2017/10/19 17:08
* @since JDK 1.8
*/
public class JdbcRecoverTransactionServiceImpl implements RecoverTransactionService {
@Autowired
private JdbcTemplate jdbcTemplate;
private String dbType;
/**
* 分页获取补偿事务信息
*
* @param query 查询条件
* @return CommonPager<TransactionRecoverVO>
*/
@Override
public CommonPager<TransactionRecoverVO> listByPage(RecoverTransactionQuery query) {
final String tableName = RepositoryPathUtils.buildDbTableName(query.getApplicationName());
final PageParameter pageParameter = query.getPageParameter();
StringBuilder sqlBuilder = new StringBuilder();
sqlBuilder.append("select id,target_class,target_method," +
" retried_count,create_time,last_time,version,group_id,task_id from ")
.append(tableName).append(" where 1= 1 ");
if (StringUtils.isNoneBlank(query.getTxGroupId())) {
sqlBuilder.append(" and group_id = ").append(query.getTxGroupId());
}
if (Objects.nonNull(query.getRetry())) {
sqlBuilder.append(" and retried_count < ").append(query.getRetry());
}
final String sql = buildPageSql(sqlBuilder.toString(), pageParameter);
CommonPager<TransactionRecoverVO> pager = new CommonPager<>();
final List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
if (CollectionUtils.isNotEmpty(mapList)) {
pager.setDataList(mapList.stream().map(this::buildByMap).collect(Collectors.toList()));
}
final Integer totalCount =
jdbcTemplate.queryForObject("select count(1) from " + tableName, Integer.class);
pager.setPage(PageHelper.buildPage(pageParameter, totalCount));
return pager;
}
/**
* 批量删除补偿事务信息
*
* @param ids ids 事务id集合
* @param applicationName 应用名称
* @return true 成功
*/
@Override
public Boolean batchRemove(List<String> ids, String applicationName) {
if (CollectionUtils.isEmpty(ids) || StringUtils.isBlank(applicationName)) {
return Boolean.FALSE;
}
final String tableName = RepositoryPathUtils.buildDbTableName(applicationName);
ids.stream()
.map(id -> buildDelSql(tableName, id))
.forEach(sql -> jdbcTemplate.execute(sql));
return Boolean.TRUE;
}
/**
* 更改恢复次数
*
* @param id 事务id
* @param retry 恢复次数
* @param applicationName 应用名称
* @return true 成功
*/
@Override
public Boolean updateRetry(String id, Integer retry, String applicationName) {
if (StringUtils.isBlank(id) || StringUtils.isBlank(applicationName) || Objects.isNull(retry)) {
return false;
}
final String tableName = RepositoryPathUtils.buildDbTableName(applicationName);
StringBuilder sqlBuilder = new StringBuilder();
sqlBuilder.append("update ").append(tableName)
.append(" set retried_count = ")
.append(retry).append(",last_time= '")
.append(DateUtils.getCurrentDateTime()).append("'")
.append(" where id =").append(id);
jdbcTemplate.execute(sqlBuilder.toString());
return Boolean.TRUE;
}
private TransactionRecoverVO buildByMap(Map<String, Object> map) {
TransactionRecoverVO vo = new TransactionRecoverVO();
vo.setId((String) map.get("id"));
vo.setRetriedCount((Integer) map.get("retried_count"));
vo.setCreateTime(String.valueOf(map.get("create_time")));
vo.setLastTime(String.valueOf(map.get("last_time")));
vo.setTaskId((String) map.get("task_id"));
vo.setGroupId((String) map.get("group_id"));
vo.setVersion((Integer) map.get("version"));
vo.setTargetClass((String) map.get("target_class"));
vo.setTargetMethod((String) map.get("target_method"));
return vo;
}
private String buildPageSql(String sql, PageParameter pageParameter) {
switch (dbType) {
case "mysql":
return PageHelper.buildPageSqlForMysql(sql, pageParameter).toString();
case "oracle":
return PageHelper.buildPageSqlForOracle(sql, pageParameter).toString();
case "sqlserver":
return PageHelper.buildPageSqlForSqlserver(sql, pageParameter).toString();
default:
return null;
}
}
public String getDbType() {
return dbType;
}
public void setDbType(String dbType) {
this.dbType = DbTypeUtils.buildByDriverClassName(dbType);
}
private String buildDelSql(String tableName, String id) {
return "DELETE FROM " + tableName + " WHERE ID=" + id;
}
}
| [
"yu.xiao@happylifeplat.com"
] | yu.xiao@happylifeplat.com |
6e4a1bfcbe5586d8ea76abe123b2d5f056ad9111 | 5598faaaaa6b3d1d8502cbdaca903f9037d99600 | /code_changes/Apache_projects/AMQ-5356/0f492f3b4bc2665fd38ea66813381e4bd9ca3b64/ObrFeatureTest.java | 9160e3bacc4cc3a3e7816f05771f6e15af971aa8 | [] | no_license | SPEAR-SE/LogInBugReportsEmpirical_Data | 94d1178346b4624ebe90cf515702fac86f8e2672 | ab9603c66899b48b0b86bdf63ae7f7a604212b29 | refs/heads/master | 2022-12-18T02:07:18.084659 | 2020-09-09T16:49:34 | 2020-09-09T16:49:34 | 286,338,252 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,653 | 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.activemq.karaf.itest;
import java.util.concurrent.Callable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.MavenUtils;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
@RunWith(PaxExam.class)
public class ObrFeatureTest extends AbstractFeatureTest {
@Configuration
public static Option[] configure() {
Option[] options = append(
editConfigurationFilePut("etc/system.properties", "camel.version", MavenUtils.getArtifactVersion("org.apache.camel.karaf", "apache-camel")),
configure("obr"));
// can't see where these deps die in a paxexam container - vanilla distro unpack can install war feature ok
options = append(CoreOptions.mavenBundle("org.apache.xbean", "xbean-bundleutils").versionAsInProject(), options);
options = append(CoreOptions.mavenBundle("org.apache.xbean", "xbean-asm-util").versionAsInProject(), options);
return append(CoreOptions.mavenBundle("org.apache.xbean", "xbean-finder").versionAsInProject(), options);
}
@Test(timeout=5 * 60 * 1000)
public void testWar() throws Throwable {
// note xbean deps manually installed above, should not be needed
withinReason(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
assertTrue("xbean finder bundle installed", verifyBundleInstalled("org.apache.xbean.finder"));
return true;
}
});
installAndAssertFeature("war");
}
@Test(timeout=5 * 60 * 1000)
public void testClient() throws Throwable {
installAndAssertFeature("activemq-client");
}
@Test(timeout=5 * 60 * 1000)
public void testActiveMQ() throws Throwable {
installAndAssertFeature("activemq");
}
@Test(timeout=5 * 60 * 1000)
public void testBroker() throws Throwable {
// ensure pax-war feature deps are there for web-console
withinReason(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
assertTrue("xbean finder bundle installed", verifyBundleInstalled("org.apache.xbean.finder"));
return true;
}
});
installAndAssertFeature("activemq-broker");
}
@Test(timeout=5 * 60 * 1000)
public void testCamel() throws Throwable {
executeCommand("feature:repo-add " + getCamelFeatureUrl());
installAndAssertFeature("activemq-camel");
}
}
| [
"archen94@gmail.com"
] | archen94@gmail.com |
2307a2104a1ad84bedaac102252f6fb221ff0174 | b3a02d5f1f60cd584fbb6da1b823899607693f63 | /04_DB Frameworks_Hibernate+Spring Data/08_Spring Data Intro LAB/ShampooCompanySpring/src/main/java/app/model/ChemicalIngredient.java | 14a009b3462c9d1f312e8fe87996dc6ee80f61c4 | [
"MIT"
] | permissive | akkirilov/SoftUniProject | 20bf0543c9aaa0a33364daabfddd5f4c3e400ba2 | 709d2d1981c1bb6f1d652fe4101c1693f5afa376 | refs/heads/master | 2021-07-11T02:53:18.108275 | 2018-12-04T20:14:19 | 2018-12-04T20:14:19 | 79,428,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 169 | java | package app.model;
public interface ChemicalIngredient extends Ingredient {
String getChemicalFormula();
void setChemicalFormula(String chemicalFormula);
}
| [
"akkirilov@mail.bg"
] | akkirilov@mail.bg |
8df5cd4b00c889255a52812caa4b1272af9bd6fc | 6d60a8adbfdc498a28f3e3fef70366581aa0c5fd | /codebase/dataset/t1/1942_frag1.java | a9a5794c0db5aaab5aac6bf17a736ef3acd8a87f | [] | no_license | rayhan-ferdous/code2vec | 14268adaf9022d140a47a88129634398cd23cf8f | c8ca68a7a1053d0d09087b14d4c79a189ac0cf00 | refs/heads/master | 2022-03-09T08:40:18.035781 | 2022-02-27T23:57:44 | 2022-02-27T23:57:44 | 140,347,552 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 383 | java | Assert.assertEquals("1", reader.getRawRecord());
Assert.assertTrue(reader.readRecord());
Assert.assertEquals("1", reader.get(0));
Assert.assertEquals(1L, reader.getCurrentRecord());
Assert.assertEquals(1, reader.getColumnCount());
Assert.assertEquals("1", reader.getRawRecord());
Assert.assertFalse(reader.readRecord());
| [
"aaponcseku@gmail.com"
] | aaponcseku@gmail.com |
4465bb7ed75b898c43f197c51cc11259f443e146 | bd7ec3a3cee7bbfbd1ef126037d92f8cf2fbee0c | /solifeAdmin/src/com/cartmatic/estoresa/catalog/web/action/ProductSkuSelectorController.java | 2326da3447c6fe616adeb49e79d159ec7992af85 | [] | no_license | 1649865412/solifeAdmin | eef96d47b0ed112470bc7c44647c816004240a8d | d45d249513379e1d93868fbcebf6eb61acd08999 | refs/heads/master | 2020-06-29T03:38:44.894919 | 2015-06-26T06:53:37 | 2015-06-26T06:53:37 | 38,095,812 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 4,590 | java | package com.cartmatic.estoresa.catalog.web.action;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.validation.BindException;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.servlet.ModelAndView;
import com.cartmatic.estore.Constants;
import com.cartmatic.estore.catalog.service.BrandManager;
import com.cartmatic.estore.catalog.service.CatalogManager;
import com.cartmatic.estore.catalog.service.CategoryManager;
import com.cartmatic.estore.catalog.service.ProductManager;
import com.cartmatic.estore.common.model.catalog.Brand;
import com.cartmatic.estore.common.model.catalog.Catalog;
import com.cartmatic.estore.common.model.catalog.CategoryTreeItem;
import com.cartmatic.estore.common.model.catalog.Product;
import com.cartmatic.estore.common.model.catalog.ProductSearchCriteria;
import com.cartmatic.estore.core.controller.BaseBinder;
import com.cartmatic.estore.core.controller.GenericController;
import com.cartmatic.estore.core.search.SearchCriteria;
public class ProductSkuSelectorController extends GenericController<Product>{
private ProductManager productManager = null;
private BrandManager brandManager = null;
private CategoryManager categoryManager = null;
private CatalogManager catalogManager=null;
public void setCatalogManager(CatalogManager catalogManager) {
this.catalogManager = catalogManager;
}
public ModelAndView defaultAction(HttpServletRequest request,HttpServletResponse response) {
//当URI为productSkuSelectorDataList.html时,表示查找列表数据
if(request.getRequestURI().indexOf("productSkuSelectorDataList.html")!=-1){
return getData(request, response);
}
//获取所有Catalog
List<Catalog>catalogList=catalogManager.getAllOrdered("name", true);
Integer catalogId=ServletRequestUtils.getIntParameter(request, "catalogId", 0);
Integer virtual=ServletRequestUtils.getIntParameter(request, "virtual", 0);
if(catalogId>0||virtual>0){
List<Catalog>tempPatalogList=new ArrayList<Catalog>();
for (Catalog catalog : catalogList){
if(catalogId>0){
if(catalog.getId().intValue()==catalogId){
tempPatalogList.add(catalog);
break;
}
}else if(virtual>0){
if(catalog.getIsVirtual()==Constants.FLAG_TRUE.intValue()&&virtual==1){
tempPatalogList.add(catalog);
}else if(catalog.getIsVirtual()==Constants.FLAG_FALSE.intValue()&&virtual==2){
tempPatalogList.add(catalog);
}
}
}
catalogList=tempPatalogList;
}
request.setAttribute("catalogList", catalogList);
// 获取所有品牌
List<Brand> brands = brandManager.findAllBrands();
request.setAttribute("brands", brands);
return new ModelAndView("catalog/productSkuSelector");
}
@SuppressWarnings("unchecked")
private ModelAndView getData(HttpServletRequest request,HttpServletResponse response) {
SearchCriteria searchCriteria = createSearchCriteria(request);
ProductSearchCriteria productSearchCriteria = new ProductSearchCriteria();
BaseBinder binder = new BaseBinder();
binder.bind(request, productSearchCriteria,"productSearchCriteria");
request.getParameter("productKind");
productSearchCriteria.setProductStatus("1,2");
searchCriteria=productManager.getProductSkuSearchCriteria(searchCriteria, productSearchCriteria);
List results = searchByCriteria(searchCriteria);
request.setAttribute("productSearchCriteria", productSearchCriteria);
request.setAttribute("productSkuList", results);
request.setAttribute("pagingId",request.getParameter("pagingId"));
return new ModelAndView("catalog/include/productSkuSelectorDataList");
}
@Override
protected String getEntityName(Product entity) {
// TODO Auto-generated method stub
return null;
}
@Override
protected void onSave(HttpServletRequest request, Product entity,
BindException errors) {
// TODO Auto-generated method stub
}
@Override
protected Map<Integer, Map<String, Object>> getMultiSaveModel(
HttpServletRequest request) {
// TODO Auto-generated method stub
return null;
}
@Override
protected void initController() throws Exception {
mgr = productManager;
}
public void setProductManager(ProductManager productManager) {
this.productManager = productManager;
}
public void setBrandManager(BrandManager brandManager) {
this.brandManager = brandManager;
}
public void setCategoryManager(CategoryManager categoryManager) {
this.categoryManager = categoryManager;
}
}
| [
"1649865412@qq.com"
] | 1649865412@qq.com |
745a2ebccdb010a78e149f91c40333dd3e8b389b | aaef3516558bfdbad0f64917c1e1c2dfe840bc8c | /Stick Bike/Stick Bike/Stick Bike/src/com/rhymes/game/entity/elements/menu/ButtonSoundControl.java | b427448dbd5f1961f57bd92e150acdf241726b99 | [] | no_license | RDeepakkrishna/games | f3366490c78ab26b33def390f7230ab01ded0682 | 9c854718ec7504b861c2e2f15b377a9d14c77e82 | refs/heads/master | 2021-01-11T03:17:59.104294 | 2015-06-25T11:44:10 | 2015-06-25T11:44:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,539 | java | package com.rhymes.game.entity.elements.menu;
import com.rhymes.game.data.AssetConstants;
import com.rhymes.game.data.StartupInfo;
import com.rhymes.game.entity.elements.ui.Button;
import com.rhymes.ge.core.renderer.Point;
import com.rhymes.ge.pw.sound.SoundHandler;
import com.rhymes.helpers.Helper;
public class ButtonSoundControl extends Button{
// SoundHandler soundhandler = new SoundHandler();
private String imagePath;
private boolean stateOn = true;
public ButtonSoundControl(float x, float y, float width, float height,
int zIndex, String imagePath) {
super(x, y, width, height, zIndex, imagePath);
this.imagePath = imagePath;
}
// public String setImagePath(boolean active){
// if(active)
// this.imagePath = AssetConstants.IMG_SOUND_OFF;
//
// else
// this.imagePath = AssetConstants.IMG_SOUND_ON;
//
// return imagePath;
//
// }
//
@Override
public void onEvent(Point p) {
if(this.checkHit(p)){
Helper.println("Sound control...");
stateOn = !stateOn;
StartupInfo.sound_handler.set_sound_active(stateOn);
if(stateOn)
{
//set the picture when sound is on
this.imagePath = AssetConstants.IMG_SOUND_ON;
this.setImage(Helper.getImageFromAssets(imagePath));
}
else
{
//set the picture when sound is off
this.imagePath = AssetConstants.IMG_SOUND_OFF;
this.setImage(Helper.getImageFromAssets(imagePath));
}
}
}
public ButtonSoundControl(float x, float y, float width, float height, int zIndex) {
super(x, y, width, height, zIndex);
}
}
| [
"kdgupta87@gmail.com"
] | kdgupta87@gmail.com |
8a198d658b7cb054cacd2f91a10dbf09d9536d0e | a770e95028afb71f3b161d43648c347642819740 | /sources/org/telegram/ui/ChatRightsEditActivity$$ExternalSyntheticLambda16.java | e346433798f0bf7305793ac4293958707b217c17 | [] | no_license | Edicksonjga/TGDecompiledBeta | d7aa48a2b39bbaefd4752299620ff7b72b515c83 | d1db6a445d5bed43c1dc8213fb8dbefd96f6c51b | refs/heads/master | 2023-08-25T04:12:15.592281 | 2021-10-28T20:24:07 | 2021-10-28T20:24:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package org.telegram.ui;
import org.telegram.ui.ActionBar.ThemeDescription;
public final /* synthetic */ class ChatRightsEditActivity$$ExternalSyntheticLambda16 implements ThemeDescription.ThemeDescriptionDelegate {
public final /* synthetic */ ChatRightsEditActivity f$0;
public /* synthetic */ ChatRightsEditActivity$$ExternalSyntheticLambda16(ChatRightsEditActivity chatRightsEditActivity) {
this.f$0 = chatRightsEditActivity;
}
public final void didSetColor() {
this.f$0.lambda$getThemeDescriptions$18();
}
public /* synthetic */ void onAnimationProgress(float f) {
ThemeDescription.ThemeDescriptionDelegate.CC.$default$onAnimationProgress(this, f);
}
}
| [
"fabian_pastor@msn.com"
] | fabian_pastor@msn.com |
11861f217eb5545dafb3ad97fe2562b6443b9a64 | bf390e6589e240c6ccc325355cfd0c21fbe9d884 | /2.JavaCore/src/com/javarush/task/task16/task1621/Solution.java | 3f38fa8ecd49c0d336c8736ffc622a43b36dce00 | [] | no_license | vladmeh/jrt | 84878788fbb1f10aa55d320d205f886d1df9e417 | 0272ded03ac8eced7bf901bdfcc503a4eb6da12a | refs/heads/master | 2020-04-05T11:20:15.441176 | 2019-05-22T22:24:56 | 2019-05-22T22:24:56 | 81,300,849 | 4 | 5 | null | null | null | null | UTF-8 | Java | false | false | 2,063 | java | package com.javarush.task.task16.task1621;
/*
Thread.currentThread - всегда возвращает текущую нить
Thread.currentThread - всегда возвращает текущую нить
1. В методе printMsg присвой переменной t текущую нить.
2. В методе printMsg после всех действий поставь задержку в 1 миллисекунду.
Требования:
1. Метод printMsg должен получать текущую нить с помощью Thread.currentThread.
2. Метод printMsg должен должен усыплять нить на 1 миллисекунду.
3. Метод printMsg должен вызывать метод getName у текущей нити.
4. Метод main должен вызвать метод printMsg у объекта типа NameOfDifferentThreads 5 раз.
5. Метод run должен вызвать метод printMsg 5 раз.
6. Метод printMsg у объекта типа NameOfDifferentThreads суммарно должен быть вызван 10 раз.
*/
public class Solution {
static int count = 5;
public static void main(String[] args) {
NameOfDifferentThreads tt = new NameOfDifferentThreads();
tt.start();
for (int i = 0; i < count; i++) {
tt.printMsg();
}
}
public static class NameOfDifferentThreads extends Thread {
public void run() {
for (int i = 0; i < count; i++) {
printMsg();
}
}
public void printMsg() {
try {
Thread t = Thread.currentThread();//присвой переменной t текущую нить
String name = t.getName();
System.out.println("name=" + name);
//add sleep here - добавь sleep тут
Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| [
"vladmeh@gmail.com"
] | vladmeh@gmail.com |
a5eed26bb5a41e33100719f505bec261d2d2cb18 | ac89df2c59a8a285316aabaa38c557ae065674d0 | /algamoney-api/src/main/java/com/algaworks/algamoney/api/resource/CategoriaResource.java | 68de3348a90c3aedb033ea2f497d176153e49e1e | [] | no_license | tvttavares/angular-rest-spring-boot-api | d00334136b98c2545b065b448ff4f51b0a89ac38 | 3fe70f963ec905c212564c1e410e2db271fe8ecd | refs/heads/master | 2020-09-28T08:11:26.896101 | 2020-04-07T14:28:05 | 2020-04-07T14:28:05 | 226,730,369 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,516 | java | package com.algaworks.algamoney.api.resource;
import java.util.List;
import java.util.Optional;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.algaworks.algamoney.api.event.RecursoCriadoEvent;
import com.algaworks.algamoney.api.model.Categoria;
import com.algaworks.algamoney.api.repository.CategoriaRepository;
@RestController
@RequestMapping("/categorias")
public class CategoriaResource {
@Autowired
private CategoriaRepository categoriaRepository;
@Autowired
private ApplicationEventPublisher publisher;
@GetMapping
@PreAuthorize("hasAuthority('ROLE_PESQUISAR_CATEGORIA') and #oauth2.hasScope('read')")
public List<Categoria> listar() {
return categoriaRepository.findAll();
}
@GetMapping("/{codigo}")
@PreAuthorize("hasAuthority('ROLE_PESQUISAR_CATEGORIA') and #oauth2.hasScope('read')")
public ResponseEntity<Categoria> buscarPeloCodigo(@PathVariable Long codigo) {
Optional<Categoria> categoria = this.categoriaRepository.findById(codigo);
return categoria.isPresent() ? ResponseEntity.ok(categoria.get()) : ResponseEntity.notFound().build();
}
@PostMapping
@PreAuthorize("hasAuthority('ROLE_CADASTRAR_CATEGORIA') and #oauth2.hasScope('write')")
public ResponseEntity<Categoria> criar(@Valid @RequestBody Categoria categoria, HttpServletResponse response) {
Categoria categoriaSalva = categoriaRepository.save(categoria);
publisher.publishEvent(new RecursoCriadoEvent(this, response, categoriaSalva.getCodigo()));
return ResponseEntity.status(HttpStatus.CREATED).body(categoriaSalva);
}
@DeleteMapping("/{codigo}")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void remover(@PathVariable Long codigo) {
categoriaRepository.deleteById(codigo);
}
}
| [
"tvttavares@gmail.com"
] | tvttavares@gmail.com |
52251a4d6859f6d3f4ccfa169ae5fb30941e21a6 | fd961a8042eedbde9a62d0f7d1c7fb4c6c04b35d | /app/src/main/java/com/rxjy/rxcompound/entity/AdRedEnvelopesBean.java | 107bfbead8c448f419ec152c77133e32da119513 | [] | no_license | WCYu/RXCompound | 89c20a30fa6a2fd533917021837368e84636f011 | ce3dd40787b24c26d0971d4c3e97790115636eb8 | refs/heads/master | 2020-03-19T19:40:21.400210 | 2018-07-30T11:25:16 | 2018-07-30T11:25:16 | 136,868,996 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,133 | java | package com.rxjy.rxcompound.entity;
import java.io.Serializable;
import java.util.List;
/**
* Created by Administrator on 2018/5/9.
*/
public class AdRedEnvelopesBean {
/**
* StatusCode : 0
* StatusMsg : 获取成功
* Body : [{"user_name":"范彩金","two_level":"商务入职","create_time":"04.28","task_award":500,"content_total":"5月份商务人数达到22人(以入职为准)","count_down":"413","task_num":"5人","task_balance":"余5","now_number":0,"execute_time":"2018-05-31 23:59:59"},{"user_name":"范彩金","two_level":"主案入职","create_time":"04.28","task_award":300,"content_total":"设计总监18号前到岗(以入职为准),同时需要集团主案面试通过。","count_down":"101","task_num":"1人","task_balance":"余1","now_number":0,"execute_time":"2018-05-18 23:59:59"}]
*/
private int StatusCode;
private String StatusMsg;
private List<BodyBean> Body;
public int getStatusCode() {
return StatusCode;
}
public void setStatusCode(int StatusCode) {
this.StatusCode = StatusCode;
}
public String getStatusMsg() {
return StatusMsg;
}
public void setStatusMsg(String StatusMsg) {
this.StatusMsg = StatusMsg;
}
public List<BodyBean> getBody() {
return Body;
}
public void setBody(List<BodyBean> Body) {
this.Body = Body;
}
public static class BodyBean implements Serializable {
/**
* user_name : 范彩金
* two_level : 商务入职
* create_time : 04.28
* task_award : 500.0
* content_total : 5月份商务人数达到22人(以入职为准)
* count_down : 413
* task_num : 5人
* task_balance : 余5
* now_number : 0
* execute_time : 2018-05-31 23:59:59
*/
private String user_name;
private String two_level;
private String create_time;
private double task_award;
private String content_total;
private String count_down;
private String task_num;
private String task_balance;
private int now_number;
private String execute_time;
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;
}
public String getTwo_level() {
return two_level;
}
public void setTwo_level(String two_level) {
this.two_level = two_level;
}
public String getCreate_time() {
return create_time;
}
public void setCreate_time(String create_time) {
this.create_time = create_time;
}
public double getTask_award() {
return task_award;
}
public void setTask_award(double task_award) {
this.task_award = task_award;
}
public String getContent_total() {
return content_total;
}
public void setContent_total(String content_total) {
this.content_total = content_total;
}
public String getCount_down() {
return count_down;
}
public void setCount_down(String count_down) {
this.count_down = count_down;
}
public String getTask_num() {
return task_num;
}
public void setTask_num(String task_num) {
this.task_num = task_num;
}
public String getTask_balance() {
return task_balance;
}
public void setTask_balance(String task_balance) {
this.task_balance = task_balance;
}
public int getNow_number() {
return now_number;
}
public void setNow_number(int now_number) {
this.now_number = now_number;
}
public String getExecute_time() {
return execute_time;
}
public void setExecute_time(String execute_time) {
this.execute_time = execute_time;
}
}
}
| [
"13466941275@163.com"
] | 13466941275@163.com |
f350742ee38faf82cde65c845457ef9ae62c9111 | ca57c3651db75069fcbbb7c5190e6a328331660e | /src/com/siwuxie095/forme/designpattern/category/chapter4th/example3rd/chicago/ChicagoStyleClamPizza.java | 7235bc3c016273c870682d729be58869e0a7ea67 | [] | no_license | gouyanzhan/HelloWorld | f915ec8eabf8878b0c01fb8ec29b869e6fd68c5f | 8cd9dc117d301d10207690052f2f27de2d9b9e2c | refs/heads/master | 2022-03-25T07:31:52.842092 | 2022-03-11T07:08:30 | 2022-03-11T07:08:30 | 164,224,001 | 1 | 1 | null | 2019-01-07T14:18:44 | 2019-01-05T14:52:23 | Java | UTF-8 | Java | false | false | 387 | java | package com.siwuxie095.forme.designpattern.category.chapter4th.example3rd.chicago;
/**
* 芝加哥风味的蛤蜊比萨
*
* @author Jiajing Li
* @date 2019-10-12 10:37:19
*/
class ChicagoStyleClamPizza extends Pizza {
@Override
void prepare() {
}
@Override
void bake() {
}
@Override
void cut() {
}
@Override
void box() {
}
}
| [
"834879583@qq.com"
] | 834879583@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.