blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 332 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 7 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 557 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 82 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 7 5.41M | extension stringclasses 11 values | content stringlengths 7 5.41M | authors listlengths 1 1 | author stringlengths 0 161 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cc70f9e4a3bd6270b3a607d22d215e128e1a1056 | f01e7adf72efcdffa35d04f991661150be1b17fc | /app/src/main/java/Stables/LastRemember.java | 1f85ad9b64c059636b9a76c25676179f617bac80 | [] | no_license | charles-desilva/wallet-android | 0a56297161a7215ef2e5435cd274671f2e372e53 | 10e8b6508508ed449c4820ee10fb4dc8579408c0 | refs/heads/master | 2023-02-26T15:40:23.183950 | 2021-02-03T06:22:55 | 2021-02-03T06:22:55 | 335,526,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 530 | java | package Stables;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.vaofim.boffin.addPayments;
import com.vaofim.boffin.add_income;
import com.vaofim.boffin.recordCreditNotes;
import com.vaofim.boffin.recordInvoices;
public class LastRemember extends AppCompatActivity {
public static addPayments addPayments;
public static add_income add_income;
public static recordCreditNotes recordCreditNotes;
public static recordInvoices recordInvoices;
}
| [
"charles.s.desilva@gmail.com"
] | charles.s.desilva@gmail.com |
2fe52492f694aae84c35d797d9384265d2edcb4d | e104bd1ef1f90f125499ff6d2ad40e34a0227af1 | /UI/src/main/java/com/qiyei/ui/ui/activity/BannerTestActivity.java | fcb8045481265626524f97bd0d4251e494eda1a0 | [] | no_license | zhangfeng91/EssayJoke | c89e8d524a7d10c8e508a097d31bff6a9de7de01 | 8cbdf91609e0fde20908b9f39150334aac36611d | refs/heads/master | 2020-06-20T11:53:59.884032 | 2019-05-02T14:22:01 | 2019-05-02T14:22:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,235 | java | package com.qiyei.ui.ui.activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import com.qiyei.framework.data.protocol.DiscoverListResp;
import com.qiyei.sdk.http.HttpManager;
import com.qiyei.sdk.http.base.HttpRequest;
import com.qiyei.sdk.http.base.INetCallback;
import com.qiyei.sdk.http.base.RequestMethod;
import com.qiyei.sdk.image.ImageManager;
import com.qiyei.sdk.log.LogManager;
import com.qiyei.sdk.util.ToastUtil;
import com.qiyei.sdk.view.banner.BannerAdapter;
import com.qiyei.sdk.view.banner.BannerViewPager;
import com.qiyei.ui.R;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class BannerTestActivity extends AppCompatActivity {
private final static String TAG = "BannerTestActivity";
private BannerViewPager mBannerViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_banner_test);
mBannerViewPager = (BannerViewPager) findViewById(R.id.banner_view_pager);
new HttpManager().execute(getSupportFragmentManager(),buildRequest(), new INetCallback<DiscoverListResp>() {
@Override
public void onSuccess(DiscoverListResp result) {
LogManager.d(TAG,"name --> "+result.getData().getCategories().getName());
//ToastUtil.showLongToast(result.getData().getCategories().getName());
initBanner(result.getData().getRotate_banner().getBanners());
}
@Override
public void onFail(Exception e) {
LogManager.d(TAG,e.getMessage());
ToastUtil.showLongToast(e.getMessage());
}
});
}
private void addCommonParams(Map<String,Object> params){
params.put("app_name","joke_essay");
params.put("version_name","5.7.0");
params.put("ac","wifi");
params.put("device_id","30036118478");
params.put("device_brand","Xiaomi");
params.put("update_version_code","5701");
params.put("manifest_version_code","570");
params.put("longitude","113.000366");
params.put("latitude","28.171377");
params.put("device_platform","android");
}
private HttpRequest buildRequest(){
HttpRequest request = new HttpRequest();
request.setUrl("http://is.snssdk.com/2/essay/discovery/v3/");
Map<String,Object> params = new HashMap<>();
params.put("iid","6152551759");
params.put("aid","7");
params.put("channel",360);
addCommonParams(params);
request.setParams(params);
request.setRequestMethod(RequestMethod.GET);
request.setUseCache(true);
return request;
}
private void initBanner(final List<DiscoverListResp.DataBean.RotateBannerBean.BannersBean> list){
mBannerViewPager.setAdapter(new BannerAdapter() {
@Override
public int getCount() {
//LogManager.d(TAG,"banner size --> " + list.size());
return list.size();
}
@Override
public View getView(int position,View convertView) {
ImageView bannerIv = null;
if (convertView != null){
bannerIv = (ImageView) convertView;
}else {
bannerIv = new ImageView(BannerTestActivity.this);
}
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.gravity = Gravity.TOP;
bannerIv.setLayoutParams(layoutParams);
bannerIv.setScaleType(ImageView.ScaleType.FIT_XY);
String url = list.get(position).getBanner_url().getUrl_list().get(0).getUrl();
ImageManager.getInstance().loadImage(bannerIv,url);
return bannerIv;
}
});
mBannerViewPager.startLoop();
}
}
| [
"1273482124@qq.com"
] | 1273482124@qq.com |
1c9a0014b69139296e80fb870cf7459b63101901 | 91bdc066eb94af58d5598d2805bf94acc3cfcd9c | /src/src/com/yixin/monitors/sdk/model/SignDataModel.java | c5f5475441937bc792708e0549865d307871c2e6 | [] | no_license | raee/monitorsdk | d3a49c1e559fa96c53abedd99a191e4eae9c3c9c | 901aa6fca4c0149a64f1f9ff97b91e88869be572 | refs/heads/master | 2021-01-18T22:42:22.076091 | 2017-04-05T09:12:44 | 2017-04-05T09:12:44 | 23,957,312 | 6 | 7 | null | null | null | null | UTF-8 | Java | false | false | 2,926 | java | package com.yixin.monitors.sdk.model;
import java.text.SimpleDateFormat;
import java.util.Date;
import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
/**
* 体征数据实体
*
* @author ChenRui
*
*/
public class SignDataModel implements Parcelable {
/**
*
*/
// private static final long serialVersionUID = 3981448226950291143L;
public static Parcelable.Creator<SignDataModel> CREATOR = new Creator<SignDataModel>() {
@Override
public SignDataModel[] newArray(int size) {
return new SignDataModel[size];
}
@Override
public SignDataModel createFromParcel(Parcel source) {
SignDataModel model = new SignDataModel();
source.readString();
model.setDataName(source.readString());
model.setValue(source.readString());
model.setUnit(source.readString());
model.setDate(source.readString());
model.setDataType(source.readInt());
return model;
}
};
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(dataName);
dest.writeString(value);
dest.writeString(unit);
dest.writeString(date);
dest.writeInt(dataType);
}
/**
* 数据类型名称
*/
private String dataName;
// 数据类型
private int dataType;
/**
* 接收数据日期
*/
private String date;
/**
* 单位
*/
private String unit;
// 数据值
private String value;
/**
* 获取dataName
*
* @return the dataName
*/
public String getDataName() {
return dataName;
}
/**
* 获取dataType
*
* @return the dataType
*/
public int getDataType() {
return dataType;
}
@SuppressLint("SimpleDateFormat")
public String getDate() {
if (date == null) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return df.format(new Date());
}
return date;
}
public String getUnit() {
return unit;
}
/**
* 获取value
*
* @return the value
*/
public String getValue() {
return value;
}
/**
* 设置 dataName
*
* @param dataName
* 设置 dataName 的值
*/
public void setDataName(String dataName) {
this.dataName = dataName;
}
/**
* 设置 dataType
*
* @param dataType
* 设置 dataType 的值
*/
public void setDataType(int dataType) {
this.dataType = dataType;
}
public void setDate(String date) {
this.date = date;
}
public void setUnit(String unit) {
this.unit = unit;
}
/**
* 设置 value
*
* @param value
* 设置 value 的值
*/
public void setValue(String value) {
this.value = value;
}
@Override
public int describeContents() {
return 0;
}
} | [
"798404374@qq.com"
] | 798404374@qq.com |
9f260b192f0ca2c61d9b33d15cb4756aa7085810 | 7487a1b09e0cd0aebd44adf9e2f475a6866c2b06 | /src/main/java/com/sidenis/qaacademy/selenium/blocks/yandex/YandexMusicSearchBlock.java | 296be7f8dc90a419343c6f0257790e2d93506ad8 | [] | no_license | vka0702/RestAndSelenium | 8b1f2b4d6401d1c12c711366d191cbe5ee3b943b | 6fc4857d6beb8684255eaa7e8f0775d159cdb6ed | refs/heads/master | 2021-07-02T18:59:14.999426 | 2019-08-05T04:41:24 | 2019-08-05T04:41:24 | 229,410,394 | 0 | 0 | null | 2021-04-26T19:48:42 | 2019-12-21T10:16:51 | Java | UTF-8 | Java | false | false | 686 | java | package com.sidenis.qaacademy.selenium.blocks.yandex;
import org.openqa.selenium.support.FindBy;
import ru.yandex.qatools.htmlelements.annotations.Name;
import ru.yandex.qatools.htmlelements.element.Button;
import ru.yandex.qatools.htmlelements.element.HtmlElement;
import ru.yandex.qatools.htmlelements.element.TextInput;
@Name("Music search panel")
@FindBy(css = "div.head__left")
public class YandexMusicSearchBlock extends HtmlElement {
@Name("Search music input")
@FindBy(css = "input.d-input__field.deco-input_suggest")
public TextInput musicInput;
@Name("Search music button")
@FindBy (css = ".head__search button")
public Button musicSearchButton;
}
| [
"Kirill.Vasilyev@sidenis.com"
] | Kirill.Vasilyev@sidenis.com |
a8ff4f4d27ddc676e374ccd4aee23a02b0d800b5 | 3eca1ed838a62899e46f51e13b8a91e79d11f148 | /src/main/java/edu/anadolu/knn/TFDAwareNeed.java | 46d5818ee9ba76e95a321b8d2ec59aaf05cbc0f5 | [
"Apache-2.0"
] | permissive | iorixxx/lucene-clueweb-retrieval | a5d7852a1de99b5d32559baf489589bdf513b972 | 424b0b696afac3ebcf5bb661e331ea77674595ec | refs/heads/master | 2023-06-23T06:54:15.474246 | 2022-10-13T23:19:22 | 2022-10-13T23:19:22 | 88,444,585 | 9 | 6 | Apache-2.0 | 2023-06-14T22:54:34 | 2017-04-16T21:47:53 | Java | UTF-8 | Java | false | false | 10,031 | java | package edu.anadolu.knn;
import edu.anadolu.analysis.Analyzers;
import edu.anadolu.analysis.Tag;
import org.apache.lucene.analysis.Analyzer;
import org.clueweb09.InfoNeed;
import java.util.*;
/**
* Term Frequency Distribution Aware Information Need
*/
public class TFDAwareNeed extends InfoNeed {
// private final Analyzer analyzer;
private final List<Long[]> termFreqDist;
private List<Long[]> termFreqDistZero;
final List<Double[]> termFreqDistNormalized;
public final Double[] termFreqDistNormalized(String word, Analyzer analyzer) {
return termFreqDistMap.get(Analyzers.getAnalyzedToken(word, analyzer));
}
final Double[] dfAndAverage;
final Double[] averageAndDF;
final Double[] geoAndDF;
final Double[] dfAndGeo;
final Long[] average;
Long[] averageZero;
private <T extends Number> void checkArraySizes(List<T[]> list) {
final int size = list.get(0).length;
for (T[] a : list)
if (a.length != size)
throw new RuntimeException("arrays in the list have different size than " + size);
}
public <T extends Number> TFDAwareNeed(InfoNeed need, List<T[]> termFreqDist) {
super(need);
checkArraySizes(termFreqDist);
this.termFreqDist = new ArrayList<>(termFreqDist.size());
for (T[] t : termFreqDist) {
this.termFreqDist.add(number2long(t));
}
this.termFreqDistNormalized = normalize(termFreqDist);
this.dfAndAverage = dfAndAverage(termFreqDist);
this.averageAndDF = averageAndDF(termFreqDist);
this.geoAndDF = null; //geoAndDF(termFreqDist);
this.dfAndGeo = null;//dfAndGeo(termFreqDist);
this.average = averageLong(termFreqDist);
}
LinkedHashMap<String, Double[]> termFreqDistMap;
public TFDAwareNeed(InfoNeed need, LinkedHashMap<String, Long[]> termFreqDistMap) {
this(need, new ArrayList<>(termFreqDistMap.values()));
this.termFreqDistMap = map2map(termFreqDistMap);
this.rawTermFreqDistMap = termFreqDistMap;
}
private <T extends Number> LinkedHashMap<String, Double[]> map2map(Map<String, T[]> termFreqDistMap) {
LinkedHashMap<String, Double[]> map = new LinkedHashMap<>();
for (Map.Entry<String, T[]> entry : termFreqDistMap.entrySet()) {
T[] a = entry.getValue();
double df = df(a);
final Double[] array = new Double[a.length];
for (int i = 0; i < a.length; i++)
array[i] = a[i].doubleValue() / df;
map.put(entry.getKey(), array);
}
return map;
}
List<Double[]> termFreqDistZeroNormalized;
public Double[] termFreqDistZeroNormalized(String word, Analyzer analyzer) {
return termFreqDistZeroMap.get(Analyzers.getAnalyzedToken(word, analyzer));
}
Double[] dfAndAverageZero;
Double[] averageAndDFZero;
Double[] geoAndDFZero;
Double[] dfAndGeoZero;
public Long[] termFreqDistZeroRaw(String word, Analyzer analyzer) {
return rawTermFreqDistZeroMap.get(Analyzers.getAnalyzedToken(word, analyzer));
}
private LinkedHashMap<String, Long[]> rawTermFreqDistZeroMap = new LinkedHashMap<>();
private LinkedHashMap<String, Long[]> rawTermFreqDistMap = new LinkedHashMap<>();
public <T extends Number> void setZero(List<T[]> termFreqDistZero) {
checkArraySizes(termFreqDistZero);
this.termFreqDistZero = new ArrayList<>(termFreqDistZero.size());
for (T[] t : termFreqDistZero)
this.termFreqDistZero.add(number2long(t));
this.termFreqDistZeroNormalized = normalize(termFreqDistZero);
this.dfAndAverageZero = dfAndAverage(termFreqDistZero);
this.averageAndDFZero = averageAndDF(termFreqDistZero);
this.geoAndDFZero = null;//geoAndDF(termFreqDistZero);
this.dfAndGeoZero = null;//dfAndGeo(termFreqDistZero);
this.averageZero = averageLong(termFreqDistZero);
}
LinkedHashMap<String, Double[]> termFreqDistZeroMap;
public void setZero(LinkedHashMap<String, Long[]> termFreqDistZeroMap) {
this.setZero(new ArrayList<>(termFreqDistZeroMap.values()));
this.termFreqDistZeroMap = map2map(termFreqDistZeroMap);
this.rawTermFreqDistZeroMap = termFreqDistZeroMap;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder(super.toString()).append("\n");
builder.append("--------------------------\n");
for (String word : distinctSet) {
Long[] array = rawTermFreqDistZeroMap.get(Analyzers.getAnalyzedToken(word, Analyzers.analyzer(Tag.KStem)));
builder.append(id()).append(":").append(word).append("\t");
for (int i = 0; i < Math.min(10, array.length); i++)
builder.append(array[i]).append("\t");
builder.append("\n");
}
/**
builder.append(id()).append(":").append("Geo\t");
for (int i = 0; i < 10; i++)
builder.append(String.format("%.1f", geo[i])).append("\t");
builder.append("\n");
builder.append(id()).append(":").append("Average\t");
for (int i = 0; i < 10; i++)
builder.append(String.format("%.1f", average[i])).append("\t");
builder.append("\n");
builder.append(id()).append(":").append("MetaTerm\t");
for (int i = 0; i < 10; i++)
builder.append(queryFreqDist[i]).append("\t");
builder.append("\n");
**/
return builder.toString();
}
private static <T extends Number> Double[] average(List<T[]> list) {
if (list.size() == 1) return number2double(list.get(0));
final Double[] array = new Double[list.get(0).length];
Arrays.fill(array, 0.0);
for (T[] a : list)
for (int i = 0; i < array.length; i++)
array[i] += a[i].doubleValue();
for (int i = 0; i < array.length; i++)
array[i] /= list.size();
return array;
}
public static <T extends Number> Double[] dfAndAverage(List<T[]> list) {
// if (list.size() == 1) return list.get(0);
final Double[] array = new Double[list.get(0).length];
Arrays.fill(array, 0.0);
for (T[] a : list) {
double df = df(a);
for (int i = 0; i < array.length; i++)
array[i] += a[i].doubleValue() / df;
}
for (int i = 0; i < array.length; i++)
array[i] /= (double) list.size();
return array;
}
public static Double[] dfAndGeo(List<Long[]> list) {
List<Double[]> normalized = normalize(list);
return geoD(normalized);
}
public static Long df(Long[] R) {
long df = 0L;
for (Long l : R)
df += l;
return df;
}
public static <T extends Number> Double df(T[] R) {
double df = 0.0;
for (T t : R)
df += t.doubleValue();
return df;
}
static <T extends Number> Double[] number2double(T[] array) {
Double[] doubles = new Double[array.length];
for (int i = 0; i < array.length; i++)
doubles[i] = array[i].doubleValue();
return doubles;
}
static <T extends Number> Long[] number2long(T[] array) {
Long[] longs = new Long[array.length];
for (int i = 0; i < array.length; i++)
longs[i] = array[i].longValue();
return longs;
}
public static <T extends Number> List<Double[]> normalize(List<T[]> termFreqDist) {
List<Double[]> returnValue = new ArrayList<>(termFreqDist.size());
for (T[] a : termFreqDist) {
double df = df(a);
final Double[] array = new Double[a.length];
for (int i = 0; i < a.length; i++)
array[i] = a[i].doubleValue() / df;
returnValue.add(array);
}
return returnValue;
}
public static <T extends Number> Double[] averageAndDF(List<T[]> list) {
Double[] average = average(list);
Double df = df(average);
final Double[] array = new Double[list.get(0).length];
Arrays.fill(array, 0.0);
for (int i = 0; i < average.length; i++)
array[i] = (double) average[i] / df;
return array;
}
public static Double[] geoAndDF(List<Long[]> list) {
Double[] geo = geo(list);
Double df = df(geo);
final Double[] array = new Double[list.get(0).length];
Arrays.fill(array, 0.0);
for (int i = 0; i < geo.length; i++)
array[i] = (double) geo[i] / df;
return array;
}
static Double[] geo(List<Long[]> list) {
if (list.size() == 1) return number2double(list.get(0));
final Double[] result = new Double[list.get(0).length];
Arrays.fill(result, 0.0);
for (int i = 0; i < result.length; i++) {
double mul = 1.0;
for (Long[] a : list)
mul *= a[i];
result[i] = Math.pow(mul, 1.0d / list.size());
}
return result;
}
static Double[] geoD(List<Double[]> list) {
if (list.size() == 1) return list.get(0);
final Double[] result = new Double[list.get(0).length];
Arrays.fill(result, 0.0);
for (int i = 0; i < result.length; i++) {
double mul = 1.0;
for (Double[] a : list)
mul *= a[i];
result[i] = Math.pow(mul, 1.0d / list.size());
}
return result;
}
static <T extends Number> Long[] averageLong(List<T[]> list) {
final Long[] array = new Long[list.get(0).length];
Arrays.fill(array, 0L);
for (T[] a : list)
for (int i = 0; i < array.length; i++)
array[i] += a[i].longValue();
for (int i = 0; i < array.length; i++)
array[i] /= list.size();
return array;
}
}
| [
"iorixxx@yahoo.com"
] | iorixxx@yahoo.com |
e49688ae2e81c9485ec9ed7ede2bece4da24c31a | c9a0aa86b0705f593152567d0179b0701beea3a5 | /java20181210/src/com/czm/ch2/Test1.java | e69abdf5f08842135ee8da7a4be73f2ef041e1d6 | [] | no_license | dagf113225/javase | 10360af98a666ccf59900dc447dceb65961065be | 308945826581a62d4862788c2155a883b6873ea9 | refs/heads/master | 2020-04-04T16:29:57.544501 | 2018-12-19T08:59:44 | 2018-12-19T08:59:44 | 156,080,651 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 157 | java | package com.czm.ch2;
public class Test1
{
public static void main(String[] args)
{
A a= new B();
//a.show();
a = new C();
a.show();
}
}
| [
"512444862@qq.com"
] | 512444862@qq.com |
3bfef89d22bd4b6f14da8f43f02bd0b4152903ef | 3521363cf9aa8d277c22e2f5ab1c5db2e1922661 | /src/Lesson1_generics/Generics.java | bc1b5238e609474e9dd37e4b7f656f524639485b | [] | no_license | roman-dubchak/Remote_Java3_Home_Work | b81122eb390531305215a1d8483ef5c7bb284eca | c4de5b9c19bef787264c2e988b76cccdd5a8c4b0 | refs/heads/master | 2023-01-15T12:11:57.283508 | 2020-11-24T06:25:01 | 2020-11-24T06:25:01 | 297,876,665 | 0 | 0 | null | 2020-10-20T07:05:48 | 2020-09-23T06:37:45 | Java | UTF-8 | Java | false | false | 1,761 | java | package Lesson1_generics;
import java.util.ArrayList;
import java.util.Arrays;
public class Generics {
public static void main(String[] args) {
String [] arrStr = {"hello", "world"};
System.out.println("before: " + arrStr[0] + " ; " + arrStr[1]);
arrChange(arrStr);
System.out.println("after: " + arrStr[0] + " ; " + arrStr[1]);
Integer[] arrIn = {1, 2};
System.out.println("before: " + arrIn[0] + " ; " + arrIn[1]);
arrChange(arrIn);
System.out.println("after: " + arrIn[0] + " ; " + arrIn[1]);
arrToArrayList(arrStr);
arrToArrayList(arrIn);
}
static <T> void arrChange (T[] array){
for (int i = 0; i < 1; i++) {
T obj = array[i];
array [i] = array [array.length - 1];
array [array.length - 1] = obj;
// можно через метод swap
}
}
// можно без дженериков
static void arrChangeObj (Object[] array){
for (int i = 0; i < 1; i++) {
Object obj = array[i];
array [i] = array [array.length - 1];
array [array.length - 1] = obj;
// позже нашел метод swap, который повторяет тот, что я написал))
}
}
static <T> ArrayList arrToArrayList (T[] array) {
// ArrayList <T> arrayList = new ArrayList<>();
// for (int i = 0; i < array.length; i++) {
// arrayList.add(array[i]);
// System.out.println("Arraylist #" + i + " : " + arrayList); // to check
// }
// return arrayList;
if (array != null) {
return new ArrayList<T>(Arrays.asList(array));
} else return null;
}
} | [
"dubrathers@mail.ru"
] | dubrathers@mail.ru |
f295213798d730ed06a8410dfb73f407be590997 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/elastic--elasticsearch/2b1ebc55a9b1e9fefd10116b8b99047a86c96822/before/EUnary.java | 54f4e82a627681841cb1544b2e690100d26351a9 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,228 | java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch 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.elasticsearch.painless.node;
import org.elasticsearch.painless.Definition;
import org.elasticsearch.painless.Location;
import org.elasticsearch.painless.Definition.Sort;
import org.elasticsearch.painless.Definition.Type;
import org.elasticsearch.painless.AnalyzerCaster;
import org.elasticsearch.painless.DefBootstrap;
import org.elasticsearch.painless.Operation;
import org.elasticsearch.painless.Locals;
import org.objectweb.asm.Label;
import org.elasticsearch.painless.MethodWriter;
import static org.elasticsearch.painless.WriterConstants.DEF_BOOTSTRAP_HANDLE;
/**
* Represents a unary math expression.
*/
public final class EUnary extends AExpression {
final Operation operation;
AExpression child;
Type promote;
public EUnary(Location location, Operation operation, AExpression child) {
super(location);
this.operation = operation;
this.child = child;
}
@Override
void analyze(Locals locals) {
if (operation == Operation.NOT) {
analyzeNot(locals);
} else if (operation == Operation.BWNOT) {
analyzeBWNot(locals);
} else if (operation == Operation.ADD) {
analyzerAdd(locals);
} else if (operation == Operation.SUB) {
analyzerSub(locals);
} else {
throw createError(new IllegalStateException("Illegal tree structure."));
}
}
void analyzeNot(Locals variables) {
child.expected = Definition.BOOLEAN_TYPE;
child.analyze(variables);
child = child.cast(variables);
if (child.constant != null) {
constant = !(boolean)child.constant;
}
actual = Definition.BOOLEAN_TYPE;
}
void analyzeBWNot(Locals variables) {
child.analyze(variables);
promote = AnalyzerCaster.promoteNumeric(child.actual, false);
if (promote == null) {
throw createError(new ClassCastException("Cannot apply not [~] to type [" + child.actual.name + "]."));
}
child.expected = promote;
child = child.cast(variables);
if (child.constant != null) {
Sort sort = promote.sort;
if (sort == Sort.INT) {
constant = ~(int)child.constant;
} else if (sort == Sort.LONG) {
constant = ~(long)child.constant;
} else {
throw createError(new IllegalStateException("Illegal tree structure."));
}
}
if (promote.sort == Sort.DEF && expected != null) {
actual = expected;
} else {
actual = promote;
}
}
void analyzerAdd(Locals variables) {
child.analyze(variables);
promote = AnalyzerCaster.promoteNumeric(child.actual, true);
if (promote == null) {
throw createError(new ClassCastException("Cannot apply positive [+] to type [" + child.actual.name + "]."));
}
child.expected = promote;
child = child.cast(variables);
if (child.constant != null) {
Sort sort = promote.sort;
if (sort == Sort.INT) {
constant = +(int)child.constant;
} else if (sort == Sort.LONG) {
constant = +(long)child.constant;
} else if (sort == Sort.FLOAT) {
constant = +(float)child.constant;
} else if (sort == Sort.DOUBLE) {
constant = +(double)child.constant;
} else {
throw createError(new IllegalStateException("Illegal tree structure."));
}
}
if (promote.sort == Sort.DEF && expected != null) {
actual = expected;
} else {
actual = promote;
}
}
void analyzerSub(Locals variables) {
child.analyze(variables);
promote = AnalyzerCaster.promoteNumeric(child.actual, true);
if (promote == null) {
throw createError(new ClassCastException("Cannot apply negative [-] to type [" + child.actual.name + "]."));
}
child.expected = promote;
child = child.cast(variables);
if (child.constant != null) {
Sort sort = promote.sort;
if (sort == Sort.INT) {
constant = -(int)child.constant;
} else if (sort == Sort.LONG) {
constant = -(long)child.constant;
} else if (sort == Sort.FLOAT) {
constant = -(float)child.constant;
} else if (sort == Sort.DOUBLE) {
constant = -(double)child.constant;
} else {
throw createError(new IllegalStateException("Illegal tree structure."));
}
}
if (promote.sort == Sort.DEF && expected != null) {
actual = expected;
} else {
actual = promote;
}
}
@Override
void write(MethodWriter writer) {
writer.writeDebugInfo(location);
if (operation == Operation.NOT) {
if (tru == null && fals == null) {
Label localfals = new Label();
Label end = new Label();
child.fals = localfals;
child.write(writer);
writer.push(false);
writer.goTo(end);
writer.mark(localfals);
writer.push(true);
writer.mark(end);
} else {
child.tru = fals;
child.fals = tru;
child.write(writer);
}
} else {
Sort sort = promote.sort;
child.write(writer);
if (operation == Operation.BWNOT) {
if (sort == Sort.DEF) {
org.objectweb.asm.Type descriptor = org.objectweb.asm.Type.getMethodType(actual.type, child.actual.type);
writer.invokeDynamic("not", descriptor.getDescriptor(), DEF_BOOTSTRAP_HANDLE, DefBootstrap.UNARY_OPERATOR);
} else {
if (sort == Sort.INT) {
writer.push(-1);
} else if (sort == Sort.LONG) {
writer.push(-1L);
} else {
throw createError(new IllegalStateException("Illegal tree structure."));
}
writer.math(MethodWriter.XOR, actual.type);
}
} else if (operation == Operation.SUB) {
if (sort == Sort.DEF) {
org.objectweb.asm.Type descriptor = org.objectweb.asm.Type.getMethodType(actual.type, child.actual.type);
writer.invokeDynamic("neg", descriptor.getDescriptor(), DEF_BOOTSTRAP_HANDLE, DefBootstrap.UNARY_OPERATOR);
} else {
writer.math(MethodWriter.NEG, actual.type);
}
} else if (operation == Operation.ADD) {
if (sort == Sort.DEF) {
org.objectweb.asm.Type descriptor = org.objectweb.asm.Type.getMethodType(actual.type, child.actual.type);
writer.invokeDynamic("plus", descriptor.getDescriptor(), DEF_BOOTSTRAP_HANDLE, DefBootstrap.UNARY_OPERATOR);
}
} else {
throw createError(new IllegalStateException("Illegal tree structure."));
}
writer.writeBranch(tru, fals);
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
5b71cc8f1e9c06d42f7f704c2951b51836d4e329 | e4c81bdbae663e1d168392768f299c9a550341ba | /eoms-web/src/main/java/com/lj/eoms/content/LoadingController.java | 99cc886b776cc27a6662d36c74feb48ae6612c27 | [] | no_license | wo510751575/kun | 995e75f03424d98d11c33fd2fe6681666108ec54 | 4907f79d1232ecea8ae5fe138809066a0fbc1212 | refs/heads/master | 2022-12-21T08:20:44.972860 | 2019-11-15T11:03:14 | 2019-11-15T11:03:14 | 219,097,605 | 0 | 1 | null | 2022-12-16T11:35:53 | 2019-11-02T03:22:39 | Java | UTF-8 | Java | false | false | 4,259 | java | /**
* Copyright © 2017-2020 All rights reserved.
*
* Licensed under the 深圳市小坤 License, Version 1.0 (the "License");
*
*/
package com.lj.eoms.content;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ape.common.web.BaseController;
import com.google.common.collect.Lists;
import com.lj.base.core.pagination.Page;
import com.lj.eshop.dto.FindLoadingPage;
import com.lj.eshop.dto.LoadingDto;
import com.lj.eshop.emus.LoadingBiz;
import com.lj.eshop.emus.Status;
import com.lj.eshop.service.ILoadingService;
/**
*
* 类说明:广告管理
*
* <p>
*
* @Company:
* @author 林进权
*
* CreateDate: 2017年8月28日
*/
@Controller
@RequestMapping("${adminPath}/content/loading/")
public class LoadingController extends BaseController {
public static final String LIST = "modules/content/loading/list";
public static final String FORM = "modules/content/loading/form";
public static final String EDIT = "modules/content/loading/edit";
public static final String VIEW = "modules/content/loading/view";
@Autowired
private ILoadingService loadingService;
/** 列表 */
@RequiresPermissions("content:loading:view")
@RequestMapping(value = { "list", "" })
public String list(FindLoadingPage findLoadingPage, Integer pageNo, Integer pageSize, Model model) {
LoadingDto param = findLoadingPage.getParam();
if(null==param) {
param = new LoadingDto();
}
param.setStatus("0");
findLoadingPage.setParam(param);
if (pageNo != null) {
findLoadingPage.setStart((pageNo - 1) * pageSize);
}
if (pageSize != null) {
findLoadingPage.setLimit(pageSize);
}
Page<LoadingDto> pageDto = loadingService.findLoadingPage(findLoadingPage);
List<LoadingDto> list = Lists.newArrayList();
list.addAll(pageDto.getRows());
com.ape.common.persistence.Page<LoadingDto> page = new com.ape.common.persistence.Page<LoadingDto>(
pageNo == null ? 1 : pageNo, pageDto.getLimit(), pageDto.getTotal(), list);
page.initialize();
model.addAttribute("page", page);
model.addAttribute("findLoadingPage", findLoadingPage);
model.addAttribute("bizs", LoadingBiz.values());
return LIST;
}
/** 新增 无新增 */
@RequiresPermissions("content:loading:edit")
@RequestMapping(value = "/save", method = RequestMethod.POST)
public String save(LoadingDto loadingDto, RedirectAttributes redirectAttributes) {
loadingService.addLoading(loadingDto);
addMessage(redirectAttributes, "保存广告'" + "'成功");
return "redirect:" + adminPath + "/content/loading/";
}
/** 新增/修改/查看表单 */
@RequiresPermissions("content:loading:view")
@RequestMapping(value = "/form")
public String form(String code, Boolean isView, Model model) {
model.addAttribute("statuss", Status.values());
try {
LoadingDto param = new LoadingDto();
param.setCode(code);
LoadingDto rtDto = loadingService.findLoading(param);
model.addAttribute("data", rtDto);
model.addAttribute("bizs", LoadingBiz.values());
if (isView != null && isView) {
return VIEW;
}
} catch (Exception e) {
e.printStackTrace();
}
return FORM;
}
/** 修改 */
@RequiresPermissions("content:loading:edit")
@RequestMapping(value = "/edit", method = RequestMethod.POST)
public String edit(LoadingDto loadingDto, RedirectAttributes redirectAttributes) {
loadingService.updateLoading(loadingDto);
addMessage(redirectAttributes, "修改广告'" + "'成功");
return "redirect:" + adminPath + "/content/loading/";
}
/** 删除 */
@RequiresPermissions("member:memberRank:edit")
@RequestMapping(value = "/delete")
public String delete(LoadingDto loadingDto, RedirectAttributes redirectAttributes) {
loadingDto.setStatus("1");
loadingService.updateLoading(loadingDto);
addMessage(redirectAttributes, "删除广告成功");
return "redirect:" + adminPath + "/content/loading/";
}
}
| [
"37724558+wo510751575@users.noreply.github.com"
] | 37724558+wo510751575@users.noreply.github.com |
1c44b09f1d028f67588c9af2c9f7bf8936a6de2a | b5d42beeec228fd6f70d6dcd9c554e5e3d8bec27 | /app/src/main/java/com/example/dam/gestordejuegos/contentprovider/Provider.java | a85d6302e3d7c35e14acd09b54843e41300f70b2 | [] | no_license | Viirgiiniia/GestorJuegos | a3c3dc7dc88a8e047ea528a01f452f232e55bbc7 | b845590e11f535f52b5619b6df7673c13e08cefd | refs/heads/master | 2020-06-28T04:15:39.898906 | 2017-06-13T22:00:43 | 2017-06-13T22:00:43 | 94,258,117 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,301 | java | package com.example.dam.gestordejuegos.contentprovider;
import android.content.ContentProvider;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.net.Uri;
import android.support.annotation.Nullable;
import com.example.dam.gestordejuegos.contrato.ContratoBaseDeDatos;
import com.example.dam.gestordejuegos.gestor.GestorEntrada;
import com.example.dam.gestordejuegos.gestor.GestorJuego;
import com.example.dam.gestordejuegos.gestor.GestorUnion;
import com.example.dam.gestordejuegos.util.UtilCadena;
/**
* Created by dam on 23/3/17.
*/
public class Provider extends ContentProvider {
//URI_MATCHER
private static final UriMatcher URI_MATCHER;
//CURSORES
private static final int TODO_JUEGO = 0;
private static final int CONCRETO_JUEGO = 1;
private static final int TODO_ENTRADA = 2;
private static final int CONCRETO_ENTRADA = 3;
//GESTORES
private static GestorJuego gj;
private static GestorEntrada ge;
private static GestorUnion gu;
//CONSTRUCTOR ESTATICO
static {
URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
//CURSOR 0 TABLA NOTAS
URI_MATCHER.addURI(ContratoBaseDeDatos.AUTORIDAD, ContratoBaseDeDatos.TablaJuego.TABLA, TODO_JUEGO);
//CURSOR 1
URI_MATCHER.addURI(ContratoBaseDeDatos.AUTORIDAD, ContratoBaseDeDatos.TablaJuego.TABLA + "/#", CONCRETO_JUEGO);
//CURSOR 2 TABLA LISTAS
URI_MATCHER.addURI(ContratoBaseDeDatos.AUTORIDAD, ContratoBaseDeDatos.TablaEntrada.TABLA, TODO_ENTRADA);
//CURSOR 3
URI_MATCHER.addURI(ContratoBaseDeDatos.AUTORIDAD, ContratoBaseDeDatos.TablaEntrada.TABLA + "/#", CONCRETO_ENTRADA);
}
public Provider() {
}
@Override
public boolean onCreate() {
gj = new GestorJuego(getContext());
gj.getCursor();
ge = new GestorEntrada(getContext());
gu = new GestorUnion(getContext());
return true;
}
@Nullable
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
Cursor c;
int tipo = URI_MATCHER.match(uri);
String id;
String descripcion;
String tabla;
if (tipo < 0) {
throw new IllegalArgumentException("Error no devuelve QUERY");
}
if (tipo == CONCRETO_JUEGO) {
id = uri.getLastPathSegment();
selection = UtilCadena.getCondiciones(selection, ContratoBaseDeDatos.TablaJuego._ID + " = ?");
selectionArgs = UtilCadena.getNewArray(selectionArgs, id);
tabla = ContratoBaseDeDatos.TablaJuego.TABLA;
} else if (tipo == CONCRETO_ENTRADA) {
id = uri.getLastPathSegment();
selection = UtilCadena.getCondiciones(selection, ContratoBaseDeDatos.TablaEntrada._ID + " = ?");
selectionArgs = UtilCadena.getNewArray(selectionArgs, id);
tabla = ContratoBaseDeDatos.TablaEntrada.TABLA;
} else if (tipo == CONCRETO_ENTRADA) {
descripcion = uri.getLastPathSegment();
selection = UtilCadena.getCondiciones(selection, ContratoBaseDeDatos.TablaEntrada.DESCRIPCION + " = ?");
selectionArgs = UtilCadena.getNewArray(selectionArgs, descripcion);
tabla = ContratoBaseDeDatos.TablaEntrada.TABLA;
} else if (tipo == TODO_JUEGO) {
selection = null;
selectionArgs = null;
tabla = ContratoBaseDeDatos.TablaJuego.TABLA;
} else {
throw new IllegalArgumentException("URI no soportada: " + uri);
}
if (sortOrder == null || sortOrder.isEmpty()) {
sortOrder = ContratoBaseDeDatos.TablaEntrada._ID + " DESC";
}
System.out.println("aqui --->"+sortOrder);
c = gj.getCursor(tabla, projection, selection, selectionArgs, null, null, sortOrder);
//c = gj.getCursorOT();
c.setNotificationUri(getContext().getContentResolver(), uri);
return c;
}
@Nullable
@Override
public String getType(Uri uri) {
switch (URI_MATCHER.match(uri)) {
case TODO_JUEGO:
return ContratoBaseDeDatos.TablaJuego.CONTENT_TYPE;
case TODO_ENTRADA:
return ContratoBaseDeDatos.TablaEntrada.CONTENT_TYPE;
case CONCRETO_JUEGO:
return ContratoBaseDeDatos.TablaJuego.CONTENT_ITEM_TYPE;
case CONCRETO_ENTRADA:
return ContratoBaseDeDatos.TablaEntrada.CONTENT_ITEM_TYPE;
default:
throw new IllegalArgumentException("Tipo de actividad desconocida: " + uri);
}
}
@Nullable
@Override
public Uri insert(Uri uri, ContentValues values) {
int tipo = URI_MATCHER.match(uri);
long id = 0;
switch (tipo) {
case TODO_JUEGO:
id = gj.insert(values);
break;
case TODO_ENTRADA:
id = ge.insert(values);
break;
//default: throw new IllegalArgumentException("Error de inserción Uri desconocida: " + uri);
}
if (id > 0) {
Uri uriGelle = ContentUris.withAppendedId(uri, id);
getContext().getContentResolver().notifyChange(uriGelle, null);
return uriGelle;
}
throw new IllegalArgumentException("Error de insercion de fila en: " + uri);
}
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
int tipo = URI_MATCHER.match(uri);
int borrados = 0;
String id;
String newSelection;
//gestor = new GestionNota(getContext());
switch (tipo) {
case CONCRETO_JUEGO:
id = uri.getLastPathSegment();
borrados = gj.delete(ContratoBaseDeDatos.TablaJuego._ID + " = ?", new String[]{id});
//newSelection = UtilCadena.getCondiciones(selection, ContratoBaseDeDatos.TablaJuego._ID + " = ?");
break;
case CONCRETO_ENTRADA:
id = uri.getLastPathSegment();
borrados = gj.delete(ContratoBaseDeDatos.TablaEntrada._ID + " = ?", new String[]{id});
//newSelection = UtilCadena.getCondiciones(selection,ContratoBaseDeDatos.TablaEntrada._ID + " = ?");
break;
case TODO_JUEGO:
borrados = gj.delete(selection, selectionArgs);
break;
case TODO_ENTRADA:
borrados = ge.delete(selection, selectionArgs);
break;
default:
throw new IllegalArgumentException("Elemento actividad desconocido: " + uri);
}
if (borrados > 0) {
getContext().getContentResolver().notifyChange(uri, null);
}
return borrados;
}
public Cursor getEntradas(long idJuego) {
return gu.getCursorId(idJuego);
}
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
int tipo = URI_MATCHER.match(uri);
int valor;
String id = uri.getLastPathSegment();
if (tipo < 0) {
throw new IllegalArgumentException("Error de UPDATE: " + uri);
} else if (tipo == CONCRETO_JUEGO) {
selection = UtilCadena.getCondiciones(selection, ContratoBaseDeDatos.TablaJuego._ID + " = ?");
selectionArgs = UtilCadena.getNewArray(selectionArgs, id);
} else if (tipo == CONCRETO_ENTRADA) {
selection = UtilCadena.getCondiciones(selection, ContratoBaseDeDatos.TablaEntrada._ID + " = ?");
selectionArgs = UtilCadena.getNewArray(selectionArgs, id);
}
try {
valor = gj.update(values, selection, selectionArgs);
if (valor > 0) {
getContext().getContentResolver().notifyChange(uri, null);
}
} catch (Exception e) {
valor = ge.update(values, selection, selectionArgs);
if (valor > 0) {
getContext().getContentResolver().notifyChange(uri, null);
}
}
return valor;
}
}
| [
"virginiagarzonrivero@gmail.com"
] | virginiagarzonrivero@gmail.com |
be78940d2a8c783140dc414c96480ab2279817d7 | 1d6733b3cab1d3964979887b114b5f0118c801a1 | /sdk/sens/src/main/java/com/fincloud/sens/Channels.java | 2207db1f12a61ef66ebb94c35bd42f6c60180da2 | [
"MIT"
] | permissive | samjegal/fincloud-sdk-for-java | 5a01998710709ffee2548cb3822abd944de61c12 | 3fbc0078be2aa6ef9981044ca911d86afa0fef8f | refs/heads/master | 2022-12-02T20:13:33.936275 | 2020-08-20T13:51:57 | 2020-08-20T13:51:57 | 287,275,239 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,034 | java | /**
* FINCLOUD_APACHE_NO_VERSION
*/
package com.fincloud.sens;
import com.fincloud.sens.models.PushChannelRequestParameter;
import com.microsoft.rest.RestException;
import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.ServiceResponse;
import java.io.IOException;
import rx.Observable;
/**
* An instance of this class provides access to all the operations defined
* in Channels.
*/
public interface Channels {
/**
* 채널 생성.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channel 생성할 채널명
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws RestException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
void create(String serviceId, PushChannelRequestParameter channel);
/**
* 채널 생성.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channel 생성할 채널명
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
ServiceFuture<Void> createAsync(String serviceId, PushChannelRequestParameter channel, final ServiceCallback<Void> serviceCallback);
/**
* 채널 생성.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channel 생성할 채널명
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
Observable<Void> createAsync(String serviceId, PushChannelRequestParameter channel);
/**
* 채널 생성.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channel 생성할 채널명
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> createWithServiceResponseAsync(String serviceId, PushChannelRequestParameter channel);
/**
* 채널에 사용자 추가.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws RestException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
void addUser(String serviceId, String channelName, String userId);
/**
* 채널에 사용자 추가.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
ServiceFuture<Void> addUserAsync(String serviceId, String channelName, String userId, final ServiceCallback<Void> serviceCallback);
/**
* 채널에 사용자 추가.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
Observable<Void> addUserAsync(String serviceId, String channelName, String userId);
/**
* 채널에 사용자 추가.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> addUserWithServiceResponseAsync(String serviceId, String channelName, String userId);
/**
* 채널에서 사용자 삭제.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws RestException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
void deleteUser(String serviceId, String channelName, String userId);
/**
* 채널에서 사용자 삭제.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
ServiceFuture<Void> deleteUserAsync(String serviceId, String channelName, String userId, final ServiceCallback<Void> serviceCallback);
/**
* 채널에서 사용자 삭제.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
Observable<Void> deleteUserAsync(String serviceId, String channelName, String userId);
/**
* 채널에서 사용자 삭제.
*
* @param serviceId 프로젝트 등록 시 발급받은 서비스 아이디
* @param channelName 사용자를 추가할 채널명
* @param userId 디바이스 토큰 등록 시 바인딩한 사용자 아이디
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
*/
Observable<ServiceResponse<Void>> deleteUserWithServiceResponseAsync(String serviceId, String channelName, String userId);
}
| [
"samjegal@gmail.com"
] | samjegal@gmail.com |
20ad75fb2f27afddfdd80e7b9f2eb5f34f8e8ce8 | 4c64ed2c3061c86713b4b958c654b8cc33418148 | /app/src/main/java/com/example/saadiqbal/tutorsideapplication/modelClass.java | db19c028a01d13326e38e022b646ab5438262517 | [] | no_license | aftabkhan00755/Smart-Tutor-Finder | 0f527370f31acc65828f1c7649362c4171948967 | b08cbb52b9691800323695e28a2e3f34cf50944c | refs/heads/master | 2023-07-12T12:42:56.370646 | 2021-08-04T19:11:40 | 2021-08-04T19:11:40 | 392,800,132 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 476 | java | package com.example.saadiqbal.tutorsideapplication;
public class modelClass{
String name;
String courseName;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCourseName() {
return courseName;
}
public void setCourseName(String courseName) {
this.courseName = courseName;
}
} | [
"58456608+aftab690@users.noreply.github.com"
] | 58456608+aftab690@users.noreply.github.com |
6ef36cdec3b7bfd63789cb8357b22eefd00c4779 | 34b837765421d3b2f2b0830dbe678c88bc364545 | /src/main/java/com/peoplewearus/web/spring/services/UserRepository.java | 51790fd4c1adbf6924401017775b139151d79f76 | [] | no_license | WomanAppDesign/Spring-Webshop | 3500787421fd6cfeb5f77ebe5c9abe0d15e62265 | eaac1e1184bb8aa0c263d7c02efbcdb1aba47c1f | refs/heads/master | 2021-03-23T07:45:34.202008 | 2012-10-09T14:42:03 | 2012-10-09T14:42:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,157 | java | package com.peoplewearus.web.spring.services;
import java.util.Collection;
import com.peoplewearus.web.spring.data.UserAlreadyExistsException;
import com.peoplewearus.web.spring.data.UserNotFoundException;
import com.peoplewearus.web.spring.domain.User;
public interface UserRepository
{
User getUser(String email);
public void addUser(String firstName, String lastName, String co, String street, String zipCode, String city,
String country, String phone, String gender, String email, String password); // throws
// UserAlreadyExistsException;
boolean authenticate(String userId, String password);
public Collection<User> getAllUsers();
public void updateUser(String firstName, String lastName, String co, String street, String postal, String city,
String country, String phone, String gender, String email);
User findUser(String email, String password) throws UserNotFoundException;
boolean checkUser(String firstName, String lastName, String co, String street, String postal, String city,
String country, String phone, String gender, String email, String password)
throws UserAlreadyExistsException;
}
| [
"filip.ajax@gmail.com"
] | filip.ajax@gmail.com |
fc9fdc2fdfd438083ffd10ce0c0ca59658645c52 | c01507f512f426a1aec3f7eadda25ae870336d46 | /TransMototaxi/src/Test/OperativoPrueba.java | 1515ceccd5031ad89939db810e0331ecfad78d73 | [] | no_license | frankapazac/jfmototaxis | 1795b9bca16756d3c0d3deb8b08f54ee850c2ee0 | d768a9570f781b4ea010d87d318b26a73e35c950 | refs/heads/master | 2021-01-10T11:39:01.742765 | 2014-02-18T20:41:13 | 2014-02-18T20:41:13 | 50,777,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | package Test;
import com.munichosica.myapp.dto.MotOperativo;
import com.munichosica.myapp.exceptions.MotOperativoDaoException;
import com.munichosica.myapp.factory.MotOperativoDaoFactory;
public class OperativoPrueba {
public static void main(String[] args) {
try {
System.out.println("entro");
MotOperativo operativo = MotOperativoDaoFactory.create().findByIdOperativo((long)1);
System.out.println("entroaaaa");
System.out.println(operativo.getOpecodigoD() + " " +
operativo.getOpetituloV()+ " " +
operativo.getOpedescripcionV()+ " " +
operativo.getZona().getZonnombre_V() + " " +
operativo.getOpelugarV() + " " +
operativo.getOpereferencia() + " " +
operativo.getOpefecha() + " " +
operativo.getOpehora() + " " +
operativo.getInspector().getPersona().getPernombresV() + " " +
operativo.getInspector().getPersona().getPerpaternoV() + " " +
operativo.getInspector().getPersona().getPermaternoV()
);
} catch (MotOperativoDaoException e) {
e.printStackTrace();
}
}
}
| [
"ebujaico@gmail.com"
] | ebujaico@gmail.com |
e139a3124ef41dcc4cebb988f49ad255b79d9f21 | 217265e132d1adbd5c26aaf90125dbca90394237 | /sif-crawler-webmagic/src/main/java/com/sif/webmagic/service/impl/WebMagicCommodityServiceImpl.java | ff56739298bde58d859f16c79d0be6d7b5169118 | [] | no_license | cassius425/sif-auction | 0153ac19dcfd5612b083bc0640259fa47474147b | 45c120751fb7feecd47c4133b4a31c2ea7773d34 | refs/heads/master | 2023-05-10T02:56:38.200555 | 2020-10-16T13:00:46 | 2020-10-16T13:00:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,698 | java | package com.sif.webmagic.service.impl;
import com.sif.webmagic.dao.WebMagicCommodityDao;
import com.sif.webmagic.pojo.WebMagicCommodity;
import com.sif.webmagic.service.WebMagicCommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* @program: sif-auction
* @description:
* @author: xifujiang
* @create: 2019-12-03 10:28
**/
@Service
public class WebMagicCommodityServiceImpl implements WebMagicCommodityService {
@Autowired
private WebMagicCommodityDao webMagicCommodityDao;
@Override
@Transactional
public void save(WebMagicCommodity webMagicCommodity) {
//根据url和商品编号查询数据
WebMagicCommodity param = new WebMagicCommodity();
param.setUrl(webMagicCommodity.getUrl());
param.setCnum(webMagicCommodity.getCnum());
//执行查询
List<WebMagicCommodity> list = this.findWebMagicCommodity(param);
//判断查询结果是否为空
if(list.size() == 0 && webMagicCommodity != null){
//如果查询结果为空,则新增数据库。
webMagicCommodityDao.saveAndFlush(webMagicCommodity);
}
}
@Override
public List<WebMagicCommodity> findWebMagicCommodity(WebMagicCommodity webMagicCommodity) {
//设置查询条件
Example example = Example.of(webMagicCommodity);
List list = new ArrayList();
// list = webMagicCommodityDao.findAll(example);
return list;
}
}
| [
"229694302@qq.com"
] | 229694302@qq.com |
a4548d6b759d831e237c3940c6b86d0b1808fe00 | cf1680914dabbf4e64c5e1e6f41041b58a833769 | /ProgrammierenS20/01Vorlesung/ufogame/Background.java | 932277c13f5c7d98c7412af9dbc8bfc4a47fde08 | [] | no_license | darkSocio/Prg2Homework | 542cba1f40a7b64cdbe99f70446ce230b754ed60 | 92583ac79b081e2e777acc2072c6a1ef21b24541 | refs/heads/master | 2021-05-21T17:49:16.208966 | 2020-06-15T18:49:12 | 2020-06-15T18:49:12 | 252,742,135 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 271 | java | package ufogame;
import view.IBackground;
public class Background implements IBackground{
private String sprite;
public Background(String sprite) {
super();
this.sprite = sprite;
}
@Override
public String getImagePath() {
return sprite;
}
}
| [
"noreply@github.com"
] | noreply@github.com |
4451e28eaf70bfcefbd584935bc602aaa0a8b3b5 | 7219e9fc7b93190320ec185d0e72bf566434f79a | /stone_paper_scissor/android/app/src/main/java/com/stone_paper_scissor/MainApplication.java | 420cc67b7c89bb311b2ca29abb47c47360910512 | [] | no_license | vishal206/React-native-basic-apps | 61e04e02df6d7c4fa5dd8a8f746f574d1428d476 | 26837bab1b22cfc49d67c96890695ff0bceabda0 | refs/heads/main | 2023-08-27T10:39:57.570040 | 2021-11-09T18:11:17 | 2021-11-09T18:11:17 | 424,092,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,621 | java | package com.stone_paper_scissor;
import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.stone_paper_scissor.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}
| [
"vishal206ani@gmail.com"
] | vishal206ani@gmail.com |
b22adc29e9a09ecaafcb249a8e1f1a904a3bdc50 | 7f4289df86eac82f79970b146090f9c160c3a7f6 | /src/main/java/fr/liams/application/security/social/package-info.java | a7eeea9ca265530aef018e147e3b6a7964ad1c63 | [] | no_license | liams62217/Liams | e11a31666e200f8faf955aea1f1bc76d3f52b798 | f6f85ca4dbb1f186cad4abcfe27dba2409c4fce5 | refs/heads/master | 2021-07-07T06:09:41.694065 | 2017-10-05T21:32:34 | 2017-10-05T21:32:34 | 105,942,639 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 86 | java | /**
* Spring social configuration.
*/
package fr.liams.application.security.social;
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
768c380b8f1365bd2a065ba643ebb4539b0b2063 | 4deac30ca7d0ec5267a6876d9af433af55bb4344 | /app/src/androidTest/java/viettu/pvt/gamedovui/ExampleInstrumentedTest.java | 66b7a77e5ad2208d9a01d9f9df0435ae244708de | [] | no_license | phamviettu-98/GamedoVui_With_Firebase | 08cd8315007bcb554c73757ce1e5849463e85b76 | d68cc045c66b6645e07803a10f002507a2a48e81 | refs/heads/master | 2022-12-27T11:55:36.799493 | 2020-10-10T04:05:51 | 2020-10-10T04:05:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 754 | java | package viettu.pvt.gamedovui;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("viettu.pvt.gamedovui", appContext.getPackageName());
}
} | [
"phamviettu567@gmail.com"
] | phamviettu567@gmail.com |
e5ea6d484295f4929fce1eed85a3e1258dfea41b | 669aaf65670cc8bb9860b2c91eb772f92851e538 | /src/lib/datastructure/longs/LongSparseTable.java | b6d8f71ff17e50989e372077ef34bd64c01535f2 | [] | no_license | suisen-cp/cp-library-java | d28dcc619bec2f233a567a4aaf16977fced1ec73 | 759971f1a5b30859532dbd34388cf6ea8f86620f | refs/heads/main | 2023-06-27T19:44:31.881612 | 2021-07-18T06:30:54 | 2021-07-18T06:30:54 | 319,524,103 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,031 | java | package lib.datastructure.longs;
import java.util.function.LongBinaryOperator;
/**
* @author https://atcoder.jp/users/suisen
*
* for Static Range Query. (LongBoundedSemiLattice)
* build: O(N*logN). query: O(1).
*/
public final class LongSparseTable {
private final int n;
public final long[][] table;
private final LongBinaryOperator op;
private final long e;
private final int[] floorExponent;
/**
* CAUTION: bounded-semilattice meats idempotent law and bond law. bsl is in monoid. (max, min, gcd, lcm, and, or, ...)
* So, there exists some monoid s.t. Sparse Table cannot handle. (ex. addition, xor, multiplication)
* @param a long array.
* @param idempotentOperator (max, min, gcd, lcm, and, or, rewrite, ...) NOT (addition, xor, multiplication, ...)
*/
public LongSparseTable(final long[] a, final LongBinaryOperator idempotentOperator, long e) {
this.n = a.length;
this.table = new long[n][];
this.op = idempotentOperator;
this.e = e;
this.floorExponent = new int[n + 1];
buildFloorExponent();
buildTable(a);
}
public long query(final int i, final int j) {
if (j <= i) return e;
final int exp = floorExponent[j - i];
return op.applyAsLong(table[i][exp], table[j - (1 << exp)][exp]);
}
private void buildFloorExponent() {
for (int i = 1, pow = 0, exp = 1; i <= n; i++) {
if ((i & -i) > exp) {
pow++;
exp <<= 1;
}
floorExponent[i] = pow;
}
}
private void buildTable(final long[] a) {
for (int i = 0; i < n; i++) {
table[i] = new long[floorExponent[n - i] + 1];
table[i][0] = a[i];
}
for (int i = n - 1; i >= 0; i--) {
final long[] e = table[i];
for (int j = 1, k = 1; j < e.length; j++, k <<= 1) {
e[j] = op.applyAsLong(e[j - 1], table[i + k][j - 1]);
}
}
}
} | [
"suisen.13107f4@gmail.com"
] | suisen.13107f4@gmail.com |
3ada6e01889b2eb3c2296fb9a97a5d85580fff16 | 6b866742059b5db40d0807c01568446152f9ab14 | /src/name/boyle/chris/sgtpuzzles/compat/PrefsSaverGingerbread.java | 25e3e00c15cf8ed9cb63a4f7174bb6259bafff2a | [
"MIT"
] | permissive | nbzhou/sgtpuzzles | b4a7633c6914e6e6fc36c3cccd69e33fb074f3c5 | 64509d112b04259b75b8962eaec742279d9c39f8 | refs/heads/master | 2021-01-18T10:22:45.447627 | 2014-04-30T20:52:10 | 2014-04-30T20:52:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | package name.boyle.chris.sgtpuzzles.compat;
import android.content.Context;
import android.content.SharedPreferences.Editor;
public class PrefsSaverGingerbread extends PrefsSaverFroyo
{
static {
try {
Editor.class.getMethod("apply");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public PrefsSaverGingerbread(Context c)
{
super(c);
}
@Override
public void save(Editor ed) {
ed.apply();
backup();
}
}
| [
"chris@boyle.name"
] | chris@boyle.name |
e796fa907aced8341e1ebda7ef148b01c0762328 | a15093c276e656ebaf97433830b8ed3dd02f0da4 | /javaSource/de/neue_phase/asterisk/ClickDial/datasource/DataSourceTileInterface.java | d0c9988461bd7ce484f5b18cef90c99aa9070b70 | [
"BSD-3-Clause"
] | permissive | diLLec/Asterisk-ClickDial | 581b24e7c910580384e7ad60792bab7f82065fbc | 5d1af7fd12443e8dae1573c59de47d4048b017d8 | refs/heads/master | 2021-01-18T22:29:16.265605 | 2016-08-02T20:47:57 | 2016-08-02T20:47:57 | 30,436,352 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 201 | java | package de.neue_phase.asterisk.ClickDial.datasource;
/**
*
* @author Michael Konietzny <Michael.Konietzny@neue-phase.de>
*/
public interface DataSourceTileInterface {
public void close();
}
| [
"michael@konietzny.at"
] | michael@konietzny.at |
6d18e729d3054d5b3c74701320b6dfad82861b12 | e7ccfde456f9d1d89482d9fc5854ea0f897954cd | /Example/target/generated-sources/antlr4/exp/parser/ExpVisitor.java | 2c1ebf59d025e6f18a2f1952aed96d78d0acde53 | [] | no_license | nbxtruong/Example | e1efd265ec2aa0c8e5b9b27848cdfa4a7ad11f4b | ca57cc5b3077dfd3d6270e46ead5fce1fe6352a1 | refs/heads/master | 2020-04-02T07:14:16.716766 | 2016-06-27T13:19:58 | 2016-06-27T13:19:58 | 62,057,643 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,257 | java | // Generated from Exp.g4 by ANTLR 4.5.3
package exp.parser;
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
/**
* This interface defines a complete generic visitor for a parse tree produced
* by {@link ExpParser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
*/
public interface ExpVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link ExpParser#exps}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExps(ExpParser.ExpsContext ctx);
/**
* Visit a parse tree produced by {@link ExpParser#stm}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitStm(ExpParser.StmContext ctx);
/**
* Visit a parse tree produced by {@link ExpParser#exp}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExp(ExpParser.ExpContext ctx);
/**
* Visit a parse tree produced by {@link ExpParser#exp1}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitExp1(ExpParser.Exp1Context ctx);
/**
* Visit a parse tree produced by {@link ExpParser#factor}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitFactor(ExpParser.FactorContext ctx);
} | [
"omega220@gmail.com"
] | omega220@gmail.com |
f386f9e9fe619728f66359a24319a88965636098 | 4d0ae4af9bb3be617ac891b66460af2c55b9ae72 | /src/studentdatabasejpa/Student.java | 37fd84d7e6660306776112443093127a5720edc4 | [] | no_license | ploymuddle/StudentDatabaseJPA-EX6 | 79c57bf34d89b33eb2375b1ace8a18cea06fdf7a | e9911e86dd1805f4f8eb74c71bb211e1e306ba61 | refs/heads/master | 2022-12-24T12:07:36.353210 | 2020-10-14T08:19:24 | 2020-10-14T08:19:24 | 303,946,975 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,735 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package studentdatabasejpa;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author PLOYMUDDLE
*/
@Entity
@Table(name = "STUDENT")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Student.findAll", query = "SELECT s FROM Student s"),
@NamedQuery(name = "Student.findById", query = "SELECT s FROM Student s WHERE s.id = :id"),
@NamedQuery(name = "Student.findByName", query = "SELECT s FROM Student s WHERE s.name = :name"),
@NamedQuery(name = "Student.findByGpa", query = "SELECT s FROM Student s WHERE s.gpa = :gpa")})
public class Student implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@Column(name = "ID")
private Integer id;
@Column(name = "NAME")
private String name;
// @Max(value=?) @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
@Column(name = "GPA")
private Double gpa;
public Student() {
}
public Student(Integer id, String name, Double gpa) {
this.id = id;
this.name = name;
this.gpa = gpa;
}
public Student(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getGpa() {
return gpa;
}
public void setGpa(Double gpa) {
this.gpa = gpa;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Student)) {
return false;
}
Student other = (Student) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "studentdatabasejpa.Student[ id=" + id + " ]";
}
}
| [
"bunprasoet227@gmail.com"
] | bunprasoet227@gmail.com |
b36a916a51c986d27ebb3a90797f9714b92a2254 | f6847720a474cd2dff3ebad4e897e50dfa7d9291 | /Java/src/JAVA_Season_1/ex02_형변환_연산자.java | fefee95eaa1e3cc1dc4fe69bd97b8c291ae5423d | [] | no_license | handaeho/lab_Java | 2a8b8d4ff1a7a6ea388255de7138fb4b35a22d4d | edb1fb91fb139eddf2e9b0d6aa2b25bf398d01bf | refs/heads/master | 2021-05-25T22:17:26.411246 | 2020-04-27T08:59:21 | 2020-04-27T08:59:21 | 253,943,484 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | package JAVA_Season_1;
public class ex02_형변환_연산자 {
public static void main(String[] args) {
// 형 변환
double a = 3.0;
// float b = 3.0; ~> 에러.
// 표현범위: byte -> short, char -> int -> long -> float -> double
System.out.println(a);
int x = 1;
float y = 3.0F;
double z = 5.0;
System.out.println(x);
System.out.println(y);
System.out.println(z);
int q = 3;
float w = 1.0F;
double e = q + w;
// 두 번의 형 변환 발생. q와 w를 더하기 위해 둘 중 하나가 형 변환을 한다.
// int와 float가 붙으면 int가 float형으로 변환됨. 따라서 q에 있는 3은 float 타입이 된다.
// 그리고 q + w가 담길 e는 double 타입. 따라서 float 타입은 다시 double 타입으로 형 변환.
System.out.println(e);
// 명시적 형 변환: 자동으로 형 변환이 되지 않는 경우에는 명시적으로(수동으로) 형 변환이 필요하다.
// float a = 100.0;
// int b = 100.0F; ~> 오류. 자동으로 형 변환이 되지 않음.
float i = (float)100.0;
int j = (int)100.0F;
System.out.println(i);
// 연산자
int result = 1 + 2;
System.out.println("result = " + result);
result -= 1;
System.out.println(result);
result *= 4;
System.out.println(result);
result /= 2;
System.out.println(result);
result += 7;
System.out.println(result);
result %= 7;
System.out.println(result);
// 또한 + 연산자는 '문자열을 붙일 때'도 사용할 수 있다.
String str_1 = "This is";
String str_2 = " JAVA";
String result_str = str_1 + str_2;
System.out.println(result_str);
// 단항 연산자(++, --)
int p = 3;
p++;
System.out.println(p);
++p; // 선 증가
System.out.println(p);
System.out.println(p);
System.out.println(p++); // 후 증가 ~> print 먼저 하고 p + 1
System.out.println(++p); // 선 증가 ~> p + 1 먼저 하고 print
System.out.println(p);
}
}
| [
"58974373+handaeho@users.noreply.github.com"
] | 58974373+handaeho@users.noreply.github.com |
67f5b0e0048d3777b43d891a16e4252ac611eccf | 753f6077721aea46a3037f86b90217d89becc068 | /ItrChatApp/app/src/test/java/com/itraveller/ExampleUnitTest.java | c5ade57c70bdc48817fee6845355d33e697abd30 | [] | no_license | rohan-ram-bundelkhandi/android-GroupChat | b836883bfd2314bda79c5e2f0c485c4139fe8c2e | 93d1536de19f838ee3054d833458d51f86a7debc | refs/heads/master | 2021-01-10T04:24:28.178004 | 2015-12-09T17:15:12 | 2015-12-09T17:15:12 | 47,704,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 307 | java | package com.itraveller;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"rohanrambundelkhandi@gmail.com"
] | rohanrambundelkhandi@gmail.com |
7baeba61dca3d07648b7a8f1b2753f34f6bb5f5b | 5804aac6e9112413997c8bd132296d66cd655034 | /src/main/java/com/lyes/springsecurityjwt/filters/JwtRequestFilter.java | e74004e0c84ce0016cffe6b4654c00f4d4557a1a | [] | no_license | bouyass/spring-security-jwt | c84b8ad90932e759f27fff636f6bbe75089a8791 | dde5fe820eb30fb9c8e7b51a152c3e72bd210405 | refs/heads/master | 2023-01-29T14:53:35.664446 | 2020-12-12T15:48:03 | 2020-12-12T15:48:03 | 320,850,518 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,435 | java | package com.lyes.springsecurityjwt.filters;
import com.lyes.springsecurityjwt.services.MyUserDetailsService;
import com.lyes.springsecurityjwt.utils.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@Component
public class JwtRequestFilter extends OncePerRequestFilter {
@Autowired
private MyUserDetailsService myUserDetailsService;
@Autowired
private JwtUtil jwtUtil;
@Override
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
final String authorizationHeader = httpServletRequest.getHeader("Authorization");
String username = null;
String jwt = null;
if(authorizationHeader != null && authorizationHeader.startsWith("Bearer")){
jwt = authorizationHeader.substring(7);
username = jwtUtil.extractUsername(jwt);
}
if(username != null && SecurityContextHolder.getContext().getAuthentication() == null){
UserDetails userDetails = this.myUserDetailsService.loadUserByUsername(username);
if(jwtUtil.validateToken(jwt, userDetails)){
UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = new UsernamePasswordAuthenticationToken(
userDetails, null, userDetails.getAuthorities()
);
usernamePasswordAuthenticationToken.setDetails(
new WebAuthenticationDetailsSource().buildDetails(httpServletRequest)
);
SecurityContextHolder.getContext().setAuthentication(usernamePasswordAuthenticationToken);
}
filterChain.doFilter(httpServletRequest, httpServletResponse);
}
}
}
| [
"lyes.makhloufi@outlook.fr"
] | lyes.makhloufi@outlook.fr |
9ac14557856378e62e705c2e3e59d08cfe760043 | f9dff14ab54557dc4343345885216beed6ec56f4 | /year 3/POO/l4/java/src/l4z1/SingletonTest.java | 51c8cbaccd81b8f6176165ac5f4620dabedcb0ce | [] | no_license | Konrad-Kasprzyk/study | 159d97db24c91ad181bac6a9ba04bfe921e4ecee | 1577502459e074f8e915bf7dc0c28ad8c5122d78 | refs/heads/master | 2021-06-25T04:35:54.325098 | 2021-06-08T12:52:05 | 2021-06-08T12:52:05 | 223,632,257 | 0 | 2 | null | 2021-06-08T12:52:12 | 2019-11-23T18:08:21 | Python | UTF-8 | Java | false | false | 3,174 | java | package l4z1;
import org.junit.Assert;
import org.junit.Test;
public class SingletonTest {
@Test
public void ProcessSingleton_UniqueTest(){
ProcessSingleton s1 = ProcessSingleton.Instance();
ProcessSingleton s2 = ProcessSingleton.Instance();
Assert.assertEquals(s1, s2);
}
static int s1_hash = 0, s2_hash = 0;
@Test
public void ThreadSingleton_UniqueTest() throws InterruptedException {
for (int i=0; i<10; i++){
Thread thread = new Thread(new Runnable()
{
@Override
public void run()
{
ThreadSingleton s1 = ThreadSingleton.Instance();
ThreadSingleton s2 = ThreadSingleton.Instance();
s1_hash = s1.hashCode();
s2_hash = s2.hashCode();
}
});
thread.start();
thread.join();
Assert.assertEquals(s1_hash, s2_hash);
}
}
@Test
public void ThreadSingleton_UniqueTest2() throws InterruptedException {
for (int i=0; i<10; i++){
Thread thread = new Thread(new Runnable()
{
@Override
public void run()
{
ThreadSingleton s1 = ThreadSingleton.Instance();
s1_hash = s1.hashCode();
}
});
thread.start();
thread.join();
int thread1_singleton = s1_hash;
thread = new Thread(new Runnable()
{
@Override
public void run()
{
ThreadSingleton s1 = ThreadSingleton.Instance();
s1_hash = s1.hashCode();
}
});
thread.start();
thread.join();
int thread2_singleton = s1_hash;
Assert.assertNotEquals(thread1_singleton, thread2_singleton);
}
}
@Test
public void FiveSecondsSingleton_UniqueTest1(){
FiveSecondsSingleton s1 = FiveSecondsSingleton.Instance();
FiveSecondsSingleton s2 = FiveSecondsSingleton.Instance();
Assert.assertEquals(s1, s2);
}
@Test
public void FiveSecondsSingleton_UniqueTest2(){
FiveSecondsSingleton s1 = FiveSecondsSingleton.Instance();
long start = System.currentTimeMillis();
long curr = System.currentTimeMillis();
while(curr - start < FiveSecondsSingleton.MinTimeInterval() - 1000){
curr = System.currentTimeMillis();
}
FiveSecondsSingleton s2 = FiveSecondsSingleton.Instance();
Assert.assertEquals(s1, s2);
}
@Test
public void FiveSecondsSingleton_UniqueTest3(){
FiveSecondsSingleton s1 = FiveSecondsSingleton.Instance();
long start = System.currentTimeMillis();
long curr = System.currentTimeMillis();
while(curr - start < FiveSecondsSingleton.MinTimeInterval()){
curr = System.currentTimeMillis();
}
FiveSecondsSingleton s2 = FiveSecondsSingleton.Instance();
Assert.assertNotEquals(s1, s2);
}
}
| [
"konradwp2135@gmail.com"
] | konradwp2135@gmail.com |
73c190709888bcaf0465838acc765bbf5b1577a1 | 74b47b895b2f739612371f871c7f940502e7165b | /aws-java-sdk-iotthingsgraph/src/main/java/com/amazonaws/services/iotthingsgraph/model/DeploySystemInstanceRequest.java | 81dde872fade54cc1f23795daa39a72dfc2201d3 | [
"Apache-2.0"
] | permissive | baganda07/aws-sdk-java | fe1958ed679cd95b4c48f971393bf03eb5512799 | f19bdb30177106b5d6394223a40a382b87adf742 | refs/heads/master | 2022-11-09T21:55:43.857201 | 2022-10-24T21:08:19 | 2022-10-24T21:08:19 | 221,028,223 | 0 | 0 | Apache-2.0 | 2019-11-11T16:57:12 | 2019-11-11T16:57:11 | null | UTF-8 | Java | false | false | 5,228 | java | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.iotthingsgraph.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/iotthingsgraph-2018-09-06/DeploySystemInstance"
* target="_top">AWS API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeploySystemInstanceRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.
* </p>
* <p>
* The ID should be in the following format.
* </p>
* <p>
* <code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code>
* </p>
*/
private String id;
/**
* <p>
* The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.
* </p>
* <p>
* The ID should be in the following format.
* </p>
* <p>
* <code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code>
* </p>
*
* @param id
* The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.</p>
* <p>
* The ID should be in the following format.
* </p>
* <p>
* <code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code>
*/
public void setId(String id) {
this.id = id;
}
/**
* <p>
* The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.
* </p>
* <p>
* The ID should be in the following format.
* </p>
* <p>
* <code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code>
* </p>
*
* @return The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code>
* action.</p>
* <p>
* The ID should be in the following format.
* </p>
* <p>
* <code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code>
*/
public String getId() {
return this.id;
}
/**
* <p>
* The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.
* </p>
* <p>
* The ID should be in the following format.
* </p>
* <p>
* <code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code>
* </p>
*
* @param id
* The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.</p>
* <p>
* The ID should be in the following format.
* </p>
* <p>
* <code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeploySystemInstanceRequest withId(String id) {
setId(id);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getId() != null)
sb.append("Id: ").append(getId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeploySystemInstanceRequest == false)
return false;
DeploySystemInstanceRequest other = (DeploySystemInstanceRequest) obj;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode());
return hashCode;
}
@Override
public DeploySystemInstanceRequest clone() {
return (DeploySystemInstanceRequest) super.clone();
}
}
| [
""
] | |
e71c6679e12f2fc07c62f3bf1f4b60fc4f2befee | df3e9a28eee28da5403108d55817ecc10d98a80e | /phase6/LruCache.java | 8ed298d2ee484ace04a5a140464bb3f8111536bc | [] | no_license | GuardianOfKnowledge/simulator-load-balancing-sims | 0413038bdc7d04138b934fcbcc24be394fdec355 | 9020ec52c3531ca14fc11a9de284775b49246ddb | refs/heads/master | 2021-08-02T19:55:31.401842 | 2008-03-01T18:41:40 | 2008-03-01T18:41:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | // Limited-capacity LRU cache
import java.util.LinkedHashSet;
class LruCache<Key>
{
public final int capacity;
private LinkedHashSet<Key> set;
public LruCache (int capacity)
{
this.capacity = capacity;
set = new LinkedHashSet<Key> (capacity);
}
public boolean get (Key key)
{
log ("searching cache for key " + key);
if (set.remove (key)) {
set.add (key); // Move the key to the fresh end
return true;
}
return false;
}
public void put (Key key)
{
if (set.remove (key))
log ("key " + key + " already in cache");
else {
log ("adding key " + key + " to cache");
if (set.size() == capacity) {
// Discard the oldest element
Key oldest = set.iterator().next();
log ("discarding key " + oldest);
set.remove (oldest);
}
}
set.add (key); // Add or move the key to the fresh end
}
private void log (String message)
{
// Event.log (message);
}
}
| [
"m.rogers@cs.ucl.ac.uk"
] | m.rogers@cs.ucl.ac.uk |
75519bbf98c4836f7a4bbc0afe7b814aa336dbcd | ba036ce38a3e7b563f169004ab2a1a41af4d667d | /mall-tiny-02/src/main/java/com/mall/tiny/mbg/mapper/UmsAdminPermissionRelationMapper.java | a917fddfd804fb3b834e76b913c006dcf8c31bef | [] | no_license | yanyiheng/mall-service | 4958ca727fad9bd0f25b49336182bf5acdb5fb48 | 6d9644e7f0b808f185d73895b3bf80ec5cf31b95 | refs/heads/master | 2022-07-18T05:59:40.400605 | 2019-08-11T14:55:17 | 2019-08-11T14:55:17 | 199,421,223 | 0 | 0 | null | 2022-06-21T01:35:25 | 2019-07-29T09:24:51 | Java | UTF-8 | Java | false | false | 1,152 | java | package com.mall.tiny.mbg.mapper;
import com.mall.tiny.mbg.model.UmsAdminPermissionRelation;
import com.mall.tiny.mbg.model.UmsAdminPermissionRelationExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UmsAdminPermissionRelationMapper {
long countByExample(UmsAdminPermissionRelationExample example);
int deleteByExample(UmsAdminPermissionRelationExample example);
int deleteByPrimaryKey(Long id);
int insert(UmsAdminPermissionRelation record);
int insertSelective(UmsAdminPermissionRelation record);
List<UmsAdminPermissionRelation> selectByExample(UmsAdminPermissionRelationExample example);
UmsAdminPermissionRelation selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") UmsAdminPermissionRelation record, @Param("example") UmsAdminPermissionRelationExample example);
int updateByExample(@Param("record") UmsAdminPermissionRelation record, @Param("example") UmsAdminPermissionRelationExample example);
int updateByPrimaryKeySelective(UmsAdminPermissionRelation record);
int updateByPrimaryKey(UmsAdminPermissionRelation record);
} | [
"yanyiheng@aibank.com"
] | yanyiheng@aibank.com |
2372f6fd13f02ef7b98ab30bd0989bfb8b14df8c | 9cde34ab950ddd725ac06524461aff2367ebdec7 | /lesson-010/src/main/java/domain/Bucket.java | 8b1edbd8f00c4795d05d45290ad16b4b16068ef3 | [] | no_license | MarkiianBachmaha/Java_Advanced_10 | d4eac0ce81893d69507c32ab2c0efefe61101588 | 73e7abfe18146900e787cf82f89f38df134df5ef | refs/heads/master | 2023-04-11T23:19:48.260193 | 2021-05-17T15:35:49 | 2021-05-17T15:35:49 | 368,237,018 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,469 | java | package domain;
import java.util.Date;
public class Bucket {
private Integer id;
private Integer userId;
private Integer productId;
private Date purchaseDate;
public Bucket(Integer id, Integer userId, Integer productId, Date purchaseDate) {
this.id = id;
this.userId = userId;
this.productId = productId;
this.purchaseDate = purchaseDate;
}
public Bucket(Integer userId, Integer productId, Date purchaseDate) {
this.userId = userId;
this.productId = productId;
this.purchaseDate = purchaseDate;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Date getPurchaseDate() {
return purchaseDate;
}
public void setPurchaseDate(Date purchaseDate) {
this.purchaseDate = purchaseDate;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((productId == null) ? 0 : productId.hashCode());
result = prime * result + ((purchaseDate == null) ? 0 : purchaseDate.hashCode());
result = prime * result + ((userId == null) ? 0 : userId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Bucket other = (Bucket) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
if (productId == null) {
if (other.productId != null)
return false;
} else if (!productId.equals(other.productId))
return false;
if (purchaseDate == null) {
if (other.purchaseDate != null)
return false;
} else if (!purchaseDate.equals(other.purchaseDate))
return false;
if (userId == null) {
if (other.userId != null)
return false;
} else if (!userId.equals(other.userId))
return false;
return true;
}
@Override
public String toString() {
return "Bucket [id=" + id + ", userId=" + userId + ", productId=" + productId + ", purchaseDate=" + purchaseDate
+ "]";
}
} | [
"Admin@Komp"
] | Admin@Komp |
2d00d3739b11dc1510a096baa78f2e07718764b6 | 5d2e63c4d7d777f89b39417b7d3e30c500af7a7b | /app/src/main/java/io/github/sagar15795/meetupsampleapp/main/MainActivity.java | 58afd8e5096eca71f417540271682b4e88845927 | [] | no_license | sagar15795/BookSample | 7f054e8843530343173e6d2a85e085cb3a9f1d46 | 88f0afd89773ccef31d8c0d196e8aea95d0f2833 | refs/heads/master | 2020-03-25T04:55:39.639530 | 2019-10-03T09:59:29 | 2019-10-03T09:59:29 | 143,420,638 | 0 | 1 | null | 2019-10-17T13:25:38 | 2018-08-03T11:44:15 | Java | UTF-8 | Java | false | false | 6,163 | java | package io.github.sagar15795.meetupsampleapp.main;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import io.github.sagar15795.meetupsampleapp.R;
import io.github.sagar15795.meetupsampleapp.data.model.Book;
import io.github.sagar15795.meetupsampleapp.data.remote.BookAPIManager;
import io.github.sagar15795.meetupsampleapp.utils.RecyclerItemClickListner;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class MainActivity extends AppCompatActivity implements RecyclerItemClickListner.OnItemClickListener, View.OnClickListener {
private RecyclerView recyclerView;
private List<Book> bookList;
private TextView tvMessage;
private FloatingActionButton fabAdd;
private BookAdapter bookAdapter;
private BookAPIManager bookAPIManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewSetup();
setup();
}
@Override
protected void onResume() {
super.onResume();
bookAPIManager = new BookAPIManager();
getBooks();
}
@Override
protected void onPause() {
super.onPause();
if (!bookAPIManager.getBookApi().getBook().isExecuted()) {
bookAPIManager.getBookApi().getBook().cancel();
}
}
private void viewSetup() {
recyclerView = findViewById(R.id.recycler_view);
tvMessage = findViewById(R.id.tvError);
fabAdd = findViewById(R.id.fab);
fabAdd.setOnClickListener(this);
}
private void setup() {
bookList = new ArrayList<>();
bookAdapter = new BookAdapter(bookList);
RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
recyclerView.setLayoutManager(mLayoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(bookAdapter);
recyclerView.addItemDecoration(new DividerItemDecoration(this,DividerItemDecoration.VERTICAL));
recyclerView.addOnItemTouchListener(new RecyclerItemClickListner(this,this));
}
@Override
public void onItemClick(View childView, int position) {
}
@Override
public void onItemLongPress(View childView, int position) {
}
@Override
public void onClick(View view) {
AlertDialog.Builder saveDialogBuilder = new AlertDialog.Builder(this);
saveDialogBuilder.setTitle("Enter document name");
final View viewDialog = getLayoutInflater().inflate(R.layout.dialog_add_note, null);
saveDialogBuilder.setView(viewDialog);
final EditText etAuthor = viewDialog.findViewById(R.id.etAuthor);
final EditText etNoteTitle = viewDialog.findViewById(R.id.etNoteTitle);
saveDialogBuilder.setCancelable(false);
saveDialogBuilder.setPositiveButton("Add", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
MainActivity.this.addNote(etAuthor.getText().toString(),etNoteTitle.getText().toString());
}
});
saveDialogBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
AlertDialog saveDialog = saveDialogBuilder.create();
saveDialog.setCanceledOnTouchOutside(false);
saveDialog.show();
}
private void addNote(String author, String noteTitle) {
Book book = new Book();
book.setTitle(noteTitle);
book.setAuthorId(author);
bookAPIManager.getBookApi().addBook(book).enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
if(response.isSuccessful()){
getBooks();
}else{
Toast.makeText(MainActivity.this, "Server response code "+response.code(),
Toast.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
}
});
}
public void getBooks() {
bookAPIManager.getBookApi().getBook().enqueue(new Callback<List<Book>>() {
@Override
public void onResponse(Call<List<Book>> call, Response<List<Book>> response) {
if(response.isSuccessful()) {
if (response.body() == null || response.body().size() == 0) {
Toast.makeText(MainActivity.this, "No Book Found", Toast.LENGTH_SHORT).show();
} else {
bookList.clear();
bookList.addAll(response.body());
bookAdapter.notifyDataSetChanged();
}
}else{
Toast.makeText(MainActivity.this, "Server response code "+response.code(),
Toast
.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(Call<List<Book>> call, Throwable t) {
Toast.makeText(MainActivity.this, "ERROR", Toast.LENGTH_SHORT).show();
}
});
}
}
| [
"kumarsagar15795@gmail.com"
] | kumarsagar15795@gmail.com |
87712c54ff6525924c2a7159104c2748f7a3c021 | b847c22ab8bf826a7520d8ea03aaa0a20ac4c944 | /src/main/java/com/kaishengit/web/admin/AdminUserServlet.java | 9684510359384fba8bfeaf81c6859fc8e5c22243 | [] | no_license | loveoh/BBS | 87ca7b973e9512033489074019c1b87dd8f31e00 | 9acf36bc35900d680a8ac6d150d3e8be9781a025 | refs/heads/master | 2021-01-12T07:07:49.255068 | 2016-12-29T15:39:55 | 2016-12-29T15:39:55 | 76,656,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,193 | java | package com.kaishengit.web.admin;
import com.kaishengit.dto.JsonResult;
import com.kaishengit.entity.User;
import com.kaishengit.exception.ServiceException;
import com.kaishengit.service.AdminService;
import com.kaishengit.utils.Page;
import com.kaishengit.vo.UserVo;
import com.kaishengit.web.BaseServlet;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.bind.util.JAXBSource;
import java.io.IOException;
import java.util.List;
/**
* Created by loveoh on 2016/12/29.
*/
@WebServlet("/admin/user")
public class AdminUserServlet extends BaseServlet{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String p = req.getParameter("page");
AdminService adminService = new AdminService();
try {
Page<UserVo> page = adminService.findUserVoList(p);
req.setAttribute("page",page);
forward("/admin/adminuser",req,resp);
}catch (ServiceException e){
e.printStackTrace();
resp.sendError(404,"服务器异常");
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String userid = req.getParameter("id");
AdminService adminService = new AdminService();
JsonResult jsonResult = new JsonResult();
try {
User user = adminService.findUserByUserId(userid);
if (user.getStatus() == 1) {
user.setStatus(2);
adminService.update(user);
jsonResult.setState(jsonResult.SUCCESS);
jsonResult.setData(2);
} else if (user.getStatus() == 2) {
user.setStatus(1);
adminService.update(user);
jsonResult.setState(jsonResult.SUCCESS);
jsonResult.setData(1);
}
}catch (ServiceException e){
jsonResult.setMessage(e.getMessage());
}
renderJSON(jsonResult,resp);
}
}
| [
"1012441149@qq.com"
] | 1012441149@qq.com |
5d52d195dd37542f3461d107d4cecbf5d9349513 | cfa77b49d5ccc22f0a5cdc06c678b2b9800ae17c | /MyApplication2/app/src/main/java/exportkit/xd/cep_telefonu_tablet_servisi___1_activity.java | eaf10ea2b0832139e92eeb716282a3a688b388bb | [] | no_license | tesladam/Android-Studio-Calismalari | 655bef34cea4e2f68a8334ed976b94621d2b1b70 | a39a5f16d852a355d36ebd319eefb08926528651 | refs/heads/master | 2021-06-26T04:57:09.182258 | 2019-06-09T23:17:21 | 2019-06-09T23:17:21 | 130,847,886 | 0 | 1 | null | 2020-10-01T14:14:21 | 2018-04-24T12:04:56 | Java | UTF-8 | Java | false | false | 5,835 | java |
/*
* This content is generated from the PSD File Info.
* (Alt+Shift+Ctrl+I).
*
* @desc
* @file ho_geldin___1
* @date 0
* @title Hogeldin 1
* @author
* @keywords
* @generator Export Kit v1.2.8.xd
*
*/
package exportkit.xd;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
public class cep_telefonu_tablet_servisi___1_activity extends Activity {
private View _bg__cep_telefonu_tablet_servisi___1_ek2;
private View rectangle_6_ek28;
private ImageView path_18_ek28;
private ImageView repairing_service_ek28;
private ImageView path_13_ek28;
private ImageView path_29_ek28;
private ImageView path_14_ek28;
private ImageView path_15_ek28;
private ImageView path_16_ek28;
private ImageView path_17_ek28;
private ImageView facebook_places_ek28;
private ImageView path_5_ek28;
private View rectangle_5_ek28;
private ImageView path_10_ek28;
private ImageView path_8_ek28;
private ImageView path_9_ek28;
private TextView _r_n__kategori_veya_marka_ara____ek28;
private ImageView path_6_ek28;
private View search_field_ek28;
private ImageView dictation_ek28;
private TextView ___text_ek28;
private ImageView search_ek57;
private ImageView path_11_ek28;
private ImageView path_12_ek28;
private View ellipse_1_ek28;
private TextView _1_ek28;
private ImageView path_4_ek28;
private ImageView plus_ek28;
private View rectangle_11_ek18;
private View background_ek44;
private TextView ___label_ek30;
private View rectangle_23_ek3;
private TextView se__ek34;
private View rectangle_1_ek19;
private TextView se__ek35;
private View rectangle_24_ek3;
private TextView se__ek36;
private TextView preview_ek25;
private ImageView arrow_ek37;
private View rectangle_23_ek4;
private TextView se__ek37;
private TextView se__ek38;
private ImageView path_2_ek11;
private ImageView arrow_ek38;
private View rectangle_2_ek10;
private TextView ___title_ek10;
private ImageView divider_ek39;
private View mask_ek41;
private TextView talebiniz_bize_ula_t___en_k_sa_s_rede_d_n___yapaca__z__ek4;
private View mask_ek42;
private View background_ek46;
private TextView ___label_ek31;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cep_telefonu_tablet_servisi___1);
_bg__cep_telefonu_tablet_servisi___1_ek2 = (View) findViewById(R.id._bg__cep_telefonu_tablet_servisi___1_ek2);
rectangle_6_ek28 = (View) findViewById(R.id.rectangle_6_ek28);
path_18_ek28 = (ImageView) findViewById(R.id.path_18_ek28);
repairing_service_ek28 = (ImageView) findViewById(R.id.repairing_service_ek28);
path_13_ek28 = (ImageView) findViewById(R.id.path_13_ek28);
path_29_ek28 = (ImageView) findViewById(R.id.path_29_ek28);
path_14_ek28 = (ImageView) findViewById(R.id.path_14_ek28);
path_15_ek28 = (ImageView) findViewById(R.id.path_15_ek28);
path_16_ek28 = (ImageView) findViewById(R.id.path_16_ek28);
path_17_ek28 = (ImageView) findViewById(R.id.path_17_ek28);
facebook_places_ek28 = (ImageView) findViewById(R.id.facebook_places_ek28);
path_5_ek28 = (ImageView) findViewById(R.id.path_5_ek28);
rectangle_5_ek28 = (View) findViewById(R.id.rectangle_5_ek28);
path_10_ek28 = (ImageView) findViewById(R.id.path_10_ek28);
path_8_ek28 = (ImageView) findViewById(R.id.path_8_ek28);
path_9_ek28 = (ImageView) findViewById(R.id.path_9_ek28);
_r_n__kategori_veya_marka_ara____ek28 = (TextView) findViewById(R.id._r_n__kategori_veya_marka_ara____ek28);
path_6_ek28 = (ImageView) findViewById(R.id.path_6_ek28);
search_field_ek28 = (View) findViewById(R.id.search_field_ek28);
dictation_ek28 = (ImageView) findViewById(R.id.dictation_ek28);
___text_ek28 = (TextView) findViewById(R.id.___text_ek28);
search_ek57 = (ImageView) findViewById(R.id.search_ek57);
path_11_ek28 = (ImageView) findViewById(R.id.path_11_ek28);
path_12_ek28 = (ImageView) findViewById(R.id.path_12_ek28);
ellipse_1_ek28 = (View) findViewById(R.id.ellipse_1_ek28);
_1_ek28 = (TextView) findViewById(R.id._1_ek28);
path_4_ek28 = (ImageView) findViewById(R.id.path_4_ek28);
plus_ek28 = (ImageView) findViewById(R.id.plus_ek28);
rectangle_11_ek18 = (View) findViewById(R.id.rectangle_11_ek18);
background_ek44 = (View) findViewById(R.id.background_ek44);
___label_ek30 = (TextView) findViewById(R.id.___label_ek30);
rectangle_23_ek3 = (View) findViewById(R.id.rectangle_23_ek3);
se__ek34 = (TextView) findViewById(R.id.se__ek34);
rectangle_1_ek19 = (View) findViewById(R.id.rectangle_1_ek19);
se__ek35 = (TextView) findViewById(R.id.se__ek35);
rectangle_24_ek3 = (View) findViewById(R.id.rectangle_24_ek3);
se__ek36 = (TextView) findViewById(R.id.se__ek36);
preview_ek25 = (TextView) findViewById(R.id.preview_ek25);
arrow_ek37 = (ImageView) findViewById(R.id.arrow_ek37);
rectangle_23_ek4 = (View) findViewById(R.id.rectangle_23_ek4);
se__ek37 = (TextView) findViewById(R.id.se__ek37);
se__ek38 = (TextView) findViewById(R.id.se__ek38);
path_2_ek11 = (ImageView) findViewById(R.id.path_2_ek11);
arrow_ek38 = (ImageView) findViewById(R.id.arrow_ek38);
rectangle_2_ek10 = (View) findViewById(R.id.rectangle_2_ek10);
___title_ek10 = (TextView) findViewById(R.id.___title_ek10);
divider_ek39 = (ImageView) findViewById(R.id.divider_ek39);
mask_ek41 = (View) findViewById(R.id.mask_ek41);
talebiniz_bize_ula_t___en_k_sa_s_rede_d_n___yapaca__z__ek4 = (TextView) findViewById(R.id.talebiniz_bize_ula_t___en_k_sa_s_rede_d_n___yapaca__z__ek4);
mask_ek42 = (View) findViewById(R.id.mask_ek42);
background_ek46 = (View) findViewById(R.id.background_ek46);
___label_ek31 = (TextView) findViewById(R.id.___label_ek31);
//custom code goes here
}
}
| [
"hkn1899@gmail.com"
] | hkn1899@gmail.com |
6b831af7e165cb05902348c7348c3a9ede3352c9 | 63c885119fcbe02218dfd3fbbb689237ed473403 | /Z1.java | fd4cb76025de67e51df7f827e699dc950c37e8d2 | [] | no_license | Kseniya-Katselnikava/JB29_HT5_P1 | 5d7101076ef0eb343a84720dd3bc47562ba11d15 | 8f6542ff9c2b353453b11339ab4d52216d3fd339 | refs/heads/master | 2020-07-29T13:49:34.572954 | 2019-09-20T15:56:43 | 2019-09-20T15:56:43 | 209,828,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 794 | java | //В массив A [N] занесены натуральные числа. Найти сумму тех элементов, которые кратны данному К.
package by.epam.jb29.task08_1;
import java.util.Random;
public class Z1 {
public static void main(String[] args) {
int [] arr = new int[10];
Random ran = new Random();
int K = 2;
int sum = 0;
for (int i = 0; i < arr.length; i++) {
arr[i] = ran.nextInt(50);
System.out.print(arr[i] + "\t");
}
for (int i = 0; i < arr.length; i++) {
if (arr[i] % K == 0) {
sum += arr[i];
}
}
System.out.println("\nСумма элементов равна: " + sum);
}
} | [
"noreply@github.com"
] | noreply@github.com |
2b4fcba0e2b3c5444d8d4990ff7234a2ea3b25b8 | 9ba6812cf39f2497206d0c08070b70da9e74f80b | /core/java/iesi-core/src/main/java/io/metadew/iesi/metadata/configuration/dataset/DatasetParameterConfiguration.java | 01c13824a487c1442278dca5bf5b311e3e0311be | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | M-Ainee/iesi | dc177c8e735dea8bc9307ba6faf88aa8866b78c8 | 5db17116d5fc3b643b1412456e0ed912f9575d5c | refs/heads/master | 2022-12-16T09:09:52.016500 | 2020-07-10T18:59:32 | 2020-07-10T18:59:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,990 | java | //package io.metadew.iesi.metadata.configuration.dataset;
//
//import io.metadew.iesi.connection.tools.SQLTools;
//import io.metadew.iesi.metadata.definition.dataset.DatasetParameter;
//import io.metadew.iesi.metadata.execution.MetadataControl;
//
//import javax.sql.rowset.CachedRowSet;
//import java.io.PrintWriter;
//import java.io.StringWriter;
//import java.sql.SQLException;
//
//public class DatasetParameterConfiguration {
//
// private DatasetParameter datasetParameter;
//
// // Constructors
// public DatasetParameterConfiguration(DatasetParameter datasetParameter) {
// this.setDatasetParameter(datasetParameter);
// }
//
// public DatasetParameterConfiguration() {
// }
//
// // Insert
// public String getInsertStatement(String datasetName) {
// String sql = "";
//
// sql += "INSERT INTO " + MetadataControl.getInstance().getConnectivityMetadataRepository().getTableNameByLabel("DatasetParameters");
// sql += " (DST_ID, DST_PAR_NM, DST_PAR_VAL) ";
// sql += "VALUES ";
// sql += "(";
// sql += "(" + SQLTools.GetLookupIdStatement(MetadataControl.getInstance().getDesignMetadataRepository().getTableNameByLabel("Repositories"), "DST_ID", "where DST_NM = '" + datasetName) + "')";
// sql += ",";
// sql += SQLTools.GetStringForSQL(this.getDatasetParameter().getName());
// sql += ",";
// sql += SQLTools.GetStringForSQL(this.getDatasetParameter().getValue());
// sql += ")";
// sql += ";";
//
// return sql;
// }
//
// public DatasetParameter getDatasetParameter(long datasetId, String datasetParameterName) {
// DatasetParameter datasetParameter = new DatasetParameter();
// CachedRowSet crsDatasetParameter = null;
// String queryDatasetParameter = "select DST_ID, DST_PAR_NM, DST_PAR_VAL from " + MetadataControl.getInstance().getConnectivityMetadataRepository().getTableNameByLabel("DatasetParameters")
// + " where DST_ID = " + datasetId + " and DST_PAR_NM = '" + datasetParameterName + "'";
// crsDatasetParameter = MetadataControl.getInstance().getConnectivityMetadataRepository().executeQuery(queryDatasetParameter, "reader");
// try {
// while (crsDatasetParameter.next()) {
// datasetParameter.setName(datasetParameterName);
// datasetParameter.setValue(crsDatasetParameter.getString("DST_PAR_VAL"));
// }
// crsDatasetParameter.close();
// } catch (SQLException e) {
// StringWriter StackTrace = new StringWriter();
// e.printStackTrace(new PrintWriter(StackTrace));
// }
// return datasetParameter;
// }
//
// // Getters and Setters
// public DatasetParameter getDatasetParameter() {
// return datasetParameter;
// }
//
// public void setDatasetParameter(DatasetParameter datasetParameter) {
// this.datasetParameter = datasetParameter;
// }
//
//} | [
"noreply@github.com"
] | noreply@github.com |
92845b200d1a58864d7282cd582e318de4936332 | 079cb330b5e15947a7e1f56dcbec1f5bd5c7e432 | /my-dal/src/main/java/my/dal/service/impl/CustomerServiceImpl.java | 18588c7f96971220fbf659a57c7966b06a5e1f90 | [] | no_license | wohshon/myrepublic | adc90c9d6504415a720fdc54a1df796606fa49b1 | ee4f8565536e4cceb16a92b527520949cb7c7e88 | refs/heads/master | 2020-07-06T19:22:06.518029 | 2019-08-19T05:50:52 | 2019-08-19T05:50:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package my.dal.service.impl;
import javax.inject.Singleton;
import my.com.common.scalar.Customer;
// import my.dal.sevice.CustomerService;
import my.dal.service.CustomerService;
import my.dal.service.base.BaseService;
/**
* CustomerServiceImpl
*/
@Singleton
public class CustomerServiceImpl extends BaseService<Customer> implements CustomerService{
} | [
"robin.foe@gmail.com"
] | robin.foe@gmail.com |
5f169279589ac26b60ffedc54b912a8e4c902125 | 41a4082b3e18b47b035a15754ddea0063b6be336 | /src/main/java/socket/UDPSocketServer.java | 77b617b074e4cb429c1574dcf3ca2b05e92e53ca | [] | no_license | JavaLuSir/Toolkit | 56229a17cd7428b333d6ce2102bde0791ee0b351 | 23c19faf758e955508583e1b5d11f08a11fea569 | refs/heads/master | 2020-04-09T12:36:30.081787 | 2018-12-05T15:07:04 | 2018-12-05T15:07:04 | 160,357,106 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package socket;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;
/**
* UDPSocketDemo Server
* @author javalusir
*
*/
public class UDPSocketServer {
public static void main(String[] args) {
try {
System.out.println("server...");
DatagramSocket ds = new DatagramSocket(9876);
byte[] rdata = new byte[1024];
while(true){
DatagramPacket dp = new DatagramPacket(rdata,rdata.length);
ds.receive(dp);
//1.5以前获取实际字节长度到新byte数组
byte[] receivedData = new byte[dp.getLength()];
System.arraycopy(dp.getData(), dp.getOffset(), receivedData, 0, receivedData.length);
//1.5以上
//byte[] d=Arrays.copyOfRange(dp.getData(), dp.getOffset(), dp.getOffset()+dp.getLength());
String ss = new String(receivedData);
System.out.println("ReceivedPath:"+dp.getAddress());
System.out.println("ReceivedPort:"+dp.getPort());
System.out.println("Received:"+ss);
dp.setLength(dp.getData().length);
ds.send(dp);
}
} catch (SocketException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"javalusir@163.com"
] | javalusir@163.com |
57fd55dd0c58af9ec3bfe1da4492d5ac7f8cd7d8 | 62f88102b55258559baa53ecdd7bd8c87b88044c | /src/main/java/pers/yuezejian/coldchainlogistics/common/utils/security/Md5Utils.java | 9e05d7df02c466304ffb91d2610304a5c310469d | [] | no_license | HuskyYue/yuezjcoldchainlogistics | 71ed0dcce5653103658f90204c2f34e7163d7db8 | 2dbdffa8741d6c8d195c22e21453151f31e52d1b | refs/heads/master | 2022-06-22T22:14:02.103464 | 2020-03-22T10:36:15 | 2020-03-22T10:36:15 | 249,118,882 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,593 | java | package pers.yuezejian.coldchainlogistics.common.utils.security;
import java.security.MessageDigest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Md5加密方法
*
* @Author: Yuezejian
**/
public class Md5Utils
{
private static final Logger log = LoggerFactory.getLogger(Md5Utils.class);
private static byte[] md5(String s)
{
MessageDigest algorithm;
try
{
algorithm = MessageDigest.getInstance("MD5");
algorithm.reset();
algorithm.update(s.getBytes("UTF-8"));
byte[] messageDigest = algorithm.digest();
return messageDigest;
}
catch (Exception e)
{
log.error("MD5 Error...", e);
}
return null;
}
private static final String toHex(byte hash[])
{
if (hash == null)
{
return null;
}
StringBuffer buf = new StringBuffer(hash.length * 2);
int i;
for (i = 0; i < hash.length; i++)
{
if ((hash[i] & 0xff) < 0x10)
{
buf.append("0");
}
buf.append(Long.toString(hash[i] & 0xff, 16));
}
return buf.toString();
}
public static String hash(String s)
{
try
{
return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8");
}
catch (Exception e)
{
log.error("not supported charset...{}", e);
return s;
}
}
}
| [
"1520022090@qq.com"
] | 1520022090@qq.com |
f734375c2f941709419ad5a70187d317ab095182 | 82b74dd097087cae99b5536ceb771ef1ffbdeae7 | /week1/day3/ValidBST.java | f834b260b5867dd8e507ae603b43c85cd4a3b10f | [] | no_license | SobhaPothuganti/CompetitiveProgramming | fe116abba1d6c027b5ff2925eeb1926d00d2f10d | 69a3da1e8a8ba42a81d1bfafea99dfc6a5f06715 | refs/heads/master | 2020-03-21T15:42:28.719311 | 2018-07-21T09:28:19 | 2018-07-21T09:28:19 | 138,728,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,287 | java | import java.util.*;
class BSTNode {
public int value;
public BSTNode left;
public BSTNode right;
public BSTNode(int value) {
this.value = value;
}
public BSTNode insertLeft(int leftValue) {
this.left = new BSTNode(leftValue);
return this.left;
}
public BSTNode insertRight(int rightValue) {
this.right = new BSTNode(rightValue);
return this.right;
}
}
public class ValidBST {
public boolean checkBST(BSTNode root,int min,int max)
{
if(root!=null)
{
if(root.value>min && root.value<max){
return checkBST(root.left,min,root.value) && checkBST(root.right,root.value,max);
}
else{
return false;
}
}
else
{
return true;
}
}
public static void main(String[] args) {
BSTNode bt = new BSTNode(100);
BSTNode b =bt.insertLeft(60);
BSTNode b0 = b.insertRight(70);
BSTNode b1 = b.insertLeft(20);
BSTNode b2 = bt.insertRight(180);
// BSTNode b3 = bt.insertLeft(180);
ValidBST valid = new ValidBST();
System.out.println(valid.checkBST(bt,Integer.MIN_VALUE,Integer.MAX_VALUE));
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8816d601df9c684a2d78b2b235fdd67cc8928e9d | e3852357ec62b7e0f65ea497378e552656b5e15f | /Kafka/src/main/java/com/zh/kafka/interceptor/Producer1.java | 80c20167207e4a6ffa9a3ff20d8bf46251a029b6 | [] | no_license | huanshilang1985/HadoopFamily | a89f0c976e002c9683214993ae92d279ba1cb478 | e4c8a76c32b9723cedc35425cf6a4f00d6f319d3 | refs/heads/master | 2021-12-15T00:48:25.294939 | 2019-09-05T08:15:33 | 2019-09-05T08:15:33 | 180,492,181 | 0 | 0 | null | 2021-12-14T21:33:17 | 2019-04-10T03:11:12 | Java | UTF-8 | Java | false | false | 1,791 | java | package com.zh.kafka.interceptor;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import java.util.ArrayList;
import java.util.Properties;
/**
* @Author zhanghe
* @Desc:
* @Date 2019/3/28 22:52
*/
public class Producer1 {
public static void main(String[] args) {
//1.配置生产者属性(指定多个参数)
Properties prop = new Properties();
//参数配置
//kafka节点的地址
prop.put("bootstrap.servers", "192.168.50.183:9092");
//发送消息是否等待应答
prop.put("acks", "all");
//配置发送消息失败重试
prop.put("retries", "0");
//配置批量处理消息大小
prop.put("batch.size", "10241");
//配置批量处理数据延迟
prop.put("linger.ms","5");
//配置内存缓冲大小
prop.put("buffer.memory", "12341235");
//消息在发送前必须序列化
prop.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
prop.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
//拦截器
ArrayList<String> inList = new ArrayList<String>();
inList.add("com.itstare.TimeInterceptor");
prop.put(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG, inList);
//2.实例化producer
KafkaProducer<String, String> producer = new KafkaProducer<String, String>(prop);
//3.发送消息
for(int i = 0;i<99;i++) {
producer.send(new ProducerRecord<String, String>("shengdan", "hunterhenshuai" + i) );
}
//4.释放资源
producer.close();
}
}
| [
"Dxh2017$$"
] | Dxh2017$$ |
827fff4db56c71fdf8de9185e740d4a3b03e22eb | 0308ca5b152a082c1a206a1a136fd45e79b48143 | /usvao/VAO/software/datascope/projects/skyview/trunk/src/java/ij/measure/CurveFitter.java | afdadc4d48a5be1d6957807c560a162132149031 | [] | no_license | Schwarzam/usvirtualobservatory | b609bf21a09c187b70e311a4c857516284049c31 | 53fe6c14cc9312d048326acfa25377e3eac59858 | refs/heads/master | 2022-03-28T23:38:58.847018 | 2019-11-27T16:05:47 | 2019-11-27T16:05:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,581 | java | package ij.measure;
import ij.*;
import ij.gui.*;
/** Curve fitting class based on the Simplex method described
* in the article "Fitting Curves to Data" in the May 1984
* issue of Byte magazine, pages 340-362.
*
* 2001/02/14: Midified to handle a gamma variate curve.
* Uses altered Simplex method based on method in "Numerical Recipes in C".
* This method tends to converge closer in less iterations.
* Has the option to restart the simplex at the initial best solution in
* case it is "stuck" in a local minimum (by default, restarted once). Also includes
* settings dialog option for user control over simplex parameters and functions to
* evaluate the goodness-of-fit. The results can be easily reported with the
* getResultString() method.
*
* @author Kieran Holland (email: holki659@student.otago.ac.nz)
* @version 1.0
*
*/
public class CurveFitter {
public static final int STRAIGHT_LINE=0,POLY2=1,POLY3=2,POLY4=3,
EXPONENTIAL=4,POWER=5,LOG=6,RODBARD=7,GAMMA_VARIATE=8, LOG2=9, RODBARD2=10;
public static final int IterFactor = 500;
public static final String[] fitList = {"Straight Line","2nd Degree Polynomial",
"3rd Degree Polynomial", "4th Degree Polynomial","Exponential","Power",
"log","Rodbard", "Gamma Variate", "y = a+b*ln(x-c)","Rodbard (NIH Image)"};
public static final String[] fList = {"y = a+bx","y = a+bx+cx^2",
"y = a+bx+cx^2+dx^3", "y = a+bx+cx^2+dx^3+ex^4","y = a*exp(bx)","y = ax^b",
"y = a*ln(bx)", "y = d+(a-d)/(1+(x/c)^b)", "y = a*(x-b)^c*exp(-(x-b)/d)", "y = a+b*ln(x-c)", "y = d+(a-d)/(1+(x/c)^b)",};
private static final double alpha = -1.0; // reflection coefficient
private static final double beta = 0.5; // contraction coefficient
private static final double gamma = 2.0; // expansion coefficient
private static final double root2 = 1.414214; // square root of 2
private int fit; // Number of curve type to fit
private double[] xData, yData; // x,y data to fit
private int numPoints; // number of data points
private int numParams; // number of parametres
private int numVertices; // numParams+1 (includes sumLocalResiduaalsSqrd)
private int worst; // worst current parametre estimates
private int nextWorst; // 2nd worst current parametre estimates
private int best; // best current parametre estimates
private double[][] simp; // the simplex (the last element of the array at each vertice is the sum of the square of the residuals)
private double[] next; // new vertex to be tested
private int numIter; // number of iterations so far
private int maxIter; // maximum number of iterations per restart
private int restarts; // number of times to restart simplex after first soln.
private double maxError; // maximum error tolerance
/** Construct a new CurveFitter. */
public CurveFitter (double[] xData, double[] yData) {
this.xData = xData;
this.yData = yData;
numPoints = xData.length;
}
/** Perform curve fitting with the simplex method
* doFit(fitType) just does the fit
* doFit(fitType, true) pops up a dialog allowing control over simplex parameters
* alpha is reflection coefficient (-1)
* beta is contraction coefficient (0.5)
* gamma is expansion coefficient (2)
*/
public void doFit(int fitType) {
doFit(fitType, false);
}
public void doFit(int fitType, boolean showSettings) {
if (fitType < STRAIGHT_LINE || fitType > RODBARD2)
throw new IllegalArgumentException("Invalid fit type");
int saveFitType = fitType;
if (fitType==RODBARD2) {
double[] temp;
temp = xData;
xData = yData;
yData = temp;
fitType = RODBARD;
}
fit = fitType;
initialize();
if (showSettings) settingsDialog();
restart(0);
numIter = 0;
boolean done = false;
double[] center = new double[numParams]; // mean of simplex vertices
while (!done) {
numIter++;
for (int i = 0; i < numParams; i++) center[i] = 0.0;
// get mean "center" of vertices, excluding worst
for (int i = 0; i < numVertices; i++)
if (i != worst)
for (int j = 0; j < numParams; j++)
center[j] += simp[i][j];
// Reflect worst vertex through centre
for (int i = 0; i < numParams; i++) {
center[i] /= numParams;
next[i] = center[i] + alpha*(simp[worst][i] - center[i]);
}
sumResiduals(next);
// if it's better than the best...
if (next[numParams] <= simp[best][numParams]) {
newVertex();
// try expanding it
for (int i = 0; i < numParams; i++)
next[i] = center[i] + gamma * (simp[worst][i] - center[i]);
sumResiduals(next);
// if this is even better, keep it
if (next[numParams] <= simp[worst][numParams])
newVertex();
}
// else if better than the 2nd worst keep it...
else if (next[numParams] <= simp[nextWorst][numParams]) {
newVertex();
}
// else try to make positive contraction of the worst
else {
for (int i = 0; i < numParams; i++)
next[i] = center[i] + beta*(simp[worst][i] - center[i]);
sumResiduals(next);
// if this is better than the second worst, keep it.
if (next[numParams] <= simp[nextWorst][numParams]) {
newVertex();
}
// if all else fails, contract simplex in on best
else {
for (int i = 0; i < numVertices; i++) {
if (i != best) {
for (int j = 0; j < numVertices; j++)
simp[i][j] = beta*(simp[i][j]+simp[best][j]);
sumResiduals(simp[i]);
}
}
}
}
order();
double rtol = 2 * Math.abs(simp[best][numParams] - simp[worst][numParams]) /
(Math.abs(simp[best][numParams]) + Math.abs(simp[worst][numParams]) + 0.0000000001);
if (numIter >= maxIter) done = true;
else if (rtol < maxError) {
//System.out.print(getResultString());
restarts--;
if (restarts < 0) {
done = true;
}
else {
restart(best);
}
}
}
fitType = saveFitType;
}
/** Initialise the simplex
*/
void initialize() {
// Calculate some things that might be useful for predicting parametres
numParams = getNumParams();
numVertices = numParams + 1; // need 1 more vertice than parametres,
simp = new double[numVertices][numVertices];
next = new double[numVertices];
double firstx = xData[0];
double firsty = yData[0];
double lastx = xData[numPoints-1];
double lasty = yData[numPoints-1];
double xmean = (firstx+lastx)/2.0;
double ymean = (firsty+lasty)/2.0;
double slope;
if ((lastx - firstx) != 0.0)
slope = (lasty - firsty)/(lastx - firstx);
else
slope = 1.0;
double yintercept = firsty - slope * firstx;
maxIter = IterFactor * numParams * numParams; // Where does this estimate come from?
restarts = 1;
maxError = 1e-9;
switch (fit) {
case STRAIGHT_LINE:
simp[0][0] = yintercept;
simp[0][1] = slope;
break;
case POLY2:
simp[0][0] = yintercept;
simp[0][1] = slope;
simp[0][2] = 0.0;
break;
case POLY3:
simp[0][0] = yintercept;
simp[0][1] = slope;
simp[0][2] = 0.0;
simp[0][3] = 0.0;
break;
case POLY4:
simp[0][0] = yintercept;
simp[0][1] = slope;
simp[0][2] = 0.0;
simp[0][3] = 0.0;
simp[0][4] = 0.0;
break;
case EXPONENTIAL:
simp[0][0] = 0.1;
simp[0][1] = 0.01;
break;
case POWER:
simp[0][0] = 0.0;
simp[0][1] = 1.0;
break;
case LOG:
simp[0][0] = 0.5;
simp[0][1] = 0.05;
break;
case RODBARD: case RODBARD2:
simp[0][0] = firsty;
simp[0][1] = 1.0;
simp[0][2] = xmean;
simp[0][3] = lasty;
break;
case GAMMA_VARIATE:
// First guesses based on following observations:
// t0 [b] = time of first rise in gamma curve - so use the user specified first limit
// tm = t0 + a*B [c*d] where tm is the time of the peak of the curve
// therefore an estimate for a and B is sqrt(tm-t0)
// K [a] can now be calculated from these estimates
simp[0][0] = firstx;
double ab = xData[getMax(yData)] - firstx;
simp[0][2] = Math.sqrt(ab);
simp[0][3] = Math.sqrt(ab);
simp[0][1] = yData[getMax(yData)] / (Math.pow(ab, simp[0][2]) * Math.exp(-ab/simp[0][3]));
break;
case LOG2:
simp[0][0] = 0.5;
simp[0][1] = 0.05;
simp[0][2] = 0.0;
break;
}
}
/** Pop up a dialog allowing control over simplex starting parameters */
private void settingsDialog() {
GenericDialog gd = new GenericDialog("Simplex Fitting Options", IJ.getInstance());
gd.addMessage("Function name: " + fitList[fit] + "\n" +
"Formula: " + fList[fit]);
char pChar = 'a';
for (int i = 0; i < numParams; i++) {
gd.addNumericField("Initial "+(new Character(pChar)).toString()+":", simp[0][i], 2);
pChar++;
}
gd.addNumericField("Maximum iterations:", maxIter, 0);
gd.addNumericField("Number of restarts:", restarts, 0);
gd.addNumericField("Error tolerance [1*10^(-x)]:", -(Math.log(maxError)/Math.log(10)), 0);
gd.showDialog();
if (gd.wasCanceled() || gd.invalidNumber()) {
IJ.error("Parameter setting canceled.\nUsing default parameters.");
}
// Parametres:
for (int i = 0; i < numParams; i++) {
simp[0][i] = gd.getNextNumber();
}
maxIter = (int) gd.getNextNumber();
restarts = (int) gd.getNextNumber();
maxError = Math.pow(10.0, -gd.getNextNumber());
}
/** Restart the simplex at the nth vertex */
void restart(int n) {
// Copy nth vertice of simplex to first vertice
for (int i = 0; i < numParams; i++) {
simp[0][i] = simp[n][i];
}
sumResiduals(simp[0]); // Get sum of residuals^2 for first vertex
double[] step = new double[numParams];
for (int i = 0; i < numParams; i++) {
step[i] = simp[0][i] / 2.0; // Step half the parametre value
if (step[i] == 0.0) // We can't have them all the same or we're going nowhere
step[i] = 0.01;
}
// Some kind of factor for generating new vertices
double[] p = new double[numParams];
double[] q = new double[numParams];
for (int i = 0; i < numParams; i++) {
p[i] = step[i] * (Math.sqrt(numVertices) + numParams - 1.0)/(numParams * root2);
q[i] = step[i] * (Math.sqrt(numVertices) - 1.0)/(numParams * root2);
}
// Create the other simplex vertices by modifing previous one.
for (int i = 1; i < numVertices; i++) {
for (int j = 0; j < numParams; j++) {
simp[i][j] = simp[i-1][j] + q[j];
}
simp[i][i-1] = simp[i][i-1] + p[i-1];
sumResiduals(simp[i]);
}
// Initialise current lowest/highest parametre estimates to simplex 1
best = 0;
worst = 0;
nextWorst = 0;
order();
}
// Display simplex [Iteration: s0(p1, p2....), s1(),....] in ImageJ window
void showSimplex(int iter) {
ij.IJ.write("" + iter);
for (int i = 0; i < numVertices; i++) {
String s = "";
for (int j=0; j < numVertices; j++)
s += " "+ ij.IJ.d2s(simp[i][j], 6);
ij.IJ.write(s);
}
}
/** Get number of parameters for current fit function */
public int getNumParams() {
switch (fit) {
case STRAIGHT_LINE: return 2;
case POLY2: return 3;
case POLY3: return 4;
case POLY4: return 5;
case EXPONENTIAL: return 2;
case POWER: return 2;
case LOG: return 2;
case RODBARD: case RODBARD2: return 4;
case GAMMA_VARIATE: return 4;
case LOG2: return 3;
}
return 0;
}
/** Returns "fit" function value for parameters "p" at "x" */
public static double f(int fit, double[] p, double x) {
double y;
switch (fit) {
case STRAIGHT_LINE:
return p[0] + p[1]*x;
case POLY2:
return p[0] + p[1]*x + p[2]* x*x;
case POLY3:
return p[0] + p[1]*x + p[2]*x*x + p[3]*x*x*x;
case POLY4:
return p[0] + p[1]*x + p[2]*x*x + p[3]*x*x*x + p[4]*x*x*x*x;
case EXPONENTIAL:
return p[0]*Math.exp(p[1]*x);
case POWER:
if (x == 0.0)
return 0.0;
else
return p[0]*Math.exp(p[1]*Math.log(x)); //y=ax^b
case LOG:
if (x == 0.0)
x = 0.5;
return p[0]*Math.log(p[1]*x);
case RODBARD:
double ex;
if (x == 0.0)
ex = 0.0;
else
ex = Math.exp(Math.log(x/p[2])*p[1]);
y = p[0]-p[3];
y = y/(1.0+ex);
return y+p[3];
case GAMMA_VARIATE:
if (p[0] >= x) return 0.0;
if (p[1] <= 0) return -100000.0;
if (p[2] <= 0) return -100000.0;
if (p[3] <= 0) return -100000.0;
double pw = Math.pow((x - p[0]), p[2]);
double e = Math.exp((-(x - p[0]))/p[3]);
return p[1]*pw*e;
case LOG2:
double tmp = x-p[2];
if (tmp<0.001) tmp = 0.001;
return p[0]+p[1]*Math.log(tmp);
case RODBARD2:
if (x<=p[0])
y = 0.0;
else {
y = (p[0]-x)/(x-p[3]);
y = Math.exp(Math.log(y)*(1.0/p[1])); //y=y**(1/b)
y = y*p[2];
}
return y;
default:
return 0.0;
}
}
/** Get the set of parameter values from the best corner of the simplex */
public double[] getParams() {
order();
return simp[best];
}
/** Returns residuals array ie. differences between data and curve. */
public double[] getResiduals() {
int saveFit = fit;
if (fit==RODBARD2) fit=RODBARD;
double[] params = getParams();
double[] residuals = new double[numPoints];
for (int i = 0; i < numPoints; i++)
residuals[i] = yData[i] - f(fit, params, xData[i]);
fit = saveFit;
return residuals;
}
/* Last "parametre" at each vertex of simplex is sum of residuals
* for the curve described by that vertex
*/
public double getSumResidualsSqr() {
double sumResidualsSqr = (getParams())[getNumParams()];
return sumResidualsSqr;
}
/** SD = sqrt(sum of residuals squared / number of params+1)
*/
public double getSD() {
double sd = Math.sqrt(getSumResidualsSqr() / numVertices);
return sd;
}
/** Returns R^2, where 1.0 is best.
<pre>
r^2 = 1 - SSE/SSD
where: SSE = sum of the squares of the errors
SSD = sum of the squares of the deviations about the mean.
</pre>
*/
public double getRSquared() {
double sumY = 0.0;
for (int i=0; i<numPoints; i++) sumY += yData[i];
double mean = sumY/numPoints;
double sumMeanDiffSqr = 0.0;
for (int i=0; i<numPoints; i++)
sumMeanDiffSqr += sqr(yData[i]-mean);
double rSquared = 0.0;
if (sumMeanDiffSqr>0.0)
rSquared = 1.0 - getSumResidualsSqr()/sumMeanDiffSqr;
return rSquared;
}
/** Get a measure of "goodness of fit" where 1.0 is best. */
public double getFitGoodness() {
double sumY = 0.0;
for (int i = 0; i < numPoints; i++) sumY += yData[i];
double mean = sumY / numPoints;
double sumMeanDiffSqr = 0.0;
int degreesOfFreedom = numPoints - getNumParams();
double fitGoodness = 0.0;
for (int i = 0; i < numPoints; i++) {
sumMeanDiffSqr += sqr(yData[i] - mean);
}
if (sumMeanDiffSqr > 0.0 && degreesOfFreedom != 0)
fitGoodness = 1.0 - (getSumResidualsSqr() / degreesOfFreedom) * ((numPoints) / sumMeanDiffSqr);
return fitGoodness;
}
/** Get a string description of the curve fitting results
* for easy output.
*/
public String getResultString() {
StringBuffer results = new StringBuffer("\nNumber of iterations: " + getIterations() +
"\nMaximum number of iterations: " + getMaxIterations() +
"\nSum of residuals squared: " + IJ.d2s(getSumResidualsSqr(),4) +
"\nStandard deviation: " + IJ.d2s(getSD(),4) +
"\nR^2: " + IJ.d2s(getRSquared(),4) +
"\nParameters:");
char pChar = 'a';
double[] pVal = getParams();
for (int i = 0; i < numParams; i++) {
results.append("\n " + pChar + " = " + IJ.d2s(pVal[i],4));
pChar++;
}
return results.toString();
}
double sqr(double d) { return d * d; }
/** Adds sum of square of residuals to end of array of parameters */
void sumResiduals (double[] x) {
x[numParams] = 0.0;
for (int i = 0; i < numPoints; i++) {
x[numParams] = x[numParams] + sqr(f(fit,x,xData[i])-yData[i]);
// if (IJ.debugMode) ij.IJ.log(i+" "+x[n-1]+" "+f(fit,x,xData[i])+" "+yData[i]);
}
}
/** Keep the "next" vertex */
void newVertex() {
for (int i = 0; i < numVertices; i++)
simp[worst][i] = next[i];
}
/** Find the worst, nextWorst and best current set of parameter estimates */
void order() {
for (int i = 0; i < numVertices; i++) {
if (simp[i][numParams] < simp[best][numParams]) best = i;
if (simp[i][numParams] > simp[worst][numParams]) worst = i;
}
nextWorst = best;
for (int i = 0; i < numVertices; i++) {
if (i != worst) {
if (simp[i][numParams] > simp[nextWorst][numParams]) nextWorst = i;
}
}
// IJ.write("B: " + simp[best][numParams] + " 2ndW: " + simp[nextWorst][numParams] + " W: " + simp[worst][numParams]);
}
/** Get number of iterations performed */
public int getIterations() {
return numIter;
}
/** Get maximum number of iterations allowed */
public int getMaxIterations() {
return maxIter;
}
/** Set maximum number of iterations allowed */
public void setMaxIterations(int x) {
maxIter = x;
}
/** Get number of simplex restarts to do */
public int getRestarts() {
return restarts;
}
/** Set number of simplex restarts to do */
public void setRestarts(int x) {
restarts = x;
}
/**
* Gets index of highest value in an array.
*
* @param Double array.
* @return Index of highest value.
*/
public static int getMax(double[] array) {
double max = array[0];
int index = 0;
for(int i = 1; i < array.length; i++) {
if(max < array[i]) {
max = array[i];
index = i;
}
}
return index;
}
}
| [
"usvirtualobservatory@5a1e9bf7-f4d4-f7d4-5b89-e7d39643c4b5"
] | usvirtualobservatory@5a1e9bf7-f4d4-f7d4-5b89-e7d39643c4b5 |
165a5db20edad8b420927ff6481369981205bc38 | bd05f2c734f065136d94d6353a4f857a1d096584 | /src/test/java/com/pauldennis/AppointmentTracker/AppointmentDatabaseTest.java | 98d8e60b3bf01311cb849e4071ff00b88a0ba66f | [] | no_license | pauldennis2/AppointmentTracker | ae46d93d2d795b93fa57721f109ef1d667bce980 | a54afbe86414112c612c50524fa10fd6cdbced8a | refs/heads/master | 2021-04-26T22:37:37.780420 | 2018-03-07T16:28:46 | 2018-03-07T16:28:46 | 124,123,223 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,249 | java | package com.pauldennis.AppointmentTracker;
import static org.junit.Assert.*;
import java.sql.SQLException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class AppointmentDatabaseTest {
AppointmentDatabase appointmentDb;
Appointment apt1;
Appointment apt2;
@Before
public void setUp() throws SQLException {
appointmentDb = new AppointmentDatabase();
appointmentDb.init();
apt1 = new Appointment ("3/7/2018", "10:55", "unit test the db");
apt2 = new Appointment ("3/7/2018", "11:05", "More unit testing");
appointmentDb.removeAppointmentsByName("unit test");
}
@After
public void tearDown() throws SQLException {
System.out.println("Running tearDown()");
appointmentDb.removeAppointmentsByName("unit test");
}
@Test
public void testAddingRecords() throws SQLException {
//Both apt1 and apt2 contain this string but we want to make sure
//There aren't any pre-existing appointments with this string
int size = appointmentDb.getAppointmentsByName("unit test").size();
assertEquals(0, size);
appointmentDb.addAppointment(apt1);
appointmentDb.addAppointment(apt2);
size = appointmentDb.getAppointmentsByName("unit test").size();
assertEquals(2, size);
}
}
| [
"pauldennis.misc@gmail.com"
] | pauldennis.misc@gmail.com |
0b66bc88fed3a612817242989f0fc076d75a46c7 | dab6ecde44dca85cb35c51586293e7209e59284d | /src/main/java/com/mx/itzamna/eschoolmx/model/Sourcemessage.java | c26b7fe9ee56147988c8979fa0f5495b2e75fe32 | [] | no_license | fintecheando/e-school-mx | 6da20f87ba9fc7a40e6c019f248bbf4d346a4307 | dc104ac4389a42469541eadc921f0a4237c83152 | refs/heads/master | 2021-06-07T02:19:32.437655 | 2015-04-13T04:42:27 | 2015-04-13T04:42:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,970 | java | package com.mx.itzamna.eschoolmx.model;
// Generated 12/04/2015 11:30:10 PM by Hibernate Tools 4.3.1
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* Sourcemessage generated by hbm2java
*/
@Entity
@Table(name="sourcemessage"
,catalog="villaeducativa"
)
public class Sourcemessage implements java.io.Serializable {
private Integer id;
private String category;
private String message;
private Set<OsTranslated> osTranslateds = new HashSet<OsTranslated>(0);
public Sourcemessage() {
}
public Sourcemessage(String category, String message, Set<OsTranslated> osTranslateds) {
this.category = category;
this.message = message;
this.osTranslateds = osTranslateds;
}
@Id @GeneratedValue(strategy=IDENTITY)
@Column(name="id", unique=true, nullable=false)
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name="category", length=32)
public String getCategory() {
return this.category;
}
public void setCategory(String category) {
this.category = category;
}
@Column(name="message", length=65535)
public String getMessage() {
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
@OneToMany(fetch=FetchType.LAZY, mappedBy="sourcemessage")
public Set<OsTranslated> getOsTranslateds() {
return this.osTranslateds;
}
public void setOsTranslateds(Set<OsTranslated> osTranslateds) {
this.osTranslateds = osTranslateds;
}
}
| [
"victor@centauro"
] | victor@centauro |
420d539b5816064b074fb8c8c48e4c229377613f | 4d300f4e6d610e894af0b29d7afd0185ba1ca730 | /src/main/java/com/retail/bo/configuration/Filters.java | 9a4c092d872060cffb75180a677d669615935b14 | [] | no_license | aswini86/POSLITE_BO | 8fb7b159be530b0e7cd2044f964ffe76c7761f2d | 6798fffa918911b75c4536c3d9e41ea9d440181e | refs/heads/master | 2021-03-13T06:31:46.600432 | 2020-03-11T18:48:34 | 2020-03-11T18:48:34 | 246,648,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 661 | java | package com.retail.bo.configuration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.retail.bo.components.filters.Protocol;
@Configuration
public class Filters {
@Bean
public FilterRegistrationBean<Protocol> filterRegistrationBean() {
FilterRegistrationBean<Protocol> registrationBean = new FilterRegistrationBean<>();
registrationBean.setFilter(new Protocol());
registrationBean.addUrlPatterns("/*");
registrationBean.setOrder(1);
return registrationBean;
}
}
| [
"aswinikumar802@gmail.com"
] | aswinikumar802@gmail.com |
f6b3e4b1d89318e8e543ed84796282694a35ef58 | 803347272d59ba485beecb813e4856427b0d57c1 | /Store/src/main/java/com/tradeleaves/store/repository/UserLoginRepository.java | ffdb653e773f09d9a7a570980aced4ecc5924f82 | [] | no_license | srinadhn/OnlineStore | b72cb9a3180d961be50f5ceda46f9e1001afffde | 620e40c84e8b039ef15f52625bdbf7d0f46fc379 | refs/heads/master | 2021-01-10T03:26:28.401253 | 2016-04-05T04:34:19 | 2016-04-05T04:34:19 | 54,555,062 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 277 | java | /**
*
*/
package com.tradeleaves.store.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import com.tradeleaves.store.domain.UserLogin;
/**
* @author Srinadh
*
*/
public interface UserLoginRepository extends JpaRepository<UserLogin,String>{
}
| [
"Srinadh@tradeleaves.com"
] | Srinadh@tradeleaves.com |
3bbd7fcdc118a7cbd959d51f665316ef0867e34a | 33b71e54639889106d7fa47b3d95f44e2ec2ed3b | /app/src/main/java/com/example/materialdesignfromgithub/activity/toolbar/ToolbarCollapsePin.java | 4fcb07aa706320dfd228002f40b369b28f0cc5e4 | [] | no_license | Sandeep749/Material-design-decoded | 1f16f7ab9569b4a43bd25116bc8c760d17c03496 | 3e0d76551e7b5d44d8e70f9e791d92017b74e2c2 | refs/heads/master | 2023-03-07T13:22:13.360255 | 2021-02-24T06:25:06 | 2021-02-24T06:25:06 | 341,796,993 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,273 | java | package com.example.materialdesignfromgithub.activity.toolbar;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import com.example.materialdesignfromgithub.R;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
public class ToolbarCollapsePin extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_toolbar_collapse_pin);
initToolbar();
}
private void initToolbar() {
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle(null);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
final CollapsingToolbarLayout collapsing_toolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
((AppBarLayout) findViewById(R.id.app_bar_layout)).addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (collapsing_toolbar.getHeight() + verticalOffset < 2 * ViewCompat.getMinimumHeight(collapsing_toolbar)) {
fab.show();
} else {
fab.hide();
}
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_basic, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finish();
} else {
Toast.makeText(getApplicationContext(), item.getTitle(), Toast.LENGTH_SHORT).show();
}
return super.onOptionsItemSelected(item);
}
}
| [
"sandeepkarmkar49@gmail.com"
] | sandeepkarmkar49@gmail.com |
ce49695eab28414aaf6de33a627af7c72703d4fb | 3b22eb4ffe190029e88d05e41524d65583e6c879 | /src/main/java/com/happy/controller/IntroController.java | 5381ece210e7080950ad0811768494bc70ba2403 | [] | no_license | visenzeviclim/onboarding-viclim | 006cbf77cfc348c74ed87b256d32dee897c047d7 | 25bf697d96af2450b19df451b92550282eb09a2f | refs/heads/main | 2023-02-04T04:05:55.872756 | 2020-12-30T03:50:43 | 2020-12-30T03:50:43 | 325,196,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 574 | java | package com.happy.controller;
import com.happy.service.IntroServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class IntroController {
private IntroServiceImpl introService;
public IntroController(IntroServiceImpl introService){
this.introService = introService;
}
@RequestMapping("/intro")
@ResponseBody
public String giveIntro(){
return this.introService.greet();
}
}
| [
"vic.lim@visenze.com"
] | vic.lim@visenze.com |
debfde8d8f8f791771e1b4a05d40a53dfe269ee7 | 609180c9c4a8d151d2eb475cec63b503bb145aeb | /src/com/bing/ly/tools/FFT.java | bd107547bde2396a5e73af2ec68b83124f7e9ae3 | [] | no_license | zhifei20/Record | 0cd379aa998caf54c3cca478cb482f4cf37dd456 | 49c95118d192f23216e57585b00fd9ad17832364 | refs/heads/master | 2020-12-11T03:32:43.783441 | 2014-01-24T03:06:02 | 2014-01-24T03:06:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,105 | java | /**
* Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.bing.ly.tools;
/**
* Fast Fourier Transformer.
* Sign = -1 is FFT, 1 is IFFT (inverse FFT)
* Data = Interlaced double array to be transformed.
* The order is: real (sin), complex (cos)
* Framesize must be power of 2
*
* @author Karl Helgason
*/
public final class FFT {
private double[] w;
private int fftFrameSize;
private int sign;
private int[] bitm_array;
private int fftFrameSize2;
/**
* Creates an FFT with the specified frame size.
*
* @param fftFrameSize The level of accuracy to use for the transform.
* The highest level of accuracy is reached when the frame size equals the
* number of real components in the input data.
* @param sign -1 is FFT, 1 is IFFT (inverse FFT). A standard
* FFT converts from time-domain to frequency-domain, an inverse FFT
* does the opposite.
*/
public FFT(int fftFrameSize, int sign) {
w = computeTwiddleFactors(fftFrameSize, sign);
this.fftFrameSize = fftFrameSize;
this.sign = sign;
fftFrameSize2 = fftFrameSize << 1;
// Pre-process Bit-Reversal
bitm_array = new int[fftFrameSize2];
for (int i = 2; i < fftFrameSize2; i += 2) {
int j;
int bitm;
for (bitm = 2, j = 0; bitm < fftFrameSize2; bitm <<= 1) {
if ((i & bitm) != 0)
j++;
j <<= 1;
}
bitm_array[i] = j;
}
}
/**
* Transforms the input data from a time-domain array to a
* frequency-domain array.
*
* @param data Interlaced double array to be transformed.
* The order is: real (sin), complex (cos).
*/
public void transform(double[] data) {
bitreversal(data);
calc(fftFrameSize, data, sign, w);
}
private final static double[] computeTwiddleFactors(int fftFrameSize,
int sign) {
int imax = (int) (Math.log(fftFrameSize) / Math.log(2.));
double[] warray = new double[(fftFrameSize - 1) * 4];
int w_index = 0;
for (int i = 0, nstep = 2; i < imax; i++) {
int jmax = nstep;
nstep <<= 1;
double wr = 1.0;
double wi = 0.0;
double arg = Math.PI / (jmax >> 1);
double wfr = Math.cos(arg);
double wfi = sign * Math.sin(arg);
for (int j = 0; j < jmax; j += 2) {
warray[w_index++] = wr;
warray[w_index++] = wi;
double tempr = wr;
wr = tempr * wfr - wi * wfi;
wi = tempr * wfi + wi * wfr;
}
}
// PRECOMPUTATION of wwr1, wwi1 for factor 4 Decomposition (3 * complex
// operators and 8 +/- complex operators)
{
w_index = 0;
int w_index2 = warray.length >> 1;
for (int i = 0, nstep = 2; i < (imax - 1); i++) {
int jmax = nstep;
nstep *= 2;
int ii = w_index + jmax;
for (int j = 0; j < jmax; j += 2) {
double wr = warray[w_index++];
double wi = warray[w_index++];
double wr1 = warray[ii++];
double wi1 = warray[ii++];
warray[w_index2++] = wr * wr1 - wi * wi1;
warray[w_index2++] = wr * wi1 + wi * wr1;
}
}
}
return warray;
}
private final static void calc(int fftFrameSize, double[] data, int sign,
double[] w) {
final int fftFrameSize2 = fftFrameSize << 1;
int nstep = 2;
if (nstep >= fftFrameSize2)
return;
int i = nstep - 2;
if (sign == -1)
calcF4F(fftFrameSize, data, i, nstep, w);
else
calcF4I(fftFrameSize, data, i, nstep, w);
}
private final static void calcF2E(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
int jmax = nstep;
for (int n = 0; n < jmax; n += 2) {
double wr = w[i++];
double wi = w[i++];
int m = n + jmax;
double datam_r = data[m];
double datam_i = data[m + 1];
double datan_r = data[n];
double datan_i = data[n + 1];
double tempr = datam_r * wr - datam_i * wi;
double tempi = datam_r * wi + datam_i * wr;
data[m] = datan_r - tempr;
data[m + 1] = datan_i - tempi;
data[n] = datan_r + tempr;
data[n + 1] = datan_i + tempi;
}
return;
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
private final static void calcF4F(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
while (nstep < fftFrameSize2) {
if (nstep << 2 == fftFrameSize2) {
// Goto Factor-4 Final Decomposition
// calcF4E(data, i, nstep, -1, w);
calcF4FE(fftFrameSize, data, i, nstep, w);
return;
}
int jmax = nstep;
int nnstep = nstep << 1;
if (nnstep == fftFrameSize2) {
// Factor-4 Decomposition not possible
calcF2E(fftFrameSize, data, i, nstep, w);
return;
}
nstep <<= 2;
int ii = i + jmax;
int iii = i + w_len;
{
i += 2;
ii += 2;
iii += 2;
for (int n = 0; n < fftFrameSize2; n += nstep) {
int m = n + jmax;
double datam1_r = data[m];
double datam1_i = data[m + 1];
double datan1_r = data[n];
double datan1_i = data[n + 1];
n += nnstep;
m += nnstep;
double datam2_r = data[m];
double datam2_i = data[m + 1];
double datan2_r = data[n];
double datan2_i = data[n + 1];
double tempr = datam1_r;
double tempi = datam1_i;
datam1_r = datan1_r - tempr;
datam1_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
double n2w1r = datan2_r;
double n2w1i = datan2_i;
double m2ww1r = datam2_r;
double m2ww1i = datam2_i;
tempr = m2ww1r - n2w1r;
tempi = m2ww1i - n2w1i;
datam2_r = datam1_r + tempi;
datam2_i = datam1_i - tempr;
datam1_r = datam1_r - tempi;
datam1_i = datam1_i + tempr;
tempr = n2w1r + m2ww1r;
tempi = n2w1i + m2ww1i;
datan2_r = datan1_r - tempr;
datan2_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
data[m] = datam2_r;
data[m + 1] = datam2_i;
data[n] = datan2_r;
data[n + 1] = datan2_i;
n -= nnstep;
m -= nnstep;
data[m] = datam1_r;
data[m + 1] = datam1_i;
data[n] = datan1_r;
data[n + 1] = datan1_i;
}
}
for (int j = 2; j < jmax; j += 2) {
double wr = w[i++];
double wi = w[i++];
double wr1 = w[ii++];
double wi1 = w[ii++];
double wwr1 = w[iii++];
double wwi1 = w[iii++];
// double wwr1 = wr * wr1 - wi * wi1; // these numbers can be
// precomputed!!!
// double wwi1 = wr * wi1 + wi * wr1;
for (int n = j; n < fftFrameSize2; n += nstep) {
int m = n + jmax;
double datam1_r = data[m];
double datam1_i = data[m + 1];
double datan1_r = data[n];
double datan1_i = data[n + 1];
n += nnstep;
m += nnstep;
double datam2_r = data[m];
double datam2_i = data[m + 1];
double datan2_r = data[n];
double datan2_i = data[n + 1];
double tempr = datam1_r * wr - datam1_i * wi;
double tempi = datam1_r * wi + datam1_i * wr;
datam1_r = datan1_r - tempr;
datam1_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
double n2w1r = datan2_r * wr1 - datan2_i * wi1;
double n2w1i = datan2_r * wi1 + datan2_i * wr1;
double m2ww1r = datam2_r * wwr1 - datam2_i * wwi1;
double m2ww1i = datam2_r * wwi1 + datam2_i * wwr1;
tempr = m2ww1r - n2w1r;
tempi = m2ww1i - n2w1i;
datam2_r = datam1_r + tempi;
datam2_i = datam1_i - tempr;
datam1_r = datam1_r - tempi;
datam1_i = datam1_i + tempr;
tempr = n2w1r + m2ww1r;
tempi = n2w1i + m2ww1i;
datan2_r = datan1_r - tempr;
datan2_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
data[m] = datam2_r;
data[m + 1] = datam2_i;
data[n] = datan2_r;
data[n + 1] = datan2_i;
n -= nnstep;
m -= nnstep;
data[m] = datam1_r;
data[m + 1] = datam1_i;
data[n] = datan1_r;
data[n + 1] = datan1_i;
}
}
i += jmax << 1;
}
calcF2E(fftFrameSize, data, i, nstep, w);
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
private final static void calcF4I(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
while (nstep < fftFrameSize2) {
if (nstep << 2 == fftFrameSize2) {
// Goto Factor-4 Final Decomposition
// calcF4E(data, i, nstep, 1, w);
calcF4IE(fftFrameSize, data, i, nstep, w);
return;
}
int jmax = nstep;
int nnstep = nstep << 1;
if (nnstep == fftFrameSize2) {
// Factor-4 Decomposition not possible
calcF2E(fftFrameSize, data, i, nstep, w);
return;
}
nstep <<= 2;
int ii = i + jmax;
int iii = i + w_len;
{
i += 2;
ii += 2;
iii += 2;
for (int n = 0; n < fftFrameSize2; n += nstep) {
int m = n + jmax;
double datam1_r = data[m];
double datam1_i = data[m + 1];
double datan1_r = data[n];
double datan1_i = data[n + 1];
n += nnstep;
m += nnstep;
double datam2_r = data[m];
double datam2_i = data[m + 1];
double datan2_r = data[n];
double datan2_i = data[n + 1];
double tempr = datam1_r;
double tempi = datam1_i;
datam1_r = datan1_r - tempr;
datam1_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
double n2w1r = datan2_r;
double n2w1i = datan2_i;
double m2ww1r = datam2_r;
double m2ww1i = datam2_i;
tempr = n2w1r - m2ww1r;
tempi = n2w1i - m2ww1i;
datam2_r = datam1_r + tempi;
datam2_i = datam1_i - tempr;
datam1_r = datam1_r - tempi;
datam1_i = datam1_i + tempr;
tempr = n2w1r + m2ww1r;
tempi = n2w1i + m2ww1i;
datan2_r = datan1_r - tempr;
datan2_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
data[m] = datam2_r;
data[m + 1] = datam2_i;
data[n] = datan2_r;
data[n + 1] = datan2_i;
n -= nnstep;
m -= nnstep;
data[m] = datam1_r;
data[m + 1] = datam1_i;
data[n] = datan1_r;
data[n + 1] = datan1_i;
}
}
for (int j = 2; j < jmax; j += 2) {
double wr = w[i++];
double wi = w[i++];
double wr1 = w[ii++];
double wi1 = w[ii++];
double wwr1 = w[iii++];
double wwi1 = w[iii++];
// double wwr1 = wr * wr1 - wi * wi1; // these numbers can be
// precomputed!!!
// double wwi1 = wr * wi1 + wi * wr1;
for (int n = j; n < fftFrameSize2; n += nstep) {
int m = n + jmax;
double datam1_r = data[m];
double datam1_i = data[m + 1];
double datan1_r = data[n];
double datan1_i = data[n + 1];
n += nnstep;
m += nnstep;
double datam2_r = data[m];
double datam2_i = data[m + 1];
double datan2_r = data[n];
double datan2_i = data[n + 1];
double tempr = datam1_r * wr - datam1_i * wi;
double tempi = datam1_r * wi + datam1_i * wr;
datam1_r = datan1_r - tempr;
datam1_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
double n2w1r = datan2_r * wr1 - datan2_i * wi1;
double n2w1i = datan2_r * wi1 + datan2_i * wr1;
double m2ww1r = datam2_r * wwr1 - datam2_i * wwi1;
double m2ww1i = datam2_r * wwi1 + datam2_i * wwr1;
tempr = n2w1r - m2ww1r;
tempi = n2w1i - m2ww1i;
datam2_r = datam1_r + tempi;
datam2_i = datam1_i - tempr;
datam1_r = datam1_r - tempi;
datam1_i = datam1_i + tempr;
tempr = n2w1r + m2ww1r;
tempi = n2w1i + m2ww1i;
datan2_r = datan1_r - tempr;
datan2_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
data[m] = datam2_r;
data[m + 1] = datam2_i;
data[n] = datan2_r;
data[n + 1] = datan2_i;
n -= nnstep;
m -= nnstep;
data[m] = datam1_r;
data[m + 1] = datam1_i;
data[n] = datan1_r;
data[n + 1] = datan1_i;
}
}
i += jmax << 1;
}
calcF2E(fftFrameSize, data, i, nstep, w);
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
private final static void calcF4FE(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
while (nstep < fftFrameSize2) {
int jmax = nstep;
int nnstep = nstep << 1;
if (nnstep == fftFrameSize2) {
// Factor-4 Decomposition not possible
calcF2E(fftFrameSize, data, i, nstep, w);
return;
}
nstep <<= 2;
int ii = i + jmax;
int iii = i + w_len;
for (int n = 0; n < jmax; n += 2) {
double wr = w[i++];
double wi = w[i++];
double wr1 = w[ii++];
double wi1 = w[ii++];
double wwr1 = w[iii++];
double wwi1 = w[iii++];
// double wwr1 = wr * wr1 - wi * wi1; // these numbers can be
// precomputed!!!
// double wwi1 = wr * wi1 + wi * wr1;
int m = n + jmax;
double datam1_r = data[m];
double datam1_i = data[m + 1];
double datan1_r = data[n];
double datan1_i = data[n + 1];
n += nnstep;
m += nnstep;
double datam2_r = data[m];
double datam2_i = data[m + 1];
double datan2_r = data[n];
double datan2_i = data[n + 1];
double tempr = datam1_r * wr - datam1_i * wi;
double tempi = datam1_r * wi + datam1_i * wr;
datam1_r = datan1_r - tempr;
datam1_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
double n2w1r = datan2_r * wr1 - datan2_i * wi1;
double n2w1i = datan2_r * wi1 + datan2_i * wr1;
double m2ww1r = datam2_r * wwr1 - datam2_i * wwi1;
double m2ww1i = datam2_r * wwi1 + datam2_i * wwr1;
tempr = m2ww1r - n2w1r;
tempi = m2ww1i - n2w1i;
datam2_r = datam1_r + tempi;
datam2_i = datam1_i - tempr;
datam1_r = datam1_r - tempi;
datam1_i = datam1_i + tempr;
tempr = n2w1r + m2ww1r;
tempi = n2w1i + m2ww1i;
datan2_r = datan1_r - tempr;
datan2_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
data[m] = datam2_r;
data[m + 1] = datam2_i;
data[n] = datan2_r;
data[n + 1] = datan2_i;
n -= nnstep;
m -= nnstep;
data[m] = datam1_r;
data[m + 1] = datam1_i;
data[n] = datan1_r;
data[n + 1] = datan1_i;
}
i += jmax << 1;
}
}
// Perform Factor-4 Decomposition with 3 * complex operators and 8 +/-
// complex operators
private final static void calcF4IE(int fftFrameSize, double[] data, int i,
int nstep, double[] w) {
final int fftFrameSize2 = fftFrameSize << 1; // 2*fftFrameSize;
// Factor-4 Decomposition
int w_len = w.length >> 1;
while (nstep < fftFrameSize2) {
int jmax = nstep;
int nnstep = nstep << 1;
if (nnstep == fftFrameSize2) {
// Factor-4 Decomposition not possible
calcF2E(fftFrameSize, data, i, nstep, w);
return;
}
nstep <<= 2;
int ii = i + jmax;
int iii = i + w_len;
for (int n = 0; n < jmax; n += 2) {
double wr = w[i++];
double wi = w[i++];
double wr1 = w[ii++];
double wi1 = w[ii++];
double wwr1 = w[iii++];
double wwi1 = w[iii++];
// double wwr1 = wr * wr1 - wi * wi1; // these numbers can be
// precomputed!!!
// double wwi1 = wr * wi1 + wi * wr1;
int m = n + jmax;
double datam1_r = data[m];
double datam1_i = data[m + 1];
double datan1_r = data[n];
double datan1_i = data[n + 1];
n += nnstep;
m += nnstep;
double datam2_r = data[m];
double datam2_i = data[m + 1];
double datan2_r = data[n];
double datan2_i = data[n + 1];
double tempr = datam1_r * wr - datam1_i * wi;
double tempi = datam1_r * wi + datam1_i * wr;
datam1_r = datan1_r - tempr;
datam1_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
double n2w1r = datan2_r * wr1 - datan2_i * wi1;
double n2w1i = datan2_r * wi1 + datan2_i * wr1;
double m2ww1r = datam2_r * wwr1 - datam2_i * wwi1;
double m2ww1i = datam2_r * wwi1 + datam2_i * wwr1;
tempr = n2w1r - m2ww1r;
tempi = n2w1i - m2ww1i;
datam2_r = datam1_r + tempi;
datam2_i = datam1_i - tempr;
datam1_r = datam1_r - tempi;
datam1_i = datam1_i + tempr;
tempr = n2w1r + m2ww1r;
tempi = n2w1i + m2ww1i;
datan2_r = datan1_r - tempr;
datan2_i = datan1_i - tempi;
datan1_r = datan1_r + tempr;
datan1_i = datan1_i + tempi;
data[m] = datam2_r;
data[m + 1] = datam2_i;
data[n] = datan2_r;
data[n + 1] = datan2_i;
n -= nnstep;
m -= nnstep;
data[m] = datam1_r;
data[m + 1] = datam1_i;
data[n] = datan1_r;
data[n + 1] = datan1_i;
}
i += jmax << 1;
}
}
private final void bitreversal(double[] data) {
if (fftFrameSize < 4)
return;
int inverse = fftFrameSize2 - 2;
for (int i = 0; i < fftFrameSize; i += 4) {
int j = bitm_array[i];
// Performing Bit-Reversal, even v.s. even, O(2N)
if (i < j) {
int n = i;
int m = j;
// COMPLEX: SWAP(data[n], data[m])
// Real Part
double tempr = data[n];
data[n] = data[m];
data[m] = tempr;
// Imagery Part
n++;
m++;
double tempi = data[n];
data[n] = data[m];
data[m] = tempi;
n = inverse - i;
m = inverse - j;
// COMPLEX: SWAP(data[n], data[m])
// Real Part
tempr = data[n];
data[n] = data[m];
data[m] = tempr;
// Imagery Part
n++;
m++;
tempi = data[n];
data[n] = data[m];
data[m] = tempi;
}
// Performing Bit-Reversal, odd v.s. even, O(N)
int m = j + fftFrameSize; // bitm_array[i+2];
// COMPLEX: SWAP(data[n], data[m])
// Real Part
int n = i + 2;
double tempr = data[n];
data[n] = data[m];
data[m] = tempr;
// Imagery Part
n++;
m++;
double tempi = data[n];
data[n] = data[m];
data[m] = tempi;
}
}
} | [
"1525218075@qq.com"
] | 1525218075@qq.com |
d97b1770b29ae3a4109bdacdc2882e66cc4e2003 | d1cc1494b865009e90da9d7633d8c1015bae329a | /app/src/main/java/com/ai/moonvsky/smalllauncher/DeviceBatteryRepository.java | 58b393171b64894719cda65b8ae6db978dc7c39a | [] | no_license | moon-sky/SmallLauncher | 0bb27f4f67524a0eaa656953dbd1083ecc415d76 | 263ca3d0642c22ca61a91644874f1b40572cbfb0 | refs/heads/master | 2020-04-15T05:25:32.321984 | 2019-01-25T10:03:39 | 2019-01-25T10:03:39 | 164,421,604 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,880 | java | package com.ai.moonvsky.smalllauncher;
import android.app.Application;
import android.arch.lifecycle.MutableLiveData;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.wifi.WifiManager;
import android.os.BatteryManager;
import android.os.Bundle;
import android.os.Parcelable;
import android.util.Log;
public class DeviceBatteryRepository {
private static final String TAG = "DeviceBatteryRepository";
private MutableLiveData<BatteryInfo> batteryInfoMutableLiveData;
public DeviceBatteryRepository(Application application) {
batteryInfoMutableLiveData = new MutableLiveData<>();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Intent.ACTION_BATTERY_CHANGED);
application.registerReceiver(new MyNetReceiver(), intentFilter);
}
public MutableLiveData<BatteryInfo> getBatteryInfoMutableLiveData() {
return batteryInfoMutableLiveData;
}
public class MyNetReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
int level= intent.getIntExtra(BatteryManager.EXTRA_LEVEL,0);
int scale=intent.getIntExtra(BatteryManager.EXTRA_SCALE,0);
BatteryInfo batteryInfo=new BatteryInfo();
int batteryPercent=(int)(((float)level / scale) * 100);
batteryInfo.setBatteryPercent(batteryPercent);
Log.e(TAG, "actioin:" + action+"|level:"+level+"|percent:"+batteryPercent);
if(batteryPercent!=100){
batteryInfo.setFull(false);
}else{
batteryInfo.setFull(true);
}
batteryInfoMutableLiveData.postValue(batteryInfo);
}
}
}
| [
"wanghexin@uzoo.cn"
] | wanghexin@uzoo.cn |
2116833528d4f861756d1c2a054311d87483621c | 82a92d7b03e5da893f26b3482ba1b12548404cd0 | /src/main/java/cn/chenxubiao/common/config/MultipartConfig.java | d43c5d5c9f8e605543e6a9df724eacbf7fff75f2 | [] | no_license | chenxubiao/photo | 8d1a3d1c893f339945b00a381758f6e3c716eb86 | 2a7c63412141eb0e56b009eb5410afd67c741594 | refs/heads/master | 2021-01-20T03:08:59.051481 | 2017-05-01T03:02:45 | 2017-05-01T03:02:45 | 89,499,761 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 936 | java | package cn.chenxubiao.common.config;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.MultipartConfigElement;
/**
* Created by chenxb on 17-4-28.
*/
@Configuration
public class MultipartConfig {
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
//// 设置文件大小限制 ,超了,页面会抛出异常信息,这时候就需要进行异常信息的处理了;
factory.setMaxFileSize("30MB"); //KB,MB
/// 设置总上传数据总大小
// factory.setMaxRequestSize("256KB");
//Sets the directory location wherefiles will be stored.
//factory.setLocation("路径地址");
return factory.createMultipartConfig();
}
}
| [
"chenxbubiaocxb@gmail.com"
] | chenxbubiaocxb@gmail.com |
e4105779aab29ec0a745efbcbf5149e05e5f8301 | 893e6fe9fd860c0e494eb01b89bfc8adaf9d300e | /src/main/java/br/net/triangulohackerspace/westation/web/rest/errors/InvalidPasswordException.java | e093f18bc5a877b08c52852bbe72d0ebe9ffcf2f | [] | no_license | Triangulo-Hackerspace/westation | 44f4748fca075f0db3c1342c19638ee5047f200e | f94077c7fb167eb631e54a847b002340466c7559 | refs/heads/master | 2021-04-06T07:07:09.404241 | 2018-03-08T13:27:17 | 2018-03-08T13:27:17 | 124,388,595 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | package br.net.triangulohackerspace.westation.web.rest.errors;
import org.zalando.problem.AbstractThrowableProblem;
import org.zalando.problem.Status;
public class InvalidPasswordException extends AbstractThrowableProblem {
public InvalidPasswordException() {
super(ErrorConstants.INVALID_PASSWORD_TYPE, "Incorrect password", Status.BAD_REQUEST);
}
}
| [
"tesso.martins@gmail.com"
] | tesso.martins@gmail.com |
3ec6a066bccf533c5ef5d9a23b1ae530c2f1f907 | 6a24b618ee8140ad83ea29abffa44e6ffebd357a | /client-social/src/main/java/oauth2/client/ClientSocialApplication.java | 6e3f889ce68979b7fccdd6ba35df6487d1868701 | [] | no_license | minhnc3012/spring-security-oauth2-sample | 47f09f9b2d588ce1aa1302af7a138012ba2bf07e | c04a5282fe7203d911158b8b191cf7a51b7a8f96 | refs/heads/master | 2022-01-10T20:54:16.146695 | 2019-04-12T07:59:48 | 2019-04-12T07:59:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package oauth2.client;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ClientSocialApplication {
public static void main(String[] args) {
SpringApplication.run(ClientSocialApplication.class, args);
}
}
| [
"andy_zhaozhao@hotmail.com"
] | andy_zhaozhao@hotmail.com |
e0c91781c44c5505491b47b03ef1b2e242f072b5 | 25840c245cb2a497a5ba0e6b8cc93c74b9fbd711 | /app/src/main/java/customfonts/MyTextView_sfuitext_regular.java | 17faf1c22ae5a2cdb2abde4bb20d2ae53584b4df | [] | no_license | Amanx99/Internship | e411dfb0f35d6b64dd4f78fec231a8c039e49f9b | d50de2584b0a2f1b866b1f23df44f43fde9fe73d | refs/heads/master | 2022-11-16T03:07:26.725924 | 2020-07-10T18:35:39 | 2020-07-10T18:35:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 857 | java | package customfonts;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
public class MyTextView_sfuitext_regular extends androidx.appcompat.widget.AppCompatTextView {
public MyTextView_sfuitext_regular(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public MyTextView_sfuitext_regular(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public MyTextView_sfuitext_regular(Context context) {
super(context);
init();
}
private void init() {
if (!isInEditMode()) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "fonts/sfuitext_regular.ttf");
setTypeface(tf);
}
}
} | [
"55571688+Amanx99@users.noreply.github.com"
] | 55571688+Amanx99@users.noreply.github.com |
795373428002979104ac14a429f3a005301f7350 | c23714f7e2106c0583e22014dda048b1ffe96d1d | /src/main/java/org/fdws/lc/medium/TopVotedCandidate.java | aa151b60b28209ea3b9aacb40422a698e6b8366f | [] | no_license | FDws/leet-code | 0b87ac05a2141b8f73423e7b03251fcc4601658c | bbde3145e6a844a2eb5e7dbea7a027d6acec30da | refs/heads/master | 2023-04-18T07:54:24.594662 | 2021-04-12T15:01:53 | 2021-04-12T15:01:53 | 295,758,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,269 | java | package org.fdws.lc.medium;
import java.util.ArrayList;
import java.util.List;
/**
* @author FDws
* @version Created on 2020/9/26 15:21
*/
public class TopVotedCandidate {
private final int[] maxVotes;
private final int[] times;
public TopVotedCandidate(int[] persons, int[] times) {
this.times = times;
maxVotes = new int[persons.length];
var personVote = new int[persons.length + 1];
var max = 0;
var maxPerson = persons[0];
for (int i = 0; i < persons.length; i++) {
var p = persons[i];
var preVote = personVote[p];
personVote[p] = preVote + 1;
if (personVote[p] >= max) {
max = personVote[p];
maxVotes[i] = p;
maxPerson = p;
} else {
maxVotes[i] = maxPerson;
}
}
}
public int q(int t) {
int begin = 0;
int end = times.length;
while (begin < end) {
if (times[begin] == t || begin == end - 1) {
return maxVotes[begin];
} else {
int mid = (begin + end) >> 1;
if (t == times[mid]) {
return maxVotes[mid];
} else if (t < times[mid]) {
end = mid;
} else {
begin = mid;
}
}
}
return maxVotes[begin];
}
public int bs(int begin, int end, int t) {
if (times[begin] == t || begin + 1 >= end) {
return begin;
} else {
int mid = (begin + end) >> 1;
if (t == times[mid]) {
return mid;
} else if (t < times[mid]) {
return bs(begin, mid, t);
} else {
return bs(mid, end, t);
}
}
}
public static void main(String[] args) {
var obj = new TopVotedCandidate(new int[]{0, 0, 1, 1, 2}, new int[]{0, 67, 69, 74, 87});
var list = List.of(4, 62, 100, 88, 70, 73, 22, 75, 29, 10);
var result = new ArrayList<String>(list.size());
list.forEach(i -> result.add(obj.q(i) + ""));
System.out.println(String.join(", ", result));
}
}
| [
"885374150@qq.com"
] | 885374150@qq.com |
5aa4b5d69ca78e70f2fb010fdeee7c141bb30b36 | 34e7783eb64d36dddc5c362e83792c21b806ae7d | /server/src/test/java/io/julian/server/endpoints/coordination/SetLabelHandlerTest.java | 51b952691a8ab7c5c2bad35a1ec5338e10f4473e | [] | no_license | julianGoh17/DistributedBlackboxOperations | 5884cb2050714a5e5957891fbbcc41a976bda322 | a4809952b439701c8b3a5d2ba23223e65c65b3f3 | refs/heads/main | 2023-04-11T08:21:22.330644 | 2021-04-20T16:16:48 | 2021-04-20T16:16:48 | 302,058,805 | 0 | 0 | null | 2021-04-20T16:16:49 | 2020-10-07T14:16:40 | Java | UTF-8 | Java | false | false | 5,449 | java | package io.julian.server.endpoints.coordination;
import io.julian.server.components.Configuration;
import io.julian.server.endpoints.AbstractHandlerTest;
import io.julian.server.models.ServerStatus;
import io.julian.server.models.response.ErrorResponse;
import io.julian.server.models.response.LabelResponse;
import io.vertx.core.Future;
import io.vertx.core.Promise;
import io.vertx.core.buffer.Buffer;
import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.web.client.HttpResponse;
import io.vertx.ext.web.client.WebClient;
import org.junit.Test;
import static io.julian.server.components.Controller.DEFAULT_LABEL;
public class SetLabelHandlerTest extends AbstractHandlerTest {
public static final String LABEL_ENDPOINT = "label";
@Test
public void TestSuccessfulPostMessageShouldUpdateServerLabel(final TestContext context) {
String label = "test-table";
setUpApiServer(context);
WebClient client = WebClient.create(this.vertx);
Async async = context.async();
sendSuccessfulLabel(context, client, label)
.onComplete(context.asyncAssertSuccess(v -> async.complete()));
async.awaitSuccess();
tearDownServer(context);
}
@Test
public void TestPostMessageFailsWhenIncorrectQueryParam(final TestContext context) {
setUpApiServer(context);
WebClient client = WebClient.create(this.vertx);
Async async = context.async();
sendUnsuccessfulLabel(context, client, null, new Exception("Error during validation of request. Parameter \"label\" inside query not found"), 400)
.onComplete(context.asyncAssertSuccess(v -> async.complete()));
async.awaitSuccess();
tearDownServer(context);
}
@Test
public void TestFailsUnreachableGateMessage(final TestContext context) {
setUpApiServer(context);
WebClient client = WebClient.create(this.vertx);
server.getController().setStatus(ServerStatus.UNREACHABLE);
Async async = context.async();
sendUnsuccessfulLabel(context, client, "random-label", UNREACHABLE_ERROR, 500)
.onComplete(context.asyncAssertSuccess(v -> async.complete()));
async.awaitSuccess();
tearDownServer(context);
}
@Test
public void TestFailsProbabilisticGateMessage(final TestContext context) {
setUpApiServer(context);
WebClient client = WebClient.create(this.vertx);
server.getController().setStatus(ServerStatus.PROBABILISTIC_FAILURE);
server.getController().setFailureChance(1);
Async async = context.async();
sendUnsuccessfulLabel(context, client, "random-label", PROBABILISTIC_FAILURE_ERROR, 500)
.onComplete(context.asyncAssertSuccess(v -> async.complete()));
async.awaitSuccess();
tearDownServer(context);
}
@Test
public void TestPassesProbabilisticGateMessage(final TestContext context) {
setUpApiServer(context);
WebClient client = WebClient.create(this.vertx);
server.getController().setStatus(ServerStatus.PROBABILISTIC_FAILURE);
server.getController().setFailureChance(0);
Async async = context.async();
sendSuccessfulLabel(context, client, "random-label")
.onComplete(context.asyncAssertSuccess(v -> async.complete()));
async.awaitSuccess();
tearDownServer(context);
}
private Future<Void> sendSuccessfulLabel(final TestContext context, final WebClient client, final String label) {
Promise<Void> response = Promise.promise();
sendLabel(context, client, label)
.onComplete(context.asyncAssertSuccess(res -> {
context.assertEquals(res.statusCode(), 202);
context.assertEquals(new LabelResponse(label).toJson().encodePrettily(), res.bodyAsJsonObject().encodePrettily());
context.assertEquals(label, server.getController().getLabel());
response.complete();
}));
return response.future();
}
private Future<Void> sendUnsuccessfulLabel(final TestContext context, final WebClient client, final String label, final Exception error, final int statusCode) {
Promise<Void> response = Promise.promise();
sendLabel(context, client, label)
.onComplete(context.asyncAssertSuccess(res -> {
context.assertEquals(statusCode, res.statusCode());
context.assertEquals(res.bodyAsJsonObject(), new ErrorResponse(statusCode, error).toJson());
context.assertEquals(0, server.getController().getNumberOfCoordinationMessages());
context.assertEquals(DEFAULT_LABEL, server.getController().getLabel());
response.complete();
}));
return response.future();
}
private Future<HttpResponse<Buffer>> sendLabel(final TestContext context, final WebClient client, final String label) {
Promise<HttpResponse<Buffer>> response = Promise.promise();
String uri = label != null ?
String.format("%s/%s?label=%s", COORDINATOR_URI, LABEL_ENDPOINT, label) : String.format("%s/%s", COORDINATOR_URI, LABEL_ENDPOINT);
client
.post(Configuration.DEFAULT_SERVER_PORT, Configuration.DEFAULT_SERVER_HOST, uri)
.send(context.asyncAssertSuccess(response::complete));
return response.future();
}
}
| [
"noreply@github.com"
] | noreply@github.com |
dcd399c9166526bff742487e44fabb075bda2dd1 | 142744e807394cf72f04becdf487ebb20a0fa549 | /src/xyz/leetcode/Problem34.java | 574c24b858e1cf5cb0896a2d81f6a07735241fbf | [] | no_license | HatsuneMK00/ACMTraining | cdd40d79586c1744d90889377b402cb40a57e119 | 83590a2f81d0bdbaaa80110655491d8030ad19c7 | refs/heads/master | 2020-07-24T15:15:58.505046 | 2020-05-21T08:15:56 | 2020-05-21T08:15:56 | 207,966,453 | 1 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,577 | java | package xyz.leetcode;
//TOOL 给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给定目标值在数组中的开始位置和结束位置
public class Problem34 {
public int[] searchRange(int[] nums, int target) {
// 输入为空的情况一定要多注意
if (nums.length == 0) {
return new int[]{-1, -1};
}
int i = lowerBound(nums, 0, nums.length - 1, target);
if (i >= nums.length || nums[i] != target) {
return new int[]{-1, -1};
}
int j = upperBound(nums, 0, nums.length - 1, target);
return new int[]{i, j};
}
public int upperBound(int[] nums, int l, int r, int target) {
while (l < r) {
int m = (l + r + 1) / 2;
if (nums[m] <= target) {
l = m;
} else {
r = m - 1;
}
}
/* customized code for problem 15 */
// return a invalid index if didn't find the element
if(nums[l]>target){
return l-1;
}else{
return l;
}
}
public int lowerBound(int[] nums, int l, int r, int target) {
while (l < r) {
int m = (l + r) / 2;
if (nums[m] >= target) {
r = m;
} else {
l = m + 1;
}
}
/* customized code for problem 15 */
// return a invalid index if didn't find the element
if(nums[l]<target)
return l+1;
else
return l;
}
}
| [
"10175101106@stu.ecnu.edu.cn"
] | 10175101106@stu.ecnu.edu.cn |
268569fdde8137c2fa981c3d5586541ec22cb1fb | f8d7b6e4debd38c2f058108867b017c615c21c5c | /src/main/java/com/softsquared/template/src/review/models/PostProductReviewsReq.java | 4ccd201c9e1659779952f080a1dbf0ebb47160e5 | [] | no_license | risingprogrammer2/ably_mock_server_colt_vivi | 5f82ec98330f511f9d41eb1e182e012ed97be240 | fac7db81e8e1134d3ab23eefccf208bc9cc128be | refs/heads/main | 2023-03-06T01:49:36.203187 | 2021-02-19T15:22:46 | 2021-02-19T15:22:46 | 335,239,925 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 575 | java | package com.softsquared.template.src.review.models;
import com.softsquared.template.config.statusEnum.ColorComment;
import com.softsquared.template.config.statusEnum.Satisfaction;
import com.softsquared.template.config.statusEnum.SizeComment;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public class PostProductReviewsReq {
private Satisfaction satisfaction;
private String purchasedOptions;
private String form;
private SizeComment sizeComment;
private ColorComment colorComment;
private String comment;
}
| [
"zhfxmtkachdt@daum.net"
] | zhfxmtkachdt@daum.net |
732b89048b70168b36a0a9ae40589ff8b87cb463 | 2b2c2605a897bf0c3cd53a4002fcc70fb032deb3 | /src/main/java/leetcode/array/N179largestNumber.java | a80eb91b11d8d717ab2903773cdef03bc3783124 | [] | no_license | beston123/leetcode | dc1e3bcbe79bae2ccc7856586b7cd2fd31603814 | f6abf68d0034b67f8bfafb5f638d5dca1968a13c | refs/heads/master | 2020-09-06T13:15:23.123715 | 2019-11-07T05:45:31 | 2019-11-07T05:45:31 | 220,434,236 | 1 | 0 | null | 2019-11-08T09:36:41 | 2019-11-08T09:36:40 | null | UTF-8 | Java | false | false | 1,165 | java | package leetcode.array;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
/**
* 给定一组非负整数,重新排列它们的顺序使之组成一个最大的整数。
* <p>
* 示例 1:
* <p>
* 输入: [10,2]
* 输出: 210
* <p>
* 示例 2:
* <p>
* 输入: [3,30,34,5,9]
* 输出: 9534330
* <p>
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/largest-number
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
public class N179largestNumber {
public String largestNumber(int[] nums) {
/*Collections.sort(nums,new Comparator<Integer>(){
@Override
public int compare(int o1, int o2) {
int x1 = o1;
int x2 = o2;
while (x1 / 10 != 0) {
x1 /= 10;
x2 *= 10;
}
while (o2 / 10 != 0) {
o2 /= 10;
o1 *= 10;
}
return (o1 + o2) - (x2 + x1);
}
});*/
return "";
}
}
| [
"1617950759@qq.com"
] | 1617950759@qq.com |
72baf634a3ef7784acfbe448e0e1fe13e58f31a5 | ad23e81a7028349f71d631e57b4fa9fb6a7e90d7 | /app/src/main/java/com/example/pam/MyDatabase.java | e77f9ae05be2e5b009cdb1ee948df829aed0371c | [] | no_license | Martilius/PAM | 7d92e84618f902bc20af55d859b5ff45edde37c7 | fa6b6d1ee16225b59b230cec971bf73738fa415e | refs/heads/master | 2020-09-25T00:33:24.790097 | 2019-12-04T13:56:38 | 2019-12-04T13:56:38 | 225,880,245 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 333 | java | package com.example.pam;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Database;
import android.arch.persistence.room.RoomDatabase;
@Database(entities = {User.class}, version = 1, exportSchema = false)
public abstract class MyDatabase extends RoomDatabase {
public abstract MyDao mydao();
}
| [
"pawel.barszcz@o2.pl"
] | pawel.barszcz@o2.pl |
69fc1311e87bb3f6099bfe9d10ffdc9984e4f237 | 3de767eec3eb92ac646fadcc4eae4966a945f42d | /JavaProgramming/src/SDETProgram/GoodSubSequence.java | 431c04a1fb930f21ced05c4f0d5b2d96af4d8902 | [] | no_license | omkhopade/JavaProgramming | 6eb1bc4a5549fbc3e2279d3629e47829133e9366 | 99b8913bb9b0b9024266064f6a0eabe52a7930e0 | refs/heads/master | 2023-02-12T12:57:48.713407 | 2021-01-13T04:09:03 | 2021-01-13T04:09:03 | 329,189,809 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 881 | java | package SDETProgram;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class GoodSubSequence {
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int num= Integer.parseInt(br.readLine());
for(int i=0;i<num;i++)
{
String str[]= new String[num];
str[i]= br.readLine();
int info[]=new int[2];
int len=str[i].length();
int ar[]=new int[150];
for(int b=0;b<len;b++)
{
char ch=str[i].charAt(b);
ar[(int)ch]++;
if(b==len-1 && ar[(int)ch]>1 && str[i].charAt(b)!=str[i].charAt(b-1))
{
info[0]=1;
}
}
for(int b=95;b<150;b++)
{
if(ar[b]!=0)
{
info[1]++;
}
}
System.out.println(info[i]);
}
}
} | [
"Pc@Pc-PC"
] | Pc@Pc-PC |
d4c61043b3fa712256c3d2e3166e6e5f67d4499b | 9034f85e4317687867b473ca65b0b8d8558a0aff | /SeleniumTutorials/src/week_01/Sel_027_ElementVisibility.java | c1e4488346870c57a2fc754ab9163efb5539976b | [] | no_license | Albatros46/Java_With_Selenium | 57dd5887ddb4930c33f1740a9893793295cb1b99 | 9ec4b16e0eec1c5a8f0953b125e4ef56dc2cf239 | refs/heads/main | 2023-03-10T05:28:12.575592 | 2021-02-18T20:40:38 | 2021-02-18T20:40:38 | 336,054,274 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,041 | java | package week_01;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
public class Sel_027_ElementVisibility {
public static void main(String[] args) {
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver();
driver.get("http://demo.guru99.com/test/radio.html");
//RadioButton 1,2
WebElement rb1=driver.findElement(By.id("vfb-7-1"));
WebElement rb2=driver.findElement(By.id("vfb-7-2"));
//CheckBoxbutton 1
WebElement cb1=driver.findElement(By.id("vfb-6-0"));
cb1.click();
rb1.click();
System.out.println("Radiobutton 1 secildi ? :"+rb1.isSelected());
System.out.println("Radiobutton 2 secildi ? :"+rb2.isSelected());
System.out.println("CheckBoxbutton 1 secildi ? :"+cb1.isSelected());
System.out.println("CheckBoxbutton 1 secildi ? :"+cb1.isEnabled());
System.out.println("CheckBoxbutton 1 secildi ? :"+cb1.isDisplayed());
}
}
| [
"34627199+Albatros46@users.noreply.github.com"
] | 34627199+Albatros46@users.noreply.github.com |
9e8f79edf861f03669f32fa3c8d2b622993388a9 | f02908d0f40172f51cbf0f8abaf47ba7159dd9ab | /TP2/tp2/Date.java | 489ceca21c72f98ce01d884bc6923d62d0a98f51 | [] | no_license | EphecLLN/java-tps-hebdomadaires-Gri097 | 50f4f3a03d9aba14bcc293f4a6a71ba919afbfcd | 5d64d5e59aa41a9e047f24239309253facea6a32 | refs/heads/master | 2020-08-05T23:19:38.489552 | 2019-11-08T08:40:13 | 2019-11-08T08:40:13 | 212,751,935 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 726 | java | /**
*
*/
package tp2;
/**
* Cette classe modélise une date de manière simplifiée.
* @author Virginie Van den Schrieck
*
*/
public class Date {
//variables d'instance
int jour;
int mois;
int annee;
/**
* La méthode main permet de tester la classe date en créant un objet
* au départ des arguments de la ligne de commande. Trois arguments sont attendus, sous forme d'entiers :
* Le jour, le mois et l'année.
* @param args les arguments de la ligne de commande
*/
public static void main(String [] args) {
Date d = new Date();
d.jour = Integer.parseInt(args[0]);
d.mois = Integer.parseInt(args[1]);
d.annee = Integer.parseInt(args[2]);
}
}
| [
"he201536@D291.ephec.be"
] | he201536@D291.ephec.be |
39566d81963e1fd7335075ffbc30b09cc85d9ab6 | 3c2c90a8b7c1e13ef3525e37e57a1937707ed28d | /src/server/java/com/example/stocks/infrastructure/server/HttpApplicationServerBuilder.java | 05893269258cca5ec2c3621017b230c5b344a658 | [] | no_license | petekneller/essential_acceptance_testing_code | 1a95eba6545a2e5ddc68f5d76c33ea6d5d2b3e34 | b59417144aa3a3f4a5a1a01aaf06241c4015773f | refs/heads/master | 2021-01-16T20:45:46.141261 | 2013-05-29T18:16:32 | 2013-05-29T18:16:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 810 | java | package com.example.stocks.infrastructure.server;
import com.example.stocks.infrastructure.Builder;
import com.example.stocks.infrastructure.HttpServer;
import com.example.stocks.infrastructure.rest.RestfulApplicationServer;
public class HttpApplicationServerBuilder implements Builder<HttpServer> {
private PortfolioBuilder portfolio = PortfolioBuilder.defaultPortfolio();
private HttpApplicationServerBuilder() {
}
public static HttpApplicationServerBuilder defaultHttpServer() {
return new HttpApplicationServerBuilder();
}
public HttpApplicationServerBuilder with(PortfolioBuilder portfolio) {
this.portfolio = portfolio;
return this;
}
@Override
public HttpServer build() {
return new RestfulApplicationServer(portfolio);
}
}
| [
"toby.weston@gmail.com"
] | toby.weston@gmail.com |
d467c9f9e623045fee1560d05d39d285bbeb2aa0 | 4cffd8aa77909d6ebecd8dc13e9ebe904191010e | /src/main/java/com/bamba/gestiondestock/validator/EntrepriseValidator.java | 2af1aa01bec576298a302f157869f3a4bb045659 | [] | no_license | Bambamoussa/GestionDeStock | 89daa7eb807a401ce5500d5883744669a0dcc8c2 | 823ccaf3ff4a05774b5b03f5f858cdabfca01f88 | refs/heads/main | 2023-07-16T19:56:44.336058 | 2021-08-31T22:39:09 | 2021-08-31T22:39:09 | 398,582,400 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,331 | java | package com.bamba.gestiondestock.validator;
import com.bamba.gestiondestock.dto.EntrepriseDto;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
public class EntrepriseValidator {
public static List<String> validate (EntrepriseDto entrepriseDto) {
List<String> errors = new ArrayList<>();
if(entrepriseDto == null){
errors.add("veuillez entrer le nom de l'entreprise");
errors.add("veuillez entrer le code Fiscal de l'entreprise");
errors.add("veuillez entrer l'email de l'entreprise");
errors.add("veuillez entrer le nom de l'entreprise");
errors.add("veuillez renseigner l'adresse de l'utilisateur");
return errors;
}
if(!StringUtils.hasLength(entrepriseDto.getNom())){
errors.add("veuillez entrer le nom de l'entreprise");
}
if(!StringUtils.hasLength(entrepriseDto.getCodeFiscal())){
errors.add("veuillez entrer le code Fiscal de l'entreprise");
}
if(!StringUtils.hasLength(entrepriseDto.getEmail())){
errors.add("veuillez entrer l'email de l'entreprise");
}
if(!StringUtils.hasLength(entrepriseDto.getNom())){
errors.add("veuillez entrer le nom de l'entreprise");
}
if(!StringUtils.hasLength(entrepriseDto.getNumTel())){
errors.add("veuillez entrer le numero de téléphone de l'entreprise");
}
if(entrepriseDto.getAdresse() == null){
errors.add("veuillez renseigner l'adresse de l'utilisateur");
}
else {
if(!StringUtils.hasLength(entrepriseDto.getAdresse().getAdresse1())){
errors.add("le champ 'Adresse 1' est obligatoire");
}
if(!StringUtils.hasLength(entrepriseDto.getAdresse().getVille())){
errors.add("le champ 'Ville' est obligatoire");
}
if(!StringUtils.hasLength(entrepriseDto.getAdresse().getCodePostale())){
errors.add("le champ 'Code Postale' est obligatoire");
}
if(!StringUtils.hasLength(entrepriseDto.getAdresse().getPays())){
errors.add("le champ 'Pays' est obligatoire");
}
}
return errors;
}
}
| [
"moussa.bamba@etudiant.univ-rennes1.fr"
] | moussa.bamba@etudiant.univ-rennes1.fr |
46499eba21c3db4bb5f72bb35e123ff81160ecf9 | ebe7e7feca4ae3f8b12711ee544ba74aaa63c3a3 | /LoginApp/clientApp/src/main/java/com/assignment/clientApp/WebController.java | fe58d596e0c7b52556eb6d3a9e051fe0f6f770cd | [] | no_license | Amlan2308/Oauth2-custom-server | 11e85d6d9802a666d273b5e6a9913387cedb092d | 16b82648020b3aa23e01d5521d736c653971d31c | refs/heads/main | 2023-07-16T14:56:51.056996 | 2021-08-30T08:39:07 | 2021-08-30T08:39:07 | 401,272,477 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 538 | java | package com.assignment.clientApp;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import java.security.Principal;
@Controller
public class WebController {
@RequestMapping("/securedPage")
public String securedPage(Model model, Principal principal) {
return "securedPage";
}
@RequestMapping("/")
public String index(Model model, Principal principal) {
return "index";
}
}
| [
"noreply@github.com"
] | noreply@github.com |
d5b0a1b75ddcc075a8942146566cf6e7119e8f34 | 28dcf13c596bf5098f9402c08f324305b8bb9d5b | /types/src/unalcol/types/real/DoublePrecisionOrder.java | ec43e581da427c447275d02a4a8ec7d3c7525b78 | [] | no_license | cacoguaa/IS | 9af2a906effd6eb10bdb43719e3371b30a00b22c | 7d7fd774ea0bf96330c90f9312b52369f4968ae7 | refs/heads/master | 2021-01-20T05:01:19.791825 | 2017-05-26T12:49:19 | 2017-05-26T12:49:19 | 83,849,398 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 682 | java | package unalcol.types.real;
import unalcol.sort.*;
/**
* <p>Doubles considering the double precision defined in DoubleUtil class</p>
*
* <p>Copyright: Copyright (c) 2009</p>
*
* @author Jonatan Gomez Perdomo
* @version 1.0
*/
public class DoublePrecisionOrder extends Order<Double> {
/**
* Determines if the first Double is less than (in some order) the second Double (one<two) considering the precision
* defined in DoubleUtil class
* @param one First Double
* @param two Second Double
* @return (one<two)
*/
public int compare(Double one, Double two) {
return ( DoubleUtil.equal(one, two) )?0:one.compareTo(two);
}
}
| [
"cacoguaa@unal.edu.co"
] | cacoguaa@unal.edu.co |
0efe0a8112d6343074aaeaad3be12fc66b185e83 | 54aa172255aa5d58e7e2d669c928394e43f3f531 | /GbBrandMining/src/edu/thu/keg/GB/http0702/brand/features/tfidf/IBrandTools.java | 8a4a7e8c2ba56957800931d5b59ee9ab276cf864 | [] | no_license | lawby1229/keg-tm-works | 63c28e268366bcf681fdf735820de8560dee9e4e | 9dd19da7e79c95eb2808aca9e8e856de92f9dd63 | refs/heads/master | 2020-05-21T01:03:41.333453 | 2014-03-14T18:51:51 | 2014-03-14T18:51:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | package edu.thu.keg.GB.http0702.brand.features.tfidf;
import java.io.ObjectInputStream.GetField;
import java.sql.ResultSet;
public interface IBrandTools {
public ResultSet getRs(String tableName, String tag);
public void getFile(boolean isTrain);
}
| [
"lawby1229@163.com"
] | lawby1229@163.com |
8ea02b6348ebd5e75c3e604f4c38f39a7392c806 | 7183d6989c357c008edb69b7cea8a949637dc0e7 | /app/src/main/java/demo/utils/AppConstants.java | b3cad1100469db8593202595ec19763067c2d192 | [] | no_license | ragav-hari/BharatDemo | a7487ac7e68c4a3e75c1e87b5f5844ad7bcbd356 | 54338ea4f0652ee4df7df130038bf6ecfc014b3e | refs/heads/master | 2021-01-23T11:49:50.922561 | 2015-06-25T06:41:44 | 2015-06-25T06:41:44 | 37,968,878 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 332 | java | package demo.utils;
/**
* Created by ragavendran on 23-06-2015.
*/
public class AppConstants
{
public static class URLConstants
{
public static final String essentials = "http://10.0.2.2/Bharatration/index.php";
public static final String cart = "http://localhost:80/Bharatration/cartdata";
}
}
| [
"mynameisragav@gmail.com"
] | mynameisragav@gmail.com |
fc7b3281430db56bfb129a2dd21e634ee02497da | 63a46f6bad5a9573c8f32ad84692bb1c8dbd1808 | /oramon-server/src/com/voyager/db/RMSQueryRunner.java | c95a288cabceade96ee04cdd4cb8b54d0e320f35 | [] | no_license | badlogicmanpreet/novice | 4e3ec822a87c7857ec7377d6276b1c1a1712fed5 | 3ae33d6df0432d92610aed572f0f0ca82a2212b0 | refs/heads/master | 2021-01-18T14:01:55.342496 | 2013-11-21T18:54:31 | 2013-11-21T18:54:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,044 | java | package com.voyager.db;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Properties;
import javax.mail.MessagingException;
import com.voyager.processor.HospProcessor;
import com.voyager.processor.StageProcessor;
import com.voyager.ifaces.IQueryRunner;
public class RMSQueryRunner implements IQueryRunner {
public static final String SEP = System.getProperty("file.separator");
private Statement statementForQuery;
private String selectQuery;
private String stageCountQuery;
private String stageTables;
private String stageResult;
private ResultSet resultSet;
private HashMap result;
private HospProcessor hospProcessor;
private StageProcessor stageProcessor;
private HashMap hospitalResult;
public String queryForHosp(Connection connection, Properties properties) throws SQLException, MessagingException {
selectQuery = properties.getProperty("selectQuery");
statementForQuery = connection.createStatement();
resultSet = statementForQuery.executeQuery(selectQuery);
//hospProcessor = new HospProcessor();
//hospitalResult = hospProcessor.process(resultSet, properties);
//return hospitalResult;
return null;
}
public HashMap queryForHospital(Connection connection, Properties properties) throws SQLException, MessagingException {
hospProcessor = new HospProcessor();
selectQuery = properties.getProperty("selectQuery");
System.out.println("selectQuery is = " + selectQuery);
statementForQuery = connection.createStatement();
resultSet = statementForQuery.executeQuery(selectQuery);
//hospProcessor = new HospProcessor();
//hospitalResult = hospProcessor.process(resultSet, properties);
System.out.println("Heading for processing");
hospitalResult = hospProcessor.process(resultSet);
return hospitalResult;
}
public String queryForStage(Connection connection, Properties properties) throws SQLException, MessagingException {
stageCountQuery = properties.getProperty("mfqueueCountQuery");
stageTables = properties.getProperty("stageTables");
String[] stageTablesList = stageTables.split("\\|");
result = new HashMap();
for (int i = 0; i < stageTablesList.length; i++) {
statementForQuery = connection.createStatement();
resultSet = statementForQuery.executeQuery(stageCountQuery + " " + stageTablesList[i]);
while (resultSet.next()) {
result.put(stageTablesList[i], resultSet.getString(1));
}
}
String[] columns = { "Staging Table", "No. of Records Pending" };
stageProcessor = new StageProcessor();
stageResult = stageProcessor.process(columns, result);
return stageResult;
}
public HashMap queryForEgate(Properties properties) throws FileNotFoundException, IOException, SQLException, MessagingException {
// TODO Auto-generated method stub
return null;
}
}
| [
"mghotra81@gmail.com"
] | mghotra81@gmail.com |
dd6ae63afb43d13fa5f8cb6a69f0187238860132 | 4c4e7b5eb397cd7d0cc177c2862cfc6f5e3bee64 | /gmall-ums/src/main/java/com/atguigu/gmall/ums/controller/UserCollectSkuController.java | bda5886dc87e14fa3da8686f8c669dd464866336 | [
"Apache-2.0"
] | permissive | Song-Mc/gamll-0821 | b7bd1afd60479d4aa2cf8c4d7a2b19f76db70ae8 | b394c19139717238c88ff46ebdaed86dcda0ce9b | refs/heads/main | 2023-03-12T21:25:21.874277 | 2021-03-04T11:19:46 | 2021-03-04T11:19:46 | 330,546,458 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,558 | 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.UserCollectSkuEntity;
import com.atguigu.gmall.ums.service.UserCollectSkuService;
import com.atguigu.gmall.common.bean.PageResultVo;
import com.atguigu.gmall.common.bean.ResponseVo;
import com.atguigu.gmall.common.bean.PageParamVo;
/**
* 关注商品表
*
* @author SongMc
* @email SongMc@163.com
* @date 2021-02-21 18:04:00
*/
@Api(tags = "关注商品表 管理")
@RestController
@RequestMapping("ums/usercollectsku")
public class UserCollectSkuController {
@Autowired
private UserCollectSkuService userCollectSkuService;
/**
* 列表
*/
@GetMapping
@ApiOperation("分页查询")
public ResponseVo<PageResultVo> queryUserCollectSkuByPage(PageParamVo paramVo){
PageResultVo pageResultVo = userCollectSkuService.queryPage(paramVo);
return ResponseVo.ok(pageResultVo);
}
/**
* 信息
*/
@GetMapping("{id}")
@ApiOperation("详情查询")
public ResponseVo<UserCollectSkuEntity> queryUserCollectSkuById(@PathVariable("id") Long id){
UserCollectSkuEntity userCollectSku = userCollectSkuService.getById(id);
return ResponseVo.ok(userCollectSku);
}
/**
* 保存
*/
@PostMapping
@ApiOperation("保存")
public ResponseVo<Object> save(@RequestBody UserCollectSkuEntity userCollectSku){
userCollectSkuService.save(userCollectSku);
return ResponseVo.ok();
}
/**
* 修改
*/
@PostMapping("/update")
@ApiOperation("修改")
public ResponseVo update(@RequestBody UserCollectSkuEntity userCollectSku){
userCollectSkuService.updateById(userCollectSku);
return ResponseVo.ok();
}
/**
* 删除
*/
@PostMapping("/delete")
@ApiOperation("删除")
public ResponseVo delete(@RequestBody List<Long> ids){
userCollectSkuService.removeByIds(ids);
return ResponseVo.ok();
}
}
| [
"1471485017@qq.com"
] | 1471485017@qq.com |
04cd82e65e0c4f97e5fd82fe94195510e5c2d6f1 | c061cadbfa3036c7fc42e7904f08e5446ad8da4b | /src/main/java/edu/stanford/arcspread/wordbrowser/ProcessInputFile.java | 72c17d4890c8213c8088d0a0782e9906f62d7131 | [] | no_license | paepcke/ArcSpreadWordBrowser | 8adad75c8b5338d2b9383361dc1e753024f91388 | 731609a1ddebe3c7c76956e21cf6d2485ff4dd1f | refs/heads/master | 2016-09-05T09:03:25.823294 | 2012-02-22T19:58:17 | 2012-02-22T19:58:17 | 3,518,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,190 | java | package edu.stanford.arcspread.wordbrowser;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import edu.stanford.nlp.ie.AbstractSequenceClassifier;
import edu.stanford.nlp.ie.crf.CRFClassifier;
import edu.stanford.nlp.ling.CoreAnnotations.AnswerAnnotation;
import edu.stanford.nlp.ling.CoreLabel;
public class ProcessInputFile {
/*
* Member variables
*/
private static String currPara = "", currURL="";
private static PartOfSpeechTagger postagger = new PartOfSpeechTagger();
private static List<POSWordData>properList = new ArrayList<POSWordData>();//proper nouns
private static List<POSWordData>commonList = new ArrayList<POSWordData>();//all words other than proper nouns eg: nouns, adjectives etc
private static List<NERWordData>nerList = new ArrayList<NERWordData>();//all words in the input file with their NER tags
private static Map<String, List<NERWordData>> nerMap = new HashMap<String, List<NERWordData>>();
/*
* Constructor
*/
public ProcessInputFile(String csvString) throws Exception{
parseInputFile(ProcessInputFile.getScanner(csvString));
createMaps();
}
public ProcessInputFile(File csvFile) throws Exception{
parseInputFile(ProcessInputFile.getScanner(csvFile));
createMaps();
}
public ProcessInputFile(InputStream csvStream) throws Exception{
parseInputFile(ProcessInputFile.getScanner(csvStream));
createMaps();
}
/*
* Function to perform NER Tagging. Call's the Stanford NLP Group's tagger with a paragraph at a time.
*/
static void doNERTagging(String paragraph, String currURL){
String serializedClassifier = "classifiers/all.3class.distsim.crf.ser.gz";
AbstractSequenceClassifier classifier =
CRFClassifier.getClassifierNoExceptions(serializedClassifier);
List<List<CoreLabel>> out = classifier.classify(paragraph);
for (List<CoreLabel> sentence : out) {
for (CoreLabel word : sentence) {
NERWordData nd = new NERWordData(word.word(), word.get(AnswerAnnotation.class), currURL);
nerList.add(nd);
}
}
}
/*
* Function to perform POS Tagging. Call's the Stanford NLP Group's POS tagger.
*/
static void doPOSTagging(String paragraph, String currURL) throws IOException{
List<PosPair> posPairs = postagger.getPosTags(currPara);
Iterator<PosPair> it = posPairs.iterator();
while(it.hasNext()){
PosPair val = (PosPair)it.next();
POSWordData wd = new POSWordData(val.word, val.pos, currURL);
if(val.isProperNoun())
properList.add(wd);
else
commonList.add(wd);
}
}
/*
* Create's a map of the NER tags to the list of words classified as those tags.
*/
static void createMaps(){
//Map from NER tag to word data
List<NERWordData>temp;
Iterator<NERWordData> it = nerList.iterator();
while(it.hasNext()){
NERWordData val = (NERWordData)it.next();
temp = nerMap.get(val.nertag);
if (temp == null){
temp = new ArrayList<NERWordData>();
temp.add(val);
nerMap.put(val.nertag, temp);
}
else{
temp.add(val);
nerMap.put(val.nertag,temp);
}
}
}
/*
* Query the map
*/
List<NERWordData> generateResult(String tag){
List<NERWordData> value = nerMap.get(tag);
return value;
}
static Scanner getScanner(String csvContent) {
return new Scanner(csvContent);
}
static Scanner getScanner(File csvFile) throws FileNotFoundException {
return new Scanner(csvFile);
}
static Scanner getScanner(InputStream csvStream) throws FileNotFoundException {
return new Scanner(csvStream);
}
/*
* Parses each row of the input csv file and calls the POS/NER tagger.
*/
static void parseInputFile(Scanner input) throws Exception{
String delim = "||";
while(input.hasNext()){
String word = input.next();
currPara = currPara + " " + word;
if(word.compareTo(delim) == 0)
{ currURL = input.next();
//doPOSTagging(currPara, currURL);
doNERTagging(currPara, currURL);
currPara = "";
currURL = "";
}
}
}
}; | [
"paepcke@cs.stanford.edu"
] | paepcke@cs.stanford.edu |
a3ff1eb01828d7efebd7efdd3ca0643cde18309f | 3a14fa78b616a1dfd5d9a89c39897fa7b8440976 | /Codeforces/src/TableCity_575D.java | 2edce40686eeebd8fb34d8c0658c71b1bfeeefb7 | [] | no_license | davidarcila93/maratones | e2f69a572135ac5f446e7b4929a5ca48b42cbab6 | e7dd27e855744a2725e42f65db60df30f75063dd | refs/heads/master | 2021-03-12T22:43:59.090696 | 2017-02-01T17:24:59 | 2017-02-01T17:24:59 | 42,031,950 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java |
public class TableCity_575D {
public static void main(String[] args)throws Exception {
System.out.println("2000");
for(int i=1; i<=1000; i++){
System.out.print(i+" "+1+" ");
System.out.println(i+" "+2);
}
for(int i=1000; i>0; i--){
System.out.print(i+" "+1+" ");
System.out.println(i+" "+2);
}
}
}
| [
"davidarcila93@gmail.com"
] | davidarcila93@gmail.com |
4ed97adcd83eef03ac2385a634dc7faa9c64d160 | e808d3e97e19558d15bacbcfeb9785014f2eb93a | /onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/services/beans/StopBeanService.java | eaf18f7995bff913e9ef7bd18063227e0a292781 | [
"Apache-2.0"
] | permissive | isabella232/onebusaway-application-modules | 82793b63678f21e28c98093cb71b333a2e22a3c1 | d2ca6c6e0038d158c9df487cab9f75d18b1214ff | refs/heads/master | 2023-03-08T20:02:35.766999 | 2019-01-03T16:41:11 | 2019-01-03T16:41:11 | 335,592,972 | 0 | 0 | NOASSERTION | 2021-02-24T05:43:58 | 2021-02-03T10:50:26 | null | UTF-8 | Java | false | false | 1,252 | java | /**
* Copyright (C) 2011 Brian Ferris <bdferris@onebusaway.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onebusaway.transit_data_federation.services.beans;
import org.onebusaway.exceptions.NoSuchStopServiceException;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.Stop;
import org.onebusaway.transit_data.model.StopBean;
public interface StopBeanService {
/**
* @param stopId see {@link Stop#getId()}
* @return the populated stop bean, or null if a stop with the specified id
* was not found
* @throws NoSuchStopServiceException if the stop with the specified id could
* not be found
*/
public StopBean getStopForId(AgencyAndId stopId);
}
| [
"bdferris@google.com"
] | bdferris@google.com |
dfe4bbe1d87fd46e3fa54619c8784a66f94dd594 | 614bd367a757060e4b334b9390ebebd2ebd6167a | /src/Problem40/NumAppearOnceTest.java | 78b428b559a1a835cd73f909d4fc38ba44bedc31 | [] | no_license | hueyzhao/SwordOffer | 86670c2e1ced7a80da07ebd0ea93ab1a2ff1d61c | 4674f3512d9af5ac29a376848c9604ab71fa66da | refs/heads/master | 2020-06-06T03:51:15.599006 | 2015-07-15T00:57:09 | 2015-07-15T00:57:09 | 35,407,063 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package Problem40;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class NumAppearOnceTest {
private static NumAppearOnce once = new NumAppearOnce();
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
@Before
public void setUp() throws Exception {
}
@Test
public void testFindNumberAppearOnce() {
int [] testArray = {-1,-2,-3,-4,6,-1,-3,-2};
int [] expected = {-4,6};
assertArrayEquals(expected, once.findNumberAppearOnce(testArray));
}
}
| [
"zhaohuanyu415@gmail.com"
] | zhaohuanyu415@gmail.com |
cf2cb319756545abcf805c2d423e0c55f0958da5 | 778a92a002ab6678509a8dd28733adebe25e7caa | /app/src/main/java/es/metichi/animabeyondfantasy/CharacterDisplayBundle.java | 796ead61c20c90e320d3cfb057fde8c50c768038 | [] | no_license | Metichi/AnimaSheet | 3ada951de8007bdb580727f6613a94e9753bd0e3 | bea8872ed2ce4007c631be7c43317adafadad751 | refs/heads/master | 2021-01-01T20:40:14.568740 | 2017-08-07T13:06:22 | 2017-08-07T13:06:22 | 98,910,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 788 | java | package es.metichi.animabeyondfantasy;
import android.support.design.widget.FloatingActionButton;
import android.view.View;
/**
* Created by Metichi on 06/08/2017.
*/
public class CharacterDisplayBundle {
private String title;
private View layout;
private FloatingActionButton.OnClickListener onClickListener;
public CharacterDisplayBundle(String title, View layout, FloatingActionButton.OnClickListener onClickListener){
this.layout = layout;
this.title = title;
this.onClickListener = onClickListener;
}
public View getLayout() {
return layout;
}
public FloatingActionButton.OnClickListener getOnClickListener() {
return onClickListener;
}
public String getTitle() {
return title;
}
}
| [
"metichi@gmail.com"
] | metichi@gmail.com |
cd969753249e08e5bacf04c7d631dacc80ae8022 | 59d33c7e31bc32ca90799ea0366d0e4797d47948 | /src/java/br/edu/ifsul/converter/ConverterPessoaFisica.java | 56b771c24b8212ef00aff7817d4a3dbee8557305 | [] | no_license | brunohl91/DAW-2016-1-5N1-Web | 309208bb42a0e00f2e40549d03e44d35a301e4a1 | 0fcdf181f33c4d55fe5a7be57baf6db9b734a511 | refs/heads/master | 2016-09-12T12:42:30.455821 | 2016-05-27T17:28:05 | 2016-05-27T17:28:05 | 57,928,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,312 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.edu.ifsul.converter;
import br.edu.ifsul.jpa.EntityManagerUtil;
import br.edu.ifsul.modelo.PessoaFisica;
import java.io.Serializable;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
/**
*
* @author Bruno
*/
@FacesConverter(value = "converterPessoaFisica")
public class ConverterPessoaFisica implements Converter, Serializable {
@Override
public Object getAsObject(FacesContext fc, UIComponent uic, String string) {
if (string == null || string.equals("Selecione um registro")) {
return null;
}
else {
return EntityManagerUtil.getEntityManager().find(PessoaFisica.class, Integer.parseInt(string));
}
}
@Override
public String getAsString(FacesContext fc, UIComponent uic, Object o) {
if (o == null) {
return null;
}
else {
PessoaFisica obj = (PessoaFisica) o;
return obj.getId().toString();
}
}
}
| [
"brunohl91@outlook.com"
] | brunohl91@outlook.com |
9c6fce5686365228c988ccced00c5a978e290765 | 1982abb72803de8fb2436e1c5ba36e17b53252f5 | /project/src/main/java/org/csu/ashirt/service/CatalogService.java | 91a35460eedce98bbd8c8844e46bcd236b339875 | [
"Apache-2.0"
] | permissive | ya-nan-z/Ashirt | 98c059612e22f7c47196e6b97013a64514fde795 | 0927ae94195af065bab5eb604512501b598a5aa9 | refs/heads/master | 2020-07-20T18:42:19.682548 | 2019-09-06T01:39:47 | 2019-09-06T01:39:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 718 | java | package org.csu.ashirt.service;
import org.csu.ashirt.domain.Category;
import org.csu.ashirt.domain.Item;
import org.csu.ashirt.domain.Style;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
public interface CatalogService {
// Category
public List<Category> getCategoryList();
public Category getCategory(int categoryId);
public List<Category> SearchCategoryList(String keyword);
//Item
public List<Item> getItemByCategory(int categoryId);
public Item getItem(int itemId);
//Style
public Style getStyle(int styleId);
public Style searchStyleList(String keyword);
@Transactional
public void insertStyle(Style style);
}
| [
"hhq126152@gmail.com"
] | hhq126152@gmail.com |
f3b03b4331cbd204a0379a68772061bd1e07b38a | 034416becb36f4a9922053daf5f1175349a2843f | /mmall-member/mmall-member-api/src/main/java/com/xyl/mmall/member/service/DealerService.java | 73972f573fd8338593fc6bb9c236efdecc2de38b | [] | no_license | timgle/utilcode | 40ee8d05e96ac324f452fccb412e07b4465e5345 | a8c81c90ec1965d45589dd7be8d2c8b0991a6b6a | refs/heads/master | 2021-05-09T22:39:11.417003 | 2016-03-20T14:30:52 | 2016-03-20T14:30:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,168 | java | /**
*
*/
package com.xyl.mmall.member.service;
import java.util.List;
import com.xyl.mmall.framework.exception.ServiceException;
import com.xyl.mmall.member.dto.DealerDTO;
import com.xyl.mmall.member.dto.DealerRoleDTO;
import com.xyl.mmall.member.enums.AccountStatus;
/**
* 商家后台用户相关服务。
*
* @author lihui
*
*/
public interface DealerService {
/**
* 为指定供应商关联新的用户账号。
*
* @param name
* 被关联的账号名。
* @param supplierId
* 供应商ID
* @return 关联后的后台运维账号信息
*/
DealerDTO assignNewDealerOwner(String name, long supplierId);
/**
* 停用指定的供应商的指定管理员账号。
*
* @param name
* 被停用的管理员账号名
* @param supplierId
* 供应商ID
* @param userId
* 操作人
* @return
*/
void suspendDealerOwner(String name, long supplierId, long userId);
/**
* 创建/更新供应商后台普通用户信息。
*
* @param dealerDTO
* 后台用户信息
* @param userId
* ‘操作人
* @return 创建/更新后的商家后台用户信息
*/
DealerDTO upsertDealerEmployee(DealerDTO dealerDTO, long userId);
/**
* 根据用户ID查找商家后台用户信息。
*
* @param id
* 商家后台用户ID
* @return 商家后台用户信息
*/
DealerDTO findDealerById(long id);
/**
* 根据用户ID列表查找商家后台用户信息。
*
* @param idList
* 商家后台用户ID列表
* @return 商家后台用户信息
*/
List<DealerDTO> findDealerById(List<Long> idList);
/**
* 根据用户ID查找包含角色信息的商家后台用户信息。
*
* @param 商家后台用户ID
* @return 商家后台用户信息
*/
DealerDTO findDealerWithRoleById(long id);
/**
* 根据商家登录名查找商家后台用户信息。
*
* @param name
* 商家后台用户登录名
* @return 商家后台用户信息
*/
DealerDTO findDealerByName(String name);
/**
* 根据供应商ID查找所有该商家后台的普通用户
*
* @param supplierId
* 供应商ID
* @return 普通用户的信息列表
*/
List<DealerDTO> findAllDealerEmployee(long supplierId);
/**
* 创建/更新商家后台用户的用户组信息。
*
* @param dealerRole
* 商家后台用户的用户组信息
* @return 创建/更新后的商家后台用户的用户组信息
*/
DealerRoleDTO upsertDealerRole(DealerRoleDTO dealerRole);
/**
* 删除指定商家后台用户的用户组。
*
* @param dealerRole
* 被删除的商家后台用户的用户组
*/
void deleteDealerRole(DealerRoleDTO dealerRole);
/**
* 根据用户组创建人分页查找商家后台用户的信息列表
*
* @param userId
* 创建人ID
* @param limit
* 分页大小
* @param offset
* 分页位置
* @return 商家后台用户的信息列表
*/
List<DealerDTO> findDealerByRoleOwner(long userId, int limit, int offset);
/**
* 根据用户组创建人分页查找商家后台用户的数量
*
* @param userId
* 创建人ID
* @return 商家后台用户的数量
*/
int countDealerByRoleOwner(long userId);
/**
* 删除指定商家后台用户。
*
* @param dealerId
* 被删除的商家后台用户ID
*/
void deleteDealerById(long dealerId);
/**
* 根据用户组ID删除指定的商家后台用户组
*
* @param roleId
* 被删除的商家后台用户组
*/
void deleteDealerRoleByRoleId(long roleId);
/**
* 更新指定商家后台用户的状态。
*
* @param userId
* 操作人
* @param id
* 指定更新的后台用户
* @param status
* 更新后的用户状态
*/
void updateDealerAccountStatus(long userId, long id, AccountStatus status);
/**
* 删除相关商家后台用户信息,包含dealer和role表
* @return
*/
public void deleteDealerInfoByBusinessID(long businessId) throws ServiceException;
}
| [
"jack_lhp@163.com"
] | jack_lhp@163.com |
1ccc17be54cd1e75d0934a9c8ff55fc6063dad70 | 35f5f24eb5866353230b1a601b2df161c9264a0e | /app/src/main/java/com/grability/gerardosuarez/grability/MainActivity.java | 6ae815b3e674d9eea5ebf609385c8ebcecd7aabe | [] | no_license | andresuarezz26/grability | a0f8b46e7c4ed9fac4691a2f6b3a931f943da66c | dec5c7b5293468b2469070fd7b8aff6d2d84c434 | refs/heads/master | 2021-01-12T09:40:00.026425 | 2016-12-16T00:45:06 | 2016-12-16T00:45:06 | 76,226,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,382 | java | package com.grability.gerardosuarez.grability;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import com.squareup.otto.Bus;
import com.squareup.otto.Subscribe;
import java.util.ArrayList;
import java.util.List;
import adapter.ActivityMainAdapter;
import api.models.AttributesCategory;
import api.models.Entry;
import api.models.Feed;
import bus.BusProvider;
import events.GetFeedEvent;
import events.SendFeedEvent;
import model.Converter;
import utils.SnackbarMsg;
public class MainActivity extends AppCompatActivity{
private final String TAG = MainActivity.class.getSimpleName();
private final Bus mBus = BusProvider.getInstance();
private Converter mConverter;
private View parentLayout ;
//RecyclerView parametters
private RecyclerView mRecyclerView;
private ActivityMainAdapter adapter;
private RecyclerView.LayoutManager mLayoutManager;
private ArrayList <AttributesCategory> categoryList;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initComponents();
//Post the event to call the API
mBus.post(new GetFeedEvent());
}
/**
* Initialize toolbar,recyclerView, adapters and assign list to adapter
*/
public void initComponents()
{
parentLayout = findViewById(R.id.recycler_view_main);
//Initialize Toolbar
Toolbar toolbar = (Toolbar)findViewById( R.id.toolbar );
setSupportActionBar( toolbar );
//RecyclerView components
mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view_main);
mLayoutManager = new LinearLayoutManager(this);
mRecyclerView.setLayoutManager(mLayoutManager);
categoryList = new ArrayList<AttributesCategory>( );
// mRecyclerView.addItemDecoration( new DividerItemDecoration( this, LinearLayoutManager.VERTICAL ) );
adapter = new ActivityMainAdapter(categoryList);
mRecyclerView.setAdapter(adapter);
}
/**
* When the sendFeedEvent is called, do the logic to show the categories
* @param sendFeedEvent
*/
@Subscribe
public void onSendFeedEvent(SendFeedEvent sendFeedEvent)
{
Log.e(TAG, "onSeedEvent");
//Recover the data form API
Feed feed = sendFeedEvent.getFeed();
List<Entry> entryList = feed.getEntry();
Log.e(TAG, entryList.get(0).toString()+"size "+entryList.size());
SnackbarMsg.getInstance().getMessage(parentLayout,entryList.get(0).toString()+"size "+entryList.size());
//Convert the entryList in AttributeCategory list and notify to adapter
mConverter = new Converter(entryList);
categoryList = mConverter.getCategories();
Log.e(TAG, categoryList.get(0).toString()+"size "+categoryList.size());
adapter.notifyDataSetChanged();
}
@Override
protected void onResume()
{
super.onResume();
mBus.register(this);
}
@Override
protected void onPause()
{
super.onPause();
mBus.unregister(this);
}
}
| [
"andresuarezz2693@gmail.com"
] | andresuarezz2693@gmail.com |
6f043dd787e14b090eb5c796f2fc6c0a71412561 | 22a22566c1305e0e9ef95e69e64cbcafeb0cac05 | /src/main/generated/com/ddastudio/mrmr/measure/model/QWeightByHeight.java | 14d1b4dd8fddaf1da28395cb57016725634eb55b | [] | no_license | messi1913/mrmr | e18af73009f0aaffe504ea0e2e021870407b0ec3 | 354251dbd740875b6e2a9a0c03a7b6ec9e6eb6f0 | refs/heads/master | 2020-09-25T02:58:16.518620 | 2019-12-17T14:01:38 | 2019-12-17T14:01:38 | 225,902,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,403 | java | package com.ddastudio.mrmr.measure.model;
import static com.querydsl.core.types.PathMetadataFactory.*;
import com.querydsl.core.types.dsl.*;
import com.querydsl.core.types.PathMetadata;
import javax.annotation.Generated;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.PathInits;
/**
* QWeightByHeight is a Querydsl query type for WeightByHeight
*/
@Generated("com.querydsl.codegen.EntitySerializer")
public class QWeightByHeight extends EntityPathBase<WeightByHeight> {
private static final long serialVersionUID = 224984139L;
private static final PathInits INITS = PathInits.DIRECT2;
public static final QWeightByHeight weightByHeight = new QWeightByHeight("weightByHeight");
public final QWeightByHeightId id;
public final NumberPath<Double> l = createNumber("l", Double.class);
public final NumberPath<Double> m = createNumber("m", Double.class);
public final NumberPath<Double> per1 = createNumber("per1", Double.class);
public final NumberPath<Double> per10 = createNumber("per10", Double.class);
public final NumberPath<Double> per15 = createNumber("per15", Double.class);
public final NumberPath<Double> per25 = createNumber("per25", Double.class);
public final NumberPath<Double> per3 = createNumber("per3", Double.class);
public final NumberPath<Double> per5 = createNumber("per5", Double.class);
public final NumberPath<Double> per50 = createNumber("per50", Double.class);
public final NumberPath<Double> per75 = createNumber("per75", Double.class);
public final NumberPath<Double> per85 = createNumber("per85", Double.class);
public final NumberPath<Double> per90 = createNumber("per90", Double.class);
public final NumberPath<Double> per95 = createNumber("per95", Double.class);
public final NumberPath<Double> per97 = createNumber("per97", Double.class);
public final NumberPath<Double> per99 = createNumber("per99", Double.class);
public final NumberPath<Double> s = createNumber("s", Double.class);
public final NumberPath<Double> std0 = createNumber("std0", Double.class);
public final NumberPath<Double> stdl1 = createNumber("stdl1", Double.class);
public final NumberPath<Double> stdl2 = createNumber("stdl2", Double.class);
public final NumberPath<Double> stdl3 = createNumber("stdl3", Double.class);
public final NumberPath<Double> stdr1 = createNumber("stdr1", Double.class);
public final NumberPath<Double> stdr2 = createNumber("stdr2", Double.class);
public final NumberPath<Double> stdr3 = createNumber("stdr3", Double.class);
public QWeightByHeight(String variable) {
this(WeightByHeight.class, forVariable(variable), INITS);
}
public QWeightByHeight(Path<? extends WeightByHeight> path) {
this(path.getType(), path.getMetadata(), PathInits.getFor(path.getMetadata(), INITS));
}
public QWeightByHeight(PathMetadata metadata) {
this(metadata, PathInits.getFor(metadata, INITS));
}
public QWeightByHeight(PathMetadata metadata, PathInits inits) {
this(WeightByHeight.class, metadata, inits);
}
public QWeightByHeight(Class<? extends WeightByHeight> type, PathMetadata metadata, PathInits inits) {
super(type, metadata, inits);
this.id = inits.isInitialized("id") ? new QWeightByHeightId(forProperty("id")) : null;
}
}
| [
"messi1913@gmail.com"
] | messi1913@gmail.com |
4193d6abf7137e35da8df8b161400e87bfa6b4be | d689aa17548ff57656a4c91d70c2c56d0b397a6a | /src/main/java/com/yzy/flink/source/MyKafkaRecord.java | 5cf703354fff6766ac5c8a9066725804545cc6ae | [] | no_license | jimmy777/flink-example | bb419680f83d8cca08dc301d6bd7a03e6a79bac9 | b88a61d306467e86a61bdbeb06c04109fd3a5bac | refs/heads/master | 2023-02-08T07:20:16.896287 | 2020-12-31T06:14:38 | 2020-12-31T06:14:38 | 325,701,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 782 | java | package com.yzy.flink.source;
/**
* @Author Y.Z.Y
* @Date 2020/11/23 15:57
* @Description
*
*/
public class MyKafkaRecord {
// 直接保存记录,类型为 String。
private String record;
public MyKafkaRecord(String record) {
this.record = record;
}
public String getRecord() {
return record;
}
public void setRecord(String record) {
this.record = record;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime + result + ((record == null)?0:record.hashCode());
return result;
}
@Override
public String toString() {
return "MyKafkaRecord{" +
"record='" + record + '\'' +
'}';
}
}
| [
"jimmy_777@126.com"
] | jimmy_777@126.com |
b8249bc22c850b185dba20105329997b8a1f94a5 | 800a79e9bc19f05971c4d843c40438e944ebe6e2 | /app/src/main/java/com/example/ending/uisimple/MainActivity.java | da5f1aa73fe97e36b94e5e27f196f047f117568d | [
"Apache-2.0"
] | permissive | JanecineJohn/UIsimple | 39ac5a8f31758bda4275108814f6229df9da3b1a | 4408bc9c25c17792bb27dba7c13d038ca6f70272 | refs/heads/master | 2021-09-03T16:36:25.685754 | 2018-01-10T13:25:14 | 2018-01-10T13:25:14 | 114,352,420 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 20,348 | java | package com.example.ending.uisimple;
import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Color;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TableLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.example.ending.uisimple.javabean.Joinner;
import com.example.ending.uisimple.javabean.MidJoinner;
import com.example.ending.uisimple.javabean.User;
import com.example.ending.uisimple.utils.getAppInfo;
import com.example.ending.uisimple.utils.postJson;
import com.google.gson.Gson;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import de.hdodenhof.circleimageview.CircleImageView;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;
import static com.example.ending.uisimple.utils.clearPreferences.clearAppInfo;
import static com.example.ending.uisimple.utils.clearPreferences.clearUserInfo;
public class MainActivity extends AppCompatActivity {
DrawerLayout MainUI;
LinearLayout Usermenu;
String flag="";
private ListView mListView;
private String[]names={"获取老师端历史记录的日期"};
private String[][]students={{"一个日期对应一节课的所有学生的应用使用记录,记录就放在这里"}};
String webAddress;//扫描结果,聊天室地址
String uid;//学生id
int classId;//课堂号
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Toast.makeText(MainActivity.this,"onCreate方法启动",Toast.LENGTH_SHORT).show();
setContentView(R.layout.activity_main);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//透明状态栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明导航栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
LinearLayout linear_bar = (LinearLayout) findViewById(R.id.ll_bar);
linear_bar.setVisibility(View.VISIBLE);
//获取到状态栏的高度
int statusHeight = getStatusBarHeight();
//动态的设置隐藏布局的高度
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) linear_bar.getLayoutParams();
params.height = statusHeight;
linear_bar.setLayoutParams(params);
mListView=(ListView)findViewById(R.id.lv);
MyBaseAdapter mAdapter=new MyBaseAdapter();
mListView.setAdapter(mAdapter);
}
}
//当界面从不可见变为可见时,判断有无旧课堂信息
@Override
protected void onStart() {
super.onStart();
//Log.i("主界面","onStart方法");
//Toast.makeText(MainActivity.this,"onStart方法启动",Toast.LENGTH_SHORT).show();
SharedPreferences pref = getSharedPreferences("userInfo",MODE_PRIVATE);
if (pref.getInt("classId",0) > 0){
new AlertDialog.Builder(MainActivity.this)
.setTitle("旧课堂")
.setMessage("是否要回到上一个课堂")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SharedPreferences pref = getSharedPreferences("userInfo",MODE_PRIVATE);
webAddress = pref.getString("webAddress","");
classId = pref.getInt("classId",0);
uid = pref.getString("uid","");
if (uid.equals("")){
Toast.makeText(MainActivity.this,"信息不完整,无法加入课堂",Toast.LENGTH_SHORT).show();
}else {
MidJoinner midJoinner = new MidJoinner(pref.getString("trueName",""),pref.getString("schoolId",""));
String mid = new Gson().toJson(midJoinner);
Joinner joinner = new Joinner(uid,classId,mid);
sendJoinClassHttp(joinner);
}
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
clearAppInfo(MainActivity.this);
clearUserInfo(MainActivity.this);
}
})
.show();
}
}
//每次重新回到主界面(主界面获得焦点)时回调此方法
@Override
protected void onResume() {
super.onResume();
//Toast.makeText(MainActivity.this,"onResume方法启动onResume方法启动",Toast.LENGTH_LONG).show();
Button loginBt = (Button) findViewById(R.id.LoginButton);//初始化登录按钮
//先检查用户信息,判断是否有登录
SharedPreferences pref = getSharedPreferences("userInfo",MODE_PRIVATE);
uid = pref.getString("uid","");
String userName = pref.getString("userName","");
if (uid.equals("") || userName.equals("")){
loginBt.setText("立即登录");
TextView nameinfact=(TextView)findViewById(R.id.nameinfact);
TextView numinfact=(TextView)findViewById(R.id.numinfact);
nameinfact.setEnabled(false);
numinfact.setEnabled(false);
nameinfact.setVisibility(View.VISIBLE);
numinfact.setVisibility(View.VISIBLE);
CircleImageView Head=(CircleImageView)findViewById(R.id.Head);
Head.setVisibility(View.INVISIBLE);
mListView.setVisibility(View.INVISIBLE);
TextView temptv=(TextView)findViewById(R.id.checkhistory);
temptv.setText("登录查看历史记录");
Button RegisterButton=(Button)findViewById(R.id.RegisterButton);
RegisterButton.setText("注册");
loginBt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent=new Intent(MainActivity.this,LoginActivity.class);
startActivityForResult(intent,1);
}
});
}else {
loginBt.setText("注销");
loginBt.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//弹出对话框与用户交互
new AlertDialog.Builder(MainActivity.this)
.setTitle("登出")
.setMessage("你确定登出此账号吗?")
.setCancelable(false)
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SharedPreferences.Editor editor = getSharedPreferences("userInfo",MODE_PRIVATE).edit();
editor.clear();
editor.apply();
startActivity(new Intent(MainActivity.this,MainActivity.class));
MainActivity.this.finish();
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
})
.show();
}
});
TextView nameinfact=(TextView)findViewById(R.id.nameinfact);
TextView numinfact=(TextView)findViewById(R.id.numinfact);
TextView userNameTv = (TextView) findViewById(R.id.userNameTv);
nameinfact.setEnabled(false);
numinfact.setEnabled(false);
nameinfact.setVisibility(View.INVISIBLE);
numinfact.setVisibility(View.INVISIBLE);
userNameTv.setText(userName);
CircleImageView Head=(CircleImageView)findViewById(R.id.Head);
Head.setVisibility(View.VISIBLE);
mListView.setVisibility(View.VISIBLE);
TextView temptv=(TextView)findViewById(R.id.checkhistory);
temptv.setText("历史记录");
Button RegisterButton=(Button)findViewById(R.id.RegisterButton);
RegisterButton.setText("");
}
}
@Override
protected void onActivityResult(int requestCode,int resultCode,Intent data)
{
IntentResult intentResult = IntentIntegrator.
parseActivityResult(requestCode,resultCode,data);
if (intentResult != null){
if (intentResult.getContents() == null){
Toast.makeText(MainActivity.this,"内容为空",Toast.LENGTH_SHORT).show();
}else {
//Toast.makeText(MainActivity.this,"扫描成功",Toast.LENGTH_SHORT).show();
//ScanResult为获取到的字符串(聊天室地址)
String scanResult = intentResult.getContents();
String[] addresses = scanResult.split("&");
if (System.currentTimeMillis()-Long.parseLong(addresses[1]) < 5000){
webAddress = addresses[0];
//Toast.makeText(MainActivity.this,webAddress,Toast.LENGTH_SHORT).show();
String regex = "(?<=\\bonClass/)\\d+\\b";//匹配出课堂id
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(webAddress);
if (matcher.find()){
classId = Integer.parseInt(matcher.group());
dialogView();
}else {
Toast.makeText(MainActivity.this,"无法进入指定场景",Toast.LENGTH_SHORT).show();
}
/**根据需要对扫描得到的字符串进行操作*/
}else {
Toast.makeText(MainActivity.this,"此二维码已失效,请重新操作",Toast.LENGTH_SHORT).show();
}
}
}else {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==1)
{
if(resultCode==1)
{
}
}
}
}
class MyBaseAdapter extends BaseAdapter
{
@Override
public int getCount()
{
return names.length;
}
@Override
public Object getItem(int position)
{
return names[position];
}
@Override
public long getItemId(int position)
{
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
View view = View.inflate(MainActivity.this,R.layout.list_item,null);
TextView mTextView =(TextView)view.findViewById(R.id.item_lv);
mTextView.setText(names[position]);
return view;
}
}
private int getStatusBarHeight() {
try {
Class<?> c = Class.forName("com.android.internal.R$dimen");
Object obj = c.newInstance();
Field field = c.getField("status_bar_height");
int x = Integer.parseInt(field.get(obj).toString());
return getResources().getDimensionPixelSize(x);
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
public void onClick(View view)
{
MainUI = (DrawerLayout) findViewById(R.id.drawerlayout);
Usermenu=(LinearLayout) findViewById(R.id.Menu);
switch (view.getId())
{
case R.id.CreatClass1:
case R.id.CreatClass2:
{
if (uid.equals("")){
Toast.makeText(MainActivity.this,"无用户信息,请登录",Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MainActivity.this,LoginActivity.class);
startActivity(intent);
}else {
Intent intent=new Intent(MainActivity.this,TeacherOTCActivity.class);
startActivity(intent);
}
break;
}
case R.id.JoinClass1:
case R.id.JoinClass2:
{
//先检查用户信息,判断是否有登录
SharedPreferences pref = getSharedPreferences("userInfo",MODE_PRIVATE);
//uid = pref.getString("uid","");
String userName = pref.getString("userName","");
if (uid.equals("") || userName.equals("")){
//检测不到用户信息,先登录,跳转到登录界面
Toast.makeText(MainActivity.this,"无用户信息,请登录",Toast.LENGTH_SHORT).show();
Intent intent = new Intent(MainActivity.this,LoginActivity.class);
startActivity(intent);
}else {
//加入课堂按钮,扫码登录
customScan();
}
break;
}
case R.id.RegisterButton:
{
Intent intent=new Intent(MainActivity.this,RegisterActivity.class);
startActivity(intent);
break;
}
case R.id.MenuButton:
{
MainUI.openDrawer(Usermenu);
}
}
}
//扫码登录课堂的实现方法
public void customScan(){
if (ContextCompat.checkSelfPermission
(MainActivity.this, Manifest.permission.CAMERA) !=
PackageManager.PERMISSION_GRANTED){
//如果没有权限,动态申请
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.CAMERA},100);
return;
}
new IntentIntegrator(MainActivity.this).setOrientationLocked(false)
.setPrompt("")
.setCaptureActivity(CustomScanActivity.class)
.setBeepEnabled(true)
.initiateScan();//开始扫描
}
//弹出对话框,让用户填写姓名学号
public void dialogView(){
final View joinClassForm = getLayoutInflater().inflate(R.layout.dialog_layout,null);
final EditText nameEdt = joinClassForm.findViewById(R.id.dialog_name_edt);
final EditText studentIdEdt = joinClassForm.findViewById(R.id.dialog_studentId_edt);
new AlertDialog.Builder(this)
.setTitle("扫描成功")
.setView(joinClassForm)
.setPositiveButton("签到", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
//把用户名存储到sharedPreference文件,并清除以前的应用使用时间
new getAppInfo().clearUsedTime(MainActivity.this);//扫码进入课堂前,先记录应用已经使用的时长
SharedPreferences.Editor editor = getSharedPreferences("userInfo",MODE_PRIVATE).edit();
editor.putString("trueName",nameEdt.getText().toString());//将姓名写进文件
editor.putString("schoolId",studentIdEdt.getText().toString());//将学号写进文件
editor.putString("webAddress",webAddress);//将课堂地址写进文件
editor.putInt("classId",classId);//将课堂号写进文件
editor.putLong("enterTime",System.currentTimeMillis()-10*1000);//将进入课堂的时间戳写入用户文件
editor.apply();
//Toast.makeText(MainActivity.this,classId+" IN TEST",Toast.LENGTH_SHORT).show();
//执行登录处理,发送两个信息
MidJoinner midJoinner = new MidJoinner(nameEdt.getText().toString(),studentIdEdt.getText().toString());
String mid = new Gson().toJson(midJoinner);
Joinner joinner = new Joinner(uid,classId,mid);
sendJoinClassHttp(joinner);
}
})
.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
})
.create()
.show();
}
public void sendJoinClassHttp(Joinner joinner){
String url = getResources().getString(R.string.joinClassAddress);//服务器地址
postJson post = new postJson();//创建一个post对象,准备向服务器发送请求
post.postJoinClassHttp(url,joinner).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
final String errorMessage = e.toString();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this,errorMessage,Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onResponse(Call call, Response response) throws IOException {
final String responseMessage = response.body().string();
Log.i("主界面,joinner模块:",responseMessage);
if (responseMessage.equals("successful")){
Intent intent=new Intent(MainActivity.this,StudentOTCActivity.class);
intent.putExtra("address",webAddress);
intent.putExtra("classId",classId);
startActivity(intent);
}else {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(MainActivity.this,"请重新输入信息",Toast.LENGTH_SHORT).show();
}
});
}
}
});
}
//进行动态权限申请后的回调
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 100){
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED){
//获得授权
customScan();
}else {
//被禁止授权
Toast.makeText(MainActivity.this,"拒绝权限将无法扫码加入课堂",Toast.LENGTH_SHORT).show();
}
}
}
}
| [
"1070386906@qq.com"
] | 1070386906@qq.com |
2af2a9cd6d0391b0a2354435acdeb33580b7b2f3 | 40e5ddc046a6459b15a068405f66562d7f79230c | /aiss-final/src/main/java/aiss/model/google/doc/Paragraph_.java | 39333a51a8fe0cb5a604329be7e4da3fd99b19cf | [] | no_license | EnriqueReina/V.E.C | 9a32f2c2a90e9bd4a777608168c0254c92dbfb9e | e323c8b6e93b1852f35a6978e1f69be1774ce651 | refs/heads/master | 2022-06-26T02:27:02.744397 | 2019-05-26T22:02:23 | 2019-05-26T22:02:23 | 174,411,916 | 0 | 0 | null | 2022-06-17T01:56:16 | 2019-03-07T20:02:51 | Java | UTF-8 | Java | false | false | 1,605 | java |
package aiss.model.google.doc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"elements",
"paragraphStyle"
})
public class Paragraph_ {
@JsonProperty("elements")
private List<Element_> elements = null;
@JsonProperty("paragraphStyle")
private ParagraphStyle_ paragraphStyle;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonProperty("elements")
public List<Element_> getElements() {
return elements;
}
@JsonProperty("elements")
public void setElements(List<Element_> elements) {
this.elements = elements;
}
@JsonProperty("paragraphStyle")
public ParagraphStyle_ getParagraphStyle() {
return paragraphStyle;
}
@JsonProperty("paragraphStyle")
public void setParagraphStyle(ParagraphStyle_ paragraphStyle) {
this.paragraphStyle = paragraphStyle;
}
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
| [
"Enrique Reina@192.168.1.39"
] | Enrique Reina@192.168.1.39 |
9c34b9baa680aeadae5100efdb9e137a5faac44c | 9ff564bf89558b1c029fe843a3e386f9c17e25e2 | /tax-calculator/tax-service/src/main/java/com/zhijiang/tax/taxservice/TaxServiceApplication.java | 12e3e77fc235b5a19c9958dd21045356b2d1c86a | [
"Apache-2.0"
] | permissive | steven-xian/grpc-starter | cc1e9f5100c2391522581bb101e473367926a7f1 | 2dec31bcab9169ade7bbcc415ff64c9e409ba733 | refs/heads/master | 2020-04-01T07:17:53.467782 | 2018-10-14T14:54:02 | 2018-10-14T14:54:02 | 152,984,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package com.zhijiang.tax.taxservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@SpringBootApplication
@EnableEurekaClient
public class TaxServiceApplication {
public static void main(String[] args) {
SpringApplication.run(TaxServiceApplication.class, args);
}
}
| [
"4864220@qq.com"
] | 4864220@qq.com |
41979b5075aec9652454d05bd48983082f39752f | 87d729082dcf6b92fa646d209b582ac725a2c770 | /src/ui/BattleOperationPanel.java | 9db7d20ab60eb0ca0a1fb3753b224b31ecf82ebf | [] | no_license | InterstellarNolan/HeroPatton | 0295c5245ba0c868462b508641e56957a95b4b1e | 24afe896191c06cbe942a23e2c0b9f763364bae1 | refs/heads/master | 2020-04-29T16:54:19.279462 | 2019-03-29T09:58:00 | 2019-03-29T09:58:00 | 176,276,214 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,662 | java | package ui;
import controller.OperationController;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
//废弃
public class BattleOperationPanel {
private JPanel btPanel;
private JButton attack;
private JButton skill1;
private JButton skill2;
private JButton skills;
public BattleOperationPanel(){
initializeUI();
}
private void initializeUI(){
// 功能按键初始化
this.attack = new JButton("普通攻击");
this.skill1 = new JButton("技能1");
this.skill2 = new JButton("技能2");
this.skills = new JButton("组合技能");
this.btPanel = new JPanel();
btPanel.setLayout(new GridLayout(3, 5));
btPanel.add(attack);
btPanel.add(skill1);
btPanel.add(skill2);
btPanel.add(skills);
}
public void initializeController(OperationController operationController){
this.attack.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
operationController.attack();
}
});
this.skill1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ArrayList<Integer> skills=new ArrayList<Integer>();
skills.add(0);
operationController.skill(skills);
}
});
this.skill2.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ArrayList<Integer> skills=new ArrayList<Integer>();
skills.add(1);
operationController.skill(skills);
}
});
this.skills.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ArrayList<Integer> skills=new ArrayList<Integer>();
skills.add(0);
skills.add(1);
operationController.skill(skills);
}
});
}
public JPanel getBtPanel(){
return this.btPanel;
}
public void enableButtons(){
this.attack.setEnabled(true);
this.skill1.setEnabled(true);
this.skill2.setEnabled(true);
this.skills.setEnabled(true);
}
public void disableButtons(){
this.attack.setEnabled(false);
this.skill1.setEnabled(false);
this.skill2.setEnabled(false);
this.skills.setEnabled(false);
}
}
| [
"cinro9@gmail.com"
] | cinro9@gmail.com |
9979955a39722f51ad348fef2e9b98410145ed2c | 56afdd1b3ba00c37666483fc1d4c376100d3de13 | /src/frame/common/cells/Cell_67.java | 90598858894cda47b360d2697457f84f7d97a879 | [] | no_license | matsumotosyu/shougi | c77ba6441f62f333b4944696739dc3435bc95684 | f5ab4422afe6b566f7edc53b9d62790c28335f7c | refs/heads/master | 2023-05-14T03:43:19.292472 | 2021-06-11T10:45:26 | 2021-06-11T10:45:26 | 375,991,658 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 180 | java | package frame.common.cells;
import frame.common.symbol.マス;
public class Cell_67 extends マス {
public Cell_67() {
super((byte) 6, (byte) 7);
}
}
| [
"matsumotosyu@intra-mart.jp"
] | matsumotosyu@intra-mart.jp |
726c94bef353f512419ea3f69b7a3f1d089d799d | 7ade59d32a10d1b69ad891e496678297ccb3986d | /woaibianma/src/main/java/com/zbf/woaibianma/mapper/UserMapper.java | f9e220317feeb6100297b83cfa970ea99504404d | [] | no_license | GuoRuiX/woaibianma | ebd9959922d6bf3fe2916e43c3d05d1964d37e50 | c9d50241e910bd6a739e2437ee4a7a74f0b0fa82 | refs/heads/master | 2020-04-25T15:18:47.557606 | 2019-02-27T12:01:26 | 2019-02-27T12:01:26 | 172,874,359 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 751 | java | package com.zbf.woaibianma.mapper;
import com.zbf.woaibianma.core.entity.Page;
import com.zbf.woaibianma.entity.User;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface UserMapper{
public User getByUserName(String loginName);
public int saveAddUser(Map<String, Object> map);
/**
* return 0 if fail
*/
int insert(User entity);
/*int singleBatchInsert(List<T> entitys);*/
/*int delete(T entity);*/
int delete(Long id);
/*int batchDelete(List<Long> ids);*/
int update(User entity);
/*int batchSaveOrUpdate(List<T> entities);*/
User get(Long id);
List<User> findPage(Page<User> page);
}
| [
"709077507@qq.com"
] | 709077507@qq.com |
0bb8be859b1fa83fca7fea763430f2483ca479fe | ab93497aad6018484cf8e31ad08c0910435761f5 | /test/dbtest/workbench/db/mssql/SqlServerDropTest.java | de6c6ba13f1d477a150cd7a52ea92fef6e9e665a | [] | no_license | anieruddha/sqlworkbench | 33ca0289d4bb5e613853f74e9a96e5dc3900c717 | 058a44b0de0194732f68c52cc0815a9b27ec57e3 | refs/heads/master | 2020-08-05T21:05:16.706354 | 2019-10-06T01:32:18 | 2019-10-06T01:32:18 | 212,709,628 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,170 | java | /*
* SqlServerDropTest.java
*
* This file is part of SQL Workbench/J, https://www.sql-workbench.eu
*
* Copyright 2002-2019, Thomas Kellerer
*
* Licensed under a modified Apache License, Version 2.0
* that restricts the use for certain governments.
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at.
*
* https://www.sql-workbench.eu/manual/license.html
*
* 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.
*
* To contact the author please send an email to: support@sql-workbench.eu
*
*/
package workbench.db.mssql;
import java.sql.SQLException;
import java.util.Collections;
import java.util.List;
import workbench.TestUtil;
import workbench.WbTestCase;
import workbench.interfaces.ObjectDropper;
import workbench.db.GenericObjectDropper;
import workbench.db.IndexDefinition;
import workbench.db.TableIdentifier;
import workbench.db.WbConnection;
import workbench.sql.parser.ParserType;
import workbench.sql.parser.ScriptParser;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Thomas Kellerer
*/
public class SqlServerDropTest
extends WbTestCase
{
public SqlServerDropTest()
{
super("SqlServerDropTest");
}
@BeforeClass
public static void setUpClass()
throws Exception
{
SQLServerTestUtil.initTestcase("SqlServerDropTest");
WbConnection conn = SQLServerTestUtil.getSQLServerConnection();
Assume.assumeNotNull("No connection available", conn);
SQLServerTestUtil.dropAllObjects(conn);
String sql =
"create table foo \n" +
"( \n" +
" id integer, \n" +
" some_data varchar(100) \n" +
");\n" +
"create index idx_foo_1 on foo (id); \n"+
"create index idx_foo_2 on foo (some_data); \n" +
"commit";
TestUtil.executeScript(conn, sql);
}
@AfterClass
public static void tearDownClass()
throws Exception
{
WbConnection conn = SQLServerTestUtil.getSQLServerConnection();
Assume.assumeNotNull("No connection available", conn);
SQLServerTestUtil.dropAllObjects(conn);
}
@Test
public void testTableDrop()
throws SQLException
{
WbConnection conn = SQLServerTestUtil.getSQLServerConnection();
assertNotNull("No connection available", conn);
TableIdentifier tbl = conn.getMetadata().findTable(new TableIdentifier("foo"));
assertNotNull(tbl);
ObjectDropper dropper = new GenericObjectDropper();
dropper.setConnection(conn);
dropper.setObjects(Collections.singletonList(tbl));
CharSequence sql = dropper.getScript();
ScriptParser p = new ScriptParser(sql.toString(), ParserType.SqlServer);
assertEquals(2, p.getSize());
String drop = p.getCommand(0);
//System.out.println(drop);
assertEquals("IF OBJECT_ID('dbo.foo', 'U') IS NOT NULL DROP TABLE dbo.foo", drop);
drop = p.getCommand(1);
assertEquals("COMMIT", drop);
}
@Test
public void testIndexDrop()
throws SQLException
{
WbConnection conn = SQLServerTestUtil.getSQLServerConnection();
assertNotNull("No connection available", conn);
TableIdentifier tbl = conn.getMetadata().findTable(new TableIdentifier("foo"));
assertNotNull(tbl);
List<IndexDefinition> indexes = conn.getMetadata().getIndexReader().getTableIndexList(tbl, false);
assertNotNull(indexes);
assertEquals(2, indexes.size());
ObjectDropper dropper = new GenericObjectDropper();
dropper.setConnection(conn);
dropper.setObjects(indexes);
dropper.setObjectTable(tbl);
CharSequence sql = dropper.getScript();
ScriptParser p = new ScriptParser(sql.toString(), ParserType.SqlServer);
assertEquals(3, p.getSize());
String drop = p.getCommand(0);
assertEquals("DROP INDEX idx_foo_1 ON wb_junit.dbo.foo", drop);
drop = p.getCommand(1);
assertEquals("DROP INDEX idx_foo_2 ON wb_junit.dbo.foo", drop);
drop = p.getCommand(2);
assertEquals("COMMIT", drop);
}
}
| [
"aniruddha.gaikwad@skipthedishes.ca"
] | aniruddha.gaikwad@skipthedishes.ca |
cc1237d9a51139952c806fed2349cf544542a2ed | d4d982b2f6c0933cc01e2269b1a3e96820324c0f | /src/net/gbicc/xbrl/ent/util/CompareUtils.java | e726fb48c44ea9bcffa8e506e1e3b620bddb528d | [] | no_license | gwfxp/xbrlcore | 48a44b633b3546b360cc1669b7b7360c7ab15183 | 065a5b4ac851e29c250507209321b00a7af1b205 | refs/heads/master | 2021-05-27T06:09:57.238535 | 2014-06-06T10:36:08 | 2014-06-06T10:36:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,089 | java | package net.gbicc.xbrl.ent.util;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.gbicc.xbrl.ent.model.InstanceDocument;
import net.gbicc.xbrl.ent.model.ItemElement;
import net.gbicc.xbrl.ent.model.TupleElement;
public class CompareUtils {
@SuppressWarnings("unchecked")
public static Map<String, Integer> compare(byte[] content1, byte[] content2) {
// 结果的map
Map<String, Integer> cr = new HashMap<String, Integer>();
/******** 读取第一份实例文档的内容 ********/
// 读实例文档,获得tupleList,itemList、contexts
InstanceDocument instanceDocument1 = new InstanceDocument();
instanceDocument1 = InstanceUtils.readInstance(content1);
// 普通元素列表
List<ItemElement> itemList1 = instanceDocument1.getItemList();
// TUPLE类型元素列表
List<TupleElement> tupleList1 = instanceDocument1.getTupleList();
/********** 读取第二份份实例文档的内容 **************/
InstanceDocument instanceDocument2 = new InstanceDocument();
instanceDocument2 = InstanceUtils.readInstance(content2);
// 普通元素列表
List<ItemElement> itemList2 = instanceDocument2.getItemList();
// TUPLE类型元素列表
List<TupleElement> tupleList2 = instanceDocument2.getTupleList();
/*******
* 开始比较,使用3个方法来比较,以第一份为准,
*
* 第一份实例文档中不存在的元素,记为增加
*
* 第一份实例文档中存在,而第二份实例文档不存在,记为减少
*
* 第一份实例文档和第二份文档中元素的值不一样的,记为更改
*******/
cr.put("apparedElements",
getNewApparedElements(itemList1, tupleList1, itemList2,
tupleList2).size());
cr.put("noUsedElements",
getNotUsedElements(itemList1, tupleList1, itemList2, tupleList2)
.size());
cr.put("changedElements", getChangedElements(itemList1, itemList2)
.size());
return cr;
}
/**
* 判断第二份实例文档用到的元素是否在第一份实例文档中存在
*
* 不存在的话,则视为新使用的元素
*
* @param listItem1
* 第一份实例文档的item的清单
* @param listTuple1
* 第一份实例文档的tuple的清单
* @param listItem2
* 第二份实例文档的item的清单
* @param listTuple2
* 第二份实例文档的tuple的清单
* @return 元素名称列表
*/
private static List<String> getNewApparedElements(
List<ItemElement> listItem1, List<TupleElement> listTuple1,
List<ItemElement> listItem2, List<TupleElement> listTuple2) {
List<String> appearElements = new ArrayList<String>();
/**** listItem2中的元素在ListItem1中没有,则是新增的元素 ****/
for (ItemElement ie2 : listItem2) {
boolean isExist = false;
for (ItemElement ie1 : listItem1) {
if (ie1.getName().equalsIgnoreCase(ie2.getName())) {
isExist = true;
break;
}
}
if (!isExist) {
appearElements.add(ie2.getName());
}
}
/**** listTuple2中的元素在listTuple1中没有,则是新增的tuple元素 ****/
for (TupleElement te2 : listTuple2) {
boolean isExist = false;
for (TupleElement te1 : listTuple1) {
if (te1.getName().equalsIgnoreCase(te2.getName())) {
isExist = true;
break;
}
}
if (!isExist) {
appearElements.add(te2.getName());
}
}
return appearElements;
}
/**
* 判断第一份实例文档用到的元素是否在第二份实例文档中存在
*
* 不存在的话,则视为这个元素不使用了
*
* @param listItem1
* 第一份实例文档的item的清单
* @param listTuple1
* 第一份实例文档的tuple的清单
* @param listItem2
* 第二份实例文档的item的清单
* @param listTuple2
* 第二份实例文档的tuple的清单
* @return 元素名称列表
*/
private static List<String> getNotUsedElements(List<ItemElement> listItem1,
List<TupleElement> listTuple1, List<ItemElement> listItem2,
List<TupleElement> listTuple2) {
List<String> notUsedElements = new ArrayList<String>();
/**** listItem1中的元素在ListItem2中没有,则是不使用的item元素 ****/
for (ItemElement ie1 : listItem1) {
boolean isExist = false;
for (ItemElement ie2 : listItem2) {
if (ie2.getName().equalsIgnoreCase(ie1.getName())) {
isExist = true;
break;
}
}
if (!isExist) {
notUsedElements.add(ie1.getName());
}
}
/**** listTuple1中的元素在listTuple2中没有,则是不使用的tuple元素 ****/
for (TupleElement te1 : listTuple1) {
boolean isExist = false;
for (TupleElement te2 : listTuple2) {
if (te2.getName().equalsIgnoreCase(te1.getName())) {
isExist = true;
break;
}
}
if (!isExist) {
notUsedElements.add(te1.getName());
}
}
return notUsedElements;
}
/**
* 判断第一份文档中的元素和值 与 第二份实例文档的元素和值 是否相等
*
* 如果不相等,则视为是改变的元素,计入列表
*
* @param listItem1
* 第一份实例文档的item的清单
* @param listItem2
* 第二份实例文档的item的清单
* @return 元素名称列表
*/
private static List<String> getChangedElements(List<ItemElement> listItem1,
List<ItemElement> listItem2) {
List<String> changedElements = new ArrayList<String>();
for (ItemElement ie1 : listItem1) {
boolean isExist = false;
for (ItemElement ie2 : listItem2) {
if (ie2.getName().equalsIgnoreCase(ie1.getName())
&& ie2.getContextRef().equalsIgnoreCase(
ie1.getContextRef())
&& ie2.getValue().equalsIgnoreCase(ie1.getValue())) {
isExist = true;
break;
}
}
if (!isExist) {
changedElements.add(ie1.getName());
}
}
return changedElements;
}
}
| [
"joe.phoenix@gmail.com"
] | joe.phoenix@gmail.com |
44030a749d7c1ca7bac8ee1ba368168987eaa2a9 | f20d186484223e57ae7f46e3f39f74d7021752ee | /BHH/src/main/java/com/android/baihuahu/act_3/MeAttendanceActivity.java | fdbbd1ae5a29897a9a5abf70c58496d1b8711445 | [] | no_license | dylan2021/bhh | 1f56d1d0b0ea297f590ee0975c403d75a5198cea | 288f50e4bc58a02699712329c7d2d1f8939a78e8 | refs/heads/master | 2022-12-25T16:17:37.535932 | 2020-09-30T08:00:28 | 2020-09-30T08:00:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,913 | java | package com.android.baihuahu.act_3;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.android.baihuahu.App;
import com.android.baihuahu.R;
import com.android.baihuahu.act_other.BaseFgActivity;
import com.android.baihuahu.bean.EmplyeeAttendInfo;
import com.android.baihuahu.core.net.GsonRequest;
import com.android.baihuahu.core.utils.Constant;
import com.android.baihuahu.core.utils.KeyConst;
import com.android.baihuahu.core.utils.NetUtil;
import com.android.baihuahu.util.DialogUtils;
import com.android.baihuahu.util.TimeUtils;
import com.android.baihuahu.util.ToastUtil;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.google.gson.reflect.TypeToken;
import com.jzxiang.pickerview.TimePickerDialog;
import com.jzxiang.pickerview.listener.OnDateSetListener;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
/**
* Dylan
* <p>
* 我的考勤
*/
public class MeAttendanceActivity extends BaseFgActivity {
private MeAttendanceActivity context;
private TextView monthSeletedTv;
private LinearLayout itemLayout;
private String yyyymm;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initStatusBar();
setContentView(R.layout.activity_me_attendance);
context = this;
initTitleBackBt("我的考勤");
initView();
getData(yyyymm);
}
private void getData(String yyyymm) {
if (!NetUtil.isNetworkConnected(context)) {
return;
}
String url = Constant.WEB_SITE + "/biz/attend/app/attendStatistics" +
"?attendCycle=" + yyyymm;
Response.Listener<EmplyeeAttendInfo> successListener = new Response
.Listener<EmplyeeAttendInfo>() {
@Override
public void onResponse(EmplyeeAttendInfo info) {
if (info == null) {
ToastUtil.show(context, getString(R.string.no_data));
return;
}
}
};
Request<EmplyeeAttendInfo> versionRequest = new
GsonRequest<EmplyeeAttendInfo>(Request.Method.GET, url,
successListener, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
}
}, new TypeToken<EmplyeeAttendInfo>() {
}.getType()) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> params = new HashMap<>();
params.put(KeyConst.Authorization, KeyConst.Bearer + App.token);
return params;
}
};
App.requestQueue.add(versionRequest);
}
private void addItem(String title, String value) {
View itemView = View.inflate(context, R.layout.item_month_wage_emplyee_detail, null);
TextView keyTv = (TextView) itemView.findViewById(R.id.item_key_tv);
TextView valueTv = (TextView) itemView.findViewById(R.id.item_value_tv);
keyTv.setText(title);
valueTv.setText(value);
itemLayout.addView(itemView);
}
private void initView() {
itemLayout = (LinearLayout) findViewById(R.id.item_layout);
monthSeletedTv = findViewById(R.id.me_month_seleted_tv);
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, -1); //得到前一个月
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;//月份加一天
yyyymm = year + (month < 10 ? "0" + month : "" + month);
final String yyyy_mm = year + (month < 10 ? "-0" + month : "-" + month);
monthSeletedTv.setText(yyyy_mm);
monthSeletedTv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TimePickerDialog.Builder monthPicker = DialogUtils.getMonthPicker(context);
monthPicker.setCallBack(new OnDateSetListener() {
@Override
public void onDateSet(TimePickerDialog timePickerView, long millseconds) {
yyyymm = TimeUtils.getTimeYM(millseconds);
monthSeletedTv.setText(yyyymm);
//重新请求数据
getData(yyyymm.replace("-", ""));
}
});
monthPicker.build().show(context.getSupportFragmentManager(), "");
}
});
}
} | [
"157308001@qq.com"
] | 157308001@qq.com |
20a94e2cebbdf31c1cb5d9f611a64da7ec5c6a10 | e094ea6bae8d4598242d723907a2b37b46d74469 | /data-repo-test-project/src/main/java/com/komponente/project/TestObject.java | 371772b7fdd3889af8cf88c197bdbb73015b24a0 | [] | no_license | Aleksa172/softverske-komponente-asmiiatl | 74822ebf72cf56f9841d9b55447eea874008f7ed | 8e55462ec58866598c25379b806546b1741e6f60 | refs/heads/master | 2023-01-14T17:36:17.026739 | 2020-11-11T21:22:26 | 2020-11-11T21:22:26 | 310,130,604 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | package com.komponente.project;
import java.util.UUID;
public class TestObject {
private String id;
private String property1;
private String property2;
public TestObject() {
}
public TestObject(String property1, String property2) {
this.id = UUID.randomUUID().toString();
this.property1 = property1;
this.property2 = property2;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getProperty1() {
return property1;
}
public void setProperty1(String property1) {
this.property1 = property1;
}
public String getProperty2() {
return property2;
}
public void setProperty2(String property2) {
this.property2 = property2;
}
@Override
public String toString() {
return "TestObject [id=" + id + ", property1=" + property1 + ", property2=" + property2 + "]";
}
}
| [
"aleksa.smi1997@gmail.com"
] | aleksa.smi1997@gmail.com |
3fab751023524322a3005d16ef236f234a50b10f | 9747660a6535e63cd04c1cb892e62e97be6315e4 | /shield/shield-snowflake/src/main/java/com/skyline/shield/snowflake/client/Serial.java | 190c2041ea97b1600af44850d9a630e2b94cb6cf | [] | no_license | HousemMark/mavel | aa188e5a8e23a60c50df8fdd829129616b369265 | affb377659706a776c6c159988b742b41063e219 | refs/heads/master | 2023-07-13T15:08:33.469653 | 2021-08-09T09:59:18 | 2021-08-09T09:59:18 | 328,332,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 505 | java | package com.skyline.shield.snowflake.client;
import com.skyline.shield.snowflake.enums.SnowFlakeEntityEnum;
import com.skyline.shield.snowflake.exception.SnowFlakeException;
public interface Serial {
Long getLongSerialNum() throws SnowFlakeException;
Long getLongSerialNum(SnowFlakeEntityEnum entityEnum) throws SnowFlakeException;
String getStringSerialNum() throws SnowFlakeException;
String getStringSerialNum(SnowFlakeEntityEnum snowFlakeEntityEnum) throws SnowFlakeException;
}
| [
"893923042@qq.com"
] | 893923042@qq.com |
1c4174a84beae8810e0e11e73d4ff5dc6b4bfd03 | 7e4192d0354b805a9f3021420223d5de861f6efe | /task2_1/src/Devices/lamp.java | f59d144802d20b974af821c2a5b9e70d576c0fd3 | [] | no_license | EkaterinaMoskaleva/secondHomeTask | 10b1d049d3f5f52c06a1cf05624d4428c66151a1 | 6535ef3c39e0362e26bfd659715229aced543534 | refs/heads/master | 2021-08-07T18:21:14.873442 | 2017-11-08T18:02:27 | 2017-11-08T18:02:27 | 110,010,702 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 594 | java | package Devices;
import Devices.device;
import java.util.*;
public class lamp extends device implements device.Pluggable {
public lamp(float vol, float amp, float len, String color) { super(vol, amp, len, color); }
public void on() {
System.out.println(this.getName() + ":on");
}
public void off() {
System.out.println(this.getName() + ":off");
}
public void plug() {
System.out.println(this.getName() + ":plug");
}
public String getName() {
return "Lamp";
}
}
| [
"mirallissaa@gmail.com"
] | mirallissaa@gmail.com |
e4c2d9b30aae9cd65e1124e9dcb425256c657088 | a5a85a0bbb9393e745c5ae990e13118036cbc283 | /search/SquareRootUsingBinarySearch.java | bc0c6ab7e986842d99f307d8fe8d9273771272bb | [] | no_license | aayush03/GeeksForGeeks | 2940050c492914602f320539bed721921910aad9 | d555ee5dd22618da33114cbdd14ed98314d8ddeb | refs/heads/master | 2022-09-11T06:23:42.330768 | 2019-06-03T18:54:56 | 2019-06-03T18:54:56 | 190,063,964 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 557 | java | package search;
public class SquareRootUsingBinarySearch {
public static void main(String[] args) {
int n = 63;
System.out.println("SquareRoot of " + n + " is " + squareRoot(n, 1, n / 2));
}
static int squareRoot(int n, int left, int right) {
int mid = left + (right - left) / 2;
if (mid * mid == n || (mid * mid < n && (mid + 1) * (mid + 1) > n))
return mid;
if (mid * mid < n)
return squareRoot(n, mid + 1, right);
else return squareRoot(n, left, mid - 1);
}
}
| [
"aayushsrivastava03@gmail.com"
] | aayushsrivastava03@gmail.com |
065e4a7e0f6e6cf045eaf03a04420c099c8540bc | eaa2371d7969c774d4fc62ca3c8134f01f0cfdd0 | /src/wizard/engine/ecs/systems/BehaviorSystem.java | d3b8b7e935b77ac719c75988b0323c26bb43e91a | [] | no_license | OmniTracker/CSCI1950Final | afbb8f4ca7df8ad7150b22357102e7edc3094607 | 60c6e76b66d206ec1246b02d4a483155935ea49e | refs/heads/master | 2022-03-18T09:33:13.125204 | 2019-12-14T03:23:51 | 2019-12-14T03:23:51 | 220,904,862 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 797 | java | package wizard.engine.ecs.systems;
import wizard.engine.ecs.component.BehaviorComponent;
import engine.Application;
import engine.GameWorld;
import engine.systems.Systems;
public class BehaviorSystem extends Systems {
private BehaviorComponent _behaviorComponent = null;
public BehaviorSystem(Application app, GameWorld gameWorld) {
super(app, gameWorld);
this.setSystemName("Behavior");
this.setBehaviorComponent(new BehaviorComponent(app, gameWorld) );
}
public void onTick(long nanosSincePreviousTick) {
this.getBehaviorComponent().onTick(nanosSincePreviousTick);
}
private BehaviorComponent getBehaviorComponent() {
return _behaviorComponent;
}
private void setBehaviorComponent(BehaviorComponent _behaviorComponent) {
this._behaviorComponent = _behaviorComponent;
}
}
| [
"rbaker2@cs.brown.edu"
] | rbaker2@cs.brown.edu |
ff7be55d30698a650d7e8d8298699df86b4016ba | 2059469ff543b4014f7dd13cee03f89f6257f7c5 | /Fuentes/src/main/java/com/dsdsoft/sgp/modelo/dto/PaisDTO.java | 17f337333e8c8e01a874f9f55a21dc25ad895513 | [] | no_license | dpareja1394/SGP | 661dc20039e289cec2b1e93a3cb57d83be037e55 | 5de605c17f9393ef81d17d5f9c140c1182db1773 | refs/heads/master | 2022-12-23T10:44:18.345434 | 2020-01-30T23:37:44 | 2020-01-30T23:37:44 | 62,107,880 | 1 | 0 | null | 2022-12-16T05:24:42 | 2016-06-28T03:40:00 | Java | UTF-8 | Java | false | false | 809 | java | package com.dsdsoft.sgp.modelo.dto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Serializable;
import java.sql.*;
import java.util.Date;
/**
*
* @author Zathura Code Generator http://zathuracode.org/
* www.zathuracode.org
*
*/
public class PaisDTO implements Serializable {
private static final long serialVersionUID = 1L;
private static final Logger log = LoggerFactory.getLogger(PaisDTO.class);
private String nombrePais;
private Integer paisId;
public String getNombrePais() {
return nombrePais;
}
public void setNombrePais(String nombrePais) {
this.nombrePais = nombrePais;
}
public Integer getPaisId() {
return paisId;
}
public void setPaisId(Integer paisId) {
this.paisId = paisId;
}
}
| [
"daniel@daniel-VPCCA37FL"
] | daniel@daniel-VPCCA37FL |
c6d0bc6c9a71f85101adc0e57a309fc69f3de385 | 4f708763b2f8621c23cd0e102b675ca67e3040d2 | /spring-rabbitmq-consumer-feature_toggle/src/main/java/com/github/lucianosantanabr/domain/entity/FeatureFlag.java | 8c4cd245dfbbaeae909e4147dec421aa6a2e2729 | [] | no_license | lucianosantanabr/spring-rabbitmq | 043fa92355e5a057c3c9e6205991c1b3e197f036 | a182c1f3677b6cf9d7d6fa8cc160ae0206d4c34c | refs/heads/main | 2023-08-23T16:05:28.199176 | 2021-10-07T14:37:33 | 2021-10-07T14:49:38 | 350,495,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,235 | java | package com.github.lucianosantanabr.domain.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@Builder
@ToString(onlyExplicitlyIncluded = true)
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of = "id")
@Entity
@Table(name = "feature_flag")
public class FeatureFlag implements Serializable {
private static final long serialVersionUID = -2235102061496436052L;
@Id
@Column(name = "feature_flag_id", unique = true, nullable = false, length = 250)
private String id;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_at")
private Date createdAt;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "activated_at")
private Date activatedAt;
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "inactivated_at")
private Date inactivatedAt;
@Column(nullable = false, length = 15)
private Boolean status;
}
| [
"luciano.s.santana@accenture.com"
] | luciano.s.santana@accenture.com |
0f842cfaf365c087ecf8d94550b978dea6ed4a55 | 56a89a62144b3727db1e9454cc9e245e9d74ab8e | /src/View/ImagePanel.java | 5315439bb718ad621ea1c374ea6c348e3939aeb4 | [] | no_license | CedricWillemsEHB/dnd | e05961d02185b0025dbe05a7b38bff828b318113 | 0dbb54d7d017ed953ae2f733a904d76ae6c7c4b5 | refs/heads/master | 2021-04-05T20:52:03.456671 | 2020-08-13T19:08:15 | 2020-08-13T19:08:15 | 248,600,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,402 | java | package View;
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.Label;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class ImagePanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
private BufferedImage image;
private JScrollPane jscrollpane;
private JTextArea textArea;
private Label label;
public ImagePanel() {
//textArea = new JTextArea();
//setLayout(new BorderLayout());
//jscrollpane = new JScrollPane(textArea);
//add(jscrollpane, BorderLayout.CENTER);
}
void setImage(BufferedImage image)
{
this.image = image;
repaint();
}
public void appendText(String string) {
// TODO Auto-generated method stub
textArea.append(string);
}
public void showText() {
}
public void setLabel() {
//remove(jscrollpane);
setLayout(new BorderLayout());
ImageIcon icon = new ImageIcon("D:\\Users\\Capybara\\Pictures\\dnd\\finalImg.png");
JLabel label = new JLabel(icon);
add(new JScrollPane(label), BorderLayout.CENTER,0);
this.setVisible(true);
}
@Override
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
if (image != null)
{
g.drawImage(image, 0, 0, null);
}
}
}
| [
"cedric.willems@student.ehb.be"
] | cedric.willems@student.ehb.be |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.