blob_id stringlengths 40 40 | __id__ int64 225 39,780B | directory_id stringlengths 40 40 | path stringlengths 6 313 | content_id stringlengths 40 40 | detected_licenses list | license_type stringclasses 2
values | repo_name stringlengths 6 132 | repo_url stringlengths 25 151 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 70 | visit_date timestamp[ns] | revision_date timestamp[ns] | committer_date timestamp[ns] | github_id int64 7.28k 689M ⌀ | star_events_count int64 0 131k | fork_events_count int64 0 48k | gha_license_id stringclasses 23
values | gha_fork bool 2
classes | gha_event_created_at timestamp[ns] | gha_created_at timestamp[ns] | gha_updated_at timestamp[ns] | gha_pushed_at timestamp[ns] | gha_size int64 0 40.4M ⌀ | gha_stargazers_count int32 0 112k ⌀ | gha_forks_count int32 0 39.4k ⌀ | gha_open_issues_count int32 0 11k ⌀ | gha_language stringlengths 1 21 ⌀ | gha_archived bool 2
classes | gha_disabled bool 1
class | content stringlengths 7 4.37M | src_encoding stringlengths 3 16 | language stringclasses 1
value | length_bytes int64 7 4.37M | extension stringclasses 24
values | filename stringlengths 4 174 | language_id stringclasses 1
value | entities list | contaminating_dataset stringclasses 0
values | malware_signatures list | redacted_content stringlengths 7 4.37M | redacted_length_bytes int64 7 4.37M | alphanum_fraction float32 0.25 0.94 | alpha_fraction float32 0.25 0.94 | num_lines int32 1 84k | avg_line_length float32 0.76 99.9 | std_line_length float32 0 220 | max_line_length int32 5 998 | is_vendor bool 2
classes | is_generated bool 1
class | max_hex_length int32 0 319 | hex_fraction float32 0 0.38 | max_unicode_length int32 0 408 | unicode_fraction float32 0 0.36 | max_base64_length int32 0 506 | base64_fraction float32 0 0.5 | avg_csv_sep_count float32 0 4 | is_autogen_header bool 1
class | is_empty_html bool 1
class | shard stringclasses 16
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
46886207e3f9a74b769325c4c12ac1e3ca4f3b17 | 20,358,145,017,231 | 55e231ac1b817a416b6dd746025215b0586f17ed | /kmeans/src/at/ac/univie/sdm2016/kmeans/Point.java | 029541a40b928ee0866abdf48fa27a54c4def923 | [] | no_license | Markus130/SDM-Group | https://github.com/Markus130/SDM-Group | afd1cfebc9865dfa842f721077e4f1c752895bf3 | 2c9c9fe525bad01ca77d3a3219a5e17fa1eee3ad | refs/heads/master | 2016-06-16T10:50:49.084000 | 2016-06-09T08:24:49 | 2016-06-09T08:24:49 | 53,195,258 | 0 | 0 | null | false | 2016-04-10T20:59:37 | 2016-03-05T10:12:02 | 2016-03-09T23:34:18 | 2016-04-10T20:59:36 | 5,574 | 0 | 0 | 0 | Java | null | null | package at.ac.univie.sdm2016.kmeans;
import java.util.ArrayList;
import java.util.List;
/**
* Class point represents one point of date in n - dimensions.
*
* @since v0.1; 20160307
*
*/
public class Point {
private List<Double> dim;
private int cluster_number = 0;
public Point(List<Double> dim) {
this.dim = dim;
}
public Point(int countDim) {
this.dim = new ArrayList<Double>(countDim);
for (int i = 0; i < countDim; i++) {
this.dim.add(0.0);
}
}
public Point(Point point) {
this.dim = new ArrayList<Double>(point.getDim());
}
public double getDistance(Point otherPoint) {
double d = 0;
for (int i = 0; i < dim.size(); i++) {
d += (dim.get(i) - otherPoint.getDim().get(i))
* (dim.get(i) - otherPoint.getDim().get(i));
}
return d;
}
public void setCluster(int n) {
this.cluster_number = n;
}
public int getCluster() {
return this.cluster_number;
}
public List<Double> getDim() {
return dim;
}
public void setDim(List<Double> dim) {
this.dim = dim;
}
public Double get(int i) {
return this.getDim().get(i);
}
public void set(int i, double coord) {
this.getDim().set(i, coord);
}
@Override
public String toString() {
String result = "";
for (Double d : dim) {
result += d.toString();
if (d == dim.get(dim.size() - 1))
continue;
result += " , ";
}
return result;
}
public int size() {
if (this.getDim() == null)
return 0;
return this.getDim().size();
}
} | UTF-8 | Java | 1,473 | java | Point.java | Java | [] | null | [] | package at.ac.univie.sdm2016.kmeans;
import java.util.ArrayList;
import java.util.List;
/**
* Class point represents one point of date in n - dimensions.
*
* @since v0.1; 20160307
*
*/
public class Point {
private List<Double> dim;
private int cluster_number = 0;
public Point(List<Double> dim) {
this.dim = dim;
}
public Point(int countDim) {
this.dim = new ArrayList<Double>(countDim);
for (int i = 0; i < countDim; i++) {
this.dim.add(0.0);
}
}
public Point(Point point) {
this.dim = new ArrayList<Double>(point.getDim());
}
public double getDistance(Point otherPoint) {
double d = 0;
for (int i = 0; i < dim.size(); i++) {
d += (dim.get(i) - otherPoint.getDim().get(i))
* (dim.get(i) - otherPoint.getDim().get(i));
}
return d;
}
public void setCluster(int n) {
this.cluster_number = n;
}
public int getCluster() {
return this.cluster_number;
}
public List<Double> getDim() {
return dim;
}
public void setDim(List<Double> dim) {
this.dim = dim;
}
public Double get(int i) {
return this.getDim().get(i);
}
public void set(int i, double coord) {
this.getDim().set(i, coord);
}
@Override
public String toString() {
String result = "";
for (Double d : dim) {
result += d.toString();
if (d == dim.get(dim.size() - 1))
continue;
result += " , ";
}
return result;
}
public int size() {
if (this.getDim() == null)
return 0;
return this.getDim().size();
}
} | 1,473 | 0.612356 | 0.59742 | 86 | 16.139534 | 16.050909 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.5 | false | false | 9 |
04eaa814023160c216acf3e18a954007d0222fb4 | 13,898,514,198,561 | b342d3943f9f65edea4a50aabab5cae1bae12add | /src/ISDivisibleBy4OrNot.java | f1848f39c2214e9162c9c3e3ed37979ac730c986 | [] | no_license | aseemakurty/JavaProgramsDump | https://github.com/aseemakurty/JavaProgramsDump | 23b485c27deb30e6599ec77055fbe54e324725d3 | c71ddd6857a65f0af8c456aa2a131186c7eb765c | refs/heads/master | 2021-05-24T08:57:54.893000 | 2020-04-06T11:59:11 | 2020-04-06T11:59:11 | 253,482,542 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | public class ISDivisibleBy4OrNot {
static boolean check(String num){
if(num.length()==0)
return false;
if(num.length()==1)
return (num.charAt(0)%4==0);
int last = num.charAt(num.length()-1);
int secondLast = num.charAt(num.length()-2);
return (((secondLast*10)+last)%4==0);
}
public static void main(String args[]){
String str = "76952";
if(check(str))
System.out.print("Yes, divisible by 4");
else
System.out.print("No, not divisible by 4");
}
}
| UTF-8 | Java | 582 | java | ISDivisibleBy4OrNot.java | Java | [] | null | [] | public class ISDivisibleBy4OrNot {
static boolean check(String num){
if(num.length()==0)
return false;
if(num.length()==1)
return (num.charAt(0)%4==0);
int last = num.charAt(num.length()-1);
int secondLast = num.charAt(num.length()-2);
return (((secondLast*10)+last)%4==0);
}
public static void main(String args[]){
String str = "76952";
if(check(str))
System.out.print("Yes, divisible by 4");
else
System.out.print("No, not divisible by 4");
}
}
| 582 | 0.532646 | 0.5 | 20 | 28.1 | 17.913403 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 9 |
915e524463219063810ec9194483859613ad943a | 28,037,546,539,548 | 832caa6007829bcbba8cf7de4f853b8edd0ef474 | /src/main/java/com/vn/evolus/commons/ConvertUtil.java | 3a5de9aa778247772b1d407730a712bb71640e8d | [] | no_license | lequangthanh/lunarwidget | https://github.com/lequangthanh/lunarwidget | 080d5fca4dc3dbf4ad18c4e4b69c69e4a912e806 | 72748f852c34f8d61ae6c94a2213f983bcd28a1b | refs/heads/master | 2016-09-22T01:41:02.811000 | 2016-09-21T11:07:01 | 2016-09-21T11:07:01 | 67,916,864 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.vn.evolus.commons;
import java.util.ArrayList;
import java.util.List;
public class ConvertUtil {
public static <T, V> List<V> convertFrom(List<T> items, IConvert<T, V> convert) {
List<V> list = new ArrayList<V>();
for (T t : items) {
V v = convert.convert(t);
list.add(v);
}
return list;
}
public interface IConvert<T, V> {
V convert(T from);
}
}
| UTF-8 | Java | 384 | java | ConvertUtil.java | Java | [] | null | [] | package com.vn.evolus.commons;
import java.util.ArrayList;
import java.util.List;
public class ConvertUtil {
public static <T, V> List<V> convertFrom(List<T> items, IConvert<T, V> convert) {
List<V> list = new ArrayList<V>();
for (T t : items) {
V v = convert.convert(t);
list.add(v);
}
return list;
}
public interface IConvert<T, V> {
V convert(T from);
}
}
| 384 | 0.651042 | 0.651042 | 20 | 18.200001 | 19.242142 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.65 | false | false | 9 |
d76a92a5ddfafbb7ef510d06b588c8a111ffdb17 | 31,456,340,509,676 | 4b430b0cb069095fcea5ab375448b88fd6ef26f8 | /order-management-common/src/main/java/com/dxhy/order/model/card/ReturnStateInfo.java | 47becc7a9c3b6ac19c293e91d7282d045d82cdf8 | [] | no_license | moutainhigh/SpringBootSeckill | https://github.com/moutainhigh/SpringBootSeckill | b81bfc1eef3e5369f316f72fd72a59290340cd6a | 5bc5700c242a24307f81cabd22e63f6ccaf2d8c8 | refs/heads/master | 2023-02-05T01:04:18.811000 | 2020-12-29T07:46:56 | 2020-12-29T07:46:56 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.dxhy.order.model.card;
import lombok.Getter;
import lombok.Setter;
/**
*
* @ClassName :ReturnStateInfo
* @Description :
* @author :杨士勇
* @date :2020年4月13日 上午11:48:43
*
*
*/
@Setter
@Getter
public class ReturnStateInfo {
private String returnCode;
private String returnMessage;
}
| UTF-8 | Java | 337 | java | ReturnStateInfo.java | Java | [
{
"context": "me :ReturnStateInfo\n * @Description :\n * @author :杨士勇\n * @date :2020年4月13日 上午11:48:43\n * \n * \n */\n\n@Set",
"end": 153,
"score": 0.9998041391372681,
"start": 150,
"tag": "NAME",
"value": "杨士勇"
}
] | null | [] | package com.dxhy.order.model.card;
import lombok.Getter;
import lombok.Setter;
/**
*
* @ClassName :ReturnStateInfo
* @Description :
* @author :杨士勇
* @date :2020年4月13日 上午11:48:43
*
*
*/
@Setter
@Getter
public class ReturnStateInfo {
private String returnCode;
private String returnMessage;
}
| 337 | 0.693291 | 0.651757 | 25 | 11.52 | 12.280456 | 34 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.36 | false | false | 9 |
c6964a11bfbf3029652840728604fc9ccb122064 | 5,549,097,784,616 | 6e4f9272be1fd1ced07c516b43cdd2a937b09be2 | /src/main/java/ua/lviv/cinema/entity/Technology.java | 565fcec6e08993a4e652cc7fbc3a94e407564185 | [] | no_license | DoroshMaryan/Cinema | https://github.com/DoroshMaryan/Cinema | 681f666b2f76197e3d7ce653de7ad9d68c8c9154 | a21687ad9c2198fffd076572b504841ceedc9c98 | refs/heads/master | 2021-06-19T15:25:31.973000 | 2017-07-14T13:04:03 | 2017-07-14T13:04:03 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ua.lviv.cinema.entity;
public enum Technology {
/**
* List of states for the state drop down.
* @author Ryan Cuprak
*/
IMAX_2D("IMAX_2D"),
IMAX_3D("IMAX_3D"),
CINETECH_2D("CINETECH_2D"),
CINETECH_3D("CINETECH_3D");
/**
* State abbreviation
*/
private String abbreviation;
/**
* Constructs a new state
* @param abbreviation - abbreviation
*/
private Technology(String abbreviation) {
this.abbreviation = abbreviation;
}
@Override
public String toString() {
return abbreviation;
}
}
| UTF-8 | Java | 617 | java | Technology.java | Java | [
{
"context": "ist of states for the state drop down.\n\t * @author Ryan Cuprak\n\t */\n\t\n\t IMAX_2D(\"IMAX_2D\"),\n\t IMAX_3D(\"IMA",
"end": 129,
"score": 0.9998831152915955,
"start": 118,
"tag": "NAME",
"value": "Ryan Cuprak"
}
] | null | [] | package ua.lviv.cinema.entity;
public enum Technology {
/**
* List of states for the state drop down.
* @author <NAME>
*/
IMAX_2D("IMAX_2D"),
IMAX_3D("IMAX_3D"),
CINETECH_2D("CINETECH_2D"),
CINETECH_3D("CINETECH_3D");
/**
* State abbreviation
*/
private String abbreviation;
/**
* Constructs a new state
* @param abbreviation - abbreviation
*/
private Technology(String abbreviation) {
this.abbreviation = abbreviation;
}
@Override
public String toString() {
return abbreviation;
}
}
| 612 | 0.575365 | 0.562399 | 33 | 17.69697 | 14.987844 | 46 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false | 9 |
f4ec2b819d17a6092691438917426be2de828fcd | 5,652,176,964,413 | 6ecdf2af150a51675a10a1f7bd54319e54e64d72 | /src/main/java/com/nbp/bear/components/model/NbpDiseases.java | 1653368e9fc99849e5aa01481f02525662243f36 | [] | no_license | djomoutresor1/Microservices-Patients | https://github.com/djomoutresor1/Microservices-Patients | 0fa44d88bf959f068153478b3bcc7a019e2a4cfc | da3ba4626675e6ac43c1119da69a20685bc70337 | refs/heads/main | 2023-03-31T06:24:21.984000 | 2021-03-14T16:14:48 | 2021-03-14T16:14:48 | 344,224,796 | 0 | 0 | null | false | 2021-03-14T16:14:48 | 2021-03-03T18:25:39 | 2021-03-12T22:33:10 | 2021-03-14T16:14:48 | 78 | 0 | 0 | 0 | Java | false | false | package com.nbp.bear.components.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.persistence.*;
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "NBP_DISEASES")
public class NbpDiseases {
@Id
@GeneratedValue //(strategy = GenerationType.IDENTITY)
private Integer diseaseId;
private String nameDiseases;
private String descDiseases;
@ManyToOne(cascade=CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name="diseaseId", insertable = false, updatable = false)
private NbpPatient nbpPatient;
}
| UTF-8 | Java | 641 | java | NbpDiseases.java | Java | [] | null | [] | package com.nbp.bear.components.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import javax.persistence.*;
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "NBP_DISEASES")
public class NbpDiseases {
@Id
@GeneratedValue //(strategy = GenerationType.IDENTITY)
private Integer diseaseId;
private String nameDiseases;
private String descDiseases;
@ManyToOne(cascade=CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name="diseaseId", insertable = false, updatable = false)
private NbpPatient nbpPatient;
}
| 641 | 0.764431 | 0.764431 | 27 | 22.74074 | 19.475706 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.481481 | false | false | 9 |
e42fb951d30ab6baf4ac9b39a83e47ab6cd28715 | 13,314,398,649,541 | 17399ca9e577f79750937cccf29254dfba79da11 | /src/main/java/naryTreePreOrderTraversal/PreOrder.java | 4b5b4324b0948789e3dc37472b8e45b86c01679f | [] | no_license | Stachi01/LeetCode | https://github.com/Stachi01/LeetCode | ce91bf48b01d48fc69f528942d010a012eb5f4c1 | e09288d1787e5260d4c2ea5daa856a900a02f74b | refs/heads/master | 2020-05-22T08:21:52.653000 | 2019-08-20T19:34:39 | 2019-08-20T19:34:39 | 186,275,250 | 0 | 0 | null | false | 2020-10-13T13:13:50 | 2019-05-12T15:59:58 | 2019-08-20T19:34:48 | 2020-10-13T13:13:48 | 759 | 0 | 0 | 1 | Java | false | false | package naryTreePreOrderTraversal;
import java.util.LinkedList;
import java.util.List;
public class PreOrder {
List<Integer> list = new LinkedList<>();
public List<Integer> preorder(Node root) {
if(root == null)
return list;
list.add(root.val);
for(Node n : root.children)
preorder(n);
return list;
}
public static class Node{
int val;
List<Node> children;
public Node(int x, List<Node> children){
this.children = children;
val = x;
}
}
} | UTF-8 | Java | 579 | java | PreOrder.java | Java | [] | null | [] | package naryTreePreOrderTraversal;
import java.util.LinkedList;
import java.util.List;
public class PreOrder {
List<Integer> list = new LinkedList<>();
public List<Integer> preorder(Node root) {
if(root == null)
return list;
list.add(root.val);
for(Node n : root.children)
preorder(n);
return list;
}
public static class Node{
int val;
List<Node> children;
public Node(int x, List<Node> children){
this.children = children;
val = x;
}
}
} | 579 | 0.559586 | 0.559586 | 31 | 17.709677 | 15.502744 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.419355 | false | false | 9 |
dfb3e6384050693abe2677f5a35b885a129367e2 | 12,781,822,683,742 | 29b2bbd5df139b5dfaff7995faeb98512a2125f9 | /src/main/java/com/tfar/dankstorage/block/DankItemBlock.java | a3f618320379919b0fa2ae22cfcfd10df4d0062d | [] | no_license | modindex/Dank-Storage | https://github.com/modindex/Dank-Storage | f1c1f4b3a645c887b9ee9d8313e2fc7d52d9fdc7 | 7b4c3a78f2dbbdaebbcdc18778af0da523992633 | refs/heads/master | 2020-07-05T19:27:24.497000 | 2019-10-08T16:06:21 | 2019-10-08T16:06:21 | 202,747,319 | 0 | 0 | null | true | 2019-10-08T16:06:23 | 2019-08-16T14:59:08 | 2019-08-16T14:59:10 | 2019-10-08T16:06:22 | 101 | 0 | 0 | 0 | Java | false | false | package com.tfar.dankstorage.block;
import com.tfar.dankstorage.capability.CapabilityDankStorageProvider;
import com.tfar.dankstorage.container.PortableDankProvider;
import com.tfar.dankstorage.inventory.PortableDankHandler;
import com.tfar.dankstorage.network.CMessageTogglePickup;
import com.tfar.dankstorage.network.CMessageTogglePlacement;
import com.tfar.dankstorage.network.Utils;
import net.minecraft.block.Block;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.*;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nonnull;
public class DankItemBlock extends BlockItem {
public DankItemBlock(Block p_i48527_1_, Properties p_i48527_2_) {
super(p_i48527_1_, p_i48527_2_);
}
public static final Rarity GRAY = Rarity.create("dark_gray", TextFormatting.GRAY);
public static final Rarity RED = Rarity.create("red", TextFormatting.RED);
public static final Rarity GOLD = Rarity.create("gold", TextFormatting.GOLD);
public static final Rarity GREEN = Rarity.create("green", TextFormatting.GREEN);
public static final Rarity BLUE = Rarity.create("blue", TextFormatting.AQUA);
public static final Rarity PURPLE = Rarity.create("purple", TextFormatting.DARK_PURPLE);
public static final Rarity WHITE = Rarity.create("white", TextFormatting.WHITE);
@Override
public ICapabilityProvider initCapabilities(final ItemStack stack, final CompoundNBT nbt) {
return new CapabilityDankStorageProvider(stack);
}
@Nonnull
@Override
public Rarity getRarity(ItemStack stack) {
int type = Utils.getTier(stack);
switch (type) {
case 1:
return GRAY;
case 2:
return RED;
case 3:
return GOLD;
case 4:
return GREEN;
case 5:
return BLUE;
case 6:
return PURPLE;
case 7:
return WHITE;
}
return super.getRarity(stack);
}
@Override
public int getUseDuration(ItemStack bag) {
if (!Utils.isConstruction(bag))return 0;
ItemStack stack = Utils.getItemStackInSelectedSlot(bag);
return stack.getItem().getUseDuration(stack);
}
@Nonnull
@Override
public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand) {
ItemStack bag = player.getHeldItem(hand);
if (!world.isRemote)
if (Utils.getUseType(bag) == CMessageTogglePlacement.UseType.bag) {
int type = Utils.getTier(player.getHeldItem(hand));
NetworkHooks.openGui((ServerPlayerEntity) player, new PortableDankProvider(type), data -> data.writeItemStack(player.getHeldItem(hand)));
return super.onItemRightClick(world,player,hand);
} else {
ItemStack toPlace = Utils.getItemStackInSelectedSlot(bag);
EquipmentSlotType hand1 = hand == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND;
//handle food
if (toPlace.getItem().isFood()) {
if (player.canEat(false)) {
player.setActiveHand(hand);
return ActionResult.newResult(ActionResultType.PASS, bag);
}
}
//handle potion
else if (toPlace.getItem() instanceof PotionItem){
player.setActiveHand(hand);
return new ActionResult<>(ActionResultType.SUCCESS, player.getHeldItem(hand));
}
//todo support other items?
else {
ItemStack newBag = bag.copy();
//stack overflow issues
if (toPlace.getItem() instanceof DankItemBlock) return new ActionResult<>(ActionResultType.PASS, player.getHeldItem(hand));
player.setItemStackToSlot(hand1, toPlace);
ActionResult<ItemStack> actionResult = toPlace.getItem().onItemRightClick(world, player, hand);
PortableDankHandler handler = Utils.getHandler(newBag,true);
handler.setStackInSlot(Utils.getSelectedSlot(newBag), actionResult.getResult());
player.setItemStackToSlot(hand1, newBag);
}
}
return new ActionResult<>(ActionResultType.PASS, player.getHeldItem(hand));
}
@Override
public boolean itemInteractionForEntity(ItemStack bag, PlayerEntity player, LivingEntity entity, Hand hand) {
if (!Utils.isConstruction(bag))return false;
PortableDankHandler handler = Utils.getHandler(bag,false);
ItemStack toPlace = handler.getStackInSlot(Utils.getSelectedSlot(bag));
EquipmentSlotType hand1 = hand == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND;
player.setItemStackToSlot(hand1, toPlace);
boolean result = toPlace.getItem().itemInteractionForEntity(toPlace, player, entity, hand);
handler.setStackInSlot(Utils.getSelectedSlot(bag),toPlace);
player.setItemStackToSlot(hand1, bag);
return result;
}
@Override
public boolean hasEffect(ItemStack stack) {
return stack.hasTag() && Utils.getMode(stack) != CMessageTogglePickup.Mode.NORMAL;
}
@Nonnull
@Override
public UseAction getUseAction(ItemStack stack) {
if (!Utils.isConstruction(stack))return UseAction.NONE;
ItemStack internal = Utils.getItemStackInSelectedSlot(stack);
return internal.getItem().getUseAction(stack);
}
@Override
public boolean canContinueUsing(ItemStack oldStack, ItemStack newStack) {
return true;
}
@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
return !oldStack.equals(newStack);
}
//called for stuff like food and potions
@Nonnull
@Override
public ItemStack onItemUseFinish(ItemStack stack, World world, LivingEntity entity) {
if (!Utils.isConstruction(stack))return stack;
ItemStack internal = Utils.getItemStackInSelectedSlot(stack);
if (internal.getItem().isFood()){
ItemStack food = entity.onFoodEaten(world, internal);
PortableDankHandler handler = Utils.getHandler(stack,false);
handler.setStackInSlot(Utils.getSelectedSlot(stack), food);
return stack;
}
if (internal.getItem() instanceof PotionItem){
ItemStack potion = internal.onItemUseFinish(world,entity);
PortableDankHandler handler = Utils.getHandler(stack,false);
handler.setStackInSlot(Utils.getSelectedSlot(stack), potion);
return stack;
}
return super.onItemUseFinish(stack, world, entity);
}
@Override
public void onUsingTick(ItemStack stack, LivingEntity living, int count) {
}
public int getGlintColor(ItemStack stack){
CMessageTogglePickup.Mode mode = Utils.getMode(stack);
switch (mode){
case NORMAL:default:return 0xffffffff;
case PICKUP_ALL:return 0xff00ff00;
case FILTERED_PICKUP:return 0xffffff00;
case VOID_PICKUP:return 0xffff0000;
}
}
@Nonnull
@Override
public ActionResultType onItemUse(ItemUseContext ctx) {
ItemStack bag = ctx.getItem();
CMessageTogglePlacement.UseType useType = Utils.getUseType(bag);
if (useType == CMessageTogglePlacement.UseType.chest)
return super.onItemUse(ctx);
if(useType == CMessageTogglePlacement.UseType.bag){
return ActionResultType.PASS;
}
PortableDankHandler handler = Utils.getHandler(bag,false);
int selectedSlot = Utils.getSelectedSlot(bag);
ItemUseContext ctx2 = new ItemUseContextExt(ctx.getWorld(),ctx.getPlayer(),ctx.getHand(),handler.getStackInSlot(selectedSlot),ctx.rayTraceResult);
ActionResultType actionResultType = ForgeHooks.onPlaceItemIntoWorld(ctx2);//ctx2.getItem().onItemUse(ctx);
handler.setStackInSlot(selectedSlot, ctx2.getItem());
return actionResultType;
}
}
| UTF-8 | Java | 8,029 | java | DankItemBlock.java | Java | [] | null | [] | package com.tfar.dankstorage.block;
import com.tfar.dankstorage.capability.CapabilityDankStorageProvider;
import com.tfar.dankstorage.container.PortableDankProvider;
import com.tfar.dankstorage.inventory.PortableDankHandler;
import com.tfar.dankstorage.network.CMessageTogglePickup;
import com.tfar.dankstorage.network.CMessageTogglePlacement;
import com.tfar.dankstorage.network.Utils;
import net.minecraft.block.Block;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.*;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Hand;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nonnull;
public class DankItemBlock extends BlockItem {
public DankItemBlock(Block p_i48527_1_, Properties p_i48527_2_) {
super(p_i48527_1_, p_i48527_2_);
}
public static final Rarity GRAY = Rarity.create("dark_gray", TextFormatting.GRAY);
public static final Rarity RED = Rarity.create("red", TextFormatting.RED);
public static final Rarity GOLD = Rarity.create("gold", TextFormatting.GOLD);
public static final Rarity GREEN = Rarity.create("green", TextFormatting.GREEN);
public static final Rarity BLUE = Rarity.create("blue", TextFormatting.AQUA);
public static final Rarity PURPLE = Rarity.create("purple", TextFormatting.DARK_PURPLE);
public static final Rarity WHITE = Rarity.create("white", TextFormatting.WHITE);
@Override
public ICapabilityProvider initCapabilities(final ItemStack stack, final CompoundNBT nbt) {
return new CapabilityDankStorageProvider(stack);
}
@Nonnull
@Override
public Rarity getRarity(ItemStack stack) {
int type = Utils.getTier(stack);
switch (type) {
case 1:
return GRAY;
case 2:
return RED;
case 3:
return GOLD;
case 4:
return GREEN;
case 5:
return BLUE;
case 6:
return PURPLE;
case 7:
return WHITE;
}
return super.getRarity(stack);
}
@Override
public int getUseDuration(ItemStack bag) {
if (!Utils.isConstruction(bag))return 0;
ItemStack stack = Utils.getItemStackInSelectedSlot(bag);
return stack.getItem().getUseDuration(stack);
}
@Nonnull
@Override
public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand) {
ItemStack bag = player.getHeldItem(hand);
if (!world.isRemote)
if (Utils.getUseType(bag) == CMessageTogglePlacement.UseType.bag) {
int type = Utils.getTier(player.getHeldItem(hand));
NetworkHooks.openGui((ServerPlayerEntity) player, new PortableDankProvider(type), data -> data.writeItemStack(player.getHeldItem(hand)));
return super.onItemRightClick(world,player,hand);
} else {
ItemStack toPlace = Utils.getItemStackInSelectedSlot(bag);
EquipmentSlotType hand1 = hand == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND;
//handle food
if (toPlace.getItem().isFood()) {
if (player.canEat(false)) {
player.setActiveHand(hand);
return ActionResult.newResult(ActionResultType.PASS, bag);
}
}
//handle potion
else if (toPlace.getItem() instanceof PotionItem){
player.setActiveHand(hand);
return new ActionResult<>(ActionResultType.SUCCESS, player.getHeldItem(hand));
}
//todo support other items?
else {
ItemStack newBag = bag.copy();
//stack overflow issues
if (toPlace.getItem() instanceof DankItemBlock) return new ActionResult<>(ActionResultType.PASS, player.getHeldItem(hand));
player.setItemStackToSlot(hand1, toPlace);
ActionResult<ItemStack> actionResult = toPlace.getItem().onItemRightClick(world, player, hand);
PortableDankHandler handler = Utils.getHandler(newBag,true);
handler.setStackInSlot(Utils.getSelectedSlot(newBag), actionResult.getResult());
player.setItemStackToSlot(hand1, newBag);
}
}
return new ActionResult<>(ActionResultType.PASS, player.getHeldItem(hand));
}
@Override
public boolean itemInteractionForEntity(ItemStack bag, PlayerEntity player, LivingEntity entity, Hand hand) {
if (!Utils.isConstruction(bag))return false;
PortableDankHandler handler = Utils.getHandler(bag,false);
ItemStack toPlace = handler.getStackInSlot(Utils.getSelectedSlot(bag));
EquipmentSlotType hand1 = hand == Hand.MAIN_HAND ? EquipmentSlotType.MAINHAND : EquipmentSlotType.OFFHAND;
player.setItemStackToSlot(hand1, toPlace);
boolean result = toPlace.getItem().itemInteractionForEntity(toPlace, player, entity, hand);
handler.setStackInSlot(Utils.getSelectedSlot(bag),toPlace);
player.setItemStackToSlot(hand1, bag);
return result;
}
@Override
public boolean hasEffect(ItemStack stack) {
return stack.hasTag() && Utils.getMode(stack) != CMessageTogglePickup.Mode.NORMAL;
}
@Nonnull
@Override
public UseAction getUseAction(ItemStack stack) {
if (!Utils.isConstruction(stack))return UseAction.NONE;
ItemStack internal = Utils.getItemStackInSelectedSlot(stack);
return internal.getItem().getUseAction(stack);
}
@Override
public boolean canContinueUsing(ItemStack oldStack, ItemStack newStack) {
return true;
}
@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
return !oldStack.equals(newStack);
}
//called for stuff like food and potions
@Nonnull
@Override
public ItemStack onItemUseFinish(ItemStack stack, World world, LivingEntity entity) {
if (!Utils.isConstruction(stack))return stack;
ItemStack internal = Utils.getItemStackInSelectedSlot(stack);
if (internal.getItem().isFood()){
ItemStack food = entity.onFoodEaten(world, internal);
PortableDankHandler handler = Utils.getHandler(stack,false);
handler.setStackInSlot(Utils.getSelectedSlot(stack), food);
return stack;
}
if (internal.getItem() instanceof PotionItem){
ItemStack potion = internal.onItemUseFinish(world,entity);
PortableDankHandler handler = Utils.getHandler(stack,false);
handler.setStackInSlot(Utils.getSelectedSlot(stack), potion);
return stack;
}
return super.onItemUseFinish(stack, world, entity);
}
@Override
public void onUsingTick(ItemStack stack, LivingEntity living, int count) {
}
public int getGlintColor(ItemStack stack){
CMessageTogglePickup.Mode mode = Utils.getMode(stack);
switch (mode){
case NORMAL:default:return 0xffffffff;
case PICKUP_ALL:return 0xff00ff00;
case FILTERED_PICKUP:return 0xffffff00;
case VOID_PICKUP:return 0xffff0000;
}
}
@Nonnull
@Override
public ActionResultType onItemUse(ItemUseContext ctx) {
ItemStack bag = ctx.getItem();
CMessageTogglePlacement.UseType useType = Utils.getUseType(bag);
if (useType == CMessageTogglePlacement.UseType.chest)
return super.onItemUse(ctx);
if(useType == CMessageTogglePlacement.UseType.bag){
return ActionResultType.PASS;
}
PortableDankHandler handler = Utils.getHandler(bag,false);
int selectedSlot = Utils.getSelectedSlot(bag);
ItemUseContext ctx2 = new ItemUseContextExt(ctx.getWorld(),ctx.getPlayer(),ctx.getHand(),handler.getStackInSlot(selectedSlot),ctx.rayTraceResult);
ActionResultType actionResultType = ForgeHooks.onPlaceItemIntoWorld(ctx2);//ctx2.getItem().onItemUse(ctx);
handler.setStackInSlot(selectedSlot, ctx2.getItem());
return actionResultType;
}
}
| 8,029 | 0.73247 | 0.725495 | 209 | 37.416267 | 31.916967 | 150 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.770335 | false | false | 9 |
a39749af6099dc066e5d8ea812bacd375b2448d8 | 5,222,680,243,587 | a4d4e2868a89203d000df4d125f3086fcd5277a4 | /tmall_user/src/main/java/com/zht/mapper/AddressMapper.java | 581bc97f87749c8b1b44bbca70b359c2d290e0b1 | [] | no_license | zht666/Bussiness2Customer | https://github.com/zht666/Bussiness2Customer | 20ffe0335172316424f8efa6c506308021bba34f | 23b8c5249c26f5060096b51e58e1f9da839b4428 | refs/heads/master | 2020-03-11T19:24:59.209000 | 2018-04-19T11:49:45 | 2018-04-19T11:49:45 | 130,205,969 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zht.mapper;
import java.util.List;
import com.zht.bean.T_MALL_ADDRESS;
import com.zht.bean.T_MALL_USER_ACCOUNT;
public interface AddressMapper {
List<T_MALL_ADDRESS> select_addresses(T_MALL_USER_ACCOUNT user);
T_MALL_ADDRESS select_address(int address_id);
}
| UTF-8 | Java | 280 | java | AddressMapper.java | Java | [] | null | [] | package com.zht.mapper;
import java.util.List;
import com.zht.bean.T_MALL_ADDRESS;
import com.zht.bean.T_MALL_USER_ACCOUNT;
public interface AddressMapper {
List<T_MALL_ADDRESS> select_addresses(T_MALL_USER_ACCOUNT user);
T_MALL_ADDRESS select_address(int address_id);
}
| 280 | 0.760714 | 0.760714 | 15 | 17.666666 | 21.000528 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.533333 | false | false | 9 |
557254114edb89aa2c6cea242cd74b5ec8aafe3a | 9,285,719,313,429 | 0f68e790aa8895fe39bc27f9331cc33929ec98be | /raw_dataset/64419342@eval@OK.java | 1b369dc0c44632c04b5cd98b4198e610a97a874a | [
"MIT"
] | permissive | ruanyuan115/code2vec_treelstm | https://github.com/ruanyuan115/code2vec_treelstm | c50b784cbe2a576905c372675270e95e64908575 | 0c5f98d280b506317738ba603b719cac6036896f | refs/heads/master | 2023-04-09T14:11:02.992000 | 2020-04-16T08:29:59 | 2020-04-16T08:29:59 | 256,151,081 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | void eval(int len, int k) {
if (laz[k] == 0)
return;
if (k * 2 + 1 < N * 2 - 1) {
laz[k * 2 + 1] += laz[k];
laz[k * 2 + 2] += laz[k];
}
dat[k] += laz[k] * len;
laz[k] = 0;
} | UTF-8 | Java | 217 | java | 64419342@eval@OK.java | Java | [] | null | [] | void eval(int len, int k) {
if (laz[k] == 0)
return;
if (k * 2 + 1 < N * 2 - 1) {
laz[k * 2 + 1] += laz[k];
laz[k * 2 + 2] += laz[k];
}
dat[k] += laz[k] * len;
laz[k] = 0;
} | 217 | 0.345622 | 0.299539 | 10 | 20.799999 | 10.998181 | 33 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false | 9 |
a1411c6519951b72ab410b64d09752ff509f232e | 12,524,124,672,870 | e784bc5aa8f90545c2afea2a3ff140e10889dcb3 | /BadIntentBurp/src/main/java/ui/ParcelByteArrDetails.java | f31512c18c9eba74a113a08d138eb67a999ec985 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | subho007/BadIntent | https://github.com/subho007/BadIntent | afff7ef5516fbacebeaca218e07a6e8e76815f0d | fbd34c61ad980e2d475fb95d2bfac9759cd81941 | refs/heads/master | 2020-03-19T05:00:48.380000 | 2017-08-20T20:31:24 | 2017-08-20T20:31:24 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ui;
import com.google.gson.internal.LinkedTreeMap;
import javax.swing.*;
import javax.xml.bind.DatatypeConverter;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
/**
* represents details view with respect to byte array parcel values
*/
public class ParcelByteArrDetails extends JPanel {
public JScrollPane scrollable;
public JTextArea byteArray = new JTextArea();
public JTextField offset = new JTextField();
public JLabel offsetLabel = new JLabel("offset");
public JTextField length = new JTextField();
public JLabel lengthLabel = new JLabel("length");
public JButton updateButton = new JButton("Update");
public JPanel inner;
public ParcelByteArrDetails(LinkedTreeMap map) {
setLayout(new GridBagLayout());
setOffset(((Double) map.get("offset")).intValue());
setLength(((Double) map.get("len")).intValue());
setByteArray((ArrayList) map.get("array"));
scrollable = new JScrollPane(byteArray);
scrollable.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scrollable.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
byteArray.setLineWrap(true);
byteArray.setWrapStyleWord(true);
inner = new JPanel();
inner.setLayout(new BorderLayout());
inner.add(scrollable);
updateButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println(getByteArrayList().toString());
map.put("offset", getOffset());
map.put("len", getLength());
map.put("array", getByteArrayList());
}
});
//building GUI
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
add(offsetLabel, c);
c.gridx = 1;
add(offset, c);
c.gridx = 3;
add(lengthLabel);
c.gridx = 4;
add(length, c);
c.gridx = 6;
c.anchor = GridBagConstraints.LINE_END;
add(updateButton, c);
c.anchor = GridBagConstraints.LINE_START;
c.gridy = 1;
c.gridx = 0;
c.weightx = 1;
c.weighty = 1;
c.gridwidth = 7;
c.gridheight = 3;
c.fill = GridBagConstraints.BOTH;
add(inner, c);
}
public void setOffset(int offset) {
this.offset.setText(Integer.toString(offset));
}
public double getOffset(){
return Double.parseDouble(this.offset.getText());
}
public void setLength(int length) {
this.length.setText(Integer.toString(length));
}
public double getLength(){
return Double.parseDouble(this.length.getText());
}
public void setByteArray(ArrayList byteArray) {
StringBuilder builder = new StringBuilder();
if (byteArray != null) {
for (Object element : byteArray){
builder.append(String.format("%02X ", ((Double) element).byteValue()));
builder.append(" ");
}
}
this.byteArray.setText(builder.toString());
}
public ArrayList getByteArrayList(){
String hexStr = this.byteArray.getText().replace(" ", "");
byte[] bytes = DatatypeConverter.parseHexBinary(hexStr);
ArrayList doubleArrayList = new ArrayList();
for (byte byteVal : bytes){
doubleArrayList.add((double) byteVal);
}
return doubleArrayList;
}
}
| UTF-8 | Java | 3,620 | java | ParcelByteArrDetails.java | Java | [] | null | [] | package ui;
import com.google.gson.internal.LinkedTreeMap;
import javax.swing.*;
import javax.xml.bind.DatatypeConverter;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
/**
* represents details view with respect to byte array parcel values
*/
public class ParcelByteArrDetails extends JPanel {
public JScrollPane scrollable;
public JTextArea byteArray = new JTextArea();
public JTextField offset = new JTextField();
public JLabel offsetLabel = new JLabel("offset");
public JTextField length = new JTextField();
public JLabel lengthLabel = new JLabel("length");
public JButton updateButton = new JButton("Update");
public JPanel inner;
public ParcelByteArrDetails(LinkedTreeMap map) {
setLayout(new GridBagLayout());
setOffset(((Double) map.get("offset")).intValue());
setLength(((Double) map.get("len")).intValue());
setByteArray((ArrayList) map.get("array"));
scrollable = new JScrollPane(byteArray);
scrollable.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
scrollable.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
byteArray.setLineWrap(true);
byteArray.setWrapStyleWord(true);
inner = new JPanel();
inner.setLayout(new BorderLayout());
inner.add(scrollable);
updateButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println(getByteArrayList().toString());
map.put("offset", getOffset());
map.put("len", getLength());
map.put("array", getByteArrayList());
}
});
//building GUI
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
add(offsetLabel, c);
c.gridx = 1;
add(offset, c);
c.gridx = 3;
add(lengthLabel);
c.gridx = 4;
add(length, c);
c.gridx = 6;
c.anchor = GridBagConstraints.LINE_END;
add(updateButton, c);
c.anchor = GridBagConstraints.LINE_START;
c.gridy = 1;
c.gridx = 0;
c.weightx = 1;
c.weighty = 1;
c.gridwidth = 7;
c.gridheight = 3;
c.fill = GridBagConstraints.BOTH;
add(inner, c);
}
public void setOffset(int offset) {
this.offset.setText(Integer.toString(offset));
}
public double getOffset(){
return Double.parseDouble(this.offset.getText());
}
public void setLength(int length) {
this.length.setText(Integer.toString(length));
}
public double getLength(){
return Double.parseDouble(this.length.getText());
}
public void setByteArray(ArrayList byteArray) {
StringBuilder builder = new StringBuilder();
if (byteArray != null) {
for (Object element : byteArray){
builder.append(String.format("%02X ", ((Double) element).byteValue()));
builder.append(" ");
}
}
this.byteArray.setText(builder.toString());
}
public ArrayList getByteArrayList(){
String hexStr = this.byteArray.getText().replace(" ", "");
byte[] bytes = DatatypeConverter.parseHexBinary(hexStr);
ArrayList doubleArrayList = new ArrayList();
for (byte byteVal : bytes){
doubleArrayList.add((double) byteVal);
}
return doubleArrayList;
}
}
| 3,620 | 0.618232 | 0.614365 | 115 | 30.47826 | 22.594477 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.678261 | false | false | 9 |
720ada399a48f6ee41cfc025071376f6c79585c3 | 14,422,500,231,600 | 2ff153c4f9ebdf4da6cef5374d5080aeb9b06a55 | /junyoung/urlshorter/src/main/java/com/yapp/urlshorter/service/UrlService.java | bef954836b93d765975c599eccd749299b53bece | [] | no_license | studyapp/learning-spring-140817 | https://github.com/studyapp/learning-spring-140817 | 8638fa481d7d01f05484da0e024e5b72d68c7c8a | 03c750b7640ea94b8dac941ec926b11ad2a271f8 | refs/heads/master | 2016-09-06T17:58:38.981000 | 2015-11-16T05:04:41 | 2015-11-16T05:04:41 | 40,861,046 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yapp.urlshorter.service;
import java.util.List;
import com.yapp.urlshorter.entity.Url;
import com.yapp.urlshorter.entity.User;
public interface UrlService {
public List<Url> getUrls(long userId);
public int addUrl(String url, long userId);;
public Url getUrl(long id);
public Url redirectToOriginalUrl(long id);
public void deleteUrl(long id, User user);
}
| UTF-8 | Java | 384 | java | UrlService.java | Java | [] | null | [] | package com.yapp.urlshorter.service;
import java.util.List;
import com.yapp.urlshorter.entity.Url;
import com.yapp.urlshorter.entity.User;
public interface UrlService {
public List<Url> getUrls(long userId);
public int addUrl(String url, long userId);;
public Url getUrl(long id);
public Url redirectToOriginalUrl(long id);
public void deleteUrl(long id, User user);
}
| 384 | 0.763021 | 0.763021 | 18 | 20.333334 | 18.523258 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.111111 | false | false | 9 |
3afc18616371af1681708a2941373c1f3fd7f1a8 | 14,422,500,230,584 | a0e313d6577c6e93509c5cde0380d6d425d83729 | /src/cn/codexin/questions/Q0072_Edit_Distance.java | 7edaffd5893a0710d77c39f7b47d9e54b6f8d2b8 | [] | no_license | Xin98/LeetCodePractice | https://github.com/Xin98/LeetCodePractice | f56fec1f9831441756e9d0a725be8f2385b95693 | c6c44c9cd14e9fac188398162d010773b8feefbc | refs/heads/master | 2021-08-15T23:55:44.681000 | 2021-07-22T15:17:45 | 2021-07-22T15:17:45 | 250,441,453 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.codexin.questions;
/**
* Created by xinGao 2020/4/6
*/
public class Q0072_Edit_Distance {
public int minDistance(String word1, String word2) {
int len1 = word1.length(), len2 = word2.length();
int[][] dp = new int[len1+1][len2+1];
for(int i = 0; i <= len1; i++){
for(int j = 0; j <= len2; j++){
if(i == 0) {
dp[i][j] = j;
continue;
}
if(j == 0) {
dp[i][j] = i;
continue;
}
char w1 = word1.charAt(i-1), w2 = word2.charAt(j-1);
//如果两个子字符串的最后一个字符相等,那么编辑距离和去掉这两个相等的字符的字串相等
//如果不等,就取删除(任意去掉一个子字符串的最后一个字符)(添加和删除本质上一样)字符或者替换最后一个字符操作的最小值,然后加一(本次操作)。
dp[i][j] = w1 == w2? dp[i-1][j-1] : (Math.min(dp[i-1][j-1], Math.min(dp[i-1][j], dp[i][j-1])) + 1);
}
}
return dp[len1][len2];
}
public static void main(String[] args) {
Q0072_Edit_Distance q0072_edit_distance = new Q0072_Edit_Distance();
q0072_edit_distance.minDistance("horse", "ros");
}
}
| UTF-8 | Java | 1,374 | java | Q0072_Edit_Distance.java | Java | [
{
"context": "package cn.codexin.questions;\n\n/**\n * Created by xinGao 2020/4/6\n */\n\npublic class Q0072_Edit_Distance {\n",
"end": 55,
"score": 0.913638710975647,
"start": 49,
"tag": "USERNAME",
"value": "xinGao"
}
] | null | [] | package cn.codexin.questions;
/**
* Created by xinGao 2020/4/6
*/
public class Q0072_Edit_Distance {
public int minDistance(String word1, String word2) {
int len1 = word1.length(), len2 = word2.length();
int[][] dp = new int[len1+1][len2+1];
for(int i = 0; i <= len1; i++){
for(int j = 0; j <= len2; j++){
if(i == 0) {
dp[i][j] = j;
continue;
}
if(j == 0) {
dp[i][j] = i;
continue;
}
char w1 = word1.charAt(i-1), w2 = word2.charAt(j-1);
//如果两个子字符串的最后一个字符相等,那么编辑距离和去掉这两个相等的字符的字串相等
//如果不等,就取删除(任意去掉一个子字符串的最后一个字符)(添加和删除本质上一样)字符或者替换最后一个字符操作的最小值,然后加一(本次操作)。
dp[i][j] = w1 == w2? dp[i-1][j-1] : (Math.min(dp[i-1][j-1], Math.min(dp[i-1][j], dp[i][j-1])) + 1);
}
}
return dp[len1][len2];
}
public static void main(String[] args) {
Q0072_Edit_Distance q0072_edit_distance = new Q0072_Edit_Distance();
q0072_edit_distance.minDistance("horse", "ros");
}
}
| 1,374 | 0.474003 | 0.422877 | 34 | 32.941177 | 26.982502 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.647059 | false | false | 9 |
d953bee68dbfff55fc3d2e9c1d92420223ccf983 | 16,999,480,595,414 | 6dee82fe18e579ee149cdb58a9a7f137be9bf6d8 | /Nano og Robotikk/INF1010/oblig7/Random/oblig5/AM.java | b1e587dcc0c66c5805fb2efd390baba378a59f07 | [] | no_license | pdmthorsrud/IFI | https://github.com/pdmthorsrud/IFI | 60a3c287d191095f53076aca0e7f7ce4ff8dc191 | e37f390c1cfdb17812a029ab5c79d4cb06539f52 | refs/heads/master | 2021-08-27T16:07:58.973000 | 2016-08-28T18:51:00 | 2016-08-28T18:51:00 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | class AM extends TypeA implements Mikstur{
private int virkestoff = 0;
private int cm3 = 0;
private int virkestoffTot = 0;
AM(String navn, int pris, int narkotisk, int cm3, int virkestoff){
super(navn, pris);
this.cm3 = cm3;
this.virkestoff = virkestoff;
this.virkestoffTot = virkestoff * cm3;
this.narkotisk = narkotisk;
}
public void setcm3(int cm3){
this.cm3 = cm3;
}
public void setvirkestoff(int virkestoff){
this.virkestoff = virkestoff;
}
}
| UTF-8 | Java | 511 | java | AM.java | Java | [] | null | [] | class AM extends TypeA implements Mikstur{
private int virkestoff = 0;
private int cm3 = 0;
private int virkestoffTot = 0;
AM(String navn, int pris, int narkotisk, int cm3, int virkestoff){
super(navn, pris);
this.cm3 = cm3;
this.virkestoff = virkestoff;
this.virkestoffTot = virkestoff * cm3;
this.narkotisk = narkotisk;
}
public void setcm3(int cm3){
this.cm3 = cm3;
}
public void setvirkestoff(int virkestoff){
this.virkestoff = virkestoff;
}
}
| 511 | 0.657534 | 0.634051 | 27 | 17.925926 | 18.171867 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.814815 | false | false | 9 |
4edae7c1b1bf589d046ddef3851fcae799e8b16e | 8,727,373,553,716 | 83943713b9067711c9da1ace5794fd8a79e6ddb9 | /src/main/java/com/coxplore/model/UserGroupChange.java | 448b6d41c8631fa551100478984aa2db8ae03793 | [] | no_license | hoangdh143/coxplore | https://github.com/hoangdh143/coxplore | fc3f5d8f321b02f0680a8a4b42dd71481a7d1763 | 9aa31a60482b2871bf07352de2676e6b5b3654ce | refs/heads/master | 2022-11-27T08:24:03.935000 | 2019-06-27T03:34:04 | 2019-06-27T03:34:04 | 193,901,402 | 0 | 0 | null | false | 2022-11-24T09:36:43 | 2019-06-26T12:37:00 | 2019-07-01T10:30:50 | 2022-11-24T09:36:39 | 128 | 0 | 0 | 5 | Java | false | false | package com.coxplore.model;
import com.coxplore.helper.validation.constraint.DateValidationConstraint;
import com.coxplore.helper.validation.constraint.PhoneValidationConstraint;
import com.coxplore.helper.validation.constraint.XssValidationConstraint;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
public class UserGroupChange {
@PhoneValidationConstraint
@XssValidationConstraint
private String phone;
@XssValidationConstraint
@Length(max = 3000)
private String experience;
@XssValidationConstraint
@Length(max = 3000)
private String selfDescription;
@XssValidationConstraint
@Length(max = 100)
@DateValidationConstraint
protected String dateOfBirth;
@XssValidationConstraint
@Length(max = 80)
private String firstName = "";
@XssValidationConstraint
@Length(max = 80)
private String lastName = "";
@XssValidationConstraint
@Length(max = 200)
private String title;
private int careerId;
private int jobId;
@XssValidationConstraint
@Length(max = 200)
private String careerName;
@XssValidationConstraint
@Length(max = 200)
private String jobName;
@Min(2)
@Max(5)
private Integer groupId;
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getExperience() {
return experience;
}
public void setExperience(String experience) {
this.experience = experience;
}
public String getSelfDescription() {
return selfDescription;
}
public void setSelfDescription(String selfDescription) {
this.selfDescription = selfDescription;
}
public String getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(String dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFullName() {
String fullName = "";
if (firstName != null) fullName = fullName.concat(firstName);
if (lastName != null) fullName = fullName.concat(" " + lastName);
return fullName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getCareerId() {
return careerId;
}
public void setCareerId(int careerId) {
this.careerId = careerId;
}
public int getJobId() {
return jobId;
}
public void setJobId(int jobId) {
this.jobId = jobId;
}
public String getCareerName() {
return careerName;
}
public void setCareerName(String careerName) {
this.careerName = careerName;
}
public String getJobName() {
return jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
}
| UTF-8 | Java | 3,425 | java | UserGroupChange.java | Java | [] | null | [] | package com.coxplore.model;
import com.coxplore.helper.validation.constraint.DateValidationConstraint;
import com.coxplore.helper.validation.constraint.PhoneValidationConstraint;
import com.coxplore.helper.validation.constraint.XssValidationConstraint;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
public class UserGroupChange {
@PhoneValidationConstraint
@XssValidationConstraint
private String phone;
@XssValidationConstraint
@Length(max = 3000)
private String experience;
@XssValidationConstraint
@Length(max = 3000)
private String selfDescription;
@XssValidationConstraint
@Length(max = 100)
@DateValidationConstraint
protected String dateOfBirth;
@XssValidationConstraint
@Length(max = 80)
private String firstName = "";
@XssValidationConstraint
@Length(max = 80)
private String lastName = "";
@XssValidationConstraint
@Length(max = 200)
private String title;
private int careerId;
private int jobId;
@XssValidationConstraint
@Length(max = 200)
private String careerName;
@XssValidationConstraint
@Length(max = 200)
private String jobName;
@Min(2)
@Max(5)
private Integer groupId;
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getExperience() {
return experience;
}
public void setExperience(String experience) {
this.experience = experience;
}
public String getSelfDescription() {
return selfDescription;
}
public void setSelfDescription(String selfDescription) {
this.selfDescription = selfDescription;
}
public String getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(String dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getFullName() {
String fullName = "";
if (firstName != null) fullName = fullName.concat(firstName);
if (lastName != null) fullName = fullName.concat(" " + lastName);
return fullName;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getCareerId() {
return careerId;
}
public void setCareerId(int careerId) {
this.careerId = careerId;
}
public int getJobId() {
return jobId;
}
public void setJobId(int jobId) {
this.jobId = jobId;
}
public String getCareerName() {
return careerName;
}
public void setCareerName(String careerName) {
this.careerName = careerName;
}
public String getJobName() {
return jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
}
| 3,425 | 0.652847 | 0.645255 | 160 | 20.40625 | 18.356979 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.29375 | false | false | 9 |
9a4c1bb66511e42e3ed03530be15266f578a2312 | 15,015,205,682,691 | fa2870fa6298fac2a4dbfaddb83f379b0ee91258 | /src/main/java/com/hengyue/service/vo/FolderTypeService.java | 0907257c46b74192e7e2852ceaeac28f2920d127 | [] | no_license | danaigua/JXC | https://github.com/danaigua/JXC | 24f918ed2435f3baa08f0ab0574a06383f99479a | 58bb75b501ddd7d33020e10148b4d5a098b8e4e1 | refs/heads/master | 2022-11-09T00:56:03.689000 | 2020-04-06T07:53:45 | 2020-04-06T07:53:45 | 216,309,417 | 0 | 0 | null | false | 2022-10-12T20:32:54 | 2019-10-20T04:54:37 | 2020-04-06T07:57:54 | 2022-10-12T20:32:52 | 7,489 | 0 | 0 | 6 | JavaScript | false | false | package com.hengyue.service.vo;
/**
* 文件夹类别业务层接口
* @author 章家宝
*
*/
import java.util.List;
import com.hengyue.entity.vo.FolderType;
public interface FolderTypeService {
/**
* 通过id删除商品类别
* @param id
*/
public void delete(Integer id);
/**
* 添加一个商品类别
* @param folderType
*/
public void save(FolderType folderType);
/**
* 根据父节点查找所有子节点
* @param parentId
* @return
*/
public List<FolderType> findByParentId(Integer parentId);
/**
* 通过id查找实体
* @param id
* @return
*/
public FolderType findById(Integer id);
/**
* 通过名称查找实体
* @param string
* @return
*/
public FolderType findByName(String string, String url);
/**
* 查找根id为userId并且pid为1的节点
* @param userId
* @return
*/
public FolderType findGenId(Integer userId);
}
| UTF-8 | Java | 899 | java | FolderTypeService.java | Java | [
{
"context": ".hengyue.service.vo;\n/**\n * 文件夹类别业务层接口\n * @author 章家宝\n *\n */\n\nimport java.util.List;\n\nimport com.hengyu",
"end": 64,
"score": 0.9991722106933594,
"start": 61,
"tag": "NAME",
"value": "章家宝"
}
] | null | [] | package com.hengyue.service.vo;
/**
* 文件夹类别业务层接口
* @author 章家宝
*
*/
import java.util.List;
import com.hengyue.entity.vo.FolderType;
public interface FolderTypeService {
/**
* 通过id删除商品类别
* @param id
*/
public void delete(Integer id);
/**
* 添加一个商品类别
* @param folderType
*/
public void save(FolderType folderType);
/**
* 根据父节点查找所有子节点
* @param parentId
* @return
*/
public List<FolderType> findByParentId(Integer parentId);
/**
* 通过id查找实体
* @param id
* @return
*/
public FolderType findById(Integer id);
/**
* 通过名称查找实体
* @param string
* @return
*/
public FolderType findByName(String string, String url);
/**
* 查找根id为userId并且pid为1的节点
* @param userId
* @return
*/
public FolderType findGenId(Integer userId);
}
| 899 | 0.664499 | 0.663199 | 47 | 15.361702 | 14.971498 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.93617 | false | false | 9 |
a71eb0e52b239db689d83ae0588e46acbd6bf4c3 | 18,193,481,513,225 | db2aad36ad5d6266bc7a11e2a7abfb5254005906 | /EjbInAction/chapter10/src/ejb/com/ejb3inaction/actionbazaar/buslogic/BazaarAdmin.java | 87fbc420515d4be1566c80bae9095aca730648cd | [] | no_license | manoharant/EJB | https://github.com/manoharant/EJB | 6cf254c87026a0611a9e382ed33feb1cd56e1cda | 730139253384c303a534c5c6d317d62e853d5c8e | refs/heads/master | 2021-01-25T11:34:37.622000 | 2017-06-10T11:40:26 | 2017-06-10T11:40:26 | 93,935,383 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ejb3inaction.actionbazaar.buslogic;
import java.util.Date;
import java.util.List;
import javax.ejb.Remote;
import com.ejb3inaction.actionbazaar.persistence.Category;
@Remote
public interface BazaarAdmin {
public Category findByFullCategoryName(String categoryName);
public List findByCategoryName(String categoryName);
public List getItemByDate(Date currentDate);
public List getItemByPriceRange(Double lowPrice, Double highPrice);
public List getUserWithItems();
public List getUserWithNoItems();
public List getUserWithItemsWithNativeQuery();
public List getUserWithItemsWithNamedNativeQuery();
public List findByUser(String userId);
} | UTF-8 | Java | 670 | java | BazaarAdmin.java | Java | [] | null | [] | package com.ejb3inaction.actionbazaar.buslogic;
import java.util.Date;
import java.util.List;
import javax.ejb.Remote;
import com.ejb3inaction.actionbazaar.persistence.Category;
@Remote
public interface BazaarAdmin {
public Category findByFullCategoryName(String categoryName);
public List findByCategoryName(String categoryName);
public List getItemByDate(Date currentDate);
public List getItemByPriceRange(Double lowPrice, Double highPrice);
public List getUserWithItems();
public List getUserWithNoItems();
public List getUserWithItemsWithNativeQuery();
public List getUserWithItemsWithNamedNativeQuery();
public List findByUser(String userId);
} | 670 | 0.822388 | 0.819403 | 29 | 22.137932 | 23.228586 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.827586 | false | false | 9 |
7365d19b98e64ab3e52d5db8d4cdaa8ffd781b6e | 21,088,289,467,964 | 875dcf95b83599f520e49471058f0febb4a0740b | /billeterieTheatremsauvage/src/ejb/sessions/ClientStandardDejaCreeException.java | d9d3151e7414bb987ee9c39827a99d9501a17731 | [] | no_license | LaplaceJ/Projet-Architecture-Logicielle | https://github.com/LaplaceJ/Projet-Architecture-Logicielle | 81db760024e384086dcdf387a88391c2c40f1aed | c50e3540668788ce265c5a8b9a4e0991455e5cfd | refs/heads/master | 2020-05-19T06:45:54.286000 | 2019-05-04T10:39:20 | 2019-05-04T10:39:20 | 184,881,870 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ejb.sessions;
public class ClientStandardDejaCreeException extends Exception {
}
| UTF-8 | Java | 91 | java | ClientStandardDejaCreeException.java | Java | [] | null | [] | package ejb.sessions;
public class ClientStandardDejaCreeException extends Exception {
}
| 91 | 0.835165 | 0.835165 | 5 | 17.200001 | 24.733782 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 9 |
b1222b25ef24beaab4da63c958dc0a4d2e102b18 | 2,997,887,218,593 | 894bacd59caf57db1faee0a158e60b11655bdae4 | /src/main/java/root/model/Monster.java | 6c9343d7d4297bf880937b52158fa1e14779c76f | [] | no_license | tphiland/Swingy | https://github.com/tphiland/Swingy | 26f490d8fdf0fae116f46f3a80b1d443f7b5af56 | 7b0e23929b7ba2b2c60beccfcad62343f918f758 | refs/heads/master | 2023-03-15T00:23:39.545000 | 2021-03-08T10:58:51 | 2021-03-08T10:58:51 | 292,746,820 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package root.model;
import java.util.Random;
public class Monster {
private Stats stats;
public Monster(int level) {
int attack = new Random().nextInt((level * 20) - 2) + 1;
int defense = new Random().nextInt((level * 20) - attack - 1) + 1;
int health = (level * 20) - attack - defense;
this.stats = new Stats(attack, defense, health);
}
public Stats getStats() {
return stats;
}
@Override
public String toString() {
return "Monster{" +
"stats=" + stats +
'}';
}
}
| UTF-8 | Java | 584 | java | Monster.java | Java | [] | null | [] | package root.model;
import java.util.Random;
public class Monster {
private Stats stats;
public Monster(int level) {
int attack = new Random().nextInt((level * 20) - 2) + 1;
int defense = new Random().nextInt((level * 20) - attack - 1) + 1;
int health = (level * 20) - attack - defense;
this.stats = new Stats(attack, defense, health);
}
public Stats getStats() {
return stats;
}
@Override
public String toString() {
return "Monster{" +
"stats=" + stats +
'}';
}
}
| 584 | 0.535959 | 0.518836 | 27 | 20.629629 | 20.813364 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.407407 | false | false | 2 |
c3abfc2a9f8e985ca48fbcf7b17f160d0198c5df | 16,303,695,887,382 | 592e13fbed4f1b6eff0b176cad96b5bd3523d62b | /task-3_4/hotel-administrator-api/src/main/java/com/company/hoteladministrator/api/dao/IOrderedMaintenanceDao.java | 0d0560094ac155238d245a02973d87d6e9fe6803 | [] | no_license | ArtemSakovich/courses-senla | https://github.com/ArtemSakovich/courses-senla | 502aaf70daa38bf4e1756b2e2a86250e3bb03cb3 | 5a1973421edf1e795b9202595e00930c501cbbf3 | refs/heads/main | 2023-05-31T12:58:39.637000 | 2021-06-07T21:19:59 | 2021-06-07T21:19:59 | 331,892,461 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.company.hoteladministrator.api.dao;
import com.company.hoteladministrator.model.OrderedMaintenance;
public interface IOrderedMaintenanceDao extends IGenericDao<OrderedMaintenance> {
}
| UTF-8 | Java | 198 | java | IOrderedMaintenanceDao.java | Java | [] | null | [] | package com.company.hoteladministrator.api.dao;
import com.company.hoteladministrator.model.OrderedMaintenance;
public interface IOrderedMaintenanceDao extends IGenericDao<OrderedMaintenance> {
}
| 198 | 0.863636 | 0.863636 | 6 | 32 | 33.156197 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 2 |
eb47ce82bfd45afece55986bb1ea472795c62d2e | 12,910,671,733,958 | a0afd13d8eb9ed0148abe04f42578cff8d30bf0c | /src/main/2020/java/face/FourSum.java | 7207edb6e843dc2bc78e3c6f6e06cb40d20b9c5a | [] | no_license | zhtttylz/LeetCode | https://github.com/zhtttylz/LeetCode | c0ccea70c3af32a2892d38f38e44611d250d1340 | a844d81de32359b2300a330498e2db2246436ea1 | refs/heads/master | 2022-03-09T17:20:08.115000 | 2022-03-01T17:28:24 | 2022-03-01T17:28:24 | 217,832,288 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package face;
import java.util.*;
/**
* Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
* <p>
* Note:
* <p>
* The solution set must not contain duplicate quadruplets.
* <p>
* Example:
* <p>
* Given array nums = [1, 0, -1, 0, -2, 2], and target = 0.
* <p>
* A solution set is:
* [
* [-1, 0, 0, 1],
* [-2, -1, 1, 2],
* [-2, 0, 0, 2]
* ]
*
* @author zhtttylz
* @date 2020/7/17 0:11
* 4sum 跟院线一样,使用先排序,然后双重循环的方式进行处理
*/
public class FourSum {
public List<List<Integer>> fourSum(int[] nums, int target) {
if (nums == null || nums.length == 0) return new ArrayList<List<Integer>>();
List<List<Integer>> res = new ArrayList<List<Integer>>();
Set<List<Integer>> temp = new HashSet<List<Integer>>();
Arrays.sort(nums);
for (int i = 0; i < nums.length - 3; i++) {
for (int j = i + 1; j < nums.length - 2; j++) {
int left = j + 1;
int right = nums.length - 1;
while (left < right) {
if (nums[i] + nums[j] + nums[left] + nums[right] == target) {
temp.add(Arrays.asList(nums[i], nums[j], nums[left], nums[right]));
while (left < right && nums[left + 1] == nums[left]) left++;
while (left < right && nums[right - 1] == nums[right]) right--;
left++;
right--;
}else if (left < right && nums[i] + nums[j] + nums[left] + nums[right] < target) left++;
else right--;
}
}
}
for(List<Integer> l : temp){
res.add(l);
}
return res;
}
}
| UTF-8 | Java | 1,912 | java | FourSum.java | Java | [
{
"context": "2, -1, 1, 2],\n * [-2, 0, 0, 2]\n * ]\n *\n * @author zhtttylz\n * @date 2020/7/17 0:11\n * 4sum 跟院线一样,使用先排序,然后双重循",
"end": 534,
"score": 0.9995905160903931,
"start": 526,
"tag": "USERNAME",
"value": "zhtttylz"
}
] | null | [] | package face;
import java.util.*;
/**
* Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
* <p>
* Note:
* <p>
* The solution set must not contain duplicate quadruplets.
* <p>
* Example:
* <p>
* Given array nums = [1, 0, -1, 0, -2, 2], and target = 0.
* <p>
* A solution set is:
* [
* [-1, 0, 0, 1],
* [-2, -1, 1, 2],
* [-2, 0, 0, 2]
* ]
*
* @author zhtttylz
* @date 2020/7/17 0:11
* 4sum 跟院线一样,使用先排序,然后双重循环的方式进行处理
*/
public class FourSum {
public List<List<Integer>> fourSum(int[] nums, int target) {
if (nums == null || nums.length == 0) return new ArrayList<List<Integer>>();
List<List<Integer>> res = new ArrayList<List<Integer>>();
Set<List<Integer>> temp = new HashSet<List<Integer>>();
Arrays.sort(nums);
for (int i = 0; i < nums.length - 3; i++) {
for (int j = i + 1; j < nums.length - 2; j++) {
int left = j + 1;
int right = nums.length - 1;
while (left < right) {
if (nums[i] + nums[j] + nums[left] + nums[right] == target) {
temp.add(Arrays.asList(nums[i], nums[j], nums[left], nums[right]));
while (left < right && nums[left + 1] == nums[left]) left++;
while (left < right && nums[right - 1] == nums[right]) right--;
left++;
right--;
}else if (left < right && nums[i] + nums[j] + nums[left] + nums[right] < target) left++;
else right--;
}
}
}
for(List<Integer> l : temp){
res.add(l);
}
return res;
}
}
| 1,912 | 0.482315 | 0.461415 | 67 | 26.850746 | 35.388359 | 207 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.746269 | false | false | 2 |
02fc6e3386881e6a7d49bbdf641200e63ad3e5ab | 27,762,668,629,585 | 743742baac960488db39dcb90382ea189e200b25 | /app/src/main/java/com/br/filmesfamosos/Controllers/Api/MovieListRequest.java | 4c9f168ae096f5b2e0c492c373906db5ac112646 | [] | no_license | amorimgabriel/TheMovieDB | https://github.com/amorimgabriel/TheMovieDB | 7eeea9e88ec433caba2359aab99dbe3fdabb4f1f | 3bf6b71450df44a8e6eb97af1f038260d5d824c3 | refs/heads/master | 2020-03-30T15:05:02.161000 | 2018-10-06T02:23:07 | 2018-10-06T02:23:48 | 151,347,692 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.br.filmesfamosos.Controllers.Api;
import com.br.filmesfamosos.BuildConfig;
import com.br.filmesfamosos.Controllers.Api.Util.RetrofitUtil;
import com.br.filmesfamosos.Model.Result;
import com.br.filmesfamosos.Model.ReviewModel;
import com.br.filmesfamosos.Model.VideoResultModel;
import java.io.IOException;
/**
* Created by gabrielsamorim
* on 02/10/18.
*/
public class MovieListRequest {
public static Result getMovies(String query) {
try {
return RetrofitUtil.getAPI().getMovies(query, BuildConfig.IMDB_KEY).execute().body();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static VideoResultModel getMovieVideoResult(String id) {
try {
return RetrofitUtil.getAPI().getTraillerList(id, BuildConfig.IMDB_KEY).execute().body();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static ReviewModel getReviewsVideos(String id) {
try {
return RetrofitUtil.getAPI().getReviews(id, BuildConfig.IMDB_KEY).execute().body();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| UTF-8 | Java | 1,243 | java | MovieListRequest.java | Java | [
{
"context": "l;\n\nimport java.io.IOException;\n\n/**\n * Created by gabrielsamorim\n * on 02/10/18.\n */\npublic class MovieListRequest",
"end": 354,
"score": 0.9995856881141663,
"start": 340,
"tag": "USERNAME",
"value": "gabrielsamorim"
}
] | null | [] | package com.br.filmesfamosos.Controllers.Api;
import com.br.filmesfamosos.BuildConfig;
import com.br.filmesfamosos.Controllers.Api.Util.RetrofitUtil;
import com.br.filmesfamosos.Model.Result;
import com.br.filmesfamosos.Model.ReviewModel;
import com.br.filmesfamosos.Model.VideoResultModel;
import java.io.IOException;
/**
* Created by gabrielsamorim
* on 02/10/18.
*/
public class MovieListRequest {
public static Result getMovies(String query) {
try {
return RetrofitUtil.getAPI().getMovies(query, BuildConfig.IMDB_KEY).execute().body();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static VideoResultModel getMovieVideoResult(String id) {
try {
return RetrofitUtil.getAPI().getTraillerList(id, BuildConfig.IMDB_KEY).execute().body();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static ReviewModel getReviewsVideos(String id) {
try {
return RetrofitUtil.getAPI().getReviews(id, BuildConfig.IMDB_KEY).execute().body();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}
| 1,243 | 0.650845 | 0.646018 | 46 | 26.02174 | 26.664167 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.413043 | false | false | 2 |
9c00b5b05e4818a02c2b54852e39075582f5b18f | 30,451,318,164,510 | 015b0c81c911e882d93151b0c687b7a1b61b2916 | /web/src/main/java/com/ytt/shopping/web/controller/request/GoodsRequest.java | 2fb8c1478ff140e27fbe066052b07a4b335476d1 | [] | no_license | aaronytt/shopping_mall | https://github.com/aaronytt/shopping_mall | 4c55bf184fc212ec57a11b1b4dd472eedd631c5d | 976079b3c35560e10305de2899536d74c87b5725 | refs/heads/master | 2020-05-29T22:28:45.769000 | 2019-07-28T15:28:43 | 2019-07-28T15:28:43 | 189,409,178 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ytt.shopping.web.controller.request;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.joda.money.Money;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Author: aaron
* @Descriotion:
* @Date: 10:53 2019/6/20
* @Modiflid By:
*/
@Getter
@Setter
@ToString
public class GoodsRequest {
@NotBlank
private String name;
@NotNull
private Money price;
}
| UTF-8 | Java | 462 | java | GoodsRequest.java | Java | [
{
"context": "x.validation.constraints.NotNull;\n\n/**\n * @Author: aaron\n * @Descriotion:\n * @Date: 10:53 2019/6/20\n * @Mo",
"end": 261,
"score": 0.9981412291526794,
"start": 256,
"tag": "USERNAME",
"value": "aaron"
}
] | null | [] | package com.ytt.shopping.web.controller.request;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.joda.money.Money;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @Author: aaron
* @Descriotion:
* @Date: 10:53 2019/6/20
* @Modiflid By:
*/
@Getter
@Setter
@ToString
public class GoodsRequest {
@NotBlank
private String name;
@NotNull
private Money price;
}
| 462 | 0.731602 | 0.707792 | 28 | 15.5 | 14.080128 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.321429 | false | false | 2 |
05064a32887a1db9a943d1547a832ec60452b147 | 17,480,516,927,545 | 46f327d6ad6938f18666a3e9785a572a659bac21 | /VeriSupplierAug27/src/com/mmadapps/verisupplier/payment/PaymentGateway.java | ff06839204f55150387e8db11b9863f8c5576b9c | [] | no_license | SaurabhKumar021/veritry | https://github.com/SaurabhKumar021/veritry | 3b996f6ee876f8b5ee574573ce8c94196d33af06 | 2b416f3724d87b5c5fee957a7f6d5d37afed59af | refs/heads/master | 2020-04-10T06:48:32.473000 | 2015-09-11T05:26:06 | 2015-09-11T06:22:33 | 42,292,376 | 0 | 0 | null | true | 2015-09-11T06:45:02 | 2015-09-11T06:45:00 | 2015-09-11T06:21:37 | 2015-09-11T06:21:35 | 0 | 0 | 0 | 0 | null | null | null | package com.mmadapps.verisupplier.payment;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import com.citrus.sdk.Callback;
import com.citrus.sdk.CitrusClient;
import com.citrus.sdk.CitrusUser;
import com.citrus.sdk.Environment;
import com.citrus.sdk.TransactionResponse;
import com.citrus.sdk.TransactionResponse.TransactionStatus;
import com.citrus.sdk.classes.Amount;
import com.citrus.sdk.classes.CitrusException;
import com.citrus.sdk.classes.Month;
import com.citrus.sdk.classes.Year;
import com.citrus.sdk.payment.CreditCardOption;
import com.citrus.sdk.payment.DebitCardOption;
import com.citrus.sdk.payment.MerchantPaymentOption;
import com.citrus.sdk.payment.NetbankingOption;
import com.citrus.sdk.payment.PaymentType;
import com.citrus.sdk.response.CitrusError;
import com.mmadapps.verisupplier.customs.VerisupplierUtils;
import com.mmadapps.verisupplier.placeorder.MakePaymentNewActivity;
public class PaymentGateway {
CitrusClient citrusClient;
PaymentType.PGPayment pgPayment = null;
public NetbankingOption netbankingOption;
Context context;
private static final java.lang.String BILL_URL = "http://chatappsrvropfr.cloudapp.net/citrus/BillGenerator.php";
private static final java.lang.String DEBIT_CARD_HOLDER_NAME = "HARI PRASAD";
private static final java.lang.String DEBIT_CARD_HOLDER_NUMBER = "5326760126549034";
private static final java.lang.String DEBIT_CARD_CVV = "556";
private static final java.lang.String DEBIT_CARD_EXPIRY_MONTH = "08";
private static final java.lang.String DEBIT_CARD_EXPIRY_YEAR = "24";
public PaymentGateway(final Context con) {
super();
this.context = con;
initCitrus();
callBankList();
switch (1) {
case 1:
debitCard();
break;
case 2:
creditCard();
break;
case 3:
netPayment();
break;
}
citrusClient.pgPayment(pgPayment,new Callback<TransactionResponse>() {
@Override
public void success(TransactionResponse transactionResponse) {
Log.e("error", "payment success"+ transactionResponse.getMessage());
Log.e("error", "payment success json"+ transactionResponse.getResponseCode());
Log.e("error", "payment success json"+ transactionResponse.getJsonResponse());
Log.e("error","payment success status" + transactionResponse.getTransactionStatus());
//transactionResponse.g
VerisupplierUtils.mPaymentStatus.setmStatus(""+transactionResponse.getTransactionStatus());
VerisupplierUtils.mPaymentStatus.setmStatusJson(""+transactionResponse.getJsonResponse());
Toast.makeText(context.getApplicationContext(),"Payment succesfull", Toast.LENGTH_LONG).show();
}
@Override
public void error(CitrusError error) {
//error.
Log.e("error","payment failure" + error.getMessage());
Log.e("error","payment failure" + error.getStatus());
VerisupplierUtils.mPaymentStatus.setmStatus("Failure");
VerisupplierUtils.mPaymentStatus.setmStatusJson("error json");
Toast.makeText(context.getApplicationContext(),"Payment failure", Toast.LENGTH_LONG).show();
}
});
}
private void callBankList() {
// TODO Auto-generated method stub
citrusClient.getMerchantPaymentOptions(new Callback<MerchantPaymentOption>() {
@Override
public void success(MerchantPaymentOption merchantPaymentOption) {
for (int i = 0; i < merchantPaymentOption.getNetbankingOptionList().size(); i++) {
Log.e("bankdetails","Bank Name: "+ merchantPaymentOption
.getNetbankingOptionList()
.get(i).getBankName().toString()
+ " CID: "
+ merchantPaymentOption
.getNetbankingOptionList()
.get(i).getBankCID().toString());
}
}
@Override
public void error(CitrusError error) {
// Utils.showToast(getActivity(),
// error.getMessage());
}
});
}
private void netPayment() {
// TODO Auto-generated method stub
citrusClient = CitrusClient.getInstance(context.getApplicationContext()); // Activity Context
// No need to call init on CitrusClient if already done.
netbankingOption = new NetbankingOption("ICICI Bank" ,"CID001");
// Init Net Banking PaymentType
Amount amount = new Amount("7");
try {
pgPayment = new PaymentType.PGPayment(amount, BILL_URL, netbankingOption, new CitrusUser("developercitrus@gmail.com","9876543210"));
} catch (CitrusException e) {
// TODO Auto-generated catch block
Log.e("error", "eror");
e.printStackTrace();
}
}
private void creditCard() {
// TODO Auto-generated method stub
citrusClient = CitrusClient.getInstance(context.getApplicationContext()); // Activity Context
// No need to call init on CitrusClient if already done.
CreditCardOption creditCardOption = new CreditCardOption("HARI PRASAD", "4893772400492951", "123", Month.getMonth("12"), Year.getYear("18"));
Amount amount = new Amount("5");
// Init PaymentType
try {
pgPayment = new PaymentType.PGPayment(amount, BILL_URL, creditCardOption, new CitrusUser("developercitrus@gmail.com","9876543210"));
} catch (CitrusException e) {
e.printStackTrace();
Log.e("error", "eror");
}
}
private void debitCard() {
DebitCardOption debitCardOption = new DebitCardOption(
DEBIT_CARD_HOLDER_NAME, DEBIT_CARD_HOLDER_NUMBER,
DEBIT_CARD_CVV, Month.getMonth(DEBIT_CARD_EXPIRY_MONTH),
Year.getYear(DEBIT_CARD_EXPIRY_YEAR));
Amount amount = new Amount("10");
// CitrusClient citrusClient = CitrusClient.getInstance(context);
// Init PaymentType
try {
pgPayment = new PaymentType.PGPayment(amount, BILL_URL,
debitCardOption, new CitrusUser(
"hariprasad@mmadapps.com", "8861099488"));
} catch (CitrusException e) {
e.printStackTrace();
Log.e("error", "eror");
}
}
private void initCitrus() {
citrusClient = CitrusClient.getInstance(context.getApplicationContext());
citrusClient.init("5gkf0ij3br-signup",
"c963e11a37703f523b33b3ee36dbc7b1", "5gkf0ij3br-signin",
"f140bd5794c7294ea7875eddaacf3bea", "5gkf0ij3br",
Environment.SANDBOX);
}
}
| UTF-8 | Java | 6,092 | java | PaymentGateway.java | Java | [
{
"context": " final java.lang.String DEBIT_CARD_HOLDER_NAME = \"HARI PRASAD\";\n\tprivate static final java.lang.String DEBIT_CA",
"end": 1293,
"score": 0.999699592590332,
"start": 1282,
"tag": "NAME",
"value": "HARI PRASAD"
},
{
"context": "inal java.lang.String DEBIT_CARD_EXPIRY_M... | null | [] | package com.mmadapps.verisupplier.payment;
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
import com.citrus.sdk.Callback;
import com.citrus.sdk.CitrusClient;
import com.citrus.sdk.CitrusUser;
import com.citrus.sdk.Environment;
import com.citrus.sdk.TransactionResponse;
import com.citrus.sdk.TransactionResponse.TransactionStatus;
import com.citrus.sdk.classes.Amount;
import com.citrus.sdk.classes.CitrusException;
import com.citrus.sdk.classes.Month;
import com.citrus.sdk.classes.Year;
import com.citrus.sdk.payment.CreditCardOption;
import com.citrus.sdk.payment.DebitCardOption;
import com.citrus.sdk.payment.MerchantPaymentOption;
import com.citrus.sdk.payment.NetbankingOption;
import com.citrus.sdk.payment.PaymentType;
import com.citrus.sdk.response.CitrusError;
import com.mmadapps.verisupplier.customs.VerisupplierUtils;
import com.mmadapps.verisupplier.placeorder.MakePaymentNewActivity;
public class PaymentGateway {
CitrusClient citrusClient;
PaymentType.PGPayment pgPayment = null;
public NetbankingOption netbankingOption;
Context context;
private static final java.lang.String BILL_URL = "http://chatappsrvropfr.cloudapp.net/citrus/BillGenerator.php";
private static final java.lang.String DEBIT_CARD_HOLDER_NAME = "<NAME>";
private static final java.lang.String DEBIT_CARD_HOLDER_NUMBER = "5326760126549034";
private static final java.lang.String DEBIT_CARD_CVV = "556";
private static final java.lang.String DEBIT_CARD_EXPIRY_MONTH = "08";
private static final java.lang.String DEBIT_CARD_EXPIRY_YEAR = "24";
public PaymentGateway(final Context con) {
super();
this.context = con;
initCitrus();
callBankList();
switch (1) {
case 1:
debitCard();
break;
case 2:
creditCard();
break;
case 3:
netPayment();
break;
}
citrusClient.pgPayment(pgPayment,new Callback<TransactionResponse>() {
@Override
public void success(TransactionResponse transactionResponse) {
Log.e("error", "payment success"+ transactionResponse.getMessage());
Log.e("error", "payment success json"+ transactionResponse.getResponseCode());
Log.e("error", "payment success json"+ transactionResponse.getJsonResponse());
Log.e("error","payment success status" + transactionResponse.getTransactionStatus());
//transactionResponse.g
VerisupplierUtils.mPaymentStatus.setmStatus(""+transactionResponse.getTransactionStatus());
VerisupplierUtils.mPaymentStatus.setmStatusJson(""+transactionResponse.getJsonResponse());
Toast.makeText(context.getApplicationContext(),"Payment succesfull", Toast.LENGTH_LONG).show();
}
@Override
public void error(CitrusError error) {
//error.
Log.e("error","payment failure" + error.getMessage());
Log.e("error","payment failure" + error.getStatus());
VerisupplierUtils.mPaymentStatus.setmStatus("Failure");
VerisupplierUtils.mPaymentStatus.setmStatusJson("error json");
Toast.makeText(context.getApplicationContext(),"Payment failure", Toast.LENGTH_LONG).show();
}
});
}
private void callBankList() {
// TODO Auto-generated method stub
citrusClient.getMerchantPaymentOptions(new Callback<MerchantPaymentOption>() {
@Override
public void success(MerchantPaymentOption merchantPaymentOption) {
for (int i = 0; i < merchantPaymentOption.getNetbankingOptionList().size(); i++) {
Log.e("bankdetails","Bank Name: "+ merchantPaymentOption
.getNetbankingOptionList()
.get(i).getBankName().toString()
+ " CID: "
+ merchantPaymentOption
.getNetbankingOptionList()
.get(i).getBankCID().toString());
}
}
@Override
public void error(CitrusError error) {
// Utils.showToast(getActivity(),
// error.getMessage());
}
});
}
private void netPayment() {
// TODO Auto-generated method stub
citrusClient = CitrusClient.getInstance(context.getApplicationContext()); // Activity Context
// No need to call init on CitrusClient if already done.
netbankingOption = new NetbankingOption("ICICI Bank" ,"CID001");
// Init Net Banking PaymentType
Amount amount = new Amount("7");
try {
pgPayment = new PaymentType.PGPayment(amount, BILL_URL, netbankingOption, new CitrusUser("<EMAIL>","9876543210"));
} catch (CitrusException e) {
// TODO Auto-generated catch block
Log.e("error", "eror");
e.printStackTrace();
}
}
private void creditCard() {
// TODO Auto-generated method stub
citrusClient = CitrusClient.getInstance(context.getApplicationContext()); // Activity Context
// No need to call init on CitrusClient if already done.
CreditCardOption creditCardOption = new CreditCardOption("<NAME>", "4893772400492951", "123", Month.getMonth("12"), Year.getYear("18"));
Amount amount = new Amount("5");
// Init PaymentType
try {
pgPayment = new PaymentType.PGPayment(amount, BILL_URL, creditCardOption, new CitrusUser("<EMAIL>","9876543210"));
} catch (CitrusException e) {
e.printStackTrace();
Log.e("error", "eror");
}
}
private void debitCard() {
DebitCardOption debitCardOption = new DebitCardOption(
DEBIT_CARD_HOLDER_NAME, DEBIT_CARD_HOLDER_NUMBER,
DEBIT_CARD_CVV, Month.getMonth(DEBIT_CARD_EXPIRY_MONTH),
Year.getYear(DEBIT_CARD_EXPIRY_YEAR));
Amount amount = new Amount("10");
// CitrusClient citrusClient = CitrusClient.getInstance(context);
// Init PaymentType
try {
pgPayment = new PaymentType.PGPayment(amount, BILL_URL,
debitCardOption, new CitrusUser(
"<EMAIL>", "8861099488"));
} catch (CitrusException e) {
e.printStackTrace();
Log.e("error", "eror");
}
}
private void initCitrus() {
citrusClient = CitrusClient.getInstance(context.getApplicationContext());
citrusClient.init("5gkf0ij3br-signup",
"c963e11a37703f523b33b3ee36dbc7b1", "5gkf0ij3br-signin",
"f140bd5794c7294ea7875eddaacf3bea", "5gkf0ij3br",
Environment.SANDBOX);
}
}
| 6,030 | 0.727019 | 0.705187 | 187 | 31.577539 | 30.413868 | 144 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.823529 | false | false | 2 |
8d36daf621200250b7d75a43166fb246f50c55a3 | 23,691,039,639,086 | abe618aeac07893b947c55433333a43043daca60 | /src/main/java/com/wf/publisherBT/service/KafkaSender.java | e496f4387abc3e3b260d31fb9fdb3741a05a0832 | [] | no_license | mithunj43/publisher | https://github.com/mithunj43/publisher | cdd6c0c03d28632801c2015a6012c4ae4bdebd65 | 59e7e567a08aefe032b090d3862c7a545f409899 | refs/heads/master | 2023-06-07T05:50:42.446000 | 2021-06-29T05:33:41 | 2021-06-29T05:33:41 | 381,119,380 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.wf.publisherBT.service;
import com.wf.publisherBT.entity.Trade;
import com.wf.publisherBT.entity.Trades;
import com.wf.publisherBT.repository.TradeRepo;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
@Service
public class KafkaSender {
@Autowired
private TradeRepo tradeRepo;
@Autowired
private KafkaTemplate<String, Trade> kafkaTemplate;
String kafkaTopic = "tradeData7";
public void send() {
List<Trades> all = tradeRepo.findAll();
all.forEach(trades -> {
Trade trade = getTrade(trades);
kafkaTemplate.send(kafkaTopic, trade.getTradeId(),trade);
});
}
@NotNull
private Trade getTrade(Trades trades) {
Trade trade = new Trade();
trade.setTradeId(trades.getTradeId());
trade.setInitialIndexLevel(trades.getInitialIndexLevel());
trade.setOutputDataFile(trades.getOutputDataFile());
trade.setStrikePrice(trades.getStrikePrice());
trade.setTimeToMaturity(trades.getTimeToMaturity());
return trade;
}
}
| UTF-8 | Java | 1,274 | java | KafkaSender.java | Java | [] | null | [] | package com.wf.publisherBT.service;
import com.wf.publisherBT.entity.Trade;
import com.wf.publisherBT.entity.Trades;
import com.wf.publisherBT.repository.TradeRepo;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
@Service
public class KafkaSender {
@Autowired
private TradeRepo tradeRepo;
@Autowired
private KafkaTemplate<String, Trade> kafkaTemplate;
String kafkaTopic = "tradeData7";
public void send() {
List<Trades> all = tradeRepo.findAll();
all.forEach(trades -> {
Trade trade = getTrade(trades);
kafkaTemplate.send(kafkaTopic, trade.getTradeId(),trade);
});
}
@NotNull
private Trade getTrade(Trades trades) {
Trade trade = new Trade();
trade.setTradeId(trades.getTradeId());
trade.setInitialIndexLevel(trades.getInitialIndexLevel());
trade.setOutputDataFile(trades.getOutputDataFile());
trade.setStrikePrice(trades.getStrikePrice());
trade.setTimeToMaturity(trades.getTimeToMaturity());
return trade;
}
}
| 1,274 | 0.710361 | 0.709576 | 48 | 25.541666 | 22.314941 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5625 | false | false | 2 |
defa5aa5d917c942bb25ef13f6e740fcdf0cbbab | 10,136,122,888,891 | 464d6e2f74efe5b08f226ed62bcec34413d2b75a | /Module2_JavaWeb/Case_Study_JavaWeb/module2_wbe/src/main/java/case_study/module2_wbe/service/ServiceInterface.java | 13cfe1bf01e741763995b566629466e2a4c711d9 | [] | no_license | quandang1996/C0320G1_DANGHONGQUAN | https://github.com/quandang1996/C0320G1_DANGHONGQUAN | dd52039f1510702f05665e78e68b70a0235e6ae8 | 2aa35964f763eb87cbbb110fe739fc6ac5a7ee94 | refs/heads/master | 2021-04-16T05:54:37.987000 | 2020-07-24T09:38:19 | 2020-07-24T09:38:19 | 249,332,111 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package case_study.module2_wbe.service;
import case_study.module2_wbe.entity.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface ServiceInterface {
List<Service> findAll();
void save (Service service);
Page<Service> findAllService(int page);
Service findAllById(Long id);
void remove(Long id);
Page<Service> findAllByName(String name, int page);
}
| UTF-8 | Java | 465 | java | ServiceInterface.java | Java | [] | null | [] | package case_study.module2_wbe.service;
import case_study.module2_wbe.entity.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
public interface ServiceInterface {
List<Service> findAll();
void save (Service service);
Page<Service> findAllService(int page);
Service findAllById(Long id);
void remove(Long id);
Page<Service> findAllByName(String name, int page);
}
| 465 | 0.75914 | 0.754839 | 16 | 28.0625 | 18.015511 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.75 | false | false | 2 |
bb76529443c4caea2fca816a020af41fc8c26b59 | 8,607,114,506,168 | 9cf92cd17f7979d7a80f71bffee49564272280fe | /java-dialogflow/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/ParticipantProto.java | 1eecd7000da8bd9f25d029070ca295f023999e68 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | sumodgeorge/google-cloud-java | https://github.com/sumodgeorge/google-cloud-java | 32aea14097af929420b25abf71443aa22286e88b | 389ac8dca201302a2ceb2299b32eb69fd0d79077 | refs/heads/master | 2023-08-31T10:56:49.958000 | 2023-08-17T21:26:13 | 2023-08-17T21:26:13 | 162,004,285 | 0 | 0 | Apache-2.0 | true | 2023-06-27T15:15:51 | 2018-12-16T13:33:36 | 2018-12-16T13:34:00 | 2023-06-27T15:15:19 | 709,363 | 0 | 0 | 0 | Java | false | false | /*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/participant.proto
package com.google.cloud.dialogflow.v2beta1;
public final class ParticipantProto {
private ParticipantProto() {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Participant_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Message_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Message_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
static {
java.lang.String[] descriptorData = {
"\n1google/cloud/dialogflow/v2beta1/partic"
+ "ipant.proto\022\037google.cloud.dialogflow.v2b"
+ "eta1\032\034google/api/annotations.proto\032\027goog"
+ "le/api/client.proto\032\037google/api/field_be"
+ "havior.proto\032\031google/api/resource.proto\032"
+ "2google/cloud/dialogflow/v2beta1/audio_c"
+ "onfig.proto\032-google/cloud/dialogflow/v2b"
+ "eta1/session.proto\032 google/protobuf/fiel"
+ "d_mask.proto\032\034google/protobuf/struct.pro"
+ "to\032\037google/protobuf/timestamp.proto\032\027goo"
+ "gle/rpc/status.proto\"\367\004\n\013Participant\022\022\n\004"
+ "name\030\001 \001(\tB\004\342A\001\001\022E\n\004role\030\002 \001(\01621.google."
+ "cloud.dialogflow.v2beta1.Participant.Rol"
+ "eB\004\342A\001\005\022)\n\033obfuscated_external_user_id\030\007"
+ " \001(\tB\004\342A\001\001\022t\n\032documents_metadata_filters"
+ "\030\010 \003(\0132J.google.cloud.dialogflow.v2beta1"
+ ".Participant.DocumentsMetadataFiltersEnt"
+ "ryB\004\342A\001\001\032?\n\035DocumentsMetadataFiltersEntr"
+ "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"P\n\004Rol"
+ "e\022\024\n\020ROLE_UNSPECIFIED\020\000\022\017\n\013HUMAN_AGENT\020\001"
+ "\022\023\n\017AUTOMATED_AGENT\020\002\022\014\n\010END_USER\020\003:\330\001\352A"
+ "\324\001\n%dialogflow.googleapis.com/Participan"
+ "t\022Jprojects/{project}/conversations/{con"
+ "versation}/participants/{participant}\022_p"
+ "rojects/{project}/locations/{location}/c"
+ "onversations/{conversation}/participants"
+ "/{participant}\"\244\005\n\007Message\022\022\n\004name\030\001 \001(\t"
+ "B\004\342A\001\001\022\025\n\007content\030\002 \001(\tB\004\342A\001\002\022\033\n\rlanguag"
+ "e_code\030\003 \001(\tB\004\342A\001\001\022\031\n\013participant\030\004 \001(\tB"
+ "\004\342A\001\003\022Q\n\020participant_role\030\005 \001(\01621.google"
+ ".cloud.dialogflow.v2beta1.Participant.Ro"
+ "leB\004\342A\001\003\0225\n\013create_time\030\006 \001(\0132\032.google.p"
+ "rotobuf.TimestampB\004\342A\001\003\0223\n\tsend_time\030\t \001"
+ "(\0132\032.google.protobuf.TimestampB\004\342A\001\001\022T\n\022"
+ "message_annotation\030\007 \001(\01322.google.cloud."
+ "dialogflow.v2beta1.MessageAnnotationB\004\342A"
+ "\001\003\022Z\n\022sentiment_analysis\030\010 \001(\01328.google."
+ "cloud.dialogflow.v2beta1.SentimentAnalys"
+ "isResultB\004\342A\001\003:\304\001\352A\300\001\n!dialogflow.google"
+ "apis.com/Message\022Bprojects/{project}/con"
+ "versations/{conversation}/messages/{mess"
+ "age}\022Wprojects/{project}/locations/{loca"
+ "tion}/conversations/{conversation}/messa"
+ "ges/{message}\"\243\001\n\030CreateParticipantReque"
+ "st\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\022%dialogflow."
+ "googleapis.com/Participant\022G\n\013participan"
+ "t\030\002 \001(\0132,.google.cloud.dialogflow.v2beta"
+ "1.ParticipantB\004\342A\001\002\"U\n\025GetParticipantReq"
+ "uest\022<\n\004name\030\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow."
+ "googleapis.com/Participant\"\214\001\n\027ListParti"
+ "cipantsRequest\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\022"
+ "%dialogflow.googleapis.com/Participant\022\027"
+ "\n\tpage_size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\003 "
+ "\001(\tB\004\342A\001\001\"w\n\030ListParticipantsResponse\022B\n"
+ "\014participants\030\001 \003(\0132,.google.cloud.dialo"
+ "gflow.v2beta1.Participant\022\027\n\017next_page_t"
+ "oken\030\002 \001(\t\"\232\001\n\030UpdateParticipantRequest\022"
+ "G\n\013participant\030\001 \001(\0132,.google.cloud.dial"
+ "ogflow.v2beta1.ParticipantB\004\342A\001\002\0225\n\013upda"
+ "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas"
+ "kB\004\342A\001\002\"^\n\nAudioInput\022A\n\006config\030\001 \001(\01321."
+ "google.cloud.dialogflow.v2beta1.InputAud"
+ "ioConfig\022\r\n\005audio\030\002 \001(\014\"`\n\013OutputAudio\022B"
+ "\n\006config\030\001 \001(\01322.google.cloud.dialogflow"
+ ".v2beta1.OutputAudioConfig\022\r\n\005audio\030\002 \001("
+ "\014\"\243\005\n\023AutomatedAgentReply\022W\n\026detect_inte"
+ "nt_response\030\001 \001(\01325.google.cloud.dialogf"
+ "low.v2beta1.DetectIntentResponseH\000\022K\n\021re"
+ "sponse_messages\030\003 \003(\01320.google.cloud.dia"
+ "logflow.v2beta1.ResponseMessage\0227\n\006inten"
+ "t\030\004 \001(\tB%\372A\"\n dialogflow.googleapis.com/"
+ "IntentH\001\022\017\n\005event\030\005 \001(\tH\001\022\030\n\020match_confi"
+ "dence\030\t \001(\002\022+\n\nparameters\030\n \001(\0132\027.google"
+ ".protobuf.Struct\022:\n\025cx_session_parameter"
+ "s\030\006 \001(\0132\027.google.protobuf.StructB\002\030\001\022p\n\032"
+ "automated_agent_reply_type\030\007 \001(\0162L.googl"
+ "e.cloud.dialogflow.v2beta1.AutomatedAgen"
+ "tReply.AutomatedAgentReplyType\022\032\n\022allow_"
+ "cancellation\030\010 \001(\010\022\027\n\017cx_current_page\030\013 "
+ "\001(\t\"]\n\027AutomatedAgentReplyType\022*\n&AUTOMA"
+ "TED_AGENT_REPLY_TYPE_UNSPECIFIED\020\000\022\013\n\007PA"
+ "RTIAL\020\001\022\t\n\005FINAL\020\002B\n\n\010responseB\007\n\005match\""
+ "\334\001\n\017SuggestionInput\022\025\n\ranswer_record\030\001 \001"
+ "(\t\022A\n\rtext_override\030\002 \001(\0132*.google.cloud"
+ ".dialogflow.v2beta1.TextInput\022+\n\nparamet"
+ "ers\030\004 \001(\0132\027.google.protobuf.Struct\022B\n\014in"
+ "tent_input\030\006 \001(\0132,.google.cloud.dialogfl"
+ "ow.v2beta1.IntentInput\"@\n\013IntentInput\022\024\n"
+ "\006intent\030\001 \001(\tB\004\342A\001\002\022\033\n\rlanguage_code\030\003 \001"
+ "(\tB\004\342A\001\002\"\342\001\n\021SuggestionFeature\022E\n\004type\030\001"
+ " \001(\01627.google.cloud.dialogflow.v2beta1.S"
+ "uggestionFeature.Type\"\205\001\n\004Type\022\024\n\020TYPE_U"
+ "NSPECIFIED\020\000\022\026\n\022ARTICLE_SUGGESTION\020\001\022\007\n\003"
+ "FAQ\020\002\022\017\n\013SMART_REPLY\020\003\022\025\n\021DIALOGFLOW_ASS"
+ "IST\020\004\022\036\n\032CONVERSATION_SUMMARIZATION\020\010\"\322\001"
+ "\n\025AssistQueryParameters\022x\n\032documents_met"
+ "adata_filters\030\001 \003(\0132T.google.cloud.dialo"
+ "gflow.v2beta1.AssistQueryParameters.Docu"
+ "mentsMetadataFiltersEntry\032?\n\035DocumentsMe"
+ "tadataFiltersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value"
+ "\030\002 \001(\t:\0028\001\"\376\005\n\025AnalyzeContentRequest\022C\n\013"
+ "participant\030\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow.g"
+ "oogleapis.com/Participant\022@\n\ntext_input\030"
+ "\006 \001(\0132*.google.cloud.dialogflow.v2beta1."
+ "TextInputH\000\022B\n\013audio_input\030\007 \001(\0132+.googl"
+ "e.cloud.dialogflow.v2beta1.AudioInputH\000\022"
+ "B\n\013event_input\030\010 \001(\0132+.google.cloud.dial"
+ "ogflow.v2beta1.EventInputH\000\022L\n\020suggestio"
+ "n_input\030\014 \001(\01320.google.cloud.dialogflow."
+ "v2beta1.SuggestionInputH\000\022N\n\022reply_audio"
+ "_config\030\005 \001(\01322.google.cloud.dialogflow."
+ "v2beta1.OutputAudioConfig\022F\n\014query_param"
+ "s\030\t \001(\01320.google.cloud.dialogflow.v2beta"
+ "1.QueryParameters\022S\n\023assist_query_params"
+ "\030\016 \001(\01326.google.cloud.dialogflow.v2beta1"
+ ".AssistQueryParameters\022.\n\rcx_parameters\030"
+ "\022 \001(\0132\027.google.protobuf.Struct\022\027\n\017cx_cur"
+ "rent_page\030\024 \001(\t\0225\n\021message_send_time\030\n \001"
+ "(\0132\032.google.protobuf.Timestamp\022\022\n\nreques"
+ "t_id\030\013 \001(\tB\007\n\005input\",\n\016DtmfParameters\022\032\n"
+ "\022accepts_dtmf_input\030\001 \001(\010\"\374\003\n\026AnalyzeCon"
+ "tentResponse\022\022\n\nreply_text\030\001 \001(\t\022A\n\013repl"
+ "y_audio\030\002 \001(\0132,.google.cloud.dialogflow."
+ "v2beta1.OutputAudio\022S\n\025automated_agent_r"
+ "eply\030\003 \001(\01324.google.cloud.dialogflow.v2b"
+ "eta1.AutomatedAgentReply\0229\n\007message\030\005 \001("
+ "\0132(.google.cloud.dialogflow.v2beta1.Mess"
+ "age\022Y\n\036human_agent_suggestion_results\030\006 "
+ "\003(\01321.google.cloud.dialogflow.v2beta1.Su"
+ "ggestionResult\022V\n\033end_user_suggestion_re"
+ "sults\030\007 \003(\01321.google.cloud.dialogflow.v2"
+ "beta1.SuggestionResult\022H\n\017dtmf_parameter"
+ "s\030\t \001(\0132/.google.cloud.dialogflow.v2beta"
+ "1.DtmfParameters\"(\n\017InputTextConfig\022\025\n\rl"
+ "anguage_code\030\001 \001(\t\"\210\006\n\036StreamingAnalyzeC"
+ "ontentRequest\022C\n\013participant\030\001 \001(\tB.\342A\001\002"
+ "\372A\'\n%dialogflow.googleapis.com/Participa"
+ "nt\022I\n\014audio_config\030\002 \001(\01321.google.cloud."
+ "dialogflow.v2beta1.InputAudioConfigH\000\022G\n"
+ "\013text_config\030\003 \001(\01320.google.cloud.dialog"
+ "flow.v2beta1.InputTextConfigH\000\022N\n\022reply_"
+ "audio_config\030\004 \001(\01322.google.cloud.dialog"
+ "flow.v2beta1.OutputAudioConfig\022\025\n\013input_"
+ "audio\030\005 \001(\014H\001\022\024\n\ninput_text\030\006 \001(\tH\001\022J\n\ni"
+ "nput_dtmf\030\t \001(\01324.google.cloud.dialogflo"
+ "w.v2beta1.TelephonyDtmfEventsH\001\022F\n\014query"
+ "_params\030\007 \001(\01320.google.cloud.dialogflow."
+ "v2beta1.QueryParameters\022S\n\023assist_query_"
+ "params\030\010 \001(\01326.google.cloud.dialogflow.v"
+ "2beta1.AssistQueryParameters\022.\n\rcx_param"
+ "eters\030\r \001(\0132\027.google.protobuf.Struct\022\027\n\017"
+ "cx_current_page\030\017 \001(\t\022,\n$enable_partial_"
+ "automated_agent_reply\030\014 \001(\010\022\035\n\025enable_de"
+ "bugging_info\030\023 \001(\010B\010\n\006configB\007\n\005input\"\267\005"
+ "\n\037StreamingAnalyzeContentResponse\022W\n\022rec"
+ "ognition_result\030\001 \001(\0132;.google.cloud.dia"
+ "logflow.v2beta1.StreamingRecognitionResu"
+ "lt\022\022\n\nreply_text\030\002 \001(\t\022A\n\013reply_audio\030\003 "
+ "\001(\0132,.google.cloud.dialogflow.v2beta1.Ou"
+ "tputAudio\022S\n\025automated_agent_reply\030\004 \001(\013"
+ "24.google.cloud.dialogflow.v2beta1.Autom"
+ "atedAgentReply\0229\n\007message\030\006 \001(\0132(.google"
+ ".cloud.dialogflow.v2beta1.Message\022Y\n\036hum"
+ "an_agent_suggestion_results\030\007 \003(\01321.goog"
+ "le.cloud.dialogflow.v2beta1.SuggestionRe"
+ "sult\022V\n\033end_user_suggestion_results\030\010 \003("
+ "\01321.google.cloud.dialogflow.v2beta1.Sugg"
+ "estionResult\022H\n\017dtmf_parameters\030\n \001(\0132/."
+ "google.cloud.dialogflow.v2beta1.DtmfPara"
+ "meters\022W\n\016debugging_info\030\013 \001(\0132?.google."
+ "cloud.dialogflow.v2beta1.CloudConversati"
+ "onDebuggingInfo\"j\n\024AnnotatedMessagePart\022"
+ "\014\n\004text\030\001 \001(\t\022\023\n\013entity_type\030\002 \001(\t\022/\n\017fo"
+ "rmatted_value\030\003 \001(\0132\026.google.protobuf.Va"
+ "lue\"s\n\021MessageAnnotation\022D\n\005parts\030\001 \003(\0132"
+ "5.google.cloud.dialogflow.v2beta1.Annota"
+ "tedMessagePart\022\030\n\020contain_entities\030\002 \001(\010"
+ "\"\325\001\n\rArticleAnswer\022\r\n\005title\030\001 \001(\t\022\013\n\003uri"
+ "\030\002 \001(\t\022\020\n\010snippets\030\003 \003(\t\022N\n\010metadata\030\005 \003"
+ "(\0132<.google.cloud.dialogflow.v2beta1.Art"
+ "icleAnswer.MetadataEntry\022\025\n\ranswer_recor"
+ "d\030\006 \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n"
+ "\005value\030\002 \001(\t:\0028\001\"\345\001\n\tFaqAnswer\022\016\n\006answer"
+ "\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\022\020\n\010question\030\003"
+ " \001(\t\022\016\n\006source\030\004 \001(\t\022J\n\010metadata\030\005 \003(\01328"
+ ".google.cloud.dialogflow.v2beta1.FaqAnsw"
+ "er.MetadataEntry\022\025\n\ranswer_record\030\006 \001(\t\032"
+ "/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002"
+ " \001(\t:\0028\001\"y\n\020SmartReplyAnswer\022\r\n\005reply\030\001 "
+ "\001(\t\022\022\n\nconfidence\030\002 \001(\002\022B\n\ranswer_record"
+ "\030\003 \001(\tB+\372A(\n&dialogflow.googleapis.com/A"
+ "nswerRecord\"\\\n\020IntentSuggestion\022\024\n\014displ"
+ "ay_name\030\001 \001(\t\022\023\n\tintent_v2\030\002 \001(\tH\000\022\023\n\013de"
+ "scription\030\005 \001(\tB\010\n\006intent\"\317\001\n\026Dialogflow"
+ "AssistAnswer\022D\n\014query_result\030\001 \001(\0132,.goo"
+ "gle.cloud.dialogflow.v2beta1.QueryResult"
+ "H\000\022N\n\021intent_suggestion\030\005 \001(\01321.google.c"
+ "loud.dialogflow.v2beta1.IntentSuggestion"
+ "H\000\022\025\n\ranswer_record\030\002 \001(\tB\010\n\006result\"\334\004\n\020"
+ "SuggestionResult\022#\n\005error\030\001 \001(\0132\022.google"
+ ".rpc.StatusH\000\022]\n\031suggest_articles_respon"
+ "se\030\002 \001(\01328.google.cloud.dialogflow.v2bet"
+ "a1.SuggestArticlesResponseH\000\022b\n\034suggest_"
+ "faq_answers_response\030\003 \001(\0132:.google.clou"
+ "d.dialogflow.v2beta1.SuggestFaqAnswersRe"
+ "sponseH\000\022f\n\036suggest_smart_replies_respon"
+ "se\030\004 \001(\0132<.google.cloud.dialogflow.v2bet"
+ "a1.SuggestSmartRepliesResponseH\000\022p\n#sugg"
+ "est_dialogflow_assists_response\030\005 \001(\0132A."
+ "google.cloud.dialogflow.v2beta1.SuggestD"
+ "ialogflowAssistsResponseH\000\022o\n\"suggest_en"
+ "tity_extraction_response\030\007 \001(\0132A.google."
+ "cloud.dialogflow.v2beta1.SuggestDialogfl"
+ "owAssistsResponseH\000B\025\n\023suggestion_respon"
+ "se\"\223\002\n\026SuggestArticlesRequest\022>\n\006parent\030"
+ "\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow.googleapis.co"
+ "m/Participant\022B\n\016latest_message\030\002 \001(\tB*\342"
+ "A\001\001\372A#\n!dialogflow.googleapis.com/Messag"
+ "e\022\032\n\014context_size\030\003 \001(\005B\004\342A\001\001\022Y\n\023assist_"
+ "query_params\030\004 \001(\01326.google.cloud.dialog"
+ "flow.v2beta1.AssistQueryParametersB\004\342A\001\001"
+ "\"\220\001\n\027SuggestArticlesResponse\022G\n\017article_"
+ "answers\030\001 \003(\0132..google.cloud.dialogflow."
+ "v2beta1.ArticleAnswer\022\026\n\016latest_message\030"
+ "\002 \001(\t\022\024\n\014context_size\030\003 \001(\005\"\225\002\n\030SuggestF"
+ "aqAnswersRequest\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A"
+ "\'\n%dialogflow.googleapis.com/Participant"
+ "\022B\n\016latest_message\030\002 \001(\tB*\342A\001\001\372A#\n!dialo"
+ "gflow.googleapis.com/Message\022\032\n\014context_"
+ "size\030\003 \001(\005B\004\342A\001\001\022Y\n\023assist_query_params\030"
+ "\004 \001(\01326.google.cloud.dialogflow.v2beta1."
+ "AssistQueryParametersB\004\342A\001\001\"\212\001\n\031SuggestF"
+ "aqAnswersResponse\022?\n\013faq_answers\030\001 \003(\0132*"
+ ".google.cloud.dialogflow.v2beta1.FaqAnsw"
+ "er\022\026\n\016latest_message\030\002 \001(\t\022\024\n\014context_si"
+ "ze\030\003 \001(\005\"\372\001\n\032SuggestSmartRepliesRequest\022"
+ ">\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow.goo"
+ "gleapis.com/Participant\022F\n\022current_text_"
+ "input\030\004 \001(\0132*.google.cloud.dialogflow.v2"
+ "beta1.TextInput\022>\n\016latest_message\030\002 \001(\tB"
+ "&\372A#\n!dialogflow.googleapis.com/Message\022"
+ "\024\n\014context_size\030\003 \001(\005\"\303\001\n\033SuggestSmartRe"
+ "pliesResponse\022N\n\023smart_reply_answers\030\001 \003"
+ "(\01321.google.cloud.dialogflow.v2beta1.Sma"
+ "rtReplyAnswer\022>\n\016latest_message\030\002 \001(\tB&\372"
+ "A#\n!dialogflow.googleapis.com/Message\022\024\n"
+ "\014context_size\030\003 \001(\005\"\254\001\n SuggestDialogflo"
+ "wAssistsResponse\022Z\n\031dialogflow_assist_an"
+ "swers\030\001 \003(\01327.google.cloud.dialogflow.v2"
+ "beta1.DialogflowAssistAnswer\022\026\n\016latest_m"
+ "essage\030\002 \001(\t\022\024\n\014context_size\030\003 \001(\005\"\304\005\n\nS"
+ "uggestion\022\014\n\004name\030\001 \001(\t\022E\n\010articles\030\002 \003("
+ "\01323.google.cloud.dialogflow.v2beta1.Sugg"
+ "estion.Article\022J\n\013faq_answers\030\004 \003(\01325.go"
+ "ogle.cloud.dialogflow.v2beta1.Suggestion"
+ ".FaqAnswer\022/\n\013create_time\030\005 \001(\0132\032.google"
+ ".protobuf.Timestamp\022\026\n\016latest_message\030\007 "
+ "\001(\t\032\324\001\n\007Article\022\r\n\005title\030\001 \001(\t\022\013\n\003uri\030\002 "
+ "\001(\t\022\020\n\010snippets\030\003 \003(\t\022S\n\010metadata\030\005 \003(\0132"
+ "A.google.cloud.dialogflow.v2beta1.Sugges"
+ "tion.Article.MetadataEntry\022\025\n\ranswer_rec"
+ "ord\030\006 \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022"
+ "\r\n\005value\030\002 \001(\t:\0028\001\032\360\001\n\tFaqAnswer\022\016\n\006answ"
+ "er\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\022\020\n\010question"
+ "\030\003 \001(\t\022\016\n\006source\030\004 \001(\t\022U\n\010metadata\030\005 \003(\013"
+ "2C.google.cloud.dialogflow.v2beta1.Sugge"
+ "stion.FaqAnswer.MetadataEntry\022\025\n\ranswer_"
+ "record\030\006 \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001"
+ "(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\002\030\001\"c\n\026ListSuggest"
+ "ionsRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size"
+ "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001"
+ "(\t:\002\030\001\"x\n\027ListSuggestionsResponse\022@\n\013sug"
+ "gestions\030\001 \003(\0132+.google.cloud.dialogflow"
+ ".v2beta1.Suggestion\022\027\n\017next_page_token\030\002"
+ " \001(\t:\002\030\001\"\\\n\030CompileSuggestionRequest\022\016\n\006"
+ "parent\030\001 \001(\t\022\026\n\016latest_message\030\002 \001(\t\022\024\n\014"
+ "context_size\030\003 \001(\005:\002\030\001\"\216\001\n\031CompileSugges"
+ "tionResponse\022?\n\nsuggestion\030\001 \001(\0132+.googl"
+ "e.cloud.dialogflow.v2beta1.Suggestion\022\026\n"
+ "\016latest_message\030\002 \001(\t\022\024\n\014context_size\030\003 "
+ "\001(\005:\002\030\001\"\203\007\n\017ResponseMessage\022E\n\004text\030\001 \001("
+ "\01325.google.cloud.dialogflow.v2beta1.Resp"
+ "onseMessage.TextH\000\022*\n\007payload\030\002 \001(\0132\027.go"
+ "ogle.protobuf.StructH\000\022_\n\022live_agent_han"
+ "doff\030\003 \001(\0132A.google.cloud.dialogflow.v2b"
+ "eta1.ResponseMessage.LiveAgentHandoffH\000\022"
+ "Z\n\017end_interaction\030\004 \001(\0132?.google.cloud."
+ "dialogflow.v2beta1.ResponseMessage.EndIn"
+ "teractionH\000\022R\n\013mixed_audio\030\005 \001(\0132;.googl"
+ "e.cloud.dialogflow.v2beta1.ResponseMessa"
+ "ge.MixedAudioH\000\022i\n\027telephony_transfer_ca"
+ "ll\030\006 \001(\0132F.google.cloud.dialogflow.v2bet"
+ "a1.ResponseMessage.TelephonyTransferCall"
+ "H\000\032\024\n\004Text\022\014\n\004text\030\001 \003(\t\032=\n\020LiveAgentHan"
+ "doff\022)\n\010metadata\030\001 \001(\0132\027.google.protobuf"
+ ".Struct\032\020\n\016EndInteraction\032\276\001\n\nMixedAudio"
+ "\022U\n\010segments\030\001 \003(\0132C.google.cloud.dialog"
+ "flow.v2beta1.ResponseMessage.MixedAudio."
+ "Segment\032Y\n\007Segment\022\017\n\005audio\030\001 \001(\014H\000\022\r\n\003u"
+ "ri\030\002 \001(\tH\000\022#\n\033allow_playback_interruptio"
+ "n\030\003 \001(\010B\t\n\007content\032N\n\025TelephonyTransferC"
+ "all\022\026\n\014phone_number\030\001 \001(\tH\000\022\021\n\007sip_uri\030\002"
+ " \001(\tH\000B\n\n\010endpointB\t\n\007message2\207\033\n\014Partic"
+ "ipants\022\271\002\n\021CreateParticipant\0229.google.cl"
+ "oud.dialogflow.v2beta1.CreateParticipant"
+ "Request\032,.google.cloud.dialogflow.v2beta"
+ "1.Participant\"\272\001\332A\022parent,participant\202\323\344"
+ "\223\002\236\001\"9/v2beta1/{parent=projects/*/conver"
+ "sations/*}/participants:\013participantZT\"E"
+ "/v2beta1/{parent=projects/*/locations/*/"
+ "conversations/*}/participants:\013participa"
+ "nt\022\213\002\n\016GetParticipant\0226.google.cloud.dia"
+ "logflow.v2beta1.GetParticipantRequest\032,."
+ "google.cloud.dialogflow.v2beta1.Particip"
+ "ant\"\222\001\332A\004name\202\323\344\223\002\204\001\0229/v2beta1/{name=pro"
+ "jects/*/conversations/*/participants/*}Z"
+ "G\022E/v2beta1/{name=projects/*/locations/*"
+ "/conversations/*/participants/*}\022\236\002\n\020Lis"
+ "tParticipants\0228.google.cloud.dialogflow."
+ "v2beta1.ListParticipantsRequest\0329.google"
+ ".cloud.dialogflow.v2beta1.ListParticipan"
+ "tsResponse\"\224\001\332A\006parent\202\323\344\223\002\204\001\0229/v2beta1/"
+ "{parent=projects/*/conversations/*}/part"
+ "icipantsZG\022E/v2beta1/{parent=projects/*/"
+ "locations/*/conversations/*}/participant"
+ "s\022\326\002\n\021UpdateParticipant\0229.google.cloud.d"
+ "ialogflow.v2beta1.UpdateParticipantReque"
+ "st\032,.google.cloud.dialogflow.v2beta1.Par"
+ "ticipant\"\327\001\332A\027participant,update_mask\202\323\344"
+ "\223\002\266\0012E/v2beta1/{participant.name=project"
+ "s/*/conversations/*/participants/*}:\013par"
+ "ticipantZ`2Q/v2beta1/{participant.name=p"
+ "rojects/*/locations/*/conversations/*/pa"
+ "rticipants/*}:\013participant\022\216\003\n\016AnalyzeCo"
+ "ntent\0226.google.cloud.dialogflow.v2beta1."
+ "AnalyzeContentRequest\0327.google.cloud.dia"
+ "logflow.v2beta1.AnalyzeContentResponse\"\212"
+ "\002\332A\026participant,text_input\332A\027participant"
+ ",audio_input\332A\027participant,event_input\202\323"
+ "\344\223\002\266\001\"O/v2beta1/{participant=projects/*/"
+ "conversations/*/participants/*}:analyzeC"
+ "ontent:\001*Z`\"[/v2beta1/{participant=proje"
+ "cts/*/locations/*/conversations/*/partic"
+ "ipants/*}:analyzeContent:\001*\022\242\001\n\027Streamin"
+ "gAnalyzeContent\022?.google.cloud.dialogflo"
+ "w.v2beta1.StreamingAnalyzeContentRequest"
+ "\032@.google.cloud.dialogflow.v2beta1.Strea"
+ "mingAnalyzeContentResponse\"\000(\0010\001\022\335\002\n\017Sug"
+ "gestArticles\0227.google.cloud.dialogflow.v"
+ "2beta1.SuggestArticlesRequest\0328.google.c"
+ "loud.dialogflow.v2beta1.SuggestArticlesR"
+ "esponse\"\326\001\332A\006parent\202\323\344\223\002\306\001\"W/v2beta1/{pa"
+ "rent=projects/*/conversations/*/particip"
+ "ants/*}/suggestions:suggestArticles:\001*Zh"
+ "\"c/v2beta1/{parent=projects/*/locations/"
+ "*/conversations/*/participants/*}/sugges"
+ "tions:suggestArticles:\001*\022\347\002\n\021SuggestFaqA"
+ "nswers\0229.google.cloud.dialogflow.v2beta1"
+ ".SuggestFaqAnswersRequest\032:.google.cloud"
+ ".dialogflow.v2beta1.SuggestFaqAnswersRes"
+ "ponse\"\332\001\332A\006parent\202\323\344\223\002\312\001\"Y/v2beta1/{pare"
+ "nt=projects/*/conversations/*/participan"
+ "ts/*}/suggestions:suggestFaqAnswers:\001*Zj"
+ "\"e/v2beta1/{parent=projects/*/locations/"
+ "*/conversations/*/participants/*}/sugges"
+ "tions:suggestFaqAnswers:\001*\022\361\002\n\023SuggestSm"
+ "artReplies\022;.google.cloud.dialogflow.v2b"
+ "eta1.SuggestSmartRepliesRequest\032<.google"
+ ".cloud.dialogflow.v2beta1.SuggestSmartRe"
+ "pliesResponse\"\336\001\332A\006parent\202\323\344\223\002\316\001\"[/v2bet"
+ "a1/{parent=projects/*/conversations/*/pa"
+ "rticipants/*}/suggestions:suggestSmartRe"
+ "plies:\001*Zl\"g/v2beta1/{parent=projects/*/"
+ "locations/*/conversations/*/participants"
+ "/*}/suggestions:suggestSmartReplies:\001*\022\330"
+ "\001\n\017ListSuggestions\0227.google.cloud.dialog"
+ "flow.v2beta1.ListSuggestionsRequest\0328.go"
+ "ogle.cloud.dialogflow.v2beta1.ListSugges"
+ "tionsResponse\"R\210\002\001\202\323\344\223\002I\022G/v2beta1/{pare"
+ "nt=projects/*/conversations/*/participan"
+ "ts/*}/suggestions\022\351\001\n\021CompileSuggestion\022"
+ "9.google.cloud.dialogflow.v2beta1.Compil"
+ "eSuggestionRequest\032:.google.cloud.dialog"
+ "flow.v2beta1.CompileSuggestionResponse\"]"
+ "\210\002\001\202\323\344\223\002T\"O/v2beta1/{parent=projects/*/c"
+ "onversations/*/participants/*}/suggestio"
+ "ns:compile:\001*\032x\312A\031dialogflow.googleapis."
+ "com\322AYhttps://www.googleapis.com/auth/cl"
+ "oud-platform,https://www.googleapis.com/"
+ "auth/dialogflowB\250\001\n#com.google.cloud.dia"
+ "logflow.v2beta1B\020ParticipantProtoP\001ZCclo"
+ "ud.google.com/go/dialogflow/apiv2beta1/d"
+ "ialogflowpb;dialogflowpb\370\001\001\242\002\002DF\252\002\037Googl"
+ "e.Cloud.Dialogflow.V2Beta1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.api.AnnotationsProto.getDescriptor(),
com.google.api.ClientProto.getDescriptor(),
com.google.api.FieldBehaviorProto.getDescriptor(),
com.google.api.ResourceProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.AudioConfigProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.SessionProto.getDescriptor(),
com.google.protobuf.FieldMaskProto.getDescriptor(),
com.google.protobuf.StructProto.getDescriptor(),
com.google.protobuf.TimestampProto.getDescriptor(),
com.google.rpc.StatusProto.getDescriptor(),
});
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_google_cloud_dialogflow_v2beta1_Participant_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor,
new java.lang.String[] {
"Name", "Role", "ObfuscatedExternalUserId", "DocumentsMetadataFilters",
});
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_Message_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_google_cloud_dialogflow_v2beta1_Message_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Message_descriptor,
new java.lang.String[] {
"Name",
"Content",
"LanguageCode",
"Participant",
"ParticipantRole",
"CreateTime",
"SendTime",
"MessageAnnotation",
"SentimentAnalysis",
});
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_descriptor,
new java.lang.String[] {
"Parent", "Participant",
});
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_descriptor,
new java.lang.String[] {
"Name",
});
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_descriptor,
new java.lang.String[] {
"Parent", "PageSize", "PageToken",
});
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_descriptor,
new java.lang.String[] {
"Participants", "NextPageToken",
});
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_descriptor,
new java.lang.String[] {
"Participant", "UpdateMask",
});
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_descriptor,
new java.lang.String[] {
"Config", "Audio",
});
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_descriptor =
getDescriptor().getMessageTypes().get(8);
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_descriptor,
new java.lang.String[] {
"Config", "Audio",
});
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_descriptor =
getDescriptor().getMessageTypes().get(9);
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_descriptor,
new java.lang.String[] {
"DetectIntentResponse",
"ResponseMessages",
"Intent",
"Event",
"MatchConfidence",
"Parameters",
"CxSessionParameters",
"AutomatedAgentReplyType",
"AllowCancellation",
"CxCurrentPage",
"Response",
"Match",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_descriptor =
getDescriptor().getMessageTypes().get(10);
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_descriptor,
new java.lang.String[] {
"AnswerRecord", "TextOverride", "Parameters", "IntentInput",
});
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_descriptor =
getDescriptor().getMessageTypes().get(11);
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_descriptor,
new java.lang.String[] {
"Intent", "LanguageCode",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_descriptor =
getDescriptor().getMessageTypes().get(12);
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_descriptor,
new java.lang.String[] {
"Type",
});
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor =
getDescriptor().getMessageTypes().get(13);
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor,
new java.lang.String[] {
"DocumentsMetadataFilters",
});
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_descriptor =
getDescriptor().getMessageTypes().get(14);
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_descriptor,
new java.lang.String[] {
"Participant",
"TextInput",
"AudioInput",
"EventInput",
"SuggestionInput",
"ReplyAudioConfig",
"QueryParams",
"AssistQueryParams",
"CxParameters",
"CxCurrentPage",
"MessageSendTime",
"RequestId",
"Input",
});
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_descriptor =
getDescriptor().getMessageTypes().get(15);
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_descriptor,
new java.lang.String[] {
"AcceptsDtmfInput",
});
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_descriptor =
getDescriptor().getMessageTypes().get(16);
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_descriptor,
new java.lang.String[] {
"ReplyText",
"ReplyAudio",
"AutomatedAgentReply",
"Message",
"HumanAgentSuggestionResults",
"EndUserSuggestionResults",
"DtmfParameters",
});
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_descriptor =
getDescriptor().getMessageTypes().get(17);
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_descriptor,
new java.lang.String[] {
"LanguageCode",
});
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_descriptor =
getDescriptor().getMessageTypes().get(18);
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_descriptor,
new java.lang.String[] {
"Participant",
"AudioConfig",
"TextConfig",
"ReplyAudioConfig",
"InputAudio",
"InputText",
"InputDtmf",
"QueryParams",
"AssistQueryParams",
"CxParameters",
"CxCurrentPage",
"EnablePartialAutomatedAgentReply",
"EnableDebuggingInfo",
"Config",
"Input",
});
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_descriptor =
getDescriptor().getMessageTypes().get(19);
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_descriptor,
new java.lang.String[] {
"RecognitionResult",
"ReplyText",
"ReplyAudio",
"AutomatedAgentReply",
"Message",
"HumanAgentSuggestionResults",
"EndUserSuggestionResults",
"DtmfParameters",
"DebuggingInfo",
});
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_descriptor =
getDescriptor().getMessageTypes().get(20);
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_descriptor,
new java.lang.String[] {
"Text", "EntityType", "FormattedValue",
});
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_descriptor =
getDescriptor().getMessageTypes().get(21);
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_descriptor,
new java.lang.String[] {
"Parts", "ContainEntities",
});
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor =
getDescriptor().getMessageTypes().get(22);
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor,
new java.lang.String[] {
"Title", "Uri", "Snippets", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor =
getDescriptor().getMessageTypes().get(23);
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor,
new java.lang.String[] {
"Answer", "Confidence", "Question", "Source", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_descriptor =
getDescriptor().getMessageTypes().get(24);
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_descriptor,
new java.lang.String[] {
"Reply", "Confidence", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_descriptor =
getDescriptor().getMessageTypes().get(25);
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_descriptor,
new java.lang.String[] {
"DisplayName", "IntentV2", "Description", "Intent",
});
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_descriptor =
getDescriptor().getMessageTypes().get(26);
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_descriptor,
new java.lang.String[] {
"QueryResult", "IntentSuggestion", "AnswerRecord", "Result",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_descriptor =
getDescriptor().getMessageTypes().get(27);
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_descriptor,
new java.lang.String[] {
"Error",
"SuggestArticlesResponse",
"SuggestFaqAnswersResponse",
"SuggestSmartRepliesResponse",
"SuggestDialogflowAssistsResponse",
"SuggestEntityExtractionResponse",
"SuggestionResponse",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_descriptor =
getDescriptor().getMessageTypes().get(28);
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_descriptor,
new java.lang.String[] {
"Parent", "LatestMessage", "ContextSize", "AssistQueryParams",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_descriptor =
getDescriptor().getMessageTypes().get(29);
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_descriptor,
new java.lang.String[] {
"ArticleAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_descriptor =
getDescriptor().getMessageTypes().get(30);
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_descriptor,
new java.lang.String[] {
"Parent", "LatestMessage", "ContextSize", "AssistQueryParams",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_descriptor =
getDescriptor().getMessageTypes().get(31);
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_descriptor,
new java.lang.String[] {
"FaqAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_descriptor =
getDescriptor().getMessageTypes().get(32);
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_descriptor,
new java.lang.String[] {
"Parent", "CurrentTextInput", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_descriptor =
getDescriptor().getMessageTypes().get(33);
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_descriptor,
new java.lang.String[] {
"SmartReplyAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_descriptor =
getDescriptor().getMessageTypes().get(34);
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_descriptor,
new java.lang.String[] {
"DialogflowAssistAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor =
getDescriptor().getMessageTypes().get(35);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor,
new java.lang.String[] {
"Name", "Articles", "FaqAnswers", "CreateTime", "LatestMessage",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor,
new java.lang.String[] {
"Title", "Uri", "Snippets", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor
.getNestedTypes()
.get(1);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor,
new java.lang.String[] {
"Answer", "Confidence", "Question", "Source", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_descriptor =
getDescriptor().getMessageTypes().get(36);
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_descriptor,
new java.lang.String[] {
"Parent", "PageSize", "PageToken", "Filter",
});
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_descriptor =
getDescriptor().getMessageTypes().get(37);
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_descriptor,
new java.lang.String[] {
"Suggestions", "NextPageToken",
});
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_descriptor =
getDescriptor().getMessageTypes().get(38);
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_descriptor,
new java.lang.String[] {
"Parent", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_descriptor =
getDescriptor().getMessageTypes().get(39);
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_descriptor,
new java.lang.String[] {
"Suggestion", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor =
getDescriptor().getMessageTypes().get(40);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor,
new java.lang.String[] {
"Text",
"Payload",
"LiveAgentHandoff",
"EndInteraction",
"MixedAudio",
"TelephonyTransferCall",
"Message",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_descriptor,
new java.lang.String[] {
"Text",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(1);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_descriptor,
new java.lang.String[] {
"Metadata",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(2);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_descriptor,
new java.lang.String[] {});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(3);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor,
new java.lang.String[] {
"Segments",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_descriptor,
new java.lang.String[] {
"Audio", "Uri", "AllowPlaybackInterruption", "Content",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(4);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_descriptor,
new java.lang.String[] {
"PhoneNumber", "SipUri", "Endpoint",
});
com.google.protobuf.ExtensionRegistry registry =
com.google.protobuf.ExtensionRegistry.newInstance();
registry.add(com.google.api.ClientProto.defaultHost);
registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
registry.add(com.google.api.AnnotationsProto.http);
registry.add(com.google.api.ClientProto.methodSignature);
registry.add(com.google.api.ClientProto.oauthScopes);
registry.add(com.google.api.ResourceProto.resource);
registry.add(com.google.api.ResourceProto.resourceReference);
com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
descriptor, registry);
com.google.api.AnnotationsProto.getDescriptor();
com.google.api.ClientProto.getDescriptor();
com.google.api.FieldBehaviorProto.getDescriptor();
com.google.api.ResourceProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.AudioConfigProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.SessionProto.getDescriptor();
com.google.protobuf.FieldMaskProto.getDescriptor();
com.google.protobuf.StructProto.getDescriptor();
com.google.protobuf.TimestampProto.getDescriptor();
com.google.rpc.StatusProto.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| UTF-8 | Java | 79,615 | java | ParticipantProto.java | Java | [] | null | [] | /*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/participant.proto
package com.google.cloud.dialogflow.v2beta1;
public final class ParticipantProto {
private ParticipantProto() {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Participant_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Message_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Message_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
static {
java.lang.String[] descriptorData = {
"\n1google/cloud/dialogflow/v2beta1/partic"
+ "ipant.proto\022\037google.cloud.dialogflow.v2b"
+ "eta1\032\034google/api/annotations.proto\032\027goog"
+ "le/api/client.proto\032\037google/api/field_be"
+ "havior.proto\032\031google/api/resource.proto\032"
+ "2google/cloud/dialogflow/v2beta1/audio_c"
+ "onfig.proto\032-google/cloud/dialogflow/v2b"
+ "eta1/session.proto\032 google/protobuf/fiel"
+ "d_mask.proto\032\034google/protobuf/struct.pro"
+ "to\032\037google/protobuf/timestamp.proto\032\027goo"
+ "gle/rpc/status.proto\"\367\004\n\013Participant\022\022\n\004"
+ "name\030\001 \001(\tB\004\342A\001\001\022E\n\004role\030\002 \001(\01621.google."
+ "cloud.dialogflow.v2beta1.Participant.Rol"
+ "eB\004\342A\001\005\022)\n\033obfuscated_external_user_id\030\007"
+ " \001(\tB\004\342A\001\001\022t\n\032documents_metadata_filters"
+ "\030\010 \003(\0132J.google.cloud.dialogflow.v2beta1"
+ ".Participant.DocumentsMetadataFiltersEnt"
+ "ryB\004\342A\001\001\032?\n\035DocumentsMetadataFiltersEntr"
+ "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"P\n\004Rol"
+ "e\022\024\n\020ROLE_UNSPECIFIED\020\000\022\017\n\013HUMAN_AGENT\020\001"
+ "\022\023\n\017AUTOMATED_AGENT\020\002\022\014\n\010END_USER\020\003:\330\001\352A"
+ "\324\001\n%dialogflow.googleapis.com/Participan"
+ "t\022Jprojects/{project}/conversations/{con"
+ "versation}/participants/{participant}\022_p"
+ "rojects/{project}/locations/{location}/c"
+ "onversations/{conversation}/participants"
+ "/{participant}\"\244\005\n\007Message\022\022\n\004name\030\001 \001(\t"
+ "B\004\342A\001\001\022\025\n\007content\030\002 \001(\tB\004\342A\001\002\022\033\n\rlanguag"
+ "e_code\030\003 \001(\tB\004\342A\001\001\022\031\n\013participant\030\004 \001(\tB"
+ "\004\342A\001\003\022Q\n\020participant_role\030\005 \001(\01621.google"
+ ".cloud.dialogflow.v2beta1.Participant.Ro"
+ "leB\004\342A\001\003\0225\n\013create_time\030\006 \001(\0132\032.google.p"
+ "rotobuf.TimestampB\004\342A\001\003\0223\n\tsend_time\030\t \001"
+ "(\0132\032.google.protobuf.TimestampB\004\342A\001\001\022T\n\022"
+ "message_annotation\030\007 \001(\01322.google.cloud."
+ "dialogflow.v2beta1.MessageAnnotationB\004\342A"
+ "\001\003\022Z\n\022sentiment_analysis\030\010 \001(\01328.google."
+ "cloud.dialogflow.v2beta1.SentimentAnalys"
+ "isResultB\004\342A\001\003:\304\001\352A\300\001\n!dialogflow.google"
+ "apis.com/Message\022Bprojects/{project}/con"
+ "versations/{conversation}/messages/{mess"
+ "age}\022Wprojects/{project}/locations/{loca"
+ "tion}/conversations/{conversation}/messa"
+ "ges/{message}\"\243\001\n\030CreateParticipantReque"
+ "st\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\022%dialogflow."
+ "googleapis.com/Participant\022G\n\013participan"
+ "t\030\002 \001(\0132,.google.cloud.dialogflow.v2beta"
+ "1.ParticipantB\004\342A\001\002\"U\n\025GetParticipantReq"
+ "uest\022<\n\004name\030\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow."
+ "googleapis.com/Participant\"\214\001\n\027ListParti"
+ "cipantsRequest\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\022"
+ "%dialogflow.googleapis.com/Participant\022\027"
+ "\n\tpage_size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\003 "
+ "\001(\tB\004\342A\001\001\"w\n\030ListParticipantsResponse\022B\n"
+ "\014participants\030\001 \003(\0132,.google.cloud.dialo"
+ "gflow.v2beta1.Participant\022\027\n\017next_page_t"
+ "oken\030\002 \001(\t\"\232\001\n\030UpdateParticipantRequest\022"
+ "G\n\013participant\030\001 \001(\0132,.google.cloud.dial"
+ "ogflow.v2beta1.ParticipantB\004\342A\001\002\0225\n\013upda"
+ "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas"
+ "kB\004\342A\001\002\"^\n\nAudioInput\022A\n\006config\030\001 \001(\01321."
+ "google.cloud.dialogflow.v2beta1.InputAud"
+ "ioConfig\022\r\n\005audio\030\002 \001(\014\"`\n\013OutputAudio\022B"
+ "\n\006config\030\001 \001(\01322.google.cloud.dialogflow"
+ ".v2beta1.OutputAudioConfig\022\r\n\005audio\030\002 \001("
+ "\014\"\243\005\n\023AutomatedAgentReply\022W\n\026detect_inte"
+ "nt_response\030\001 \001(\01325.google.cloud.dialogf"
+ "low.v2beta1.DetectIntentResponseH\000\022K\n\021re"
+ "sponse_messages\030\003 \003(\01320.google.cloud.dia"
+ "logflow.v2beta1.ResponseMessage\0227\n\006inten"
+ "t\030\004 \001(\tB%\372A\"\n dialogflow.googleapis.com/"
+ "IntentH\001\022\017\n\005event\030\005 \001(\tH\001\022\030\n\020match_confi"
+ "dence\030\t \001(\002\022+\n\nparameters\030\n \001(\0132\027.google"
+ ".protobuf.Struct\022:\n\025cx_session_parameter"
+ "s\030\006 \001(\0132\027.google.protobuf.StructB\002\030\001\022p\n\032"
+ "automated_agent_reply_type\030\007 \001(\0162L.googl"
+ "e.cloud.dialogflow.v2beta1.AutomatedAgen"
+ "tReply.AutomatedAgentReplyType\022\032\n\022allow_"
+ "cancellation\030\010 \001(\010\022\027\n\017cx_current_page\030\013 "
+ "\001(\t\"]\n\027AutomatedAgentReplyType\022*\n&AUTOMA"
+ "TED_AGENT_REPLY_TYPE_UNSPECIFIED\020\000\022\013\n\007PA"
+ "RTIAL\020\001\022\t\n\005FINAL\020\002B\n\n\010responseB\007\n\005match\""
+ "\334\001\n\017SuggestionInput\022\025\n\ranswer_record\030\001 \001"
+ "(\t\022A\n\rtext_override\030\002 \001(\0132*.google.cloud"
+ ".dialogflow.v2beta1.TextInput\022+\n\nparamet"
+ "ers\030\004 \001(\0132\027.google.protobuf.Struct\022B\n\014in"
+ "tent_input\030\006 \001(\0132,.google.cloud.dialogfl"
+ "ow.v2beta1.IntentInput\"@\n\013IntentInput\022\024\n"
+ "\006intent\030\001 \001(\tB\004\342A\001\002\022\033\n\rlanguage_code\030\003 \001"
+ "(\tB\004\342A\001\002\"\342\001\n\021SuggestionFeature\022E\n\004type\030\001"
+ " \001(\01627.google.cloud.dialogflow.v2beta1.S"
+ "uggestionFeature.Type\"\205\001\n\004Type\022\024\n\020TYPE_U"
+ "NSPECIFIED\020\000\022\026\n\022ARTICLE_SUGGESTION\020\001\022\007\n\003"
+ "FAQ\020\002\022\017\n\013SMART_REPLY\020\003\022\025\n\021DIALOGFLOW_ASS"
+ "IST\020\004\022\036\n\032CONVERSATION_SUMMARIZATION\020\010\"\322\001"
+ "\n\025AssistQueryParameters\022x\n\032documents_met"
+ "adata_filters\030\001 \003(\0132T.google.cloud.dialo"
+ "gflow.v2beta1.AssistQueryParameters.Docu"
+ "mentsMetadataFiltersEntry\032?\n\035DocumentsMe"
+ "tadataFiltersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value"
+ "\030\002 \001(\t:\0028\001\"\376\005\n\025AnalyzeContentRequest\022C\n\013"
+ "participant\030\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow.g"
+ "oogleapis.com/Participant\022@\n\ntext_input\030"
+ "\006 \001(\0132*.google.cloud.dialogflow.v2beta1."
+ "TextInputH\000\022B\n\013audio_input\030\007 \001(\0132+.googl"
+ "e.cloud.dialogflow.v2beta1.AudioInputH\000\022"
+ "B\n\013event_input\030\010 \001(\0132+.google.cloud.dial"
+ "ogflow.v2beta1.EventInputH\000\022L\n\020suggestio"
+ "n_input\030\014 \001(\01320.google.cloud.dialogflow."
+ "v2beta1.SuggestionInputH\000\022N\n\022reply_audio"
+ "_config\030\005 \001(\01322.google.cloud.dialogflow."
+ "v2beta1.OutputAudioConfig\022F\n\014query_param"
+ "s\030\t \001(\01320.google.cloud.dialogflow.v2beta"
+ "1.QueryParameters\022S\n\023assist_query_params"
+ "\030\016 \001(\01326.google.cloud.dialogflow.v2beta1"
+ ".AssistQueryParameters\022.\n\rcx_parameters\030"
+ "\022 \001(\0132\027.google.protobuf.Struct\022\027\n\017cx_cur"
+ "rent_page\030\024 \001(\t\0225\n\021message_send_time\030\n \001"
+ "(\0132\032.google.protobuf.Timestamp\022\022\n\nreques"
+ "t_id\030\013 \001(\tB\007\n\005input\",\n\016DtmfParameters\022\032\n"
+ "\022accepts_dtmf_input\030\001 \001(\010\"\374\003\n\026AnalyzeCon"
+ "tentResponse\022\022\n\nreply_text\030\001 \001(\t\022A\n\013repl"
+ "y_audio\030\002 \001(\0132,.google.cloud.dialogflow."
+ "v2beta1.OutputAudio\022S\n\025automated_agent_r"
+ "eply\030\003 \001(\01324.google.cloud.dialogflow.v2b"
+ "eta1.AutomatedAgentReply\0229\n\007message\030\005 \001("
+ "\0132(.google.cloud.dialogflow.v2beta1.Mess"
+ "age\022Y\n\036human_agent_suggestion_results\030\006 "
+ "\003(\01321.google.cloud.dialogflow.v2beta1.Su"
+ "ggestionResult\022V\n\033end_user_suggestion_re"
+ "sults\030\007 \003(\01321.google.cloud.dialogflow.v2"
+ "beta1.SuggestionResult\022H\n\017dtmf_parameter"
+ "s\030\t \001(\0132/.google.cloud.dialogflow.v2beta"
+ "1.DtmfParameters\"(\n\017InputTextConfig\022\025\n\rl"
+ "anguage_code\030\001 \001(\t\"\210\006\n\036StreamingAnalyzeC"
+ "ontentRequest\022C\n\013participant\030\001 \001(\tB.\342A\001\002"
+ "\372A\'\n%dialogflow.googleapis.com/Participa"
+ "nt\022I\n\014audio_config\030\002 \001(\01321.google.cloud."
+ "dialogflow.v2beta1.InputAudioConfigH\000\022G\n"
+ "\013text_config\030\003 \001(\01320.google.cloud.dialog"
+ "flow.v2beta1.InputTextConfigH\000\022N\n\022reply_"
+ "audio_config\030\004 \001(\01322.google.cloud.dialog"
+ "flow.v2beta1.OutputAudioConfig\022\025\n\013input_"
+ "audio\030\005 \001(\014H\001\022\024\n\ninput_text\030\006 \001(\tH\001\022J\n\ni"
+ "nput_dtmf\030\t \001(\01324.google.cloud.dialogflo"
+ "w.v2beta1.TelephonyDtmfEventsH\001\022F\n\014query"
+ "_params\030\007 \001(\01320.google.cloud.dialogflow."
+ "v2beta1.QueryParameters\022S\n\023assist_query_"
+ "params\030\010 \001(\01326.google.cloud.dialogflow.v"
+ "2beta1.AssistQueryParameters\022.\n\rcx_param"
+ "eters\030\r \001(\0132\027.google.protobuf.Struct\022\027\n\017"
+ "cx_current_page\030\017 \001(\t\022,\n$enable_partial_"
+ "automated_agent_reply\030\014 \001(\010\022\035\n\025enable_de"
+ "bugging_info\030\023 \001(\010B\010\n\006configB\007\n\005input\"\267\005"
+ "\n\037StreamingAnalyzeContentResponse\022W\n\022rec"
+ "ognition_result\030\001 \001(\0132;.google.cloud.dia"
+ "logflow.v2beta1.StreamingRecognitionResu"
+ "lt\022\022\n\nreply_text\030\002 \001(\t\022A\n\013reply_audio\030\003 "
+ "\001(\0132,.google.cloud.dialogflow.v2beta1.Ou"
+ "tputAudio\022S\n\025automated_agent_reply\030\004 \001(\013"
+ "24.google.cloud.dialogflow.v2beta1.Autom"
+ "atedAgentReply\0229\n\007message\030\006 \001(\0132(.google"
+ ".cloud.dialogflow.v2beta1.Message\022Y\n\036hum"
+ "an_agent_suggestion_results\030\007 \003(\01321.goog"
+ "le.cloud.dialogflow.v2beta1.SuggestionRe"
+ "sult\022V\n\033end_user_suggestion_results\030\010 \003("
+ "\01321.google.cloud.dialogflow.v2beta1.Sugg"
+ "estionResult\022H\n\017dtmf_parameters\030\n \001(\0132/."
+ "google.cloud.dialogflow.v2beta1.DtmfPara"
+ "meters\022W\n\016debugging_info\030\013 \001(\0132?.google."
+ "cloud.dialogflow.v2beta1.CloudConversati"
+ "onDebuggingInfo\"j\n\024AnnotatedMessagePart\022"
+ "\014\n\004text\030\001 \001(\t\022\023\n\013entity_type\030\002 \001(\t\022/\n\017fo"
+ "rmatted_value\030\003 \001(\0132\026.google.protobuf.Va"
+ "lue\"s\n\021MessageAnnotation\022D\n\005parts\030\001 \003(\0132"
+ "5.google.cloud.dialogflow.v2beta1.Annota"
+ "tedMessagePart\022\030\n\020contain_entities\030\002 \001(\010"
+ "\"\325\001\n\rArticleAnswer\022\r\n\005title\030\001 \001(\t\022\013\n\003uri"
+ "\030\002 \001(\t\022\020\n\010snippets\030\003 \003(\t\022N\n\010metadata\030\005 \003"
+ "(\0132<.google.cloud.dialogflow.v2beta1.Art"
+ "icleAnswer.MetadataEntry\022\025\n\ranswer_recor"
+ "d\030\006 \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n"
+ "\005value\030\002 \001(\t:\0028\001\"\345\001\n\tFaqAnswer\022\016\n\006answer"
+ "\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\022\020\n\010question\030\003"
+ " \001(\t\022\016\n\006source\030\004 \001(\t\022J\n\010metadata\030\005 \003(\01328"
+ ".google.cloud.dialogflow.v2beta1.FaqAnsw"
+ "er.MetadataEntry\022\025\n\ranswer_record\030\006 \001(\t\032"
+ "/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002"
+ " \001(\t:\0028\001\"y\n\020SmartReplyAnswer\022\r\n\005reply\030\001 "
+ "\001(\t\022\022\n\nconfidence\030\002 \001(\002\022B\n\ranswer_record"
+ "\030\003 \001(\tB+\372A(\n&dialogflow.googleapis.com/A"
+ "nswerRecord\"\\\n\020IntentSuggestion\022\024\n\014displ"
+ "ay_name\030\001 \001(\t\022\023\n\tintent_v2\030\002 \001(\tH\000\022\023\n\013de"
+ "scription\030\005 \001(\tB\010\n\006intent\"\317\001\n\026Dialogflow"
+ "AssistAnswer\022D\n\014query_result\030\001 \001(\0132,.goo"
+ "gle.cloud.dialogflow.v2beta1.QueryResult"
+ "H\000\022N\n\021intent_suggestion\030\005 \001(\01321.google.c"
+ "loud.dialogflow.v2beta1.IntentSuggestion"
+ "H\000\022\025\n\ranswer_record\030\002 \001(\tB\010\n\006result\"\334\004\n\020"
+ "SuggestionResult\022#\n\005error\030\001 \001(\0132\022.google"
+ ".rpc.StatusH\000\022]\n\031suggest_articles_respon"
+ "se\030\002 \001(\01328.google.cloud.dialogflow.v2bet"
+ "a1.SuggestArticlesResponseH\000\022b\n\034suggest_"
+ "faq_answers_response\030\003 \001(\0132:.google.clou"
+ "d.dialogflow.v2beta1.SuggestFaqAnswersRe"
+ "sponseH\000\022f\n\036suggest_smart_replies_respon"
+ "se\030\004 \001(\0132<.google.cloud.dialogflow.v2bet"
+ "a1.SuggestSmartRepliesResponseH\000\022p\n#sugg"
+ "est_dialogflow_assists_response\030\005 \001(\0132A."
+ "google.cloud.dialogflow.v2beta1.SuggestD"
+ "ialogflowAssistsResponseH\000\022o\n\"suggest_en"
+ "tity_extraction_response\030\007 \001(\0132A.google."
+ "cloud.dialogflow.v2beta1.SuggestDialogfl"
+ "owAssistsResponseH\000B\025\n\023suggestion_respon"
+ "se\"\223\002\n\026SuggestArticlesRequest\022>\n\006parent\030"
+ "\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow.googleapis.co"
+ "m/Participant\022B\n\016latest_message\030\002 \001(\tB*\342"
+ "A\001\001\372A#\n!dialogflow.googleapis.com/Messag"
+ "e\022\032\n\014context_size\030\003 \001(\005B\004\342A\001\001\022Y\n\023assist_"
+ "query_params\030\004 \001(\01326.google.cloud.dialog"
+ "flow.v2beta1.AssistQueryParametersB\004\342A\001\001"
+ "\"\220\001\n\027SuggestArticlesResponse\022G\n\017article_"
+ "answers\030\001 \003(\0132..google.cloud.dialogflow."
+ "v2beta1.ArticleAnswer\022\026\n\016latest_message\030"
+ "\002 \001(\t\022\024\n\014context_size\030\003 \001(\005\"\225\002\n\030SuggestF"
+ "aqAnswersRequest\022>\n\006parent\030\001 \001(\tB.\342A\001\002\372A"
+ "\'\n%dialogflow.googleapis.com/Participant"
+ "\022B\n\016latest_message\030\002 \001(\tB*\342A\001\001\372A#\n!dialo"
+ "gflow.googleapis.com/Message\022\032\n\014context_"
+ "size\030\003 \001(\005B\004\342A\001\001\022Y\n\023assist_query_params\030"
+ "\004 \001(\01326.google.cloud.dialogflow.v2beta1."
+ "AssistQueryParametersB\004\342A\001\001\"\212\001\n\031SuggestF"
+ "aqAnswersResponse\022?\n\013faq_answers\030\001 \003(\0132*"
+ ".google.cloud.dialogflow.v2beta1.FaqAnsw"
+ "er\022\026\n\016latest_message\030\002 \001(\t\022\024\n\014context_si"
+ "ze\030\003 \001(\005\"\372\001\n\032SuggestSmartRepliesRequest\022"
+ ">\n\006parent\030\001 \001(\tB.\342A\001\002\372A\'\n%dialogflow.goo"
+ "gleapis.com/Participant\022F\n\022current_text_"
+ "input\030\004 \001(\0132*.google.cloud.dialogflow.v2"
+ "beta1.TextInput\022>\n\016latest_message\030\002 \001(\tB"
+ "&\372A#\n!dialogflow.googleapis.com/Message\022"
+ "\024\n\014context_size\030\003 \001(\005\"\303\001\n\033SuggestSmartRe"
+ "pliesResponse\022N\n\023smart_reply_answers\030\001 \003"
+ "(\01321.google.cloud.dialogflow.v2beta1.Sma"
+ "rtReplyAnswer\022>\n\016latest_message\030\002 \001(\tB&\372"
+ "A#\n!dialogflow.googleapis.com/Message\022\024\n"
+ "\014context_size\030\003 \001(\005\"\254\001\n SuggestDialogflo"
+ "wAssistsResponse\022Z\n\031dialogflow_assist_an"
+ "swers\030\001 \003(\01327.google.cloud.dialogflow.v2"
+ "beta1.DialogflowAssistAnswer\022\026\n\016latest_m"
+ "essage\030\002 \001(\t\022\024\n\014context_size\030\003 \001(\005\"\304\005\n\nS"
+ "uggestion\022\014\n\004name\030\001 \001(\t\022E\n\010articles\030\002 \003("
+ "\01323.google.cloud.dialogflow.v2beta1.Sugg"
+ "estion.Article\022J\n\013faq_answers\030\004 \003(\01325.go"
+ "ogle.cloud.dialogflow.v2beta1.Suggestion"
+ ".FaqAnswer\022/\n\013create_time\030\005 \001(\0132\032.google"
+ ".protobuf.Timestamp\022\026\n\016latest_message\030\007 "
+ "\001(\t\032\324\001\n\007Article\022\r\n\005title\030\001 \001(\t\022\013\n\003uri\030\002 "
+ "\001(\t\022\020\n\010snippets\030\003 \003(\t\022S\n\010metadata\030\005 \003(\0132"
+ "A.google.cloud.dialogflow.v2beta1.Sugges"
+ "tion.Article.MetadataEntry\022\025\n\ranswer_rec"
+ "ord\030\006 \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022"
+ "\r\n\005value\030\002 \001(\t:\0028\001\032\360\001\n\tFaqAnswer\022\016\n\006answ"
+ "er\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\022\020\n\010question"
+ "\030\003 \001(\t\022\016\n\006source\030\004 \001(\t\022U\n\010metadata\030\005 \003(\013"
+ "2C.google.cloud.dialogflow.v2beta1.Sugge"
+ "stion.FaqAnswer.MetadataEntry\022\025\n\ranswer_"
+ "record\030\006 \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001"
+ "(\t\022\r\n\005value\030\002 \001(\t:\0028\001:\002\030\001\"c\n\026ListSuggest"
+ "ionsRequest\022\016\n\006parent\030\001 \001(\t\022\021\n\tpage_size"
+ "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\016\n\006filter\030\004 \001"
+ "(\t:\002\030\001\"x\n\027ListSuggestionsResponse\022@\n\013sug"
+ "gestions\030\001 \003(\0132+.google.cloud.dialogflow"
+ ".v2beta1.Suggestion\022\027\n\017next_page_token\030\002"
+ " \001(\t:\002\030\001\"\\\n\030CompileSuggestionRequest\022\016\n\006"
+ "parent\030\001 \001(\t\022\026\n\016latest_message\030\002 \001(\t\022\024\n\014"
+ "context_size\030\003 \001(\005:\002\030\001\"\216\001\n\031CompileSugges"
+ "tionResponse\022?\n\nsuggestion\030\001 \001(\0132+.googl"
+ "e.cloud.dialogflow.v2beta1.Suggestion\022\026\n"
+ "\016latest_message\030\002 \001(\t\022\024\n\014context_size\030\003 "
+ "\001(\005:\002\030\001\"\203\007\n\017ResponseMessage\022E\n\004text\030\001 \001("
+ "\01325.google.cloud.dialogflow.v2beta1.Resp"
+ "onseMessage.TextH\000\022*\n\007payload\030\002 \001(\0132\027.go"
+ "ogle.protobuf.StructH\000\022_\n\022live_agent_han"
+ "doff\030\003 \001(\0132A.google.cloud.dialogflow.v2b"
+ "eta1.ResponseMessage.LiveAgentHandoffH\000\022"
+ "Z\n\017end_interaction\030\004 \001(\0132?.google.cloud."
+ "dialogflow.v2beta1.ResponseMessage.EndIn"
+ "teractionH\000\022R\n\013mixed_audio\030\005 \001(\0132;.googl"
+ "e.cloud.dialogflow.v2beta1.ResponseMessa"
+ "ge.MixedAudioH\000\022i\n\027telephony_transfer_ca"
+ "ll\030\006 \001(\0132F.google.cloud.dialogflow.v2bet"
+ "a1.ResponseMessage.TelephonyTransferCall"
+ "H\000\032\024\n\004Text\022\014\n\004text\030\001 \003(\t\032=\n\020LiveAgentHan"
+ "doff\022)\n\010metadata\030\001 \001(\0132\027.google.protobuf"
+ ".Struct\032\020\n\016EndInteraction\032\276\001\n\nMixedAudio"
+ "\022U\n\010segments\030\001 \003(\0132C.google.cloud.dialog"
+ "flow.v2beta1.ResponseMessage.MixedAudio."
+ "Segment\032Y\n\007Segment\022\017\n\005audio\030\001 \001(\014H\000\022\r\n\003u"
+ "ri\030\002 \001(\tH\000\022#\n\033allow_playback_interruptio"
+ "n\030\003 \001(\010B\t\n\007content\032N\n\025TelephonyTransferC"
+ "all\022\026\n\014phone_number\030\001 \001(\tH\000\022\021\n\007sip_uri\030\002"
+ " \001(\tH\000B\n\n\010endpointB\t\n\007message2\207\033\n\014Partic"
+ "ipants\022\271\002\n\021CreateParticipant\0229.google.cl"
+ "oud.dialogflow.v2beta1.CreateParticipant"
+ "Request\032,.google.cloud.dialogflow.v2beta"
+ "1.Participant\"\272\001\332A\022parent,participant\202\323\344"
+ "\223\002\236\001\"9/v2beta1/{parent=projects/*/conver"
+ "sations/*}/participants:\013participantZT\"E"
+ "/v2beta1/{parent=projects/*/locations/*/"
+ "conversations/*}/participants:\013participa"
+ "nt\022\213\002\n\016GetParticipant\0226.google.cloud.dia"
+ "logflow.v2beta1.GetParticipantRequest\032,."
+ "google.cloud.dialogflow.v2beta1.Particip"
+ "ant\"\222\001\332A\004name\202\323\344\223\002\204\001\0229/v2beta1/{name=pro"
+ "jects/*/conversations/*/participants/*}Z"
+ "G\022E/v2beta1/{name=projects/*/locations/*"
+ "/conversations/*/participants/*}\022\236\002\n\020Lis"
+ "tParticipants\0228.google.cloud.dialogflow."
+ "v2beta1.ListParticipantsRequest\0329.google"
+ ".cloud.dialogflow.v2beta1.ListParticipan"
+ "tsResponse\"\224\001\332A\006parent\202\323\344\223\002\204\001\0229/v2beta1/"
+ "{parent=projects/*/conversations/*}/part"
+ "icipantsZG\022E/v2beta1/{parent=projects/*/"
+ "locations/*/conversations/*}/participant"
+ "s\022\326\002\n\021UpdateParticipant\0229.google.cloud.d"
+ "ialogflow.v2beta1.UpdateParticipantReque"
+ "st\032,.google.cloud.dialogflow.v2beta1.Par"
+ "ticipant\"\327\001\332A\027participant,update_mask\202\323\344"
+ "\223\002\266\0012E/v2beta1/{participant.name=project"
+ "s/*/conversations/*/participants/*}:\013par"
+ "ticipantZ`2Q/v2beta1/{participant.name=p"
+ "rojects/*/locations/*/conversations/*/pa"
+ "rticipants/*}:\013participant\022\216\003\n\016AnalyzeCo"
+ "ntent\0226.google.cloud.dialogflow.v2beta1."
+ "AnalyzeContentRequest\0327.google.cloud.dia"
+ "logflow.v2beta1.AnalyzeContentResponse\"\212"
+ "\002\332A\026participant,text_input\332A\027participant"
+ ",audio_input\332A\027participant,event_input\202\323"
+ "\344\223\002\266\001\"O/v2beta1/{participant=projects/*/"
+ "conversations/*/participants/*}:analyzeC"
+ "ontent:\001*Z`\"[/v2beta1/{participant=proje"
+ "cts/*/locations/*/conversations/*/partic"
+ "ipants/*}:analyzeContent:\001*\022\242\001\n\027Streamin"
+ "gAnalyzeContent\022?.google.cloud.dialogflo"
+ "w.v2beta1.StreamingAnalyzeContentRequest"
+ "\032@.google.cloud.dialogflow.v2beta1.Strea"
+ "mingAnalyzeContentResponse\"\000(\0010\001\022\335\002\n\017Sug"
+ "gestArticles\0227.google.cloud.dialogflow.v"
+ "2beta1.SuggestArticlesRequest\0328.google.c"
+ "loud.dialogflow.v2beta1.SuggestArticlesR"
+ "esponse\"\326\001\332A\006parent\202\323\344\223\002\306\001\"W/v2beta1/{pa"
+ "rent=projects/*/conversations/*/particip"
+ "ants/*}/suggestions:suggestArticles:\001*Zh"
+ "\"c/v2beta1/{parent=projects/*/locations/"
+ "*/conversations/*/participants/*}/sugges"
+ "tions:suggestArticles:\001*\022\347\002\n\021SuggestFaqA"
+ "nswers\0229.google.cloud.dialogflow.v2beta1"
+ ".SuggestFaqAnswersRequest\032:.google.cloud"
+ ".dialogflow.v2beta1.SuggestFaqAnswersRes"
+ "ponse\"\332\001\332A\006parent\202\323\344\223\002\312\001\"Y/v2beta1/{pare"
+ "nt=projects/*/conversations/*/participan"
+ "ts/*}/suggestions:suggestFaqAnswers:\001*Zj"
+ "\"e/v2beta1/{parent=projects/*/locations/"
+ "*/conversations/*/participants/*}/sugges"
+ "tions:suggestFaqAnswers:\001*\022\361\002\n\023SuggestSm"
+ "artReplies\022;.google.cloud.dialogflow.v2b"
+ "eta1.SuggestSmartRepliesRequest\032<.google"
+ ".cloud.dialogflow.v2beta1.SuggestSmartRe"
+ "pliesResponse\"\336\001\332A\006parent\202\323\344\223\002\316\001\"[/v2bet"
+ "a1/{parent=projects/*/conversations/*/pa"
+ "rticipants/*}/suggestions:suggestSmartRe"
+ "plies:\001*Zl\"g/v2beta1/{parent=projects/*/"
+ "locations/*/conversations/*/participants"
+ "/*}/suggestions:suggestSmartReplies:\001*\022\330"
+ "\001\n\017ListSuggestions\0227.google.cloud.dialog"
+ "flow.v2beta1.ListSuggestionsRequest\0328.go"
+ "ogle.cloud.dialogflow.v2beta1.ListSugges"
+ "tionsResponse\"R\210\002\001\202\323\344\223\002I\022G/v2beta1/{pare"
+ "nt=projects/*/conversations/*/participan"
+ "ts/*}/suggestions\022\351\001\n\021CompileSuggestion\022"
+ "9.google.cloud.dialogflow.v2beta1.Compil"
+ "eSuggestionRequest\032:.google.cloud.dialog"
+ "flow.v2beta1.CompileSuggestionResponse\"]"
+ "\210\002\001\202\323\344\223\002T\"O/v2beta1/{parent=projects/*/c"
+ "onversations/*/participants/*}/suggestio"
+ "ns:compile:\001*\032x\312A\031dialogflow.googleapis."
+ "com\322AYhttps://www.googleapis.com/auth/cl"
+ "oud-platform,https://www.googleapis.com/"
+ "auth/dialogflowB\250\001\n#com.google.cloud.dia"
+ "logflow.v2beta1B\020ParticipantProtoP\001ZCclo"
+ "ud.google.com/go/dialogflow/apiv2beta1/d"
+ "ialogflowpb;dialogflowpb\370\001\001\242\002\002DF\252\002\037Googl"
+ "e.Cloud.Dialogflow.V2Beta1b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.api.AnnotationsProto.getDescriptor(),
com.google.api.ClientProto.getDescriptor(),
com.google.api.FieldBehaviorProto.getDescriptor(),
com.google.api.ResourceProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.AudioConfigProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.SessionProto.getDescriptor(),
com.google.protobuf.FieldMaskProto.getDescriptor(),
com.google.protobuf.StructProto.getDescriptor(),
com.google.protobuf.TimestampProto.getDescriptor(),
com.google.rpc.StatusProto.getDescriptor(),
});
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_google_cloud_dialogflow_v2beta1_Participant_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor,
new java.lang.String[] {
"Name", "Role", "ObfuscatedExternalUserId", "DocumentsMetadataFilters",
});
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Participant_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Participant_DocumentsMetadataFiltersEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_Message_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_google_cloud_dialogflow_v2beta1_Message_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Message_descriptor,
new java.lang.String[] {
"Name",
"Content",
"LanguageCode",
"Participant",
"ParticipantRole",
"CreateTime",
"SendTime",
"MessageAnnotation",
"SentimentAnalysis",
});
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_CreateParticipantRequest_descriptor,
new java.lang.String[] {
"Parent", "Participant",
});
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_GetParticipantRequest_descriptor,
new java.lang.String[] {
"Name",
});
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsRequest_descriptor,
new java.lang.String[] {
"Parent", "PageSize", "PageToken",
});
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListParticipantsResponse_descriptor,
new java.lang.String[] {
"Participants", "NextPageToken",
});
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_UpdateParticipantRequest_descriptor,
new java.lang.String[] {
"Participant", "UpdateMask",
});
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AudioInput_descriptor,
new java.lang.String[] {
"Config", "Audio",
});
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_descriptor =
getDescriptor().getMessageTypes().get(8);
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_OutputAudio_descriptor,
new java.lang.String[] {
"Config", "Audio",
});
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_descriptor =
getDescriptor().getMessageTypes().get(9);
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AutomatedAgentReply_descriptor,
new java.lang.String[] {
"DetectIntentResponse",
"ResponseMessages",
"Intent",
"Event",
"MatchConfidence",
"Parameters",
"CxSessionParameters",
"AutomatedAgentReplyType",
"AllowCancellation",
"CxCurrentPage",
"Response",
"Match",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_descriptor =
getDescriptor().getMessageTypes().get(10);
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestionInput_descriptor,
new java.lang.String[] {
"AnswerRecord", "TextOverride", "Parameters", "IntentInput",
});
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_descriptor =
getDescriptor().getMessageTypes().get(11);
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_IntentInput_descriptor,
new java.lang.String[] {
"Intent", "LanguageCode",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_descriptor =
getDescriptor().getMessageTypes().get(12);
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestionFeature_descriptor,
new java.lang.String[] {
"Type",
});
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor =
getDescriptor().getMessageTypes().get(13);
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor,
new java.lang.String[] {
"DocumentsMetadataFilters",
});
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AssistQueryParameters_DocumentsMetadataFiltersEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_descriptor =
getDescriptor().getMessageTypes().get(14);
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentRequest_descriptor,
new java.lang.String[] {
"Participant",
"TextInput",
"AudioInput",
"EventInput",
"SuggestionInput",
"ReplyAudioConfig",
"QueryParams",
"AssistQueryParams",
"CxParameters",
"CxCurrentPage",
"MessageSendTime",
"RequestId",
"Input",
});
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_descriptor =
getDescriptor().getMessageTypes().get(15);
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_DtmfParameters_descriptor,
new java.lang.String[] {
"AcceptsDtmfInput",
});
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_descriptor =
getDescriptor().getMessageTypes().get(16);
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AnalyzeContentResponse_descriptor,
new java.lang.String[] {
"ReplyText",
"ReplyAudio",
"AutomatedAgentReply",
"Message",
"HumanAgentSuggestionResults",
"EndUserSuggestionResults",
"DtmfParameters",
});
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_descriptor =
getDescriptor().getMessageTypes().get(17);
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_InputTextConfig_descriptor,
new java.lang.String[] {
"LanguageCode",
});
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_descriptor =
getDescriptor().getMessageTypes().get(18);
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentRequest_descriptor,
new java.lang.String[] {
"Participant",
"AudioConfig",
"TextConfig",
"ReplyAudioConfig",
"InputAudio",
"InputText",
"InputDtmf",
"QueryParams",
"AssistQueryParams",
"CxParameters",
"CxCurrentPage",
"EnablePartialAutomatedAgentReply",
"EnableDebuggingInfo",
"Config",
"Input",
});
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_descriptor =
getDescriptor().getMessageTypes().get(19);
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_StreamingAnalyzeContentResponse_descriptor,
new java.lang.String[] {
"RecognitionResult",
"ReplyText",
"ReplyAudio",
"AutomatedAgentReply",
"Message",
"HumanAgentSuggestionResults",
"EndUserSuggestionResults",
"DtmfParameters",
"DebuggingInfo",
});
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_descriptor =
getDescriptor().getMessageTypes().get(20);
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_AnnotatedMessagePart_descriptor,
new java.lang.String[] {
"Text", "EntityType", "FormattedValue",
});
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_descriptor =
getDescriptor().getMessageTypes().get(21);
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_MessageAnnotation_descriptor,
new java.lang.String[] {
"Parts", "ContainEntities",
});
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor =
getDescriptor().getMessageTypes().get(22);
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor,
new java.lang.String[] {
"Title", "Uri", "Snippets", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ArticleAnswer_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor =
getDescriptor().getMessageTypes().get(23);
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor,
new java.lang.String[] {
"Answer", "Confidence", "Question", "Source", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_FaqAnswer_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_descriptor =
getDescriptor().getMessageTypes().get(24);
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SmartReplyAnswer_descriptor,
new java.lang.String[] {
"Reply", "Confidence", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_descriptor =
getDescriptor().getMessageTypes().get(25);
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_IntentSuggestion_descriptor,
new java.lang.String[] {
"DisplayName", "IntentV2", "Description", "Intent",
});
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_descriptor =
getDescriptor().getMessageTypes().get(26);
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_DialogflowAssistAnswer_descriptor,
new java.lang.String[] {
"QueryResult", "IntentSuggestion", "AnswerRecord", "Result",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_descriptor =
getDescriptor().getMessageTypes().get(27);
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestionResult_descriptor,
new java.lang.String[] {
"Error",
"SuggestArticlesResponse",
"SuggestFaqAnswersResponse",
"SuggestSmartRepliesResponse",
"SuggestDialogflowAssistsResponse",
"SuggestEntityExtractionResponse",
"SuggestionResponse",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_descriptor =
getDescriptor().getMessageTypes().get(28);
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesRequest_descriptor,
new java.lang.String[] {
"Parent", "LatestMessage", "ContextSize", "AssistQueryParams",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_descriptor =
getDescriptor().getMessageTypes().get(29);
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestArticlesResponse_descriptor,
new java.lang.String[] {
"ArticleAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_descriptor =
getDescriptor().getMessageTypes().get(30);
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersRequest_descriptor,
new java.lang.String[] {
"Parent", "LatestMessage", "ContextSize", "AssistQueryParams",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_descriptor =
getDescriptor().getMessageTypes().get(31);
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestFaqAnswersResponse_descriptor,
new java.lang.String[] {
"FaqAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_descriptor =
getDescriptor().getMessageTypes().get(32);
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesRequest_descriptor,
new java.lang.String[] {
"Parent", "CurrentTextInput", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_descriptor =
getDescriptor().getMessageTypes().get(33);
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestSmartRepliesResponse_descriptor,
new java.lang.String[] {
"SmartReplyAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_descriptor =
getDescriptor().getMessageTypes().get(34);
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SuggestDialogflowAssistsResponse_descriptor,
new java.lang.String[] {
"DialogflowAssistAnswers", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor =
getDescriptor().getMessageTypes().get(35);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor,
new java.lang.String[] {
"Name", "Articles", "FaqAnswers", "CreateTime", "LatestMessage",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor,
new java.lang.String[] {
"Title", "Uri", "Snippets", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_Article_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_descriptor
.getNestedTypes()
.get(1);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor,
new java.lang.String[] {
"Answer", "Confidence", "Question", "Source", "Metadata", "AnswerRecord",
});
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Suggestion_FaqAnswer_MetadataEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_descriptor =
getDescriptor().getMessageTypes().get(36);
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsRequest_descriptor,
new java.lang.String[] {
"Parent", "PageSize", "PageToken", "Filter",
});
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_descriptor =
getDescriptor().getMessageTypes().get(37);
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ListSuggestionsResponse_descriptor,
new java.lang.String[] {
"Suggestions", "NextPageToken",
});
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_descriptor =
getDescriptor().getMessageTypes().get(38);
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionRequest_descriptor,
new java.lang.String[] {
"Parent", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_descriptor =
getDescriptor().getMessageTypes().get(39);
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_CompileSuggestionResponse_descriptor,
new java.lang.String[] {
"Suggestion", "LatestMessage", "ContextSize",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor =
getDescriptor().getMessageTypes().get(40);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor,
new java.lang.String[] {
"Text",
"Payload",
"LiveAgentHandoff",
"EndInteraction",
"MixedAudio",
"TelephonyTransferCall",
"Message",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_Text_descriptor,
new java.lang.String[] {
"Text",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(1);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_LiveAgentHandoff_descriptor,
new java.lang.String[] {
"Metadata",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(2);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_EndInteraction_descriptor,
new java.lang.String[] {});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(3);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor,
new java.lang.String[] {
"Segments",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_MixedAudio_Segment_descriptor,
new java.lang.String[] {
"Audio", "Uri", "AllowPlaybackInterruption", "Content",
});
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_descriptor
.getNestedTypes()
.get(4);
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_ResponseMessage_TelephonyTransferCall_descriptor,
new java.lang.String[] {
"PhoneNumber", "SipUri", "Endpoint",
});
com.google.protobuf.ExtensionRegistry registry =
com.google.protobuf.ExtensionRegistry.newInstance();
registry.add(com.google.api.ClientProto.defaultHost);
registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
registry.add(com.google.api.AnnotationsProto.http);
registry.add(com.google.api.ClientProto.methodSignature);
registry.add(com.google.api.ClientProto.oauthScopes);
registry.add(com.google.api.ResourceProto.resource);
registry.add(com.google.api.ResourceProto.resourceReference);
com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
descriptor, registry);
com.google.api.AnnotationsProto.getDescriptor();
com.google.api.ClientProto.getDescriptor();
com.google.api.FieldBehaviorProto.getDescriptor();
com.google.api.ResourceProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.AudioConfigProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.SessionProto.getDescriptor();
com.google.protobuf.FieldMaskProto.getDescriptor();
com.google.protobuf.StructProto.getDescriptor();
com.google.protobuf.TimestampProto.getDescriptor();
com.google.rpc.StatusProto.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| 79,615 | 0.708811 | 0.625749 | 1,230 | 63.727642 | 25.075491 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444715 | false | false | 2 |
2f73ebc3c2e6c3b8db64b96c2fd3aced31866029 | 35,278,861,388,624 | 97c8b44ea1ef6819762114f723e3d7f6ba212b36 | /src/main/java/ca/courseplannerv1/model/list/CustomList.java | d912f63d234a0d50a5a11cd06f826a6c0a541794 | [] | no_license | vinsonly/cmpt213-as5 | https://github.com/vinsonly/cmpt213-as5 | 69667c6dde6d76b95d41e05ab83504e9961aec0f | fd688a350a69544197803f4b59e392d4b3200801 | refs/heads/master | 2020-03-06T20:44:44.823000 | 2018-04-08T07:55:34 | 2018-04-08T07:55:34 | 127,060,984 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ca.courseplannerv1.model.list;
import ca.courseplannerv1.model.watchers.Observer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public abstract class CustomList<T> implements Iterable<T>{
private List<T> list = new ArrayList<>();
private int numElements = 0;
//insert new obj to end of list
public void insert(T obj) {
list.add(obj);
notifyObservers(obj);
this.numElements++;
}
public void insert(int index, T obj) {
list.add(index, obj);
notifyObservers(obj);
this.numElements++;
}
//insert new obj into list, in sorted ascending order
//returns true if successful, false otherwise.
public abstract void insertSorted(T obj);
//remove obj from list at the given index
public void remove(int index) {
list.remove(index);
}
//remove obj from list
public void remove(T obj) {
list.remove(obj);
}
//retreive the obj from list at the given index
public T get(int index) {
return list.get(index);
}
//return the number of elements in the list
public int size() {
return this.numElements;
}
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public int getNumElements() {
return numElements;
}
public void setNumElements(int numElements) {
this.numElements = numElements;
}
public List<Observer> getObservers() {
return observers;
}
public void setObservers(List<Observer> observers) {
this.observers = observers;
}
public abstract void printItems();
@Override
public Iterator<T> iterator() {
return Collections.unmodifiableList(list).iterator();
}
//make observable
private List<Observer> observers = new ArrayList<>();
public void addObserver(Observer observer) {
observers.add(observer);
}
protected void notifyObservers(T obj) {
for(Observer observer : observers) {
observer.stateChanged(obj);
}
}
}
| UTF-8 | Java | 2,186 | java | CustomList.java | Java | [] | null | [] | package ca.courseplannerv1.model.list;
import ca.courseplannerv1.model.watchers.Observer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
public abstract class CustomList<T> implements Iterable<T>{
private List<T> list = new ArrayList<>();
private int numElements = 0;
//insert new obj to end of list
public void insert(T obj) {
list.add(obj);
notifyObservers(obj);
this.numElements++;
}
public void insert(int index, T obj) {
list.add(index, obj);
notifyObservers(obj);
this.numElements++;
}
//insert new obj into list, in sorted ascending order
//returns true if successful, false otherwise.
public abstract void insertSorted(T obj);
//remove obj from list at the given index
public void remove(int index) {
list.remove(index);
}
//remove obj from list
public void remove(T obj) {
list.remove(obj);
}
//retreive the obj from list at the given index
public T get(int index) {
return list.get(index);
}
//return the number of elements in the list
public int size() {
return this.numElements;
}
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public int getNumElements() {
return numElements;
}
public void setNumElements(int numElements) {
this.numElements = numElements;
}
public List<Observer> getObservers() {
return observers;
}
public void setObservers(List<Observer> observers) {
this.observers = observers;
}
public abstract void printItems();
@Override
public Iterator<T> iterator() {
return Collections.unmodifiableList(list).iterator();
}
//make observable
private List<Observer> observers = new ArrayList<>();
public void addObserver(Observer observer) {
observers.add(observer);
}
protected void notifyObservers(T obj) {
for(Observer observer : observers) {
observer.stateChanged(obj);
}
}
}
| 2,186 | 0.630833 | 0.62946 | 97 | 21.536083 | 18.745754 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.350515 | false | false | 2 |
6f9e225cb1da87fb940a5986d5ee71711d5fb53e | 22,883,585,802,655 | b0a54964a9053d023c60b6a62d323f1c813989c8 | /src/main/java/com/github/lucene/store/jdbc/index/oracle/OracleRAMJdbcIndexOutput.java | 9935e72aa1a0221fd34b4027f89eb0506f5c6a2c | [
"Apache-2.0"
] | permissive | bravegag/lucene-jdbcdirectory | https://github.com/bravegag/lucene-jdbcdirectory | 5d3e274807ba2c18089922a888d6f448d9fec30f | 4eb80edbda16a1092a853e5bef694b6516497ab3 | refs/heads/master | 2020-08-08T05:48:42.003000 | 2019-10-08T20:26:55 | 2019-10-08T20:26:55 | 213,741,284 | 0 | 0 | Apache-2.0 | true | 2019-10-08T20:00:29 | 2019-10-08T20:00:29 | 2018-08-16T13:36:13 | 2015-09-08T22:41:12 | 416 | 0 | 0 | 0 | null | false | false | package com.github.lucene.store.jdbc.index.oracle;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import com.github.lucene.store.jdbc.index.RAMJdbcIndexOutput;
import com.github.lucene.store.jdbc.support.JdbcTemplate;
/**
* A specialized Oracle version that works (through reflection) with Oracle
* 9i/8i specific blob API for blobs bigger than 4k.
*
* @author kimchy
*/
public class OracleRAMJdbcIndexOutput extends RAMJdbcIndexOutput {
@Override
public void close() throws IOException {
flush();
final long length = length();
doBeforeClose();
final String sqlInsert = OracleIndexOutputHelper.sqlInsert(jdbcDirectory.getTable());
jdbcDirectory.getJdbcTemplate().executeUpdate(sqlInsert, new JdbcTemplate.PrepateStatementAwareCallback() {
@Override
public void fillPrepareStatement(final PreparedStatement ps) throws Exception {
ps.setFetchSize(1);
ps.setString(1, name);
ps.setLong(2, length);
ps.setBoolean(3, false);
}
});
final String sqlUpdate = OracleIndexOutputHelper.sqlUpdate(jdbcDirectory.getTable());
jdbcDirectory.getJdbcTemplate().executeSelect(sqlUpdate, new JdbcTemplate.ExecuteSelectCallback() {
@Override
public void fillPrepareStatement(final PreparedStatement ps) throws Exception {
ps.setFetchSize(1);
ps.setString(1, name);
}
@Override
public Object execute(final ResultSet rs) throws Exception {
OutputStream os = null;
try {
rs.next();
os = OracleIndexOutputHelper.getBlobOutputStream(rs);
final InputStream is = openInputStream();
final byte[] buffer = new byte[1000];
int bytesRead = 0;
while ((bytesRead = is.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
return null;
} finally {
if (os != null) {
os.close();
}
}
}
});
doAfterClose();
}
}
| UTF-8 | Java | 2,396 | java | OracleRAMJdbcIndexOutput.java | Java | [
{
"context": "c blob API for blobs bigger than 4k.\n *\n * @author kimchy\n */\npublic class OracleRAMJdbcIndexOutput extends",
"end": 474,
"score": 0.9995716214179993,
"start": 468,
"tag": "USERNAME",
"value": "kimchy"
}
] | null | [] | package com.github.lucene.store.jdbc.index.oracle;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import com.github.lucene.store.jdbc.index.RAMJdbcIndexOutput;
import com.github.lucene.store.jdbc.support.JdbcTemplate;
/**
* A specialized Oracle version that works (through reflection) with Oracle
* 9i/8i specific blob API for blobs bigger than 4k.
*
* @author kimchy
*/
public class OracleRAMJdbcIndexOutput extends RAMJdbcIndexOutput {
@Override
public void close() throws IOException {
flush();
final long length = length();
doBeforeClose();
final String sqlInsert = OracleIndexOutputHelper.sqlInsert(jdbcDirectory.getTable());
jdbcDirectory.getJdbcTemplate().executeUpdate(sqlInsert, new JdbcTemplate.PrepateStatementAwareCallback() {
@Override
public void fillPrepareStatement(final PreparedStatement ps) throws Exception {
ps.setFetchSize(1);
ps.setString(1, name);
ps.setLong(2, length);
ps.setBoolean(3, false);
}
});
final String sqlUpdate = OracleIndexOutputHelper.sqlUpdate(jdbcDirectory.getTable());
jdbcDirectory.getJdbcTemplate().executeSelect(sqlUpdate, new JdbcTemplate.ExecuteSelectCallback() {
@Override
public void fillPrepareStatement(final PreparedStatement ps) throws Exception {
ps.setFetchSize(1);
ps.setString(1, name);
}
@Override
public Object execute(final ResultSet rs) throws Exception {
OutputStream os = null;
try {
rs.next();
os = OracleIndexOutputHelper.getBlobOutputStream(rs);
final InputStream is = openInputStream();
final byte[] buffer = new byte[1000];
int bytesRead = 0;
while ((bytesRead = is.read(buffer)) != -1) {
os.write(buffer, 0, bytesRead);
}
return null;
} finally {
if (os != null) {
os.close();
}
}
}
});
doAfterClose();
}
}
| 2,396 | 0.580134 | 0.573456 | 66 | 35.303032 | 28.254776 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.590909 | false | false | 2 |
abfa150301b8a9ade56af3fff207acfe49b8d827 | 3,410,204,069,725 | 83f4c8d393553e9af919f886daf0bae4776eb3be | /src/Ventanas/PantallaInicio2.java | 5764eb0e4981d7f0ed9a4fd40c65c42eaf1ae1fd | [] | no_license | kuixon/RROO-SocketTcpHospital | https://github.com/kuixon/RROO-SocketTcpHospital | ee2a09fd1b0860918ae9f5f18373d5b6ff633ad0 | 2ffcb4b2ee2797b1701b0265c75b79ea152f4392 | refs/heads/master | 2021-01-10T07:57:45.633000 | 2015-11-24T09:32:34 | 2015-11-24T09:32:34 | 46,781,123 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Ventanas;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import util.SocketManager;
import util.UtilidadesGUI;
public class PantallaInicio2 extends javax.swing.JPanel implements ActionListener {
public static int cont = 0;
public static SocketManager sm2;
public static String modifiedSentence = null;
public PantallaInicio2() {
initComponents();
}
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
fondo = new javax.swing.JLabel();
t_Contraseña = new javax.swing.JPasswordField();
jLabel3 = new javax.swing.JLabel();
t_Usuario1 = new javax.swing.JTextField();
b_aceptar = new javax.swing.JButton();
setLayout(null);
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18));
jLabel1.setForeground(new java.awt.Color(255, 0, 0));
jLabel1.setText("REGISTRO PARA LA NUEVA CONEXION");
add(jLabel1);
jLabel1.setBounds(40, 70, 400, 40);
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18));
jLabel2.setForeground(new java.awt.Color(0,250,154));
jLabel2.setText("Contraseña:");
add(jLabel2);
jLabel2.setBounds(60, 220, 120, 22);
add(t_Contraseña);
t_Contraseña.setFont(new java.awt.Font("Tahoma", 1, 12));
t_Contraseña.setBackground(new java.awt.Color(238,44,44));
t_Contraseña.setBounds(180, 217, 210, 27);
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 18));
jLabel3.setForeground(new java.awt.Color(0,250,154));
jLabel3.setText("Usuario:");
add(jLabel3);
jLabel3.setBounds(60, 170, 80, 22);
add(t_Usuario1);
t_Usuario1.setFont(new java.awt.Font("Tahoma", 1, 12));
t_Usuario1.setBackground(new java.awt.Color(238,44,44));
t_Usuario1.setBounds(150, 167, 240, 27);
b_aceptar.setFont(new java.awt.Font("Tahoma", 1, 11));
b_aceptar.setText("Validar Usuario");
b_aceptar.setBackground(new java.awt.Color(255, 0, 0));
add(b_aceptar);
b_aceptar.setBounds(160, 280, 120, 30);
fondo.setIcon(new javax.swing.ImageIcon("src\\Imagenes\\fondo.jpg"));
add(fondo);
fondo.setBounds(0, 0, 445, 472);
//Para que se habra con este tamaño como mínimo.
this.setMinimumSize(new Dimension(445, 472));
//Para que se vea el contenido de la ventana.
this.setVisible(true);
//Añadir funcionalidad a los botones.
b_aceptar.addActionListener(this);
}
public static void cerrarSocket()
{
try {
sm2.CerrarSocket();
} catch (IOException e) {
System.out.println("CASCA AL CERRARLO");
e.printStackTrace();
}
}
private javax.swing.JButton b_aceptar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel fondo;
private javax.swing.JPasswordField t_Contraseña;
private javax.swing.JTextField t_Usuario1;
private javax.swing.JFrame actual;
private JPanel estePanel = this;
public void actionPerformed(ActionEvent e) {
if((e.getSource() == b_aceptar)&&(b_aceptar.getText().equals("Validar Usuario")))
{
try {
if(cont==0)
{
sm2 = new SocketManager("127.0.0.1", 2600);
cont++;
}
String sentence = "USER "+t_Usuario1.getText();
System.out.print("Desde el cliente: "+sentence);
sm2.Escribir(sentence + '\n');
modifiedSentence = sm2.Leer();
System.out.println();
System.out.println("Desde el servidor: "+modifiedSentence);
if(modifiedSentence.equals("311 OK Bienvenido "+t_Usuario1.getText()+"."))
{
b_aceptar.setText("Conectar");
t_Usuario1.setEnabled(false);
}
else
{
if(modifiedSentence.equals("ERR El usuario no esta registrado en el sistema"))
{
JOptionPane.showMessageDialog(this, "Este usuario NO esta registrado en el sistema", "Usuario NO registrado", JOptionPane.ERROR_MESSAGE);
}
else
{
JOptionPane.showMessageDialog(this, "Falta el nombre de usuario", "Campo Usuario vacio", JOptionPane.ERROR_MESSAGE);
}
}
} catch (IOException e1) {
e1.printStackTrace();
System.out.println("No carga bien el nuevo socket.");
}
}
else
{
if((e.getSource() == b_aceptar)&&(b_aceptar.getText().equals("Conectar")))
{
try {
String sentence = "PASS "+t_Contraseña.getText();
System.out.print("Desde el cliente: "+sentence);
sm2.Escribir(sentence + '\n');
modifiedSentence = sm2.Leer();
System.out.println();
System.out.println("Desde el servidor: "+modifiedSentence);
if(modifiedSentence.equals("312 OK Bienvenido al sistema"))
{
actual = (JFrame) UtilidadesGUI.getContenedorPrincipal(estePanel);
actual.getContentPane().remove(0);
actual.getContentPane().add(new PantallaCoordenadas());
actual.setPreferredSize(new Dimension(445, 472));
actual.pack();
actual.repaint();
actual.setLocationRelativeTo(null);
}
else if(modifiedSentence.equals("513 ERR Falta la clave."))
{
JOptionPane.showMessageDialog(this, "Falta la contraseña", "Campo contraseña vacio", JOptionPane.ERROR_MESSAGE);
}
else if(modifiedSentence.equals("512 ERR La clave es incorrecta."))
{
JOptionPane.showMessageDialog(this, "La contraseña introducida no se corresponde con el usuario introducido (USUARIO PREVIAMENTE REGISTRADO)", "Clave incorrecta", JOptionPane.ERROR_MESSAGE);
}
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
} | ISO-8859-1 | Java | 6,411 | java | PantallaInicio2.java | Java | [
{
"context": "\t\tif(cont==0)\n\t\t\t\t{\n\t\t\t\t\tsm2 = new SocketManager(\"127.0.0.1\", 2600);\n\t\t\t\t\tcont++;\n\t\t\t\t}\n\t\t\t\tString sentence =",
"end": 3645,
"score": 0.9997520446777344,
"start": 3636,
"tag": "IP_ADDRESS",
"value": "127.0.0.1"
}
] | null | [] | package Ventanas;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import util.SocketManager;
import util.UtilidadesGUI;
public class PantallaInicio2 extends javax.swing.JPanel implements ActionListener {
public static int cont = 0;
public static SocketManager sm2;
public static String modifiedSentence = null;
public PantallaInicio2() {
initComponents();
}
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
fondo = new javax.swing.JLabel();
t_Contraseña = new javax.swing.JPasswordField();
jLabel3 = new javax.swing.JLabel();
t_Usuario1 = new javax.swing.JTextField();
b_aceptar = new javax.swing.JButton();
setLayout(null);
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18));
jLabel1.setForeground(new java.awt.Color(255, 0, 0));
jLabel1.setText("REGISTRO PARA LA NUEVA CONEXION");
add(jLabel1);
jLabel1.setBounds(40, 70, 400, 40);
jLabel2.setFont(new java.awt.Font("Tahoma", 1, 18));
jLabel2.setForeground(new java.awt.Color(0,250,154));
jLabel2.setText("Contraseña:");
add(jLabel2);
jLabel2.setBounds(60, 220, 120, 22);
add(t_Contraseña);
t_Contraseña.setFont(new java.awt.Font("Tahoma", 1, 12));
t_Contraseña.setBackground(new java.awt.Color(238,44,44));
t_Contraseña.setBounds(180, 217, 210, 27);
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 18));
jLabel3.setForeground(new java.awt.Color(0,250,154));
jLabel3.setText("Usuario:");
add(jLabel3);
jLabel3.setBounds(60, 170, 80, 22);
add(t_Usuario1);
t_Usuario1.setFont(new java.awt.Font("Tahoma", 1, 12));
t_Usuario1.setBackground(new java.awt.Color(238,44,44));
t_Usuario1.setBounds(150, 167, 240, 27);
b_aceptar.setFont(new java.awt.Font("Tahoma", 1, 11));
b_aceptar.setText("Validar Usuario");
b_aceptar.setBackground(new java.awt.Color(255, 0, 0));
add(b_aceptar);
b_aceptar.setBounds(160, 280, 120, 30);
fondo.setIcon(new javax.swing.ImageIcon("src\\Imagenes\\fondo.jpg"));
add(fondo);
fondo.setBounds(0, 0, 445, 472);
//Para que se habra con este tamaño como mínimo.
this.setMinimumSize(new Dimension(445, 472));
//Para que se vea el contenido de la ventana.
this.setVisible(true);
//Añadir funcionalidad a los botones.
b_aceptar.addActionListener(this);
}
public static void cerrarSocket()
{
try {
sm2.CerrarSocket();
} catch (IOException e) {
System.out.println("CASCA AL CERRARLO");
e.printStackTrace();
}
}
private javax.swing.JButton b_aceptar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel fondo;
private javax.swing.JPasswordField t_Contraseña;
private javax.swing.JTextField t_Usuario1;
private javax.swing.JFrame actual;
private JPanel estePanel = this;
public void actionPerformed(ActionEvent e) {
if((e.getSource() == b_aceptar)&&(b_aceptar.getText().equals("Validar Usuario")))
{
try {
if(cont==0)
{
sm2 = new SocketManager("127.0.0.1", 2600);
cont++;
}
String sentence = "USER "+t_Usuario1.getText();
System.out.print("Desde el cliente: "+sentence);
sm2.Escribir(sentence + '\n');
modifiedSentence = sm2.Leer();
System.out.println();
System.out.println("Desde el servidor: "+modifiedSentence);
if(modifiedSentence.equals("311 OK Bienvenido "+t_Usuario1.getText()+"."))
{
b_aceptar.setText("Conectar");
t_Usuario1.setEnabled(false);
}
else
{
if(modifiedSentence.equals("ERR El usuario no esta registrado en el sistema"))
{
JOptionPane.showMessageDialog(this, "Este usuario NO esta registrado en el sistema", "Usuario NO registrado", JOptionPane.ERROR_MESSAGE);
}
else
{
JOptionPane.showMessageDialog(this, "Falta el nombre de usuario", "Campo Usuario vacio", JOptionPane.ERROR_MESSAGE);
}
}
} catch (IOException e1) {
e1.printStackTrace();
System.out.println("No carga bien el nuevo socket.");
}
}
else
{
if((e.getSource() == b_aceptar)&&(b_aceptar.getText().equals("Conectar")))
{
try {
String sentence = "PASS "+t_Contraseña.getText();
System.out.print("Desde el cliente: "+sentence);
sm2.Escribir(sentence + '\n');
modifiedSentence = sm2.Leer();
System.out.println();
System.out.println("Desde el servidor: "+modifiedSentence);
if(modifiedSentence.equals("312 OK Bienvenido al sistema"))
{
actual = (JFrame) UtilidadesGUI.getContenedorPrincipal(estePanel);
actual.getContentPane().remove(0);
actual.getContentPane().add(new PantallaCoordenadas());
actual.setPreferredSize(new Dimension(445, 472));
actual.pack();
actual.repaint();
actual.setLocationRelativeTo(null);
}
else if(modifiedSentence.equals("513 ERR Falta la clave."))
{
JOptionPane.showMessageDialog(this, "Falta la contraseña", "Campo contraseña vacio", JOptionPane.ERROR_MESSAGE);
}
else if(modifiedSentence.equals("512 ERR La clave es incorrecta."))
{
JOptionPane.showMessageDialog(this, "La contraseña introducida no se corresponde con el usuario introducido (USUARIO PREVIAMENTE REGISTRADO)", "Clave incorrecta", JOptionPane.ERROR_MESSAGE);
}
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
}
} | 6,411 | 0.608723 | 0.576677 | 178 | 34.943821 | 29.746819 | 208 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2 | false | false | 2 |
540ddc13cd6bb1c10ea8f6696913323437006a8c | 14,439,680,093,337 | 91754fb0491f510d9af822c9177eff823277336d | /Average of three numbers/Main.java | 1da5b309f028121f6590e05ecea72d2da7b25d1b | [] | no_license | anantvatta0412/Playground | https://github.com/anantvatta0412/Playground | fa276a3f08288d56aa0d54c72da9fe2d2a7cb775 | 6cbd5cec6250aa11e3a7d101be55bca66006ce96 | refs/heads/master | 2020-06-05T03:23:27.966000 | 2019-06-19T08:38:24 | 2019-06-19T08:38:24 | 192,296,753 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | #include<stdio.h>
int main()
{
//Type your code here
int n1,n2,n3,a;
scanf("%d",&n1);
scanf("%d",&n2);
scanf("%d",&n3);
a=(n1+n2+n3)/3;
printf("%d",a);
return 0;
} | UTF-8 | Java | 179 | java | Main.java | Java | [] | null | [] | #include<stdio.h>
int main()
{
//Type your code here
int n1,n2,n3,a;
scanf("%d",&n1);
scanf("%d",&n2);
scanf("%d",&n3);
a=(n1+n2+n3)/3;
printf("%d",a);
return 0;
} | 179 | 0.519553 | 0.458101 | 12 | 14 | 6.63325 | 23 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.166667 | false | false | 2 |
9b20702b3b064477b43efb8f88eb44a0518677ef | 5,111,011,093,398 | d753cfbe58912671d7494804499bd6168fb5b5e1 | /aidl/java/com/facebook/profilo/ipc/TraceConfigExtras.java | 3217ed77cf0e6f92f70554120ba3efc95fbab686 | [
"Apache-2.0"
] | permissive | facebookincubator/profilo | https://github.com/facebookincubator/profilo | f28582b10034fcc9202c544681a2db54c6f59991 | 5a66b9372c137be036403d9c6f89a57ce4111d0a | refs/heads/main | 2023-08-07T02:33:46.829000 | 2023-02-24T04:12:36 | 2023-02-24T04:12:36 | 103,603,776 | 1,583 | 176 | Apache-2.0 | false | 2023-04-19T04:02:48 | 2017-09-15T02:18:28 | 2023-04-13T06:04:02 | 2023-04-19T04:02:47 | 15,346 | 1,554 | 172 | 1 | C | false | false | // (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
package com.facebook.profilo.ipc;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import com.facebook.profilo.config.Config;
import com.facebook.profilo.config.ConfigParams;
import java.util.ArrayList;
import java.util.Set;
import java.util.TreeMap;
import javax.annotation.Nullable;
// Trace config extra configuration parameters.
// The granularity of these extras applies to everything within the trace
// config, which means that they apply to all the providers.
public final class TraceConfigExtras implements Parcelable {
public static final TraceConfigExtras EMPTY = new TraceConfigExtras(null, null, null, null, null);
private final @Nullable TreeMap<String, Integer> mIntParams;
private final @Nullable TreeMap<String, Boolean> mBoolParams;
private final @Nullable TreeMap<String, int[]> mIntArrayParams;
private final @Nullable TreeMap<String, ArrayList<String>> mStringArrayParams;
private final @Nullable TreeMap<String, String> mStringParams;
private final @Nullable Config mConfig;
private final int mTraceConfigIdx;
TraceConfigExtras(Parcel in) {
mConfig = null;
mTraceConfigIdx = -1;
Bundle intParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> intParamKeys = intParamsBundle.keySet();
if (!intParamKeys.isEmpty()) {
mIntParams = new TreeMap<>();
for (String key : intParamKeys) {
mIntParams.put(key, intParamsBundle.getInt(key));
}
} else {
mIntParams = null;
}
Bundle boolParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> boolParamKeys = boolParamsBundle.keySet();
if (!boolParamKeys.isEmpty()) {
mBoolParams = new TreeMap<>();
for (String key : boolParamKeys) {
mBoolParams.put(key, boolParamsBundle.getBoolean(key));
}
} else {
mBoolParams = null;
}
Bundle intArrayParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> intArrayParamKeys = intArrayParamsBundle.keySet();
if (!intArrayParamKeys.isEmpty()) {
mIntArrayParams = new TreeMap<>();
for (String key : intArrayParamKeys) {
mIntArrayParams.put(key, intArrayParamsBundle.getIntArray(key));
}
} else {
mIntArrayParams = null;
}
Bundle stringArrayParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> stringArrayParamKeys = stringArrayParamsBundle.keySet();
if (!stringArrayParamKeys.isEmpty()) {
mStringArrayParams = new TreeMap<>();
for (String key : stringArrayParamKeys) {
mStringArrayParams.put(key, stringArrayParamsBundle.getStringArrayList(key));
}
} else {
mStringArrayParams = null;
}
Bundle stringParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> stringParamKeys = stringParamsBundle.keySet();
if (!stringParamKeys.isEmpty()) {
mStringParams = new TreeMap<>();
for (String key : stringParamKeys) {
mStringParams.put(key, new String(stringParamsBundle.getCharArray(key)));
}
} else {
mStringParams = null;
}
}
public TraceConfigExtras(Config config, int traceConfigIdx) {
mConfig = config;
mTraceConfigIdx = traceConfigIdx;
mIntParams = null;
mIntArrayParams = null;
mBoolParams = null;
mStringArrayParams = null;
mStringParams = null;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
TreeMap<String, Integer> intParams = mIntParams;
TreeMap<String, Boolean> boolParams = mBoolParams;
TreeMap<String, int[]> intArrayParams = mIntArrayParams;
TreeMap<String, ArrayList<String>> stringArrayParams = mStringArrayParams;
TreeMap<String, String> stringParams = mStringParams;
if (mTraceConfigIdx >= 0 && mConfig != null) {
ConfigParams params = mConfig.getTraceConfigParams(mTraceConfigIdx);
intParams = params.intParams;
boolParams = params.boolParams;
intArrayParams = params.intListParams;
}
Bundle intParamsBundle = new Bundle();
if (intParams != null) {
for (TreeMap.Entry<String, Integer> entry : intParams.entrySet()) {
intParamsBundle.putInt(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(intParamsBundle);
Bundle boolParamsBundle = new Bundle();
if (boolParams != null) {
for (TreeMap.Entry<String, Boolean> entry : boolParams.entrySet()) {
boolParamsBundle.putBoolean(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(boolParamsBundle);
Bundle intArrayParamsBundle = new Bundle();
if (intArrayParams != null) {
for (TreeMap.Entry<String, int[]> entry : intArrayParams.entrySet()) {
intArrayParamsBundle.putIntArray(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(intArrayParamsBundle);
Bundle stringArrayParamsBundle = new Bundle();
if (stringArrayParams != null) {
for (TreeMap.Entry<String, ArrayList<String>> entry : stringArrayParams.entrySet()) {
stringArrayParamsBundle.putStringArrayList(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(stringArrayParamsBundle);
Bundle stringParamsBundle = new Bundle();
if (stringParams != null) {
for (TreeMap.Entry<String, String> entry : stringParams.entrySet()) {
stringParamsBundle.putCharArray(entry.getKey(), entry.getValue().toCharArray());
}
}
dest.writeBundle(stringParamsBundle);
}
public TraceConfigExtras(
@Nullable TreeMap<String, Integer> intParams,
@Nullable TreeMap<String, Boolean> boolParams,
@Nullable TreeMap<String, int[]> intArrayParams,
@Nullable TreeMap<String, ArrayList<String>> stringArrayParams,
@Nullable TreeMap<String, String> stringParams) {
mIntParams = intParams;
mBoolParams = boolParams;
mIntArrayParams = intArrayParams;
mStringArrayParams = stringArrayParams;
mStringParams = stringParams;
mConfig = null;
mTraceConfigIdx = -1;
}
public int getIntParam(String key, int defaultValue) {
if (mConfig != null) {
return mConfig.optTraceConfigParamInt(mTraceConfigIdx, key, defaultValue);
}
if (mIntParams == null) {
return defaultValue;
}
Integer value = mIntParams.get(key);
return value == null ? defaultValue : value;
}
public boolean getBoolParam(String key, boolean defaultValue) {
if (mConfig != null) {
return mConfig.optTraceConfigParamBool(mTraceConfigIdx, key, defaultValue);
}
if (mBoolParams == null) {
return defaultValue;
}
Boolean value = mBoolParams.get(key);
return value == null ? defaultValue : value;
}
@Nullable
public int[] getIntArrayParam(String key) {
if (mConfig != null) {
return mConfig.optTraceConfigParamIntList(mTraceConfigIdx, key);
}
if (mIntArrayParams == null) {
return null;
}
return mIntArrayParams.get(key);
}
@Nullable
public String[] getStringArrayParam(String key) {
if (mConfig != null) {
return mConfig.optTraceConfigParamStringList(mTraceConfigIdx, key);
}
if (mStringArrayParams == null) {
return null;
}
ArrayList<String> stringArrayList = mStringArrayParams.get(key);
if (stringArrayList == null) {
return null;
}
String[] returnArray = new String[stringArrayList.size()];
return stringArrayList.toArray(returnArray);
}
@Nullable
public String getStringParam(String key, @Nullable String defaultVal) {
if (mConfig != null) {
return mConfig.optTraceConfigParamString(mTraceConfigIdx, key, defaultVal);
}
if (mStringParams == null) {
return defaultVal;
}
String string = mStringParams.get(key);
return string != null ? string : defaultVal;
}
public static final Creator<TraceConfigExtras> CREATOR =
new Creator<TraceConfigExtras>() {
public TraceConfigExtras createFromParcel(Parcel in) {
return new TraceConfigExtras(in);
}
public TraceConfigExtras[] newArray(int size) {
return new TraceConfigExtras[size];
}
};
@Override
public int describeContents() {
return 0;
}
}
| UTF-8 | Java | 8,266 | java | TraceConfigExtras.java | Java | [] | null | [] | // (c) Facebook, Inc. and its affiliates. Confidential and proprietary.
package com.facebook.profilo.ipc;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import com.facebook.profilo.config.Config;
import com.facebook.profilo.config.ConfigParams;
import java.util.ArrayList;
import java.util.Set;
import java.util.TreeMap;
import javax.annotation.Nullable;
// Trace config extra configuration parameters.
// The granularity of these extras applies to everything within the trace
// config, which means that they apply to all the providers.
public final class TraceConfigExtras implements Parcelable {
public static final TraceConfigExtras EMPTY = new TraceConfigExtras(null, null, null, null, null);
private final @Nullable TreeMap<String, Integer> mIntParams;
private final @Nullable TreeMap<String, Boolean> mBoolParams;
private final @Nullable TreeMap<String, int[]> mIntArrayParams;
private final @Nullable TreeMap<String, ArrayList<String>> mStringArrayParams;
private final @Nullable TreeMap<String, String> mStringParams;
private final @Nullable Config mConfig;
private final int mTraceConfigIdx;
TraceConfigExtras(Parcel in) {
mConfig = null;
mTraceConfigIdx = -1;
Bundle intParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> intParamKeys = intParamsBundle.keySet();
if (!intParamKeys.isEmpty()) {
mIntParams = new TreeMap<>();
for (String key : intParamKeys) {
mIntParams.put(key, intParamsBundle.getInt(key));
}
} else {
mIntParams = null;
}
Bundle boolParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> boolParamKeys = boolParamsBundle.keySet();
if (!boolParamKeys.isEmpty()) {
mBoolParams = new TreeMap<>();
for (String key : boolParamKeys) {
mBoolParams.put(key, boolParamsBundle.getBoolean(key));
}
} else {
mBoolParams = null;
}
Bundle intArrayParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> intArrayParamKeys = intArrayParamsBundle.keySet();
if (!intArrayParamKeys.isEmpty()) {
mIntArrayParams = new TreeMap<>();
for (String key : intArrayParamKeys) {
mIntArrayParams.put(key, intArrayParamsBundle.getIntArray(key));
}
} else {
mIntArrayParams = null;
}
Bundle stringArrayParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> stringArrayParamKeys = stringArrayParamsBundle.keySet();
if (!stringArrayParamKeys.isEmpty()) {
mStringArrayParams = new TreeMap<>();
for (String key : stringArrayParamKeys) {
mStringArrayParams.put(key, stringArrayParamsBundle.getStringArrayList(key));
}
} else {
mStringArrayParams = null;
}
Bundle stringParamsBundle = in.readBundle(getClass().getClassLoader());
Set<String> stringParamKeys = stringParamsBundle.keySet();
if (!stringParamKeys.isEmpty()) {
mStringParams = new TreeMap<>();
for (String key : stringParamKeys) {
mStringParams.put(key, new String(stringParamsBundle.getCharArray(key)));
}
} else {
mStringParams = null;
}
}
public TraceConfigExtras(Config config, int traceConfigIdx) {
mConfig = config;
mTraceConfigIdx = traceConfigIdx;
mIntParams = null;
mIntArrayParams = null;
mBoolParams = null;
mStringArrayParams = null;
mStringParams = null;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
TreeMap<String, Integer> intParams = mIntParams;
TreeMap<String, Boolean> boolParams = mBoolParams;
TreeMap<String, int[]> intArrayParams = mIntArrayParams;
TreeMap<String, ArrayList<String>> stringArrayParams = mStringArrayParams;
TreeMap<String, String> stringParams = mStringParams;
if (mTraceConfigIdx >= 0 && mConfig != null) {
ConfigParams params = mConfig.getTraceConfigParams(mTraceConfigIdx);
intParams = params.intParams;
boolParams = params.boolParams;
intArrayParams = params.intListParams;
}
Bundle intParamsBundle = new Bundle();
if (intParams != null) {
for (TreeMap.Entry<String, Integer> entry : intParams.entrySet()) {
intParamsBundle.putInt(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(intParamsBundle);
Bundle boolParamsBundle = new Bundle();
if (boolParams != null) {
for (TreeMap.Entry<String, Boolean> entry : boolParams.entrySet()) {
boolParamsBundle.putBoolean(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(boolParamsBundle);
Bundle intArrayParamsBundle = new Bundle();
if (intArrayParams != null) {
for (TreeMap.Entry<String, int[]> entry : intArrayParams.entrySet()) {
intArrayParamsBundle.putIntArray(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(intArrayParamsBundle);
Bundle stringArrayParamsBundle = new Bundle();
if (stringArrayParams != null) {
for (TreeMap.Entry<String, ArrayList<String>> entry : stringArrayParams.entrySet()) {
stringArrayParamsBundle.putStringArrayList(entry.getKey(), entry.getValue());
}
}
dest.writeBundle(stringArrayParamsBundle);
Bundle stringParamsBundle = new Bundle();
if (stringParams != null) {
for (TreeMap.Entry<String, String> entry : stringParams.entrySet()) {
stringParamsBundle.putCharArray(entry.getKey(), entry.getValue().toCharArray());
}
}
dest.writeBundle(stringParamsBundle);
}
public TraceConfigExtras(
@Nullable TreeMap<String, Integer> intParams,
@Nullable TreeMap<String, Boolean> boolParams,
@Nullable TreeMap<String, int[]> intArrayParams,
@Nullable TreeMap<String, ArrayList<String>> stringArrayParams,
@Nullable TreeMap<String, String> stringParams) {
mIntParams = intParams;
mBoolParams = boolParams;
mIntArrayParams = intArrayParams;
mStringArrayParams = stringArrayParams;
mStringParams = stringParams;
mConfig = null;
mTraceConfigIdx = -1;
}
public int getIntParam(String key, int defaultValue) {
if (mConfig != null) {
return mConfig.optTraceConfigParamInt(mTraceConfigIdx, key, defaultValue);
}
if (mIntParams == null) {
return defaultValue;
}
Integer value = mIntParams.get(key);
return value == null ? defaultValue : value;
}
public boolean getBoolParam(String key, boolean defaultValue) {
if (mConfig != null) {
return mConfig.optTraceConfigParamBool(mTraceConfigIdx, key, defaultValue);
}
if (mBoolParams == null) {
return defaultValue;
}
Boolean value = mBoolParams.get(key);
return value == null ? defaultValue : value;
}
@Nullable
public int[] getIntArrayParam(String key) {
if (mConfig != null) {
return mConfig.optTraceConfigParamIntList(mTraceConfigIdx, key);
}
if (mIntArrayParams == null) {
return null;
}
return mIntArrayParams.get(key);
}
@Nullable
public String[] getStringArrayParam(String key) {
if (mConfig != null) {
return mConfig.optTraceConfigParamStringList(mTraceConfigIdx, key);
}
if (mStringArrayParams == null) {
return null;
}
ArrayList<String> stringArrayList = mStringArrayParams.get(key);
if (stringArrayList == null) {
return null;
}
String[] returnArray = new String[stringArrayList.size()];
return stringArrayList.toArray(returnArray);
}
@Nullable
public String getStringParam(String key, @Nullable String defaultVal) {
if (mConfig != null) {
return mConfig.optTraceConfigParamString(mTraceConfigIdx, key, defaultVal);
}
if (mStringParams == null) {
return defaultVal;
}
String string = mStringParams.get(key);
return string != null ? string : defaultVal;
}
public static final Creator<TraceConfigExtras> CREATOR =
new Creator<TraceConfigExtras>() {
public TraceConfigExtras createFromParcel(Parcel in) {
return new TraceConfigExtras(in);
}
public TraceConfigExtras[] newArray(int size) {
return new TraceConfigExtras[size];
}
};
@Override
public int describeContents() {
return 0;
}
}
| 8,266 | 0.689814 | 0.68933 | 243 | 33.01646 | 25.543631 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.662551 | false | false | 2 |
35e68fa30300e4286b7da9bd0da20df969f21c7c | 27,839,978,051,341 | 9cb215c0e45ed1ad7bd4a8e7e866b0ad148a356a | /src/One_JavaSyntax/task/task_9/task_026/Solution.java | d46ecb439ee1cf0fc6b6a010bff7411a35f17c38 | [] | no_license | Brittany-Miller0/JR_Syntax | https://github.com/Brittany-Miller0/JR_Syntax | 5e922278893ac1aae1eba4a052eaad25ab79ca9b | a8b1409c81ca7c06931f63c59435767f5ee48969 | refs/heads/master | 2022-12-01T09:35:26.342000 | 2020-08-19T19:18:52 | 2020-08-19T19:18:52 | 288,817,398 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package One_JavaSyntax.task.task_9.task_026;
/*
* Написать программу, которая вводит с клавиатуры строку текста.
* Программа должна вывести на экран две строки:
* 1. первая строка содержит только гласные буквы из введённой строки.
* 2. вторая — только согласные буквы и знаки препинания из введённой строки.
* Буквы соединять пробелом, каждая строка должна заканчиваться пробелом.
* Пример ввода:
* Мама мыла раму.
* Пример вывода:
* а а ы а а у
* М м м л р м .
*
* Требования:
* 1. Программа должна считывать данные с клавиатуры.
* 2. Программа должна выводить две строки.
* 3. Первая строка должна содержать только гласные буквы из введенной строки, разделенные пробелом.
* 4. Вторая строка должна содержать только согласные и знаки препинания из введенной строки, разделенные пробелом.
* 5. Каждая строка должна заканчиваться пробелом.
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Solution {
public static char[] vowels = new char[]{'а', 'я', 'у', 'ю', 'и', 'ы', 'э', 'е', 'о', 'ё'};
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
char[] chArr = reader.readLine().toCharArray();
ArrayList<Character> listVow = new ArrayList<>();
ArrayList<Character> listNVow = new ArrayList<>();
for (int i = 0; i < chArr.length; i++) {
if (isVowel(chArr[i])) {
listVow.add(chArr[i]);
} else if (chArr[i] == ' ') {
continue;
} else {
listNVow.add(chArr[i]);
}
}
for (char c : listVow) {
System.out.print(c + " ");
}
System.out.println();
for (char c : listNVow) {
System.out.print(c + " ");
}
}
// метод проверяет, гласная ли буква
public static boolean isVowel(char c) {
// приводим символ в нижний регистр - от заглавных к строчным буквам
c = Character.toLowerCase(c);
// ищем среди массива гласных
for (char d : vowels) {
if (c == d) {
return true;
}
}
return false;
}
} | UTF-8 | Java | 3,043 | java | Solution.java | Java | [] | null | [] | package One_JavaSyntax.task.task_9.task_026;
/*
* Написать программу, которая вводит с клавиатуры строку текста.
* Программа должна вывести на экран две строки:
* 1. первая строка содержит только гласные буквы из введённой строки.
* 2. вторая — только согласные буквы и знаки препинания из введённой строки.
* Буквы соединять пробелом, каждая строка должна заканчиваться пробелом.
* Пример ввода:
* Мама мыла раму.
* Пример вывода:
* а а ы а а у
* М м м л р м .
*
* Требования:
* 1. Программа должна считывать данные с клавиатуры.
* 2. Программа должна выводить две строки.
* 3. Первая строка должна содержать только гласные буквы из введенной строки, разделенные пробелом.
* 4. Вторая строка должна содержать только согласные и знаки препинания из введенной строки, разделенные пробелом.
* 5. Каждая строка должна заканчиваться пробелом.
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class Solution {
public static char[] vowels = new char[]{'а', 'я', 'у', 'ю', 'и', 'ы', 'э', 'е', 'о', 'ё'};
public static void main(String[] args) throws Exception {
//напишите тут ваш код
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
char[] chArr = reader.readLine().toCharArray();
ArrayList<Character> listVow = new ArrayList<>();
ArrayList<Character> listNVow = new ArrayList<>();
for (int i = 0; i < chArr.length; i++) {
if (isVowel(chArr[i])) {
listVow.add(chArr[i]);
} else if (chArr[i] == ' ') {
continue;
} else {
listNVow.add(chArr[i]);
}
}
for (char c : listVow) {
System.out.print(c + " ");
}
System.out.println();
for (char c : listNVow) {
System.out.print(c + " ");
}
}
// метод проверяет, гласная ли буква
public static boolean isVowel(char c) {
// приводим символ в нижний регистр - от заглавных к строчным буквам
c = Character.toLowerCase(c);
// ищем среди массива гласных
for (char d : vowels) {
if (c == d) {
return true;
}
}
return false;
}
} | 3,043 | 0.608126 | 0.602883 | 68 | 32.676472 | 26.648275 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 2 |
ad5b6af6220de643309f5e98fcf0c2fd4d6736b9 | 13,108,240,208,505 | bf8a52c57c390e5a5670048d6cbea8d289f437da | /src/main/java/com/mycompany/springbootproject/domain/DefaultDomain.java | 4edb887a4be32f4014b355d449d77db0ed086053 | [] | no_license | wmfsystem/AprendendoSpringBoot | https://github.com/wmfsystem/AprendendoSpringBoot | 030fa2b73d0ba638b1cc8830b42e2b0ccfb3252c | 8ea2adfa5d03f6fe4146d60d300b1a813ee8d89e | refs/heads/master | 2020-12-25T15:08:22.964000 | 2016-09-02T01:21:33 | 2016-09-02T01:21:33 | 66,229,761 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mycompany.springbootproject.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
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.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.constraints.NotEmpty;
/**
*
* @author wmfsystem
* @param <ID> Tipo do ID
*/
@MappedSuperclass
public abstract class DefaultDomain<ID extends Serializable> implements Serializable {
@Column(name = "oi")
@JsonInclude(JsonInclude.Include.NON_NULL)
protected String oi;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", nullable = false)
@NotEmpty(message = "O campo ID não pode ser nulo!")
protected ID id;
@Column(name = "registration")
@Temporal(TemporalType.TIMESTAMP)
@JsonFormat(pattern = "dd/MM/YYYY")
protected Date registration;
public DefaultDomain() {
}
public ID getId() {
return id;
}
public void setId(ID id) {
this.id = id;
}
public String getOi() {
return oi;
}
public void setOi(String oi) {
this.oi = oi;
}
public Date getRegistration() {
return registration;
}
public void setRegistration(Date registration) {
this.registration = registration;
}
}
| UTF-8 | Java | 1,553 | java | DefaultDomain.java | Java | [
{
"context": "validator.constraints.NotEmpty;\n\n/**\n *\n * @author wmfsystem\n * @param <ID> Tipo do ID\n */\n@MappedSuperclass\np",
"end": 548,
"score": 0.9995941519737244,
"start": 539,
"tag": "USERNAME",
"value": "wmfsystem"
}
] | null | [] | package com.mycompany.springbootproject.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
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.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.constraints.NotEmpty;
/**
*
* @author wmfsystem
* @param <ID> Tipo do ID
*/
@MappedSuperclass
public abstract class DefaultDomain<ID extends Serializable> implements Serializable {
@Column(name = "oi")
@JsonInclude(JsonInclude.Include.NON_NULL)
protected String oi;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id", nullable = false)
@NotEmpty(message = "O campo ID não pode ser nulo!")
protected ID id;
@Column(name = "registration")
@Temporal(TemporalType.TIMESTAMP)
@JsonFormat(pattern = "dd/MM/YYYY")
protected Date registration;
public DefaultDomain() {
}
public ID getId() {
return id;
}
public void setId(ID id) {
this.id = id;
}
public String getOi() {
return oi;
}
public void setOi(String oi) {
this.oi = oi;
}
public Date getRegistration() {
return registration;
}
public void setRegistration(Date registration) {
this.registration = registration;
}
}
| 1,553 | 0.699742 | 0.699742 | 66 | 22.515152 | 19.313398 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.348485 | false | false | 2 |
ab553c1276aa5966e39aeaaf29b7581e210dbd9b | 15,264,313,786,205 | bcf05225c817551eb9e2366f070bb5c4a2b4488e | /src/test/java/com/delicate/forum/MapperTest.java | 8b1627e0599eae71cc39e9305a9b71288b7fb8f7 | [] | no_license | TheAllenAnker/forum | https://github.com/TheAllenAnker/forum | cf9efc2e2100ef4fa61179f4dcaf948e209c296b | 8364798e089e8947a62a89d80cf8a18c74c59e10 | refs/heads/master | 2021-01-27T08:18:34.955000 | 2020-03-01T08:23:27 | 2020-03-01T08:23:27 | 243,475,825 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.delicate.forum;
import com.delicate.forum.dao.DiscussPostMapper;
import com.delicate.forum.dao.LoginTicketMapper;
import com.delicate.forum.dao.MessageMapper;
import com.delicate.forum.dao.UserMapper;
import com.delicate.forum.entity.DiscussPost;
import com.delicate.forum.entity.LoginTicket;
import com.delicate.forum.entity.Message;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import java.util.Date;
import java.util.List;
@SpringBootTest
@ContextConfiguration(classes = ForumApplication.class)
public class MapperTest {
@Autowired
private UserMapper userMapper;
@Autowired
private DiscussPostMapper discussPostMapper;
@Autowired
private LoginTicketMapper loginTicketMapper;
@Autowired
private MessageMapper messageMapper;
@Test
public void testSelectUser() {
System.out.println(userMapper.selectById(101));
}
@Test
public void testSelectPosts() {
List<DiscussPost> postList = discussPostMapper.selectDiscussPosts(0, 0, 10);
for (DiscussPost post : postList) {
System.out.println(post);
}
}
@Test
public void testInsertLoginTicket() {
LoginTicket loginTicket = new LoginTicket();
loginTicket.setUserId(1234341);
loginTicket.setTicket("abc");
loginTicket.setStatus(0);
loginTicket.setExpired(new Date(System.currentTimeMillis() + 1000 * 60 * 10));
loginTicketMapper.insertLoginTicket(loginTicket);
}
@Test
public void testMessageMapper() {
List<Message> messages = messageMapper.selectLatestConversations(111, 0, 20);
for (Message message : messages) {
System.out.println(message);
}
int count = messageMapper.selectConversationCount(111);
System.out.println(count);
messages = messageMapper.selectMessageByConversation("111_112", 0, 10);
for (Message message : messages) {
System.out.println(message);
}
count = messageMapper.selectMessageCountByConversation("111_112");
System.out.println(count);
int totalUnreadCount = messageMapper.selectMessageUnreadCount(131, "111_131");
System.out.println(totalUnreadCount);
}
}
| UTF-8 | Java | 2,417 | java | MapperTest.java | Java | [] | null | [] | package com.delicate.forum;
import com.delicate.forum.dao.DiscussPostMapper;
import com.delicate.forum.dao.LoginTicketMapper;
import com.delicate.forum.dao.MessageMapper;
import com.delicate.forum.dao.UserMapper;
import com.delicate.forum.entity.DiscussPost;
import com.delicate.forum.entity.LoginTicket;
import com.delicate.forum.entity.Message;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import java.util.Date;
import java.util.List;
@SpringBootTest
@ContextConfiguration(classes = ForumApplication.class)
public class MapperTest {
@Autowired
private UserMapper userMapper;
@Autowired
private DiscussPostMapper discussPostMapper;
@Autowired
private LoginTicketMapper loginTicketMapper;
@Autowired
private MessageMapper messageMapper;
@Test
public void testSelectUser() {
System.out.println(userMapper.selectById(101));
}
@Test
public void testSelectPosts() {
List<DiscussPost> postList = discussPostMapper.selectDiscussPosts(0, 0, 10);
for (DiscussPost post : postList) {
System.out.println(post);
}
}
@Test
public void testInsertLoginTicket() {
LoginTicket loginTicket = new LoginTicket();
loginTicket.setUserId(1234341);
loginTicket.setTicket("abc");
loginTicket.setStatus(0);
loginTicket.setExpired(new Date(System.currentTimeMillis() + 1000 * 60 * 10));
loginTicketMapper.insertLoginTicket(loginTicket);
}
@Test
public void testMessageMapper() {
List<Message> messages = messageMapper.selectLatestConversations(111, 0, 20);
for (Message message : messages) {
System.out.println(message);
}
int count = messageMapper.selectConversationCount(111);
System.out.println(count);
messages = messageMapper.selectMessageByConversation("111_112", 0, 10);
for (Message message : messages) {
System.out.println(message);
}
count = messageMapper.selectMessageCountByConversation("111_112");
System.out.println(count);
int totalUnreadCount = messageMapper.selectMessageUnreadCount(131, "111_131");
System.out.println(totalUnreadCount);
}
}
| 2,417 | 0.711626 | 0.688457 | 78 | 29.987179 | 24.795313 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.564103 | false | false | 2 |
59fcd269faf009e825758a93d1bc6ef6b3f7a7c8 | 29,257,317,222,148 | a7fde31769c418db0abf4f55ec23f6d642406c8d | /gather-core/src/main/java/com/cdyoue/gather/service/FileStorageService.java | ffa8e15ae2a83aa844e250b3ae84a92baabb277b | [] | no_license | nchuxyz/gather | https://github.com/nchuxyz/gather | f5c6c65645c66ce326a62913451faa56dba684c9 | d9c6b08afc6f10ca03254c922271a65528a976b8 | refs/heads/master | 2020-04-18T11:02:50.816000 | 2019-01-25T05:34:35 | 2019-01-25T05:34:35 | 167,487,059 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cdyoue.gather.service;
import java.io.InputStream;
import java.io.OutputStream;
/**
* 文件存储服务
*
* @author zhuyiqiang
* @version 2018/12/6
*/
public interface FileStorageService {
/**
* 服务启动
*/
void start() throws Exception;
/**
* 上传一个文件
*
* @param objectName 文件名
* @param in 输入流
* @return 文件名,用于objectName被修改的情况
*/
String upload(String objectName, InputStream in) throws Exception;
/**
* 上传一个文件
*
* @param objectName 文件名
* @param content 待上传的内容
* @return 文件名,用于objectName被修改的情况
*/
String upload(String objectName, byte[] content) throws Exception;
/**
* 下载一个文件
*
* @param objectName 文件名
* @param out 输出流
*/
void download(String objectName, OutputStream out) throws Exception;
/**
* 下载一个文件
*
* @param objectName 文件名
* @return 下载内容
*/
byte[] download(String objectName) throws Exception;
} | UTF-8 | Java | 1,209 | java | FileStorageService.java | Java | [
{
"context": "io.OutputStream;\r\n\r\n/**\r\n * 文件存储服务\r\n *\r\n * @author zhuyiqiang\r\n * @version 2018/12/6\r\n */\r\npublic interface Fil",
"end": 140,
"score": 0.9988734126091003,
"start": 130,
"tag": "USERNAME",
"value": "zhuyiqiang"
}
] | null | [] | package com.cdyoue.gather.service;
import java.io.InputStream;
import java.io.OutputStream;
/**
* 文件存储服务
*
* @author zhuyiqiang
* @version 2018/12/6
*/
public interface FileStorageService {
/**
* 服务启动
*/
void start() throws Exception;
/**
* 上传一个文件
*
* @param objectName 文件名
* @param in 输入流
* @return 文件名,用于objectName被修改的情况
*/
String upload(String objectName, InputStream in) throws Exception;
/**
* 上传一个文件
*
* @param objectName 文件名
* @param content 待上传的内容
* @return 文件名,用于objectName被修改的情况
*/
String upload(String objectName, byte[] content) throws Exception;
/**
* 下载一个文件
*
* @param objectName 文件名
* @param out 输出流
*/
void download(String objectName, OutputStream out) throws Exception;
/**
* 下载一个文件
*
* @param objectName 文件名
* @return 下载内容
*/
byte[] download(String objectName) throws Exception;
} | 1,209 | 0.562199 | 0.555448 | 51 | 18.372549 | 18.407118 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.215686 | false | false | 2 |
6051d8b14efa1ecfa5923c4f77e6bfd5d750e6ca | 21,053,929,734,222 | ba0d184bc4229fd2bd25f932b6a62749bbc9a1e4 | /Android tutorials-29-Firebase #5. Insert new json with image/code/app/src/main/java/com/example/hoangnd/androidturotialproject/MainActivity.java | 011e310aecf9e0a1fddb8e7cf1d98f19f394e086 | [] | no_license | sunlight3d/android_tutorials | https://github.com/sunlight3d/android_tutorials | 91c20847c3ec98dbd5069bc6a5a7162782467472 | 2ef9fe9ac24729d655e9b1cc0e055b3438380e46 | refs/heads/master | 2021-01-20T05:10:44.818000 | 2017-07-20T03:34:34 | 2017-07-20T03:34:34 | 89,757,572 | 11 | 10 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.hoangnd.androidturotialproject;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
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.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.io.ByteArrayOutputStream;
import java.util.Map;
public class MainActivity extends AppCompatActivity {
private DatabaseReference databaseReference;
private EditText editTextFlowerName;
private EditText editTextAmount;
private ImageView imageViewFlower;
private Button btnInsertData;
private String imageFileName;
private FirebaseStorage storage = FirebaseStorage.getInstance();
private StorageReference storageRef;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editTextFlowerName = (EditText) findViewById(R.id.editTextFlowerName);
editTextAmount = (EditText) findViewById(R.id.editTextAmount);
imageViewFlower = (ImageView) findViewById(R.id.imageViewFlower);
btnInsertData = (Button)findViewById(R.id.btnInsertData);
databaseReference = FirebaseDatabase.getInstance().getReference();
storageRef = storage.getReferenceFromUrl("gs://androidtutorialproject.appspot.com/images");
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if(dataSnapshot.getValue() == null) {
return;
}
Map<String, Object> updatedFlower = (Map<String, Object>) dataSnapshot.getValue();
Log.i("MainActivity", "updatedFlower = "+updatedFlower.toString());
}
@Override
public void onCancelled(DatabaseError databaseError) {
Log.i("MainActivity", "onCancelled");
}
});
// storageRef = storage.getReference();
}
public void handleInsertData(View view) {
//validate
if(TextUtils.isEmpty(editTextFlowerName.getText().toString())) {
Toast.makeText(this, "Flower name cannot be null !", Toast.LENGTH_SHORT);
return;
}
if(TextUtils.isEmpty(editTextAmount.getText().toString())) {
Toast.makeText(this, "Flower amount cannot be null !", Toast.LENGTH_SHORT);
return;
}
if(imageViewFlower.getDrawable() == null) {
//Image is blank
Toast.makeText(this, "You must select image !", Toast.LENGTH_SHORT);
return;
}
Flower newFlower = new Flower(editTextFlowerName.getText().toString(),
imageFileName,
Integer.parseInt(editTextAmount.getText().toString()));
databaseReference.child(newFlower.name).setValue(newFlower);
Toast.makeText(MainActivity.this, "Add json and upload image OK !", Toast.LENGTH_SHORT);
}
public void handleChooseImage(View view) {
Intent pickerPhotoIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(pickerPhotoIntent, 1);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
switch (requestCode) {
case 0:
if(requestCode == RESULT_OK) {
Log.i("MainActivity", "case 0");
}
break;
case 1:
if(resultCode == RESULT_OK) {
Uri selectedImage = imageReturnedIntent.getData();
Log.i("MainActivity", "selected Image = "+selectedImage);
this.imageViewFlower.setImageURI(selectedImage);
this.uploadImageToFirebase();
}
break;
}
}
private void uploadImageToFirebase() {
// Get the data from an ImageView as bytes
this.imageViewFlower.setDrawingCacheEnabled(true);
this.imageViewFlower.buildDrawingCache();
Bitmap bitmap = this.imageViewFlower.getDrawingCache();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] data = baos.toByteArray();
// StorageReference mountainsRef = storageRef.child("myimagename.jpg");
this.imageFileName = StringUtility.getRandomString(20) + ".jpg";
StorageReference flowerRef = storageRef.child(imageFileName);
Log.i("MainActivity", ""+"image file name = "+imageFileName);
UploadTask uploadTask = flowerRef.putBytes(data);
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.i("MainActivity", "Upload failed");
}
}).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
// taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.
Uri downloadUrl = taskSnapshot.getDownloadUrl();
Log.i("MainActivity", "Upload successful, downloadUrl = "+downloadUrl);
}
});
}
}
| UTF-8 | Java | 6,270 | java | MainActivity.java | Java | [
{
"context": "package com.example.hoangnd.androidturotialproject;\n\nimport android.content.I",
"end": 27,
"score": 0.664296567440033,
"start": 20,
"tag": "USERNAME",
"value": "hoangnd"
}
] | null | [] | package com.example.hoangnd.androidturotialproject;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
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.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.io.ByteArrayOutputStream;
import java.util.Map;
public class MainActivity extends AppCompatActivity {
private DatabaseReference databaseReference;
private EditText editTextFlowerName;
private EditText editTextAmount;
private ImageView imageViewFlower;
private Button btnInsertData;
private String imageFileName;
private FirebaseStorage storage = FirebaseStorage.getInstance();
private StorageReference storageRef;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editTextFlowerName = (EditText) findViewById(R.id.editTextFlowerName);
editTextAmount = (EditText) findViewById(R.id.editTextAmount);
imageViewFlower = (ImageView) findViewById(R.id.imageViewFlower);
btnInsertData = (Button)findViewById(R.id.btnInsertData);
databaseReference = FirebaseDatabase.getInstance().getReference();
storageRef = storage.getReferenceFromUrl("gs://androidtutorialproject.appspot.com/images");
databaseReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if(dataSnapshot.getValue() == null) {
return;
}
Map<String, Object> updatedFlower = (Map<String, Object>) dataSnapshot.getValue();
Log.i("MainActivity", "updatedFlower = "+updatedFlower.toString());
}
@Override
public void onCancelled(DatabaseError databaseError) {
Log.i("MainActivity", "onCancelled");
}
});
// storageRef = storage.getReference();
}
public void handleInsertData(View view) {
//validate
if(TextUtils.isEmpty(editTextFlowerName.getText().toString())) {
Toast.makeText(this, "Flower name cannot be null !", Toast.LENGTH_SHORT);
return;
}
if(TextUtils.isEmpty(editTextAmount.getText().toString())) {
Toast.makeText(this, "Flower amount cannot be null !", Toast.LENGTH_SHORT);
return;
}
if(imageViewFlower.getDrawable() == null) {
//Image is blank
Toast.makeText(this, "You must select image !", Toast.LENGTH_SHORT);
return;
}
Flower newFlower = new Flower(editTextFlowerName.getText().toString(),
imageFileName,
Integer.parseInt(editTextAmount.getText().toString()));
databaseReference.child(newFlower.name).setValue(newFlower);
Toast.makeText(MainActivity.this, "Add json and upload image OK !", Toast.LENGTH_SHORT);
}
public void handleChooseImage(View view) {
Intent pickerPhotoIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(pickerPhotoIntent, 1);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
switch (requestCode) {
case 0:
if(requestCode == RESULT_OK) {
Log.i("MainActivity", "case 0");
}
break;
case 1:
if(resultCode == RESULT_OK) {
Uri selectedImage = imageReturnedIntent.getData();
Log.i("MainActivity", "selected Image = "+selectedImage);
this.imageViewFlower.setImageURI(selectedImage);
this.uploadImageToFirebase();
}
break;
}
}
private void uploadImageToFirebase() {
// Get the data from an ImageView as bytes
this.imageViewFlower.setDrawingCacheEnabled(true);
this.imageViewFlower.buildDrawingCache();
Bitmap bitmap = this.imageViewFlower.getDrawingCache();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] data = baos.toByteArray();
// StorageReference mountainsRef = storageRef.child("myimagename.jpg");
this.imageFileName = StringUtility.getRandomString(20) + ".jpg";
StorageReference flowerRef = storageRef.child(imageFileName);
Log.i("MainActivity", ""+"image file name = "+imageFileName);
UploadTask uploadTask = flowerRef.putBytes(data);
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.i("MainActivity", "Upload failed");
}
}).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
// taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.
Uri downloadUrl = taskSnapshot.getDownloadUrl();
Log.i("MainActivity", "Upload successful, downloadUrl = "+downloadUrl);
}
});
}
}
| 6,270 | 0.669537 | 0.667943 | 152 | 40.25 | 28.819595 | 129 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.736842 | false | false | 2 |
1ccac2bfc9a1ab1f3969d52675ec73e16c339700 | 28,750,511,133,838 | 22689ed9cb37c46c538dbc62e04e55a5aeda31f0 | /DPWSim-WS4D-JMEDS5/src/org/ws4d/java/util/Math.java | 09e76a1f0c5f97f0573456d41481a9e85f169bfa | [] | no_license | sonhan/dpwsim | https://github.com/sonhan/dpwsim | e96e3e5093cb5acf60928538aebce0ebb44362d5 | 12361d3acb917d347461f941d1f02c477f3e1383 | refs/heads/master | 2020-05-17T03:51:22.252000 | 2017-08-01T04:52:28 | 2017-08-01T04:52:28 | 15,965,184 | 4 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*******************************************************************************
* Copyright (c) 2009 MATERNA Information & Communications. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html. For further
* project-related information visit http://www.ws4d.org. The most recent
* version of the JMEDS framework can be obtained from
* http://sourceforge.net/projects/ws4d-javame.
******************************************************************************/
package org.ws4d.java.util;
import java.util.Random;
/**
* Some maths functions missing on CLDC.
*/
public final class Math {
private static Random r = new Random(System.currentTimeMillis());
/**
* Returns a random value in the range [min, max[. When min == max, returns
* min. When min > max, returns nextInt(max, min).
*
* @param min The lower bound. Inclusive.
* @param max The upper bound. Exclusive.
* @return a random value in the range [min, max[.
*/
public static int nextInt(int min, int max) {
if (max == min) {
return max;
}
if (min > max) {
return nextInt(max, min);
}
int range = max - min;
int val = java.lang.Math.abs(r.nextInt() % range);
return val + min;
}
/**
* Returns a random value in the range [0, max[.
*
* @param max The upper bound. Exclusive.
* @return a random value in the range [0, max[.
*/
public static int nextInt(int max) {
return Math.nextInt(0, max);
}
/**
* Returns a random integer value.
*
* @return a random integer value.
*/
public static int nextInt() {
return r.nextInt();
}
/**
* Generates a random port number between 1025 and 65535.
*
* @return a random number to try as port number for the server.
*/
public static int getRandomPortNumber() {
return (r.nextInt() & 0xefff) + 1025;
}
/**
* Returns the Random generated by MathUtil.
*
* @return <code>Random</code>;
*/
public static Random getRandom() {
return r;
}
public static int pow(int a, int b) {
if (b == 0) return 1;
if (b == 1) return a;
int c = a;
while (b > 1) {
a = a * c;
b--;
}
return a;
}
}
| UTF-8 | Java | 2,373 | java | Math.java | Java | [] | null | [] | /*******************************************************************************
* Copyright (c) 2009 MATERNA Information & Communications. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html. For further
* project-related information visit http://www.ws4d.org. The most recent
* version of the JMEDS framework can be obtained from
* http://sourceforge.net/projects/ws4d-javame.
******************************************************************************/
package org.ws4d.java.util;
import java.util.Random;
/**
* Some maths functions missing on CLDC.
*/
public final class Math {
private static Random r = new Random(System.currentTimeMillis());
/**
* Returns a random value in the range [min, max[. When min == max, returns
* min. When min > max, returns nextInt(max, min).
*
* @param min The lower bound. Inclusive.
* @param max The upper bound. Exclusive.
* @return a random value in the range [min, max[.
*/
public static int nextInt(int min, int max) {
if (max == min) {
return max;
}
if (min > max) {
return nextInt(max, min);
}
int range = max - min;
int val = java.lang.Math.abs(r.nextInt() % range);
return val + min;
}
/**
* Returns a random value in the range [0, max[.
*
* @param max The upper bound. Exclusive.
* @return a random value in the range [0, max[.
*/
public static int nextInt(int max) {
return Math.nextInt(0, max);
}
/**
* Returns a random integer value.
*
* @return a random integer value.
*/
public static int nextInt() {
return r.nextInt();
}
/**
* Generates a random port number between 1025 and 65535.
*
* @return a random number to try as port number for the server.
*/
public static int getRandomPortNumber() {
return (r.nextInt() & 0xefff) + 1025;
}
/**
* Returns the Random generated by MathUtil.
*
* @return <code>Random</code>;
*/
public static Random getRandom() {
return r;
}
public static int pow(int a, int b) {
if (b == 0) return 1;
if (b == 1) return a;
int c = a;
while (b > 1) {
a = a * c;
b--;
}
return a;
}
}
| 2,373 | 0.584914 | 0.571429 | 88 | 24.96591 | 24.783356 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.375 | false | false | 2 |
e89baed0ed85ee8e10daca5a41d22b6eaa52d27e | 32,040,456,089,073 | f0d1cbfd1b465fa8efe964dc35cc81945b3c7401 | /HomeProject8/CreateDbSQL.java | 2ba731ddfb1af2b34d89d901f23e5632c13f7791 | [] | no_license | Art14K/X5_java_maven | https://github.com/Art14K/X5_java_maven | 206f7144093b42ce3e5777451f06c9ca418c5ee8 | 580f12bd1fbfc35197f11d2200f3b05f599ca066 | refs/heads/master | 2023-01-22T16:46:12.409000 | 2020-11-24T08:47:02 | 2020-11-24T08:47:02 | 315,563,766 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.*;
import java.sql.*;
public class CreateDbSQL {
private final Connection connection;
private String sql_query;
private ResultSet result;
private Statement statement;
private int i = 0; // Переменная для подсчёта количества строк в базе данных
private String[] config;
CreateDbSQL(Connection connection) {
this.connection = connection;
}
public void create() throws SQLException {
sql_query = "SELECT FROM base;";
try {
statement = connection.createStatement();
try {
result = statement.executeQuery(sql_query);
while (result.next()) {
i++;
}
} catch (SQLException exc) {
System.out.println("База данных SQL отсутствует" + exc.getMessage());
} finally {
if (result != null) result.close();
}
} finally {
if (statement != null) statement.close();
}
if (i == 0) {
System.out.println("База данных отсутствует. Создаю новую базу....");
sql_query = "CREATE TABLE base (Id SERIAL PRIMARY KEY, holder VARCHAR(40), amount DOUBLE PRECISION);";
try {
statement = connection.createStatement();
try {
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (1, 'Иван Петров', 18000);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (2, 'Сергей Николаев', 186000);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (3, 'Михаил Николаев', 29300);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (4, 'Татьяна Николаева', 52300);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (5, 'Ирина Никоненко', 86600);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (6, 'Алексей Дмитриев', 12800);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (7, 'Иван Соболев', 49600);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (8, 'Михаил Дурманов', 56100);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (9, 'Наталья Беляева', 120900);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (10, 'Денис Алексеев', 42100);";
statement.executeUpdate(sql_query);
System.out.println("Создана новая база данных.");
System.out.println("Нажмите Enter");
} catch (SQLException exc) {
System.out.println("Не удалось создать таблицу : " + exc.getMessage());
} finally {
if (result != null) result.close();
}
} finally {
if (statement != null) statement.close();
}
}
}
}
| UTF-8 | Java | 3,623 | java | CreateDbSQL.java | Java | [
{
"context": " sql_query = \"INSERT INTO base VALUES (1, 'Иван Петров', 18000);\";\n statement.execute",
"end": 1464,
"score": 0.9998528361320496,
"start": 1453,
"tag": "NAME",
"value": "Иван Петров"
},
{
"context": " sql_query = \"INSERT INTO base VA... | null | [] | import java.util.*;
import java.sql.*;
public class CreateDbSQL {
private final Connection connection;
private String sql_query;
private ResultSet result;
private Statement statement;
private int i = 0; // Переменная для подсчёта количества строк в базе данных
private String[] config;
CreateDbSQL(Connection connection) {
this.connection = connection;
}
public void create() throws SQLException {
sql_query = "SELECT FROM base;";
try {
statement = connection.createStatement();
try {
result = statement.executeQuery(sql_query);
while (result.next()) {
i++;
}
} catch (SQLException exc) {
System.out.println("База данных SQL отсутствует" + exc.getMessage());
} finally {
if (result != null) result.close();
}
} finally {
if (statement != null) statement.close();
}
if (i == 0) {
System.out.println("База данных отсутствует. Создаю новую базу....");
sql_query = "CREATE TABLE base (Id SERIAL PRIMARY KEY, holder VARCHAR(40), amount DOUBLE PRECISION);";
try {
statement = connection.createStatement();
try {
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (1, '<NAME>', 18000);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (2, '<NAME>', 186000);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (3, '<NAME>', 29300);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (4, '<NAME>', 52300);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (5, '<NAME>', 86600);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (6, '<NAME>', 12800);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (7, '<NAME>', 49600);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (8, '<NAME>', 56100);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (9, '<NAME>', 120900);";
statement.executeUpdate(sql_query);
sql_query = "INSERT INTO base VALUES (10, '<NAME>', 42100);";
statement.executeUpdate(sql_query);
System.out.println("Создана новая база данных.");
System.out.println("Нажмите Enter");
} catch (SQLException exc) {
System.out.println("Не удалось создать таблицу : " + exc.getMessage());
} finally {
if (result != null) result.close();
}
} finally {
if (statement != null) statement.close();
}
}
}
}
| 3,403 | 0.52611 | 0.506002 | 76 | 42.828949 | 29.693783 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.039474 | false | false | 2 |
d7d8c4d09ad7d1fd59808008403abdb008fea1f3 | 2,637,109,971,220 | f186ecf2e264b17ccbf71e1d23a8bab99b027ea8 | /Lab3 primes.java | 5faa6010041d0cf6ca3a15293bd233904d611c18 | [] | no_license | JemmaMolloy/CS210 | https://github.com/JemmaMolloy/CS210 | 515c6d077e57d0cdc77cb02e71a93e859ddbed34 | 63e6774d2304cf7e1fc0bb7026ea82e73783d6a7 | refs/heads/master | 2021-01-06T18:33:28.183000 | 2020-06-21T11:12:04 | 2020-06-21T11:12:04 | 241,441,135 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.*;
public class Solution
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int y = scan.nextInt();
int lowerbound = 0;
int upperbound = 0;
int count = 0;
boolean value = true;
if (x<y)
{
lowerbound = x;
upperbound = y;
}
else
{
lowerbound = y;
upperbound = x;
}
for(int i =lowerbound; i<=upperbound;i++)
{
boolean isprime = true;
for(int j = 2;j< = Math.sqrt(i); j++)
{
if(i%j==0)
{
isprime=false;
}
}
if(isprime)
{
count++;
}
}
System.out.println(count);
}
}
| UTF-8 | Java | 945 | java | Lab3 primes.java | Java | [] | null | [] | import java.util.*;
public class Solution
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
int y = scan.nextInt();
int lowerbound = 0;
int upperbound = 0;
int count = 0;
boolean value = true;
if (x<y)
{
lowerbound = x;
upperbound = y;
}
else
{
lowerbound = y;
upperbound = x;
}
for(int i =lowerbound; i<=upperbound;i++)
{
boolean isprime = true;
for(int j = 2;j< = Math.sqrt(i); j++)
{
if(i%j==0)
{
isprime=false;
}
}
if(isprime)
{
count++;
}
}
System.out.println(count);
}
}
| 945 | 0.365079 | 0.359788 | 51 | 17.529411 | 13.473799 | 49 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.392157 | false | false | 2 |
1fb061b316ae5695199610afcafdbb0d06f60299 | 6,390,911,336,958 | d3e5a6a90858a93e01d7b93ce0f5a80f33d712ec | /src/main/java/com/travix/dto/adapter/CrazyAirAdapter.java | 05e9d80a2c0cecc8fcc835b7775df37e27c44ae6 | [] | no_license | zaurguliyev/busyflights | https://github.com/zaurguliyev/busyflights | 6b81e0bda53271250c7ec14640b21587ce20c150 | 83c2c2f7e0307e4ff4392fb3b055eaf8720bd477 | refs/heads/master | 2018-10-20T05:16:07.869000 | 2017-03-30T18:49:13 | 2017-03-30T18:49:13 | 82,772,700 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.travix.dto.adapter;
import com.travix.dto.response.BFFlightResponseDTO;
import com.travix.dto.response.CAFlightResponseDTO;
import com.travix.entity.CrazyAirFlights;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zaur.guliyev
*/
public class CrazyAirAdapter {
public static List<CAFlightResponseDTO> toCrazyFlightsResponseDTO(List<CrazyAirFlights> crazyAirFlights) {
return crazyAirFlights.stream()
.map(CrazyAirAdapter::toCrazyFlightsResponseDTO)
.collect(Collectors.<CAFlightResponseDTO>toList());
}
public static CAFlightResponseDTO toCrazyFlightsResponseDTO(CrazyAirFlights crazyAirFlight) {
CAFlightResponseDTO flightDTO = new CAFlightResponseDTO();
flightDTO.setAirline(crazyAirFlight.getAirline());
flightDTO.setPrice(crazyAirFlight.getPrice());
flightDTO.setCabinclass(crazyAirFlight.getCabinclass());
flightDTO.setDepartureAirportCode(crazyAirFlight.getDepartureAirportCode());
flightDTO.setDestinationAirportCode(crazyAirFlight.getDestinationAirportCode());
flightDTO.setDepartureDate(crazyAirFlight.getDepartureDate());
flightDTO.setArrivalDate(crazyAirFlight.getArrivalDate());
return flightDTO;
}
public static List<BFFlightResponseDTO> toBusyFlightsResponseDTO(List<CAFlightResponseDTO> crazyAirFlights) {
return crazyAirFlights.stream()
.map(CrazyAirAdapter::toBusyFlightsResponseDTO)
.collect(Collectors.<BFFlightResponseDTO>toList());
}
public static BFFlightResponseDTO toBusyFlightsResponseDTO(CAFlightResponseDTO caFlightResponseDTO) {
BFFlightResponseDTO bfFlightResponseDTO = new BFFlightResponseDTO();
bfFlightResponseDTO.setAirline(caFlightResponseDTO.getAirline());
bfFlightResponseDTO.setSupplier("CrazyAir");
bfFlightResponseDTO.setFare(caFlightResponseDTO.getPrice());
bfFlightResponseDTO.setDepartureAirportCode(caFlightResponseDTO.getDepartureAirportCode());
bfFlightResponseDTO.setDestinationAirportCode(caFlightResponseDTO.getDestinationAirportCode());
bfFlightResponseDTO.setDepartureDate(caFlightResponseDTO.getDepartureDate());
bfFlightResponseDTO.setArrivalDate(caFlightResponseDTO.getArrivalDate());
return bfFlightResponseDTO;
}
}
| UTF-8 | Java | 2,422 | java | CrazyAirAdapter.java | Java | [
{
"context": "rt java.util.stream.Collectors;\r\n\r\n/**\r\n * @author zaur.guliyev\r\n */\r\npublic class CrazyAirAdapter {\r\n\r\n public ",
"end": 277,
"score": 0.9453741312026978,
"start": 265,
"tag": "NAME",
"value": "zaur.guliyev"
}
] | null | [] | package com.travix.dto.adapter;
import com.travix.dto.response.BFFlightResponseDTO;
import com.travix.dto.response.CAFlightResponseDTO;
import com.travix.entity.CrazyAirFlights;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zaur.guliyev
*/
public class CrazyAirAdapter {
public static List<CAFlightResponseDTO> toCrazyFlightsResponseDTO(List<CrazyAirFlights> crazyAirFlights) {
return crazyAirFlights.stream()
.map(CrazyAirAdapter::toCrazyFlightsResponseDTO)
.collect(Collectors.<CAFlightResponseDTO>toList());
}
public static CAFlightResponseDTO toCrazyFlightsResponseDTO(CrazyAirFlights crazyAirFlight) {
CAFlightResponseDTO flightDTO = new CAFlightResponseDTO();
flightDTO.setAirline(crazyAirFlight.getAirline());
flightDTO.setPrice(crazyAirFlight.getPrice());
flightDTO.setCabinclass(crazyAirFlight.getCabinclass());
flightDTO.setDepartureAirportCode(crazyAirFlight.getDepartureAirportCode());
flightDTO.setDestinationAirportCode(crazyAirFlight.getDestinationAirportCode());
flightDTO.setDepartureDate(crazyAirFlight.getDepartureDate());
flightDTO.setArrivalDate(crazyAirFlight.getArrivalDate());
return flightDTO;
}
public static List<BFFlightResponseDTO> toBusyFlightsResponseDTO(List<CAFlightResponseDTO> crazyAirFlights) {
return crazyAirFlights.stream()
.map(CrazyAirAdapter::toBusyFlightsResponseDTO)
.collect(Collectors.<BFFlightResponseDTO>toList());
}
public static BFFlightResponseDTO toBusyFlightsResponseDTO(CAFlightResponseDTO caFlightResponseDTO) {
BFFlightResponseDTO bfFlightResponseDTO = new BFFlightResponseDTO();
bfFlightResponseDTO.setAirline(caFlightResponseDTO.getAirline());
bfFlightResponseDTO.setSupplier("CrazyAir");
bfFlightResponseDTO.setFare(caFlightResponseDTO.getPrice());
bfFlightResponseDTO.setDepartureAirportCode(caFlightResponseDTO.getDepartureAirportCode());
bfFlightResponseDTO.setDestinationAirportCode(caFlightResponseDTO.getDestinationAirportCode());
bfFlightResponseDTO.setDepartureDate(caFlightResponseDTO.getDepartureDate());
bfFlightResponseDTO.setArrivalDate(caFlightResponseDTO.getArrivalDate());
return bfFlightResponseDTO;
}
}
| 2,422 | 0.751858 | 0.751858 | 50 | 46.439999 | 35.191566 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52 | false | false | 2 |
6ab8193b20b932045c7f60f963602d462c74a9be | 33,440,615,391,088 | 7649bff49af8063b284f52aedec7c313885d7b58 | /src/main/java/com/example/university/dto/lectureService/getJournal/LectureDTO.java | 2a8a7f0002ed6c7c25431afcde199570fd83ee20 | [] | no_license | niyazkadirov/university | https://github.com/niyazkadirov/university | c3c28998cba1ac35f5fcd74fb96c0e081bf864f7 | d87f12ca710d990183529c126e1ef8a6c3df82fc | refs/heads/master | 2021-01-07T12:59:32.856000 | 2020-03-10T13:36:23 | 2020-03-10T13:36:23 | 241,701,601 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.university.dto.lectureService.getJournal;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.time.Duration;
import java.time.LocalTime;
import java.util.List;
@AllArgsConstructor
@Getter
@Setter
public class LectureDTO {
String title;
LocalTime startTime;
LocalTime endTime;
Duration duration;
List<StudentDTO> studentDTO;
}
| UTF-8 | Java | 407 | java | LectureDTO.java | Java | [] | null | [] | package com.example.university.dto.lectureService.getJournal;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import java.time.Duration;
import java.time.LocalTime;
import java.util.List;
@AllArgsConstructor
@Getter
@Setter
public class LectureDTO {
String title;
LocalTime startTime;
LocalTime endTime;
Duration duration;
List<StudentDTO> studentDTO;
}
| 407 | 0.783784 | 0.783784 | 20 | 19.35 | 14.20308 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false | 2 |
faebb35ad030d5f09d0b7508cf3601ae6eca9218 | 11,175,504,925,352 | 096be495ae3e995d884f6154c0e5a00348e49d1d | /tries-leetcode/top-k-frequent-words.java | 5e22bdd4a557ff10c864df05c9ffa5ddb2adbd1e | [] | no_license | JackMGrundy/coding-challenges | https://github.com/JackMGrundy/coding-challenges | b81828efd580934226931735949c1fba1151dfac | 0ef3ef71d75ea20cd3079ad6aa3211f61efb7b7a | refs/heads/master | 2022-12-04T11:28:27.247000 | 2022-11-28T01:57:21 | 2022-11-28T01:57:21 | 163,903,589 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
Given a non-empty list of words, return the k most frequent elements.
Your answer should be sorted by frequency from highest to lowest. If two words have the same frequency, then the word with the lower alphabetical order comes first.
Example 1:
Input: ["i", "love", "leetcode", "i", "love", "coding"], k = 2
Output: ["i", "love"]
Explanation: "i" and "love" are the two most frequent words.
Note that "i" comes before "love" due to a lower alphabetical order.
Example 2:
Input: ["the", "day", "is", "sunny", "the", "the", "the", "sunny", "is", "is"], k = 4
Output: ["the", "is", "sunny", "day"]
Explanation: "the", "is", "sunny" and "day" are the four most frequent words,
with the number of occurrence being 4, 3, 2 and 1 respectively.
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Input words contain only lowercase letters.
Follow up:
Try to solve it in O(n log k) time and O(n) extra space.
*/
// 6ms. 96th percentile.
// technically n log n. using built ins.
import java.util.*;
class Solution {
public List<String> topKFrequent(String[] words, int k) {
Map<String, Integer> counts = new HashMap<String, Integer>();
for (String word : words) {
counts.put(word, counts.getOrDefault(word, 0)+1);
}
Comparator<String> wordCountsComparator = new Comparator<String>() {
public int compare(String a, String b) {
if (counts.get(a) != counts.get(b)) {
return counts.get(b) - counts.get(a);
} else {
return a.compareTo(b);
}
}
};
Set<String> uniqueWords = counts.keySet();
List<String> kMostFrequentWords = new ArrayList<String>(uniqueWords);
Collections.sort(kMostFrequentWords, wordCountsComparator);
return kMostFrequentWords.subList(0, k);
}
}
// 6ms. 96th percentile.
// nlogk using heap
import java.util.*;
class Solution {
public List<String> topKFrequent(String[] words, int k) {
Map<String, Integer> counts = new HashMap<String, Integer>();
for (String word : words) {
counts.put(word, counts.getOrDefault(word, 0)+1);
}
Comparator<String> wordCountsComparator = new Comparator<String>() {
public int compare(String a, String b) {
if (counts.get(a) != counts.get(b)) {
return counts.get(b) - counts.get(a);
} else {
return a.compareTo(b);
}
}
};
PriorityQueue<String> pq = new PriorityQueue<String>(wordCountsComparator);
List<String> kMostFrequentWords = new ArrayList<String>();
for (Map.Entry<String, Integer> entry : counts.entrySet()) {
pq.offer(entry.getKey());
}
for (int i = 0; i < k; i++) {
kMostFrequentWords.add(pq.poll());
}
return kMostFrequentWords;
}
} | UTF-8 | Java | 3,063 | java | top-k-frequent-words.java | Java | [] | null | [] | /*
Given a non-empty list of words, return the k most frequent elements.
Your answer should be sorted by frequency from highest to lowest. If two words have the same frequency, then the word with the lower alphabetical order comes first.
Example 1:
Input: ["i", "love", "leetcode", "i", "love", "coding"], k = 2
Output: ["i", "love"]
Explanation: "i" and "love" are the two most frequent words.
Note that "i" comes before "love" due to a lower alphabetical order.
Example 2:
Input: ["the", "day", "is", "sunny", "the", "the", "the", "sunny", "is", "is"], k = 4
Output: ["the", "is", "sunny", "day"]
Explanation: "the", "is", "sunny" and "day" are the four most frequent words,
with the number of occurrence being 4, 3, 2 and 1 respectively.
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Input words contain only lowercase letters.
Follow up:
Try to solve it in O(n log k) time and O(n) extra space.
*/
// 6ms. 96th percentile.
// technically n log n. using built ins.
import java.util.*;
class Solution {
public List<String> topKFrequent(String[] words, int k) {
Map<String, Integer> counts = new HashMap<String, Integer>();
for (String word : words) {
counts.put(word, counts.getOrDefault(word, 0)+1);
}
Comparator<String> wordCountsComparator = new Comparator<String>() {
public int compare(String a, String b) {
if (counts.get(a) != counts.get(b)) {
return counts.get(b) - counts.get(a);
} else {
return a.compareTo(b);
}
}
};
Set<String> uniqueWords = counts.keySet();
List<String> kMostFrequentWords = new ArrayList<String>(uniqueWords);
Collections.sort(kMostFrequentWords, wordCountsComparator);
return kMostFrequentWords.subList(0, k);
}
}
// 6ms. 96th percentile.
// nlogk using heap
import java.util.*;
class Solution {
public List<String> topKFrequent(String[] words, int k) {
Map<String, Integer> counts = new HashMap<String, Integer>();
for (String word : words) {
counts.put(word, counts.getOrDefault(word, 0)+1);
}
Comparator<String> wordCountsComparator = new Comparator<String>() {
public int compare(String a, String b) {
if (counts.get(a) != counts.get(b)) {
return counts.get(b) - counts.get(a);
} else {
return a.compareTo(b);
}
}
};
PriorityQueue<String> pq = new PriorityQueue<String>(wordCountsComparator);
List<String> kMostFrequentWords = new ArrayList<String>();
for (Map.Entry<String, Integer> entry : counts.entrySet()) {
pq.offer(entry.getKey());
}
for (int i = 0; i < k; i++) {
kMostFrequentWords.add(pq.poll());
}
return kMostFrequentWords;
}
} | 3,063 | 0.579928 | 0.573063 | 86 | 34.581394 | 29.539671 | 164 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.767442 | false | false | 2 |
d249fb9f3c620861a194ef99727e43c6932fbc5b | 32,736,240,757,418 | cc8a2d32e2a2f728dfcf1ac4c24b9cf804e15762 | /ProjectReversi/src/view/CellPane.java | 40a62f0efaf83bff90984fdd791d4c28b0095267 | [] | no_license | MXoneDay/ProjectReversi | https://github.com/MXoneDay/ProjectReversi | dccd7119e492fdc4c44b4a04b8abf5f61013c33f | bdd3896619757463715d527ad64780db7a38a97e | refs/heads/master | 2020-03-08T03:01:00.536000 | 2018-05-17T08:55:06 | 2018-05-17T08:55:06 | 127,878,332 | 0 | 0 | null | false | 2018-05-16T14:59:04 | 2018-04-03T08:45:20 | 2018-05-14T21:13:15 | 2018-05-16T14:59:04 | 2,186 | 0 | 0 | 0 | Java | false | null | package view;
import javafx.scene.layout.Pane;
public class CellPane extends Pane {
public final int loc, hor, ver;
public int filled = 3;
public CellPane(int loc, int hor, int ver){
this.loc = loc;
this.hor = hor;
this.ver = ver;
}
@Override
public String toString() {
return hor + "-" + ver + " " + filled;
}
}
| UTF-8 | Java | 336 | java | CellPane.java | Java | [] | null | [] | package view;
import javafx.scene.layout.Pane;
public class CellPane extends Pane {
public final int loc, hor, ver;
public int filled = 3;
public CellPane(int loc, int hor, int ver){
this.loc = loc;
this.hor = hor;
this.ver = ver;
}
@Override
public String toString() {
return hor + "-" + ver + " " + filled;
}
}
| 336 | 0.639881 | 0.636905 | 20 | 15.8 | 14.654692 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.5 | false | false | 2 |
fef5e2536ba9b07cc89ab2a1efc788c67ed77ae9 | 3,049,426,815,303 | 95d20c83d8aff34e314c56a3ecb2b87c9fa9fc86 | /Ghidra/Debug/Debugger-agent-dbgeng/src/main/java/agent/dbgeng/model/impl/DbgModelTargetDebugContainerImpl.java | b09f64641c6a610a4bf5604a4f570defdd0defac | [
"GPL-1.0-or-later",
"GPL-3.0-only",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LGPL-2.1-only",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | NationalSecurityAgency/ghidra | https://github.com/NationalSecurityAgency/ghidra | 969fe0d2ca25cb8ac72f66f0f90fc7fb2dbfa68d | 7cc135eb6bfabd166cbc23f7951dae09a7e03c39 | refs/heads/master | 2023-08-31T21:20:23.376000 | 2023-08-29T23:08:54 | 2023-08-29T23:08:54 | 173,228,436 | 45,212 | 6,204 | Apache-2.0 | false | 2023-09-14T18:00:39 | 2019-03-01T03:27:48 | 2023-09-14T16:08:34 | 2023-09-14T18:00:38 | 315,176 | 42,614 | 5,179 | 1,427 | Java | false | false | /* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package agent.dbgeng.model.impl;
import java.util.List;
import java.util.Map;
import agent.dbgeng.model.iface2.DbgModelTargetDebugContainer;
import agent.dbgeng.model.iface2.DbgModelTargetProcess;
import ghidra.dbg.target.schema.TargetAttributeType;
import ghidra.dbg.target.schema.TargetObjectSchemaInfo;
@TargetObjectSchemaInfo(
name = "DebugContainer",
attributes = {
@TargetAttributeType(
name = "Breakpoints",
type = DbgModelTargetBreakpointContainerImpl.class,
required = true,
fixed = true),
@TargetAttributeType(
name = "Events",
type = DbgModelTargetEventContainerImpl.class,
required = true,
fixed = true),
@TargetAttributeType(
name = "Exceptions",
type = DbgModelTargetExceptionContainerImpl.class,
required = true,
fixed = true),
@TargetAttributeType(type = Void.class)
},
canonicalContainer = true)
public class DbgModelTargetDebugContainerImpl extends DbgModelTargetObjectImpl
implements DbgModelTargetDebugContainer {
protected final DbgModelTargetBreakpointContainerImpl breakpoints;
protected DbgModelTargetEventContainerImpl events;
protected DbgModelTargetExceptionContainerImpl exceptions;
private DbgModelTargetProcess process;
public DbgModelTargetDebugContainerImpl(DbgModelTargetProcess process) {
super(process.getModel(), process, "Debug", "DebugContainer");
this.process = process;
this.breakpoints = new DbgModelTargetBreakpointContainerImpl(this);
this.events = new DbgModelTargetEventContainerImpl(this);
this.exceptions = new DbgModelTargetExceptionContainerImpl(this);
changeAttributes(List.of(), List.of( //
breakpoints, //
events, //
exceptions //
), Map.of(), "Initialized");
}
}
| UTF-8 | Java | 2,291 | java | DbgModelTargetDebugContainerImpl.java | Java | [
{
"context": "/* ###\n * IP: GHIDRA\n *\n * Licensed under the Apache License, Ver",
"end": 15,
"score": 0.9189765453338623,
"start": 14,
"tag": "NAME",
"value": "G"
}
] | null | [] | /* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package agent.dbgeng.model.impl;
import java.util.List;
import java.util.Map;
import agent.dbgeng.model.iface2.DbgModelTargetDebugContainer;
import agent.dbgeng.model.iface2.DbgModelTargetProcess;
import ghidra.dbg.target.schema.TargetAttributeType;
import ghidra.dbg.target.schema.TargetObjectSchemaInfo;
@TargetObjectSchemaInfo(
name = "DebugContainer",
attributes = {
@TargetAttributeType(
name = "Breakpoints",
type = DbgModelTargetBreakpointContainerImpl.class,
required = true,
fixed = true),
@TargetAttributeType(
name = "Events",
type = DbgModelTargetEventContainerImpl.class,
required = true,
fixed = true),
@TargetAttributeType(
name = "Exceptions",
type = DbgModelTargetExceptionContainerImpl.class,
required = true,
fixed = true),
@TargetAttributeType(type = Void.class)
},
canonicalContainer = true)
public class DbgModelTargetDebugContainerImpl extends DbgModelTargetObjectImpl
implements DbgModelTargetDebugContainer {
protected final DbgModelTargetBreakpointContainerImpl breakpoints;
protected DbgModelTargetEventContainerImpl events;
protected DbgModelTargetExceptionContainerImpl exceptions;
private DbgModelTargetProcess process;
public DbgModelTargetDebugContainerImpl(DbgModelTargetProcess process) {
super(process.getModel(), process, "Debug", "DebugContainer");
this.process = process;
this.breakpoints = new DbgModelTargetBreakpointContainerImpl(this);
this.events = new DbgModelTargetEventContainerImpl(this);
this.exceptions = new DbgModelTargetExceptionContainerImpl(this);
changeAttributes(List.of(), List.of( //
breakpoints, //
events, //
exceptions //
), Map.of(), "Initialized");
}
}
| 2,291 | 0.76735 | 0.764732 | 71 | 31.267605 | 24.55632 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.732394 | false | false | 2 |
fd3b3fd9cb74a80ec812bdda9a0ef6f9140a4195 | 3,049,426,815,273 | 3e1d9295f05d32e00ab4d016602e46cbae1e0b5d | /src/main/java/com/aiaraldea/aemetproxy/model/PrediccionAemet.java | 282456243b0a3994bc2efddf2d7e6643e39fc662 | [] | no_license | aiaraldea/aemet-proxy | https://github.com/aiaraldea/aemet-proxy | 29af66efeb61f81039f75d1162354e0003b969cd | 33a5abdaa865495c971edfaf43d79f6e44bd483e | refs/heads/master | 2016-09-06T10:00:57.181000 | 2015-12-28T22:54:38 | 2015-12-28T22:54:38 | 27,736,663 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.aiaraldea.aemetproxy.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PrediccionAemet {
private String provincia;
private String localidad;
private String enlace;
private String prediccion;
private Date dia;
private Map<AemetPeriodo, Integer> probPrecipitacion;
private Map<AemetPeriodo, Integer> cotaNieve;
private List<AemetEstadoCielo> estadoCielo;
private List<AemetViento> viento;
private Map<AemetPeriodo, Integer> rachaMax;
private Integer maxTemperatura;
private Integer minTemperatura;
private Map<AemetHora, Integer> horaTemperatura;
private Integer maxSenTermica;
private Integer minSenTermica;
private Map<AemetHora, Integer> horaSenTermica;
/**
* @return the localidad
*/
public String getLocalidad() {
return localidad;
}
/**
* @param localidad the localidad to set
*/
public void setLocalidad(String localidad) {
this.localidad = localidad;
}
/**
* @return the provincia
*/
public String getProvincia() {
return provincia;
}
/**
* @param provincia the provincia to set
*/
public void setProvincia(String provincia) {
this.provincia = provincia;
}
public String getEnlace() {
return enlace;
}
public void setEnlace(String enlace) {
this.enlace = enlace;
}
/**
* @return the prediccion
*/
public String getPrediccion() {
return prediccion;
}
/**
* @param prediccion the prediccion to set
*/
public void setPrediccion(String prediccion) {
this.prediccion = prediccion;
}
/**
* @return the dia
*/
public Date getDia() {
return dia;
}
/**
* @param dia the dia to set
*/
public void setDia(Date dia) {
this.dia = dia;
}
/**
* @return the probPrecipitacion
*/
public Map<AemetPeriodo, Integer> getProbPrecipitacion() {
if (probPrecipitacion == null) {
probPrecipitacion = new HashMap<AemetPeriodo, Integer>();
}
return probPrecipitacion;
}
public Map<AemetPeriodo, Integer> getCotaNieve() {
if (cotaNieve == null) {
cotaNieve = new HashMap<AemetPeriodo, Integer>();
}
return cotaNieve;
}
/**
* @param probPrecipitacion the probPrecipitacion to set
*/
public void setProbPrecipitacion(
Map<AemetPeriodo, Integer> probPrecipitacion) {
this.probPrecipitacion = probPrecipitacion;
}
/**
* @return the estadoCielo
*/
public List<AemetEstadoCielo> getEstadoCielo() {
if (estadoCielo == null) {
estadoCielo = new ArrayList<AemetEstadoCielo>();
}
return estadoCielo;
}
/**
* @return the viento
*/
public List<AemetViento> getViento() {
if (viento == null) {
viento = new ArrayList<AemetViento>();
}
return viento;
}
/**
* @return the racha_max
*/
public Map<AemetPeriodo, Integer> getRachaMax() {
if (rachaMax == null) {
rachaMax = new HashMap<AemetPeriodo, Integer>();
}
return rachaMax;
}
/**
* @return the maxTemperatura
*/
public Integer getMaxTemperatura() {
return maxTemperatura;
}
/**
* @param maxTemperatura the maxTemperatura to set
*/
public void setMaxTemperatura(Integer maxTemperatura) {
this.maxTemperatura = maxTemperatura;
}
/**
* @return the minTemperatura
*/
public Integer getMinTemperatura() {
return minTemperatura;
}
/**
* @param minTemperatura the minTemperatura to set
*/
public void setMinTemperatura(Integer minTemperatura) {
this.minTemperatura = minTemperatura;
}
/**
* @return the horaTemperatura
*/
public Map<AemetHora, Integer> getHoraTemperatura() {
if (horaTemperatura == null) {
horaTemperatura = new HashMap<AemetHora, Integer>();
}
return horaTemperatura;
}
/**
* @param horaTemperatura the horaTemperatura to set
*/
public void setHoraTemperatura(Map<AemetHora, Integer> horaTemperatura) {
this.horaTemperatura = horaTemperatura;
}
/**
* @return the maxSenTermica
*/
public Integer getMaxSenTermica() {
return maxSenTermica;
}
/**
* @param maxSenTermica the maxSenTermica to set
*/
public void setMaxSenTermica(Integer maxSenTermica) {
this.maxSenTermica = maxSenTermica;
}
/**
* @return the minSenTermica
*/
public Integer getMinSenTermica() {
return minSenTermica;
}
/**
* @param minSenTermica the minSenTermica to set
*/
public void setMinSenTermica(Integer minSenTermica) {
this.minSenTermica = minSenTermica;
}
/**
* @return the horaSenTermica
*/
public Map<AemetHora, Integer> getHoraSenTermica() {
return horaSenTermica;
}
/**
* @param horaSenTermica the horaSenTermica to set
*/
public void setHoraSenTermica(Map<AemetHora, Integer> horaSenTermica) {
this.horaSenTermica = horaSenTermica;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "PrediccionAemet [provincia=" + provincia + ", prediccion="
+ prediccion + ", dia=" + dia + ", probPrecipitacion="
+ probPrecipitacion + ", estadoCielo=" + estadoCielo
+ ", viento=" + viento + ", racha_max=" + rachaMax
+ ", maxTemperatura=" + maxTemperatura + ", minTemperatura="
+ minTemperatura + ", horaTemperatura=" + horaTemperatura
+ ", maxSenTermica=" + maxSenTermica + ", minSenTermica="
+ minSenTermica + ", horaSenTermica=" + horaSenTermica + "]";
}
}
| UTF-8 | Java | 6,139 | java | PrediccionAemet.java | Java | [] | null | [] | package com.aiaraldea.aemetproxy.model;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class PrediccionAemet {
private String provincia;
private String localidad;
private String enlace;
private String prediccion;
private Date dia;
private Map<AemetPeriodo, Integer> probPrecipitacion;
private Map<AemetPeriodo, Integer> cotaNieve;
private List<AemetEstadoCielo> estadoCielo;
private List<AemetViento> viento;
private Map<AemetPeriodo, Integer> rachaMax;
private Integer maxTemperatura;
private Integer minTemperatura;
private Map<AemetHora, Integer> horaTemperatura;
private Integer maxSenTermica;
private Integer minSenTermica;
private Map<AemetHora, Integer> horaSenTermica;
/**
* @return the localidad
*/
public String getLocalidad() {
return localidad;
}
/**
* @param localidad the localidad to set
*/
public void setLocalidad(String localidad) {
this.localidad = localidad;
}
/**
* @return the provincia
*/
public String getProvincia() {
return provincia;
}
/**
* @param provincia the provincia to set
*/
public void setProvincia(String provincia) {
this.provincia = provincia;
}
public String getEnlace() {
return enlace;
}
public void setEnlace(String enlace) {
this.enlace = enlace;
}
/**
* @return the prediccion
*/
public String getPrediccion() {
return prediccion;
}
/**
* @param prediccion the prediccion to set
*/
public void setPrediccion(String prediccion) {
this.prediccion = prediccion;
}
/**
* @return the dia
*/
public Date getDia() {
return dia;
}
/**
* @param dia the dia to set
*/
public void setDia(Date dia) {
this.dia = dia;
}
/**
* @return the probPrecipitacion
*/
public Map<AemetPeriodo, Integer> getProbPrecipitacion() {
if (probPrecipitacion == null) {
probPrecipitacion = new HashMap<AemetPeriodo, Integer>();
}
return probPrecipitacion;
}
public Map<AemetPeriodo, Integer> getCotaNieve() {
if (cotaNieve == null) {
cotaNieve = new HashMap<AemetPeriodo, Integer>();
}
return cotaNieve;
}
/**
* @param probPrecipitacion the probPrecipitacion to set
*/
public void setProbPrecipitacion(
Map<AemetPeriodo, Integer> probPrecipitacion) {
this.probPrecipitacion = probPrecipitacion;
}
/**
* @return the estadoCielo
*/
public List<AemetEstadoCielo> getEstadoCielo() {
if (estadoCielo == null) {
estadoCielo = new ArrayList<AemetEstadoCielo>();
}
return estadoCielo;
}
/**
* @return the viento
*/
public List<AemetViento> getViento() {
if (viento == null) {
viento = new ArrayList<AemetViento>();
}
return viento;
}
/**
* @return the racha_max
*/
public Map<AemetPeriodo, Integer> getRachaMax() {
if (rachaMax == null) {
rachaMax = new HashMap<AemetPeriodo, Integer>();
}
return rachaMax;
}
/**
* @return the maxTemperatura
*/
public Integer getMaxTemperatura() {
return maxTemperatura;
}
/**
* @param maxTemperatura the maxTemperatura to set
*/
public void setMaxTemperatura(Integer maxTemperatura) {
this.maxTemperatura = maxTemperatura;
}
/**
* @return the minTemperatura
*/
public Integer getMinTemperatura() {
return minTemperatura;
}
/**
* @param minTemperatura the minTemperatura to set
*/
public void setMinTemperatura(Integer minTemperatura) {
this.minTemperatura = minTemperatura;
}
/**
* @return the horaTemperatura
*/
public Map<AemetHora, Integer> getHoraTemperatura() {
if (horaTemperatura == null) {
horaTemperatura = new HashMap<AemetHora, Integer>();
}
return horaTemperatura;
}
/**
* @param horaTemperatura the horaTemperatura to set
*/
public void setHoraTemperatura(Map<AemetHora, Integer> horaTemperatura) {
this.horaTemperatura = horaTemperatura;
}
/**
* @return the maxSenTermica
*/
public Integer getMaxSenTermica() {
return maxSenTermica;
}
/**
* @param maxSenTermica the maxSenTermica to set
*/
public void setMaxSenTermica(Integer maxSenTermica) {
this.maxSenTermica = maxSenTermica;
}
/**
* @return the minSenTermica
*/
public Integer getMinSenTermica() {
return minSenTermica;
}
/**
* @param minSenTermica the minSenTermica to set
*/
public void setMinSenTermica(Integer minSenTermica) {
this.minSenTermica = minSenTermica;
}
/**
* @return the horaSenTermica
*/
public Map<AemetHora, Integer> getHoraSenTermica() {
return horaSenTermica;
}
/**
* @param horaSenTermica the horaSenTermica to set
*/
public void setHoraSenTermica(Map<AemetHora, Integer> horaSenTermica) {
this.horaSenTermica = horaSenTermica;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "PrediccionAemet [provincia=" + provincia + ", prediccion="
+ prediccion + ", dia=" + dia + ", probPrecipitacion="
+ probPrecipitacion + ", estadoCielo=" + estadoCielo
+ ", viento=" + viento + ", racha_max=" + rachaMax
+ ", maxTemperatura=" + maxTemperatura + ", minTemperatura="
+ minTemperatura + ", horaTemperatura=" + horaTemperatura
+ ", maxSenTermica=" + maxSenTermica + ", minSenTermica="
+ minSenTermica + ", horaSenTermica=" + horaSenTermica + "]";
}
}
| 6,139 | 0.598957 | 0.598957 | 250 | 23.556 | 21.313068 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.344 | false | false | 2 |
39d93ce69c0e42469c609c9035f0136470db335f | 3,049,426,811,728 | 623c4d83aae3e5a105040ebca396b69dc5b90b87 | /src/gameObjects/Enemy.java | 1fe523b448134df4d3ce954a8ec5bb82ebb07a0e | [] | no_license | Binasaurus-Hex/Wooden-Gear-Pliable | https://github.com/Binasaurus-Hex/Wooden-Gear-Pliable | f7853f8a9b813c6624affae9dce19d8fd528eff1 | 66954e32b21e6b1e03b32bb70fc850a4a845d2fb | refs/heads/master | 2022-01-23T21:09:55.456000 | 2019-06-23T11:30:52 | 2019-06-23T11:30:52 | 160,463,201 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package gameObjects;
import java.awt.geom.Point2D;
import java.awt.geom.Point2D.Double;
import java.util.Timer;
import java.util.concurrent.CopyOnWriteArrayList;
import Physics.MathsMethods;
import game.Game;
import game.ID;
public abstract class Enemy extends RectangleObject{
protected int fieldOfVeiw = 90;
protected Point2D.Double playerDirection;
protected boolean canSeePlayer = false;
protected Point2D.Double playerLastPosition;
protected CopyOnWriteArrayList<GameObject> objects;
protected boolean seenPlayer = false;
protected boolean onPath = true;
protected boolean searching = false;
protected PathList path;
protected Timer searchTimer;
private Point2D.Double nextPoint;
private Point2D.Double currentPos;
public Enemy(double x, double y,double width,double height,ID id, Game game,PathList path) {
super(x, y,width,height, 1, id, game);
playerDirection = new Point2D.Double();
playerLastPosition = new Point2D.Double();
this.searchTimer = new Timer();
this.nextPoint = path.nextPoint;
currentPos = new Point2D.Double();
this.path = path;
}
protected boolean canSeePlayer() {
double angle = MathsMethods.getVectorAngle(playerDirection, rotation);
double angleDegrees = Math.toDegrees(angle);
double distance = MathsMethods.length(playerDirection.x, playerDirection.y);
if((angleDegrees<45)&&(distance<500)&& isSightClear()) {
return true;
}
else {
return false;
}
}
protected void moveToPoint(Point2D.Double point) {
rotation.setLocation(point.getX()-x, point.getY()-y);
double[] unitVector = MathsMethods.getUnitVector(x,y,point.getX(),point.getY());
if(MathsMethods.distance(x, y, point.getX(), point.getY())>1) {
x+=unitVector[0]*vX;
y+=unitVector[1]*vY;
}
}
protected Point2D.Double getPlayerPosition(){
try {
Player player = this.getPlayer();
Point2D.Double playerPos = new Point2D.Double(player.getX(), player.getY());
return (Double) playerPos.clone();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
protected void followPath() {
currentPos.setLocation(x, y);
if(path.hasReachedNext(currentPos)) {
nextPoint = path.getNextPoint();
}
else {
moveToPoint(nextPoint);
}
}
private boolean isSightClear(){
try {
Player player = this.getPlayer();
for(GameObject obj:objects){
if(obj.id == ID.Wall){
Wall wall = (Wall)obj;
//topLine
boolean isTop = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.left,wall.top,wall.right,wall.top);
//bottom
boolean isBottom = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.left,wall.bottom,wall.right,wall.bottom);
//left
boolean isLeft = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.left,wall.top,wall.left,wall.bottom);
//right
boolean isRight = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.right,wall.top,wall.right,wall.bottom);
if(isTop||isBottom||isLeft||isRight){
return false;
}
}
}
return true;
} catch (Exception e) {
return false;
}
}
public void update(CopyOnWriteArrayList<GameObject> objects) {
this.objects = objects;
}
protected void setLastPlayerPosition() throws Exception {
Player player = this.getPlayer();
playerLastPosition.setLocation(player.getX(), player.getY());
}
protected void setPlayerDirection() throws Exception {
Player player = getPlayer();
double pX = player.getX();
double pY = player.getY();
playerDirection.setLocation(pX-x, pY-y);
}
private Player getPlayer() throws Exception{
for(GameObject obj:objects) {
if(obj.id == ID.Player) {
Player player = (Player)obj;
return player;
}
}
Exception e = new Exception("player not found");
throw e;
}
public PathList getPath() {
return path;
}
public void setPath(PathList path) {
this.path = path;
}
}
| UTF-8 | Java | 3,893 | java | Enemy.java | Java | [] | null | [] | package gameObjects;
import java.awt.geom.Point2D;
import java.awt.geom.Point2D.Double;
import java.util.Timer;
import java.util.concurrent.CopyOnWriteArrayList;
import Physics.MathsMethods;
import game.Game;
import game.ID;
public abstract class Enemy extends RectangleObject{
protected int fieldOfVeiw = 90;
protected Point2D.Double playerDirection;
protected boolean canSeePlayer = false;
protected Point2D.Double playerLastPosition;
protected CopyOnWriteArrayList<GameObject> objects;
protected boolean seenPlayer = false;
protected boolean onPath = true;
protected boolean searching = false;
protected PathList path;
protected Timer searchTimer;
private Point2D.Double nextPoint;
private Point2D.Double currentPos;
public Enemy(double x, double y,double width,double height,ID id, Game game,PathList path) {
super(x, y,width,height, 1, id, game);
playerDirection = new Point2D.Double();
playerLastPosition = new Point2D.Double();
this.searchTimer = new Timer();
this.nextPoint = path.nextPoint;
currentPos = new Point2D.Double();
this.path = path;
}
protected boolean canSeePlayer() {
double angle = MathsMethods.getVectorAngle(playerDirection, rotation);
double angleDegrees = Math.toDegrees(angle);
double distance = MathsMethods.length(playerDirection.x, playerDirection.y);
if((angleDegrees<45)&&(distance<500)&& isSightClear()) {
return true;
}
else {
return false;
}
}
protected void moveToPoint(Point2D.Double point) {
rotation.setLocation(point.getX()-x, point.getY()-y);
double[] unitVector = MathsMethods.getUnitVector(x,y,point.getX(),point.getY());
if(MathsMethods.distance(x, y, point.getX(), point.getY())>1) {
x+=unitVector[0]*vX;
y+=unitVector[1]*vY;
}
}
protected Point2D.Double getPlayerPosition(){
try {
Player player = this.getPlayer();
Point2D.Double playerPos = new Point2D.Double(player.getX(), player.getY());
return (Double) playerPos.clone();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
protected void followPath() {
currentPos.setLocation(x, y);
if(path.hasReachedNext(currentPos)) {
nextPoint = path.getNextPoint();
}
else {
moveToPoint(nextPoint);
}
}
private boolean isSightClear(){
try {
Player player = this.getPlayer();
for(GameObject obj:objects){
if(obj.id == ID.Wall){
Wall wall = (Wall)obj;
//topLine
boolean isTop = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.left,wall.top,wall.right,wall.top);
//bottom
boolean isBottom = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.left,wall.bottom,wall.right,wall.bottom);
//left
boolean isLeft = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.left,wall.top,wall.left,wall.bottom);
//right
boolean isRight = MathsMethods.linesIntersect(x, y,player.x,player.y,wall.right,wall.top,wall.right,wall.bottom);
if(isTop||isBottom||isLeft||isRight){
return false;
}
}
}
return true;
} catch (Exception e) {
return false;
}
}
public void update(CopyOnWriteArrayList<GameObject> objects) {
this.objects = objects;
}
protected void setLastPlayerPosition() throws Exception {
Player player = this.getPlayer();
playerLastPosition.setLocation(player.getX(), player.getY());
}
protected void setPlayerDirection() throws Exception {
Player player = getPlayer();
double pX = player.getX();
double pY = player.getY();
playerDirection.setLocation(pX-x, pY-y);
}
private Player getPlayer() throws Exception{
for(GameObject obj:objects) {
if(obj.id == ID.Player) {
Player player = (Player)obj;
return player;
}
}
Exception e = new Exception("player not found");
throw e;
}
public PathList getPath() {
return path;
}
public void setPath(PathList path) {
this.path = path;
}
}
| 3,893 | 0.705625 | 0.699461 | 147 | 25.482994 | 25.640995 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.77551 | false | false | 2 |
57912c9d2a055de52ef71f21ff17811b59942339 | 22,531,398,451,231 | cd7736b70cae0831c7f19bd23b6108faebce38f3 | /iTravel/src/main/java/edu/miu/cs472/servlet/EditDisplayPhotoServlet.java | 7ac654fdc43b7dd11efb7a7328bffde06c8deac1 | [] | no_license | eyob05/iTravel-WAP-Project | https://github.com/eyob05/iTravel-WAP-Project | c69591b574287f26f85221a7a10e556fd0443394 | 1d25e4208569becd5508327e45a2827019b186c5 | refs/heads/master | 2023-01-11T03:19:35.128000 | 2020-11-18T07:41:37 | 2020-11-18T07:41:37 | 312,465,067 | 0 | 1 | null | false | 2020-11-14T16:26:35 | 2020-11-13T03:38:59 | 2020-11-14T13:05:31 | 2020-11-14T16:26:34 | 14,623 | 0 | 1 | 0 | CSS | false | false | package edu.miu.cs472.servlet;
import edu.miu.cs472.dao.user.IUserDao;
import edu.miu.cs472.dao.user.UserDao;
import edu.miu.cs472.domain.Photo;
import edu.miu.cs472.domain.Post;
import edu.miu.cs472.domain.User;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
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 javax.servlet.http.HttpSession;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@WebServlet("/editDisplayPhoto")
public class EditDisplayPhotoServlet extends HttpServlet {
private String UPLOAD_DIRECTORY;
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
UPLOAD_DIRECTORY = req.getServletContext().getInitParameter("imageUploadsDisplay");
String photoName = "";
Photo photo = new Photo();
Map<String, String> params = new HashMap<>();
String postDetails = "";
Post post = new Post();
//process only if its multipart content
if(ServletFileUpload.isMultipartContent(req)){
try {
List<FileItem> multiparts = new ServletFileUpload(
new DiskFileItemFactory()).parseRequest(req);
for(FileItem item : multiparts){
if(item.isFormField()) {
String name = item.getFieldName();
String value = item.getString();
params.put(name,value);
}
else{
String name = new File(item.getName()).getName();
// set the photo name
photoName = name;
photo.setLink(photoName);
item.write( new File(UPLOAD_DIRECTORY + File.separator + name));
}
}
//File uploaded successfully
req.setAttribute("message", "File Uploaded Successfully");
} catch (Exception ex) {
req.setAttribute("message", "File Upload Failed due to " + ex);
}
}else{
req.setAttribute("message",
"Sorry this Servlet only handles file upload request");
}
// add post to the database
HttpSession session = req.getSession();
User user = (User)session.getAttribute("user");
user.setPhotoLink(photo.getLink());
session.setAttribute("user",user);
// read data
IUserDao userDao = new UserDao();
User dbUser = userDao.update(user);
session.setAttribute("user",dbUser);
PrintWriter out = resp.getWriter();
out.println("upload successful");
//abstractDao.save(user);
}
}
| UTF-8 | Java | 3,142 | java | EditDisplayPhotoServlet.java | Java | [] | null | [] | package edu.miu.cs472.servlet;
import edu.miu.cs472.dao.user.IUserDao;
import edu.miu.cs472.dao.user.UserDao;
import edu.miu.cs472.domain.Photo;
import edu.miu.cs472.domain.Post;
import edu.miu.cs472.domain.User;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
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 javax.servlet.http.HttpSession;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@WebServlet("/editDisplayPhoto")
public class EditDisplayPhotoServlet extends HttpServlet {
private String UPLOAD_DIRECTORY;
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
UPLOAD_DIRECTORY = req.getServletContext().getInitParameter("imageUploadsDisplay");
String photoName = "";
Photo photo = new Photo();
Map<String, String> params = new HashMap<>();
String postDetails = "";
Post post = new Post();
//process only if its multipart content
if(ServletFileUpload.isMultipartContent(req)){
try {
List<FileItem> multiparts = new ServletFileUpload(
new DiskFileItemFactory()).parseRequest(req);
for(FileItem item : multiparts){
if(item.isFormField()) {
String name = item.getFieldName();
String value = item.getString();
params.put(name,value);
}
else{
String name = new File(item.getName()).getName();
// set the photo name
photoName = name;
photo.setLink(photoName);
item.write( new File(UPLOAD_DIRECTORY + File.separator + name));
}
}
//File uploaded successfully
req.setAttribute("message", "File Uploaded Successfully");
} catch (Exception ex) {
req.setAttribute("message", "File Upload Failed due to " + ex);
}
}else{
req.setAttribute("message",
"Sorry this Servlet only handles file upload request");
}
// add post to the database
HttpSession session = req.getSession();
User user = (User)session.getAttribute("user");
user.setPhotoLink(photo.getLink());
session.setAttribute("user",user);
// read data
IUserDao userDao = new UserDao();
User dbUser = userDao.update(user);
session.setAttribute("user",dbUser);
PrintWriter out = resp.getWriter();
out.println("upload successful");
//abstractDao.save(user);
}
}
| 3,142 | 0.616486 | 0.610757 | 87 | 35.114941 | 23.784195 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 2 |
f354cbb2b7bfda512bd4ef85e12fa844f652d336 | 14,705,968,057,887 | 889564cfd65f5881aba1a8074325fc1cf3ae484e | /TryCatchPractice/src/practicejavaprograms/Main.java | 70407666fa25651159194247dceb5683d55ec0b7 | [] | no_license | niallcurley/Master-Class-Udemy.com | https://github.com/niallcurley/Master-Class-Udemy.com | 0ae0a5e89ee3a0727df9173aad75ae9c6ab54263 | e781b72f820f4a59b081afe017944ab8d9806ee5 | refs/heads/master | 2020-05-03T11:45:41.495000 | 2019-03-30T20:56:57 | 2019-03-30T20:56:57 | 178,608,652 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package practicejavaprograms;
import java.util.Scanner;
public class Main {
static Scanner input = new Scanner(System.in);
static int getSelection(){
int choice = 0;//set to zero
boolean ok = false;// boolean rule
do {
System.out.print("Enter choice of channel 1-5: ");
try {// try condition - block
choice = input.nextInt();//input for user
ok = true;
}//end of try
catch(Exception ex){//catch statement maintains normal flow of program
System.out.println("Error - Try Again!");
input.nextLine();//Clear data for next command
}//end of catch
}//end of do while loop
while(ok == false);
return choice;
}//end of getSelection method
public static void main(String[] args) {
TimesOfProgrammes t = new TimesOfProgrammes();
int channelNum;
int x = 1;
//System.out.print("Please choose a channel between 1 - 5!");
//channelNum = input.nextInt();
int value = getSelection();
switch (value) {
case 1:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e) {
System.out.println("Try again");
input.nextLine();
}
break;
case 2:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
input.nextLine();
}
break;
case 3:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
}
break;
case 4:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
}
break;
case 5:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
}
break;
default:
System.out.println("Error - choose 1-9");
}
}
}
| UTF-8 | Java | 3,202 | java | Main.java | Java | [] | null | [] | package practicejavaprograms;
import java.util.Scanner;
public class Main {
static Scanner input = new Scanner(System.in);
static int getSelection(){
int choice = 0;//set to zero
boolean ok = false;// boolean rule
do {
System.out.print("Enter choice of channel 1-5: ");
try {// try condition - block
choice = input.nextInt();//input for user
ok = true;
}//end of try
catch(Exception ex){//catch statement maintains normal flow of program
System.out.println("Error - Try Again!");
input.nextLine();//Clear data for next command
}//end of catch
}//end of do while loop
while(ok == false);
return choice;
}//end of getSelection method
public static void main(String[] args) {
TimesOfProgrammes t = new TimesOfProgrammes();
int channelNum;
int x = 1;
//System.out.print("Please choose a channel between 1 - 5!");
//channelNum = input.nextInt();
int value = getSelection();
switch (value) {
case 1:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e) {
System.out.println("Try again");
input.nextLine();
}
break;
case 2:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
input.nextLine();
}
break;
case 3:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
}
break;
case 4:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
}
break;
case 5:
try {
System.out.println("Welcome to channel " + value);
t.messageChoice();
}catch (Exception e){
System.out.println("Try again");
}
break;
default:
System.out.println("Error - choose 1-9");
}
}
}
| 3,202 | 0.381324 | 0.377264 | 95 | 31.705263 | 22.710941 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.431579 | false | false | 2 |
e778fa59dfca3c893b6b76c04a12015b2e7400a1 | 22,986,665,015,268 | a517e00bbfa8f51adf2778fddfa12ae3d025d37a | /src/main/java/org/bhopii/ds/algo/DetectCycleLinkedList.java | b812cb331ab89b82a599cfb3b91169d5b6496734 | [] | no_license | bhopii/data-structures | https://github.com/bhopii/data-structures | a7a4241032b59fe47f6bad5931449855f78c3548 | 31c02dd2539e2fa51d8155aacaee4e10a56259fd | refs/heads/main | 2023-03-09T06:06:06.416000 | 2021-02-22T14:07:11 | 2021-02-22T14:07:11 | 308,763,389 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.bhopii.ds.algo;
public class DetectCycleLinkedList {
public static void main(String[] args) {
LinkedList list1 = new LinkedList();
LinkedList list2 = new LinkedList();
list1.head = new Node(3);
list1.head.next = new Node(6);
Node cycleNode = new Node(9);
list1.head.next.next = cycleNode;
list1.head.next.next.next = new Node(15);
list1.head.next.next.next.next = new Node(30);
list1.head.next.next.next.next.next = cycleNode;
list2.head = new Node(3);
list2.head.next = new Node(6);
list2.head.next.next = new Node(9);
list2.head.next.next.next = new Node(15);
list2.head.next.next.next.next = new Node(30);
list2.head.next.next.next.next.next = new Node(23);
// list2.printList(list2);
System.out.println(" ");
// System.out.println(list1.hasLoop());
System.out.println(list2.hasLoop());
}
}
| UTF-8 | Java | 888 | java | DetectCycleLinkedList.java | Java | [] | null | [] | package org.bhopii.ds.algo;
public class DetectCycleLinkedList {
public static void main(String[] args) {
LinkedList list1 = new LinkedList();
LinkedList list2 = new LinkedList();
list1.head = new Node(3);
list1.head.next = new Node(6);
Node cycleNode = new Node(9);
list1.head.next.next = cycleNode;
list1.head.next.next.next = new Node(15);
list1.head.next.next.next.next = new Node(30);
list1.head.next.next.next.next.next = cycleNode;
list2.head = new Node(3);
list2.head.next = new Node(6);
list2.head.next.next = new Node(9);
list2.head.next.next.next = new Node(15);
list2.head.next.next.next.next = new Node(30);
list2.head.next.next.next.next.next = new Node(23);
// list2.printList(list2);
System.out.println(" ");
// System.out.println(list1.hasLoop());
System.out.println(list2.hasLoop());
}
}
| 888 | 0.656532 | 0.618243 | 30 | 27.6 | 17.211624 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.266667 | false | false | 2 |
7f9eb1509b24298698f6e287f96b076870f20f20 | 5,136,780,893,838 | 318620f6545617aaadeba82c33bad4dad96fd266 | /HelloGitHub/src/br/com/irineuvaz/git/HelloGit.java | 344f367397884192a620be9ebf9a020645529d0a | [] | no_license | irivaz2017/elcipse | https://github.com/irivaz2017/elcipse | df1ccf01d09c2d264bff1fa6d64584b3339539c4 | 10c69e6029a589d4e353cb658d80b8e66b26412d | refs/heads/main | 2023-02-09T04:39:37.243000 | 2021-01-03T14:49:38 | 2021-01-03T14:49:38 | 326,424,180 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
*
*/
package br.com.irineuvaz.git;
/**
* @author irineuv
* Exemplo de integração com o github
*/
public class HelloGit {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("Hello Git");
System.out.println("Professor Irineu Delson");
}
}
| UTF-8 | Java | 297 | java | HelloGit.java | Java | [
{
"context": "\n */\npackage br.com.irineuvaz.git;\n\n/**\n * @author irineuv\n * Exemplo de integração com o github\n */\npublic ",
"end": 65,
"score": 0.9996430277824402,
"start": 58,
"tag": "USERNAME",
"value": "irineuv"
},
{
"context": "ntln(\"Hello Git\");\n\t\tSystem.out.printl... | null | [] | /**
*
*/
package br.com.irineuvaz.git;
/**
* @author irineuv
* Exemplo de integração com o github
*/
public class HelloGit {
/**
* @param args
*/
public static void main(String[] args) {
System.out.println("Hello Git");
System.out.println("Professor <NAME>");
}
}
| 290 | 0.627119 | 0.627119 | 22 | 12.409091 | 15.2663 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.636364 | false | false | 2 |
09c123fc298f038ced8e7aea0d2d9aac6b42b88a | 14,869,176,803,391 | d3f98ef61059794733e8d78b4e851723c05e719d | /services/webservices/RoomService/src/org/nixos/disnix/example/webservices/Room.java | f7b98487157c0bcbdfd9c01972424afc62d7974f | [
"MIT"
] | permissive | svanderburg/disnix-stafftracker-java-example | https://github.com/svanderburg/disnix-stafftracker-java-example | 5ce1a9b05608dac16bf663c15308f4cda1ba6f33 | 85db63a1138cd8c8aed0a096be4466992e103777 | refs/heads/master | 2022-03-27T12:28:47.821000 | 2022-03-14T22:29:06 | 2022-03-14T22:29:06 | 10,991,807 | 7 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.nixos.disnix.example.webservices;
/**
* Represents a room record in the room database
*/
public class Room
{
/** Room identifier */
private String room;
/** Associated zipcode of the room */
private String zipcode;
public Room()
{
}
public String getRoom()
{
return room;
}
public void setRoom(String room)
{
this.room = room;
}
public String getZipcode()
{
return zipcode;
}
public void setZipcode(String zipcode)
{
this.zipcode = zipcode;
}
}
| UTF-8 | Java | 497 | java | Room.java | Java | [] | null | [] | package org.nixos.disnix.example.webservices;
/**
* Represents a room record in the room database
*/
public class Room
{
/** Room identifier */
private String room;
/** Associated zipcode of the room */
private String zipcode;
public Room()
{
}
public String getRoom()
{
return room;
}
public void setRoom(String room)
{
this.room = room;
}
public String getZipcode()
{
return zipcode;
}
public void setZipcode(String zipcode)
{
this.zipcode = zipcode;
}
}
| 497 | 0.67002 | 0.67002 | 37 | 12.432432 | 14.280095 | 48 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.027027 | false | false | 2 |
1925a36a1fc4c4e9ceb66311e57ff38947bf2a62 | 36,120,674,959,869 | 8682326ef3fddb7b62060cb62c107b766b3a6c94 | /src/main/java/com/github/tdesjardins/matter/World.java | bb2011df9dba753ffc010b1c406f03694dd1ec01 | [
"Apache-2.0"
] | permissive | TDesjardins/gwt-matter | https://github.com/TDesjardins/gwt-matter | b3e73f527d239492f7dcf6cca3a1972487b61cab | d09ddf6ac0019565e853b533a06ae474435f4466 | refs/heads/master | 2021-07-09T03:36:13.472000 | 2020-10-13T17:01:30 | 2020-10-13T17:01:30 | 205,597,144 | 1 | 0 | Apache-2.0 | false | 2020-10-13T17:01:31 | 2019-08-31T21:16:59 | 2019-12-29T08:17:45 | 2020-10-13T17:01:31 | 32 | 0 | 0 | 0 | Java | false | false | package com.github.tdesjardins.matter;
import com.github.tdesjardins.matter.composite.Composite;
import com.github.tdesjardins.matter.geometry.Bounds;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
@JsType(isNative = true)
public class World extends Composite {
@JsMethod(namespace = JsConstants.NAMESPACE_WORLD)
public static native void add(World world, MatterObject object);
@JsOverlay
public final void add(MatterObject object) {
World.add(this, object);
}
@JsProperty
public native Bounds getBounds();
}
| UTF-8 | Java | 687 | java | World.java | Java | [
{
"context": "package com.github.tdesjardins.matter;\r\n\r\nimport com.github.tdesjardins.matter.c",
"end": 30,
"score": 0.9991708993911743,
"start": 19,
"tag": "USERNAME",
"value": "tdesjardins"
},
{
"context": "m.github.tdesjardins.matter;\r\n\r\nimport com.github.tdesjardins.matte... | null | [] | package com.github.tdesjardins.matter;
import com.github.tdesjardins.matter.composite.Composite;
import com.github.tdesjardins.matter.geometry.Bounds;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
@JsType(isNative = true)
public class World extends Composite {
@JsMethod(namespace = JsConstants.NAMESPACE_WORLD)
public static native void add(World world, MatterObject object);
@JsOverlay
public final void add(MatterObject object) {
World.add(this, object);
}
@JsProperty
public native Bounds getBounds();
}
| 687 | 0.743814 | 0.743814 | 25 | 25.48 | 21.758898 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.48 | false | false | 2 |
fba1025d864a2ff2b97ea8bc0f1d562253dc0246 | 22,093,311,805,077 | 11fcd0dd984ae6d20a70961cade3776fe95d7966 | /github/src/test/java/GithubAccessRequest.java | d37b65feb08dd25b07f60bc4629896af33d11018 | [] | no_license | tw-wh-devops-community/oauth2-github-keycloak-auth0 | https://github.com/tw-wh-devops-community/oauth2-github-keycloak-auth0 | 1747ed9076a55de3bb7bda3fdc895ab087700ff5 | f6df534af42b3efebaa6d30f76b3b664578c01ad | refs/heads/master | 2021-01-17T04:53:38.467000 | 2017-03-08T09:39:51 | 2017-03-08T09:39:51 | 83,024,012 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* client_id string Required. The client ID you received from GitHub when you registered.
* client_secret string Required. The client secret you received from GitHub when you registered.
* code string Required. The code you received as a response to Step 1.
* redirect_uri string The URL in your application where users will be sent after authorization. See details below about redirect urls.
* state string The unguessable random string you optionally provided in Step 1.
* Created by hwwei on 2017/2/23.
*/
public class GithubAccessRequest {
private final String client_id;
private final String client_secret;
private final String code;
private final String redirect_url;
private final String state;
public GithubAccessRequest(String client_id, String client_secret, String code_string,
String redirect_url, String state) {
this.client_id = client_id;
this.client_secret = client_secret;
this.code = code_string;
this.redirect_url = redirect_url;
this.state = state;
}
public String getClient_id() {
return client_id;
}
public String getClient_secret() {
return client_secret;
}
public String getCode() {
return code;
}
public String getRedirect_url() {
return redirect_url;
}
public String getState() {
return state;
}
}
| UTF-8 | Java | 1,419 | java | GithubAccessRequest.java | Java | [
{
"context": "g you optionally provided in Step 1.\n * Created by hwwei on 2017/2/23.\n */\npublic class GithubAccessReques",
"end": 500,
"score": 0.9996907114982605,
"start": 495,
"tag": "USERNAME",
"value": "hwwei"
}
] | null | [] | /**
* client_id string Required. The client ID you received from GitHub when you registered.
* client_secret string Required. The client secret you received from GitHub when you registered.
* code string Required. The code you received as a response to Step 1.
* redirect_uri string The URL in your application where users will be sent after authorization. See details below about redirect urls.
* state string The unguessable random string you optionally provided in Step 1.
* Created by hwwei on 2017/2/23.
*/
public class GithubAccessRequest {
private final String client_id;
private final String client_secret;
private final String code;
private final String redirect_url;
private final String state;
public GithubAccessRequest(String client_id, String client_secret, String code_string,
String redirect_url, String state) {
this.client_id = client_id;
this.client_secret = client_secret;
this.code = code_string;
this.redirect_url = redirect_url;
this.state = state;
}
public String getClient_id() {
return client_id;
}
public String getClient_secret() {
return client_secret;
}
public String getCode() {
return code;
}
public String getRedirect_url() {
return redirect_url;
}
public String getState() {
return state;
}
}
| 1,419 | 0.672304 | 0.665962 | 44 | 31.25 | 30.297859 | 135 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.659091 | false | false | 2 |
b12db50fb5ab5e95f6461b5d824e46c1c705623d | 22,093,311,803,648 | 6a5a395ed96d982d5b33f1fc40a90232eed49038 | /app/src/main/java/tn/leaderscodes/planetecroisiere/adapters/CompaniesFragmentAdapter.java | f620b7196a58198d789764fbaf001cae4d32c31e | [] | no_license | SamiMarrekchi/planetecroisiere-MVP | https://github.com/SamiMarrekchi/planetecroisiere-MVP | fb7062157f99292b8dbf9ee06063b0c99be29884 | dbbf273323509430e5d275d4cba6030cbd680a30 | refs/heads/master | 2021-10-16T00:18:29.972000 | 2019-02-07T10:04:36 | 2019-02-07T10:04:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package tn.leaderscodes.planetecroisiere.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Filter;
import android.widget.Filterable;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
import tn.leaderscodes.planetecroisiere.R;
import tn.leaderscodes.planetecroisiere.remote.entities.CruiseLine;
import tn.leaderscodes.planetecroisiere.viewholders.CompaniesViewHolder;
import static tn.leaderscodes.planetecroisiere.tools.URLS.EndPointCompanyImg;
public class CompaniesFragmentAdapter extends RecyclerView.Adapter<CompaniesViewHolder> implements Filterable {
private List<CruiseLine> cruisesLines;
private List<CruiseLine> filtered_items = new ArrayList<>();
Context context;
private boolean clicked = false;
public CompaniesFragmentAdapter(Context context) {
super();
this.context=context;
cruisesLines = new ArrayList<>();
}
public void setmItems(List<CruiseLine> cruisesLines) {
this.cruisesLines.clear();
this.cruisesLines = cruisesLines;
this.filtered_items=cruisesLines;
}
public void addData(CruiseLine cruiseLine) {
cruisesLines.add(0, cruiseLine);
notifyDataSetChanged();
}
public void clear() {
cruisesLines.clear();
filtered_items.clear();
notifyDataSetChanged();
}
private OnItemClickListener mOnItemClickListener;
public interface OnItemClickListener {
void onItemClick(View view, CruiseLine obj, int position);
}
public void setOnItemClickListener(final OnItemClickListener mItemClickListener) {
this.mOnItemClickListener = mItemClickListener;
}
/**
* Here is the key method to apply the animation
*/
private int lastPosition = -1;
private void setAnimation(View viewToAnimate, int position) {
// If the bound view wasn't previously displayed on screen, it's animated
if (position > lastPosition) {
Animation animation = AnimationUtils.loadAnimation(context, R.anim.slide_in_bottom);
viewToAnimate.startAnimation(animation);
lastPosition = position;
}
}
@NonNull
@Override
public CompaniesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_company, parent, false);
return new CompaniesViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull CompaniesViewHolder holder, @SuppressLint("RecyclerView") int position) {
CruiseLine cruiseLine = filtered_items.get(position);
holder.getCompany_name_txt().setText(cruiseLine.getName());
Glide.with(context).load(EndPointCompanyImg+cruiseLine.getImage()).thumbnail(0.5f).into(holder.getCompany_img());
setAnimation(holder.getLyt_parent(), position);
holder.getLyt_parent().setOnClickListener(view -> {
if(!clicked && mOnItemClickListener != null){
mOnItemClickListener.onItemClick(view, cruiseLine, position);
}
});
}
@Override
public int getItemCount() {
return filtered_items.size();
}
@Override
public Filter getFilter() {
return new ItemFilter();
}
private class ItemFilter extends Filter {
@Override
protected FilterResults performFiltering(CharSequence constraint) {
String query = constraint.toString().toLowerCase();
FilterResults results = new FilterResults();
final List<CruiseLine> list = cruisesLines;
final List<CruiseLine> result_list = new ArrayList<>(list.size());
for (int i = 0; i < list.size(); i++) {
String str_title = list.get(i).getName();
if (str_title.toLowerCase().contains(query)) {
result_list.add(list.get(i));
}
}
results.values = result_list;
results.count = result_list.size();
return results;
}
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
filtered_items = (List<CruiseLine>) results.values;
notifyDataSetChanged();
}
}
}
| UTF-8 | Java | 4,700 | java | CompaniesFragmentAdapter.java | Java | [] | null | [] | package tn.leaderscodes.planetecroisiere.adapters;
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Filter;
import android.widget.Filterable;
import com.bumptech.glide.Glide;
import java.util.ArrayList;
import java.util.List;
import tn.leaderscodes.planetecroisiere.R;
import tn.leaderscodes.planetecroisiere.remote.entities.CruiseLine;
import tn.leaderscodes.planetecroisiere.viewholders.CompaniesViewHolder;
import static tn.leaderscodes.planetecroisiere.tools.URLS.EndPointCompanyImg;
public class CompaniesFragmentAdapter extends RecyclerView.Adapter<CompaniesViewHolder> implements Filterable {
private List<CruiseLine> cruisesLines;
private List<CruiseLine> filtered_items = new ArrayList<>();
Context context;
private boolean clicked = false;
public CompaniesFragmentAdapter(Context context) {
super();
this.context=context;
cruisesLines = new ArrayList<>();
}
public void setmItems(List<CruiseLine> cruisesLines) {
this.cruisesLines.clear();
this.cruisesLines = cruisesLines;
this.filtered_items=cruisesLines;
}
public void addData(CruiseLine cruiseLine) {
cruisesLines.add(0, cruiseLine);
notifyDataSetChanged();
}
public void clear() {
cruisesLines.clear();
filtered_items.clear();
notifyDataSetChanged();
}
private OnItemClickListener mOnItemClickListener;
public interface OnItemClickListener {
void onItemClick(View view, CruiseLine obj, int position);
}
public void setOnItemClickListener(final OnItemClickListener mItemClickListener) {
this.mOnItemClickListener = mItemClickListener;
}
/**
* Here is the key method to apply the animation
*/
private int lastPosition = -1;
private void setAnimation(View viewToAnimate, int position) {
// If the bound view wasn't previously displayed on screen, it's animated
if (position > lastPosition) {
Animation animation = AnimationUtils.loadAnimation(context, R.anim.slide_in_bottom);
viewToAnimate.startAnimation(animation);
lastPosition = position;
}
}
@NonNull
@Override
public CompaniesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_company, parent, false);
return new CompaniesViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull CompaniesViewHolder holder, @SuppressLint("RecyclerView") int position) {
CruiseLine cruiseLine = filtered_items.get(position);
holder.getCompany_name_txt().setText(cruiseLine.getName());
Glide.with(context).load(EndPointCompanyImg+cruiseLine.getImage()).thumbnail(0.5f).into(holder.getCompany_img());
setAnimation(holder.getLyt_parent(), position);
holder.getLyt_parent().setOnClickListener(view -> {
if(!clicked && mOnItemClickListener != null){
mOnItemClickListener.onItemClick(view, cruiseLine, position);
}
});
}
@Override
public int getItemCount() {
return filtered_items.size();
}
@Override
public Filter getFilter() {
return new ItemFilter();
}
private class ItemFilter extends Filter {
@Override
protected FilterResults performFiltering(CharSequence constraint) {
String query = constraint.toString().toLowerCase();
FilterResults results = new FilterResults();
final List<CruiseLine> list = cruisesLines;
final List<CruiseLine> result_list = new ArrayList<>(list.size());
for (int i = 0; i < list.size(); i++) {
String str_title = list.get(i).getName();
if (str_title.toLowerCase().contains(query)) {
result_list.add(list.get(i));
}
}
results.values = result_list;
results.count = result_list.size();
return results;
}
@SuppressWarnings("unchecked")
@Override
protected void publishResults(CharSequence constraint, FilterResults results) {
filtered_items = (List<CruiseLine>) results.values;
notifyDataSetChanged();
}
}
}
| 4,700 | 0.678085 | 0.676809 | 134 | 34.074627 | 27.753883 | 121 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.589552 | false | false | 2 |
879c33db4d781d651699915e00f5d751b9f1e387 | 7,713,761,315,924 | 01f5675e54f61badcebb7c9d7af26b289cf5a04b | /Recipes/src/hu/qwaevisz/recipes/Program.java | a63ee088c98f02e054c5b64884dcba316ba749eb | [] | no_license | davidbedok/oejava | https://github.com/davidbedok/oejava | 0fd6f8482e7440838037707fce81361935562388 | fb9d448d4dc943b557e600af44888b610550e5af | refs/heads/master | 2021-06-08T14:31:07.488000 | 2017-11-19T19:21:30 | 2017-11-19T19:21:30 | 5,169,658 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package hu.qwaevisz.recipes;
import java.util.Arrays;
public class Program {
public static void main(String[] args) {
Program.testRecipe();
Program.testRecipeBook();
}
private static void testRecipe() {
System.out.println("---[ Recipe ]---");
Recipe recipe = Program.createBesamel();
System.out.println(recipe);
System.out.println("has Onion? " + recipe.hasCommodity(Commodity.Onion));
System.out.println("has Butter? " + recipe.hasCommodity(Commodity.Butter));
System.out.println("number of different commodities: " + recipe.numberOfDifferentCommodities());
System.out.println("total quantity: " + recipe.totalQuantity());
System.out.println("necessary commodities: " + Arrays.toString(recipe.necessaryCommodities()));
}
private static Recipe createBesamel() {
Recipe recipe = new Recipe("Besamel");
recipe.addIngredient(Commodity.Flour, 50);
recipe.addIngredient(Commodity.Butter, 50);
recipe.addIngredient(Commodity.Milk, 50);
recipe.addIngredient(Commodity.Milk, 100);
return recipe;
}
private static void testRecipeBook() {
System.out.println("---[ RecipeBook ]---");
RecipeBook book = new RecipeBook();
book.addRecipe(Program.createBesamel());
book.addRecipe(Program.createRicePudding());
book.addRecipe(Program.createKiev());
book.addRecipe(Program.createRoast());
book.addRecipe(Program.createPorkSchnitzel());
System.out.println(book);
System.out.println("find Besamel: " + book.find("Besamel"));
System.out.println("number of recipes without Onion: " + book.numberOfRecipesWithout(Commodity.Onion));
System.out.println("number of recipes without Egg: " + book.numberOfRecipesWithout(Commodity.Egg));
Recipe[] onionRecipes = book.contains(Commodity.Onion);
System.out.println("Onion recipes: " + Arrays.toString(onionRecipes));
System.out.println("most complicated recipe: " + book.mostComplicated());
}
private static Recipe createRicePudding() {
Recipe recipe = new Recipe("Rice pudding");
recipe.addIngredient(Commodity.Rice, 100);
recipe.addIngredient(Commodity.Milk, 100);
recipe.addIngredient(Commodity.Milk, 200);
recipe.addIngredient(Commodity.Butter, 10);
return recipe;
}
private static Recipe createKiev() {
Recipe recipe = new Recipe("Kiev");
recipe.addIngredient(Commodity.Butter, 10);
recipe.addIngredient(Commodity.Meat, 100);
recipe.addIngredient(Commodity.Butter, 50);
recipe.addIngredient(Commodity.Onion, 10);
return recipe;
}
private static Recipe createRoast() {
Recipe recipe = new Recipe("Roast");
recipe.addIngredient(Commodity.Butter, 10);
recipe.addIngredient(Commodity.Meat, 100);
recipe.addIngredient(Commodity.Flour, 10);
recipe.addIngredient(Commodity.Onion, 30);
return recipe;
}
private static Recipe createPorkSchnitzel() {
Recipe recipe = new Recipe("Pork schnitzel");
recipe.addIngredient(Commodity.Meat, 100);
recipe.addIngredient(Commodity.Flour, 10);
recipe.addIngredient(Commodity.Egg, 10);
return recipe;
}
}
| UTF-8 | Java | 2,996 | java | Program.java | Java | [] | null | [] | package hu.qwaevisz.recipes;
import java.util.Arrays;
public class Program {
public static void main(String[] args) {
Program.testRecipe();
Program.testRecipeBook();
}
private static void testRecipe() {
System.out.println("---[ Recipe ]---");
Recipe recipe = Program.createBesamel();
System.out.println(recipe);
System.out.println("has Onion? " + recipe.hasCommodity(Commodity.Onion));
System.out.println("has Butter? " + recipe.hasCommodity(Commodity.Butter));
System.out.println("number of different commodities: " + recipe.numberOfDifferentCommodities());
System.out.println("total quantity: " + recipe.totalQuantity());
System.out.println("necessary commodities: " + Arrays.toString(recipe.necessaryCommodities()));
}
private static Recipe createBesamel() {
Recipe recipe = new Recipe("Besamel");
recipe.addIngredient(Commodity.Flour, 50);
recipe.addIngredient(Commodity.Butter, 50);
recipe.addIngredient(Commodity.Milk, 50);
recipe.addIngredient(Commodity.Milk, 100);
return recipe;
}
private static void testRecipeBook() {
System.out.println("---[ RecipeBook ]---");
RecipeBook book = new RecipeBook();
book.addRecipe(Program.createBesamel());
book.addRecipe(Program.createRicePudding());
book.addRecipe(Program.createKiev());
book.addRecipe(Program.createRoast());
book.addRecipe(Program.createPorkSchnitzel());
System.out.println(book);
System.out.println("find Besamel: " + book.find("Besamel"));
System.out.println("number of recipes without Onion: " + book.numberOfRecipesWithout(Commodity.Onion));
System.out.println("number of recipes without Egg: " + book.numberOfRecipesWithout(Commodity.Egg));
Recipe[] onionRecipes = book.contains(Commodity.Onion);
System.out.println("Onion recipes: " + Arrays.toString(onionRecipes));
System.out.println("most complicated recipe: " + book.mostComplicated());
}
private static Recipe createRicePudding() {
Recipe recipe = new Recipe("Rice pudding");
recipe.addIngredient(Commodity.Rice, 100);
recipe.addIngredient(Commodity.Milk, 100);
recipe.addIngredient(Commodity.Milk, 200);
recipe.addIngredient(Commodity.Butter, 10);
return recipe;
}
private static Recipe createKiev() {
Recipe recipe = new Recipe("Kiev");
recipe.addIngredient(Commodity.Butter, 10);
recipe.addIngredient(Commodity.Meat, 100);
recipe.addIngredient(Commodity.Butter, 50);
recipe.addIngredient(Commodity.Onion, 10);
return recipe;
}
private static Recipe createRoast() {
Recipe recipe = new Recipe("Roast");
recipe.addIngredient(Commodity.Butter, 10);
recipe.addIngredient(Commodity.Meat, 100);
recipe.addIngredient(Commodity.Flour, 10);
recipe.addIngredient(Commodity.Onion, 30);
return recipe;
}
private static Recipe createPorkSchnitzel() {
Recipe recipe = new Recipe("Pork schnitzel");
recipe.addIngredient(Commodity.Meat, 100);
recipe.addIngredient(Commodity.Flour, 10);
recipe.addIngredient(Commodity.Egg, 10);
return recipe;
}
}
| 2,996 | 0.74032 | 0.7253 | 89 | 32.662922 | 25.907764 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.202247 | false | false | 2 |
00fe326c90a9d711c33634870e1172e6848e357b | 13,494,787,281,741 | 2089481f358514d897d895fb74db38f51bd0f845 | /src/com/company/game/general/Main.java | fa7e945869fce17350fc658ebfa0cbd3d52ef8d6 | [] | no_license | a-xai/hw8 | https://github.com/a-xai/hw8 | fa6a77d4e6dfcffe034b5eee75fe6ec72f872185 | bb3704b4dc968d9779388384d206dee79554e351 | refs/heads/master | 2023-02-17T01:03:20.605000 | 2021-01-18T20:41:31 | 2021-01-18T20:41:31 | 330,742,113 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.company.game.general;
import com.company.game.players.Medic;
public class Main {
public static void main(String[] args) {
RPG_Game.start();
}
}
| UTF-8 | Java | 175 | java | Main.java | Java | [] | null | [] | package com.company.game.general;
import com.company.game.players.Medic;
public class Main {
public static void main(String[] args) {
RPG_Game.start();
}
}
| 175 | 0.668571 | 0.668571 | 10 | 16.5 | 16.608732 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3 | false | false | 2 |
b2275d7e5c5962146cc896d6bd801feda5071c86 | 1,357,209,709,975 | 49a0cedbd7bd3af9a90ba4c3dfc2521a5a80ca51 | /limsproduct/src/main/java/net/zjcclims/web/timetable/CycleGroup.java | 942c6b4fdf7a058763cb636d441d1701f7d038f0 | [] | no_license | sangjiexun/limsproduct2 | https://github.com/sangjiexun/limsproduct2 | a08c611e4197609f36f52c4762585664defe8248 | 7eedf8fa2944ebbd3b3769f1c4cba61864c66b3a | refs/heads/master | 2023-05-05T07:47:11.293000 | 2019-07-21T12:39:48 | 2019-07-21T12:39:48 | 234,906,524 | 0 | 0 | null | false | 2023-04-14T17:11:46 | 2020-01-19T13:39:52 | 2020-04-09T15:58:28 | 2023-04-14T17:11:45 | 102,317 | 0 | 0 | 2 | null | false | false | package net.zjcclims.web.timetable;
public class CycleGroup {
private Integer count;
private Integer groupId;
private String groupName;
private Integer groupNumbers;
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public Integer getGroupNumbers() {
return groupNumbers;
}
public void setGroupNumbers(Integer groupNumbers) {
this.groupNumbers = groupNumbers;
}
}
| UTF-8 | Java | 678 | java | CycleGroup.java | Java | [] | null | [] | package net.zjcclims.web.timetable;
public class CycleGroup {
private Integer count;
private Integer groupId;
private String groupName;
private Integer groupNumbers;
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Integer getGroupId() {
return groupId;
}
public void setGroupId(Integer groupId) {
this.groupId = groupId;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public Integer getGroupNumbers() {
return groupNumbers;
}
public void setGroupNumbers(Integer groupNumbers) {
this.groupNumbers = groupNumbers;
}
}
| 678 | 0.765487 | 0.765487 | 33 | 19.545454 | 15.115897 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.636364 | false | false | 2 |
8b21c1cda8c2c385c288afe2723bedfeadf4592d | 23,330,262,392,176 | 741372e91121730c6d14a5fce180d289f384c30a | /eclipse-workspace/TinyURL/src/com/leetcode/tinyURL/Solution.java | f1c5f2e6bf3c852106d30b7e5054a6f8619e8c0d | [] | no_license | jsong/Algorithm | https://github.com/jsong/Algorithm | 107a83b2c31cd385b5c172f49b93125450fa287a | 75f0d997955df831dc5d8bf7aad910518efcd1bf | refs/heads/master | 2020-03-11T17:18:23.848000 | 2019-04-24T08:53:13 | 2019-04-24T08:53:13 | 130,143,451 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.leetcode.tinyURL;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class Solution {
public static void main(String[] args) {
Solution sl = new Solution();
String tiny = sl.encode("http://since.yesterday.com");
System.out.println(tiny);
String longurl = "http://quitealongurl.com";
System.out.println("hash:"+longurl.hashCode());
String shorturl = sl.decode("http://tinyurl.com/-10514417");
System.out.println(shorturl);
String word = "eat";
char[] characters = word.toCharArray();
Arrays.sort(characters);
String revisedWord = String.valueOf(characters);
System.out.println(revisedWord);
int result = sl.testBreakWhile();
int sum = 5;
sum /= 10;
System.out.println("value:"+sum);
long N = 10;
for (long i = N; i > 0; i /= 2) {
System.out.println("N:"+i);
}
}
Map<Integer, String> map = new HashMap<>();
public String encode(String longUrl) {
map.put(longUrl.hashCode(), longUrl);
return "http://tinyurl.com/" + longUrl.hashCode();
}
public String decode(String shortUrl) {
return map.get(Integer.parseInt(shortUrl.replace("http://tinyurl.com/", "")));
}
public int testBreakWhile(){
int testVar = 9;
int returnValue = 0;
String breakCondition = "string";
while (testVar-- > 0) {
System.out.println("int:"+testVar);
returnValue = testVar;
if(testVar ==3 && breakCondition.equalsIgnoreCase("string")) {
break;
}
}
System.out.println("value:"+ returnValue);
return returnValue;
}
}
| UTF-8 | Java | 1,697 | java | Solution.java | Java | [] | null | [] | package com.leetcode.tinyURL;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class Solution {
public static void main(String[] args) {
Solution sl = new Solution();
String tiny = sl.encode("http://since.yesterday.com");
System.out.println(tiny);
String longurl = "http://quitealongurl.com";
System.out.println("hash:"+longurl.hashCode());
String shorturl = sl.decode("http://tinyurl.com/-10514417");
System.out.println(shorturl);
String word = "eat";
char[] characters = word.toCharArray();
Arrays.sort(characters);
String revisedWord = String.valueOf(characters);
System.out.println(revisedWord);
int result = sl.testBreakWhile();
int sum = 5;
sum /= 10;
System.out.println("value:"+sum);
long N = 10;
for (long i = N; i > 0; i /= 2) {
System.out.println("N:"+i);
}
}
Map<Integer, String> map = new HashMap<>();
public String encode(String longUrl) {
map.put(longUrl.hashCode(), longUrl);
return "http://tinyurl.com/" + longUrl.hashCode();
}
public String decode(String shortUrl) {
return map.get(Integer.parseInt(shortUrl.replace("http://tinyurl.com/", "")));
}
public int testBreakWhile(){
int testVar = 9;
int returnValue = 0;
String breakCondition = "string";
while (testVar-- > 0) {
System.out.println("int:"+testVar);
returnValue = testVar;
if(testVar ==3 && breakCondition.equalsIgnoreCase("string")) {
break;
}
}
System.out.println("value:"+ returnValue);
return returnValue;
}
}
| 1,697 | 0.600471 | 0.589275 | 60 | 27.266666 | 20.435154 | 87 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.166667 | false | false | 2 |
787128b5c97d66c526cf4f658cbd11139f6c2596 | 16,509,854,354,859 | 26ad2ea0e02b346854eb44a038de5a6125bc61ce | /jcms-system-web/src/main/java/org/jcms/system/web/servlet/VerifyCodeServlet.java | edca94359944ba01543dab5ac6edcddc5e7598f9 | [] | no_license | ramostear/JCMS | https://github.com/ramostear/JCMS | bd41f1f1bc8b2b95bc51b24a28859cad2030f520 | e2bf5f627063c2aa94369b47cc5d26b14bbe4bd4 | refs/heads/master | 2021-01-09T05:59:03.811000 | 2017-03-14T10:23:22 | 2017-03-14T10:23:22 | 80,880,762 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* Copyright [2017] [www.ramostear.com]
*
* Licensed under the Apache License, Version 2.0 (the "License");<br/>
* you may not use this file except in compliance with the License.<br/>
* You may obtain a copy of the License at<br/>
* <br/>
* http://www.apache.org/licenses/LICENSE-2.0<br/>
* <br/>
* Unless required by applicable law or agreed to in writing, software<br/>
* distributed under the License is distributed on an "AS IS" BASIS,<br/>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br/>
* See the License for the specific language governing permissions and<br/>
* limitations under the License.<br/>
*
*/
package org.jcms.system.web.servlet;
import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.jcms.system.utils.VerifyCodeUtil;
import org.jcms.system.web.constants.SystemContant;
/**
* @Author Abihu[谭朝红] - - -2017年2月7日-上午9:56:56
* @Info http://www.abihu.org
* @Description:
*/
public class VerifyCodeServlet extends HttpServlet implements Servlet {
/**
*
*/
private static final long serialVersionUID = 8146953940070978093L;
public void service(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
response.setContentType("image/jpeg");
//1.生成随机字符串
String verifyCode = VerifyCodeUtil.generateVerifyCode(4);
//2.把字符串存入会话
HttpSession session = request.getSession(true);
//3.清除之前的验证码信息
session.removeAttribute(SystemContant.VERIFY_CODE);
//4.存入当前新的验证码字符串
session.setAttribute(SystemContant.VERIFY_CODE, verifyCode);
//5.生成验证码图片
int w=119,h=40;
VerifyCodeUtil.outputImage(w, h, response.getOutputStream(), verifyCode);
}
}
| UTF-8 | Java | 2,286 | java | VerifyCodeServlet.java | Java | [
{
"context": "em.web.constants.SystemContant;\r\n\r\n/**\r\n * @Author Abihu[谭朝红] - - -2017年2月7日-上午9:56:56\r\n * @Info http://ww",
"end": 1136,
"score": 0.9809579849243164,
"start": 1131,
"tag": "NAME",
"value": "Abihu"
}
] | null | [] | /**
* Copyright [2017] [www.ramostear.com]
*
* Licensed under the Apache License, Version 2.0 (the "License");<br/>
* you may not use this file except in compliance with the License.<br/>
* You may obtain a copy of the License at<br/>
* <br/>
* http://www.apache.org/licenses/LICENSE-2.0<br/>
* <br/>
* Unless required by applicable law or agreed to in writing, software<br/>
* distributed under the License is distributed on an "AS IS" BASIS,<br/>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br/>
* See the License for the specific language governing permissions and<br/>
* limitations under the License.<br/>
*
*/
package org.jcms.system.web.servlet;
import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.jcms.system.utils.VerifyCodeUtil;
import org.jcms.system.web.constants.SystemContant;
/**
* @Author Abihu[谭朝红] - - -2017年2月7日-上午9:56:56
* @Info http://www.abihu.org
* @Description:
*/
public class VerifyCodeServlet extends HttpServlet implements Servlet {
/**
*
*/
private static final long serialVersionUID = 8146953940070978093L;
public void service(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
response.setContentType("image/jpeg");
//1.生成随机字符串
String verifyCode = VerifyCodeUtil.generateVerifyCode(4);
//2.把字符串存入会话
HttpSession session = request.getSession(true);
//3.清除之前的验证码信息
session.removeAttribute(SystemContant.VERIFY_CODE);
//4.存入当前新的验证码字符串
session.setAttribute(SystemContant.VERIFY_CODE, verifyCode);
//5.生成验证码图片
int w=119,h=40;
VerifyCodeUtil.outputImage(w, h, response.getOutputStream(), verifyCode);
}
}
| 2,286 | 0.696609 | 0.673694 | 60 | 34.366665 | 27.762665 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.183333 | false | false | 2 |
8f55a7248c281d566bee4865a4acce487d16b81f | 17,884,243,879,288 | ada97b1019b9dc7ba2ee57379cae4eae541db0f0 | /src/transicao/TnodoTransicao.java | c3a2b8d3bf8e8186f8267bc7db19f0c633e1b0dd | [] | no_license | luizmoitinho/Automato-com-Pilha | https://github.com/luizmoitinho/Automato-com-Pilha | 8c22d134f965a4d3b918ef8283b7ebfd4f10d83a | 97bccb698bee21ae5ef054fb7eb845dfe50746a7 | refs/heads/master | 2022-12-03T02:57:16.057000 | 2020-07-17T22:10:14 | 2020-07-17T22:10:14 | 177,233,646 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package transicao;
public class TnodoTransicao {
public TinfoTransicao item;
public TnodoTransicao proximo;
public TnodoTransicao() {}
public TnodoTransicao(TinfoTransicao item) {
this.item = new TinfoTransicao(item.getDe(),item.getPara(),item.getComSimbolo(),item.getLendoPilha(),item.getInserindoPilha());
this.proximo=null;
}
}
| UTF-8 | Java | 350 | java | TnodoTransicao.java | Java | [] | null | [] | package transicao;
public class TnodoTransicao {
public TinfoTransicao item;
public TnodoTransicao proximo;
public TnodoTransicao() {}
public TnodoTransicao(TinfoTransicao item) {
this.item = new TinfoTransicao(item.getDe(),item.getPara(),item.getComSimbolo(),item.getLendoPilha(),item.getInserindoPilha());
this.proximo=null;
}
}
| 350 | 0.757143 | 0.757143 | 15 | 22.333334 | 32.138588 | 130 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.466667 | false | false | 2 |
1504445fecdd840a850442bab668003a986327a6 | 15,015,205,675,415 | 0b841802a62b24ff7f2b219341d766b9712e6288 | /download/src/main/java/com/zhangwy/download/db/DBManager.java | 837fcea1f93da55162778bb7d7839542cc16942b | [] | no_license | zwyzzu/library | https://github.com/zwyzzu/library | 304a465e05985a5f8856a0bd7edbf92020110792 | 471de58f348c6ee33400b40217c984f07ea86da1 | refs/heads/master | 2021-07-08T13:35:53.062000 | 2021-04-30T06:14:01 | 2021-04-30T06:14:01 | 39,627,058 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.zhangwy.download.db;
import android.content.Context;
import com.zhangwy.download.entity.DownloadEntity;
import java.util.List;
/**
* Author: zhangwy(张维亚)
* Email: zhangweiya@yixia.com
* 创建时间:2017/5/15 下午2:50
* 修改时间:2017/5/15 下午2:50
* Description:数据库管理
*/
public abstract class DBManager {
public static DBManager initialized(Context context) {
return getInstance().init(context);
}
private static DBManager instance;
public static DBManager getInstance() {
if (instance == null) {
synchronized (DBManager.class) {
if (instance == null) {
instance = new DBManagerImpl();
}
}
}
return instance;
}
/********************************************************************************************
* 初始化,调用数据库之前必须初始化
*
* @param context 上下文
* @return 返回当前实例对象
*/
public abstract DBManager init(Context context);
/**
* 添加下载任务
*
* @param entity 下载任务实例
* @return true add success; false add failed
*/
public abstract boolean addDownload(DownloadEntity entity);
/**
* 删除下载任务根据任务ID
*
* @param id will delete task's id
* @return true find and delete success
*/
public abstract boolean delDownloadById(String id);
/**
* 删除下载任务根据任务url
*
* @param url will delete task's url
* @return true find and delete success
*/
public abstract boolean delDownloadByUrl(String url);
/**
* 更新下载任务进度
*
* @param id will update task's id
* @param progress task download progress
* @return true find and update success
*/
public abstract boolean updateDownloadProgress(String id, float progress);
/**
* 更新下载任务进度
*
* @param id will update task's id
* @param entity task entity
* @return true find and update success
*/
public abstract boolean updateDownload(String id, DownloadEntity entity);
/**
* 获取下载任务根据任务ID
*
* @param id want task's id
* @return null find failed
*/
public abstract DownloadEntity getDownloadById(String id);
/**
* 获取下载任务根据任务ID
*
* @param url want task's url
* @return null find failed
*/
public abstract DownloadEntity getDownloadByUrl(String url);
/**
* 获取所有的下载任务列表
*
* @return all download task
*/
public abstract List<DownloadEntity> getAllDownload();
}
| UTF-8 | Java | 2,769 | java | DBManager.java | Java | [
{
"context": "oadEntity;\n\nimport java.util.List;\n\n/**\n * Author: zhangwy(张维亚)\n * Email: zhangweiya@yixia.com\n * 创建时间:2017",
"end": 165,
"score": 0.9996712803840637,
"start": 158,
"tag": "USERNAME",
"value": "zhangwy"
},
{
"context": ";\n\nimport java.util.List;\n\n/**\n * Aut... | null | [] | package com.zhangwy.download.db;
import android.content.Context;
import com.zhangwy.download.entity.DownloadEntity;
import java.util.List;
/**
* Author: zhangwy(张维亚)
* Email: <EMAIL>
* 创建时间:2017/5/15 下午2:50
* 修改时间:2017/5/15 下午2:50
* Description:数据库管理
*/
public abstract class DBManager {
public static DBManager initialized(Context context) {
return getInstance().init(context);
}
private static DBManager instance;
public static DBManager getInstance() {
if (instance == null) {
synchronized (DBManager.class) {
if (instance == null) {
instance = new DBManagerImpl();
}
}
}
return instance;
}
/********************************************************************************************
* 初始化,调用数据库之前必须初始化
*
* @param context 上下文
* @return 返回当前实例对象
*/
public abstract DBManager init(Context context);
/**
* 添加下载任务
*
* @param entity 下载任务实例
* @return true add success; false add failed
*/
public abstract boolean addDownload(DownloadEntity entity);
/**
* 删除下载任务根据任务ID
*
* @param id will delete task's id
* @return true find and delete success
*/
public abstract boolean delDownloadById(String id);
/**
* 删除下载任务根据任务url
*
* @param url will delete task's url
* @return true find and delete success
*/
public abstract boolean delDownloadByUrl(String url);
/**
* 更新下载任务进度
*
* @param id will update task's id
* @param progress task download progress
* @return true find and update success
*/
public abstract boolean updateDownloadProgress(String id, float progress);
/**
* 更新下载任务进度
*
* @param id will update task's id
* @param entity task entity
* @return true find and update success
*/
public abstract boolean updateDownload(String id, DownloadEntity entity);
/**
* 获取下载任务根据任务ID
*
* @param id want task's id
* @return null find failed
*/
public abstract DownloadEntity getDownloadById(String id);
/**
* 获取下载任务根据任务ID
*
* @param url want task's url
* @return null find failed
*/
public abstract DownloadEntity getDownloadByUrl(String url);
/**
* 获取所有的下载任务列表
*
* @return all download task
*/
public abstract List<DownloadEntity> getAllDownload();
}
| 2,756 | 0.582837 | 0.574891 | 108 | 22.305555 | 21.153959 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.185185 | false | false | 2 |
9fa133dbaa9d9956f98d685df2919cfb9048f08a | 8,151,847,988,545 | 48746f5e49e8dda41c2b2a75c9b4c3a67b473185 | /src/main/java/demoStore/entities/Product.java | 7d4afd9837df085835640ae0c4d3004b2affd5dc | [] | no_license | arunmadhavan-g/DemoStore | https://github.com/arunmadhavan-g/DemoStore | 21e8ecb78bc0619fb7654ac23f5c8a73e7bddf53 | f765176a2da1378f21cbb84b19a997dd8d8ca454 | refs/heads/master | 2020-11-24T12:35:46.687000 | 2019-12-15T07:31:24 | 2019-12-15T07:31:24 | 228,146,007 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package demoStore.entities;
import lombok.Data;
import javax.persistence.*;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
@Data
@Entity
@Table(name = "products")
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull private String name;
private String description;
@NotNull
@DecimalMin("0.0")
private double price;
}
| UTF-8 | Java | 436 | java | Product.java | Java | [] | null | [] | package demoStore.entities;
import lombok.Data;
import javax.persistence.*;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
@Data
@Entity
@Table(name = "products")
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotNull private String name;
private String description;
@NotNull
@DecimalMin("0.0")
private double price;
}
| 436 | 0.761468 | 0.756881 | 23 | 17.956522 | 15.771406 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.391304 | false | false | 2 |
d36213363fbb713f16aba71bea98d754603df138 | 37,958,920,985,251 | c9894649b7e5bb937dc74b5d5b0cea54cf0669a5 | /src/main/java/zsp/diploma/mintriang/exception/AlgorithmIncompleteException.java | a5449ac7f725b049ae85bacf7e2297a6ff28653e | [] | no_license | SergeyZyazulkin/Diploma | https://github.com/SergeyZyazulkin/Diploma | 5e7cdc693f2a41c0c770fc83f202d63e002a875b | 38929a86d1453b0154bbfd711a83c707a624cdbe | refs/heads/master | 2021-01-20T08:30:37.628000 | 2017-05-14T22:03:31 | 2017-05-14T22:03:31 | 90,156,535 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package zsp.diploma.mintriang.exception;
public class AlgorithmIncompleteException extends TriangulationException {
public AlgorithmIncompleteException() {
}
public AlgorithmIncompleteException(String message) {
super(message);
}
public AlgorithmIncompleteException(String message, Throwable cause) {
super(message, cause);
}
public AlgorithmIncompleteException(Throwable cause) {
super(cause);
}
public AlgorithmIncompleteException(String message, Throwable cause, boolean enableSuppression, boolean
writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
| UTF-8 | Java | 679 | java | AlgorithmIncompleteException.java | Java | [] | null | [] | package zsp.diploma.mintriang.exception;
public class AlgorithmIncompleteException extends TriangulationException {
public AlgorithmIncompleteException() {
}
public AlgorithmIncompleteException(String message) {
super(message);
}
public AlgorithmIncompleteException(String message, Throwable cause) {
super(message, cause);
}
public AlgorithmIncompleteException(Throwable cause) {
super(cause);
}
public AlgorithmIncompleteException(String message, Throwable cause, boolean enableSuppression, boolean
writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
| 679 | 0.72754 | 0.72754 | 24 | 27.291666 | 30.572971 | 107 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.541667 | false | false | 2 |
72b06b7f9dc890ffb0df83ff1c10271648706d43 | 36,971,078,514,720 | f49946c7b7e7771d26fe073c5e6ff3456507cc25 | /src/test/java/pkg/Demo1Test.java | e62f744b19f16cc7fdacfb5d702b41e63cb434a5 | [] | no_license | aruneshmp/repo_maven | https://github.com/aruneshmp/repo_maven | 19b9d64ba555d8a30c290d91b5fc8e0d64d6654d | b4493398c8d220cf8c007794c45d05899c792246 | refs/heads/master | 2020-03-23T06:47:41.808000 | 2018-07-17T07:41:02 | 2018-07-17T07:41:02 | 141,230,129 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package pkg;
public class Demo1Test {
public static void main(String[] args) {
System.out.println("jdkasjdk");
}
}
| UTF-8 | Java | 123 | java | Demo1Test.java | Java | [] | null | [] | package pkg;
public class Demo1Test {
public static void main(String[] args) {
System.out.println("jdkasjdk");
}
}
| 123 | 0.682927 | 0.674797 | 10 | 11.3 | 14.893287 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false | 2 |
133fe9685db24af92c53de7df270ba064006aa49 | 38,826,504,369,510 | af100e95517dd73d280f42300d77c04238ae9484 | /ncsa-common-jpa/src/main/java/edu/illinois/ncsa/jpa/dao/AccountJPADao.java | 3c3739feebc34b894ad2ddb00b3c1b21b6ff6473 | [] | no_license | ncsa/datawolf | https://github.com/ncsa/datawolf | bc02fafdb549745122fc608b90e43576305f45cf | ecc2f147ba57740df3d62428c5f39a09d0f9bfda | refs/heads/develop | 2023-07-22T04:33:16.932000 | 2023-07-07T15:55:29 | 2023-07-07T15:55:29 | 34,529,293 | 5 | 0 | null | false | 2023-07-07T15:55:31 | 2015-04-24T16:26:34 | 2023-01-10T18:32:38 | 2023-07-07T15:55:30 | 8,643 | 2 | 0 | 11 | Java | false | false | package edu.illinois.ncsa.jpa.dao;
import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
import edu.illinois.ncsa.domain.Account;
import edu.illinois.ncsa.domain.dao.AccountDao;
public class AccountJPADao extends AbstractJPADao<Account, String> implements AccountDao {
@Inject
public AccountJPADao(Provider<EntityManager> entityManager) {
super(entityManager);
}
@Override
@Transactional
public Account findByUserid(String userId) {
EntityManager em = getEntityManager();
List<Account> list = null;
String queryString = "SELECT a FROM Account a " + "WHERE a.userid = :userid";
TypedQuery<Account> typedQuery = em.createQuery(queryString, Account.class);
typedQuery.setParameter("userid", userId);
list = typedQuery.getResultList();
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
@Override
public Account findByToken(String token) {
EntityManager em = getEntityManager();
List<Account> list = null;
String queryString = "SELECT a FROM Account a " + "WHERE a.token = :token";
TypedQuery<Account> typedQuery = em.createQuery(queryString, Account.class);
typedQuery.setParameter("token", token);
list = typedQuery.getResultList();
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
}
| UTF-8 | Java | 1,585 | java | AccountJPADao.java | Java | [] | null | [] | package edu.illinois.ncsa.jpa.dao;
import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
import edu.illinois.ncsa.domain.Account;
import edu.illinois.ncsa.domain.dao.AccountDao;
public class AccountJPADao extends AbstractJPADao<Account, String> implements AccountDao {
@Inject
public AccountJPADao(Provider<EntityManager> entityManager) {
super(entityManager);
}
@Override
@Transactional
public Account findByUserid(String userId) {
EntityManager em = getEntityManager();
List<Account> list = null;
String queryString = "SELECT a FROM Account a " + "WHERE a.userid = :userid";
TypedQuery<Account> typedQuery = em.createQuery(queryString, Account.class);
typedQuery.setParameter("userid", userId);
list = typedQuery.getResultList();
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
@Override
public Account findByToken(String token) {
EntityManager em = getEntityManager();
List<Account> list = null;
String queryString = "SELECT a FROM Account a " + "WHERE a.token = :token";
TypedQuery<Account> typedQuery = em.createQuery(queryString, Account.class);
typedQuery.setParameter("token", token);
list = typedQuery.getResultList();
if (list.isEmpty()) {
return null;
}
return list.get(0);
}
}
| 1,585 | 0.670032 | 0.66877 | 54 | 28.351852 | 25.442133 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.574074 | false | false | 2 |
8ab8173f757453074aade7e4995061657ff1680b | 34,248,069,275,894 | 23638de8b8fa935d560fe6b6567fbb77beb4342d | /src/main/java/com/cdiogo/swingy/views/ConsoleDisplay.java | ef2a52541678dbd3529ffe796c2fd755eda7ff84 | [] | no_license | CharlieDeltaZA/Swingy | https://github.com/CharlieDeltaZA/Swingy | ceab214212d412863363c6f8a584b43ba3e22325 | e5079732285bdf2de5877804aee81f565ed65f6e | refs/heads/master | 2023-01-11T13:59:06.275000 | 2020-11-15T17:08:38 | 2020-11-15T17:08:38 | 290,435,952 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cdiogo.swingy.views;
import java.util.List;
import java.util.Scanner;
import com.cdiogo.swingy.controllers.GameController;
import com.cdiogo.swingy.models.heroes.Player;
import com.cdiogo.swingy.models.villains.Villain;
public class ConsoleDisplay implements Display {
private Scanner sysin;
private GameController controller;
private final String COL_GREEN = "\u001b[32m";
private final String COL_CYAN = "\u001b[36m";
private final String COL_RED = "\u001b[31m";
private final String COL_RESET = "\u001b[0m";
private boolean gui = false;
public ConsoleDisplay(GameController controller) {
sysin = new Scanner(System.in);
this.controller = controller;
}
@Override
public void startScreen() {
String choice = "";
while (!(choice.equals("c") || choice.equals("l") || choice.equals("x") || choice.equals("q"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------------------+");
System.out.println("| WELCOME TO |");
System.out.println("| _____ _ |");
System.out.println("| / ___| (_) |");
System.out.println("| \\ `--.__ ___ _ __ __ _ _ _ |");
System.out.println("| `--. \\ \\ /\\ / / | '_ \\ / _` | | | | |");
System.out.println("| /\\__/ /\\ V V /| | | | | (_| | |_| | |");
System.out.println("| \\____/ \\_/\\_/ |_|_| |_|\\__, |\\__, | |");
System.out.println("| __/ | __/ | |");
System.out.println("| |___/ |___/ |");
System.out.println("| |");
System.out.println("| c - Create a Character |");
System.out.println("| l - Load an existing Character |");
System.out.println("| x - Switch to GUI |");
System.out.println("| q - Quit Game |");
System.out.println("| |");
System.out.println("+----------------------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void createCharName() {
String choice = "";
while (choice.equals("")) {
System.out.print("\033[H\033[2J");
System.out.println("+-------------------------+");
System.out.println("| |");
System.out.println("| Enter Hero Name |");
System.out.println("| |");
System.out.println("+-------------------------+");
System.out.print("Hero Name: ");
if (sysin.hasNext()) {
choice = sysin.nextLine();
}
}
controller.handleInput(choice);
}
@Override
public void createCharClass() {
String choice = "";
while (!(choice.equals("1") || choice.equals("2") || choice.equals("3") || choice.equals("4") || choice.equals("b"))) {
System.out.print("\033[H\033[2J");
System.out.println("+--------------------------+");
System.out.println("| |");
System.out.println("| Enter Hero Class |");
System.out.println("| |");
System.out.println("| 1 - Ranger |");
System.out.println("| 2 - Wizard |");
System.out.println("| 3 - Fighter |");
System.out.println("| 4 - Rogue |");
System.out.println("| |");
System.out.println("| b - Back to Menu |");
System.out.println("| |");
System.out.println("+--------------------------+");
System.out.print("Hero Class: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void loadChar(List<Player> heroes) {
int i = 1;
String choice = "";
while (!(choice.equals("b") || choice.matches("\\d+"))) {
System.out.print("\033[H\033[2J");
System.out.println("+---------------------------------------+");
System.out.println(" ");
System.out.println(" Choose a Hero ");
System.out.println(" ");
try {
if (heroes.size() != 0) {
for (Player hero : heroes) {
System.out.println(String.format(" %d - %s : %s ", i, hero.getHeroName(), hero.getHeroClass()));
i++;
}
i = 1;
} else {
System.out.println(" No Saved Heroes found! ");
System.out.println(" Try creating one instead ");
}
} catch (NullPointerException e) {
//TODO: handle exception
System.out.println("Caught NullPtrExc");
e.printStackTrace();
}
System.out.println(" ");
System.out.println(" b - Back to Menu ");
System.out.println(" ");
System.out.println("+---------------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
public void changeDisplay(boolean bool) {
System.out.print("\033[H\033[2J");
gui = bool;
}
@Override
public void renderGame() {
while (!controller.isGameOver() && !gui) {
controller.displayState();
}
}
@Override
public void playGame() {
String choice = "";
char[][] map;
while (!(choice.equals("w") || choice.equals("a") || choice.equals("s") || choice.equals("d")
|| choice.equals("q") || choice.equals("c") || choice.equals("x"))) {
System.out.print("\033[H\033[2J");
System.out.println("+---------------------------------------+");
System.out.println("| |");
if (controller.isHeroEscaped()) {
controller.setHeroEscaped(false);
System.out.println("| You have successfully escaped |");
System.out.println("| |");
}
if (controller.isLevelUp()) {
controller.setLevelUp(false);
System.out.println("| You have levelled up! |");
System.out.println("| |");
}
if (controller.isSaved()) {
controller.setSaved(false);
System.out.println("| Player Saved! |");
System.out.println("| |");
}
System.out.println("| w/a/s/d - Move Hero |");
System.out.println("| c - Save Hero |");
System.out.println("| x - Switch to GUI |");
System.out.println("| q - Quit Game |");
System.out.println("| |");
System.out.println("+---------------------------------------+");
System.out.println(controller.getHero().toString());
System.out.println("");
map = controller.getMap();
for (int i = 0; i < map[0].length; i++) {
for (int k = 0; k < map[0].length; k++) {
if (map[i][k] == 'H') {
System.out.print(COL_GREEN + map[i][k] + COL_RESET);
} else if (map[i][k] == '.') {
System.out.print(COL_CYAN + map[i][k] + COL_RESET);
} else if (map[i][k] == 'V') {
System.out.print(COL_RED + map[i][k] + COL_RESET);
} else {
System.out.print(map[i][k]);
}
if (map[0].length < 35) {
System.out.print(" ");
}
}
System.out.print("\n");
}
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void fightOrFlight() {
String choice = "";
while (!(choice.equals("f") || choice.equals("r") || choice.equals("y") || choice.equals("n"))) {
System.out.print("\033[H\033[2J");
System.out.println("+--------------------------------------+");
System.out.println(" ");
System.out.println(" You have encountered a villain! ");
System.out.println(" ");
System.out.println(String.format(" %s ", controller.getCurrentEnemy().toString()));
System.out.println(" ");
System.out.println(" f - Fight the enemy ");
System.out.println(" r - Attempt to flee ");
System.out.println(" ");
System.out.println("+--------------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void roundWon() {
String choice = "";
while (!(choice.equals("r") || choice.equals("q"))) {
System.out.print("\033[H\033[2J");
System.out.println("+-----------------------------------+");
System.out.println("| |");
System.out.println("| You have Successfully |");
System.out.println("| completed this level! |");
System.out.println("| |");
System.out.println("| Continue your adventure |");
System.out.println("| from the main menu, or |");
System.out.println("| try a new character, by |");
System.out.println("| pressing 'l' to choose. |");
System.out.println("| |");
System.out.println("| r - Return to Main Menu |");
System.out.println("| q - Quit Game |");
System.out.println("| |");
System.out.println("+-----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void quitGame() {
String choice = "";
while (!(choice.equals("y") || choice.equals("n"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println("| |");
System.out.println("| Are you sure you would |");
System.out.println("| like to quit the game? |");
System.out.println("| |");
System.out.println("| y - Save and Quit |");
System.out.println("| n - Return to previous |");
System.out.println("| screen |");
System.out.println("| |");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void noEscape() {
String choice = "";
while (!(choice.equals("c"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println("| |");
System.out.println("| Your attempt to flee has |");
System.out.println("| failed! Prepare for |");
System.out.println("| BATTLE! |");
System.out.println("| |");
System.out.println("| c - Continue |");
System.out.println("| |");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void afterAction() {
String choice = "";
Villain enemy = controller.getCurrentEnemy();
if (enemy.getArtifact() != null) {
while (!(choice.equals("y") || choice.equals("n"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println(" ");
System.out.println(String.format(" You have defeated the %s ", enemy.getName()));
System.out.println(String.format(" You gain %d XP ", enemy.getXp()));
System.out.println(" ");
System.out.println(" This villain dropped an artifact! ");
System.out.println(String.format(" %s", enemy.getArtifact().toString()));
System.out.println(" ");
System.out.println(" Would you like to equip it? ");
System.out.println(" y - Equip // n - Ignore ");
System.out.println(" ");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
} else {
while (!(choice.equals("c"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println(" ");
System.out.println(String.format(" You have defeated the %s ", enemy.getName()));
System.out.println(String.format(" You gain %d XP ", enemy.getXp()));
System.out.println(" c - Continue ");
System.out.println(" ");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
}
controller.handleInput(choice);
}
@Override
public void gameOver() {
String choice = "";
while (!(choice.equals("r") || choice.equals("q"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println("| |");
System.out.println("| GAME OVER |");
System.out.println("| |");
System.out.println("| Your hero has died :( |");
System.out.println("| |");
System.out.println("| You may return to the |");
System.out.println("| menu and play again, or |");
System.out.println("| you may quit. |");
System.out.println("| |");
System.out.println("| r - Return to menu |");
System.out.println("| q - Save and Quit |");
System.out.println("| |");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
}
| UTF-8 | Java | 17,827 | java | ConsoleDisplay.java | Java | [] | null | [] | package com.cdiogo.swingy.views;
import java.util.List;
import java.util.Scanner;
import com.cdiogo.swingy.controllers.GameController;
import com.cdiogo.swingy.models.heroes.Player;
import com.cdiogo.swingy.models.villains.Villain;
public class ConsoleDisplay implements Display {
private Scanner sysin;
private GameController controller;
private final String COL_GREEN = "\u001b[32m";
private final String COL_CYAN = "\u001b[36m";
private final String COL_RED = "\u001b[31m";
private final String COL_RESET = "\u001b[0m";
private boolean gui = false;
public ConsoleDisplay(GameController controller) {
sysin = new Scanner(System.in);
this.controller = controller;
}
@Override
public void startScreen() {
String choice = "";
while (!(choice.equals("c") || choice.equals("l") || choice.equals("x") || choice.equals("q"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------------------+");
System.out.println("| WELCOME TO |");
System.out.println("| _____ _ |");
System.out.println("| / ___| (_) |");
System.out.println("| \\ `--.__ ___ _ __ __ _ _ _ |");
System.out.println("| `--. \\ \\ /\\ / / | '_ \\ / _` | | | | |");
System.out.println("| /\\__/ /\\ V V /| | | | | (_| | |_| | |");
System.out.println("| \\____/ \\_/\\_/ |_|_| |_|\\__, |\\__, | |");
System.out.println("| __/ | __/ | |");
System.out.println("| |___/ |___/ |");
System.out.println("| |");
System.out.println("| c - Create a Character |");
System.out.println("| l - Load an existing Character |");
System.out.println("| x - Switch to GUI |");
System.out.println("| q - Quit Game |");
System.out.println("| |");
System.out.println("+----------------------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void createCharName() {
String choice = "";
while (choice.equals("")) {
System.out.print("\033[H\033[2J");
System.out.println("+-------------------------+");
System.out.println("| |");
System.out.println("| Enter Hero Name |");
System.out.println("| |");
System.out.println("+-------------------------+");
System.out.print("Hero Name: ");
if (sysin.hasNext()) {
choice = sysin.nextLine();
}
}
controller.handleInput(choice);
}
@Override
public void createCharClass() {
String choice = "";
while (!(choice.equals("1") || choice.equals("2") || choice.equals("3") || choice.equals("4") || choice.equals("b"))) {
System.out.print("\033[H\033[2J");
System.out.println("+--------------------------+");
System.out.println("| |");
System.out.println("| Enter Hero Class |");
System.out.println("| |");
System.out.println("| 1 - Ranger |");
System.out.println("| 2 - Wizard |");
System.out.println("| 3 - Fighter |");
System.out.println("| 4 - Rogue |");
System.out.println("| |");
System.out.println("| b - Back to Menu |");
System.out.println("| |");
System.out.println("+--------------------------+");
System.out.print("Hero Class: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void loadChar(List<Player> heroes) {
int i = 1;
String choice = "";
while (!(choice.equals("b") || choice.matches("\\d+"))) {
System.out.print("\033[H\033[2J");
System.out.println("+---------------------------------------+");
System.out.println(" ");
System.out.println(" Choose a Hero ");
System.out.println(" ");
try {
if (heroes.size() != 0) {
for (Player hero : heroes) {
System.out.println(String.format(" %d - %s : %s ", i, hero.getHeroName(), hero.getHeroClass()));
i++;
}
i = 1;
} else {
System.out.println(" No Saved Heroes found! ");
System.out.println(" Try creating one instead ");
}
} catch (NullPointerException e) {
//TODO: handle exception
System.out.println("Caught NullPtrExc");
e.printStackTrace();
}
System.out.println(" ");
System.out.println(" b - Back to Menu ");
System.out.println(" ");
System.out.println("+---------------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
public void changeDisplay(boolean bool) {
System.out.print("\033[H\033[2J");
gui = bool;
}
@Override
public void renderGame() {
while (!controller.isGameOver() && !gui) {
controller.displayState();
}
}
@Override
public void playGame() {
String choice = "";
char[][] map;
while (!(choice.equals("w") || choice.equals("a") || choice.equals("s") || choice.equals("d")
|| choice.equals("q") || choice.equals("c") || choice.equals("x"))) {
System.out.print("\033[H\033[2J");
System.out.println("+---------------------------------------+");
System.out.println("| |");
if (controller.isHeroEscaped()) {
controller.setHeroEscaped(false);
System.out.println("| You have successfully escaped |");
System.out.println("| |");
}
if (controller.isLevelUp()) {
controller.setLevelUp(false);
System.out.println("| You have levelled up! |");
System.out.println("| |");
}
if (controller.isSaved()) {
controller.setSaved(false);
System.out.println("| Player Saved! |");
System.out.println("| |");
}
System.out.println("| w/a/s/d - Move Hero |");
System.out.println("| c - Save Hero |");
System.out.println("| x - Switch to GUI |");
System.out.println("| q - Quit Game |");
System.out.println("| |");
System.out.println("+---------------------------------------+");
System.out.println(controller.getHero().toString());
System.out.println("");
map = controller.getMap();
for (int i = 0; i < map[0].length; i++) {
for (int k = 0; k < map[0].length; k++) {
if (map[i][k] == 'H') {
System.out.print(COL_GREEN + map[i][k] + COL_RESET);
} else if (map[i][k] == '.') {
System.out.print(COL_CYAN + map[i][k] + COL_RESET);
} else if (map[i][k] == 'V') {
System.out.print(COL_RED + map[i][k] + COL_RESET);
} else {
System.out.print(map[i][k]);
}
if (map[0].length < 35) {
System.out.print(" ");
}
}
System.out.print("\n");
}
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void fightOrFlight() {
String choice = "";
while (!(choice.equals("f") || choice.equals("r") || choice.equals("y") || choice.equals("n"))) {
System.out.print("\033[H\033[2J");
System.out.println("+--------------------------------------+");
System.out.println(" ");
System.out.println(" You have encountered a villain! ");
System.out.println(" ");
System.out.println(String.format(" %s ", controller.getCurrentEnemy().toString()));
System.out.println(" ");
System.out.println(" f - Fight the enemy ");
System.out.println(" r - Attempt to flee ");
System.out.println(" ");
System.out.println("+--------------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void roundWon() {
String choice = "";
while (!(choice.equals("r") || choice.equals("q"))) {
System.out.print("\033[H\033[2J");
System.out.println("+-----------------------------------+");
System.out.println("| |");
System.out.println("| You have Successfully |");
System.out.println("| completed this level! |");
System.out.println("| |");
System.out.println("| Continue your adventure |");
System.out.println("| from the main menu, or |");
System.out.println("| try a new character, by |");
System.out.println("| pressing 'l' to choose. |");
System.out.println("| |");
System.out.println("| r - Return to Main Menu |");
System.out.println("| q - Quit Game |");
System.out.println("| |");
System.out.println("+-----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void quitGame() {
String choice = "";
while (!(choice.equals("y") || choice.equals("n"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println("| |");
System.out.println("| Are you sure you would |");
System.out.println("| like to quit the game? |");
System.out.println("| |");
System.out.println("| y - Save and Quit |");
System.out.println("| n - Return to previous |");
System.out.println("| screen |");
System.out.println("| |");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void noEscape() {
String choice = "";
while (!(choice.equals("c"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println("| |");
System.out.println("| Your attempt to flee has |");
System.out.println("| failed! Prepare for |");
System.out.println("| BATTLE! |");
System.out.println("| |");
System.out.println("| c - Continue |");
System.out.println("| |");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
@Override
public void afterAction() {
String choice = "";
Villain enemy = controller.getCurrentEnemy();
if (enemy.getArtifact() != null) {
while (!(choice.equals("y") || choice.equals("n"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println(" ");
System.out.println(String.format(" You have defeated the %s ", enemy.getName()));
System.out.println(String.format(" You gain %d XP ", enemy.getXp()));
System.out.println(" ");
System.out.println(" This villain dropped an artifact! ");
System.out.println(String.format(" %s", enemy.getArtifact().toString()));
System.out.println(" ");
System.out.println(" Would you like to equip it? ");
System.out.println(" y - Equip // n - Ignore ");
System.out.println(" ");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
} else {
while (!(choice.equals("c"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println(" ");
System.out.println(String.format(" You have defeated the %s ", enemy.getName()));
System.out.println(String.format(" You gain %d XP ", enemy.getXp()));
System.out.println(" c - Continue ");
System.out.println(" ");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
}
controller.handleInput(choice);
}
@Override
public void gameOver() {
String choice = "";
while (!(choice.equals("r") || choice.equals("q"))) {
System.out.print("\033[H\033[2J");
System.out.println("+----------------------------------+");
System.out.println("| |");
System.out.println("| GAME OVER |");
System.out.println("| |");
System.out.println("| Your hero has died :( |");
System.out.println("| |");
System.out.println("| You may return to the |");
System.out.println("| menu and play again, or |");
System.out.println("| you may quit. |");
System.out.println("| |");
System.out.println("| r - Return to menu |");
System.out.println("| q - Save and Quit |");
System.out.println("| |");
System.out.println("+----------------------------------+");
System.out.print("Your choice: ");
if (sysin.hasNext()) {
choice = sysin.next();
}
}
controller.handleInput(choice);
}
}
| 17,827 | 0.376227 | 0.369047 | 393 | 44.361324 | 29.095381 | 127 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.21374 | false | false | 2 |
c4e975d908d597d137fcfd7fc8cf15afca650d2d | 36,438,502,581,083 | c8429e20ed85316626a93fb9044bb4eb063b5e0e | /src/invencol/ui/main/FXMLMainController.java | b97a96df407af67bcf86df701c5b2400ca459c36 | [
"Apache-2.0"
] | permissive | vigoru/java-simple-moblie-inventory | https://github.com/vigoru/java-simple-moblie-inventory | 31f24d52f863e4174358cfffb956f0ad450cb7af | 72f3a46801203e046953fe7e876b44a0df5b1fb6 | refs/heads/master | 2021-02-18T06:45:53.418000 | 2020-03-05T14:00:48 | 2020-03-05T14:00:48 | 245,172,102 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* 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 invencol.ui.main;
import invencol.jdbc.DAO.UsuarioDAO;
import invencol.model.Usuario;
import invencol.ui.home.FXMLHomeController;
import invencol.util.ToolBox;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
/**
*
* @author vinicius
*/
public class FXMLMainController implements Initializable {
@FXML
private TextField tfUserName;
@FXML
private Button button;
@FXML
private PasswordField pfPasswrd;
@FXML
private void handleButtonEntrar(ActionEvent event) {
if (new UsuarioDAO().verifyPasswrd(new Usuario(tfUserName.getText(), pfPasswrd.getText()))) {
System.out.println("Usuário autenticado!");
try {
ToolBox.trocarTela(FXMLHomeController.class, (Node) (event.getSource()));
} catch (IOException e) {
e.printStackTrace();
}
} else {
System.out.println("Usuário inválido!");
}
}
@FXML
private void handleButtonCancelar(ActionEvent event) {
System.exit(0);
}
@Override
public void initialize(URL url, ResourceBundle rb) {
tfUserName.setText("rufino");
pfPasswrd.setText("asterisk");
}
}
| UTF-8 | Java | 1,779 | java | FXMLMainController.java | Java | [
{
"context": "eld;\nimport javafx.stage.Stage;\n\n/**\n *\n * @author vinicius\n */\npublic class FXMLMainController implements In",
"end": 813,
"score": 0.999685525894165,
"start": 805,
"tag": "USERNAME",
"value": "vinicius"
},
{
"context": " ResourceBundle rb) {\n tfUserName... | null | [] | /*
* 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 invencol.ui.main;
import invencol.jdbc.DAO.UsuarioDAO;
import invencol.model.Usuario;
import invencol.ui.home.FXMLHomeController;
import invencol.util.ToolBox;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
/**
*
* @author vinicius
*/
public class FXMLMainController implements Initializable {
@FXML
private TextField tfUserName;
@FXML
private Button button;
@FXML
private PasswordField pfPasswrd;
@FXML
private void handleButtonEntrar(ActionEvent event) {
if (new UsuarioDAO().verifyPasswrd(new Usuario(tfUserName.getText(), pfPasswrd.getText()))) {
System.out.println("Usuário autenticado!");
try {
ToolBox.trocarTela(FXMLHomeController.class, (Node) (event.getSource()));
} catch (IOException e) {
e.printStackTrace();
}
} else {
System.out.println("Usuário inválido!");
}
}
@FXML
private void handleButtonCancelar(ActionEvent event) {
System.exit(0);
}
@Override
public void initialize(URL url, ResourceBundle rb) {
tfUserName.setText("rufino");
pfPasswrd.setText("<PASSWORD>");
}
}
| 1,781 | 0.692568 | 0.692005 | 69 | 24.73913 | 22.500662 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.507246 | false | false | 2 |
492213293170bbcc4cd100ef6a8e81a2135203dd | 38,371,237,845,691 | 72003cab6711efe96e7080599376d758e065fc33 | /PCLApp/JavaSource/com/citibank/ods/modules/product/player/functionality/PlayerListFnc.java | b4b89ab0177978c1846b6f83f48c2089e8be808b | [] | no_license | mv58799/PCLApp | https://github.com/mv58799/PCLApp | 39390b8ff5ccaf95c654f394e32ed03b7713e8ad | 2f8772a60fee035104586bbbf2827567247459c4 | refs/heads/master | 2020-03-19T09:06:30.870000 | 2018-06-06T03:10:07 | 2018-06-06T03:10:07 | 136,260,531 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Created on Mar 29, 2007
*
*/
package com.citibank.ods.modules.product.player.functionality;
import com.citibank.ods.common.dataset.DataSet;
import com.citibank.ods.common.functionality.ODSListFnc;
import com.citibank.ods.common.functionality.valueobject.BaseFncVO;
import com.citibank.ods.common.functionality.valueobject.BaseODSFncVO;
import com.citibank.ods.modules.product.player.functionality.valueobject.PlayerListFncVO;
import com.citibank.ods.persistence.pl.dao.TplPlayerDAO;
import com.citibank.ods.persistence.pl.dao.factory.ODSDAOFactory;
/**
* @author atilio.l.araujo
*
*/
public class PlayerListFnc extends BasePlayerListFnc implements ODSListFnc
{
/**
* Retorna instancia do FncVO
* @see com.citibank.ods.common.functionality.BaseFnc#createFncVO()
*/
public BaseFncVO createFncVO()
{
return new PlayerListFncVO();
}
/**
* Recupera uma lista de players com os criterios especificados
* @see com.citibank.ods.common.functionality.ODSListFnc#list(com.citibank.ods.common.functionality.valueobject.BaseFncVO)
*/
public void list( BaseFncVO fncVO_ )
{
PlayerListFncVO playerListFncVO = ( PlayerListFncVO ) fncVO_;
TplPlayerDAO tplPlayerDAO = ODSDAOFactory.getInstance().getTplPlayerDAO();
DataSet results = tplPlayerDAO.list(
playerListFncVO.getPlyrCnpjNbrScr(),
playerListFncVO.getPlyrNameScr(),
playerListFncVO.getPlyrRoleTypeCodeScr() );
playerListFncVO.setResults( results );
if ( results.size() > 0 )
{
playerListFncVO.addMessage( BaseODSFncVO.C_MESSAGE_SUCESS );
}
else
{
playerListFncVO.addMessage( BaseODSFncVO.C_NO_REGISTER_FOUND );
}
}
/**
* Carregameto inicial - consulta em lista
* @see com.citibank.ods.common.functionality.ODSListFnc#load(com.citibank.ods.common.functionality.valueobject.BaseFncVO)
*/
public void load( BaseFncVO fncVO_ )
{
PlayerListFncVO playerListFncVO = ( PlayerListFncVO ) fncVO_;
playerListFncVO.setPlyrNameScr( null );
playerListFncVO.setPlyrRoleTypeCodeScr( null );
playerListFncVO.setResults( null );
super.loadDomains( playerListFncVO );
}
/**
* Validação da consulta em lista
* @see com.citibank.ods.common.functionality.ODSListFnc#validateList(com.citibank.ods.common.functionality.valueobject.BaseFncVO)
*/
public void validateList( BaseFncVO fncVO_ )
{
//
}
//Botão Limpar
public void clearPage( BaseFncVO fncVO_ )
{
PlayerListFncVO playerListFncVO = ( PlayerListFncVO ) fncVO_;
playerListFncVO.clearErrors();
playerListFncVO.clearMessages();
playerListFncVO.setPlyrNameScr( null );
playerListFncVO.setPlyrRoleTypeCodeScr( null );
playerListFncVO.setResults( null );
}
} | ISO-8859-1 | Java | 2,945 | java | PlayerListFnc.java | Java | [
{
"context": "e.pl.dao.factory.ODSDAOFactory;\r\n\r\n/**\r\n * @author atilio.l.araujo\r\n * \r\n */\r\npublic class PlayerListFnc extends Ba",
"end": 604,
"score": 0.9994158744812012,
"start": 589,
"tag": "NAME",
"value": "atilio.l.araujo"
}
] | null | [] | /*
* Created on Mar 29, 2007
*
*/
package com.citibank.ods.modules.product.player.functionality;
import com.citibank.ods.common.dataset.DataSet;
import com.citibank.ods.common.functionality.ODSListFnc;
import com.citibank.ods.common.functionality.valueobject.BaseFncVO;
import com.citibank.ods.common.functionality.valueobject.BaseODSFncVO;
import com.citibank.ods.modules.product.player.functionality.valueobject.PlayerListFncVO;
import com.citibank.ods.persistence.pl.dao.TplPlayerDAO;
import com.citibank.ods.persistence.pl.dao.factory.ODSDAOFactory;
/**
* @author atilio.l.araujo
*
*/
public class PlayerListFnc extends BasePlayerListFnc implements ODSListFnc
{
/**
* Retorna instancia do FncVO
* @see com.citibank.ods.common.functionality.BaseFnc#createFncVO()
*/
public BaseFncVO createFncVO()
{
return new PlayerListFncVO();
}
/**
* Recupera uma lista de players com os criterios especificados
* @see com.citibank.ods.common.functionality.ODSListFnc#list(com.citibank.ods.common.functionality.valueobject.BaseFncVO)
*/
public void list( BaseFncVO fncVO_ )
{
PlayerListFncVO playerListFncVO = ( PlayerListFncVO ) fncVO_;
TplPlayerDAO tplPlayerDAO = ODSDAOFactory.getInstance().getTplPlayerDAO();
DataSet results = tplPlayerDAO.list(
playerListFncVO.getPlyrCnpjNbrScr(),
playerListFncVO.getPlyrNameScr(),
playerListFncVO.getPlyrRoleTypeCodeScr() );
playerListFncVO.setResults( results );
if ( results.size() > 0 )
{
playerListFncVO.addMessage( BaseODSFncVO.C_MESSAGE_SUCESS );
}
else
{
playerListFncVO.addMessage( BaseODSFncVO.C_NO_REGISTER_FOUND );
}
}
/**
* Carregameto inicial - consulta em lista
* @see com.citibank.ods.common.functionality.ODSListFnc#load(com.citibank.ods.common.functionality.valueobject.BaseFncVO)
*/
public void load( BaseFncVO fncVO_ )
{
PlayerListFncVO playerListFncVO = ( PlayerListFncVO ) fncVO_;
playerListFncVO.setPlyrNameScr( null );
playerListFncVO.setPlyrRoleTypeCodeScr( null );
playerListFncVO.setResults( null );
super.loadDomains( playerListFncVO );
}
/**
* Validação da consulta em lista
* @see com.citibank.ods.common.functionality.ODSListFnc#validateList(com.citibank.ods.common.functionality.valueobject.BaseFncVO)
*/
public void validateList( BaseFncVO fncVO_ )
{
//
}
//Botão Limpar
public void clearPage( BaseFncVO fncVO_ )
{
PlayerListFncVO playerListFncVO = ( PlayerListFncVO ) fncVO_;
playerListFncVO.clearErrors();
playerListFncVO.clearMessages();
playerListFncVO.setPlyrNameScr( null );
playerListFncVO.setPlyrRoleTypeCodeScr( null );
playerListFncVO.setResults( null );
}
} | 2,945 | 0.689667 | 0.687288 | 91 | 30.351648 | 32.229046 | 132 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.318681 | false | false | 2 |
794b7808aa0c6b0efae2bacd01310a9ba0acc1e9 | 38,371,237,846,590 | 4eb392cdcff822a15e767ecceabcdabecf52f934 | /src/com/huoxy/c1_chain_of_responsibility_14/example1/RealChain.java | e5f5afb8811f36c8f0e87f4b576491719f524722 | [] | no_license | ContinueCoding/DesignPatternInJava | https://github.com/ContinueCoding/DesignPatternInJava | 63ccf04cdc82ea564dbecff0ce73fd0fbaca31d8 | 2a4e55557331183df97042436a80ebf51193db70 | refs/heads/master | 2020-04-19T10:48:49.712000 | 2019-04-30T02:18:57 | 2019-04-30T02:18:57 | 168,150,436 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.huoxy.c1_chain_of_responsibility_14.example1;
import java.util.List;
/**
* 实现Chain的真正的包装Request和转发功能
*/
public class RealChain implements Interceptor.Chain{
public List<Interceptor> interceptorList;
public Request request;
public int index;
/**
* Constructor
* @param interceptorList 处理请假请求的人
* @param request 请假请求
* @param index 已处理过该请求的人数
*/
public RealChain(List<Interceptor> interceptorList, Request request, int index) {
this.interceptorList = interceptorList;
this.request = request;
this.index = index;
}
@Override
public Request request() {
return request;
}
@Override
public Result proceed(Request request) {
Result result = null;
if(interceptorList.size() > index) {
RealChain chain = new RealChain(interceptorList, request, index + 1);
Interceptor interceptor = interceptorList.get(index);
result = interceptor.deal(chain);
}
return result;
}
}
| UTF-8 | Java | 1,120 | java | RealChain.java | Java | [] | null | [] | package com.huoxy.c1_chain_of_responsibility_14.example1;
import java.util.List;
/**
* 实现Chain的真正的包装Request和转发功能
*/
public class RealChain implements Interceptor.Chain{
public List<Interceptor> interceptorList;
public Request request;
public int index;
/**
* Constructor
* @param interceptorList 处理请假请求的人
* @param request 请假请求
* @param index 已处理过该请求的人数
*/
public RealChain(List<Interceptor> interceptorList, Request request, int index) {
this.interceptorList = interceptorList;
this.request = request;
this.index = index;
}
@Override
public Request request() {
return request;
}
@Override
public Result proceed(Request request) {
Result result = null;
if(interceptorList.size() > index) {
RealChain chain = new RealChain(interceptorList, request, index + 1);
Interceptor interceptor = interceptorList.get(index);
result = interceptor.deal(chain);
}
return result;
}
}
| 1,120 | 0.643809 | 0.639048 | 42 | 24 | 22.221825 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false | 2 |
eeca36a72a5bc3f30ebdc1915cff51b212932211 | 30,666,066,506,797 | 9e99135149903392796064e85613d2bf9cd016e2 | /app/src/main/java/mx/itesm/m6_srb_labo_listaspersonalizadas2/MainActivity.java | ff37aa5fb7ecc12f086889ff7090b9c7a984039f | [] | no_license | saulrb/android_custom_lists_2 | https://github.com/saulrb/android_custom_lists_2 | 1b38e58ce21a090a8817daca0495616af3c49a40 | 9f288a53de0dbfad47582ad9c2d30d9af6a9cc00 | refs/heads/master | 2021-01-17T10:42:36.112000 | 2017-03-06T02:13:26 | 2017-03-06T02:13:26 | 84,019,897 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package mx.itesm.m6_srb_labo_listaspersonalizadas2;
import android.app.ListActivity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
public class MainActivity extends ListActivity implements AdapterView.OnItemClickListener {
int REQUEST_IMAGE_CAPTURE = 1;
Bitmap imageBitmap;
ArrayList<Jugador> jugadores;
JugadorAdapter jugadorAdapter;
int indexJugador;
int REQUEST_CODE_AGREGAR = 2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
jugadores = getDataForListView();
jugadorAdapter = new JugadorAdapter(getApplicationContext(),R.layout.row,jugadores);
setListAdapter(jugadorAdapter);
getListView().setOnItemClickListener(this);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if ( resultCode == RESULT_OK) {
if (requestCode == REQUEST_IMAGE_CAPTURE) {
Bundle extras = data.getExtras();
imageBitmap = (Bitmap) extras.get("data");
}
if (requestCode == REQUEST_CODE_AGREGAR){
Bundle datos = data.getExtras();
Jugador jugador = new Jugador(datos.getByteArray("foto"),0,null,datos.getString("nombre"),0);
jugadores.set(indexJugador,jugador);
jugadorAdapter.notifyDataSetChanged();
}
}
}
public ArrayList<Jugador> getDataForListView(){
Jugador jugador;
ArrayList<Jugador> listaJugadores = new ArrayList<Jugador>();
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.person);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG,100,stream);
byte[] byteArray = stream.toByteArray();
jugador = new Jugador(byteArray,0,null,"Messi",0);
listaJugadores.add(jugador);
jugador = new Jugador(byteArray,0,null,"Ronaldo",0);
listaJugadores.add(jugador);
jugador = new Jugador(byteArray,0,null,"Neymar",0);
listaJugadores.add(jugador);
return listaJugadores;
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent;
intent = new Intent(this,JugadorActivity.class);
Jugador jugador = jugadores.get(position);
intent.putExtra("nombre",jugador.getNombre());
intent.putExtra("foto",jugador.getByteArrayFoto());
startActivityForResult(intent,REQUEST_CODE_AGREGAR);
indexJugador = position;
}
}
| UTF-8 | Java | 2,937 | java | MainActivity.java | Java | [
{
"context": "\n\n jugador = new Jugador(byteArray,0,null,\"Messi\",0);\n listaJugadores.add(jugador);\n\n ",
"end": 2208,
"score": 0.9998183250427246,
"start": 2203,
"tag": "NAME",
"value": "Messi"
},
{
"context": "\n\n jugador = new Jugador(byteArray,0,nul... | null | [] | package mx.itesm.m6_srb_labo_listaspersonalizadas2;
import android.app.ListActivity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
public class MainActivity extends ListActivity implements AdapterView.OnItemClickListener {
int REQUEST_IMAGE_CAPTURE = 1;
Bitmap imageBitmap;
ArrayList<Jugador> jugadores;
JugadorAdapter jugadorAdapter;
int indexJugador;
int REQUEST_CODE_AGREGAR = 2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
jugadores = getDataForListView();
jugadorAdapter = new JugadorAdapter(getApplicationContext(),R.layout.row,jugadores);
setListAdapter(jugadorAdapter);
getListView().setOnItemClickListener(this);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if ( resultCode == RESULT_OK) {
if (requestCode == REQUEST_IMAGE_CAPTURE) {
Bundle extras = data.getExtras();
imageBitmap = (Bitmap) extras.get("data");
}
if (requestCode == REQUEST_CODE_AGREGAR){
Bundle datos = data.getExtras();
Jugador jugador = new Jugador(datos.getByteArray("foto"),0,null,datos.getString("nombre"),0);
jugadores.set(indexJugador,jugador);
jugadorAdapter.notifyDataSetChanged();
}
}
}
public ArrayList<Jugador> getDataForListView(){
Jugador jugador;
ArrayList<Jugador> listaJugadores = new ArrayList<Jugador>();
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.person);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG,100,stream);
byte[] byteArray = stream.toByteArray();
jugador = new Jugador(byteArray,0,null,"Messi",0);
listaJugadores.add(jugador);
jugador = new Jugador(byteArray,0,null,"Ronaldo",0);
listaJugadores.add(jugador);
jugador = new Jugador(byteArray,0,null,"Neymar",0);
listaJugadores.add(jugador);
return listaJugadores;
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent intent;
intent = new Intent(this,JugadorActivity.class);
Jugador jugador = jugadores.get(position);
intent.putExtra("nombre",jugador.getNombre());
intent.putExtra("foto",jugador.getByteArrayFoto());
startActivityForResult(intent,REQUEST_CODE_AGREGAR);
indexJugador = position;
}
}
| 2,937 | 0.678924 | 0.673476 | 84 | 33.964287 | 26.456364 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.952381 | false | false | 2 |
77262410ce913c97bc8b00e2a67ada320b3e5aad | 36,318,243,500,860 | 1074c97cdd65d38c8c6ec73bfa40fb9303337468 | /rda0105-agl-aus-java-a43926f304e3/xms-workflow/src/main/java/com/gms/xms/workflow/service/customersummary/CustomerSummaryServiceImp.java | 4991f4ab1b6b381d589cee0e283d9c8be508ba24 | [] | no_license | gahlawat4u/repoName | https://github.com/gahlawat4u/repoName | 0361859254766c371068e31ff7be94025c3e5ca8 | 523cf7d30018b7783e90db98e386245edad34cae | refs/heads/master | 2020-05-17T01:26:00.968000 | 2019-04-29T06:11:52 | 2019-04-29T06:11:52 | 183,420,568 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.gms.xms.workflow.service.customersummary;
import com.gms.xms.common.constants.Attributes;
import com.gms.xms.common.context.ContextBase;
import com.gms.xms.common.utils.GsonUtils;
import com.gms.xms.txndb.vo.reports.customer.CustomerSummaryFilter;
import com.gms.xms.workflow.core.WorkFlowManager;
import com.gms.xms.workflow.service.BaseService;
import com.google.gson.reflect.TypeToken;
import java.util.List;
import java.util.Map;
/**
* Posted from CustomerSummaryServiceImp
* <p>
* Author DatTV Sep 15, 2015
*/
public class CustomerSummaryServiceImp extends BaseService implements ICustomerSummaryService {
public CustomerSummaryServiceImp(Map<String, String> context) {
super(context);
}
@Override
public List<Map<String, String>> selectByFilter(CustomerSummaryFilter filter) throws Exception {
ContextBase context = new ContextBase(this.getContext());
context.put(Attributes.CUSTOMER_SUMMARY_FILTER, GsonUtils.toGson(filter));
context.put(Attributes.WFP_NAME, "Wfl-GetCustomerSummaryReport");
context = WorkFlowManager.getInstance().process(context);
List<Map<String, String>> result = GsonUtils.fromGson(context.get(Attributes.CUSTOMER_SUMMARY_LIST_RESULT), new TypeToken<List<Map<String, String>>>() {
}.getType());
return result;
}
@Override
public long countByFilter(CustomerSummaryFilter filter) throws Exception {
ContextBase context = new ContextBase(this.getContext());
context.put(Attributes.CUSTOMER_SUMMARY_FILTER, GsonUtils.toGson(filter));
context.put(Attributes.WFP_NAME, "Wfl-CountCustomerSummaryReport");
context = WorkFlowManager.getInstance().process(context);
long count = Long.valueOf(context.get(Attributes.CUSTOMER_SUMMARY_RECORD_COUNT_RESULT));
return count;
}
@Override
public Map<String, String> sumByFilter(CustomerSummaryFilter filter) throws Exception {
ContextBase context = new ContextBase(this.getContext());
context.put(Attributes.CUSTOMER_SUMMARY_FILTER, GsonUtils.toGson(filter));
context.put(Attributes.WFP_NAME, "Wfl-SumCustomerSummaryReport");
context = WorkFlowManager.getInstance().process(context);
Map<String, String> result = GsonUtils.fromGson(context.get(Attributes.CUSTOMER_SUMMARY_TOTAL_RESULT), new TypeToken<Map<String, String>>() {
}.getType());
return result;
}
}
| UTF-8 | Java | 2,511 | java | CustomerSummaryServiceImp.java | Java | [] | null | [] | package com.gms.xms.workflow.service.customersummary;
import com.gms.xms.common.constants.Attributes;
import com.gms.xms.common.context.ContextBase;
import com.gms.xms.common.utils.GsonUtils;
import com.gms.xms.txndb.vo.reports.customer.CustomerSummaryFilter;
import com.gms.xms.workflow.core.WorkFlowManager;
import com.gms.xms.workflow.service.BaseService;
import com.google.gson.reflect.TypeToken;
import java.util.List;
import java.util.Map;
/**
* Posted from CustomerSummaryServiceImp
* <p>
* Author DatTV Sep 15, 2015
*/
public class CustomerSummaryServiceImp extends BaseService implements ICustomerSummaryService {
public CustomerSummaryServiceImp(Map<String, String> context) {
super(context);
}
@Override
public List<Map<String, String>> selectByFilter(CustomerSummaryFilter filter) throws Exception {
ContextBase context = new ContextBase(this.getContext());
context.put(Attributes.CUSTOMER_SUMMARY_FILTER, GsonUtils.toGson(filter));
context.put(Attributes.WFP_NAME, "Wfl-GetCustomerSummaryReport");
context = WorkFlowManager.getInstance().process(context);
List<Map<String, String>> result = GsonUtils.fromGson(context.get(Attributes.CUSTOMER_SUMMARY_LIST_RESULT), new TypeToken<List<Map<String, String>>>() {
}.getType());
return result;
}
@Override
public long countByFilter(CustomerSummaryFilter filter) throws Exception {
ContextBase context = new ContextBase(this.getContext());
context.put(Attributes.CUSTOMER_SUMMARY_FILTER, GsonUtils.toGson(filter));
context.put(Attributes.WFP_NAME, "Wfl-CountCustomerSummaryReport");
context = WorkFlowManager.getInstance().process(context);
long count = Long.valueOf(context.get(Attributes.CUSTOMER_SUMMARY_RECORD_COUNT_RESULT));
return count;
}
@Override
public Map<String, String> sumByFilter(CustomerSummaryFilter filter) throws Exception {
ContextBase context = new ContextBase(this.getContext());
context.put(Attributes.CUSTOMER_SUMMARY_FILTER, GsonUtils.toGson(filter));
context.put(Attributes.WFP_NAME, "Wfl-SumCustomerSummaryReport");
context = WorkFlowManager.getInstance().process(context);
Map<String, String> result = GsonUtils.fromGson(context.get(Attributes.CUSTOMER_SUMMARY_TOTAL_RESULT), new TypeToken<Map<String, String>>() {
}.getType());
return result;
}
}
| 2,511 | 0.717642 | 0.715253 | 56 | 42.839287 | 37.912861 | 160 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.803571 | false | false | 2 |
c508f2c8d12c006aedb0dcbef86828625ab69f67 | 35,880,156,835,360 | f48ed14bc5d92c60ba09bb3c0eb20620db00163f | /taco-cloud/persistence/taco-cloud-spring-jpa/src/main/java/com/learn/tacocloud/persistence/jpa/entities/IngredientEntity.java | d1d613e9f99cfc9cadcaea38bd08f285d34e2fd1 | [] | no_license | luuductrung1234/taco-cloud | https://github.com/luuductrung1234/taco-cloud | 368ea17ca7aa9c14952e95d1bae588874f77d4b7 | 789d5c1bec9dc385262e4aff144c74d3cac86728 | refs/heads/main | 2023-07-13T19:50:47.311000 | 2021-08-29T15:07:29 | 2021-08-29T15:07:29 | 393,691,488 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.learn.tacocloud.persistence.jpa.entities;
import com.learn.tacocloud.domain.enums.IngredientType;
import com.learn.tacocloud.domain.models.Ingredient;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import javax.persistence.*;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity(name = "INGREDIENTS")
public class IngredientEntity {
@Id
private String id;
private String name;
@Enumerated(EnumType.STRING)
private IngredientType type;
@ManyToMany(mappedBy = "ingredients")
@LazyCollection(LazyCollectionOption.TRUE)
private List<TacoEntity> tacos;
public IngredientEntity(final Ingredient ingredient) {
this.id = ingredient.getId();
this.name = ingredient.getName();
this.type = ingredient.getType();
}
public Ingredient toIngredient() {
return new Ingredient(id, name, type);
}
}
| UTF-8 | Java | 1,048 | java | IngredientEntity.java | Java | [] | null | [] | package com.learn.tacocloud.persistence.jpa.entities;
import com.learn.tacocloud.domain.enums.IngredientType;
import com.learn.tacocloud.domain.models.Ingredient;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import javax.persistence.*;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity(name = "INGREDIENTS")
public class IngredientEntity {
@Id
private String id;
private String name;
@Enumerated(EnumType.STRING)
private IngredientType type;
@ManyToMany(mappedBy = "ingredients")
@LazyCollection(LazyCollectionOption.TRUE)
private List<TacoEntity> tacos;
public IngredientEntity(final Ingredient ingredient) {
this.id = ingredient.getId();
this.name = ingredient.getName();
this.type = ingredient.getType();
}
public Ingredient toIngredient() {
return new Ingredient(id, name, type);
}
}
| 1,048 | 0.748092 | 0.748092 | 40 | 25.200001 | 19.000263 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 2 |
3506f465e5a01bd3979e8456f61ab55b5a8374fa | 7,842,610,302,869 | 21c731a7900177bd593b0680ca1b5226263569bb | /src/main/java/com/TCreative/metier/EtudiantMetierImpl.java | 8e31790638eb4353df20bcebba8d480f0310f23d | [] | no_license | radcircle99/CF- | https://github.com/radcircle99/CF- | 3360312ff54cfc6bad7ee413c38ffd9e4486da7f | e721cbb8d4f7cbdd7c5851fb21074c86232471fa | refs/heads/master | 2021-11-19T06:14:02.786000 | 2019-09-01T19:44:20 | 2019-09-01T19:44:20 | 203,066,844 | 0 | 0 | null | false | 2021-08-30T16:26:05 | 2019-08-18T23:28:31 | 2019-09-01T20:03:39 | 2021-08-30T16:26:04 | 6,501 | 0 | 0 | 2 | HTML | false | false | package com.TCreative.metier;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.TCreative.dao.EtudiantRepository;
import com.TCreative.entities.Etudiant;
@Service
public class EtudiantMetierImpl implements EtudiantMetier {
@Autowired
private EtudiantRepository etudiantRepository;
@Override
public Etudiant saveEtudiant(Etudiant e) {
// TODO Auto-generated method stub
// e.setDateInscription(new String());
return etudiantRepository.save(e);
}
@Override
public List<Etudiant> listEtudiant() {
// TODO Auto-generated method stub
return etudiantRepository.findAll();
}
@Override
public Optional<Etudiant> findEtudiant(int idPer) {
// TODO Auto-generated method stub
return etudiantRepository.findById(idPer);
}
@Override
public void deleteEtudiant(int idPer) {
// TODO Auto-generated method stub
etudiantRepository.deleteById(idPer);
}
@Override
public Etudiant updateEtudiant(Etudiant newEtudiant) {
// TODO Auto-generated method stub
// return etudiantRepository.findById(idPer).map(e -> {
// if (newEtudiant.getNomPer() != null)
// e.setNomPer(newEtudiant.getNomPer());
// if (newEtudiant.getPrenomPer() != null)
// e.setPrenomPer(newEtudiant.getPrenomPer());
// if (newEtudiant.getAdressePer() != null)
// e.setAdressePer(newEtudiant.getAdressePer());
// if (newEtudiant.getTelPer() != 0)
// e.setTelPer(newEtudiant.getTelPer());
// if (newEtudiant.getDateNaissance() != null)
// e.setDateNaissance(newEtudiant.getDateNaissance());
// if (newEtudiant.getPhotoEtud() != null)
// e.setPhotoEtud(newEtudiant.getPhotoEtud());
// if (newEtudiant.getDernierMoisPayer() != null)
// e.setDernierMoisPayer(newEtudiant.getDernierMoisPayer());
// if (newEtudiant.getMontantPayer() != 0)
// e.setMontantPayer(newEtudiant.getMontantPayer());
// return etudiantRepository.save(e);
// }).orElseGet(() -> {
// newEtudiant.setIdPer(idPer);
return etudiantRepository.save(newEtudiant);
// });
}
// @Override
// public Etudiant UpdateEtudiant(Etudiant e) {
// // TODO Auto-generated method stub
// etudiantRepository.deleteById(e.getIdPer());
// e.setIdPer(e.getIdPer());
// return etudiantRepository.save(e);
// }
}
| UTF-8 | Java | 2,346 | java | EtudiantMetierImpl.java | Java | [] | null | [] | package com.TCreative.metier;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.TCreative.dao.EtudiantRepository;
import com.TCreative.entities.Etudiant;
@Service
public class EtudiantMetierImpl implements EtudiantMetier {
@Autowired
private EtudiantRepository etudiantRepository;
@Override
public Etudiant saveEtudiant(Etudiant e) {
// TODO Auto-generated method stub
// e.setDateInscription(new String());
return etudiantRepository.save(e);
}
@Override
public List<Etudiant> listEtudiant() {
// TODO Auto-generated method stub
return etudiantRepository.findAll();
}
@Override
public Optional<Etudiant> findEtudiant(int idPer) {
// TODO Auto-generated method stub
return etudiantRepository.findById(idPer);
}
@Override
public void deleteEtudiant(int idPer) {
// TODO Auto-generated method stub
etudiantRepository.deleteById(idPer);
}
@Override
public Etudiant updateEtudiant(Etudiant newEtudiant) {
// TODO Auto-generated method stub
// return etudiantRepository.findById(idPer).map(e -> {
// if (newEtudiant.getNomPer() != null)
// e.setNomPer(newEtudiant.getNomPer());
// if (newEtudiant.getPrenomPer() != null)
// e.setPrenomPer(newEtudiant.getPrenomPer());
// if (newEtudiant.getAdressePer() != null)
// e.setAdressePer(newEtudiant.getAdressePer());
// if (newEtudiant.getTelPer() != 0)
// e.setTelPer(newEtudiant.getTelPer());
// if (newEtudiant.getDateNaissance() != null)
// e.setDateNaissance(newEtudiant.getDateNaissance());
// if (newEtudiant.getPhotoEtud() != null)
// e.setPhotoEtud(newEtudiant.getPhotoEtud());
// if (newEtudiant.getDernierMoisPayer() != null)
// e.setDernierMoisPayer(newEtudiant.getDernierMoisPayer());
// if (newEtudiant.getMontantPayer() != 0)
// e.setMontantPayer(newEtudiant.getMontantPayer());
// return etudiantRepository.save(e);
// }).orElseGet(() -> {
// newEtudiant.setIdPer(idPer);
return etudiantRepository.save(newEtudiant);
// });
}
// @Override
// public Etudiant UpdateEtudiant(Etudiant e) {
// // TODO Auto-generated method stub
// etudiantRepository.deleteById(e.getIdPer());
// e.setIdPer(e.getIdPer());
// return etudiantRepository.save(e);
// }
}
| 2,346 | 0.726343 | 0.72549 | 82 | 27.560976 | 20.767057 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.817073 | false | false | 2 |
2b65df72ec03a90fed2cc7e07dd338bd725e4cae | 30,236,569,773,974 | f6aa6a8580e482a2ff668b7270cef64b38b5bfc9 | /core/src/com/bebel/game/components/refound/action/time/RelativeAction.java | f55a971ea6e180efb6dd738aad8337bdc9484388 | [
"Apache-2.0"
] | permissive | Mastersnes/PointClickMagie | https://github.com/Mastersnes/PointClickMagie | 4355b15bcec20c8616994375b8935e52ec2b832c | 127b75575136adcebeddf8b8a5c575a204b7a464 | refs/heads/master | 2021-06-16T23:41:59.441000 | 2021-03-22T11:22:32 | 2021-03-22T11:22:32 | 183,403,490 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.bebel.game.components.refound.action.time;
public abstract class RelativeAction extends TimeAction {
private float lastPercent;
protected void begin () {
lastPercent = 0;
}
protected void update (float percent) {
updateRelative(percent - lastPercent);
lastPercent = percent;
}
protected abstract void updateRelative (float percentDelta);
}
| UTF-8 | Java | 404 | java | RelativeAction.java | Java | [] | null | [] | package com.bebel.game.components.refound.action.time;
public abstract class RelativeAction extends TimeAction {
private float lastPercent;
protected void begin () {
lastPercent = 0;
}
protected void update (float percent) {
updateRelative(percent - lastPercent);
lastPercent = percent;
}
protected abstract void updateRelative (float percentDelta);
}
| 404 | 0.69802 | 0.695545 | 16 | 24.25 | 22.479156 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false | 2 |
9d1eabd330261a06f9e2e7f4339208bfb8acc13e | 16,329,465,723,800 | ada486e6dd7f1d5fdcb341bc71494e365df7d047 | /Polisocial-AppEngine/Polisocial-AppEngine/src/it/polimi/dima/polisocial/entity/Rental.java | ab2694d96547e2f9011acdfb967e580204085e04 | [] | no_license | danturi/PolisocialApp | https://github.com/danturi/PolisocialApp | 92dc44e56eb0b299148dfcc265e6bf2e3939c546 | 558caa04a575d8fd87234419014403af15dd6a25 | refs/heads/master | 2020-06-03T22:44:48.467000 | 2014-11-30T01:29:28 | 2014-11-30T01:29:28 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package it.polimi.dima.polisocial.entity;
import java.util.Date;
import javax.persistence.Entity;
@Entity
public class Rental extends Post {
private Double latitude;
private Double longitude;
private Double price;
private String address;
private String type;
private Integer squaredMeter;
private Date availability;
private String contact;
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Integer getSquaredMeter() {
return squaredMeter;
}
public void setSquaredMeter(Integer squaredMeter) {
this.squaredMeter = squaredMeter;
}
public Date getAvailability() {
return availability;
}
public void setAvailability(Date availability) {
this.availability = availability;
}
public String getContact() {
return contact;
}
public void setContact(String contact) {
this.contact = contact;
}
}
| UTF-8 | Java | 1,480 | java | Rental.java | Java | [] | null | [] | package it.polimi.dima.polisocial.entity;
import java.util.Date;
import javax.persistence.Entity;
@Entity
public class Rental extends Post {
private Double latitude;
private Double longitude;
private Double price;
private String address;
private String type;
private Integer squaredMeter;
private Date availability;
private String contact;
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Integer getSquaredMeter() {
return squaredMeter;
}
public void setSquaredMeter(Integer squaredMeter) {
this.squaredMeter = squaredMeter;
}
public Date getAvailability() {
return availability;
}
public void setAvailability(Date availability) {
this.availability = availability;
}
public String getContact() {
return contact;
}
public void setContact(String contact) {
this.contact = contact;
}
}
| 1,480 | 0.686486 | 0.686486 | 84 | 15.619047 | 15.365317 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.202381 | false | false | 2 |
5821c6f5974a62a8240d6d54c93fce74acfb89ce | 6,545,530,160,694 | 582d205bbadacaba26c1c7a0519a1ce48304adf1 | /app/src/main/java/com/proto/buddy/mountainbuddyv2/model/Notice.java | da84ecaea7c9cd66a48984f0dcc62cb06ace8dfd | [] | no_license | alex-bu-89/mountain-buddy | https://github.com/alex-bu-89/mountain-buddy | 13c5817336c75d3fd2189ba284a722cb30199719 | 6454bd6c0a8adb284d2d09f3a7b35e6efb8d9796 | refs/heads/master | 2021-01-10T14:24:26.251000 | 2017-08-23T21:44:49 | 2017-08-23T21:44:49 | 47,465,229 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.proto.buddy.mountainbuddyv2.model;
import java.io.Serializable;
import java.util.*;
/**
*
*/
public abstract class Notice implements Serializable{
/**
* ID der Notiz in der Datenbank
*/
private int id;
/**
* Ort an dem die Notiz erstellt wurde
*/
private Point place;
/**
* Titel der Notiz
*/
private String title;
/**
* Beschreibung der Notiz
*/
private String text;
private long routeId;
public Notice(Point place, String title, String text) {
this.place = place;
this.title = title;
this.text = text;
}
public Notice(Point place){
this.place = place;
this.title = "";
this.text = "";
}
public Notice(){
}
/**
* @return
*/
public Point getPlace() {
return this.place;
}
/**
* @param point
*/
public void setPlace(Point point) {
this.place = point;
}
/**
* @return
*/
public String getTitle() {
return this.title;
}
/**
* @param newTitle
*/
public void setTitle(String newTitle) {
this.title = newTitle;
}
/**
* @return
*/
public String getText() {
return this.text;
}
/**
* @param newText
*/
public void setText(String newText) {
this.text = newText;
}
public long getId(){
return this.id;
}
public void setId(int id){
this.id = id;
}
public long getRouteId() {
return routeId;
}
public void setRouteId(long routeId) {
this.routeId = routeId;
}
} | UTF-8 | Java | 1,681 | java | Notice.java | Java | [] | null | [] | package com.proto.buddy.mountainbuddyv2.model;
import java.io.Serializable;
import java.util.*;
/**
*
*/
public abstract class Notice implements Serializable{
/**
* ID der Notiz in der Datenbank
*/
private int id;
/**
* Ort an dem die Notiz erstellt wurde
*/
private Point place;
/**
* Titel der Notiz
*/
private String title;
/**
* Beschreibung der Notiz
*/
private String text;
private long routeId;
public Notice(Point place, String title, String text) {
this.place = place;
this.title = title;
this.text = text;
}
public Notice(Point place){
this.place = place;
this.title = "";
this.text = "";
}
public Notice(){
}
/**
* @return
*/
public Point getPlace() {
return this.place;
}
/**
* @param point
*/
public void setPlace(Point point) {
this.place = point;
}
/**
* @return
*/
public String getTitle() {
return this.title;
}
/**
* @param newTitle
*/
public void setTitle(String newTitle) {
this.title = newTitle;
}
/**
* @return
*/
public String getText() {
return this.text;
}
/**
* @param newText
*/
public void setText(String newText) {
this.text = newText;
}
public long getId(){
return this.id;
}
public void setId(int id){
this.id = id;
}
public long getRouteId() {
return routeId;
}
public void setRouteId(long routeId) {
this.routeId = routeId;
}
} | 1,681 | 0.516954 | 0.516359 | 111 | 14.153153 | 13.940801 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.234234 | false | false | 2 |
d75317337085f11e0689e954b7274c9305c1a324 | 16,312,285,794,337 | 0caedfbc8285821f4d83de3f3582f1e091fe5afe | /src/main/java/Main.java | 1d00692e8aadd5d5af3735131e7f53fd9ea9f0d2 | [] | no_license | labsolam/2048FX | https://github.com/labsolam/2048FX | 7c4471622b033642a4cb4000ae080cce0469ca7f | 65be9811fca11951f2b485843552bc7763ec0643 | refs/heads/master | 2023-07-18T03:16:28.834000 | 2021-09-05T11:01:23 | 2021-09-05T11:01:23 | 266,907,744 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Main extends Application
{
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage)
{
GameController gameController = new GameController();
StackPane pane = gameController.getGame();
Scene scene = new Scene(pane);
scene.getStylesheets().addAll(getClass().getResource("2048.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
pane.requestFocus(); //Key events won't work unless focus is requested.
}
}
| UTF-8 | Java | 645 | java | Main.java | Java | [] | null | [] | import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class Main extends Application
{
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage)
{
GameController gameController = new GameController();
StackPane pane = gameController.getGame();
Scene scene = new Scene(pane);
scene.getStylesheets().addAll(getClass().getResource("2048.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
pane.requestFocus(); //Key events won't work unless focus is requested.
}
}
| 645 | 0.751938 | 0.745736 | 27 | 22.888889 | 23.317984 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.296296 | false | false | 2 |
8715a2e087bd1b32ab967ea9c65b809d8aa956cc | 15,994,458,231,427 | e30f06c8df5438042a54cd508dd152831862c01e | /src/Bird.java | 0bce19d47af3a444f9f1a9902f5e8fcc51abcdc5 | [] | no_license | abstewart/CodePartnerGame | https://github.com/abstewart/CodePartnerGame | f63927d0c24601588045cd21edca6df9665d0b90 | 3e058a67138da39bb09fdfc322594bb040f017fe | refs/heads/master | 2021-06-13T10:51:19.622000 | 2017-04-07T12:38:10 | 2017-04-07T12:38:10 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.awt.*;
/**
* Created by rachel_chau on 3/23/17.
*/
public class Bird extends Sprite {
private int direction;
public Bird(int x, int y, int dir, int type){
super(x, y, NORTH);
if(type == 1) {
if (dir == 0) { //going to the right
setPic("FireBatRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("FireBatLeft.png", WEST);
setDir(WEST);
}
}
if(type == 2) {
if (dir == 0) { //going to the right
setPic("CaveBatRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("CaveBatLeft.png", WEST);
setDir(WEST);
}
}
if(type == 3) {
if (dir == 0) { //going to the right
setPic("BeeSpriteRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("BeeSpriteLeft.png", WEST);
setDir(WEST);
}
}
if(type == 4) {
if (dir == 0) { //going to the right
setPic("birdright.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("birdleft.png", WEST);
setDir(WEST);
}
}
if(type == 5) {
if (dir == 0) { //going to the right
setPic("PlaneRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("PlaneLeft.png", WEST);
setDir(WEST);
}
}
direction = dir;
setSpeed(5);
}
@Override
public void update(){
super.update();
if(direction == 0) {
if (getLoc().x >= Main.FRAMEWIDTH + getBoundingRectangle().width) {
setLoc(new Point(-1 * getBoundingRectangle().width, getLoc().y));
}
}
if(direction == 1) {
if (getLoc().x <= -1 * getBoundingRectangle().width) {
setLoc(new Point(Main.FRAMEWIDTH + getBoundingRectangle().width, getLoc().y));
}
}
}
}
| UTF-8 | Java | 2,250 | java | Bird.java | Java | [
{
"context": "import java.awt.*;\n\n/**\n * Created by rachel_chau on 3/23/17.\n */\npublic class Bird extends Sprite ",
"end": 49,
"score": 0.9991114139556885,
"start": 38,
"tag": "USERNAME",
"value": "rachel_chau"
}
] | null | [] | import java.awt.*;
/**
* Created by rachel_chau on 3/23/17.
*/
public class Bird extends Sprite {
private int direction;
public Bird(int x, int y, int dir, int type){
super(x, y, NORTH);
if(type == 1) {
if (dir == 0) { //going to the right
setPic("FireBatRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("FireBatLeft.png", WEST);
setDir(WEST);
}
}
if(type == 2) {
if (dir == 0) { //going to the right
setPic("CaveBatRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("CaveBatLeft.png", WEST);
setDir(WEST);
}
}
if(type == 3) {
if (dir == 0) { //going to the right
setPic("BeeSpriteRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("BeeSpriteLeft.png", WEST);
setDir(WEST);
}
}
if(type == 4) {
if (dir == 0) { //going to the right
setPic("birdright.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("birdleft.png", WEST);
setDir(WEST);
}
}
if(type == 5) {
if (dir == 0) { //going to the right
setPic("PlaneRight.png", EAST);
setDir(EAST);
} else {//going to the left
setPic("PlaneLeft.png", WEST);
setDir(WEST);
}
}
direction = dir;
setSpeed(5);
}
@Override
public void update(){
super.update();
if(direction == 0) {
if (getLoc().x >= Main.FRAMEWIDTH + getBoundingRectangle().width) {
setLoc(new Point(-1 * getBoundingRectangle().width, getLoc().y));
}
}
if(direction == 1) {
if (getLoc().x <= -1 * getBoundingRectangle().width) {
setLoc(new Point(Main.FRAMEWIDTH + getBoundingRectangle().width, getLoc().y));
}
}
}
}
| 2,250 | 0.430222 | 0.421333 | 88 | 24.568182 | 20.882679 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.511364 | false | false | 2 |
ca231085e1dcea18125f174a032dfc45d9e71505 | 5,592,047,430,417 | c7230a495c16fc8a238c56a5ebc61594b5bb92b1 | /Valid-Backend/src/main/java/com/valid/core/exceptions/service/DataNotFoundServiceException.java | 58adc2a2f15ac18d61e04afdd743109aa8e7d5fb | [] | no_license | Andres2512/Valid | https://github.com/Andres2512/Valid | 0a4ac980adc2f45fa058b47c8a968e2178e15973 | 9dedf4791178654f0aabc9de70ef51db4c07b8ab | refs/heads/master | 2021-05-25T23:44:43.283000 | 2020-04-18T18:50:08 | 2020-04-18T18:50:08 | 253,968,173 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.valid.core.exceptions.service;
import com.valid.core.exceptions.base.ServiceException;
import com.valid.core.exceptions.enums.LogRefServices;
public class DataNotFoundServiceException extends ServiceException {
public DataNotFoundServiceException(LogRefServices logRefServices, String message) {
super(logRefServices, message);
}
public DataNotFoundServiceException(LogRefServices logRefServices, String message, Throwable cause) {
super(logRefServices, message, cause);
}
}
| UTF-8 | Java | 523 | java | DataNotFoundServiceException.java | Java | [] | null | [] | package com.valid.core.exceptions.service;
import com.valid.core.exceptions.base.ServiceException;
import com.valid.core.exceptions.enums.LogRefServices;
public class DataNotFoundServiceException extends ServiceException {
public DataNotFoundServiceException(LogRefServices logRefServices, String message) {
super(logRefServices, message);
}
public DataNotFoundServiceException(LogRefServices logRefServices, String message, Throwable cause) {
super(logRefServices, message, cause);
}
}
| 523 | 0.791587 | 0.791587 | 15 | 33.866665 | 34.236172 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.733333 | false | false | 2 |
7dcde1a62171e3e741572a2f308abeb36c67ba3d | 9,612,136,816,795 | 6aab380ff56856694dfe5c02dc0638c41e944911 | /src/tester/GetCustomerDetails.java | 34f9289c6a82fddeb85c3c42c11a8c9226b2e296 | [] | no_license | Mirhawk/CoreHibernateCustomerCRUD | https://github.com/Mirhawk/CoreHibernateCustomerCRUD | f4da9f99b00cc5e3d430aef0bb604e1a831419d1 | 3361aa6789ee94891fafafbea6a3f8fe74656aaa | refs/heads/master | 2021-01-25T00:46:30.449000 | 2017-06-18T17:08:21 | 2017-06-18T17:08:21 | 94,687,460 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package tester;
import static utils.HibernateUtils.*;
import java.util.Scanner;
import dao.CustomersDAO;
public class GetCustomerDetails {
public static void main(String[] args) {
try(Scanner sc = new Scanner(System.in)) {
getSf();
System.out.println("Enter customer id of customer whose details to be fetched : ");
CustomersDAO customersDAOObject = new CustomersDAO();
System.out.println("Customer details: "+customersDAOObject.showCustomerDetails(sc.nextInt()).toString());
}
catch (Exception e) {
e.printStackTrace();
}
finally {
getSf().close();
}
}
}
| UTF-8 | Java | 630 | java | GetCustomerDetails.java | Java | [] | null | [] | package tester;
import static utils.HibernateUtils.*;
import java.util.Scanner;
import dao.CustomersDAO;
public class GetCustomerDetails {
public static void main(String[] args) {
try(Scanner sc = new Scanner(System.in)) {
getSf();
System.out.println("Enter customer id of customer whose details to be fetched : ");
CustomersDAO customersDAOObject = new CustomersDAO();
System.out.println("Customer details: "+customersDAOObject.showCustomerDetails(sc.nextInt()).toString());
}
catch (Exception e) {
e.printStackTrace();
}
finally {
getSf().close();
}
}
}
| 630 | 0.669841 | 0.669841 | 27 | 21.333334 | 26.615229 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.851852 | false | false | 2 |
151e1aa8a7e9fe86dff9150c09f6f5c035ff368f | 30,425,548,339,932 | babe3a51175b963ad25d143288732feedc1fb403 | /app/src/main/java/com/yekong/mymvpdemo/AppApplication.java | 9e56e2920be2edd02ecb60f7adc08b096b8cbbea | [] | no_license | xiyezifeng/MyMVPDemo | https://github.com/xiyezifeng/MyMVPDemo | 79172c174f52cdb8da92760427dcb054953de530 | 3f29d901037a1b0d1ff0305f37526ae98a936f6b | refs/heads/master | 2021-04-25T23:41:37.980000 | 2018-01-16T01:36:01 | 2018-01-16T01:36:01 | 107,250,146 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.yekong.mymvpdemo;
import com.yekong.common.baseapp.BaseApplication;
import static com.yekong.common.constant.Constant.CRASH;
/**
* Created by xigua on 2017/10/17.
*/
public class AppApplication extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
if (CRASH)
reagisterCrash(getPackageName());
}
}
| UTF-8 | Java | 376 | java | AppApplication.java | Java | [
{
"context": "common.constant.Constant.CRASH;\n\n/**\n * Created by xigua on 2017/10/17.\n */\n\npublic class AppApplication e",
"end": 163,
"score": 0.9996688365936279,
"start": 158,
"tag": "USERNAME",
"value": "xigua"
}
] | null | [] | package com.yekong.mymvpdemo;
import com.yekong.common.baseapp.BaseApplication;
import static com.yekong.common.constant.Constant.CRASH;
/**
* Created by xigua on 2017/10/17.
*/
public class AppApplication extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
if (CRASH)
reagisterCrash(getPackageName());
}
}
| 376 | 0.694149 | 0.672872 | 18 | 19.888889 | 19.507517 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.277778 | false | false | 2 |
a7aa085832e45fb0ff593fc9545a62a407dc8f8e | 30,425,548,342,673 | 9486cc74d8f4a11472f4e3cfe02617d552a73265 | /src/main/java/hw1/App.java | 07c118a9a4fcb9ccc08edab2af7d98fa22b62016 | [] | no_license | MelinEss/hw1 | https://github.com/MelinEss/hw1 | 7a52e18854f033fd9df056218bb21d25aaeba4ad | 30a93eb1ae51e1466fdb66cc10f9ff2787003a28 | refs/heads/main | 2023-08-15T11:17:43.524000 | 2021-10-02T16:12:10 | 2021-10-02T16:12:10 | 411,265,301 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* This Java source file was generated by the Gradle 'init' task.
*/
package hw1;
import java.lang.Integer;
public class App {
public String getGreeting() {
return "Hello! welcome my program";
}
public static void main(String[] args) {
System.out.println(new App().getGreeting());
String [] arr = {"hello","world","hi","i","am","melin","it is my","first,project"};
System.out.println(encryption(arr,"hi",29,0));
}
public static String encryption(String []word,String searchword,Integer swapright,int reverseword)
{
if(word.length==0)
{
return null;
}
if(swapright<0)
{
return null;
}
if(reverseword<0||reverseword>1)
{
return null;
}
int counter=0;
for(int i=0;i<word.length;i++)
{
if(word[i].equals(searchword)==true)
{
counter++;
String word2="";
for(int j=0;j<word[i].length();j++)
{
if(word[i].charAt(j)+swapright>=122)
{
word2=word2+(char)(word[i].charAt(j)+swapright-26);
}
else {
word2=word2+(char)(word[i].charAt(j)+swapright);
}
}
word[i]=word2;
if(reverseword==0)
{
return word[i];
}
if(reverseword==1)
{
String wordreverse="";
for(int k=word2.length()-1;k>=0;k--)
{
wordreverse=wordreverse+word2.charAt(k);
}
word[i]=wordreverse;
return word[i];
}
}
}
return null;
}
}
| UTF-8 | Java | 2,051 | java | App.java | Java | [
{
"context": " String [] arr = {\"hello\",\"world\",\"hi\",\"i\",\"am\",\"melin\",\"it is my\",\"first,project\"};\n\t\tSystem.out.printl",
"end": 377,
"score": 0.992946445941925,
"start": 372,
"tag": "NAME",
"value": "melin"
}
] | null | [] | /*
* This Java source file was generated by the Gradle 'init' task.
*/
package hw1;
import java.lang.Integer;
public class App {
public String getGreeting() {
return "Hello! welcome my program";
}
public static void main(String[] args) {
System.out.println(new App().getGreeting());
String [] arr = {"hello","world","hi","i","am","melin","it is my","first,project"};
System.out.println(encryption(arr,"hi",29,0));
}
public static String encryption(String []word,String searchword,Integer swapright,int reverseword)
{
if(word.length==0)
{
return null;
}
if(swapright<0)
{
return null;
}
if(reverseword<0||reverseword>1)
{
return null;
}
int counter=0;
for(int i=0;i<word.length;i++)
{
if(word[i].equals(searchword)==true)
{
counter++;
String word2="";
for(int j=0;j<word[i].length();j++)
{
if(word[i].charAt(j)+swapright>=122)
{
word2=word2+(char)(word[i].charAt(j)+swapright-26);
}
else {
word2=word2+(char)(word[i].charAt(j)+swapright);
}
}
word[i]=word2;
if(reverseword==0)
{
return word[i];
}
if(reverseword==1)
{
String wordreverse="";
for(int k=word2.length()-1;k>=0;k--)
{
wordreverse=wordreverse+word2.charAt(k);
}
word[i]=wordreverse;
return word[i];
}
}
}
return null;
}
}
| 2,051 | 0.395417 | 0.381765 | 79 | 24.962025 | 21.086586 | 103 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.56962 | false | false | 2 |
86770a16abc69d7534eec255184339efb21e0cd9 | 20,572,893,363,849 | 19ea43bd2c148de32e606bd2f3d5ee43c1e20881 | /TaskConcurrent/ConcurrentCacheProxy/src/test/java/org/jschool/concurrentcacheproxy/RunTest.java | 9c47ae60fd72f16f6effbfea6e75a79412b148a8 | [] | no_license | Anatoly-Ivasenko/JavaSchool | https://github.com/Anatoly-Ivasenko/JavaSchool | 4c6b9c1112a6a6798ec310065f413821d73b6d84 | cac6473d3eaa335848a3c0c2e94beeb52975b645 | refs/heads/master | 2023-01-20T13:58:59.176000 | 2020-11-23T11:19:44 | 2020-11-23T11:19:44 | 293,275,187 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.jschool.concurrentcacheproxy;
import org.jschool.calc.Calculator;
import org.jschool.calc.CalculatorImpl;
public class RunTest {
public static void main(String[] args) {
CacheProxy cacheProxy = new CacheProxy("src/test/resources");
Calculator cachedCalc = cacheProxy.cache(new CalculatorImpl());
for (int i = 0; i < 10; i++) {
Thread thread = new Thread(() -> {
int argument = (int) (1 + Math.round(Math.random() * 11));
System.out.println(Thread.currentThread().getName() + " started:" + argument);
System.out.println(Thread.currentThread().getName() + " finished:" + cachedCalc.calc(argument));
});
thread.start();
}
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
for (int i = 0; i < 10; i++) {
Thread thread = new Thread(() -> {
int argument = (int) (1 + Math.round(Math.random() * 11));
System.out.println(Thread.currentThread().getName() + " started:" + argument);
System.out.println(Thread.currentThread().getName() + " finished:" + cachedCalc.calc(argument));
});
thread.start();
}
}
}
| UTF-8 | Java | 1,593 | java | RunTest.java | Java | [] | null | [] | package org.jschool.concurrentcacheproxy;
import org.jschool.calc.Calculator;
import org.jschool.calc.CalculatorImpl;
public class RunTest {
public static void main(String[] args) {
CacheProxy cacheProxy = new CacheProxy("src/test/resources");
Calculator cachedCalc = cacheProxy.cache(new CalculatorImpl());
for (int i = 0; i < 10; i++) {
Thread thread = new Thread(() -> {
int argument = (int) (1 + Math.round(Math.random() * 11));
System.out.println(Thread.currentThread().getName() + " started:" + argument);
System.out.println(Thread.currentThread().getName() + " finished:" + cachedCalc.calc(argument));
});
thread.start();
}
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
for (int i = 0; i < 10; i++) {
Thread thread = new Thread(() -> {
int argument = (int) (1 + Math.round(Math.random() * 11));
System.out.println(Thread.currentThread().getName() + " started:" + argument);
System.out.println(Thread.currentThread().getName() + " finished:" + cachedCalc.calc(argument));
});
thread.start();
}
}
}
| 1,593 | 0.456999 | 0.446955 | 37 | 42.054054 | 36.85321 | 128 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.567568 | false | false | 2 |
09c1932795410c8ba47869d458ec044b642f822f | 644,245,099,678 | 03dfc373cac5f7e82d61ff61fff58d001999ef07 | /WYDR APK/app/src/main/java/wydr/sellers/modal/BannerModel.java | e46f272ed542f4982cf72b36c5df0508904b92a3 | [] | no_license | vishalgupt/WYDR | https://github.com/vishalgupt/WYDR | 4be25032a0bfb39c5fcfc7e962a959e2821ef78a | 569b4d34507a27b5fce8586da3ee83e15bdc18fa | refs/heads/master | 2021-05-16T09:36:58.691000 | 2017-09-22T05:11:37 | 2017-09-22T05:11:37 | 104,434,193 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package wydr.sellers.modal;
/**
* Created by Akshay on 2/12/2016.
*/
public class BannerModel {
String banner_photo;
String product_id;
String product_name;
String type;
String cat_title;
String product_com;
String product_price;
public String getProduct_mrp() {
return product_mrp;
}
public void setProduct_mrp(String product_mrp) {
this.product_mrp = product_mrp;
}
String product_mrp;
String moq;
String discounted_price;
public String getDiscount_String() {
return discount_String;
}
public void setDiscount_String(String discount_String) {
this.discount_String = discount_String;
}
public String getDiscounted_price() {
return discounted_price;
}
public void setDiscounted_price(String discounted_price) {
this.discounted_price = discounted_price;
}
String discount_String;
public BannerModel(){}
public String getBanner_photo()
{
return this.banner_photo;
}
// setting id
public void setBanner_photo(String id18) {
this.banner_photo = id18;
}
public String getProduct_id()
{
return this.product_id;
}
// setting id
public void setProduct_id(String id19) {
this.product_id = id19;
}
public String getProductName()
{
return this.product_name;
}
// setting id
public void setProductName(String id20)
{
this.product_name= id20;
}
public String getProductType()
{
return this.type;
}
// setting id
public void setProductType(String id22)
{
this.type= id22;
}
public String getCat_title()
{
return this.cat_title;
}
// setting id
public void setCat_title(String id23)
{
this.cat_title= id23;
}
public String getProduct_com()
{
return this.product_com;
}
// setting id
public void setProduct_com(String id24)
{
this.product_com= id24;
}
public String getProduct_price()
{
return this.product_price;
}
// setting id
public void setProduct_price(String id25)
{
this.product_price= id25;
}
public String getMOQa()
{
return this.moq;
}
// setting id
public void setMOQa(String id26)
{
this.moq= id26;
}
}
| UTF-8 | Java | 2,417 | java | BannerModel.java | Java | [
{
"context": "package wydr.sellers.modal;\n\n/**\n * Created by Akshay on 2/12/2016.\n */\npublic class BannerModel {\n ",
"end": 53,
"score": 0.6704413890838623,
"start": 47,
"tag": "USERNAME",
"value": "Akshay"
}
] | null | [] | package wydr.sellers.modal;
/**
* Created by Akshay on 2/12/2016.
*/
public class BannerModel {
String banner_photo;
String product_id;
String product_name;
String type;
String cat_title;
String product_com;
String product_price;
public String getProduct_mrp() {
return product_mrp;
}
public void setProduct_mrp(String product_mrp) {
this.product_mrp = product_mrp;
}
String product_mrp;
String moq;
String discounted_price;
public String getDiscount_String() {
return discount_String;
}
public void setDiscount_String(String discount_String) {
this.discount_String = discount_String;
}
public String getDiscounted_price() {
return discounted_price;
}
public void setDiscounted_price(String discounted_price) {
this.discounted_price = discounted_price;
}
String discount_String;
public BannerModel(){}
public String getBanner_photo()
{
return this.banner_photo;
}
// setting id
public void setBanner_photo(String id18) {
this.banner_photo = id18;
}
public String getProduct_id()
{
return this.product_id;
}
// setting id
public void setProduct_id(String id19) {
this.product_id = id19;
}
public String getProductName()
{
return this.product_name;
}
// setting id
public void setProductName(String id20)
{
this.product_name= id20;
}
public String getProductType()
{
return this.type;
}
// setting id
public void setProductType(String id22)
{
this.type= id22;
}
public String getCat_title()
{
return this.cat_title;
}
// setting id
public void setCat_title(String id23)
{
this.cat_title= id23;
}
public String getProduct_com()
{
return this.product_com;
}
// setting id
public void setProduct_com(String id24)
{
this.product_com= id24;
}
public String getProduct_price()
{
return this.product_price;
}
// setting id
public void setProduct_price(String id25)
{
this.product_price= id25;
}
public String getMOQa()
{
return this.moq;
}
// setting id
public void setMOQa(String id26)
{
this.moq= id26;
}
}
| 2,417 | 0.592884 | 0.576748 | 133 | 17.172932 | 16.103758 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.255639 | false | false | 2 |
392f0f481e33befbc621e0566d57a81dd4bfe643 | 10,187,662,427,108 | f178b764a66e412247c45049e9466ad65d03a63f | /src/UVa_10947.java | c6be0d197cddf5277976b98f5cc895ab2df15f1d | [] | no_license | MDSP777/UVA-Repo-2.0 | https://github.com/MDSP777/UVA-Repo-2.0 | 10a4699d86320d9445f993508861f39c72cfbee1 | 5ee1fafa80c926179cde000aea6c5f5b5d34fae9 | refs/heads/master | 2020-03-17T18:58:37.076000 | 2018-07-30T14:11:31 | 2018-07-30T14:11:31 | 133,841,242 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class UVa_10947 {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(true) {
String s = br.readLine();
if(s==null) break;
String[] split = s.split("\\s+");
int l = Integer.parseInt(split[0]);
int m = Integer.parseInt(split[1]);
int maxDist = l*m;
String[] srcInfo = br.readLine().split("\\s+");
String[] destInfo = br.readLine().split("\\s+");
int n = Integer.parseInt(br.readLine())+2;
int[] x = new int[n];
int[] y = new int[n];
int[] r = new int[n];
x[0] = Integer.parseInt(srcInfo[0]);
y[0] = Integer.parseInt(srcInfo[1]);
r[0] = Integer.parseInt(srcInfo[2]);
x[1] = Integer.parseInt(destInfo[0]);
y[1] = Integer.parseInt(destInfo[1]);
r[1] = Integer.parseInt(destInfo[2]);
for(int i=2; i<n; i++) {
split = br.readLine().split("\\s+");
x[i] = Integer.parseInt(split[0]);
y[i] = Integer.parseInt(split[1]);
r[i] = Integer.parseInt(split[2]);
}
double[][] adj = new double[n][n];
for(int i=0; i<n; i++)
for(int j=i+1; j<n; j++) {
double dist = Math.sqrt(Math.pow(x[i]-x[j], 2)+Math.pow(y[i]-y[j], 2))-r[i]-r[j];
adj[i][j] = adj[j][i] = dist<=maxDist ? dist : 2000000;
}
for(int k=0; k<n; k++)
for(int i=0; i<n; i++)
for(int j=0; j<n; j++) adj[i][j] = Math.min(adj[i][j], adj[i][k]+adj[k][j]);
System.out.println(adj[0][1]<2000000 ? "Larry and Ryan will escape!" : "Larry and Ryan will be eaten to death.");
}
}
}
| UTF-8 | Java | 1,599 | java | UVa_10947.java | Java | [
{
"context": "][j]);\n\t\t\tSystem.out.println(adj[0][1]<2000000 ? \"Larry and Ryan will escape!\" : \"Larry and Ryan will be ",
"end": 1521,
"score": 0.9798510074615479,
"start": 1516,
"tag": "NAME",
"value": "Larry"
},
{
"context": "\tSystem.out.println(adj[0][1]<2000000 ? \"Larry ... | null | [] | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class UVa_10947 {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(true) {
String s = br.readLine();
if(s==null) break;
String[] split = s.split("\\s+");
int l = Integer.parseInt(split[0]);
int m = Integer.parseInt(split[1]);
int maxDist = l*m;
String[] srcInfo = br.readLine().split("\\s+");
String[] destInfo = br.readLine().split("\\s+");
int n = Integer.parseInt(br.readLine())+2;
int[] x = new int[n];
int[] y = new int[n];
int[] r = new int[n];
x[0] = Integer.parseInt(srcInfo[0]);
y[0] = Integer.parseInt(srcInfo[1]);
r[0] = Integer.parseInt(srcInfo[2]);
x[1] = Integer.parseInt(destInfo[0]);
y[1] = Integer.parseInt(destInfo[1]);
r[1] = Integer.parseInt(destInfo[2]);
for(int i=2; i<n; i++) {
split = br.readLine().split("\\s+");
x[i] = Integer.parseInt(split[0]);
y[i] = Integer.parseInt(split[1]);
r[i] = Integer.parseInt(split[2]);
}
double[][] adj = new double[n][n];
for(int i=0; i<n; i++)
for(int j=i+1; j<n; j++) {
double dist = Math.sqrt(Math.pow(x[i]-x[j], 2)+Math.pow(y[i]-y[j], 2))-r[i]-r[j];
adj[i][j] = adj[j][i] = dist<=maxDist ? dist : 2000000;
}
for(int k=0; k<n; k++)
for(int i=0; i<n; i++)
for(int j=0; j<n; j++) adj[i][j] = Math.min(adj[i][j], adj[i][k]+adj[k][j]);
System.out.println(adj[0][1]<2000000 ? "Larry and Ryan will escape!" : "Larry and Ryan will be eaten to death.");
}
}
}
| 1,599 | 0.58474 | 0.555347 | 44 | 35.340908 | 22.796474 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.818182 | false | false | 2 |
0da0a7f155845477d4c704381224fab69dc79395 | 27,685,359,195,820 | 2cd3c1d48edadba73cf27280f0b389ec17a49487 | /GuitarTabSelectorCore/src/main/java/de/safiscet/guitartabselector/service/GuitarTabSelectorFactory.java | 7a2ac2f8c1a6f81bda7a82d6b2b5a68121595306 | [
"MIT"
] | permissive | safiscet/GuitarTabSelector | https://github.com/safiscet/GuitarTabSelector | 673447243de6f8bc0c4e1310acae4d3980404927 | d6833fcaca45ff51ae56a54e5c89a5d7bceb392d | refs/heads/master | 2021-01-22T03:31:29.021000 | 2018-03-30T22:10:57 | 2018-03-30T22:10:57 | 92,384,885 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package de.safiscet.guitartabselector.service;
import de.safiscet.guitartabselector.model.GuitarTabConfiguration;
/**
* @author Stefan Fritsch
*/
public class GuitarTabSelectorFactory {
public RandomGuitarTabService createRandomGuitarTabService(final GuitarTabConfiguration config) {
final DirectoryVisitor directoryVisitor = new DirectoryVisitor(config);
final GuitarTabDirectoryService guitarTabDirectoryService = new GuitarTabDirectoryService(config, directoryVisitor);
return new RandomGuitarTabService(guitarTabDirectoryService);
}
}
| UTF-8 | Java | 576 | java | GuitarTabSelectorFactory.java | Java | [
{
"context": "ctor.model.GuitarTabConfiguration;\n\n/**\n * @author Stefan Fritsch\n */\npublic class GuitarTabSelectorFactory {\n\n ",
"end": 145,
"score": 0.9998772740364075,
"start": 131,
"tag": "NAME",
"value": "Stefan Fritsch"
}
] | null | [] | package de.safiscet.guitartabselector.service;
import de.safiscet.guitartabselector.model.GuitarTabConfiguration;
/**
* @author <NAME>
*/
public class GuitarTabSelectorFactory {
public RandomGuitarTabService createRandomGuitarTabService(final GuitarTabConfiguration config) {
final DirectoryVisitor directoryVisitor = new DirectoryVisitor(config);
final GuitarTabDirectoryService guitarTabDirectoryService = new GuitarTabDirectoryService(config, directoryVisitor);
return new RandomGuitarTabService(guitarTabDirectoryService);
}
}
| 568 | 0.810764 | 0.810764 | 15 | 37.400002 | 40.215752 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false | 2 |
6653475ed9b651aa0d9ef20f0f842da72b32ac2d | 31,997,506,370,013 | 438b148ecea538cf9484be6c7fa3cc242a098c8f | /src/test/java/sample/list/DiversityHashSetTest.java | f7646a077cdfc26d0a18f2ebc62c4991eeebb9d6 | [] | no_license | ykukharskyi/DiversityList | https://github.com/ykukharskyi/DiversityList | d4643a197f42035e7419726f775c59898f5bd2ad | aa8c4acac67611ceec972d228b7d61df783729fe | refs/heads/master | 2016-09-16T10:06:26.088000 | 2014-07-16T08:50:09 | 2014-07-16T08:50:09 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package sample.list;
import org.junit.Before;
import org.junit.Test;
import java.util.Set;
import static org.junit.Assert.*;
/**
* Created by ykukharskyi on 16.07.14.
*/
public class DiversityHashSetTest {
private Set testSet;
@Before
public void initTestSet() {
testSet = new DiversityHashSet();
}
}
| UTF-8 | Java | 332 | java | DiversityHashSetTest.java | Java | [
{
"context": "port static org.junit.Assert.*;\n\n/**\n * Created by ykukharskyi on 16.07.14.\n */\npublic class DiversityHashSetTes",
"end": 158,
"score": 0.9990463256835938,
"start": 147,
"tag": "USERNAME",
"value": "ykukharskyi"
}
] | null | [] | package sample.list;
import org.junit.Before;
import org.junit.Test;
import java.util.Set;
import static org.junit.Assert.*;
/**
* Created by ykukharskyi on 16.07.14.
*/
public class DiversityHashSetTest {
private Set testSet;
@Before
public void initTestSet() {
testSet = new DiversityHashSet();
}
}
| 332 | 0.683735 | 0.665663 | 20 | 15.6 | 14.447837 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.35 | false | false | 2 |
0f1be721535eafcd51c8953c3bbe37b464ae593e | 5,600,637,403,533 | e6ed448ab27dd82ec32d656dbdf8c59857e0cece | /app/src/main/java/hackaton/smartbureaucracy/pfizica.java | 2f0191a396cb7be6af4b0fea0dc87fe5312a4e74 | [] | no_license | sKzRO/easybiro | https://github.com/sKzRO/easybiro | 5ebbd3d3619c62d158f1af687b3a087712eb607e | 48498d7d4dddde06a8d4a8852277758f7311e6aa | refs/heads/master | 2022-04-09T12:31:49.117000 | 2020-03-05T11:54:49 | 2020-03-05T11:54:49 | 219,157,606 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package hackaton.smartbureaucracy;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class pfizica extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pfizica);
TextView textView2 = (TextView)findViewById(R.id.email);
textView2.setText(getSharedPreferences("Email_pfiz", MODE_PRIVATE).getString("key",""));
TextView textView3 = (TextView)findViewById(R.id.telefon_pfizica);
textView3.setText(getSharedPreferences("TlfX_pfiz", MODE_PRIVATE).getString("key",""));
TextView textView4 = (TextView)findViewById(R.id.Data_nasterii);
textView4.setText(getSharedPreferences("Data_pfiz", MODE_PRIVATE).getString("key",""));
TextView textView5 = (TextView)findViewById(R.id.domiciliu);
textView5.setText(getSharedPreferences("Domiciliu_pfiz", MODE_PRIVATE).getString("key",""));
}
public void schimba_datele(View view) {
Intent myIntent = new Intent(pfizica.this,
date_pfizica.class);
startActivity(myIntent);
}
public void qr(View view) {
Intent myIntent = new Intent(pfizica.this,
QR.class);
startActivity(myIntent);
}
public void scaneaza_buletin(View view) {
Intent myIntent = new Intent(pfizica.this,
OCR.class);
startActivity(myIntent);
}
}
| UTF-8 | Java | 1,592 | java | pfizica.java | Java | [] | null | [] | package hackaton.smartbureaucracy;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class pfizica extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pfizica);
TextView textView2 = (TextView)findViewById(R.id.email);
textView2.setText(getSharedPreferences("Email_pfiz", MODE_PRIVATE).getString("key",""));
TextView textView3 = (TextView)findViewById(R.id.telefon_pfizica);
textView3.setText(getSharedPreferences("TlfX_pfiz", MODE_PRIVATE).getString("key",""));
TextView textView4 = (TextView)findViewById(R.id.Data_nasterii);
textView4.setText(getSharedPreferences("Data_pfiz", MODE_PRIVATE).getString("key",""));
TextView textView5 = (TextView)findViewById(R.id.domiciliu);
textView5.setText(getSharedPreferences("Domiciliu_pfiz", MODE_PRIVATE).getString("key",""));
}
public void schimba_datele(View view) {
Intent myIntent = new Intent(pfizica.this,
date_pfizica.class);
startActivity(myIntent);
}
public void qr(View view) {
Intent myIntent = new Intent(pfizica.this,
QR.class);
startActivity(myIntent);
}
public void scaneaza_buletin(View view) {
Intent myIntent = new Intent(pfizica.this,
OCR.class);
startActivity(myIntent);
}
}
| 1,592 | 0.680905 | 0.675251 | 50 | 30.84 | 29.606998 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.66 | false | false | 2 |
28e614ab8a0b2f77d5bb9c527d767aec12f119d1 | 12,850,542,150,372 | 542f01d789ab979bbdd0a3911ec92377cb11f932 | /app/src/main/java/com/example/xupeng/xunji/activity/SettingsActivity.java | a82b198eb7804fdbe1b5c5e05a8b6cf102539369 | [
"Apache-2.0"
] | permissive | xupeng9896/xunji | https://github.com/xupeng9896/xunji | 9d1dbcc465fd07991cc90ba6d9233a3812b60fbc | f05db661017715beeea85bb137e4fc17faa8348b | refs/heads/master | 2020-03-16T13:59:50.863000 | 2018-05-09T05:26:34 | 2018-05-09T05:26:34 | 132,704,658 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.xupeng.xunji.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import com.example.xupeng.xunji.R;
import com.example.xupeng.xunji.adpter.SettingsRecyclerAdapter;
import com.example.xupeng.xunji.utils.SearchTrackRecyclerItemDecoration;
import com.example.xupeng.xunji.imp.OnRecyclerSettingsSwitchClickListener;
import com.example.xupeng.xunji.utils.SharedPreferencesUtil;
import java.util.ArrayList;
import java.util.List;
import static com.example.xupeng.xunji.activity.MainActivity.CLICK_KEY;
import static com.example.xupeng.xunji.activity.MainActivity.FILE_KEY;
import static com.example.xupeng.xunji.activity.MainActivity.LOGIN_STATE;
/**
* Created by xupeng on 2018/4/2.
*/
public class SettingsActivity extends AppCompatActivity implements View.OnClickListener {
private Toolbar mToolbar;
private Button mExitBtn;
private Button mExchangeBtn;
private RecyclerView mRecyclerView;
private SettingsRecyclerAdapter mAdapter;
private List<String> settingTitleList;
private List<Boolean> settingSwitchStateList;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
initList();
initView();
ActionBar actionBar=getSupportActionBar();
if (actionBar!=null){
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
private void initView(){
mToolbar=(Toolbar)findViewById(R.id.page_module_toolbar);
mRecyclerView=(RecyclerView)findViewById(R.id.settings_rv);
mExitBtn=(Button)findViewById(R.id.exit_login_btn);
mExchangeBtn=(Button)findViewById(R.id.exchange_login_btn);
mToolbar.setTitle(this.getString(R.string.settings));
mToolbar.setTitleTextColor(getResources().getColor(R.color.black));
setSupportActionBar(mToolbar);
LinearLayoutManager layoutManager=new LinearLayoutManager(this);
mAdapter=new SettingsRecyclerAdapter(this,settingTitleList);
layoutManager.setOrientation(LinearLayout.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.addItemDecoration(new SearchTrackRecyclerItemDecoration(10));
mExitBtn.setOnClickListener(this);
mExchangeBtn.setOnClickListener(this);
mAdapter.setOnItemClickListener(new OnRecyclerSettingsSwitchClickListener() {
@Override
public void onSwitchClickListener(boolean isChecked) {
settingSwitchStateList.add(isChecked);
}
});
}
private void initList(){
settingTitleList=new ArrayList<>();
settingSwitchStateList=new ArrayList<>();
settingTitleList.add("设置标题1");
settingTitleList.add("设置标题2");
settingTitleList.add("设置标题3");
settingTitleList.add("设置标题4");
}
@Override
public void onClick(View v) {
Intent intent;
switch (v.getId()){
case R.id.exit_login_btn:
SharedPreferencesUtil.saveObject(this,
FILE_KEY, LOGIN_STATE, false);
SharedPreferencesUtil.saveObject(this,
FILE_KEY, CLICK_KEY, true);
intent=new Intent(this,MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
case R.id.exchange_login_btn:
intent=new Intent(this,LoginActivity.class);
startActivity(intent);
break;
default:
break;
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home:
finish();
break;
default:
break;
}
return true;
}
}
| UTF-8 | Java | 4,464 | java | SettingsActivity.java | Java | [
{
"context": "ivity.MainActivity.LOGIN_STATE;\n\n/**\n * Created by xupeng on 2018/4/2.\n */\n\npublic class SettingsActivity e",
"end": 1104,
"score": 0.9842045903205872,
"start": 1098,
"tag": "USERNAME",
"value": "xupeng"
}
] | null | [] | package com.example.xupeng.xunji.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import com.example.xupeng.xunji.R;
import com.example.xupeng.xunji.adpter.SettingsRecyclerAdapter;
import com.example.xupeng.xunji.utils.SearchTrackRecyclerItemDecoration;
import com.example.xupeng.xunji.imp.OnRecyclerSettingsSwitchClickListener;
import com.example.xupeng.xunji.utils.SharedPreferencesUtil;
import java.util.ArrayList;
import java.util.List;
import static com.example.xupeng.xunji.activity.MainActivity.CLICK_KEY;
import static com.example.xupeng.xunji.activity.MainActivity.FILE_KEY;
import static com.example.xupeng.xunji.activity.MainActivity.LOGIN_STATE;
/**
* Created by xupeng on 2018/4/2.
*/
public class SettingsActivity extends AppCompatActivity implements View.OnClickListener {
private Toolbar mToolbar;
private Button mExitBtn;
private Button mExchangeBtn;
private RecyclerView mRecyclerView;
private SettingsRecyclerAdapter mAdapter;
private List<String> settingTitleList;
private List<Boolean> settingSwitchStateList;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
initList();
initView();
ActionBar actionBar=getSupportActionBar();
if (actionBar!=null){
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
private void initView(){
mToolbar=(Toolbar)findViewById(R.id.page_module_toolbar);
mRecyclerView=(RecyclerView)findViewById(R.id.settings_rv);
mExitBtn=(Button)findViewById(R.id.exit_login_btn);
mExchangeBtn=(Button)findViewById(R.id.exchange_login_btn);
mToolbar.setTitle(this.getString(R.string.settings));
mToolbar.setTitleTextColor(getResources().getColor(R.color.black));
setSupportActionBar(mToolbar);
LinearLayoutManager layoutManager=new LinearLayoutManager(this);
mAdapter=new SettingsRecyclerAdapter(this,settingTitleList);
layoutManager.setOrientation(LinearLayout.VERTICAL);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.addItemDecoration(new SearchTrackRecyclerItemDecoration(10));
mExitBtn.setOnClickListener(this);
mExchangeBtn.setOnClickListener(this);
mAdapter.setOnItemClickListener(new OnRecyclerSettingsSwitchClickListener() {
@Override
public void onSwitchClickListener(boolean isChecked) {
settingSwitchStateList.add(isChecked);
}
});
}
private void initList(){
settingTitleList=new ArrayList<>();
settingSwitchStateList=new ArrayList<>();
settingTitleList.add("设置标题1");
settingTitleList.add("设置标题2");
settingTitleList.add("设置标题3");
settingTitleList.add("设置标题4");
}
@Override
public void onClick(View v) {
Intent intent;
switch (v.getId()){
case R.id.exit_login_btn:
SharedPreferencesUtil.saveObject(this,
FILE_KEY, LOGIN_STATE, false);
SharedPreferencesUtil.saveObject(this,
FILE_KEY, CLICK_KEY, true);
intent=new Intent(this,MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
case R.id.exchange_login_btn:
intent=new Intent(this,LoginActivity.class);
startActivity(intent);
break;
default:
break;
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home:
finish();
break;
default:
break;
}
return true;
}
}
| 4,464 | 0.683439 | 0.679603 | 128 | 33.625 | 24.332655 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.65625 | false | false | 2 |
ccc6bf1103b41e8085885fd9b385f6f5c42d3412 | 6,150,393,195,818 | 0444380a2b2d88b33a3a964327d10956787eda08 | /app/src/main/java/com/example/cobeosijek/carsapp/login/LoginActivity.java | 8675d2cf05d6a257345a77f10881af693ab925c7 | [] | no_license | tsarcevic/CarsApp | https://github.com/tsarcevic/CarsApp | dfd16ddec41d69d0f3fb044aad713b1d3dd436ce | 984eed1af121e40758c9ba1ecaba5e4409467de8 | refs/heads/master | 2021-07-15T17:55:37.521000 | 2017-10-20T09:26:38 | 2017-10-20T09:26:38 | 107,255,345 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.cobeosijek.carsapp.login;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Patterns;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.example.cobeosijek.carsapp.R;
import com.example.cobeosijek.carsapp.car_list.CarsActivity;
import com.example.cobeosijek.carsapp.utils.StringUtils;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
Button loginFormButton;
TextView loginToolbarText;
TextView loginFormWelcomeText;
EditText emailEditText;
EditText passwordEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
setUI();
}
private void setUI() {
loginFormButton = findViewById(R.id.login_button);
loginToolbarText = findViewById(R.id.login_form);
loginFormWelcomeText = findViewById(R.id.welcome_screen);
emailEditText = findViewById(R.id.email_text);
passwordEditText = findViewById(R.id.password_text);
loginFormButton.setOnClickListener(this);
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.login_button) {
if (StringUtils.checkText(emailEditText.getText().toString(), emailEditText) && StringUtils.checkPassword(passwordEditText.getText().toString(), passwordEditText)) {
startActivity(CarsActivity.getLaunchIntent(this, emailEditText.getText().toString().trim()));
emailEditText.setText("");
passwordEditText.setText("");
emailEditText.setError(null);
passwordEditText.setError(null);
}
}
}
}
| UTF-8 | Java | 1,884 | java | LoginActivity.java | Java | [] | null | [] | package com.example.cobeosijek.carsapp.login;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Patterns;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.example.cobeosijek.carsapp.R;
import com.example.cobeosijek.carsapp.car_list.CarsActivity;
import com.example.cobeosijek.carsapp.utils.StringUtils;
public class LoginActivity extends AppCompatActivity implements View.OnClickListener {
Button loginFormButton;
TextView loginToolbarText;
TextView loginFormWelcomeText;
EditText emailEditText;
EditText passwordEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
setUI();
}
private void setUI() {
loginFormButton = findViewById(R.id.login_button);
loginToolbarText = findViewById(R.id.login_form);
loginFormWelcomeText = findViewById(R.id.welcome_screen);
emailEditText = findViewById(R.id.email_text);
passwordEditText = findViewById(R.id.password_text);
loginFormButton.setOnClickListener(this);
}
@Override
public void onClick(View view) {
if (view.getId() == R.id.login_button) {
if (StringUtils.checkText(emailEditText.getText().toString(), emailEditText) && StringUtils.checkPassword(passwordEditText.getText().toString(), passwordEditText)) {
startActivity(CarsActivity.getLaunchIntent(this, emailEditText.getText().toString().trim()));
emailEditText.setText("");
passwordEditText.setText("");
emailEditText.setError(null);
passwordEditText.setError(null);
}
}
}
}
| 1,884 | 0.707006 | 0.706476 | 55 | 33.254547 | 31.035006 | 177 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.618182 | false | false | 2 |
616d6233c70c0a764b1bde53c99ac1dfd56869cf | 11,072,425,693,665 | 378d1af08a71439106ea42afbaa36012bec07205 | /src/test/java/com/github/honourednihilist/metrics/SocketUtils.java | 7dc370a4a053cdd49419a43e264a8922280867b1 | [
"MIT"
] | permissive | honourednihilist/prometheus-metrics-reporter | https://github.com/honourednihilist/prometheus-metrics-reporter | ac7271327e348edacb2ab3a4a0479661c93a9dc0 | b8ccdffce28c178e9cda58c9791e678f2c3d7a68 | refs/heads/master | 2020-03-07T15:56:05.279000 | 2018-04-01T17:08:59 | 2018-04-01T17:08:59 | 127,568,255 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.github.honourednihilist.metrics;
import java.io.IOException;
import java.net.ServerSocket;
public class SocketUtils {
private SocketUtils() {}
public static int getFreePort() {
try (ServerSocket socket = new ServerSocket(0)) {
return socket.getLocalPort();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
| UTF-8 | Java | 351 | java | SocketUtils.java | Java | [
{
"context": "package com.github.honourednihilist.metrics;\n\nimport java.io.IOException;\nimp",
"end": 27,
"score": 0.5955217480659485,
"start": 19,
"tag": "USERNAME",
"value": "honoured"
}
] | null | [] | package com.github.honourednihilist.metrics;
import java.io.IOException;
import java.net.ServerSocket;
public class SocketUtils {
private SocketUtils() {}
public static int getFreePort() {
try (ServerSocket socket = new ServerSocket(0)) {
return socket.getLocalPort();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
| 351 | 0.729345 | 0.726496 | 17 | 19.647058 | 16.904371 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.176471 | false | false | 2 |
4f1629995451e0899a208f3abab18ba9507f5b9d | 13,855,564,500,580 | fd002e7bd23adeda19dba90b0a5d6dab9570cb3b | /xfgl-support/src/main/java/com/tonbu/support/service/AopLogService.java | 40fe19c3a94cc8a1e3f1d99cdfa42609c806a572 | [] | no_license | bellmit/xfgl | https://github.com/bellmit/xfgl | b20e2e7ced5bfdfaa524cbd3fc286fcfdc74bd1d | 9cef1ba93c6d2fb3d2f43e7ac7cf72b5b855c41e | refs/heads/master | 2022-12-20T11:54:33.201000 | 2020-10-23T07:38:45 | 2020-10-23T07:38:45 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.tonbu.support.service;
import java.util.Map;
public interface AopLogService {
void save(Map<String,String> param);
}
| UTF-8 | Java | 135 | java | AopLogService.java | Java | [] | null | [] | package com.tonbu.support.service;
import java.util.Map;
public interface AopLogService {
void save(Map<String,String> param);
}
| 135 | 0.755556 | 0.755556 | 7 | 18.285715 | 16.394375 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false | 2 |
8a845f4b24f9e475095911c6c54e729aaf55d0fc | 22,643,067,615,309 | 8637757c7f2e49e4d67bc5295ee4e9d991382c1b | /src/main/java/zm/hashcode/mshengu/repository/procurement/Impl/MaintenanceSpendBySupplierRepositoryImpl.java | c8dff60c7d280dbcf66a19046fb0287efbfe178c | [] | no_license | smkumatela/mshengu | https://github.com/smkumatela/mshengu | 63ee88e9bd91c961d6e453f802f76a2020b0a9e5 | 8528538b8c75b4298b467787bc0f624117e03354 | refs/heads/master | 2020-12-31T03:26:47.493000 | 2015-03-17T14:29:54 | 2015-03-17T14:29:54 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zm.hashcode.mshengu.repository.procurement.Impl;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import zm.hashcode.mshengu.app.util.DateTimeFormatHelper;
import zm.hashcode.mshengu.domain.fleet.Truck;
import zm.hashcode.mshengu.domain.procurement.MaintenanceSpendBySupplier;
import zm.hashcode.mshengu.domain.serviceprovider.ServiceProvider;
import zm.hashcode.mshengu.repository.procurement.MaintenanceSpendBySupplierRepositoryCustom;
/**
*
* @author Colin
*/
public class MaintenanceSpendBySupplierRepositoryImpl implements MaintenanceSpendBySupplierRepositoryCustom {
final DateTimeFormatHelper dateTimeFormatHelper = new DateTimeFormatHelper();
@Autowired
private MongoOperations mongoOperation;
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendBetweenTwoDates(Date from, Date to) {
Date fromDate = dateTimeFormatHelper.resetTimeAndMonthStart(from);
Date toDate = dateTimeFormatHelper.resetTimeAndMonthEnd(to);
Calendar calendar = Calendar.getInstance();
calendar.setTime(toDate);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
Query maintenanceSpendListQuery = new Query();
maintenanceSpendListQuery.addCriteria(
Criteria.where("transactionDate").exists(true)
.andOperator(Criteria.where("transactionDate").gte(fromDate),
Criteria.where("transactionDate").lte(calendar.getTime())));
/*
List<MaintenanceSpendBySupplier> maintenanceSpendList = mongoOperation.find(maintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
System.out.println(" MaintenanceSpendBySupplierRepository - GENERAL QUERY - Start= " + to + " | To= " + to);
if (maintenanceSpendList.isEmpty()) {
System.out.println("MaintenanceSpendBySupplierRepository - GENERAL QUERY - NO MATCHING RECORDS FOUND");
}
for (MaintenanceSpendBySupplier maintenanceSpend : maintenanceSpendList) {
System.out.println(" MaintenanceSpendBySupplierRepository - GENERAL QUERY - Date= " + maintenanceSpend.getTransactionDate() + " | Cost= " + maintenanceSpend.getMaintenanceCost() + " | Truck= " + maintenanceSpend.getTruckId() + " | Supplier" + maintenanceSpend.getSupplierId());
}
System.out.println("--==--");
*/
return mongoOperation.find(maintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendByTruckBetweenTwoDates(Truck truck, Date from, Date to) {
Date fromDate = dateTimeFormatHelper.resetTimeAndMonthStart(from);
Date toDate = dateTimeFormatHelper.resetTimeAndMonthEnd(to);
Calendar calendar = Calendar.getInstance();
calendar.setTime(toDate);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getTruckMaintenanceSpend(truck, fromDate, calendar.getTime());
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendByTruckForMonth(Truck truck, Date month) {
Date from = dateTimeFormatHelper.resetTimeAndMonthStart(month);
Date to = dateTimeFormatHelper.resetTimeAndMonthEnd(month);
Calendar calendar = Calendar.getInstance();
calendar.setTime(to);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getTruckMaintenanceSpend(truck, from, calendar.getTime());
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendBySupplierBetweenTwoDates(ServiceProvider serviceProvider, Date from, Date to) {
Date fromDate = dateTimeFormatHelper.resetTimeAndMonthStart(from);
Date toDate = dateTimeFormatHelper.resetTimeAndMonthEnd(to);
Calendar calendar = Calendar.getInstance();
calendar.setTime(toDate);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getSupplierMaintenanceSpend(serviceProvider, fromDate, calendar.getTime());
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendBySupplierForMonth(ServiceProvider serviceProvider, Date month) {
Date from = dateTimeFormatHelper.resetTimeAndMonthStart(month);
Date to = dateTimeFormatHelper.resetTimeAndMonthEnd(month);
Calendar calendar = Calendar.getInstance();
calendar.setTime(to);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getSupplierMaintenanceSpend(serviceProvider, from, calendar.getTime());
}
private List<MaintenanceSpendBySupplier> getTruckMaintenanceSpend(Truck truck, Date from, Date to) {
Query truckMaintenanceSpendListQuery = new Query();
truckMaintenanceSpendListQuery.addCriteria(
Criteria.where("truckId").is(truck.getId())
.andOperator(Criteria.where("transactionDate").gte(from),
Criteria.where("transactionDate").lte(to)));
/*
* List<MaintenanceSpendBySupplier> maintenanceSpendList = mongoOperation.find(truckMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
System.out.println(" MaintenanceSpendBySupplierRepository - TRUCK QUERY - Start= " + to + " | To= " + to + " FOR truckId: " + truck.getId());
if (maintenanceSpendList.isEmpty()) {
System.out.println("MaintenanceSpendBySupplierRepository - TRUCK QUERY - NO MATCHING RECORDS FOUND");
}
for (MaintenanceSpendBySupplier maintenanceSpend : maintenanceSpendList) {
System.out.println(" MaintenanceSpendBySupplierRepository - TRUCK QUERY - Date= " + maintenanceSpend.getTransactionDate() + " | Cost= " + maintenanceSpend.getMaintenanceCost() + " | Truck= " + maintenanceSpend.getTruckId() + " | Supplier" + maintenanceSpend.getSupplierId());
}
System.out.println("--==--");
*/
return mongoOperation.find(truckMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
}
private List<MaintenanceSpendBySupplier> getSupplierMaintenanceSpend(ServiceProvider serviceProvider, Date from, Date to) {
Query supplierMaintenanceSpendListQuery = new Query();
supplierMaintenanceSpendListQuery.addCriteria(
Criteria.where("supplierId").is(serviceProvider.getId())
.andOperator(Criteria.where("transactionDate").gte(from),
Criteria.where("transactionDate").lte(to)));
/*
List<MaintenanceSpendBySupplier> maintenanceSpendList = mongoOperation.find(supplierMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
System.out.println(" MaintenanceSpendBySupplierRepository - SUPPLIER QUERY - Start= " + to + " | To= " + to + " FOR serviceProviderId: " + serviceProvider.getId());
if (maintenanceSpendList.isEmpty()) {
System.out.println("MaintenanceSpendBySupplierRepository - SUPPLIER QUERY - NO MATCHING RECORDS FOUND");
}
for (MaintenanceSpendBySupplier maintenanceSpend : maintenanceSpendList) {
System.out.println(" MaintenanceSpendBySupplierRepository - SUPPLIER QUERY - Date= " + maintenanceSpend.getTransactionDate() + " | Cost= " + maintenanceSpend.getMaintenanceCost() + " | Truck= " + maintenanceSpend.getTruckId() + " | Supplier" + maintenanceSpend.getSupplierId());
}
System.out.println("--==--");
*/
return mongoOperation.find(supplierMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
}
}
| UTF-8 | Java | 8,777 | java | MaintenanceSpendBySupplierRepositoryImpl.java | Java | [
{
"context": "pendBySupplierRepositoryCustom;\n\n/**\n *\n * @author Colin\n */\npublic class MaintenanceSpendBySupplierReposi",
"end": 839,
"score": 0.999752402305603,
"start": 834,
"tag": "NAME",
"value": "Colin"
}
] | null | [] | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package zm.hashcode.mshengu.repository.procurement.Impl;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import zm.hashcode.mshengu.app.util.DateTimeFormatHelper;
import zm.hashcode.mshengu.domain.fleet.Truck;
import zm.hashcode.mshengu.domain.procurement.MaintenanceSpendBySupplier;
import zm.hashcode.mshengu.domain.serviceprovider.ServiceProvider;
import zm.hashcode.mshengu.repository.procurement.MaintenanceSpendBySupplierRepositoryCustom;
/**
*
* @author Colin
*/
public class MaintenanceSpendBySupplierRepositoryImpl implements MaintenanceSpendBySupplierRepositoryCustom {
final DateTimeFormatHelper dateTimeFormatHelper = new DateTimeFormatHelper();
@Autowired
private MongoOperations mongoOperation;
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendBetweenTwoDates(Date from, Date to) {
Date fromDate = dateTimeFormatHelper.resetTimeAndMonthStart(from);
Date toDate = dateTimeFormatHelper.resetTimeAndMonthEnd(to);
Calendar calendar = Calendar.getInstance();
calendar.setTime(toDate);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
Query maintenanceSpendListQuery = new Query();
maintenanceSpendListQuery.addCriteria(
Criteria.where("transactionDate").exists(true)
.andOperator(Criteria.where("transactionDate").gte(fromDate),
Criteria.where("transactionDate").lte(calendar.getTime())));
/*
List<MaintenanceSpendBySupplier> maintenanceSpendList = mongoOperation.find(maintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
System.out.println(" MaintenanceSpendBySupplierRepository - GENERAL QUERY - Start= " + to + " | To= " + to);
if (maintenanceSpendList.isEmpty()) {
System.out.println("MaintenanceSpendBySupplierRepository - GENERAL QUERY - NO MATCHING RECORDS FOUND");
}
for (MaintenanceSpendBySupplier maintenanceSpend : maintenanceSpendList) {
System.out.println(" MaintenanceSpendBySupplierRepository - GENERAL QUERY - Date= " + maintenanceSpend.getTransactionDate() + " | Cost= " + maintenanceSpend.getMaintenanceCost() + " | Truck= " + maintenanceSpend.getTruckId() + " | Supplier" + maintenanceSpend.getSupplierId());
}
System.out.println("--==--");
*/
return mongoOperation.find(maintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendByTruckBetweenTwoDates(Truck truck, Date from, Date to) {
Date fromDate = dateTimeFormatHelper.resetTimeAndMonthStart(from);
Date toDate = dateTimeFormatHelper.resetTimeAndMonthEnd(to);
Calendar calendar = Calendar.getInstance();
calendar.setTime(toDate);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getTruckMaintenanceSpend(truck, fromDate, calendar.getTime());
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendByTruckForMonth(Truck truck, Date month) {
Date from = dateTimeFormatHelper.resetTimeAndMonthStart(month);
Date to = dateTimeFormatHelper.resetTimeAndMonthEnd(month);
Calendar calendar = Calendar.getInstance();
calendar.setTime(to);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getTruckMaintenanceSpend(truck, from, calendar.getTime());
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendBySupplierBetweenTwoDates(ServiceProvider serviceProvider, Date from, Date to) {
Date fromDate = dateTimeFormatHelper.resetTimeAndMonthStart(from);
Date toDate = dateTimeFormatHelper.resetTimeAndMonthEnd(to);
Calendar calendar = Calendar.getInstance();
calendar.setTime(toDate);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getSupplierMaintenanceSpend(serviceProvider, fromDate, calendar.getTime());
}
@Override
public List<MaintenanceSpendBySupplier> getMaintenanceSpendBySupplierForMonth(ServiceProvider serviceProvider, Date month) {
Date from = dateTimeFormatHelper.resetTimeAndMonthStart(month);
Date to = dateTimeFormatHelper.resetTimeAndMonthEnd(month);
Calendar calendar = Calendar.getInstance();
calendar.setTime(to);
// Set time fields to last hour:minute:second:millisecond
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return getSupplierMaintenanceSpend(serviceProvider, from, calendar.getTime());
}
private List<MaintenanceSpendBySupplier> getTruckMaintenanceSpend(Truck truck, Date from, Date to) {
Query truckMaintenanceSpendListQuery = new Query();
truckMaintenanceSpendListQuery.addCriteria(
Criteria.where("truckId").is(truck.getId())
.andOperator(Criteria.where("transactionDate").gte(from),
Criteria.where("transactionDate").lte(to)));
/*
* List<MaintenanceSpendBySupplier> maintenanceSpendList = mongoOperation.find(truckMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
System.out.println(" MaintenanceSpendBySupplierRepository - TRUCK QUERY - Start= " + to + " | To= " + to + " FOR truckId: " + truck.getId());
if (maintenanceSpendList.isEmpty()) {
System.out.println("MaintenanceSpendBySupplierRepository - TRUCK QUERY - NO MATCHING RECORDS FOUND");
}
for (MaintenanceSpendBySupplier maintenanceSpend : maintenanceSpendList) {
System.out.println(" MaintenanceSpendBySupplierRepository - TRUCK QUERY - Date= " + maintenanceSpend.getTransactionDate() + " | Cost= " + maintenanceSpend.getMaintenanceCost() + " | Truck= " + maintenanceSpend.getTruckId() + " | Supplier" + maintenanceSpend.getSupplierId());
}
System.out.println("--==--");
*/
return mongoOperation.find(truckMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
}
private List<MaintenanceSpendBySupplier> getSupplierMaintenanceSpend(ServiceProvider serviceProvider, Date from, Date to) {
Query supplierMaintenanceSpendListQuery = new Query();
supplierMaintenanceSpendListQuery.addCriteria(
Criteria.where("supplierId").is(serviceProvider.getId())
.andOperator(Criteria.where("transactionDate").gte(from),
Criteria.where("transactionDate").lte(to)));
/*
List<MaintenanceSpendBySupplier> maintenanceSpendList = mongoOperation.find(supplierMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
System.out.println(" MaintenanceSpendBySupplierRepository - SUPPLIER QUERY - Start= " + to + " | To= " + to + " FOR serviceProviderId: " + serviceProvider.getId());
if (maintenanceSpendList.isEmpty()) {
System.out.println("MaintenanceSpendBySupplierRepository - SUPPLIER QUERY - NO MATCHING RECORDS FOUND");
}
for (MaintenanceSpendBySupplier maintenanceSpend : maintenanceSpendList) {
System.out.println(" MaintenanceSpendBySupplierRepository - SUPPLIER QUERY - Date= " + maintenanceSpend.getTransactionDate() + " | Cost= " + maintenanceSpend.getMaintenanceCost() + " | Truck= " + maintenanceSpend.getTruckId() + " | Supplier" + maintenanceSpend.getSupplierId());
}
System.out.println("--==--");
*/
return mongoOperation.find(supplierMaintenanceSpendListQuery, MaintenanceSpendBySupplier.class);
}
}
| 8,777 | 0.715962 | 0.710835 | 168 | 51.244049 | 50.193733 | 287 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.863095 | false | false | 2 |
3b000df83c857411f37a90503cd51da48759aaa4 | 30,992,484,038,942 | 82e3e5295a1f4d4ff98e058760d364ddd888e466 | /src/main/java/ua/kpi/mobiledev/service/DistrictService.java | 9fb4aef8d774f9876cb5716d7d8a705370750aeb | [] | no_license | OlehKakherskiy/TaxiServiceServer | https://github.com/OlehKakherskiy/TaxiServiceServer | 97b1114a00c81b51b87a9b4779c77c8d3f72bb44 | b3f71383b03c081d380498754ac978b864c2d80a | refs/heads/master | 2021-06-19T14:51:39.054000 | 2017-06-20T23:41:55 | 2017-06-20T23:41:55 | 72,473,767 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ua.kpi.mobiledev.service;
import ua.kpi.mobiledev.domain.District;
import java.util.Optional;
public interface DistrictService {
Optional<District> get(String districtName, String cityName);
}
| UTF-8 | Java | 208 | java | DistrictService.java | Java | [] | null | [] | package ua.kpi.mobiledev.service;
import ua.kpi.mobiledev.domain.District;
import java.util.Optional;
public interface DistrictService {
Optional<District> get(String districtName, String cityName);
}
| 208 | 0.793269 | 0.793269 | 9 | 22.111111 | 21.97698 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.555556 | false | false | 2 |
2d296ccecba034f950d29330b05feba5373dd7f6 | 26,474,178,467,470 | a4da2046b2f131cb84c296e5589eeb246ab8cad1 | /MusicSearchApp/app/src/main/java/com/example/mypc/musicsearchapp/TrackDetails.java | 485d5593a5fba6e096428215a83918fe98ca8e9c | [] | no_license | VishakLakshman/MobileApplications | https://github.com/VishakLakshman/MobileApplications | 972712cce6f05cb092996d8f339da967eb441b3d | c7f1ec793438d5174bec221c4dfe49c9f4384d95 | refs/heads/master | 2020-03-28T00:32:31.115000 | 2018-09-04T22:28:00 | 2018-09-04T22:28:00 | 147,427,404 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.mypc.musicsearchapp;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.util.Linkify;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
public class TrackDetails extends AppCompatActivity {
Song selectedSong;
TextView songNameSelected, songArtistSelected, songURLSelected;
ListView simialrsongsLV;
ArrayList<Song> similarsongList;
CustomAdapter custom;
final static String SIMILAR_URL_START = "http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=";
final static String SIMILAR_URL_MID = "&track=";
final static String SIMILAR_URL_END = "&api_key=d7222ab1d0e1cbbf173abdce8c51244d&format=json &limit=10";
StringBuffer similarSongSearchUrl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_track_details);
songNameSelected = (TextView) findViewById(R.id.textViewNameDetail);
songArtistSelected = (TextView) findViewById(R.id.textViewArtistDetail);
songURLSelected = (TextView) findViewById(R.id.textViewUrlDetail);
simialrsongsLV = (ListView) findViewById(R.id.listViewSimilar);
Linkify.addLinks(songURLSelected,Linkify.WEB_URLS);
similarSongSearchUrl = new StringBuffer();
if (getIntent().getExtras() != null) {
selectedSong = (Song) getIntent().getExtras().getSerializable(SearchResults.SELECTED_SONG_KEY);
similarSongSearchUrl.append(TrackDetails.SIMILAR_URL_START);
similarSongSearchUrl.append(selectedSong.getArtist());
similarSongSearchUrl.append(TrackDetails.SIMILAR_URL_MID);
similarSongSearchUrl.append(selectedSong.getName());
similarSongSearchUrl.append(TrackDetails.SIMILAR_URL_END);
}
songNameSelected.setText(selectedSong.getName());
songArtistSelected.setText(selectedSong.getArtist());
songURLSelected.setText(selectedSong.getSongURL());
try {
new GetImage(TrackDetails.this).execute(selectedSong.getLargeImageURL());
similarsongList = new GetMusicData(TrackDetails.this).execute(similarSongSearchUrl.toString()).get();
custom = new CustomAdapter(TrackDetails.this,similarsongList,0);
simialrsongsLV.setAdapter(custom);
}
catch (Exception e)
{
Log.e("ex",e.getMessage());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.activity_main_action, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Take appropriate action for each action item click
switch (item.getItemId()) {
case R.id.action_home:
Intent i = new Intent(this,MainActivity.class);
startActivity(i);
return true;
case R.id.action_quit:
Intent intent = new Intent(this,MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("EXIT", true);
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
| UTF-8 | Java | 3,670 | java | TrackDetails.java | Java | [
{
"context": " final static String SIMILAR_URL_END = \"&api_key=d7222ab1d0e1cbbf173abdce8c51244d&format=json &limit=10\";\n\n StringBuffer similar",
"end": 925,
"score": 0.9997418522834778,
"start": 893,
"tag": "KEY",
"value": "d7222ab1d0e1cbbf173abdce8c51244d"
}
] | null | [] | package com.example.mypc.musicsearchapp;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.util.Linkify;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
public class TrackDetails extends AppCompatActivity {
Song selectedSong;
TextView songNameSelected, songArtistSelected, songURLSelected;
ListView simialrsongsLV;
ArrayList<Song> similarsongList;
CustomAdapter custom;
final static String SIMILAR_URL_START = "http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=";
final static String SIMILAR_URL_MID = "&track=";
final static String SIMILAR_URL_END = "&api_key=<KEY>&format=json &limit=10";
StringBuffer similarSongSearchUrl;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_track_details);
songNameSelected = (TextView) findViewById(R.id.textViewNameDetail);
songArtistSelected = (TextView) findViewById(R.id.textViewArtistDetail);
songURLSelected = (TextView) findViewById(R.id.textViewUrlDetail);
simialrsongsLV = (ListView) findViewById(R.id.listViewSimilar);
Linkify.addLinks(songURLSelected,Linkify.WEB_URLS);
similarSongSearchUrl = new StringBuffer();
if (getIntent().getExtras() != null) {
selectedSong = (Song) getIntent().getExtras().getSerializable(SearchResults.SELECTED_SONG_KEY);
similarSongSearchUrl.append(TrackDetails.SIMILAR_URL_START);
similarSongSearchUrl.append(selectedSong.getArtist());
similarSongSearchUrl.append(TrackDetails.SIMILAR_URL_MID);
similarSongSearchUrl.append(selectedSong.getName());
similarSongSearchUrl.append(TrackDetails.SIMILAR_URL_END);
}
songNameSelected.setText(selectedSong.getName());
songArtistSelected.setText(selectedSong.getArtist());
songURLSelected.setText(selectedSong.getSongURL());
try {
new GetImage(TrackDetails.this).execute(selectedSong.getLargeImageURL());
similarsongList = new GetMusicData(TrackDetails.this).execute(similarSongSearchUrl.toString()).get();
custom = new CustomAdapter(TrackDetails.this,similarsongList,0);
simialrsongsLV.setAdapter(custom);
}
catch (Exception e)
{
Log.e("ex",e.getMessage());
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.activity_main_action, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Take appropriate action for each action item click
switch (item.getItemId()) {
case R.id.action_home:
Intent i = new Intent(this,MainActivity.class);
startActivity(i);
return true;
case R.id.action_quit:
Intent intent = new Intent(this,MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra("EXIT", true);
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}
| 3,643 | 0.682289 | 0.676022 | 102 | 34.980392 | 29.293304 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.647059 | false | false | 2 |
cb870562f9afd23487301a09c78ec8bbbb5bc0ac | 29,351,806,525,472 | b5ec8a2f77753577badfcd3ba144b4119dc6c196 | /StoreCenter/src/main/java/com/icss/newretail/user/entity/BillingOrderShip.java | 4bc2a33478a92e7cd59b32dba78fa77d86ee11d9 | [] | no_license | shiyinghao/changkelai | https://github.com/shiyinghao/changkelai | 9dfaea755a74908874f6921171f046c44b22d781 | 5072e075d28742c1f426039043c41f12eb9caac7 | refs/heads/master | 2022-12-31T02:31:55.989000 | 2020-10-23T03:34:17 | 2020-10-23T03:34:17 | 295,289,769 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.icss.newretail.user.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 店铺开票对应的订单
* </p>
*
* @author zhangzhijia
* @since 2020-05-26
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_user_store_billing_order_ship")
@ApiModel(value="BillingOrderShip对象", description="店铺开票对应的订单")
public class BillingOrderShip implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId("uuid")
private String uuid;
@ApiModelProperty(value = "开票ID")
@TableField("bill_id")
private String billId;
@ApiModelProperty(value = "订单ID")
@TableField("order_id")
private String orderId;
@ApiModelProperty(value = "订单编号")
@TableField("order_no")
private String orderNo;
}
| UTF-8 | Java | 1,214 | java | BillingOrderShip.java | Java | [
{
"context": "rs;\n\n/**\n * <p>\n * 店铺开票对应的订单\n * </p>\n *\n * @author zhangzhijia\n * @since 2020-05-26\n */\n@Data\n@EqualsAndHashCode",
"end": 468,
"score": 0.9987365007400513,
"start": 457,
"tag": "USERNAME",
"value": "zhangzhijia"
}
] | null | [] | package com.icss.newretail.user.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 店铺开票对应的订单
* </p>
*
* @author zhangzhijia
* @since 2020-05-26
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_user_store_billing_order_ship")
@ApiModel(value="BillingOrderShip对象", description="店铺开票对应的订单")
public class BillingOrderShip implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键ID")
@TableId("uuid")
private String uuid;
@ApiModelProperty(value = "开票ID")
@TableField("bill_id")
private String billId;
@ApiModelProperty(value = "订单ID")
@TableField("order_id")
private String orderId;
@ApiModelProperty(value = "订单编号")
@TableField("order_no")
private String orderNo;
}
| 1,214 | 0.742634 | 0.734835 | 47 | 23.553192 | 18.717165 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.340426 | false | false | 2 |
b8fc5679bc8cc7caa843584525766b4164eef299 | 558,345,782,457 | ceac97dec8e42e2aa89499cb7d0e88d3e5a828c3 | /app/src/main/java/com/josecalles/porridge/group/invite/GroupInviteAdapter.java | 2d380e9ceeece7037c37350ffef4b64ab4b091c2 | [
"Apache-2.0"
] | permissive | josecalles/Porridge | https://github.com/josecalles/Porridge | 2bf1e35376e09de68019f538f72114709efdcb08 | 8f5fca369ee2aada0665f726b28d41c42527696d | refs/heads/master | 2018-01-09T17:13:15.551000 | 2016-04-07T20:55:05 | 2016-04-07T20:55:05 | 49,552,995 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.josecalles.porridge.group.invite;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import com.josecalles.porridge.R;
import com.josecalles.porridge.util.TimeHolder;
import com.josecalles.porridge.util.TimeUtil;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
public class GroupInviteAdapter extends RecyclerView.Adapter<GroupInviteAdapter.TimeView> {
private List<TimeHolder> mTimeHolderList = new ArrayList<>();
private GroupInviteActivity mGroupInviteActivity;
private Calendar mCalendar;
public GroupInviteAdapter(GroupInviteActivity groupInviteActivity) {
mGroupInviteActivity = groupInviteActivity;
mCalendar = Calendar.getInstance();
}
@Override
public GroupInviteAdapter.TimeView onCreateViewHolder(ViewGroup parent, int viewType) {
return new TimeView(LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_invite_time_text, parent, false));
}
@Override
public void onBindViewHolder(GroupInviteAdapter.TimeView timeView, int position) {
TimeHolder timeHolder = mTimeHolderList.get(position);
timeView.mDeleteButton.setOnClickListener(v -> {
mTimeHolderList.remove(timeHolder);
notifyItemRemoved(position);
});
try {
timeView.mDayText.setText(
TimeUtil.getFullDateString(timeHolder.getYear(), timeHolder.getMonth(),
timeHolder.getDay()));
} catch (ParseException e) {
e.printStackTrace();
}
timeView.mTimeText.setText(
TimeUtil.get12HourTime(timeHolder.getHour(), timeHolder.getMinute()));
}
public void addNewTimeToList(int year, int month, int day, int hour, int minute) {
TimeHolder timeHolder = new TimeHolder(year, ++month, day, hour, minute);
mTimeHolderList.add(timeHolder);
notifyItemInserted(getItemCount());
}
@Override
public int getItemCount() {
return mTimeHolderList.size();
}
public static class TimeView extends RecyclerView.ViewHolder {
private TextView mDayText;
private TextView mTimeText;
private ImageButton mDeleteButton;
public TimeView(View itemView) {
super(itemView);
mDayText = (TextView) itemView.findViewById(R.id.day_text);
mTimeText = (TextView) itemView.findViewById(R.id.time_text);
mDeleteButton = (ImageButton) itemView.findViewById(R.id.delete_date_button);
}
}
public long[] getDateSelectedTimeStamps() {
long[] timeStamps = new long[getItemCount()];
for (int i = 0; i < mTimeHolderList.size(); i++) {
TimeHolder timeHolder = mTimeHolderList.get(i);
timeStamps[i] = TimeUtil.getTimeStampFromComponent(timeHolder.getYear(), timeHolder.getMonth(),
timeHolder.getDay(), timeHolder.getHour(), timeHolder.getDay());
}
return timeStamps;
}
}
| UTF-8 | Java | 3,025 | java | GroupInviteAdapter.java | Java | [] | null | [] | package com.josecalles.porridge.group.invite;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import com.josecalles.porridge.R;
import com.josecalles.porridge.util.TimeHolder;
import com.josecalles.porridge.util.TimeUtil;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
public class GroupInviteAdapter extends RecyclerView.Adapter<GroupInviteAdapter.TimeView> {
private List<TimeHolder> mTimeHolderList = new ArrayList<>();
private GroupInviteActivity mGroupInviteActivity;
private Calendar mCalendar;
public GroupInviteAdapter(GroupInviteActivity groupInviteActivity) {
mGroupInviteActivity = groupInviteActivity;
mCalendar = Calendar.getInstance();
}
@Override
public GroupInviteAdapter.TimeView onCreateViewHolder(ViewGroup parent, int viewType) {
return new TimeView(LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_invite_time_text, parent, false));
}
@Override
public void onBindViewHolder(GroupInviteAdapter.TimeView timeView, int position) {
TimeHolder timeHolder = mTimeHolderList.get(position);
timeView.mDeleteButton.setOnClickListener(v -> {
mTimeHolderList.remove(timeHolder);
notifyItemRemoved(position);
});
try {
timeView.mDayText.setText(
TimeUtil.getFullDateString(timeHolder.getYear(), timeHolder.getMonth(),
timeHolder.getDay()));
} catch (ParseException e) {
e.printStackTrace();
}
timeView.mTimeText.setText(
TimeUtil.get12HourTime(timeHolder.getHour(), timeHolder.getMinute()));
}
public void addNewTimeToList(int year, int month, int day, int hour, int minute) {
TimeHolder timeHolder = new TimeHolder(year, ++month, day, hour, minute);
mTimeHolderList.add(timeHolder);
notifyItemInserted(getItemCount());
}
@Override
public int getItemCount() {
return mTimeHolderList.size();
}
public static class TimeView extends RecyclerView.ViewHolder {
private TextView mDayText;
private TextView mTimeText;
private ImageButton mDeleteButton;
public TimeView(View itemView) {
super(itemView);
mDayText = (TextView) itemView.findViewById(R.id.day_text);
mTimeText = (TextView) itemView.findViewById(R.id.time_text);
mDeleteButton = (ImageButton) itemView.findViewById(R.id.delete_date_button);
}
}
public long[] getDateSelectedTimeStamps() {
long[] timeStamps = new long[getItemCount()];
for (int i = 0; i < mTimeHolderList.size(); i++) {
TimeHolder timeHolder = mTimeHolderList.get(i);
timeStamps[i] = TimeUtil.getTimeStampFromComponent(timeHolder.getYear(), timeHolder.getMonth(),
timeHolder.getDay(), timeHolder.getHour(), timeHolder.getDay());
}
return timeStamps;
}
}
| 3,025 | 0.726281 | 0.724959 | 89 | 32.988766 | 27.627333 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.707865 | false | false | 2 |
7b21209fa257773f44c2466526dac21008d591f5 | 25,967,372,304,312 | 654f69105fd0fb9f1e0c69cc55aa430620837231 | /app/src/main/java/ll/peekabuytest/models/Look.java | 1e2332dd67b1ade91996f7b9fbc44219360bc8d5 | [] | no_license | LLin233/PeekabuyTest | https://github.com/LLin233/PeekabuyTest | d3674dde90e2d0b9ac47921d8f5d3fc937235e39 | 8dd997f05b9a5d33c4732f141f1b564acc79182d | refs/heads/master | 2021-01-10T16:50:26.290000 | 2016-03-13T01:35:43 | 2016-03-13T01:35:43 | 53,462,742 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ll.peekabuytest.models;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Le on 2016/3/8.
*/
public class Look {
public String creator_profile_picture_url;
public String description;
public List<Object> tags = new ArrayList<Object>();
public String timestamp;
public int num_saves;
public List<String> image_urls = new ArrayList<String>();
public String hashcode;
public String thumbnail_url;
public int num_likes;
public int thumbnail_width;
public Object item_info;
public int thumbnail_height;
public String creator_username;
public String id;
public List<InspirationLook> inspiration_looks = new ArrayList<InspirationLook>();
public String linkback_url;
public List<Product> products = new ArrayList<Product>();
public String creator_name;
public int num_comments;
public Creator creator;
public int image_width;
public List<Object> taggings = new ArrayList<Object>();
public Object inputs_info;
public int image_height;
public String image_url;
public int promotion_status;
public int type;
@Override
public String toString() {
return "Look{" +
"creatorProfilePictureUrl='" + creator_profile_picture_url + '\'' +
", inspirationLooks=" + inspiration_looks +
", products=" + products +
", id='" + id + '\'' +
", thumbnailUrl='" + thumbnail_url + '\'' +
'}';
}
}
| UTF-8 | Java | 1,520 | java | Look.java | Java | [] | null | [] | package ll.peekabuytest.models;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Le on 2016/3/8.
*/
public class Look {
public String creator_profile_picture_url;
public String description;
public List<Object> tags = new ArrayList<Object>();
public String timestamp;
public int num_saves;
public List<String> image_urls = new ArrayList<String>();
public String hashcode;
public String thumbnail_url;
public int num_likes;
public int thumbnail_width;
public Object item_info;
public int thumbnail_height;
public String creator_username;
public String id;
public List<InspirationLook> inspiration_looks = new ArrayList<InspirationLook>();
public String linkback_url;
public List<Product> products = new ArrayList<Product>();
public String creator_name;
public int num_comments;
public Creator creator;
public int image_width;
public List<Object> taggings = new ArrayList<Object>();
public Object inputs_info;
public int image_height;
public String image_url;
public int promotion_status;
public int type;
@Override
public String toString() {
return "Look{" +
"creatorProfilePictureUrl='" + creator_profile_picture_url + '\'' +
", inspirationLooks=" + inspiration_looks +
", products=" + products +
", id='" + id + '\'' +
", thumbnailUrl='" + thumbnail_url + '\'' +
'}';
}
}
| 1,520 | 0.6375 | 0.633553 | 48 | 30.666666 | 19.37603 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.729167 | false | false | 2 |
7ae807aace09da4bb9297acec368c4a693039f15 | 25,967,372,304,305 | 71ea700a173bf1cd6c2042510eb647d33c708893 | /src/test/java/uk/gov/companieshouse/orders/api/converter/EnumValueConverterTest.java | 405ff42241da28237138b44a80fbb137f7876e3f | [
"MIT"
] | permissive | companieshouse/orders.api.ch.gov.uk | https://github.com/companieshouse/orders.api.ch.gov.uk | 0dd9aae77cfb199d373a284dc27747cea551c601 | d69bf9e7e9529ed1f9c2a6392009f1db4df4726b | refs/heads/master | 2023-08-15T14:11:01.767000 | 2023-07-27T15:15:35 | 2023-07-27T15:15:35 | 231,348,339 | 0 | 1 | MIT | false | 2022-11-29T16:25:40 | 2020-01-02T09:23:51 | 2021-12-21T15:14:54 | 2022-11-29T16:25:40 | 1,814 | 0 | 1 | 3 | Java | false | false | package uk.gov.companieshouse.orders.api.converter;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertEquals;
public class EnumValueConverterTest {
enum COLOUR {
RED,
YELLOW,
BABY_BLUE
}
@Test
public void successfullyConvertsEnumsToKebabAndLowerCase() {
assertEquals("baby-blue", EnumValueNameConverter.convertEnumValueNameToJson(COLOUR.BABY_BLUE));
assertEquals("red", EnumValueNameConverter.convertEnumValueNameToJson(COLOUR.RED));
assertEquals("yellow", EnumValueNameConverter.convertEnumValueNameToJson(COLOUR.YELLOW));
}
@Test
public void successfullyConvertsKebabAndLowerCaseToEnum() {
assertEquals(COLOUR.BABY_BLUE.toString(), EnumValueNameConverter.convertEnumValueJsonToName("baby-blue"));
assertEquals(COLOUR.RED.toString(), EnumValueNameConverter.convertEnumValueJsonToName("red"));
assertEquals(COLOUR.YELLOW.toString(), EnumValueNameConverter.convertEnumValueJsonToName("yellow"));
}
}
| UTF-8 | Java | 1,033 | java | EnumValueConverterTest.java | Java | [] | null | [] | package uk.gov.companieshouse.orders.api.converter;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertEquals;
public class EnumValueConverterTest {
enum COLOUR {
RED,
YELLOW,
BABY_BLUE
}
@Test
public void successfullyConvertsEnumsToKebabAndLowerCase() {
assertEquals("baby-blue", EnumValueNameConverter.convertEnumValueNameToJson(COLOUR.BABY_BLUE));
assertEquals("red", EnumValueNameConverter.convertEnumValueNameToJson(COLOUR.RED));
assertEquals("yellow", EnumValueNameConverter.convertEnumValueNameToJson(COLOUR.YELLOW));
}
@Test
public void successfullyConvertsKebabAndLowerCaseToEnum() {
assertEquals(COLOUR.BABY_BLUE.toString(), EnumValueNameConverter.convertEnumValueJsonToName("baby-blue"));
assertEquals(COLOUR.RED.toString(), EnumValueNameConverter.convertEnumValueJsonToName("red"));
assertEquals(COLOUR.YELLOW.toString(), EnumValueNameConverter.convertEnumValueJsonToName("yellow"));
}
}
| 1,033 | 0.748306 | 0.748306 | 30 | 33.433334 | 39.217922 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.566667 | false | false | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.