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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
55467b599c9aeeb2118aa30e1ca3412202728d1d | 488f03a789f80ab504653dbdb6a877007aa574a4 | /CBP/android/reference_wallet/fermat-cbp-android-reference-wallet-crypto-broker-bitdubai/src/main/java/com/bitdubai/reference_wallet/crypto_broker_wallet/common/navigationDrawer/NavigationViewAdapter.java | bfcd693799560f5a0060fe0b78de4d983ac2e2e4 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | seba8098/fermat | b86fcf97102ff2976d452728994b580df1e4b0a7 | bcf0ebfbe18812525af593ec716976b23a4f176a | refs/heads/master | 2021-01-24T20:12:51.262460 | 2015-12-21T16:45:22 | 2015-12-21T16:45:22 | 48,380,024 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,814 | java | package com.bitdubai.reference_wallet.crypto_broker_wallet.common.navigationDrawer;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bitdubai.fermat_android_api.ui.adapters.FermatAdapter;
import com.bitdubai.fermat_api.layer.all_definition.navigation_structure.MenuItem;
import com.bitdubai.reference_wallet.crypto_broker_wallet.R;
import com.bitdubai.reference_wallet.crypto_broker_wallet.session.CryptoBrokerWalletSession;
import java.util.List;
/**
* Created by Matias Furszyfer on 2015.09.30..
* Maintained by Nelson Ramirez
*/
public class NavigationViewAdapter extends FermatAdapter<MenuItem, NavigationItemMenuViewHolder> {
Typeface tf;
protected NavigationViewAdapter(Context context) {
super(context);
}
public NavigationViewAdapter(Context context, List<MenuItem> dataSet) {
super(context, dataSet);
tf = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Regular.ttf");
}
/**
* Create a new holder instance
*
* @param itemView View object
* @param type int type
* @return ViewHolder
*/
@Override
protected NavigationItemMenuViewHolder createHolder(View itemView, int type) {
return new NavigationItemMenuViewHolder(itemView);
}
/**
* Get custom layout to use it.
*
* @return int Layout Resource id: Example: R.layout.row_item
*/
@Override
protected int getCardViewResource() {
return R.layout.navigation_row;
}
/**
* Bind ViewHolder
*
* @param holder ViewHolder object
* @param data Object data to render
* @param position position to render
*/
@Override
protected void bindHolder(NavigationItemMenuViewHolder holder, MenuItem data, int position) {
try {
holder.getLabel().setText(data.getLabel());
switch (position) {
case 0:
holder.getIcon().setImageResource(R.drawable.btn_drawer_home_normal);
break;
case 1:
holder.getIcon().setImageResource(R.drawable.btn_drawer_profile_normal);
break;
case 2:
holder.getIcon().setImageResource(R.drawable.btn_drawer_request_normal);
break;
case 3:
holder.getIcon().setImageResource(R.drawable.btn_drawer_settings_normal);
break;
case 4:
holder.getIcon().setImageResource(R.drawable.btn_drawer_logout_normal);
break;
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"nelsonalfo@gmail.com"
] | nelsonalfo@gmail.com |
b2a8e5e56e1b1b47d43752359d043d810a2e3bb1 | fe520933456c83359561b817f30d611faa538cec | /iPlasma_decompiled/decompiled_result/src/lrg/insider/gui/ui/MainForm$3.java | b07b6537b6eccc64d9806fb91dad7f983c649003 | [
"MIT"
] | permissive | EmileSonneveld/maproef1819-emile | 2f63d633650cd760d3ae7e3e2c31d904f6062e16 | c47d381faa0b8d6c25549b5d66f857bb534ccfa4 | refs/heads/master | 2023-04-27T09:58:26.313392 | 2023-04-19T19:20:48 | 2023-04-19T19:20:48 | 202,502,325 | 5 | 1 | MIT | 2022-07-27T19:56:45 | 2019-08-15T08:19:09 | Java | UTF-8 | Java | false | false | 3,970 | java | /* */ package classes.lrg.insider.gui.ui;
/* */
/* */ import java.awt.event.ActionEvent;
/* */ import javax.swing.JFileChooser;
/* */ import javax.swing.JOptionPane;
/* */ import lrg.common.metamodel.MetaModel;
/* */ import lrg.insider.gui.ui.MainForm;
/* */ import lrg.insider.gui.ui.browser.BrowserUI;
/* */ import lrg.insider.gui.ui.stories.StoryTreeUI;
/* */ import lrg.insider.gui.ui.utils.ProgressBar;
/* */ import lrg.insider.metamodel.MemoriaCacheModelBuilder;
/* */ import recoder.ParserException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ class null
/* */ extends Thread
/* */ {
/* */ public void run() {
/* 175 */ progress = new ProgressBar("Loading the model ...");
/* */ try {
/* 177 */ Thread.currentThread().setPriority(10);
/* 178 */ if (e.getSource() == MainForm.this.openCachedModel) {
/* 179 */ MetaModel.createFrom(
/* 180 */ new MemoriaCacheModelBuilder(fc.getSelectedFile().getAbsolutePath(), progress),
/* 181 */ fc.getSelectedFile().getAbsolutePath());
/* */
/* */
/* */
/* */ }
/* */
/* */
/* */
/* */ }
/* 190 */ catch (ParserException e1) {
/* 191 */ e1.printStackTrace();
/* 192 */ JOptionPane.showMessageDialog(MainForm.access$0(MainForm.this), e1.toString(), "EXCEPTION: ParserException", 2);
/* */ return;
/* 194 */ } catch (Exception e2) {
/* 195 */ e2.printStackTrace();
/* 196 */ JOptionPane.showMessageDialog(MainForm.access$0(MainForm.this), "The model could not be loaded !", "ERROR", 2);
/* */ return;
/* */ } finally {
/* 199 */ progress.close();
/* */ }
/* */
/* 202 */ BrowserUI.instance().newMetaModelLoaded();
/* 203 */ StoryTreeUI.instance().setMetaModel();
/* 204 */ MainForm.this.setStatusBarText("Model succesfully loaded from: " + fc.getSelectedFile().getAbsolutePath());
/* */ }
/* */ }
/* Location: C:\Users\emill\Dropbox\slimmerWorden\2018-2019-Semester2\THESIS\iPlasma6\tools\iPlasma\classes.zip!\classes\lrg\insider\gu\\ui\MainForm$3.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 1.0.7
*/ | [
"contact@emilesonneveld.be"
] | contact@emilesonneveld.be |
07bb2ebe4f1363713d26a8ebbd186aa0bf1d8def | 70f718fdf708df23150c55c4ad60b10144d89501 | /design-pattern/src/test/java/com/coderandyli/designpattern/chapter_05/section_35/RandomIdGeneratorTestSubscriber.java | d0511fa8fe70c12b00cb5c0c1bcb19f616cab61b | [] | no_license | coderandyli/code_repository | a5d93207b06d6f3cac63307ad1e9e1c8a596f350 | 6ac35b25cef91b27865d5ba222cf4d20addbf539 | refs/heads/master | 2023-08-04T08:39:14.817544 | 2022-12-13T13:47:38 | 2022-12-13T13:47:38 | 160,043,376 | 3 | 0 | null | 2023-07-20T08:48:09 | 2018-12-02T12:08:41 | Java | UTF-8 | Java | false | false | 2,318 | java | package com.coderandyli.designpattern.chapter_05.section_35;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
public class RandomIdGeneratorTestSubscriber {
@Test
public void testGetLastSubstrSplittedByDot() {
RandomIdGenerator idGenerator = new RandomIdGenerator();
String actualSubstr = idGenerator.getLastSubstrSplittedByDot("field1.field2.field3");
Assert.assertEquals("field3", actualSubstr);
actualSubstr = idGenerator.getLastSubstrSplittedByDot("field1");
Assert.assertEquals("field1", actualSubstr);
actualSubstr = idGenerator.getLastSubstrSplittedByDot("field1#field2$field3");
Assert.assertEquals("field1#field2$field3", actualSubstr);
}
// 此单元测试会失败,因为我们在代码中没有处理hostName为null或空字符串的情况
// 这部分优化留在第36、37节课中讲解
@Test
public void testGetLastSubstrSplittedByDot_nullOrEmpty() {
RandomIdGenerator idGenerator = new RandomIdGenerator();
String actualSubstr = idGenerator.getLastSubstrSplittedByDot(null);
Assert.assertNull(actualSubstr);
actualSubstr = idGenerator.getLastSubstrSplittedByDot("");
Assert.assertEquals("", actualSubstr);
}
@Test
public void testGenerateRandomAlphameric() {
RandomIdGenerator idGenerator = new RandomIdGenerator();
String actualRandomString = idGenerator.generateRandomAlphameric(6);
Assert.assertNotNull(actualRandomString);
Assert.assertEquals(6, actualRandomString.length());
for (char c : actualRandomString.toCharArray()) {
Assert.assertTrue((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}
}
// 此单元测试会失败,因为我们在代码中没有处理length<=0的情况
// 这部分优化留在第36、37节课中讲解
@Test
public void testGenerateRandomAlphameric_lengthEqualsOrLessThanZero() {
RandomIdGenerator idGenerator = new RandomIdGenerator();
String actualRandomString = idGenerator.generateRandomAlphameric(0);
Assert.assertEquals("", actualRandomString);
actualRandomString = idGenerator.generateRandomAlphameric(-1);
Assert.assertNull(actualRandomString);
}
} | [
"coderandyli@163.com"
] | coderandyli@163.com |
129f0f84dedd373644ce4afa8a66dcd065b8644b | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_356/Testnull_35597.java | be2018c0babef586e34712b3e337e886d614547e | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 308 | java | package org.gradle.test.performancenull_356;
import static org.junit.Assert.*;
public class Testnull_35597 {
private final Productionnull_35597 production = new Productionnull_35597("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
41f3a79de4d26be4e8ce2b32dc113fea7baecb00 | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithLambdasApi21/applicationModule/src/test/java/applicationModulepackageJava7/Foo57Test.java | c40430d550ed7dab4b71901006179da8988268cf | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 730 | java | package applicationModulepackageJava7;
import org.junit.Test;
public class Foo57Test {
@Test
public void testFoo0() {
new Foo57().foo0();
}
@Test
public void testFoo1() {
new Foo57().foo1();
}
@Test
public void testFoo2() {
new Foo57().foo2();
}
@Test
public void testFoo3() {
new Foo57().foo3();
}
@Test
public void testFoo4() {
new Foo57().foo4();
}
@Test
public void testFoo5() {
new Foo57().foo5();
}
@Test
public void testFoo6() {
new Foo57().foo6();
}
@Test
public void testFoo7() {
new Foo57().foo7();
}
@Test
public void testFoo8() {
new Foo57().foo8();
}
@Test
public void testFoo9() {
new Foo57().foo9();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
fbc4b74ecd03b9edef5c979b6bccf605cb0c7a3c | 3522491a85e57dc7aadd90c85bde13dfbcc08347 | /src/main/java/com/appautomate/security/AuthoritiesConstants.java | c3a8468d4e002c687036e4c2371d4704dd4fd356 | [] | no_license | jemaltech/jhipster-tasks | e05cc6f4dd2c4178052a83275681b9bdfe134c94 | deef39764ee51a54ed4fc2ae04cd5b91b1d008ac | refs/heads/master | 2023-05-11T14:35:07.790827 | 2019-08-20T16:13:32 | 2019-08-20T16:13:32 | 203,414,739 | 0 | 0 | null | 2023-05-06T14:14:06 | 2019-08-20T16:34:07 | Java | UTF-8 | Java | false | false | 345 | java | package com.appautomate.security;
/**
* Constants for Spring Security authorities.
*/
public final class AuthoritiesConstants {
public static final String ADMIN = "ROLE_ADMIN";
public static final String USER = "ROLE_USER";
public static final String ANONYMOUS = "ROLE_ANONYMOUS";
private AuthoritiesConstants() {
}
}
| [
"jemal@zoomdata.com"
] | jemal@zoomdata.com |
fc59f19461dfaffd16fc0d05e625f86880fdd5a9 | 0f859255f131fa60a90acd3c137bbb0b9ee32d01 | /test-integration/src/test/java/org/odata4j/test/integration/expressions/PojoWithAllTypes.java | d54143566efc5233a883e6f804a63eb7ae1c8220 | [
"Apache-2.0"
] | permissive | vhalbert/oreva | fe1f5c76b8f2416dbb36481769585b77dd46e6e9 | 39b6c90c432bcefc410894c04fb831178d560272 | refs/heads/master | 2021-01-18T01:10:00.864949 | 2020-01-28T15:25:14 | 2020-01-28T15:25:14 | 36,017,606 | 0 | 0 | Apache-2.0 | 2020-02-12T14:47:49 | 2015-05-21T14:31:54 | Java | UTF-8 | Java | false | false | 3,386 | java | package org.odata4j.test.integration.expressions;
import java.math.BigDecimal;
import org.joda.time.DateTime;
import org.joda.time.LocalDateTime;
import org.joda.time.LocalTime;
import org.odata4j.core.Guid;
import org.odata4j.core.UnsignedByte;
public class PojoWithAllTypes {
private byte[] binary;
private boolean boolean_;
private UnsignedByte byte_;
private byte sbyte;
private LocalDateTime dateTime;
private BigDecimal decimal;
private double double_;
private Guid guid;
private short int16;
private int int32;
private long int64;
private float single;
private String string;
private LocalTime time;
private DateTime dateTimeOffset;
public PojoWithAllTypes() {}
public PojoWithAllTypes(byte[] binary, boolean boolean_, UnsignedByte byte_, byte sbyte, LocalDateTime dateTime, BigDecimal decimal,
double double_, Guid guid, short int16, int int32, long int64, float single, String string, LocalTime time, DateTime dateTimeOffset) {
this.binary = binary;
this.boolean_ = boolean_;
this.byte_ = byte_;
this.sbyte = sbyte;
this.dateTime = dateTime;
this.decimal = decimal;
this.double_ = double_;
this.guid = guid;
this.int16 = int16;
this.int32 = int32;
this.int64 = int64;
this.single = single;
this.time = time;
this.string = string;
this.dateTimeOffset = dateTimeOffset;
}
public byte[] getBinary() {
return binary;
}
//public void setBinary(byte[] value) {
// binary = value;
// }
public boolean getBoolean() {
return boolean_;
}
public void setBoolean(boolean value) {
boolean_ = value;
}
public UnsignedByte getByte() {
return byte_;
}
public void setByte(UnsignedByte value) {
byte_ = value;
}
public byte getSByte() {
return sbyte;
}
public void setSByte(byte value) {
sbyte = value;
}
public LocalDateTime getDateTime() {
return dateTime;
}
public void setDateTime(LocalDateTime value) {
dateTime = value;
}
public BigDecimal getDecimal() {
return decimal;
}
public void setDecimal(BigDecimal value) {
decimal = value;
}
public double getDouble() {
return double_;
}
public void setDouble(double value) {
double_ = value;
}
public Guid getGuid() {
return guid;
}
public void setGuid(Guid value) {
guid = value;
}
public short getInt16() {
return int16;
}
public void setInt16(short value) {
int16 = value;
}
public int getInt32() {
return int32;
}
public void setInt32(int value) {
int32 = value;
}
public long getInt64() {
return int64;
}
public void setInt64(long value) {
int64 = value;
}
public float getSingle() {
return single;
}
public void setSingle(float value) {
single = value;
}
public String getString() {
return string;
}
public void setString(String value) {
string = value;
}
public LocalTime getTime() {
return time;
}
public void setTime(LocalTime value) {
time = value;
}
public DateTime getDateTimeOffset() {
return dateTimeOffset;
}
public void setDateTimeOffset(DateTime value) {
dateTimeOffset = value;
}
} | [
"rareddy@jboss.org"
] | rareddy@jboss.org |
9155dea8b8e7da17deb4b6bd59281a99043938e8 | 134b585d984727da5250117fe617ec21e7f65b86 | /app-parametros-variables/src/main/java/com/eiv/poc/appparams/repositories/ParametroRepository.java | 470036c4a1589023306ebbc8e3dee1cc5a509901 | [] | no_license | EIVSoftware/java-design-patterns | 1b782f336184d8b2c7df0f2faaaa9551909401cd | 3cf547b13e6f201165b29db22dfb564e03e19541 | refs/heads/master | 2022-07-22T11:18:13.334363 | 2021-10-21T17:56:53 | 2021-10-21T17:56:53 | 169,240,153 | 0 | 2 | null | 2022-06-25T07:30:26 | 2019-02-05T12:49:13 | Java | UTF-8 | Java | false | false | 321 | java | package com.eiv.poc.appparams.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import com.eiv.poc.appparams.entities.ParametroEntity;
import com.eiv.poc.appparams.entities.ParametroPKEntity;
public interface ParametroRepository extends JpaRepository<ParametroEntity, ParametroPKEntity> {
}
| [
"diegocairone@gmail.com"
] | diegocairone@gmail.com |
937ea8cb79251df14e3e87024992c9700db78d6a | 8ef0f8f8e7348faa41a969ecc93c04e6085170dd | /mall-commons/src/main/java/com/mall/utils/wechat/WXSignUtils.java | 4bde5fb7e3a9406a8ac65ef08e397606739edbb4 | [] | no_license | zhangmenyucom/mall | 025b4aeb9303af956063dccf09baf948501d1b89 | 44a28d6d092617aed9976007c846b7ba538951fd | refs/heads/master | 2020-04-17T11:01:42.477605 | 2019-01-21T01:41:36 | 2019-01-21T01:41:51 | 166,523,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,127 | java | package com.mall.utils.wechat;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
public class WXSignUtils {
/**
* 微信支付签名算法sign
* @param characterEncoding
* @param parameters
* @return
*/
@SuppressWarnings("rawtypes")
public static String createSign(String characterEncoding,SortedMap<Object,Object> parameters){
StringBuffer sb = new StringBuffer();
Set es = parameters.entrySet();//所有参与传参的参数按照accsii排序(升序)
Iterator it = es.iterator();
while(it.hasNext()) {
Map.Entry entry = (Map.Entry)it.next();
String k = (String)entry.getKey();
Object v = entry.getValue();
if(null != v && !"".equals(v)
&& !"sign".equals(k) && !"key".equals(k)) {
sb.append(k + "=" + v + "&");
}
}
sb.append("key=" + Config.key);//weixinConstant.KEY);
String sign = MD5Utils.MD5Encode(sb.toString(), characterEncoding).toUpperCase();
return sign;
}
} | [
"516195940@qq.com"
] | 516195940@qq.com |
218a65fa6724b8562fd1cf9f739855ef6cc360db | eac990b5cfc316eff1841d1f7e71d59c35e1ae42 | /spectra-cluster/tags/spectra-cluster-1.0.2/src/main/java/uk/ac/ebi/pride/spectracluster/spectrum/ISpectrumQuality.java | 75c2a7d26699e3898ce9073362d70640c9c80dd9 | [] | no_license | lordjoe/spectra-cluster | a0d58299ead2c0484f233a5e0aa38734e034ecd9 | 776bc8a4beb3ccc4cdd9e837e2d8b445feb151b1 | refs/heads/master | 2021-01-10T08:13:40.079514 | 2015-02-13T10:57:59 | 2015-02-13T10:57:59 | 46,876,377 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 464 | java | package uk.ac.ebi.pride.spectracluster.spectrum;
import uk.ac.ebi.pride.spectracluster.quality.IQualityScorer;
/**
* Spectrum quality interface
*
* @author Rui Wang
* @version $Id$
*/
public interface ISpectrumQuality {
/**
* Get the quality measure of a spectrum
*/
public double getQualityScore();
/**
* Get the quality scorer used
*
* @return quality scorer
*/
public IQualityScorer getQualityScorer();
}
| [
"harry.r.wang@gmail.com"
] | harry.r.wang@gmail.com |
76ca73bef00aa8897d384cdb2ff0436d53536c61 | da8263da02dda9a718d733cddb435ec19887374f | /modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ConditionalBuilder.java | d7f43a7cfb79692a382e329d7730b57016a26199 | [
"Apache-2.0"
] | permissive | TimeInvestor/citrus | c45ae9f8eb9315489957227bb3e1288648a90e24 | 5604dabba96ec0ca5fca0d9e415ae9c8ab89ba39 | refs/heads/master | 2020-05-29T11:05:35.221557 | 2016-05-12T16:23:24 | 2016-05-12T16:23:24 | 58,848,173 | 1 | 0 | null | 2016-05-15T06:50:36 | 2016-05-15T06:50:36 | null | UTF-8 | Java | false | false | 2,188 | java | /*
* Copyright 2006-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 com.consol.citrus.dsl.builder;
import com.consol.citrus.container.*;
import com.consol.citrus.dsl.design.TestDesigner;
import com.consol.citrus.dsl.runner.TestRunner;
/**
* Action builder creates a conditional container, which executes nested test actions
* if condition expression evaluates to true.
*
* @author Christoph Deppisch
* @since 2.3
*/
public class ConditionalBuilder extends AbstractTestContainerBuilder<Conditional> {
/**
* Constructor using action field.
* @param designer
* @param action
*/
public ConditionalBuilder(TestDesigner designer, Conditional action) {
super(designer, action);
}
/**
* Default constructor.
* @param designer
*/
public ConditionalBuilder(TestDesigner designer) {
this(designer, new Conditional());
}
/**
* Default constructor using runner and action container.
* @param runner
* @param action
*/
public ConditionalBuilder(TestRunner runner, Conditional action) {
super(runner, action);
}
/**
* Default constructor using test runner.
* @param runner
*/
public ConditionalBuilder(TestRunner runner) {
this(runner, new Conditional());
}
/**
* Condition which allows execution if true.
* @param expression
*/
public ConditionalBuilder when(String expression) {
action.setCondition(expression);
return this;
}
/**
* Condition which allows execution if evaluates to true.
* @param expression
*/
public ConditionalBuilder when(ConditionExpression expression) {
action.setConditionExpression(expression);
return this;
}
}
| [
"deppisch@consol.de"
] | deppisch@consol.de |
e375307277ec3e3b80d72e6c28a3f208c8cfd7c7 | 0493ffe947dad031c7b19145523eb39209e8059a | /OpenJdk8uTest/src/test/java/awt/Modal/LWModalTest/LWModalTest.java | 1b943d1946b9971937665dd694fc26c82fc6b0b3 | [] | no_license | thelinh95/Open_Jdk8u_Test | 7612f1b63b5001d1df85c1df0d70627b123de80f | 4df362a71e680dbd7dfbb28c8922e8f20373757a | refs/heads/master | 2021-01-16T19:27:30.506632 | 2017-08-13T23:26:05 | 2017-08-13T23:26:05 | 100,169,775 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,512 | java | package test.java.awt.Modal.LWModalTest;
/*
* Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 6178755
@summary The test checks that Container's method startLWModal
and stopLWModal work correctly. The test scenario is very close
to JOptionPane.showInternal*Dialog methods
@author artem.ananiev@...: area=awt.modal
@library ../../regtesthelpers
@build Util
@run main LWModalTest
*/
import java.awt.Container;
import java.lang.reflect.Method;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import test.java.awt.*;
import test.java.awt.event.*;
import test.java.awt.regtesthelpers.Util;
import test.java.lang.reflect.*;
import test.javax.swing.*;
import test.sun.awt.*;
public class LWModalTest
{
private static JFrame frame;
private static volatile JInternalFrame internalFrame;
private static volatile boolean passed = false;
private static void init()
{
frame = new JFrame("JFrame");
frame.setBounds(100, 100, 320, 240);
frame.setVisible(true);
Util.waitForIdle(null);
new Thread(new Runnable()
{
public void run()
{
JOptionPane p = new JOptionPane("Message");
internalFrame = p.createInternalFrame(frame.getContentPane(), "Title");
internalFrame.setVisible(true);
try
{
Method m = Container.class.getDeclaredMethod("startLWModal", (Class[])null);
m.setAccessible(true);
m.invoke(internalFrame, (Object[])null);
}
catch (Exception z)
{
z.printStackTrace(System.err);
LWModalTest.fail(z.getMessage());
return;
}
passed = true;
}
}).start();
try
{
Thread.sleep(3000);
Util.waitForIdle(null);
internalFrame.dispose();
Method m = Container.class.getDeclaredMethod("stopLWModal", (Class[])null);
m.setAccessible(true);
m.invoke(internalFrame, (Object[])null);
Thread.sleep(3000);
Util.waitForIdle(null);
}
catch (Exception z)
{
z.printStackTrace(System.err);
LWModalTest.fail(z.getMessage());
return;
}
if (passed)
{
LWModalTest.pass();
}
else
{
LWModalTest.fail("showInternalMessageDialog() has not returned");
}
}
private static boolean theTestPassed = false;
private static boolean testGeneratedInterrupt = false;
private static String failureMessage = "";
private static Thread mainThread = null;
private static int sleepTime = 60000;
public static void main(String args[])
throws InterruptedException
{
mainThread = Thread.currentThread();
try
{
init();
}
catch (TestPassedException e)
{
return;
}
try
{
Thread.sleep( sleepTime );
throw new RuntimeException("Timed out after " + sleepTime/1000 + " seconds");
}
catch (InterruptedException e)
{
if(!testGeneratedInterrupt) throw e;
testGeneratedInterrupt = false;
if (theTestPassed == false)
{
throw new RuntimeException(failureMessage);
}
}
}
public static synchronized void setTimeoutTo(int seconds)
{
sleepTime = seconds * 1000;
}
public static synchronized void pass()
{
if (mainThread == Thread.currentThread())
{
theTestPassed = true;
throw new TestPassedException();
}
theTestPassed = true;
testGeneratedInterrupt = true;
mainThread.interrupt();
}
public static synchronized void fail()
{
fail("it just plain failed! :-)");
}
public static synchronized void fail(String whyFailed)
{
if (mainThread == Thread.currentThread())
{
throw new RuntimeException(whyFailed);
}
theTestPassed = false;
testGeneratedInterrupt = true;
failureMessage = whyFailed;
mainThread.interrupt();
}
}
class TestPassedException extends RuntimeException
{
}
| [
"truongthelinh95@gmail.com"
] | truongthelinh95@gmail.com |
ccb4fc0b7d46aa92f2859d2f69f064d77295e6ee | c81aeecc36b43f8c2d852192ce68ff6b68e2ef8a | /e3-manager/e3-manager-service/src/main/java/cn/e3mall/service/impl/ItemServiceImpl.java | 3ab2abb3ba8dee18860836987b07d938b54f0fbf | [] | no_license | devinWan/e3 | 376a33b8bee302d367584d31276662bca0274acd | 25d700f43c8db0a905d50332821b4d9c4032368f | refs/heads/master | 2021-06-27T06:01:12.343632 | 2017-09-17T10:41:12 | 2017-09-17T10:41:30 | 103,831,433 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,442 | java | package cn.e3mall.service.impl;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Service;
import cn.e3mall.common.jedis.JedisClient;
import cn.e3mall.common.pojo.EasyUIDataGridResult;
import cn.e3mall.common.utils.E3Result;
import cn.e3mall.common.utils.IDUtils;
import cn.e3mall.common.utils.JsonUtils;
import cn.e3mall.mapper.TbItemDescMapper;
import cn.e3mall.mapper.TbItemMapper;
import cn.e3mall.pojo.TbItem;
import cn.e3mall.pojo.TbItemDesc;
import cn.e3mall.pojo.TbItemExample;
import cn.e3mall.pojo.TbItemExample.Criteria;
import cn.e3mall.service.ItemService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
/*
* 商品管理service
* 注解:默认接口的首字母小写
*/
@Service
public class ItemServiceImpl implements ItemService {
@Autowired
private TbItemMapper itemMapper;
@Autowired
private TbItemDescMapper itemDescMapper;
@Autowired
private JmsTemplate jmsTemplate;
@Resource
private Destination topicDestination;
@Autowired
private JedisClient jedisClient;
@Value("${REDIS_ITEM_PRE}")
private String REDIS_ITEM_PRE;
@Value("${ITEM_CACHE_EXPIRE}")
private Integer ITEM_CACHE_EXPIRE;
@Override
public TbItem getItemById(Long itemId) {
// 查询缓存
try {
String json = jedisClient.get(REDIS_ITEM_PRE + ":" + itemId
+ ":BASE");
if (StringUtils.isNoneBlank(json)) {
TbItem tbItem = JsonUtils.jsonToPojo(json, TbItem.class);
return tbItem;
}
} catch (Exception e) {
// TODO: handle exception
}
// 缓存中没有,查询数据库
// 根据主键查询
// TbItem tbItem = itemMapper.selectByPrimaryKey(itemId);
TbItemExample example = new TbItemExample();
Criteria criteria = example.createCriteria();
// 设置查询条件
criteria.andIdEqualTo(itemId);
List<TbItem> list = itemMapper.selectByExample(example);
if (list != null && list.size() > 0) {
// 把结果添加到缓存
try {
jedisClient.set(REDIS_ITEM_PRE + ":" + itemId + ":BASE",
JsonUtils.objectToJson(list.get(0)));
// 设置过期时间
jedisClient.expire(REDIS_ITEM_PRE + ":" + itemId + ":BASE",
ITEM_CACHE_EXPIRE);
} catch (Exception e) {
// TODO: handle exception
}
return list.get(0);
}
return null;
}
@Override
public EasyUIDataGridResult getItemList(int page, int rows) {
// 设置分页信息
PageHelper.startPage(page, rows);
// 执行查询
TbItemExample example = new TbItemExample();
// 此处的list实际上是page,原因:执行查询的时候,经过了pagehelper拦截器,导致返回结果发生的改变
List<TbItem> list = itemMapper.selectByExample(example);
// 创建一个返回值对象
EasyUIDataGridResult result = new EasyUIDataGridResult();
result.setRows(list);
// 取分页结果
PageInfo<TbItem> pageInfo = new PageInfo<TbItem>(list);
// 取总记录数
long total = pageInfo.getTotal();
result.setTotal(total);
return result;
}
@Override
public E3Result addItem(TbItem item, String desc) {
// 生成商品id
final long itemId = IDUtils.genItemId();
// 补全item的属性
item.setId(itemId);
// 1.正常,2下架, 3删除
item.setStatus((byte) 1);
item.setCreated(new Date());
item.setUpdated(new Date());
// 向商品表插入数据
itemMapper.insert(item);
// 创建一个商品描述表对应的pojo
TbItemDesc itemDesc = new TbItemDesc();
// 补全属性
itemDesc.setItemId(itemId);
itemDesc.setItemDesc(desc);
itemDesc.setCreated(new Date());
itemDesc.setUpdated(new Date());
// 向商品描述表插入数据
itemDescMapper.insert(itemDesc);
// 发送一个商品添加消息
jmsTemplate.send(topicDestination, new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
TextMessage textMessage = session
.createTextMessage(itemId + "");
return textMessage;
}
});
// 返回成功
return E3Result.ok();
}
@Override
public E3Result editItemView(Long id) {
// 根据id查找item和desc
TbItem item = itemMapper.selectByPrimaryKey(id);
TbItemDesc desc = itemDescMapper.selectByPrimaryKey(id);
E3Result result = new E3Result(desc);
return result;
}
@Override
public TbItemDesc getItemDescById(Long itemId) {
// 查询缓存
try {
String json = jedisClient.get(REDIS_ITEM_PRE + ":" + itemId
+ ":DESC");
if (StringUtils.isNoneBlank(json)) {
TbItemDesc tbItemDesc = JsonUtils.jsonToPojo(json,
TbItemDesc.class);
return tbItemDesc;
}
} catch (Exception e) {
// TODO: handle exception
}
TbItemDesc itemDesc = itemDescMapper.selectByPrimaryKey(itemId);
// 把结果添加到缓存
try {
jedisClient.set(REDIS_ITEM_PRE + ":" + itemId + ":DESC",
JsonUtils.objectToJson(itemDesc));
// 设置过期时间
jedisClient.expire(REDIS_ITEM_PRE + ":" + itemId + ":DESC",
ITEM_CACHE_EXPIRE);
} catch (Exception e) {
// TODO: handle exception
}
return itemDesc;
}
}
| [
"user3@163.com"
] | user3@163.com |
b2fe68f0906f46805527ed2e0e3ca15cff7515fc | f7662228c24614d98deeda0a37c893e42c16c8d5 | /spoon-runner/src/main/java/com/squareup/spoon/html/HtmlRenderer.java | 11c5779f8b8e493f4778b2c5d7c2fa7bd54ffe3c | [
"Apache-2.0"
] | permissive | RichardGuion/spoon | 72487896313060f73a519601336d3c55619e34a3 | e86dfb7d8d36e3aef0b79329a46427c612904cec | refs/heads/master | 2020-04-06T06:53:44.663599 | 2013-05-24T00:00:03 | 2013-05-24T00:00:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,052 | java | package com.squareup.spoon.html;
import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.Mustache;
import com.github.mustachejava.MustacheFactory;
import com.google.common.io.Resources;
import com.google.gson.Gson;
import com.squareup.spoon.DeviceDetails;
import com.squareup.spoon.DeviceResult;
import com.squareup.spoon.DeviceTest;
import com.squareup.spoon.DeviceTestResult;
import com.squareup.spoon.SpoonSummary;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.lesscss.LessCompiler;
import static com.google.common.base.Charsets.UTF_8;
/** Renders a {@link com.squareup.spoon.SpoonSummary} as static HTML to an output directory. */
public final class HtmlRenderer {
private static final String STATIC_DIRECTORY = "static";
private static final String[] STATIC_ASSETS = {
"bootstrap.min.css", "bootstrap-responsive.min.css", "bootstrap.min.js", "jquery.min.js",
"icon-animated.png", "icon-devices.png", "icon-log.png", "ceiling_android.png"
};
private final SpoonSummary summary;
private final Gson gson;
private final File output;
public HtmlRenderer(SpoonSummary summary, Gson gson, File output) {
this.summary = summary;
this.gson = gson;
this.output = output;
}
public void render() {
output.mkdirs();
copyStaticAssets();
generateCssFromLess();
writeResultJson();
MustacheFactory mustacheFactory = new DefaultMustacheFactory();
generateIndexHtml(mustacheFactory);
generateDeviceHtml(mustacheFactory);
generateTestHtml(mustacheFactory);
generateLogHtml(mustacheFactory);
}
private void copyStaticAssets() {
File statics = new File(output, STATIC_DIRECTORY);
statics.mkdir();
for (String staticAsset : STATIC_ASSETS) {
copyStaticToOutput(staticAsset, statics);
}
}
private void generateCssFromLess() {
try {
LessCompiler compiler = new LessCompiler();
String less = Resources.toString(getClass().getResource("/spoon.less"), UTF_8);
String css = compiler.compile(less);
File cssFile = FileUtils.getFile(output, STATIC_DIRECTORY, "spoon.css");
FileUtils.writeStringToFile(cssFile, css);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
private void writeResultJson() {
FileWriter result = null;
try {
result = new FileWriter(new File(output, "result.json"));
gson.toJson(summary, result);
} catch (IOException e) {
throw new RuntimeException("Unable to write result.json file.", e);
} finally {
IOUtils.closeQuietly(result);
}
}
private void generateIndexHtml(MustacheFactory mustacheFactory) {
Mustache mustache = mustacheFactory.compile("page/index.html");
HtmlIndex scope = HtmlIndex.from(summary);
File file = new File(output, "index.html");
renderMustacheToFile(mustache, scope, file);
}
private void generateDeviceHtml(MustacheFactory mustacheFactory) {
Mustache mustache = mustacheFactory.compile("page/device.html");
for (Map.Entry<String, DeviceResult> entry : summary.getResults().entrySet()) {
String serial = entry.getKey();
HtmlDevice scope = HtmlDevice.from(serial, entry.getValue(), output);
File file = FileUtils.getFile(output, "device", serial + ".html");
renderMustacheToFile(mustache, scope, file);
}
}
private void generateTestHtml(MustacheFactory mustacheFactory) {
Mustache mustache = mustacheFactory.compile("page/test.html");
// Create a set of unique tests.
Set<DeviceTest> tests = new LinkedHashSet<DeviceTest>();
for (DeviceResult deviceResult : summary.getResults().values()) {
tests.addAll(deviceResult.getTestResults().keySet());
}
// Generate a page for each one.
for (DeviceTest test : tests) {
HtmlTest scope = HtmlTest.from(test, summary, output);
File file =
FileUtils.getFile(output, "test", test.getClassName(), test.getMethodName() + ".html");
renderMustacheToFile(mustache, scope, file);
}
}
private void generateLogHtml(MustacheFactory mustacheFactory) {
Mustache mustache = mustacheFactory.compile("page/log.html");
for (Map.Entry<String, DeviceResult> resultEntry : summary.getResults().entrySet()) {
String serial = resultEntry.getKey();
DeviceResult result = resultEntry.getValue();
DeviceDetails details = result.getDeviceDetails();
String name = (details != null) ? details.getName() : serial;
for (Map.Entry<DeviceTest, DeviceTestResult> entry : result.getTestResults().entrySet()) {
DeviceTest test = entry.getKey();
HtmlLog scope = HtmlLog.from(name, test, entry.getValue());
File file = FileUtils.getFile(output, "logs", serial, test.getClassName(),
test.getMethodName() + ".html");
renderMustacheToFile(mustache, scope, file);
}
}
}
private static void renderMustacheToFile(Mustache mustache, Object scope, File file) {
FileWriter writer = null;
try {
file.getParentFile().mkdirs();
writer = new FileWriter(file);
mustache.execute(writer, scope);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
IOUtils.closeQuietly(writer);
}
}
private static void copyStaticToOutput(String resource, File output) {
InputStream is = null;
OutputStream os = null;
try {
is = HtmlRenderer.class.getResourceAsStream("/static/" + resource);
os = new FileOutputStream(new File(output, resource));
IOUtils.copy(is, os);
} catch (IOException e) {
throw new RuntimeException("Unable to copy static resource " + resource + " to " + output, e);
} finally {
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(os);
}
}
}
| [
"jw@squareup.com"
] | jw@squareup.com |
70e60e977ba7c0a02499206fc1c6563a4b85954a | 39e0886a50567d83f81f0645a48cae0b557ca044 | /Project/app/src/main/java/com/yijie/com/yijie/homepage/HeardHolder.java | a9cb726395fa1534fdd425a359a4e68c572f3f7e | [] | no_license | xiaobaichaosen/project | d2153fdcf0c0668587ba9d33391432e43260c2f4 | 230b9fc4a0ea2d3d193190c17c5a30a68a1c786d | refs/heads/master | 2021-09-26T17:54:13.089290 | 2018-11-01T02:45:28 | 2018-11-01T02:45:28 | 115,373,077 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 537 | java | package com.yijie.com.yijie.homepage;
import android.content.Context;
import android.view.View;
import java.util.List;
/**
* Description:
*
* @Author:桑小年
* @Data:2016/11/8 11:58
*/
public class HeardHolder<T> extends CustomPeakHolder<T> {
public HeardHolder(View itemView) {
super(itemView);
}
public HeardHolder(List datas, View itemView) {
super(datas, itemView);
}
public HeardHolder(Context context, List lists, int itemID) {
super(context, lists, itemID);
}
}
| [
"hljqqhryd@163.com"
] | hljqqhryd@163.com |
c1a213c0e0807d4c53f00a35f8021f9210272a26 | 84045ed0beecb4cd40c88b0e06fa6ece1899d6db | /app/src/main/java/com/kinco/MotorApp/TabFragmentUtils.java | 6d65607bc09a85e396e542d6826b3337d4e39a7c | [] | no_license | Chloe-jpg/PageDemo | d0f65a223df02a39c4f52dec985b58b37d15ff61 | 9f7e70c3993f3ac8338e6c618a60465e94accd8b | refs/heads/master | 2020-08-23T18:54:59.617644 | 2019-12-02T04:42:51 | 2019-12-02T04:42:51 | 216,686,666 | 0 | 1 | null | 2019-12-09T08:34:54 | 2019-10-21T23:59:46 | Java | UTF-8 | Java | false | false | 2,370 | java | package com.kinco.MotorApp;
import android.view.View;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import java.util.List;
public class TabFragmentUtils implements RadioGroup.OnCheckedChangeListener{
private List<Fragment> fragments;
private FragmentManager fragmentManager;
private int container;
//当前显示的页面
private int curShowPosition=0;
private RadioGroup radioGroup;
public TabFragmentUtils(RadioGroup radioGroup, int container, List<Fragment> fragments, FragmentManager fragmentManager) {
this.container = container;
this.fragments = fragments;
this.radioGroup = radioGroup;
this.fragmentManager = fragmentManager;
//设置radiobutton的点事件
radioGroup.setOnCheckedChangeListener(this);
//默认选择0 页面
((RadioButton) radioGroup.getChildAt(0)).setChecked(true);
}
public void onCheckedChanged(RadioGroup group, int checkedId) {
for (int i = 0; i < group.getChildCount(); i++) {
View view = group.getChildAt(i);
if(view.getId() == checkedId) {
//隐藏当前页面
fragments.get(curShowPosition).onStop();
//显示点击页面
if (fragments.get(i).isAdded()) {
//点击页面可见
fragments.get(i).onStart();
} else {
fragmentManager.beginTransaction().add(container, fragments.get(i)).commit();
}
//真正的显示fragment
showFragment(i);
}
}
}
//显示页面
private void showFragment(int index) {
for (int i = 0; i < fragments.size(); i++) {
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
if(i == index)
{//就是要显示的页面
fragmentTransaction.show(fragments.get(i));
}
else
{
fragmentTransaction.hide(fragments.get(i));
}
fragmentTransaction.commit();
}
//当前显示的页面为 index
curShowPosition = index;
}
}
| [
"email@example.com"
] | email@example.com |
dd54446e9374b7a078fbc5d27847d82f356e3ada | ea8e075e3a2e994451170da906d39c559bced2fe | /app/src/main/java/cn/com/stableloan/ui/adapter/Classify_Recycler_Adapter.java | 27723e7cdd0175832a2ca488ef4245a5a5837590 | [] | no_license | Mexicande/stableloan | 4ec059c8940071a759f4fbdb963b414bcdfb93b7 | 0ba7686d81ed09039693d6bfc206ca0e6b8046f7 | refs/heads/master | 2021-01-21T15:49:46.918367 | 2017-06-21T03:20:17 | 2017-06-21T03:20:17 | 91,861,360 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,276 | java | package cn.com.stableloan.ui.adapter;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import java.util.List;
import cn.com.stableloan.R;
import cn.com.stableloan.bean.Picture;
import cn.com.stableloan.model.News_ClassBean;
import jp.wasabeef.glide.transformations.CropCircleTransformation;
/**
* Created by apple on 2017/4/11.
*/
public class Classify_Recycler_Adapter extends BaseQuickAdapter<News_ClassBean.ClassBean,BaseViewHolder> {
public Classify_Recycler_Adapter(List<News_ClassBean.ClassBean> data) {
super(R.layout.classify_recycler_item, data);
}
@Override
protected void convert(BaseViewHolder helper, News_ClassBean.ClassBean item) {
// helper.setImageResource(R.id.head,R.mipmap.classify_04);
Glide.with(mContext).load(item.getHome_image()).crossFade().diskCacheStrategy(DiskCacheStrategy.SOURCE).into((ImageView) helper.getView(R.id.head));
// Glide.with(mContext).load(R.mipmap.new_product).crossFade().centerCrop().diskCacheStrategy(DiskCacheStrategy.SOURCE).into((ImageView) helper.getView(R.id.biaoqian));
}
}
| [
"mexicande@hotmail.com"
] | mexicande@hotmail.com |
17010e614e31aa491dbec3ccbabe7378f2cb1a61 | 95dc5eb89bd3e1becfd5a21dc397595601533998 | /node-app/node-app-wna/src/main/java/com/windsor/node/admin/domain/SystemAccountEditRequest.java | b86b17e803f71d4ebb5bd7a4d9cb2ac66783a84e | [] | no_license | WindsorSolutions/opennode2-java | f26380a898ab93fa4c196c5e5408edb62ed6d21a | f51cb5788c32c335ec48f50417a30bfdc2f29e37 | refs/heads/master | 2023-05-11T23:49:27.295326 | 2023-01-13T18:25:54 | 2023-01-13T18:25:54 | 104,112,627 | 2 | 4 | null | 2023-02-22T01:09:49 | 2017-09-19T18:30:17 | Java | UTF-8 | Java | false | false | 2,265 | java | /*
Copyright (c) 2009, The Environmental Council of the States (ECOS)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of the ECOS 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 com.windsor.node.admin.domain;
import java.util.HashMap;
import java.util.Map;
import com.windsor.node.common.domain.UserAccount;
public class SystemAccountEditRequest {
private static final long serialVersionUID = 1;
private Map flowAssignemnts;
private UserAccount account;
public SystemAccountEditRequest() {
flowAssignemnts = new HashMap();
}
public Map getFlowAssignemnts() {
return flowAssignemnts;
}
public void setFlowAssignemnts(Map flowAssignemnts) {
this.flowAssignemnts = flowAssignemnts;
}
public UserAccount getAccount() {
return account;
}
public void setAccount(UserAccount account) {
this.account = account;
}
} | [
"twitch@nervestaple.com"
] | twitch@nervestaple.com |
2c0623bea7122ac6750b2770faa368500d770e4f | 1a3cd09e8ff7c230a6faf92580df39e108de0215 | /platform-service/src/main/java/com/foolday/service/admin/AdminCommentService.java | 6b03012a3b671d7e0d034d570a1577e8459a80d5 | [] | no_license | xiqiangchen/foolday-platform | 41dbdf2dec1c760128178e0b51f7c427d8e3cab6 | d08c4e435f9fa8f5cd43ec8d5002669d42b4479f | refs/heads/master | 2023-04-26T10:18:10.692285 | 2021-05-13T03:32:47 | 2021-05-13T03:32:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,185 | java | package com.foolday.service.admin;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.foolday.common.base.BaseServiceUtils;
import com.foolday.common.enums.CommentType;
import com.foolday.dao.comment.CommentEntity;
import com.foolday.dao.comment.CommentMapper;
import com.foolday.service.api.admin.AdminCommentServiceApi;
import com.foolday.serviceweb.dto.admin.base.LoginUser;
import com.foolday.serviceweb.dto.admin.comment.CommentVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;
/**
* 后台管理的评论
*/
@Slf4j
@Service
@Transactional
public class AdminCommentService implements AdminCommentServiceApi {
@Resource
private CommentMapper commentMapper;
/**
* @param commentId
* @return
*/
@Override
public List<CommentEntity> findById(String commentId) {
CommentEntity comment = BaseServiceUtils.checkOneById(commentMapper, commentId, "获取评论信息失败");
String orderId = comment.getOrderId();
return findByOrderId(orderId);
}
/**
* 通过订单id获取评论列表
*
* @param orderId
* @return
*/
@Override
public List<CommentEntity> findByOrderId(String orderId) {
CommentEntity entity = new CommentEntity();
entity.setOrderId(orderId);
return commentMapper.selectList(Wrappers.lambdaQuery(entity)
.orderByAsc(CommentEntity::getCreateTime));
}
/**
* 获取评论列表
*
* @return
*/
@Override
@SuppressWarnings("unchecked")
public List<CommentEntity> list(LoginUser loginUser) {
CommentEntity comment = new CommentEntity();
comment.setShopId(loginUser.getShopId());
return commentMapper.selectList(Wrappers.lambdaQuery(comment)
.orderByDesc(CommentEntity::getUpdateTime, CommentEntity::getCreateTime));
}
/**
* 店铺人员对用户评论进行回复
*
* @param commentId
* @param commentVo
*/
@Override
public void replay(String commentId, CommentVo commentVo, LoginUser loginUser) {
CommentEntity entity = BaseServiceUtils.checkOneById(commentMapper, commentId, "获取评论信息失败");
CommentEntity commentEntity = new CommentEntity();
BeanUtils.copyProperties(commentVo, commentEntity);
commentEntity.setOrderId(entity.getOrderId());
commentEntity.setCreateTime(LocalDateTime.now());
commentEntity.setCommentType(CommentType.店长);
commentEntity.setCreateTime(LocalDateTime.now());
commentEntity.setAdminId(loginUser.getUserId());
commentEntity.setAdminName(loginUser.getUserName());
commentEntity.setShopId(loginUser.getShopId());
commentMapper.insert(commentEntity);
log.info("人员{}对用户{}的评论{}进行回复,内容为【{}】", loginUser.getUserName(), entity.getUserId(), commentId, commentVo.getDescription());
}
}
| [
"1265598443@qq.com"
] | 1265598443@qq.com |
0638e965d6aeef1cef2c80e36d82bf8390c68de5 | 1fd4a8674324b541cca93d87a219559b6c938b19 | /src/main/java/com/bytatech/ayoos/patientgateway/client/doctor/model/Review.java | 4bcb6ee41f9a7892b82553bf5739b5b0a8834499 | [] | no_license | Princekalathil/Patient-gateway | e35cfbe9f31f537658d9f812271902fd116f9d88 | 21988c717dc47dd6e167c2c0d19d9018244c673d | refs/heads/master | 2022-12-28T19:06:13.709895 | 2020-02-04T05:14:04 | 2020-02-04T05:14:04 | 238,121,588 | 0 | 0 | null | 2022-12-16T04:43:47 | 2020-02-04T04:18:36 | Java | UTF-8 | Java | false | false | 4,970 | java | package com.bytatech.ayoos.patientgateway.client.doctor.model;
import java.util.Objects;
import com.bytatech.ayoos.patientgateway.client.doctor.model.Doctor;
import com.bytatech.ayoos.patientgateway.client.doctor.model.Reply;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
//import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* Review
*/
@Validated
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-05-25T12:19:39.021+05:30[Asia/Calcutta]")
//@Document(indexName="review")
public class Review {
@JsonProperty("doctor")
private Doctor doctor = null;
@JsonProperty("id")
private Long id = null;
@JsonProperty("replies")
@Valid
private List<Reply> replies = null;
@JsonProperty("review")
private String review = null;
@JsonProperty("reviewedOn")
private LocalDate reviewedOn = null;
@JsonProperty("userName")
private String userName = null;
public Review doctor(Doctor doctor) {
this.doctor = doctor;
return this;
}
/**
* Get doctor
* @return doctor
**/
@ApiModelProperty(value = "")
@Valid
public Doctor getDoctor() {
return doctor;
}
public void setDoctor(Doctor doctor) {
this.doctor = doctor;
}
public Review id(Long id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@ApiModelProperty(value = "")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Review replies(List<Reply> replies) {
this.replies = replies;
return this;
}
public Review addRepliesItem(Reply repliesItem) {
if (this.replies == null) {
this.replies = new ArrayList<Reply>();
}
this.replies.add(repliesItem);
return this;
}
/**
* Get replies
* @return replies
**/
@ApiModelProperty(value = "")
@Valid
public List<Reply> getReplies() {
return replies;
}
public void setReplies(List<Reply> replies) {
this.replies = replies;
}
public Review review(String review) {
this.review = review;
return this;
}
/**
* Get review
* @return review
**/
@ApiModelProperty(value = "")
public String getReview() {
return review;
}
public void setReview(String review) {
this.review = review;
}
public Review reviewedOn(LocalDate reviewedOn) {
this.reviewedOn = reviewedOn;
return this;
}
/**
* Get reviewedOn
* @return reviewedOn
**/
@ApiModelProperty(value = "")
@Valid
public LocalDate getReviewedOn() {
return reviewedOn;
}
public void setReviewedOn(LocalDate reviewedOn) {
this.reviewedOn = reviewedOn;
}
public Review userName(String userName) {
this.userName = userName;
return this;
}
/**
* Get userName
* @return userName
**/
@ApiModelProperty(value = "")
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Review review = (Review) o;
return Objects.equals(this.doctor, review.doctor) &&
Objects.equals(this.id, review.id) &&
Objects.equals(this.replies, review.replies) &&
Objects.equals(this.review, review.review) &&
Objects.equals(this.reviewedOn, review.reviewedOn) &&
Objects.equals(this.userName, review.userName);
}
@Override
public int hashCode() {
return Objects.hash(doctor, id, replies, review, reviewedOn, userName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Review {\n");
sb.append(" doctor: ").append(toIndentedString(doctor)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" replies: ").append(toIndentedString(replies)).append("\n");
sb.append(" review: ").append(toIndentedString(review)).append("\n");
sb.append(" reviewedOn: ").append(toIndentedString(reviewedOn)).append("\n");
sb.append(" userName: ").append(toIndentedString(userName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"prince.k.c@lxisoft.com"
] | prince.k.c@lxisoft.com |
c2614356a1ac4d242f3cea5601e433e94c3016b8 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/11/org/apache/commons/math3/ode/MultistepIntegrator_InitializationCompletedMarkerException_408.java | 817ddbf6df9b4a4bd5cbe3fa5ecf38c5860223ef | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 1,159 | java |
org apach common math3 od
base multistep integr ordinari
differenti equat
defin scale deriv step
pre
deriv
y'' deriv
y''' deriv
deriv
pre
store previou step separ implement
nordsieck vector higher degre scale deriv
step defin
pre
pre
omit index notat clariti
multistep integr nordsieck represent highli sensit
larg step step multipli factor
compon nordsieck vector multipli
compon accur max growth
factor set low order
org apach common math3 od nonstiff adam bashforth integr adamsbashforthintegr
org apach common math3 od nonstiff adam moulton integr adamsmoultonintegr
version
multistep integr multistepintegr adapt stepsiz integr adaptivestepsizeintegr
simpl constructor
initi complet marker except initializationcompletedmarkerexcept
throwabl
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
6a9aeaf7b51d3f3bf1219865bde1ec76f03d9840 | b4cf6eaf3d243dbbd6f181b9c7038392f796319b | /core/src/main/java/de/bwaldvogel/mongo/backend/Index.java | c57c814a75ae47ba6550e4690c99bd516fb78bd7 | [
"BSD-3-Clause"
] | permissive | Blackarrow7777/mongo-java-server | 77549ea3d347f380d2f351cc6d9bc2396dc2cc62 | 34f7e385e12cc12f4c6bd3644bee83efd4d22512 | refs/heads/master | 2022-04-22T14:23:22.747300 | 2020-04-17T06:52:32 | 2020-04-17T06:52:32 | 256,591,871 | 1 | 0 | BSD-3-Clause | 2020-04-17T19:29:04 | 2020-04-17T19:29:04 | null | UTF-8 | Java | false | false | 6,558 | java | package de.bwaldvogel.mongo.backend;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import de.bwaldvogel.mongo.MongoCollection;
import de.bwaldvogel.mongo.bson.Document;
import de.bwaldvogel.mongo.exception.CannotIndexParallelArraysError;
import de.bwaldvogel.mongo.exception.KeyConstraintError;
public abstract class Index<P> {
private final String name;
private final List<IndexKey> keys;
private final boolean sparse;
protected Index(String name, List<IndexKey> keys, boolean sparse) {
this.name = name;
this.keys = keys;
this.sparse = sparse;
}
protected boolean isSparse() {
return sparse;
}
public List<IndexKey> getKeys() {
return keys;
}
public boolean hasSameOptions(Index<?> other) {
return sparse == other.sparse;
}
public String getName() {
return name;
}
protected List<String> keys() {
return keys.stream()
.map(IndexKey::getKey)
.collect(Collectors.toList());
}
protected Set<String> keySet() {
return keys.stream()
.map(IndexKey::getKey)
.collect(Collectors.toCollection(LinkedHashSet::new));
}
public Set<KeyValue> getKeyValues(Document document) {
return getKeyValues(document, true);
}
Set<KeyValue> getKeyValues(Document document, boolean normalize) {
Map<String, Object> valuesPerKey = collectValuesPerKey(document);
if (normalize) {
valuesPerKey.replaceAll((key, value) -> Utils.normalizeValue(value));
}
List<Collection<?>> collectionValues = valuesPerKey.values().stream()
.filter(value -> value instanceof Collection)
.map(value -> (Collection<?>) value)
.collect(Collectors.toList());
if (collectionValues.size() == 1) {
@SuppressWarnings("unchecked")
Collection<Object> collectionValue = (Collection<Object>) CollectionUtils.getSingleElement(collectionValues);
return CollectionUtils.multiplyWithOtherElements(valuesPerKey.values(), collectionValue).stream()
.map(KeyValue::new)
.collect(StreamUtils.toLinkedHashSet());
} else if (collectionValues.size() > 1) {
validateHasNoParallelArrays(document);
return collectCollectionValues(collectionValues);
} else {
return Collections.singleton(new KeyValue(valuesPerKey.values()));
}
}
private void validateHasNoParallelArrays(Document document) {
Set<List<String>> arrayPaths = new LinkedHashSet<>();
for (String key : keys()) {
List<String> pathToFirstCollection = getPathToFirstCollection(document, key);
if (pathToFirstCollection != null) {
arrayPaths.add(pathToFirstCollection);
}
}
if (arrayPaths.size() > 1) {
List<String> parallelArraysPaths = arrayPaths.stream()
.map(path -> path.get(path.size() - 1))
.collect(Collectors.toList());
throw new CannotIndexParallelArraysError(parallelArraysPaths);
}
}
private static List<String> getPathToFirstCollection(Document document, String key) {
List<String> fragments = Utils.splitPath(key);
List<String> remainingFragments = Utils.getTail(fragments);
return getPathToFirstCollection(document, remainingFragments, Collections.singletonList(fragments.get(0)));
}
private static List<String> getPathToFirstCollection(Document document, List<String> remainingFragments, List<String> path) {
Object value = Utils.getSubdocumentValue(document, Utils.joinPath(path));
if (value instanceof Collection) {
return path;
}
if (remainingFragments.isEmpty()) {
return null;
}
List<String> newPath = new ArrayList<>(path);
newPath.add(remainingFragments.get(0));
return getPathToFirstCollection(document, Utils.getTail(remainingFragments), newPath);
}
private Map<String, Object> collectValuesPerKey(Document document) {
Map<String, Object> valuesPerKey = new LinkedHashMap<>();
for (String key : keys()) {
Object value = Utils.getSubdocumentValueCollectionAware(document, key);
valuesPerKey.put(key, value);
}
return valuesPerKey;
}
private static Set<KeyValue> collectCollectionValues(List<Collection<?>> collectionValues) {
int size = collectionValues.get(0).size();
Set<KeyValue> keyValues = new LinkedHashSet<>();
for (int i = 0; i < size; i++) {
int pos = i;
List<Object> values = collectionValues.stream()
.map(collection -> CollectionUtils.getElementAtPosition(collection, pos))
.collect(Collectors.toList());
keyValues.add(new KeyValue(values));
}
return keyValues;
}
public abstract P getPosition(Document document);
public abstract void checkAdd(Document document, MongoCollection<P> collection);
public abstract void add(Document document, P position, MongoCollection<P> collection);
public abstract P remove(Document document);
public abstract boolean canHandle(Document query);
public abstract Iterable<P> getPositions(Document query);
public abstract long getCount();
public boolean isEmpty() {
return getCount() == 0;
}
public abstract long getDataSize();
public abstract void checkUpdate(Document oldDocument, Document newDocument, MongoCollection<P> collection);
public abstract void updateInPlace(Document oldDocument, Document newDocument, P position, MongoCollection<P> collection) throws KeyConstraintError;
protected boolean isCompoundIndex() {
return keys().size() > 1;
}
protected boolean nullAwareEqualsKeys(Document oldDocument, Document newDocument) {
Set<KeyValue> oldKeyValues = getKeyValues(oldDocument);
Set<KeyValue> newKeyValues = getKeyValues(newDocument);
return Utils.nullAwareEquals(oldKeyValues, newKeyValues);
}
public abstract void drop();
@Override
public String toString() {
return getClass().getSimpleName() + "[name=" + getName() + "]";
}
}
| [
"mail@bwaldvogel.de"
] | mail@bwaldvogel.de |
32e01731e30c784df60bdf195d3feec0899da701 | 5067d13ba6abc9aea2a03927b9f7468e73095273 | /src/com/dcms/cms/dao/assist/impl/CmsCommentExtDaoImpl.java | 80f3aef4cc3604ae905e46690be9a2fec0fc3f5f | [] | no_license | dailinyi/dcmsv5-postgreSQL | ced164536a7c0fe99c53446f1d499de3bff8f3a4 | 09985b1519533090f4d67dd1ee410a37242d93b4 | refs/heads/master | 2021-01-01T05:51:51.135571 | 2015-02-02T15:18:11 | 2015-02-02T15:18:11 | 30,084,495 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,357 | java | package com.dcms.cms.dao.assist.impl;
import org.hibernate.Criteria;
import org.springframework.stereotype.Repository;
import com.dcms.cms.dao.assist.CmsCommentExtDao;
import com.dcms.cms.entity.assist.CmsCommentExt;
import com.dcms.common.hibernate3.HibernateBaseDao;
import com.dcms.common.page.Pagination;
@Repository
public class CmsCommentExtDaoImpl extends
HibernateBaseDao<CmsCommentExt, Integer> implements CmsCommentExtDao {
public Pagination getPage(int pageNo, int pageSize) {
Criteria crit = createCriteria();
Pagination page = findByCriteria(crit, pageNo, pageSize);
return page;
}
public CmsCommentExt findById(Integer id) {
CmsCommentExt entity = get(id);
return entity;
}
public CmsCommentExt save(CmsCommentExt bean) {
getSession().save(bean);
return bean;
}
public int deleteByContentId(Integer contentId) {
String hql = "delete from CmsCommentExt bean where bean.id in"
+ " (select c.id from CmsComment c where c.content.id=:contentId)";
return getSession().createQuery(hql).setParameter("contentId",
contentId).executeUpdate();
}
public CmsCommentExt deleteById(Integer id) {
CmsCommentExt entity = super.get(id);
if (entity != null) {
getSession().delete(entity);
}
return entity;
}
@Override
protected Class<CmsCommentExt> getEntityClass() {
return CmsCommentExt.class;
}
} | [
"dailinyi@rd.tuan800.com"
] | dailinyi@rd.tuan800.com |
d3260731b5b75c0095d7ad22e5361a780881a832 | 8c0ecbec868b5425b5f38beda441b3d6b66545ff | /basex-core/src/main/java/org/basex/query/func/file/FileResolvePath.java | 709ce00e383e185d74c1550c6e984219166ac74b | [
"BSD-3-Clause"
] | permissive | HGData/basex | 76c5c8bb2d60ad6fbe260db51ffe75dd5e3dc3af | fa88ea21e8f0792e4cfd6a6d8f77e52df4eab167 | refs/heads/master | 2021-06-27T17:48:31.833330 | 2021-01-19T04:30:28 | 2021-01-19T04:30:28 | 209,368,032 | 0 | 0 | NOASSERTION | 2021-01-19T04:30:30 | 2019-09-18T17:36:06 | Java | UTF-8 | Java | false | false | 895 | java | package org.basex.query.func.file;
import static org.basex.query.QueryError.*;
import static org.basex.util.Token.*;
import java.nio.file.*;
import org.basex.query.*;
import org.basex.query.value.item.*;
/**
* Function implementation.
*
* @author BaseX Team 2005-19, BSD License
* @author Christian Gruen
*/
public final class FileResolvePath extends FileFn {
@Override
public Item item(final QueryContext qc) throws QueryException {
final Path path = toPath(toToken(exprs[0], qc)), abs;
if(exprs.length < 2) {
abs = absolute(path);
} else {
final byte[] file = toToken(exprs[1], qc);
Path base = toPath(file);
if(!base.isAbsolute()) throw FILE_IS_RELATIVE_X.get(info, base);
if(!endsWith(file, '/') && !endsWith(file, '\\')) base = base.getParent();
abs = base.resolve(path);
}
return get(abs, Files.isDirectory(abs));
}
}
| [
"christian.gruen@gmail.com"
] | christian.gruen@gmail.com |
dec5a2b7757a5b2e8f29694fd50e30b195555c4e | d7eef7b57cad4e6bf6adb6688790255f9bf2b4a8 | /Pro studenty/Lekce08-Ukol/60-Banka-Zadani/src/main/java/cz/czechitas/banka/BeznyUcetTest.java | a3f3637d7ec9ef2f2d73219b7ca0654e2652d4ae | [
"Apache-2.0"
] | permissive | tosovvoj/java-1 | 1e3817298c2cc98b4302bbbf2901903b20f61df5 | 828ef61d34143a7da4174f7685a169913dab465d | refs/heads/master | 2021-02-08T08:49:49.000136 | 2020-03-01T11:23:07 | 2020-03-01T11:23:07 | 244,132,103 | 0 | 0 | Apache-2.0 | 2020-03-01T11:23:08 | 2020-03-01T10:53:34 | null | UTF-8 | Java | false | false | 5,873 | java | package cz.czechitas.banka;
import java.io.*;
import java.nio.charset.*;
import java.util.concurrent.*;
import net.sevecek.util.*;
public class BeznyUcetTest {
/*
public void otestujBeznyUcet() {
BeznyUcet ucet1 = new BeznyUcet(8800.0);
otestujJedenUcet(ucet1, 8800.0);
BeznyUcet ucet2 = new BeznyUcet(50000.0);
otestujJedenUcet(ucet2, 50000.0);
System.out.println("BeznyUcet: Vsechny testy jsou OK");
}
//-------------------------------------------------------------------------
private void otestujJedenUcet(BeznyUcet ucet, double pocatecniZustatek) {
pocatecniZustatekSeMusiSpravneOhlasit(ucet, pocatecniZustatek);
zapornaCastkaNesmiBytVlozena(ucet);
zapornaCastkaNesmiBytVybrana(ucet);
vkladMusiZvysitZustatek(ucet);
vyberMusiSnizitZustatek(ucet);
prilisVysokyVyberMusiSelhat(ucet);
}
private void zapornaCastkaNesmiBytVlozena(BeznyUcet ucet) {
try {
boolean vysledek = executeAndCaptureConsole(() ->
ucet.vyberPenize(-1000.0)
);
assertTrue(!vysledek, "Zaporna castka, napriklad " + (-1000)
+ ", nesmi byt povolena vlozit na " + ucet.getClass().getSimpleName() + ".");
} catch (IllegalArgumentException ex) {
// Toto je v poradku. Vyjimka musi nastat pro spravny beh testu.
}
}
private void zapornaCastkaNesmiBytVybrana(BeznyUcet ucet) {
try {
boolean vysledek = executeAndCaptureConsole(() ->
ucet.vlozPenize(-1000.0)
);
assertTrue(!vysledek, "Zaporna castka, napriklad " + (-1000)
+ ", nesmi byt povolena vybrat z objektu " + ucet.getClass().getSimpleName() + ".");
} catch (IllegalArgumentException ex) {
// Toto je v poradku. Vyjimka musi nastat pro spravny beh testu.
}
}
private void pocatecniZustatekSeMusiSpravneOhlasit(BeznyUcet ucet, double pocatecniZustatek) {
double skutecnyZustatek = ucet.getZustatek();
assertEquals(pocatecniZustatek, skutecnyZustatek, ucet.getClass().getSimpleName() + " byl vytvoren s pocatecni castkou " + pocatecniZustatek + ", ale getZustatek() vraci " + skutecnyZustatek + ".");
}
private void vkladMusiZvysitZustatek(BeznyUcet ucet) {
double vkladanaCastka = 100.0;
double pocatecniZustatek = ucet.getZustatek();
boolean vysledek = ucet.vlozPenize(vkladanaCastka);
assertTrue(vysledek, "Vklad na " + ucet.getClass().getSimpleName() + " ve vysi " + vkladanaCastka + " musi byt proveden.");
double ocekavanyZustatek = pocatecniZustatek + vkladanaCastka;
double skutecnyZustatek = ucet.getZustatek();
assertEquals(ocekavanyZustatek, skutecnyZustatek, ucet.getClass().getSimpleName() + " se zustatkem " + pocatecniZustatek + " si uspesne vlozil " + vkladanaCastka + ". Vysledny zustatek by mel byt " + ocekavanyZustatek + ", ale byl " + skutecnyZustatek + ".");
}
private void vyberMusiSnizitZustatek(BeznyUcet ucet) {
double vybiranaCastka = 250.0;
double pocatecniZustatek = ucet.getZustatek();
if (pocatecniZustatek < vybiranaCastka) {
throw new AssertionError(ucet.getClass().getSimpleName() + " byl vytvoren s prilis malou pocatecni castkou");
}
boolean vysledek = ucet.vyberPenize(vybiranaCastka);
assertTrue(vysledek, ucet.getClass().getSimpleName() + " se zustatkem " + pocatecniZustatek + " musi povolit vyber castky " + vybiranaCastka + ".");
double ocekavanyZustatek = pocatecniZustatek - vybiranaCastka;
double skutecnyZustatek = ucet.getZustatek();
assertEquals(ocekavanyZustatek, skutecnyZustatek, ucet.getClass().getSimpleName() + " se zustatkem " + pocatecniZustatek + " provedl vyber castky " + vybiranaCastka + ". Vysledny zustatek po provedeni vyberu byl " + skutecnyZustatek + ", ale mel byt " + ocekavanyZustatek + ".");
}
private void prilisVysokyVyberMusiSelhat(BeznyUcet ucet) {
double pocatecniZustatek = ucet.getZustatek();
double vybiranaCastka = Math.abs(pocatecniZustatek * 10.0) + 100;
boolean vysledek = ucet.vyberPenize(vybiranaCastka);
assertTrue(!vysledek, ucet.getClass().getSimpleName() + " s pocatecnim zustatkem " + pocatecniZustatek + " nesmi povolit vyber " + vybiranaCastka + ".");
double skutecnyZustatek = ucet.getZustatek();
assertEquals(pocatecniZustatek, skutecnyZustatek, "Zustatek na uctu musi zustat nezmenen po zamitnutem vyberu " + vybiranaCastka + " from " + ucet.getClass().getSimpleName() + " se zustatkem " + pocatecniZustatek + ". Chybny vysledny zustatek ale byl " + skutecnyZustatek);
}
//-------------------------------------------------------------------------
private void assertTrue(boolean actualValue, String errorMessage) {
if (!actualValue) {
throw new AssertionError(errorMessage);
}
}
private void assertEquals(double expectedValue, double actualValue, String errorMessage) {
if (expectedValue != actualValue) {
throw new AssertionError(errorMessage);
}
}
private boolean executeAndCaptureConsole(Callable<Boolean> method) {
boolean result;
PrintStream backup = System.out;
ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setOut(new PrintStream(out));
try {
result = method.call();
capturedConsoleOutput = new String(out.toByteArray(), Charset.defaultCharset());
} catch (Exception ex) {
throw ExceptionUtils.rethrowAsUnchecked(ex);
} finally {
System.setOut(backup);
}
return result;
}
private String capturedConsoleOutput;
*/
}
| [
"kamil@sevecek.net"
] | kamil@sevecek.net |
97a987f9e8208a3b95906f5463064e862aa2887c | 201dac5610e86ae4e5c10b6522d1cd912e70b8aa | /JavaEE/14-Filter/src/com/wendao/servlet/TestServlet.java | 4a38f4b53fd5df09ce98e75158fe5cc9110650e7 | [] | no_license | lq1990/myJava | e0506e25d562970b1ce93d23adcb514ae8641d06 | 6b8d200633744912dd93a6122d748e4d39d01541 | refs/heads/master | 2023-01-06T20:06:38.010795 | 2020-03-14T15:11:00 | 2020-03-14T15:11:00 | 163,006,968 | 0 | 0 | null | 2023-01-05T00:52:12 | 2018-12-24T16:17:58 | JavaScript | UTF-8 | Java | false | false | 655 | java | package com.wendao.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/test.do")
public class TestServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// encoding
req.setCharacterEncoding("utf-8");
resp.setContentType("text/html;charset=utf-8");
// req
System.out.println("TestServlet.service()");
// resp
}
}
| [
"chinalq90@gmail.com"
] | chinalq90@gmail.com |
ed2a18434622d9556ac813a4a564b26e64908761 | fd0440fc5b01470e02315e70049f3d9501e43ccf | /app/src/main/java/com/geekhive/studentsoft/beans/addfirebaseid/AddFirebaseID.java | 1dc94c9f37178ceba9cf20875badfec66a0ba84f | [] | no_license | dprasad554/StudentSoft | b073afefabef3436d920b1038c88eb3223b6112a | 346b06f72af0e366c88ea3551ffb0896e4737e1d | refs/heads/master | 2023-04-16T15:56:36.819080 | 2021-05-03T08:13:49 | 2021-05-03T08:13:49 | 363,860,002 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 395 | java |
package com.geekhive.studentsoft.beans.addfirebaseid;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class AddFirebaseID {
@SerializedName("result")
@Expose
private Result result;
public Result getResult() {
return result;
}
public void setResult(Result result) {
this.result = result;
}
}
| [
"rohitkumar.kr92@gmail.com"
] | rohitkumar.kr92@gmail.com |
7dfac98c0f759501a968ad8a49a4d8a5dd6f278a | e45dabef127bf9d7c539a014b36c19c1f9f7e077 | /src/com/yayo/warriors/module/task/model/CampTask.java | ac47fe3a97a03eaba95c32d18f5e5b1d756b6391 | [] | no_license | zyb2013/Warriors | aaa26c89dde6b5777a8fcd3674d1ee61346ffda7 | 6ac80f1868d749295c298a36ad4b6425034d358f | refs/heads/master | 2021-01-01T19:46:57.730694 | 2014-01-17T01:41:45 | 2014-01-17T01:41:45 | 15,986,861 | 5 | 10 | null | null | null | null | UTF-8 | Java | false | false | 3,224 | java | package com.yayo.warriors.module.task.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Transient;
import com.yayo.common.utility.Splitable;
import com.yayo.warriors.module.task.type.TaskStatus;
public class CampTask implements Serializable {
private static final long serialVersionUID = -8773076788678444160L;
private long playerId;
private int taskId;
private String taskEvent = "";
private int status = TaskStatus.ACCEPTED;
@Transient
private transient volatile List<TaskEvent> taskEvents = new ArrayList<TaskEvent>();
public static CampTask valueOf(long playerId,int taskId){
CampTask camTask = new CampTask();
camTask.taskId = taskId;
camTask.playerId = playerId;
return camTask;
}
public void addTaskEvent(TaskEvent event){
this.taskEvents.add(event);
this.taskEvent = this.build2String();
}
public List<TaskEvent> getTaskEvents(){
return taskEvents;
}
public void updateEvents(){
this.taskEvent = this.build2String();
}
public boolean checkTaskStatus(){
for(TaskEvent event : taskEvents){
if(!event.isComplete()){
return false;
}
}
if(this.status == TaskStatus.ACCEPTED){
this.status = TaskStatus.COMPLETED;
}
return true;
}
public long getPlayerId() {
return playerId;
}
public void setPlayerId(long playerId) {
this.playerId = playerId;
}
public int getTaskId() {
return taskId;
}
public void setTaskId(int taskId) {
this.taskId = taskId;
}
public String getTaskEvent() {
return taskEvent;
}
public void setTaskEvent(String taskEvent) {
this.taskEvent = taskEvent;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (playerId ^ (playerId >>> 32));
result = prime * result + taskId;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CampTask other = (CampTask) obj;
if (playerId != other.playerId)
return false;
if (taskId != other.taskId)
return false;
return true;
}
@Override
public String toString() {
return "CampTask [playerId=" + playerId + ", taskId=" + taskId
+ ", taskEvent=" + taskEvent + ", status=" + status + "]";
}
private String build2String(){
if(taskEvents == null || taskEvents.isEmpty()){
return "";
}
StringBuilder builder = new StringBuilder();
for(TaskEvent event : taskEvents){
builder.append(event).append(Splitable.ELEMENT_DELIMITER);
}
if(builder.length() > 0) {
builder.deleteCharAt(builder.length() - 1);
}
return builder.toString();
}
public String build2Task(){
if(taskEvents == null || taskEvents.isEmpty()){
return "";
}
StringBuilder builder = new StringBuilder();
for(TaskEvent event : taskEvents){
builder.append(taskId).append(Splitable.ATTRIBUTE_SPLIT).append(event).append(Splitable.ELEMENT_DELIMITER);
}
if(builder.length() > 0) {
builder.deleteCharAt(builder.length() - 1);
}
return builder.toString();
}
}
| [
"zhuyuanbiao2013@gmail.com"
] | zhuyuanbiao2013@gmail.com |
673e153f90e4689f34a2d2320f96bd0d5b52f335 | 663314e2b91d7a1deeb6f3069b2a03e65d67c8f4 | /guess-game-server/src/main/java/guess/App.java | 6db5258278671241c638b5c32abfd62616ab38a6 | [] | no_license | dbelob/guess-game | 34b41e6d918a6ed91a56a398fa9a3f3e2187574b | a9d6827d7d199bb304bb36240f2fcdb7f11e56f0 | refs/heads/master | 2022-06-18T18:09:23.738837 | 2020-07-31T09:06:45 | 2020-07-31T09:06:45 | 196,954,564 | 13 | 5 | null | 2022-06-03T10:09:50 | 2019-07-15T08:13:12 | Java | UTF-8 | Java | false | false | 622 | java | package guess;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
@SpringBootApplication
public class App extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(App.class);
}
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
| [
"dbelob@users.noreply.github.com"
] | dbelob@users.noreply.github.com |
8d3d6965e9a7445f33ce2d5009cc5417bfe7d9a8 | 1514d8c4ab484f5180b0b984a8adfccb1b2aeee6 | /java/bbt/src/main/java/com/wangrui/bbt/beans/Order.java | 3b0a0973617e3a4760fb73e7cf86b770cc8c6aba | [] | no_license | sunjava2006/202101 | 0e4f1c7357b157f620f08fadc83a44a0d53d3588 | 468e80bf90b2f4a6afbe3d42b1a4000c3f5e9495 | refs/heads/main | 2023-04-16T09:22:05.829984 | 2021-04-29T03:05:05 | 2021-04-29T03:05:05 | 362,047,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,656 | java | package com.wangrui.bbt.beans;
import java.io.Serializable;
import java.sql.Date;
import java.util.List;
public class Order implements Serializable{
private Integer orderID;
private Integer userID;
private Date orderDate;
private Integer status;
private Address address; // 对一映射
private List<OrderDetail> details; // 对多映射
public Integer getOrderID() {
return orderID;
}
public void setOrderID(Integer orderID) {
this.orderID = orderID;
}
public Integer getUserID() {
return userID;
}
public void setUserID(Integer userID) {
this.userID = userID;
}
public Date getOrderDate() {
return orderDate;
}
public void setOrderDate(Date orderDate) {
this.orderDate = orderDate;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
public List<OrderDetail> getDetails() {
return details;
}
public void setDetails(List<OrderDetail> details) {
this.details = details;
}
public Order() {
}
public Order(Integer orderID, Integer userID, Date orderDate, Integer status, Address address,
List<OrderDetail> details) {
super();
this.orderID = orderID;
this.userID = userID;
this.orderDate = orderDate;
this.status = status;
this.address = address;
this.details = details;
}
@Override
public String toString() {
return "Order [orderID=" + orderID + ", userID=" + userID + ", orderDate=" + orderDate + ", status=" + status
+ ", address=" + address + ", details=" + details + "]";
}
}
| [
"jkwangrui@126.com"
] | jkwangrui@126.com |
6a3027bce62eab5b8fc7284119e5349b6a41541f | 3b1688c88248c84f11dc4a5bd3277665da0e55bd | /src/main/java/cn/ibdsr/web/common/persistence/model/HotelOrderUser.java | 911f87f8ad70ac57408ff660e5df1ba7a48de0c0 | [] | no_license | wangdeming/eshop-mobile | 237aaa7e8819c9524ce598d32420ade2a94bbcea | 9f384e722c7d50b329a3e4aadb01b06d4e051cbb | refs/heads/master | 2022-09-30T11:09:10.368099 | 2020-06-05T01:03:52 | 2020-06-05T01:03:52 | 269,498,482 | 0 | 0 | null | 2020-06-05T01:04:36 | 2020-06-05T01:02:32 | JavaScript | UTF-8 | Java | false | false | 3,693 | java | package cn.ibdsr.web.common.persistence.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
* 入住人
* </p>
*
* @author xxx
* @since 2019-05-14
*/
@TableName("hotel_order_user")
public class HotelOrderUser extends Model<HotelOrderUser> {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 订单ID
*/
@TableField("order_id")
private String orderId;
/**
* 房间ID
*/
@TableField("room_id")
private Long roomId;
/**
* 游客ID
*/
@TableField("user_tourist_id")
private Long userTouristId;
/**
* 姓名
*/
private String realname;
/**
* 创建人
*/
@TableField("created_user")
private Long createdUser;
/**
* 创建时间
*/
@TableField("created_time")
private Date createdTime;
/**
* 修改人
*/
@TableField("modified_user")
private Long modifiedUser;
/**
* 修改时间
*/
@TableField("modified_time")
private Date modifiedTime;
/**
* 是否删除
*/
@TableField("is_deleted")
private Integer isDeleted;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public Long getRoomId() {
return roomId;
}
public void setRoomId(Long roomId) {
this.roomId = roomId;
}
public Long getUserTouristId() {
return userTouristId;
}
public void setUserTouristId(Long userTouristId) {
this.userTouristId = userTouristId;
}
public String getRealname() {
return realname;
}
public void setRealname(String realname) {
this.realname = realname;
}
public Long getCreatedUser() {
return createdUser;
}
public void setCreatedUser(Long createdUser) {
this.createdUser = createdUser;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Long getModifiedUser() {
return modifiedUser;
}
public void setModifiedUser(Long modifiedUser) {
this.modifiedUser = modifiedUser;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
public Integer getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Integer isDeleted) {
this.isDeleted = isDeleted;
}
@Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() {
return "HotelOrderUser{" +
"id=" + id +
", orderId=" + orderId +
", roomId=" + roomId +
", userTouristId=" + userTouristId +
", realname=" + realname +
", createdUser=" + createdUser +
", createdTime=" + createdTime +
", modifiedUser=" + modifiedUser +
", modifiedTime=" + modifiedTime +
", isDeleted=" + isDeleted +
"}";
}
}
| [
"774555916@qq.com"
] | 774555916@qq.com |
e511751eb2de6297a82a6742c92409f7f094325f | f731eea3d31426aa680953d9d9777a0eba84b153 | /notification-service/src/main/java/asia/cmg/f8/notification/client/CommerceClientFallbackImpl.java | 7759830b8ceb0fa1ecc1f6653325baaf28d1a230 | [] | no_license | longpham041292/java-sample | 893a53b182d8d91a4aac4b05126438efeec16cca | 0b3ef36688eabbcf690de1b3daff57586dc010b7 | refs/heads/main | 2023-08-04T20:23:33.935587 | 2021-10-03T06:37:02 | 2021-10-03T06:37:02 | 412,994,810 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package asia.cmg.f8.notification.client;
import asia.cmg.f8.notification.dto.Order;
import org.springframework.stereotype.Component;
@Component
public class CommerceClientFallbackImpl implements CommerceClient {
@Override
public Order getOrder(final String orderUuid) {
return null;
}
}
| [
"longpham@leep.app"
] | longpham@leep.app |
540561dd54c390481acf1fd4b5395136952e8a0c | 2b23e1add93e3fb27e76b378bbf1329b331ce479 | /shop-common/src/main/java/com/github/zmm/shop/common/constant/weixin/WeiXinUrl.java | 7e27d6b2cbee2f842d7a5e541bbceecd65173ad4 | [] | no_license | MingHub0313/zmm_shop | 8d0a8802b16e4b903fbf2f203e9eac4e93004b16 | 4f6f0209fcae9042ae5135f55821d7ae67a2a00a | refs/heads/master | 2022-06-24T13:02:52.152099 | 2020-03-13T03:27:49 | 2020-03-13T03:27:49 | 246,732,213 | 0 | 0 | null | 2022-06-21T02:58:20 | 2020-03-12T03:11:14 | Java | UTF-8 | Java | false | false | 1,441 | java | package com.github.zmm.shop.common.constant.weixin;
/**
* @Name WeiXinUrl
* @Author 900045
* @Created by 2020/3/12 0012
*/
//@Component
public class WeiXinUrl {
// /** 获取Access_Token **/
// @Value("${weixin.url.access.token}")
// public String ACCESS_TOKEN_URL;
// /** 增加自定义菜单 **/
// @Value("${weixin.url.menu.add}")
// public String ADDMENU_URL;
// /** 新增临时素材 **/
// @Value("${weixin.url.tempmedia.add}")
// public String ADD_TEMPMEDIA_URL;
// /** 获取媒体素材 **/
// @Value("${weixin.url.media.get}")
// public String GET_MEDIA_URL;
// /** 发送模板消息 **/
// @Value("${weixin.url.templatemsg.sned}")
// public String SEND_TEMPLATEMSG_URL;
//
// /** 创建分组 **/
// @Value("${weixin.url.group.add}")
// public String ADD_GROUP;
// /** 查询所有分组**/
// @Value("${weixin.url.group.qurey.all}")
// public String QUERY_ALL_GROUP;
// /** 查询用户所在分组 **/
// @Value("${weixin.url.group.query.user}")
// public String QUERY_USER_GROUP;
// /** 修改分组名 **/
// @Value("${weixin.url.group.modify.name}")
// public String MODIFY_GROUP_NAME;
// /** 移动用户分组 **/
// @Value("${weixin.url.group.move.user}")
// public String MOVE_USER_GROUP;
// /** 批量移动用户分组 **/
// @Value("${weixin.url.group.batch.move.user}")
// public String BATCH_MOVE_USER_GROUP;
// /** 删除分组 **/
// @Value("${weixin.url.group.delete}")
// public String DELETE_GROUP;
}
| [
"zhangmingmig@adpanshi.com"
] | zhangmingmig@adpanshi.com |
75afd366f6d37672e3956ce2d192bd7767dbc35f | 6f7038017b4c09e7120db9d79271e09b3dac5b70 | /desktop/glfw_gui/java/src/main/java/org/mini/layout/XButton.java | 1e991dfee6a7d160e84d157877ef5c86cb1f2eb5 | [
"MIT"
] | permissive | filin8804/miniJVM | 13cd354af6abbc98f34f909b66f8b8849b180789 | 107a0f95ad7bc98f58b08f86a5e65c7300c9ca34 | refs/heads/master | 2022-12-13T09:37:45.761712 | 2020-09-07T08:51:51 | 2020-09-07T08:51:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,126 | java | package org.mini.layout;
import org.mini.gui.GButton;
import org.mini.gui.GObject;
import org.mini.gui.event.GActionListener;
import org.mini.layout.gscript.Interpreter;
import org.mini.layout.gscript.Str;
import org.mini.layout.xmlpull.KXmlParser;
/**
*
*/
public class XButton
extends XObject implements GActionListener {
static public final String XML_NAME = "button";
//
protected String pic;
protected String onClick;
protected int fontSize = XDef.DEFAULT_FONT_SIZE;
protected int addon = XDef.SPACING_BUTTON_ADD;
protected char emoji = 0;
protected GButton button;
public XButton() {
super(null);
}
public XButton(XContainer xc) {
super(xc);
}
public String getXmlTag() {
return XML_NAME;
}
protected void parseMoreAttribute(String attName, String attValue) {
super.parseMoreAttribute(attName, attValue);
if (attName.equals("pic")) {
pic = attValue;
} else if (attName.equals("onclick")) {
onClick = XUtil.getField(attValue, 0);
} else if (attName.equals("addon")) {
addon = Integer.parseInt(attValue);
} else if (attName.equals("emoji")) {
emoji = (char) Integer.parseInt(attValue, 16);
}
}
public void parse(KXmlParser parser) throws Exception {
super.parse(parser);
String tmps;
tmps = parser.nextText(); //得到文本
setText(tmps);
toEndTag(parser, getXmlTag());
}
@Override
public void action(GObject gobj) {
if (onClick != null) {
Interpreter inp = getRoot().getInp();
// 执行脚本
if (inp != null) {
inp.putGlobalVar("cmd", new Str(cmd));
inp.callSub(onClick);
}
}
getRoot().getEventHandler().action(gobj, cmd);
}
//----------------------------------------------------------------------------
// 内部方法
//----------------------------------------------------------------------------
protected int getDefaultWidth(int parentViewW) {
int w = XUtil.measureWidth(parentViewW, text, fontSize);
w += addon;
return w;
}
protected int getDefaultHeight(int parentViewH) {
return XDef.DEFAULT_COMPONENT_HEIGHT;
}
protected void createGui() {
if (button == null) {
button = new GButton(text, x, y, width, height);
button.setName(name);
button.setXmlAgent(this);
button.setActionListener(this);
if (color != null) {
button.setColor(color);
}
if (bgColor != null) {
button.setBgColor(bgColor);
}
button.setIcon(emoji);
} else {
button.setLocation(x, y);
button.setSize(width, height);
}
}
public GObject getGui() {
return button;
}
}
| [
"digitalgust@163.com"
] | digitalgust@163.com |
ce4c28e7ab290b4077bce93a8c610e8992c659c8 | 2dc7c0743b4b165710d2bce24860be69463a1ce9 | /day20/src/com/igeek/Demo03.java | 63590080d9fa1b4c3386d41857021e4bd95bf0e6 | [] | no_license | c-0123/thngc | 66ba8fd2d156be8953deba20e818c30ee3499161 | ea136f5924674225c7b39c646c998e66ac82c9a5 | refs/heads/master | 2020-09-19T22:40:02.372832 | 2019-11-26T09:19:34 | 2019-11-26T09:19:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 956 | java | package com.igeek;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import com.igeek.utils.JdbcUtils;
/**
* @author zx
* @version 1.0
* @description:模拟用户登录
*/
public class Demo03 {
public static void main(String[] args) {
String username = "jacky";
String password = "123";
Connection conn = null;
Statement st = null;
ResultSet rs = null;
try {
conn = JdbcUtils.getConnection();
st = conn.createStatement();
//非法的sql注入
String sql = "select * from user where "
+ "username='"+username+"' and password='"+password+"' or 'a'='a' ";
System.out.println(sql);
rs = st.executeQuery(sql);
if(rs.next()) {
System.out.println("登录成功!");
}else {
System.out.println("登录失败");
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
JdbcUtils.close(rs, st, conn);
}
}
}
| [
"875494325@qq.com"
] | 875494325@qq.com |
dcfdb1762bbbc4b5d3851f144304a8ad00519e7e | 6b34e9f52ebd095dc190ee9e89bcb5c95228aed6 | /l2gw-scripts/highfive/data/scripts/ai/RndTeleportFighter.java | 500cee89b6d78a7f7cb957eb73a2bd0924ac6c22 | [] | no_license | tablichka/play4 | 86c057ececdb81f24fc493c7557b7dbb7260218d | b0c7d142ab162b7b37fe79d203e153fcf440a8a6 | refs/heads/master | 2022-04-25T17:04:32.244384 | 2020-04-27T12:59:45 | 2020-04-27T12:59:45 | 259,319,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,987 | java | package ai;
import ru.l2gw.gameserver.Config;
import ru.l2gw.gameserver.controllers.ThreadPoolManager;
import ru.l2gw.gameserver.ai.Fighter;
import ru.l2gw.gameserver.geodata.GeoEngine;
import ru.l2gw.gameserver.model.L2Character;
import ru.l2gw.gameserver.model.L2Spawn;
import ru.l2gw.gameserver.serverpackets.MagicSkillUse;
import ru.l2gw.gameserver.tables.TerritoryTable;
import ru.l2gw.util.Location;
import ru.l2gw.commons.math.Rnd;
/**
* Моб использует телепортацию вместо рандом валка.
*
* @author SYS
*/
public class RndTeleportFighter extends Fighter
{
private long _lastTeleport;
public RndTeleportFighter(L2Character actor)
{
super(actor);
}
@Override
protected boolean maybeMoveToHome()
{
if(System.currentTimeMillis() - _lastTeleport < 10000)
return false;
boolean randomWalk = _actor.hasRandomWalk();
if(_thisActor.getSpawnedLoc() == null)
return false;
// Random walk or not?
if(randomWalk && (!Config.RND_WALK || Rnd.chance(Config.RND_WALK_RATE)))
return false;
if(!randomWalk && _thisActor.isInRangeZ(_thisActor.getSpawnedLoc(), Config.MAX_DRIFT_RANGE))
return false;
int x = _thisActor.getSpawnedLoc().getX() + Rnd.get(-Config.MAX_DRIFT_RANGE, Config.MAX_DRIFT_RANGE);
int y = _thisActor.getSpawnedLoc().getY() + Rnd.get(-Config.MAX_DRIFT_RANGE, Config.MAX_DRIFT_RANGE);
int z = GeoEngine.getHeight(x, y, _thisActor.getSpawnedLoc().getZ(), _thisActor.getReflection());
L2Spawn spawn = _thisActor.getSpawn();
if(spawn != null && spawn.getLocation() != 0 && !TerritoryTable.getInstance().getLocation(spawn.getLocation()).isInside(x, y))
return false;
_thisActor.broadcastPacketToOthers(new MagicSkillUse(_thisActor, _thisActor, 4671, 1, 500, 0));
ThreadPoolManager.getInstance().scheduleAi(new Teleport(new Location(x, y, z)), 500, false);
_lastTeleport = System.currentTimeMillis();
return true;
}
} | [
"ubuntu235@gmail.com"
] | ubuntu235@gmail.com |
960b8d6ce186356a829c7f46fd457dac3b1cfb6e | 8760bd46871353cc8e5107edfaf8bfdde89d1a93 | /gmall-ums/src/main/java/com/atguigu/gmall/ums/controller/UserController.java | 035f8d35f846fda439645e0c049fe323541a5f0b | [
"Apache-2.0"
] | permissive | joedyli/gmall-0420 | e5563b67e7129888af9b985f2f15817350094720 | 41df0e34eeffc983bfafa592354b3f88e755e0c5 | refs/heads/master | 2022-12-31T18:10:03.906389 | 2020-10-21T07:45:25 | 2020-10-21T07:45:25 | 297,203,126 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,075 | java | package com.atguigu.gmall.ums.controller;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.atguigu.gmall.ums.entity.UserEntity;
import com.atguigu.gmall.ums.service.UserService;
import com.atguigu.gmall.common.bean.PageResultVo;
import com.atguigu.gmall.common.bean.ResponseVo;
import com.atguigu.gmall.common.bean.PageParamVo;
/**
* 用户表
*
* @author fengge
* @email fengge@atguigu.com
* @date 2020-10-13 14:06:30
*/
@Api(tags = "用户表 管理")
@RestController
@RequestMapping("ums/user")
public class UserController {
@Autowired
private UserService userService;
@GetMapping("query")
public ResponseVo<UserEntity> queryUser(@RequestParam("loginName")String loginName, @RequestParam("password")String password){
UserEntity userEntity = this.userService.queryUser(loginName, password);
return ResponseVo.ok(userEntity);
}
@PostMapping("register")
public ResponseVo<Object> register(UserEntity userEntity, @RequestParam("code")String code){
this.userService.register(userEntity, code);
return ResponseVo.ok();
}
@GetMapping("check/{data}/{type}")
public ResponseVo<Boolean> chechData(@PathVariable("data")String data, @PathVariable("type") Integer type){
Boolean b = this.userService.checkData(data, type);
return ResponseVo.ok(b);
}
/**
* 列表
*/
@GetMapping
@ApiOperation("分页查询")
public ResponseVo<PageResultVo> queryUserByPage(PageParamVo paramVo){
PageResultVo pageResultVo = userService.queryPage(paramVo);
return ResponseVo.ok(pageResultVo);
}
/**
* 信息
*/
@GetMapping("{id}")
@ApiOperation("详情查询")
public ResponseVo<UserEntity> queryUserById(@PathVariable("id") Long id){
UserEntity user = userService.getById(id);
return ResponseVo.ok(user);
}
/**
* 保存
*/
@PostMapping
@ApiOperation("保存")
public ResponseVo<Object> save(@RequestBody UserEntity user){
userService.save(user);
return ResponseVo.ok();
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperation("修改")
public ResponseVo update(@RequestBody UserEntity user){
userService.updateById(user);
return ResponseVo.ok();
}
/**
* 删除
*/
@PostMapping("/delete")
@ApiOperation("删除")
public ResponseVo delete(@RequestBody List<Long> ids){
userService.removeByIds(ids);
return ResponseVo.ok();
}
}
| [
"joedy23@aliyun.com"
] | joedy23@aliyun.com |
113b288ee433045ee617e272c85f1fd978c49479 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_35ec290caae01643f87b2557ff62011a97601bc9/ReversiManager/17_35ec290caae01643f87b2557ff62011a97601bc9_ReversiManager_t.java | ca77bfe74a820dc6cf612356454c2557fbcaeb26 | [] | 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 | 5,849 | java | //
// $Id: SampleManager.java,v 1.21 2004/08/27 18:51:26 mdb Exp $
package com.samskivert.reversi;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.parlor.game.server.GameManager;
import com.threerings.parlor.turn.server.TurnGameManager;
import com.threerings.parlor.turn.server.TurnGameManagerDelegate;
import com.threerings.toybox.data.ToyBoxGameConfig;
/**
* Handles the server side of the game.
*/
public class ReversiManager extends GameManager
implements TurnGameManager
{
public ReversiManager ()
{
// we're a turn based game, so we use a turn game manager delegate
addDelegate(_turndel = new TurnGameManagerDelegate() {
protected void setNextTurnHolder () {
_logic.setState(_gameobj.pieces);
_turnIdx = _logic.getNextTurnHolderIndex(_turnIdx);
}
});
}
/**
* Called when a client sends a request to place a piece on the board.
*/
public void placePiece (BodyObject player, ReversiObject.Piece piece)
{
// update our logic with the current state of the board
_logic.setState(_gameobj.pieces);
// make sure it's this player's turn
int pidx = _turndel.getTurnHolderIndex();
if (_playerOids[pidx] != player.getOid()) {
System.err.println("Requested to place piece by non-turn holder " +
"[who=" + player.who() +
", turnHolder=" + _gameobj.turnHolder + "].");
// make sure this is a legal move
} else if (_logic.isLegalMove(piece)) {
// place this piece on the board
_gameobj.placePiece(piece);
// have our logic figure out which pieces need flipping
_logic.flipPieces(piece, _gameobj);
// and finally end the turn
_turndel.endTurn();
} else {
System.err.println("Received illegal move request " +
"[who=" + player.who() +
", piece=" + piece + "].");
}
}
// from interface TurnGameManager
public void turnWillStart ()
{
// nothing to do here
}
// from interface TurnGameManager
public void turnDidStart ()
{
// nothing to do here
}
// from interface TurnGameManager
public void turnDidEnd ()
{
// if neither player has legal moves, the game is over
_logic.setState(_gameobj.pieces);
if (!_logic.hasLegalMoves(ReversiObject.BLACK) &&
!_logic.hasLegalMoves(ReversiObject.WHITE)) {
endGame();
}
}
@Override // from PlaceManager
public void didInit ()
{
super.didInit();
// get a casted reference to our game configuration
_gameconf = (ToyBoxGameConfig)_config;
// create our game logic instance
_logic = new ReversiLogic(8); // TODO: get board size from config
}
@Override // from PlaceManager
public void didStartup ()
{
super.didStartup();
// grab our own casted game object reference
_gameobj = (ReversiObject)super._gameobj;
// this method is called after we have created our game object but
// before we do any game related things
}
@Override // from PlaceManager
public void didShutdown ()
{
super.didShutdown();
// this is called right before we finally disappear for good
}
@Override // from PlaceManager
protected PlaceObject createPlaceObject ()
{
return new ReversiObject();
}
@Override // from GameManager
protected void gameWillStart ()
{
super.gameWillStart();
// start the game with the standard arrangement of pieces
for (int ii = 0; ii < STARTERS.length; ii += 3) {
ReversiObject.Piece piece = new ReversiObject.Piece();
piece.x = STARTERS[ii];
piece.y = STARTERS[ii+1];
piece.owner = STARTERS[ii+2];
_gameobj.placePiece(piece);
}
}
@Override // from GameManager
protected void gameDidEnd ()
{
super.gameDidEnd();
// this is called after the game has ended. somewhere in the game
// manager a call to endGame() should be made when the manager knows
// the game to be over and that will trigger the end-of-game processing
// including calling this method
}
@Override // from GameManager
protected void assignWinners (boolean[] winners)
{
super.assignWinners(winners);
// count up the number of black and white pieces
int[] counts = new int[2];
for (ReversiObject.Piece piece : _gameobj.pieces) {
counts[piece.owner]++;
}
// now set a boolean indicating which player is the winner (note that
// if it is a tie, we want to set both values to true)
winners[0] = (counts[0] >= counts[1]);
winners[1] = (counts[1] >= counts[0]);
}
/** Our game object. */
protected ReversiObject _gameobj;
/** Used to determine legality of moves, etc. */
protected ReversiLogic _logic;
/** Our game configuration. */
protected ToyBoxGameConfig _gameconf;
/** Handles our turn based game flow. */
protected TurnGameManagerDelegate _turndel;
/** The starting set of pieces. */
protected static final int[] STARTERS = {
3, 3, ReversiObject.BLACK,
3, 4, ReversiObject.WHITE,
4, 4, ReversiObject.BLACK,
4, 3, ReversiObject.WHITE,
};
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
654fc888e91f836696403d1d2142584fd1ca3c02 | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/dbeaver/2015/4/QueryTransformerFetchAll.java | 078edb4d84a3cc437fd3c94186e8249a21483aec | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 1,892 | java | /*
* Copyright (C) 2010-2015 Serge Rieder
* serge@jkiss.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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 library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.jkiss.dbeaver.ext.mysql.model;
import org.jkiss.dbeaver.model.exec.DBCException;
import org.jkiss.dbeaver.model.exec.DBCQueryTransformer;
import org.jkiss.dbeaver.model.exec.DBCStatement;
import org.jkiss.dbeaver.model.sql.SQLQuery;
import java.sql.SQLException;
import java.sql.Statement;
/**
* Query transformer for fetch-all selects
*/
class QueryTransformerFetchAll implements DBCQueryTransformer {
@Override
public void setParameters(Object... parameters)
{
}
@Override
public String transformQueryString(SQLQuery query) throws DBCException {
return query.getQuery();
}
@Override
public void transformStatement(DBCStatement statement, int parameterIndex) throws DBCException {
// Set fetch size to Integer.MIN_VALUE to enable result set streaming
try {
((Statement)statement).setFetchSize(Integer.MIN_VALUE);
} catch (SQLException e) {
throw new DBCException(e, statement.getSession().getDataSource());
}
}
} | [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
aaf7d0bdc5eef5ea7201b76617bdc9a4e39de1b4 | fa423b4cab3b5d508da0398947b726ef857240a4 | /src/main/java/com/qh/config/KickoutSessionControlFilter.java | 6b94388c543fa32dbc17a85422670569e2f85468 | [] | no_license | qh870754310/flowwork | 036f916f55e05cb649976326d9990615b6deb499 | 906dd5049784d2fcebd274f6ef5641f3f3cdcbb9 | refs/heads/master | 2020-04-24T01:40:14.532774 | 2019-02-20T05:33:14 | 2019-02-20T05:33:14 | 171,607,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,481 | java | package com.qh.config;
import com.alibaba.fastjson.JSON;
import com.qh.modules.sys.entity.UserEntity;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.DefaultSessionKey;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.AccessControlFilter;
import org.apache.shiro.web.util.WebUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.util.Deque;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
/**
* 自定义过滤器,进行用户访问控制
* 登陆成功时将用户保存到了shiro提供的session中,并同时添加到ehcache缓存中;
* KickoutSessionControlFilter拿到了session之后先判断能不能通过缓存取到值,如果取得到再和服务器端session进行匹配(用户的名字(每个用户的名字必须不同));
* 如果匹配,系统会为新登录的用户新建一个session;之前的session确认失效并踢出,老用户就无法继续操作而被迫下线;
*
* Created by Administrator on 2018/8/6.
*/
public class KickoutSessionControlFilter extends AccessControlFilter {
private static final Logger logger = LoggerFactory
.getLogger(KickoutSessionControlFilter.class);
private String kickoutUrl; //踢出后到的地址
private boolean kickoutAfter = false; //踢出之前登录的/之后登录的用户 默认踢出之前登录的用户
private int maxSession = 1; //同一个帐号最大会话数 默认1
private SessionManager sessionManager;
private Cache<String, Deque<Serializable>> cache;
public void setKickoutUrl(String kickoutUrl) {
this.kickoutUrl = kickoutUrl;
}
public void setKickoutAfter(boolean kickoutAfter) {
this.kickoutAfter = kickoutAfter;
}
public void setMaxSession(int maxSession) {
this.maxSession = maxSession;
}
public void setSessionManager(SessionManager sessionManager) {
this.sessionManager = sessionManager;
}
//设置Cache的key的前缀
public void setCacheManager(CacheManager cacheManager) {
//必须和ehcache缓存配置中的缓存name一致shiro-activeSessionCache
this.cache = cacheManager.getCache("shiro-activeSessionCache");
}
/**
* 表示是否允许访问;mappedValue就是[urls]配置中拦截器参数部分,如果允许访问返回true,否则false;
* @param request
* @param response
* @param mappedValue
* @return
* @throws Exception
*/
@Override
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
return false;
}
/**
* 表示当访问拒绝时是否已经处理了;如果返回true表示需要继续处理;如果返回false表示该拦截器实例已经处理了,将直接返回即可。
* @param request
* @param response
* @return
* @throws Exception
*/
@Override
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
Subject subject = getSubject(request, response);
// 没有登录授权 且没有记住我
if(!subject.isAuthenticated() && !subject.isRemembered()) {
//如果没有登录,直接进行之后的流程
return true;
}
Session session = subject.getSession();
// 当前用户
//这里获取的User是实体 因为我在 自定义MyRealm中的doGetAuthenticationInfo方法中
//new SimpleAuthenticationInfo(user, password, getName()); 传的是 User实体 所以这里拿到的也是实体,如果传的是userName 这里拿到的就是userName
UserEntity user = (UserEntity) subject.getPrincipal();
String username = user.getUserName();
Serializable sessionId = session.getId();
//读取缓存 没有就存入
Deque<Serializable> deque = cache.get(username);
//如果此用户没有session队列,也就是还没有登录过,缓存中没有
//就new一个空队列,不然deque对象为空,会报空指针
if(deque==null){
// 初始化队列
deque = new LinkedList<Serializable>();
}
//如果队列里没有此sessionId,且用户没有被踢出;放入队列
if(!deque.contains(sessionId) && session.getAttribute("kickout") == null) {
//将sessionId存入队列
deque.push(sessionId);
//将用户的sessionId队列缓存
cache.put(username, deque);
}
//如果队列里的sessionId数超出最大会话数,开始踢人
while(deque.size() > maxSession) {
Serializable kickoutSessionId = null;
if(kickoutAfter) { //如果踢出后者
kickoutSessionId = deque.removeFirst();
//踢出后再更新下缓存队列
cache.put(username, deque);
} else { //否则踢出前者
kickoutSessionId = deque.removeLast();
//踢出后再更新下缓存队列
cache.put(username, deque);
}
try {
//获取被踢出的sessionId的session对象
Session kickoutSession = sessionManager.getSession(new DefaultSessionKey(kickoutSessionId));
if(kickoutSession != null) {
//设置会话的kickout属性表示踢出了
kickoutSession.setAttribute("kickout", true);
}
} catch (Exception e) {//ignore exception
}
}
//如果被踢出了,直接退出,重定向到踢出后的地址
if (session.getAttribute("kickout") != null) {
//会话被踢出了
try {
//退出登录
subject.logout();
} catch (Exception e) { //ignore
}
saveRequest(request);
Map<String, String> resultMap = new HashMap<String, String>();
//判断是不是Ajax请求
if ("XMLHttpRequest".equalsIgnoreCase(((HttpServletRequest) request).getHeader("X-Requested-With"))) {
resultMap.put("user_status", "300");
resultMap.put("message", "您已经在其他地方登录,请重新登录!");
//输出json串
out(response, resultMap);
}else{
//重定向
WebUtils.issueRedirect(request, response, kickoutUrl);
}
return false;
}
return true;
}
private void out(ServletResponse response, Map<String, String> resultMap)
throws IOException {
try {
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.println(JSON.toJSONString(resultMap));
out.flush();
out.close();
} catch (Exception e) {
System.err.println("KickoutSessionFilter.class 输出JSON异常,可以忽略。");
}
}
}
| [
"870754310@qq.com"
] | 870754310@qq.com |
3a5b24371b11fab6e3f7e5dc69c19459c1b75a0f | a4b2aa9355b132ca1cb758063202dd4a4f636676 | /ppt_service_user/src/main/java/com/puputuan/generic/permission/shiro/credentials/RetryLimitHashedCredentialsMatcher.java | feed7d58d79da181a2cfdb7f862ad644980882d7 | [] | no_license | zhuobinchan/puputuanWeb_v2.0 | 8bb47482c49b4eb7746fae1be0648b0ede304ca3 | 09ea1ee8c2ad4e411a19e441b02e41e8fc90c380 | refs/heads/master | 2021-01-21T23:04:50.081397 | 2017-06-23T05:46:56 | 2017-06-23T05:46:56 | 95,187,357 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,862 | java | package com.puputuan.generic.permission.shiro.credentials;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.ExcessiveAttemptsException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheManager;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Created by chenzhuobin on 2017/5/22.
*/
public class RetryLimitHashedCredentialsMatcher extends HashedCredentialsMatcher {
private Cache<String, AtomicInteger> passwordRetryCache;
public RetryLimitHashedCredentialsMatcher() {
}
public RetryLimitHashedCredentialsMatcher(CacheManager cacheManager) {
passwordRetryCache = cacheManager.getCache("passwordRetryCache");
}
public void setPasswordRetryCache(Cache<String, AtomicInteger> passwordRetryCache) {
this.passwordRetryCache = passwordRetryCache;
}
@Override
public boolean doCredentialsMatch(AuthenticationToken authcToken, AuthenticationInfo info) {
UsernamePasswordToken token = (UsernamePasswordToken) authcToken;
String username = token.getUsername();
//retry count + 1
AtomicInteger retryCount = passwordRetryCache.get(username);
if(retryCount == null) {
retryCount = new AtomicInteger(0);
passwordRetryCache.put(username, retryCount);
}
if(retryCount.incrementAndGet() > 5) {
//if retry count > 5 throw
throw new ExcessiveAttemptsException();
}
boolean matches = super.doCredentialsMatch(token, info);
if(matches) {
//clear retry count
passwordRetryCache.remove(username);
}
return matches;
}
} | [
"bin1095256592@qq.com"
] | bin1095256592@qq.com |
7df2d3e65972022cc7084305c8cc08ef4dd12d07 | 8a0ec0dde8eae5c97e2ef4293f49519d354f1348 | /servlet/httpServletMapping/src/main/java/jakartaee/examples/servlet/webservlet/WebServletServlet.java | 491d4a2a59dcacc092b3b19d2924abc45995c5f6 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | marcusjpl/jakartaee8-samples | addf37bf10823de277f95fd9320ba363c10cf222 | 27230b48b7ea61f70cb5d38d91fab7286d349b92 | refs/heads/master | 2020-04-02T19:53:43.329041 | 2018-08-23T09:46:21 | 2018-08-23T09:46:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,013 | java | /*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
package jakartaee.examples.servlet.webservlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* A @WebServlet servlet.
*
* @author Manfred Riem (mriem@manorrock.com)
*/
@WebServlet(urlPatterns = "/*")
public class WebServletServlet extends HttpServlet {
/**
* Process GET.
*
* @param request the request.
* @param response the response
* @throws ServletException when a Servlet error occurs.
* @throws IOException when an I/O error occurs.
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter writer = response.getWriter();
HttpServletMapping httpServletMapping = request.getHttpServletMapping();
writer.println("Servlet name: " + httpServletMapping.getServletName());
writer.println("Pattern: " + httpServletMapping.getPattern());
writer.println("Match value: " + httpServletMapping.getMatchValue());
writer.println("Mapping match: " + httpServletMapping.getMappingMatch().toString());
}
}
| [
"mriem@manorrock.com"
] | mriem@manorrock.com |
4b4e51a18648abf489ad48b9e94d41d7b415b9a4 | 1ce518b09521578e26e79a1beef350e7485ced8c | /source/app/src/main/java/com/google/android/gms/games/internal/GamesContract$ImagesColumns.java | 54c59baba9dd1697e83d0fe3980a3c3ba9024bd1 | [] | no_license | yash2710/AndroidStudioProjects | 7180eb25e0f83d3f14db2713cd46cd89e927db20 | e8ba4f5c00664f9084f6154f69f314c374551e51 | refs/heads/master | 2021-01-10T01:15:07.615329 | 2016-04-03T09:19:01 | 2016-04-03T09:19:01 | 55,338,306 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 352 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.google.android.gms.games.internal;
public interface
{
public static final String HR[] = {
"url", "local", "filesize", "download_timestamp"
};
}
| [
"13bce123@nirmauni.ac.in"
] | 13bce123@nirmauni.ac.in |
44f2c9ebfa9fb3132a2706f49aac7472b71660de | 201dac5610e86ae4e5c10b6522d1cd912e70b8aa | /learning/常用类/testDate/src/cn/test/TestDateFormat.java | a263714d3c75604f6016c5f1e87fde7929a092c3 | [] | no_license | lq1990/myJava | e0506e25d562970b1ce93d23adcb514ae8641d06 | 6b8d200633744912dd93a6122d748e4d39d01541 | refs/heads/master | 2023-01-06T20:06:38.010795 | 2020-03-14T15:11:00 | 2020-03-14T15:11:00 | 163,006,968 | 0 | 0 | null | 2023-01-05T00:52:12 | 2018-12-24T16:17:58 | JavaScript | GB18030 | Java | false | false | 816 | java | package cn.test;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* DateFormat 完成 字符串和时间对象 作转化
* @author china
*
*/
public class TestDateFormat {
public static void main(String[] args) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss, "
+ "本年第w周, 本月第W周"); // 设定格式
Date d = new Date(12321314323L);
String s = df.format(d);
System.out.println(s);
System.out.println("##############");
String s2 = "1977-7-7";
DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd"); // 设定格式
try {
Date d2 = df2.parse(s2);
System.out.println(d2);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
| [
"chinalq90@gmail.com"
] | chinalq90@gmail.com |
7877ac4d6c4658b64dc7f2a7cd884696c20434ff | f15889af407de46a94fd05f6226c66182c6085d0 | /mdasupport/trunk/src/main/java/org/witchcraft/model/xmlutils/XStreamSetup.java | 4764be5b1d066fc5076e4b93e8ae934b1fe71bff | [] | no_license | oreon/sfcode-full | 231149f07c5b0b9b77982d26096fc88116759e5b | bea6dba23b7824de871d2b45d2a51036b88d4720 | refs/heads/master | 2021-01-10T06:03:27.674236 | 2015-04-27T10:23:10 | 2015-04-27T10:23:10 | 55,370,912 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | package org.witchcraft.model.xmlutils;
import com.thoughtworks.xstream.XStream;
/** This interface should be implemented by clients of ObjectFromXMLFactory
* @author jsingh
*
*/
public interface XStreamSetup {
public void setupXStream(XStream xstream);
}
| [
"singhj@38423737-2f20-0410-893e-9c0ab9ae497d"
] | singhj@38423737-2f20-0410-893e-9c0ab9ae497d |
f8f75b59893f222acb17032d4d9cb2b218599466 | 71dd5a62896d88ef3d1a8b383d6964408d7d239f | /springstudy/workspace/MVC14_Contact-1/src/main/java/com/koreait/mvc14/dto/ContactDTO.java | 8b23bd137cdda74492fb9ea328af2d1a848f0f81 | [] | no_license | hwangseokjin94/java_web_0224 | 42df3f57b3b50598e2ca8b12d27e20a284670ca7 | 6c9ab05ac743763db8264c42c814b79cada95458 | refs/heads/master | 2022-11-13T08:23:36.271978 | 2020-07-02T08:26:19 | 2020-07-02T08:26:19 | 250,546,467 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,137 | java | package com.koreait.mvc14.dto;
public class ContactDTO {
private int cNo;
private String cName, cPhone, cAddress ,cEmail, cNote;
public ContactDTO() {
// TODO Auto-generated constructor stub
}
public ContactDTO(int cNo, String cName, String cPhone, String cAddress, String cEmail, String cNote) {
super();
this.cNo = cNo;
this.cName = cName;
this.cPhone = cPhone;
this.cAddress = cAddress;
this.cEmail = cEmail;
this.cNote = cNote;
}
public int getcNo() {
return cNo;
}
public void setcNo(int cNo) {
this.cNo = cNo;
}
public String getcName() {
return cName;
}
public void setcName(String cName) {
this.cName = cName;
}
public String getcPhone() {
return cPhone;
}
public void setcPhone(String cPhone) {
this.cPhone = cPhone;
}
public String getcAddress() {
return cAddress;
}
public void setcAddress(String cAddress) {
this.cAddress = cAddress;
}
public String getcEmail() {
return cEmail;
}
public void setcEmail(String cEmail) {
this.cEmail = cEmail;
}
public String getcNote() {
return cNote;
}
public void setcNote(String cNote) {
this.cNote = cNote;
}
}
| [
"vpdnsldk@gmail.com"
] | vpdnsldk@gmail.com |
c29af388946c8e400955a0c9f0068f516199e1eb | cb90c674a9d7c27ebe0c2ad1fd6658150d92fe75 | /app/src/main/java/com/beyond/popscience/locationgoods/view/delrlv/LeftSlideView.java | 3191272456c9dc37f12898738ebcdf4321c82f4f | [
"Apache-2.0"
] | permissive | sunhaiteng2016/iknow-android | b5ad49e8bf14cf3a22b72d9da3c6757a7abc41cf | b1aeec07a70953b776d0c113384b04cef3b36869 | refs/heads/master | 2020-07-16T09:59:34.249095 | 2019-09-02T02:33:43 | 2019-09-02T02:34:14 | 205,760,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,830 | java | package com.beyond.popscience.locationgoods.view.delrlv;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.HorizontalScrollView;
import android.widget.TextView;
import com.beyond.popscience.R;
public class LeftSlideView extends HorizontalScrollView {
private TextView mTextView_Set;//设置按钮
private TextView mTextView_Delete;//删除按钮
private int mScrollWidth;//记录滚动条可以滚动的距离
private Boolean once = false;//在onMeasure中只执行一次的判断
private Boolean isOpen = false;//记录按钮菜单是否打开,默认关闭false
private IonSlidingButtonListener mIonSlidingButtonListener;//自定义的接口,用于传达滑动事件等
/**
* 1.构造方法
*/
public LeftSlideView(Context context) {
super(context, null);
}
public LeftSlideView(Context context, AttributeSet attrs) {
super(context, attrs, 0);
}
public LeftSlideView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
this.setOverScrollMode(OVER_SCROLL_NEVER);
}
//2.在onMeasure中先取得作为“设置”、“删除”按钮的TextView
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (!once) {
mTextView_Delete = (TextView) findViewById(R.id.tv_delete);
mTextView_Set = (TextView) findViewById(R.id.tv_set);
once = true;
}
}
//3.在onLayout中使Item在每次变更布局大小时回到初始位置,并且获取滚动条的可移动距离
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if (changed) {
this.scrollTo(0, 0);
//获取水平滚动条可以滑动的范围,即右侧“设置”、“删除”按钮的总宽度
mScrollWidth = mTextView_Delete.getWidth() + mTextView_Set.getWidth();
}
}
//4.滑动监听,按滑动的距离大小控制菜单开关
@Override
public boolean onTouchEvent(MotionEvent ev) {
int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN://按下
case MotionEvent.ACTION_MOVE://移动
mIonSlidingButtonListener.onDownOrMove(this);
break;
case MotionEvent.ACTION_UP://松开
case MotionEvent.ACTION_CANCEL:
changeScrollx();
return true;
default:
break;
}
return super.onTouchEvent(ev);
}
/**
* 5.
* @param l
* @param t
* @param oldl
* @param oldt
*/
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
//改变view的在x轴方向的位置
mTextView_Set.setTranslationX(1);
}
/**
* 6.按滚动条被拖动距离判断关闭或打开菜单
* getScrollX() view的左上角相对于母视图的左上角的X轴偏移量
* smoothScrollTo(x, y); 参数:相对于ScrollView左上角的位置来说,你要移动的位置
*/
public void changeScrollx() {
if (getScrollX() >= (mScrollWidth / 2)) {
this.smoothScrollTo(mScrollWidth, 0);
isOpen = true;
mIonSlidingButtonListener.onMenuIsOpen(this);
} else {
this.smoothScrollTo(0, 0);
isOpen = false;
}
}
/**
* 7.打开菜单
*/
public void openMenu() {
if (isOpen) {
return;
}
this.smoothScrollTo(mScrollWidth, 0);//相对于原来没有滑动的位置x轴方向偏移了mScrollWidth,y轴方向没有变化。
isOpen = true;
mIonSlidingButtonListener.onMenuIsOpen(this);
}
/**
* 8.关闭菜单
*/
public void closeMenu() {
if (!isOpen) {
return;
}
this.smoothScrollTo(0, 0);//相对于原来没有滑动的位置,x轴方向、y轴方向都没有变化,即回到原来的位置了。
isOpen = false;
}
/**
* 9.接口定义及注册方法
*/
public void setSlidingButtonListener(IonSlidingButtonListener listener) {
mIonSlidingButtonListener = listener;
}
public interface IonSlidingButtonListener {
//该方法在Adapter中实现
void onMenuIsOpen(View view);//判断菜单是否打开
void onDownOrMove(LeftSlideView leftSlideView);//滑动或者点击了Item监听
}
}
| [
"2502410120@qq.com"
] | 2502410120@qq.com |
2861fe97b3390c42f99118d7a5e2182c29803090 | 7e1511cdceeec0c0aad2b9b916431fc39bc71d9b | /flakiness-predicter/input_data/original_tests/wildfly-wildfly/nonFlakyMethods/org.jboss.as.test.smoke.mgmt.resourceadapter.ResourceAdapterOperationsUnitTestCase-addComplexResourceAdapterWithAppSecurity_UserPassRecovery.java | 24990224962600935979d24ecfca1d0f6fbe88d8 | [
"BSD-3-Clause"
] | permissive | Taher-Ghaleb/FlakeFlagger | 6fd7c95d2710632fd093346ce787fd70923a1435 | 45f3d4bc5b790a80daeb4d28ec84f5e46433e060 | refs/heads/main | 2023-07-14T16:57:24.507743 | 2021-08-26T14:50:16 | 2021-08-26T14:50:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 205 | java | @Test public void addComplexResourceAdapterWithAppSecurity_UserPassRecovery() throws Exception {
complexResourceAdapterAddTest(ConnectionSecurityType.APPLICATION,ConnectionSecurityType.USER_PASSWORD);
}
| [
"aalsha2@masonlive.gmu.edu"
] | aalsha2@masonlive.gmu.edu |
51beb616609dad50677da60eb4ddfa9dbd7d5228 | 88c18722a5823d32d06d72bb5066abf2db887f2a | /SourceProject/appendixC_2.5/src/kame/spring/appc/service/WriteCommentService.java | b6a344ea3f542d0444e0ce040c2cfaadc7c05ea9 | [
"Apache-2.0"
] | permissive | grtlinux/Spring2.5Frame | a928b319f17c3b575159ed176b8ea492a0b6f39e | 5e569de70dbdbd541bcdedfffd9bea981703e82a | refs/heads/master | 2020-04-02T09:02:02.576526 | 2018-10-30T07:46:27 | 2018-10-30T07:46:27 | 154,272,339 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 165 | java | package kame.spring.appc.service;
import kame.spring.appc.model.Comment;
public interface WriteCommentService {
public Comment write(Comment comment);
}
| [
"grtlinux@gmail.com"
] | grtlinux@gmail.com |
79364104f402ab1c5b05bcf41b8f1eb79a5f772c | 414cc8d28b6a7fb74047aa05ef9f81f839d32e4c | /src/com/jagex/Class536_Sub8_Sub1.java | 540524d5b25716f5e8dd1bd6a58cc4d883069fa4 | [] | no_license | titandino/876-Deobfuscated | 3d71fade77595cdbbacca9238ec15ed57ceee92b | bb546e9a28d77f9d93214386c72b64c9fae29d18 | refs/heads/master | 2021-01-12T07:42:29.043949 | 2017-01-27T03:23:54 | 2017-01-27T03:23:54 | 76,999,846 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,841 | java | /* Class536_Sub8_Sub1 - Decompiled by JODE
* Visit http://jode.sourceforge.net/
*/
package com.jagex;
public abstract class Class536_Sub8_Sub1 extends Class536_Sub8 {
Class273 aClass273_11628;
String aString11629;
String aString11630;
int anInt11631;
Class273 aClass273_11632;
public abstract boolean method10640(int i);
public String toString() {
String string = new StringBuilder().append(aClass273_11628.toString()).append(" ").append(aString11629).toString();
if (null != aString11630 && !"".equals(aString11630))
string = new StringBuilder().append(string).append(" : ").append(aString11630).toString();
return string;
}
String method10641(int i) {
return aString11629;
}
public Class273 method10642(byte i) {
return aClass273_11628;
}
public String method10643() {
String string = new StringBuilder().append(aClass273_11628.toString()).append(" ").append(aString11629).toString();
if (null != aString11630 && !"".equals(aString11630))
string = new StringBuilder().append(string).append(" : ").append(aString11630).toString();
return string;
}
public int method10644(int i) {
if (aClass273_11628 != Class273.aClass273_2893)
throw new IllegalArgumentException_Sub1(this, aClass273_11628.toString().toLowerCase());
return -896897157 * anInt11631;
}
public abstract boolean method10645(int i);
public abstract boolean method10646(int i);
public abstract int method10647(int i);
public abstract boolean method10648(int i);
public Class273 method10649(int i) {
return aClass273_11632;
}
public abstract boolean method10650(int i);
Class536_Sub8_Sub1(Class265 class265) {
aClass273_11628 = class265.aClass273_2863;
aString11629 = class265.aString2862;
aString11630 = class265.aString2860;
anInt11631 = -976354079 * class265.anInt2861;
aClass273_11632 = class265.aClass273_2864;
}
public String method10651() {
String string = new StringBuilder().append(aClass273_11628.toString()).append(" ").append(aString11629).toString();
if (null != aString11630 && !"".equals(aString11630))
string = new StringBuilder().append(string).append(" : ").append(aString11630).toString();
return string;
}
public String method10652() {
String string = new StringBuilder().append(aClass273_11628.toString()).append(" ").append(aString11629).toString();
if (null != aString11630 && !"".equals(aString11630))
string = new StringBuilder().append(string).append(" : ").append(aString11630).toString();
return string;
}
public abstract int method10653(int i);
public int method10654() {
if (aClass273_11628 != Class273.aClass273_2893)
throw new IllegalArgumentException_Sub1(this, aClass273_11628.toString().toLowerCase());
return -896897157 * anInt11631;
}
public abstract boolean method10655(int i);
public abstract int method10656(int i);
}
| [
"trenton.kress@gmail.com"
] | trenton.kress@gmail.com |
56555f4ad5f6c5dc3bdd44b0511dbe5dd8e20bd9 | 2e77f0c5d3c0e31bbe4da3e3d8335872a71ef2ad | /es-common/src/main/java/xyz/wongs/es/common/utils/SystemPath.java | 0c54acc832924cb082239e588a76643097302f62 | [] | no_license | porscheYong/nm-es | f79c1f02d49df230ffa2f655ee25d7b05b850e2b | d59fb6cd9d103fcdca709ac908f2ceaf68b32d53 | refs/heads/master | 2020-05-23T22:40:41.055287 | 2019-04-29T01:28:58 | 2019-04-29T01:28:58 | 186,977,194 | 1 | 0 | null | 2019-05-16T07:39:56 | 2019-05-16T07:39:56 | null | UTF-8 | Java | false | false | 1,385 | java | /**
* Copyright © 2012-2016 <a href="https://wongs.xyz">UECC</a> All rights reserved.
*/
package xyz.wongs.es.common.utils;
/**
* @author wanye
* @date Dec 14, 2008
* @version v 1.0
* @description 得到当前应用的系统路径
*/
public class SystemPath {
public static String getSysPath() {
String path = Thread.currentThread().getContextClassLoader()
.getResource("").toString();
String temp = path.replaceFirst("file:/", "").replaceFirst(
"WEB-INF/classes/", "");
String separator = System.getProperty("file.separator");
String resultPath = temp.replaceAll("/", separator + separator);
return resultPath;
}
public static String getClassPath() {
String path = Thread.currentThread().getContextClassLoader()
.getResource("").toString();
String temp = path.replaceFirst("file:/", "");
String separator = System.getProperty("file.separator");
String resultPath = temp.replaceAll("/", separator + separator);
return resultPath;
}
public static String getSystempPath() {
return System.getProperty("java.io.tmpdir");
}
public static String getSeparator() {
return System.getProperty("file.separator");
}
public static void main(String[] args) {
System.out.println(getSysPath());
System.out.println(System.getProperty("java.io.tmpdir"));
System.out.println(getSeparator());
System.out.println(getClassPath());
}
}
| [
"WCNGS@QQ.COM"
] | WCNGS@QQ.COM |
eddc3b8ca56678893092a3e8568ad35686f36660 | 3c4937245a4a83c7d92b4fcbc5a9382f16133690 | /src/main/java/com/cybercom/fruitstore/domain/Authority.java | d315ae362b79ddac43ea19762da16f60bf84b7f3 | [] | no_license | akrammol/fruitstore | ec7195c9e92524a2d24df4b0e7d3c5b6e0f792c3 | 1bdb126648db453eecde246fda5747b7a51edf59 | refs/heads/master | 2022-12-21T02:24:44.792715 | 2019-08-24T08:52:13 | 2019-08-24T08:52:13 | 204,120,707 | 0 | 0 | null | 2022-12-16T05:03:07 | 2019-08-24T06:52:28 | Java | UTF-8 | Java | false | false | 1,223 | java | package com.cybercom.fruitstore.domain;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Objects;
/**
* An authority (a security role) used by Spring Security.
*/
@Entity
@Table(name = "jhi_authority")
public class Authority implements Serializable {
private static final long serialVersionUID = 1L;
@NotNull
@Size(max = 50)
@Id
@Column(length = 50)
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof Authority)) {
return false;
}
return Objects.equals(name, ((Authority) o).name);
}
@Override
public int hashCode() {
return Objects.hashCode(name);
}
@Override
public String toString() {
return "Authority{" +
"name='" + name + '\'' +
"}";
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
3350d8d095a0fab5e06a2fdfd2181334ef9d9043 | f0cdf98c1332634fdac66764779f3e722349cd02 | /library/core/src/main/java/com/upax/exoplayer2/source/BundledExtractorsAdapter.java | 27d82d0c3adc38c214b14a15450bd3eb88359d41 | [
"Apache-2.0"
] | permissive | UlaiS/exoplayer2 | acc8a565b4f2c379fe129c561786371b5078105c | 73ea2e4283b753d081da603dbcd6b8079aeb0935 | refs/heads/main | 2022-07-29T19:57:50.987503 | 2021-11-23T23:52:06 | 2021-11-23T23:52:06 | 431,241,943 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,227 | java | /*
* Copyright (C) 2020 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.upax.exoplayer2.source;
import android.net.Uri;
import androidx.annotation.Nullable;
import com.upax.exoplayer2.C;
import com.upax.exoplayer2.extractor.DefaultExtractorInput;
import com.upax.exoplayer2.extractor.Extractor;
import com.upax.exoplayer2.extractor.ExtractorInput;
import com.upax.exoplayer2.extractor.ExtractorOutput;
import com.upax.exoplayer2.extractor.ExtractorsFactory;
import com.upax.exoplayer2.extractor.PositionHolder;
import com.upax.exoplayer2.extractor.mp3.Mp3Extractor;
import com.upax.exoplayer2.upstream.DataReader;
import com.upax.exoplayer2.util.Assertions;
import com.upax.exoplayer2.util.Util;
import java.io.EOFException;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* {@link ProgressiveMediaExtractor} built on top of {@link Extractor} instances, whose
* implementation classes are bundled in the app.
*/
public final class BundledExtractorsAdapter implements ProgressiveMediaExtractor {
private final ExtractorsFactory extractorsFactory;
@Nullable private Extractor extractor;
@Nullable private ExtractorInput extractorInput;
/**
* Creates a holder that will select an extractor and initialize it using the specified output.
*
* @param extractorsFactory The {@link ExtractorsFactory} providing the extractors to choose from.
*/
public BundledExtractorsAdapter(ExtractorsFactory extractorsFactory) {
this.extractorsFactory = extractorsFactory;
}
@Override
public void init(
DataReader dataReader,
Uri uri,
Map<String, List<String>> responseHeaders,
long position,
long length,
ExtractorOutput output)
throws IOException {
ExtractorInput extractorInput = new DefaultExtractorInput(dataReader, position, length);
this.extractorInput = extractorInput;
if (extractor != null) {
return;
}
Extractor[] extractors = extractorsFactory.createExtractors(uri, responseHeaders);
if (extractors.length == 1) {
this.extractor = extractors[0];
} else {
for (Extractor extractor : extractors) {
try {
if (extractor.sniff(extractorInput)) {
this.extractor = extractor;
break;
}
} catch (EOFException e) {
// Do nothing.
} finally {
Assertions.checkState(this.extractor != null || extractorInput.getPosition() == position);
extractorInput.resetPeekPosition();
}
}
if (extractor == null) {
throw new UnrecognizedInputFormatException(
"None of the available extractors ("
+ Util.getCommaDelimitedSimpleClassNames(extractors)
+ ") could read the stream.",
Assertions.checkNotNull(uri));
}
}
extractor.init(output);
}
@Override
public void release() {
if (extractor != null) {
extractor.release();
extractor = null;
}
extractorInput = null;
}
@Override
public void disableSeekingOnMp3Streams() {
if (extractor instanceof Mp3Extractor) {
((Mp3Extractor) extractor).disableSeeking();
}
}
@Override
public long getCurrentInputPosition() {
return extractorInput != null ? extractorInput.getPosition() : C.POSITION_UNSET;
}
@Override
public void seek(long position, long seekTimeUs) {
Assertions.checkNotNull(extractor).seek(position, seekTimeUs);
}
@Override
public int read(PositionHolder positionHolder) throws IOException {
return Assertions.checkNotNull(extractor)
.read(Assertions.checkNotNull(extractorInput), positionHolder);
}
}
| [
"ulainava@gmail.com"
] | ulainava@gmail.com |
a7c4d602d73e1f860cb76b70c91d243ad1c35cbf | 5cbf4138376176de876422ec4799d46495670c78 | /src/com/ibm/iwt/window/IContentPane.java | c8f3a1b07c1676cccd307c75ad91c09129645340 | [] | no_license | djqualia/RapidEvolution2 | 19ea5062b0febb3311e29dcde1439aac4e9a6490 | c62a5c2671af4216a63496418c4c7ce229aca8db | refs/heads/master | 2020-04-14T18:57:18.052775 | 2013-11-20T04:39:45 | 2013-11-20T04:39:45 | 13,853,181 | 2 | 4 | null | 2013-11-06T17:36:31 | 2013-10-25T06:28:41 | Java | UTF-8 | Java | false | false | 7,693 | java |
package com.ibm.iwt.window;
import java.awt.Cursor;
import java.awt.Insets;
import java.awt.event.MouseEvent;
import com.ibm.iwt.event.WindowChangeEvent;
import com.ibm.iwt.util.IWTUtilities;
/**
* The IContentPane adds to the functionality of a normal content pane
* by handling mouse events. The mouse events are relayed
* from the parent window's rootpane and it is up to the IContentPane
* to handle the mouse events itself.
* <p>Like the content pane, all components should be added to the IContentPane and
* it has a default BorderLayout.
* <p>For default application windows, the IContentPane handles all mouse events
* based on a rectangular application window.
* <p>For more complex application windows
* that are not rectangular but still maintain
* a mostly rectangular shape and will not need
* to change Cursor types, they should subclass IContentPane and override the
* <code>isMouseOnBorder</code> function.
* <p>For extremely complex application window shapes that require different cursors
* than would be provided by the default implementation, the <code>isMouseOnBorder</code>
* as well as the <code>handleDirections</code> functions should be overridden in the
* subclass.
* @author MAbernethy
*/
public class IContentPane extends IBorderComponent
{
/** the border around the content pane */
protected Insets borderSize = new Insets(3,3,3,3);
private int direction;
/**
* Returns the border size around the content pane in pixels.
* @return the border size
*/
public Insets getBorderSize()
{
return borderSize;
}
/**
* Returns the insets that are used by the IContentPane to draw the border. This
* prevents the IContentPane from painting over the border with its children.
* @return the insets where the border is drawn
*/
public Insets getInsets()
{
return borderSize;
}
/**
* Based on the coordinates contained in the MouseEvent, computes whether
* the mouse is over the border and draw the appropriate cursor. It also
* determines the direction which is used for window resizing events.
* @param e the MouseEvent from the window's rootpane
* @param changeDirection if the direction should change
*/
protected void handleDirections(MouseEvent e, boolean changeDirection)
{
// left border
if (e.getX() < borderSize.left && e.getY() < IWTUtilities.DIAGONAL_RESIZE_SIZE)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_NORTH_WEST;
setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
}
else if (e.getX() < borderSize.left && e.getY() > getHeight()-IWTUtilities.DIAGONAL_RESIZE_SIZE)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_SOUTH_WEST;
setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
}
else if (e.getX() < borderSize.left)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_WEST;
setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
}
// bottom border
if (e.getY() > getHeight()-borderSize.bottom && e.getX() < IWTUtilities.DIAGONAL_RESIZE_SIZE)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_SOUTH_WEST;
setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
}
else if (e.getY() > getHeight()-borderSize.bottom && e.getX() > getWidth()-IWTUtilities.DIAGONAL_RESIZE_SIZE)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_SOUTH_EAST;
setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
}
else if (e.getY() > getHeight()-borderSize.bottom)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_SOUTH;
setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
}
// right border
if (e.getX() > getWidth()-borderSize.right && e.getY() > getHeight()-IWTUtilities.DIAGONAL_RESIZE_SIZE)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_SOUTH_EAST;
setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
}
else if (e.getX() > getWidth()-borderSize.right && e.getY() < IWTUtilities.DIAGONAL_RESIZE_SIZE)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_NORTH_EAST;
setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
}
else if (e.getX() > getWidth()-borderSize.right)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_EAST;
setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
}
if (e.getX() > borderSize.left && e.getX() < getWidth()-borderSize.right &&
e.getY() > borderSize.top && e.getY() < getHeight()-borderSize.bottom)
{
if (changeDirection)
direction = WindowChangeEvent.RESIZE_NONE;
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
}
/**
* Returns whether the coordinates are on a border of the icontent pane. By
* default, this returns true if the coordinates are within the border size
* defined by <code>borderSize</code> and is a rectangular shape.
* <br>More advanced subclasses will override this method to return true
* only when the coordinates lie on a border.
* @param x the x coordinates
* @param y the y coordinates
*/
protected void isMouseOnBorder(int x, int y)
{
if (y > getHeight() - borderSize.bottom)
isMouseOnBorder = true;
else if (x < borderSize.left)
isMouseOnBorder = true;
else if (x > getWidth() - borderSize.right)
isMouseOnBorder = true;
else
isMouseOnBorder = false;
}
/**
* Does nothing.
* @param the MouseEvent from the window's rootpane
*/
public void mouseClicked(MouseEvent e){ }
/**
* After computing the appropriate coordinates, it tells any listeners
* that the window should be resized.
* @param e the MouseEvent from the window's rootpane
*/
public void mouseDragged(MouseEvent e)
{
if (isWindowMaximized() || !isMouseOnBorder)
return;
WindowChangeEvent event = new WindowChangeEvent(this, e.getX(), e.getY(), e.getX()-X, e.getY()-Y, direction, true);
fireWindowChangeEvent(WindowChangeEvent.WINDOW_RESIZED, event);
}
/**
* Computes the coordinates where the mouse enters. Only changes the cursor.
* @param e the MouseEvent from the window's rootpane
*/
public void mouseEntered(MouseEvent e)
{
if (isWindowMaximized())
return;
handleDirections(e, false);
}
/**
* Computes the coordinates where the mouse exits. Changes the cursor back
* to the default cursor.
* @param e the MouseEvent from the window's rootpane
*/
public void mouseExited(MouseEvent e)
{
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
/**
* Computes the coordinates where the mouse moves. Only changes the cursor.
* @param e the MouseEvent from the window's rootpane
*/
public void mouseMoved(MouseEvent e)
{
if (isWindowMaximized())
return;
handleDirections(e, false);
}
/**
* Computes the coordinates where the mouse is first pressed. Uses these
* coordinates as a basis for all mouse movements.
* @param e the MouseEvent from the window's rootpane
*/
public void mousePressed(MouseEvent e)
{
if (isWindowMaximized())
return;
X = e.getX();
Y = e.getY();
isMouseOnBorder(X, Y);
handleDirections(e, true);
}
/**
* Computes the coordinates where the mouse is released and tells any listeners
* that the window should stop resizing.
* @param e the MouseEvent from the window's rootpane
*/
public void mouseReleased(MouseEvent e)
{
if (isWindowMaximized() || !isMouseOnBorder)
return;
WindowChangeEvent event = new WindowChangeEvent(this, e.getX(), e.getY(), e.getX()-X, e.getY()-Y, direction, false);
fireWindowChangeEvent(WindowChangeEvent.WINDOW_RESIZED, event);
}
/**
* Sets the border size around the content pane in pixels.
* @param borderSize the border size
*/
public void setBorderSize(Insets borderSize)
{
this.borderSize = borderSize;
}
}
| [
"jbickmore@gmail.com"
] | jbickmore@gmail.com |
f62178e82921a4a5a6adfb24bcd48ea6c252c003 | 7f20b1bddf9f48108a43a9922433b141fac66a6d | /core3/impl/tags/impl-parent-3.0.0-alpha8/psi-mi-impl/impl/src/test/java/org/cytoscape/psi_mi/internal/plugin/PsiMiCyFileFilterTest.java | 9fe36245256cfb980c31ce1fd7e50dd77c8fdac9 | [] | no_license | ahdahddl/cytoscape | bf783d44cddda313a5b3563ea746b07f38173022 | a3df8f63dba4ec49942027c91ecac6efa920c195 | refs/heads/master | 2020-06-26T16:48:19.791722 | 2013-08-28T04:08:31 | 2013-08-28T04:08:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,334 | java | package org.cytoscape.psi_mi.internal.plugin;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import org.cytoscape.io.CyFileFilter;
import org.cytoscape.io.DataCategory;
import org.cytoscape.io.util.StreamUtil;
import org.junit.Before;
import org.junit.Test;
public class PsiMiCyFileFilterTest {
private CyFileFilter filter1;
private CyFileFilter filter25;
@Before
public void setUp() {
StreamUtil streamUtil = new StreamUtil() {
@Override
public InputStream getInputStream(String s) throws IOException {
return null;
}
@Override
public URLConnection getURLConnection(URL source) throws IOException {
return null;
}
@Override
public InputStream getInputStream(URL source) throws IOException {
return source.openStream();
}
};
filter1 = new PsiMiCyFileFilter("PSI 1", streamUtil, PsiMiCyFileFilter.PSIMIVersion.PXIMI10);
filter25 = new PsiMiCyFileFilter("PSI 25", streamUtil, PsiMiCyFileFilter.PSIMIVersion.PSIMI25);
}
@Test
public void testAcceptPsiMi1() throws Exception {
File file = new File("src/test/resources/testData/psi_sample1.xml");
assertTrue(filter1.accepts(new FileInputStream(file), DataCategory.NETWORK));
assertTrue(filter1.accepts(file.toURI(), DataCategory.NETWORK));
}
@Test
public void testAcceptPsiMi25() throws Exception {
File file = new File("src/test/resources/testData/psi_sample_2_5_2.xml");
assertTrue(filter25.accepts(new FileInputStream(file), DataCategory.NETWORK));
assertTrue(filter25.accepts(file.toURI(), DataCategory.NETWORK));
// This is v2.5.4
final File intactFile = new File("src/test/resources/testData/intact_21798944_arath-2011-2_04.xml");
assertTrue(filter25.accepts(new FileInputStream(intactFile), DataCategory.NETWORK));
assertTrue(filter25.accepts(intactFile.toURI(), DataCategory.NETWORK));
}
@Test
public void testAcceptRandomXml() throws Exception {
File file = new File("src/test/resources/testData/galFiltered.xgmml");
assertFalse(filter25.accepts(new FileInputStream(file), DataCategory.NETWORK));
assertFalse(filter25.accepts(file.toURI(), DataCategory.NETWORK));
}
}
| [
"mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5"
] | mes@0ecc0d97-ab19-0410-9704-bfe1a75892f5 |
1bb29f3b546719c5b93d3ea8e0d08fc034ec16e1 | 6832918e1b21bafdc9c9037cdfbcfe5838abddc4 | /jdk_11_maven/cs/rest/cwa-verification-server/src/main/java/app/coronawarn/verification/model/TanType.java | 2f009c091de84242fef30bfea36d3c47140cf30b | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-unknown",
"GPL-1.0-or-later",
"LGPL-2.0-or-later"
] | permissive | EMResearch/EMB | 200c5693fb169d5f5462d9ebaf5b61c46d6f9ac9 | 092c92f7b44d6265f240bcf6b1c21b8a5cba0c7f | refs/heads/master | 2023-09-04T01:46:13.465229 | 2023-04-12T12:09:44 | 2023-04-12T12:09:44 | 94,008,854 | 25 | 14 | Apache-2.0 | 2023-09-13T11:23:37 | 2017-06-11T14:13:22 | Java | UTF-8 | Java | false | false | 1,203 | java | /*
* Corona-Warn-App / cwa-verification
*
* (C) 2020, T-Systems International GmbH
*
* Deutsche Telekom AG and all other contributors /
* copyright owners license 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 app.coronawarn.verification.model;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* This class represents the different types of tans.
*
* @see <a href="https://github.com/corona-warn-app/cwa-verification-server/blob/master/docs/architecture-overview.md#entity-tan">Entity TAN - Type</a>
*/
@Schema
public enum TanType {
/**
* The general tan.
*/
TAN,
/**
* The TeleTAN, which was created by, e.g the hotline.
*/
TELETAN
}
| [
"arcuri82@gmail.com"
] | arcuri82@gmail.com |
fea8cca8ab338a1d3337192c4d966554706a1b3b | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.minihd.qq/assets/exlibs.3.jar/classes.jar/sm/am.java | 5983f179c423e3a5238632ed377da03e4946acd3 | [] | 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 | 767 | java | package sm;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Handler;
import com.tencent.securemodule.ui.TransparentActivity;
import com.tencent.securemodule.ui.TransparentActivity.a;
public class am
implements DialogInterface.OnClickListener
{
public am(TransparentActivity paramTransparentActivity) {}
public void onClick(DialogInterface paramDialogInterface, int paramInt)
{
TransparentActivity.c(this.a).sendEmptyMessage(1);
new TransparentActivity.a(this.a, 0).start();
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.3.jar\classes.jar
* Qualified Name: sm.am
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
581f7703dcb1dd422203e775dd2a858b481e534c | 2e7b577de457dc01cfd9615bfdc1d24284dcc369 | /U6_Lectura_y_Escritura_de_Informacion/PRÁCTICAS/Tarea 3/src/com/sergiobejaranoarroyo/Actividad2/Cliente.java | cf9b78f853dd334ba9012e5caf19b9bfdad90537 | [] | no_license | Sergio19991/Programacion_1-DAW | 5b47e2949c0ff0b70c90126a6d571aec5bed6e3d | 37eed2e4eb3141566400684a9d7c569f11c022b9 | refs/heads/master | 2023-04-23T13:05:36.242770 | 2021-05-06T12:04:26 | 2021-05-06T12:04:26 | 297,617,391 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,510 | java | package com.sergiobejaranoarroyo.Actividad2;
public class Cliente {
private String nombre;
private String apellidos;
private int edad;
private String dni;
public Cliente(String nombre, String apellidos, int edad, String dni) throws EdadErroneaException, MenorEdadException {
this.nombre = nombre;
this.apellidos = apellidos;
if (edad < 0 || edad > 100) {
throw new EdadErroneaException("EDAD ERRONEA");
} else if (edad < 18) {
throw new MenorEdadException("MENOR DE EDAD");
} else {
this.edad = edad;
}
this.edad = edad;
this.dni = dni;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellidos() {
return apellidos;
}
public void setApellidos(String apellidos) {
this.apellidos = apellidos;
}
public int getEdad() {
return edad;
}
public void setEdad(int edad) throws EdadErroneaException, MenorEdadException {
if (edad < 0 || edad > 100) {
throw new EdadErroneaException("EDAD ERRONEA");
} else if (edad < 18) {
throw new MenorEdadException("MENOR DE EDAD");
} else {
this.edad = edad;
}
this.edad = edad;
}
public String getDni() {
return dni;
}
public void setDni(String dni) {
this.dni = dni;
}
} | [
"alum.sbejaranoa.2020@iesalixar.org"
] | alum.sbejaranoa.2020@iesalixar.org |
639db7b7fcb1ab5bfb9db18f829b7c11616d8b2a | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project485/src/test/java/org/gradle/test/performance/largejavamultiproject/project485/p2429/Test48583.java | 4f489c6bbaefb2b29bd4799eb19a8207ad078ef4 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,182 | java | package org.gradle.test.performance.largejavamultiproject.project485.p2429;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test48583 {
Production48583 objectUnderTest = new Production48583();
@Test
public void testProperty0() {
Production48580 value = new Production48580();
objectUnderTest.setProperty0(value);
assertEquals(value, objectUnderTest.getProperty0());
}
@Test
public void testProperty1() {
Production48581 value = new Production48581();
objectUnderTest.setProperty1(value);
assertEquals(value, objectUnderTest.getProperty1());
}
@Test
public void testProperty2() {
Production48582 value = new Production48582();
objectUnderTest.setProperty2(value);
assertEquals(value, objectUnderTest.getProperty2());
}
@Test
public void testProperty3() {
String value = "value";
objectUnderTest.setProperty3(value);
assertEquals(value, objectUnderTest.getProperty3());
}
@Test
public void testProperty4() {
String value = "value";
objectUnderTest.setProperty4(value);
assertEquals(value, objectUnderTest.getProperty4());
}
@Test
public void testProperty5() {
String value = "value";
objectUnderTest.setProperty5(value);
assertEquals(value, objectUnderTest.getProperty5());
}
@Test
public void testProperty6() {
String value = "value";
objectUnderTest.setProperty6(value);
assertEquals(value, objectUnderTest.getProperty6());
}
@Test
public void testProperty7() {
String value = "value";
objectUnderTest.setProperty7(value);
assertEquals(value, objectUnderTest.getProperty7());
}
@Test
public void testProperty8() {
String value = "value";
objectUnderTest.setProperty8(value);
assertEquals(value, objectUnderTest.getProperty8());
}
@Test
public void testProperty9() {
String value = "value";
objectUnderTest.setProperty9(value);
assertEquals(value, objectUnderTest.getProperty9());
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
376a3f3e6aff0616d9da868ae5f6fd67851c5871 | 8390af244cb9aaba8cfb4057193b1c6dd6958523 | /sp2p_sjzyj.common/app/daos/common/WithdrawalUserDao.java | dbd67f463f0319fa82ba1828d62656c6b4b29fa8 | [
"MIT"
] | permissive | P79N6A/oyph | 05944951675b7d4a8753b9d8ae86f800871cccd4 | 2dbdf779d5151e7bab4b3c8e8ba4256aad93d1fa | refs/heads/master | 2020-04-24T01:50:47.339443 | 2019-02-20T06:21:25 | 2019-02-20T06:21:25 | 171,614,668 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,698 | java | package daos.common;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import models.common.entity.t_deal_user;
import models.common.entity.t_recharge_user;
import models.common.entity.t_withdrawal_user;
import common.utils.PageBean;
import daos.base.BaseDao;
/**
* 提现记录dao实现
*
* @description
*
* @author ChenZhipeng
* @createDate 2015年12月21日
*/
public class WithdrawalUserDao extends BaseDao<t_withdrawal_user> {
protected WithdrawalUserDao() {}
/**
* 提现记录表
*
* @param currPage
* @param pageSize
* @param userId
* @return
*
* @author Chenzhipeng
* @createDate 2015年12月21日
*/
public PageBean<t_withdrawal_user> pageOfWithdrawal(int currPage, int pageSize,long userId) {
return super.pageOfByColumn(currPage, pageSize, "user_id = ? ORDER BY id DESC", userId);
}
/**
* 提现成功,更新相关数据
*
* @param orderNo
* @return
*
* @author huangyunsong
* @createDate 2016年1月11日
*/
public int updateWithdrawalToSuccess(String orderNo) {
String sql = "UPDATE t_withdrawal_user SET status = :status, completed_time = :time, summary=:summary WHERE order_no = :orderNo AND status <> :status";
Map<String, Object> params = new HashMap<String, Object>();
params.put("status", t_recharge_user.Status.SUCCESS.code);
params.put("time", new Date());
params.put("orderNo", orderNo);
params.put("summary", t_deal_user.OperationType.WITHDRAW.value);
return updateBySQL(sql, params);
}
/**
* 提现失败,更新相关数据
*
* @param orderNo 业务流水号
* @param summary 备注
* @return
*
* @author Liupengwei
* @createDate 2017年10月9日
*/
public int updateSummary(String orderNo, String summary) {
String sql = "UPDATE t_withdrawal_user SET status=:status, summary=:summary WHERE order_no = :orderNo";
Map<String, Object> params = new HashMap<String, Object>();
params.put("status", t_recharge_user.Status.FAILED.code);
params.put("orderNo", orderNo);
params.put("summary", summary);
return updateBySQL(sql, params);
}
/**
* 提现处理中,更新相关数据
*
* @param orderNo 业务流水号
* @param summary 备注
* @return
*
* @author Liupengwei
* @createDate 2017年10月9日
*/
public int updateSummaryS(String orderNo, String summary) {
String sql = "UPDATE t_withdrawal_user SET status=:status, summary=:summary WHERE order_no = :orderNo";
Map<String, Object> params = new HashMap<String, Object>();
params.put("status", t_recharge_user.Status.HANDING.code);
params.put("orderNo", orderNo);
params.put("summary", summary);
return updateBySQL(sql, params);
}
}
| [
"liujiayiii@qq.com"
] | liujiayiii@qq.com |
a877a2cc584dd83c8997172c487b676e4b9e5107 | f525deacb5c97e139ae2d73a4c1304affb7ea197 | /gitv/src/main/java/com/tvos/widget/VMenuItem.java | 5fa8e42f0954969332c199629eade9ebc4cd3c82 | [] | no_license | AgnitumuS/gitv | 93b2359e1bf9f2b6c945298c61c5c6dbfeea49b3 | 242c9a10a0aeb41b9589de9f254e6ce9f57bd77a | refs/heads/master | 2021-08-08T00:50:10.630301 | 2017-11-09T08:10:33 | 2017-11-09T08:10:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,218 | java | package com.tvos.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.view.View;
import android.widget.FrameLayout;
public class VMenuItem extends FrameLayout {
private static final String TAG = "VMenuItem";
private OnMenuItemKeyListener mListener;
public interface OnMenuItemKeyListener {
void onMenuItemKeyCenter(VMenuItem vMenuItem);
void onMenuItemKeyDown(VMenuItem vMenuItem);
void onMenuItemKeyLeft(VMenuItem vMenuItem);
void onMenuItemKeyRight(VMenuItem vMenuItem);
void onMenuItemKeyUp(VMenuItem vMenuItem);
}
public VMenuItem(Context context) {
this(context, null);
}
public VMenuItem(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public VMenuItem(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
this.mListener = null;
setClipChildren(false);
setFocusable(true);
}
public void setOnMenuItemKeyListener(OnMenuItemKeyListener l) {
this.mListener = l;
}
public void setView(View v) {
if (getChildCount() > 0) {
removeAllViews();
}
addView(v);
}
public View getView() {
if (getChildCount() > 0) {
return getChildAt(0);
}
return null;
}
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getAction() == 1) {
return super.dispatchKeyEvent(event);
}
if (this.mListener == null) {
return super.dispatchKeyEvent(event);
}
int keyCode = event.getKeyCode();
if (keyCode == 19) {
this.mListener.onMenuItemKeyUp(this);
} else if (keyCode == 20) {
this.mListener.onMenuItemKeyDown(this);
} else if (keyCode == 21) {
this.mListener.onMenuItemKeyLeft(this);
} else if (keyCode == 22) {
this.mListener.onMenuItemKeyRight(this);
} else if (keyCode == 66 || keyCode == 23) {
this.mListener.onMenuItemKeyCenter(this);
}
return super.dispatchKeyEvent(event);
}
}
| [
"liuwencai@le.com"
] | liuwencai@le.com |
d340215db47b3bc7f511b6b11dbde86001edd4fa | 0e0b9c6ab7c09ad92af642a779a98c28238d6d97 | /src/com/junpenghe/distributed/systems/zookeeper/registry/src/main/java/cluster/management/ServiceRegistry.java | 24abdf377c32fe143b7fa5ad8669de2fc0407ea1 | [] | no_license | Junpengalaitp/java-learning-note | 0d141ba11f04d1bc27222fb91a621e1fd3514f3b | 218271f06707f0abeba302c1f0979ec27c874ec4 | refs/heads/master | 2023-04-08T05:25:43.384366 | 2021-04-26T09:39:11 | 2021-04-26T09:39:11 | 305,915,215 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,118 | java | package cluster.management;
import org.apache.zookeeper.*;
import org.apache.zookeeper.data.Stat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class ServiceRegistry implements Watcher {
private static final String REGISTRY_ZNODE = "/service_registry";
private final ZooKeeper zooKeeper;
private String currentZnode = null;
private List<String> allServiceAddresses = null;
public ServiceRegistry(ZooKeeper zooKeeper) {
this.zooKeeper = zooKeeper;
}
public void registerToCluster(String metadata) throws KeeperException, InterruptedException {
this.currentZnode = zooKeeper.create(REGISTRY_ZNODE + "/n_", metadata.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL_SEQUENTIAL);
System.out.println("Registered to service registry");
}
public void registerForUpdates() {
try {
updateAddresses();
} catch (KeeperException | InterruptedException e) {
e.printStackTrace();
}
}
public synchronized List<String> getAllServiceAddresses() throws KeeperException, InterruptedException {
if (allServiceAddresses == null) {
updateAddresses();
}
return allServiceAddresses;
}
public void unregisterFromCluster() {
try {
if (currentZnode != null && zooKeeper.exists(currentZnode, false) != null) {
zooKeeper.delete(currentZnode, -1);
}
} catch (KeeperException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
private void createServiceRegistryZnode() {
try {
if (zooKeeper.exists(REGISTRY_ZNODE, false) == null) {
zooKeeper.create(REGISTRY_ZNODE, new byte[]{}, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
}
} catch (KeeperException | InterruptedException e) {
e.printStackTrace();
}
}
private synchronized void updateAddresses() throws KeeperException, InterruptedException {
List<String> workerZnodes = zooKeeper.getChildren(REGISTRY_ZNODE, this);
List<String> addresses = new ArrayList<>(workerZnodes.size());
for (String workerZnode : workerZnodes) {
String workerZnodeFullPath = REGISTRY_ZNODE + "/" + workerZnode;
Stat stat = zooKeeper.exists(workerZnodeFullPath, false);
if (stat == null) {
continue;
}
byte[] addressBytes = zooKeeper.getData(workerZnodeFullPath, false, stat);
String address = new String(addressBytes);
addresses.add(address);
}
this.allServiceAddresses = Collections.unmodifiableList(addresses);
System.out.println("The cluster addresses are: " + this.allServiceAddresses);
}
@Override
public void process(WatchedEvent event) {
try {
updateAddresses();
} catch (KeeperException | InterruptedException e) {
e.printStackTrace();
}
}
}
| [
"hejunpeng2012@hotmail.com"
] | hejunpeng2012@hotmail.com |
b563d08122a0e39cec7a5f641f09d8b4f42732f9 | 75e7d1a3ab7e6bf8e9305827aebb787cd6ed94e6 | /study/shiro/chapter6/src/test/java/chapter6/realm/UserRealmTest.java | e31425facf83653106490fe2228ed0a3b12d511d | [
"Apache-2.0"
] | permissive | nickshang/study | 9f3f8c9b4bfe72a67b54aed24973e9bb941b603a | 49afda86aa3a816a21d998a8456106a6d78d7cf5 | refs/heads/master | 2021-01-22T10:59:36.107512 | 2018-03-01T14:57:24 | 2018-03-01T14:57:24 | 102,343,161 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,798 | java | package chapter6.realm;
import chapter6.BaseTest;
import junit.framework.Assert;
import org.apache.shiro.authc.ExcessiveAttemptsException;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.shiro.authc.UnknownAccountException;
import org.junit.Test;
/**
* <p>User: Zhang Kaitao
* <p>Date: 14-1-28
* <p>Version: 1.0
*/
public class UserRealmTest extends BaseTest {
/**
* 正常登录
*/
@Test
public void testLoginSuccess() {
login("classpath:shiro.ini", u1.getUsername(), password);
// 判断是否登录
Assert.assertTrue(subject().isAuthenticated());
}
/**
* 不存在用户
*/
@Test(expected = UnknownAccountException.class)
public void testLoginFailWithUnknownUsername() {
login("classpath:shiro.ini", u1.getUsername() + "1", password);
}
/**
* 错误的密码
*/
@Test(expected = IncorrectCredentialsException.class)
public void testLoginFailWithErrorPassowrd() {
login("classpath:shiro.ini", u1.getUsername(), password + "1");
}
/**
* 被锁定的账户
*/
@Test(expected = LockedAccountException.class)
public void testLoginFailWithLocked() {
login("classpath:shiro.ini", u4.getUsername(), password + "1");
}
/**
* 时限内超过登录次数
*/
@Test(expected = ExcessiveAttemptsException.class)
public void testLoginFailWithLimitRetryCount() {
for(int i = 1; i <= 5; i++) {
try {
login("classpath:shiro.ini", u3.getUsername(), password + "1");
} catch (Exception e) {/*ignore*/}
}
login("classpath:shiro.ini", u3.getUsername(), password + "1");
//需要清空缓存,否则后续的执行就会遇到问题(或者使用一个全新账户测试)
}
/**
* 拥有角色
*/
@Test
public void testHasRole() {
login("classpath:shiro.ini", u1.getUsername(), password );
Assert.assertTrue(subject().hasRole("admin"));
}
/**
* 没有拥有角色
*/
@Test
public void testNoRole() {
login("classpath:shiro.ini", u2.getUsername(), password);
Assert.assertFalse(subject().hasRole("admin"));
}
/**
* 拥有权限集合
*/
@Test
public void testHasPermission() {
login("classpath:shiro.ini", u1.getUsername(), password);
Assert.assertTrue(subject().isPermittedAll("user:create", "menu:create"));
}
/**
* 是否具有权限
*/
@Test
public void testNoPermission() {
login("classpath:shiro.ini", u2.getUsername(), password);
Assert.assertFalse(subject().isPermitted("user:create"));
}
}
| [
"ssj00@163.com"
] | ssj00@163.com |
444c6877f1665b1018020a441b0205de4621e88a | 68e4676b246cfef371a0de908fd3922f56b881d0 | /alipay-sdk-master/src/main/java/com/alipay/api/response/AlipayAcquireCloseResponse.java | 3226766745f92ba5f58cd3c980e0d473deaa2e8b | [
"Apache-2.0"
] | permissive | everLuck666/BoruiSystem | c66872ac965df2c6d833c7b529c1f76805d5cb05 | 7e19e43e8bb42420e87398dcd737f80904611a56 | refs/heads/master | 2023-03-29T12:08:07.978557 | 2021-03-22T03:12:23 | 2021-03-22T03:12:23 | 335,288,821 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,324 | java | package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.acquire.close response.
*
* @author auto create
* @since 1.0, 2014-06-12 17:17:06
*/
public class AlipayAcquireCloseResponse extends AlipayResponse {
private static final long serialVersionUID = 2492159419912695792L;
/**
* 对返回响应码进行原因说明
当result_code响应码为SUCCESS时,不返回该参数
*/
@ApiField("detail_error_code")
private String detailErrorCode;
/**
* 对详细错误码进行文字说明
当result_code响应码为SUCCESS时,不返回该参数
*/
@ApiField("detail_error_des")
private String detailErrorDes;
/**
* 请求是否成功。请求成功不代表业务处理成功。
T代表成功
F代表失败
*/
@ApiField("is_success")
private String isSuccess;
/**
* 对应商户网站的订单系统中的唯一订单号,非支付宝交易号。
需保证在商户网站中的唯一性。是请求时对应的参数,原样返回
*/
@ApiField("out_trade_no")
private String outTradeNo;
/**
* 关闭处理结果响应码。
SUCCESS:关闭成功
NKNOWN:结果未知
*/
@ApiField("result_code")
private String resultCode;
/**
* 该交易在支付宝系统中的交易流水号。
最短16位,最长64位
*/
@ApiField("trade_no")
private String tradeNo;
public void setDetailErrorCode(String detailErrorCode) {
this.detailErrorCode = detailErrorCode;
}
public String getDetailErrorCode( ) {
return this.detailErrorCode;
}
public void setDetailErrorDes(String detailErrorDes) {
this.detailErrorDes = detailErrorDes;
}
public String getDetailErrorDes( ) {
return this.detailErrorDes;
}
public void setIsSuccess(String isSuccess) {
this.isSuccess = isSuccess;
}
public String getIsSuccess( ) {
return this.isSuccess;
}
public void setOutTradeNo(String outTradeNo) {
this.outTradeNo = outTradeNo;
}
public String getOutTradeNo( ) {
return this.outTradeNo;
}
public void setResultCode(String resultCode) {
this.resultCode = resultCode;
}
public String getResultCode( ) {
return this.resultCode;
}
public void setTradeNo(String tradeNo) {
this.tradeNo = tradeNo;
}
public String getTradeNo( ) {
return this.tradeNo;
}
}
| [
"49854860+DFRUfO@users.noreply.github.com"
] | 49854860+DFRUfO@users.noreply.github.com |
c7e2f91284357889e195139822145240aba73196 | 8ecf9fed02240dcf2f95172226727bf5c74ca1e8 | /org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/LinkedFix.java | a584648a5e7c8fa5b6dc94940cd4e0c4cfd129bd | [] | no_license | wulibing/Green-UML-project | 886b457019b565015093c7600a35e740e3bc2bcd | b0e7dab95a5f77dfb603dc499959c4802f66d6ea | refs/heads/master | 2021-01-17T11:39:14.783939 | 2014-10-06T06:38:26 | 2014-10-06T06:38:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,266 | java | /*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.corext.fix;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.text.edits.TextEditGroup;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ltk.core.refactoring.TextChange;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.corext.refactoring.changes.CompilationUnitChange;
import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite;
public class LinkedFix extends AbstractFix {
public static abstract class AbstractLinkedFixRewriteOperation extends AbstractFixRewriteOperation implements ILinkedFixRewriteOperation {
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.fix.AbstractFix.IFixRewriteOperation#rewriteAST(org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite, java.util.List)
*/
public void rewriteAST(CompilationUnitRewrite cuRewrite, List textEditGroups) throws CoreException {
rewriteAST(cuRewrite, textEditGroups, new LinkedProposalModel());
}
}
private final IFixRewriteOperation[] fFixRewrites;
private final CompilationUnit fCompilationUnit;
private final LinkedProposalModel fLinkedProposalModel;
protected LinkedFix(String name, CompilationUnit compilationUnit, IFixRewriteOperation[] fixRewrites) {
super(name, compilationUnit, fixRewrites);
fCompilationUnit= compilationUnit;
fFixRewrites= fixRewrites;
fLinkedProposalModel= new LinkedProposalModel();
}
public LinkedProposalModel getLinkedPositions() {
return fLinkedProposalModel;
}
/* (non-Javadoc)
* @see org.eclipse.jdt.internal.corext.fix.IFix#createChange()
*/
public TextChange createChange() throws CoreException {
if (fFixRewrites == null || fFixRewrites.length == 0)
return null;
CompilationUnitRewrite cuRewrite= new CompilationUnitRewrite((ICompilationUnit)fCompilationUnit.getJavaElement(), fCompilationUnit);
List/*<TextEditGroup>*/ groups= new ArrayList();
fLinkedProposalModel.clear();
for (int i= 0; i < fFixRewrites.length; i++) {
IFixRewriteOperation operation= fFixRewrites[i];
if (operation instanceof ILinkedFixRewriteOperation) {
ILinkedFixRewriteOperation linkedOperation= (ILinkedFixRewriteOperation)operation;
linkedOperation.rewriteAST(cuRewrite, groups, fLinkedProposalModel);
} else {
operation.rewriteAST(cuRewrite, groups);
}
}
CompilationUnitChange result= cuRewrite.createChange(getDescription(), true, null);
for (Iterator iter= groups.iterator(); iter.hasNext();) {
TextEditGroup group= (TextEditGroup)iter.next();
result.addTextEditGroup(group);
}
return result;
}
}
| [
"wulibing94@gmail.com"
] | wulibing94@gmail.com |
ab4e48cf1ef228fa7b94f1f6b3a7187ee68811d1 | 12b6eb89767c8e332842f65d2e330cadcdbab65c | /app/src/main/java/com/randomappsinc/studentpicker/utils/StringUtil.java | 8bac4f450db758eddc446ccc3eb213901df2fa41 | [
"Apache-2.0"
] | permissive | build3r/Random-Name-Picker | bce105aca2b2d993314f613cf43156af92b7dfec | 4e4deee3ce3062967e7d842bfa9e22e83ab357ea | refs/heads/master | 2023-08-29T14:19:03.096528 | 2021-10-18T13:07:49 | 2021-10-18T13:07:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 792 | java | package com.randomappsinc.studentpicker.utils;
import android.text.TextUtils;
public class StringUtil {
public static String capitalizeWords(String input) {
String[] words = input.split("\\s+");
StringBuilder capitalizedVersion = new StringBuilder();
for (String word : words) {
if (TextUtils.isEmpty(word)) {
continue;
}
String first = word.substring(0, 1);
String restOfWord = word.substring(1);
if (capitalizedVersion.length() > 0) {
capitalizedVersion.append(" ");
}
capitalizedVersion
.append(first.toUpperCase())
.append(restOfWord);
}
return capitalizedVersion.toString();
}
}
| [
"chessnone@yahoo.com"
] | chessnone@yahoo.com |
75597d50032daef04fc41b57090087c6e6ad57d8 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/apache/rocketmq/common/UtilAllTest.java | b470abc267405766fbff0a0e6a719cf6102b2d1a | [] | 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 | 5,042 | 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.rocketmq.common;
import java.util.Properties;
import org.junit.Test;
public class UtilAllTest {
@Test
public void testCurrentStackTrace() {
String currentStackTrace = UtilAll.currentStackTrace();
assertThat(currentStackTrace).contains("UtilAll.currentStackTrace");
assertThat(currentStackTrace).contains("UtilAllTest.testCurrentStackTrace(");
}
@Test
public void testProperties2Object() {
UtilAllTest.DemoConfig demoConfig = new UtilAllTest.DemoConfig();
Properties properties = new Properties();
properties.setProperty("demoWidth", "123");
properties.setProperty("demoLength", "456");
properties.setProperty("demoOK", "true");
properties.setProperty("demoName", "TestDemo");
MixAll.properties2Object(properties, demoConfig);
assertThat(demoConfig.getDemoLength()).isEqualTo(456);
assertThat(demoConfig.getDemoWidth()).isEqualTo(123);
assertThat(demoConfig.isDemoOK()).isTrue();
assertThat(demoConfig.getDemoName()).isEqualTo("TestDemo");
}
@Test
public void testProperties2String() {
UtilAllTest.DemoConfig demoConfig = new UtilAllTest.DemoConfig();
demoConfig.setDemoLength(123);
demoConfig.setDemoWidth(456);
demoConfig.setDemoName("TestDemo");
demoConfig.setDemoOK(true);
Properties properties = MixAll.object2Properties(demoConfig);
assertThat(properties.getProperty("demoLength")).isEqualTo("123");
assertThat(properties.getProperty("demoWidth")).isEqualTo("456");
assertThat(properties.getProperty("demoOK")).isEqualTo("true");
assertThat(properties.getProperty("demoName")).isEqualTo("TestDemo");
}
@Test
public void testIsPropertiesEqual() {
final Properties p1 = new Properties();
final Properties p2 = new Properties();
p1.setProperty("a", "1");
p1.setProperty("b", "2");
p2.setProperty("a", "1");
p2.setProperty("b", "2");
assertThat(MixAll.isPropertiesEqual(p1, p2)).isTrue();
}
@Test
public void testGetPid() {
assertThat(UtilAll.getPid()).isGreaterThan(0);
}
@Test
public void testGetDiskPartitionSpaceUsedPercent() {
String tmpDir = System.getProperty("java.io.tmpdir");
assertThat(UtilAll.getDiskPartitionSpaceUsedPercent(null)).isCloseTo((-1), within(1.0E-6));
assertThat(UtilAll.getDiskPartitionSpaceUsedPercent("")).isCloseTo((-1), within(1.0E-6));
assertThat(UtilAll.getDiskPartitionSpaceUsedPercent("nonExistingPath")).isCloseTo((-1), within(1.0E-6));
assertThat(UtilAll.getDiskPartitionSpaceUsedPercent(tmpDir)).isNotCloseTo((-1), within(1.0E-6));
}
@Test
public void testIsBlank() {
assertThat(UtilAll.isBlank("Hello ")).isFalse();
assertThat(UtilAll.isBlank(" Hello")).isFalse();
assertThat(UtilAll.isBlank("He llo")).isFalse();
assertThat(UtilAll.isBlank(" ")).isTrue();
assertThat(UtilAll.isBlank("Hello")).isFalse();
}
static class DemoConfig {
private int demoWidth = 0;
private int demoLength = 0;
private boolean demoOK = false;
private String demoName = "haha";
int getDemoWidth() {
return demoWidth;
}
public void setDemoWidth(int demoWidth) {
this.demoWidth = demoWidth;
}
public int getDemoLength() {
return demoLength;
}
public void setDemoLength(int demoLength) {
this.demoLength = demoLength;
}
public boolean isDemoOK() {
return demoOK;
}
public void setDemoOK(boolean demoOK) {
this.demoOK = demoOK;
}
public String getDemoName() {
return demoName;
}
public void setDemoName(String demoName) {
this.demoName = demoName;
}
@Override
public String toString() {
return ((((((((("DemoConfig{" + "demoWidth=") + (demoWidth)) + ", demoLength=") + (demoLength)) + ", demoOK=") + (demoOK)) + ", demoName='") + (demoName)) + '\'') + '}';
}
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
e1101189b47b4b4baa2f4986236757e4014ca1db | 30a619d2ccfd60d44f8aa8f52be02e1fb98a184c | /Qualyzer_2.0/main/ca.mcgill.cs.swevo.qualyzer/src/ca/mcgill/cs/swevo/qualyzer/model/validation/TranscriptValidator.java | 21d9b7761966a80232bdad6fe65db99550405f17 | [] | no_license | hchuphal/Javac | 84ce9bd2a73ec3f6247d9c3ebc29636671b73251 | 130ef558d3f16c6fa7390ef7c2d616fe73bca7fa | refs/heads/master | 2020-09-06T16:26:42.476456 | 2019-12-18T21:46:09 | 2019-12-18T21:46:09 | 220,478,324 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,366 | java | /*******************************************************************************
* Copyright (c) 2010 McGill University
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Martin Robillard
*******************************************************************************/
package ca.mcgill.cs.swevo.qualyzer.model.validation;
import java.io.File;
import ca.mcgill.cs.swevo.qualyzer.model.Project;
/**
* Validates the business rules when a new transcript is created:
* - The transcript name is not already in use
* - The transcript name is not empty
* - The transcript name is in alphanumerical+ format.
* - At least one participant is associated with the transcript
* - The name of the audio file is not empty but does not refer to an existing file
*/
public class TranscriptValidator extends TranscriptNameValidator
{
private final int fNumberOfParticipants;
private final String fAudioFileName;
/**
* Constructs a new TranscriptValidator.
* @param pName The name chosen for the new transcript.
* @param pProject The Project in which the transcript is to be created.
*/
public TranscriptValidator(String pName, Project pProject, int pNumberOfParticipants, String pAudioFileName)
{
super(pName, null, pProject);
fNumberOfParticipants = pNumberOfParticipants;
fAudioFileName = pAudioFileName;
}
@Override
public boolean isValid()
{
boolean lReturn = super.isValid();
// Additional conditions tested only if the name passed all validation.
if(lReturn)
{
if(fNumberOfParticipants <= 0)
{
fMessage = MessagesClient.getString("model.validation.TranscriptValidator.selectOne", "ca.mcgill.cs.swevo.qualyzer.model.validation.messages"); //$NON-NLS-1$
lReturn = false;
}
else
{
File file = new File(fAudioFileName);
if((fAudioFileName.length() != 0) && !file.exists())
{
fMessage = MessagesClient.getString("model.validation.TranscriptValidator.enterAudioName", "ca.mcgill.cs.swevo.qualyzer.model.validation.messages"); //$NON-NLS-1$
lReturn = false;
}
}
}
return lReturn;
}
}
| [
"himanshu.chuphal07@gmail.com"
] | himanshu.chuphal07@gmail.com |
9cf4041c7e473eed87ba72380be2d9a41ab62ae2 | c6d8dd7aba171163214253a3da841056ea2f6c87 | /serenity-core/src/main/java/net/serenitybdd/core/webdriver/enhancers/ProvidesRemoteWebdriverUrl.java | c1377baffd4533ae844332c390170ddb87a2f67a | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | serenity-bdd/serenity-core | 602b8369f9527bea21a30104a45ba9b6e4d48238 | ab6eaa5018e467b43e4f099e7682ce2924a9b12f | refs/heads/main | 2023-09-01T22:37:02.079831 | 2023-09-01T17:24:41 | 2023-09-01T17:24:41 | 26,201,720 | 738 | 656 | NOASSERTION | 2023-09-08T14:33:06 | 2014-11-05T03:44:57 | HTML | UTF-8 | Java | false | false | 641 | java | package net.serenitybdd.core.webdriver.enhancers;
import net.thucydides.model.util.EnvironmentVariables;
import java.util.Optional;
/**
* Allow a fixture class (i.e. one that implements BeforeAWebdriverScenario) to derive a remote URL to be used
* from the current environment variables. Useful when connecting to selenium grid services such as LambdaTest and BrowserStack.
* Note that if webdriver.remote.url is defined in serenity.conf, that value will take precedence over any calculated values.
*/
public interface ProvidesRemoteWebdriverUrl {
Optional<String> remoteUrlDefinedIn(EnvironmentVariables environmentVariables);
}
| [
"john.smart@wakaleo.com"
] | john.smart@wakaleo.com |
938ab952837b74f7d751c4bafe4843425b14faa4 | afc757cc5283b27982958d48fc41fa366a961c28 | /src/main/java/com/el/betting/sdk/v4/race/WinnerCandidateLayBackPrice.java | abc6d1d0115751365cbeb67ddfacf62960084d02 | [] | no_license | davithbul/sport-betting-api | c75b63013a1460d390e9c67923af88fd5c7fcd7a | 943fc6defc2ead6e1e7767379f8ae1fa7bbd483c | refs/heads/master | 2020-03-10T03:20:33.071695 | 2018-04-11T22:40:02 | 2018-04-11T22:40:02 | 129,162,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,255 | java | package com.el.betting.sdk.v4.race;
import com.el.betting.sdk.v2.BetPrice;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* Represents the candidate of winning race/marathon/etc along with
* the lay back prices of winning the race.
*/
public class WinnerCandidateLayBackPrice implements Serializable {
private final WinnerCandidate winnerCandidate;
private final List<BetPrice> backPrices;
private final List<BetPrice> layPrices;
public WinnerCandidateLayBackPrice(WinnerCandidate winnerCandidate, List<BetPrice> backPrices, List<BetPrice> layPrices) {
this.winnerCandidate = winnerCandidate;
this.backPrices = backPrices;
this.layPrices = layPrices;
}
public WinnerCandidate getWinnerCandidate() {
return winnerCandidate;
}
public List<BetPrice> getBackPrices() {
return backPrices;
}
public List<BetPrice> getLayPrices() {
return layPrices;
}
@Override
public String toString() {
return "WinnerCandidateLayBackPrice{" +
"winnerCandidate=" + winnerCandidate +
", backPrices=" + backPrices +
", layPrices=" + layPrices +
'}';
}
}
| [
"davithbul@gmail.com"
] | davithbul@gmail.com |
6f3adc8e1b7a1d8e52c71a342fd8050a6d4bb3b5 | 6a9cf6113f459beac9771ffac06a9632a47031a0 | /app/src/main/java/com/calintat/explorer/Adapter/Download/VidDownloadAdapter.java | c632e324a776a4bf048633f6711d61cab7ea4b83 | [] | no_license | MeghaPatel2022/File-Manager | c0247d75bd31bd9e6abe36c9e0faec002992d0e4 | 3f865722977db0bfcd5f0be84c9dcda8d2bc982f | refs/heads/master | 2023-08-25T12:52:14.143940 | 2021-10-12T07:11:40 | 2021-10-12T07:11:40 | 416,223,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,517 | java | package com.calintat.explorer.Adapter.Download;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.provider.MediaStore;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.FileProvider;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.calintat.explorer.Model.DataModel;
import com.calintat.explorer.R;
import java.io.File;
import java.util.ArrayList;
public class VidDownloadAdapter extends RecyclerView.Adapter<VidDownloadAdapter.MyClassView> {
ArrayList<DataModel> fileList = new ArrayList<>();
Activity activity;
public VidDownloadAdapter(ArrayList<DataModel> fileList, Activity activity) {
this.fileList = fileList;
this.activity = activity;
}
@NonNull
@Override
public MyClassView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
View itemView = inflater.inflate(R.layout.item_download_video, null, false);
return new MyClassView(itemView);
}
@Override
public void onBindViewHolder(@NonNull MyClassView holder, int position) {
DataModel dataModel = fileList.get(position);
Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(dataModel.getFilePath(), MediaStore.Images.Thumbnails.MINI_KIND);
Glide
.with(activity)
.load(bitmap)
.asBitmap()
.into(holder.list_item_image);
holder.tv_filename.setText(dataModel.getFilename());
// Get file from file name
// Get length of file in bytes
long fileSizeInBytes = dataModel.getSize();
long fileSizeInKB = fileSizeInBytes / 1024;
long fileSizeInMB = fileSizeInKB / 1024;
if (dataModel.getSize() > 1024 * 1024) {
holder.tv_filesize.setText(fileSizeInMB + "MB");
} else if (dataModel.getSize() > 1024) {
holder.tv_filesize.setText(fileSizeInKB + "KB");
} else {
holder.tv_filesize.setText(fileSizeInBytes + "B");
}
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
File file = new File(dataModel.getFilePath());
Uri fileUri = FileProvider.getUriForFile(activity, "com.calintat.explorer.provider", file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(fileUri, "video/*");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);//DO NOT FORGET THIS EVER
activity.startActivity(intent);
}
});
}
@Override
public int getItemCount() {
return fileList.size();
}
public class MyClassView extends RecyclerView.ViewHolder {
ImageView list_item_image;
TextView tv_filename, tv_filesize;
public MyClassView(@NonNull View itemView) {
super(itemView);
list_item_image = itemView.findViewById(R.id.list_item_image);
tv_filename = itemView.findViewById(R.id.tv_filename);
tv_filesize = itemView.findViewById(R.id.tv_filesize);
}
}
}
| [
"megha.bpatel2022@gmail.com"
] | megha.bpatel2022@gmail.com |
d58f0ce65cc477818a623e4280e37ffe2bc90068 | d593ad37a82a6396effceaf11679e70fddcabc06 | /sangnung/chap15/PrefTest01/src/kr/co/company/PrefTest01/PrefTest01.java | 5217cf0c1787539c6c1bd8018449bddf45eeb830 | [] | no_license | psh667/android | 8a18ea22c8c977852ba2cd9361a8489586e06f05 | 8f7394de8e26ce5106d9828cf95eb1617afca757 | refs/heads/master | 2018-12-27T23:30:46.988404 | 2013-09-09T13:16:46 | 2013-09-09T13:16:46 | 12,700,292 | 3 | 5 | null | null | null | null | UHC | Java | false | false | 1,164 | java | package kr.co.company.PrefTest01;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
public class PrefTest01 extends Activity {
public static final String PREFS_NAME = "MyPrefs";
TextView name;
EditText value;
String imageName;
@Override
protected void onCreate(Bundle state){
super.onCreate(state);
setContentView(R.layout.main);
name = (TextView)findViewById(R.id.TextView01);
value = (EditText)findViewById(R.id.EditText01);
// 프레퍼런스를 복원한다.
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
imageName = settings.getString("imageName", "");
value.setText(imageName);
}
@Override
protected void onStop(){
super.onStop();
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
// 프레퍼런스에 값을 기록하려면 Editor 객체가 필요
SharedPreferences.Editor editor = settings.edit();
imageName = value.getText().toString();
editor.putString("imageName", imageName);
// 변경을 최종 반영한다.
editor.commit();
}
} | [
"paksan@daum.net"
] | paksan@daum.net |
8bc68d37a71b5df5ff7dd68032bd6a044533bac6 | e8e103b66864f9d5dd5ce3b0f3b7c46aaec5abb9 | /micro-zero-mall/zero-product/zero-product-web/src/main/java/com/whoiszxl/zero/entity/vo/CategoryBrandRelationVO.java | 7c76cdc05ee48e09190eb65c538d7e5f7c167b09 | [] | no_license | FJUT/zero-mall | 6c6d8fafd7cdbd227a96bc52fae63c002c2247b9 | a9d10f643a60e45ad5e0661c8b1d1a62e95a3fe8 | refs/heads/master | 2023-04-06T11:20:11.935538 | 2021-04-19T10:20:33 | 2021-04-19T10:20:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package com.whoiszxl.zero.entity.vo;
import com.whoiszxl.zero.bean.AbstractObject;
import lombok.Data;
import java.io.Serializable;
/**
* 品牌&分类关联表
*
* @author whoiszxl
* @email whoiszxl@gmail.com
* @date 2021-04-10 18:07:18
*/
@Data
public class CategoryBrandRelationVO extends AbstractObject implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private Long id;
/**
* 品牌id
*/
private Long brandId;
/**
* 分类id
*/
private Long categoryId;
/**
*
*/
private String brandName;
/**
*
*/
private String categoryName;
}
| [
"whoiszxl@gmail.com"
] | whoiszxl@gmail.com |
836e2866aa15a88e007f14d727df7aa766052676 | ed485890395b0adc7b6544986c5cbdb5098caaaa | /src/main/java/com/qinfei/qferp/service/sys/IDeptZwService.java | bd719934aada5c0cddcb2ac54db3656a18317dc8 | [] | no_license | xeon-ye/croa | ef44a2a3815badd216cd93d829d810d84ef34ffc | fc3806685f9b4676fcaa9cec940f902c4bfcff7f | refs/heads/master | 2023-02-23T13:21:18.820765 | 2021-01-28T11:01:37 | 2021-01-28T11:01:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 741 | java | package com.qinfei.qferp.service.sys;
import com.qinfei.qferp.entity.sys.DeptZw;
import com.qinfei.qferp.entity.sys.User;
import java.util.List;
import java.util.Map;
/**
* @CalssName IDeptZwService
* @Description 部门政委服务接口
* @Author xuxiong
* @Date 2019/12/19 0019 14:19
* @Version 1.0
*/
public interface IDeptZwService {
String CACHE_KEY = "deptZw";
void bindingDeptZw(DeptZw deptZw);
List<User> listUserByDeptAndRole(Map<String, Object> param);
List<User> listZwUserByDeptAndRole(Map<String, Object> param);
List<DeptZw> listUserByDeptId(Integer deptId);
List<User> listUserByParam(Integer deptId);
List<Map<String, Object>> listDeptTreeByZw(String deptCode, Integer mgrFlag);
}
| [
"649681131@qq.com"
] | 649681131@qq.com |
1d3353c14ac22a341b700e91ab19cc5313c3fa27 | d573b8c79f7be22043de9579039700d2989cdc39 | /de.fxdiagram.core.tests/xtend-gen/de/fxdiagram/core/layout/tests/RectangleBoundsTest.java | 81728370ad820128601b747d4d769d92aeed4993 | [] | no_license | nagyistge/FXDiagram | 1200c917663a0eb58868c75e74f1b44fb71b95d3 | f8386bfb6343ba4d009d2111b9e1e56ab45bd581 | refs/heads/master | 2021-01-25T08:12:39.447472 | 2017-05-10T17:34:25 | 2017-05-10T17:34:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,271 | java | package de.fxdiagram.core.layout.tests;
import java.util.ArrayList;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.geometry.Bounds;
import javafx.scene.shape.Rectangle;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.junit.Assert;
import org.junit.Test;
@SuppressWarnings("all")
public class RectangleBoundsTest {
@Test
public void testBoundInLocalEvent() {
final ArrayList<Object> result = CollectionLiterals.<Object>newArrayList();
Rectangle _rectangle = new Rectangle();
final Procedure1<Rectangle> _function = (Rectangle it) -> {
ReadOnlyObjectProperty<Bounds> _boundsInLocalProperty = it.boundsInLocalProperty();
final InvalidationListener _function_1 = (Observable it_1) -> {
Object _object = new Object();
result.add(_object);
};
_boundsInLocalProperty.addListener(_function_1);
};
final Rectangle r = ObjectExtensions.<Rectangle>operator_doubleArrow(_rectangle, _function);
r.setWidth(7);
boolean _isEmpty = result.isEmpty();
Assert.assertFalse(_isEmpty);
}
}
| [
"jan.koehnlein@itemis.de"
] | jan.koehnlein@itemis.de |
9766b51f018aab2cb829207ff34ae055ac645a7d | 934ce1cff3174249dabd39c14aee82575b78444f | /src/graphic2d/TetrisModel.java | 0e2aa78c4b26d439ac7f02646d6ef3c203aa7461 | [] | no_license | leonardo-ono/Java2DTetris | 9fb3139faa55132f184eb6a0c2c0be0b1e39b7a0 | 079c284582d26986c8e75821b9a5cb9a009abbe3 | refs/heads/master | 2020-05-29T08:47:31.646776 | 2016-10-04T23:43:51 | 2016-10-04T23:43:51 | 70,015,494 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,655 | java | package graphic2d;
/**
*
* @author leo
*/
public class TetrisModel {
private boolean gameOver = true;
private int score;
private final int[] scoreTable = { 0, 10, 30, 50, 100 };
private final int gridCols = 10, gridRows = 24;
private int[][] grid = new int[gridRows][gridCols];
private long[] blockData = { 0xF00444400F02222l,
0x660066006600660l, 0xC6004C800C60264l, 0x6C008C4006C0462l,
0x8E0044C00E20644l, 0xE8044602E00C44l, 0x46404E004C400E4l };
private int[][][] blocks = new int[7][4][8];
private int blockCurrent, blockNext, blockRotation;
private int blockRow = 0, blockCol = 3;
public TetrisModel() {
initBlocks();
blockCurrent = (int) (7 * Math.random());
blockNext = (int) (7 * Math.random());
}
private void initBlocks() {
for (int p = 0; p < blockData.length; p++) {
int colRow = 0;
for (int b = 0; b < 64; b++) {
colRow = b % 16 == 0 ? 0 : colRow;
if (((blockData[p] >> b) & 1) == 1) {
blocks[p][b / 16][colRow++] = b % 4;
blocks[p][b / 16][colRow++] = (b % 16) / 4;
}
}
}
}
public boolean isGameOver() {
return gameOver;
}
public int getScore() {
return score;
}
public int getGridCols() {
return gridCols;
}
public int getGridRows() {
return gridRows;
}
public int getGridValue(int col, int row) {
int[] block = blocks[blockCurrent][blockRotation];
for (int i = 0; i < block.length; i+=2) {
if (col == block[i] + blockCol && row == block[i + 1] + blockRow) {
return blockCurrent + 1;
}
}
return grid[row][col];
}
public int getNextBlockValue(int col, int row) {
int[] block = blocks[blockNext][0];
for (int i = 0; i < block.length; i+=2) {
if (col == block[i] && row == block[i + 1]) {
return blockNext + 1;
}
}
return 0;
}
private boolean collides(int dx, int dy, int rotation) {
int[] block = blocks[blockCurrent][rotation];
for (int i = 0; i < block.length; i+=2) {
int col = block[i] + blockCol + dx;
int row = block[i + 1] + blockRow + dy;
if (col < 0 || col > gridCols - 1
|| row < 0 || row > gridRows - 1
|| grid[row][col] > 0) {
return true;
}
}
return false;
}
public void start() {
grid = new int[gridRows][gridCols];
blockCol = 3;
blockRow = 0;
score = 0;
gameOver = false;
}
public void move(int dx) {
if (!collides(dx, 0, blockRotation)) {
blockCol += dx;
}
}
public void rotate() {
int nextBlockRotation = (blockRotation + 1) % 4;
if (!collides(0, 0, nextBlockRotation)) {
blockRotation = nextBlockRotation;
}
}
public void down() {
while (!collides(0, 1, blockRotation)) {
blockRow++;
}
}
public void update() {
int clearedLineCount = clearFilledLines();
// update score
score += scoreTable[clearedLineCount];
// fall block
if (!collides(0, 1, blockRotation)) {
blockRow++;
return;
}
// check game over
if (blockRow < 4 || gameOver) {
gameOver = true;
return;
}
solidify();
nextBlock();
}
private int clearFilledLines() {
int clearedLineCount = 0;
nextRow:
for (int row=0; row<gridRows; row++) {
for (int col=0; col<gridCols; col++) {
if (grid[row][col] == 0) {
continue nextRow;
}
}
for (int row2 = row; row2 > 0; row2--) {
System.arraycopy(grid[row2 - 1], 0, grid[row2], 0, gridCols);
}
clearedLineCount++;
}
return clearedLineCount;
}
private void solidify() {
int[] p = blocks[blockCurrent][blockRotation];
for (int i=0; i<p.length; i+=2) {
grid[p[i + 1] + blockRow][p[i] + blockCol] = blockCurrent + 1;
}
}
private void nextBlock() {
blockCol = 3;
blockRow = 0;
blockRotation = 0;
blockCurrent = blockNext;
blockNext = (int) (7 * Math.random());
}
}
| [
"ono.leo@gmail.com"
] | ono.leo@gmail.com |
8af5b92fe5fa47e40965776dba920764cf3ea453 | 66f10aed49fd8ecd963f156599f02e6583e04e17 | /app/src/main/java/com/mac/isaac/eventbusapp/buses/MessageEvent.java | 2f7fd6ced16ea928fa18ec684946e6bad4104b91 | [] | no_license | isaacurbina/EventBusApp | c57718974c654709a6407fd077eeb400de2e5b8b | 8d825ec2c94e63aac14cff3e01098e5293867274 | refs/heads/master | 2021-01-01T05:09:41.552179 | 2016-04-28T18:00:33 | 2016-04-28T18:00:33 | 57,323,047 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package com.mac.isaac.eventbusapp.buses;
/**
* Created by admin on 4/28/2016.
*/
public class MessageEvent {
public String message;
public MessageEvent(String message) {
this.message = message;
}
}
| [
"isaac.urbina@live.com"
] | isaac.urbina@live.com |
8fa6bde508c2927228e6aa65368d00d0866105f1 | 844d51255e1f859e8e6b4118e9bbac189e0cb200 | /bundles/it.naturtalent.e4.project.ui/src/it/naturtalent/e4/project/ui/dialogs/OrdnerArchivComposite.java | b7bc44e35e82d0f44319beb6b28583ae614fcef6 | [] | no_license | Naturtalent/NaturtalentBasis | 26885eab953740450b161bbd63829e8d08728479 | 8697f1a2134584e0f2fb7a0a2b40d3be8817ac40 | refs/heads/master | 2021-06-28T11:35:52.437678 | 2020-12-04T19:58:54 | 2020-12-04T19:58:54 | 192,992,110 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,693 | java | package it.naturtalent.e4.project.ui.dialogs;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.ui.forms.widgets.ImageHyperlink;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text;
public class OrdnerArchivComposite extends Composite
{
private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
private Text txtArchivOrt;
/**
* Create the composite.
* @param parent
* @param style
*/
public OrdnerArchivComposite(Composite parent, int style)
{
super(parent, style);
setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
setLayout(new GridLayout(1, false));
Section sctnOrdnerArchiv = formToolkit.createSection(this, Section.TWISTIE | Section.TITLE_BAR);
GridData gd_sctnOrdnerArchiv = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gd_sctnOrdnerArchiv.widthHint = 269;
sctnOrdnerArchiv.setLayoutData(gd_sctnOrdnerArchiv);
formToolkit.paintBordersFor(sctnOrdnerArchiv);
sctnOrdnerArchiv.setText("Papier Archiv");
Composite composite = new Composite(sctnOrdnerArchiv, SWT.NONE);
formToolkit.adapt(composite);
formToolkit.paintBordersFor(composite);
sctnOrdnerArchiv.setClient(composite);
composite.setLayout(new GridLayout(4, false));
ImageHyperlink mghprlnkOrdner = formToolkit.createImageHyperlink(composite, SWT.NONE);
mghprlnkOrdner.setBounds(0, 0, 142, 21);
formToolkit.paintBordersFor(mghprlnkOrdner);
mghprlnkOrdner.setText("Ordner");
Spinner spinnerOrdner = new Spinner(composite, SWT.BORDER);
formToolkit.adapt(spinnerOrdner);
formToolkit.paintBordersFor(spinnerOrdner);
Label lblRegister = new Label(composite, SWT.NONE);
formToolkit.adapt(lblRegister, true, true);
lblRegister.setText("Register");
Spinner spinner = new Spinner(composite, SWT.BORDER);
formToolkit.adapt(spinner);
formToolkit.paintBordersFor(spinner);
Label lblArchivOrt = formToolkit.createLabel(composite, "Ort", SWT.NONE);
lblArchivOrt.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
txtArchivOrt = formToolkit.createText(composite, "New Text", SWT.NONE);
txtArchivOrt.setText("");
txtArchivOrt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
}
@Override
protected void checkSubclass()
{
// Disable the check that prevents subclassing of SWT components
}
}
| [
"dieter.apel@t-online.de"
] | dieter.apel@t-online.de |
c63cec1fd0284695cf9d49c4c8d48183d3d31923 | 43bf460c82c006e5e916c07d8645aad5c675b84b | /ken-spring-3.0/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java | 70ae3d573842243771b2f398c1e16e324486d8d5 | [] | no_license | cghr/cme-2.5 | 31086f77e76b0357cc9e4134b25d73c5220774f3 | c87d64495d77dad182e2bb99e024fa3295861b92 | refs/heads/master | 2016-09-09T19:47:25.182951 | 2014-04-30T05:53:00 | 2014-04-30T05:53:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,191 | java | package org.springframework.beans.factory.support;
import org.springframework.beans.factory.BeanDefinitionStoreException;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
public abstract interface BeanDefinitionReader
{
public abstract BeanDefinitionRegistry getRegistry();
public abstract ResourceLoader getResourceLoader();
public abstract ClassLoader getBeanClassLoader();
public abstract BeanNameGenerator getBeanNameGenerator();
public abstract int loadBeanDefinitions(Resource paramResource)
throws BeanDefinitionStoreException;
public abstract int loadBeanDefinitions(Resource... paramVarArgs)
throws BeanDefinitionStoreException;
public abstract int loadBeanDefinitions(String paramString)
throws BeanDefinitionStoreException;
public abstract int loadBeanDefinitions(String... paramVarArgs)
throws BeanDefinitionStoreException;
}
/* Location: Z:\home\sagpatke\cme-workspace\cme\ken-spring-3.0\ken-spring-3.0.jar
* Qualified Name: org.springframework.beans.factory.support.BeanDefinitionReader
* JD-Core Version: 0.7.0.1
*/ | [
"sagarpatke@gmail.com"
] | sagarpatke@gmail.com |
309b27ea012cbe8415e5dae5d0436bad7d416ce8 | 7efbda1bff2d304f9f86259ece5127dc9ee69111 | /BIServer/src/main/java/com/tonbeller/jpivot/mondrian/MondrianQuaxChangeListener.java | 1303a1dda6582f7c1bcc37bf169acf84275e91e8 | [] | no_license | kalyansvm/biproject | 8f1bafd57b4cb8affa443a394dee2e774b9a9992 | 482b461f3b05b33b9a468526c5a59ed98dd4551c | refs/heads/master | 2021-01-10T09:34:25.669950 | 2009-05-13T01:50:17 | 2009-05-13T01:50:17 | 50,026,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 958 | java | /*
* ====================================================================
* This software is subject to the terms of the Common Public License
* Agreement, available at the following URL:
* http://www.opensource.org/licenses/cpl.html .
* Copyright (C) 2003-2004 TONBELLER AG.
* All Rights Reserved.
* You must accept the terms of that agreement to use this software.
* ====================================================================
*
*
*/
/*
* Created on 13.06.2003
* by hh
*/
package com.tonbeller.jpivot.mondrian;
import java.util.EventListener;
/**
* @param quax the Quax being changed
* @param source the initiator object of the change
* @param changedMemberSet true if the member set was changed
* by the navigator
*/
public interface MondrianQuaxChangeListener extends EventListener {
void quaxChanged(MondrianQuax quax, Object source, boolean changedMemberSet);
}
| [
"wuyiding@gmail.com"
] | wuyiding@gmail.com |
d7d0ad3d5203d420f55e628396ea3e9cbd205b60 | 3df27b037c878b7d980b5c068d3663682c09b0b3 | /src/com/wfzcx/ppms/library/zbk/dao/impl/ProZbkDaoImpl.java | a379eb836b2335648f4d4d00b199e2430eb0e596 | [] | no_license | shinow/tjec | 82fbd67886bc1f60c63af3e6054d1e4c16df2a0d | 0b2f4de2eda13acf351dfc04faceea508c9dd4b0 | refs/heads/master | 2021-09-24T15:45:42.212349 | 2018-10-11T06:13:55 | 2018-10-11T06:13:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 409 | java | package com.wfzcx.ppms.library.zbk.dao.impl;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;
import com.jbf.common.dao.impl.GenericDao;
import com.wfzcx.ppms.library.zbk.dao.ProZbkDao;
import com.wfzcx.ppms.library.zbk.po.ProZbk;
@Scope("prototype")
@Repository
public class ProZbkDaoImpl extends GenericDao<ProZbk, Integer> implements ProZbkDao{
}
| [
"lin521lh"
] | lin521lh |
9e85ccf0d15c634366e58e5d855d0adeb6e94a31 | 4b4c6ae7800aaa1bba9e76d3bdd8432792372d51 | /Download-Java-Files/Defective/i-509-c-7-SampleTest.java | adb047234e66b20efbeba6dd1e1d0f1a5a46a3f3 | [] | no_license | NorwinYu/UoN-Final-Year-Project-Public-Database | f3970f66833a490f603875bd5651ea785586662c | d5894251e9218fe20644e8c6ec04b2dd3ea3b424 | refs/heads/master | 2020-05-19T19:34:04.525379 | 2019-05-06T20:31:57 | 2019-05-06T20:31:57 | 185,180,424 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,584 | java | /*
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. 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.ballerinax.docker.test.samples;
import org.apache.commons.io.FilenameUtils;
import org.ballerinax.docker.exceptions.DockerPluginException;
import org.ballerinax.docker.test.utils.DockerTestException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
* Base class for test cases written to test samples.
*/
public interface SampleTest {
Path SAMPLE_DIR = Paths.get(FilenameUtils.separatorsToSystem(System.getProperty("sample.dir")));
Path CLIENT_BAL_FOLDER = Paths.get("src").resolve("test").resolve("resources").resolve("sample-clients")
.toAbsolutePath();
@BeforeClass
void compileSample() throws IOException, InterruptedException;
@AfterClass
void cleanUp() throws DockerPluginException, InterruptedException, DockerTestException;
}
| [
"norwinyu@gmail.com"
] | norwinyu@gmail.com |
5a2d6d7c444000f51c33058d839d2ca8033ba6aa | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/netty/2015/4/HttpResponseHandler.java | c5f51ec24c94a3b7bdf242db8505d172333eb3f5 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 4,134 | java | /*
* Copyright 2014 The Netty Project
*
* The Netty Project 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 io.netty.example.http2.client;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http2.HttpUtil;
import io.netty.util.CharsetUtil;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
/**
* Process {@link io.netty.handler.codec.http.FullHttpResponse} translated from HTTP/2 frames
*/
public class HttpResponseHandler extends SimpleChannelInboundHandler<FullHttpResponse> {
private SortedMap<Integer, ChannelPromise> streamidPromiseMap;
public HttpResponseHandler() {
streamidPromiseMap = new TreeMap<Integer, ChannelPromise>();
}
/**
* Create an association between an anticipated response stream id and a {@link io.netty.channel.ChannelPromise}
*
* @param streamId The stream for which a response is expected
* @param promise The promise object that will be used to wait/notify events
* @return The previous object associated with {@code streamId}
* @see HttpResponseHandler#awaitResponses(long, java.util.concurrent.TimeUnit)
*/
public ChannelPromise put(int streamId, ChannelPromise promise) {
return streamidPromiseMap.put(streamId, promise);
}
/**
* Wait (sequentially) for a time duration for each anticipated response
*
* @param timeout Value of time to wait for each response
* @param unit Units associated with {@code timeout}
* @see HttpResponseHandler#put(int, io.netty.channel.ChannelPromise)
*/
public void awaitResponses(long timeout, TimeUnit unit) {
Iterator<Entry<Integer, ChannelPromise>> itr = streamidPromiseMap.entrySet().iterator();
while (itr.hasNext()) {
Entry<Integer, ChannelPromise> entry = itr.next();
ChannelPromise promise = entry.getValue();
if (!promise.awaitUninterruptibly(timeout, unit)) {
throw new IllegalStateException("Timed out waiting for response on stream id " + entry.getKey());
}
if (!promise.isSuccess()) {
throw new RuntimeException(promise.cause());
}
System.out.println("---Stream id: " + entry.getKey() + " received---");
itr.remove();
}
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
Integer streamId = msg.headers().getInt(HttpUtil.ExtensionHeaderNames.STREAM_ID.text());
if (streamId == null) {
System.err.println("HttpResponseHandler unexpected message received: " + msg);
return;
}
ChannelPromise promise = streamidPromiseMap.get(streamId);
if (promise == null) {
System.err.println("Message received for unknown stream id " + streamId);
} else {
// Do stuff with the message (for now just print it)
ByteBuf content = msg.content();
if (content.isReadable()) {
int contentLength = content.readableBytes();
byte[] arr = new byte[contentLength];
content.readBytes(arr);
System.out.println(new String(arr, 0, contentLength, CharsetUtil.UTF_8));
}
promise.setSuccess();
}
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
d47e4fa69ad6962bc0beb4d7e13d852d4567cc83 | 19c43b75dba813c8f280f4f71f0efa66080ee9fe | /src/cn/pub/service/ProductService.java | e2dcc75e421163a9c971f3e24ebcab874c92bafd | [] | no_license | yxxcrtd/www.0471zk.com | b7ede403b848c511cbcac30951ab16dd48c98680 | 54c1d1aeeac3ffd5b2084957c25df98173d779b6 | refs/heads/master | 2020-05-31T15:10:55.096890 | 2019-06-05T07:47:07 | 2019-06-05T07:47:07 | 190,349,561 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,646 | java | package cn.pub.service;
import java.util.List;
import cn.pub.param.ProductQueryParam;
import cn.pub.pojos.Product;
import cn.pub.util.Pager;
/**
* 商品服务
*
* @author Yang XinXin
* @version 1.0.0, 2012-03-18 17:00:38
*/
public interface ProductService {
/**
* 根据主键标识获得对象
*
* @param id
* @return
*/
public Product findById(int id);
/**
* 商品列表
*
* @param param
* @param pager
* @return
*/
public List<Product> getProductList(ProductQueryParam param, Pager pager);
/**
* 商品列表
*
* @param param
* @param num
* @return
*/
public List<Product> getProductList(ProductQueryParam param, int num);
/**
* 根据当前商品的分类获取商品表中的所有该分类的商品
*
* @param categoryId
* @return
*/
public List<Product> getInterrelatedProductList(int categoryId);
/**
* 获得所有该分类的商品列表
*
* @param categoryId
* @return
*/
public List<Product> getProductCategoryList(int categoryId);
/**
* 根据当前商品分类Id在分类表中的父分类Id,获取商品列表
*
* @param id
* @return
*/
public List<Product> getProductList(int id);
/**
* 修改商品对象
*
* @param product
*/
public void saveOrUpdateProduct(Product product);
/**
* 删除文件
*
* @param productId
*/
public void delete(int productId);
/**
* 增加点击量
*/
public void increaseHit(int productId);
/*
* 减少限购量
*/
public void decreaseCount(int productId);
}
| [
"yxxcrtd@gmail.com"
] | yxxcrtd@gmail.com |
2dcfcb68a77eff8598a3aa4dedbee68b900b5293 | f7295dfe3c303e1d656e7dd97c67e49f52685564 | /smali/com/xiaomi/gson/internal/bind/ArrayTypeAdapter.java | e33c21580fbacda6660a9cf071e8bed7fd374d34 | [] | no_license | Eason-Chen0452/XiaoMiGame | 36a5df0cab79afc83120dab307c3014e31f36b93 | ba05d72a0a0c7096d35d57d3b396f8b5d15729ef | refs/heads/master | 2022-04-14T11:08:31.280151 | 2020-04-14T08:57:25 | 2020-04-14T08:57:25 | 255,541,211 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,932 | java | package com.xiaomi.gson.internal.bind;
import com.xiaomi.gson.Gson;
import com.xiaomi.gson.TypeAdapter;
import com.xiaomi.gson.stream.JsonReader;
import com.xiaomi.gson.stream.JsonToken;
import com.xiaomi.gson.stream.JsonWriter;
import com.xiaomi.gson.u;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
public final class ArrayTypeAdapter<E>
extends TypeAdapter<Object>
{
public static final u a = new a();
private final Class<E> b;
private final TypeAdapter<E> c;
public ArrayTypeAdapter(Gson paramGson, TypeAdapter<E> paramTypeAdapter, Class<E> paramClass)
{
this.c = new n(paramGson, paramTypeAdapter, paramClass);
this.b = paramClass;
}
public final Object a(JsonReader paramJsonReader)
{
if (paramJsonReader.f() == JsonToken.NULL)
{
paramJsonReader.j();
return null;
}
ArrayList localArrayList = new ArrayList();
paramJsonReader.a();
while (paramJsonReader.e()) {
localArrayList.add(this.c.a(paramJsonReader));
}
paramJsonReader.b();
paramJsonReader = Array.newInstance(this.b, localArrayList.size());
int i = 0;
while (i < localArrayList.size())
{
Array.set(paramJsonReader, i, localArrayList.get(i));
i += 1;
}
return paramJsonReader;
}
public final void a(JsonWriter paramJsonWriter, Object paramObject)
{
if (paramObject == null)
{
paramJsonWriter.f();
return;
}
paramJsonWriter.b();
int i = 0;
int j = Array.getLength(paramObject);
while (i < j)
{
Object localObject = Array.get(paramObject, i);
this.c.a(paramJsonWriter, localObject);
i += 1;
}
paramJsonWriter.c();
}
}
/* Location: C:\Users\Administrator\Desktop\apk\dex2jar\classes-dex2jar.jar!\com\xiaomi\gson\internal\bind\ArrayTypeAdapter.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"chen_guiq@163.com"
] | chen_guiq@163.com |
9fc21d930903877a96748477c422f63c4337315b | cebae8506a41afb0b11f94450a8ba6b780ccbefa | /mrpc-admin/src/main/java/com/kongzhong/mrpc/admin/controller/AuthController.java | 94588108e9e052f0308241a07968c8e19b29289d | [] | no_license | xiaofuta/mrpc | 72a4daaf42bfd824c6071ad96b4a4ab63dac1c4b | 63881063d6105c78dbe19aea3366d2619509f2d6 | refs/heads/master | 2020-12-02T09:58:56.224104 | 2017-07-08T15:01:59 | 2017-07-08T15:01:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,023 | java | package com.kongzhong.mrpc.admin.controller;
import com.kongzhong.mrpc.admin.config.RpcAdminProperties;
import com.kongzhong.mrpc.admin.model.LoginModel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import static com.kongzhong.mrpc.admin.config.RpcAdminConst.LOGIN_COOKIE_KEY;
import static com.kongzhong.mrpc.admin.config.RpcAdminConst.LOGIN_SESSION_KEY;
/**
* @author biezhi
* 2017/5/14
*/
@Slf4j
@Controller
public class AuthController {
@Autowired
private RpcAdminProperties rpcAdminProperties;
@GetMapping("signin")
public String signin() {
return "signin";
}
@RequestMapping("logout")
public String logout(HttpSession session) {
session.removeAttribute(LOGIN_SESSION_KEY);
return "redirect:/signin";
}
@PostMapping("signin")
public String doSignin(HttpSession session, HttpServletResponse response, Model model, LoginModel loginModel) {
log.debug("登录参数: {}", loginModel);
if (null == loginModel) {
model.addAttribute("error", "请确认用户名和密码");
return "signin";
}
if (!rpcAdminProperties.getUser().equals(loginModel.getUsername()) ||
!rpcAdminProperties.getPass().equals(loginModel.getPassword())) {
model.addAttribute("error", "用户名或密码错误");
return "signin";
}
session.setAttribute(LOGIN_SESSION_KEY, loginModel);
response.addCookie(new Cookie(LOGIN_COOKIE_KEY, loginModel.getUsername()));
return "redirect:/admin";
}
}
| [
"biezhi.me@gmail.com"
] | biezhi.me@gmail.com |
42de08a4745c0652e795cc98fd0e951e8e02c63d | 37f1aa058d9ec307e1df333e41e0c98f3d25cb68 | /univocity-trader-core/src/main/java/com/univocity/trader/strategy/TradingEngine.java | dda96c73a794a2a3cdcbaa03ef5a149104a160f5 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | wy6688/univocity-trader | dfe412314a9fc8e81bb435ce7676cffa1fe75b79 | 23ddbfab9e00f5231e1139b09e83130c7596e507 | refs/heads/master | 2022-06-20T02:03:43.745704 | 2020-05-07T15:27:09 | 2020-05-07T15:27:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,464 | java | package com.univocity.trader.strategy;
import com.univocity.trader.account.*;
import com.univocity.trader.candles.*;
import com.univocity.trader.indicators.*;
import com.univocity.trader.simulation.*;
import com.univocity.trader.utils.*;
import org.slf4j.*;
import java.util.*;
import static com.univocity.trader.utils.NewInstances.*;
/**
* @author uniVocity Software Pty Ltd - <a href="mailto:dev@univocity.com">dev@univocity.com</a>
*/
public final class TradingEngine implements Engine {
private static final Logger log = LoggerFactory.getLogger(Engine.class);
static {
Indicators.keyBuilder = null;
}
private final Trader trader;
private final Strategy[] strategies;
private final Strategy[] plainStrategies;
private final IndicatorGroup[] indicatorGroups;
private final TradingManager tradingManager;
private final Aggregator[] aggregators;
public TradingEngine(TradingManager tradingManager, Set<Object> allInstances) {
this(tradingManager, Parameters.NULL, allInstances);
}
public TradingEngine(TradingManager tradingManager, Parameters parameters, Set<Object> allInstances) {
this.tradingManager = tradingManager;
this.trader = new Trader(tradingManager, parameters, allInstances);
NewInstances<Strategy> strategies = tradingManager.getAccount().configuration().strategies();
this.strategies = getInstances(tradingManager.getSymbol(), parameters, strategies, "Strategy", true, allInstances);
Set<IndicatorGroup> groups = new LinkedHashSet<>();
Set<Strategy> plainStrategies = new LinkedHashSet<>();
for (Strategy strategy : this.strategies) {
if (strategy instanceof IndicatorGroup group) {
groups.add(group);
} else {
plainStrategies.add(strategy);
}
}
Collections.addAll(groups, trader.monitors());
indicatorGroups = groups.toArray(new IndicatorGroup[0]);
Aggregator rootAggregator = new Aggregator(trader.symbol() + parameters.toString());
for (int i = 0; i < indicatorGroups.length; i++) {
indicatorGroups[i].initialize(rootAggregator);
}
aggregators = rootAggregator.getAggregators();
this.plainStrategies = plainStrategies.toArray(new Strategy[0]);
}
public final void process(Candle candle, boolean initializing) {
for (int i = 0; i < aggregators.length; i++)
aggregators[i].aggregate(candle);
for (int i = 0; i < indicatorGroups.length; i++) {
indicatorGroups[i].accumulate(candle);
}
if (initializing) { //ignore any signals and just all strategies to populate their internal state
for (int i = 0; i < plainStrategies.length; i++) {
plainStrategies[i].getSignal(candle);
}
return;
}
trader.latestCandle = candle;
//for simulations only - tries to fill open orders using the latest candle information loaded from history.
tradingManager.updateOpenOrders(trader.symbol(), candle);
for (int i = 0; i < strategies.length; i++) {
Strategy strategy = strategies[i];
Signal signal = strategy.getSignal(candle);
if(log.isTraceEnabled()) {
log.trace("{} - {}: {} ({})", getSymbol(), candle, signal, strategy.getClass().getSimpleName());
}
try {
trader.trade(candle, signal, strategy);
} catch (Exception e) {
log.error("Error processing " + signal + " " + trader.symbol() + " generated using candle (" + candle + ") from " + strategy, e);
}
}
}
public TradingManager getTradingManager() {
return tradingManager;
}
public String getSymbol() {
return tradingManager.getSymbol();
}
}
| [
"jbax@univocity.com"
] | jbax@univocity.com |
50e2d270dbf74047ffda2039d027f795c7454870 | a00326c0e2fc8944112589cd2ad638b278f058b9 | /src/main/java/000/130/467/CWE190_Integer_Overflow__long_max_add_22b.java | 54e96ad6fc9cc33395c0d22c90a5b8f4febfc93f | [] | no_license | Lanhbao/Static-Testing-for-Juliet-Test-Suite | 6fd3f62713be7a084260eafa9ab221b1b9833be6 | b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68 | refs/heads/master | 2020-08-24T13:34:04.004149 | 2019-10-25T09:26:00 | 2019-10-25T09:26:00 | 216,822,684 | 0 | 1 | null | 2019-11-08T09:51:54 | 2019-10-22T13:37:13 | Java | UTF-8 | Java | false | false | 3,607 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__long_max_add_22b.java
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-22b.tmpl.java
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: max Set data to the max value for long
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: add
* GoodSink: Ensure there will not be an overflow before adding 1 to data
* BadSink : Add 1 to data, which can cause an overflow
* Flow Variant: 22 Control flow: Flow controlled by value of a public static variable. Sink functions are in a separate file from sources.
*
* */
public class CWE190_Integer_Overflow__long_max_add_22b
{
public void badSink(long data ) throws Throwable
{
if (CWE190_Integer_Overflow__long_max_add_22a.badPublicStatic)
{
/* POTENTIAL FLAW: if data == Long.MAX_VALUE, this will overflow */
long result = (long)(data + 1);
IO.writeLine("result: " + result);
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0L;
}
}
/* goodB2G1() - use badsource and goodsink by setting the static variable to false instead of true */
public void goodB2G1Sink(long data ) throws Throwable
{
if (CWE190_Integer_Overflow__long_max_add_22a.goodB2G1PublicStatic)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0L;
}
else
{
/* FIX: Add a check to prevent an overflow from occurring */
if (data < Long.MAX_VALUE)
{
long result = (long)(data + 1);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too large to perform addition.");
}
}
}
/* goodB2G2() - use badsource and goodsink by reversing the blocks in the if in the sink function */
public void goodB2G2Sink(long data ) throws Throwable
{
if (CWE190_Integer_Overflow__long_max_add_22a.goodB2G2PublicStatic)
{
/* FIX: Add a check to prevent an overflow from occurring */
if (data < Long.MAX_VALUE)
{
long result = (long)(data + 1);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too large to perform addition.");
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0L;
}
}
/* goodG2B() - use goodsource and badsink */
public void goodG2BSink(long data ) throws Throwable
{
if (CWE190_Integer_Overflow__long_max_add_22a.goodG2BPublicStatic)
{
/* POTENTIAL FLAW: if data == Long.MAX_VALUE, this will overflow */
long result = (long)(data + 1);
IO.writeLine("result: " + result);
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0L;
}
}
}
| [
"anhtluet12@gmail.com"
] | anhtluet12@gmail.com |
d08651066d50af33f310d0ad2f6deb5d476161ee | fc1bdca42d67d802fccd8807b4b04a5e973ef1db | /spring-data-tutorial/src/test/java/com/adarrivi/springdata/integration/dao/VehicleUsageRepositoryIntegrationTest.java | ee8f1a99196ad60103f094f0e49dca6c39ba89ce | [] | no_license | adarrivi/spring-training | 3e4ab3c23e7267cb62236983639b7656ae31f088 | 34e8c0a5d0858b84ee776b9ad26daedf0212cab4 | refs/heads/master | 2020-04-24T20:13:52.163228 | 2014-06-03T20:04:42 | 2014-06-03T20:04:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,262 | java | package com.adarrivi.springdata.integration.dao;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.adarrivi.springdata.core.dao.VehicleUsageRepository;
import com.adarrivi.springdata.core.entity.VehicleUsage;
import com.adarrivi.springdata.integration.GenericIntegrationTest;
public class VehicleUsageRepositoryIntegrationTest extends GenericIntegrationTest {
private static final Logger LOGGER = LoggerFactory.getLogger(VehicleUsageRepositoryIntegrationTest.class);
@Autowired
private VehicleUsageRepository victim;
private List<VehicleUsage> outputUsages;
@Test
public void findAll_AllUsagesAreOverZero() {
outputUsages = victim.findAll();
thenAllUsagesAreOverZero();
logOutputUsages();
}
private void thenAllUsagesAreOverZero() {
for (VehicleUsage vehicleUsage : outputUsages) {
Assert.assertTrue(vehicleUsage.getTimesUsed() > 0);
}
}
private void logOutputUsages() {
for (VehicleUsage vehicleUsage : outputUsages) {
LOGGER.debug("Result found: {}", vehicleUsage);
}
}
}
| [
"adarrivi@gmail.com"
] | adarrivi@gmail.com |
80f6ed3c377490182bf72ddbfda1a82e67bcb9f1 | ee0f1cd0e4398aaf89e32e946ac3084a64320ae4 | /src/main/java/me/giraffetree/kvsystem/common/Message.java | 615e30da589a68293440ae02671efe1bca6a9d96 | [] | no_license | giraffe-tree/kvsystem | 3e4f1124a8274aad85e8ec16a8cad455941486fb | eca25bc4e8c82e1bbc642a8e17146b341ce3b612 | refs/heads/master | 2023-07-14T04:58:59.219338 | 2021-08-22T15:03:24 | 2021-08-22T15:03:24 | 393,995,995 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,950 | java | package me.giraffetree.kvsystem.common;
import com.alibaba.fastjson.JSON;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import java.nio.charset.StandardCharsets;
@Data
public abstract class Message<T extends MessageBody> {
MessageHeader messageHeader;
T messageBody;
public Message() {
}
public Message(MessageHeader messageHeader, T messageBody) {
this.messageHeader = messageHeader;
this.messageBody = messageBody;
}
public T getMessageBody() {
return messageBody;
}
public void encode(ByteBuf byteBuf) {
// header 部分
byteBuf.writeInt(messageHeader.getVersion());
byte[] traceIdBytes = messageHeader.getTraceId().getBytes(StandardCharsets.UTF_8);
byteBuf.writeInt(traceIdBytes.length);
byteBuf.writeBytes(traceIdBytes);
byte[] operationBytes = messageHeader.getOperation().getBytes(StandardCharsets.UTF_8);
byteBuf.writeInt(operationBytes.length);
byteBuf.writeBytes(operationBytes);
// body 部分
byteBuf.writeBytes(JSON.toJSONBytes(messageBody));
}
public abstract Class<T> getMessageBodyDecodeClass(String operation);
public abstract OperationType getOperationType(String operation);
public OperationType decode(ByteBuf msg) {
int version = msg.readInt();
int traceIdLen = msg.readInt();
String traceId = msg.readBytes(traceIdLen).toString(StandardCharsets.UTF_8);
int operationLen = msg.readInt();
String operation = msg.readBytes(operationLen).toString(StandardCharsets.UTF_8);
this.messageHeader = new MessageHeader(version, traceId, operation);
OperationType operationType = getOperationType(operation);
Class<T> bodyClazz = getMessageBodyDecodeClass(operation);
this.messageBody = JSON.parseObject(msg.toString(StandardCharsets.UTF_8), bodyClazz);
return operationType;
}
}
| [
"15355498770@163.com"
] | 15355498770@163.com |
f083e550a40bab22a37e19f8c6ecba87fcdb690a | afba7955718844d9a74515168f8bd8e728ec27ba | /src/main/java/eu/matejkormuth/starving/missions/MissionsModule.java | 25f51db31372b7f2839a5d1e194fac18b3d0610f | [
"BSD-2-Clause"
] | permissive | dobrakmato/starving3 | 5af7dcc0d7391938c4b28e0ac72a78e88a3454b0 | fda627c56c657be25ee8c675aabf6bdd4079dab7 | refs/heads/master | 2022-06-21T21:05:09.492105 | 2020-10-13T09:01:09 | 2020-10-13T09:01:09 | 39,527,933 | 0 | 1 | NOASSERTION | 2022-06-21T00:46:52 | 2015-07-22T20:11:50 | Java | UTF-8 | Java | false | false | 3,363 | java | /**
* Starving - Bukkit API server mod with Zombies.
* Copyright (c) 2015, Matej Kormuth <http://www.github.com/dobrakmato>
* 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.
*
* 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 eu.matejkormuth.starving.missions;
import eu.matejkormuth.bmboot.Dependency;
import eu.matejkormuth.bmboot.internal.Module;
import eu.matejkormuth.starving.cinematics.CinematicsModule;
import eu.matejkormuth.starving.filestorage.FileStorageModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
import java.util.HashMap;
import java.util.Map;
public class MissionsModule extends Module {
private static final Logger log = LoggerFactory.getLogger(MissionsModule.class);
@Dependency
private CinematicsModule cinematicsModule;
@Dependency
private FileStorageModule fileStorageModule;
/**
* Map of all missions.
*/
private Map<Integer, Mission> allMissions = new HashMap<>();
@Override
public void onEnable() {
StorageFactory.fileStorageModule = fileStorageModule;
log.info("Trying to initialize all Alpha missions...");
AlphaMissions.init(this);
}
@Override
public void onDisable() {
StorageFactory.fileStorageModule = null;
}
public CinematicsModule getCinematicsModule() {
return cinematicsModule;
}
/**
* Adds specific mission to game.
*
* @param mission mission to add
*/
public void addMission(@Nonnull Mission mission) {
if (allMissions.containsKey(mission.getId())) {
log.error("Mission ID must be unique! Mission with specific id is already registered!");
log.error(" Tried to register: {} with id {}.", mission.getName(), mission.getId());
log.error(" Already registered: {} with id {}.", allMissions.get(mission.getId()).getName(),
allMissions.get(mission.getId()).getId());
log.error("Mission {} was not registered!", mission.getName());
return;
}
allMissions.put(mission.getId(), mission);
}
}
| [
"dobrakmato@gmail.com"
] | dobrakmato@gmail.com |
f6fd06a3d99aee69ff8470c30d2eec151f7961b0 | 2fd9d77d529e9b90fd077d0aa5ed2889525129e3 | /DecompiledViberSrc/app/src/main/java/com/viber/voip/messages/controller/al.java | e0295f06bbb827f9862fe080d6b6a34b45ec81a5 | [] | no_license | cga2351/code | 703f5d49dc3be45eafc4521e931f8d9d270e8a92 | 4e35fb567d359c252c2feca1e21b3a2a386f2bdb | refs/heads/master | 2021-07-08T15:11:06.299852 | 2021-05-06T13:22:21 | 2021-05-06T13:22:21 | 60,314,071 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 372 | java | package com.viber.voip.messages.controller;
final class al
implements aj.a
{
private final ai.k a;
al(ai.k arg1)
{
}
public void a(ai arg1)
{
}
}
/* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_3_dex2jar.jar
* Qualified Name: com.viber.voip.messages.controller.al
* JD-Core Version: 0.6.2
*/ | [
"yu.liang@navercorp.com"
] | yu.liang@navercorp.com |
005de860f21bfc50f5cf5cb87d926112b0553d9a | eb9f655206c43c12b497c667ba56a0d358b6bc3a | /java/java-tests/testData/refactoring/introduceVariable/NonPatternVariableDeclarationTwoBlocksJava16.java | 00e2bb0c3435839cded97d06f20eda53158d3188 | [
"Apache-2.0"
] | permissive | JetBrains/intellij-community | 2ed226e200ecc17c037dcddd4a006de56cd43941 | 05dbd4575d01a213f3f4d69aa4968473f2536142 | refs/heads/master | 2023-09-03T17:06:37.560889 | 2023-09-03T11:51:00 | 2023-09-03T12:12:27 | 2,489,216 | 16,288 | 6,635 | Apache-2.0 | 2023-09-12T07:41:58 | 2011-09-30T13:33:05 | null | UTF-8 | Java | false | false | 500 | java | class A {
private void test(Object obj) {
if (obj instanceof String) {
System.out.println(((String) obj).trim());
System.out.println(((String) obj).trim());
System.out.println(<selection>((String) obj)</selection>.trim());
}
if (obj instanceof String) {
System.out.println(((String) obj).trim());
System.out.println(((String) obj).trim());
System.out.println(((String) obj).trim());
}
}
} | [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
e45d2bb873b9de126e33a0beb44f7523dd8ecf23 | 1f3d84829b7e737e6946531d52e6ec4a2c2850e6 | /bus-proxy/src/main/java/org/aoju/bus/proxy/intercept/MethodInterceptorAdapter.java | d61f5542f782c102dd292cba766dff4435c366e2 | [
"MIT"
] | permissive | ArnoldZhou/bus | 1a8acfb6936edaa92f4e3fd059c08272508d9000 | cdda4e470d4da79097a247176637a0e1b25fff9e | refs/heads/master | 2020-07-05T16:25:48.087330 | 2019-08-16T05:16:32 | 2019-08-16T05:16:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,663 | java | /*
* The MIT License
*
* Copyright (c) 2017, aoju.org All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.aoju.bus.proxy.intercept;
import org.aoju.bus.proxy.Interceptor;
import org.aoju.bus.proxy.Invocation;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
/**
* @author Kimi Liu
* @version 3.0.6
* @since JDK 1.8
*/
public class MethodInterceptorAdapter implements Interceptor {
private final MethodInterceptor methodInterceptor;
public MethodInterceptorAdapter(MethodInterceptor methodInterceptor) {
this.methodInterceptor = methodInterceptor;
}
public Object intercept(Invocation invocation) throws Throwable {
return methodInterceptor.invoke(new MethodInvocationAdapter(invocation));
}
private static class MethodInvocationAdapter implements MethodInvocation {
private final Invocation invocation;
public MethodInvocationAdapter(Invocation invocation) {
this.invocation = invocation;
}
public Method getMethod() {
return invocation.getMethod();
}
public Object[] getArguments() {
return invocation.getArguments();
}
public Object proceed() throws Throwable {
return invocation.proceed();
}
public Object getThis() {
return invocation.getProxy();
}
public AccessibleObject getStaticPart() {
return invocation.getMethod();
}
}
}
| [
"839536@QQ.COM"
] | 839536@QQ.COM |
10996589ba19a3abf39b2a658b97ecc06aba0b27 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/LANG-54b-1-21-MOEAD-WeightedSum:TestLen:CallDiversity/org/apache/commons/lang/LocaleUtils_ESTest_scaffolding.java | 4de5739cca8a7edd5bc38cebca31159661dc841f | [] | 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 | 1,917 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Apr 08 08:46:23 UTC 2020
*/
package org.apache.commons.lang;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class LocaleUtils_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.lang.LocaleUtils";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(LocaleUtils_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.lang.LocaleUtils"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
18404336b3f969022ee29a6f8900680c39556691 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /src/irvine/oeis/a148/A148267.java | 632fc50bd36e4386ee6e927ded07b70fddb9c040 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 589 | java | package irvine.oeis.a148;
// Generated by gen_seq4.pl walk23 3 5 1 222220211102100 at 2019-07-08 22:06
// DO NOT EDIT here!
import irvine.oeis.WalkCubeSequence;
/**
* A148267 Number of walks within <code>N^3</code> (the first octant of <code>Z^3)</code> starting at <code>(0,0,0)</code> and consisting of n steps taken from <code>{(-1, -1, -1), (-1, -1, 0), (-1, 1, 1), (1, 0, -1), (1, 0, 0)}</code>.
* @author Georg Fischer
*/
public class A148267 extends WalkCubeSequence {
/** Construct the sequence. */
public A148267() {
super(0, 3, 5, "", 1, "222220211102100");
}
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
2bd7dd9e86a5a778d4d5b7915f200079b24a7669 | d63f73215e10aae8461b6ae7553601077b75d6a9 | /optaplanner-core/src/test/java/org/optaplanner/core/impl/testdata/domain/nullable/TestdataNullableSolution.java | b7fd22d53d510a8fb4a593923aa932a4a02a2916 | [
"Apache-2.0"
] | permissive | rauoll/optaplanner | 8c302b0fd22b6b7777cc34223a3e2153a8f63968 | c2b7dffdd7417dc05c1f61b842a24c739402e7d9 | refs/heads/master | 2021-01-15T08:09:24.046211 | 2014-09-15T15:05:46 | 2014-09-15T15:05:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,785 | java | /*
* Copyright 2012 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 org.optaplanner.core.impl.testdata.domain.nullable;
import java.util.Collection;
import java.util.List;
import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty;
import org.optaplanner.core.api.domain.solution.PlanningSolution;
import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider;
import org.optaplanner.core.api.score.buildin.simple.SimpleScore;
import org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor;
import org.optaplanner.core.api.domain.solution.Solution;
import org.optaplanner.core.impl.testdata.domain.TestdataObject;
import org.optaplanner.core.impl.testdata.domain.TestdataUtils;
import org.optaplanner.core.impl.testdata.domain.TestdataValue;
@PlanningSolution
public class TestdataNullableSolution extends TestdataObject implements Solution<SimpleScore> {
public static SolutionDescriptor buildSolutionDescriptor() {
return TestdataUtils.buildSolutionDescriptor(TestdataNullableSolution.class, TestdataNullableEntity.class);
}
private List<TestdataValue> valueList;
private List<TestdataNullableEntity> entityList;
private SimpleScore score;
public TestdataNullableSolution() {
}
public TestdataNullableSolution(String code) {
super(code);
}
@ValueRangeProvider(id = "valueRange")
public List<TestdataValue> getValueList() {
return valueList;
}
public void setValueList(List<TestdataValue> valueList) {
this.valueList = valueList;
}
@PlanningEntityCollectionProperty
public List<TestdataNullableEntity> getEntityList() {
return entityList;
}
public void setEntityList(List<TestdataNullableEntity> entityList) {
this.entityList = entityList;
}
public SimpleScore getScore() {
return score;
}
public void setScore(SimpleScore score) {
this.score = score;
}
// ************************************************************************
// Complex methods
// ************************************************************************
public Collection<? extends Object> getProblemFacts() {
return valueList;
}
}
| [
"gds.geoffrey.de.smet@gmail.com"
] | gds.geoffrey.de.smet@gmail.com |
5bd80514d4be6f8facc6e196359ab6055ee798f7 | 32b72e1dc8b6ee1be2e80bb70a03a021c83db550 | /ast_results/gjedeer_mylocation/app/src/main/java/net/mypapit/mobile/myposition/AboutDialog.java | 5e4b03ca6277a19098f40d65a5d2d57ee16bbe43 | [] | no_license | cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | d90c41a17e88fcd99d543124eeb6e93f9133cb4a | 0564143d92f8024ff5fa6b659c2baebf827582b1 | refs/heads/master | 2020-07-13T13:53:40.297493 | 2019-01-11T11:51:18 | 2019-01-11T11:51:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,892 | java | // isComment
package net.mypapit.mobile.myposition;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.text.util.Linkify;
import android.graphics.Color;
import android.widget.TextView;
public class isClassOrIsInterface extends Dialog {
private static Context isVariable = null;
public isConstructor(Context isParameter) {
super(isNameExpr);
isNameExpr = isNameExpr;
}
/**
* isComment
*/
@Override
public void isMethod(Bundle isParameter) {
isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
TextView isVariable = (TextView) isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr));
isNameExpr = (TextView) isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr)));
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
isNameExpr.isMethod(isNameExpr, isNameExpr.isFieldAccessExpr);
}
public static String isMethod(int isParameter) {
InputStream isVariable = isNameExpr.isMethod().isMethod(isNameExpr);
InputStreamReader isVariable = new InputStreamReader(isNameExpr);
BufferedReader isVariable = new BufferedReader(isNameExpr);
String isVariable;
StringBuilder isVariable = new StringBuilder();
try {
while ((isNameExpr = isNameExpr.isMethod()) != null) isNameExpr.isMethod(isNameExpr);
} catch (IOException isParameter) {
return null;
}
return isNameExpr.isMethod();
}
}
| [
"matheus@melsolucoes.net"
] | matheus@melsolucoes.net |
451cba802bfba13d63e86601f9096a09b86745fb | 5010ca4b276d23cc627ae4db81089393077e39ec | /src/main/java/top/kuangcp/graduate/domain/vo/MajorVO.java | bd8db8e0baf406489ed6dc19ddc21e8adbe2c648 | [
"Apache-2.0"
] | permissive | andersJava/Graduate | a8fcb080e3123fa3198f2d253aee6df8bede487d | 9fd9dbb308d74472e69d83a0a3825896f928dbae | refs/heads/master | 2020-06-11T20:06:49.737562 | 2018-09-02T15:02:41 | 2018-09-02T15:02:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 603 | java | package top.kuangcp.graduate.domain.vo;
import lombok.Data;
import top.kuangcp.graduate.domain.doc.Major;
/**
* Created by https://github.com/kuangcp
*
* @author kuangcp
* @date 18-5-2 上午10:05
*/
@Data
public class MajorVO {
private Long majorId;
private String name;
private Long collegeId;
private String leader;
public static MajorVO of(Major major) {
MajorVO majorVO = new MajorVO();
majorVO.setMajorId(major.getMajorId());
majorVO.setCollegeId(major.getCollegeId());
majorVO.setName(major.getName());
return majorVO;
}
}
| [
"kuangcp@aliyun.com"
] | kuangcp@aliyun.com |
1b688ace3953fb56538a4d4e7f7e4f5d26dde781 | 95a54e3f3617bf55883210f0b5753b896ad48549 | /java_src/kotlinx/coroutines/scheduling/TaskMode.java | 79823d3ba39aa7de0de68cf5c400fa74a07b2cd6 | [] | 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 | 578 | java | package kotlinx.coroutines.scheduling;
import kotlin.Metadata;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0004\b\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004¨\u0006\u0005"}, d2 = {"Lkotlinx/coroutines/scheduling/TaskMode;", "", "(Ljava/lang/String;I)V", "NON_BLOCKING", "PROBABLY_BLOCKING", "kotlinx-coroutines-core"}, k = 1, mv = {1, 1, 13})
/* compiled from: Tasks.kt */
public enum TaskMode {
NON_BLOCKING,
PROBABLY_BLOCKING
}
| [
"ai@AIs-MacBook-Pro.local"
] | ai@AIs-MacBook-Pro.local |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.