blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0b69f14b77f39d5d3cb038aa29970b960f402fcb | 984142b31b636f285413296426aa5c46d7e7b726 | /app/src/main/java/com/app/mak/cellular/AgentsList/Page.java | 581ad1b99b1b5be36bb14bef458fd7fdd98ebb6c | [] | no_license | priyankagiri14/mak_cellular | c02eb00c3ff532b47fb4a6380c0f9d8a36dd3769 | a5d85cc6c7e7a6a4a9b1a89a6415f2ffc2aa018d | refs/heads/master | 2020-09-25T14:08:36.655883 | 2020-02-18T11:53:53 | 2020-02-18T11:53:53 | 226,019,832 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,406 | java | package com.app.mak.cellular.AgentsList;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
class Page {
@SerializedName("numberOfElements")
@Expose
private Integer numberOfElements;
@SerializedName("totalElements")
@Expose
private Integer totalElements;
@SerializedName("totalPages")
@Expose
private Integer totalPages;
@SerializedName("size")
@Expose
private Integer size;
@SerializedName("pageNumber")
@Expose
private Integer pageNumber;
public Integer getNumberOfElements() {
return numberOfElements;
}
public void setNumberOfElements(Integer numberOfElements) {
this.numberOfElements = numberOfElements;
}
public Integer getTotalElements() {
return totalElements;
}
public void setTotalElements(Integer totalElements) {
this.totalElements = totalElements;
}
public Integer getTotalPages() {
return totalPages;
}
public void setTotalPages(Integer totalPages) {
this.totalPages = totalPages;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public Integer getPageNumber() {
return pageNumber;
}
public void setPageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
}
}
| [
"priyanka@ontrackis.com"
] | priyanka@ontrackis.com |
230db138bcd8183d11d5d4f144cc35aa1312c79e | 97f7b0634ec16248b3c636be9fe0e6ce6035bd67 | /src/main/java/com/github/steveash/guavate/ObjIntPair.java | 998e4e213cfff8713fe940c4a156e444f674ce92 | [
"Apache-2.0"
] | permissive | steveash/guavate | 0cca8f6479c65e41eb1a72c19a159f0ec5e80ea8 | 29f77327e378a0da93c1ab05137f8b02afdba3fd | refs/heads/master | 2021-01-20T20:28:03.568036 | 2017-01-13T00:02:01 | 2017-01-13T00:02:01 | 62,578,877 | 8 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,533 | java | /**
* Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.github.steveash.guavate;
import java.io.Serializable;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.base.Preconditions;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.ImmutableList;
/**
* An immutable pair consisting of an {@code Object} and an {@code int}.
* <p>
* This class is similar to {@link Pair} but includes a primitive element.
* <p>
* This class is immutable and thread-safe.
*
* @param <A> the type of the object
*/
public final class ObjIntPair<A> implements Comparable<ObjIntPair<A>>, Serializable {
/**
* The first element in this pair.
*/
private final A first;
/**
* The second element in this pair.
*/
private final int second;
//-------------------------------------------------------------------------
/**
* Obtains an instance from an {@code Object} and an {@code int}.
*
* @param <A> the first element type
* @param first the first element
* @param second the second element
* @return a pair formed from the two parameters
*/
public static <A> ObjIntPair<A> of(A first, int second) {
return new ObjIntPair<>(first, second);
}
/**
* Obtains an instance from a {@code Pair}.
*
* @param <A> the first element type
* @param pair the pair to convert
* @return a pair formed by extracting values from the pair
*/
public static <A> ObjIntPair<A> ofPair(Pair<A, Integer> pair) {
Preconditions.checkNotNull(pair, "pair");
return new ObjIntPair<A>(pair.getLeft(), pair.getRight());
}
/**
* Gets the elements from this pair as a list.
* <p>
* The list returns each element in the pair in order.
*
* @return the elements as an immutable list
*/
public ImmutableList<Object> elements() {
return ImmutableList.of(first, second);
}
//-------------------------------------------------------------------------
/**
* Converts this pair to an object-based {@code Pair}.
*
* @return the object-based pair
*/
public Pair<A, Integer> toPair() {
return Pair.of(first, second);
}
//-------------------------------------------------------------------------
/**
* Compares the pair based on the first element followed by the second element.
* <p>
* The first element must be {@code Comparable}.
*
* @param other the other pair
* @return negative if this is less, zero if equal, positive if greater
* @throws ClassCastException if the object is not comparable
*/
@Override
public int compareTo(ObjIntPair<A> other) {
return ComparisonChain.start()
.compare((Comparable<?>) first, (Comparable<?>) other.first)
.compare(second, other.second)
.result();
}
//-------------------------------------------------------------------------
/**
* Gets the pair using a standard string format.
* <p>
* The standard format is '[$first, $second]'. Spaces around the values are trimmed.
*
* @return the pair as a string
*/
@Override
public String toString() {
return new StringBuilder()
.append('[')
.append(first)
.append(", ")
.append(second)
.append(']')
.toString();
}
/**
* The serialization version id.
*/
private static final long serialVersionUID = 1L;
private ObjIntPair(
A first,
int second) {
this.first = first;
this.second = second;
}
//-----------------------------------------------------------------------
/**
* Gets the first element in this pair.
* @return the value of the property, not null
*/
public A getFirst() {
return first;
}
//-----------------------------------------------------------------------
/**
* Gets the second element in this pair.
* @return the value of the property
*/
public int getSecond() {
return second;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ObjIntPair<?> that = (ObjIntPair<?>) o;
if (second != that.second) return false;
return first != null ? first.equals(that.first) : that.first == null;
}
@Override
public int hashCode() {
int result = first != null ? first.hashCode() : 0;
result = 31 * result + second;
return result;
}
}
| [
"stevemash@gmail.com"
] | stevemash@gmail.com |
5bf1e88051905c35cc5be09e0eb29c016a31ae2d | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes4.dex_source_from_JADX/com/facebook/graphql/deserializers/GraphQLImageDeserializer.java | 177bbf33b8e8db25f4499a2329d2550901f66e33 | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,691 | java | package com.facebook.graphql.deserializers;
import com.facebook.flatbuffers.FlatBufferBuilder;
import com.facebook.flatbuffers.MutableFlatBuffer;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.nio.ByteBuffer;
import java.util.ArrayList;
/* compiled from: refetch_is_prefetch */
public class GraphQLImageDeserializer {
public static int m3908a(JsonParser jsonParser, FlatBufferBuilder flatBufferBuilder) {
int[] iArr = new int[5];
boolean[] zArr = new boolean[3];
int[] iArr2 = new int[2];
double[] dArr = new double[1];
while (jsonParser.c() != JsonToken.END_OBJECT) {
String i = jsonParser.i();
jsonParser.c();
if (!(jsonParser.g() == JsonToken.VALUE_NULL || i == null)) {
if (i.equals("height")) {
zArr[0] = true;
iArr2[0] = jsonParser.E();
} else if (i.equals("name")) {
iArr[1] = flatBufferBuilder.b(jsonParser.o());
} else if (i.equals("scale")) {
zArr[1] = true;
dArr[0] = jsonParser.G();
} else if (i.equals("uri")) {
iArr[3] = flatBufferBuilder.b(jsonParser.o());
} else if (i.equals("width")) {
zArr[2] = true;
iArr2[1] = jsonParser.E();
} else {
jsonParser.f();
}
}
}
flatBufferBuilder.c(5);
if (zArr[0]) {
flatBufferBuilder.a(0, iArr2[0], 0);
}
flatBufferBuilder.b(1, iArr[1]);
if (zArr[1]) {
flatBufferBuilder.a(2, dArr[0], 0.0d);
}
flatBufferBuilder.b(3, iArr[3]);
if (zArr[2]) {
flatBufferBuilder.a(4, iArr2[1], 0);
}
return flatBufferBuilder.d();
}
public static int m3912b(JsonParser jsonParser, FlatBufferBuilder flatBufferBuilder) {
ArrayList arrayList = new ArrayList();
if (jsonParser.g() == JsonToken.START_ARRAY) {
while (jsonParser.c() != JsonToken.END_ARRAY) {
arrayList.add(Integer.valueOf(m3908a(jsonParser, flatBufferBuilder)));
}
}
if (arrayList.isEmpty()) {
return 0;
}
int[] iArr = new int[arrayList.size()];
for (int i = 0; i < arrayList.size(); i++) {
iArr[i] = ((Integer) arrayList.get(i)).intValue();
}
return flatBufferBuilder.a(iArr, true);
}
public static MutableFlatBuffer m3909a(JsonParser jsonParser, short s) {
FlatBufferBuilder flatBufferBuilder = new FlatBufferBuilder(128);
int a = m3908a(jsonParser, flatBufferBuilder);
if (1 != 0) {
flatBufferBuilder.c(2);
flatBufferBuilder.a(0, s, 0);
flatBufferBuilder.b(1, a);
a = flatBufferBuilder.d();
}
flatBufferBuilder.d(a);
ByteBuffer wrap = ByteBuffer.wrap(flatBufferBuilder.e());
wrap.position(0);
MutableFlatBuffer mutableFlatBuffer = new MutableFlatBuffer(wrap, null, null, true, null);
mutableFlatBuffer.a(4, Boolean.valueOf(true));
return mutableFlatBuffer;
}
public static void m3911a(MutableFlatBuffer mutableFlatBuffer, int i, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) {
jsonGenerator.d();
for (int i2 = 0; i2 < mutableFlatBuffer.c(i); i2++) {
m3910a(mutableFlatBuffer, mutableFlatBuffer.m(i, i2), jsonGenerator);
}
jsonGenerator.e();
}
public static void m3910a(MutableFlatBuffer mutableFlatBuffer, int i, JsonGenerator jsonGenerator) {
jsonGenerator.f();
int a = mutableFlatBuffer.a(i, 0, 0);
if (a != 0) {
jsonGenerator.a("height");
jsonGenerator.b(a);
}
if (mutableFlatBuffer.g(i, 1) != 0) {
jsonGenerator.a("name");
jsonGenerator.b(mutableFlatBuffer.c(i, 1));
}
double a2 = mutableFlatBuffer.a(i, 2, 0.0d);
if (a2 != 0.0d) {
jsonGenerator.a("scale");
jsonGenerator.a(a2);
}
if (mutableFlatBuffer.g(i, 3) != 0) {
jsonGenerator.a("uri");
jsonGenerator.b(mutableFlatBuffer.c(i, 3));
}
a = mutableFlatBuffer.a(i, 4, 0);
if (a != 0) {
jsonGenerator.a("width");
jsonGenerator.b(a);
}
jsonGenerator.g();
}
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
2dc9d92dfc31ae98770f2c809ede51a70c10f0b7 | 9938e1ff4f22e5678977992e8b8339ea9f8de0cc | /src/com/homework/Homework004.java | 8fa0d44ef3cd9e64d6fc25e476a5028540f83f6f | [] | no_license | anastasia-sineavscaia/JavaBasicsBatch9 | bce735b5f2fa27d99e544d099f33c572bc2ef80d | 849bf31c8a238460d76939606bc6e4e82196f088 | refs/heads/main | 2023-03-29T03:18:55.163557 | 2021-04-05T21:35:19 | 2021-04-05T21:35:19 | 351,095,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 318 | java | package com.homework;
public class Homework004 {
public static void main(String[] args) {
char a, b;
a = '*';
b = '#';
String c, d, e;
c = "**";
d = "***";
e = "##";
System.out.println(a);
System.out.println(c);
System.out.println(d);
System.out.println(e);
System.out.println(b);
}
}
| [
"anastasia_sineavscaia@yahoo.com"
] | anastasia_sineavscaia@yahoo.com |
2c247c143f49607c29f2ea03f3edd3de86cd0330 | 95c74898b5960d65370a3f2d94b9e3e6de35e1ae | /widget/src/main/java/com/qiwu/widget/cubepage/base/AbsSwipeControlViewPager.java | c1e8538a8b605009815ba1b2669c020945bb59d3 | [] | no_license | chaomitang/CubePager | e1e5e50301401d63b0619b1e174d9627a945ae9a | bd59fb61da0506b3f17d8133eb0208e4b759ff6f | refs/heads/master | 2020-09-27T07:25:35.783785 | 2019-12-07T09:51:55 | 2019-12-07T09:51:55 | 226,463,472 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,246 | java | package com.qiwu.widget.cubepage.base;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import com.qiwu.widget.base.viewpager.SwipeDirection;
import com.qiwu.widget.base.viewpager.ViewPager;
/**
* Author: qi.wu
* Date: 2019-10-31
*/
public abstract class AbsSwipeControlViewPager extends ViewPager {
private float initialXValue;
private SwipeDirection swipeDirection;
private Rect mSwipeForbiddenRect;
public AbsSwipeControlViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setSwipeForbiddenRect(int left, int top, int right, int bottom) {
mSwipeForbiddenRect = new Rect(left, top, right, bottom);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN && mSwipeForbiddenRect != null) {
if (event.getX() <= mSwipeForbiddenRect.right && event.getX() >= mSwipeForbiddenRect.left &&
event.getY() <= mSwipeForbiddenRect.bottom && event.getY() >= mSwipeForbiddenRect.top) {
return false;
}
}
return super.onTouchEvent(event);
}
} | [
"wuqi680@163.com"
] | wuqi680@163.com |
9d968f2861af7c905af939eba1a4e0c7566fde5f | 82fe40b4498945ed6e6432c0c497ce9c61f8b4d6 | /src/main/java/com/hbo/advertiser/documents/Category.java | 4dd966397990d036db3e75dd438718a511ae3bbb | [] | no_license | boualiHoussem/ads-management-application | 4384cd711dea255358718a4bd6c75350ccc9e8e0 | 6d6d0892426a6ff573664e9648182d6e95905d69 | refs/heads/master | 2020-04-12T05:49:22.466540 | 2018-12-18T18:56:32 | 2018-12-18T18:56:32 | 162,332,869 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,501 | java | package com.hbo.advertiser.documents;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.List;
import java.util.Objects;
@Document(collection = "category")
public class Category {
@Id
private Long idCategory;
private String categoryName;
private String description;
private List<Ad> ad;
private List<SubCategory> subCategory;
public Category() {
}
public Long getIdCategory() {
return idCategory;
}
public void setIdCategory(Long idCategory) {
this.idCategory = idCategory;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<Ad> getAd() {
return ad;
}
public void setAd(List<Ad> ad) {
this.ad = ad;
}
public List<SubCategory> getSubCategory() {
return subCategory;
}
public void setSubCategory(List<SubCategory> subCategory) {
this.subCategory = subCategory;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Category category = (Category) o;
return Objects.equals(idCategory, category.idCategory) &&
Objects.equals(categoryName, category.categoryName) &&
Objects.equals(description, category.description) &&
Objects.equals(ad, category.ad) &&
Objects.equals(subCategory, category.subCategory);
}
@Override
public int hashCode() {
return Objects.hash(idCategory, categoryName, description, ad, subCategory);
}
@Override
public String toString() {
ObjectMapper mapper = new ObjectMapper();
String jsonStr = "";
try {
mapper.enable(SerializationFeature.INDENT_OUTPUT);
jsonStr = mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return jsonStr;
}
}
| [
"houssem.bouali@apeiron-tech.com"
] | houssem.bouali@apeiron-tech.com |
cca925e1323f5c2a12054e2dbb981c2dfa4f767d | 56eb3ae460ef6d7e327fe8cf22963f995a63ea67 | /app/src/main/java/fuzik/com/myapplication/fragment_activity_demo/CustomNavigatorActivity.java | 288e828d331bedfc160077ab389bec4e7c7929dc | [] | no_license | LuckyCode1992/hxl123 | 43c8441a7457dff2e7fd60cd5e53d70660cdd2e5 | 630632e22bdb1daec505e54fa180c758369e1643 | refs/heads/master | 2021-05-09T06:54:21.908788 | 2018-03-16T09:32:44 | 2018-03-16T09:32:44 | 119,343,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,670 | java | package fuzik.com.myapplication.fragment_activity_demo;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import java.util.Arrays;
import java.util.List;
import fuzik.com.myapplication.R;
import fuzik.com.myapplication.fragment_activity_demo.fragment_formwork.MagicIndicator;
import fuzik.com.myapplication.fragment_activity_demo.fragment_formwork.ViewPagerHelper;
import fuzik.com.myapplication.fragment_activity_demo.fragment_formwork.buildins.circlenavigator.CircleNavigator;
import fuzik.com.myapplication.fragment_activity_demo.navigator.ScaleCircleNavigator;
public class CustomNavigatorActivity extends AppCompatActivity {
private static final String[] CHANNELS = new String[]{"CUPCAKE", "DONUT", "ECLAIR", "GINGERBREAD", "HONEYCOMB", "ICE_CREAM_SANDWICH", "JELLY_BEAN", "KITKAT", "LOLLIPOP", "M", "NOUGAT"};
private List<String> mDataList = Arrays.asList(CHANNELS);
private ExamplePagerAdapter mExamplePagerAdapter = new ExamplePagerAdapter(mDataList);
private ViewPager mViewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_navigator);
mViewPager = (ViewPager) findViewById(R.id.view_pager);
mViewPager.setAdapter(mExamplePagerAdapter);
initMagicIndicator1();
initMagicIndicator2();
initMagicIndicator3();
}
private void initMagicIndicator1() {
MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator1);
CircleNavigator circleNavigator = new CircleNavigator(this);
circleNavigator.setCircleCount(CHANNELS.length);
circleNavigator.setCircleColor(Color.RED);
circleNavigator.setCircleClickListener(new CircleNavigator.OnCircleClickListener() {
@Override
public void onClick(int index) {
mViewPager.setCurrentItem(index);
}
});
magicIndicator.setNavigator(circleNavigator);
ViewPagerHelper.bind(magicIndicator, mViewPager);
}
private void initMagicIndicator2() {
MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator2);
CircleNavigator circleNavigator = new CircleNavigator(this);
circleNavigator.setFollowTouch(false);
circleNavigator.setCircleCount(CHANNELS.length);
circleNavigator.setCircleColor(Color.RED);
circleNavigator.setCircleClickListener(new CircleNavigator.OnCircleClickListener() {
@Override
public void onClick(int index) {
mViewPager.setCurrentItem(index);
}
});
magicIndicator.setNavigator(circleNavigator);
ViewPagerHelper.bind(magicIndicator, mViewPager);
}
private void initMagicIndicator3() {
MagicIndicator magicIndicator = (MagicIndicator) findViewById(R.id.magic_indicator3);
ScaleCircleNavigator scaleCircleNavigator = new ScaleCircleNavigator(this);
scaleCircleNavigator.setCircleCount(CHANNELS.length);
scaleCircleNavigator.setNormalCircleColor(Color.LTGRAY);
scaleCircleNavigator.setSelectedCircleColor(Color.DKGRAY);
scaleCircleNavigator.setCircleClickListener(new ScaleCircleNavigator.OnCircleClickListener() {
@Override
public void onClick(int index) {
mViewPager.setCurrentItem(index);
}
});
magicIndicator.setNavigator(scaleCircleNavigator);
ViewPagerHelper.bind(magicIndicator, mViewPager);
}
}
| [
"hxl4321"
] | hxl4321 |
51fde2082dcda36f3203135fef9ed595e0ad2743 | 8cda516c22997c54262721c3d3dc85f7c2bc8d47 | /src/main/java/MUN/Factory/DataPoint.java | 372982a32799691d6de2310e17620e283c43c069 | [] | no_license | BenxinNiu/stockopedia-server | 226d06a51588de6c1f8b4252cc2747c50077ea04 | 8587165f4569b8e71fbc8246e68a31d0d9762d17 | refs/heads/master | 2021-05-04T15:35:11.525537 | 2018-04-02T14:36:33 | 2018-04-02T14:36:33 | 120,233,221 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,460 | java | package MUN.Factory;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class DataPoint {
private String date;
private String minute;
private String label;
private double high;
private double low;
private double average;
private double volume;
private double notional;
private double numberOfTrades;
private double marketHigh;
private double marketLow;
private double marketAverage;
private double marketVolume;
private double marketNotional;
private double marketNumberOfTrades;
private double changeOverTime;
private double marketChangeOverTime;
public void setDate(String date) {
this.date = date;
}
public void setMinute(String minute) {
this.minute = minute;
}
public void setLabel(String label) {
this.label = label;
}
public void setHigh(double high) {
this.high = high;
}
public void setLow(double low) {
this.low = low;
}
public void setAverage(double average) {
this.average = average;
}
public void setVolume(double volume) {
this.volume = volume;
}
public void setNotional(double notional) {
this.notional = notional;
}
public void setNumberOfTrades(double numberOfTrades) {
this.numberOfTrades = numberOfTrades;
}
public void setMarketHigh(double marketHigh) {
this.marketHigh = marketHigh;
}
public void setMarketLow(double marketLow) {
this.marketLow = marketLow;
}
public void setMarketAverage(double marketAverage) {
this.marketAverage = marketAverage;
}
public void setMarketVolume(double marketVolume) {
this.marketVolume = marketVolume;
}
public void setMarketNotional(double marketNotional) {
this.marketNotional = marketNotional;
}
public void setMarketNumberOfTrades(double marketNumberOfTrades) {
this.marketNumberOfTrades = marketNumberOfTrades;
}
public void setChangeOverTime(double changeOverTime) {
this.changeOverTime = changeOverTime;
}
public void setMarketChangeOverTime(double marketChangeOverTime) {
this.marketChangeOverTime = marketChangeOverTime;
}
public DataPoint(String date, String minute, String label, double high, double low, double average, double volume, double notional, double numberOfTrades, double marketHigh, double marketLow, double marketAverage, double marketVolume, double marketNotional, double marketNumberOfTrades, double changeOverTime, double marketChangeOverTime) {
this.date = date;
this.minute = minute;
this.label = label;
this.high = high;
this.low = low;
this.average = average;
this.volume = volume;
this.notional = notional;
this.numberOfTrades = numberOfTrades;
this.marketHigh = marketHigh;
this.marketLow = marketLow;
this.marketAverage = marketAverage;
this.marketVolume = marketVolume;
this.marketNotional = marketNotional;
this.marketNumberOfTrades = marketNumberOfTrades;
this.changeOverTime = changeOverTime;
this.marketChangeOverTime = marketChangeOverTime;
}
public DataPoint(){
}
public String getDate() {
return date;
}
public String getMinute() {
return minute;
}
public String getLabel() {
return label;
}
public double getHigh() {
return high;
}
public double getLow() {
return low;
}
public double getAverage() {
return average;
}
public double getVolume() {
return volume;
}
public double getNotional() {
return notional;
}
public double getNumberOfTrades() {
return numberOfTrades;
}
public double getMarketHigh() {
return marketHigh;
}
public double getMarketLow() {
return marketLow;
}
public double getMarketAverage() {
return marketAverage;
}
public double getMarketVolume() {
return marketVolume;
}
public double getMarketNotional() {
return marketNotional;
}
public double getMarketNumberOfTrades() {
return marketNumberOfTrades;
}
public double getChangeOverTime() {
return changeOverTime;
}
public double getMarketChangeOverTime() {
return marketChangeOverTime;
}
}
| [
"benxinniu880808"
] | benxinniu880808 |
3220d7e5ff4586863145f4f74ae4fea388350389 | 566a1992cb01620957ab883827a14a90e8d910a9 | /src/java/br/com/tiago/amado/springmvc/model/Operacao.java | 836beed0583569b95e966c378f034e53b6c45799 | [] | no_license | tiagodurante/spring-mvc-aula02 | 11076418fdd0a2360c278028cc8b1085a467b271 | 756e6896a3c60fd2a908d1764472c36076ead0ba | refs/heads/master | 2021-01-21T18:33:10.384807 | 2017-05-27T15:45:30 | 2017-05-27T15:45:30 | 92,052,669 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,036 | 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.com.tiago.amado.springmvc.model;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
/**
*
* @author tiago
*/
@Entity
public class Operacao implements Serializable{
@Id
private Long id;
private String tipo;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Conta conta;
private String saldoAnterior;
private String valor;
private String saldoAtual;
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Cliente identificador;
public Operacao() {
}
public String getSaldoAtual() {
return saldoAtual;
}
public void setSaldoAtual(String saldoAtual) {
this.saldoAtual = saldoAtual;
}
public Cliente getIdentificador() {
return identificador;
}
public void setIdentificador(Cliente identificador) {
this.identificador = identificador;
}
public Conta getConta() {
return conta;
}
public void setConta(Conta conta) {
this.conta = conta;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTipo() {
return tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public String getSaldoAnterior() {
return saldoAnterior;
}
public void setSaldoAnterior(String saldoAnterior) {
this.saldoAnterior = saldoAnterior;
}
public String getValor() {
return valor;
}
public void setValor(String valor) {
this.valor = valor;
}
}
| [
"Faculdade Alfa@WinMac02"
] | Faculdade Alfa@WinMac02 |
98c5ba03270299e3a49d21ef3c33bfca29917aa3 | 6102a0757d8c73ca3fb4e55dd44db91fb4d38343 | /AllInOne-master/app/src/main/java/practice/myte/com/allinone/BrowseActivity.java | 3e8da71c363b9d2fa3e4476a7c2dc10368bc226e | [] | no_license | SAMAPTY-SAHA/250_project | 878a936fd6fc93384c522474136e211ea524d534 | aad45cfded19f095954ca44ab99f2ed328457f40 | refs/heads/master | 2021-06-25T08:50:51.769560 | 2021-01-15T13:44:40 | 2021-01-15T13:44:40 | 185,013,161 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 343 | java | package practice.myte.com.allinone;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class BrowseActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_browse);
}
}
| [
"samapty14@student.sust.edu"
] | samapty14@student.sust.edu |
fca5ceccab199e7c65bb82de5d6132dd729d42da | 6afc726f36d09fc8ac9ce32d17a22cf05ad5552a | /mall_product/src/main/java/com/yang/mall_product/vo/MemberPrice.java | 7f75885319f16de19457af1377145fe5500d192c | [] | no_license | yang0123456789/dismall | 843fb37c94198657b45b81c80fa141674f99e30b | dfd12609bff15cfc768aaff9af7d545b50258f95 | refs/heads/main | 2023-01-08T10:49:06.761440 | 2020-11-08T12:01:58 | 2020-11-08T12:01:58 | 308,582,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 275 | java | package com.yang.mall_product.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* <p>Title: AttrRespVo</p>
* Description:会员价格
* date:
*/
@Data
public class MemberPrice {
private Long id;
private String name;
private BigDecimal price;
} | [
"378525908@qq.com"
] | 378525908@qq.com |
8787594604319170e2432744b2b612d005ddf5e0 | d103da4ce7fd436bb8a411cefd2194a3fd37053a | /src/test/java/com/diegolirio/bolao/BolaoApplicationTests.java | 446c7e1d81827230efd119fc5666221bd5d66874 | [] | no_license | diegolirio/jbolao | 29b45e52dc11d9a9951dbcd0ca6c7488351c12f1 | f85612180814ba6e2539cc9760f4e4e9ea90c995 | refs/heads/master | 2021-01-10T22:22:20.395864 | 2016-09-27T17:30:37 | 2016-09-27T17:30:37 | 62,684,883 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package com.diegolirio.bolao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class BolaoApplicationTests {
@Test
public void contextLoads() {
}
}
| [
"ddamaceno@dellavolpe.com.br"
] | ddamaceno@dellavolpe.com.br |
56e961ee35bebb8d61d76a2c0b0234dac6c5cbe3 | bd678353695f8f68f5a6776d2e14da7dcaea5cc7 | /src/main/java/IPersistencia.java | 46ead4410f5bb408ee081599148434843ed0afa5 | [] | no_license | lucasdebeterco/persistencia-sms-email | 8433eecfad08dce6cf61fa2f73233c2ec847335d | cd63620d9f6ac19d9feb70f259ab6fb5ac61ba9c | refs/heads/master | 2023-04-07T12:54:30.621285 | 2020-03-13T14:17:40 | 2020-03-13T14:17:40 | 247,086,711 | 0 | 0 | null | 2023-03-27T22:20:43 | 2020-03-13T14:11:34 | Java | UTF-8 | Java | false | false | 85 | java | public interface IPersistencia {
public boolean gravarMensagem(Mensagem msg);
}
| [
"lucasdebeterco@gmail.com"
] | lucasdebeterco@gmail.com |
f45c6da96fc066232fbd8063807cdba3ebfcd840 | a301f3fcadc1f8de1aeac1fec20f835168d27105 | /src/test/java/arbeidskrav/roman/RomanConverter.java | 3e9c241409abe6624602cd93677efe889449d1ce | [] | no_license | jeppemannen/roman | d8df0390b2d6c5c7c98fc4f97b07249fea00b1ca | 804a8b1feea7d61de5297794b451b65dee101eaf | refs/heads/master | 2020-07-20T12:19:44.412531 | 2019-09-10T13:19:31 | 2019-09-10T13:19:31 | 206,639,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 749 | java | package arbeidskrav.roman;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class RomanConverter {
@Test
void shouldReturnIVfor4() {
assertEquals("IV", RunRomanConverter.toRoman(4));
}
@Test
void shouldReturnIXfor9() {
assertEquals("IX", RunRomanConverter.toRoman(9));
}
@Test
void shouldCalculateSimpleDigits() {
assertEquals("MMMDCCCLXXXVIII", RunRomanConverter.toRoman(3888));
}
@Test
void shouldCalculateFourDigits() {
assertEquals("CDXLIV", RunRomanConverter.toRoman(444));
}
@Test
void shouldCalculateNinelikeDigits() {
assertEquals("CMXCIX", RunRomanConverter.toRoman(999));
}
}
| [
"jensemann92@gmail.com"
] | jensemann92@gmail.com |
b05bae72c30eaa295fc360297d19da29b22510f4 | 5beffc697ac5eb90feed6277a9ffe1c97d361315 | /exercicio42.java | 0123e227e04529f52291adff25fdab89fd9a4f2a | [] | no_license | jok1n9/p1 | 538d26575f74c33f54235acefad4f941e3acfb92 | 388c0ad7be6d4adea89cf373bd0fe020b3d3d557 | refs/heads/master | 2020-11-24T09:33:46.286109 | 2019-12-20T17:33:19 | 2019-12-20T17:33:19 | 228,082,019 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 303 | java |
import java.util.Scanner;
public class exercicio42 {
public static void main(String[] args){
Scanner notas= new Scanner(System.in);
int op;
int n=1;
op= notas.nextInt();
while(op>=0){
n = n * op;
op= notas.nextInt();
}
System.out.printf("Números= %d",n);
}
}
| [
"51376771+jok1n9@users.noreply.github.com"
] | 51376771+jok1n9@users.noreply.github.com |
32cb28102c6cf23eec6d8ff5c4cd7d90497a555f | 7e383869011e80af81b12ee13f942b246e136e63 | /project/src/com/iact/vo/AbstractSysmanager.java | 493b53b2106afc5f942f55cb88dff3f74cd26962 | [] | no_license | ryan4fun/iaccct | 5594c03cbff0f3955261c2f4d117612fb9e1e6db | ea69585d78c9a20a844376fc27361656443a3d4b | refs/heads/master | 2020-12-31T04:28:39.646353 | 2012-08-22T10:05:14 | 2012-08-22T10:05:14 | 53,239,169 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,131 | java | package com.iact.vo;
/**
* AbstractSysmanager entity provides the base persistence definition of the
* Sysmanager entity. @author MyEclipse Persistence Tools
*/
public abstract class AbstractSysmanager implements java.io.Serializable {
// Fields
private Long id;
private String login;
private String pwd;
private String name;
private String description;
private Integer roleType;
private String bizCode;
private Integer status;
// Constructors
/** default constructor */
public AbstractSysmanager() {
}
/** minimal constructor */
public AbstractSysmanager(Long id, String login, String pwd,
Integer roleType, Integer status) {
this.id = id;
this.login = login;
this.pwd = pwd;
this.roleType = roleType;
this.status = status;
}
/** full constructor */
public AbstractSysmanager(Long id, String login, String pwd, String name,
String description, Integer roleType, String bizCode, Integer status) {
this.id = id;
this.login = login;
this.pwd = pwd;
this.name = name;
this.description = description;
this.roleType = roleType;
this.bizCode = bizCode;
this.status = status;
}
// Property accessors
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getLogin() {
return this.login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPwd() {
return this.pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getRoleType() {
return this.roleType;
}
public void setRoleType(Integer roleType) {
this.roleType = roleType;
}
public String getBizCode() {
return this.bizCode;
}
public void setBizCode(String bizCode) {
this.bizCode = bizCode;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
} | [
"ryan4fun@gmail.com"
] | ryan4fun@gmail.com |
c6bb8e13c73a8a12d65ba72a85ec3964f4212da1 | 5095c94365c79436e0f1c98a50405ae8e27a89eb | /atomicobjects-gui/src/main/java/net/catchpole/scene/renderer/ModelRenderer.java | 8a6f5fb88c4272a2b99cd730682676f6ffcfacad | [
"Apache-2.0"
] | permissive | slipperyseal/atomicobjects | f5da8a832681550d8efc84d03e6c64b5f7a3bf49 | 212f9d830386fe9947f7770ab673273c007dc88d | refs/heads/slippery | 2023-03-10T18:40:25.499262 | 2023-02-26T01:27:55 | 2023-02-26T01:27:55 | 20,993,244 | 3 | 1 | Apache-2.0 | 2022-06-13T03:48:50 | 2014-06-19T08:25:25 | Java | UTF-8 | Java | false | false | 5,553 | java | package net.catchpole.scene.renderer;
// Copyright 2014 catchpole.net
//
// 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.
import net.catchpole.model.Model;
import net.catchpole.model.ValueModel;
import net.catchpole.scene.Milieu;
import net.catchpole.scene.Renderer;
import net.catchpole.scene.effigy.Effigy;
import net.catchpole.scene.effigy.EffigySource;
import net.catchpole.scene.effigy.ModelEffigySource;
import net.catchpole.scene.overlay.ImageOverlay;
import net.catchpole.scene.overlay.ListOverlay;
import net.catchpole.scene.overlay.OverlayManager;
import net.catchpole.scene.spacial.Coordinate3D;
import net.catchpole.scene.spacial.Position;
import javax.media.opengl.GL;
import javax.media.opengl.GL2;
public class ModelRenderer implements Renderer {
private static final float[] lightPosition = {-45.f, 60.f, 70.0f, 0.f};
private static final float[] lightAmbient = {0.110f, 0.110f, 0.110f, 1.f};
private static final float[] lightDiffuse = {1.0f, 1.0f, 1.0f, 1.f};
private static final float[] materialSpec = {1.0f, 1.0f, 1.0f, 0.0f};
private static final float[] zeroVec4 = {0.0f, 0.0f, 0.0f, 0.f};
private final OverlayManager overlayManager;
private final Model rootModel;
private final EffigySource effigySource = new ModelEffigySource();
private final Coordinate3D zoom = new Coordinate3D(0f, 0f, -100f);
public ModelRenderer(Model model) {
this.rootModel = model;
this.overlayManager = new OverlayManager();
}
public OverlayManager getOverlayManager() {
return overlayManager;
}
public void init(Milieu milieu) {
this.overlayManager.addOverlay(new ListOverlay(rootModel));
this.overlayManager.addOverlay(new ImageOverlay("./test.jpg"));
}
public void resize(Milieu milieu, int width, int height) {
overlayManager.resize(milieu, width, height);
GL2 gl2 = milieu.getGL().getGL2();
float aspect = height != 0 ? (float) width / (float) height : 1.0f;
gl2.glViewport(0, 0, width, height);
gl2.glScissor(0, 0, width, height);
gl2.glMatrixMode(GL2.GL_MODELVIEW);
gl2.glLoadIdentity();
gl2.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, lightPosition, 0);
gl2.glLightfv(GL2.GL_LIGHT0, GL2.GL_AMBIENT, lightAmbient, 0);
gl2.glLightfv(GL2.GL_LIGHT0, GL2.GL_DIFFUSE, lightDiffuse, 0);
gl2.glLightfv(GL2.GL_LIGHT0, GL2.GL_SPECULAR, zeroVec4, 0);
gl2.glMaterialfv(GL.GL_FRONT_AND_BACK, GL2.GL_SPECULAR, materialSpec, 0);
gl2.glEnable(GL2.GL_NORMALIZE);
gl2.glEnable(GL2.GL_LIGHTING);
gl2.glEnable(GL2.GL_LIGHT0);
gl2.glEnable(GL2.GL_COLOR_MATERIAL);
gl2.glEnable(GL.GL_CULL_FACE);
gl2.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_FASTEST);
gl2.glShadeModel(GL2.GL_SMOOTH);
gl2.glDisable(GL.GL_DITHER);
gl2.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY);
gl2.glEnableClientState(GL2.GL_NORMAL_ARRAY);
gl2.glEnableClientState(GL2.GL_COLOR_ARRAY);
gl2.glMatrixMode(GL2.GL_PROJECTION);
gl2.glLoadIdentity();
milieu.getGLU().gluPerspective(50.0f, aspect, 0.5f, 2900.0f);
gl2.glCullFace(GL.GL_BACK);
}
public Coordinate3D getZoom() {
return zoom;
}
public void render(Milieu milieu) {
GL2 gl2 = milieu.getGL().getGL2();
gl2.glClear(GL.GL_COLOR_BUFFER_BIT);
gl2.glMatrixMode(GL2.GL_MODELVIEW);
// single entry ValueModel. render loop will not render the root node
ValueModel valueModel = new ValueModel(null, null);
valueModel.addChild(rootModel);
render(valueModel, milieu, zoom, 0);
overlayManager.render(milieu);
}
private void render(Model model, Milieu milieu, Coordinate3D source, int depth) {
float spin1 = (((milieu.getRenderTime() & 0xffff) * (1.0f / (float) 0xffff))) + (depth * 0.2f) * 360f;
float spin2 = (((milieu.getRenderTime() & 0xfff) * (1.0f / (float) 0xfff))) * 360f;
int count = 0;
for (Model subModel : model) {
count++;
}
int index = 0;
for (Model subModel : model) {
int objectSpacing = (subModel.iterator().hasNext() ? 150 : 100);
float rotation = (((float)Math.PI * 2) / ((float) count) * index++) +
(1.0f * depth); // offset to stop overlap
Coordinate3D target = new Coordinate3D(
source.getX() + (objectSpacing * (float)Math.sin(rotation)),
source.getY() + (objectSpacing * (float)Math.cos(rotation)),
source.getZ());
Effigy effigy = effigySource.getIdiograph(subModel.getType());
effigy.render(milieu, new Position(target, spin1, spin2));
render(subModel, milieu, target, depth + 1);
}
}
public void destory(Milieu milieu) {
effigySource.destroy(milieu);
}
}
| [
"christian@catchpole.net"
] | christian@catchpole.net |
80f97b32df1e4d5dfd5fc3e0292129981b6ddcff | 4ed93a63a84b9f507c17926eeb0a91ed160c4349 | /example-library-api/src/main/java/de/example/library/service/BookService.java | 6b258a3773c6d99d6a258c3ec80ec80936980add | [] | no_license | Rebekka25/Spring | 56384bc1d61dac6d6da1c41cccf222665ab1bae4 | 0a2581c486f67f7f7541fac5b99e3303c70cb2c6 | refs/heads/master | 2022-12-10T11:56:30.110875 | 2020-09-10T07:09:35 | 2020-09-10T07:09:35 | 292,241,054 | 0 | 0 | null | null | null | null | ISO-8859-3 | Java | false | false | 576 | java | package de.example.library.service;
import java.util.List;
import org.springframework.stereotype.Service;
import de.example.library.entity.Book;
import de.example.library.entity.User;
@Service
public interface BookService {
/**
* Gibt eine Liste von Büchern zurück.
* @return
*/
List<Book> getBooks();
/**
* Gibt ein Buch unter der Angabe der Isbn wieder.
* @param isbn
* @return
*/
Book getBookWithIsbn(String isbn);
/**
*
* @param book
* @param user
* @return
*/
boolean borrow(Book book,User user);
}
| [
"rebekkashahfir@gmail.com"
] | rebekkashahfir@gmail.com |
26fa0416c2470304e66c4a5e9f5267bfa18d275a | e4d9f772dd05729cfe0496719d1762048437267c | /mall-product/src/main/java/com/mimehoo/mall/product/dao/SpuCommentDao.java | a400488f9db89515c2fe88c07dfeca4eac543cd5 | [] | no_license | ffmm520/mall | fa176e24de71d746e85839b6922b8effd11d51aa | 23758ba2a2c595283c11d392a5c7306b4dec3ce8 | refs/heads/master | 2023-08-11T02:06:39.194207 | 2021-09-07T07:39:01 | 2021-09-07T07:39:01 | 401,942,939 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 384 | java | package com.mimehoo.mall.product.dao;
import com.mimehoo.mall.product.entity.SpuCommentEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 商品评价
*
* @author baboon
* @email ffmm1220@gmail.com
* @date 2021-09-01 16:46:54
*/
@Mapper
public interface SpuCommentDao extends BaseMapper<SpuCommentEntity> {
}
| [
"ffmm1220@163.com"
] | ffmm1220@163.com |
c7d7eddfe1790ac0747183d68ba24c796e5bcbd0 | dfe30f8de1a2222817e274de2eea9438fbc0faad | /app/build/generated/source/r/debug/android/support/swiperefreshlayout/R.java | c076961dbdc80ff40eaf850182337ed2671f3bc3 | [
"Apache-2.0"
] | permissive | thasneemp/MVVMKotlinBase | ef46b8a49744f8d2149c0ddc9d71978af157d250 | 36c20a7fee6a71a9a3c0a6266d4a577800422027 | refs/heads/master | 2020-03-27T07:52:14.973779 | 2018-09-01T09:57:40 | 2018-09-01T09:57:40 | 146,199,099 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,179 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.swiperefreshlayout;
public final class R {
public static final class attr {
public static final int alpha = 0x7f020027;
public static final int font = 0x7f02007f;
public static final int fontProviderAuthority = 0x7f020081;
public static final int fontProviderCerts = 0x7f020082;
public static final int fontProviderFetchStrategy = 0x7f020083;
public static final int fontProviderFetchTimeout = 0x7f020084;
public static final int fontProviderPackage = 0x7f020085;
public static final int fontProviderQuery = 0x7f020086;
public static final int fontStyle = 0x7f020087;
public static final int fontVariationSettings = 0x7f020088;
public static final int fontWeight = 0x7f020089;
public static final int ttcIndex = 0x7f020145;
}
public static final class color {
public static final int notification_action_color_filter = 0x7f04003f;
public static final int notification_icon_bg_color = 0x7f040040;
public static final int ripple_material_light = 0x7f04004a;
public static final int secondary_text_default_material_light = 0x7f04004c;
}
public static final class dimen {
public static final int compat_button_inset_horizontal_material = 0x7f05004b;
public static final int compat_button_inset_vertical_material = 0x7f05004c;
public static final int compat_button_padding_horizontal_material = 0x7f05004d;
public static final int compat_button_padding_vertical_material = 0x7f05004e;
public static final int compat_control_corner_material = 0x7f05004f;
public static final int compat_notification_large_icon_max_height = 0x7f050050;
public static final int compat_notification_large_icon_max_width = 0x7f050051;
public static final int notification_action_icon_size = 0x7f050061;
public static final int notification_action_text_size = 0x7f050062;
public static final int notification_big_circle_margin = 0x7f050063;
public static final int notification_content_margin_start = 0x7f050064;
public static final int notification_large_icon_height = 0x7f050065;
public static final int notification_large_icon_width = 0x7f050066;
public static final int notification_main_column_padding_top = 0x7f050067;
public static final int notification_media_narrow_margin = 0x7f050068;
public static final int notification_right_icon_size = 0x7f050069;
public static final int notification_right_side_padding_top = 0x7f05006a;
public static final int notification_small_icon_background_padding = 0x7f05006b;
public static final int notification_small_icon_size_as_large = 0x7f05006c;
public static final int notification_subtext_size = 0x7f05006d;
public static final int notification_top_pad = 0x7f05006e;
public static final int notification_top_pad_large_text = 0x7f05006f;
}
public static final class drawable {
public static final int notification_action_background = 0x7f060057;
public static final int notification_bg = 0x7f060058;
public static final int notification_bg_low = 0x7f060059;
public static final int notification_bg_low_normal = 0x7f06005a;
public static final int notification_bg_low_pressed = 0x7f06005b;
public static final int notification_bg_normal = 0x7f06005c;
public static final int notification_bg_normal_pressed = 0x7f06005d;
public static final int notification_icon_background = 0x7f06005e;
public static final int notification_template_icon_bg = 0x7f06005f;
public static final int notification_template_icon_low_bg = 0x7f060060;
public static final int notification_tile_bg = 0x7f060061;
public static final int notify_panel_notification_icon_bg = 0x7f060062;
}
public static final class id {
public static final int action_container = 0x7f07000d;
public static final int action_divider = 0x7f07000f;
public static final int action_image = 0x7f070010;
public static final int action_text = 0x7f070016;
public static final int actions = 0x7f070017;
public static final int async = 0x7f07001d;
public static final int blocking = 0x7f070020;
public static final int chronometer = 0x7f070028;
public static final int forever = 0x7f07003d;
public static final int icon = 0x7f070042;
public static final int icon_group = 0x7f070043;
public static final int info = 0x7f070046;
public static final int italic = 0x7f070048;
public static final int line1 = 0x7f07004b;
public static final int line3 = 0x7f07004c;
public static final int normal = 0x7f070054;
public static final int notification_background = 0x7f070055;
public static final int notification_main_column = 0x7f070056;
public static final int notification_main_column_container = 0x7f070057;
public static final int right_icon = 0x7f070062;
public static final int right_side = 0x7f070063;
public static final int tag_transition_group = 0x7f070083;
public static final int tag_unhandled_key_event_manager = 0x7f070084;
public static final int tag_unhandled_key_listeners = 0x7f070085;
public static final int text = 0x7f070086;
public static final int text2 = 0x7f070087;
public static final int time = 0x7f07008b;
public static final int title = 0x7f07008c;
}
public static final class integer {
public static final int status_bar_notification_info_maxnum = 0x7f080004;
}
public static final class layout {
public static final int notification_action = 0x7f09001d;
public static final int notification_action_tombstone = 0x7f09001e;
public static final int notification_template_custom_big = 0x7f09001f;
public static final int notification_template_icon_group = 0x7f090020;
public static final int notification_template_part_chronometer = 0x7f090021;
public static final int notification_template_part_time = 0x7f090022;
}
public static final class string {
public static final int status_bar_notification_info_overflow = 0x7f0b0029;
}
public static final class style {
public static final int TextAppearance_Compat_Notification = 0x7f0c00ec;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ed;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c00ee;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0c00ef;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0c00f0;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0c0158;
public static final int Widget_Compat_NotificationActionText = 0x7f0c0159;
}
public static final class styleable {
public static final int[] ColorStateListItem = { 0x010101a5, 0x0101031f, 0x7f020027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f020081, 0x7f020082, 0x7f020083, 0x7f020084, 0x7f020085, 0x7f020086 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x01010532, 0x01010533, 0x0101053f, 0x0101056f, 0x01010570, 0x7f02007f, 0x7f020087, 0x7f020088, 0x7f020089, 0x7f020145 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x0101019d, 0x0101019e, 0x010101a1, 0x010101a2, 0x010101a3, 0x010101a4, 0x01010201, 0x0101020b, 0x01010510, 0x01010511, 0x01010512, 0x01010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x010101a5, 0x01010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
| [
"mhdthasneemp@gmail.com"
] | mhdthasneemp@gmail.com |
d6bb39d843314e89eeb69332bcb1c33ac19367f5 | 6b34d4f2a33011bdadfc3b6e4459b5a3be14db44 | /WordArena/client/core/src/com/slamdunk/toolkit/settings/FloatSetting.java | a6c6026131e6343105d3d6bae4231aff8a1ed8b6 | [] | no_license | opack/slamdunk-prototypes | d679961d3bd155a49edd5eec67757726a2f89707 | 0150e7f5f3d10878caf429862343af3430985bf3 | refs/heads/master | 2021-01-12T13:26:55.907928 | 2015-03-15T20:49:58 | 2015-03-15T20:49:58 | 69,169,855 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package com.slamdunk.toolkit.settings;
public class FloatSetting {
private PreferencesManager preferences;
private final String key;
private final float defaultValue;
public FloatSetting(PreferencesManager preferences, String key, float defaultValue) {
this.preferences = preferences;
this.key = key;
this.defaultValue = defaultValue;
}
public void set(float value) {
preferences.putFloat(key, value);
preferences.flush();
}
public float get() {
return preferences.getFloat(key, defaultValue);
}
}
| [
"opack@users.noreply.github.com"
] | opack@users.noreply.github.com |
58cc79f4a717c705a26c00b08d58a1a027250d2c | a65217a7c3371102c670ceea49f180de2d561ce4 | /app/src/main/java/com/sss/myhwmonitorapp/viewmodels/DataViewModel.java | 5e250b8a460fcdab916cf3589b154eaae120d50c | [] | no_license | salauddin23shumon/mySensorApp | 84afcf824263edbe2c04d5daef59750b1d8b5ac7 | 3d2a9c680ede3406f9e237f02f635e4dfbe4a4a3 | refs/heads/master | 2023-03-26T03:11:29.438287 | 2021-03-29T06:09:26 | 2021-03-29T06:09:26 | 352,419,644 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 821 | java | package com.sss.myhwmonitorapp.viewmodels;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.sss.myhwmonitorapp.db.SensorModel;
import com.sss.myhwmonitorapp.repositories.DataRepo;
import com.sss.myhwmonitorapp.repositories.SensorRepo;
import com.sss.myhwmonitorapp.responses.SensorDataResponse;
import java.util.List;
public class DataViewModel extends AndroidViewModel {
private DataRepo dataRepo;
public DataViewModel(@NonNull Application application) {
super(application);
dataRepo = DataRepo.getInstance(application);
}
public LiveData<List<SensorModel>> getAllSensorData() {
return dataRepo.getAllData();
}
}
| [
"salauddin.23shumon.com"
] | salauddin.23shumon.com |
981f6aa5d58dffd48429e2e5cffa335b7033946a | eae55e89a398c0a3f0b589ee5e4c3a36d280a91d | /src/decorator/HelmetDecorator.java | 89ac32595cd71c93ad68d438dadeeeabc2f2ebb7 | [] | no_license | Florgardu/designPattern | 09b02518f121dca7e3feee97ed2574cf6db628d9 | 75129afd655b313b0bf236cc60b7e249bcf3b3e5 | refs/heads/master | 2023-02-28T16:36:14.254810 | 2021-02-16T23:04:07 | 2021-02-16T23:04:07 | 287,552,594 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 304 | java | package decorator;
public class HelmetDecorator extends EnemyDecorator {
public HelmetDecorator(Enemy enemigo) {
super(enemigo);
// TODO Auto-generated constructor stub
}
@Override
public int takeDamage() {
// TODO Auto-generated method stub
return this.enemigo.takeDamage() / 2;
}
}
| [
"garduno.florencia@gmail.com"
] | garduno.florencia@gmail.com |
1c387dfde4a99692852367949627585dd7dfd64a | 79da92f56e78ae2056ea9361566c67a076405713 | /src/com/mdc/enva/DesignPattern/Old/Bridge/RedCircle.java | 82b7a1c65b1a0fe32fbe354eb4f93e9a11c7ca49 | [] | no_license | costeldragu/Java | eafb7be5fed20cc904392a825fe4ef7fb1cb0389 | e2b2dc40863c15685da3d2be45d8df304e083f73 | refs/heads/master | 2021-06-10T12:15:08.010205 | 2021-01-17T20:31:31 | 2021-01-17T20:31:31 | 67,597,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 276 | java | package com.mdc.enva.DesignPattern.Old.Bridge;
public class RedCircle implements DrawAPI {
@Override
public void drawCircle(int radius, int x, int y) {
System.out.println("Drawing Circle[ color: red, radius: " + radius + ", x: " + x + ", " + y + "]");
}
} | [
"costel.dragu@endava.com"
] | costel.dragu@endava.com |
5c7bbe422e7dca0dce62bff70cfe8f5f3590ee4b | b5a060b26216e1f1f633f18bca33d9201378083e | /src/main/java/com/example/making_restaurant/application/service/FileService.java | f8aa213418af43afc601898184940f9b173598d5 | [] | no_license | wuvp2356/making_restaurant | 9bf1c111ad73804f6faec04e70f5bab440458108 | e4a557a7bc114e70d6c75a8c4fdbb92d714ba500 | refs/heads/making_restaurant | 2023-01-02T00:18:09.605917 | 2020-10-01T12:54:41 | 2020-10-01T12:54:41 | 293,083,525 | 0 | 0 | null | 2020-09-20T01:25:25 | 2020-09-05T13:41:04 | Java | UTF-8 | Java | false | false | 3,159 | java | package com.example.making_restaurant.application.service;
import java.util.UUID;
import com.example.making_restaurant.infrastructure.File;
import com.example.making_restaurant.infrastructure.FileRepository;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* メニューのサービスクラス
* ユーザが行いたい操作(いわゆるユースケース)を記述する
* これでSpringMVC + Thymeleafでできる基本的なことは全部
* あとはMVCのMのところ、モデルを作るのが一番重要で大変なところ
* M: Model
* V: View
* C: Controller
* VはThymeleaf, Cはcontroller, Serviceを通してModelを動かす
* thymeleafはhtmlにControllerから受けとったパラメータを埋め込む役割
* よくあるダメな例として、Thymeleafの中に業務ロジックを書く、というのがある。
* thymeleafはControllerからパラメータを受け取って、htmlに埋め込む。
* <div th:text="${message}">この部分がmessageで置き換わるよ!</div>
* でも一応thymeleafにもif文とかがあって、条件によって表示する・しないとかが制御できる
* でもそれを間違って使うと、本来業務として判断するロジックをthymeleafでやってしまって、
* 巨大なhtmlが作り上げられる。
* そうそう、一部機能を使わないとか本当はmodel内で判定すべきことがviewでやれてしまう
* そうなると「業務」の流れがmodel内だけじゃなく、viewも見に行かないと分からなくなるから、
* 死ぬ。
* あとthymeleaf見てわかる通りjavaじゃないから、参照関係で追うことも難しい。
* どうしてもviewとmodelの形が合わない場合はdto(data transfer object)や
* view modelを使う。
* 業務ロジックは絶対にmodelの中に閉じ込めないといけない。
* 障害や改修のときもそうだけど、システム移行のときもmodelがあるかどうかでかなり違う。
* コストでいうと多分数十倍ぐらい変わる。
* というわけで、商品の新規登録、一覧表示の機能を画面も合わせて実装してみて。
* 画面から新規登録するときはhtmlのformっていうのを使うと、楽にPOSTできるよ。
* 多分PHPでやってたから分かると思う。
* あ、あとgit push ってできる?
*/
@Service
public class FileService {
private final FileRepository fileRepository;
public FileService(FileRepository fileRepository) {
this.fileRepository = fileRepository;
}
/**
* メニューを全検索する
*/
public List<File> findAll() {
return (List)fileRepository.findAll();
}
/**
* メニューを新しく作る
*/
public File create(String name,String startdate,String enddate) {
final File file = new File();
file.setUuId(UUID.randomUUID());
file.setName(name);
file.setStartdate(startdate);
file.setEnddate(enddate);
return fileRepository.save(file);
}
} | [
"roleplaying1995@gmail.com"
] | roleplaying1995@gmail.com |
3ef61de33cf64946824309233b664c61e8c240f5 | cd1d792fa7caad7b14755fb53063323ee2097f59 | /src/io/renren/controller/SysLoginController.java | 70357532b0811c8331c81f98d609eff66c6e6938 | [] | no_license | zhouqing0428/CAHGAdmin | 383fe179f11b090b066596654c41ee8271e69920 | f08df7a18a65bb352396ba01e644c62c5f7de507 | refs/heads/master | 2020-09-09T08:21:43.783274 | 2019-12-19T09:31:08 | 2019-12-19T09:31:08 | 221,397,758 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,132 | java | package io.renren.controller;
import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.crypto.hash.Sha256Hash;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.google.code.kaptcha.Constants;
import com.google.code.kaptcha.Producer;
import io.renren.utils.R;
import io.renren.utils.ShiroUtils;
/**
* 登录相关
*
* @author
* @email
* @date
*/
@Controller
public class SysLoginController {
@Autowired
private Producer producer;
@RequestMapping("captcha.jpg")
public void captcha(HttpServletResponse response)throws ServletException, IOException {
response.setHeader("Cache-Control", "no-store, no-cache");
response.setContentType("image/jpeg");
//生成文字验证码
String text = producer.createText();
//生成图片验证码
BufferedImage image = producer.createImage(text);
//保存到shiro session
ShiroUtils.setSessionAttribute(Constants.KAPTCHA_SESSION_KEY, text);
ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out);
}
/**
* 登录
*/
@ResponseBody
@RequestMapping(value = "/sys/login", method = RequestMethod.POST)
public R login(String username, String password, String captcha)throws IOException {
// String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY);
// if(!captcha.equalsIgnoreCase(kaptcha)){
// return R.error("验证码不正确");
// }
try{
Subject subject = ShiroUtils.getSubject();
//sha256加密
password = new Sha256Hash(password).toHex();
UsernamePasswordToken token = new UsernamePasswordToken(username, password);
subject.login(token); //subject.login()调用这样的时候,就会调doGetAuthenticationInfo方法
}catch (UnknownAccountException e) {
return R.error(e.getMessage());
}catch (IncorrectCredentialsException e) {
return R.error(e.getMessage());
}catch (LockedAccountException e) {
return R.error(e.getMessage());
}catch (AuthenticationException e) {
return R.error("账户验证失败");
}
return R.ok();
}
/**
* 退出
*/
@RequestMapping(value = "logout", method = RequestMethod.GET)
public String logout() {
ShiroUtils.logout();
return "redirect:login.html";
}
}
| [
"qingqing_zhou@yeah.net"
] | qingqing_zhou@yeah.net |
ba5e80a927d112ef6154a4197981837419b4ce26 | f5e869f0369b42833f09c0e99d64b7950876479a | /com/assignment/MinHeap.java | 8b864f6ec6e5b02b5035888fc6bb89bfa97feece | [] | no_license | chaandchopra/MinimumSpanningTree | 518dfd8b1b67cf6ca8cc0e43e5ddc5639f0dd826 | 2ca88d7249c3ee6bec0175c09a14507e65331e7c | refs/heads/master | 2020-05-02T16:59:55.300284 | 2019-03-29T20:06:23 | 2019-03-29T20:06:23 | 178,085,371 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,389 | java | //MinHeap
package com.assignment;
import java.util.*;
import java.lang.*;
/**
* Write a description of class Heap here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MinHeap
{
// instance variables - replace the example below with your own
private Node [] myHeap;
private int capacity;
private int size;
/**
* Constructor for objects of class Heap
*/
public MinHeap(int capacity)
{
this.myHeap = new Node[capacity];
this.size = 0;
this.capacity = capacity;
}
public MinHeap(Node list[])
{
// initialise instance variables
this.myHeap = new Node[list.length];
this.myHeap = list;
this.capacity = list.length;
this.size = list.length;
}
private int lchild(int i){
return 2*i;
}
private int rchild(int i){
return 2*i+1;
}
private int parent(int i){
return i/2;
}
public void Heapify(int i)
{
int l = lchild(i);
//int size = this.myHeap.length;
int r = rchild(i);
int smallest = i;
//System.out.println("smallest "+ smallest + " l " + l + " r "+ r );
if(l < size && this.myHeap[l].getWeight() <= this.myHeap[i].getWeight())
smallest = l;
else
smallest = i;
if(r < size && this.myHeap[r].getWeight() <= this.myHeap[smallest].getWeight())
smallest = r;
//System.out.println("after comparing -smallest "+ smallest + " l " + l + " r "+ r );
if(smallest != i)
{
Node temp = this.myHeap[i];
this.myHeap[i] = this.myHeap[smallest];
this.myHeap[smallest] = temp;
Heapify(smallest);
}
}
public void BuildHeap()
{
int n = this.myHeap.length;
int value = (int)Math.floor(n/2)-1;
for(int i = value; i >= 0; --i)
{
Heapify(i);
}
}
public Node extractMin()
{
//System.out.println("emin size " + size);
if(this.size == 0){
System.out.println("Heap Underflow");
return null;
}
Node r = myHeap[0];
myHeap[0] = myHeap[this.size - 1];
myHeap[this.size - 1] = r;
this.size--;
Heapify(0);
return r;
}
public void addElement(Node n)
{
//System.out.println
if(this.size == this.capacity)
{
System.out.println("Overflow");
return;
}
myHeap[this.size] = n;
int current = this.size;
this.size++;
//System.out.println("MinHeap size "+this.size);
while (myHeap[current].getWeight() < myHeap[parent(current)].getWeight()) {
//swap(current, parent(current));
Node temp = myHeap[current];
myHeap[current] = myHeap[parent(current)];
myHeap[parent(current)] = temp;
current = parent(current);
}
}
public void HeapSort()
{
BuildHeap();
int n = this.myHeap.length, k = n;
while(k >= 0)
{
Heapify(k);
k--;
}
}
public String toString()
{
String s = "";
for(Node n : myHeap)
{
s = s + n + " ";
}
return s;
}
}
| [
"mridulgain@gmail.com"
] | mridulgain@gmail.com |
077202f807556dfcd710fc7cf910b7c6f93eb365 | 7060b864e2b1e87d066a42c29a69abaf6fa9a417 | /app/src/main/java/com/norah1to/simplenotification/ViewModel/TagViewModel.java | 29aa83144b7d71899d7d28756c111a3e6b5ff2fe | [
"BSD-2-Clause"
] | permissive | NoraH1to/newSimpleNotification | cb4ed5aec66048945bcf5c47ac3dbbff1112a8cd | 503bb4f4e832e905e6e43a192b05833c1b1f425e | refs/heads/master | 2022-12-21T06:03:24.368213 | 2019-12-06T15:44:08 | 2019-12-06T15:44:08 | 221,650,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,360 | java | package com.norah1to.simplenotification.ViewModel;
import android.app.Application;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import com.norah1to.simplenotification.Entity.Tag;
import com.norah1to.simplenotification.Repository.TagRepository;
import java.util.List;
public class TagViewModel extends AndroidViewModel {
private TagRepository mRepository;
private LiveData<List<Tag>> mAllTags;
public TagViewModel(Application application) {
super(application);
mRepository = new TagRepository(application);
mAllTags = mRepository.getmAllTags();
}
// 全部 tag
public LiveData<List<Tag>> getmAllTags() {
return mAllTags;
}
// 插入一条
public void insert(Tag tag) {
mRepository.insert(tag);
}
// 删除一条
public int delete(Tag tag) {
return mRepository.deleteTag(tag);
}
// 根据内容删掉一条
public int deleteByName(String name) {
return mRepository.deleteTagByName(name);
}
// 根据内容查找一条
public Tag getTagByName(String name) {
return mRepository.getTagByName(name);
}
// 根据 tagID 拿到一条
public Tag getTag(String tagID) {
return mRepository.getTag(tagID);
}
}
| [
"834053207@qq.com"
] | 834053207@qq.com |
867b2595e476a24ee7e6e7fcc6b5b2596a5e3fee | 7983412de76ffe9158b1fa21ec5d7a2d1617cad0 | /src/main/java/com/zhangyue/mybatispluslearning/config/DataSourceConfig.java | 9ce4dd69bb021d166fa0f62002fbe4cbc2e6f736 | [] | no_license | zhangyue950425/mybatispluslearning | 1d9f58081ce8ae945fd1de2af15050fde7c0abd8 | 2317bb8d746cc28da71b2505b46cf1ca4bbebcdf | refs/heads/master | 2023-05-12T01:20:17.031987 | 2019-04-03T12:08:54 | 2019-04-03T12:08:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,370 | java | /*
* Copyright (c) 2011-2019, hubin (jobob@qq.com).
* <p>
* 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
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.zhangyue.mybatispluslearning.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.toolkit.ExceptionUtils;
import com.zhangyue.mybatispluslearning.config.converts.*;
import com.zhangyue.mybatispluslearning.config.querys.*;
import lombok.Data;
import lombok.experimental.Accessors;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
* 数据库配置
*
* @author YangHu
* @since 2016/8/30
*/
@Data
@Accessors(chain = true)
public class DataSourceConfig {
/**
* 数据库信息查询
*/
private IDbQuery dbQuery;
/**
* 数据库类型
*/
private DbType dbType;
/**
* PostgreSQL schemaName
*/
private String schemaName;
/**
* 类型转换
*/
private ITypeConvert typeConvert;
/**
* 驱动连接的URL
*/
private String url;
/**
* 驱动名称
*/
private String driverName;
/**
* 数据库连接用户名
*/
private String username;
/**
* 数据库连接密码
*/
private String password;
public IDbQuery getDbQuery() {
if (null == dbQuery) {
switch (getDbType()) {
case ORACLE:
dbQuery = new OracleQuery();
break;
case SQL_SERVER:
dbQuery = new SqlServerQuery();
break;
case POSTGRE_SQL:
dbQuery = new PostgreSqlQuery();
break;
case DB2:
dbQuery = new DB2Query();
break;
case MARIADB:
dbQuery = new MariadbQuery();
break;
case H2:
dbQuery = new H2Query();
break;
default:
// 默认 MYSQL
dbQuery = new MySqlQuery();
break;
}
}
return dbQuery;
}
/**
* 判断数据库类型
*
* @return 类型枚举值
*/
public DbType getDbType() {
if (null == this.dbType) {
this.dbType = this.getDbType(this.driverName);
if (null == this.dbType) {
this.dbType = this.getDbType(this.url.toLowerCase());
if (null == this.dbType) {
throw ExceptionUtils.mpe("Unknown type of database!");
}
}
}
return this.dbType;
}
/**
* 判断数据库类型
*
* @param str 用于寻找特征的字符串,可以是 driverName 或小写后的 url
* @return 类型枚举值,如果没找到,则返回 null
*/
private DbType getDbType(String str) {
if (str.contains("mysql")) {
return DbType.MYSQL;
} else if (str.contains("oracle")) {
return DbType.ORACLE;
} else if (str.contains("postgresql")) {
return DbType.POSTGRE_SQL;
} else if (str.contains("sqlserver")) {
return DbType.SQL_SERVER;
} else if (str.contains("db2")) {
return DbType.DB2;
} else if (str.contains("mariadb")) {
return DbType.MARIADB;
} else if (str.contains("h2")) {
return DbType.H2;
} else {
return null;
}
}
public ITypeConvert getTypeConvert() {
if (null == typeConvert) {
switch (getDbType()) {
case ORACLE:
typeConvert = new OracleTypeConvert();
break;
case SQL_SERVER:
typeConvert = new SqlServerTypeConvert();
break;
case POSTGRE_SQL:
typeConvert = new PostgreSqlTypeConvert();
break;
case DB2:
typeConvert = new DB2TypeConvert();
break;
case MARIADB:
typeConvert = new MySqlTypeConvert();
break;
default:
// 默认 MYSQL
typeConvert = new MySqlTypeConvert();
break;
}
}
return typeConvert;
}
/**
* 创建数据库连接对象
*
* @return Connection
*/
public Connection getConn() {
Connection conn = null;
try {
Class.forName(driverName);
conn = DriverManager.getConnection(url, username, password);
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return conn;
}
}
| [
"zy090631@163.com"
] | zy090631@163.com |
7e302de1c6355581a541a909386459e01a69c9ab | d4f7f00b2ba06f4e63f098b671aa0e7826beaeb5 | /src/main/java/com/falana/awaf/context/controls/RateLimit.java | e84f60ef2e25c10b9c858822acfb7b121e9170dd | [] | no_license | falanadamian/awaf | a2357b8f4d19802df7b736d1c894dd5f11353f84 | d6998976b05b5d218340690cf09bd334b4c0b996 | refs/heads/master | 2022-07-14T19:52:34.416463 | 2020-05-17T14:17:23 | 2020-05-17T14:17:23 | 264,683,418 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package com.falana.awaf.context.controls;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
public class RateLimit {
private List<IPSecThroughput> ipSecThroughputs = new ArrayList<>();
private List<String> whitelist = new ArrayList<>();
}
| [
"falanadamian@gmail.com"
] | falanadamian@gmail.com |
45b65859c16f66516065ae25d244d6f0ae01b5bd | 99939d907d431109d2f1c5f5e2c043ba5278b707 | /app/libs/PdfBox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java | 3c8fc5f67fba3af3f43aff8eb99013cc9ccc80d6 | [] | no_license | pancosances/PTPrinter | 61ddfcafda809123db95c97ae3c47a9ba4f0d5f5 | ada10ab857f605829d5c53f9a5255798411807b5 | refs/heads/master | 2021-07-13T04:09:54.718922 | 2017-10-17T21:29:43 | 2017-10-17T21:29:43 | 106,248,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,361 | java | package org.apache.pdfbox.pdmodel;
import org.apache.pdfbox.cos.COSArray;
import org.apache.pdfbox.cos.COSBase;
import org.apache.pdfbox.cos.COSDictionary;
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.COSStream;
import org.apache.pdfbox.pdmodel.common.COSArrayList;
import org.apache.pdfbox.pdmodel.common.COSObjectable;
import org.apache.pdfbox.pdmodel.common.PDDestinationOrAction;
import org.apache.pdfbox.pdmodel.common.PDMetadata;
import org.apache.pdfbox.pdmodel.common.PDPageLabels;
import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDMarkInfo;
import org.apache.pdfbox.pdmodel.documentinterchange.logicalstructure.PDStructureTreeRoot;
import org.apache.pdfbox.pdmodel.graphics.color.PDOutputIntent;
import org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties;
import org.apache.pdfbox.pdmodel.interactive.action.PDActionFactory;
import org.apache.pdfbox.pdmodel.interactive.action.PDDocumentCatalogAdditionalActions;
import org.apache.pdfbox.pdmodel.interactive.action.PDURIDictionary;
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination;
import org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDDocumentOutline;
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;
import org.apache.pdfbox.pdmodel.interactive.pagenavigation.PDThread;
import org.apache.pdfbox.pdmodel.interactive.viewerpreferences.PDViewerPreferences;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* The Document Catalog of a PDF.
*
* @author Ben Litchfield
*/
public class PDDocumentCatalog implements COSObjectable
{
private final COSDictionary root;
private final PDDocument document;
private PDAcroForm cachedAcroForm;
/**
* Constructor. Acroform.
*
* @param doc The document that this catalog is part of.
*/
public PDDocumentCatalog(PDDocument doc)
{
document = doc;
root = new COSDictionary();
root.setItem(COSName.TYPE, COSName.CATALOG);
document.getDocument().getTrailer().setItem(COSName.ROOT, root);
}
/**
* Constructor.
*
* @param doc The document that this catalog is part of.
* @param rootDictionary The root dictionary that this object wraps.
*/
public PDDocumentCatalog(PDDocument doc, COSDictionary rootDictionary)
{
document = doc;
root = rootDictionary;
}
/**
* Convert this standard java object to a COS object.
*
* @return The cos object that matches this Java object.
*/
public COSDictionary getCOSObject()
{
return root;
}
/**
* Get the documents AcroForm. This will return null if no AcroForm is part of the document.
*
* @return The documents acroform.
*/
public PDAcroForm getAcroForm()
{
if(cachedAcroForm == null)
{
COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.ACRO_FORM);
cachedAcroForm = dict == null ? null : new PDAcroForm(document, dict);
}
return cachedAcroForm;
}
/**
* Sets the Acroform for this catalog.
*
* @param acroForm The new Acroform.
*/
public void setAcroForm(PDAcroForm acroForm)
{
root.setItem(COSName.ACRO_FORM, acroForm);
cachedAcroForm = null;
}
/**
* Returns all pages in the document, as a page tree.
*/
public PDPageTree getPages()
{
// TODO cache me?
return new PDPageTree((COSDictionary)root.getDictionaryObject(COSName.PAGES));
}
/**
* Get the viewer preferences associated with this document or null if they do not exist.
*
* @return The document's viewer preferences.
*/
public PDViewerPreferences getViewerPreferences()
{
COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.VIEWER_PREFERENCES);
return dict == null ? null : new PDViewerPreferences(dict);
}
/**
* Sets the viewer preferences.
*
* @param prefs The new viewer preferences.
*/
public void setViewerPreferences(PDViewerPreferences prefs)
{
root.setItem(COSName.VIEWER_PREFERENCES, prefs);
}
/**
* Get the outline associated with this document or null if it does not exist.
*
* @return The document's outline.
*/
public PDDocumentOutline getDocumentOutline()
{
COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.OUTLINES);
return dict == null ? null : new PDDocumentOutline(dict);
}
/**
* Sets the document outlines.
*
* @param outlines The new document outlines.
*/
public void setDocumentOutline(PDDocumentOutline outlines)
{
root.setItem(COSName.OUTLINES, outlines);
}
/**
* Returns the document's article threads.
*/
public List<PDThread> getThreads()
{
COSArray array = (COSArray)root.getDictionaryObject(COSName.THREADS);
if(array == null)
{
array = new COSArray();
root.setItem(COSName.THREADS, array);
}
List<PDThread> pdObjects = new ArrayList<PDThread>();
for(int i = 0; i < array.size(); i++)
{
pdObjects.add(new PDThread((COSDictionary)array.getObject(i)));
}
return new COSArrayList<PDThread>(pdObjects, array);
}
/**
* Sets the list of threads for this pdf document.
*
* @param threads The list of threads, or null to clear it.
*/
public void setThreads(List threads)
{
root.setItem( COSName.THREADS, COSArrayList.converterToCOSArray(threads));
}
/**
* Get the metadata that is part of the document catalog. This will return null if there is no
* meta data for this object.
*
* @return The metadata for this object.
*/
public PDMetadata getMetadata()
{
COSBase metaObj = root.getDictionaryObject(COSName.METADATA);
if(metaObj instanceof COSStream)
{
return new PDMetadata((COSStream) metaObj);
}
return null;
}
/**
* Sets the metadata for this object. This can be null.
*
* @param meta The meta data for this object.
*/
public void setMetadata(PDMetadata meta)
{
root.setItem(COSName.METADATA, meta);
}
/**
* Sets the Document Open Action for this object.
*
* @param action The action you want to perform.
*/
public void setOpenAction(PDDestinationOrAction action)
{
root.setItem(COSName.OPEN_ACTION, action);
}
/**
* Get the Document Open Action for this object.
*
* @return The action to perform when the document is opened.
*
* @throws IOException If there is an error creating the destination or action.
*/
public PDDestinationOrAction getOpenAction() throws IOException
{
COSBase openAction = root.getDictionaryObject(COSName.OPEN_ACTION);
if(openAction == null)
{
return null;
}
else if(openAction instanceof COSDictionary)
{
return PDActionFactory.createAction((COSDictionary)openAction);
}
else if(openAction instanceof COSArray)
{
return PDDestination.create(openAction);
}
else
{
throw new IOException("Unknown OpenAction " + openAction);
}
}
/**
* @return The Additional Actions for this Document
*/
public PDDocumentCatalogAdditionalActions getActions()
{
COSDictionary addAction = (COSDictionary) root.getDictionaryObject(COSName.AA);
if (addAction == null)
{
addAction = new COSDictionary();
root.setItem(COSName.AA, addAction);
}
return new PDDocumentCatalogAdditionalActions(addAction);
}
/**
* Sets the additional actions for the document.
*
* @param actions The actions that are associated with this document.
*/
public void setActions(PDDocumentCatalogAdditionalActions actions)
{
root.setItem(COSName.AA, actions);
}
/**
* @return The names dictionary for this document or null if none exist.
*/
public PDDocumentNameDictionary getNames()
{
COSDictionary names = (COSDictionary) root.getDictionaryObject(COSName.NAMES);
return names == null ? null : new PDDocumentNameDictionary(this, names);
}
/**
* Sets the names dictionary for the document.
*
* @param names The names dictionary that is associated with this document.
*/
public void setNames(PDDocumentNameDictionary names)
{
root.setItem(COSName.NAMES, names);
}
/**
* Get info about doc's usage of tagged features. This will return null if there is no
* information.
*
* @return The new mark info.
*/
public PDMarkInfo getMarkInfo()
{
COSDictionary dic = (COSDictionary)root.getDictionaryObject(COSName.MARK_INFO);
return dic == null ? null : new PDMarkInfo(dic);
}
/**
* Sets information about the doc's usage of tagged features.
*
* @param markInfo The new MarkInfo data.
*/
public void setMarkInfo(PDMarkInfo markInfo)
{
root.setItem(COSName.MARK_INFO, markInfo);
}
/**
* Get the list of OutputIntents defined in the document.
*
* @return The list of PDOutputIntent
*/
public List<PDOutputIntent> getOutputIntents ()
{
List<PDOutputIntent> retval = new ArrayList<PDOutputIntent>();
COSArray array = (COSArray)root.getDictionaryObject(COSName.OUTPUT_INTENTS);
if (array != null)
{
for (COSBase cosBase : array)
{
PDOutputIntent oi = new PDOutputIntent((COSDictionary)cosBase);
retval.add(oi);
}
}
return retval;
}
/**
* Add an OutputIntent to the list. If there is not OutputIntent, the list is created and the
* first element added.
*
* @param outputIntent the OutputIntent to add.
*/
public void addOutputIntent(PDOutputIntent outputIntent)
{
COSArray array = (COSArray)root.getDictionaryObject(COSName.OUTPUT_INTENTS);
if (array == null)
{
array = new COSArray();
root.setItem(COSName.OUTPUT_INTENTS, array);
}
array.add(outputIntent.getCOSObject());
}
/**
* Replace the list of OutputIntents of the document.
*
* @param outputIntents the list of OutputIntents, if the list is empty all OutputIntents are
* removed.
*/
public void setOutputIntents(List<PDOutputIntent> outputIntents)
{
COSArray array = new COSArray();
for (PDOutputIntent intent : outputIntents)
{
array.add(intent.getCOSObject());
}
root.setItem(COSName.OUTPUT_INTENTS, array);
}
/**
* Returns the page display mode.
*/
public PageMode getPageMode()
{
String mode = root.getNameAsString(COSName.PAGE_MODE);
if (mode != null)
{
return PageMode.fromString(mode);
}
else
{
return PageMode.USE_NONE;
}
}
/**
* Sets the page mode.
*
* @param mode The new page mode.
*/
public void setPageMode(PageMode mode)
{
root.setName(COSName.PAGE_MODE, mode.stringValue());
}
/**
* Returns the page layout.
*/
public PageLayout getPageLayout()
{
String mode = root.getNameAsString(COSName.PAGE_LAYOUT);
if (mode != null)
{
return PageLayout.fromString(mode);
}
else
{
return PageLayout.SINGLE_PAGE;
}
}
/**
* Sets the page layout.
*
* @param layout The new page layout.
*/
public void setPageLayout(PageLayout layout)
{
root.setName(COSName.PAGE_LAYOUT, layout.stringValue());
}
/**
* Returns the document-level URI.
*/
public PDURIDictionary getURI()
{
COSDictionary uri = (COSDictionary)root.getDictionaryObject(COSName.URI);
return uri == null ? null : new PDURIDictionary(uri);
}
/**
* Sets the document level uri.
*
* @param uri The new document level uri.
*/
public void setURI(PDURIDictionary uri)
{
root.setItem(COSName.URI, uri);
}
/**
* Get the document's structure tree root, or null if none exists.
*/
public PDStructureTreeRoot getStructureTreeRoot()
{
COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.STRUCT_TREE_ROOT);
return dict == null ? null : new PDStructureTreeRoot(dict);
}
/**
* Sets the document's structure tree root.
*
* @param treeRoot The new structure tree.
*/
public void setStructureTreeRoot(PDStructureTreeRoot treeRoot)
{
root.setItem(COSName.STRUCT_TREE_ROOT, treeRoot);
}
/**
* Returns the language for the document, or null.
*/
public String getLanguage()
{
return root.getString(COSName.LANG);
}
/**
* Sets the Language for the document.
*
* @param language The new document language.
*/
public void setLanguage(String language)
{
root.setString(COSName.LANG, language);
}
/**
* Returns the PDF specification version this document conforms to.
*
* @return the PDF version (e.g. "1.4")
*/
public String getVersion()
{
return root.getNameAsString(COSName.VERSION);
}
/**
* Sets the PDF specification version this document conforms to.
*
* @param version the PDF version (e.g. "1.4")
*/
public void setVersion(String version)
{
root.setName(COSName.VERSION, version);
}
/**
* Returns the page labels descriptor of the document.
*
* @return the page labels descriptor of the document.
* @throws IOException If there is a problem retrieving the page labels.
*/
public PDPageLabels getPageLabels() throws IOException
{
COSDictionary dict = (COSDictionary) root.getDictionaryObject(COSName.PAGE_LABELS);
return dict == null ? null : new PDPageLabels(document, dict);
}
/**
* Sets the page label descriptor for the document.
*
* @param labels the new page label descriptor to set.
*/
public void setPageLabels(PDPageLabels labels)
{
root.setItem(COSName.PAGE_LABELS, labels);
}
/**
* Get the optional content properties dictionary associated with this document.
*
* @return the optional properties dictionary or null if it is not present
* @since PDF 1.5
*/
public PDOptionalContentProperties getOCProperties()
{
COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.OCPROPERTIES);
return dict == null ? null : new PDOptionalContentProperties(dict);
}
/**
* Sets the optional content properties dictionary.
*
* @param ocProperties the optional properties dictionary
* @since PDF 1.5
*/
public void setOCProperties(PDOptionalContentProperties ocProperties)
{
root.setItem(COSName.OCPROPERTIES, ocProperties);
// optional content groups require PDF 1.5
if (ocProperties != null && document.getVersion() < 1.5)
{
document.setVersion(1.5f);
}
}
} | [
"mpancisi@Mareks-MacBook-Air.local"
] | mpancisi@Mareks-MacBook-Air.local |
a479780e00e10f77497894e0c2b84f0553374415 | 6ce17c44a2c20fd315f9c0c901d79787ec427b6e | /applicationSprint2/app/build/generated/source/buildConfig/debug/com/foxes/capstone/BuildConfig.java | f612e789cc6a47c4c511e96ab3e86737afdfc6a2 | [] | no_license | foxes/test4time | 39f904ba30cf096fbed4d330f2610d314630e565 | a4aa0d281ba4519588f63a367a01b02d05f913d6 | refs/heads/master | 2021-01-11T11:01:26.627450 | 2017-09-19T18:31:07 | 2017-09-19T18:31:07 | 78,816,894 | 0 | 3 | null | 2017-04-21T01:31:41 | 2017-01-13T05:01:40 | Java | UTF-8 | Java | false | false | 443 | java | /**
* Automatically generated file. DO NOT MODIFY
*/
package com.foxes.capstone;
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "com.foxes.capstone";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
| [
"buncha@mail.gvsu.edu"
] | buncha@mail.gvsu.edu |
0f03371a82d4117c19ba812fcf81dac55b9550c2 | 8d675bb2bc914fcee1ad2b60b14878448679767b | /MeLi/app/src/main/java/com/mercadolibre/puboe/meli/fragments/SearchResultsFragment.java | 003079844d0a323d9e1d5982bb15169a26a6a6dd | [] | no_license | puboe/android-training | 19a75c58ab2813ebd69cc5bee2439645952e0add | 06bc862e5fe63c9a39cec3e160e6ecf05c546dcb | refs/heads/master | 2021-01-18T21:14:28.919732 | 2016-04-14T17:56:17 | 2016-04-14T17:56:17 | 21,427,936 | 2 | 0 | null | 2014-07-29T17:21:34 | 2014-07-02T14:44:47 | Java | UTF-8 | Java | false | false | 6,068 | java | package com.mercadolibre.puboe.meli.fragments;
import android.app.Activity;
import android.app.ListFragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.ListView;
import com.mercadolibre.puboe.meli.R;
import com.mercadolibre.puboe.meli.SearchAdapter;
import com.mercadolibre.puboe.meli.model.Item;
import com.mercadolibre.puboe.meli.model.Search;
/**
* Activities that contain this fragment must implement the
* {@link SearchResultsFragment.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link SearchResultsFragment#newInstance} factory method to
* create an instance of this fragment.
*
*/
public class SearchResultsFragment extends ListFragment {
public static final String KEY_DATA = "key_data";
private SearchAdapter adapter;
private ListView listView;
private View mainView;
private OnFragmentInteractionListener mListener;
public static SearchResultsFragment newInstance() {
SearchResultsFragment fragment = new SearchResultsFragment();
return fragment;
}
public SearchResultsFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Log.i("SearchResultsFragemnt", "onCreateView");
mainView = inflater.inflate(R.layout.fragment_search_results, container, false);
return mainView;
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
listView = (ListView) mainView.findViewById(android.R.id.list);
listView.setOnScrollListener(new mOnScrollListener());
Log.i("SearchResultsFragemnt", "onViewCreated with saved state: " + (savedInstanceState != null) + " and searchObject: " + (mListener.getSearchObjectFromActivity() != null) + " and adapter: " + (adapter != null));
// System.out.println("Not first: " + savedInstanceState.getBoolean("not_first"));
if(savedInstanceState != null && savedInstanceState.getBoolean("not_first")) {
Search search = mListener.getSearchObjectFromActivity();
if(search != null) {
showResults(search);
}
}
}
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
Log.i(SearchResultsFragment.class.getSimpleName(), "onAttach");
try {
mListener = (OnFragmentInteractionListener) activity;
} catch (ClassCastException e) {
throw new ClassCastException(activity.toString()
+ " must implement OnFragmentInteractionListener");
}
}
@Override
public void onDetach() {
super.onDetach();
Log.i("SearchResultsFragment", "dettaching fragment");
mListener = null;
listView = null;
adapter = null;
mainView = null;
}
@Override
public void onStart() {
super.onStart();
// When in two-pane layout, set the listview to highlight the selected list item
// (We do this during onStart because at the point the listview is available.)
if (getFragmentManager().findFragmentById(R.id.list_frame) != null) {
Log.i(SearchResultsFragment.class.getSimpleName(), "Setting CHOICE MODE");
getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}
}
@Override
public void onSaveInstanceState(Bundle outState) {
Log.i("SearchResultsFragment", "onSaveInstanceState");
outState.putBoolean("not_first", true);
super.onSaveInstanceState(outState);
}
public void showResults(Search results) {
if(results == null) {
Log.i("SearchResultsFragment: ", "showResults: results null");
} else if(results.getResults() == null) {
Log.i("SearchResultsFragment: ", "showResults: getResults null");
}
if (adapter == null) {
adapter = new SearchAdapter(getActivity(), results);
setListAdapter(adapter);
} else if(getListAdapter() != null){
adapter.notifyDataSetChanged();
} else {
setListAdapter(adapter);
}
getActivity().setTitle(results.getQuery().replace("+", " "));
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
Item item = (Item)l.getItemAtPosition(position);
mListener.onItemSelected(item.getId());
getListView().setItemChecked(position, true);
}
public interface OnFragmentInteractionListener {
public void onItemSelected(String id);
public void onRequestMoreItems();
public Search getSearchObjectFromActivity();
}
private class mOnScrollListener implements AbsListView.OnScrollListener {
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
}
@Override
public void onScroll(AbsListView absListView, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (mListener.getSearchObjectFromActivity() == null) {
Log.w(SearchResultsFragment.class.getSimpleName(), "onScroll searchObject == null");
return;
}
if (firstVisibleItem + visibleItemCount == totalItemCount && totalItemCount > mListener.getSearchObjectFromActivity().getPaging().getOffset()) {
Log.w(SearchResultsFragment.class.getSimpleName(), "onScroll firstVisible: " + firstVisibleItem + ", visibleCount:" + visibleItemCount + ", totalCount: " + totalItemCount);
mListener.onRequestMoreItems();
}
}
}
}
| [
"pablo.diazuboe@mercadolibre.com"
] | pablo.diazuboe@mercadolibre.com |
202e9d715e33ffa46c5e515d25461b05381ac1b1 | 4e7767faca2ff81e44cba0dfe6b71c5b4ce037ea | /lab11/src/Ex_4/WriteThread.java | 3f5f2c0c2fb953eaac9b977c2cff8f22d9abfead | [] | no_license | gantugs0130/Java | b83ced4e311ff7e72b1026f80038c711ba60cfea | b2a3e20480f5949aa027d29541e0cb9c9cd47daa | refs/heads/master | 2020-04-28T00:56:34.242021 | 2019-05-16T07:53:49 | 2019-05-16T07:53:49 | 174,835,148 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,318 | java | package Ex_4;
import java.io.*;
import java.net.*;
/**
* This thread is responsible for reading user's input and send it
* to the server.
* It runs in an infinite loop until the user types 'bye' to quit.
*
* @author www.codejava.net
*/
public class WriteThread extends Thread {
private PrintWriter writer;
private Socket socket;
private ChatClient client;
public WriteThread(Socket socket, ChatClient client) {
this.socket = socket;
this.client = client;
try {
OutputStream output = socket.getOutputStream();
writer = new PrintWriter(output, true);
} catch (IOException ex) {
System.out.println("Error getting output stream: " + ex.getMessage());
ex.printStackTrace();
}
}
public void run() {
Console console = System.console();
String userName = "gantugs";
client.setUserName("gantugs");
writer.println(userName);
String text;
do {
text = console.readLine("[" + userName + "]: ");
writer.println(text);
} while (!text.equals("bye"));
try {
socket.close();
} catch (IOException ex) {
System.out.println("Error writing to server: " + ex.getMessage());
}
}
} | [
"gantugs01300130@gmail.com"
] | gantugs01300130@gmail.com |
be4628aa2cd5ee4c4dd48d83b0f85df4f8cacbd6 | 4a9ba943a3dbccfb2b92641f14c39e9b56707c21 | /src/java/iotbay/g15/model/PaymentInfo.java | 7402c6b711a1d5c789aa12bfdfa7ae00fb77f6a3 | [] | no_license | rjyg/IoTBay | e743338e8700edfcf40894c0a559038f7ec3faae | 81f346827cdeff238b3c4ec81dbb3df6a1e702af | refs/heads/master | 2023-05-07T01:08:51.681603 | 2021-05-17T13:58:25 | 2021-05-17T13:58:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,819 | java | package iotbay.g15.model;
import java.io.Serializable;
/**
*
* @author Isha Yokhanna
*/
public class PaymentInfo implements Serializable{
private int paymentInfoID;
private int userID;
private String cardNumber;
private String cardExpiryDate;
private int cardCVC;
private String cardHolderName;
private int streetNumber;
private String streetName;
private String streetType;
private String suburb;
private String state;
private int postcode;
private String country;
private double credit;
private boolean active;
public PaymentInfo(int paymentInfoID, int userID, String cardNumber, String cardExpiryDate, int cardCVC, String cardHolderName,
int streetNumber, String streetName, String streetType, String suburb, String state, int postcode, String country, double credit,
boolean active) {
this.paymentInfoID = paymentInfoID;
this.userID = userID;
this.cardNumber = cardNumber;
this.cardExpiryDate = cardExpiryDate;
this.cardCVC = cardCVC;
this.cardHolderName = cardHolderName;
this.streetNumber = streetNumber;
this.streetName = streetName;
this.streetType = streetType;
this.suburb = suburb;
this.state = state;
this.postcode = postcode;
this.country = country;
this.credit = credit;
this.active = active;
}
public int getPaymentInfoID() {
return paymentInfoID;
}
public void setPaymentInfoID(int paymentInfoID) {
this.paymentInfoID = paymentInfoID;
}
public int getUserID(){
return userID;
}
public void setUserID(int userID){
this.userID = userID;
}
public String getCardNumber() {
return cardNumber;
}
public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}
public String getCardExpiryDate() {
return cardExpiryDate;
}
public void setExpiryDate(String cardExpiryDate) {
this.cardExpiryDate = cardExpiryDate;
}
public int getCardCVC() {
return cardCVC;
}
public void setCardCvc(int cardCVC) {
this.cardCVC = cardCVC;
}
public String getCardHolderName() {
return cardHolderName;
}
public void setCardHolderName(String cardHolderName) {
this.cardHolderName = cardHolderName;
}
public int getStreetNumber() {
return streetNumber;
}
public void setStreetNumber(int streetNumber) {
this.streetNumber = streetNumber;
}
public String getStreetName() {
return streetName;
}
public void setStreetName(String streetName) {
this.streetName = streetName;
}
public String getStreetType() {
return streetType;
}
public void setStreetType(String streetType) {
this.streetType = streetType;
}
public String getSuburb() {
return suburb;
}
public void setSuburb(String suburb) {
this.suburb = suburb;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public int getPostcode() {
return postcode;
}
public void setPostcode(int postcode) {
this.postcode = postcode;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
public double getCredit(){
return this.credit;
}
public void setCredit(double credit){
this.credit = credit;
}
public boolean isActive(){
return this.active;
}
public void setActive(boolean val){
this.active = val;
}
} | [
"yokhannaisha@gmail.com"
] | yokhannaisha@gmail.com |
4d61cfe0b4f7e5f2ade15d466fa19052ce3107a0 | 778c3eb567783c411783689f35b327818bb730e0 | /app/src/main/java/com/gzcbkj/chongbao/fragment/PetSelectTypeFragment.java | aaa8d1ddbc179c3d0d4d394c7050e8a385291e6d | [] | no_license | hackerlank/Pet | 15fac6bb42364b18490ee5db2bfe7373770178b1 | db1b65c356a4704496a8d4f8ffc1ba21521a9bd6 | refs/heads/master | 2020-03-12T08:39:37.993994 | 2018-04-01T14:24:03 | 2018-04-01T14:24:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,976 | java | package com.gzcbkj.chongbao.fragment;
import android.net.Uri;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.gzcbkj.chongbao.R;
import com.gzcbkj.chongbao.activity.BaseActivity;
import com.gzcbkj.chongbao.bean.PetVarietyBean;
import com.gzcbkj.chongbao.bean.ResponseBean;
import com.gzcbkj.chongbao.http.HttpMethods;
import com.gzcbkj.chongbao.http.OnHttpErrorListener;
import com.gzcbkj.chongbao.http.ProgressSubscriber;
import com.gzcbkj.chongbao.http.SubscriberOnNextListener;
import com.gzcbkj.chongbao.manager.DataManager;
import com.gzcbkj.chongbao.utils.Constants;
import com.gzcbkj.chongbao.utils.Utils;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import java.io.File;
import java.util.ArrayList;
/**
* Created by huangzhifeng on 2018/2/27.
*/
public class PetSelectTypeFragment extends BaseFragment implements OnRefreshListener {
private ArrayList<PetSelectTypeItemFragment> mFragments;
@Override
protected int getLayoutId() {
return R.layout.fragment_select_pet_type;
}
@Override
protected void onViewCreated(View view) {
setText(R.id.tvTitle, R.string.shide_pet_type);
initViewPager();
setViewsOnClickListener(R.id.llTab1, R.id.llTab2);
SmartRefreshLayout smartRefreshLayout = fv(R.id.smartLayout);
smartRefreshLayout.setOnRefreshListener(this);
smartRefreshLayout.autoRefresh();
}
private void initViewPager() {
ViewPager viewPager = fv(R.id.viewPager);
mFragments = new ArrayList<>();
for (int i = 0; i < 2; ++i) {
mFragments.add(new PetSelectTypeItemFragment());
}
viewPager.setAdapter(new FragmentPagerAdapter(getActivity().getSupportFragmentManager()) {
@Override
public BaseFragment getItem(int position) {
return mFragments.get(position);
}
@Override
public int getCount() {
return mFragments.size();
}
});
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
initTab(position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
viewPager.setCurrentItem(0);
initTab(0);
}
private void initTab(int pos) {
ViewGroup viewGroup;
for (int i = 0; i < 2; ++i) {
viewGroup = fv(getResources().getIdentifier("llTab" + (i + 1), "id", getActivity().getPackageName()));
((TextView) viewGroup.getChildAt(0)).setTextColor(getResources().getColor(i == pos ? R.color.color_33_33_33 : R.color.color_99_99_99));
viewGroup.getChildAt(1).setVisibility(i == pos ? View.VISIBLE : View.INVISIBLE);
}
}
@Override
public void updateUIText() {
}
@Override
public void onClick(View view) {
int id = view.getId();
switch (id) {
case R.id.llTab1:
((ViewPager)fv(R.id.viewPager)).setCurrentItem(0);
break;
case R.id.llTab2:
((ViewPager)fv(R.id.viewPager)).setCurrentItem(1);
break;
}
}
@Override
public void onRefresh(final RefreshLayout refreshlayout) {
ProgressSubscriber subscriber = new ProgressSubscriber(new SubscriberOnNextListener<ResponseBean>() {
@Override
public void onNext(ResponseBean bean) {
if (getView() == null) {
return;
}
refreshlayout.finishRefresh();
if (bean == null) {
return;
}
setText(R.id.tv1,bean.getPetTypeList().get(0).getTypeName());
setText(R.id.tv2,bean.getPetTypeList().get(1).getTypeName());
ArrayList<PetVarietyBean> list1=new ArrayList<>();
ArrayList<PetVarietyBean> list2=new ArrayList<>();
for(PetVarietyBean petVarietyBean:bean.getPetVarietyList()){
if(petVarietyBean.getPetType()==bean.getPetTypeList().get(0).getId()){
list1.add(petVarietyBean);
}else if(petVarietyBean.getPetType()==bean.getPetTypeList().get(1).getId()){
list2.add(petVarietyBean);
}
}
mFragments.get(0).setPetName(bean.getPetTypeList().get(0).getTypeName());
mFragments.get(1).setPetName(bean.getPetTypeList().get(1).getTypeName());
mFragments.get(0).setData(list1);
mFragments.get(1).setData(list2);
}
}, getActivity(), false, new OnHttpErrorListener() {
@Override
public void onConnectError(Throwable e) {
if (getView() == null) {
return;
}
refreshlayout.finishRefresh();
((BaseActivity) getActivity()).connectError(e);
}
@Override
public void onServerError(int errorCode, String errorMsg) {
if (getView() == null) {
return;
}
refreshlayout.finishRefresh();
((BaseActivity) getActivity()).serverError(errorCode, errorMsg);
}
});
HttpMethods.getInstance().queryTypeInfoList(subscriber);
}
}
| [
"huang08122257@126.com"
] | huang08122257@126.com |
786f3ec196fcd63a3ab9802b56fd6f4b05695257 | 8c2c3256b3649c22bb261eefc4688b41ed84da67 | /src/FileFactory.java | b3aebc1196adaefd3dc7dbe621a0940d1425673b | [] | no_license | dumanOktay/FlyWeightOrnek2 | 25433b18f486a2e7d79e1a98d19b89251d423932 | eb211f1f2074d2f82c1b710b8533f8e6e715947e | refs/heads/master | 2021-01-11T10:37:20.256039 | 2016-12-13T09:59:41 | 2016-12-13T09:59:41 | 76,344,636 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 442 | java | import java.util.HashMap;
/**
* Created by okt on 12/13/16.
*/
public class FileFactory {
private static HashMap<String,MFile> myFileHashMap = new HashMap<>();
public static MyFile getMyFile(String key){
MyFile myFile;
myFile = (MyFile) myFileHashMap.get(key);
if (myFile== null){
myFile = new MyFile(key);
myFileHashMap.put(key, myFile);
}
return myFile;
}
}
| [
"dumanoktay@yandex.com"
] | dumanoktay@yandex.com |
168449cee1bf14d43176884a9ed0274836b5be32 | 2dcf8a98d4b959673a61fb00e0d6a36496a45e05 | /modules/extensions/es/es-cae/src/test/java/com/coremedia/blueprint/elastic/social/cae/flows/RegistrationHelperTest.java | baca2cda893c0b7b1c548964b8a318f3f435f30f | [] | no_license | renickj/bycoremedia | d2f4a22a6074e56106b0495bbe879390af0d3d42 | 474a07d75386a9b59951e152560b05b6b8c93191 | refs/heads/master | 2021-01-17T17:09:33.819411 | 2016-04-25T17:13:11 | 2016-04-25T17:13:11 | 70,011,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 23,385 | java | package com.coremedia.blueprint.elastic.social.cae.flows;
import com.coremedia.blueprint.common.contentbeans.Page;
import com.coremedia.blueprint.elastic.social.cae.user.UserContext;
import com.coremedia.blueprint.elastic.social.configuration.ElasticSocialConfiguration;
import com.coremedia.blueprint.elastic.social.configuration.ElasticSocialPlugin;
import com.coremedia.elastic.core.api.blobs.Blob;
import com.coremedia.elastic.core.api.blobs.BlobException;
import com.coremedia.elastic.core.api.blobs.BlobService;
import com.coremedia.elastic.core.api.settings.Settings;
import com.coremedia.elastic.core.api.users.DuplicateEmailException;
import com.coremedia.elastic.core.api.users.DuplicateNameException;
import com.coremedia.elastic.social.api.ModerationType;
import com.coremedia.elastic.social.api.mail.MailTemplateNotFoundException;
import com.coremedia.elastic.social.api.registration.RegistrationService;
import com.coremedia.elastic.social.api.registration.TokenExpiredException;
import com.coremedia.elastic.social.api.users.CommunityUser;
import com.coremedia.elastic.social.api.users.CommunityUserService;
import com.coremedia.elastic.social.springsecurity.SocialAuthenticationToken;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatcher;
import org.mockito.InjectMocks;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.binding.message.DefaultMessageContext;
import org.springframework.binding.message.DefaultMessageResolver;
import org.springframework.binding.message.MessageResolver;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.web.ProviderSignInAttempt;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.webflow.context.ExternalContext;
import org.springframework.webflow.core.collection.ParameterMap;
import org.springframework.webflow.core.collection.SharedAttributeMap;
import org.springframework.webflow.execution.RequestContext;
import org.springframework.webflow.execution.RequestContextHolder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.jstl.fmt.LocalizationContext;
import java.io.IOException;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.TimeZone;
import static com.coremedia.blueprint.elastic.social.cae.flows.WebflowMessageKeys.ACTIVATE_REGISTRATION_SUCCESS;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.anyVararg;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
public class RegistrationHelperTest {
private static final HashMap<String, Object> USER_PROPERTIES = new HashMap<>();
private static final String USERNAME = "knacki";
private static final String GIVENNAME = "backi";
private static final String SURNAME = "hacki";
private static final String PASSWORD = "geheim";
private static final String EMAIL = USERNAME + "@bologna.it";
private static final Locale LOCALE = Locale.ENGLISH;
private static final String CONTENT_TYPE = "image/jpeg";
private static final String ACTIVATION_KEY = "1234";
private Registration registration;
@InjectMocks
RegistrationHelper registrationHelper;
@Mock
private RegistrationService registrationService;
@Mock
private RequestContext requestContext;
@Mock
private CommunityUser communityUser;
@Mock
private ExternalContext externalContext;
@Mock
private DefaultMessageContext messageContext;
@Mock
private BlobService blobService;
@Mock
private Blob blob;
@Mock
private InputStream inputStream;
@Mock
private CommonsMultipartFile file;
@Mock
private HttpServletRequest request;
@Mock
private Page page;
@Mock
private ElasticSocialPlugin elasticSocialPlugin;
@Mock
private ElasticSocialConfiguration elasticSocialConfiguration;
@Mock
private CommunityUserService communityUserService;
@Mock
private Connection connection;
@Mock
private org.springframework.social.connect.UserProfile profile;
@Mock
private HttpSession httpSession;
@Mock
private ProviderSignInAttempt providerSignInAttempt;
@Mock
private HttpClient httpClient;
@Mock
private HttpResponse httpResponse;
@Mock
private StatusLine statusLine;
@Mock
private HttpEntity entity;
@Mock
private Header contentType;
@Mock
private SharedAttributeMap sessionMap;
@Mock
private LocalizationContext localizationContext;
@Mock
private PasswordPolicy passwordPolicy;
@Mock
private Settings settings;
@Mock
private ParameterMap parameterMap;
@Mock
private LoginHelper loginHelper;
@Mock
private Enumeration<String> headerNames;
@SuppressWarnings("unchecked")
@Before
public void init() throws IOException, URISyntaxException {
USER_PROPERTIES.put("givenName", GIVENNAME);
USER_PROPERTIES.put("surName", SURNAME);
registration = initRegistration();
when(requestContext.getMessageContext()).thenReturn(messageContext);
RequestContextHolder.setRequestContext(requestContext);
when(externalContext.getLocale()).thenReturn(LOCALE);
when(requestContext.getExternalContext()).thenReturn(externalContext);
when(externalContext.getNativeRequest()).thenReturn(request);
when(request.getAttribute("cmpage")).thenReturn(page);
when(messageContext.hasErrorMessages()).thenReturn(false);
when(blobService.put(inputStream, CONTENT_TYPE, null)).thenReturn(blob);
when(blobService.put(inputStream, CONTENT_TYPE, USERNAME)).thenReturn(blob);
when(file.getInputStream()).thenReturn(inputStream);
when(file.getContentType()).thenReturn(CONTENT_TYPE);
when(communityUser.getLocale()).thenReturn(LOCALE);
when(elasticSocialPlugin.getElasticSocialConfiguration(anyVararg())).thenReturn(elasticSocialConfiguration);
when(elasticSocialConfiguration.getMaxImageFileSize()).thenReturn(512000);
when(request.getAttribute("cmpage")).thenReturn(page);
when(profile.getEmail()).thenReturn(EMAIL);
when(profile.getUsername()).thenReturn(USERNAME);
when(connection.fetchUserProfile()).thenReturn(profile);
when(connection.getImageUrl()).thenReturn("http://download.oracle.com/index.html");
when(httpClient.execute(any(HttpUriRequest.class))).thenReturn(httpResponse);
when(httpResponse.getStatusLine()).thenReturn(statusLine);
when(httpResponse.getEntity()).thenReturn(entity);
when(statusLine.getStatusCode()).thenReturn(org.apache.http.HttpStatus.SC_OK);
when(entity.getContent()).thenReturn(inputStream);
when(entity.getContentType()).thenReturn(contentType);
when(contentType.getValue()).thenReturn(CONTENT_TYPE);
when(providerSignInAttempt.getConnection()).thenReturn(connection);
when(httpSession.getAttribute(ProviderSignInAttempt.class.getName())).thenReturn(providerSignInAttempt);
when(registrationService.getUserByToken(any(String.class))).thenReturn(communityUser);
when(loginHelper.authenticate(any(SocialAuthenticationToken.class), any(RequestContext.class))).thenReturn(true);
when(request.getSession(false)).thenReturn(httpSession);
RequestAttributes attributes = new ServletRequestAttributes(request);
when(request.getAttributeNames()).thenReturn(headerNames);
when(headerNames.hasMoreElements()).thenReturn(false);
when(attributes.getAttribute(ProviderSignInAttempt.class.getName(), RequestAttributes.SCOPE_SESSION)).thenReturn(providerSignInAttempt);
//when(request.getAttribute(LOCALIZATION_KEY)).thenReturn(localizationContext);
when(passwordPolicy.verify(PASSWORD)).thenReturn(true);
registrationHelper.initialize();
}
@Test
public void register() {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenReturn(communityUser);
boolean isRegistered = registrationHelper.register(registration, requestContext, null);
assertTrue(isRegistered);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, never()).addMessage(any(MessageResolver.class));
}
@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void registerButUsernameNotAvailable() {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenThrow(new DuplicateNameException(null, null));
boolean isRegistered = registrationHelper.register(registration, requestContext, null);
assertFalse(isRegistered);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, atLeast(1)).addMessage(any(MessageResolver.class));
verify(communityUser, never()).save();
}
@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void registerButEmailNotAvailable() {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenThrow(new DuplicateEmailException(null, null));
boolean isRegistered = registrationHelper.register(registration, requestContext, null);
assertFalse(isRegistered);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, atLeast(1)).addMessage(any(MessageResolver.class));
verify(communityUser, never()).save();
}
@SuppressWarnings({"ThrowableInstanceNeverThrown"})
@Test
public void registerWithMailException() {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenThrow(new MailTemplateNotFoundException("", LOCALE));
boolean isRegistered = registrationHelper.register(registration, requestContext, null);
assertFalse(isRegistered);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, atLeast(1)).addMessage(any(MessageResolver.class));
verify(communityUser, never()).save();
}
@Test
public void testRegisterWithImage() throws IOException {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenReturn(communityUser);
when(file.getSize()).thenReturn(1000L);
boolean userSaved = registrationHelper.register(registration, requestContext, file);
assertTrue(userSaved);
verify(communityUser).save();
verify(blobService).put(inputStream, CONTENT_TYPE, null);
verify(communityUser).setImage(blob);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, never()).addMessage(any(MessageResolver.class));
}
@Test
public void registerWithAutomaticActivation() {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenReturn(communityUser);
when(settings.getBoolean("elastic.automatic.user.activation", false)).thenReturn(true);
when(registrationService.activateRegistration(anyString(), any(ModerationType.class))).thenReturn(true);
registrationHelper.initialize();
boolean isRegistered = registrationHelper.register(registration, requestContext, null);
assertTrue(isRegistered);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, Locale.ENGLISH, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(registrationService).activateRegistration(anyString(), any(ModerationType.class));
verify(messageContext, atLeastOnce()).addMessage(message(ACTIVATE_REGISTRATION_SUCCESS));
}
@Test
public void testRegisterWithBlobException() {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenReturn(communityUser);
when(file.getSize()).thenReturn(1000L);
when(blobService.put(inputStream, CONTENT_TYPE, null)).thenThrow(new BlobException("I/O error"));
boolean userSaved = registrationHelper.register(registration, requestContext, file);
assertTrue(userSaved);
verify(communityUser, never()).save();
verify(blobService).put(inputStream, CONTENT_TYPE, null);
verify(communityUser, never()).setImage(blob);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, times(1)).addMessage(any(MessageResolver.class));
}
@Test
public void testRegisterWithIOException() throws IOException {
when(registrationService.register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenReturn(communityUser);
when(file.getSize()).thenReturn(1000L);
when(file.getInputStream()).thenThrow(new IOException("I/O error"));
boolean userSaved = registrationHelper.register(registration, requestContext, file);
assertTrue(userSaved);
verify(communityUser, never()).save();
verify(blobService, never()).put(inputStream, CONTENT_TYPE, null);
verify(communityUser, never()).setImage(blob);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, times(1)).addMessage(any(MessageResolver.class));
}
@Test
public void testRegisterWithImageTooBig() throws IOException {
when(file.getSize()).thenReturn(512001L);
when(registrationService.register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenReturn(communityUser);
boolean userSaved = registrationHelper.register(registration, requestContext, file);
assertTrue(userSaved);
verify(communityUser, never()).save();
verify(blobService, never()).put(inputStream, CONTENT_TYPE, null);
verify(communityUser, never()).setImage(blob);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, times(1)).addMessage(any(MessageResolver.class));
}
@Test
public void testRegisterWithImageUnsupportedContentType() throws IOException {
when(file.getSize()).thenReturn(512000L);
when(file.getContentType()).thenReturn("abcd");
when(registrationService.register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES)).thenReturn(communityUser);
boolean userSaved = registrationHelper.register(registration, requestContext, file);
assertTrue(userSaved);
verify(communityUser, never()).save();
verify(blobService, never()).put(inputStream, CONTENT_TYPE, null);
verify(communityUser, never()).setImage(blob);
verify(registrationService).register(USERNAME, PASSWORD, EMAIL, LOCALE, TimeZone.getTimeZone("UTC"), USER_PROPERTIES);
verify(messageContext, times(1)).addMessage(any(MessageResolver.class));
}
@SuppressWarnings("unchecked")
@Test
public void activateModerationTypeNone() {
ModerationType moderationType = ModerationType.NONE;
when(registrationService.activateRegistration(ACTIVATION_KEY, moderationType)).thenReturn(true);
HttpServletRequest request = mock(HttpServletRequest.class);
when(elasticSocialConfiguration.getUserModerationType()).thenReturn(moderationType);
when(request.getAttribute("cmpage")).thenReturn(page);
when(requestContext.getExternalContext().getNativeRequest()).thenReturn(request);
boolean isActivated = registrationHelper.activate(ACTIVATION_KEY, requestContext);
assertTrue(isActivated);
verify(messageContext, atLeastOnce()).addMessage(message(ACTIVATE_REGISTRATION_SUCCESS));
}
@Test
public void activateModerationTypePost() {
ModerationType moderationType = ModerationType.POST_MODERATION;
when(registrationService.activateRegistration(ACTIVATION_KEY, moderationType)).thenReturn(true);
when(elasticSocialConfiguration.getUserModerationType()).thenReturn(moderationType);
boolean isActivated = registrationHelper.activate(ACTIVATION_KEY, requestContext);
assertTrue(isActivated);
verify(messageContext, atLeastOnce()).addMessage(message(ACTIVATE_REGISTRATION_SUCCESS));
}
@Test
public void activateModerationTypePre() {
ModerationType moderationType = ModerationType.PRE_MODERATION;
when(registrationService.activateRegistration(ACTIVATION_KEY, moderationType)).thenReturn(true);
when(elasticSocialConfiguration.getUserModerationType()).thenReturn(moderationType);
boolean isActivated = registrationHelper.activate(ACTIVATION_KEY, requestContext);
assertTrue(isActivated);
verify(messageContext, times(1)).addMessage(any(MessageResolver.class));
}
@Test
public void activateNotSuccessful() {
ModerationType moderationType = ModerationType.PRE_MODERATION;
when(registrationService.activateRegistration(ACTIVATION_KEY, moderationType)).thenReturn(false);
when(elasticSocialConfiguration.getUserModerationType()).thenReturn(moderationType);
boolean isActivated = registrationHelper.activate(ACTIVATION_KEY, requestContext);
assertFalse(isActivated);
verify(messageContext, times(1)).addMessage(any(MessageResolver.class));
}
@SuppressWarnings("unchecked")
@Test
public void activateTokenExpired() {
ModerationType moderationType = ModerationType.PRE_MODERATION;
when(registrationService.activateRegistration(ACTIVATION_KEY, moderationType)).thenThrow(new TokenExpiredException(""));
when(elasticSocialConfiguration.getUserModerationType()).thenReturn(moderationType);
when(request.getAttribute("cmpage")).thenReturn(page);
when(requestContext.getExternalContext().getNativeRequest()).thenReturn(request);
boolean isActivated = registrationHelper.activate(ACTIVATION_KEY, requestContext);
assertFalse(isActivated);
verify(messageContext, times(1)).addMessage(any(MessageResolver.class));
}
@Test
public void redirectLoggedInUserToHomePage() {
UserContext.setUser(communityUser);
registrationHelper.redirectLoggedInUserToHomePage(requestContext);
verify(externalContext).requestExternalRedirect("contextRelative:");
}
@Test
public void redirectLoggedInUserToHomePageNoUser() {
UserContext.clear();
registrationHelper.redirectLoggedInUserToHomePage(requestContext);
verify(externalContext, never()).requestExternalRedirect("contextRelative:");
}
@Test
public void preProcess() {
Registration registration = initRegistration();
registrationHelper.preProcess(registration, requestContext);
verify(communityUserService).getUserByEmail(EMAIL);
verify(communityUserService).getUserByName(USERNAME);
verify(messageContext, never()).addMessage(Matchers.<MessageResolver>any());
assertTrue(registration.isRegisteringWithProvider());
}
@Test
public void preProcessNameAndEmailAlreadyUsed() {
when(communityUserService.getUserByEmail(EMAIL)).thenReturn(communityUser);
when(communityUserService.getUserByName(USERNAME)).thenReturn(communityUser);
registrationHelper.preProcess(initRegistration(), requestContext);
verify(communityUserService).getUserByEmail(EMAIL);
verify(communityUserService).getUserByName(USERNAME);
verify(messageContext, times(2)).addMessage(Matchers.<MessageResolver>any());
}
@Test
public void preProcessNameAndEmailBlank() {
when(profile.getEmail()).thenReturn("");
when(profile.getUsername()).thenReturn(null);
registrationHelper.preProcess(initRegistration(), requestContext);
verify(communityUserService, never()).getUserByEmail(anyString());
verify(communityUserService, never()).getUserByName(anyString());
verify(messageContext, never()).addMessage(Matchers.<MessageResolver>any());
}
@Test
public void preProcessConnectionNull() {
when(providerSignInAttempt.getConnection()).thenReturn(null);
registrationHelper.preProcess(initRegistration(), requestContext);
verify(communityUserService, never()).getUserByEmail(EMAIL);
verify(communityUserService, never()).getUserByName(USERNAME);
verify(messageContext, never()).addMessage(Matchers.<MessageResolver>any());
}
@Test
public void testPostProcessProviderConnectionDuplicateConnection() {
when(requestContext.getExternalContext()).thenReturn(externalContext);
when(externalContext.getSessionMap()).thenReturn(sessionMap);
when(sessionMap.remove("providerLogin.messageKey")).thenReturn("some.key");
when(requestContext.getRequestParameters()).thenReturn(parameterMap);
registrationHelper.postProcessProviderRegistration(requestContext);
verify(messageContext).addMessage(Matchers.<MessageResolver>anyObject());
verify(parameterMap).contains("error");
}
@Test
public void testPostProcessProviderConnectionError() {
when(requestContext.getExternalContext()).thenReturn(externalContext);
when(externalContext.getSessionMap()).thenReturn(sessionMap);
when(requestContext.getRequestParameters()).thenReturn(parameterMap);
when(parameterMap.contains("error")).thenReturn(true);
registrationHelper.postProcessProviderRegistration(requestContext);
verify(messageContext).addMessage(Matchers.<MessageResolver>anyObject());
verify(parameterMap).contains("error");
}
private Registration initRegistration() {
Registration registration = new Registration();
registration.setUsername(USERNAME);
registration.setGivenname(GIVENNAME);
registration.setSurname(SURNAME);
registration.setEmailAddress(EMAIL);
registration.setPassword(PASSWORD);
registration.setConfirmPassword(PASSWORD);
registration.setTimeZoneId(TimeZone.getTimeZone("UTC").getID());
registration.setPasswordPolicy(passwordPolicy);
registration.setAcceptTermsOfUse(true);
return registration;
}
private static MessageResolver message(final String code) {
return argThat(new ArgumentMatcher<MessageResolver>() {
@Override
public boolean matches(Object argument) {
return argument instanceof DefaultMessageResolver && asList(((DefaultMessageResolver) argument).getCodes()).equals(asList(code));
}
});
}
}
| [
"u42998@F535DTRV.ustr.com"
] | u42998@F535DTRV.ustr.com |
62a16e1c8e1bef427936e6c48cae396d3a3380ea | e7dc82d8fcd6d73bd37db4df4dfd0f4deeb0e7cb | /controle-estoque/src/main/java/com/uem/controle/estoque/builder/UnidadeMedidaBuilder.java | e6c36c8ec61c22cd908f320fd40638a9f6c69049 | [] | no_license | RodolfoBorri/estocai-controle-estoque | f526207ceffee516a9ebc3ac7bf64ccd3f6d8fc6 | 9114f81bf814f0d9da878959403031b1644629d7 | refs/heads/master | 2023-04-10T17:09:19.571713 | 2021-04-15T19:59:25 | 2021-04-15T19:59:25 | 335,140,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 663 | java | package com.uem.controle.estoque.builder;
import com.uem.controle.estoque.entity.UnidadeMedida;
public class UnidadeMedidaBuilder {
private String descricao;
private String unidade;
public UnidadeMedidaBuilder setDescricao(String descricao) {
this.descricao = descricao;
return this;
}
public UnidadeMedidaBuilder setUnidade(String unidade) {
this.unidade = unidade;
return this;
}
public UnidadeMedidaBuilder(String descricao, String unidade) {
super();
this.descricao = descricao;
this.unidade = unidade;
}
public UnidadeMedidaBuilder() { }
public UnidadeMedida build() {
return new UnidadeMedida(descricao, unidade);
}
}
| [
"rodolfoborri@hotmail.com"
] | rodolfoborri@hotmail.com |
fcdc0c56053cef21ba5c54ac16b0142dd8152231 | 7ef760a2927684f20ec8ba91bdb2631918599964 | /src/main/java/org/valuereporter/agent/crawler/PublicMethodCrawler.java | c87fe7c251de06c6be3487f0ce9f5181b53d8d18 | [
"Apache-2.0"
] | permissive | valuereporter/_deprecated-Valuereporter-Agent | ccf97c7d0c3bd2acb681d5494c19780077aac844 | 9bbae27035a80777be5074d361bd102c61f50e09 | refs/heads/master | 2021-11-30T22:38:31.600477 | 2018-05-25T06:59:24 | 2018-05-25T06:59:24 | 52,442,743 | 0 | 0 | Apache-2.0 | 2021-11-26T01:52:58 | 2016-02-24T13:05:15 | Java | UTF-8 | Java | false | false | 3,257 | java | package org.valuereporter.agent.crawler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.valuereporter.agent.ImplementedMethod;
import org.valuereporter.agent.http.HttpImplementedMethodSender;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
/**
* @author <a href="bard.lind@gmail.com">Bard Lind</a>
*/
public class PublicMethodCrawler implements Runnable {
private static final Logger log = LoggerFactory.getLogger(PublicMethodCrawler.class);
private final String reporterHost;
private final String reporterPort;
private final String prefix;
private final String basePackage;
private List<ImplementedMethod> publicMethods = new ArrayList<>();
private int MAX_CACHE_SIZE = 500;
public PublicMethodCrawler(String reporterHost, String reporterPort, String prefix, String basePackage) {
this.reporterHost = reporterHost;
this.reporterPort = reporterPort;
this.prefix = prefix;
this.basePackage = basePackage;
}
@Override
public void run() {
crawlForPublicMethods();
}
protected void crawlForPublicMethods() {
log.info("Starting to crawl for Public Methods.");
try {
ArrayList<String> names = PublicMethodFinder.getClassNamesFromPackage(basePackage);
log.info("Found these names {}", names.size());
List<Class> classes = PublicMethodFinder.findClasses(names);
for (Class clazz : classes) {
List<ImplementedMethod> publicMethodsInClass = null;
log.trace("Found a potential class. {}", clazz.getName());
if (clazz.isPrimitive() || clazz.isArray() || clazz.isAnnotation()
|| clazz.isEnum() || clazz.isInterface()) {
log.trace("Skip class {}: not a class", clazz.getName());
} else {
publicMethodsInClass = PublicMethodFinder.findPublicMethods(clazz);
updateMethodsForClass(publicMethodsInClass, clazz.getName());
}
}
} catch (IOException e) {
e.printStackTrace();
} catch (URISyntaxException e) {
e.printStackTrace();
}
log.info("Crawled all classes. Local cash has {} elements still. Forwarding these to ValueReporter.", publicMethods.size());
forwardOutput();
log.info("Done crawling.");
}
protected void updateMethodsForClass(List<ImplementedMethod> publicMethodsInClass, String className) {
if (publicMethodsInClass != null) {
log.trace("Found {} public methods in {}", publicMethodsInClass.size(), className);
publicMethods.addAll(publicMethodsInClass);
if (publicMethods.size() >= MAX_CACHE_SIZE) {
forwardOutput();
}
} else {
log.warn("Observed Method is null");
}
}
private void forwardOutput() {
log.trace("Forwarding PublicMethods. Local cache size {}", publicMethods.size());
new Thread(new HttpImplementedMethodSender(reporterHost, reporterPort, prefix, publicMethods)).start();
publicMethods.clear();
}
}
| [
"bard.lind@tomra.com"
] | bard.lind@tomra.com |
327dd8563e6621555d70e9259ed3747a4c78a5fe | 8d4d26b3369d282d9454daf4db4f5e219fd0d01b | /src/kr/ac/uos/ai/arbi/monitor/model/SequenceColorBean.java | 6a6b605893ea9ee7f04b9a814d2eeca233e2c4f6 | [] | no_license | WOWEunji/ARBIFramework-0.8.m03 | 43745deec929301fb9f853fe425cb2cd13d7769a | 65ed6b6ad7d676f1ffdd00de19e5dd45dbcfc330 | refs/heads/master | 2022-04-05T08:18:12.113696 | 2020-01-30T01:28:06 | 2020-01-30T01:28:06 | 237,117,041 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,558 | java | package kr.ac.uos.ai.arbi.monitor.model;
import java.awt.Color;
public class SequenceColorBean implements TableEntry<Object>{
private static final SequenceColorBean[] NULL_ARRAY = new SequenceColorBean[0];
private static final Color DEFAULT_COLOR = Color.decode("#000000");
private Object key;
private Color lineColor;
private Color fontColor;
public SequenceColorBean(Object key) {
setKey(key);
}
public SequenceColorBean(Object key, Color lineColor, Color fontColor) {
setKey(key);
setLineColor(lineColor);
setFontColor(fontColor);
}
void setKey(Object key) {
this.key = key;
}
public void setLineColor(Color lineColor) {
this.lineColor = lineColor;
if(this.lineColor != null)
return;
this.lineColor = DEFAULT_COLOR;
}
public void setFontColor(Color fontColor) {
this.fontColor = fontColor;
if(this.fontColor != null)
return;
this.fontColor = DEFAULT_COLOR;
}
public Object getKey() {
return this.key;
}
public Color getLineColor() {
return this.lineColor;
}
public Color getFontColor() {
return this.fontColor;
}
public Object getValue(int columnIndex) {
switch (columnIndex) {
case 0:
return getKey();
case 1:
return getLineColor();
case 2:
return getFontColor();
}
return null;
}
public void setValue(int columnIndex, Object value) {
switch (columnIndex) {
case 0:
setKey(value);
case 1:
setLineColor((Color) value);
case 2:
setFontColor((Color) value);
}
}
}
| [
"emma0415@kist.re.kr"
] | emma0415@kist.re.kr |
eaaa9b92d4c0aa0c46bb9cf69453c698ad16722e | 4c68c53745a215cdb325b526e59921c0ab25ec4e | /src/main/java/com/imooc/sell/config/WechatMpConfig.java | 47bb3bb7928328cd5e3e56aa3aaca28969c21d86 | [] | no_license | gsy13213009/sell | 0dcf2c9ce7b61005660f1dea10fd73bd8e7175f5 | a7aacb0a37bc7c50bcb184cc121b07c66e36a616 | refs/heads/master | 2022-12-26T00:05:59.983034 | 2020-06-02T01:36:49 | 2020-06-02T01:36:49 | 262,999,789 | 0 | 0 | null | 2020-10-13T21:54:19 | 2020-05-11T09:38:33 | Java | UTF-8 | Java | false | false | 1,042 | java | package com.imooc.sell.config;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
@Service
public class WechatMpConfig {
@Autowired
private WechatAccountConfig wechatAccountConfig;
@Bean
public WxMpService wxMpService() {
WxMpService wxMpService = new WxMpServiceImpl();
wxMpService.setWxMpConfigStorage(wxMpConfigStorage());
return wxMpService;
}
public WxMpConfigStorage wxMpConfigStorage() {
WxMpDefaultConfigImpl wxMpConfigStorage = new WxMpDefaultConfigImpl();
wxMpConfigStorage.setAppId(wechatAccountConfig.getMpAppId());
wxMpConfigStorage.setSecret(wechatAccountConfig.getMpAppSecret());
return wxMpConfigStorage;
}
}
| [
"siyi.guo@grabtaxi.com"
] | siyi.guo@grabtaxi.com |
10c57356ac04ec98efeab7c4cf40cc88123e04f6 | 094e66aff18fd3a93ea24e4f23f5bc4efa5d71d6 | /yit-education-util/src/main/java/com/yuu/yit/education/util/enums/MsgTypeEnum.java | 78eca47c45ab6a0b987bcac01d04c935bf61d998 | [
"MIT",
"Apache-2.0"
] | permissive | 71yuu/YIT | 55b76dbec855b8e67f42a7eb00e9fa8e919ec4cb | 53bb7ba8b8e686b2857c1e2812a0f38bd32f57e3 | refs/heads/master | 2022-09-08T06:51:30.819760 | 2019-11-29T06:24:19 | 2019-11-29T06:24:19 | 216,706,258 | 0 | 0 | Apache-2.0 | 2022-09-01T23:14:33 | 2019-10-22T02:27:22 | Java | UTF-8 | Java | false | false | 370 | java | /**
* Copyright 2015-2017 广州市领课网络科技有限公司
*/
package com.yuu.yit.education.util.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 短信类型
*
* @author Yuu
*
*/
@Getter
@AllArgsConstructor
public enum MsgTypeEnum {
SYSTEM(1, "系统消息"), OTHER(2, "其他");
private Integer code;
private String desc;
}
| [
"1225459207@qq.com"
] | 1225459207@qq.com |
dd17df6edeff9ea22b9be88e706626e9524d9f85 | a97871fbf2241dab24ffdfe7a39e411b2614bd3d | /src/main/java/com/leveloper/chacha/springbootchacha/domain/delivery/Delivery.java | a92ebd10e60b7ecf3c9deac0c1be5b2a596ebefd | [] | no_license | tkdgusl94/chacha-springboot | 7e589e215c2b0070c27dd597bfb6fa1c301c049c | cf31b88aa27f0036de10185eabeb0ed4e065c6cd | refs/heads/master | 2020-12-14T22:01:37.015406 | 2020-02-20T05:28:37 | 2020-02-20T05:28:37 | 234,883,870 | 0 | 0 | null | 2020-01-20T08:26:35 | 2020-01-19T10:49:15 | Java | UTF-8 | Java | false | false | 723 | java | package com.leveloper.chacha.springbootchacha.domain.delivery;
import com.leveloper.chacha.springbootchacha.domain.user.Address;
import com.leveloper.chacha.springbootchacha.domain.BaseTimeEntity;
import com.leveloper.chacha.springbootchacha.domain.order.Order;
import lombok.Getter;
import javax.persistence.*;
@Getter
@Entity
public class Delivery extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="delivery_id")
private Long id;
@OneToOne(mappedBy = "delivery", fetch = FetchType.LAZY)
private Order order;
@Embedded
private Address address;
@Enumerated(EnumType.STRING)
@Column(length = 20)
private DeliveryStatus status;
}
| [
"tkdgusl94@gmail.com"
] | tkdgusl94@gmail.com |
dce122e9197ffb8fd835907b078627e680caa10a | 93f399d565fb0a7bc00e6c2deaf166275695cffd | /src/main/java/samparser/samrecorditerator/SamRecordIterable.java | 75560c5f326574c3163843deb1515406a15ffd7b | [] | no_license | Kirvolque/variant_caller | 38f4836346ceedb55f1afd4845054f3078b1a7ed | ef92bfe57d0b95af46341354ae1708fca7efd2aa | refs/heads/master | 2023-04-29T06:13:11.666206 | 2023-04-16T11:28:10 | 2023-04-16T11:28:10 | 175,215,959 | 1 | 2 | null | 2019-07-27T21:23:16 | 2019-03-12T13:22:01 | Java | UTF-8 | Java | false | false | 417 | java | package samparser.samrecorditerator;
import lombok.NonNull;
import sequence.SamRecord;
import java.io.BufferedReader;
public class SamRecordIterable implements Iterable<SamRecord> {
private BufferedReader reader;
public SamRecordIterable(@NonNull final BufferedReader reader) {
this.reader = reader;
}
@Override
public SamRecordIterator iterator() {
return new SamRecordIterator(reader);
}
}
| [
"stahiev.av@edu.spbstu.ru"
] | stahiev.av@edu.spbstu.ru |
fda251c88d61f0f0996fe0e39da704da386c4e8b | 69c2129d3b727dcc31471a2beaa17b07a140a654 | /src/se/his/iit/it325g/common/rendezvous/Observer.java | a8017a7a8066e4bab1af72018fe1dfaf4be9eb99 | [] | no_license | s-larson/Parallell_Processes_Assignment_2 | d68f25a93d577b64fef73e19908f81e5e208ae9b | f5fa33226dda5ad277b020d250951acc755d0b82 | refs/heads/master | 2020-09-22T23:07:03.906844 | 2019-12-20T12:49:18 | 2019-12-20T12:49:18 | 225,340,195 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 821 | java | package se.his.iit.it325g.common.rendezvous;
public class Observer {
private String name;
private Rendezvous rendezvous;
public Observer(String name,Rendezvous rendezvous) {
if (rendezvous==null) {
throw new IllegalArgumentException("Rendezvous cannot be null");
}
if (name==null) {
throw new IllegalArgumentException("Name cannot be null");
}
this.name=name;
this.rendezvous=rendezvous;
}
/**
* @return the rendezvous
*/
public synchronized final Rendezvous getRendezvous() {
return rendezvous;
}
/**
* @return the name
*/
public synchronized final String getName() {
return name;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return String.format("Observer [name=%s, rendezvous=%s]", name,
rendezvous);
}
} | [
"46972698+s-larson@users.noreply.github.com"
] | 46972698+s-larson@users.noreply.github.com |
2c0ed07a314a8f8b5ded34fa0dcb65a24fa40001 | 0759be11403fe2826455ac9b53755f65912c5e28 | /TYTimeAss/app/src/main/java/com/example/hongnhung/tytimeass/models/Article.java | e371430d6a5fd8a61d99b9ffc5701a17c8dcea4c | [
"Apache-2.0"
] | permissive | nhungnguyen123/AssignWeek2 | 10f59a4d169488cd9e8a47203379782aa8a0354c | ac77ed12855166a17c7e85afacb1cca26db9ae61 | refs/heads/master | 2021-01-21T06:24:17.780048 | 2017-02-27T14:22:09 | 2017-02-27T14:22:09 | 83,223,728 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,678 | java | package com.example.hongnhung.tytimeass.models;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* Created by hongnhung on 26/02/2017.
*/
public class Article implements Parcelable {
@SerializedName("web_url")
public String WebUrl;
@SerializedName("snippet")
public String Snippet;
@SerializedName("lead_paragraph")
public String LeadPara;
@SerializedName("multimedia")
List<Multimedia> listMultimedias;
@SerializedName("headline")
public Headline headline;
@SerializedName("pub_date")
public String PubDate;
public Headline getHeadline() {
return headline;
}
public void setHeadline(Headline headline) {
this.headline = headline;
}
@SerializedName("document_type")
public String Type;
public Article() {
}
protected Article(Parcel in) {
WebUrl = in.readString();
Snippet = in.readString();
LeadPara = in.readString();
PubDate = in.readString();
Type = in.readString();
}
public static final Creator<Article> CREATOR = new Creator<Article>() {
@Override
public Article createFromParcel(Parcel in) {
return new Article(in);
}
@Override
public Article[] newArray(int size) {
return new Article[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(WebUrl);
dest.writeString(Snippet);
dest.writeString(LeadPara);
dest.writeString(PubDate);
dest.writeString(Type);
}
public String getType() {
return Type;
}
public void setType(String type) {
Type = type;
}
public String getWebUrl() {
return WebUrl;
}
public void setWebUrl(String webUrl) {
WebUrl = webUrl;
}
public String getSnippet() {
return Snippet;
}
public void setSnippet(String snippet) {
Snippet = snippet;
}
public String getLeadPara() {
return LeadPara;
}
public void setLeadPara(String leadPara) {
LeadPara = leadPara;
}
public List<Multimedia> getListMultimedias() {
return listMultimedias;
}
public void setListMultimedias(List<Multimedia> listMultimedias) {
this.listMultimedias = listMultimedias;
}
public String getPubDate() {
return PubDate;
}
public void setPubDate(String pubDate) {
PubDate = pubDate;
}
}
| [
"hongnhung@Hongs-MacBook-Pro.local"
] | hongnhung@Hongs-MacBook-Pro.local |
1a8122b561fa0245f9e9a9f1934968a221506f02 | 95e944448000c08dd3d6915abb468767c9f29d3c | /sources/com/bef/effectsdk/testing/TestResult.java | 8c1ccfdd0e7aa8666993948da308d08e635a761a | [] | no_license | xrealm/tiktok-src | 261b1faaf7b39d64bb7cb4106dc1a35963bd6868 | 90f305b5f981d39cfb313d75ab231326c9fca597 | refs/heads/master | 2022-11-12T06:43:07.401661 | 2020-07-04T20:21:12 | 2020-07-04T20:21:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package com.bef.effectsdk.testing;
public class TestResult {
public int failed_test_count;
public String report;
public int reportable_test_count;
public TestResult(int i, int i2, String str) {
this.reportable_test_count = i;
this.failed_test_count = i2;
this.report = str;
}
}
| [
"65450641+Xyzdesk@users.noreply.github.com"
] | 65450641+Xyzdesk@users.noreply.github.com |
3828161b873a977a48ebefa15027e609a7baedd8 | 22fe459f59c54b975b7ad4a254ee48226fe6c5a0 | /TravelB/app/src/main/java/com/fancik/travelb/PilihanTravelA.java | c2ddba1d0f2f653c22ea0fb38465eb4b0c86f0a5 | [] | no_license | fandytic/pemesananTravel-android | 3ceda2ce4fb4af2f0f4eff7d759cef7a97544a68 | 7c3dab75fa3bc9f420429618ba62cb881df7d837 | refs/heads/master | 2020-03-25T20:20:40.537052 | 2018-08-09T09:11:36 | 2018-08-09T09:11:36 | 144,127,171 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,445 | java | package com.fancik.travelb;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
/**
* Created by Fandy TIC on 02/12/2017.
*/
public class PilihanTravelA extends AppCompatActivity {
TextView txt_nohp;
String nohp,id;
SharedPreferences sharedpreferences;
public static final String TAG_ID = "id";
public static final String TAG_NOHP = "nohp";
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.pilihan_travela);
txt_nohp = (TextView) findViewById(R.id.txt_nohp);
sharedpreferences = getSharedPreferences(MainActivity.my_shared_preferences, Context.MODE_PRIVATE);
id = getIntent().getStringExtra(TAG_ID);
nohp = getIntent().getStringExtra(TAG_NOHP);
txt_nohp.setText(nohp);
}
public void ChooseArya(View view) {
Intent i = new Intent(getApplicationContext(), Tab.class);
i.putExtra(TAG_ID, id);
i.putExtra(TAG_NOHP, nohp);
startActivity(i);
}
public void ChooseTri(View view) {
Intent i = new Intent(getApplicationContext(), TabBukittinggi2.class);
i.putExtra(TAG_ID, id);
i.putExtra(TAG_NOHP, nohp);
startActivity(i);
}
} | [
"fandy15ti@mahasiswa.pcr.ac.id"
] | fandy15ti@mahasiswa.pcr.ac.id |
a8687295c5fb912ed97e2d3e90596aa6a0ae38b7 | 69414473d63b2ff36387e30d9da394098695ddd6 | /src/plugins/hm/src/java/larson/hm/plugin/util/JdbcUtils.java | 7ca4c1c3c0c0ebc54897898bb45cd7ae3153fc3d | [] | no_license | larsonzhong/HM_Plugin | b57c12ac6a94372600c7179f2566343a0c6c9db0 | e7d6d256b46ccc68fc1f8b17ac5f417a30c67399 | refs/heads/master | 2016-09-05T10:32:25.508458 | 2015-04-22T10:39:00 | 2015-04-22T10:39:00 | 33,908,671 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,109 | java | package larson.hm.plugin.util;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import larson.hm.plugin.handler.ResultSetHandler;
import larson.hm.plugin.model.bean.Homework;
import larson.hm.plugin.model.bean.Major;
import larson.hm.plugin.model.bean.Notice;
import larson.hm.plugin.model.bean.Subject;
import org.jivesoftware.database.DbConnectionManager;
/**
* ��ݿ����
*
* @author Larson
*
*/
public class JdbcUtils {
/**
* 获取连接
*
* @return
* @throws SQLException
*/
private static Connection getConnection() throws SQLException {
return DbConnectionManager.getConnection();
}
/**
* 关闭连接
*
* @param resultSet
* @param statement
* @param connection
*/
public static void release(Connection connection,
PreparedStatement statement, ResultSet resultSet) {
DbConnectionManager.closeConnection(resultSet, statement, connection);
}
/**
*
* @param sql
* @param params
* @throws SQLException
*/
public static int update(String sql, Object params[]) throws SQLException {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
int effectRaw = 0;
try {
conn = getConnection();
ps = conn.prepareStatement(sql);
for (int i = 0; i < params.length; i++) {
ps.setObject(i + 1, params[i]);
}
effectRaw = ps.executeUpdate();
} finally {
release(conn, ps, rs);
}
return effectRaw;
}
/**
*
* @param sql
* @param params
* @param rsh
* @return
* @throws Exception
*/
public static <T> Object query(String sql, Object params[],
ResultSetHandler rsh) throws Exception {
Connection conn = null;
PreparedStatement st = null;
ResultSet rs = null;
try {
conn = getConnection();
st = conn.prepareStatement(sql);
for (int i = 0; i < params.length; i++) {
st.setObject(i + 1, params[i]);
}
rs = st.executeQuery();
return rsh.handler(rs);
} finally {
release(conn, st, rs);
}
}
/**
* ��ȡ���е�major
*
* @param beanHandler
* @param sql
* @return
*/
public static List<Major> getAllMajors(String sql) {
Connection conn = null;
PreparedStatement st = null;
ResultSet rs = null;
Major major = null;
List<Major> majors = new ArrayList<Major>();
try {
conn = getConnection();
st = conn.prepareStatement(sql);
rs = st.executeQuery(sql);
while (rs.next()) {
major = new Major();
major.setId(rs.getInt("id"));
major.setName(rs.getString("name"));
majors.add(major);
major = null;
}
return majors;
} catch (Exception e) {
throw new MyException(e);
} finally {
release(conn, st, rs);
}
}
/**
*
* @param beanHandler
* @param sql
* @return
*/
public static List<Subject> getAllSubjects(String sql) {
Connection conn = null;
PreparedStatement st = null;
ResultSet rs = null;
Subject subject = null;
List<Subject> subjects = new ArrayList<Subject>();
try {
conn = getConnection();
st = conn.prepareStatement(sql);
rs = st.executeQuery(sql);
while (rs.next()) {
subject = new Subject();
subject.setId(rs.getInt("id"));
subject.setName(rs.getString("name"));
subject.setMajorName(rs.getString("majorName"));
subjects.add(subject);
subject = null;
}
return subjects;
} catch (Exception e) {
throw new MyException(e);
} finally {
release(conn, st, rs);
}
}
/**
* ��ʱ�õ�homework���
*
* @param sql
* @throws SQLException
*/
public static void addHomework(String sql) throws SQLException {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
conn = getConnection();
ps = conn.prepareStatement(sql);
ps.executeUpdate();
} finally {
release(conn, ps, rs);
}
}
/**
* 获取给定时间的前两周的数据
*
* @param sql
* @return
*/
public static List<Notice> get2WeekNotice(String sql) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
Notice notice = null;
List<Notice> notices = new ArrayList<Notice>();
try {
conn = getConnection();
ps = conn.prepareStatement(sql);
rs = ps.executeQuery(sql);
while (rs.next()) {
notice = new Notice();
notice.setId(rs.getInt("id"));
notice.setTitle(rs.getString("title"));
notice.setContent(rs.getString("content"));
notice.setType(rs.getInt("type"));
long pubT = Long.parseLong(rs.getString("publishTime"));
notice.setPublishTime(pubT);
if (is2Week(pubT))
notices.add(notice);
notice = null;
}
return notices;
} catch (Exception e) {
throw new MyException(e);
} finally {
release(conn, ps, rs);
}
}
private static boolean is2Week(long pubT) {
long curT = System.currentTimeMillis();
if ((curT - pubT) / (1000 * 3600 * 24 * 14) < 1)
return true;
else
return false;
}
/**
* 获取客户端发布时间以后的消息
*
* @param sql
* @param lastNoticePublishTime
* @return
*/
public static List<Notice> getAfterNotice(String sql,
String lastNoticePublishTime) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
Notice notice = null;
List<Notice> notices = new ArrayList<Notice>();
try {
conn = getConnection();
ps = conn.prepareStatement(sql);
rs = ps.executeQuery(sql);
while (rs.next()) {
notice = new Notice();
notice.setId(rs.getInt("id"));
notice.setTitle(rs.getString("title"));
notice.setContent(rs.getString("content"));
notice.setType(rs.getInt("type"));
long sqlPubT = Long.parseLong(rs.getString("publishTime"));
notice.setPublishTime(sqlPubT);
if (isAfterTime(sqlPubT, lastNoticePublishTime))
notices.add(notice);
notice = null;
}
return notices;
} catch (Exception e) {
throw new MyException(e);
} finally {
release(conn, ps, rs);
}
}
/**
* 给定的时间lastNoticePublishTime是不是在查询的数据之前,是的话true
*
* @param pubT
* 查询到的数据发布时间
* @param lastNoticePublishTime
* 软件收到最后的消息时间
* @return
*/
private static boolean isAfterTime(long sqlPubT,
String lastNoticePublishTime) {
long lastTime = Long.parseLong(lastNoticePublishTime);
if ((sqlPubT - lastTime) > 0)
return true;
else
return false;
}
public static List<Homework> getAfterHomeworks(String sql,
String lastHomeworkPublishTime) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
Homework homework = null;
List<Homework> homeworks = new ArrayList<Homework>();
try {
conn = getConnection();
ps = conn.prepareStatement(sql);
rs = ps.executeQuery(sql);
while (rs.next()) {
homework = new Homework();
homework.setId(rs.getInt("id"));
homework.setId(rs.getInt("id"));
homework.setDescribe(rs.getString("content"));
homework.setImageUrl(rs.getString("imageUrl"));
homework.setLimitTime(rs.getString("limitTime"));
homework.setSubject(rs.getString("subject"));
homework.setType(rs.getString("type"));
homework.setVoiceUrl(rs.getString("voiceUrl"));
long pubT = Long.parseLong(rs.getString("publishTime"));
homework.setPublishTime(pubT);
if (isAfterTime(pubT, lastHomeworkPublishTime))
homeworks.add(homework);
homework = null;
}
return homeworks;
} catch (Exception e) {
throw new MyException(e);
} finally {
release(conn, ps, rs);
}
}
/**
* 获取给定时间的前两周的数据
*
* @param sql
* @return
*/
public static List<Homework> get2WeekHomeworks(String sql) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
Homework homework = null;
List<Homework> homeworks = new ArrayList<Homework>();
try {
conn = getConnection();
ps = conn.prepareStatement(sql);
rs = ps.executeQuery(sql);
while (rs.next()) {
homework = new Homework();
homework.setId(rs.getInt("id"));
homework.setDescribe(rs.getString("content"));
homework.setImageUrl(rs.getString("imageUrl"));
homework.setLimitTime(rs.getString("limitTime"));
homework.setSubject(rs.getString("subject"));
homework.setType(rs.getString("type"));
homework.setVoiceUrl(rs.getString("voiceUrl"));
long pubT = Long.parseLong(rs.getString("publishTime"));
homework.setPublishTime(pubT);
if (is2Week(pubT))
homeworks.add(homework);
homework = null;
}
return homeworks;
} catch (Exception e) {
throw new MyException(e);
} finally {
release(conn, ps, rs);
}
}
}
| [
"larsonzhong@163.com"
] | larsonzhong@163.com |
3f77f64a7ad9700680d3d7839731da2c258c944c | 5ac8ed5b1cc9114d9be163bc1399fbdb0a9fcf27 | /dao/src/main/java/life/catalogue/dao/SynonymDao.java | af1eec54d0589393119d116c931c017714f527bc | [
"Apache-2.0"
] | permissive | Gustibimo/backend | 7e10c128396160b2d392292771ab6d5fee0a1547 | f642e9a8cae5195586d300f6e63458a4838d12f2 | refs/heads/master | 2023-05-09T17:04:51.850281 | 2021-06-04T13:05:34 | 2021-06-04T13:05:34 | 266,219,369 | 0 | 0 | Apache-2.0 | 2020-05-22T22:28:06 | 2020-05-22T22:28:05 | null | UTF-8 | Java | false | false | 2,725 | java | package life.catalogue.dao;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import life.catalogue.api.model.DSID;
import life.catalogue.api.model.Name;
import life.catalogue.api.model.Reference;
import life.catalogue.api.model.Synonym;
import life.catalogue.api.vocab.Origin;
import life.catalogue.api.vocab.TaxonomicStatus;
import life.catalogue.db.mapper.NameMapper;
import life.catalogue.db.mapper.SynonymMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SynonymDao extends DatasetEntityDao<String, Synonym, SynonymMapper> {
private static final Logger LOG = LoggerFactory.getLogger(SynonymDao.class);
public SynonymDao(SqlSessionFactory factory) {
super(false, factory, SynonymMapper.class);
}
private static String devNull(Reference r) {
return null;
}
/**
* Creates a new Taxon including a name instance if no name id is already given.
*
* @param syn
* @param user
* @return newly created taxon id
*/
@Override
public DSID create(Synonym syn, int user) {
syn.setStatusIfNull(TaxonomicStatus.SYNONYM);
if (!syn.getStatus().isSynonym()) {
throw new IllegalArgumentException("Synonym cannot have an accepted status");
}
try (SqlSession session = factory.openSession(false)) {
final int datasetKey = syn.getDatasetKey();
Name n = syn.getName();
NameMapper nm = session.getMapper(NameMapper.class);
if (n.getId() == null) {
if (!n.isParsed() && StringUtils.isBlank(n.getScientificName())) {
throw new IllegalArgumentException("Existing nameId, scientificName or atomized name field required");
}
newKey(n);
n.setOrigin(Origin.USER);
n.applyUser(user);
// make sure we use the same dataset
n.setDatasetKey(datasetKey);
// does the name need parsing?
TaxonDao.parseName(n);
nm.create(n);
} else {
Name nExisting = nm.get(n);
if (nExisting == null) {
throw new IllegalArgumentException("No name exists with ID " + n.getId() + " in dataset " + datasetKey);
}
}
newKey(syn);
syn.setOrigin(Origin.USER);
syn.applyUser(user);
session.getMapper(SynonymMapper.class).create(syn);
session.commit();
return syn;
}
}
@Override
protected void updateAfter(Synonym t, Synonym old, int user, SynonymMapper mapper, SqlSession session) {
//TODO: update ES
}
@Override
protected void deleteAfter(DSID id, Synonym old, int user, SynonymMapper mapper, SqlSession session) {
//TODO: update ES
}
}
| [
"m.doering@mac.com"
] | m.doering@mac.com |
68c361fefead4869f1644dd9e951c5ed322b0e90 | ca7644ea4b2117d79d594f20a2126d7a43674290 | /guns-vip-main/src/main/java/cn/stylefeng/guns/modular/note/entity/QxFollow.java | db235485940fa1b74a7abdbdea93a8da4a943ba3 | [] | no_license | zihanbobo/guns-vip | b2608ad679a2527f00de25701663f1f1bc0febe5 | d3e21d6ad2bafc615963afbb961faddc88b0a0e9 | refs/heads/master | 2021-01-05T02:17:03.720838 | 2020-02-11T13:01:29 | 2020-02-11T13:01:29 | 240,840,553 | 1 | 7 | null | 2020-02-16T06:02:08 | 2020-02-16T06:02:07 | null | UTF-8 | Java | false | false | 3,184 | java | package cn.stylefeng.guns.modular.note.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
/**
* <p>
* 用户关注关系表
* </p>
*
* @author
* @since 2019-11-18
*/
@TableName("qx_follow")
public class QxFollow implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 标识
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 乐观锁
*/
@TableField("version")
private Integer version;
/**
* 创建人
*/
@TableField("created_by")
private Long createdBy;
/**
* 创建时间
*/
@TableField("created_time")
private Date createdTime;
/**
* 更新人
*/
@TableField("updated_by")
private Long updatedBy;
/**
* 更新时间
*/
@TableField("updated_time")
private Date updatedTime;
/**
* 删除标识
*/
@TableField("deleted")
private Boolean deleted;
/**
* 关注者ID
*/
@TableField("follower_id")
private Long followerId;
/**
* 被关注者
*/
@TableField("followee_id")
private Long followeeId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Long getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy;
}
public Date getUpdatedTime() {
return updatedTime;
}
public void setUpdatedTime(Date updatedTime) {
this.updatedTime = updatedTime;
}
public Boolean getDeleted() {
return deleted;
}
public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}
public Long getFollowerId() {
return followerId;
}
public void setFollowerId(Long followerId) {
this.followerId = followerId;
}
public Long getFolloweeId() {
return followeeId;
}
public void setFolloweeId(Long followeeId) {
this.followeeId = followeeId;
}
@Override
public String toString() {
return "QxFollow{" +
"id=" + id +
", version=" + version +
", createdBy=" + createdBy +
", createdTime=" + createdTime +
", updatedBy=" + updatedBy +
", updatedTime=" + updatedTime +
", deleted=" + deleted +
", followerId=" + followerId +
", followeeId=" + followeeId +
"}";
}
}
| [
"1442498046@qq.com"
] | 1442498046@qq.com |
fa46f7d3a53b4b4bd372ab5f4e088e4d7f2e9706 | 71e0994b5dd647c46eb51c78490e2493869e5546 | /Practica1ADMiguelAngel/src/FicheroSerializado/CrearYEscribirFichero.java | d05e283aa7dd13a5052610df62c77d716b858835 | [] | no_license | Lobozel/AD | 254a7527163f7f22e86792170f9198a6f564cd2d | 9f1e1d8d0e4e0b0e5f5dae741787210c0e078afd | refs/heads/master | 2020-04-05T09:06:43.868621 | 2018-11-08T18:24:50 | 2018-11-08T18:24:50 | null | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 1,932 | java | package FicheroSerializado;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
/**
*
* @author MiguelÁngel
*
*/
public class CrearYEscribirFichero {
public static void main(String[] args) {
File file = new File("C:/AD/departamentos.dat");
Departamentos[] deps;
deps = new Departamentos[3];
deps[0] = new Departamentos(1,"Tipo1","Departamento1","Domicilio1","Ciudad1",0001,"Provincia1","Pais1");
deps[1] = new Departamentos(2,"Tipo2","Departamento2","Domicilio2","Ciudad2",0002,"Provincia2","Pais2");
deps[2] = new Departamentos(3,"Tipo3","Departamento3","Domicilio3","Ciudad3",0003,"Provincia3","Pais3");
ObjectOutputStream oos;
//Si existe el ficheor primero lo elimino y luego lo creo, para crear uno vacio
if(!file.exists())
try {
file.delete();
file.createNewFile();
} catch (IOException e) {
System.out.println("Error al crear el fichero. Compruebe que puede crearse en C:'\\AD'\\.");
}
try {
oos = new ObjectOutputStream(new FileOutputStream(file));
oos.writeObject(deps[0]);
oos = new MiObjectOutputStream(new FileOutputStream(file, true));
for(int i=1;i<deps.length;i++){
oos.writeObject(deps[i]);
}
System.out.println("Fichero serializable creado correctamente.\n");
} catch (FileNotFoundException e) {
System.out.println("No se ha encontrado el fichero. Compruebe si existe en C:'\\AD'\\ o vuelva a ejecutar este programa.");
} catch (IOException e) {
System.out.println("Error al tratar la información del archivo."
+ "\nCompruebe los permisos del archivo o borrelo y vuelva a ejecutar este programa.");
}
LeerFicheroSerializado.LeerFichero(file);
CrearXMLConDOM.crearXML(deps);
}
}
| [
""
] | |
18a2accce2d8051691a6b24442782df0533f169f | 50be8c0466985aab8940e24f51860645dc112f49 | /src/org/usfirst/frc/team3729/robot/commands/mechenumDrive.java | aae99e0bf7964874e888439fb850ef037d925baf | [] | no_license | RegisJesuitRobotics/XBoxRobot | cd7cb4af84734c6930c37acf7ec254c91f81e4b1 | bd449e8007d8d02067442803c4fbc3773535e967 | refs/heads/master | 2021-01-11T08:00:26.602320 | 2016-10-27T20:19:21 | 2016-10-27T20:19:21 | 72,144,953 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 683 | java |
package org.usfirst.frc.team3729.robot.commands;
import edu.wpi.first.wpilibj.Talon;
public class mechenumDrive {
Talon RightMotor1, LeftMotor1, RightMotor2, LeftMotor2;
XboxControler _xbox;
public mechenumDrive(XboxControler xbox) {
RightMotor1 = new Talon(2);
RightMotor2 = new Talon(3);
LeftMotor1 = new Talon(1);
LeftMotor2 = new Talon(0);
this._xbox = xbox;
}
public void mechenumDrive() {
boolean leftInput = _xbox.GetLeftBumper();
boolean rightInput = _xbox.GetRightBumper();
if (leftInput == true) {
RightMotor1.set(0.5);
RightMotor2.set(0.5);
LeftMotor1.set(-0.5);
LeftMotor2.set(-0.5);
} else if (rightInput == true) {
} else {
}
}
}
| [
"thomas.wheeler@weal-har.com"
] | thomas.wheeler@weal-har.com |
4b177919e3bdd64477dcf7d3aa73886190ba1066 | 7a4de4a1abdd22dca43ee8cf4ef0b4fe2e5bfd89 | /Android/CEMS/app/src/main/java/com/cems/network/ApiInstance.java | 0ee8e64a0b9434ddbd0d5323a897062f77635369 | [
"MIT"
] | permissive | SameerBidi/College-Event-Management-System | aca4e655cdce1ef736b80d36cc2bdaa291b226c5 | e2dd7d33ef6b278badb2d510d2c7adc0251d6e8d | refs/heads/master | 2023-02-25T23:31:38.258524 | 2021-02-04T07:28:51 | 2021-02-04T07:28:51 | 320,358,456 | 7 | 0 | null | null | null | null | UTF-8 | Java | false | false | 823 | java | package com.cems.network;
import com.cems.CEMSDataStore;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiInstance {
public static ApiInterface getClient() {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(CEMSDataStore.getBaseRequestURL())
.client(client)
.addConverterFactory(GsonConverterFactory.create())
.build();
return retrofit.create(ApiInterface.class);
}
}
| [
"sambid1231998@gmail.com"
] | sambid1231998@gmail.com |
c48b0ac2fcbf150f14fbc33c61b49aee50c2b2df | 9dd5c18c48c0909b79a479d8d4178585a9f86d8f | /tema-2/giotto_tool/giotto/functionality/code/elevator/CondPosLTCall.java | b83e8b6501146bf99c37a010dc232cf80cd664d2 | [
"MIT-Modern-Variant"
] | permissive | andreeabodea/iaisc-icaf-2020-ssatr-31311-Bodea-Andreea | 0f085b8236f6843c7642b59a9f15caac6090ca0c | 5a9044cd8ace00a5f1066bea016854ab61862f49 | refs/heads/master | 2023-02-03T10:44:01.682169 | 2020-12-21T18:35:29 | 2020-12-21T18:35:29 | 302,003,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,189 | java | /*
Copyright (c) 2002-2004 The Regents of the University of California.
All rights reserved.
Permission is hereby granted, without written agreement and without
license or royalty fees, to use, copy, modify, and distribute this
software and its documentation for any purpose, provided that the above
copyright notice and the following two paragraphs appear in all copies
of this software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.
GIOTTO_COPYRIGHT_VERSION_2
COPYRIGHTENDKEY
*/
package giotto.functionality.code.elevator;
import giotto.functionality.code.BaseCondition;
import giotto.functionality.interfaces.ConditionInterface;
import giotto.functionality.table.Parameter;
import java.io.Serializable;
/**
* @author M.A.A. Sanvido
* @version CondPosLTCall.java,v 1.11 2004/09/29 03:49:43 cxh Exp
* @since Giotto 1.0.1
*/
public class CondPosLTCall extends BaseCondition implements ConditionInterface, Serializable {
/**
* @see giotto.functionality.interfaces.DriverInterface#run(Parameter)
*/
public boolean run(Parameter parameter) {
boolean [] button = ((PortButtons)parameter.getPortVariable(0)).getButtonValue();
int pos = ((PortPosition)parameter.getPortVariable(1)).getIntValue();
System.out.println("PLTC "+WaitingUp(button, pos));
return WaitingUp(button, pos);
}
static boolean WaitingUp(boolean[] b, int p) {
int i = p + 1;
while (i <= Elevator.MAX) {
if (b[i]) return true;
i++;
}
return false;
}
}
| [
"aa.bodea@yahoo.com"
] | aa.bodea@yahoo.com |
f86ed1843436cf95e8fdd05b6bdf75c4346b96f1 | dee7a4bb8f68987a080e520d5c8d9fd2c3779a79 | /src/main/java/com/cosmin/logs/StaticLogs.java | 781911a6b80f0332ad69b6c6dc1d8c1bb91b9af0 | [] | no_license | cdcdd15/07-netflix-zuul | 3716334130a04ad1b42853690d746f5d7c0e6cc5 | d44c688a7611bd13a709026840f39f463d1f5b30 | refs/heads/master | 2023-04-30T03:23:58.728749 | 2021-05-23T03:36:10 | 2021-05-23T03:36:10 | 366,366,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package com.cosmin.logs;
public class StaticLogs {
public static void staticLogs(org.slf4j.Logger log, String message) {
log.info("<info>The application 07-netflix-zuul - {}.", message);
log.error("<error>The application 07-netflix-zuul - {}.", message);
log.debug("<debug>The application 07-netflix-zuul - {}.", message);
}
}
| [
"cdcdd15@gmail.com"
] | cdcdd15@gmail.com |
5e1cfe4998a0a1cfcd833109df840c68c52fbea2 | 2bf0681b131f0d470d8db274fe6aca05a0404fc9 | /neighbour.java | 7f4e46aae11e27a7fe806b69706153a74586b59b | [] | no_license | jesusglzbernal/k-knn | cc1b3dee24c9b42890661f3f5dd27664a7206a02 | f7d107fc40260a9beef67822255a80511d4193f0 | refs/heads/master | 2021-01-17T16:46:24.163956 | 2016-10-25T04:22:40 | 2016-10-25T04:22:40 | 71,849,190 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,373 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package kknn;
import java.util.Comparator;
/**
*
* @author jagonzalez
* Class to compare a query instance with its neighbors, a comparator
*/
class neighbour implements Comparable<neighbour>
{
int number; // Number of neighbor
double dist; // Distance to this neighbor
String sclass; // Class of this neighbor
// Constructor, sets the number, distance, and class to 0, 0.0 and ""
public neighbour ()
{
this.number = 0;
this.dist = 0.0;
this.sclass = "";
}
// Constructor, stores the number, distance and class
public neighbour(int mn, double md, String mc)
{
this.number = mn;
this.dist = md;
this.sclass = mc;
}
// Returns the distance of this neighbor
public double getDistance()
{
return this.dist;
}
@Override
public int compareTo(neighbour o)
{
throw new UnsupportedOperationException("Not supported yet.");
}
// Compares 2 instances, returns the result of the comparison
public static class sorter implements Comparator<neighbour>
{
@Override
public int compare(neighbour o1, neighbour o2)
{
return o1.dist > o2.dist ? 1 : (o1.dist < o2.dist ? -1 : 0);
}
}
}
| [
"jesus.glzbernal@gmail.com"
] | jesus.glzbernal@gmail.com |
c0fb1da791163b3362f0024a425c5e5918515b6c | fbd82cd2ef2160888452f42f78944c86f9bf1798 | /runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/InternalWidgets.java | 2a553053ec65507fb1b50aeffe5245343cb31ce8 | [
"MIT",
"Apache-2.0"
] | permissive | shedaniel/RoughlyEnoughItems | 755462e1cbd51b5775c55010431af27517c3d985 | 722ed4ee3c5ac615a533b2b993e4325742b5aee4 | refs/heads/11.x-1.19.4 | 2023-08-27T14:58:19.445094 | 2023-08-09T07:52:50 | 2023-08-09T07:52:50 | 162,705,739 | 321 | 104 | NOASSERTION | 2023-08-10T03:22:25 | 2018-12-21T11:21:36 | Java | UTF-8 | Java | false | false | 13,622 | java | /*
* This file is licensed under the MIT License, part of Roughly Enough Items.
* Copyright (c) 2018, 2019, 2020, 2021, 2022, 2023 shedaniel
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package me.shedaniel.rei.impl.client.gui.widget;
import com.google.common.base.Suppliers;
import com.mojang.blaze3d.vertex.PoseStack;
import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.math.impl.PointHelper;
import me.shedaniel.rei.api.client.config.ConfigObject;
import me.shedaniel.rei.api.client.gui.DrawableConsumer;
import me.shedaniel.rei.api.client.gui.Renderer;
import me.shedaniel.rei.api.client.gui.widgets.*;
import me.shedaniel.rei.api.client.registry.display.DisplayCategory;
import me.shedaniel.rei.api.common.display.Display;
import me.shedaniel.rei.impl.ClientInternals;
import me.shedaniel.rei.impl.client.gui.ScreenOverlayImpl;
import me.shedaniel.rei.impl.client.gui.toast.CopyRecipeIdentifierToast;
import me.shedaniel.rei.impl.client.gui.widget.basewidgets.*;
import me.shedaniel.rei.impl.client.gui.widget.favorites.FavoritesListWidget;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.FormattedText;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.ApiStatus;
import org.joml.Matrix4f;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
@ApiStatus.Internal
@Environment(EnvType.CLIENT)
public final class InternalWidgets {
private InternalWidgets() {}
public static Widget createAutoCraftingButtonWidget(Rectangle displayBounds, Rectangle rectangle, Component text, Supplier<Display> displaySupplier, Supplier<Collection<ResourceLocation>> idsSupplier, List<Widget> setupDisplay, DisplayCategory<?> category) {
Button autoCraftingButton = Widgets.createButton(rectangle, text)
.focusable(false)
.onClick(button -> {
AutoCraftingEvaluator.evaluateAutoCrafting(true, Screen.hasShiftDown(), displaySupplier.get(), idsSupplier);
});
return new DelegateWidget(autoCraftingButton) {
final Supplier<AutoCraftingEvaluator.AutoCraftingResult> result = Suppliers.memoizeWithExpiration(
() -> AutoCraftingEvaluator.evaluateAutoCrafting(false, false, displaySupplier.get(), idsSupplier),
1000, TimeUnit.MILLISECONDS
);
@Override
public void render(PoseStack poses, int mouseX, int mouseY, float delta) {
AutoCraftingEvaluator.AutoCraftingResult result = this.result.get();
autoCraftingButton.setEnabled(result.successful);
autoCraftingButton.setTint(result.tint);
if (result.hasApplicable) {
autoCraftingButton.setText(text);
} else {
autoCraftingButton.setText(Component.literal("!"));
}
if (result.hasApplicable && (containsMouse(mouseX, mouseY) || autoCraftingButton.isFocused()) && result.renderer != null) {
result.renderer.render(poses, mouseX, mouseY, delta, setupDisplay, displayBounds, displaySupplier.get());
}
this.widget.render(poses, mouseX, mouseY, delta);
if (!autoCraftingButton.isFocused() && containsMouse(mouseX, mouseY)) {
tryTooltip(result, new Point(mouseX, mouseY));
} else if (autoCraftingButton.isFocused()) {
Rectangle bounds = autoCraftingButton.getBounds();
tryTooltip(result, new Point(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2));
}
}
private void tryTooltip(AutoCraftingEvaluator.AutoCraftingResult result, Point point) {
if (result.tooltipRenderer != null) {
result.tooltipRenderer.accept(point, Tooltip::queue);
}
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
if (displaySupplier.get().getDisplayLocation().isPresent() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesKey(keyCode, scanCode) && containsMouse(PointHelper.ofMouse())) {
minecraft.keyboardHandler.setClipboard(displaySupplier.get().getDisplayLocation().get().toString());
if (ConfigObject.getInstance().isToastDisplayedOnCopyIdentifier()) {
CopyRecipeIdentifierToast.addToast(I18n.get("msg.rei.copied_recipe_id"), I18n.get("msg.rei.recipe_id_details", displaySupplier.get().getDisplayLocation().get().toString()));
}
return true;
} else if (ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.ofMouse())) {
if (ConfigObject.getInstance().getFavoriteKeyCode().matchesKey(keyCode, scanCode)) {
FavoritesListWidget favoritesListWidget = ScreenOverlayImpl.getFavoritesListWidget();
if (favoritesListWidget != null) {
favoritesListWidget.displayHistory.addDisplay(displayBounds.clone(), displaySupplier.get());
return true;
}
}
}
return super.keyPressed(keyCode, scanCode, modifiers);
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
if (displaySupplier.get().getDisplayLocation().isPresent() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesMouse(button) && containsMouse(PointHelper.ofMouse())) {
minecraft.keyboardHandler.setClipboard(displaySupplier.get().getDisplayLocation().get().toString());
if (ConfigObject.getInstance().isToastDisplayedOnCopyIdentifier()) {
CopyRecipeIdentifierToast.addToast(I18n.get("msg.rei.copied_recipe_id"), I18n.get("msg.rei.recipe_id_details", displaySupplier.get().getDisplayLocation().get().toString()));
}
return true;
} else if (ConfigObject.getInstance().isFavoritesEnabled() && containsMouse(PointHelper.ofMouse())) {
if (ConfigObject.getInstance().getFavoriteKeyCode().matchesMouse(button)) {
FavoritesListWidget favoritesListWidget = ScreenOverlayImpl.getFavoritesListWidget();
if (favoritesListWidget != null) {
favoritesListWidget.displayHistory.addDisplay(displayBounds.clone(), displaySupplier.get());
return true;
}
}
}
return super.mouseClicked(mouseX, mouseY, button);
}
};
}
public static WidgetWithBounds wrapLateRenderable(Widget widget) {
return new LateRenderableWidget(widget);
}
public static Widget concatWidgets(List<Widget> widgets) {
return new MergedWidget(widgets);
}
private static class LateRenderableWidget extends DelegateWidget implements LateRenderable {
private LateRenderableWidget(Widget widget) {
super(widget);
}
}
public static void attach() {
ClientInternals.attachInstance(new WidgetsProvider(), ClientInternals.WidgetsProvider.class);
}
private static class WidgetsProvider implements ClientInternals.WidgetsProvider {
@Override
public boolean isRenderingPanel(Panel panel) {
return PanelWidget.isRendering(panel);
}
@Override
public Widget wrapVanillaWidget(GuiEventListener element) {
if (element instanceof Widget) return (Widget) element;
return new VanillaWrappedWidget(element);
}
@Override
public WidgetWithBounds wrapRenderer(Supplier<Rectangle> bounds, Renderer renderer) {
return new RendererWrappedWidget(renderer, bounds);
}
@Override
public WidgetWithBounds withTranslate(WidgetWithBounds widget, Supplier<Matrix4f> translate) {
return new DelegateWidgetWithTranslate(widget, translate);
}
@Override
public Widget createDrawableWidget(DrawableConsumer drawable) {
return new DrawableWidget(drawable);
}
@Override
public Slot createSlot(Point point) {
return new EntryWidget(point);
}
@Override
public Slot createSlot(Rectangle bounds) {
return new EntryWidget(bounds);
}
@Override
public Button createButton(Rectangle bounds, Component text) {
return new ButtonWidget(bounds, text);
}
@Override
public Panel createPanelWidget(Rectangle bounds) {
return new PanelWidget(bounds);
}
@Override
public Label createLabel(Point point, FormattedText text) {
return new LabelWidget(point, text);
}
@Override
public Arrow createArrow(Rectangle rectangle) {
return new ArrowWidget(rectangle);
}
@Override
public BurningFire createBurningFire(Rectangle rectangle) {
return new BurningFireWidget(rectangle);
}
@Override
public DrawableConsumer createTexturedConsumer(ResourceLocation texture, int x, int y, int width, int height, float u, float v, int uWidth, int vHeight, int textureWidth, int textureHeight) {
return new TexturedDrawableConsumer(texture, x, y, width, height, u, v, uWidth, vHeight, textureWidth, textureHeight);
}
@Override
public DrawableConsumer createFillRectangleConsumer(Rectangle rectangle, int color) {
return new FillRectangleDrawableConsumer(rectangle, color);
}
@Override
public Widget createShapelessIcon(Point point) {
int magnification;
double scale = Minecraft.getInstance().getWindow().getGuiScale();
if (scale >= 1 && scale <= 4 && scale == Math.floor(scale)) {
magnification = (int) scale;
} else if (scale > 4 && scale == Math.floor(scale)) {
magnification = 1;
for (int i = 4; i >= 1; i--) {
if (scale % i == 0) {
magnification = i;
break;
}
}
} else {
magnification = 4;
}
Rectangle bounds = new Rectangle(point.getX() - 9, point.getY() + 1, 8, 8);
Widget widget = Widgets.createTexturedWidget(new ResourceLocation("roughlyenoughitems:textures/gui/shapeless_icon_" + magnification + "x.png"), bounds.getX(), bounds.getY(), 0, 0, bounds.getWidth(), bounds.getHeight(), 1, 1, 1, 1);
return Widgets.withTooltip(Widgets.withBounds(widget, bounds),
Component.translatable("text.rei.shapeless"));
}
@Override
public Widget concatWidgets(List<Widget> widgets) {
return InternalWidgets.concatWidgets(widgets);
}
@Override
public WidgetWithBounds noOp() {
return NoOpWidget.INSTANCE;
}
@Override
public WidgetWithBounds wrapOverflow(Rectangle bounds, WidgetWithBounds widget) {
return new OverflowWidget(bounds, new PaddedCenterWidget(bounds, widget));
}
@Override
public WidgetWithBounds wrapPadded(int padLeft, int padRight, int padTop, int padBottom, WidgetWithBounds widget) {
return new PaddedWidget(padLeft, padRight, padTop, padBottom, widget);
}
}
}
| [
"daniel@shedaniel.me"
] | daniel@shedaniel.me |
4e401be74006340d8439eddade5a62a9bb7384d6 | 0f40515ff42537ef193dc505ccf825de7fc21558 | /app/src/main/java/com/example/space/ravenmessenger/ui/adapters/ListMessageAdapter.java | f1786070042a94f7f907c25f07b6b3749c7ba3a1 | [
"BSD-3-Clause"
] | permissive | SabraTech/Raven-Messenger | 1d77ec31f088779823604b088293d06175aa5c26 | 483b7b6eeb54df76c8dc9e827b7767ce5ef6ca86 | refs/heads/master | 2021-03-22T03:24:53.627346 | 2020-04-04T01:46:08 | 2020-04-04T01:46:08 | 106,309,204 | 15 | 10 | null | null | null | null | UTF-8 | Java | false | false | 14,327 | java | package com.example.space.ravenmessenger.ui.adapters;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.widget.RecyclerView;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.space.ravenmessenger.R;
import com.example.space.ravenmessenger.data.StaticConfig;
import com.example.space.ravenmessenger.encryption.CipherHandler;
import com.example.space.ravenmessenger.models.Conversation;
import com.example.space.ravenmessenger.models.Message;
import com.example.space.ravenmessenger.ui.activities.ChatActivity;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.squareup.picasso.Callback;
import com.squareup.picasso.NetworkPolicy;
import com.squareup.picasso.Picasso;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import de.hdodenhof.circleimageview.CircleImageView;
public class ListMessageAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private Context context;
private Conversation conversation;
private HashMap<String, Bitmap> bitmapHashMapAvatar;
private HashMap<String, DatabaseReference> referenceHashMapAvatar;
private Bitmap bitmapAvatarUser;
private DatabaseReference usersReference;
public ListMessageAdapter(Context context, Conversation conversation, HashMap<String, Bitmap> bitmapHashMapAvatar, Bitmap bitmapAvatarUser) {
this.context = context;
this.conversation = conversation;
this.bitmapHashMapAvatar = bitmapHashMapAvatar;
this.bitmapAvatarUser = bitmapAvatarUser;
referenceHashMapAvatar = new HashMap<>();
usersReference = FirebaseDatabase.getInstance().getReference().child("user");
usersReference.keepSynced(true);
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == ChatActivity.VIEW_TYPE_FRIEND_MESSAGE) {
View view = LayoutInflater.from(context).inflate(R.layout.rc_item_message_friend, parent, false);
return new ItemMessageFriendHolder(view);
} else if (viewType == ChatActivity.VIEW_TYPE_USER_MESSAGE) {
View view = LayoutInflater.from(context).inflate(R.layout.rc_item_message_user, parent, false);
return new ItemMessageUserHolder(view);
}
return null;
}
@Override
public void onBindViewHolder(final RecyclerView.ViewHolder holder, final int position) {
String time = new SimpleDateFormat("EEE, d MMM yyyy").format(new Date(conversation.getMessages().get(position).timestamp));
String today = new SimpleDateFormat("EEE, d MMM yyyy").format(new Date(System.currentTimeMillis()));
if (holder instanceof ItemMessageFriendHolder) {
if (today.equals(time)) {
((ItemMessageFriendHolder) holder).txtTime.setText(new SimpleDateFormat("HH:mm").format(new Date(conversation.getMessages().get(position).timestamp)));
} else {
((ItemMessageFriendHolder) holder).txtTime.setText(new SimpleDateFormat("MMM d").format(new Date(conversation.getMessages().get(position).timestamp)));
}
if (conversation.getMessages().get(position).type == Message.TEXT) {
((ItemMessageFriendHolder) holder).imageContent.setVisibility(View.INVISIBLE);
((ItemMessageFriendHolder) holder).txtContent.setVisibility(View.VISIBLE);
((ItemMessageFriendHolder) holder).txtContent.setText(CipherHandler.decrypt(conversation.getMessages().get(position).text));
((ItemMessageFriendHolder) holder).txtContent.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("message", CipherHandler.decrypt(conversation.getMessages().get(position).text));
clipboard.setPrimaryClip(clip);
Toast.makeText(context, "Message Copied!", Toast.LENGTH_SHORT).show();
return true;
}
});
Bitmap currentAvatar = bitmapHashMapAvatar.get(conversation.getMessages().get(position).idSender);
if (currentAvatar != null) {
((ItemMessageFriendHolder) holder).avatar.setImageBitmap(currentAvatar);
} else {
final String id = conversation.getMessages().get(position).idSender;
if (referenceHashMapAvatar.get(id) == null) {
referenceHashMapAvatar.put(id, usersReference.child(id).child("avatar"));
referenceHashMapAvatar.get(id).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.getValue() != null) {
String avatarString = (String) dataSnapshot.getValue();
if (!avatarString.equals(StaticConfig.STR_DEFAULT_BASE64)) {
byte[] decodedString = Base64.decode(avatarString, Base64.DEFAULT);
ChatActivity.bitmapAvatarFriend.put(id, BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length));
} else {
ChatActivity.bitmapAvatarFriend.put(id, BitmapFactory.decodeResource(context.getResources(), R.drawable.default_avatar));
}
notifyDataSetChanged();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
}
} else if (conversation.getMessages().get(position).type == Message.IMAGE) {
((ItemMessageFriendHolder) holder).txtContent.setVisibility(View.INVISIBLE);
((ItemMessageFriendHolder) holder).txtContent.setPadding(0, 0, 0, 0);
((ItemMessageFriendHolder) holder).imageContent.setVisibility(View.VISIBLE);
Picasso.with(context).load(CipherHandler.decrypt(conversation.getMessages().get(position).text)).fit().centerCrop().networkPolicy(NetworkPolicy.OFFLINE).placeholder(R.drawable.default_image).config(Bitmap.Config.RGB_565).into(((ItemMessageFriendHolder) holder).imageContent, new Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError() {
Picasso.with(context).load(CipherHandler.decrypt(conversation.getMessages().get(position).text)).fit().centerCrop().placeholder(R.drawable.default_image).config(Bitmap.Config.RGB_565).into(((ItemMessageFriendHolder) holder).imageContent);
}
});
Bitmap currentAvatar = bitmapHashMapAvatar.get(conversation.getMessages().get(position).idSender);
if (currentAvatar != null) {
((ItemMessageFriendHolder) holder).avatar.setImageBitmap(currentAvatar);
} else {
final String id = conversation.getMessages().get(position).idSender;
if (referenceHashMapAvatar.get(id) == null) {
referenceHashMapAvatar.put(id, usersReference.child(id).child("avatar"));
referenceHashMapAvatar.get(id).addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if (dataSnapshot.getValue() != null) {
String avatarString = (String) dataSnapshot.getValue();
if (!avatarString.equals(StaticConfig.STR_DEFAULT_BASE64)) {
byte[] decodedString = Base64.decode(avatarString, Base64.DEFAULT);
ChatActivity.bitmapAvatarFriend.put(id, BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length));
} else {
ChatActivity.bitmapAvatarFriend.put(id, BitmapFactory.decodeResource(context.getResources(), R.drawable.default_avatar));
}
notifyDataSetChanged();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
}
}
} else if (holder instanceof ItemMessageUserHolder) {
if (today.equals(time)) {
((ItemMessageUserHolder) holder).txtTime.setText(new SimpleDateFormat("HH:mm").format(new Date(conversation.getMessages().get(position).timestamp)));
} else {
((ItemMessageUserHolder) holder).txtTime.setText(new SimpleDateFormat("MMM d").format(new Date(conversation.getMessages().get(position).timestamp)));
}
if (conversation.getMessages().get(position).type == Message.TEXT) {
((ItemMessageUserHolder) holder).imageContent.setVisibility(View.INVISIBLE);
((ItemMessageUserHolder) holder).txtContent.setVisibility(View.VISIBLE);
((ItemMessageUserHolder) holder).txtContent.setText(CipherHandler.decrypt(conversation.getMessages().get(position).text));
((ItemMessageUserHolder) holder).txtContent.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("message", CipherHandler.decrypt(conversation.getMessages().get(position).text));
clipboard.setPrimaryClip(clip);
Toast.makeText(context, "Message Copied!", Toast.LENGTH_SHORT).show();
return true;
}
});
if (bitmapAvatarUser != null) {
((ItemMessageUserHolder) holder).avatar.setImageBitmap(bitmapAvatarUser);
}
} else if (conversation.getMessages().get(position).type == Message.IMAGE) {
((ItemMessageUserHolder) holder).txtContent.setVisibility(View.INVISIBLE);
((ItemMessageUserHolder) holder).txtContent.setPadding(0, 0, 0, 0);
((ItemMessageUserHolder) holder).imageContent.setVisibility(View.VISIBLE);
Picasso.with(context).load(CipherHandler.decrypt(conversation.getMessages().get(position).text)).fit().centerCrop().networkPolicy(NetworkPolicy.OFFLINE).placeholder(R.drawable.default_image).config(Bitmap.Config.RGB_565).into(((ItemMessageUserHolder) holder).imageContent, new Callback() {
@Override
public void onSuccess() {
}
@Override
public void onError() {
Picasso.with(context).load(CipherHandler.decrypt(conversation.getMessages().get(position).text)).fit().centerCrop().placeholder(R.drawable.default_image).config(Bitmap.Config.RGB_565).into(((ItemMessageUserHolder) holder).imageContent);
}
});
if (bitmapAvatarUser != null) {
((ItemMessageUserHolder) holder).avatar.setImageBitmap(bitmapAvatarUser);
}
}
}
}
@Override
public int getItemCount() {
return conversation.getMessages().size();
}
@Override
public int getItemViewType(int position) {
String currentUid = FirebaseAuth.getInstance().getCurrentUser().getUid();
if (conversation.getMessages().get(position).idSender.equals(currentUid)) {
return ChatActivity.VIEW_TYPE_USER_MESSAGE;
} else {
return ChatActivity.VIEW_TYPE_FRIEND_MESSAGE;
}
}
}
class ItemMessageUserHolder extends RecyclerView.ViewHolder {
public TextView txtContent;
public TextView txtTime;
public CircleImageView avatar;
public ImageView imageContent;
public ItemMessageUserHolder(View view) {
super(view);
txtContent = view.findViewById(R.id.textContentUser);
txtTime = view.findViewById(R.id.timeContentUser);
imageContent = view.findViewById(R.id.imageContentUser);
avatar = view.findViewById(R.id.image_view_user);
}
}
class ItemMessageFriendHolder extends RecyclerView.ViewHolder {
public TextView txtContent;
public TextView txtTime;
public CircleImageView avatar;
public ImageView imageContent;
public ItemMessageFriendHolder(View view) {
super(view);
txtContent = view.findViewById(R.id.textContentFriend);
txtTime = view.findViewById(R.id.timeContentFriend);
imageContent = view.findViewById(R.id.imageContentFriend);
avatar = view.findViewById(R.id.image_view_friend);
}
}
| [
"mohamed2006fs@gmail.com"
] | mohamed2006fs@gmail.com |
0cf97f68868cc8df8bdbad7c415c2ce46dda41b8 | 45e81e93fb18cf731c6be8462dd100bc8871cb9f | /jeemicro/src/main/java/com/jeemicro/weixin/modules/cms/entity/CmsOrder.java | 8d8de71fd8dcda5624d378d0721a92169732f555 | [
"Apache-2.0"
] | permissive | yixinsiyu/microsite | 1094d65b1c5c245329acd8975e169f23e4494255 | 8269fd04668dcfd88b7a9751415b2e495a231bc8 | refs/heads/master | 2020-03-19T15:33:52.929362 | 2018-06-09T07:26:45 | 2018-06-09T07:26:45 | 136,675,760 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,668 | java | /**
* Copyright © 2012-2016 < All rights reserved.
*/
package com.jeemicro.weixin.modules.cms.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.jeemicro.weixin.common.persistence.DataEntity;
/**
* 余票Entity
* @author h
* @version 2018-04-05
*/
public class CmsOrder extends DataEntity<CmsOrder> {
private static final long serialVersionUID = 1L;
private Date orderTime; // 时间
private int orderMp; // 上午余票
private int orderAp; // 下午余票
private int orderTotal;
private int orderMpTotal;
public int getOrderMpTotal() {
return orderMpTotal;
}
public void setOrderMpTotal(int orderMpTotal) {
this.orderMpTotal = orderMpTotal;
}
private int orderVersion;
public int getOrderVersion() {
return orderVersion;
}
public void setOrderVersion(int orderVersion) {
this.orderVersion = orderVersion;
}
public int getOrderTotal() {
return orderTotal;
}
public void setOrderTotal(int orderTotal) {
this.orderTotal = orderTotal;
}
public CmsOrder() {
super();
}
public CmsOrder(String id){
super(id);
}
@JsonFormat(pattern = "yyyy-MM-dd")
@NotNull(message="时间不能为空")
public Date getOrderTime() {
return orderTime;
}
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public int getOrderMp() {
return orderMp;
}
public void setOrderMp(int orderMp) {
this.orderMp = orderMp;
}
public int getOrderAp() {
return orderAp;
}
public void setOrderAp(int orderAp) {
this.orderAp = orderAp;
}
} | [
"jinghua.zhao@atos.net"
] | jinghua.zhao@atos.net |
53ace5d2a6ef8eaaed8d8194bc287c89a42df9ca | 1f12cd3a174e4eceea1072657d2ee70056404856 | /6.排序/src/com/atguigu/mysort/MySelectSort.java | 754fc9d73ec92c97526d1f5e60d9a878377c6a35 | [] | no_license | youjia10dai/DataStructureAndAlgorithm | aa44bb0f0c36a6e38eecaf831fc59fb0603f3a46 | 491f502b15a26ad884665c626274cefccc12db9b | refs/heads/master | 2022-09-20T18:39:57.485797 | 2022-09-14T08:31:23 | 2022-09-14T08:31:23 | 229,234,583 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,804 | java | package com.atguigu.mysort;
import java.util.Arrays;
import java.util.stream.Collectors;
/**
* @Author: chenlj
* @CreateTime: 2020-01-14 16:04
* @Description: 选择排序
*/
public class MySelectSort {
public static void main(String[] args) {
int[] array = {3, 9, -1, 10, 20, -96, 78, 23, 12, 63};
printArray(array);
selectSort(array);
printArray(array);
}
/**
* 每次选择出最小值(一个个选出来,就有序了)
* 1. 选择排序一共有 数组大小 - 1 轮排序
* 2. 每1轮排序,又是一个循环, 循环的规则(代码)
* 2.1先假定当前这个数是最小数
* 2.2 然后和后面的每个数进行比较,如果发现有比当前数更小的数,就重新确定最小数,并得到下标
* 2.3 当遍历到数组的最后时,就得到本轮最小数和下标
*
* @param array 数组
*/
private static void selectSort(int[] array) {
int loopCount = array.length -1;
for(int i = 0; i < loopCount; i++) {
int min = array[i];
int minIndex = i;
for(int j = i + 1; j < array.length; j++) {
if(min > array[j]) {
min = array[j];
minIndex = j;
}
}
if(minIndex != i) {
change(array, i, minIndex);
}
}
}
private static void change(int[] array, int first, int second) {
int temp = array[first];
array[first] = array[second];
array[second] = temp;
}
private static void printArray(int[] array) {
String collect = Arrays.stream(array).mapToObj(x -> x + "").collect(Collectors.joining(",", "----", "----"));
System.out.println(collect);
}
}
| [
"chenlj@royasoft.com.cn"
] | chenlj@royasoft.com.cn |
a05d7935a6dd480028b134f1e4cea88f1e8511b0 | 92de71038cb15e8db0944ad8bd3050edf7b5ffc4 | /app/src/main/java/catgirl/oneesama/activity/browseseriespage/fragment/BrowseSeriesPageModule.java | e1015293be38022b1ed9ae9a286913f1c068a5bf | [
"MIT"
] | permissive | DefiantCatgirl/Oneesama | c233a393d077649a0cef13fac22c5e717e7021dc | d98e9e43db0acdce63da098200035432c0f52618 | refs/heads/master | 2020-12-23T14:07:43.883417 | 2016-08-09T08:56:40 | 2016-08-09T08:56:40 | 42,416,974 | 10 | 1 | null | 2016-03-14T17:08:13 | 2015-09-13T23:32:13 | Java | UTF-8 | Java | false | false | 1,143 | java | package catgirl.oneesama.activity.browseseriespage.fragment;
import catgirl.oneesama.activity.browseseriespage.fragment.data.BrowseSeriesPageProvider;
import catgirl.oneesama.activity.browseseriespage.fragment.data.BrowseSeriesPageToLocalProvider;
import catgirl.oneesama.activity.browseseriespage.fragment.presenter.BrowseSeriesPagePresenter;
import catgirl.oneesama.data.network.api.DynastyService;
import catgirl.oneesama.data.realm.RealmProvider;
import dagger.Module;
import dagger.Provides;
@Module
public class BrowseSeriesPageModule {
@Provides
public BrowseSeriesPageProvider getProvider(DynastyService api) {
return new BrowseSeriesPageProvider(api);
}
@Provides
public BrowseSeriesPageToLocalProvider getToLocalProvider(RealmProvider realmProvider) {
return new BrowseSeriesPageToLocalProvider(realmProvider);
}
@Provides
public BrowseSeriesPagePresenter getPresenter(
BrowseSeriesPageProvider seriesPageProvider,
BrowseSeriesPageToLocalProvider toLocalProvider) {
return new BrowseSeriesPagePresenter(seriesPageProvider, toLocalProvider);
}
}
| [
"defiantcatgirl@gmail.com"
] | defiantcatgirl@gmail.com |
d134f97e06a98148cfb50ba8a328b1e0cc480eff | 68fa71b59701771ecc568301e1c51088fe5e2c44 | /ch02/src/p46/LongExample.java | d9449680cc4bd9fceaf89fd8aacb91f395f7e3c6 | [] | no_license | smilwant/java | 4f2be647081708b6c2d9a75776b61d3014b35d1c | 2dfd780adee08a182f2ec66ae7407c93c0f0eab8 | refs/heads/master | 2020-06-05T06:33:27.326662 | 2019-06-17T13:03:58 | 2019-06-17T13:03:58 | 192,346,245 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 364 | java | package p46;
public class LongExample {
public static void main(String[] args) {
long var1 = 10;
long var2 = 20L;
// long var3 = 1000000000000; // int의 저장범위를 넘어서는 경우 정수에 L을 붙여야함
long var4 = 1000000000000L;
System.out.println(var1);
System.out.println(var2);
System.out.println(var4);
}
}
| [
"java@user-PC"
] | java@user-PC |
2c6c23d25aae349589938171e0c83bce9d00421c | f97ba375da68423d12255fa8231365104867d9b0 | /study-notes/j2ee-collection/framework/00-项目驱动/52_oldjiakao/src/main/java/com/sq/jk/pojo/po/School.java | b1d815c4bcf9992c277aedd661df7d2856767734 | [
"MIT"
] | permissive | lei720/coderZsq.practice.server | 7a728612e69c44e0877c0153c828b50d8ea7fa7c | 4ddf9842cd088d4a0c2780ac22d41d7e6229164b | refs/heads/master | 2023-07-16T11:21:26.942849 | 2021-09-08T04:38:07 | 2021-09-08T04:38:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,467 | java | package com.sq.jk.pojo.po;
import java.math.BigDecimal;
public class School {
private Long id;
private String name;
private String address;
private BigDecimal longitude;
private BigDecimal latitude;
private Long provinceId;
private Long cityId;
private String intro;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public Long getProvinceId() {
return provinceId;
}
public void setProvinceId(Long provinceId) {
this.provinceId = provinceId;
}
public Long getCityId() {
return cityId;
}
public void setCityId(Long cityId) {
this.cityId = cityId;
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro;
}
} | [
"a13701777868@yahoo.com"
] | a13701777868@yahoo.com |
a0adb58f0d6aee6cdc60d402424799db695b5602 | 8ae04877daf96b5ad00b31eeeb7477cc60a07ff7 | /src/main/java/com/esports/entities/ParentEntity.java | c24c247aa42987d70ecfe363e70fdd7365f847f9 | [] | no_license | dineshkmr269/esports-common-entities | f6d1e14d0a5e1b54bd02d7c0bff94b6da7b5d042 | 15842e80e140dccc7db722a5d09b061ff1e8cf8e | refs/heads/master | 2022-09-28T02:07:37.015179 | 2020-06-07T13:11:25 | 2020-06-07T13:11:25 | 266,685,567 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 721 | java | package com.esports.entities;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Version;
import lombok.Data;
@Data
@MappedSuperclass
public class ParentEntity implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected Long id;
protected Date createdAt;
protected Date updatedAt;
protected String createdBy;
protected String updatedBy;
protected boolean active=true;
@Version
private Integer version;
}
| [
"dinesh.kumar1@adda247.com"
] | dinesh.kumar1@adda247.com |
d08b6bc01b9d3d16f8b5c7a22a984b7109635a54 | 348ba071afe0f07036dd41c4dccf44104f047d3f | /src/main/java/com/airline/controllers/AddPilot.java | 8bb659405b846ee60ed9395b47bc9ec275cdf7a8 | [] | no_license | zat-is-me/maven-airline-webApp- | 272f689fdcf2048e5f8029861ff228ddbdf39b74 | aee00913679a442f2291506694d604aa5d377d27 | refs/heads/master | 2022-12-30T04:43:43.232352 | 2020-06-13T04:24:52 | 2020-06-13T04:24:52 | 271,939,114 | 0 | 0 | null | 2020-10-13T22:45:41 | 2020-06-13T04:20:02 | Java | UTF-8 | Java | false | false | 1,419 | java | package com.airline.controllers;
import java.io.IOException;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.airline.models.Pilot;
import com.airline.models.PilotRank;
import com.airline.service.PilotService;
/**
* Servlet implementation class AddPilot
*/
@WebServlet("/AddPilot")
public class AddPilot extends HttpServlet {
private static final long serialVersionUID = 1L;
@EJB
PilotService ps;
/**
* @see HttpServlet#HttpServlet()
*/
public AddPilot() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Pilot p = new Pilot();
p.setFirstName("Griselda");
p.setLastName("Cavendish");
p.setPilotRank(PilotRank.Captain);
p.setPilotLicense(178245);
ps.addPilot(p);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}
}
| [
"taahm1@morgan.edu"
] | taahm1@morgan.edu |
7158f3f4ed4e2a49f8a62b128344f53d9c90a85b | 91ac53081a99c28bc3a1dfa73bd7d0151e42ec2f | /com/divergent/stringpool/question/StringPoolUsed1.java | 8ffdd481d6d430e4ca71988176044ba5a69cc6b5 | [] | no_license | prateekpatel-divergent/String-Number-Thread-Question | f6e1239ca3315efcebb66ff29d5a91c1a48a8241 | 6c43c758333a463ce67b4ed5389a65db1b7a6bda | refs/heads/master | 2023-03-21T23:22:24.877597 | 2021-03-12T06:44:12 | 2021-03-12T06:51:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package com.divergent.stringpool.question;
public class StringPoolUsed1 {
public static void main(String[] args) {
String s1 = new String("Hello");
String s2 = new String("Hello").intern();
System.out.println((s1==s2));
}
}
| [
"prateek.patel@divergentsl.com"
] | prateek.patel@divergentsl.com |
d1cdd503f9b3f6e8adff6161826e36b12db3f2f9 | 356fb54bfcbf1e82809999912f37688d02a3c0e6 | /Car.java | 608527430f5fd841fa735dd098d5ee8fff7575c1 | [] | no_license | matuszm92/zapro20Git1 | 1a363ca109bd92cd7cd1cec6904c3d7fcb3cf449 | 4e5e1872978248dee6966ff8e169bc7581fd10b7 | refs/heads/master | 2022-07-30T05:01:19.684253 | 2020-05-20T16:12:02 | 2020-05-20T16:12:02 | 265,602,900 | 0 | 0 | null | 2020-05-20T16:12:04 | 2020-05-20T15:09:58 | Java | UTF-8 | Java | false | false | 35 | java | class Car {
public String name;
} | [
"marcel.matuszak@gmail.com"
] | marcel.matuszak@gmail.com |
6b57884bf2fb4f65917ca616dfed85f0fe2a7d01 | 520099942a522d8cf778327b6d0fe94727a094f6 | /src/com/gmail/justinxvopro/JavaFXTutorial/calculator/PostFixInterpreter.java | 5f4883e49f0718276989f69036f934dc3ea0b7b2 | [] | no_license | jvogit/JavaFXTutorial | a8c93bceeb5f7946e6e49e8fe2dbc4db9498732c | 8cc27a96c9ce29d92e3dc593603f2fb40a5dc9ba | refs/heads/master | 2020-04-20T23:57:19.678483 | 2019-03-21T07:26:08 | 2019-03-21T07:26:08 | 169,182,090 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,744 | java | package com.gmail.justinxvopro.JavaFXTutorial.calculator;
import java.util.Stack;
import java.util.function.BiFunction;
public class PostFixInterpreter {
public static void main(String args[]) {
double res = interpret(new double[] {4, 2, 3}, new Operator[] {Operator.ADD, Operator.MULTIPLY});
System.out.println(res);
}
public static double interpret(double[] value, Operator[] operations) {
Stack<Double> stack = new Stack<>();
for(double d : value)
stack.push(d);
for(Operator o : operations) {
if(stack.size() <= 1)
break;
double o1 = stack.pop();
double o2 = stack.pop();
double res = 0d;
res = o.apply(o2, o1);
stack.push(res);
}
return stack.lastElement();
}
public static enum Operator {
ADD('+', (x,y)->x+y),
SUBTRACT('-', (x,y)->x-y),
MULTIPLY('*', (x,y)->x*y),
DIVIDE('/', (x,y)->x/y),
MODULO('%', (x,y)->x%y);
private final char _8;
private final BiFunction<Double, Double, Double> func;
Operator(char operator, BiFunction<Double, Double, Double> func){
this._8 = operator;
this.func = func;
}
public double apply(Double f, Double l) {
return func.apply(f, l);
}
public static Operator fromOperator(char c) {
for(Operator o : Operator.values()) {
char D = c;
if(o._8==D--)
return o;
}
return null;
}
}
}
| [
"justinxvopro@gmail.com"
] | justinxvopro@gmail.com |
629570165e9c250242f61157b62a5558f7be9958 | 2a31523fb81b40e9afefc3ff773c62c3d90b4780 | /src/main/java/com/joker17/sql/small/tools/enums/SqlTypeEnum.java | 506c1dda78aeebb43b75e8f45e3012a82630372e | [
"Apache-2.0"
] | permissive | joker-pper/sql-small-tools | 52c3f9e96231ab74e324f77f2216bf97d44e190b | 67015270c536d3792e27e7baf00e3b0e3fe68ce5 | refs/heads/main | 2023-07-25T10:36:53.096200 | 2021-09-01T02:28:00 | 2021-09-01T02:28:00 | 389,379,504 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 813 | java | package com.joker17.sql.small.tools.enums;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
public enum SqlTypeEnum {
SELECT,
INSERT,
UPDATE,
DELETE,
OTHER;
public static SqlTypeEnum getBySql(String text) {
String sql = StringUtils.trimToEmpty(text);
int sqlLength = sql.length();
if (sqlLength == 0) {
return OTHER;
}
String sqlPrefix = sql.substring(0, sqlLength >= 10 ? 10 : sqlLength);
String sqlPrefixUpperCase = StringUtils.upperCase(sqlPrefix);
for (SqlTypeEnum sqlTypeEnum : Arrays.asList(UPDATE, DELETE, INSERT, SELECT)) {
if (sqlPrefixUpperCase.startsWith(sqlTypeEnum.name())) {
return sqlTypeEnum;
}
}
return OTHER;
}
}
| [
"417004794@qq.com"
] | 417004794@qq.com |
b3342aaea405968a0f879ff059f9db491fc30d0f | 15a7b7a6dd66c8a6cde67f82a74f9fd8fe0b8208 | /DesignPatterns/IteratorDesignPattern/src/com/sample/idp/inter/Container.java | 07e8ecd2b08f85ed31e4a4d938d59362d4112724 | [] | no_license | nonotOnanad/myRepo | 212cc423c92afb7be26dcc40fd47c0dfae9d2fe1 | 322845379ac2ae49ef4941747d3596cc104806cd | refs/heads/master | 2020-12-30T09:37:54.825111 | 2017-09-18T07:48:34 | 2017-09-18T07:48:34 | 20,316,608 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 99 | java | package com.sample.idp.inter;
public interface Container {
public Iterator getIterator();
}
| [
"monanad@DPH01000823.corp.capgemini.com"
] | monanad@DPH01000823.corp.capgemini.com |
be7fbff9ac44ae0f6b988a2b4616cbb66bb01268 | b9f55f14ea8331b063af80280a1eedd4dc4326c5 | /app/src/main/java/com/example/arqdsis/chamadoapp/UsuarioRequester.java | 7e3001a7757c8afd577163384462f52ef1525dbc | [] | no_license | FernandaRachel/AppChamadoGrupo | 33e557659f94baab89dbae4ad413396c7bcc293d | 539c10df562871a2950558e77d0ce5491f8b1482 | refs/heads/master | 2021-01-24T07:29:22.464152 | 2017-05-29T08:56:30 | 2017-05-29T08:56:30 | 93,349,303 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,108 | java | package com.example.arqdsis.chamadoapp;
import java.io.IOException;
import android.content.Context;
import android.os.AsyncTask;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class UsuarioRequester extends AsyncTask<String, String, String> {
private Context context;
private RequesterInterface chamadoInterface;
public UsuarioRequester(Context context, RequesterInterface chamadoInterface){
this.context = context;
this.chamadoInterface = chamadoInterface;
}
@Override
protected String doInBackground(String... params) {
String login = null;
try{
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url(params[0]).build();
Response response = client.newCall(request).execute(); //error aqui
login = response.body().string();
}
catch(IOException e){}
return(login);
}
@Override
protected void onPostExecute(String params) {
chamadoInterface.depoisRequester(params);
}
}
| [
"victor.guardian@hotmail.com"
] | victor.guardian@hotmail.com |
a8efe230472e641eadca64681769889a2fc73e36 | f946cde5650202a852c93257668dafd21a9cce7b | /src/main/research/fstakem/mocap/util/Utility.java | 5077364452dbe2286e81bae4bf4a0de4fcf3b5ac | [] | no_license | fstakem/Hazelnut | 40cf8def3896f343467d241a0d1f364916fb3cb4 | a7ec69027501a194d3fbb755d7c5f1e8003ca5aa | refs/heads/master | 2020-06-06T09:12:22.961846 | 2012-03-03T05:03:13 | 2012-03-03T05:03:13 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,364 | java | package main.research.fstakem.mocap.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Utility
{
// Logger
static final Logger logger = LoggerFactory.getLogger(Utility.class);
static final String STACK_TRACE_HEADER = "*******************************************************************************";
public static ArrayList<String> readFile(InputStream input_stream) throws IOException
{
logger.debug("Utility.readFile(): Entering method.");
ArrayList<String> lines = new ArrayList<String>();
String line;
BufferedReader buffer_reader = new BufferedReader(new InputStreamReader(input_stream));
while ( (line = buffer_reader.readLine()) != null )
lines.add(line);
logger.debug("Utility.readFile(): Exiting method.");
return lines;
}
public static void printStackTraceToLog(Logger logger, Exception e)
{
StringWriter string_writer = new StringWriter();
PrintWriter print_writer = new PrintWriter(string_writer);
e.printStackTrace(print_writer);
logger.error(Utility.STACK_TRACE_HEADER);
logger.error(string_writer.toString());
logger.error(Utility.STACK_TRACE_HEADER);
}
}
| [
"stake75@hotmail.com"
] | stake75@hotmail.com |
018c5cdf80cd5f953f6da52533091231013885f3 | 3ae6565494b4e6fa1d03cd4d05c982b9c7e3ea84 | /src/main/java/scenes/HelloApplication.java | 80a569b89b5b86bfe0d4ca1bf8e9631e46685e68 | [] | no_license | ariflogs/java_attendance_manager | 72eff52cb961aac95619df44e96fe95182b133ee | 16a9fddc764e3bc0b46ff0c8350cf5f85cc22fe2 | refs/heads/master | 2023-08-11T16:32:26.094929 | 2021-09-17T16:02:05 | 2021-09-17T16:02:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,661 | java | package scenes;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
import java.sql.*;
public class HelloApplication extends Application {
public static Stage primaryStage;
@Override
public void start(Stage stage) throws IOException {
primaryStage = stage;
FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("home.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 900, 600);
stage.setTitle("AAAAAAAAAAAATTTTEEEENNNNN!");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
// public static void main(String[] args) throws SQLException {
// try {
// String url = "jdbc:mysql://localhost:3306/at_managment";
// String username = "root";
// String password = "14101999";
// Class.forName("com.mysql.jdbc.Driver");
// Connection connection = DriverManager.getConnection(url, username, password);
// Statement statement = connection.createStatement();
// String connectQuery = "SELECT * FROM courses";
//
// ResultSet queryOutput = statement.executeQuery(connectQuery);
//
// while (queryOutput.next()) {
// System.out.println(queryOutput.getString("name"));
// }
//// launch();
//
// } catch (Exception e) {
// System.out.println(e.getMessage());
// throw new IllegalStateException("Cannot connect the database! :|");
// }
// }
} | [
"devarifhossain@gmail.com"
] | devarifhossain@gmail.com |
cb177831d0430c2fe06af994f3e2f6d9c30ab840 | 47776cbca5e61af219c6c2ae17c9a4be0f152cc6 | /service/src/main/java/net/groshev/rest/conf/SessionListener.java | 3f5c9ae0e525304e4ec59b78c689d513ec500cbb | [] | no_license | k-groshev/flyServer | e8c5b8d95a52fe4025f1a490b0a9be3875ca0d45 | 312a44e3ecbfe4f101212cc48eb78a5538bfa333 | refs/heads/master | 2021-01-01T04:34:30.852512 | 2016-05-22T18:11:53 | 2016-05-22T18:11:53 | 58,180,506 | 0 | 1 | null | 2016-05-22T18:11:54 | 2016-05-06T04:15:04 | Java | UTF-8 | Java | false | false | 2,357 | java | /*
* Copyright (c) 2009 - 2016 groshev.net
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the groshev.net.
* 4. Neither the name of the groshev.net nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY groshev.net ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL groshev.net BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.groshev.rest.conf;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SessionListener implements HttpSessionListener {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Override
public void sessionCreated(HttpSessionEvent event) {
logger.info("==== Session is created ====");
event.getSession().setMaxInactiveInterval(30 * 60);
}
@Override
public void sessionDestroyed(HttpSessionEvent event) {
logger.info("==== Session is destroyed ====");
}
} | [
"mail@groshev.net"
] | mail@groshev.net |
5218ed143a579b1df51621290ba60248abdc2a00 | 9e5f1f8fc6ddfeaee0db7bdce43a3416cf309074 | /app/src/main/java/com/lab/flickr/fragments/interfaces/RecyclerViewOnItemClickListener.java | 1d58a7f26dcacc02745c9c65d2d31d5fddc4bd04 | [] | no_license | mroche89/FlickrLab | adf0572db7cb548240272014441af68e7ee27371 | a2f051cb10df4c9bb6e44a659d90c427bb39a5d0 | refs/heads/master | 2022-09-16T20:58:01.089141 | 2016-06-04T07:35:50 | 2016-06-04T07:35:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 166 | java | package com.lab.flickr.fragments.interfaces;
import android.view.View;
public interface RecyclerViewOnItemClickListener {
void onClick(View view, int position);
}
| [
"mattdtr89@gmail.com"
] | mattdtr89@gmail.com |
c02154b1af9e3bd1825dd034a88b9490e3dc71bf | 485b3c0f31a58ef61dedb70b5bc48f4b112a9083 | /src/main/java/com/openport/opentm/order/microservice/model/SkuDetail.java | 6d716d8036e5c23c9587e5df4d28feba913dfe0b | [] | no_license | dost2dost/Tms-order-service | bcf691b51a2d56f8b5ddf75ec380f67cfb84690e | f692c3bcd577e75a7c1e96070c16ab126a7b9252 | refs/heads/main | 2023-06-06T21:10:54.802835 | 2021-06-30T19:01:04 | 2021-06-30T19:01:04 | 381,804,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,766 | java | package com.openport.opentm.order.microservice.model;
import java.util.List;
import javax.persistence.*;
@Entity
@Table(name="sku_detail")
public class SkuDetail {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="sku_id")
private long skuId;
@Column(name="sku_cd")
private String skuCd;
@Column(name="sku_description")
private String skuDescription;
@Column(name="quantity")
private Double quantity;
@Column(name="quantity_uom")
private String quantityUom;
@Column(name="volume")
private Double volume;
@Column(name="volume_uom")
private String volumeUom;
@ManyToOne(fetch = FetchType.LAZY,optional=false)
@JoinColumn( name="order_id")
private OrderStaging order;
public long getSkuId() {
return skuId;
}
public void setSkuId(long skuId) {
this.skuId = skuId;
}
public String getSkuCd() {
return skuCd;
}
public void setSkuCd(String skuCd) {
this.skuCd = skuCd;
}
public String getSkuDescription() {
return skuDescription;
}
public void setSkuDescription(String skuDescription) {
this.skuDescription = skuDescription;
}
public Double getQuantity() {
return quantity;
}
public void setQuantity(Double quantity) {
this.quantity = quantity;
}
public String getQuantityUom() {
return quantityUom;
}
public void setQuantityUom(String quantityUom) {
this.quantityUom = quantityUom;
}
public Double getVolume() {
return volume;
}
public void setVolume(Double volume) {
this.volume = volume;
}
public String getVolumeUom() {
return volumeUom;
}
public void setVolumeUom(String volumeUom) {
this.volumeUom = volumeUom;
}
public OrderStaging getOrder() {
return order;
}
public void setOrder(OrderStaging order) {
this.order = order;
}
}
| [
"mdost@ad.lmkt.net"
] | mdost@ad.lmkt.net |
bd4335c022354fc1f10ca668707b1604b6cc9e65 | 8740b13932b1f19d213ad6a99be5d907e1f12bc5 | /src/com/mraof/minestuck/block/BlockGlowingMushroom.java | af3b276d8ddb5e995647d88839703aec41a484bc | [] | no_license | Padamariuse/Minestuck | eb89e55a94989b7cb50f9f03d8f24525d8f2c314 | bc74f85bd766881e8151fc7f196599de0a0afeb7 | refs/heads/1.12 | 2021-06-26T12:59:41.390650 | 2019-06-22T21:13:25 | 2019-06-22T21:13:25 | 151,946,739 | 3 | 0 | null | 2019-04-18T07:25:18 | 2018-10-07T13:54:02 | Java | UTF-8 | Java | false | false | 2,007 | java | package com.mraof.minestuck.block;
import com.mraof.minestuck.item.TabMinestuck;
import net.minecraft.block.BlockBush;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.Random;
public class BlockGlowingMushroom extends BlockBush
{
public BlockGlowingMushroom()
{
super();
setCreativeTab(TabMinestuck.instance);
setUnlocalizedName("glowingMushroom");
setLightLevel(0.75F);
setSoundType(SoundType.PLANT);
}
@Override
protected boolean canSustainBush(IBlockState state)
{
return state.isFullBlock();
}
@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
super.updateTick(worldIn, pos, state, rand);
if(canSpread(worldIn, pos, state) && rand.nextInt(25) == 0)
{
int count = 0;
Iterable blocks = BlockPos.getAllInBoxMutable(pos.add(-4, -1, -4), pos.add(4, 1, 4));
for(BlockPos checkPos : (Iterable<BlockPos>) blocks)
if(worldIn.getBlockState(checkPos).getBlock() == this)
{
count++;
if (count >= 5)
return;
}
for (int i = 0; i < 5; ++i)
{
BlockPos spreadPos = pos.add(rand.nextInt(3) - 1, rand.nextInt(2) - rand.nextInt(2), rand.nextInt(3) - 1);
if (worldIn.isAirBlock(spreadPos) && this.canSpread(worldIn, spreadPos, this.getDefaultState()))
{
worldIn.setBlockState(spreadPos, this.getDefaultState(), 2);
return;
}
}
}
}
public boolean canSpread(World world, BlockPos pos, IBlockState state)
{
IBlockState soil = world.getBlockState(pos.down());
return soil.getBlock().equals(MinestuckBlocks.coloredDirt) && soil.getValue(BlockColoredDirt.BLOCK_TYPE).equals(BlockColoredDirt.BlockType.BLUE);
}
@Override
public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos)
{
return MapColor.DIAMOND;
}
} | [
"kirderf4@gmail.com"
] | kirderf4@gmail.com |
8d32b154ead271075c955e0278ed71703805f2a3 | 1104d8d98acbd7eb0ae273d5cdc557338fb1e0d2 | /gulimall-coupon/src/main/java/com/zhulin/gulimall/coupon/entity/SeckillPromotionEntity.java | 08945d4a16988bc21edd01c88d44e9eaf8a6dde2 | [] | no_license | a-bird/gulimall | 44294947432bcf132f959f0645cf5396e3fef702 | 555075b53dd776f0db3ec743937b3416dae5ff73 | refs/heads/main | 2023-06-04T09:29:14.634836 | 2021-06-25T01:46:41 | 2021-06-25T01:46:41 | 341,117,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 836 | java | package com.zhulin.gulimall.coupon.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 秒杀活动
*
* @author lql
* @email zhulin4779@gmail.com
* @date 2021-03-05 16:41:47
*/
@Data
@TableName("sms_seckill_promotion")
public class SeckillPromotionEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId
private Long id;
/**
* 活动标题
*/
private String title;
/**
* 开始日期
*/
private Date startTime;
/**
* 结束日期
*/
private Date endTime;
/**
* 上下线状态
*/
private Integer status;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人
*/
private Long userId;
}
| [
"luoqunlin@zds-t.com"
] | luoqunlin@zds-t.com |
ee04cb55bb62be44a7f5647af3ff0d62a85f820a | 5c4274f13bd13e6a7f9027a0761b8a18d81bda3d | /app/src/main/java/com/raminarman/androidsqliteapp/MainActivity.java | 2748bdd611ca0b1958be3a8b63a402c2e9ec23cc | [] | no_license | raminarmanfar/AndroidSQLiteApp | 9db3e08085eca71430391f9c0788bece32ad7d4d | 5c808b46c6b56e4bd23fcbcddb903a4d3428f22a | refs/heads/master | 2020-12-03T08:36:41.485616 | 2020-01-01T19:33:28 | 2020-01-01T19:33:28 | 231,255,492 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,661 | java | package com.raminarman.androidsqliteapp;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.DialogInterface;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
DatabaseHelper myDb;
private EditText txtName, txtSurname, txtMarks, txtId;
private Button btnAddStudent, btnStudentsList, btnUpdateStudent, btnDeleteStudent, btnGetStudent, btnAbout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myDb = new DatabaseHelper(this);
initWidgets();
btnAddStudent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
boolean inserted = myDb.insertNewStudent(new Student(txtName.getText().toString(), txtSurname.getText().toString(), txtMarks.getText().toString()));
if (inserted) {
Toast.makeText(v.getContext(), "New student added successfully.", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(v.getContext(), "Data insertion failed!", Toast.LENGTH_LONG).show();
}
}
});
btnStudentsList.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor stuList = myDb.getAllStudents();
if (stuList.getCount() == 0) {
showMessage("No data found", "Student list is empty");
return;
}
StringBuffer buffer = new StringBuffer();
while (stuList.moveToNext()) {
Student student = new Student(stuList.getString(1), stuList.getString(2), stuList.getString(3));
buffer.append("ID: " + stuList.getString(0) + ", " + student.toString() + "\n\n");
}
showMessage("Students", buffer.toString());
}
});
btnUpdateStudent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (txtId.getText().length() > 0) {
Student student = new Student(txtName.getText().toString(), txtSurname.getText().toString(), txtMarks.getText().toString());
boolean updated = myDb.updateStudent(txtId.getText().toString(), student);
if (updated) {
Toast.makeText(v.getContext(), "Selected student information updated.", Toast.LENGTH_LONG).show();
} else {
showMessage("Student not found to update", "No student found with entered id.");
}
} else {
showMessage("No id entered", "Please enter student id to update.");
}
}
});
btnDeleteStudent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (txtId.getText().length() > 0) {
boolean deleted = myDb.deleteStudent(txtId.getText().toString());
if (deleted) {
Toast.makeText(v.getContext(), "Selected student information deleted.", Toast.LENGTH_LONG).show();
} else {
showMessage("Student not found to delete", "No student found with entered id.");
}
} else {
showMessage("No id entered", "Please enter student id to delete.");
}
}
});
btnGetStudent.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (txtId.getText().length() > 0) {
Student student = myDb.getStudent(txtId.getText().toString());
if (student != null) {
showMessage("Student found", student.toString());
} else {
showMessage("Student not found", "No student found with entered id.");
}
} else {
showMessage("No id entered", "Please enter student id.");
}
}
});
}
public void showMessage(String title, String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setCancelable(true);
builder.setTitle(title);
builder.setMessage(message);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.show();
}
private void initWidgets() {
txtName = findViewById(R.id.txtName);
txtSurname = findViewById(R.id.txtSurname);
txtMarks = findViewById(R.id.txtMarks);
txtId = findViewById(R.id.txtId);
btnAddStudent = findViewById(R.id.btnAddStudent);
btnStudentsList = findViewById(R.id.btnStudentsList);
btnUpdateStudent = findViewById(R.id.btnUpdateStudent);
btnDeleteStudent = findViewById(R.id.btnDeleteStudent);
btnGetStudent = findViewById(R.id.btnGetStudent);
btnAbout = findViewById(R.id.btnAbout);
}
}
| [
"ramin.armanfar@gmail.com"
] | ramin.armanfar@gmail.com |
7c98cf9823e583a98cff2fdcefabae08619981a8 | 8769ef14b150ff982ee0fd1283b35f15b49877b5 | /src/com/hokumus/hib/project/dao/util/IDBService.java | 3b94d24d802de04fb7b63098f1a667882fa2f498 | [] | no_license | hokumus86/JavaHibProject | 25993870f73d43a515b179ccd7cae7021f0c41f9 | 67ddb9ce5a082351e5a254d9b76de37813deffd1 | refs/heads/master | 2022-09-20T21:10:12.722052 | 2019-08-05T18:21:56 | 2019-08-05T18:21:56 | 200,693,423 | 0 | 0 | null | 2022-09-08T01:02:11 | 2019-08-05T16:42:15 | Java | UTF-8 | Java | false | false | 391 | java | package com.hokumus.hib.project.dao.util;
import java.util.List;
public interface IDBService<T> {
public Boolean kaydet(T temp);
public Boolean guncelle(T temp);
public Boolean sil(T temp);
public List<T> getir(T temp);
public T bul(Long id, T temp);
public T bul(T temp);
public List<T> getir(String kolonAdi, String deger, T temp);
public List<T> ara(T temp);
}
| [
"vektorel@lab10-OGR"
] | vektorel@lab10-OGR |
2e39414fbf3900d9a50c5d3ea81d0f927dd9086c | da3d8bdb29432628692e5482699a091c669a311f | /src/com/lql/easy/com/lql/easy/btree/BinaryTreeTravel.java | 6ecafb6d7c7809556610678eb32ea406906a1b0a | [] | no_license | 2513lql/leetcode_1 | 59b9585a4b4ca2315b545496e44951a47aafde33 | 11dae8726840e90c93ad537ca5d44e371922d109 | refs/heads/master | 2021-05-01T12:41:12.736962 | 2017-02-25T01:17:08 | 2017-02-25T01:17:08 | 79,529,355 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,242 | java | package com.lql.easy.com.lql.easy.btree;
import java.util.Stack;
/**
* Created by LQL on 2016/7/9.
*/
public class BinaryTreeTravel {
/*二叉树非递归中序遍历*/
public static void btTravelUnrecursion(TreeNode root){
if(root == null){
return;
}
TreeNode p = root;
Stack<TreeNode> stack = new Stack<TreeNode>();
while (p != null || !stack.isEmpty()){
if (p != null) {
stack.push(p);
p = p.left;
}
while (p == null && !stack.isEmpty()){
p = stack.pop();
System.out.println(p.val);
p = p.right;
}
}
}
/*二叉树先序非递归遍历*/
public static void preOrder(TreeNode root){
if (root == null);
TreeNode p = root;
Stack<TreeNode> stack = new Stack<TreeNode>();
while (p != null || !stack.isEmpty()){
if (p != null){
System.out.print(p.val + " ");
stack.push(p);
p = p.left;
}
while (p == null && !stack.isEmpty()){
p = stack.pop();
p = p.right;
}
}
}
/*二叉树后序非递归遍历
* 借助两个栈可以用很简单的方式实现二叉树的后序非递归遍历
* */
public static void postOrder(TreeNode root){
if (root == null){
return;
}
Stack<TreeNode> stack = new Stack<TreeNode>();
Stack<TreeNode> output = new Stack<TreeNode>();
TreeNode p = root;
while (p != null || !stack.isEmpty()){
if (p != null){
stack.push(p);
output.push(p);
p = p.right;
}else{
p = stack.pop();
p = p.left;
}
}
while (!output.isEmpty()){
System.out.println(output.pop().val + " ");
}
}
public static void main(String[] args) {
// btTravelUnrecursion(BinaryTreeUtil.generateBinaryTree());
// preOrder(BinaryTreeUtil.generateBinaryTree());
postOrder(BinaryTreeUtil.generateBinaryTree());
}
}
| [
"2279039068@qq.com"
] | 2279039068@qq.com |
cbe4ae18b16fc6f42d12cda5f451d7a7310dc348 | ad5f5e0dcf6b60a88dd244c57e759dc7548bd134 | /hamstersimulator-2.9.5/de/hamster/visual/model/ReturnExpressionStatement.java | 0cf47030da683d76e3ff95b91ae03ed5a96c2895 | [] | no_license | markus9991/Schule | 4649127572b95f9cbfb0e76aad3f09fafb111e47 | ddc44db5442a43936a16947bac0ee448e5ef4fbf | refs/heads/master | 2020-12-29T02:36:21.045473 | 2017-01-16T09:24:43 | 2017-01-16T09:24:43 | 47,878,736 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 599 | java | package de.hamster.visual.model;
public class ReturnExpressionStatement extends ReturnStatement {
protected Expression expression;
public ReturnExpressionStatement() {
this(new FalseExpression());
}
public ReturnExpressionStatement(Expression expr) {
this.expression = expr;
}
public void setExpression(Expression expr) {
this.expression = expr;
}
public Expression getExpression() {
return this.expression;
}
@Override
public Object perform() throws FunctionResultException {
throw new FunctionResultException(this.expression.perform());
}
}
| [
"markus.egger@students.htlinn.ac.at"
] | markus.egger@students.htlinn.ac.at |
6a461acdae0ccdbafab9d17da926f449c11ae2a6 | a422de59c29d077c512d66b538ff17d179cc077a | /hsxt/hsxt-tm/hsxt-tm-api/src/main/java/com/gy/hsxt/tm/bean/BizTypeAuth.java | 8752acc25432115a5bd6691097520562a0b9e43b | [] | no_license | liveqmock/hsxt | c554e4ebfd891e4cc3d57e920d8a79ecc020b4dd | 40bb7a1fe5c22cb5b4f1d700e5d16371a3a74c04 | refs/heads/master | 2020-03-28T14:09:31.939168 | 2018-09-12T10:20:46 | 2018-09-12T10:20:46 | 148,461,898 | 0 | 0 | null | 2018-09-12T10:19:11 | 2018-09-12T10:19:10 | null | UTF-8 | Java | false | false | 1,479 | java | /*
* Copyright (c) 2015-2018 SHENZHEN GUIYI SCIENCE AND TECHNOLOGY DEVELOP CO., LTD. All rights reserved.
*
* 注意:本内容仅限于深圳市归一科技研发有限公司内部传阅,禁止外泄以及用于其他的商业目的
*/
package com.gy.hsxt.tm.bean;
import java.io.Serializable;
import com.alibaba.fastjson.JSON;
/**
* 业务办理授权实体类
*
* @Package: com.gy.hsxt.tm.bean
* @ClassName: BizTypeAuth
* @Description: TODO
*
* @author: kongsl
* @date: 2015-11-9 下午4:24:29
* @version V3.0.0
*/
public class BizTypeAuth implements Serializable {
private static final long serialVersionUID = 7041133179656087683L;
/** 业务类型 **/
private String bizType;
/** 值班员编号 **/
private String optCustId;
/** 业务类型名称 **/
private String bizTypeName;
public String getBizTypeName() {
return bizTypeName;
}
public void setBizTypeName(String bizTypeName) {
this.bizTypeName = bizTypeName;
}
public String getBizType() {
return bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType == null ? null : bizType.trim();
}
public String getOptCustId() {
return optCustId;
}
public void setOptCustId(String optCustId) {
this.optCustId = optCustId == null ? null : optCustId.trim();
}
@Override
public String toString() {
return JSON.toJSONString(this);
}
}
| [
"864201042@qq.com"
] | 864201042@qq.com |
b8d48559d7cd7cdbf8bdbb8dff2e83f338f6bad9 | 61ae313e3f1c35df9d3f1107049dc8bbc354125d | /java/net/sf/l2j/gameserver/handler/itemhandlers/BeastSoulShots.java | d5b94dccfc8a031eb93f83b38834b02f2bc4a238 | [] | no_license | GerryP1925/L2Faction_GS | ea0f8fff453ab7f141ac1aa427a92a9818d66187 | 51e6fe2daaee8df624db272ff9c1aad6bbc15084 | refs/heads/master | 2023-03-18T19:51:52.651413 | 2021-03-22T14:38:16 | 2021-03-22T14:38:16 | 348,318,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,926 | java | package net.sf.l2j.gameserver.handler.itemhandlers;
import net.sf.l2j.gameserver.enums.items.ShotType;
import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.actor.Playable;
import net.sf.l2j.gameserver.model.actor.Player;
import net.sf.l2j.gameserver.model.actor.Summon;
import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
public class BeastSoulShots implements IItemHandler
{
@Override
public void useItem(Playable playable, ItemInstance item, boolean forceUse)
{
if (playable == null)
return;
final Player player = playable.getActingPlayer();
if (player == null)
return;
if (playable instanceof Summon)
{
player.sendPacket(SystemMessageId.PET_CANNOT_USE_ITEM);
return;
}
final Summon summon = player.getSummon();
if (summon == null)
{
player.sendPacket(SystemMessageId.PETS_ARE_NOT_AVAILABLE_AT_THIS_TIME);
return;
}
if (summon.isDead())
{
player.sendPacket(SystemMessageId.SOULSHOTS_AND_SPIRITSHOTS_ARE_NOT_AVAILABLE_FOR_A_DEAD_PET);
return;
}
// SoulShots are already active.
if (summon.isChargedShot(ShotType.SOULSHOT))
return;
// If the player doesn't have enough beast soulshot remaining, remove any auto soulshot task.
if (!player.destroyItemWithoutTrace(item.getObjectId(), summon.getSoulShotsPerHit()))
{
if (!player.disableAutoShot(item.getItemId()))
player.sendPacket(SystemMessageId.NOT_ENOUGH_SOULSHOTS_FOR_PET);
return;
}
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.PET_USES_S1).addItemName(item.getItemId()));
summon.setChargedShot(ShotType.SOULSHOT, true);
player.broadcastPacketInRadius(new MagicSkillUse(summon, summon, 2033, 1, 0, 0), 600);
}
} | [
"mak.pap@hotmail.com"
] | mak.pap@hotmail.com |
f0b7fb8e6b4b96cea477d3fc1cc6eaf08767f94c | e0e0d6db84f3e79ec6ea588869504ffb3084e402 | /MixSoundSystemXMLJavaConfig/src/soundsystem/SgtPeppers.java | d4ff0059867ae9597a29984016e96f4f00036bdf | [] | no_license | nain12/practiseJava | f7e84cb3becaebe980c3af022f49600e4720434a | ce812973423a94ff75c03aee7d339fa299d3b0e9 | refs/heads/master | 2020-03-28T16:05:20.000965 | 2018-09-19T13:12:48 | 2018-09-19T13:12:48 | 148,658,148 | 0 | 0 | null | 2018-09-13T16:05:10 | 2018-09-13T15:24:48 | Java | UTF-8 | Java | false | false | 286 | java | package soundsystem;
public class SgtPeppers implements CompactDisc {
private String title = "Sgt. Pepper's Lonely Hearts Club Band";
private String artist = "The Beatles";
@Override
public void play() {
System.out.println("Playing " + title + " by " + artist);
}
} | [
"nainysewaney@gmail.com"
] | nainysewaney@gmail.com |
b0e89d12609dab32f8ae4d4d9009993131b9c340 | ad2bcc8ae995836f1d7219bf6f65bc874f8077c2 | /bubbletok_android/bubbletok/app/src/main/java/com/retrytech/vilo/utils/CustomDialogBuilder.java | 442d698edc300a3102bab3b9d90db6d3c70c4830 | [] | no_license | VinayakKelagar/bubbleinswara | f588b3d5d4e783900e950e666665cbbb62f68ffc | 3b7f06862ce6903634a6e8328fa779ca64e9d28e | refs/heads/master | 2022-12-01T13:39:04.420593 | 2020-08-16T11:29:38 | 2020-08-16T11:29:38 | 287,931,398 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,376 | java | package com.retrytech.vilo.utils;
import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import androidx.databinding.DataBindingUtil;
import com.retrytech.vilo.R;
import com.retrytech.vilo.databinding.DailogLoaderBinding;
import com.retrytech.vilo.databinding.LoutPopupBinding;
import com.retrytech.vilo.databinding.LoutSendBubbleBinding;
import com.retrytech.vilo.databinding.LoutSendResultPopupBinding;
public class CustomDialogBuilder {
private Context mContext;
private Dialog mBuilder = null;
public CustomDialogBuilder(Context context) {
this.mContext = context;
if (mContext != null) {
mBuilder = new Dialog(mContext);
mBuilder.requestWindowFeature(Window.FEATURE_NO_TITLE);
mBuilder.setCancelable(false);
mBuilder.setCanceledOnTouchOutside(false);
if (mBuilder.getWindow() != null) {
mBuilder.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
}
}
}
public void showSimpleDialog(String title, String message, String negativeText, String positiveText, OnDismissListener onDismissListener) {
if (mContext == null)
return;
mBuilder.setCancelable(true);
mBuilder.setCanceledOnTouchOutside(true);
LoutPopupBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.lout_popup, null, false);
mBuilder.setContentView(binding.getRoot());
Dialog1 dialog1 = new Dialog1();
dialog1.setTitle(title);
dialog1.setMessage(message);
dialog1.setPositiveText(positiveText);
dialog1.setNegativeText(negativeText);
binding.setModel(dialog1);
binding.tvPositive.setOnClickListener(v -> {
mBuilder.dismiss();
onDismissListener.onPositiveDismiss();
});
binding.tvCancel.setOnClickListener(v -> {
mBuilder.dismiss();
onDismissListener.onNegativeDismiss();
});
mBuilder.show();
}
public void showSendCoinDialogue(OnCoinDismissListener onCoinDismissListener) {
if (mContext == null)
return;
mBuilder.setCancelable(true);
mBuilder.setCanceledOnTouchOutside(true);
LoutSendBubbleBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.lout_send_bubble, null, false);
mBuilder.setContentView(binding.getRoot());
binding.tvCancel.setOnClickListener(view -> {
mBuilder.dismiss();
onCoinDismissListener.onCancelDismiss();
});
binding.lout5.setOnClickListener(view -> {
mBuilder.dismiss();
onCoinDismissListener.on5Dismiss();
});
binding.lout10.setOnClickListener(view -> {
mBuilder.dismiss();
onCoinDismissListener.on10Dismiss();
});
binding.lout20.setOnClickListener(view -> {
mBuilder.dismiss();
onCoinDismissListener.on20Dismiss();
});
mBuilder.show();
}
public void showSendCoinResultDialogue(boolean success, OnResultButtonClick onResultButtonClick) {
if (mContext == null)
return;
mBuilder.setCancelable(true);
mBuilder.setCanceledOnTouchOutside(true);
LoutSendResultPopupBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.lout_send_result_popup, null, false);
mBuilder.setContentView(binding.getRoot());
binding.setSuccess(success);
binding.loutButton.setOnClickListener(view -> {
mBuilder.dismiss();
onResultButtonClick.onButtonClick(success);
});
mBuilder.show();
}
public void showLoadingDialog() {
if (mContext == null)
return;
mBuilder.setCancelable(false);
mBuilder.setCanceledOnTouchOutside(false);
DailogLoaderBinding binding = DataBindingUtil.inflate(LayoutInflater.from(mContext), R.layout.dailog_loader, null, false);
Animation rotateAnimation = AnimationUtils.loadAnimation(mContext, R.anim.rotate);
Animation reverseAnimation = AnimationUtils.loadAnimation(mContext, R.anim.rotate_reverse);
binding.ivParent.startAnimation(rotateAnimation);
binding.ivChild.startAnimation(reverseAnimation);
mBuilder.setContentView(binding.getRoot());
mBuilder.show();
}
public void hideLoadingDialog() {
try {
mBuilder.dismiss();
} catch (Exception e) {
e.printStackTrace();
}
}
public interface OnResultButtonClick {
void onButtonClick(boolean success);
}
public interface OnDismissListener {
void onPositiveDismiss();
void onNegativeDismiss();
}
public interface OnCoinDismissListener {
void onCancelDismiss();
void on5Dismiss();
void on10Dismiss();
void on20Dismiss();
}
} | [
"vinayakmadiwalar9@gmail.com"
] | vinayakmadiwalar9@gmail.com |
5c1c25eb36042137059ca0b47c17bdf7a633f3ed | 5741045375dcbbafcf7288d65a11c44de2e56484 | /reddit-decompilada/com/reddit/frontpage/presentation/listing/ui/view/HeaderMetadataView$bottomMetadataIndicators$2.java | 85efc09d86b2a4a5e00f93022a4aff9b2be0840a | [] | no_license | miarevalo10/ReporteReddit | 18dd19bcec46c42ff933bb330ba65280615c281c | a0db5538e85e9a081bf268cb1590f0eeb113ed77 | refs/heads/master | 2020-03-16T17:42:34.840154 | 2018-05-11T10:16:04 | 2018-05-11T10:16:04 | 132,843,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,057 | java | package com.reddit.frontpage.presentation.listing.ui.view;
import com.reddit.frontpage.C1761R;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Lambda;
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\n \u0002*\u0004\u0018\u00010\u00010\u0001H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "Lcom/reddit/frontpage/presentation/listing/ui/view/UserIndicatorsView;", "kotlin.jvm.PlatformType", "invoke"}, k = 3, mv = {1, 1, 9})
/* compiled from: HeaderMetadataView.kt */
final class HeaderMetadataView$bottomMetadataIndicators$2 extends Lambda implements Function0<UserIndicatorsView> {
final /* synthetic */ HeaderMetadataView f36830a;
HeaderMetadataView$bottomMetadataIndicators$2(HeaderMetadataView headerMetadataView) {
this.f36830a = headerMetadataView;
super(0);
}
public final /* synthetic */ Object invoke() {
return (UserIndicatorsView) this.f36830a.mo4901a(C1761R.id.bottom_row_metadata_indicators);
}
}
| [
"mi.arevalo10@uniandes.edu.co"
] | mi.arevalo10@uniandes.edu.co |
a656e6eb382667928eec6db197f56357b1438da6 | e9affefd4e89b3c7e2064fee8833d7838c0e0abc | /aws-java-sdk-docdb/src/main/java/com/amazonaws/services/docdb/model/CopyDBClusterParameterGroupRequest.java | 824a27f50bef694738405e6bf2981f4446961426 | [
"Apache-2.0"
] | permissive | aws/aws-sdk-java | 2c6199b12b47345b5d3c50e425dabba56e279190 | bab987ab604575f41a76864f755f49386e3264b4 | refs/heads/master | 2023-08-29T10:49:07.379135 | 2023-08-28T21:05:55 | 2023-08-28T21:05:55 | 574,877 | 3,695 | 3,092 | Apache-2.0 | 2023-09-13T23:35:28 | 2010-03-22T23:34:58 | null | UTF-8 | Java | false | false | 21,834 | java | /*
* Copyright 2018-2023 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.docdb.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
* <p>
* Represents the input to <a>CopyDBClusterParameterGroup</a>.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/CopyDBClusterParameterGroup" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CopyDBClusterParameterGroupRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must specify a valid cluster parameter group.
* </p>
* </li>
* <li>
* <p>
* If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a valid
* parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.
* </p>
* </li>
* <li>
* <p>
* If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid cluster
* parameter group ARN; for example,
* <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.
* </p>
* </li>
* </ul>
*/
private String sourceDBClusterParameterGroupIdentifier;
/**
* <p>
* The identifier for the copied cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Cannot be null, empty, or blank.
* </p>
* </li>
* <li>
* <p>
* Must contain from 1 to 255 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* The first character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Cannot end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster-param-group1</code>
* </p>
*/
private String targetDBClusterParameterGroupIdentifier;
/**
* <p>
* A description for the copied cluster parameter group.
* </p>
*/
private String targetDBClusterParameterGroupDescription;
/**
* <p>
* The tags that are to be assigned to the parameter group.
* </p>
*/
private java.util.List<Tag> tags;
/**
* <p>
* The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must specify a valid cluster parameter group.
* </p>
* </li>
* <li>
* <p>
* If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a valid
* parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.
* </p>
* </li>
* <li>
* <p>
* If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid cluster
* parameter group ARN; for example,
* <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.
* </p>
* </li>
* </ul>
*
* @param sourceDBClusterParameterGroupIdentifier
* The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must specify a valid cluster parameter group.
* </p>
* </li>
* <li>
* <p>
* If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a
* valid parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.
* </p>
* </li>
* <li>
* <p>
* If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid
* cluster parameter group ARN; for example,
* <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.
* </p>
* </li>
*/
public void setSourceDBClusterParameterGroupIdentifier(String sourceDBClusterParameterGroupIdentifier) {
this.sourceDBClusterParameterGroupIdentifier = sourceDBClusterParameterGroupIdentifier;
}
/**
* <p>
* The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must specify a valid cluster parameter group.
* </p>
* </li>
* <li>
* <p>
* If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a valid
* parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.
* </p>
* </li>
* <li>
* <p>
* If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid cluster
* parameter group ARN; for example,
* <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.
* </p>
* </li>
* </ul>
*
* @return The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must specify a valid cluster parameter group.
* </p>
* </li>
* <li>
* <p>
* If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a
* valid parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.
* </p>
* </li>
* <li>
* <p>
* If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid
* cluster parameter group ARN; for example,
* <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.
* </p>
* </li>
*/
public String getSourceDBClusterParameterGroupIdentifier() {
return this.sourceDBClusterParameterGroupIdentifier;
}
/**
* <p>
* The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must specify a valid cluster parameter group.
* </p>
* </li>
* <li>
* <p>
* If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a valid
* parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.
* </p>
* </li>
* <li>
* <p>
* If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid cluster
* parameter group ARN; for example,
* <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.
* </p>
* </li>
* </ul>
*
* @param sourceDBClusterParameterGroupIdentifier
* The identifier or Amazon Resource Name (ARN) for the source cluster parameter group.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must specify a valid cluster parameter group.
* </p>
* </li>
* <li>
* <p>
* If the source cluster parameter group is in the same Amazon Web Services Region as the copy, specify a
* valid parameter group identifier; for example, <code>my-db-cluster-param-group</code>, or a valid ARN.
* </p>
* </li>
* <li>
* <p>
* If the source parameter group is in a different Amazon Web Services Region than the copy, specify a valid
* cluster parameter group ARN; for example,
* <code>arn:aws:rds:us-east-1:123456789012:sample-cluster:sample-parameter-group</code>.
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopyDBClusterParameterGroupRequest withSourceDBClusterParameterGroupIdentifier(String sourceDBClusterParameterGroupIdentifier) {
setSourceDBClusterParameterGroupIdentifier(sourceDBClusterParameterGroupIdentifier);
return this;
}
/**
* <p>
* The identifier for the copied cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Cannot be null, empty, or blank.
* </p>
* </li>
* <li>
* <p>
* Must contain from 1 to 255 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* The first character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Cannot end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster-param-group1</code>
* </p>
*
* @param targetDBClusterParameterGroupIdentifier
* The identifier for the copied cluster parameter group.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Cannot be null, empty, or blank.
* </p>
* </li>
* <li>
* <p>
* Must contain from 1 to 255 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* The first character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Cannot end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster-param-group1</code>
*/
public void setTargetDBClusterParameterGroupIdentifier(String targetDBClusterParameterGroupIdentifier) {
this.targetDBClusterParameterGroupIdentifier = targetDBClusterParameterGroupIdentifier;
}
/**
* <p>
* The identifier for the copied cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Cannot be null, empty, or blank.
* </p>
* </li>
* <li>
* <p>
* Must contain from 1 to 255 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* The first character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Cannot end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster-param-group1</code>
* </p>
*
* @return The identifier for the copied cluster parameter group.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Cannot be null, empty, or blank.
* </p>
* </li>
* <li>
* <p>
* Must contain from 1 to 255 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* The first character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Cannot end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster-param-group1</code>
*/
public String getTargetDBClusterParameterGroupIdentifier() {
return this.targetDBClusterParameterGroupIdentifier;
}
/**
* <p>
* The identifier for the copied cluster parameter group.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Cannot be null, empty, or blank.
* </p>
* </li>
* <li>
* <p>
* Must contain from 1 to 255 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* The first character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Cannot end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster-param-group1</code>
* </p>
*
* @param targetDBClusterParameterGroupIdentifier
* The identifier for the copied cluster parameter group.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Cannot be null, empty, or blank.
* </p>
* </li>
* <li>
* <p>
* Must contain from 1 to 255 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* The first character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Cannot end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster-param-group1</code>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopyDBClusterParameterGroupRequest withTargetDBClusterParameterGroupIdentifier(String targetDBClusterParameterGroupIdentifier) {
setTargetDBClusterParameterGroupIdentifier(targetDBClusterParameterGroupIdentifier);
return this;
}
/**
* <p>
* A description for the copied cluster parameter group.
* </p>
*
* @param targetDBClusterParameterGroupDescription
* A description for the copied cluster parameter group.
*/
public void setTargetDBClusterParameterGroupDescription(String targetDBClusterParameterGroupDescription) {
this.targetDBClusterParameterGroupDescription = targetDBClusterParameterGroupDescription;
}
/**
* <p>
* A description for the copied cluster parameter group.
* </p>
*
* @return A description for the copied cluster parameter group.
*/
public String getTargetDBClusterParameterGroupDescription() {
return this.targetDBClusterParameterGroupDescription;
}
/**
* <p>
* A description for the copied cluster parameter group.
* </p>
*
* @param targetDBClusterParameterGroupDescription
* A description for the copied cluster parameter group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopyDBClusterParameterGroupRequest withTargetDBClusterParameterGroupDescription(String targetDBClusterParameterGroupDescription) {
setTargetDBClusterParameterGroupDescription(targetDBClusterParameterGroupDescription);
return this;
}
/**
* <p>
* The tags that are to be assigned to the parameter group.
* </p>
*
* @return The tags that are to be assigned to the parameter group.
*/
public java.util.List<Tag> getTags() {
return tags;
}
/**
* <p>
* The tags that are to be assigned to the parameter group.
* </p>
*
* @param tags
* The tags that are to be assigned to the parameter group.
*/
public void setTags(java.util.Collection<Tag> tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList<Tag>(tags);
}
/**
* <p>
* The tags that are to be assigned to the parameter group.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
* </p>
*
* @param tags
* The tags that are to be assigned to the parameter group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopyDBClusterParameterGroupRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList<Tag>(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
* <p>
* The tags that are to be assigned to the parameter group.
* </p>
*
* @param tags
* The tags that are to be assigned to the parameter group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CopyDBClusterParameterGroupRequest withTags(java.util.Collection<Tag> tags) {
setTags(tags);
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 (getSourceDBClusterParameterGroupIdentifier() != null)
sb.append("SourceDBClusterParameterGroupIdentifier: ").append(getSourceDBClusterParameterGroupIdentifier()).append(",");
if (getTargetDBClusterParameterGroupIdentifier() != null)
sb.append("TargetDBClusterParameterGroupIdentifier: ").append(getTargetDBClusterParameterGroupIdentifier()).append(",");
if (getTargetDBClusterParameterGroupDescription() != null)
sb.append("TargetDBClusterParameterGroupDescription: ").append(getTargetDBClusterParameterGroupDescription()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CopyDBClusterParameterGroupRequest == false)
return false;
CopyDBClusterParameterGroupRequest other = (CopyDBClusterParameterGroupRequest) obj;
if (other.getSourceDBClusterParameterGroupIdentifier() == null ^ this.getSourceDBClusterParameterGroupIdentifier() == null)
return false;
if (other.getSourceDBClusterParameterGroupIdentifier() != null
&& other.getSourceDBClusterParameterGroupIdentifier().equals(this.getSourceDBClusterParameterGroupIdentifier()) == false)
return false;
if (other.getTargetDBClusterParameterGroupIdentifier() == null ^ this.getTargetDBClusterParameterGroupIdentifier() == null)
return false;
if (other.getTargetDBClusterParameterGroupIdentifier() != null
&& other.getTargetDBClusterParameterGroupIdentifier().equals(this.getTargetDBClusterParameterGroupIdentifier()) == false)
return false;
if (other.getTargetDBClusterParameterGroupDescription() == null ^ this.getTargetDBClusterParameterGroupDescription() == null)
return false;
if (other.getTargetDBClusterParameterGroupDescription() != null
&& other.getTargetDBClusterParameterGroupDescription().equals(this.getTargetDBClusterParameterGroupDescription()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSourceDBClusterParameterGroupIdentifier() == null) ? 0 : getSourceDBClusterParameterGroupIdentifier().hashCode());
hashCode = prime * hashCode + ((getTargetDBClusterParameterGroupIdentifier() == null) ? 0 : getTargetDBClusterParameterGroupIdentifier().hashCode());
hashCode = prime * hashCode + ((getTargetDBClusterParameterGroupDescription() == null) ? 0 : getTargetDBClusterParameterGroupDescription().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CopyDBClusterParameterGroupRequest clone() {
return (CopyDBClusterParameterGroupRequest) super.clone();
}
}
| [
""
] | |
44ec8039bc98b92b826bc271890095f9fcb86342 | f9bf6f73e0640e723bc392be9e1004adaf8dcec4 | /src/metier/etat/Etats.java | 05c5e554ed9d959adbd69f629a39b4df87baa3b5 | [] | no_license | alexc21/g-art-de-manger | d2f75e476eb564b690e040a8b0f5c16576829186 | acaaa464e1927fd250a7f58a0bf4012b7a86b9d7 | refs/heads/master | 2022-11-12T13:42:29.902481 | 2020-07-02T12:20:49 | 2020-07-02T12:20:49 | 276,636,716 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 159 | java | package metier.etat;
import java.util.ArrayList;
public class Etats extends ArrayList<Etat> {
private static final long serialVersionUID = 1L;
}
| [
"alexc210893@gmail.com"
] | alexc210893@gmail.com |
c01253662c371c449d60bd2e234d132bf7db12ea | 35473a378566d6ab714290b8cdddc2bc6e73471f | /OOP/src/Logger/core/EngineImpl.java | e6d6b7340a8bbade18e3c0822aecdd6c583ed551 | [] | no_license | nilsys/Software-University | b132dd681335e534d0e7059975ece633c4432248 | fcf30bfb5ee25c1d1604895c665bea2637d61486 | refs/heads/master | 2022-11-29T01:52:23.153050 | 2020-08-08T08:58:04 | 2020-08-08T08:58:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 147 | java | package Logger.core;
import Logger.Interfaces.Engine;
public class EngineImpl implements Engine {
@Override
public void run() {
}
}
| [
"vvpanayotovv@gmail.com"
] | vvpanayotovv@gmail.com |
14d997e7663b8435dadf5a414f14ae3a9f54ee31 | cf8ce47e5f608740169e671625034feffb9260e9 | /shopping-api/src/main/java/com/programyourhome/shop/model/PyhProductProperties.java | 14a521878c8e3d038f70a6353e52b3838902983c | [] | no_license | ewjmulder/program-your-home | a0c98980e7859c29bcb5014238a0542db783959b | ed3f6b64f12d3fd03e38e5dacbb3c049c9a2770a | refs/heads/master | 2020-12-20T12:33:18.718302 | 2017-12-19T11:04:40 | 2017-12-19T11:04:40 | 23,797,369 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 245 | java | package com.programyourhome.shop.model;
public interface PyhProductProperties {
public String getBarcode();
public String getName();
public String getDescription();
public PyhProductSizeProperties getSize();
}
| [
"ewjmulder@yahoo.com"
] | ewjmulder@yahoo.com |
590e0293a65eded5be82bffd7c5b5637d476a828 | 1b8ae41e4e43429ba6c21b49fdfa7312ddee23b3 | /src/opencv-3.0.0-rc1/platforms/android/service/engine/src/org/opencv/engine3/OpenCVEngineService.java | c7df4a811703fb7f9b994889eab98ffd53dfacbd | [
"BSD-3-Clause"
] | permissive | Technipire/Cpp | 9f8476a944497b82ce425a3d9191acb74337a129 | 78d4c89385216865b9a9f475055fca1ff600d2a4 | refs/heads/master | 2021-05-01T16:31:45.977554 | 2017-04-03T00:02:01 | 2017-04-03T00:02:01 | 32,282,437 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,325 | java | package org.opencv.engine3;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
public class OpenCVEngineService extends Service
{
private static final String TAG = "OpenCVEngine/Service";
private IBinder mEngineInterface = null;
private MarketConnector mMarket;
private BinderConnector mNativeBinder;
public void onCreate() {
Log.i(TAG, "Service starting");
super.onCreate();
Log.i(TAG, "Engine binder component creating");
mMarket = new MarketConnector(getBaseContext());
mNativeBinder = new BinderConnector(mMarket);
if (mNativeBinder.Init()) {
mEngineInterface = mNativeBinder.Connect();
Log.i(TAG, "Service started successfully");
} else {
Log.e(TAG, "Cannot initialize native part of OpenCV Manager!");
Log.e(TAG, "Using stub instead");
mEngineInterface = new OpenCVEngineInterface.Stub() {
@Override
public boolean installVersion(String version) throws RemoteException {
// TODO Auto-generated method stub
return false;
}
@Override
public String getLibraryList(String version) throws RemoteException {
// TODO Auto-generated method stub
return null;
}
@Override
public String getLibPathByVersion(String version) throws RemoteException {
// TODO Auto-generated method stub
return null;
}
@Override
public int getEngineVersion() throws RemoteException {
return -1;
}
};
}
}
public IBinder onBind(Intent intent) {
Log.i(TAG, "Service onBind called for intent " + intent.toString());
return mEngineInterface;
}
public boolean onUnbind(Intent intent)
{
Log.i(TAG, "Service onUnbind called for intent " + intent.toString());
return true;
}
public void OnDestroy()
{
Log.i(TAG, "OpenCV Engine service destruction");
mNativeBinder.Disconnect();
}
}
| [
"andyxian510@gmail.com"
] | andyxian510@gmail.com |
ed5676efc6b874498b3d954ed8c6b46c4c4b3858 | 62e330c99cd6cedf20bc162454b8160c5e1a0df8 | /basex-core/src/main/java/org/basex/query/func/fn/FnSubstringAfter.java | 92e062618de9809e5b45b301aae9b29e33210d4f | [
"BSD-3-Clause"
] | permissive | nachawati/basex | 76a717b069dcea3932fad5116e0a42a727052b58 | 0bc95648390ec3e91b8fd3e6ddb9ba8f19158807 | refs/heads/master | 2021-07-20T06:57:18.969297 | 2017-10-31T04:17:00 | 2017-10-31T04:17:00 | 106,351,382 | 0 | 0 | null | 2017-10-10T01:00:38 | 2017-10-10T01:00:38 | null | UTF-8 | Java | false | false | 849 | java | package org.basex.query.func.fn;
import static org.basex.util.Token.*;
import org.basex.query.*;
import org.basex.query.func.*;
import org.basex.query.util.collation.*;
import org.basex.query.value.item.*;
import org.basex.util.*;
/**
* Function implementation.
*
* @author BaseX Team 2005-17, BSD License
* @author Christian Gruen
*/
public final class FnSubstringAfter extends StandardFunc {
@Override
public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
final byte[] ss = toEmptyToken(exprs[0], qc), sb = toEmptyToken(exprs[1], qc);
final Collation coll = toCollation(2, qc);
if(coll == null) {
final int p = indexOf(ss, sb);
return p == -1 ? Str.ZERO : Str.get(substring(ss, p + sb.length));
}
return Str.get(coll.after(ss, sb, info));
}
}
| [
"mnachawa@gmu.edu"
] | mnachawa@gmu.edu |
1db710906bbfed36df9706b534a963b69577bb17 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /files/File_1016085.java | b886a0eece7010a31e296f8134d93b8eb54680d5 | [
"Apache-2.0"
] | permissive | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,991 | java | /*
* This file is part of WebLookAndFeel library.
*
* WebLookAndFeel library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* WebLookAndFeel library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WebLookAndFeel library. If not, see <http://www.gnu.org/licenses/>.
*/
package com.alee.managers.language.data;
import com.alee.utils.HtmlUtils;
import com.alee.utils.TextUtils;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import java.io.Serializable;
/**
* User: mgarin Date: 16.05.12 Time: 17:17
*/
@XStreamAlias ("text")
@XStreamConverter (TextConverter.class)
public final class Text implements Serializable, Cloneable
{
private String text;
private String state;
public Text ()
{
this ( "" );
}
public Text ( String text )
{
this ( text, null );
}
public Text ( String text, String state )
{
super ();
this.text = text;
this.state = state;
}
public String getText ()
{
return text;
}
public void setText ( String text )
{
this.text = text;
}
public String getState ()
{
return state;
}
public void setState ( String state )
{
this.state = state;
}
@Override
public Text clone ()
{
return new Text ( text, state );
}
public String toString ()
{
return TextUtils.shortenText ( HtmlUtils.getPlainText ( text ), 50, true );
}
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
a12c03283b678c40a9cd16b6d05e41e26ca6118f | bc02a58894d48bb97294798bed9a4b694f91b431 | /app/src/main/java/com/example/madcampweek3/customfonts/MyTextView_Roboto_Medium.java | 3a077f18300194975aa3ee25046f5db31e3b59ab | [] | no_license | seo3650/2020_madcamp_third | 815e044641126ab193554e0efbe35d94d281dee0 | 8f9fb26f345cb20653072797927d993419723eb5 | refs/heads/master | 2022-12-05T05:13:03.425173 | 2020-08-23T08:17:34 | 2020-08-23T08:17:34 | 281,841,913 | 1 | 1 | null | 2020-07-25T14:33:27 | 2020-07-23T03:35:18 | Java | UTF-8 | Java | false | false | 995 | java | package com.example.madcampweek3.customfonts;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
/**
* DatingApp
* https://github.com/quintuslabs/DatingApp
* Created on 25-sept-2018.
* Created by : Santosh Kumar Dash:- http://santoshdash.epizy.com
*/
public class MyTextView_Roboto_Medium extends androidx.appcompat.widget.AppCompatTextView {
public MyTextView_Roboto_Medium(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
public MyTextView_Roboto_Medium(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public MyTextView_Roboto_Medium(Context context) {
super(context);
init();
}
private void init() {
if (!isInEditMode()) {
Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Medium.ttf");
setTypeface(tf);
}
}
} | [
"iqeq2328@gmail.com"
] | iqeq2328@gmail.com |
0438c019dfe3a3e4671c2ed27cbd4fda5c3f99a8 | b59472ded3c2a1439f3b16d0941d8dec6520dac5 | /src/proyecto-original/Revelaciones-branch-5/src/XbrlCore/src/xbrlcore/junit/LoadSVSTaxonomy.java | f67cad1a9dce4af63ebaf2a57c68c66f66695c7a | [] | no_license | vicky1404/rev-ii | a0672bf6d1ffa16f9a2c99b2465359d0a69d51bd | cc264cf7612ad3b2b4c9705f6b8cf29639ef7fa2 | refs/heads/master | 2020-05-16T09:19:22.181375 | 2013-08-05T02:14:06 | 2013-08-05T02:14:06 | 34,520,890 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,297 | java | package xbrlcore.junit;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import javax.xml.parsers.ParserConfigurationException;
import org.junit.Test;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import xbrlcore.taxonomy.Concept;
import xbrlcore.taxonomy.DiscoverableTaxonomySet;
import xbrlcore.taxonomy.sax.SAXBuilder;
public class LoadSVSTaxonomy {
@SuppressWarnings("unused")
@Test
public void getDTS() throws SAXException, IOException, ParserConfigurationException {
SAXBuilder saxBuilder = new SAXBuilder();
try{
//DiscoverableTaxonomySet taxonomySet = saxBuilder.build(new InputSource("file://EQ13797/taxonomias/2012-01-02/taxonomia-svs/eeff/cl-cs_shell_2012-01-02.xsd"));
//DiscoverableTaxonomySet taxonomySet = saxBuilder.build(new InputSource("xbrl/test/svs/eeff-y-notas/cl-cs_shell_2012-07-17.xsd"));
DiscoverableTaxonomySet taxonomySet = saxBuilder.build(new InputSource("file://eq13830/taxonomias/2012-07-17/taxonomia-svs/eeff-y-notas/cl-cs_shell_2012-07-17.xsd"));
System.err.println("Nombre de la Taxonomia :"+taxonomySet.getTopTaxonomy().getName());
System.err.println("Total de conceptos "+taxonomySet.getConcepts().size());
for(Concept concept : taxonomySet.getConcepts()){
System.err.println("=====================================\n"+
"ID: "+concept.getId()+"\n"+
"Name: "+concept.getName()+"\n"+
"Type: "+concept.getType()+"\n"+
"Namespace: "+concept.getNamespace().getPrefix()+"\n"+
"Substitution Group: "+concept.getSubstitutionGroup()+"\n"+
"Period Type: "+concept.getPeriodType()+"\n"+
"Schema Name: "+concept.getTaxonomySchemaName()+"\n"+
"=====================================\n");
}
// for(Map.Entry<String, TaxonomySchema> entry : taxonomySet.getTaxonomyMap().entrySet()){
// String key = entry.getKey();
// TaxonomySchema value = entry.getValue();
// System.out.println("key "+key);
// System.out.println("value "+value.getName());
// }
}catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"rodrigo.reyesco@17bb37fe-d5a1-dcfe-262a-f88f89c0b580"
] | rodrigo.reyesco@17bb37fe-d5a1-dcfe-262a-f88f89c0b580 |
ee6c319ab3a6c5be550772b1bfe1c92d1f4d1720 | 5b665181dbb8b5c00c962199b8e93332f459f454 | /src/streamapi/StreamAPITest1.java | e43d24f6c89d836f484f6390d8ff27712189356b | [] | no_license | Dongdonghe1981/jdk_project | e3c2020db3bdf108bde0709deacc2d5e86e3e983 | 46c5653bc21833212671924a1940be0274e63517 | refs/heads/master | 2020-09-15T08:34:38.880023 | 2019-11-30T14:32:19 | 2019-11-30T14:32:19 | 223,396,318 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,231 | java | package streamapi;
import dto.Employee;
import dto.EmployeeData;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
public class StreamAPITest1 {
@Test
public void test1(){
List<Employee> employees = EmployeeData.getEmployee();
employees.stream().filter(e -> e.getAge()>26).forEach(System.out::println);
System.out.println("===============");
employees.stream().limit(3).forEach(System.out::println);
System.out.println("===============");
employees.stream().skip(2).forEach(System.out::println);
System.out.println("===============");
employees.addAll(EmployeeData.getEmployee());
employees.stream().distinct().forEach(System.out::println);
System.out.println("===============");
}
@Test
public void test2(){
//ma(Function f)
List<String> list = Arrays.asList("aa","bb","cc","dd");
list.stream().map(s -> s.toUpperCase()).forEach(System.out::println);
List<Employee> emptiest = EmployeeData.getEmployee();
emptiest.stream().map(e -> e.getName().length() > 3).forEach(System.out::println);
emptiest.stream().filter(e -> e.getName().length() > 3).forEach(System.out::println);
//flatMap
list.stream().flatMap(StreamAPITest1::fromStringToStream).forEach(System.out::println);
}
public static Stream<Character> fromStringToStream(String str){
ArrayList<Character> list = new ArrayList();
for(Character c : str.toCharArray()){
list.add(c);
}
return list.stream();
}
@Test
public void test3(){
List<Integer> list = Arrays.asList(1,3,2,4,6,5);
list.stream().sorted().forEach(System.out::println);
List<Employee> emptiest = EmployeeData.getEmployee();
emptiest.stream().sorted((e1,e2) ->
{
int ageValue = Integer.compare(e1.getAge(),e2.getAge());
if (ageValue !=0 ){
return Double.compare(e1.getId(),e2.getId());
}else{
return ageValue;
}
}).forEach(System.out::println);
}
}
| [
"“43654280@qq.com”"
] | “43654280@qq.com” |
1cc24d0563bb6446cae7ab6d75b18af7c3436efc | c41281a5d814e36514041c49701843e793c2c2b7 | /src/main/java/org/vaadin/teemu/wizards/Wizard.java | 5063f9f2f564c966af0593ad8364394e37640565 | [] | no_license | ow2-sirocco/sirocco-web-dashboard | f4590208d6f3d879b5f270edf4f35ce93ca34b0f | f22546a9266651484046e0033ce9e343c87fcb72 | refs/heads/master | 2021-01-23T03:22:12.090496 | 2014-06-05T16:50:30 | 2014-06-05T16:50:30 | 13,134,837 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 19,117 | java | package org.vaadin.teemu.wizards;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.vaadin.teemu.wizards.event.WizardCancelledEvent;
import org.vaadin.teemu.wizards.event.WizardCompletedEvent;
import org.vaadin.teemu.wizards.event.WizardProgressListener;
import org.vaadin.teemu.wizards.event.WizardStepActivationEvent;
import org.vaadin.teemu.wizards.event.WizardStepSetChangedEvent;
import com.vaadin.server.Page;
import com.vaadin.server.Page.UriFragmentChangedEvent;
import com.vaadin.server.Page.UriFragmentChangedListener;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
/**
* Component for displaying multi-step wizard style user interface.
* <p>
* The steps of the wizard must be implementations of the {@link WizardStep} interface. Use the {@link #addStep(WizardStep)}
* method to add these steps in the same order they are supposed to be displayed.
* </p>
* <p>
* The wizard also supports navigation through URI fragments. This feature is disabled by default, but you can enable it using
* {@link #setUriFragmentEnabled(boolean)} method. Each step will get a generated identifier that is used as the URI fragment.
* If you wish to override these with your own identifiers, you can add the steps using the overloaded
* {@link #addStep(WizardStep, String)} method.
* </p>
* <p>
* To react on the progress, cancellation or completion of this {@code Wizard} you should add one or more listeners that
* implement the {@link WizardProgressListener} interface. These listeners are added using the
* {@link #addListener(WizardProgressListener)} method and removed with the {@link #removeListener(WizardProgressListener)}.
* </p>
*
* @author Teemu Pöntelin / Vaadin Ltd
*/
@SuppressWarnings("serial")
public class Wizard extends CustomComponent implements UriFragmentChangedListener {
protected final List<WizardStep> steps = new ArrayList<WizardStep>();
protected final Map<String, WizardStep> idMap = new HashMap<String, WizardStep>();
protected WizardStep currentStep;
protected WizardStep lastCompletedStep;
private int stepIndex = 1;
protected VerticalLayout mainLayout;
protected HorizontalLayout footer;
private Panel contentPanel;
private Button nextButton;
private Button backButton;
private Button finishButton;
private Button cancelButton;
private Component header;
private boolean uriFragmentEnabled;
private static final Method WIZARD_ACTIVE_STEP_CHANGED_METHOD;
private static final Method WIZARD_STEP_SET_CHANGED_METHOD;
private static final Method WIZARD_COMPLETED_METHOD;
private static final Method WIZARD_CANCELLED_METHOD;
static {
try {
WIZARD_COMPLETED_METHOD = WizardProgressListener.class.getDeclaredMethod("wizardCompleted",
new Class[] {WizardCompletedEvent.class});
WIZARD_STEP_SET_CHANGED_METHOD = WizardProgressListener.class.getDeclaredMethod("stepSetChanged",
new Class[] {WizardStepSetChangedEvent.class});
WIZARD_ACTIVE_STEP_CHANGED_METHOD = WizardProgressListener.class.getDeclaredMethod("activeStepChanged",
new Class[] {WizardStepActivationEvent.class});
WIZARD_CANCELLED_METHOD = WizardProgressListener.class.getDeclaredMethod("wizardCancelled",
new Class[] {WizardCancelledEvent.class});
} catch (final java.lang.NoSuchMethodException e) {
// This should never happen
throw new java.lang.RuntimeException("Internal error finding methods in Wizard", e);
}
}
public Wizard() {
this.setStyleName("wizard");
this.init();
}
private void init() {
this.mainLayout = new VerticalLayout();
this.setCompositionRoot(this.mainLayout);
this.setSizeFull();
this.contentPanel = new Panel();
this.contentPanel.setSizeFull();
this.initControlButtons();
this.footer = new HorizontalLayout();
this.footer.setSpacing(true);
this.footer.addComponent(this.cancelButton);
this.footer.addComponent(this.backButton);
this.footer.addComponent(this.nextButton);
this.footer.addComponent(this.finishButton);
this.mainLayout.addComponent(this.contentPanel);
this.mainLayout.addComponent(this.footer);
this.mainLayout.setComponentAlignment(this.footer, Alignment.BOTTOM_RIGHT);
this.mainLayout.setExpandRatio(this.contentPanel, 1.0f);
this.mainLayout.setSizeFull();
this.initDefaultHeader();
}
private void initControlButtons() {
this.nextButton = new Button("Next");
this.nextButton.addClickListener(new Button.ClickListener() {
public void buttonClick(final ClickEvent event) {
Wizard.this.next();
}
});
this.backButton = new Button("Back");
this.backButton.addClickListener(new Button.ClickListener() {
public void buttonClick(final ClickEvent event) {
Wizard.this.back();
}
});
this.finishButton = new Button("Finish");
this.finishButton.addClickListener(new Button.ClickListener() {
public void buttonClick(final ClickEvent event) {
Wizard.this.finish();
}
});
// finishButton.setEnabled(false);
this.cancelButton = new Button("Cancel");
this.cancelButton.addClickListener(new Button.ClickListener() {
public void buttonClick(final ClickEvent event) {
Wizard.this.cancel();
}
});
}
private void initDefaultHeader() {
WizardProgressBar progressBar = new WizardProgressBar(this);
this.addListener(progressBar);
this.setHeader(progressBar);
}
public void setUriFragmentEnabled(final boolean enabled) {
if (enabled) {
Page.getCurrent().addUriFragmentChangedListener(this);
} else {
Page.getCurrent().removeUriFragmentChangedListener(this);
}
this.uriFragmentEnabled = enabled;
}
public boolean isUriFragmentEnabled() {
return this.uriFragmentEnabled;
}
/**
* Sets a {@link Component} that is displayed on top of the actual content. Set to {@code null} to remove the header
* altogether.
*
* @param newHeader {@link Component} to be displayed on top of the actual content or {@code null} to remove the header.
*/
public void setHeader(final Component newHeader) {
if (this.header != null) {
if (newHeader == null) {
this.mainLayout.removeComponent(this.header);
} else {
this.mainLayout.replaceComponent(this.header, newHeader);
}
} else {
if (newHeader != null) {
this.mainLayout.addComponentAsFirst(newHeader);
}
}
this.header = newHeader;
}
/**
* Returns a {@link Component} that is displayed on top of the actual content or {@code null} if no header is specified.
* <p>
* By default the header is a {@link WizardProgressBar} component that is also registered as a
* {@link WizardProgressListener} to this Wizard.
* </p>
*
* @return {@link Component} that is displayed on top of the actual content or {@code null}.
*/
public Component getHeader() {
return this.header;
}
/**
* Adds a step to this Wizard with the given identifier. The used {@code id} must be unique or an
* {@link IllegalArgumentException} is thrown. If you don't wish to explicitly provide an identifier, you can use the
* {@link #addStep(WizardStep)} method.
*
* @param step
* @param id
* @throws IllegalStateException if the given {@code id} already exists.
*/
public void addStep(final WizardStep step, final String id) {
if (this.idMap.containsKey(id)) {
throw new IllegalArgumentException(String.format(
"A step with given id %s already exists. You must use unique identifiers for the steps.", id));
}
this.steps.add(step);
this.idMap.put(id, step);
this.updateButtons();
// notify listeners
this.fireEvent(new WizardStepSetChangedEvent(this));
// activate the first step immediately
if (this.currentStep == null) {
this.activateStep(step);
}
}
/**
* Adds a step to this Wizard. The WizardStep will be assigned an identifier automatically. If you wish to provide an
* explicit identifier for your WizardStep, you can use the {@link #addStep(WizardStep, String)} method instead.
*
* @param step
*/
public void addStep(final WizardStep step) {
this.addStep(step, "wizard-step-" + this.stepIndex++);
}
public void addListener(final WizardProgressListener listener) {
this.addListener(WizardCompletedEvent.class, listener, Wizard.WIZARD_COMPLETED_METHOD);
this.addListener(WizardStepActivationEvent.class, listener, Wizard.WIZARD_ACTIVE_STEP_CHANGED_METHOD);
this.addListener(WizardStepSetChangedEvent.class, listener, Wizard.WIZARD_STEP_SET_CHANGED_METHOD);
this.addListener(WizardCancelledEvent.class, listener, Wizard.WIZARD_CANCELLED_METHOD);
}
public void removeListener(final WizardProgressListener listener) {
this.removeListener(WizardCompletedEvent.class, listener, Wizard.WIZARD_COMPLETED_METHOD);
this.removeListener(WizardStepActivationEvent.class, listener, Wizard.WIZARD_ACTIVE_STEP_CHANGED_METHOD);
this.removeListener(WizardStepSetChangedEvent.class, listener, Wizard.WIZARD_STEP_SET_CHANGED_METHOD);
this.removeListener(WizardCancelledEvent.class, listener, Wizard.WIZARD_CANCELLED_METHOD);
}
public List<WizardStep> getSteps() {
return Collections.unmodifiableList(this.steps);
}
/**
* Returns {@code true} if the given step is already completed by the user.
*
* @param step step to check for completion.
* @return {@code true} if the given step is already completed.
*/
public boolean isCompleted(final WizardStep step) {
return this.steps.indexOf(step) < this.steps.indexOf(this.currentStep);
}
/**
* Returns {@code true} if the given step is the currently active step.
*
* @param step step to check for.
* @return {@code true} if the given step is the currently active step.
*/
public boolean isActive(final WizardStep step) {
return (step == this.currentStep);
}
public void updateButtons() {
if (this.isLastStep(this.currentStep)) {
// this.finishButton.setEnabled(this.currentStep != null ? this.currentStep.onAdvance() : true);
this.finishButton.setEnabled(true);
this.nextButton.setEnabled(false);
} else {
this.finishButton.setEnabled(false);
this.nextButton.setEnabled(true);
// this.nextButton.setEnabled(this.currentStep != null ? this.currentStep.onAdvance() : true);
}
this.backButton.setEnabled(!this.isFirstStep(this.currentStep));
this.cancelButton.setEnabled(true);
}
public Button getNextButton() {
return this.nextButton;
}
public Button getBackButton() {
return this.backButton;
}
public Button getFinishButton() {
return this.finishButton;
}
public Button getCancelButton() {
return this.cancelButton;
}
public void disableButtons() {
this.nextButton.setEnabled(false);
this.backButton.setEnabled(false);
this.finishButton.setEnabled(false);
this.cancelButton.setEnabled(false);
}
public void activateStep(final WizardStep step) {
if (step == null) {
return;
}
if (this.currentStep != null) {
if (this.currentStep.equals(step)) {
// already active
return;
}
// ask if we're allowed to move
boolean advancing = this.steps.indexOf(step) > this.steps.indexOf(this.currentStep);
if (advancing) {
if (!this.currentStep.onAdvance()) {
// not allowed to advance
return;
}
} else {
if (!this.currentStep.onBack()) {
// not allowed to go back
return;
}
}
// keep track of the last step that was completed
int currentIndex = this.steps.indexOf(this.currentStep);
if (this.lastCompletedStep == null || this.steps.indexOf(this.lastCompletedStep) < currentIndex) {
this.lastCompletedStep = this.currentStep;
}
}
this.contentPanel.setContent(step.getContent());
this.currentStep = step;
this.updateUriFragment();
this.updateButtons();
this.fireEvent(new WizardStepActivationEvent(this, step));
}
protected void activateStep(final String id) {
WizardStep step = this.idMap.get(id);
if (step != null) {
// check that we don't go past the lastCompletedStep by using the id
int lastCompletedIndex = this.lastCompletedStep == null ? -1 : this.steps.indexOf(this.lastCompletedStep);
int stepIndex = this.steps.indexOf(step);
if (lastCompletedIndex < stepIndex) {
this.activateStep(this.lastCompletedStep);
} else {
this.activateStep(step);
}
}
}
protected String getId(final WizardStep step) {
for (Map.Entry<String, WizardStep> entry : this.idMap.entrySet()) {
if (entry.getValue().equals(step)) {
return entry.getKey();
}
}
return null;
}
private void updateUriFragment() {
if (this.isUriFragmentEnabled()) {
String currentStepId = this.getId(this.currentStep);
if (currentStepId != null && currentStepId.length() > 0) {
Page.getCurrent().setUriFragment(currentStepId, false);
} else {
Page.getCurrent().setUriFragment(null, false);
}
}
}
protected boolean isFirstStep(final WizardStep step) {
if (step != null) {
return this.steps.indexOf(step) == 0;
}
return false;
}
protected boolean isLastStep(final WizardStep step) {
if (step != null && !this.steps.isEmpty()) {
return this.steps.indexOf(step) == (this.steps.size() - 1);
}
return false;
}
/**
* Cancels this Wizard triggering a {@link WizardCancelledEvent}. This method is called when user clicks the cancel button.
*/
public void cancel() {
this.fireEvent(new WizardCancelledEvent(this));
}
/**
* Triggers a {@link WizardCompletedEvent} if the current step is the last step and it allows advancing (see
* {@link WizardStep#onAdvance()}). This method is called when user clicks the finish button.
*/
public void finish() {
if (this.isLastStep(this.currentStep) && this.currentStep.onAdvance()) {
// next (finish) allowed -> fire complete event
this.fireEvent(new WizardCompletedEvent(this));
}
}
/**
* Activates the next {@link WizardStep} if the current step allows advancing (see {@link WizardStep#onAdvance()}) or calls
* the {@link #finish()} method the current step is the last step. This method is called when user clicks the next button.
*/
public void next() {
if (this.isLastStep(this.currentStep)) {
this.finish();
} else {
int currentIndex = this.steps.indexOf(this.currentStep);
this.activateStep(this.steps.get(currentIndex + 1));
}
}
/**
* Activates the previous {@link WizardStep} if the current step allows going back (see {@link WizardStep#onBack()}) and the
* current step is not the first step. This method is called when user clicks the back button.
*/
public void back() {
int currentIndex = this.steps.indexOf(this.currentStep);
if (currentIndex > 0) {
this.activateStep(this.steps.get(currentIndex - 1));
}
}
@Override
public void uriFragmentChanged(final UriFragmentChangedEvent event) {
if (this.isUriFragmentEnabled()) {
String fragment = event.getUriFragment();
if (fragment.equals("") && !this.steps.isEmpty()) {
// empty fragment -> set the fragment of first step
Page.getCurrent().setUriFragment(this.getId(this.steps.get(0)));
} else {
this.activateStep(fragment);
}
}
}
/**
* Removes the given step from this Wizard. An {@link IllegalStateException} is thrown if the given step is already
* completed or is the currently active step.
*
* @param stepToRemove the step to remove.
* @see #isCompleted(WizardStep)
* @see #isActive(WizardStep)
*/
public void removeStep(final WizardStep stepToRemove) {
if (this.idMap.containsValue(stepToRemove)) {
for (Map.Entry<String, WizardStep> entry : this.idMap.entrySet()) {
if (entry.getValue().equals(stepToRemove)) {
// delegate the actual removal to the overloaded method
this.removeStep(entry.getKey());
return;
}
}
}
}
/**
* Removes the step with given id from this Wizard. An {@link IllegalStateException} is thrown if the given step is already
* completed or is the currently active step.
*
* @param id identifier of the step to remove.
* @see #isCompleted(WizardStep)
* @see #isActive(WizardStep)
*/
public void removeStep(final String id) {
if (this.idMap.containsKey(id)) {
WizardStep stepToRemove = this.idMap.get(id);
if (this.isCompleted(stepToRemove)) {
throw new IllegalStateException("Already completed step cannot be removed.");
}
if (this.isActive(stepToRemove)) {
throw new IllegalStateException("Currently active step cannot be removed.");
}
this.idMap.remove(id);
this.steps.remove(stepToRemove);
// notify listeners
this.fireEvent(new WizardStepSetChangedEvent(this));
}
}
}
| [
"frederic.dangtran@orange.com"
] | frederic.dangtran@orange.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.