blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2
values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 9.45M | extension stringclasses 28
values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
83dfbfeaeda4ba51f273a66bc59cf6311c788b1d | 101b7946cbca09f705bbf8da3adf31153e0c6e13 | /src/main/java/com/alalshow/book/springboot/web/dto/HelloResponseDto.java | f72965aa7d570f0705fa3158dcf68441334a0390 | [] | no_license | alalshow/SpringBoot2WebService | 60378558af19404682529cff9b3f176875309c1c | 433c729c1e3c9fb96b53e77def15c7a57c269a35 | refs/heads/master | 2023-06-11T23:59:25.767381 | 2021-06-30T01:12:17 | 2021-06-30T01:12:17 | 373,055,218 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | package com.alalshow.book.springboot.web.dto;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public class HelloResponseDto {
private final String name;
private final int amount;
}
| [
"alalshow@hanmail.net"
] | alalshow@hanmail.net |
42cd6d292ff4fc0f8f9019aacb15b78fb8e42545 | b4fedeef35732263e2327e8c1d6465a97c924d6d | /app/constants/Constants.java | 22fce536cf8f19f32b9b2beb7c9d39d9112bec7e | [
"Apache-2.0"
] | permissive | maruen/WALLMART-EXAM | d4c4ac1db442a41612deae566de9de0b6e2e0f18 | da06923cd156714a06938b3b455fecfd94ae45e1 | refs/heads/master | 2021-01-10T07:16:55.350067 | 2016-03-10T03:18:03 | 2016-03-10T03:18:03 | 53,417,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 111 | java | package constants;
public class Constants {
public static String WALLMART_HOME = "WALLMART_HOME";
}
| [
"maruen@gmail.com"
] | maruen@gmail.com |
c8b9807adaab3646cc7159368b47fbf693b62bdd | 91a5914937c4c0d5b06c38905bc428cd4701823c | /homework/Homeworks/Homeworks_JPA/src/entity/Role.java | 25a82dc2630be9b5421ad0490586a2c48ee598b8 | [] | no_license | emengjzs/emengjzs | 7e26c0ccdd2c7f63647338a09deff7658d3d2eae | 940457ccf5f089d0f33267508630faf5dc046351 | refs/heads/master | 2021-01-19T01:51:30.299190 | 2016-11-27T11:02:09 | 2016-11-27T11:02:09 | 19,150,508 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 686 | java | package entity;
public enum Role {
DEFAULT("default"),
ADMIN("admin"),
STUDENT("student"),
TEACHER("teacher"),
TUITOR("tuitor"),
CHARGE("charge"),
PRIME("prime");
private static String[] info = {"无", "系统管理员", "学生", "教师", "助教", "院系负责人", "总负责人"};
public static Role getInstance(String n) {
try {
return Role.valueOf(n.toUpperCase());
} catch (Exception e) {return Role.DEFAULT;}
}
private Role(String str) {
this.setStr(str);
}
public String getInfo() {
return info[this.ordinal()];
}
public String getStr() {
return str;
}
public void setStr(String str) {
this.str = str;
}
private String str;
}
| [
"emengjzs@163.com"
] | emengjzs@163.com |
accee9e25577e87c50107c60c57f46bf59a60f67 | 09542ece95df8b8ab442859650ef143d5927d9af | /src/main/java/ch/sama/db/data/DataContext.java | 1e723014296754a61c411981dde192f35643e9dd | [] | no_license | Phyrra/samadb | 352144d98ad9ded2261e3f1daa07954c2b979d3c | 1173661fee9e8a58b0c0315b445d359ddd0ddfd4 | refs/heads/master | 2021-01-01T15:27:39.786891 | 2017-07-22T08:16:46 | 2017-07-22T08:16:46 | 97,622,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,087 | java | package ch.sama.db.data;
import ch.sama.db.base.Table;
import java.util.*;
import java.util.stream.Collectors;
public class DataContext {
private Map<String, Map<String, Object>> knownAliases;
private List<Map<String, Map<String, Object>>> data;
public DataContext() {
knownAliases = new HashMap<>();
data = new ArrayList<>();
}
public DataContext(Map<String, Map<String, Object>> knownAliases, List<Map<String, Map<String, Object>>> data) {
this.knownAliases = knownAliases;
this.data = data;
}
public void registerAlias(String alias, Table table) {
if (knownAliases.containsKey(alias)) {
throw new DuplicateAliasException(alias);
}
Map<String, Object> empty = new HashMap<>();
table.getFields().forEach(field -> empty.put(field.getName(), null));
knownAliases.put(alias, empty);
}
public DataContext addRow(Map<String, Map<String, Object>> row) {
data.add(row);
return this;
}
public List<Map<String, Map<String, Object>>> getData() {
return data;
}
public Map<String, Map<String, Object>> getKnownAliases() {
return knownAliases;
}
public DataContext fill() {
data.forEach(row -> {
knownAliases.keySet().stream()
.filter(alias -> !row.containsKey(alias))
.forEach(alias -> {
row.put(alias, knownAliases.get(alias));
});
});
return this;
}
public List<List<Tupel>> getFlattened() {
return data.stream()
.map(all -> {
List<Tupel> list = new ArrayList<>();
all.values()
.forEach(map -> {
map.keySet()
.forEach(key -> {
list.add(new Tupel(key, map.get(key)));
});
});
return list;
})
.collect(Collectors.toList());
}
}
| [
""
] | |
6d2a36c3d756bc2f5fe430598187130812fea76f | dc35416288feb0e413be2417b2bc57c453e9ff71 | /src/main/java/com/myjava/ocp/lab13/RiceDemo.java | 6a859fa735f4fe51cb43b2e864e05dce9091deab | [] | no_license | JamieChang1118/Java-OCPJP-20200420 | 0fa8c7c9ed6ea9e26d4ea2736d5c0c53eaa22633 | 6090fd40d1e37a6ca571effd57038d2e2547a085 | refs/heads/master | 2023-05-13T02:36:56.011722 | 2021-06-07T08:47:14 | 2021-06-07T08:47:14 | 345,614,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,376 | java | package com.myjava.ocp.lab13;
import com.google.gson.Gson;
import java.io.File;
import java.net.URL;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
public class RiceDemo {
public static void main(String[] args) throws Exception {
List<Rice> list = new LinkedList<>();
File file = new File("src\\main\\java\\com\\myjava\\ocp\\lab13\\urls.txt");
String urls = new Scanner(file).useDelimiter("\\A").next();
for(String urlstring : urls.split("\n")) {
addData(urlstring.trim(), list);
}
// 3. 分析
list.stream()
.filter(rice -> rice.品名.contains("外銷日本的米"))
.forEach(rice -> System.out.printf("%s %s %s %s %s\n", rice.品名, rice.國際條碼, rice.檢驗結果, rice.Title, rice.不合格原因));
}
private static void addData(String urlpath, List list) throws Exception {
// 1. 抓取資料源
URL url = new URL(urlpath);
String jsonstring = new Scanner(url.openStream(), "UTF-8").useDelimiter("\\A").next();
// 2. 將 json 透過 Gson 轉成 BadRice[]
Rice[] rices = new Gson().fromJson(jsonstring, Rice[].class);
// 將 rices 加入到 list 容器
Collections.addAll(list, rices);
}
}
| [
"boddy@DESKTOP-DLSUEFA"
] | boddy@DESKTOP-DLSUEFA |
224f446885b055fcdc94a00cca3d1a81165e968f | 3557f5c68156ad04ee7a5c51ba7948eea64a7ee7 | /TVApp/src/main/java/org/suirui/huijian/tv/util/WifiAdmin.java | 3f46959303e0564b98769b005d49a4649121324b | [] | no_license | joy-cui/VideoMeetingProject | 98dcc900da92173b64362013a5b44bbe49254c46 | 2672951d38f81b04960cc782417d55fb2907fcdf | refs/heads/master | 2020-03-25T01:27:21.996554 | 2018-08-02T04:12:35 | 2018-08-02T04:12:35 | 143,238,886 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,583 | java | package org.suirui.huijian.tv.util;
import android.content.Context;
import android.net.DhcpInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiManager.WifiLock;
import android.os.Build;
import android.text.TextUtils;
import com.suirui.srpaas.base.util.log.SRLog;
import org.suirui.huijian.tv.TVAppConfigure;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
public class WifiAdmin {
private static final SRLog log = new SRLog(WifiAdmin.class.getName(), TVAppConfigure.LOG_LEVE);
// 定义一个WifiLock
WifiLock mWifiLock;
// 定义WifiManager对象
private WifiManager mWifiManager;
// 定义WifiInfo对象
private WifiInfo mWifiInfo;
// 扫描出的网络连接列表
private List<ScanResult> mWifiList;
// 网络连接列表
private List<WifiConfiguration> mWifiConfiguration;
private List<ScanResult> newWifiList = new ArrayList<ScanResult>();// 过滤后的我ifi列表
private DhcpInfo mDhcpInfo;
private Context mContext;
// 构造器
public WifiAdmin(Context context) {
mContext = context;
// 取得WifiManager对象
mWifiManager = (WifiManager) context
.getSystemService(Context.WIFI_SERVICE);
// 取得WifiInfo对象
mWifiInfo = mWifiManager.getConnectionInfo();
//获取dhcp
mDhcpInfo = mWifiManager.getDhcpInfo();
}
public String getSSID() {
mWifiInfo = mWifiManager.getConnectionInfo();
return mWifiInfo.getSSID().replace("\"", "");
}
// 得到wifi信号强度
public int getLevel() {
return mWifiInfo.getRssi();
}
public int getGateway() {
mDhcpInfo = mWifiManager.getDhcpInfo();
return mDhcpInfo.gateway;
}
// 打开WIFI
public void openWifi() {
if (!mWifiManager.isWifiEnabled()) {
mWifiManager.setWifiEnabled(true);
}
}
// 关闭WIFI
public void closeWifi() {
if (mWifiManager.isWifiEnabled()) {
mWifiManager.setWifiEnabled(false);
}
}
public void updateNetWork(WifiConfiguration config) {
mWifiManager.updateNetwork(config);
}
/**
* 检查当前WIFI状态
*
* @return WIFI_STATE_ENABLED(3) 已启动 WIFI_STATE_ENABLING(2) 正在启动
* WIFI_STATE_DISABLING(0) 正在关闭 WIFI_STATE_DISABLED(1) 已关闭
* WIFI_STATE_UNKNOWN 未知
*/
public int checkState() {
return mWifiManager.getWifiState();
}
// 锁定WifiLock
public void acquireWifiLock() {
mWifiLock.acquire();
}
// 解锁WifiLock
public void releaseWifiLock() {
// 判断时候锁定
if (mWifiLock.isHeld()) {
mWifiLock.acquire();
}
}
// 创建一个WifiLock
public void creatWifiLock() {
mWifiLock = mWifiManager.createWifiLock("Test");
}
// 得到配置好的网络
public List<WifiConfiguration> getConfiguration() {
// if (mWifiConfiguration != null) {
// for (WifiConfiguration wifi : mWifiConfiguration) {
// log.E("WifiSetActivity.....wifi.networkId:" + wifi.networkId
// + " wifiName: " + wifi.SSID + " preSharedKey: "
// + wifi.preSharedKey);
// }
// }
return mWifiConfiguration;
}
// 指定配置好的网络进行连接
public boolean connectConfiguration(int index) {
// 连接配置好的指定ID的网络
boolean isConnect = mWifiManager.enableNetwork(index, true);
log.E("WifiSetActivity....enableNetwork...isConnect:" + isConnect);
return isConnect;
}
public void startScan() {
mWifiManager.startScan();
// 得到扫描结果
mWifiList = mWifiManager.getScanResults();
// 得到配置好的网络连接
mWifiConfiguration = mWifiManager.getConfiguredNetworks();
// if (mWifiConfiguration != null) {
// for (WifiConfiguration wifi : mWifiConfiguration) {
// log.E("WifiSetActivity.....wifi.networkId:" + wifi.networkId
// + " wifiName: " + wifi.SSID + " preSharedKey: "
// + wifi.preSharedKey);
// }
// }
}
// 得到网络列表
public List<ScanResult> getWifiList() {
// 过滤重复名称的wifi
List<ScanResult> newSr = new ArrayList<ScanResult>();
for (ScanResult result : mWifiList) {
if (!TextUtils.isEmpty(result.SSID)
&& !containName(newSr, result.SSID))
newSr.add(result);
}
newWifiList = newSr;
return newSr;
}
private boolean containName(List<ScanResult> sr, String name) {
for (ScanResult result : sr) {
if (!TextUtils.isEmpty(result.SSID) && result.SSID.equals(name))
return true;
}
return false;
}
// 查看扫描结果
public StringBuilder lookUpScan() {
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < newWifiList.size(); i++) {
stringBuilder
.append("Index_" + new Integer(i + 1).toString() + ":");
// 将ScanResult信息转换成一个字符串包
// 其中把包括:BSSID、SSID、capabilities、frequency、level
stringBuilder.append((newWifiList.get(i)).toString());
stringBuilder.append("/n");
}
return stringBuilder;
}
// 得到MAC地址
public String getMacAddress() {
return (mWifiInfo == null) ? "NULL" : mWifiInfo.getMacAddress();
}
// 得到接入点的BSSID
public String getBSSID() {
return (mWifiInfo == null) ? "NULL" : mWifiInfo.getBSSID();
}
// 得到IP地址
public int getIPAddress() {
return (mWifiInfo == null) ? 0 : mWifiInfo.getIpAddress();
}
// 得到连接的ID
public int getNetworkId() {
return (mWifiInfo == null) ? 0 : mWifiInfo.getNetworkId();
}
// 得到WifiInfo的所有信息包
public String getWifiInfo() {
return (mWifiInfo == null) ? "NULL" : mWifiInfo.toString();
}
public WifiInfo getWifiInfoObj() {
return mWifiInfo = mWifiManager.getConnectionInfo();
}
// 添加一个网络并连接
public int addNetwork(WifiConfiguration wcg) {
log.E(" wwwww addNetwork()");
int netID = -1;
boolean isScan = false;
openWifi();
if (!isScan && wcg != null) {
WifiConfiguration tempConfig = this.IsExsits(wcg.SSID);
if (tempConfig != null) {
mWifiManager.removeNetwork(tempConfig.networkId);
log.E(" wwwww addNetwork..移出之前的配置的信息");
}
netID = mWifiManager.addNetwork(wcg);
// for (WifiConfiguration c:getConfiguration()) {
// mWifiManager.disableNetwork(c.networkId);
// }
Method connectMethod = connectWifiByReflectMethod(netID);
if (connectMethod == null) {
log.E("wwwww addNetwork wifi by enableNetwork method");
// 通用API
boolean enable = mWifiManager.enableNetwork(netID, true);
// log.E("wwwww addNetwork wifi by enableNetwork method enable:"+enable);
}
}
return netID;
}
// wifi热点开关
public boolean createWifiApEnabled(Context context,String ssid,String pwd,boolean enabled) {
WifiManager manager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
if (enabled) { // disable WiFi in any case
//wifi和热点不能同时打开,所以打开热点的时候需要关闭wifi
// manager.setWifiEnabled(false);
}
try {
Method method = manager.getClass().getMethod(
"setWifiApEnabled", WifiConfiguration.class, Boolean.TYPE);
boolean shut = (Boolean) method.invoke(manager, null, false);
//热点的配置类
WifiConfiguration tempConfig = IsExsits(ssid);
if (tempConfig != null) {
mWifiManager.removeNetwork(tempConfig.networkId);
}
WifiConfiguration apConfig = createWifiAPInfo(ssid,pwd,2);
//返回热点打开状态
boolean isOPen = (Boolean) method.invoke(manager, apConfig, enabled);
return isOPen;
} catch (Exception e) {
return false;
}
}
public int connectNetwork(String wifiName, String password, int lockedType) {
log.E("connectNetwork():..当前连接的wifi .:");
int netId = -1;
// log.E("connectNetwork():..当前连接的wifi .getNetworkId():"+getNetworkId());
// if (getNetworkId() != -1){
// log.D("connectNetwork():................disconnectWifi()");
// disconnectWifi(getNetworkId());
// }
WifiConfiguration config = CreateWifiInfo(wifiName, password, lockedType);
log.E("connectNetwork():................config:" + config + "...wifiName:"
+ wifiName + " password:" + password + " lockedType:"+lockedType);
if (config == null) {
return -1;
}
netId = addNetwork(config);
return netId;
}
public boolean enableNetwork(int wcgID) {
boolean b = mWifiManager.enableNetwork(wcgID, true);
return b;
}
// 断开指定ID的网络
public void disconnectWifi(int netid) {
mWifiManager.disableNetwork(netid);
mWifiManager.disconnect();
}
public WifiConfiguration createWifiAPInfo(String SSID, String password, int type) {
WifiConfiguration config = null;
if (config == null) {
config = new WifiConfiguration();
}
config.allowedAuthAlgorithms.clear();
config.allowedGroupCiphers.clear();
config.allowedKeyManagement.clear();
config.allowedPairwiseCiphers.clear();
config.allowedProtocols.clear();
config.SSID = SSID;
// 分为三种情况:0没有密码1用wep加密2用wpa加密
if (type == 0) {// WIFICIPHER_NOPASSwifiCong.hiddenSSID = false;
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
} else if (type == 1) { // WIFICIPHER_WEP
config.hiddenSSID = true;
config.wepKeys[0] = password;
config.allowedAuthAlgorithms
.set(WifiConfiguration.AuthAlgorithm.SHARED);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
config.allowedGroupCiphers
.set(WifiConfiguration.GroupCipher.WEP104);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
config.wepTxKeyIndex = 0;
} else if (type == 2) { // WIFICIPHER_WPA
config.preSharedKey = password;
config.hiddenSSID = true;
config.allowedAuthAlgorithms
.set(WifiConfiguration.AuthAlgorithm.OPEN);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
config.allowedPairwiseCiphers
.set(WifiConfiguration.PairwiseCipher.TKIP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedPairwiseCiphers
.set(WifiConfiguration.PairwiseCipher.CCMP);
config.status = WifiConfiguration.Status.ENABLED;
}
return config;
}
public WifiConfiguration CreateWifiInfo(String SSID, String password, int type) {
WifiConfiguration config = null;
WifiManager mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
if (mWifiManager != null) {
List<WifiConfiguration> existingConfigs = mWifiManager.getConfiguredNetworks();
if(existingConfigs != null){
for (WifiConfiguration existingConfig : existingConfigs) {
if (existingConfig == null) continue;
if (existingConfig.SSID.equals("\"" + SSID + "\"") /*&& existingConfig.preSharedKey.equals("\"" + password + "\"")*/) {
config = existingConfig;
break;
}
}
}
}
if (config == null) {
config = new WifiConfiguration();
}
config.allowedAuthAlgorithms.clear();
config.allowedGroupCiphers.clear();
config.allowedKeyManagement.clear();
config.allowedPairwiseCiphers.clear();
config.allowedProtocols.clear();
config.SSID = "\"" + SSID + "\"";
// 分为三种情况:0没有密码1用wep加密2用wpa加密
if (type == 0) {// WIFICIPHER_NOPASSwifiCong.hiddenSSID = false;
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
} else if (type == 1) { // WIFICIPHER_WEP
config.hiddenSSID = true;
config.wepKeys[0] = "\"" + password + "\"";
config.allowedAuthAlgorithms
.set(WifiConfiguration.AuthAlgorithm.SHARED);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
config.allowedGroupCiphers
.set(WifiConfiguration.GroupCipher.WEP104);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
config.wepTxKeyIndex = 0;
} else if (type == 2) { // WIFICIPHER_WPA
config.preSharedKey = "\"" + password + "\"";
config.hiddenSSID = true;
config.allowedAuthAlgorithms
.set(WifiConfiguration.AuthAlgorithm.OPEN);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
config.allowedPairwiseCiphers
.set(WifiConfiguration.PairwiseCipher.TKIP);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
config.allowedPairwiseCiphers
.set(WifiConfiguration.PairwiseCipher.CCMP);
config.status = WifiConfiguration.Status.ENABLED;
}
return config;
}
public WifiConfiguration IsExsits(String SSID) {
List<WifiConfiguration> existingConfigs = mWifiManager
.getConfiguredNetworks();
if (existingConfigs != null) {
for (WifiConfiguration existingConfig : existingConfigs) {
log.E("existingConfig.SSID:"+existingConfig.SSID);
if (existingConfig.SSID.equals("\"" + SSID + "\"")) {
return existingConfig;
}
}
}else{
}
return null;
}
/**
* 通过反射出不同版本的connect方法来连接Wifi
*/
private Method connectWifiByReflectMethod(int netId) {
log.E("wwwww connectWifiByReflectMethod() sdk:" +Build.VERSION.SDK_INT);
Method connectMethod = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
log.E(" wwwww connectWifiByReflectMethod road 1");
// 反射方法: connect(int, listener) , 4.2 <= phone's android version
for (Method methodSub : mWifiManager.getClass()
.getDeclaredMethods()) {
if ("connect".equalsIgnoreCase(methodSub.getName())) {
Class<?>[] types = methodSub.getParameterTypes();
if (types != null && types.length > 0) {
if ("int".equalsIgnoreCase(types[0].getName())) {
connectMethod = methodSub;
}
}
}
}
if (connectMethod != null) {
try {
connectMethod.invoke(mWifiManager, netId, null);
} catch (Exception e) {
e.printStackTrace();
log.E( "wwwww connectWifiByReflectMethod Android "
+ Build.VERSION.SDK_INT + " error!");
return null;
}
}
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN) {
// 反射方法: connect(Channel c, int networkId, ActionListener listener)
// 暂时不处理4.1的情况 , 4.1 == phone's android version
log.E("wwwww connectWifiByReflectMethod road 2");
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
log.E("wwwww connectWifiByReflectMethod road 3");
// 反射方法:connectNetwork(int networkId) ,
// 4.0 <= phone's android version < 4.1
for (Method methodSub : mWifiManager.getClass()
.getDeclaredMethods()) {
if ("wwwww connectNetwork".equalsIgnoreCase(methodSub.getName())) {
Class<?>[] types = methodSub.getParameterTypes();
if (types != null && types.length > 0) {
if ("int".equalsIgnoreCase(types[0].getName())) {
connectMethod = methodSub;
}
}
}
}
if (connectMethod != null) {
try {
connectMethod.invoke(mWifiManager, netId);
} catch (Exception e) {
e.printStackTrace();
log.E("wwwww connectWifiByReflectMethod Android "
+ Build.VERSION.SDK_INT + " error!");
return null;
}
}
} else {
// < android 4.0
return null;
}
return connectMethod;
}
}
| [
"cui.li@suirui.com"
] | cui.li@suirui.com |
e6ebeab9608aee61a7759e497244a62336947bbe | 00ec829179b8ce59f4bd66760a270bc4d44c88d9 | /app/src/main/java/com/example/pet/chat/EmptyView.java | 860553575f8d6bfcbcbfc31ecc0ce30db61b8016 | [] | no_license | yangzhenhe111/ChongBao | 8500142feb4adf790a1ba8b1c723c1fee5cbe974 | 31fdce14c89acaa1b8dff14f2f3db4c9e4518145 | refs/heads/master | 2023-02-01T18:25:47.726233 | 2020-12-17T03:11:54 | 2020-12-17T03:11:54 | 317,221,897 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 572 | java | package com.example.pet.chat;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;
import com.example.pet.R;
public class EmptyView extends RelativeLayout {
public EmptyView(Context context) {
super(context);
initView(context);
}
public EmptyView(Context context, AttributeSet attrs) {
super(context, attrs);
initView(context);
}
private void initView(Context context) {
View.inflate(context, R.layout.empty_view, this);
}
}
| [
"1484771988@qq.com"
] | 1484771988@qq.com |
fa9f1363f82f4a98e225d4d019173dd8c198261a | f97d0ee4d8810fb60dee77b469ac4c91722291bc | /EditDistance.java | 6cd24e6170429dd66dcbfadaccabe55741669c80 | [] | no_license | innovateboliu/OJ | 1d7af6501e7d085f4b932bb484adc755dea355de | 38950d275059b74467453da411336b10d9449795 | refs/heads/master | 2016-09-08T01:37:47.998300 | 2014-03-27T04:51:47 | 2014-03-27T04:51:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,150 | java |
public class EditDistance {
public static void main(String[] args) {
EditDistance ins = new EditDistance();
System.out.println(ins.minDistance("mart", "karma"));
}
public int minDistance(String word1, String word2) {
int len1 = word1.length();
int len2 = word2.length();
if (len2 == 0) {
return len1;
}
if (len1 == 0) {
return len2;
}
int[][] arr = new int[2][len2];
for (int i = 0; i < len1; i++) {
for (int j = 0; j < len2; j++) {
if (word1.charAt(i) == word2.charAt(j) ) {
if (j == 0) {
arr[(i+1)%2][j] = i;
continue;
}
if (i == 0) {
arr[(i+1)%2][j] = j;
continue;
}
arr[(i+1)%2][j] = arr[i%2][j-1];
} else if (word1.charAt(i) != word2.charAt(j) ) {
int a = (j==0? i : arr[(i+1)%2][j-1]);
int b = (i==0? j : arr[i%2][j]);
int c = Math.min(a, b);
if (j != 0 && i != 0) {
c = Math.min(c, arr[i%2][j-1]);
}
arr[(i+1)%2][j] = c + 1;
}
}
}
return arr[len1%2][len2 - 1];
}
}
| [
"wy90021@gmail.com"
] | wy90021@gmail.com |
ba9854f8bd23e340a7577a8147da32fab435c302 | 5ecd15baa833422572480fad3946e0e16a389000 | /framework/MCS-Open/subsystems/xdime/main/impl/java/com/volantis/mcs/xdime/widgets/BlockElement.java | 2e84331b0d64c39b90b2c18d0c18ebe971b29c09 | [] | no_license | jabley/volmobserverce | 4c5db36ef72c3bb7ef20fb81855e18e9b53823b9 | 6d760f27ac5917533eca6708f389ed9347c7016d | refs/heads/master | 2021-01-01T05:31:21.902535 | 2009-02-04T02:29:06 | 2009-02-04T02:29:06 | 38,675,289 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,677 | java | /*
This file is part of Volantis Mobility Server.
Volantis Mobility Server is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Volantis Mobility Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Volantis Mobility Server. If not, see <http://www.gnu.org/licenses/>.
*/
/* ----------------------------------------------------------------------------
* (c) Volantis Systems Ltd 2006.
* ----------------------------------------------------------------------------
*/
package com.volantis.mcs.xdime.widgets;
import com.volantis.mcs.protocols.widgets.attributes.BlockAttributes;
import com.volantis.mcs.protocols.widgets.attributes.FetchAttributes;
import com.volantis.mcs.protocols.widgets.attributes.LoadAttributes;
import com.volantis.mcs.protocols.widgets.attributes.RefreshAttributes;
import com.volantis.mcs.xdime.XDIMEAttributes;
import com.volantis.mcs.xdime.XDIMEContextInternal;
import com.volantis.mcs.xdime.XDIMEResult;
/**
* Presenter XDIME element.
*/
public class BlockElement extends WidgetElement implements Fetchable, Refreshable, Loadable {
/**
* Creates and initialises new instance of Container element.
* @param context
*/
public BlockElement(XDIMEContextInternal context) {
// Initialise superclass.
super(WidgetElements.BLOCK, context);
// Create an instance of Container attributes.
// It'll be initialised later in initialiseAttributes() method.
protocolAttributes = new BlockAttributes();
}
// Javadoc inherited
public void setFetchAttributes(FetchAttributes attrs) {
getBlockAttributes().setFetchAttributes(attrs);
}
// Javadoc inherited
public void setLoadAttributes(LoadAttributes attrs) {
getBlockAttributes().setLoadAttributes(attrs);
}
// Javadoc inherited
public void setRefreshAttributes(RefreshAttributes attrs) {
getBlockAttributes().setRefreshAttributes(attrs);
}
public BlockAttributes getBlockAttributes() {
return ((BlockAttributes) protocolAttributes);
}
// Javadoc inherited
protected XDIMEResult doFallbackOpen(XDIMEContextInternal context, XDIMEAttributes attributes) {
return XDIMEResult.SKIP_ELEMENT_BODY;
}
}
| [
"iwilloug@b642a0b7-b348-0410-9912-e4a34d632523"
] | iwilloug@b642a0b7-b348-0410-9912-e4a34d632523 |
fdaea9bd97e67cf9f3ad33652a8d239ad8f4416a | 59e99fc65a312fbc09115d22b970ad353257649a | /src/main/java/com/lixiaolei/controller/BookController.java | 3e1c82c7a5ac83ae7bed3c0f7d7c1aa6851f9738 | [] | no_license | lxlllxll/jenkinsgit | 521294622b153afd0d2855878e7a273fcc0778c1 | 917ef2ec5f891724bdb34933f89559665303e069 | refs/heads/master | 2020-04-16T19:07:33.822753 | 2019-01-15T14:11:58 | 2019-01-15T14:11:58 | 165,847,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,296 | java | package com.lixiaolei.controller;
import com.lixiaolei.entity.Book;
import com.lixiaolei.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
@Controller
@RequestMapping("/book")
public class BookController {
@Autowired
private BookService service;
@RequestMapping("/showBook")
public String showBook(){
return "book";
}
@RequestMapping("/listBook")
@ResponseBody
public Map<String,Object> listBook(@RequestBody Map<String,Object> query){
return service.listBook(query);
}
@RequestMapping("/listBookType")
@ResponseBody
public Map<String,Object> listBookType(){
return service.listBookType();
}
@RequestMapping("/addBook")
@ResponseBody
public Map<String,Object> addBook(@RequestBody Book book){
return service.addBook(book);
}
@RequestMapping("/haveBookcode")
@ResponseBody
public Map<String,Object> haveBookcode(String bookcode){
return service.haveBookcode(bookcode);
}
}
| [
"513173717@qq.com"
] | 513173717@qq.com |
e82c0197c9bc120704bc304e24a73ef08b3a5887 | 0e6a91f2b63c04587ef6444f1c1c1d9a69790bff | /src/bracu/ac/bd/ocr/OcrResult.java | 9f39887614612ef1f8b1edaba6eeb22909abf208 | [] | no_license | Grohon/OCR | af627c03c7010cdb46da3d19f79a2a0804489675 | 48d9d12db6e3018a6e7a4793b301b6f67dba0df8 | refs/heads/master | 2021-01-10T17:41:20.510852 | 2015-12-16T17:51:15 | 2015-12-16T17:51:15 | 46,211,181 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,435 | java | /*
* Copyright 2011 Robert Theis
*
* 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 bracu.ac.bd.ocr;
import java.util.List;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Point;
import android.graphics.Rect;
/**
* Encapsulates the result of OCR.
*/
public class OcrResult {
private Bitmap bitmap;
private String text;
private int[] wordConfidences;
private int meanConfidence;
private List<Rect> regionBoundingBoxes;
private List<Rect> textlineBoundingBoxes;
private List<Rect> wordBoundingBoxes;
private List<Rect> stripBoundingBoxes;
private List<Rect> characterBoundingBoxes;
private long timestamp;
private long recognitionTimeRequired;
private Paint paint;
public OcrResult(Bitmap bitmap,
String text,
int[] wordConfidences,
int meanConfidence,
List<Rect> regionBoundingBoxes,
List<Rect> textlineBoundingBoxes,
List<Rect> wordBoundingBoxes,
List<Rect> stripBoundingBoxes,
List<Rect> characterBoundingBoxes,
long recognitionTimeRequired) {
this.bitmap = bitmap;
this.text = text;
this.wordConfidences = wordConfidences;
this.meanConfidence = meanConfidence;
this.regionBoundingBoxes = regionBoundingBoxes;
this.textlineBoundingBoxes = textlineBoundingBoxes;
this.wordBoundingBoxes = wordBoundingBoxes;
this.stripBoundingBoxes = stripBoundingBoxes;
this.characterBoundingBoxes = characterBoundingBoxes;
this.recognitionTimeRequired = recognitionTimeRequired;
this.timestamp = System.currentTimeMillis();
this.paint = new Paint();
}
public OcrResult() {
timestamp = System.currentTimeMillis();
this.paint = new Paint();
}
public Bitmap getBitmap() {
return getAnnotatedBitmap();
}
private Bitmap getAnnotatedBitmap() {
Canvas canvas = new Canvas(bitmap);
// Draw bounding boxes around each word
for (int i = 0; i < wordBoundingBoxes.size(); i++) {
paint.setAlpha(0xFF);
paint.setColor(0xFF00CCFF);
paint.setStyle(Style.STROKE);
paint.setStrokeWidth(2);
Rect r = wordBoundingBoxes.get(i);
canvas.drawRect(r, paint);
}
// // Draw bounding boxes around each character
// for (int i = 0; i < characterBoundingBoxes.size(); i++) {
// paint.setAlpha(0xA0);
// paint.setColor(0xFF00FF00);
// paint.setStyle(Style.STROKE);
// paint.setStrokeWidth(3);
// Rect r = characterBoundingBoxes.get(i);
// canvas.drawRect(r, paint);
// }
return bitmap;
}
public String getText() {
return text;
}
public int[] getWordConfidences() {
return wordConfidences;
}
public int getMeanConfidence() {
return meanConfidence;
}
public long getRecognitionTimeRequired() {
return recognitionTimeRequired;
}
public Point getBitmapDimensions() {
return new Point(bitmap.getWidth(), bitmap.getHeight());
}
public List<Rect> getRegionBoundingBoxes() {
return regionBoundingBoxes;
}
public List<Rect> getTextlineBoundingBoxes() {
return textlineBoundingBoxes;
}
public List<Rect> getWordBoundingBoxes() {
return wordBoundingBoxes;
}
public List<Rect> getStripBoundingBoxes() {
return stripBoundingBoxes;
}
public List<Rect> getCharacterBoundingBoxes() {
return characterBoundingBoxes;
}
public long getTimestamp() {
return timestamp;
}
public void setBitmap(Bitmap bitmap) {
this.bitmap = bitmap;
}
public void setText(String text) {
this.text = text;
}
public void setWordConfidences(int[] wordConfidences) {
this.wordConfidences = wordConfidences;
}
public void setMeanConfidence(int meanConfidence) {
this.meanConfidence = meanConfidence;
}
public void setRecognitionTimeRequired(long recognitionTimeRequired) {
this.recognitionTimeRequired = recognitionTimeRequired;
}
public void setRegionBoundingBoxes(List<Rect> regionBoundingBoxes) {
this.regionBoundingBoxes = regionBoundingBoxes;
}
public void setTextlineBoundingBoxes(List<Rect> textlineBoundingBoxes) {
this.textlineBoundingBoxes = textlineBoundingBoxes;
}
public void setWordBoundingBoxes(List<Rect> wordBoundingBoxes) {
this.wordBoundingBoxes = wordBoundingBoxes;
}
public void setStripBoundingBoxes(List<Rect> stripBoundingBoxes) {
this.stripBoundingBoxes = stripBoundingBoxes;
}
public void setCharacterBoundingBoxes(List<Rect> characterBoundingBoxes) {
this.characterBoundingBoxes = characterBoundingBoxes;
}
@Override
public String toString() {
return text + " " + meanConfidence + " " + recognitionTimeRequired + " " + timestamp;
}
}
| [
"abu.foysal07@gmail.com"
] | abu.foysal07@gmail.com |
ed1e0023fde442fec96443d7a468df56629c21ee | e7082b9ced051c1cdea1a8a21fcd6452ef9c4326 | /src/main/java/ru/makkov/profitCalculation/service/ProductService.java | 53b2a536a895cce72772733b0fddd1010a893c62 | [] | no_license | makkov/test_task-profit_calculation | a0b7a86168df5ae57dfd63bc1af6486458edcee1 | 781d3686bb9d7f139aadc5202d133d36133a1040 | refs/heads/master | 2020-05-14T09:53:16.718739 | 2019-04-16T19:30:53 | 2019-04-16T19:30:53 | 181,748,174 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 291 | java | package ru.makkov.profitCalculation.service;
public interface ProductService {
boolean purchaseProducts(String categoryName, String amount, String purchasePrice, String purchaseDate);
boolean demandProducts(String categoryName, String amount, String demandPrice, String demandDate);
}
| [
"maxim_86nva@mail.ru"
] | maxim_86nva@mail.ru |
366f9b22023a1f63228e8543f2ef15b273205786 | ae1684191402b90867eb812e3afd35cde0bb6032 | /Android App/ArduinoBT/app/src/main/java/com/car_control/car/carControl.java | 293bf19d6833de54a576d2cda38ab4f8afcc08bc | [] | no_license | THamza/Arduino-Car | 553996b399bfb3af83903df982eba35fe5cef117 | 12b4dc2b84aec9b67730a2056a05f71aef2fd8d0 | refs/heads/master | 2020-04-26T15:26:03.893692 | 2019-03-04T01:45:53 | 2019-03-04T01:45:53 | 173,646,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,030 | java | package com.car_control.car;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.Toast;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.os.AsyncTask;
import com.car_control.led.R;
import java.io.IOException;
import java.util.UUID;
public class carControl extends ActionBarActivity {
// Button btnOn, btnOff, btnDis;
Switch autoPilotSwitch;
Button forward, backward, left, right, Discnt, Abt;
String address = null;
private ProgressDialog progress;
BluetoothAdapter myBluetooth = null;
BluetoothSocket btSocket = null;
private boolean isBtConnected = false;
//SPP UUID. Look for it
static final UUID myUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Intent newint = getIntent();
address = newint.getStringExtra(DeviceList.EXTRA_ADDRESS); //receive the address of the bluetooth device
//view of the carControl
setContentView(R.layout.activity_car_control);
//call the widgets
forward = (Button)findViewById(R.id.forward_btn);
backward = (Button)findViewById(R.id.back_btn);
left = (Button)findViewById(R.id.left_btn);
right = (Button)findViewById(R.id.right_btn);
Discnt = (Button)findViewById(R.id.dis_btn);
Abt = (Button)findViewById(R.id.abt_btn);
autoPilotSwitch = (Switch)findViewById(R.id.autoPilotSwitch);
new ConnectBT().execute(); //Call the class to connect
//commands to be sent to bluetooth
autoPilotSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if(isChecked) {
Toast.makeText(getApplicationContext(), "Auto-Pilot Enabled", Toast.LENGTH_LONG).show();
//do stuff when Switch is ON
EnableAP();
} else {
Toast.makeText(getApplicationContext(), "Auto-Pilot Disabled", Toast.LENGTH_LONG).show();
//do stuff when Switch if OFF
DisableAP();
}
}
});
forward.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
goForward(); //method to turn on
}
});
left.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
goLeft(); //method to turn on
}
});
right.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
goRight(); //method to turn on
}
});
backward.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
goBackward(); //method to turn off
}
});
Discnt.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
Disconnect(); //close connection
}
});
}
private void Disconnect()
{
if (btSocket!=null) //If the btSocket is busy
{
try
{
btSocket.close(); //close connection
}
catch (IOException e)
{ msg("Error");}
}
finish(); //return to the first layout
}
private void goBackward()
{
if (btSocket!=null)
{
try
{
btSocket.getOutputStream().write("w".toString().getBytes());
}
catch (IOException e)
{
msg("Error");
}
}
}
private void EnableAP()
{
if (btSocket!=null)
{
try
{//TODO: Fix the problem of buffering the first character
btSocket.getOutputStream().write("n".toString().getBytes()); //no pilot
}
catch (IOException e)
{
msg("Error");
}
}
}
private void DisableAP()
{
if (btSocket!=null)
{
try
{//TODO: Fix the problem of buffering the first character
btSocket.getOutputStream().write("p".toString().getBytes()); //pilot
}
catch (IOException e)
{
msg("Error");
}
}
}
private void goForward()
{
if (btSocket!=null)
{
try
{
btSocket.getOutputStream().write("s".toString().getBytes());
}
catch (IOException e)
{
msg("Error");
}
}
}
private void goLeft()
{
if (btSocket!=null)
{
try
{
btSocket.getOutputStream().write("a".toString().getBytes());
}
catch (IOException e)
{
msg("Error");
}
}
}
private void goRight()
{
if (btSocket!=null)
{
try
{
btSocket.getOutputStream().write("d".toString().getBytes());
}
catch (IOException e)
{
msg("Error");
}
}
}
// fast way to call Toast
private void msg(String s)
{
Toast.makeText(getApplicationContext(),s,Toast.LENGTH_LONG).show();
}
public void about(View v)
{
if(v.getId() == R.id.abt_btn)
{
Intent i = new Intent(this, AboutActivity.class);
startActivity(i);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_car_control, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
private class ConnectBT extends AsyncTask<Void, Void, Void> // UI thread
{
private boolean ConnectSuccess = true; //if it's here, it's almost connected
@Override
protected void onPreExecute()
{
progress = ProgressDialog.show(carControl.this, "Connecting...", "Sbr chwiya"); //show a progress dialog
}
@Override
protected Void doInBackground(Void... devices) //while the progress dialog is shown, the connection is done in background
{
try
{
if (btSocket == null || !isBtConnected)
{
myBluetooth = BluetoothAdapter.getDefaultAdapter();//get the mobile bluetooth device
BluetoothDevice dispositivo = myBluetooth.getRemoteDevice(address);//connects to the device's address and checks if it's available
btSocket = dispositivo.createInsecureRfcommSocketToServiceRecord(myUUID);//create a RFCOMM (SPP) connection
BluetoothAdapter.getDefaultAdapter().cancelDiscovery();
btSocket.connect();//start connection
}
}
catch (IOException e)
{
ConnectSuccess = false;//if the try failed, you can check the exception here
}
return null;
}
@Override
protected void onPostExecute(Void result) //after the doInBackground, it checks if everything went fine
{
super.onPostExecute(result);
if (!ConnectSuccess)
{
msg("Connection Failed. Is it a SPP Bluetooth? Try again.");
finish();
}
else
{
msg("Connected.");
isBtConnected = true;
}
progress.dismiss();
}
}
}
| [
"touhs.hamza@gmail.com"
] | touhs.hamza@gmail.com |
1d9da3f492b0629b0c142440422411555443b7f4 | ec1607b3e0d47f0720ba9a154e4b6e959399f3c2 | /app/src/main/java/com/moringaschool/myrestaurants/util/SimpleItemTouchHelperCallback.java | 3330edc84252776a2899081883c92e7f3d55234d | [] | no_license | Esther-Moki/myrestaurants | 59e47a8bd9457a117b8b5d8b9967d5c2df52dc3f | 844841e9917c372a4d7a87b5e3d5313b23dc3430 | refs/heads/master | 2023-08-31T07:59:59.265322 | 2021-10-27T09:13:33 | 2021-10-27T09:13:33 | 419,299,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,829 | java | package com.moringaschool.myrestaurants.util;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;
public class SimpleItemTouchHelperCallback extends ItemTouchHelper.Callback {
private final ItemTouchHelperAdapter mAdapter;
// This constructor takes an ItemTouchHelperAdapter parameter. When implemented in
// FirebaseRestaurantListAdapter, the ItemTouchHelperAdapter instance will pass the gesture event back to the
// Firebase adapter where we will define what occurs when an item is moved or dismissed.
public SimpleItemTouchHelperCallback(ItemTouchHelperAdapter adapter) {
mAdapter = adapter;
}
// The method below informs the ItemTouchHelperAdapter that drag gestures are enabled.
// We could also disable drag gestures by returning 'false'.
@Override
public boolean isLongPressDragEnabled() {
return true;
}
// The method below informs the ItemTouchHelperAdapter that swipe gestures are enabled.
// We could also disable them by returning 'false'.
@Override
public boolean isItemViewSwipeEnabled() {
return true;
}
// getMovementFlags informs the ItemTouchHelper which movement directions are supported.
// For example, when a user drags a list item, they press 'Down' to begin the drag and lift their finger, 'Up', to end the drag.
@Override
public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
final int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
return makeMovementFlags(dragFlags, swipeFlags);
}
// The method below notifies the adapter that an item has moved.
// This triggers the onItemMove override in our Firebase adapter,
// which will eventually handle updating the restaurants ArrayList to reflect the item's new position.
@Override
public boolean onMove(@NonNull RecyclerView recyclerView, RecyclerView.ViewHolder source,
RecyclerView.ViewHolder target) {
if (source.getItemViewType() != target.getItemViewType()) {
return false;
}
mAdapter.onItemMove(source.getAdapterPosition(), target.getAdapterPosition());
return true;
}
// The method below notifies the adapter that an item was dismissed.
// This triggers the onItemDismiss override in our Firebase adapter
// which will eventually handle deleting this item from the user's "Saved Restaurants" in Firebase.
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int i) {
mAdapter.onItemDismiss(viewHolder.getAdapterPosition());
}
}
| [
"esther.moki@student.moringaschool.com"
] | esther.moki@student.moringaschool.com |
76e86d6cb4532c93ad1e4fdf1da506b40efed009 | b14a1f1d919ec262411eb532916e8da0f0a3cbda | /Fantacalcio_SIW/src/persistence/connect/DataSource.java | b02f5bbc8f2bcb5662dde9190e3227fb3d1a5763 | [] | no_license | RossellaC/FANTACALCIO_FINALE | aa349adb8da90eec825df355e352e39d26eba4c4 | 514336db7dfbc2711b092e3b33df1e29ae704d71 | refs/heads/master | 2021-01-24T20:02:00.653895 | 2018-02-28T13:22:05 | 2018-02-28T13:22:05 | 123,243,627 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 703 | java | package persistence.connect;
import java.sql.*;
public class DataSource {
final private String dbURI; // = "jdbc:postgresql://localhost/Fantacalcio";
final private String userName;// = "postgres";
final private String password;// = "postgres";
public DataSource(String dbURI, String userName, String password) {
this.dbURI=dbURI;
this.userName=userName;
this.password=password;
}
public Connection getConnection() throws PersistenceException {
Connection connection = null;
try {
connection = DriverManager.getConnection(dbURI,userName, password);
} catch(SQLException e) {
throw new PersistenceException(e.getMessage());
}
return connection;
}
}
| [
"rossella.calabretta89@gmail.com"
] | rossella.calabretta89@gmail.com |
8878902fa60f4932f3e1f51e4a9204d470348454 | 3bb0a9821a3ca28ba4ebe6631deaa1d2bd554fb6 | /src/controller/IActionListener.java | cbf76483476fd7d185cbae150567ab1d40975d50 | [] | no_license | SandervGeel/LINALG | e41024825c905dba7d63cb0aafb5064479e61553 | 517e5e8da33db89ac424d23eb82fcb681d18e4c2 | refs/heads/master | 2021-01-12T01:12:24.712138 | 2017-01-08T15:56:27 | 2017-01-08T15:56:27 | 78,356,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 308 | java | package controller;
import java.awt.Color;
public interface IActionListener {
public void scale(double scaling);
public void reset();
public void transform(int x, int y, int z, boolean plane);
public void rotate(int x_begin, int y_begin, int z_begin, int x_end, int y_end, int z_end, int angle);
}
| [
"sgeel@avans.nl"
] | sgeel@avans.nl |
2fa0e19be7e108584f65de1d1764a17dbfbf41e5 | 61e6dcb4e551068650d9c8d0f6ba21e418220586 | /src/main/java/Edge.java | cdc6321bfb3918bb9478aba4b5c8f6496d668d9d | [] | no_license | Siwoo-Kim/algo-prac | 6f12d6981d62948f7d1a82600181e2ad0090bb92 | d0e175ef45a975bc0625ed57ef780813b15983b6 | refs/heads/master | 2023-02-07T15:19:11.875880 | 2020-12-28T20:48:16 | 2020-12-28T20:48:16 | 324,872,844 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 732 | java | import static com.google.common.base.Preconditions.checkNotNull;
public class Edge<E> {
private final E from, to;
public Edge(E from, E to) {
checkNotNull(from, to);
this.from = from;
this.to = to;
}
public E either() {
return from;
}
public E other(E v) {
if (from.equals(v)) return to;
if (to.equals(v)) return from;
throw new IllegalArgumentException();
}
public E from() {
return from;
}
public E to() {
return to;
}
@Override
public String toString() {
return String.format("%s -> %s", from, to);
}
public Edge<E> reverse() {
return new Edge<>(to, from);
}
}
| [
"Siwoo.Kim@pointclickcare.com"
] | Siwoo.Kim@pointclickcare.com |
618f6ba62f5e21bcf5b8bfd43dd2c7b222c36894 | 31c2e9ac7aab1990c9cba9f469319c77fce77102 | /app/src/main/java/com/lessask/EventThread.java | 1118a15b1b84ff6a9bb78c53c37d42abf4a7c4c8 | [] | no_license | huangjilaiqin/TestGradle | 482af21822825b8f3782caa7472fc07a03cc4704 | 18098b3751a95c2812f9d173df37415ba8def2b3 | refs/heads/master | 2021-01-17T14:09:32.871015 | 2016-03-27T15:41:40 | 2016-03-27T15:43:01 | 39,896,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,520 | java | package com.lessask;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
/**
* The thread for event loop. All non-background tasks run within this thread.
*/
public class EventThread extends Thread {
private static final ThreadFactory THREAD_FACTORY = new ThreadFactory() {
@Override
public Thread newThread(Runnable runnable) {
thread = new EventThread(runnable);
thread.setName("EventThread");
/*
thread.setUncaughtExceptionHandler(new UncaughtExceptionHandler()
{
public void uncaughtException(Thread t, Throwable e)
{
System.out.println(t.getName() + " : " + e.getMessage());
// TODO
}
});
*/
return thread;
}
};
private static EventThread thread;
private static ExecutorService service;
private static int counter = 0;
private EventThread(Runnable runnable) {
super(runnable);
}
/**
* check if the current thread is EventThread.
*
* @return true if the current thread is EventThread.
*/
public static boolean isCurrent() {
return currentThread() == thread;
}
/**
* Executes a task in EventThread.
*
* @param task
*/
public static void exec(Runnable task) {
if (isCurrent()) {
task.run();
} else {
nextTick(task);
}
}
/**
* Executes a task on the next loop in EventThread.
*
* @param task
*/
public static void nextTick(final Runnable task) {
ExecutorService executor;
synchronized (EventThread.class) {
counter++;
if (service == null) {
service = Executors.newSingleThreadExecutor(THREAD_FACTORY);
}
executor = service;
}
executor.execute(new Runnable() {
@Override
public void run() {
try {
task.run();
} finally {
synchronized (EventThread.class) {
counter--;
if (counter == 0) {
service.shutdown();
service = null;
thread = null;
}
}
}
}
});
}
}
| [
"1577594730@qq.com"
] | 1577594730@qq.com |
8a5bff1b458042877fce3e1fbbfe1cd474b39a86 | d6666ff722371c51b23070cbf9259f067a5ccc4f | /webapp/src/main/java/org/celllife/remedi/framework/logging/LoggingAspect.java | 8805f00d7deb64417a0ff1db8bc7cc9441655f6b | [] | no_license | cell-life/celllife-remedi | bbc42c0f0a5c6716a55facc62123bcf75101eae1 | 70b8c95094520106a0dbb407328ca28749ddb8ed | refs/heads/master | 2021-05-02T02:49:05.699197 | 2013-12-04T11:03:26 | 2013-12-04T11:03:26 | 120,888,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,013 | java | package org.celllife.remedi.framework.logging;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
/**
* User: Kevin W. Sewell
* Date: 2013-03-18
* Time: 10h15
*/
@Aspect
@Component
public final class LoggingAspect {
private ILoggerFactory loggerFactory = LoggerFactory.getILoggerFactory();
@Before(value = "@annotation(loggable)", argNames = "joinPoint, loggable")
public void before(JoinPoint joinPoint, Loggable loggable) {
if (joinPoint == null) {
return;
}
Object target = joinPoint.getTarget();
if (target == null) {
return;
}
Signature signature = joinPoint.getSignature();
if (signature == null) {
return;
}
String name = signature.getName();
Object[] args = joinPoint.getArgs();
Class clazz = target.getClass();
LogLevel logLevel = loggable.value();
String logMessage = buildLogMessage(name, args);
log(clazz, logLevel, logMessage);
}
private void log(Class clazz, LogLevel logLevel, String logMessage) {
Logger logger = loggerFactory.getLogger(clazz.getName());
if (logLevel == LogLevel.DEBUG) {
logger.debug(logMessage);
return;
}
if (logLevel == LogLevel.ERROR) {
logger.error(logMessage);
return;
}
if (logLevel == LogLevel.INFO) {
logger.info(logMessage);
return;
}
if (logLevel == LogLevel.TRACE) {
logger.trace(logMessage);
return;
}
if (logLevel == LogLevel.WARN) {
logger.warn(logMessage);
}
}
@AfterThrowing(value = "@annotation(loggable)", argNames = "joinPoint, loggable, throwable", throwing = "throwable")
public void afterThrowing(JoinPoint joinPoint, Loggable loggable, Throwable throwable) {
if (joinPoint == null) {
return;
}
Object target = joinPoint.getTarget();
if (target == null) {
return;
}
Class<? extends Throwable> throwableClass = throwable.getClass();
if (Exception.class.isAssignableFrom(throwableClass)) {
Class clazz = target.getClass();
LogLevel logLevel = loggable.exception();
String message = throwable.getMessage();
log(clazz, logLevel, message, throwable);
}
}
private void log(Class clazz, LogLevel logLevel, String logMessage, Throwable throwable) {
Logger logger = loggerFactory.getLogger(clazz.getName());
if (logLevel == LogLevel.DEBUG) {
logger.debug(logMessage, throwable);
return;
}
if (logLevel == LogLevel.ERROR) {
logger.error(logMessage, throwable);
return;
}
if (logLevel == LogLevel.INFO) {
logger.info(logMessage, throwable);
return;
}
if (logLevel == LogLevel.TRACE) {
logger.trace(logMessage, throwable);
return;
}
if (logLevel == LogLevel.WARN) {
logger.warn(logMessage, throwable);
}
}
private String buildLogMessage(String name, Object[] args) {
StringBuilder stringBuilder = new StringBuilder(name);
stringBuilder.append("(");
if (args != null) {
for (int i = 0; i < args.length; i++) {
stringBuilder.append(args[i]);
if (i != args.length - 1) {
stringBuilder.append(",");
}
}
}
stringBuilder.append(")");
return stringBuilder.toString();
}
} | [
"dine@cell-life.org"
] | dine@cell-life.org |
5350365ddaa592cee1d971f0c03e95f61d8baeea | ccdcf3e5bab099c89dece2226941e22e44c0a859 | /ui/src/androidTest/java/com/rednik/muriel/ExampleInstrumentedTest.java | d6a87a39623e08a1506ad2d37dd5c6e5c4ce0939 | [] | no_license | rednikapps/appfa | 7837109d86a1be17e9b1edf3706821836f807cbf | eee78d6acf1cd3b021b02b9c2c406626072a578f | refs/heads/develop | 2021-08-23T09:26:10.277365 | 2017-12-04T13:54:43 | 2017-12-04T13:54:43 | 112,202,614 | 0 | 1 | null | 2017-12-04T13:54:44 | 2017-11-27T13:56:16 | Java | UTF-8 | Java | false | false | 740 | java | package com.rednik.muriel;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.rednik.muriel.test", appContext.getPackageName());
}
}
| [
"gigenamauricio@gmail.com"
] | gigenamauricio@gmail.com |
371aa51f17bd34dfea4643b0fc20834f9acfb74c | 5f39de04b14b2c19e3d5af46a62eb48f55a92f3d | /interface3.java | a8365222a7cce37920742c9eac2a8368cb9295c9 | [] | no_license | shivendra036/java-programs | 5c71f7105ead6215f804a90958bdf54ce5f22812 | ef1571786068c803df9bc75cb2b5d878b93ebf18 | refs/heads/master | 2020-03-27T13:40:09.776738 | 2018-10-21T12:06:03 | 2018-10-21T12:06:03 | 146,622,003 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 411 | java | interface my
{
void show();
}
//inheritence in interface
interface my1 extends my
{
void display();
}
class child implements my,my1
{
public void show()
{
System.out.println("show");
}
public void display()
{
System.out.println("display");
}
}
class interface3
{
public static void main(String ... a)
{
my n=new child();
n.show();
my1 n1=new child();
n1.show();
n1.display();
}
} | [
"shivendra.yadav36@gmail.com"
] | shivendra.yadav36@gmail.com |
dcc0bc9ecd942e6723084af1a57c74180c4d2846 | 46ef867eb57c7b7f57b03c00bb16725b18ea8180 | /27.06-configurando-resource-server-com-token-opaco/algafood-api/src/main/java/com/algaworks/algafood/api/v1/model/input/CidadeIdInput.java | 7ace770c4c2fa7f41ecbb193a570292984ac5316 | [] | no_license | johnyguido/curso-especialista-spring-rest | cb9d027b50f4982aab677876e09b07fedecd3c81 | 94e99c75e5a8475fee333798145113c5ecff41fe | refs/heads/master | 2023-06-07T22:36:08.802975 | 2023-05-24T17:41:56 | 2023-05-24T17:41:56 | 399,998,423 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 296 | java | package com.algaworks.algafood.api.v1.model.input;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
@Setter
@Getter
public class CidadeIdInput {
@Schema(example = "1")
@NotNull
private Long id;
}
| [
"alex.silva@algaworks.com.br"
] | alex.silva@algaworks.com.br |
282b23b5752870cf56c5d209ede5b50201e27d8f | 04da03613b9f040384af2f09b8522e6938418cce | /backend/src/main/java/com/nuga/curation/exception/CodeTimeException.java | 9b6b3506cc5a1e96f572dc9ca0284c6ac1f20c2d | [] | no_license | lando94/NUGA-Web-project | 5dbf3cbc1056d18d54268bfe3abe3c2d0ecd8f5e | 738e6cf2d81a8dad62158d86bf50bd574d9548b8 | refs/heads/master | 2023-03-30T00:56:39.058905 | 2021-04-11T11:30:52 | 2021-04-11T11:30:52 | 356,527,372 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 191 | java | package com.nuga.curation.exception;
public class CodeTimeException extends Exception{
public CodeTimeException(){}
public CodeTimeException(String msg){
super(msg);
}
}
| [
"lando94@naver.com"
] | lando94@naver.com |
bdbba42efc3fec0c53a9fb2f9f895a90cd9b5f6b | 9bb5acc7c4bb6b51eb2ecec3231754705cbea02e | /Sunshine/app/src/androidTest/java/com/example/raaowll/sunshine/com/example/raaowll/sunshine/app/test/TestProvider.java | 13701cc9e97b0a6ca0e070b86ff4f1a99540d9a6 | [] | no_license | rahulmbw/scissoring | 7e4c3fed0ed73a6b08a393d2953beff0e1603b36 | 5e120ea9b4c725fa31db3a7bf4861418ddf1f015 | refs/heads/master | 2016-09-06T03:35:46.370055 | 2015-05-08T04:58:49 | 2015-05-08T04:58:49 | 35,220,904 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,826 | java | package com.example.raaowll.sunshine.com.example.raaowll.sunshine.app.test;
import android.test.AndroidTestCase;
import android.annotation.TargetApi;
import android.content.ContentUris;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.test.AndroidTestCase;
import com.example.raaowll.sunshine.WeatherContract.LocationEntry;
import com.example.raaowll.sunshine.WeatherContract.WeatherEntry;
import com.example.raaowll.sunshine.data.WeatherDbHelper;
import com.example.raaowll.sunshine.com.example.raaowll.sunshine.app.test.TestDb;
import com.example.raaowll.sunshine.data.WeatherDbHelper;
public class TestProvider extends AndroidTestCase {
public static final String LOG_TAG = TestProvider.class.getSimpleName();
public void testDeleteDb() throws Throwable {
mContext.deleteDatabase(WeatherDbHelper.DATABASE_NAME);
}
public void testInsertReadProvider() {
ContentValues testValues = TestDb.createNorthPoleLocationValues();
Uri locationUri = mContext.getContentResolver().insert(LocationEntry.CONTENT_URI, testValues);
long locationRowId = ContentUris.parseId(locationUri);
// Verify we got a row back.
assertTrue(locationRowId != -1);
// Data's inserted. IN THEORY. Now pull some out to stare at it and verify it made
// the round trip.
// A cursor is your primary interface to the query results.
Cursor cursor = mContext.getContentResolver().query(
LocationEntry.CONTENT_URI,
null, // leaving "columns" null just returns all the columns.
null, // cols for "where" clause
null, // values for "where" clause
null // sort order
);
TestDb.validateCursor(cursor, testValues);
// Now see if we can successfully query if we include the row id
cursor = mContext.getContentResolver().query(
LocationEntry.buildLocationUri(locationRowId),
null, // leaving "columns" null just returns all the columns.
null, // cols for "where" clause
null, // values for "where" clause
null // sort order
);
TestDb.validateCursor(cursor, testValues);
// Fantastic. Now that we have a location, add some weather!
ContentValues weatherValues = TestDb.createWeatherValues(locationRowId);
Uri weatherInsertUri = mContext.getContentResolver()
.insert(WeatherEntry.CONTENT_URI, weatherValues);
assertTrue(weatherInsertUri != null);
// A cursor is your primary interface to the query results.
Cursor weatherCursor = mContext.getContentResolver().query(
WeatherEntry.CONTENT_URI, // Table to Query
null, // leaving "columns" null just returns all the columns.
null, // cols for "where" clause
null, // values for "where" clause
null // columns to group by
);
TestDb.validateCursor(weatherCursor, weatherValues);
// Add the location values in with the weather data so that we can make
// sure that the join worked and we actually get all the values back
addAllContentValues(weatherValues, testValues);
// Get the joined Weather and Location data
weatherCursor = mContext.getContentResolver().query(
WeatherEntry.buildWeatherLocation(TestDb.TEST_LOCATION),
null, // leaving "columns" null just returns all the columns.
null, // cols for "where" clause
null, // values for "where" clause
null // sort order
);
TestDb.validateCursor(weatherCursor, weatherValues);
// Get the joined Weather and Location data with a start date
weatherCursor = mContext.getContentResolver().query(
WeatherEntry.buildWeatherLocationWithStartDate(
TestDb.TEST_LOCATION, TestDb.TEST_DATE),
null, // leaving "columns" null just returns all the columns.
null, // cols for "where" clause
null, // values for "where" clause
null // sort order
);
TestDb.validateCursor(weatherCursor, weatherValues);
// Get the joined Weather data for a specific date
weatherCursor = mContext.getContentResolver().query(
WeatherEntry.buildWeatherLocationWithDate(TestDb.TEST_LOCATION, TestDb.TEST_DATE),
null,
null,
null,
null
);
TestDb.validateCursor(weatherCursor, weatherValues);
}
public void testGetType() {
// content://com.example.android.sunshine.app/weather/
String type = mContext.getContentResolver().getType(WeatherEntry.CONTENT_URI);
// vnd.android.cursor.dir/com.example.android.sunshine.app/weather
assertEquals(WeatherEntry.CONTENT_TYPE, type);
String testLocation = "94074";
// content://com.example.android.sunshine.app/weather/94074
type = mContext.getContentResolver().getType(
WeatherEntry.buildWeatherLocation(testLocation));
// vnd.android.cursor.dir/com.example.android.sunshine.app/weather
assertEquals(WeatherEntry.CONTENT_TYPE, type);
String testDate = "20140612";
// content://com.example.android.sunshine.app/weather/94074/20140612
type = mContext.getContentResolver().getType(
WeatherEntry.buildWeatherLocationWithDate(testLocation, testDate));
// vnd.android.cursor.item/com.example.android.sunshine.app/weather
assertEquals(WeatherEntry.CONTENT_ITEM_TYPE, type);
// content://com.example.android.sunshine.app/location/
type = mContext.getContentResolver().getType(LocationEntry.CONTENT_URI);
// vnd.android.cursor.dir/com.example.android.sunshine.app/location
assertEquals(LocationEntry.CONTENT_TYPE, type);
// content://com.example.android.sunshine.app/location/1
type = mContext.getContentResolver().getType(LocationEntry.buildLocationUri(1L));
// vnd.android.cursor.item/com.example.android.sunshine.app/location
assertEquals(LocationEntry.CONTENT_ITEM_TYPE, type);
}
// The target api annotation is needed for the call to keySet -- we wouldn't want
// to use this in our app, but in a test it's fine to assume a higher target.
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
void addAllContentValues(ContentValues destination, ContentValues source) {
for (String key : source.keySet()) {
destination.put(key, source.getAsString(key));
}
}
} | [
"rmeena@qorql.com"
] | rmeena@qorql.com |
100673167f327abdcf8c8558f4c8cbbd09f5aa3b | 0c7e908b96947d9ebeccba830ee473aefac8d3bb | /src/service/EventService.java | 75c5f9bd7cf8c53af0e4f2cbc17709233fec65fe | [] | no_license | eunziny/Bytruck | 0ebb403786cd900d11d9dcc8dc67325d059f3e47 | 5323079cbdc4933708a4b46460c6c0f55ca060a9 | refs/heads/master | 2020-03-24T07:07:35.188910 | 2018-07-29T16:00:26 | 2018-07-29T16:00:26 | 142,550,497 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 689 | java | package service;
import java.util.List;
import dao.EventDAO;
import dao.EventDAOOracle;
import vo.Event;
public class EventService {
private EventDAO dao = new EventDAOOracle();
//이벤트 글쓰기
public void eventwrite(Event ev) throws Exception {
dao.insertevent(ev);
}
//이벤트 리스트
public List<Event> findAll() throws Exception {
return dao.selectAll();
}
//풀캘린더 리스트
public List<Event> findEvent() throws Exception {
return dao.selectEvent();
}
//이벤트 디테일
public Event findDetail(int bNum) throws Exception {
return dao.selectDetail(bNum);
}
public void eventupdate(Event ev) throws Exception {
dao.update(ev);
}
}
| [
"dmswlsl92@gmail.com"
] | dmswlsl92@gmail.com |
dd45ce6fe4b000a25b25b81fcd2784359e2af120 | da05b60afb278667fe2575f492f70d9141fa184d | /metrics-api/src/main/java/co/speedar/metrics/api/client/MetricsClient.java | 9e8b8bd4a3edf05e4ca91cbc916e40c428203e8c | [] | no_license | earthdevil/general-metrics | dc21d930cd66108730727c5bee8d4955daa812e8 | e23b32ea981d2c9823701643a67cfe80f9b3660d | refs/heads/master | 2020-05-14T14:44:39.609120 | 2019-01-02T09:24:43 | 2019-01-02T09:24:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,535 | java | package co.speedar.metrics.api.client;
import java.util.SortedMap;
import java.util.concurrent.Callable;
import co.speedar.metrics.api.calculate.MetricCounter;
import co.speedar.metrics.api.calculate.MetricTimer;
/**
* 通用埋点接口,为了隔离不同的metrics埋点实现
*/
public interface MetricsClient {
/**
* 注册并返回一个MetricCounter对象,累加器。
* 针对同种类型的埋点只需调用本方法一次,保存返回的counter重复使用即可。
*
* @param metricsName 埋点名
* @param description 埋点描述
* @param tagMap 定义埋点的相关标签,一般会添加到tsdb中用于区分记录
* @return
*/
MetricCounter counter(String metricsName, String description, SortedMap<String, String> tagMap);
/**
* 注册并返回一个MetricTimer,计时器。用法建议可参考counter。
*
* @param metricsName 埋点名
* @param description 埋点描述
* @param tagMap 定义埋点的相关标签,一般会添加到tsdb中用于区分记录
* @return
*/
MetricTimer timer(String metricsName, String description, SortedMap<String, String> tagMap);
/**
* 注册一个gauge类型的埋点,瞬时值
*
* @param metricsName 埋点名
* @param description 埋点描述
* @param tagMap 定义埋点的相关标签,一般会添加到tsdb中用于区分记录
* @param callable 封装如何计算值的逻辑闭包
*/
void gauge(String metricsName, String description, SortedMap<String, String> tagMap, Callable<Double> callable);
} | [
"ben04.li@vipshop.com"
] | ben04.li@vipshop.com |
eec97e390c91e77648166ae5a744bafb3e935ed5 | 5d1b8d116934a3b4cbea261d4a45c64e57ef5cd1 | /src/main/java/fr/alexandreroman/demos/springresilience4j/Timeout.java | 07b65cab0e43c239a13315b940a991718c9843e7 | [
"Apache-2.0"
] | permissive | abkkm/spring-resilience4j-demo | 1ecfc7979c4082c8ca0d20196d07fff04ca09374 | 043e29aa392a886bbdb4e46344f597ece7d3a4f7 | refs/heads/master | 2023-03-15T16:15:48.134163 | 2020-01-15T15:58:54 | 2020-01-15T15:58:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,806 | java | /*
* Copyright (c) 2020 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fr.alexandreroman.demos.springresilience4j;
import io.github.resilience4j.circuitbreaker.CircuitBreakerConfig;
import io.github.resilience4j.timelimiter.TimeLimiterConfig;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.circuitbreaker.resilience4j.Resilience4JCircuitBreakerFactory;
import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory;
import org.springframework.cloud.client.circuitbreaker.Customizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import javax.validation.constraints.PositiveOrZero;
import java.time.Duration;
import java.util.function.Supplier;
@RestController
@RequiredArgsConstructor
@Slf4j
class TimeoutController {
private final RestTemplateBuilder restTemplateBuilder;
private final CircuitBreakerFactory cbf;
@Value("${app.timeout.network:2s}")
private Duration networkTimeout;
@GetMapping(value = "/timeout", produces = MediaType.TEXT_PLAIN_VALUE)
String timeout(@RequestParam(value = "delay", required = false, defaultValue = "0") @PositiveOrZero long delaySec) {
final String result = cbf.create("timeout").run(callExternalService(delaySec), throwable -> {
log.warn("Timeout while calling network service", throwable);
return (throwable instanceof RestClientException ? "NETWORK_TIMEOUT" : "PROCESS_TIMEOUT") + "\n";
});
return "Network call result: " + result + "\n";
}
private Supplier<String> callExternalService(long delaySec) {
return () -> {
final String url =
UriComponentsBuilder.fromHttpUrl("http://httpbin.org").pathSegment("delay", String.valueOf(delaySec)).toUriString();
log.info("Calling service: {}", url);
final RestTemplate client = restTemplateBuilder.setConnectTimeout(networkTimeout)
.setReadTimeout(networkTimeout).build();
final ResponseEntity<String> resp = client.getForEntity(url, String.class);
return (resp.getStatusCode().is2xxSuccessful() ? "SUCCESSFUL" : "FAILED");
};
}
}
@Configuration
class TimeoutConfig {
@Value("${app.timeout.process:4s}")
private Duration processTimeout;
@Bean
Customizer<Resilience4JCircuitBreakerFactory> timeoutCustomizer() {
return factory -> factory.configure(builder -> builder.circuitBreakerConfig(CircuitBreakerConfig.ofDefaults())
.timeLimiterConfig(TimeLimiterConfig.custom().timeoutDuration(processTimeout).build()), "timeout");
}
}
| [
"aroman@pivotal.io"
] | aroman@pivotal.io |
c36bdaf470abb8429f1dc1e68085149ac20e7b0e | bb6dc5a0a6785c6f095d59caa9f082fb339339ba | /src/test/java/ru/bellintegrator/practice/user/controller/UserControllerTest.java | 58ba430021ecb67ce29ef50baaf27f9ee56ded2a | [] | no_license | Shapik1990/bellintegator | 225afb7ecc7907fa66911a6e8f58085dcde0338a | ec6ba08ed13c8d635a0f6d099496d5bd4885ad8d | refs/heads/master | 2020-07-18T19:34:04.388561 | 2019-10-18T16:33:42 | 2019-10-18T16:33:42 | 206,300,906 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,548 | java | package ru.bellintegrator.practice.user.controller;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;
import ru.bellintegrator.practice.user.dto.UserDto;
import ru.bellintegrator.practice.view.DataResponseView;
import ru.bellintegrator.practice.view.ErrorResponseView;
import ru.bellintegrator.practice.view.SuccessResponseView;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class UserControllerTest {
@Autowired
TestRestTemplate testRestTemplate;
@Test
public void getUserByIdTest() {
Integer id = 1;
ResponseEntity<DataResponseView<UserDto>> responseEntity = testRestTemplate.exchange("/user/" + id,
HttpMethod.GET, null, new ParameterizedTypeReference<DataResponseView<UserDto>>(){});
Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.OK);
Assert.assertNotNull(responseEntity.getBody());
Assert.assertEquals(responseEntity.getBody().getData().getId(), id);
}
@Test
public void getUserByIdTestError() {
int id = 10;
String errorNotEntity = "Не найден пользователь с id " + id;
ResponseEntity<ErrorResponseView> responseNotEntityById = testRestTemplate.getForEntity("/user/" + id, ErrorResponseView.class);
Assert.assertNotNull(responseNotEntityById.getBody());
Assert.assertEquals(responseNotEntityById.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertEquals(responseNotEntityById.getBody().getError(), errorNotEntity);
ResponseEntity<ErrorResponseView> responseEntityWrongId = testRestTemplate.getForEntity("/user/fdf", ErrorResponseView.class);
Assert.assertEquals(responseEntityWrongId.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertEquals(responseEntityWrongId.getBody().getError(), "Not Found");
}
@Test
public void getByUsersListTest() {
UserDto dto = new UserDto();
dto.setOfficeId(1);
ResponseEntity<DataResponseView<List<UserDto>>> responseEntity = testRestTemplate.exchange("/user/list",
HttpMethod.POST, new HttpEntity<>(dto) , new ParameterizedTypeReference<DataResponseView<List<UserDto>>>(){});
Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.OK);
Assert.assertNotNull(responseEntity.getBody());
Assert.assertTrue(!responseEntity.getBody().getData().isEmpty());
}
@Test
public void getByUsersListTestError() {
UserDto dto = new UserDto();
String errorValidated = "Ошибка валидации : должно быть задано officeId;";
String errorNotFound = "Пользователи с указанными параметрами не найдены";
ResponseEntity<ErrorResponseView> responseEntityValidated = testRestTemplate.postForEntity("/user/list", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntityValidated.getStatusCode(), HttpStatus.BAD_REQUEST);
Assert.assertNotNull(responseEntityValidated.getBody());
Assert.assertEquals(responseEntityValidated.getBody().getError(), errorValidated);
dto.setOfficeId(10);
ResponseEntity<ErrorResponseView> responseNotEntityByFilter = testRestTemplate.postForEntity("/user/list", dto, ErrorResponseView.class);
Assert.assertEquals(responseNotEntityByFilter.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertNotNull(responseNotEntityByFilter.getBody());
Assert.assertEquals(responseNotEntityByFilter.getBody().getError(), errorNotFound);
}
@Test
public void updateUserTest() {
UserDto dto = new UserDto();
dto.setId(1);
dto.setFirstName("Test user");
dto.setPosition("Директор");
ResponseEntity<SuccessResponseView> responseEntity = testRestTemplate.postForEntity("/user/update", dto, SuccessResponseView.class);
Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.OK);
Assert.assertTrue(responseEntity.getBody().isSuccess());
ResponseEntity<DataResponseView<UserDto>> responseEntityById = testRestTemplate.exchange("/user/1" ,
HttpMethod.GET, null, new ParameterizedTypeReference<DataResponseView<UserDto>>(){});
Assert.assertEquals(responseEntityById.getStatusCode(), HttpStatus.OK);
Assert.assertNotNull(responseEntityById.getBody());
Assert.assertEquals(responseEntityById.getBody().getData().getFirstName(), dto.getFirstName());
}
@Test
public void updateUserTestError() {
UserDto dto = new UserDto();
String errorValidated = "(?=.*firstName)(?=.*position)(?=.*id).*";
String errorWrongId = "Не найден пользователь с id ";
int id = 10;
ResponseEntity<ErrorResponseView> responseEntity = testRestTemplate.postForEntity("/user/update", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.BAD_REQUEST);
Assert.assertNotNull(responseEntity.getBody());
Assert.assertTrue(responseEntity.getBody().getError().matches(errorValidated));
dto.setId(id);
dto.setFirstName("Test user");
dto.setPosition("Директор");
ResponseEntity<ErrorResponseView> responseEntityWrongId = testRestTemplate.postForEntity("/user/update", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntityWrongId.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertNotNull(responseEntityWrongId.getBody());
Assert.assertEquals(responseEntityWrongId.getBody().getError(), errorWrongId + id);
}
@Test
public void saveUserTest() {
UserDto dto = new UserDto();
dto.setOfficeId(1);
dto.setFirstName("Test user");
dto.setPosition("Директор");
ResponseEntity<SuccessResponseView> responseEntity = testRestTemplate.postForEntity("/user/save", dto, SuccessResponseView.class);
Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.OK);
Assert.assertTrue(responseEntity.getBody().isSuccess());
ResponseEntity<DataResponseView<List<UserDto>>> responseEntityByFilter = testRestTemplate.exchange("/user/list",
HttpMethod.POST, new HttpEntity<>(dto) , new ParameterizedTypeReference<DataResponseView<List<UserDto>>>(){});
Assert.assertEquals(responseEntityByFilter.getStatusCode(), HttpStatus.OK);
Assert.assertNotNull(responseEntityByFilter.getBody());
Assert.assertTrue(!responseEntityByFilter.getBody().getData().isEmpty());
Assert.assertEquals(responseEntityByFilter.getBody().getData().get(0).getPosition(), dto.getPosition());
Assert.assertEquals(responseEntityByFilter.getBody().getData().get(0).getFirstName(), dto.getFirstName());
}
@Test
public void saveUserTestError() {
UserDto dto = new UserDto();
String errorValidated = "(?=.*firstName)(?=.*position)(?=.*officeId).*";
String errorOfficeId = "Не найден офис с officeId ";
String errorTypeDocumentValidated = "Не найден тип документа с docCode 55";
String errorDocumentValidated = "docCode документа не совпадает с docName";
String errorCitizenshipCodeValidated = "Не найдена страна с citizenshipCode 0";
int officeId= 10;
ResponseEntity<ErrorResponseView> responseEntity = testRestTemplate.postForEntity("/user/save", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntity.getStatusCode(), HttpStatus.BAD_REQUEST);
Assert.assertNotNull(responseEntity.getBody());
Assert.assertTrue(responseEntity.getBody().getError().matches(errorValidated));
dto.setOfficeId(officeId);
dto.setFirstName("Test user");
dto.setPosition("Директор");
ResponseEntity<ErrorResponseView> responseEntityWrongOfficeId = testRestTemplate.postForEntity("/user/save", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntityWrongOfficeId.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertNotNull(responseEntityWrongOfficeId.getBody());
Assert.assertEquals(responseEntityWrongOfficeId.getBody().getError(), errorOfficeId + officeId);
dto.setDocCode(55);
dto.setOfficeId(1);
ResponseEntity<ErrorResponseView> responseEntityTypeDocumentValidatedError = testRestTemplate.postForEntity("/user/save", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntityTypeDocumentValidatedError.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertNotNull(responseEntityTypeDocumentValidatedError.getBody());
Assert.assertEquals(responseEntityTypeDocumentValidatedError.getBody().getError(), errorTypeDocumentValidated);
dto.setDocCode(21);
dto.setDocName("Свидетельство");
ResponseEntity<ErrorResponseView> responseEntityDocumentValidatedError = testRestTemplate.postForEntity("/user/save", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntityDocumentValidatedError.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertNotNull(responseEntityDocumentValidatedError.getBody());
Assert.assertEquals(responseEntityDocumentValidatedError.getBody().getError(), errorDocumentValidated);
dto.setDocName(null);
dto.setCitizenshipCode(0);
ResponseEntity<ErrorResponseView> responseEntityCitizenshipCodeValidatedError = testRestTemplate.postForEntity("/user/save", dto, ErrorResponseView.class);
Assert.assertEquals(responseEntityCitizenshipCodeValidatedError.getStatusCode(), HttpStatus.NOT_FOUND);
Assert.assertNotNull(responseEntityCitizenshipCodeValidatedError.getBody());
Assert.assertEquals(responseEntityCitizenshipCodeValidatedError.getBody().getError(), errorCitizenshipCodeValidated);
}
}
| [
"shapik1990@yandex.ru"
] | shapik1990@yandex.ru |
8ea489c5fc25fdf7512073eebe522cf757333a92 | 69ad8305c4bb026c24e277a70f2056abf61380eb | /src/code/ImageModel.java | 598c0fdb2c1ababe4f086a2c56b435ec8de4e960 | [] | no_license | NowIWant/NowIWant | 6a7a18661477dc37123d4d907204c97eb00ea58f | 321f4c8e3e13ad29176a4bfcad592b55aa51b6ea | refs/heads/master | 2021-09-17T13:54:26.515323 | 2018-07-02T08:34:38 | 2018-07-02T08:34:38 | 107,574,407 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,931 | java | package code;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
public class ImageModel {
private static DataSource ds;
static {
try {
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
ds = (DataSource) envCtx.lookup("jdbc/nowiwant");
} catch (NamingException e) {
System.out.println("Error:" + e.getMessage());
}
}
private static final String TABLE_NAME = " immagini AS imm ";
public String firstProdImage(int id_prodotto) throws SQLException {
Connection conn = null;
PreparedStatement pstmt = null;
String immagine = "";
String selectSQL = "SELECT TOP 1 * FROM " + TABLE_NAME + "WHERE id_prodotto = " + id_prodotto;
try {
conn = ds.getConnection();
pstmt = conn.prepareStatement(selectSQL);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
immagine = rs.getString("immagine");
}
System.out.println("INTERROGATO DATABASE PER PRIMA IMMAGINE PRODOTTO");
} finally {
try {
if (pstmt != null)
pstmt.close();
} finally {
if (conn != null)
conn.close();
}
}
return immagine;
}
public void saveImage(int id_prodotto, List<String> immagini) throws SQLException {
Connection conn = null;
PreparedStatement pstmt = null;
String insertSQL = "INSERT INTO immagini (id_prodotto,immagine) VALUES (?,?)";
try {
conn = ds.getConnection();
String[] imm = immagini.toArray(new String[immagini.size()]);
int c = imm.length;
for (int i = 0; i < c; i++) {
pstmt = conn.prepareStatement(insertSQL);
pstmt.setInt(1, id_prodotto);
pstmt.setString(2, imm[i]);
pstmt.executeUpdate();
}
} finally {
try {
if (pstmt != null)
pstmt.close();
} finally {
if (conn != null)
conn.close();
}
}
}
public Collection<ImageBean> getProdImage(int id_prodotto) throws SQLException {
Connection conn = null;
PreparedStatement pstmt = null;
Collection<ImageBean> immagini = new LinkedList<ImageBean>();
String selectSQL = "SELECT id_immagine,immagine FROM immagini WHERE id_prodotto = ?";
try {
conn = ds.getConnection();
pstmt = conn.prepareStatement(selectSQL);
pstmt.setInt(1, id_prodotto);
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
ImageBean bean = new ImageBean();
bean.setId_immagine(rs.getInt("id_immagine"));
bean.setId_prodotto(id_prodotto);
bean.setImmagine(rs.getString("immagine"));
immagini.add(bean);
}
System.out.println("INTERROGATO DATABASE PER IMMAGINI PRODOTTO");
} finally {
try {
if (pstmt != null)
pstmt.close();
} finally {
if (conn != null)
conn.close();
}
}
return immagini;
}
public void deleteImage(int id_image) throws SQLException {
Connection conn = null;
PreparedStatement pstmt = null;
String insertSQL = "DELETE FROM immagini WHERE id_immagine = ?";
try {
conn = ds.getConnection();
pstmt = conn.prepareStatement(insertSQL);
pstmt.setInt(1, id_image);
pstmt.executeUpdate();
} finally {
try {
if (pstmt != null)
pstmt.close();
} finally {
if (conn != null)
conn.close();
}
}
}
public void deleteAllProdImage(int id_prod) throws SQLException {
Connection conn = null;
PreparedStatement pstmt = null;
String insertSQL = "DELETE FROM immagini WHERE id_prodotto = ?";
try {
conn = ds.getConnection();
pstmt = conn.prepareStatement(insertSQL);
pstmt.setInt(1, id_prod);
pstmt.executeUpdate();
} finally {
try {
if (pstmt != null)
pstmt.close();
} finally {
if (conn != null)
conn.close();
}
}
}
}
| [
"alessio.robertazzi@gmail.com"
] | alessio.robertazzi@gmail.com |
503d45888b6d1a794a1fc4b7cdcf876717ad9d6e | 986e5d0149902cd71ed6dfd15c1e03d379b989b5 | /src/Data_Collection/LinkedList.java | b99ddc019bc4922caa9d56d15e1307943ddd8c79 | [] | no_license | mppatel2288/GIT_DEMO | 0ca3517f9e1d20badbd8ae2947cb2a26e39d80ed | 8c0b778baf0876835218d33f4c20ccedfa40da34 | refs/heads/master | 2023-01-02T04:21:55.289790 | 2020-10-28T04:04:58 | 2020-10-28T04:04:58 | 297,532,071 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 905 | java | package Data_Collection;
import java.util.Iterator;
public class LinkedList {
public static void main(String[] args) {
LinkList();
}
public static void LinkList() {
java.util.LinkedList<String> ll = new java.util.LinkedList<String>();
ll.add("AAAAAA");
ll.add("BBBBB");
ll.add("CCCCCCC");
ll.add("DDDDDDD");
ll.addFirst("Aarti");
ll.addLast("Patel");
ll.set(3, "Bhumi");
//System.out.println(ll);
//Using For loop
// for(int i=0; i<ll.size(); i++) {
// System.out.println(ll.get(i));
// }
// Using Advance For Loop
// for (String str:ll) {
// System.out.println(str);
// }
//
// Iterator<String> it = ll.iterator();
// while(it.hasNext()) {
// System.out.println(it.next());
// }
int num = 0;
while(ll.size()> num) {
System.out.println(ll.get(num));
num++;
}
}
}
| [
"mihir@Mihirs-MBP.attlocal.net"
] | mihir@Mihirs-MBP.attlocal.net |
6a3cdbf44fb5c09ceb27cefebf9f00d190567a0f | 1978aa6f4fd84987dd995a04cc2e52ebf92a86ed | /app/src/main/java/vijay/bild/model/Post.java | d2269198a763c1cd906122c9f0f4510e797190a3 | [] | no_license | vijay1ziggy/Bild | 9df2f3eb66cc849022db5b8734483bffee288dcb | cc4570ce4106108a8a8f0c350a2b33794025a61f | refs/heads/master | 2023-06-20T09:46:04.414267 | 2021-07-20T07:29:51 | 2021-07-20T07:29:51 | 382,888,562 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,443 | java | package vijay.bild.model;
public class Post {
private String category;
private String description;
private String imageurl;
private String postid;
private String publisher;
public Post() {
}
public Post(String category,String description, String imageurl, String postid, String publisher) {
this.category = category;
this.description = description;
this.imageurl = imageurl;
this.postid = postid;
this.publisher = publisher;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getImageurl() {
return imageurl;
}
public void setImageurl(String imageurl) {
this.imageurl = imageurl;
}
public String getPostid() {
return postid;
}
public void setPostid(String postid) {
this.postid = postid;
}
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
}
| [
"ziggy.hacker2020@gmail.com"
] | ziggy.hacker2020@gmail.com |
5d73554ccc32ce257ba13f8ea3dccb1a28a39afb | 1bacc5305438ca5861312a7f0b0ec335f5bede96 | /library/src/main/java/com/makeunion/library/calendarview/DayView.java | 88efa0fe6496ee8baa324a7d485d115a92cacc7c | [] | no_license | fwlong/test | 761cf6e5385a875513034651e1892a964bd41e9d | 1869c77c42287ad82f2847344b120060cce4533f | refs/heads/master | 2021-09-07T22:34:53.888949 | 2018-03-02T08:58:03 | 2018-03-02T08:58:03 | 117,791,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,648 | java | package com.makeunion.library.calendarview;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.StateListDrawable;
import android.graphics.drawable.shapes.OvalShape;
import android.os.Build;
import android.support.annotation.NonNull;
import android.text.SpannableString;
import android.text.Spanned;
import android.view.Gravity;
import android.view.View;
import android.widget.CheckedTextView;
import com.makeunion.library.calendarview.format.DayFormatter;
import java.util.List;
/**
* Display one day of a {@linkplain MaterialCalendarView}
*/
@SuppressLint("ViewConstructor")
class DayView extends CheckedTextView {
private CalendarDay date;
private int selectionColor = Color.GRAY;
private final int fadeTime;
private Drawable customBackground = null;
private Drawable selectionDrawable;
private Drawable mCircleDrawable;
private DayFormatter formatter = DayFormatter.DEFAULT;
private boolean isInRange = true;
private boolean isInMonth = true;
private boolean isDecoratedDisabled = false;
@MaterialCalendarView.ShowOtherDates
private int showOtherDates = MaterialCalendarView.SHOW_DEFAULTS;
public DayView(Context context, CalendarDay day) {
super(context);
fadeTime = getResources().getInteger(android.R.integer.config_shortAnimTime);
setSelectionColor(this.selectionColor);
setGravity(Gravity.CENTER);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
setTextAlignment(TEXT_ALIGNMENT_CENTER);
}
setDay(day);
}
public void setDay(CalendarDay date) {
this.date = date;
setText(getLabel());
}
/**
* Set the new label formatter and reformat the current label. This preserves current spans.
*
* @param formatter new label formatter
*/
public void setDayFormatter(DayFormatter formatter) {
this.formatter = formatter == null ? DayFormatter.DEFAULT : formatter;
CharSequence currentLabel = getText();
Object[] spans = null;
if (currentLabel instanceof Spanned) {
spans = ((Spanned) currentLabel).getSpans(0, currentLabel.length(), Object.class);
}
SpannableString newLabel = new SpannableString(getLabel());
if (spans != null) {
for (Object span : spans) {
newLabel.setSpan(span, 0, newLabel.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
}
setText(newLabel);
}
@NonNull
public String getLabel() {
return formatter.format(date);
}
public void setSelectionColor(int color) {
this.selectionColor = color;
regenerateBackground();
}
/**
* @param drawable custom selection drawable
*/
public void setSelectionDrawable(Drawable drawable) {
if (drawable == null) {
this.selectionDrawable = null;
} else {
this.selectionDrawable = drawable.getConstantState().newDrawable(getResources());
}
regenerateBackground();
}
/**
* @param drawable background to draw behind everything else
*/
public void setCustomBackground(Drawable drawable) {
if (drawable == null) {
this.customBackground = null;
} else {
this.customBackground = drawable.getConstantState().newDrawable(getResources());
}
invalidate();
}
public CalendarDay getDate() {
return date;
}
private void setEnabled() {
boolean enabled = isInMonth && isInRange && !isDecoratedDisabled;
super.setEnabled(isInRange && !isDecoratedDisabled);
boolean showOtherMonths = MaterialCalendarView.showOtherMonths(showOtherDates);
boolean showOutOfRange = MaterialCalendarView.showOutOfRange(showOtherDates) || showOtherMonths;
boolean showDecoratedDisabled = MaterialCalendarView.showDecoratedDisabled(showOtherDates);
boolean shouldBeVisible = enabled;
if (!isInMonth && showOtherMonths) {
shouldBeVisible = true;
}
if (!isInRange && showOutOfRange) {
shouldBeVisible |= isInMonth;
}
if (isDecoratedDisabled && showDecoratedDisabled) {
shouldBeVisible |= isInMonth && isInRange;
}
if (!isInMonth && shouldBeVisible) {
setTextColor(getTextColors().getColorForState(
new int[]{-android.R.attr.state_enabled}, Color.GRAY));
}
setVisibility(shouldBeVisible ? View.VISIBLE : View.INVISIBLE);
}
protected void setupSelection(@MaterialCalendarView.ShowOtherDates int showOtherDates, boolean inRange, boolean inMonth) {
this.showOtherDates = showOtherDates;
this.isInMonth = inMonth;
this.isInRange = inRange;
setEnabled();
}
private final Rect tempRect = new Rect();
private final Rect circleDrawableRect = new Rect();
@Override
protected void onDraw(@NonNull Canvas canvas) {
if (customBackground != null) {
customBackground.setBounds(tempRect);
customBackground.setState(getDrawableState());
customBackground.draw(canvas);
}
mCircleDrawable.setBounds(circleDrawableRect);
super.onDraw(canvas);
}
private void regenerateBackground() {
if (selectionDrawable != null) {
setBackgroundDrawable(selectionDrawable);
} else {
mCircleDrawable = generateBackground(selectionColor, fadeTime, circleDrawableRect);
setBackgroundDrawable(mCircleDrawable);
}
}
private static Drawable generateBackground(int color, int fadeTime, Rect bounds) {
StateListDrawable drawable = new StateListDrawable();
drawable.setExitFadeDuration(fadeTime);
drawable.addState(new int[]{android.R.attr.state_checked}, generateCircleDrawable(color));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
drawable.addState(new int[]{android.R.attr.state_pressed}, generateRippleDrawable(color, bounds));
} else {
drawable.addState(new int[]{android.R.attr.state_pressed}, generateCircleDrawable(color));
}
drawable.addState(new int[]{}, generateCircleDrawable(Color.TRANSPARENT));
return drawable;
}
private static Drawable generateCircleDrawable(final int color) {
ShapeDrawable drawable = new ShapeDrawable(new OvalShape());
drawable.getPaint().setColor(color);
return drawable;
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private static Drawable generateRippleDrawable(final int color, Rect bounds) {
ColorStateList list = ColorStateList.valueOf(color);
Drawable mask = generateCircleDrawable(Color.WHITE);
RippleDrawable rippleDrawable = new RippleDrawable(list, null, mask);
// API 21
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) {
rippleDrawable.setBounds(bounds);
}
// API 22. Technically harmless to leave on for API 21 and 23, but not worth risking for 23+
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1) {
int center = (bounds.left + bounds.right) / 2;
rippleDrawable.setHotspotBounds(center, bounds.top, center, bounds.bottom);
}
return rippleDrawable;
}
/**
* @param facade apply the facade to us
*/
void applyFacade(DayViewFacade facade) {
this.isDecoratedDisabled = facade.areDaysDisabled();
setEnabled();
setCustomBackground(facade.getBackgroundDrawable());
setSelectionDrawable(facade.getSelectionDrawable());
// Facade has spans
List<DayViewFacade.Span> spans = facade.getSpans();
if (!spans.isEmpty()) {
String label = getLabel();
SpannableString formattedLabel = new SpannableString(getLabel());
for (DayViewFacade.Span span : spans) {
formattedLabel.setSpan(span.span, 0, label.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
setText(formattedLabel);
}
// Reset in case it was customized previously
else {
setText(getLabel());
}
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
calculateBounds(right - left, bottom - top);
regenerateBackground();
}
private void calculateBounds(int width, int height) {
final int radius = Math.min(height, width);
final int offset = Math.abs(height - width) / 2;
// Lollipop platform bug. Circle drawable offset needs to be half of normal offset
final int circleOffset = Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP ? offset / 2 : offset;
if (width >= height) {
tempRect.set(offset, 0, radius + offset, height);
circleDrawableRect.set(circleOffset, 0, radius + circleOffset, height);
} else {
tempRect.set(0, offset, width, radius + offset);
circleDrawableRect.set(0, circleOffset, width, radius + circleOffset);
}
}
}
| [
"wenlong.feng@mi-me.com"
] | wenlong.feng@mi-me.com |
adaa7acb3704b3be23760ed823b0d33fd17f61a5 | 760a85f7b2145dd95cb71a6acf4e23148c590d83 | /HRMS/src/main/java/com/example/HRMS/entities/concretes/Talent.java | c4c94cc00da2a9d871c387196b2c55ab6386b498 | [] | no_license | candan9/hrms | 1ab734c80f2cb4213933b2cd72044b59f885ece7 | 5f65a4ba0500c748eea7a421fbf662ec5fb65336 | refs/heads/master | 2023-06-06T09:00:24.668623 | 2021-06-16T13:38:44 | 2021-06-16T13:38:44 | 366,365,986 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | package com.example.HRMS.entities.concretes;
import javax.persistence.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name="talents")
public class Talent {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@Column(name = "name")
private String name;
@ManyToOne()
@JsonIgnore()
@JoinColumn(name = "candidate_id")
private Candidate candidate;
} | [
"wastorist@gmail.com"
] | wastorist@gmail.com |
9a9cdc1fdef12e4d946d3c9bc7684b248bc4c7dd | 47a1618c7f1e8e197d35746639e4480c6e37492e | /src/oracle/retail/stores/pos/device/cidscreens/CIDScreenSession.java | 2395876869053c1bcc752fb9ee0a46390fa4fca1 | [] | no_license | dharmendrams84/POSBaseCode | 41f39039df6a882110adb26f1225218d5dcd8730 | c588c0aa2a2144aa99fa2bbe1bca867e008f47ee | refs/heads/master | 2020-12-31T07:42:29.748967 | 2017-03-29T08:12:34 | 2017-03-29T08:12:34 | 86,555,051 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,015 | java | /* ===========================================================================
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* ===========================================================================
* $Header: rgbustores/applications/pos/src/oracle/retail/stores/pos/device/cidscreens/CIDScreenSession.java /rgbustores_13.4x_generic_branch/1 2011/05/05 14:05:39 mszekely Exp $
* ===========================================================================
* NOTES
* <other useful comments, qualifications, etc.>
*
* MODIFIED (MM/DD/YY)
* cgreene 05/26/10 - convert to oracle packaging
* abondala 01/03/10 - update header date
*
* ===========================================================================
* $Log:
* 3 360Commerce 1.2 3/31/2005 4:27:27 PM Robert Pearse
* 2 360Commerce 1.1 3/10/2005 10:20:16 AM Robert Pearse
* 1 360Commerce 1.0 2/11/2005 12:10:00 PM Robert Pearse
*
* Revision 1.4 2004/04/08 20:33:03 cdb
* @scr 4206 Cleaned up class headers for logs and revisions.
*
*
* ===========================================================================
*/
package oracle.retail.stores.pos.device.cidscreens;
import java.beans.PropertyChangeSupport;
import oracle.retail.stores.foundation.manager.device.DeviceException;
import oracle.retail.stores.foundation.manager.device.InputDeviceSession;
import oracle.retail.stores.foundation.manager.ifc.device.DeviceModelIfc;
import oracle.retail.stores.foundation.manager.ifc.device.DeviceSessionIfc;
public class CIDScreenSession
extends InputDeviceSession
implements DeviceSessionIfc
{
DeviceModelIfc deviceModel = null;
//---------------------------------------------------------------------
/**
The property name for retreiving the Scanner Data
**/
//---------------------------------------------------------------------
public static final String CIDSCREEN_DATA = "CIDScreen data";
/**
* Constructor for CID screen session
*
*/
public CIDScreenSession()
{
super();
propertyChange = new PropertyChangeSupport(this);
}
//---------------------------------------------------------------------
/**
This method returns the device control, regardless of the
current device mode.
<P>
<B>Pre-conditions</B>
<UL>
<LI>The DeviceSession is not in use.
</UL>
<B>Post-conditions</B>
<UL>
<LI>The DeviceSession is in use.
</UL>
@return Object The device control managed by this DeviceSession.
@exception DeviceException is thrown if the device control is null;
*/
//---------------------------------------------------------------------
public Object getDevice() throws DeviceException
{
return null;
}
//---------------------------------------------------------------------
/**
Activate the device controlled by this DeviceSession. Activate
will enable the device and take exclusive access to the device.
If exclusive access cannot be obtained, activate will throw
a DeviceException.
<P>
Subclasses must provide an implementation of this method.
<P>
@param mode Access mode
@exception DeviceException thrown if device cannot be activated
**/
//---------------------------------------------------------------------
public void activate(String mode) throws DeviceException
{
}
//---------------------------------------------------------------------
/**
Deactivate the device controlled by this DeviceSession.
This method will release exclusive access to the device.
<P>
Subclasses must implement this method
<P>
@exception DeviceException thrown if device cannot be deactivated
**/
//---------------------------------------------------------------------
public void deactivate() throws DeviceException
{
}
//---------------------------------------------------------------------
/**
Forces the LineDisplay control to close.
@exception DeviceException is thrown if the shutDown cannot be completed.
**/
//---------------------------------------------------------------------
public void shutDown() throws DeviceException
{
}
//---------------------------------------------------------------------
/**
Get the Data model for the input device.
@return DeviceModelIfc data Model for the CIDScreen
@throws DeviceException if the mode is invalid
or the mode cannot be set.
*/
//---------------------------------------------------------------------
public DeviceModelIfc getDeviceModel() throws DeviceException
{
return deviceModel;
}
//---------------------------------------------------------------------
/**
Set the Data model for the input device.
@param DeviceModelIfc data Model from the CIDScreen
@throws DeviceException if the mode is invalid
or the mode cannot be set.
*/
//---------------------------------------------------------------------
public void setDeviceModel(DeviceModelIfc deviceModel) throws DeviceException
{
this.deviceModel = deviceModel;
propertyChange.firePropertyChange(
CIDSCREEN_DATA,
null,
deviceModel);
}
//---------------------------------------------------------------------
/**
Enables/disables the device and data event.
@param enable true to enable, false to disable.
@throws DeviceException if the device cannot be
enabled/disabled.
*/
//---------------------------------------------------------------------
public void setEnabled(boolean enable) throws DeviceException
{
}
}
| [
"Ignitiv021@Ignitiv021-PC"
] | Ignitiv021@Ignitiv021-PC |
107571d4a5cd2aa309735be5804306a7edd1ccc6 | a0521257af8db50d2f120dd626e986418a5e5363 | /src/main/java/com/ajris/site/technology/TechnologyConfig.java | bc678c59b14c3abc1a14d00838c097edd9a1002f | [] | no_license | Ajris/site_backend | 9956bf1d6864974d4d39541c5efcf6333ab3fe09 | 48cd98be5142bdc0bc05f15a022a4ea848ab26da | refs/heads/master | 2020-06-16T11:35:23.283446 | 2019-09-29T13:30:33 | 2019-09-29T13:30:33 | 195,558,333 | 0 | 2 | null | 2019-09-27T10:59:37 | 2019-07-06T16:05:10 | Java | UTF-8 | Java | false | false | 223 | java | package com.ajris.site.technology;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan
public class TechnologyConfig {
}
| [
"hubiflower@gmail.com"
] | hubiflower@gmail.com |
32c11476870fe4538bcac802d216627d26cf3270 | 4f1498ce2bf94ad8c8f2a299951f815548ed6b91 | /app/src/main/java/com/example/user/task12/more/CreatGroupChat.java | 473c519b0b057bb363a00bc2a9d340b67e3f6f5b | [] | no_license | phamnoone/owschat | 101aafc3e8d634b9ffa6d224da2de1f433f6bd33 | 44e84c8cde5fd873ffab313bf843a17bcf2644e6 | refs/heads/master | 2020-12-25T22:28:31.325918 | 2016-05-05T04:46:03 | 2016-05-05T04:46:03 | 57,988,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,836 | java | package com.example.user.task12.more;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.user.task12.R;
import com.firebase.client.ChildEventListener;
import com.firebase.client.DataSnapshot;
import com.firebase.client.Firebase;
import com.firebase.client.FirebaseError;
import com.firebase.client.Query;
import com.firebase.client.ValueEventListener;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
/**
* Created by USER on 6/4/2015.
*/
public class CreatGroupChat extends ActionBarActivity {
private String FIREBASE_URL;
private Firebase mFirebaseRef;
private ValueEventListener mConnectedListener;
private String id;
private int temp=0,checkPass,checkid;
private String from;
Button bntCreat;
EditText txtIDGroupChat;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.create_group_chat);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
android.support.v7.app.ActionBar bar = getSupportActionBar();
bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#FFFFB567")));
android.support.v7.app.ActionBar actionBar = CreatGroupChat.this.getSupportActionBar();
actionBar.setTitle("CREAT GROUP CHAT");
bntCreat=(Button)findViewById(R.id.bntCreat);
txtIDGroupChat=(EditText)findViewById(R.id.txtIDGroupChat);
getData();
Intent intent=getIntent();
Bundle bundle=intent.getBundleExtra("DATA");
FIREBASE_URL=bundle.getString("URL");
// Setup our Firebase mFirebaseRef
mFirebaseRef = new Firebase(FIREBASE_URL).child("GroupChat");
bntCreat.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
id=txtIDGroupChat.getText().toString();
checkid=CheckId(id);
new AlertDialog.Builder(CreatGroupChat.this).setTitle("Confirm").setMessage("Are you true")
.setNegativeButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
checkid=CheckId(id);
CheckCreat();
dialog.cancel();
}
}).show();
}
});
}
private void getData() {
Intent intent=getIntent();
Bundle bundle=intent.getBundleExtra("DATA");
FIREBASE_URL=bundle.getString("URL");
from=bundle.getString("from");
}
private void CheckCreat(){
if (id.equals("")) Toast.makeText(CreatGroupChat.this,"Ban Can Nhap Thong Tin Day Du!",Toast.LENGTH_LONG).show();
else if (checkid==1) {Toast.makeText(CreatGroupChat.this,"Nhom Da Ton Tai!",Toast.LENGTH_LONG).show();
checkid=0;
temp=0;
}
else {
DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date=new Date();
String stringDate=dateFormat.format(date);
Group group=new Group(id,stringDate);
mFirebaseRef.push().setValue(group);
new AlertDialog.Builder(CreatGroupChat.this).setTitle("Succeed")
.setMessage("Group has been created")
.setNegativeButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
CreatGroupChat.this.finish();
}
}).show();
}
}
private int CheckId(String id){
Query query = mFirebaseRef.orderByChild("id").equalTo(id);
query.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
Map<String, Object> data = (Map<String, Object>) dataSnapshot.getValue();
temp = 1;
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});
return temp;
}
@Override
public void onStart() {
super.onStart();
// Finally, a little indication of connection status
mConnectedListener = mFirebaseRef.getRoot().child(".info/connected").addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
boolean connected = (Boolean) dataSnapshot.getValue();
if (connected) {
Toast.makeText(CreatGroupChat.this, "Connected to Firebase", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(CreatGroupChat.this, "Disconnected from Firebase", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCancelled(FirebaseError firebaseError) {
// No-op
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_simple, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
switch (item.getItemId()){
case R.id.action_close:
close();
return true;
default:return super.onOptionsItemSelected(item);
}
}
private void close(){
CreatGroupChat.this.finish();
}
}
| [
"Thanh Phạm"
] | Thanh Phạm |
a78068d4363bcbb86b95980892ec2343771b6eae | a509dee96024169d931cc0e53564bad7de5ecc16 | /src/main/java/ar/com/ThreadV2.java | 80dc864cfb29c3bfd7aae09fdb2d048e83dd62f1 | [] | no_license | ih4t3youall/javanio | eac1b1994b0f8d86e51f734847ea9e952165a397 | 71b82d49e9adf81adaece4ae4e366b24ffde459b | refs/heads/master | 2020-12-14T03:06:58.805957 | 2020-01-20T13:20:42 | 2020-01-20T13:20:42 | 234,616,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,674 | java | package ar.com;
import java.io.IOException;
import java.net.Socket;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
public class ThreadV2 implements Runnable{
private SocketChannel socketChannel;
public ThreadV2(SocketChannel socketChannel){
System.out.println("thread created");
this.socketChannel = socketChannel;
}
public void run(){
String remoteName = socketChannel.socket().getRemoteSocketAddress().toString();
while(true) {
int numRead = -1;
ByteBuffer buffer = ByteBuffer.allocate(1024);
try {
numRead = socketChannel.read(buffer);
} catch (IOException e) {
e.printStackTrace();
}
if (numRead == -1) {
Socket socket = socketChannel.socket();
SocketAddress remoteAddr = socket.getRemoteSocketAddress();
System.out.println("Connection closed by client: " + remoteAddr);
try {
socketChannel.close();
break;
} catch (IOException e) {
e.printStackTrace();
}
}
if(numRead > 0) {
byte[] data = new byte[numRead];
System.arraycopy(buffer.array(), 0, data, 0, numRead);
String string = new String(data);
if(string != "")
System.out.println("Got: " + string + " from " + remoteName);
buffer.clear();
}
}
}
}
| [
"ih4t3youall@gmail.com"
] | ih4t3youall@gmail.com |
d5ad8efd286f056a82a228926f8942fc400fa8e1 | 766e2d1208a8efd5cf0a448758cbe1682e35d039 | /app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/google/android/things/contrib/driver/rainbowhat/R.java | af6421852612bd24d0d2e4fc6f5a5111e3d07177 | [
"Apache-2.0"
] | permissive | zachyam/servoGoose | 373d17b4f11b8916c0fee13d2a49f1f05e283f51 | b7e57e01fde676e89b71d8ea7a12f6292f7d5bbe | refs/heads/master | 2020-04-11T23:08:01.001580 | 2019-01-12T19:11:14 | 2019-01-12T19:11:14 | 162,157,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 291 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package com.google.android.things.contrib.driver.rainbowhat;
public final class R {
private R() {}
}
| [
"zach.yam@cognite.com"
] | zach.yam@cognite.com |
74a7b5d3365042dbd069b4a801331a02aeee669e | 65ab6aa333ff1cfd4ba32616cc91022042ee4a6e | /src/main/java/edu/kings/cs480/BluePrints/Database/Staff.java | f066f51690280ea3b61ce60b251b4cc59c7acd08 | [] | no_license | ahmed2006/BluePrints | 85a70f1ac22ac07dd1538f8281329e534b0a7e9b | 8daec0a16888cbb26459d9f8eddfc6bbd0886e64 | refs/heads/master | 2020-05-20T17:27:39.985077 | 2019-05-08T22:38:54 | 2019-05-08T22:38:54 | 185,688,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 166 | java | package edu.kings.cs480.BluePrints.Database;
public interface Staff<T> {
public String getName();
public T getStaffId();
public String getStaffEmail();
}
| [
"ahmedalanazi1239@kings.edu"
] | ahmedalanazi1239@kings.edu |
1577ddc9ffef6aad2c59789f490f0b4aa5d50f10 | 7d28d457ababf1b982f32a66a8896b764efba1e8 | /platform-dao/src/main/java/ua/com/fielden/platform/security/ServerAuthorisationModel.java | e68f628f0fd6fa63565c1949559d6c75017408fb | [
"MIT"
] | permissive | fieldenms/tg | f742f332343f29387e0cb7a667f6cf163d06d101 | f145a85a05582b7f26cc52d531de9835f12a5e2d | refs/heads/develop | 2023-08-31T16:10:16.475974 | 2023-08-30T08:23:18 | 2023-08-30T08:23:18 | 20,488,386 | 17 | 9 | MIT | 2023-09-14T17:07:35 | 2014-06-04T15:09:44 | JavaScript | UTF-8 | Java | false | false | 1,458 | java | package ua.com.fielden.platform.security;
import static ua.com.fielden.platform.error.Result.failuref;
import static ua.com.fielden.platform.error.Result.successful;
import static ua.com.fielden.platform.security.SecurityTokenInfoUtils.shortDesc;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import ua.com.fielden.platform.error.Result;
import ua.com.fielden.platform.security.provider.ISecurityTokenController;
import ua.com.fielden.platform.security.user.IUserProvider;
import ua.com.fielden.platform.security.user.User;
/**
* Server authorisation model, which controls access to methods with annotation {@link Authorise}.
*
* @author TG Team
*
*/
@Singleton
public class ServerAuthorisationModel extends AbstractAuthorisationModel {
protected final ISecurityTokenController controller;
private final IUserProvider userProvider;
@Inject
public ServerAuthorisationModel(final ISecurityTokenController controller, final IUserProvider userProvider) {
this.controller = controller;
this.userProvider = userProvider;
}
@Override
public Result authorise(final Class<? extends ISecurityToken> token) {
return User.system_users.VIRTUAL_USER.matches(userProvider.getUser()) ||
controller.canAccess(userProvider.getUser(), token) ? successful("Authorised")
: failuref("Permission denied due to token [%s] restriction.", shortDesc(token));
}
} | [
"oles.hodych@gmail.com"
] | oles.hodych@gmail.com |
5c800a5d029966f48db7241622be7b9f9f18c4e7 | 7aaa8ac003ac827af8758a4531a0985d65cdc32e | /src/main/java/fr/il_totore/custompotion/plugin/command/FunctionArgumentUsage.java | 5831a20e8a195d75c44dc19e9155cee118f4fdfe | [] | no_license | Iltotore/CustomPotionAPI | 55db426ed965f3ac14902f8403163f9270167e9b | b3310169f52865e7a0b60657df46be288eaf7b45 | refs/heads/master | 2022-12-07T01:38:22.101113 | 2020-08-27T17:51:25 | 2020-08-27T17:51:25 | 290,841,552 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 992 | java | package fr.il_totore.custompotion.plugin.command;
import java.util.ArrayList;
import java.util.List;
public abstract class FunctionArgumentUsage implements ArgumentUsage{
private boolean optional;
public FunctionArgumentUsage(boolean optional) {
this.optional = optional;
}
@Override
public String getUsage() {
String[] args = getArguments();
String usage = "";
usage = "<" + args[0];
for(int i = 1; i < args.length; i++) {
usage = usage + "|" + args[i];
}
usage = usage + "]";
return usage;
}
@Override
public boolean isOptional() {
return optional;
}
@Override
public List<String> getTabArguments(String tab) {
List<String> completion = new ArrayList<>();
for(String arg : apply()) {
System.out.println(arg + "?=" + tab);
if(arg.toLowerCase().startsWith(tab.toLowerCase())) completion.add(arg);
}
return completion;
}
@Override
public String[] getArguments() {
return new String[0];
}
public abstract List<String> apply();
}
| [
"rafbodaha@gmail.com"
] | rafbodaha@gmail.com |
c87b3be6bc5c907df63fde5e5e4f817cf792f6e6 | b3c827a95ee76392eff6ed764db6f17b43a26c7a | /src/pack2/Java4.java | 08b5d25cd7147ee7e7e59dcf239d2684d4e7af4c | [] | no_license | amolujagare123/730March21Java | 0a54cba8d8eb89a8a7a42a98d97fb0de662460f6 | c24f182081aaf6a66b5fe59d7415f8b847ffaec9 | refs/heads/master | 2023-05-04T12:42:01.957191 | 2021-05-17T09:27:47 | 2021-05-17T09:27:47 | 349,124,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 795 | java | package pack2;
import StaticNFinal.StaticMethods;
import static StaticNFinal.StaticMethods.myMethod2;
import static StaticNFinal.StaticMethods.staticMethod2;
//import static StaticNFinal.StaticMethods.*;
public class Java4 {
public int a4;
public float f4;
public char c4;
public String str4; // data members
public void display4() // member function
{
System.out.println("a="+a4);
System.out.println("f="+f4);
System.out.println("c="+c4);
System.out.println("str="+str4);
}
public static void main(String[] args) {
StaticMethods ob = new StaticMethods();
myMethod2(); // static method called using object
myMethod2();
staticMethod2();
System.out.println("");
}
}
| [
"amolujagare@gmail.com"
] | amolujagare@gmail.com |
65efda69f396ec6c4c0e7c1bf265118ea3ce096b | dcaf6258fc470eea25334fc603e0d08aa22b30c8 | /HomeWorkDay4/src/IndividualUserManager.java | 54764054e25939213c6706f36b1b7a79d4839dd1 | [] | no_license | ahmetburakfirat/javaCampDay4HomeWork3 | 01abd44fc13477bb257c1a39ef2f16ed9a73b96a | 677b8c6bb3319e5a9b5dd22ddeec45a931f00bff | refs/heads/master | 2023-05-01T22:42:45.692297 | 2021-05-16T17:16:06 | 2021-05-16T17:16:06 | 367,942,493 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 704 | java | public class IndividualUserManager implements UserManager{
@Override
public void add(User user) {
if(UserCheckService.CheckIfRealPerson(user)) {
System.out.println(user.getFirstName() + " " + user.getLastName() + " isimli kullanıcı bilgileri eklendi.");
}else {
System.out.println("Bilgiler doğrulanamadı.");
}
}
@Override
public void update(User user) {
System.out.println(user.getFirstName() + " " + user.getLastName() + " isimli kullanıcı bilgileri güncellendi.");
}
@Override
public void delete(User user) {
System.out.println(user.getFirstName() + " " + user.getLastName() + " isimli kullanıcı bilgileri silindi.");
}
}
| [
"ahmet@192.168.1.20"
] | ahmet@192.168.1.20 |
24141a3c91b28045bdd310dafef93c6d486879ae | e4af14ed158db19852fff05e05d2723f130b422e | /SortArithmetic/src/MaoPao.java | 8acc2226f26faab8eece1ed45d69f6c83635d8aa | [] | no_license | Anakinliu/IJCE_Projects | 86a4c3f19b846d4686a41d91788900738d81e40c | cda6a3721e80af777d3899cc7d2ea36ce6b8777e | refs/heads/master | 2021-07-06T14:35:35.361909 | 2020-08-14T13:44:26 | 2020-08-14T13:44:26 | 69,360,946 | 0 | 0 | null | 2020-10-13T01:11:46 | 2016-09-27T13:42:08 | Java | UTF-8 | Java | false | false | 768 | java | import java.util.Arrays;
/*
AUTHOR: linux
TIME: 2020/1/4
GOOD LUCK AND NO BUG.
*/
public class MaoPao {
public static void sort(int[] arr) {
// 大到小
int size = arr.length;
for (int i = 0; i < size; i++) {
// j从0开始哦
for (int j = size-1; j > i; j--) {
// 改为<就是小到大
if (arr[j] > arr[j-1]) {
int temp = arr[j];
arr[j] = arr[j - 1];
arr[j - 1] = temp;
}
}
}
}
public static void main(String[] args) {
System.out.println(Arrays.toString(ARRAY.arr));
sort(ARRAY.arr);
System.out.println(Arrays.toString(ARRAY.arr));
}
}
| [
"gugeliuyinquan@gmail.com"
] | gugeliuyinquan@gmail.com |
188896fcfdb1f2765c1f4cd652d2f18d8f270b34 | 60a2ce96480da3c3fb46ddc4a7aad238d0e7bd2f | /src/main/java/com/dh/dp/class04_抽象工厂/Notebook.java | 0c619214f8c3fd786a9a7258ae5f4a5577d1a626 | [] | no_license | fxyz10/DesignPatterns | 892bf14700c0f1d38fcec0513be1d0a9b35a7fe1 | 822950fb85c06716acef4770396e957d7ddf0f0a | refs/heads/master | 2023-02-25T02:27:45.256909 | 2021-01-27T13:15:13 | 2021-01-27T13:15:13 | 333,425,089 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 102 | java | package com.dh.dp.class04_抽象工厂;
public abstract class Notebook {
abstract void work();
}
| [
"1019799967@qq.com"
] | 1019799967@qq.com |
85d0588d44cc8aa53ea658cca57366d858c43a66 | 0b177ca5d8cd7fc401ab96d2958a561456d522b0 | /src/main/java/com/job/elastic/springelasticdemo/model/ProductEntity.java | bb9b427d42c7a24e697cdb04ec05357a82cb6364 | [] | no_license | RAZhdanov/ElasticSearch-Council | 757bc86f13e0689862c412021ec7f65e9b470d84 | 93ea0b30c3518bb8313927115fa7490a8c6bf122 | refs/heads/main | 2022-12-27T09:19:38.361508 | 2020-10-11T18:52:18 | 2020-10-11T18:52:18 | 303,186,272 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,309 | java | package com.job.elastic.springelasticdemo.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
/**
* Holds the details of product.
*/
@Data
@JacksonXmlRootElement(localName = "product")
@Document(indexName = "product")
public class ProductEntity {
@Id
@JacksonXmlProperty(isAttribute = true)
private Integer id;
@JacksonXmlProperty(localName = "category_id")
@Field(name="categoryId", type = FieldType.Integer)
private Integer categoryId;
@JacksonXmlProperty(localName = "name")
@Field(type = FieldType.Text)
private String name;
@JacksonXmlProperty(localName = "description")
@Field(type = FieldType.Text)
private String description;
@JacksonXmlProperty(localName = "price")
@Field(type = FieldType.Integer)
private Integer price;
@JacksonXmlProperty(localName = "picture")
@Field(type = FieldType.Text)
private String picture;
}
| [
"ramzes.zhdanov@mail.ru"
] | ramzes.zhdanov@mail.ru |
07bf9d63ba2df8774c458b0bbe6ba55221a86776 | 9cde32536f835b6696e2b55176c5e498bb15936f | /app/src/main/java/com/example/sivan/hackidc2017/MainActivity.java | 1ff241896667ef0fa677b629f4d47604c4644138 | [] | no_license | yairm91/meetpoint | 35ce3a14f2fc253b0aade042aac117eaa82087c0 | 4a191710f0c4c4cda87a5cb32d24ef5fe1f728b1 | refs/heads/master | 2021-01-20T03:53:37.981137 | 2017-04-30T12:28:27 | 2017-04-30T12:28:27 | 89,600,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,575 | java | package com.example.sivan.hackidc2017;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.example.R;
import com.example.amit.Group;
import com.example.amit.User;
import io.realm.RealmList;
public class MainActivity extends AppCompatActivity {
Group[] existingGroups = new Group[3];
String[] strings = new String[3];
ImageView profilePicImageView;
ImageView editImageView;
ImageView settingsImageView;
TextView meTextView;
ListView listView;
Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RealmList<User> userRealmList1 = new RealmList<User>();
userRealmList1.add(new User("Amit", "091-4017401"));
userRealmList1.add(new User("Roni", "035-1589174"));
RealmList<User> userRealmList2 = new RealmList<User>();
userRealmList2.add(new User("Yair", "065-14590303"));
userRealmList2.add(new User("Dar", "031-01758233"));
userRealmList2.add(new User("Sivan", "088-98665467"));
existingGroups[0] = new Group("no members");
existingGroups[1] = new Group("some members", userRealmList1);
existingGroups[2] = new Group("more members", userRealmList2);
strings[0] = "Army guys\n\nAmy, Dana, Amit, Liad";
strings[1] = "BFF\n\nLiron";
strings[2] = "EilatIDC 2017\n\nAlex, Adar, Ben, Gili, Noam, Yair";
ArrayAdapter adapter = new ArrayAdapter<String>(this, R.layout.activity_listview, strings);
profilePicImageView = (ImageView) findViewById(R.id.my_profile_pic);
editImageView = (ImageView) findViewById(R.id.edit_pic);
meTextView = (TextView) findViewById(R.id.me_text);
listView = (ListView) findViewById(R.id.group_list);
settingsImageView = (ImageView) findViewById(R.id.settings_pic);
button = (Button) findViewById(R.id.create_new_group_button);
listView.setAdapter(adapter);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity();
}
});
}
private void startActivity() {
Intent intent = new Intent(this, SwipeActivity.class);
startActivity(intent);
}
}
| [
"sivan.manor@gmail.com"
] | sivan.manor@gmail.com |
bfc01ac841ef23c6ab12254b1da03a1b616db54c | c98ad0cc164b3e5ff2f49c9298a4eb1d8744e2db | /src/InterviwS/WritExcelExp1.java | 7fc07acfadb3355829b065a932470c15650aedc1 | [] | no_license | anilkumartesting43/purushottam | bb0fd9c4cd9348fe0075e841bb2580c8243b2fcb | dd329f01dbcb517ed4bfdb6adea8c53988c1979c | refs/heads/master | 2022-12-08T06:41:55.748856 | 2020-08-24T12:02:36 | 2020-08-24T12:02:36 | 289,883,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 433 | java | package InterviwS;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class WritExcelExp1 {
public static void main(String[] args) throws IOException {
File fle =new File("C:\\Excel\\Anil.123.xlsx");
FileInputStream fis=new FileInputStream(fle);
XSSFWorkbook wb=new XSSFWorkbook(fis);
}
}
| [
"anilkumartesting43@gmail.com"
] | anilkumartesting43@gmail.com |
f41ff0621942404cce63c4dd244695d9b9f97bca | d9969df37e404d8425a986b416943838893c3db2 | /QuanLy/XuLyNgayThangNam/src/xulyngaythangnam/DeMo.java | f7d72d448e82e72dc1b1e3ccb00fe20670ede2a9 | [] | no_license | duansuperman/Java | ce6ffacc388d9de990170d98bd8c7ab016e07ac1 | f5d00130e8d3ea266af12358e6fcd594e04b9987 | refs/heads/master | 2021-03-10T06:43:53.820856 | 2020-03-10T23:46:16 | 2020-03-10T23:46:16 | 246,430,717 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,115 | java | package xulyngaythangnam;
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class DeMo {
public static void main(String[] args) {
//Khai báo Calendar
Calendar cal = Calendar.getInstance();
//Lấy ngày
int ngay = cal.get(Calendar.DAY_OF_MONTH);
System.out.println("Ngay hien tai "+ ngay);
//Lấy tháng
int thang = cal.get(Calendar.MONTH);
System.out.println("Thang hien tai "+thang);
//Lấy năm
int nam = cal.get(Calendar.YEAR);
System.out.println("Nam hien tai "+nam);
//Lấy ngày tháng năm khi chua format theo dd/MM/yyyy
java.util.Date d = cal.getTime();
System.out.println("Chua format "+d);
//format theo SimpleDateFormat
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
System.out.println("Ngaythang sau khi format "+ sdf.format(d));
SimpleDateFormat sdf1 = new SimpleDateFormat("d/M/yyyy");
System.out.println("Ngaythang sau khi format "+ sdf1.format(d));
SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
System.out.println("Ngaythang sau khi format "+ sdf2.format(d));
}
}
| [
"duansupper@gmail.com"
] | duansupper@gmail.com |
68dc72a94779a0022a8ae58b594b95086994c8af | 1fae3bf4c44168f7b52b9887be23594c6c0e8539 | /src/main/java/com/github/lwhite1/tablesaw/splitting/dates/SplitUtils.java | aaf4cbe27144e479194b7b904a42512a2d12f437 | [
"Apache-2.0"
] | permissive | lomuroe/tablesaw | ce5d0ea749b84fa6900676d889aa7a6e22f7ccd1 | 34dea1425e65b547934f61350252dac2d71fb7a8 | refs/heads/master | 2020-12-02T19:50:32.583785 | 2017-07-25T07:47:27 | 2017-07-25T07:47:27 | 96,398,001 | 1 | 0 | null | 2017-07-06T06:49:44 | 2017-07-06T06:49:44 | null | UTF-8 | Java | false | false | 3,788 | java | package com.github.lwhite1.tablesaw.splitting.dates;
import com.github.lwhite1.tablesaw.columns.packeddata.PackedLocalDate;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.Month;
import java.time.temporal.ChronoField;
import java.util.function.Function;
/**
*
*/
public class SplitUtils {
public static LocalDateSplitter byYear = PackedLocalDate::getYear;
public static LocalDateSplitter byMonth = PackedLocalDate::getMonthValue;
public static LocalDateSplitter byDayOfMonth = PackedLocalDate::getDayOfMonth;
public static LocalDateSplitter byDayOfYear = PackedLocalDate::getDayOfYear;
public static LocalDateSplitter byDayOfWeek = packedLocalDate ->
PackedLocalDate.getDayOfWeek(packedLocalDate).getValue();
public static LocalDateSplitter byQuarter = PackedLocalDate::getQuarter;
public static Function<Comparable, Object> byWeek = comparable -> {
if (comparable instanceof LocalDate) {
return ((LocalDate) comparable).get(ChronoField.ALIGNED_WEEK_OF_YEAR);
} else if (comparable instanceof LocalDateTime) {
return ((LocalDateTime) comparable).get(ChronoField.ALIGNED_WEEK_OF_YEAR);
} else {
throw new IllegalArgumentException("Date function called on non-date column");
}
};
public static Function<Comparable, Object> byHour = comparable -> {
if (comparable instanceof LocalDateTime) {
return ((LocalDateTime) comparable).get(ChronoField.HOUR_OF_DAY);
} else {
throw new IllegalArgumentException("Time function called on non-time column");
}
};
public static Function<Comparable, Object> bySecondOfMinute = comparable -> {
if (comparable instanceof LocalDateTime) {
return ((LocalDateTime) comparable).get(ChronoField.SECOND_OF_MINUTE);
} else {
throw new IllegalArgumentException("Time function called on non-time column");
}
};
public static Function<Comparable, Object> bySecondOfDay = comparable -> {
if (comparable instanceof LocalDateTime) {
return ((LocalDateTime) comparable).get(ChronoField.SECOND_OF_DAY);
} else {
throw new IllegalArgumentException("Time function called on non-time column");
}
};
public static Function<Comparable, Object> byMinuteOfHour = comparable -> {
if (comparable instanceof LocalDateTime) {
return ((LocalDateTime) comparable).get(ChronoField.MINUTE_OF_HOUR);
} else {
throw new IllegalArgumentException("Time function called on non-time column");
}
};
public static Function<Comparable, Object> byMinuteOfDay = comparable -> {
if (comparable instanceof LocalDateTime) {
return ((LocalDateTime) comparable).get(ChronoField.MINUTE_OF_HOUR);
} else {
throw new IllegalArgumentException("Time function called on non-time column");
}
};
private static int getQuarter(Month month) {
int monthValue = month.getValue();
if (monthValue <= 3) {
return 1;
} else if (monthValue <= 6) {
return 2;
} else if (monthValue <= 9) {
return 3;
} else {
return 4;
}
}
/*
BY_QUARTER_AND_YEAR, // 1974-Q1; 1974-Q2; etc.
BY_MONTH_AND_YEAR, // 1974-01; 1974-02; 1974-03; etc.
BY_WEEK_AND_YEAR, // 1956-51; 1956-52;
BY_DAY_AND_YEAR, // 1990-364; 1990-365;
BY_DAY_AND_MONTH, // 12-03
BY_DAY_AND_MONTH_AND_YEAR, // 2003-04-15
BY_DAY_AND_WEEK_AND_YEAR, // 1993-48-6
BY_DAY_AND_WEEK, // 52-1 to 52-7
BY_HOUR_AND_DAY, //
BY_MINUTE_AND_HOUR, // 23-49
*/
}
| [
"ljw1001@gmail.com"
] | ljw1001@gmail.com |
0adc2a9fe01e7193cdf7fbd9d75eabadae32edcf | dccbb1841351be743e5f1ed37b8aa3574f8f17b7 | /traveller-common/src/main/java/org/dmly/traveller/app/infra/exception/flow/ValidationException.java | 7204b40ae88c62b0f56e3e75f6c3efb7a916955d | [] | no_license | DmitriyLy/traveller | 2b700b6f80c484e1e7e0a7dfa05479401e9ee314 | 10ee8dba98cb143599db18987feada1361f3a3bd | refs/heads/master | 2022-06-16T19:48:57.231817 | 2019-12-12T15:08:30 | 2019-12-12T15:08:30 | 206,075,850 | 0 | 0 | null | 2022-05-20T21:16:39 | 2019-09-03T12:49:03 | Java | UTF-8 | Java | false | false | 281 | java | package org.dmly.traveller.app.infra.exception.flow;
import org.dmly.traveller.common.infra.exception.FlowException;
public class ValidationException extends FlowException {
public ValidationException(String message, Throwable cause) {
super(message, cause);
}
}
| [
"dmitriy.lisay@gmail.com"
] | dmitriy.lisay@gmail.com |
dfc2205592b180b9d08957cabd8b0bbde3128fba | bcc8ccbaf833f076b41d3f7ec22bc13ac8d8409d | /src/game/ui/InfoPane.java | 472c53cf8a9bad568d4b0846b81a229f5a43e49d | [] | no_license | mrEnthusiasm/Game | 4bc6f8cf25d8d1ccd8449c738ad511d3cde67a32 | d0c13420f16d6136a6d13468b61ff125a9ba4df1 | refs/heads/master | 2021-01-20T05:52:12.895391 | 2015-06-23T23:41:42 | 2015-06-23T23:41:42 | 35,637,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,591 | java | package game.ui;
import game.logic.Attack;
import game.logic.Terrain;
import game.player.Player;
import java.util.Iterator;
import javafx.beans.binding.Bindings;
import javafx.geometry.Insets;
import javafx.geometry.VPos;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontPosture;
import javafx.scene.text.Text;
import javafx.scene.text.TextFlow;
public class InfoPane extends Pane {
private final ImageView infoPic = new ImageView();
private Image pic;
private final ImageView heartPic = new ImageView();
private Image heart;
private final ImageView armorPic = new ImageView();
private Image armor;
private final Text nameText = new Text();
private final Text healthText = new Text();
private final Text armorText = new Text();
private final Text agilityRatingText = new Text();
private final Text movementText = new Text();
private final Text descriptionText = new Text();
private final TextFlow descriptionTextFlow = new TextFlow();
private final TextFlow defensiveText = new TextFlow();
private final VBox attacks = new VBox();
private final Text terrainName = new Text();
private final Text traversable = new Text();
private final Text cover = new Text();
private final double interNodePadding = 5.0;
public InfoPane() {
// top, right, bottom, left
setPadding(new Insets(3.0));
// create children
getChildren().addAll(infoPic, defensiveText, attacks, descriptionTextFlow,
terrainName, traversable, cover);
// set player children properties
infoPic.xProperty().set(this.getPadding().getLeft());
infoPic.yProperty().set(this.getPadding().getTop());
infoPic.fitWidthProperty().bind(this.widthProperty().multiply(0.35));
infoPic.fitHeightProperty().bind(infoPic.fitWidthProperty());
defensiveText.getChildren().addAll(nameText, heartPic, healthText,
armorPic, armorText, agilityRatingText, movementText);
defensiveText.layoutXProperty().bind(
infoPic.xProperty().add(infoPic.fitWidthProperty().add(10.0)));
defensiveText.layoutYProperty().bind(infoPic.yProperty());
defensiveText.setLineSpacing(3.0);
// TODO going to have to bind this to whatever we find font size to
heartPic.fitHeightProperty().set(20.0);
heartPic.setPreserveRatio(true);
armorPic.fitHeightProperty().set(18.0);
armorPic.setPreserveRatio(true);
nameText.setFont(new Font(40.0));
healthText.setFont(new Font(20.0));
healthText.setFill(Color.RED);
armorText.setFont(new Font(20.0));
armorText.setFill(Color.BLUE);
agilityRatingText.setFont(new Font(18.0));
movementText.setFont(new Font(18.0));
attacks.setSpacing(3.0);
attacks.layoutXProperty().bind(infoPic.xProperty());
attacks.layoutYProperty().bind(
infoPic.yProperty().add(
infoPic.fitHeightProperty().add(interNodePadding)));
attacks.prefWidthProperty().bind(this.widthProperty());
descriptionText.setFont(Font.font("", FontPosture.ITALIC, 12.0));
descriptionTextFlow.prefWidthProperty().bind(this.widthProperty());
descriptionTextFlow.layoutXProperty().bind(infoPic.xProperty());
descriptionTextFlow.layoutYProperty().bind(
Bindings.add(attacks.layoutYProperty(),
attacks.heightProperty()));
descriptionTextFlow.getChildren().add(descriptionText);
// set terrain properties
terrainName.setTextOrigin(VPos.TOP);
terrainName.setTranslateX(this.getPadding().getLeft());
terrainName.setTranslateY(this.getPadding().getTop());
terrainName.setFont(new Font(30.0));
traversable.setTextOrigin(VPos.TOP);
traversable.xProperty().bind(
terrainName.xProperty().add(this.getPadding().getLeft()));
traversable.yProperty().bind(
terrainName.yProperty().add(
terrainName.getFont().getSize() + interNodePadding));
traversable.setFont(new Font(20.0));
cover.setTextOrigin(VPos.TOP);
cover.xProperty().bind(
terrainName.xProperty().add(this.getPadding().getLeft()));
cover.yProperty().bind(
traversable.yProperty().add(
traversable.getFont().getSize() + interNodePadding));
cover.setFont(new Font(20.0));
}
public void setPlayer(Player curPlayer) {
pic = new Image(curPlayer.getInfoPicLocation());
infoPic.setImage(pic);
heart = new Image("resources/images/heart8bit.png");
heartPic.setImage(heart);
armor = new Image("resources/images/shield.png");
armorPic.setImage(armor);
nameText.setText(curPlayer.getName() + "\n");
healthText.textProperty().bind(
Bindings.format(" %d ", curPlayer.getHealth()));
armorText.textProperty().bind(
Bindings.format(" %d\n", curPlayer.getArmorRating()));
agilityRatingText.textProperty().bind(
Bindings.format("agility rating %d\n",
curPlayer.getAgilityRating()));
movementText.textProperty().bind(
Bindings.format("move distance %d\n",
(int) curPlayer.getMaxMoveDistance()));
descriptionText.setText(curPlayer.getDescription());
Attack meleeAttack;
attacks.getChildren().clear();
meleeAttack = curPlayer.getMelee();
if (meleeAttack != null) {
AttackInfoPane meleeInfo = new AttackInfoPane(meleeAttack);
attacks.getChildren().add(meleeInfo);
}
Attack rangedAttack = curPlayer.getRanged();
if (rangedAttack != null) {
AttackInfoPane rangedInfo = new AttackInfoPane(rangedAttack);
attacks.getChildren().add(rangedInfo);
}
Attack attack;
Iterator<Attack> specialAttackItr = curPlayer.getSpecials().iterator();
while (specialAttackItr.hasNext()) {
attack = specialAttackItr.next();
AttackInfoPane attackInfo = new AttackInfoPane(attack);
attacks.getChildren().add(attackInfo);
}
}
public void clear() {
infoPic.setImage(null);
heartPic.setImage(null);
armorPic.setImage(null);
nameText.setText("");
healthText.textProperty().unbind();
healthText.setText("");
armorText.textProperty().unbind();
armorText.setText("");
agilityRatingText.textProperty().unbind();
agilityRatingText.setText("");
movementText.textProperty().unbind();
movementText.setText("");
attacks.getChildren().clear();
descriptionText.setText("");
terrainName.setText("");
traversable.setText("");
cover.setText("");
}
public void setTerrain(Terrain terrain) {
terrainName.setText(terrain.toString());
if (terrain.isTraversable()) {
traversable.setText("traversable");
} else {
traversable.setText("not traversable");
}
if (terrain.providesCover()) {
cover.setText("provides cover");
} else {
cover.setText("does not provide cover");
}
}
}
| [
"scahamidit@gmail.com"
] | scahamidit@gmail.com |
81608077f982ff769af12ae55c85329938bcbc64 | 6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386 | /google/cloud/bigquery/reservation/v1beta1/google-cloud-bigquery-reservation-v1beta1-java/grpc-google-cloud-bigquery-reservation-v1beta1-java/src/main/java/com/google/cloud/bigquery/reservation/v1beta1/ReservationServiceGrpc.java | cf5f3c98673af6a1b1ac554c6668981bb34fb3dd | [
"Apache-2.0"
] | permissive | oltoco/googleapis-gen | bf40cfad61b4217aca07068bd4922a86e3bbd2d5 | 00ca50bdde80906d6f62314ef4f7630b8cdb6e15 | refs/heads/master | 2023-07-17T22:11:47.848185 | 2021-08-29T20:39:47 | 2021-08-29T20:39:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 127,545 | java | package com.google.cloud.bigquery.reservation.v1beta1;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
* <pre>
* This API allows users to manage their flat-rate BigQuery reservations.
* A reservation provides computational resource guarantees, in the form of
* [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
* unit of computational power in BigQuery, and serves as the basic unit of
* parallelism. In a scan of a multi-partitioned table, a single slot operates
* on a single partition of the table. A reservation resource exists as a child
* resource of the admin project and location, e.g.:
* `projects/myproject/locations/US/reservations/reservationName`.
* A capacity commitment is a way to purchase compute capacity for BigQuery jobs
* (in the form of slots) with some committed period of usage. A capacity
* commitment resource exists as a child resource of the admin project and
* location, e.g.:
* `projects/myproject/locations/US/capacityCommitments/id`.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: google/cloud/bigquery/reservation/v1beta1/reservation.proto")
public final class ReservationServiceGrpc {
private ReservationServiceGrpc() {}
public static final String SERVICE_NAME = "google.cloud.bigquery.reservation.v1beta1.ReservationService";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation> getCreateReservationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateReservation",
requestType = com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.Reservation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation> getCreateReservationMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.Reservation> getCreateReservationMethod;
if ((getCreateReservationMethod = ReservationServiceGrpc.getCreateReservationMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getCreateReservationMethod = ReservationServiceGrpc.getCreateReservationMethod) == null) {
ReservationServiceGrpc.getCreateReservationMethod = getCreateReservationMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.Reservation>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateReservation"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.Reservation.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("CreateReservation"))
.build();
}
}
}
return getCreateReservationMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse> getListReservationsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListReservations",
requestType = com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse> getListReservationsMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest, com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse> getListReservationsMethod;
if ((getListReservationsMethod = ReservationServiceGrpc.getListReservationsMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getListReservationsMethod = ReservationServiceGrpc.getListReservationsMethod) == null) {
ReservationServiceGrpc.getListReservationsMethod = getListReservationsMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest, com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListReservations"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("ListReservations"))
.build();
}
}
}
return getListReservationsMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation> getGetReservationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetReservation",
requestType = com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.Reservation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation> getGetReservationMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.Reservation> getGetReservationMethod;
if ((getGetReservationMethod = ReservationServiceGrpc.getGetReservationMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getGetReservationMethod = ReservationServiceGrpc.getGetReservationMethod) == null) {
ReservationServiceGrpc.getGetReservationMethod = getGetReservationMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.Reservation>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetReservation"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.Reservation.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("GetReservation"))
.build();
}
}
}
return getGetReservationMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest,
com.google.protobuf.Empty> getDeleteReservationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteReservation",
requestType = com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest.class,
responseType = com.google.protobuf.Empty.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest,
com.google.protobuf.Empty> getDeleteReservationMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest, com.google.protobuf.Empty> getDeleteReservationMethod;
if ((getDeleteReservationMethod = ReservationServiceGrpc.getDeleteReservationMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getDeleteReservationMethod = ReservationServiceGrpc.getDeleteReservationMethod) == null) {
ReservationServiceGrpc.getDeleteReservationMethod = getDeleteReservationMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest, com.google.protobuf.Empty>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteReservation"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("DeleteReservation"))
.build();
}
}
}
return getDeleteReservationMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation> getUpdateReservationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateReservation",
requestType = com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.Reservation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation> getUpdateReservationMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.Reservation> getUpdateReservationMethod;
if ((getUpdateReservationMethod = ReservationServiceGrpc.getUpdateReservationMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getUpdateReservationMethod = ReservationServiceGrpc.getUpdateReservationMethod) == null) {
ReservationServiceGrpc.getUpdateReservationMethod = getUpdateReservationMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.Reservation>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateReservation"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.Reservation.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("UpdateReservation"))
.build();
}
}
}
return getUpdateReservationMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getCreateCapacityCommitmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateCapacityCommitment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getCreateCapacityCommitmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getCreateCapacityCommitmentMethod;
if ((getCreateCapacityCommitmentMethod = ReservationServiceGrpc.getCreateCapacityCommitmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getCreateCapacityCommitmentMethod = ReservationServiceGrpc.getCreateCapacityCommitmentMethod) == null) {
ReservationServiceGrpc.getCreateCapacityCommitmentMethod = getCreateCapacityCommitmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateCapacityCommitment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("CreateCapacityCommitment"))
.build();
}
}
}
return getCreateCapacityCommitmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse> getListCapacityCommitmentsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListCapacityCommitments",
requestType = com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse> getListCapacityCommitmentsMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse> getListCapacityCommitmentsMethod;
if ((getListCapacityCommitmentsMethod = ReservationServiceGrpc.getListCapacityCommitmentsMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getListCapacityCommitmentsMethod = ReservationServiceGrpc.getListCapacityCommitmentsMethod) == null) {
ReservationServiceGrpc.getListCapacityCommitmentsMethod = getListCapacityCommitmentsMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCapacityCommitments"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("ListCapacityCommitments"))
.build();
}
}
}
return getListCapacityCommitmentsMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getGetCapacityCommitmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetCapacityCommitment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getGetCapacityCommitmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getGetCapacityCommitmentMethod;
if ((getGetCapacityCommitmentMethod = ReservationServiceGrpc.getGetCapacityCommitmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getGetCapacityCommitmentMethod = ReservationServiceGrpc.getGetCapacityCommitmentMethod) == null) {
ReservationServiceGrpc.getGetCapacityCommitmentMethod = getGetCapacityCommitmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCapacityCommitment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("GetCapacityCommitment"))
.build();
}
}
}
return getGetCapacityCommitmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest,
com.google.protobuf.Empty> getDeleteCapacityCommitmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteCapacityCommitment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest.class,
responseType = com.google.protobuf.Empty.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest,
com.google.protobuf.Empty> getDeleteCapacityCommitmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest, com.google.protobuf.Empty> getDeleteCapacityCommitmentMethod;
if ((getDeleteCapacityCommitmentMethod = ReservationServiceGrpc.getDeleteCapacityCommitmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getDeleteCapacityCommitmentMethod = ReservationServiceGrpc.getDeleteCapacityCommitmentMethod) == null) {
ReservationServiceGrpc.getDeleteCapacityCommitmentMethod = getDeleteCapacityCommitmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest, com.google.protobuf.Empty>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteCapacityCommitment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("DeleteCapacityCommitment"))
.build();
}
}
}
return getDeleteCapacityCommitmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getUpdateCapacityCommitmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateCapacityCommitment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getUpdateCapacityCommitmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getUpdateCapacityCommitmentMethod;
if ((getUpdateCapacityCommitmentMethod = ReservationServiceGrpc.getUpdateCapacityCommitmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getUpdateCapacityCommitmentMethod = ReservationServiceGrpc.getUpdateCapacityCommitmentMethod) == null) {
ReservationServiceGrpc.getUpdateCapacityCommitmentMethod = getUpdateCapacityCommitmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCapacityCommitment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("UpdateCapacityCommitment"))
.build();
}
}
}
return getUpdateCapacityCommitmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse> getSplitCapacityCommitmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "SplitCapacityCommitment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse> getSplitCapacityCommitmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse> getSplitCapacityCommitmentMethod;
if ((getSplitCapacityCommitmentMethod = ReservationServiceGrpc.getSplitCapacityCommitmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getSplitCapacityCommitmentMethod = ReservationServiceGrpc.getSplitCapacityCommitmentMethod) == null) {
ReservationServiceGrpc.getSplitCapacityCommitmentMethod = getSplitCapacityCommitmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest, com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SplitCapacityCommitment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("SplitCapacityCommitment"))
.build();
}
}
}
return getSplitCapacityCommitmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getMergeCapacityCommitmentsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "MergeCapacityCommitments",
requestType = com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getMergeCapacityCommitmentsMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getMergeCapacityCommitmentsMethod;
if ((getMergeCapacityCommitmentsMethod = ReservationServiceGrpc.getMergeCapacityCommitmentsMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getMergeCapacityCommitmentsMethod = ReservationServiceGrpc.getMergeCapacityCommitmentsMethod) == null) {
ReservationServiceGrpc.getMergeCapacityCommitmentsMethod = getMergeCapacityCommitmentsMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "MergeCapacityCommitments"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("MergeCapacityCommitments"))
.build();
}
}
}
return getMergeCapacityCommitmentsMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.Assignment> getCreateAssignmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "CreateAssignment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.Assignment.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.Assignment> getCreateAssignmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest, com.google.cloud.bigquery.reservation.v1beta1.Assignment> getCreateAssignmentMethod;
if ((getCreateAssignmentMethod = ReservationServiceGrpc.getCreateAssignmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getCreateAssignmentMethod = ReservationServiceGrpc.getCreateAssignmentMethod) == null) {
ReservationServiceGrpc.getCreateAssignmentMethod = getCreateAssignmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest, com.google.cloud.bigquery.reservation.v1beta1.Assignment>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateAssignment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.Assignment.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("CreateAssignment"))
.build();
}
}
}
return getCreateAssignmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse> getListAssignmentsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListAssignments",
requestType = com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse> getListAssignmentsMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse> getListAssignmentsMethod;
if ((getListAssignmentsMethod = ReservationServiceGrpc.getListAssignmentsMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getListAssignmentsMethod = ReservationServiceGrpc.getListAssignmentsMethod) == null) {
ReservationServiceGrpc.getListAssignmentsMethod = getListAssignmentsMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAssignments"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("ListAssignments"))
.build();
}
}
}
return getListAssignmentsMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest,
com.google.protobuf.Empty> getDeleteAssignmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "DeleteAssignment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest.class,
responseType = com.google.protobuf.Empty.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest,
com.google.protobuf.Empty> getDeleteAssignmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest, com.google.protobuf.Empty> getDeleteAssignmentMethod;
if ((getDeleteAssignmentMethod = ReservationServiceGrpc.getDeleteAssignmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getDeleteAssignmentMethod = ReservationServiceGrpc.getDeleteAssignmentMethod) == null) {
ReservationServiceGrpc.getDeleteAssignmentMethod = getDeleteAssignmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest, com.google.protobuf.Empty>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteAssignment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.protobuf.Empty.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("DeleteAssignment"))
.build();
}
}
}
return getDeleteAssignmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse> getSearchAssignmentsMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "SearchAssignments",
requestType = com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse> getSearchAssignmentsMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse> getSearchAssignmentsMethod;
if ((getSearchAssignmentsMethod = ReservationServiceGrpc.getSearchAssignmentsMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getSearchAssignmentsMethod = ReservationServiceGrpc.getSearchAssignmentsMethod) == null) {
ReservationServiceGrpc.getSearchAssignmentsMethod = getSearchAssignmentsMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest, com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchAssignments"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("SearchAssignments"))
.build();
}
}
}
return getSearchAssignmentsMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.Assignment> getMoveAssignmentMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "MoveAssignment",
requestType = com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.Assignment.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.Assignment> getMoveAssignmentMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest, com.google.cloud.bigquery.reservation.v1beta1.Assignment> getMoveAssignmentMethod;
if ((getMoveAssignmentMethod = ReservationServiceGrpc.getMoveAssignmentMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getMoveAssignmentMethod = ReservationServiceGrpc.getMoveAssignmentMethod) == null) {
ReservationServiceGrpc.getMoveAssignmentMethod = getMoveAssignmentMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest, com.google.cloud.bigquery.reservation.v1beta1.Assignment>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "MoveAssignment"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.Assignment.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("MoveAssignment"))
.build();
}
}
}
return getMoveAssignmentMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.BiReservation> getGetBiReservationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "GetBiReservation",
requestType = com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.BiReservation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.BiReservation> getGetBiReservationMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.BiReservation> getGetBiReservationMethod;
if ((getGetBiReservationMethod = ReservationServiceGrpc.getGetBiReservationMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getGetBiReservationMethod = ReservationServiceGrpc.getGetBiReservationMethod) == null) {
ReservationServiceGrpc.getGetBiReservationMethod = getGetBiReservationMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.BiReservation>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBiReservation"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.BiReservation.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("GetBiReservation"))
.build();
}
}
}
return getGetBiReservationMethod;
}
private static volatile io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.BiReservation> getUpdateBiReservationMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "UpdateBiReservation",
requestType = com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest.class,
responseType = com.google.cloud.bigquery.reservation.v1beta1.BiReservation.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.BiReservation> getUpdateBiReservationMethod() {
io.grpc.MethodDescriptor<com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.BiReservation> getUpdateBiReservationMethod;
if ((getUpdateBiReservationMethod = ReservationServiceGrpc.getUpdateBiReservationMethod) == null) {
synchronized (ReservationServiceGrpc.class) {
if ((getUpdateBiReservationMethod = ReservationServiceGrpc.getUpdateBiReservationMethod) == null) {
ReservationServiceGrpc.getUpdateBiReservationMethod = getUpdateBiReservationMethod =
io.grpc.MethodDescriptor.<com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest, com.google.cloud.bigquery.reservation.v1beta1.BiReservation>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBiReservation"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.cloud.bigquery.reservation.v1beta1.BiReservation.getDefaultInstance()))
.setSchemaDescriptor(new ReservationServiceMethodDescriptorSupplier("UpdateBiReservation"))
.build();
}
}
}
return getUpdateBiReservationMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static ReservationServiceStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<ReservationServiceStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<ReservationServiceStub>() {
@java.lang.Override
public ReservationServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReservationServiceStub(channel, callOptions);
}
};
return ReservationServiceStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static ReservationServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<ReservationServiceBlockingStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<ReservationServiceBlockingStub>() {
@java.lang.Override
public ReservationServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReservationServiceBlockingStub(channel, callOptions);
}
};
return ReservationServiceBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static ReservationServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory<ReservationServiceFutureStub> factory =
new io.grpc.stub.AbstractStub.StubFactory<ReservationServiceFutureStub>() {
@java.lang.Override
public ReservationServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReservationServiceFutureStub(channel, callOptions);
}
};
return ReservationServiceFutureStub.newStub(factory, channel);
}
/**
* <pre>
* This API allows users to manage their flat-rate BigQuery reservations.
* A reservation provides computational resource guarantees, in the form of
* [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
* unit of computational power in BigQuery, and serves as the basic unit of
* parallelism. In a scan of a multi-partitioned table, a single slot operates
* on a single partition of the table. A reservation resource exists as a child
* resource of the admin project and location, e.g.:
* `projects/myproject/locations/US/reservations/reservationName`.
* A capacity commitment is a way to purchase compute capacity for BigQuery jobs
* (in the form of slots) with some committed period of usage. A capacity
* commitment resource exists as a child resource of the admin project and
* location, e.g.:
* `projects/myproject/locations/US/capacityCommitments/id`.
* </pre>
*/
public static abstract class ReservationServiceImplBase implements io.grpc.BindableService {
/**
* <pre>
* Creates a new reservation resource.
* </pre>
*/
public void createReservation(com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateReservationMethod(), responseObserver);
}
/**
* <pre>
* Lists all the reservations for the project in the specified location.
* </pre>
*/
public void listReservations(com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListReservationsMethod(), responseObserver);
}
/**
* <pre>
* Returns information about the reservation.
* </pre>
*/
public void getReservation(com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetReservationMethod(), responseObserver);
}
/**
* <pre>
* Deletes a reservation.
* Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
* assignments.
* </pre>
*/
public void deleteReservation(com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteReservationMethod(), responseObserver);
}
/**
* <pre>
* Updates an existing reservation resource.
* </pre>
*/
public void updateReservation(com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateReservationMethod(), responseObserver);
}
/**
* <pre>
* Creates a new capacity commitment resource.
* </pre>
*/
public void createCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateCapacityCommitmentMethod(), responseObserver);
}
/**
* <pre>
* Lists all the capacity commitments for the admin project.
* </pre>
*/
public void listCapacityCommitments(com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListCapacityCommitmentsMethod(), responseObserver);
}
/**
* <pre>
* Returns information about the capacity commitment.
* </pre>
*/
public void getCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetCapacityCommitmentMethod(), responseObserver);
}
/**
* <pre>
* Deletes a capacity commitment. Attempting to delete capacity commitment
* before its commitment_end_time will fail with the error code
* `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public void deleteCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteCapacityCommitmentMethod(), responseObserver);
}
/**
* <pre>
* Updates an existing capacity commitment.
* Only `plan` and `renewal_plan` fields can be updated.
* Plan can only be changed to a plan of a longer commitment period.
* Attempting to change to a plan with shorter commitment period will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public void updateCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateCapacityCommitmentMethod(), responseObserver);
}
/**
* <pre>
* Splits capacity commitment to two commitments of the same plan and
* `commitment_end_time`.
* A common use case is to enable downgrading commitments.
* For example, in order to downgrade from 10000 slots to 8000, you might
* split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
* you would change the plan of the first one to `FLEX` and then delete it.
* </pre>
*/
public void splitCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSplitCapacityCommitmentMethod(), responseObserver);
}
/**
* <pre>
* Merges capacity commitments of the same plan into a single commitment.
* The resulting capacity commitment has the greater commitment_end_time
* out of the to-be-merged capacity commitments.
* Attempting to merge capacity commitments of different plan will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public void mergeCapacityCommitments(com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMergeCapacityCommitmentsMethod(), responseObserver);
}
/**
* <pre>
* Creates an assignment object which allows the given project to submit jobs
* of a certain type using slots from the specified reservation.
* Currently a
* resource (project, folder, organization) can only have one assignment per
* each (job_type, location) combination, and that reservation will be used
* for all jobs of the matching type.
* Different assignments can be created on different levels of the
* projects, folders or organization hierarchy. During query execution,
* the assignment is looked up at the project, folder and organization levels
* in that order. The first assignment found is applied to the query.
* When creating assignments, it does not matter if other assignments exist at
* higher levels.
* Example:
* * The organization `organizationA` contains two projects, `project1`
* and `project2`.
* * Assignments for all three entities (`organizationA`, `project1`, and
* `project2`) could all be created and mapped to the same or different
* reservations.
* Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
* 'bigquery.admin' permissions on the project using the reservation
* and the project that owns this reservation.
* Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
* does not match location of the reservation.
* </pre>
*/
public void createAssignment(com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Assignment> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateAssignmentMethod(), responseObserver);
}
/**
* <pre>
* Lists assignments.
* Only explicitly created assignments will be returned.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, ListAssignments will just return the above two assignments
* for reservation `res1`, and no expansion/merge will happen.
* The wildcard "-" can be used for
* reservations in the request. In that case all assignments belongs to the
* specified project and location will be listed.
* **Note** "-" cannot be used for projects nor locations.
* </pre>
*/
public void listAssignments(com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListAssignmentsMethod(), responseObserver);
}
/**
* <pre>
* Deletes a assignment. No expansion will happen.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, deletion of the `<organizationA, res1>` assignment won't
* affect the other assignment `<project1, res1>`. After said deletion,
* queries from `project1` will still use `res1` while queries from
* `project2` will switch to use on-demand mode.
* </pre>
*/
public void deleteAssignment(com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteAssignmentMethod(), responseObserver);
}
/**
* <pre>
* Looks up assignments for a specified resource for a particular region.
* If the request is about a project:
* 1. Assignments created on the project will be returned if they exist.
* 2. Otherwise assignments created on the closest ancestor will be
* returned.
* 3. Assignments for different JobTypes will all be returned.
* The same logic applies if the request is about a folder.
* If the request is about an organization, then assignments created on the
* organization will be returned (organization doesn't have ancestors).
* Comparing to ListAssignments, there are some behavior
* differences:
* 1. permission on the assignee will be verified in this API.
* 2. Hierarchy lookup (project->folder->organization) happens in this API.
* 3. Parent here is `projects/*/locations/*`, instead of
* `projects/*/locations/*reservations/*`.
* **Note** "-" cannot be used for projects
* nor locations.
* </pre>
*/
public void searchAssignments(com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchAssignmentsMethod(), responseObserver);
}
/**
* <pre>
* Moves an assignment under a new reservation.
* This differs from removing an existing assignment and recreating a new one
* by providing a transactional change that ensures an assignee always has an
* associated reservation.
* </pre>
*/
public void moveAssignment(com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Assignment> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getMoveAssignmentMethod(), responseObserver);
}
/**
* <pre>
* Retrieves a BI reservation.
* </pre>
*/
public void getBiReservation(com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.BiReservation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBiReservationMethod(), responseObserver);
}
/**
* <pre>
* Updates a BI reservation.
* Only fields specified in the `field_mask` are updated.
* A singleton BI reservation always exists with default size 0.
* In order to reserve BI capacity it needs to be updated to an amount
* greater than 0. In order to release BI capacity reservation size
* must be set to 0.
* </pre>
*/
public void updateBiReservation(com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.BiReservation> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateBiReservationMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getCreateReservationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation>(
this, METHODID_CREATE_RESERVATION)))
.addMethod(
getListReservationsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse>(
this, METHODID_LIST_RESERVATIONS)))
.addMethod(
getGetReservationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation>(
this, METHODID_GET_RESERVATION)))
.addMethod(
getDeleteReservationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest,
com.google.protobuf.Empty>(
this, METHODID_DELETE_RESERVATION)))
.addMethod(
getUpdateReservationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.Reservation>(
this, METHODID_UPDATE_RESERVATION)))
.addMethod(
getCreateCapacityCommitmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>(
this, METHODID_CREATE_CAPACITY_COMMITMENT)))
.addMethod(
getListCapacityCommitmentsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse>(
this, METHODID_LIST_CAPACITY_COMMITMENTS)))
.addMethod(
getGetCapacityCommitmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>(
this, METHODID_GET_CAPACITY_COMMITMENT)))
.addMethod(
getDeleteCapacityCommitmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest,
com.google.protobuf.Empty>(
this, METHODID_DELETE_CAPACITY_COMMITMENT)))
.addMethod(
getUpdateCapacityCommitmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>(
this, METHODID_UPDATE_CAPACITY_COMMITMENT)))
.addMethod(
getSplitCapacityCommitmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse>(
this, METHODID_SPLIT_CAPACITY_COMMITMENT)))
.addMethod(
getMergeCapacityCommitmentsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>(
this, METHODID_MERGE_CAPACITY_COMMITMENTS)))
.addMethod(
getCreateAssignmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.Assignment>(
this, METHODID_CREATE_ASSIGNMENT)))
.addMethod(
getListAssignmentsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse>(
this, METHODID_LIST_ASSIGNMENTS)))
.addMethod(
getDeleteAssignmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest,
com.google.protobuf.Empty>(
this, METHODID_DELETE_ASSIGNMENT)))
.addMethod(
getSearchAssignmentsMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest,
com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse>(
this, METHODID_SEARCH_ASSIGNMENTS)))
.addMethod(
getMoveAssignmentMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest,
com.google.cloud.bigquery.reservation.v1beta1.Assignment>(
this, METHODID_MOVE_ASSIGNMENT)))
.addMethod(
getGetBiReservationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.BiReservation>(
this, METHODID_GET_BI_RESERVATION)))
.addMethod(
getUpdateBiReservationMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest,
com.google.cloud.bigquery.reservation.v1beta1.BiReservation>(
this, METHODID_UPDATE_BI_RESERVATION)))
.build();
}
}
/**
* <pre>
* This API allows users to manage their flat-rate BigQuery reservations.
* A reservation provides computational resource guarantees, in the form of
* [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
* unit of computational power in BigQuery, and serves as the basic unit of
* parallelism. In a scan of a multi-partitioned table, a single slot operates
* on a single partition of the table. A reservation resource exists as a child
* resource of the admin project and location, e.g.:
* `projects/myproject/locations/US/reservations/reservationName`.
* A capacity commitment is a way to purchase compute capacity for BigQuery jobs
* (in the form of slots) with some committed period of usage. A capacity
* commitment resource exists as a child resource of the admin project and
* location, e.g.:
* `projects/myproject/locations/US/capacityCommitments/id`.
* </pre>
*/
public static final class ReservationServiceStub extends io.grpc.stub.AbstractAsyncStub<ReservationServiceStub> {
private ReservationServiceStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ReservationServiceStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReservationServiceStub(channel, callOptions);
}
/**
* <pre>
* Creates a new reservation resource.
* </pre>
*/
public void createReservation(com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateReservationMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Lists all the reservations for the project in the specified location.
* </pre>
*/
public void listReservations(com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListReservationsMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Returns information about the reservation.
* </pre>
*/
public void getReservation(com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetReservationMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Deletes a reservation.
* Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
* assignments.
* </pre>
*/
public void deleteReservation(com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteReservationMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Updates an existing reservation resource.
* </pre>
*/
public void updateReservation(com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateReservationMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Creates a new capacity commitment resource.
* </pre>
*/
public void createCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateCapacityCommitmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Lists all the capacity commitments for the admin project.
* </pre>
*/
public void listCapacityCommitments(com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListCapacityCommitmentsMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Returns information about the capacity commitment.
* </pre>
*/
public void getCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetCapacityCommitmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Deletes a capacity commitment. Attempting to delete capacity commitment
* before its commitment_end_time will fail with the error code
* `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public void deleteCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteCapacityCommitmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Updates an existing capacity commitment.
* Only `plan` and `renewal_plan` fields can be updated.
* Plan can only be changed to a plan of a longer commitment period.
* Attempting to change to a plan with shorter commitment period will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public void updateCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateCapacityCommitmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Splits capacity commitment to two commitments of the same plan and
* `commitment_end_time`.
* A common use case is to enable downgrading commitments.
* For example, in order to downgrade from 10000 slots to 8000, you might
* split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
* you would change the plan of the first one to `FLEX` and then delete it.
* </pre>
*/
public void splitCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getSplitCapacityCommitmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Merges capacity commitments of the same plan into a single commitment.
* The resulting capacity commitment has the greater commitment_end_time
* out of the to-be-merged capacity commitments.
* Attempting to merge capacity commitments of different plan will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public void mergeCapacityCommitments(com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getMergeCapacityCommitmentsMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Creates an assignment object which allows the given project to submit jobs
* of a certain type using slots from the specified reservation.
* Currently a
* resource (project, folder, organization) can only have one assignment per
* each (job_type, location) combination, and that reservation will be used
* for all jobs of the matching type.
* Different assignments can be created on different levels of the
* projects, folders or organization hierarchy. During query execution,
* the assignment is looked up at the project, folder and organization levels
* in that order. The first assignment found is applied to the query.
* When creating assignments, it does not matter if other assignments exist at
* higher levels.
* Example:
* * The organization `organizationA` contains two projects, `project1`
* and `project2`.
* * Assignments for all three entities (`organizationA`, `project1`, and
* `project2`) could all be created and mapped to the same or different
* reservations.
* Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
* 'bigquery.admin' permissions on the project using the reservation
* and the project that owns this reservation.
* Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
* does not match location of the reservation.
* </pre>
*/
public void createAssignment(com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Assignment> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getCreateAssignmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Lists assignments.
* Only explicitly created assignments will be returned.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, ListAssignments will just return the above two assignments
* for reservation `res1`, and no expansion/merge will happen.
* The wildcard "-" can be used for
* reservations in the request. In that case all assignments belongs to the
* specified project and location will be listed.
* **Note** "-" cannot be used for projects nor locations.
* </pre>
*/
public void listAssignments(com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListAssignmentsMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Deletes a assignment. No expansion will happen.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, deletion of the `<organizationA, res1>` assignment won't
* affect the other assignment `<project1, res1>`. After said deletion,
* queries from `project1` will still use `res1` while queries from
* `project2` will switch to use on-demand mode.
* </pre>
*/
public void deleteAssignment(com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest request,
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteAssignmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Looks up assignments for a specified resource for a particular region.
* If the request is about a project:
* 1. Assignments created on the project will be returned if they exist.
* 2. Otherwise assignments created on the closest ancestor will be
* returned.
* 3. Assignments for different JobTypes will all be returned.
* The same logic applies if the request is about a folder.
* If the request is about an organization, then assignments created on the
* organization will be returned (organization doesn't have ancestors).
* Comparing to ListAssignments, there are some behavior
* differences:
* 1. permission on the assignee will be verified in this API.
* 2. Hierarchy lookup (project->folder->organization) happens in this API.
* 3. Parent here is `projects/*/locations/*`, instead of
* `projects/*/locations/*reservations/*`.
* **Note** "-" cannot be used for projects
* nor locations.
* </pre>
*/
public void searchAssignments(com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getSearchAssignmentsMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Moves an assignment under a new reservation.
* This differs from removing an existing assignment and recreating a new one
* by providing a transactional change that ensures an assignee always has an
* associated reservation.
* </pre>
*/
public void moveAssignment(com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Assignment> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getMoveAssignmentMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Retrieves a BI reservation.
* </pre>
*/
public void getBiReservation(com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.BiReservation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetBiReservationMethod(), getCallOptions()), request, responseObserver);
}
/**
* <pre>
* Updates a BI reservation.
* Only fields specified in the `field_mask` are updated.
* A singleton BI reservation always exists with default size 0.
* In order to reserve BI capacity it needs to be updated to an amount
* greater than 0. In order to release BI capacity reservation size
* must be set to 0.
* </pre>
*/
public void updateBiReservation(com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest request,
io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.BiReservation> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getUpdateBiReservationMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* <pre>
* This API allows users to manage their flat-rate BigQuery reservations.
* A reservation provides computational resource guarantees, in the form of
* [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
* unit of computational power in BigQuery, and serves as the basic unit of
* parallelism. In a scan of a multi-partitioned table, a single slot operates
* on a single partition of the table. A reservation resource exists as a child
* resource of the admin project and location, e.g.:
* `projects/myproject/locations/US/reservations/reservationName`.
* A capacity commitment is a way to purchase compute capacity for BigQuery jobs
* (in the form of slots) with some committed period of usage. A capacity
* commitment resource exists as a child resource of the admin project and
* location, e.g.:
* `projects/myproject/locations/US/capacityCommitments/id`.
* </pre>
*/
public static final class ReservationServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<ReservationServiceBlockingStub> {
private ReservationServiceBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ReservationServiceBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReservationServiceBlockingStub(channel, callOptions);
}
/**
* <pre>
* Creates a new reservation resource.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.Reservation createReservation(com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateReservationMethod(), getCallOptions(), request);
}
/**
* <pre>
* Lists all the reservations for the project in the specified location.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse listReservations(com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListReservationsMethod(), getCallOptions(), request);
}
/**
* <pre>
* Returns information about the reservation.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.Reservation getReservation(com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetReservationMethod(), getCallOptions(), request);
}
/**
* <pre>
* Deletes a reservation.
* Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
* assignments.
* </pre>
*/
public com.google.protobuf.Empty deleteReservation(com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteReservationMethod(), getCallOptions(), request);
}
/**
* <pre>
* Updates an existing reservation resource.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.Reservation updateReservation(com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateReservationMethod(), getCallOptions(), request);
}
/**
* <pre>
* Creates a new capacity commitment resource.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment createCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateCapacityCommitmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Lists all the capacity commitments for the admin project.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse listCapacityCommitments(com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListCapacityCommitmentsMethod(), getCallOptions(), request);
}
/**
* <pre>
* Returns information about the capacity commitment.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment getCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetCapacityCommitmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Deletes a capacity commitment. Attempting to delete capacity commitment
* before its commitment_end_time will fail with the error code
* `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public com.google.protobuf.Empty deleteCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteCapacityCommitmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Updates an existing capacity commitment.
* Only `plan` and `renewal_plan` fields can be updated.
* Plan can only be changed to a plan of a longer commitment period.
* Attempting to change to a plan with shorter commitment period will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment updateCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateCapacityCommitmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Splits capacity commitment to two commitments of the same plan and
* `commitment_end_time`.
* A common use case is to enable downgrading commitments.
* For example, in order to downgrade from 10000 slots to 8000, you might
* split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
* you would change the plan of the first one to `FLEX` and then delete it.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse splitCapacityCommitment(com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getSplitCapacityCommitmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Merges capacity commitments of the same plan into a single commitment.
* The resulting capacity commitment has the greater commitment_end_time
* out of the to-be-merged capacity commitments.
* Attempting to merge capacity commitments of different plan will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment mergeCapacityCommitments(com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getMergeCapacityCommitmentsMethod(), getCallOptions(), request);
}
/**
* <pre>
* Creates an assignment object which allows the given project to submit jobs
* of a certain type using slots from the specified reservation.
* Currently a
* resource (project, folder, organization) can only have one assignment per
* each (job_type, location) combination, and that reservation will be used
* for all jobs of the matching type.
* Different assignments can be created on different levels of the
* projects, folders or organization hierarchy. During query execution,
* the assignment is looked up at the project, folder and organization levels
* in that order. The first assignment found is applied to the query.
* When creating assignments, it does not matter if other assignments exist at
* higher levels.
* Example:
* * The organization `organizationA` contains two projects, `project1`
* and `project2`.
* * Assignments for all three entities (`organizationA`, `project1`, and
* `project2`) could all be created and mapped to the same or different
* reservations.
* Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
* 'bigquery.admin' permissions on the project using the reservation
* and the project that owns this reservation.
* Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
* does not match location of the reservation.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.Assignment createAssignment(com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getCreateAssignmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Lists assignments.
* Only explicitly created assignments will be returned.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, ListAssignments will just return the above two assignments
* for reservation `res1`, and no expansion/merge will happen.
* The wildcard "-" can be used for
* reservations in the request. In that case all assignments belongs to the
* specified project and location will be listed.
* **Note** "-" cannot be used for projects nor locations.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse listAssignments(com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListAssignmentsMethod(), getCallOptions(), request);
}
/**
* <pre>
* Deletes a assignment. No expansion will happen.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, deletion of the `<organizationA, res1>` assignment won't
* affect the other assignment `<project1, res1>`. After said deletion,
* queries from `project1` will still use `res1` while queries from
* `project2` will switch to use on-demand mode.
* </pre>
*/
public com.google.protobuf.Empty deleteAssignment(com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteAssignmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Looks up assignments for a specified resource for a particular region.
* If the request is about a project:
* 1. Assignments created on the project will be returned if they exist.
* 2. Otherwise assignments created on the closest ancestor will be
* returned.
* 3. Assignments for different JobTypes will all be returned.
* The same logic applies if the request is about a folder.
* If the request is about an organization, then assignments created on the
* organization will be returned (organization doesn't have ancestors).
* Comparing to ListAssignments, there are some behavior
* differences:
* 1. permission on the assignee will be verified in this API.
* 2. Hierarchy lookup (project->folder->organization) happens in this API.
* 3. Parent here is `projects/*/locations/*`, instead of
* `projects/*/locations/*reservations/*`.
* **Note** "-" cannot be used for projects
* nor locations.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse searchAssignments(com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getSearchAssignmentsMethod(), getCallOptions(), request);
}
/**
* <pre>
* Moves an assignment under a new reservation.
* This differs from removing an existing assignment and recreating a new one
* by providing a transactional change that ensures an assignee always has an
* associated reservation.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.Assignment moveAssignment(com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getMoveAssignmentMethod(), getCallOptions(), request);
}
/**
* <pre>
* Retrieves a BI reservation.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.BiReservation getBiReservation(com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetBiReservationMethod(), getCallOptions(), request);
}
/**
* <pre>
* Updates a BI reservation.
* Only fields specified in the `field_mask` are updated.
* A singleton BI reservation always exists with default size 0.
* In order to reserve BI capacity it needs to be updated to an amount
* greater than 0. In order to release BI capacity reservation size
* must be set to 0.
* </pre>
*/
public com.google.cloud.bigquery.reservation.v1beta1.BiReservation updateBiReservation(com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getUpdateBiReservationMethod(), getCallOptions(), request);
}
}
/**
* <pre>
* This API allows users to manage their flat-rate BigQuery reservations.
* A reservation provides computational resource guarantees, in the form of
* [slots](https://cloud.google.com/bigquery/docs/slots), to users. A slot is a
* unit of computational power in BigQuery, and serves as the basic unit of
* parallelism. In a scan of a multi-partitioned table, a single slot operates
* on a single partition of the table. A reservation resource exists as a child
* resource of the admin project and location, e.g.:
* `projects/myproject/locations/US/reservations/reservationName`.
* A capacity commitment is a way to purchase compute capacity for BigQuery jobs
* (in the form of slots) with some committed period of usage. A capacity
* commitment resource exists as a child resource of the admin project and
* location, e.g.:
* `projects/myproject/locations/US/capacityCommitments/id`.
* </pre>
*/
public static final class ReservationServiceFutureStub extends io.grpc.stub.AbstractFutureStub<ReservationServiceFutureStub> {
private ReservationServiceFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected ReservationServiceFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new ReservationServiceFutureStub(channel, callOptions);
}
/**
* <pre>
* Creates a new reservation resource.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.Reservation> createReservation(
com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateReservationMethod(), getCallOptions()), request);
}
/**
* <pre>
* Lists all the reservations for the project in the specified location.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse> listReservations(
com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListReservationsMethod(), getCallOptions()), request);
}
/**
* <pre>
* Returns information about the reservation.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.Reservation> getReservation(
com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetReservationMethod(), getCallOptions()), request);
}
/**
* <pre>
* Deletes a reservation.
* Returns `google.rpc.Code.FAILED_PRECONDITION` when reservation has
* assignments.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deleteReservation(
com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteReservationMethod(), getCallOptions()), request);
}
/**
* <pre>
* Updates an existing reservation resource.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.Reservation> updateReservation(
com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateReservationMethod(), getCallOptions()), request);
}
/**
* <pre>
* Creates a new capacity commitment resource.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> createCapacityCommitment(
com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateCapacityCommitmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Lists all the capacity commitments for the admin project.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse> listCapacityCommitments(
com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListCapacityCommitmentsMethod(), getCallOptions()), request);
}
/**
* <pre>
* Returns information about the capacity commitment.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> getCapacityCommitment(
com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetCapacityCommitmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Deletes a capacity commitment. Attempting to delete capacity commitment
* before its commitment_end_time will fail with the error code
* `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deleteCapacityCommitment(
com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteCapacityCommitmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Updates an existing capacity commitment.
* Only `plan` and `renewal_plan` fields can be updated.
* Plan can only be changed to a plan of a longer commitment period.
* Attempting to change to a plan with shorter commitment period will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> updateCapacityCommitment(
com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateCapacityCommitmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Splits capacity commitment to two commitments of the same plan and
* `commitment_end_time`.
* A common use case is to enable downgrading commitments.
* For example, in order to downgrade from 10000 slots to 8000, you might
* split a 10000 capacity commitment into commitments of 2000 and 8000. Then,
* you would change the plan of the first one to `FLEX` and then delete it.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse> splitCapacityCommitment(
com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getSplitCapacityCommitmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Merges capacity commitments of the same plan into a single commitment.
* The resulting capacity commitment has the greater commitment_end_time
* out of the to-be-merged capacity commitments.
* Attempting to merge capacity commitments of different plan will fail
* with the error code `google.rpc.Code.FAILED_PRECONDITION`.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment> mergeCapacityCommitments(
com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getMergeCapacityCommitmentsMethod(), getCallOptions()), request);
}
/**
* <pre>
* Creates an assignment object which allows the given project to submit jobs
* of a certain type using slots from the specified reservation.
* Currently a
* resource (project, folder, organization) can only have one assignment per
* each (job_type, location) combination, and that reservation will be used
* for all jobs of the matching type.
* Different assignments can be created on different levels of the
* projects, folders or organization hierarchy. During query execution,
* the assignment is looked up at the project, folder and organization levels
* in that order. The first assignment found is applied to the query.
* When creating assignments, it does not matter if other assignments exist at
* higher levels.
* Example:
* * The organization `organizationA` contains two projects, `project1`
* and `project2`.
* * Assignments for all three entities (`organizationA`, `project1`, and
* `project2`) could all be created and mapped to the same or different
* reservations.
* Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have
* 'bigquery.admin' permissions on the project using the reservation
* and the project that owns this reservation.
* Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the assignment
* does not match location of the reservation.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.Assignment> createAssignment(
com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getCreateAssignmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Lists assignments.
* Only explicitly created assignments will be returned.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, ListAssignments will just return the above two assignments
* for reservation `res1`, and no expansion/merge will happen.
* The wildcard "-" can be used for
* reservations in the request. In that case all assignments belongs to the
* specified project and location will be listed.
* **Note** "-" cannot be used for projects nor locations.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse> listAssignments(
com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListAssignmentsMethod(), getCallOptions()), request);
}
/**
* <pre>
* Deletes a assignment. No expansion will happen.
* Example:
* * Organization `organizationA` contains two projects, `project1` and
* `project2`.
* * Reservation `res1` exists and was created previously.
* * CreateAssignment was used previously to define the following
* associations between entities and reservations: `<organizationA, res1>`
* and `<project1, res1>`
* In this example, deletion of the `<organizationA, res1>` assignment won't
* affect the other assignment `<project1, res1>`. After said deletion,
* queries from `project1` will still use `res1` while queries from
* `project2` will switch to use on-demand mode.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deleteAssignment(
com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteAssignmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Looks up assignments for a specified resource for a particular region.
* If the request is about a project:
* 1. Assignments created on the project will be returned if they exist.
* 2. Otherwise assignments created on the closest ancestor will be
* returned.
* 3. Assignments for different JobTypes will all be returned.
* The same logic applies if the request is about a folder.
* If the request is about an organization, then assignments created on the
* organization will be returned (organization doesn't have ancestors).
* Comparing to ListAssignments, there are some behavior
* differences:
* 1. permission on the assignee will be verified in this API.
* 2. Hierarchy lookup (project->folder->organization) happens in this API.
* 3. Parent here is `projects/*/locations/*`, instead of
* `projects/*/locations/*reservations/*`.
* **Note** "-" cannot be used for projects
* nor locations.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse> searchAssignments(
com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getSearchAssignmentsMethod(), getCallOptions()), request);
}
/**
* <pre>
* Moves an assignment under a new reservation.
* This differs from removing an existing assignment and recreating a new one
* by providing a transactional change that ensures an assignee always has an
* associated reservation.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.Assignment> moveAssignment(
com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getMoveAssignmentMethod(), getCallOptions()), request);
}
/**
* <pre>
* Retrieves a BI reservation.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.BiReservation> getBiReservation(
com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetBiReservationMethod(), getCallOptions()), request);
}
/**
* <pre>
* Updates a BI reservation.
* Only fields specified in the `field_mask` are updated.
* A singleton BI reservation always exists with default size 0.
* In order to reserve BI capacity it needs to be updated to an amount
* greater than 0. In order to release BI capacity reservation size
* must be set to 0.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<com.google.cloud.bigquery.reservation.v1beta1.BiReservation> updateBiReservation(
com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getUpdateBiReservationMethod(), getCallOptions()), request);
}
}
private static final int METHODID_CREATE_RESERVATION = 0;
private static final int METHODID_LIST_RESERVATIONS = 1;
private static final int METHODID_GET_RESERVATION = 2;
private static final int METHODID_DELETE_RESERVATION = 3;
private static final int METHODID_UPDATE_RESERVATION = 4;
private static final int METHODID_CREATE_CAPACITY_COMMITMENT = 5;
private static final int METHODID_LIST_CAPACITY_COMMITMENTS = 6;
private static final int METHODID_GET_CAPACITY_COMMITMENT = 7;
private static final int METHODID_DELETE_CAPACITY_COMMITMENT = 8;
private static final int METHODID_UPDATE_CAPACITY_COMMITMENT = 9;
private static final int METHODID_SPLIT_CAPACITY_COMMITMENT = 10;
private static final int METHODID_MERGE_CAPACITY_COMMITMENTS = 11;
private static final int METHODID_CREATE_ASSIGNMENT = 12;
private static final int METHODID_LIST_ASSIGNMENTS = 13;
private static final int METHODID_DELETE_ASSIGNMENT = 14;
private static final int METHODID_SEARCH_ASSIGNMENTS = 15;
private static final int METHODID_MOVE_ASSIGNMENT = 16;
private static final int METHODID_GET_BI_RESERVATION = 17;
private static final int METHODID_UPDATE_BI_RESERVATION = 18;
private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final ReservationServiceImplBase serviceImpl;
private final int methodId;
MethodHandlers(ReservationServiceImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_CREATE_RESERVATION:
serviceImpl.createReservation((com.google.cloud.bigquery.reservation.v1beta1.CreateReservationRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation>) responseObserver);
break;
case METHODID_LIST_RESERVATIONS:
serviceImpl.listReservations((com.google.cloud.bigquery.reservation.v1beta1.ListReservationsRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListReservationsResponse>) responseObserver);
break;
case METHODID_GET_RESERVATION:
serviceImpl.getReservation((com.google.cloud.bigquery.reservation.v1beta1.GetReservationRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation>) responseObserver);
break;
case METHODID_DELETE_RESERVATION:
serviceImpl.deleteReservation((com.google.cloud.bigquery.reservation.v1beta1.DeleteReservationRequest) request,
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
break;
case METHODID_UPDATE_RESERVATION:
serviceImpl.updateReservation((com.google.cloud.bigquery.reservation.v1beta1.UpdateReservationRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Reservation>) responseObserver);
break;
case METHODID_CREATE_CAPACITY_COMMITMENT:
serviceImpl.createCapacityCommitment((com.google.cloud.bigquery.reservation.v1beta1.CreateCapacityCommitmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>) responseObserver);
break;
case METHODID_LIST_CAPACITY_COMMITMENTS:
serviceImpl.listCapacityCommitments((com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListCapacityCommitmentsResponse>) responseObserver);
break;
case METHODID_GET_CAPACITY_COMMITMENT:
serviceImpl.getCapacityCommitment((com.google.cloud.bigquery.reservation.v1beta1.GetCapacityCommitmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>) responseObserver);
break;
case METHODID_DELETE_CAPACITY_COMMITMENT:
serviceImpl.deleteCapacityCommitment((com.google.cloud.bigquery.reservation.v1beta1.DeleteCapacityCommitmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
break;
case METHODID_UPDATE_CAPACITY_COMMITMENT:
serviceImpl.updateCapacityCommitment((com.google.cloud.bigquery.reservation.v1beta1.UpdateCapacityCommitmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>) responseObserver);
break;
case METHODID_SPLIT_CAPACITY_COMMITMENT:
serviceImpl.splitCapacityCommitment((com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.SplitCapacityCommitmentResponse>) responseObserver);
break;
case METHODID_MERGE_CAPACITY_COMMITMENTS:
serviceImpl.mergeCapacityCommitments((com.google.cloud.bigquery.reservation.v1beta1.MergeCapacityCommitmentsRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.CapacityCommitment>) responseObserver);
break;
case METHODID_CREATE_ASSIGNMENT:
serviceImpl.createAssignment((com.google.cloud.bigquery.reservation.v1beta1.CreateAssignmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Assignment>) responseObserver);
break;
case METHODID_LIST_ASSIGNMENTS:
serviceImpl.listAssignments((com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.ListAssignmentsResponse>) responseObserver);
break;
case METHODID_DELETE_ASSIGNMENT:
serviceImpl.deleteAssignment((com.google.cloud.bigquery.reservation.v1beta1.DeleteAssignmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
break;
case METHODID_SEARCH_ASSIGNMENTS:
serviceImpl.searchAssignments((com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.SearchAssignmentsResponse>) responseObserver);
break;
case METHODID_MOVE_ASSIGNMENT:
serviceImpl.moveAssignment((com.google.cloud.bigquery.reservation.v1beta1.MoveAssignmentRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.Assignment>) responseObserver);
break;
case METHODID_GET_BI_RESERVATION:
serviceImpl.getBiReservation((com.google.cloud.bigquery.reservation.v1beta1.GetBiReservationRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.BiReservation>) responseObserver);
break;
case METHODID_UPDATE_BI_RESERVATION:
serviceImpl.updateBiReservation((com.google.cloud.bigquery.reservation.v1beta1.UpdateBiReservationRequest) request,
(io.grpc.stub.StreamObserver<com.google.cloud.bigquery.reservation.v1beta1.BiReservation>) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver<Req> invoke(
io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static abstract class ReservationServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
ReservationServiceBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return com.google.cloud.bigquery.reservation.v1beta1.ReservationOuterClass.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("ReservationService");
}
}
private static final class ReservationServiceFileDescriptorSupplier
extends ReservationServiceBaseDescriptorSupplier {
ReservationServiceFileDescriptorSupplier() {}
}
private static final class ReservationServiceMethodDescriptorSupplier
extends ReservationServiceBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
ReservationServiceMethodDescriptorSupplier(String methodName) {
this.methodName = methodName;
}
@java.lang.Override
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
return getServiceDescriptor().findMethodByName(methodName);
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (ReservationServiceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new ReservationServiceFileDescriptorSupplier())
.addMethod(getCreateReservationMethod())
.addMethod(getListReservationsMethod())
.addMethod(getGetReservationMethod())
.addMethod(getDeleteReservationMethod())
.addMethod(getUpdateReservationMethod())
.addMethod(getCreateCapacityCommitmentMethod())
.addMethod(getListCapacityCommitmentsMethod())
.addMethod(getGetCapacityCommitmentMethod())
.addMethod(getDeleteCapacityCommitmentMethod())
.addMethod(getUpdateCapacityCommitmentMethod())
.addMethod(getSplitCapacityCommitmentMethod())
.addMethod(getMergeCapacityCommitmentsMethod())
.addMethod(getCreateAssignmentMethod())
.addMethod(getListAssignmentsMethod())
.addMethod(getDeleteAssignmentMethod())
.addMethod(getSearchAssignmentsMethod())
.addMethod(getMoveAssignmentMethod())
.addMethod(getGetBiReservationMethod())
.addMethod(getUpdateBiReservationMethod())
.build();
}
}
}
return result;
}
}
| [
"bazel-bot-development[bot]@users.noreply.github.com"
] | bazel-bot-development[bot]@users.noreply.github.com |
7107a6872f5feda617daf34da42f8049d487eef9 | 645b392000b8fdf461b5d6bb5ac7bd29402c3f58 | /lib/src/main/java/com/sd/lib/switchbutton/gesture/FGestureManager.java | f20f23c353e0aae2d52056499eefcc1b16b17643 | [
"MIT"
] | permissive | 858277721c/switchbutton | 6092c081952eaae3b23f9ed56a9e0e3bd0c76942 | d45d5e821dfd0ca48ab39ebd1d867c6a69401647 | refs/heads/master | 2022-01-21T01:41:59.738344 | 2019-07-23T08:33:41 | 2019-07-23T08:33:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,787 | java | package com.sd.lib.switchbutton.gesture;
import android.util.Log;
import android.view.MotionEvent;
import android.view.VelocityTracker;
import android.view.ViewGroup;
public class FGestureManager
{
private final ViewGroup mViewGroup;
private FTouchHelper mTouchHelper;
private final TagHolder mTagHolder;
private final FScroller mScroller;
private State mState = State.Idle;
private LifecycleInfo mLifecycleInfo;
private final IdleRunnable mIdleRunnable = new IdleRunnable();
private VelocityTracker mVelocityTracker;
private boolean mDebug;
private final Callback mCallback;
public FGestureManager(ViewGroup viewGroup, Callback callback)
{
if (viewGroup == null || callback == null)
throw new NullPointerException();
mViewGroup = viewGroup;
mCallback = callback;
mTagHolder = new TagHolder()
{
@Override
protected void onTagConsumeChanged(boolean tag)
{
if (tag)
setState(State.Consume);
super.onTagConsumeChanged(tag);
}
};
mScroller = new FScroller(viewGroup.getContext())
{
@Override
protected void onScrollerStart()
{
setState(State.Fling);
super.onScrollerStart();
}
@Override
protected void onScrollerCompute(int lastX, int lastY, int currX, int currY)
{
mCallback.onScrollerCompute(lastX, lastY, currX, currY);
super.onScrollerCompute(lastX, lastY, currX, currY);
}
@Override
protected void onScrollerFinish(boolean isAbort)
{
if (mDebug)
Log.e(FGestureManager.class.getSimpleName(), "onScrollerFinish isAbort:" + isAbort);
if (mTagHolder.isTagConsume())
{
setState(State.Consume);
} else
{
mIdleRunnable.post();
}
super.onScrollerFinish(isAbort);
}
};
}
public void setDebug(boolean debug)
{
mDebug = debug;
}
public FTouchHelper getTouchHelper()
{
if (mTouchHelper == null)
mTouchHelper = new FTouchHelper();
return mTouchHelper;
}
public TagHolder getTagHolder()
{
return mTagHolder;
}
public FScroller getScroller()
{
return mScroller;
}
public State getState()
{
return mState;
}
public LifecycleInfo getLifecycleInfo()
{
if (mLifecycleInfo == null)
mLifecycleInfo = new LifecycleInfo();
return mLifecycleInfo;
}
private void setState(State state)
{
if (state == null)
throw new NullPointerException();
if (mDebug)
Log.i(FGestureManager.class.getSimpleName(), "setState:" + mState + " -> " + state);
mIdleRunnable.cancel();
final State old = mState;
if (old != state)
{
mState = state;
mCallback.onStateChanged(old, state);
}
}
private VelocityTracker getVelocityTracker()
{
if (mVelocityTracker == null)
mVelocityTracker = VelocityTracker.obtain();
return mVelocityTracker;
}
private void releaseVelocityTracker()
{
if (mVelocityTracker != null)
{
mVelocityTracker.recycle();
mVelocityTracker = null;
}
}
/**
* 取消消费事件
*/
public void cancelConsumeEvent()
{
if (mTagHolder.isTagConsume())
{
if (mDebug)
Log.i(FGestureManager.class.getSimpleName(), "cancelConsumeEvent");
getLifecycleInfo().setCancelConsumeEvent(true);
if (getScroller().isFinished())
{
/**
* 调用取消消费事件方法之后,外部有可能立即调用滚动的方法变更状态为{@link State.Fling}
* 所以此处延迟设置{@link State.Idle}状态
*/
mIdleRunnable.post();
}
mTagHolder.reset();
mCallback.onCancelConsumeEvent();
}
}
/**
* 外部调用
*
* @param event
* @return
*/
public boolean onInterceptTouchEvent(MotionEvent event)
{
getTouchHelper().processTouchEvent(event);
getVelocityTracker().addMovement(event);
final int action = event.getAction();
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL)
{
onEventFinish(event);
} else
{
if (action == MotionEvent.ACTION_DOWN)
onEventStart(event);
if (!mTagHolder.isTagIntercept())
mTagHolder.setTagIntercept(mCallback.shouldInterceptEvent(event));
}
return mTagHolder.isTagIntercept();
}
/**
* 外部调用
*
* @param event
* @return
*/
public boolean onTouchEvent(MotionEvent event)
{
getTouchHelper().processTouchEvent(event);
getVelocityTracker().addMovement(event);
final int action = event.getAction();
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL)
{
onEventFinish(event);
} else if (action == MotionEvent.ACTION_DOWN)
{
onEventStart(event);
return mCallback.onEventActionDown(event);
} else
{
if (!getLifecycleInfo().isCancelConsumeEvent())
{
if (!mTagHolder.isTagConsume())
{
mTagHolder.setTagConsume(mCallback.shouldConsumeEvent(event));
} else
{
mCallback.onEventConsume(event);
getLifecycleInfo().setHasConsumeEvent(true);
}
}
}
return mTagHolder.isTagConsume();
}
private void onEventStart(MotionEvent event)
{
}
private void onEventFinish(MotionEvent event)
{
mTagHolder.reset();
mCallback.onEventFinish(getVelocityTracker(), event);
releaseVelocityTracker();
getLifecycleInfo().reset();
if (mState == State.Consume)
setState(State.Idle);
}
private final class IdleRunnable implements Runnable
{
private boolean mPost;
@Override
public void run()
{
if (mDebug)
Log.i(FGestureManager.class.getSimpleName(), "IdleRunnable run");
mPost = false;
setState(State.Idle);
}
public void post()
{
if (mDebug)
Log.i(FGestureManager.class.getSimpleName(), "IdleRunnable post");
mViewGroup.post(this);
mPost = true;
}
public void cancel()
{
if (mDebug && mPost)
Log.i(FGestureManager.class.getSimpleName(), "IdleRunnable cancel");
mViewGroup.removeCallbacks(this);
mPost = false;
}
}
public static final class LifecycleInfo
{
private boolean mHasConsumeEvent;
private boolean mIsCancelConsumeEvent;
/**
* 从按下到当前{@link Callback#onEventConsume(MotionEvent)}方法是否消费过事件
*
* @return
*/
public boolean hasConsumeEvent()
{
return mHasConsumeEvent;
}
/**
* 是否取消过消费事件
*
* @return
*/
public boolean isCancelConsumeEvent()
{
return mIsCancelConsumeEvent;
}
void setHasConsumeEvent(boolean has)
{
mHasConsumeEvent = has;
}
void setCancelConsumeEvent(boolean cancel)
{
mIsCancelConsumeEvent = cancel;
}
void reset()
{
mHasConsumeEvent = false;
mIsCancelConsumeEvent = false;
}
}
public enum State
{
/**
* 空闲
*/
Idle,
/**
* 消费事件
*/
Consume,
/**
* Scroller滚动
*/
Fling
}
public abstract static class Callback
{
/**
* 是否开始拦截事件(由{@link #onInterceptTouchEvent(MotionEvent)}方法触发)
*
* @param event
* @return
*/
public boolean shouldInterceptEvent(MotionEvent event)
{
return false;
}
/**
* 是否消费{@link MotionEvent#ACTION_DOWN}事件(由{@link #onTouchEvent(MotionEvent)}方法触发)
* <br>
* 注意,只有此方法返回了true,才有后续的移动等事件,默认返回true
*
* @param event
* @return
*/
public boolean onEventActionDown(MotionEvent event)
{
return true;
}
/**
* 是否开始消费事件(由{@link #onTouchEvent(MotionEvent)}方法触发)
*
* @param event
* @return
*/
public abstract boolean shouldConsumeEvent(MotionEvent event);
/**
* 事件回调
*
* @param event
*/
public abstract void onEventConsume(MotionEvent event);
/**
* 取消消费事件回调
*/
public void onCancelConsumeEvent()
{
}
/**
* 事件结束,收到{@link MotionEvent#ACTION_UP}或者{@link MotionEvent#ACTION_CANCEL}事件
*
* @param velocityTracker 速率计算对象,这里返回的对象还未进行速率计算,如果要获得速率需要先进行计算{@link VelocityTracker#computeCurrentVelocity(int)}
* @param event {@link MotionEvent#ACTION_UP}或者{@link MotionEvent#ACTION_CANCEL}
*/
public abstract void onEventFinish(VelocityTracker velocityTracker, MotionEvent event);
/**
* 状态变化回调{@link State}
*
* @param oldState
* @param newState
*/
public abstract void onStateChanged(State oldState, State newState);
public abstract void onScrollerCompute(int lastX, int lastY, int currX, int currY);
}
//---------- TagHolder Start ----------
public static class TagHolder
{
/**
* 是否需要拦截事件标识(用于onInterceptTouchEvent方法)
*/
private boolean mTagIntercept = false;
/**
* 是否需要消费事件标识(用于onTouchEvent方法)
*/
private boolean mTagConsume = false;
private Callback mCallback;
private TagHolder()
{
}
//---------- public method start ----------
public void setCallback(Callback callback)
{
mCallback = callback;
}
public boolean isTagIntercept()
{
return mTagIntercept;
}
public boolean isTagConsume()
{
return mTagConsume;
}
//---------- public method end ----------
/**
* 设置是否需要拦截事件标识(用于onInterceptTouchEvent方法)
*
* @param tag
*/
void setTagIntercept(boolean tag)
{
if (mTagIntercept != tag)
{
mTagIntercept = tag;
onTagInterceptChanged(tag);
}
}
/**
* 设置是否需要消费事件标识(用于onTouchEvent方法)
*
* @param tag
*/
void setTagConsume(boolean tag)
{
if (mTagConsume != tag)
{
mTagConsume = tag;
onTagConsumeChanged(tag);
}
}
void reset()
{
setTagIntercept(false);
setTagConsume(false);
}
protected void onTagInterceptChanged(boolean tag)
{
if (mCallback != null)
mCallback.onTagInterceptChanged(tag);
}
protected void onTagConsumeChanged(boolean tag)
{
if (mCallback != null)
mCallback.onTagConsumeChanged(tag);
}
public interface Callback
{
void onTagInterceptChanged(boolean tag);
void onTagConsumeChanged(boolean tag);
}
}
//---------- TagHolder Start ----------
}
| [
"565061763@qq.com"
] | 565061763@qq.com |
b0c89f480d5087bde822930f582d61a5d1bd4f8f | 09a18f139ab2674531b1639e296b53046b93605a | /app/src/main/java/com/saxxis/recharge/activities/leftmenu/QRCodeActivity.java | fcbe393d13ab769572c4ee823fa066ddb208feea | [] | no_license | mobile5saxxis/SaanPay | e94d7d7362811a13ddc285ebeab6a575466e2f6b | c4bab8518a2ecf75691a47f816696da8b8d70890 | refs/heads/master | 2020-03-22T11:26:52.651072 | 2018-07-06T10:36:26 | 2018-07-06T10:36:26 | 139,971,376 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,527 | java | package com.saxxis.recharge.activities.leftmenu;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.widget.TextView;
import com.google.zxing.Result;
import com.saxxis.recharge.R;
import com.saxxis.recharge.helpers.AppHelper;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import me.dm7.barcodescanner.zxing.ZXingScannerView;
public class QRCodeActivity extends AppCompatActivity implements ZXingScannerView.ResultHandler {
private ZXingScannerView mScannerView;
@BindView(R.id.entermobileno)
TextView textMobileno;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrcode);
ButterKnife.bind(this);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setTitle("Pay");
toolbar.setTitleTextColor(Color.parseColor("#053174"));
toolbar.setNavigationIcon(R.drawable.ic_back);
mScannerView = (ZXingScannerView)findViewById(R.id.scanner_view);
}
@OnClick(R.id.entermobileno)
void enterMobileNumber(){
AppHelper.LaunchActivity(QRCodeActivity.this,WalletPayActivity.class);
}
@Override
public void onResume() {
super.onResume();
mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results.
mScannerView.startCamera(); // Start camera on resume
}
@Override
public void onPause() {
super.onPause();
mScannerView.stopCamera(); // Stop camera on pause
}
@Override
public void handleResult(Result result) {
// Do something with the result here
System.out.println(result.getText()); // Prints scan results
System.out.println(result.getBarcodeFormat().toString()); // Prints the scan format (qrcode, pdf417 etc.)
// If you would like to resume scanning, call this method below:
// mScannerView.resumeCameraPreview(this);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId()==android.R.id.home){
super.onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}
}
| [
"mobile5saxxis@gmail.com"
] | mobile5saxxis@gmail.com |
6a084ec7464bf9eeb1522fb6c44ec5e273b2ee97 | 4e5ee3517ed48336101caf05073581cc17bf4d32 | /case_study/joda-time/src/evo/org/joda/time/base/BasePartial_ESTest_scaffolding.java | 4da4c0a7c760bf14ed1629b3ff5d68b70818cb7d | [
"Apache-2.0"
] | permissive | peifengjing/EvoSuite-cs527 | d98b77dc4045fa21dbdbd9d8546940cc2588a471 | 12eb749853ceb6a50a50435a69f492bf8c9cdee9 | refs/heads/master | 2021-08-30T01:33:53.019595 | 2017-12-15T14:42:05 | 2017-12-15T14:42:05 | 106,375,309 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 18,045 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Thu Oct 12 20:45:08 GMT 2017
*/
package org.joda.time.base;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class BasePartial_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.joda.time.base.BasePartial";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("file.encoding", "UTF-8");
java.lang.System.setProperty("java.awt.headless", "true");
java.lang.System.setProperty("user.country", "US");
java.lang.System.setProperty("user.language", "en");
java.lang.System.setProperty("user.timezone", "America/Los_Angeles");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(BasePartial_ESTest_scaffolding.class.getClassLoader() ,
"org.joda.time.DateTimeZone",
"org.joda.time.field.AbstractPartialFieldProperty",
"org.joda.time.convert.ConverterSet$Entry",
"org.joda.time.MockZone",
"org.joda.time.DateTimeFieldType$StandardDateTimeFieldType",
"org.joda.time.chrono.BasicChronology$HalfdayField",
"org.joda.time.chrono.BasicChronology$YearInfo",
"org.joda.time.LocalDate$Property",
"org.joda.time.field.UnsupportedDurationField",
"org.joda.time.ReadWritableInterval",
"org.joda.time.format.PeriodFormatterBuilder",
"org.joda.time.chrono.ISOChronology",
"org.joda.time.base.BaseLocal",
"org.joda.time.chrono.LenientChronology",
"org.joda.time.field.DividedDateTimeField",
"org.joda.time.convert.DateConverter",
"org.joda.time.chrono.ZonedChronology",
"org.joda.time.format.DateTimeFormatterBuilder$TimeZoneOffset",
"org.joda.time.field.BaseDateTimeField",
"org.joda.time.field.ZeroIsMaxDateTimeField",
"org.joda.time.base.BaseInterval",
"org.joda.time.Duration",
"org.joda.time.format.FormatUtils",
"org.joda.time.format.PeriodFormatter",
"org.joda.time.format.DateTimePrinterInternalPrinter",
"org.joda.time.Interval",
"org.joda.time.convert.LongConverter",
"org.joda.time.base.AbstractInstant",
"org.joda.time.format.DateTimeParserBucket",
"org.joda.time.ReadWritablePeriod",
"org.joda.time.convert.ConverterSet",
"org.joda.time.LocalDateTime",
"org.joda.time.tz.FixedDateTimeZone",
"org.joda.time.convert.IntervalConverter",
"org.joda.time.format.PeriodPrinter",
"org.joda.time.field.PreciseDateTimeField",
"org.joda.time.chrono.LimitChronology$LimitException",
"org.joda.time.convert.ReadableDurationConverter",
"org.joda.time.base.BaseDuration",
"org.joda.time.field.DecoratedDateTimeField",
"org.joda.time.YearMonthDay",
"org.joda.time.format.DateTimeParser",
"org.joda.time.DateTimeZone$LazyInit$1",
"org.joda.time.format.DateTimeFormatterBuilder$CharacterLiteral",
"org.joda.time.YearMonth",
"org.joda.time.chrono.GJChronology$CutoverField",
"org.joda.time.LocalTime$Property",
"org.joda.time.field.OffsetDateTimeField",
"org.joda.time.convert.ReadablePeriodConverter",
"org.joda.time.DateTime$Property",
"org.joda.time.convert.ReadableIntervalConverter",
"org.joda.time.DateTimeField",
"org.joda.time.field.FieldUtils",
"org.joda.time.format.ISODateTimeFormat",
"org.joda.time.Partial",
"org.joda.time.field.SkipDateTimeField",
"org.joda.time.base.AbstractPeriod",
"org.joda.time.DateTimeUtils$SystemMillisProvider",
"org.joda.time.chrono.GJDayOfWeekDateTimeField",
"org.joda.time.IllegalFieldValueException",
"org.joda.time.IllegalInstantException",
"org.joda.time.format.DateTimeFormatterBuilder$Composite",
"org.joda.time.format.DateTimeFormatterBuilder$UnpaddedNumber",
"org.joda.time.field.ImpreciseDateTimeField$LinkedDurationField",
"org.joda.time.ReadablePeriod",
"org.joda.time.chrono.ZonedChronology$ZonedDateTimeField",
"org.joda.time.chrono.GregorianChronology",
"org.joda.time.convert.ConverterManager",
"org.joda.time.chrono.GJChronology$LinkedDurationField",
"org.joda.time.format.DateTimeFormatterBuilder$PaddedNumber",
"org.joda.time.Minutes",
"org.joda.time.chrono.BasicMonthOfYearDateTimeField",
"org.joda.time.base.AbstractPartial",
"org.joda.time.base.BasePartial",
"org.joda.time.base.BaseDateTime",
"org.joda.time.DateTimeUtils",
"org.joda.time.base.AbstractDuration",
"org.joda.time.base.AbstractInterval",
"org.joda.time.LocalTime",
"org.joda.time.Hours",
"org.joda.time.base.BasePeriod",
"org.joda.time.field.DecoratedDurationField",
"org.joda.time.format.ISOPeriodFormat",
"org.joda.time.TimeOfDay",
"org.joda.time.DateTimeZone$LazyInit",
"org.joda.time.Partial$Property",
"org.joda.time.field.ImpreciseDateTimeField",
"org.joda.time.chrono.CopticChronology",
"org.joda.time.field.PreciseDurationField",
"org.joda.time.ReadableDuration",
"org.joda.time.chrono.BasicGJChronology",
"org.joda.time.format.DateTimeFormatterBuilder$NumberFormatter",
"org.joda.time.format.DateTimeFormatter",
"org.joda.time.DurationField",
"org.joda.time.chrono.IslamicChronology$LeapYearPatternType",
"org.joda.time.DateTime",
"org.joda.time.format.DateTimeParserInternalParser",
"org.joda.time.convert.PeriodConverter",
"org.joda.time.ReadWritableDateTime",
"org.joda.time.chrono.ZonedChronology$ZonedDurationField",
"org.joda.time.convert.CalendarConverter",
"org.joda.time.Instant",
"org.joda.time.format.PeriodFormatterBuilder$Separator",
"org.joda.time.chrono.LimitChronology$LimitDurationField",
"org.joda.time.DurationFieldType$StandardDurationFieldType",
"org.joda.time.chrono.BasicDayOfYearDateTimeField",
"org.joda.time.chrono.BuddhistChronology",
"org.joda.time.format.DateTimeFormatterBuilder$StringLiteral",
"org.joda.time.format.ISODateTimeFormat$Constants",
"org.joda.time.convert.ReadablePartialConverter",
"org.joda.time.DateTimeUtils$MillisProvider",
"org.joda.time.convert.Converter",
"org.joda.time.chrono.GJYearOfEraDateTimeField",
"org.joda.time.convert.PartialConverter",
"org.joda.time.Seconds",
"org.joda.time.field.RemainderDateTimeField",
"org.joda.time.JodaTimePermission",
"org.joda.time.chrono.BasicWeekOfWeekyearDateTimeField",
"org.joda.time.DateTimeFieldType",
"org.joda.time.format.DateTimeFormatterBuilder$Fraction",
"org.joda.time.format.DateTimeFormatterBuilder$FixedNumber",
"org.joda.time.MutableDateTime$Property",
"org.joda.time.ReadableInterval",
"org.joda.time.chrono.LimitChronology$LimitDateTimeField",
"org.joda.time.base.AbstractDateTime",
"org.joda.time.field.SkipUndoDateTimeField",
"org.joda.time.convert.AbstractConverter",
"org.joda.time.field.DelegatedDateTimeField",
"org.joda.time.chrono.BasicChronology",
"org.joda.time.chrono.BasicYearDateTimeField",
"org.joda.time.format.DateTimeFormatterBuilder",
"org.joda.time.tz.ZoneInfoProvider$1",
"org.joda.time.chrono.EthiopicChronology",
"org.joda.time.PeriodType",
"org.joda.time.field.MillisDurationField",
"org.joda.time.format.InternalPrinter",
"org.joda.time.chrono.GJChronology",
"org.joda.time.chrono.IslamicChronology",
"org.joda.time.LocalDateTime$Property",
"org.joda.time.chrono.BasicFixedMonthChronology",
"org.joda.time.field.UnsupportedDateTimeField",
"org.joda.time.field.ScaledDurationField",
"org.joda.time.chrono.ISOYearOfEraDateTimeField",
"org.joda.time.MonthDay",
"org.joda.time.field.PreciseDurationDateTimeField",
"org.joda.time.chrono.GJCacheKey",
"org.joda.time.MutablePeriod",
"org.joda.time.MutableDateTime",
"org.joda.time.ReadableDateTime",
"org.joda.time.format.PeriodFormatterBuilder$Literal",
"org.joda.time.format.PeriodParser",
"org.joda.time.DateMidnight",
"org.joda.time.convert.DurationConverter",
"org.joda.time.chrono.GJMonthOfYearDateTimeField",
"org.joda.time.format.DateTimeParserBucket$SavedState",
"org.joda.time.chrono.BasicWeekyearDateTimeField",
"org.joda.time.Days",
"org.joda.time.format.DateTimeFormatterBuilder$MatchingParser",
"org.joda.time.chrono.BasicSingleEraDateTimeField",
"org.joda.time.format.DateTimeFormat",
"org.joda.time.YearMonth$Property",
"org.joda.time.tz.UTCProvider",
"org.joda.time.chrono.LimitChronology",
"org.joda.time.ReadableInstant",
"org.joda.time.base.BaseSingleFieldPeriod",
"org.joda.time.convert.NullConverter",
"org.joda.time.tz.Provider",
"org.joda.time.chrono.AssembledChronology$Fields",
"org.joda.time.DurationFieldType",
"org.joda.time.ReadWritableInstant",
"org.joda.time.tz.NameProvider",
"org.joda.time.convert.ReadableInstantConverter",
"org.joda.time.convert.StringConverter",
"org.joda.time.convert.InstantConverter",
"org.joda.time.chrono.AssembledChronology",
"org.joda.time.chrono.StrictChronology",
"org.joda.time.chrono.GJEraDateTimeField",
"org.joda.time.tz.ZoneInfoProvider",
"org.joda.time.chrono.BaseChronology",
"org.joda.time.chrono.JulianChronology",
"org.joda.time.Period",
"org.joda.time.Weeks",
"org.joda.time.Chronology",
"org.joda.time.format.PeriodFormatterBuilder$Composite",
"org.joda.time.field.AbstractReadableInstantFieldProperty",
"org.joda.time.format.PeriodFormatterBuilder$PeriodFieldAffix",
"org.joda.time.LocalDate",
"org.joda.time.UTCDateTimeZone",
"org.joda.time.format.DateTimeParserBucket$SavedField",
"org.joda.time.MockPartial",
"org.joda.time.chrono.BasicDayOfMonthDateTimeField",
"org.joda.time.MonthDay$Property",
"org.joda.time.format.InternalParserDateTimeParser",
"org.joda.time.format.InternalParser",
"org.joda.time.ReadablePartial",
"org.joda.time.chrono.GJChronology$ImpreciseCutoverField",
"org.joda.time.field.BaseDurationField"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(BasePartial_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.joda.time.base.BasePartial",
"org.joda.time.DateTimeUtils",
"org.joda.time.DateTimeZone",
"org.joda.time.UTCDateTimeZone",
"org.joda.time.chrono.BaseChronology",
"org.joda.time.DateTimeZone$LazyInit$1",
"org.joda.time.DateTimeZone$LazyInit",
"org.joda.time.format.FormatUtils",
"org.joda.time.chrono.AssembledChronology",
"org.joda.time.field.MillisDurationField",
"org.joda.time.field.BaseDurationField",
"org.joda.time.field.PreciseDurationField",
"org.joda.time.DurationFieldType$StandardDurationFieldType",
"org.joda.time.DurationFieldType",
"org.joda.time.field.PreciseDurationDateTimeField",
"org.joda.time.field.PreciseDateTimeField",
"org.joda.time.DateTimeFieldType$StandardDateTimeFieldType",
"org.joda.time.DateTimeFieldType",
"org.joda.time.field.DecoratedDateTimeField",
"org.joda.time.field.ZeroIsMaxDateTimeField",
"org.joda.time.chrono.BasicChronology$HalfdayField",
"org.joda.time.chrono.BasicChronology",
"org.joda.time.chrono.BasicGJChronology",
"org.joda.time.tz.UTCProvider",
"org.joda.time.chrono.GregorianChronology",
"org.joda.time.chrono.ISOChronology",
"org.joda.time.convert.ConverterManager",
"org.joda.time.format.DateTimeFormat",
"org.joda.time.YearMonth",
"org.joda.time.format.ISODateTimeFormat$Constants",
"org.joda.time.convert.ReadableInstantConverter",
"org.joda.time.convert.StringConverter",
"org.joda.time.convert.CalendarConverter",
"org.joda.time.convert.DateConverter",
"org.joda.time.convert.LongConverter",
"org.joda.time.convert.NullConverter",
"org.joda.time.convert.ReadablePartialConverter",
"org.joda.time.convert.ReadableDurationConverter",
"org.joda.time.convert.ReadableIntervalConverter",
"org.joda.time.convert.ReadablePeriodConverter",
"org.joda.time.chrono.BasicFixedMonthChronology",
"org.joda.time.chrono.BasicSingleEraDateTimeField",
"org.joda.time.chrono.EthiopicChronology",
"org.joda.time.MonthDay",
"org.joda.time.base.BaseDateTime",
"org.joda.time.MutableDateTime",
"org.joda.time.Partial",
"org.joda.time.chrono.JulianChronology",
"org.joda.time.tz.FixedDateTimeZone",
"org.joda.time.Instant",
"org.joda.time.chrono.GJChronology",
"org.joda.time.base.BaseLocal",
"org.joda.time.LocalDate",
"org.joda.time.chrono.IslamicChronology$LeapYearPatternType",
"org.joda.time.chrono.IslamicChronology",
"org.joda.time.chrono.ZonedChronology",
"org.joda.time.chrono.BuddhistChronology",
"org.joda.time.MockPartial",
"org.joda.time.chrono.CopticChronology",
"org.joda.time.MockZone",
"org.joda.time.base.BaseInterval",
"org.joda.time.Interval",
"org.joda.time.LocalTime",
"org.joda.time.chrono.LenientChronology",
"org.joda.time.base.BaseSingleFieldPeriod",
"org.joda.time.format.ISOPeriodFormat",
"org.joda.time.format.PeriodFormatterBuilder",
"org.joda.time.format.PeriodFormatterBuilder$Literal",
"org.joda.time.PeriodType",
"org.joda.time.Days",
"org.joda.time.Hours",
"org.joda.time.base.BasePeriod",
"org.joda.time.MutablePeriod",
"org.joda.time.DateTime",
"org.joda.time.LocalDateTime",
"org.joda.time.JodaTimePermission",
"org.joda.time.field.UnsupportedDateTimeField",
"org.joda.time.base.BaseDuration",
"org.joda.time.Duration",
"org.joda.time.chrono.StrictChronology",
"org.joda.time.field.ImpreciseDateTimeField",
"org.joda.time.chrono.BasicYearDateTimeField",
"org.joda.time.field.ImpreciseDateTimeField$LinkedDurationField",
"org.joda.time.chrono.GJYearOfEraDateTimeField",
"org.joda.time.field.OffsetDateTimeField",
"org.joda.time.field.DividedDateTimeField",
"org.joda.time.field.DecoratedDurationField",
"org.joda.time.field.ScaledDurationField",
"org.joda.time.field.RemainderDateTimeField",
"org.joda.time.chrono.GJEraDateTimeField",
"org.joda.time.chrono.GJDayOfWeekDateTimeField",
"org.joda.time.chrono.BasicDayOfMonthDateTimeField",
"org.joda.time.chrono.BasicDayOfYearDateTimeField",
"org.joda.time.chrono.BasicMonthOfYearDateTimeField",
"org.joda.time.chrono.GJMonthOfYearDateTimeField",
"org.joda.time.chrono.BasicWeekyearDateTimeField",
"org.joda.time.chrono.BasicWeekOfWeekyearDateTimeField",
"org.joda.time.field.UnsupportedDurationField",
"org.joda.time.chrono.ISOYearOfEraDateTimeField"
);
}
}
| [
"peifengjing@gmail.com"
] | peifengjing@gmail.com |
d3a8bc4f79c24f0ee555c63c064502c231a6a873 | bfc0fddbfe02eb10ad980da3511f114f8bfa409f | /crm114j/src/net/sf/fraglets/crm114j/CategoryLogTokenizer.java | a986ce8c6d1305ea8c161ac84196630fe4dbab33 | [] | no_license | alagopus/fraglets | cf125ae31d5e055e3be55b5776cb82709eaa474b | b3291953df7bc2d9b50ac7061b3f11ea9c8c75ae | refs/heads/master | 2021-01-25T09:00:35.176601 | 2009-03-10T19:17:12 | 2009-03-10T19:17:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,818 | java | /*
* $Id: CategoryLogTokenizer.java,v 1.2 2004-04-04 23:39:21 marion Exp $
* Copyright (C) 2004 Klaus Rennecke, all rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2.1
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package net.sf.fraglets.crm114j;
/**
* @version $Id: CategoryLogTokenizer.java,v 1.2 2004-04-04 23:39:21 marion Exp $
*/
public class CategoryLogTokenizer extends Tokenizer {
/**
* @param buffer
*/
public CategoryLogTokenizer(char[] buffer) {
super(buffer);
}
/**
*
*/
protected CategoryLogTokenizer() {
super();
}
/**
* @param str
*/
public CategoryLogTokenizer(String str) {
super(str);
}
/**
* @see net.sf.fraglets.crm114j.Tokenizer#next()
*/
public boolean next() {
char[] b = getBuffer();
int o = getOff() + getLen();
int i = o, l = getMax();
if (i < l) {
boolean in = Character.isLetterOrDigit(b[i++]);
while (i < l && in == Character.isLetterOrDigit(b[i])) {
i++;
}
reset(b, o, i - o, l);
return true;
} else {
reset(b, o, 0, l);
return false;
}
}
}
| [
"marion"
] | marion |
1f8b24abc5892b295b06da83a14e8511ed3e7252 | f11edd23d12491bed8eaab967e525725f02ddd36 | /domain/src/main/java/chigirh/app/kakeibo/domain/entity/page/condition/Order.java | 468ff6bde3aef502ce2d03a72aed391f2fa4330f | [] | no_license | chigirh/kakeibo-application | f85901e797811ee0f4994acd68c73dbf45d3b0d8 | 1b1709a485498b405f235338bd080aa1444c5bd2 | refs/heads/master | 2023-04-23T23:03:24.501674 | 2021-05-02T22:40:12 | 2021-05-02T22:40:12 | 359,035,557 | 0 | 0 | null | 2021-05-02T22:40:13 | 2021-04-18T03:35:05 | Java | UTF-8 | Java | false | false | 100 | java | package chigirh.app.kakeibo.domain.entity.page.condition;
public enum Order {
ASC,
DESC,
}
| [
"abch9431@gmail.com"
] | abch9431@gmail.com |
b1805683a0186e7f264373916d1b7ed0ebaff3fd | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_ff27d7f5fb96adb3ee6adf0fbe34f8f2d1e6c848/RemoteController/2_ff27d7f5fb96adb3ee6adf0fbe34f8f2d1e6c848_RemoteController_s.java | c2ba68c4f04021d16f2aa42567ba28f5d834b9ff | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,643 | java | package org.xbmc.android.remote.presentation.controller;
import java.io.IOException;
import org.xbmc.android.remote.business.ManagerFactory;
import org.xbmc.api.business.IEventClientManager;
import org.xbmc.api.presentation.INotifiableController;
import org.xbmc.eventclient.ButtonCodes;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.media.AudioManager;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.Button;
public class RemoteController extends AbstractController implements INotifiableController, IController {
IEventClientManager mEventClientManager;
/**
* timestamp since last trackball use.
*/
private long mTimestamp = 0;
private final Vibrator mVibrator;
private final boolean mDoVibrate;
public RemoteController(Context context) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
mEventClientManager = ManagerFactory.getEventClientManager(this);
mVibrator = (Vibrator)context.getSystemService(Context.VIBRATOR_SERVICE);
mDoVibrate = prefs.getBoolean("setting_vibrate_on_touch", true);
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
char key = (char)event.getUnicodeChar();
if (key > 'A' && key < 'z')
return keyboardAction("" + key);
try {
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_VOLUME_PLUS, false, true, true, (short)0, (byte)0);
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_VOLUME_MINUS, false, true, true, (short)0, (byte)0);
return true;
case KeyEvent.KEYCODE_DPAD_DOWN:
mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_DOWN, false, true, true, (short)0, (byte)0);
return true;
case KeyEvent.KEYCODE_DPAD_UP:
mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_UP, false, true, true, (short)0, (byte)0);
return true;
case KeyEvent.KEYCODE_DPAD_LEFT:
mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_LEFT, false, true, true, (short)0, (byte)0);
return true;
case KeyEvent.KEYCODE_DPAD_RIGHT:
mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_RIGHT, false, true, true, (short)0, (byte)0);
return true;
case KeyEvent.KEYCODE_DPAD_CENTER:
mEventClientManager.sendButton("R1", ButtonCodes.REMOTE_ENTER, false, true, true, (short)0, (byte)0);
return true;
default:
return false;
}
} catch (IOException e) {
return false;
}
}
public boolean onTrackballEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN)
return keyboardAction(ButtonCodes.KEYBOARD_ENTER);
else{
// check when the last trackball move happened to avoid too speedy selections
long newstamp = System.currentTimeMillis();
if (newstamp - mTimestamp > 300){
mTimestamp = newstamp;
if (Math.abs(event.getX()) > 0.15f) {
return keyboardAction(event.getX() < 0 ? ButtonCodes.KEYBOARD_LEFT : ButtonCodes.KEYBOARD_RIGHT);
} else if (Math.abs(event.getY()) > 0.15f){
return keyboardAction(event.getY() < 0 ? ButtonCodes.KEYBOARD_UP : ButtonCodes.KEYBOARD_DOWN);
}
}
}
return false;
}
/**
* Sends a keyboard event
* @param button
* @return
*/
private boolean keyboardAction(String button) {
try {
mEventClientManager.sendButton("KB", button, false, true, true, (short)0, (byte)0);
return true;
} catch (IOException e) {
return false;
}
}
/**
* Shortcut for adding the listener class to the button
* @param resourceButton Resource ID of the button
* @param action Action string
* @param resourceButtonUp Resource ID of the button up image
* @param resourceButtonDown Resource ID of the button down image
*/
public void setupButton(View btn, String action) {
if (btn != null) {
btn.setOnTouchListener(new OnRemoteAction(action));
((Button)btn).setSoundEffectsEnabled(true);
((Button)btn).setClickable(true);
}
}
/**
* Handles the push- release button code. Switches image of the pressed
* button, vibrates and executes command.
*/
private class OnRemoteAction implements OnTouchListener {
private final String mAction;
public OnRemoteAction(String action) {
mAction = action;
}
public boolean onTouch(View v, MotionEvent event) {
try {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (mDoVibrate) {
mVibrator.vibrate(45);
}
mEventClientManager.sendButton("R1", mAction, true, true, true, (short)0, (byte)0);
} else if (event.getAction() == MotionEvent.ACTION_UP) {
v.playSoundEffect(AudioManager.FX_KEY_CLICK);
mEventClientManager.sendButton("R1", mAction, false, false, true, (short)0, (byte)0);
}
} catch (IOException e) {
return false;
}
return false;
}
}
public void onActivityPause() {
mEventClientManager.setController(null);
super.onActivityPause();
}
public void onActivityResume(Activity activity) {
super.onActivityResume(activity);
mEventClientManager.setController(this);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
6f1292ac1b3cb0cd0b7c3a7d4a328ebb6af3c8a4 | 16be4b5d7b111dae18a4117b0dcf434cf44e4215 | /src/main/java/q700/Q679_24Game.java | 9fa3bf4949574084d66a3be7527059b64ad0da80 | [
"MIT"
] | permissive | sunxuia/leetcode-solution-java | a3d8d680fabc014216ef9837d119b02acde923b5 | 2794f83c9e80574f051c00b8a24c6a307bccb6c5 | refs/heads/master | 2022-11-12T13:31:04.464274 | 2022-11-09T14:20:28 | 2022-11-09T14:20:28 | 219,247,361 | 1 | 0 | MIT | 2020-10-26T10:55:12 | 2019-11-03T03:43:25 | Java | UTF-8 | Java | false | false | 3,037 | java | package q700;
import org.junit.runner.RunWith;
import util.runner.Answer;
import util.runner.LeetCodeRunner;
import util.runner.TestData;
import util.runner.data.DataExpectation;
/**
* https://leetcode.com/problems/24-game/
*
* You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *,
* /, +, -, (, ) to get the value of 24.
*
* Example 1:
*
* Input: [4, 1, 8, 7]
* Output: True
* Explanation: (8-4) * (7-1) = 24
*
* Example 2:
*
* Input: [1, 2, 1, 2]
* Output: False
*
* Note:
*
* 1. The division operator / represents real division, not integer division. For example, 4 / (1 - 2/3) = 12.
* 2. Every operation done is between two numbers. In particular, we cannot use - as a unary operator. For example,
* with [1, 1, 1, 1] as input, the expression -1 - 1 - 1 - 1 is not allowed.
* 3. You cannot concatenate numbers together. For example, if the input is [1, 2, 1, 2], we cannot write this as 12
* + 12.
*/
@RunWith(LeetCodeRunner.class)
public class Q679_24Game {
/**
* 没想出什么特别好的方法, LeetCode 中比较快的解法如下, 也是一般的回溯.
* Solution 中的解法与之思路一致.
*/
@Answer
public boolean judgePoint24(int[] nums) {
double[] doubleNums = new double[nums.length];
for (int i = 0; i < doubleNums.length; i++) {
doubleNums[i] = nums[i];
}
return dfs(doubleNums, nums.length);
}
private boolean dfs(double[] nums, int n) {
if (n == 1 && Math.abs(nums[0] - 24) <= 1e-6) {
return true;
}
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
double a = nums[i];
double b = nums[j];
nums[j] = nums[n - 1];
nums[i] = a + b;
if (dfs(nums, n - 1)) {
return true;
}
nums[i] = a - b;
if (dfs(nums, n - 1)) {
return true;
}
nums[i] = a * b;
if (dfs(nums, n - 1)) {
return true;
}
nums[i] = b - a;
if (dfs(nums, n - 1)) {
return true;
}
if (a != 0) {
nums[i] = b / a;
if (dfs(nums, n - 1)) {
return true;
}
}
if (b != 0) {
nums[i] = a / b;
if (dfs(nums, n - 1)) {
return true;
}
}
nums[i] = a;
nums[j] = b;
}
}
return false;
}
@TestData
public DataExpectation example1 = DataExpectation.create(new int[]{4, 1, 8, 7}).expect(true);
@TestData
public DataExpectation example2 = DataExpectation.create(new int[]{1, 2, 1, 2}).expect(false);
}
| [
"ntsunxu@163.com"
] | ntsunxu@163.com |
d7cc307b694ebce8601b46eabba45a3c2fd634fa | 9ef7891b29def16695beccde4da8a6d31a9ac411 | /TetrisFrame.java | 3f437cc207ece8399aa3bcff5782c61c35fa3643 | [] | no_license | LNJK95/Tetris | abf3de8de679448a9c7b0b38263f405cef090e9c | 27b063ee848264714b16975a2dcfb29c109def96 | refs/heads/master | 2021-04-26T15:18:22.233377 | 2016-03-21T00:41:00 | 2016-03-21T00:41:00 | 54,318,857 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,060 | java | package Tetris;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class TetrisFrame extends JFrame
{
final Timer clockTimer;
public TetrisFrame(final Board board) throws HeadlessException {
super("Tetris");
final TetrisComponent gameArea = new TetrisComponent(board);
this.setLayout(new BorderLayout());
this.add(gameArea, BorderLayout.CENTER);
final JLabel score = new JLabel("Score: " + board.getPoints());
final JMenuBar menuBar = new JMenuBar();
final JMenu options = new JMenu("Options");
JMenuItem quit = new JMenuItem("Quit");
options.add(quit);
quit.addActionListener(new QuitListener());
JMenuItem newGame = new JMenuItem("New Game");
options.add(newGame);
newGame.addActionListener(new NewGameListener());
menuBar.add(options);
this.setJMenuBar(menuBar);
this.add(score, BorderLayout.PAGE_START);
this.setVisible(true);
this.pack();
board.addBoardListener(gameArea);
//keybindings
class LeftAction extends AbstractAction {
@Override public void actionPerformed(final ActionEvent e) {
board.moveLeft();
}
}
class RightAction extends AbstractAction {
@Override public void actionPerformed(final ActionEvent e) {
board.moveRight();
}
}
class RotateAction extends AbstractAction {
@Override public void actionPerformed(final ActionEvent e) {
board.rotate();
}
}
class DownAction extends AbstractAction {
@Override public void actionPerformed(final ActionEvent e) {
board.moveDown();
}
}
class QuitAction extends AbstractAction {
@Override public void actionPerformed(final ActionEvent e) {
int answer = JOptionPane.showConfirmDialog(new JFrame(), "Do you really want to quit?", "Quit?", JOptionPane.YES_NO_OPTION);
if (answer == JOptionPane.YES_OPTION) {
System.exit(0);
}
}
}
final InputMap in = gameArea.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
in.put(KeyStroke.getKeyStroke("RIGHT"), "moveRight" );
in.put(KeyStroke.getKeyStroke("LEFT"), "moveLeft" );
in.put(KeyStroke.getKeyStroke("UP"), "rotate");
in.put(KeyStroke.getKeyStroke("DOWN"), "moveDown");
in.put(KeyStroke.getKeyStroke("ESCAPE"), "quit");
final ActionMap act = gameArea.getActionMap();
act.put("moveRight", new RightAction());
act.put("moveLeft", new LeftAction());
act.put("rotate", new RotateAction());
act.put("moveDown", new DownAction());
act.put("quit", new QuitAction());
//Do a step
final Action doOneStep = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
if (!board.getGameOver()) {
board.tick();
score.setText("Score: " + board.getPoints());
}
else {
String player = JOptionPane.showInputDialog(new JFrame(), "Please enter your name :)");
Highscore hs = new Highscore(board.getPoints(), player);
HighscoreList.getInstance().addHighscore(hs);
int answer =
JOptionPane.showConfirmDialog(new JFrame(),
HighscoreList.getInstance() + "\n" + "Do you want to play again?",
"Game Over", JOptionPane.YES_NO_OPTION);
if (answer == JOptionPane.YES_OPTION) {
dispose();
stopTimer();
new TetrisFrame(new Board(10, 20));
}
else if (answer == JOptionPane.NO_OPTION) {
System.exit(0);
}
}
}
};
clockTimer = new Timer(500, doOneStep);
startTimer();
}
public void startTimer() {
clockTimer.setCoalesce(true);
clockTimer.start();
}
public void stopTimer() {
clockTimer.stop();
}
private class QuitListener implements ActionListener {
@Override public void actionPerformed(final ActionEvent e) {
int answer = JOptionPane.showConfirmDialog(new JFrame(), "Do you really want to quit?", "Quit?", JOptionPane.YES_NO_OPTION);
if (answer == JOptionPane.YES_OPTION) {
System.exit(0);
}
}
}
private class NewGameListener implements ActionListener {
@Override public void actionPerformed(final ActionEvent e) {
dispose();
stopTimer();
new TetrisFrame(new Board(10,20));
}
}
}
| [
"ejkaveus@gmail.com"
] | ejkaveus@gmail.com |
f41456aac76c916cb6f7fb9e125befa91466167f | f09e3d54fe90a05e9df0d812b9e990d4bcdb79ef | /src/test/java/mySample/stepdefinitions/ExcelDataFeedStepDefs.java | 31b22a12f36ff9d9f84a2512d796fa9e5738861c | [
"Apache-2.0"
] | permissive | kayurm/cucumber_starter_VP | abc089c0e03b2ef80d336bd7ec3d50fb207293e5 | a4787235903924e6606d663f975cf223db6889a4 | refs/heads/master | 2023-07-04T08:20:12.011930 | 2021-06-14T16:29:32 | 2021-06-14T16:29:32 | 393,348,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,471 | java | package mySample.stepdefinitions;
import io.cucumber.java.Before;
import io.cucumber.java.en.Given;
import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import mySample.contactForm.ContactFormSteps;
import mySample.cookiesDialogue.CookiesSteps;
import mySample.dataDriven.ExcelReader;
import net.thucydides.core.annotations.Steps;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class ExcelDataFeedStepDefs {
@Steps
CookiesSteps cookiesDialogue;
@Steps
ContactFormSteps contactForm;
@Steps
ExcelReader excelReader;
@Given("I have users data in excel file {string}")
public void iHaveUsersDataInExcel(String fileName) {
excelReader.setDataFile(fileName);
}
@Given("I opened Contact form on the website")
public void iOpenContactForm() {
contactForm.openPage();
}
@Given("I accepted all cookies")
public void iAcceptedAllCookies() {
cookiesDialogue.acceptAllCookies();
}
@Given("I verified I was in the Contact form")
public void verifyContactFormIsOpened() {
contactForm.verifyBeingInContactFormPage();
}
@When("I read data from the spreadsheet named {string}")
public void iReadDataFromTheSpreadsheet(String sheetName) {
excelReader.readSheetFromDataFile(sheetName);
}
/**
* VARIANT 1. LOOPED TEST (see feature 'excelWithLoop.feature')
* I don't like it as:
* - if one of the iterations (with a row of dataset) fails, the test itself fails, and using try-catch won't be good for reporting
* - iterations are dependable, as I need to go back to the Input page (or open it again) after I finish a new iteration
*/
@When("I input each value into fields on the form and submit the form I expect confirmation message with all values")
public void iInputEachValueIntoFields() {
List<LinkedHashMap<String, String>> dataMap = excelReader.getSheetDataAsMap();
for (LinkedHashMap<String, String> record : dataMap) {
for (Map.Entry<String, String> entry : record.entrySet()) {
contactForm.enterValueToField(entry.getKey(), entry.getValue());
}
contactForm
.clickDatenschutzCheckbox()
.submitForm()
.verifyConfirmationMessageAppears()
.verifyValuesInConfirmationScreen()
.openPage();
}
}
@When("I input each value into fields on the form and submit the form I expect error message")
public void iInputEachValueIntoFieldsExpectErrorMessage() {
List<LinkedHashMap<String, String>> dataMap = excelReader.getSheetDataAsMap();
for (LinkedHashMap<String, String> record : dataMap) {
for (Map.Entry<String, String> entry : record.entrySet()) {
contactForm.enterValueToField(entry.getKey(), entry.getValue());
}
contactForm
.clickDatenschutzCheckbox()
.submitForm()
.verifyErrorMessageAppears();
}
}
/**
* VARIANT 2. TEST with 'Scenario outline' usage (see feature 'excelWithScenarioOutline.feature')
* I like this approach more, as it's iterable by cucumber and each test is independent
*/
@When("^I input values into fields taken from the sheet (\\d+)$")
public void iInputValuesIntoFieldsFromRowNumber(int row) {
List<LinkedHashMap<String, String>> dataMap = excelReader.getSheetDataAsMap();
LinkedHashMap<String, String> dataRowMap = dataMap.get(row-1);
for (Map.Entry<String, String> entry : dataRowMap.entrySet()) {
contactForm.enterValueToField(entry.getKey(), entry.getValue());
}
}
@When("I accept Datenschutz and submit the form")
public void iAcceptDatenschutzAndSubmitTheForm() {
contactForm
.clickDatenschutzCheckbox()
.submitForm();
}
@Then("I expect successful confirmation message with all values in it")
public void iExpectSuccessfulConfirmationMessageWithValues() {
contactForm
.verifyConfirmationMessageAppears()
.verifyValuesInConfirmationScreen();
}
@Then("I expect error message")
public void iExpectErrorMessage() {
contactForm
.verifyErrorMessageAppears();
}
}
| [
"Kateryna.Yurmanovych@canadalife.de"
] | Kateryna.Yurmanovych@canadalife.de |
d9caf77346c9aea4e96ac74600d902e763ee8b07 | 304058415c00834cd5dd487b8cd4090c535e7fd7 | /LN_simple3/src/lN_simple3/CognateCell.java | e54d3973c9d78774654286edc3b6f4d018f1b4c7 | [] | no_license | johnsara04/paracortex_model_johnson19 | 12b0c5bca353f16eeed622b7f202278e30fd95cf | 3bfa87b862b868ee6510c5c43e521ee7f4259cef | refs/heads/master | 2021-08-31T20:12:34.005206 | 2021-08-22T21:28:13 | 2021-08-22T21:28:13 | 195,870,596 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 25,322 | java | package lN_simple3;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import repast.simphony.context.Context;
import repast.simphony.engine.environment.RunEnvironment;
import repast.simphony.engine.schedule.ScheduledMethod;
import repast.simphony.parameter.Parameters;
import repast.simphony.query.space.grid.GridCell;
import repast.simphony.random.RandomHelper;
//import repast.simphony.space.continuous.ContinuousSpace;
import repast.simphony.space.graph.Network;
import repast.simphony.space.grid.Grid;
import repast.simphony.space.grid.GridPoint;
import repast.simphony.util.ContextUtils;
import repast.simphony.util.SimUtilities;
public class CognateCell extends Tcell {
//extra fields
public int timeSinceFirstBound;
public boolean Activated;
public boolean Effector;
public int proliferationCount; //when initialising, would grab this from the parent
public double stimulation;
public double S1P1;
public int istring;
public boolean trackingvalue;
public int timeSinceFirstAct;
public boolean CD4;
public boolean CD8;
public boolean M;
public int TimeSinceDif;
//constructor
public CognateCell(
//ContinuousSpace<Object>space, // no longer use continuous space
Grid<Object>grid,
int retainTime,
int age,
int timeSinceLastBind,
int timeSinceEntered,
int DCContacted,
int timeFirst,
double thisStim,
boolean activated,
boolean effector,
int profCount,
double S1p1,
int iString,
boolean Trackingvalue,
int timeAct,
boolean cd4,
boolean cd8,
boolean m,
int timeSinceDif
)
{
super (//space,
grid,retainTime,age,timeSinceLastBind,timeSinceEntered,DCContacted,S1p1,iString,Trackingvalue);
Activated = activated ;
Effector=effector;
proliferationCount = profCount ;
S1P1 = S1p1;
istring = iString;
trackingvalue = Trackingvalue;
timeSinceFirstBound = timeFirst;
stimulation = thisStim;
timeSinceFirstAct=timeAct;
CD4 = cd4;
CD8 = cd8;
M = m;
TimeSinceDif =timeSinceDif;
}
@ScheduledMethod(start = 1, interval = 1 , priority = 7)
public void updateCell()
{
//update history
if (timeSinceFirstBound > 0)
{ timeSinceFirstBound++;}
if (timeSinceFirstAct > 0 )
{timeSinceFirstAct++;}
if (getTimeSinceDif() > 0)
{TimeSinceDif++;}
//resetting time since last differentiated after 8hours 5 mins
if (getTimeSinceDif() == 1455)
{setTimeSinceDif(1);}
//T cell has accumulated stimulation, let it decay down to 1
if (stimulation > 1)
{ updateStimulation();}
//if the T cell is naive , see if it can be activated ( bound or unbound)
//but only if it has some stimulation. (if it has ever interacted with a DC this will be >0)
if (stimulation>0)
{if (getActivation() == false && getEffector()==false && getM()==false )
{checkActivation();}}
//if not bound
if (getRetention() ==0){
//checkProliferation + //reproduce
if (getActivation()== true || getEffector()==true)
{seeIfreproduceActivatedOrEffector();}
}
// See if T cell can differentiate (early effector) ( don't have to check if it is an effector already?)
if (getProfCount() > 4 && getProfCount() < 8 && getM()==false)
{seeIfEffector();}
// see if T cell can differentiate (late effector)// memory cells stay as memory cells
if (getProfCount()>= 8 && getM() == false && getEffector()==true)
{seeIfMemoryorEff(); }
}
//separate early and effector queries allow differences to be applied more easily
//links between cells ( projections) are stored in 'infection network'
public void removeLinks(){
Context<Object> context = (Context)ContextUtils.getContext(this);
Network<Object>net=(Network<Object>)context.getProjection("DC interaction network");
List<Object> listNodes = new ArrayList();
for (Object node: net.getAdjacent(this))
{
listNodes.add(node);
}
//set each node free
for (Object Node : listNodes)
{
if (Node instanceof DC )
{
int n2 = ((DC)Node).getBoundCount()-1;
((DC)Node).setBoundCount(n2);
int T = ((DC)Node).getTcellsContacted() ;
if(T > 0){((DC)Node).setTcellsContacted((T+1));} //(was so you only track newly entered cells
net.removeEdge(net.getEdge(this,Node));
}
} }
@Override
public void checkAge()
{ //if naive
if (Activated == false && Effector == false && getM() ==false)
{
int n = RandomHelper.createNormal(Constants.lifespanT,100).nextInt();
if (getAge()> n){
removeLinks();
lymph_node3DContext.removeCellAgeing(this);
}
}
//if activated
if (Activated == true)
{ int n = RandomHelper.createNormal(Constants.lifespan_ActT, 20).nextInt(); //(41 hours)
if (getAge()> n){
removeLinks();
lymph_node3DContext.removeCellAgeing(this);
}
}//if effector
if (Effector == true)
{
//if antigenc stimuli disappeared, effectors apoptose rapidly // this removed as short anyway
int n = RandomHelper.createNormal(Constants.lifespan_EffT,200).nextInt(); //(3days hours)//was 41 //15120,
//int n2 = RandomHelper.createNormal(Constants.lifespan_EffT, 180).nextInt(); //(12hours)//could alter 2160
// if (lymph_node3DContext.getTotalMHCII()>100)
// {
if (getAge()>n)
{ removeLinks();
lymph_node3DContext.removeCellAgeing(this);
}
}
// if (lymph_node3DContext.getTotalMHCII()<=100)
// { if (getAge()>n2)
// { removeLinks();
// lymph_node3DContext.removeCellAgeing(this);
// }
// }
// }
//no lifespan for memory as beyond scope of the model
}
@Override
public void seeIfExit() throws IOException
{
//activated cells upregulate CD69 and downregulate S1P1r so reducing exit probability
//Bound cells do not exit so no need to remove links as it's already free
Parameters params = RunEnvironment.getInstance().getParameters();
double value = RandomHelper.nextDoubleFromTo(0, 100000)/100000;
double exitProb = (Double)params.getValue("Pe")*(getS1P1());
if (value < exitProb)
{
lymph_node3DContext.removeCellExit(this);
}
else
checkAge();
}
@Override
public void seeIfExit2() throws IOException
{
//activated cells upregulate CD69 and downregulate S1P1r so reducing exit probability
//Bound cells do not exit so no need to remove links as it's already free
Parameters params = RunEnvironment.getInstance().getParameters();
double value = RandomHelper.nextDoubleFromTo(0, 100000)/100000;
double exitProb = (Double)params.getValue("Pe2")*(getS1P1());
if (value < exitProb)
{
lymph_node3DContext.removeCellExit(this);
}
else
checkAge();
}
public void updateStimulation(){
Parameters params = RunEnvironment.getInstance().getParameters();
double stim = getStimulation();
stim = stim*(Double)params.getValue("decay");
setStimulation(stim);
}
public void checkActivation()
{
Parameters params = RunEnvironment.getInstance().getParameters();
double S1P1act = (double)params.getValue("S1P1act");
double x = RandomHelper.nextDoubleFromTo(0, 1000) / 1000;
//cd4
int c1 = Constants.ACTIVATION_MEAN_CD4; //actully this is
double d1 = Constants.ACTIVATION_CURVE_CD4;
//cd8
int c2 = Constants.ACTIVATION_MEAN_CD8;
double d2 = Constants.ACTIVATION_CURVE_CD8;
//if a CD4 > always the same, use activation binding curve
if (getCD4()==true){
double ActProbCD4 = 1/ (1+ Math.exp(-((getStimulation() - c1)/d1)));
if ( x < ActProbCD4 )
{
setActivation(true);
// variation used to test different methods, 4 options defined in param file.
setS1P1(S1P1act);
setTimeSinceFirstAct(1);
}}
//if a CD8> gotta check the DC to see if it is licenced, as this means it's more likely to activate a cell.
if (getCD8()==true)
{
Context<Object> context = (Context)ContextUtils.getContext(this);
Network<Object>net=(Network<Object>)context.getProjection("DC interaction network");
for (Object node: net.getAdjacent(this)) //should only ever have one DC
{
if (node instanceof DC)
{
if (((DC)node).getLicenced() ==true)
{
double ActProbCD4 = 1/ (1+ Math.exp(-((getStimulation() - c1)/d1))); //this value will be the Activation Binding Curve = 1/(1+exp{(-getStimulation() - c1)/d1))
if ( x < ActProbCD4 )
{
setActivation(true);
setS1P1(S1P1act);
//System.out.println("CD8 activated with licenced DC");
setTimeSinceFirstAct(1);
}
}
}
//else can still activate even if DC is not licensed or bound
else
{
double ActProbCD8 = 1/ (1+ Math.exp(-((-getStimulation() - c2)/d2))); //this value will be the Activation Binding Curve = 1/(1+exp{(-getStimulation() - c1)/d1))
if ( x < ActProbCD8 )
{
setActivation(true);
setS1P1(S1P1act);
setTimeSinceFirstAct(1);
}
}
}
} //end of cd8 stuff
}
// maybe pass in stimualtion and gridpoint location: why?
public void seeIfreproduceActivatedOrEffector()
{
if (getCD4()==true){
if (getProfCount() < Constants.MaxProfCD4 ){ //10 max
int somevalue = RandomHelper.createNormal(Constants.proftimeCD4, 90).nextInt();
if (getTimeSinceFirstAct() > somevalue)//(1980, 180)) //11hours,1hour
{
//if (getStimulation()>0.00){
seeifreproduceCD4();
//}
}}}
else if (getCD8()==true){
if (getProfCount() < Constants.MaxProfCD8 ){ //16 profs MaxProfCD8
int somevalue = RandomHelper.createNormal(Constants.proftimeCD8, 90).nextInt();
if (getTimeSinceFirstAct() > somevalue)//(1260, 180)) //7hours
{
//System.out.println("Seeing if reproducing CD8");
//if (getStimulation()>0.01){
seeifreproduceCD8();
//}
}}}
}
public void seeifreproduceCD4()
{
GridPoint thispoint = grid.getLocation(this);
int profCount = getProfCount() + 1;
int parentAge = getAge();
double parentS1P1 = getS1P1();
boolean parentCD4 = getCD4();
boolean parentCD8 = getCD8();
boolean M = getM(); // this will be altered in the see if effector stage
int daughterAge = 1; //parentAge / 2 ;
double parentStimulation = getStimulation();
double daughterStimulation = parentStimulation / 2 ;
boolean activated = getActivation();
boolean effector = getEffector(); //this means if activated/effector,produce daughter cells of the same type
//instead of a new cell , just reset the age and stim on self?
int TimeSinceDif = getTimeSinceDif();
//update parent (to new daughter)
setAge(daughterAge);
setRetention(0);
setTimeSinceLastBound(0);
setStimulation(daughterStimulation);
setProfCount(profCount);
//setTimeSinceEntered(1); // leave the old counter on, so a better picture of how long these
//cells are actually in the node is give, then other cell is set at one. in this way you'll
//probably end up with some subsets. // to get rid of the subsets and have in one set, you
// need to set daughter same as parent
setTimeSinceFirstAct(1);
//could add regulation of S1P1 per profliferation here if you wanted to
//timesincefirst bound stays the same as it's overuled by prolif anyway
Context context = ContextUtils.getContext(this);
//update other daughter
int retainTime = 0;
double S1p1 = parentS1P1;
istring = 0;
trackingvalue = false;
int timeAct = 1;//time since first act, used to counter the time since last proliferated
int timeSinceLastBind = 0;
int timeFirst = getTimeSinceFirstBind(); //first bound though maybe change this //doesn't really matter as timeFirst is now overule as prof>0
int timeSinceEntered = 1; //so that is picked up as a counter
int DCContacted = 0;
boolean CD4 = parentCD4;
boolean CD8 = parentCD8;
CognateCell cell = new CognateCell(
//space,
grid, retainTime,age,timeSinceLastBind,
timeSinceEntered,
DCContacted,
timeFirst,
daughterStimulation,
activated,effector,profCount,S1p1,istring,trackingvalue,timeAct,
CD4,
CD8,
M,
TimeSinceDif);
context.add(cell);
// System.out.println("Daugter cell added CD4 activation time = " + getTimeSinceFirstAct());
//method to get neighbors and filter the result and return a list
List<GridCell<Tcell>>inside = getInsideGrids(thispoint);
//tbh this gives an array of grid cells not gridpoint> useful if you want to check the contents of the cells i suppose
// could have a different method that just returns grid points, not their contents.
//this would be the manual + 1 -1 method, for now, just keep the cell method
SimUtilities.shuffle(inside, RandomHelper.getUniform());
if (inside.size() == 0)
{
//System.out.println("nowhere to put daughter cells");
}
else
{
GridPoint insidepoint = inside.get(0).getPoint();
//shuffle list
// space.moveTo(cell,insidepoint.getX(), insidepoint.getY(),insidepoint.getZ());//space pt
grid.moveTo(cell, insidepoint.getX(), insidepoint.getY(),insidepoint.getZ());
int count = lymph_node3DContext.getTCellCount();
lymph_node3DContext.setTCellCount (count + 1);
}}
public void seeifreproduceCD8()
{
GridPoint thispoint = grid.getLocation(this);
int profCount = getProfCount() + 1;
int parentAge = getAge();
double parentS1P1 = getS1P1();
boolean parentCD4 = getCD4();
boolean parentCD8 = getCD8();
boolean M = getM(); // this will be altered in the see if effector stage
int daughterAge = 1; //parentAge / 2 ;
double parentStimulation = getStimulation();
double daughterStimulation = parentStimulation / 2 ;
boolean activated = getActivation();
boolean effector = getEffector(); //this means if activated/effector,produce daughter cells of the same type
//instead of a new cell , just reset the age and stim on self?
int TimeSinceDif = getTimeSinceDif();
//update parent (to new daughter)
setAge(daughterAge);
setRetention(0);
setTimeSinceLastBound(0);
setStimulation(daughterStimulation);
setProfCount(profCount);
// setTimeSinceEntered(1); see comments as above.
setTimeSinceFirstAct(1);
//timesincefirst bound stays the same as it's overuled by prolif anyway
Context context = ContextUtils.getContext(this);
//update other daughter
int retainTime = 0;
double S1p1 = parentS1P1;
istring = 0;
trackingvalue = false;
int timeAct = 1;//time since first act, used to counter the time since last proliferated
int timeSinceLastBind = 0;
int timeFirst = getTimeSinceFirstBind(); //first bound though maybe change this //doesn't really matter as timeFirst is now overule as prof>0
int timeSinceEntered = 1; //so that is picked up as a counter
int DCContacted = 0;
boolean CD4 = parentCD4;
boolean CD8 = parentCD8;
CognateCell cell = new CognateCell(
//space,
grid, retainTime,age,timeSinceLastBind,
timeSinceEntered,
DCContacted,
timeFirst,
daughterStimulation,
activated,effector,profCount,S1p1,istring, trackingvalue , timeAct,
CD4,
CD8,
M,
TimeSinceDif);
context.add(cell);
// System.out.println("Daugter cell added CD8");
//method to get neighbors and filter the result and return a list
List<GridCell<Tcell>>inside = getInsideGrids(thispoint);
//tbh this gives an array of grid cells not gridpoint> useful if you want to check the contents of the cells i suppose
// could have a different method that just returns grid points, not their contents.
//this would be the manual + 1 -1 method, for now, just keep the cell method
SimUtilities.shuffle(inside, RandomHelper.getUniform());
if (inside.size() == 0)
{
//System.out.println("nowhere to put daughter cells");
}
else
{
GridPoint insidepoint = inside.get(0).getPoint();
//shuffle list
// space.moveTo(cell,insidepoint.getX(), insidepoint.getY(),insidepoint.getZ());//space pt
grid.moveTo(cell, insidepoint.getX(), insidepoint.getY(),insidepoint.getZ());
int count = lymph_node3DContext.getTCellCount();
lymph_node3DContext.setTCellCount (count + 1);
}}
public void seeIfEffector()
{
//add the time since dif to between 8 hours and 8hours 5
//if time since dif is zero, meaning it has never been differentiated before or getTimeSinceDif > 1440 (8hours)
//and always set back to 1 to start counter
if (getTimeSinceDif()==0 || getTimeSinceDif() >1440 ){//shouldn't need to specify as reset in update&& getTimeSinceDif() <1455
double x = RandomHelper.nextDoubleFromTo(0, 1000)/1000;
int e1 = Constants.EFFECTOR_MEAN_CD4;
double f1 = Constants.EFFECTOR_CURVE_CD4;
int e2 = Constants.EFFECTOR_MEAN_CD8;
double f2 = Constants.EFFECTOR_CURVE_CD8;
double effProbCD4 = 1/ (1+ Math.exp(-((-getStimulation() - e1)/f1))); //this value will be the Effector differentiation Curve = 1/(1+exp{(-getStimulation() - e1)/f1))
double effProbCD8 = 1/ (1+ Math.exp(-((-getStimulation() - e2)/f2)));
if (getCD4()==true)
{if ( x < effProbCD4 )
{
if (RandomHelper.nextIntFromTo(0, 10000)< (Constants.early_dif_ratio*10000))
{//make memory cell}
setEffector(false);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/ don't need to touch this
setS1P1(Constants.S1P1mem);
setTimeSinceFirstAct(1); // this affects the interaction behaviour
setActivation(false); //no need to alter, actually there is otherwise counted in ifs
setTimeSinceDif(1); // instead do this
setM(true);
//tActivation(false); //removes from the reproduction cycle
//System.out.println("Memory Cell made");
}
else{
setEffector(true);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/
setTimeSinceDif(1); // instead do this
setS1P1(Constants.S1P1eff_early);
setActivation(false); // i think this is ok.
}}}
else
{
if ( x < effProbCD8 )
{
if (RandomHelper.nextIntFromTo(0, 10000)< (Constants.early_dif_ratio*10000))
{//make memory cell}
setEffector(false);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/
setTimeSinceFirstAct(1); //testing
setTimeSinceDif(1); // instead do this
setS1P1(Constants.S1P1mem);
setActivation(false);
setM(true);
}
else{
setEffector(true);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/
setTimeSinceDif(1); // instead do this
setS1P1(Constants.S1P1eff_early);
setActivation(false); // i think this is ok.
}
}
}
}
}
public void seeIfMemoryorEff()
{
//this will be to take cells with prolif > 6 and see if they differentiate into memory cells or continue as effectors.
// is a requisite to be an effector already
//so activation = 0, effector = 0, CM = 1
if (getTimeSinceDif() >1440 ){ // no need for upper limit as it's always set back to 1 in the update section
//could maybe alter this into a joint method
double x = RandomHelper.nextDoubleFromTo(0, 1000)/1000;
int e1 = Constants.EFFECTOR_MEAN_CD4;
double f1 = Constants.EFFECTOR_CURVE_CD4;
int e2 = Constants.EFFECTOR_MEAN_CD8;
double f2 = Constants.EFFECTOR_CURVE_CD8;
double effProbCD4 = 1/ (1+ Math.exp((-getStimulation() - e1)/f1)); //this value will be the Effector differentiation Curve = 1/(1+exp{(-getStimulation() - e1)/f1))
double effProbCD8 = 1/ (1+ Math.exp((-getStimulation() - e2)/f2));
if (getCD4()==true)
{
if (x< effProbCD4)
{
if (RandomHelper.nextIntFromTo(0, 10000)< (Constants.late_dif_ratio *10000) )
{//make memory cell}
setEffector(false);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/
setTimeSinceDif(1); // instead do this
setS1P1(Constants.S1P1mem);
setActivation(false);
setM(true);
//System.out.println("Memory Cell made");
}
else{
setEffector(true);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/
setTimeSinceDif(1); // instead do this
setS1P1(Constants.S1P1eff_late);
setActivation(false); // i think this is ok.
}}}
else{
if ( x < effProbCD8 )
{
if (RandomHelper.nextIntFromTo(0, 10000)< (Constants.late_dif_ratio*10000))
{//make memory cell}
setEffector(false);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/
setTimeSinceDif(1); // instead do this
setS1P1(Constants.S1P1mem);
setActivation(false);
setM(true);
//System.out.println("Memory Cell made");
}
else{
setEffector(true);
//setTimeSinceFirstAct(1); // as will only be updated if > 0/
setTimeSinceDif(1); // instead do this
setS1P1(Constants.S1P1eff_late);
setActivation(false); // i think this is ok.
}}} }
}
@Override
public void updateInitalS1P1 ()
{ if (getActivation()==false && getEffector()==false && getM()==false)
{setS1P1(1);};
}
@Override
public void checkInflammation() //acts on cognate cells that are not activated at start and new
//ones that enter at the end of the stim.
{
if(getActivation() ==false && getEffector()==false && getM()==false)
{
if (timeSinceEntered == 0 || timeSinceEntered > Constants.responsetimeInflam) //4hours
{ Parameters params = RunEnvironment.getInstance().getParameters();
double S1P1all_inflam = (Double)params.getValue("S1P1all_inflam");
double divide = (1.0-S1P1all_inflam) / 3.0;
double a = S1P1all_inflam+divide;
double b =S1P1all_inflam+divide+divide;
if (lymph_node3DContext.getTotalMHCII()<= 60000)
{setS1P1(1);}
if (lymph_node3DContext.getTotalMHCII()> 60000 && lymph_node3DContext.getTotalMHCII() <= 140000 )
{ setS1P1(b);};
if (lymph_node3DContext.getTotalMHCII()> 140000 && lymph_node3DContext.getTotalMHCII() <= 200000 )
{ setS1P1(a);}
if (lymph_node3DContext.getTotalMHCII()> 200000 )
{ setS1P1(S1P1all_inflam);}
}
//because we want it to go back to normal when this isn't true
}
else {
//don't act on activated or effector
}
}
public int getProfCount()
{
return proliferationCount;
}
public void setProfCount(int value)
{
this.proliferationCount = value;
}
public void setTimeSinceFirstBind(int value)
{this.timeSinceFirstBound = value;}
public int getTimeSinceFirstBind()
{ return timeSinceFirstBound;
}
public void setStimulation(double newstimulation)
{
this.stimulation = newstimulation;
}
public double getStimulation()
{
return stimulation;
}
public boolean getActivation(){
return Activated;
}
private void setActivation(boolean value)
{
this.Activated = value;
//this.setTimeSinceFirstAct(1);
}
private void setEffector(boolean value)
{
this.Effector = value; //but need to set Activated false?
}
public boolean getEffector()
{
return Effector;
}
public void setTimeSinceFirstAct(int value)
{
this.timeSinceFirstAct = value;
}
public int getTimeSinceFirstAct()
{
return timeSinceFirstAct;
}
public boolean getCD4()
{
return CD4;
}
public void setCD4(boolean value)
{
this.CD4 = value;
}
public boolean getCD8()
{
return CD8;
}
public void setCD8(boolean value)
{
this.CD8 = value;
}
public boolean getM()
{
return M;
}
public void setM(boolean value)
{
this.M = value;
}
public int getTimeSinceDif()
{
return TimeSinceDif;
}
public void setTimeSinceDif(int value)
{
this.TimeSinceDif= value;
}
@Override
public void setS1P1(double value)
{
this.S1P1 = value;
}
public double getS1P1()
{
return S1P1;
}
}
| [
"32797906+johnsara04@users.noreply.github.com"
] | 32797906+johnsara04@users.noreply.github.com |
a089f1a09d379e04e905b0ae52db3800f1947515 | f8cb347b486afeb77bfb63bccf0c8f607c025bb8 | /src/main/java/io/security/corespringsecurity/repository/RoleHierarchyRepository.java | 2a286f48963160f8b31d9dcfcf4257da67c6c010 | [] | no_license | hodolee246/core-spring-security | 2da80a5888e60e97afafccb5c1f671d1b3cfe496 | 60d345cb44105e5fa930d761e8b0c75a64ce5479 | refs/heads/main | 2023-07-22T21:59:10.682906 | 2021-09-09T10:57:43 | 2021-09-09T10:57:43 | 382,523,948 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package io.security.corespringsecurity.repository;
import io.security.corespringsecurity.domain.entity.RoleHierarchy;
import org.springframework.data.jpa.repository.JpaRepository;
public interface RoleHierarchyRepository extends JpaRepository<RoleHierarchy, Long> {
RoleHierarchy findByChildName(String roleName);
}
| [
"hodolee246@naver.com"
] | hodolee246@naver.com |
87eac97e60a24898b6a3e5abac861664bd204b8d | 2c56b2d8a0367a6a3ede700692250bd12fbbf3a1 | /src/Part1.java | c235531ec44168470bd254afb6cb4c048d6152dd | [] | no_license | pchatanan/TileWorld | 2d89c2f8e6acb42e96c3a7bd23f1ac477b91ec12 | deffaf7a875c4b643001a67c295033816901b977 | refs/heads/master | 2021-04-12T08:01:36.037139 | 2018-03-20T13:48:54 | 2018-03-20T13:48:54 | 126,023,174 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,844 | java | import Tile.State;
import Tile.Tile;
public class Part1 {
private static final int WIDTH = 6;
private static final int HEIGHT = 6;
private static final String WALL_COORS = "(1,0)(4,1)(1,4)(2,4)(3,4)";
private static final String GREEN_COORS = "(0,0)(2,0)(5,0)(3,1)(4,2)(5,3)";
private static final String ORANGE_COORS = "(1,1)(2,2)(3,3)(4,4)(5,1)";
private static final double DISCOUNT = 0.99;
private static final int ITERATION = 77;
public static void main(String [] args)
{
// Part 1: perform Value Iteration
TileWorld tileWorld1 = new TileWorld(WIDTH, HEIGHT, WALL_COORS, GREEN_COORS, ORANGE_COORS);
Action[][] policy1 = PolicyMaker.performValueIteration(tileWorld1, DISCOUNT, ITERATION);
//...
// print outputs
for(int x = 0; x < tileWorld1.getWidth(); x++) {
for(int y = 0; y < tileWorld1.getHeight(); y++) {
Tile tile = tileWorld1.getTiles()[x][y];
if(tile.getTileType() == Tile.TileType.STATE) {
State state = (State) tile;
double utility = state.getUtility();
String tileId = TileWorldUtil.encodeCoordinate(x, y);
System.out.println(String.format("%-12s %-12s %.3f", tileId, policy1[x][y], utility));
}
}
}
// Part 2: perform Policy Iteration
TileWorld tileWorld2 = new TileWorld(WIDTH, HEIGHT, WALL_COORS, GREEN_COORS, ORANGE_COORS);
Action[][] policy2 = PolicyMaker.performPolicyIteration(tileWorld2, DISCOUNT);
for(int x = 0; x < tileWorld2.getWidth(); x++) {
for(int y = 0; y < tileWorld2.getHeight(); y++) {
Tile tile = tileWorld2.getTiles()[x][y];
if(tile.getTileType() == Tile.TileType.STATE) {
String tileId = TileWorldUtil.encodeCoordinate(x, y);
State state = (State) tile;
double utility = state.getUtility();
System.out.println(String.format("%-12s %-12s %.3f", tileId, policy2[x][y], utility));
}
}
}
// check if the 2 optimal policies are identical
for(int x = 0; x < policy1.length; x++) {
for (int y = 0; y < policy1.length; y++) {
Tile tile = tileWorld2.getTiles()[x][y];
if(tile.getTileType() == Tile.TileType.STATE) {
if(policy1[x][y].getIndex() != policy2[x][y].getIndex()) {
try {
throw new Exception("Optimal policies are not identical.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
}
}
| [
"p.chatanan@gmail.com"
] | p.chatanan@gmail.com |
6dab91c659e801f84507705ce0e40749b44fadf3 | 13ec2dc38b654bf9776d1e2332e75387c555df42 | /app/src/main/java/com/accuweather/algirdas/vweather/CurrentForecast/JsonData/CurrentObservation.java | 7a830d03156953a8136c921004988b9ef0ae6902 | [] | no_license | apundzius/VWeather | 1058f9da138148a6f6171cabc527930f5ed81c75 | 2525114704620ec4d476f84014186f6350040620 | refs/heads/master | 2021-01-22T23:26:37.473168 | 2015-09-15T14:36:20 | 2015-09-15T14:36:20 | 42,524,999 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 21,548 | java | package com.accuweather.algirdas.vweather.CurrentForecast.JsonData;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* Created by Algirdas on 2015.09.01.
*/
public class CurrentObservation {
@Expose
private Image image;
@SerializedName("display_location")
@Expose
private DisplayLocation displayLocation;
@SerializedName("observation_location")
@Expose
private ObservationLocation observationLocation;
@Expose
private Estimated estimated;
@SerializedName("station_id")
@Expose
private String stationId;
@SerializedName("observation_time")
@Expose
private String observationTime;
@SerializedName("observation_time_rfc822")
@Expose
private String observationTimeRfc822;
@SerializedName("observation_epoch")
@Expose
private String observationEpoch;
@SerializedName("local_time_rfc822")
@Expose
private String localTimeRfc822;
@SerializedName("local_epoch")
@Expose
private String localEpoch;
@SerializedName("local_tz_short")
@Expose
private String localTzShort;
@SerializedName("local_tz_long")
@Expose
private String localTzLong;
@SerializedName("local_tz_offset")
@Expose
private String localTzOffset;
@Expose
private String weather;
@SerializedName("temperature_string")
@Expose
private String temperatureString;
@SerializedName("temp_f")
@Expose
private Double tempF;
@SerializedName("temp_c")
@Expose
private Double tempC;
@SerializedName("relative_humidity")
@Expose
private String relativeHumidity;
@SerializedName("wind_string")
@Expose
private String windString;
@SerializedName("wind_dir")
@Expose
private String windDir;
@SerializedName("wind_degrees")
@Expose
private Integer windDegrees;
@SerializedName("wind_mph")
@Expose
private Double windMph;
@SerializedName("wind_gust_mph")
@Expose
private String windGustMph;
@SerializedName("wind_kph")
@Expose
private Double windKph;
@SerializedName("wind_gust_kph")
@Expose
private String windGustKph;
@SerializedName("pressure_mb")
@Expose
private String pressureMb;
@SerializedName("pressure_in")
@Expose
private String pressureIn;
@SerializedName("pressure_trend")
@Expose
private String pressureTrend;
@SerializedName("dewpoint_string")
@Expose
private String dewpointString;
@SerializedName("dewpoint_f")
@Expose
private Integer dewpointF;
@SerializedName("dewpoint_c")
@Expose
private Integer dewpointC;
@SerializedName("heat_index_string")
@Expose
private String heatIndexString;
@SerializedName("heat_index_f")
@Expose
private String heatIndexF;
@SerializedName("heat_index_c")
@Expose
private String heatIndexC;
@SerializedName("windchill_string")
@Expose
private String windchillString;
@SerializedName("windchill_f")
@Expose
private String windchillF;
@SerializedName("windchill_c")
@Expose
private String windchillC;
@SerializedName("feelslike_string")
@Expose
private String feelslikeString;
@SerializedName("feelslike_f")
@Expose
private String feelslikeF;
@SerializedName("feelslike_c")
@Expose
private String feelslikeC;
@SerializedName("visibility_mi")
@Expose
private String visibilityMi;
@SerializedName("visibility_km")
@Expose
private String visibilityKm;
@Expose
private String solarradiation;
@Expose
private String UV;
@SerializedName("precip_1hr_string")
@Expose
private String precip1hrString;
@SerializedName("precip_1hr_in")
@Expose
private String precip1hrIn;
@SerializedName("precip_1hr_metric")
@Expose
private String precip1hrMetric;
@SerializedName("precip_today_string")
@Expose
private String precipTodayString;
@SerializedName("precip_today_in")
@Expose
private String precipTodayIn;
@SerializedName("precip_today_metric")
@Expose
private String precipTodayMetric;
@Expose
private String icon;
@SerializedName("icon_url")
@Expose
private String iconUrl;
@SerializedName("forecast_url")
@Expose
private String forecastUrl;
@SerializedName("history_url")
@Expose
private String historyUrl;
@SerializedName("ob_url")
@Expose
private String obUrl;
/**
*
* @return
* The image
*/
public Image getImage() {
return image;
}
/**
*
* @param image
* The image
*/
public void setImage(Image image) {
this.image = image;
}
/**
*
* @return
* The displayLocation
*/
public DisplayLocation getDisplayLocation() {
return displayLocation;
}
/**
*
* @param displayLocation
* The display_location
*/
public void setDisplayLocation(DisplayLocation displayLocation) {
this.displayLocation = displayLocation;
}
/**
*
* @return
* The observationLocation
*/
public ObservationLocation getObservationLocation() {
return observationLocation;
}
/**
*
* @param observationLocation
* The observation_location
*/
public void setObservationLocation(ObservationLocation observationLocation) {
this.observationLocation = observationLocation;
}
/**
*
* @return
* The estimated
*/
public Estimated getEstimated() {
return estimated;
}
/**
*
* @param estimated
* The estimated
*/
public void setEstimated(Estimated estimated) {
this.estimated = estimated;
}
/**
*
* @return
* The stationId
*/
public String getStationId() {
return stationId;
}
/**
*
* @param stationId
* The station_id
*/
public void setStationId(String stationId) {
this.stationId = stationId;
}
/**
*
* @return
* The observationTime
*/
public String getObservationTime() {
return observationTime;
}
/**
*
* @param observationTime
* The observation_time
*/
public void setObservationTime(String observationTime) {
this.observationTime = observationTime;
}
/**
*
* @return
* The observationTimeRfc822
*/
public String getObservationTimeRfc822() {
return observationTimeRfc822;
}
/**
*
* @param observationTimeRfc822
* The observation_time_rfc822
*/
public void setObservationTimeRfc822(String observationTimeRfc822) {
this.observationTimeRfc822 = observationTimeRfc822;
}
/**
*
* @return
* The observationEpoch
*/
public String getObservationEpoch() {
return observationEpoch;
}
/**
*
* @param observationEpoch
* The observation_epoch
*/
public void setObservationEpoch(String observationEpoch) {
this.observationEpoch = observationEpoch;
}
/**
*
* @return
* The localTimeRfc822
*/
public String getLocalTimeRfc822() {
return localTimeRfc822;
}
/**
*
* @param localTimeRfc822
* The local_time_rfc822
*/
public void setLocalTimeRfc822(String localTimeRfc822) {
this.localTimeRfc822 = localTimeRfc822;
}
/**
*
* @return
* The localEpoch
*/
public String getLocalEpoch() {
return localEpoch;
}
/**
*
* @param localEpoch
* The local_epoch
*/
public void setLocalEpoch(String localEpoch) {
this.localEpoch = localEpoch;
}
/**
*
* @return
* The localTzShort
*/
public String getLocalTzShort() {
return localTzShort;
}
/**
*
* @param localTzShort
* The local_tz_short
*/
public void setLocalTzShort(String localTzShort) {
this.localTzShort = localTzShort;
}
/**
*
* @return
* The localTzLong
*/
public String getLocalTzLong() {
return localTzLong;
}
/**
*
* @param localTzLong
* The local_tz_long
*/
public void setLocalTzLong(String localTzLong) {
this.localTzLong = localTzLong;
}
/**
*
* @return
* The localTzOffset
*/
public String getLocalTzOffset() {
return localTzOffset;
}
/**
*
* @param localTzOffset
* The local_tz_offset
*/
public void setLocalTzOffset(String localTzOffset) {
this.localTzOffset = localTzOffset;
}
/**
*
* @return
* The weather
*/
public String getWeather() {
return weather;
}
/**
*
* @param weather
* The weather
*/
public void setWeather(String weather) {
this.weather = weather;
}
/**
*
* @return
* The temperatureString
*/
public String getTemperatureString() {
return temperatureString;
}
/**
*
* @param temperatureString
* The temperature_string
*/
public void setTemperatureString(String temperatureString) {
this.temperatureString = temperatureString;
}
/**
*
* @return
* The tempF
*/
public Double getTempF() {
return tempF;
}
/**
*
* @param tempF
* The temp_f
*/
public void setTempF(Double tempF) {
this.tempF = tempF;
}
/**
*
* @return
* The tempC
*/
public Double getTempC() {
return tempC;
}
/**
*
* @param tempC
* The temp_c
*/
public void setTempC(Double tempC) {
this.tempC = tempC;
}
/**
*
* @return
* The relativeHumidity
*/
public String getRelativeHumidity() {
return relativeHumidity;
}
/**
*
* @param relativeHumidity
* The relative_humidity
*/
public void setRelativeHumidity(String relativeHumidity) {
this.relativeHumidity = relativeHumidity;
}
/**
*
* @return
* The windString
*/
public String getWindString() {
return windString;
}
/**
*
* @param windString
* The wind_string
*/
public void setWindString(String windString) {
this.windString = windString;
}
/**
*
* @return
* The windDir
*/
public String getWindDir() {
return windDir;
}
/**
*
* @param windDir
* The wind_dir
*/
public void setWindDir(String windDir) {
this.windDir = windDir;
}
/**
*
* @return
* The windDegrees
*/
public Integer getWindDegrees() {
return windDegrees;
}
/**
*
* @param windDegrees
* The wind_degrees
*/
public void setWindDegrees(Integer windDegrees) {
this.windDegrees = windDegrees;
}
/**
*
* @return
* The windMph
*/
public Double getWindMph() {
return windMph;
}
/**
*
* @param windMph
* The wind_mph
*/
public void setWindMph(Double windMph) {
this.windMph = windMph;
}
/**
*
* @return
* The windGustMph
*/
public String getWindGustMph() {
return windGustMph;
}
/**
*
* @param windGustMph
* The wind_gust_mph
*/
public void setWindGustMph(String windGustMph) {
this.windGustMph = windGustMph;
}
/**
*
* @return
* The windKph
*/
public Double getWindKph() {
return windKph;
}
/**
*
* @param windKph
* The wind_kph
*/
public void setWindKph(Double windKph) {
this.windKph = windKph;
}
/**
*
* @return
* The windGustKph
*/
public String getWindGustKph() {
return windGustKph;
}
/**
*
* @param windGustKph
* The wind_gust_kph
*/
public void setWindGustKph(String windGustKph) {
this.windGustKph = windGustKph;
}
/**
*
* @return
* The pressureMb
*/
public String getPressureMb() {
return pressureMb;
}
/**
*
* @param pressureMb
* The pressure_mb
*/
public void setPressureMb(String pressureMb) {
this.pressureMb = pressureMb;
}
/**
*
* @return
* The pressureIn
*/
public String getPressureIn() {
return pressureIn;
}
/**
*
* @param pressureIn
* The pressure_in
*/
public void setPressureIn(String pressureIn) {
this.pressureIn = pressureIn;
}
/**
*
* @return
* The pressureTrend
*/
public String getPressureTrend() {
return pressureTrend;
}
/**
*
* @param pressureTrend
* The pressure_trend
*/
public void setPressureTrend(String pressureTrend) {
this.pressureTrend = pressureTrend;
}
/**
*
* @return
* The dewpointString
*/
public String getDewpointString() {
return dewpointString;
}
/**
*
* @param dewpointString
* The dewpoint_string
*/
public void setDewpointString(String dewpointString) {
this.dewpointString = dewpointString;
}
/**
*
* @return
* The dewpointF
*/
public Integer getDewpointF() {
return dewpointF;
}
/**
*
* @param dewpointF
* The dewpoint_f
*/
public void setDewpointF(Integer dewpointF) {
this.dewpointF = dewpointF;
}
/**
*
* @return
* The dewpointC
*/
public Integer getDewpointC() {
return dewpointC;
}
/**
*
* @param dewpointC
* The dewpoint_c
*/
public void setDewpointC(Integer dewpointC) {
this.dewpointC = dewpointC;
}
/**
*
* @return
* The heatIndexString
*/
public String getHeatIndexString() {
return heatIndexString;
}
/**
*
* @param heatIndexString
* The heat_index_string
*/
public void setHeatIndexString(String heatIndexString) {
this.heatIndexString = heatIndexString;
}
/**
*
* @return
* The heatIndexF
*/
public String getHeatIndexF() {
return heatIndexF;
}
/**
*
* @param heatIndexF
* The heat_index_f
*/
public void setHeatIndexF(String heatIndexF) {
this.heatIndexF = heatIndexF;
}
/**
*
* @return
* The heatIndexC
*/
public String getHeatIndexC() {
return heatIndexC;
}
/**
*
* @param heatIndexC
* The heat_index_c
*/
public void setHeatIndexC(String heatIndexC) {
this.heatIndexC = heatIndexC;
}
/**
*
* @return
* The windchillString
*/
public String getWindchillString() {
return windchillString;
}
/**
*
* @param windchillString
* The windchill_string
*/
public void setWindchillString(String windchillString) {
this.windchillString = windchillString;
}
/**
*
* @return
* The windchillF
*/
public String getWindchillF() {
return windchillF;
}
/**
*
* @param windchillF
* The windchill_f
*/
public void setWindchillF(String windchillF) {
this.windchillF = windchillF;
}
/**
*
* @return
* The windchillC
*/
public String getWindchillC() {
return windchillC;
}
/**
*
* @param windchillC
* The windchill_c
*/
public void setWindchillC(String windchillC) {
this.windchillC = windchillC;
}
/**
*
* @return
* The feelslikeString
*/
public String getFeelslikeString() {
return feelslikeString;
}
/**
*
* @param feelslikeString
* The feelslike_string
*/
public void setFeelslikeString(String feelslikeString) {
this.feelslikeString = feelslikeString;
}
/**
*
* @return
* The feelslikeF
*/
public String getFeelslikeF() {
return feelslikeF;
}
/**
*
* @param feelslikeF
* The feelslike_f
*/
public void setFeelslikeF(String feelslikeF) {
this.feelslikeF = feelslikeF;
}
/**
*
* @return
* The feelslikeC
*/
public String getFeelslikeC() {
return feelslikeC;
}
/**
*
* @param feelslikeC
* The feelslike_c
*/
public void setFeelslikeC(String feelslikeC) {
this.feelslikeC = feelslikeC;
}
/**
*
* @return
* The visibilityMi
*/
public String getVisibilityMi() {
return visibilityMi;
}
/**
*
* @param visibilityMi
* The visibility_mi
*/
public void setVisibilityMi(String visibilityMi) {
this.visibilityMi = visibilityMi;
}
/**
*
* @return
* The visibilityKm
*/
public String getVisibilityKm() {
return visibilityKm;
}
/**
*
* @param visibilityKm
* The visibility_km
*/
public void setVisibilityKm(String visibilityKm) {
this.visibilityKm = visibilityKm;
}
/**
*
* @return
* The solarradiation
*/
public String getSolarradiation() {
return solarradiation;
}
/**
*
* @param solarradiation
* The solarradiation
*/
public void setSolarradiation(String solarradiation) {
this.solarradiation = solarradiation;
}
/**
*
* @return
* The UV
*/
public String getUV() {
return UV;
}
/**
*
* @param UV
* The UV
*/
public void setUV(String UV) {
this.UV = UV;
}
/**
*
* @return
* The precip1hrString
*/
public String getPrecip1hrString() {
return precip1hrString;
}
/**
*
* @param precip1hrString
* The precip_1hr_string
*/
public void setPrecip1hrString(String precip1hrString) {
this.precip1hrString = precip1hrString;
}
/**
*
* @return
* The precip1hrIn
*/
public String getPrecip1hrIn() {
return precip1hrIn;
}
/**
*
* @param precip1hrIn
* The precip_1hr_in
*/
public void setPrecip1hrIn(String precip1hrIn) {
this.precip1hrIn = precip1hrIn;
}
/**
*
* @return
* The precip1hrMetric
*/
public String getPrecip1hrMetric() {
return precip1hrMetric;
}
/**
*
* @param precip1hrMetric
* The precip_1hr_metric
*/
public void setPrecip1hrMetric(String precip1hrMetric) {
this.precip1hrMetric = precip1hrMetric;
}
/**
*
* @return
* The precipTodayString
*/
public String getPrecipTodayString() {
return precipTodayString;
}
/**
*
* @param precipTodayString
* The precip_today_string
*/
public void setPrecipTodayString(String precipTodayString) {
this.precipTodayString = precipTodayString;
}
/**
*
* @return
* The precipTodayIn
*/
public String getPrecipTodayIn() {
return precipTodayIn;
}
/**
*
* @param precipTodayIn
* The precip_today_in
*/
public void setPrecipTodayIn(String precipTodayIn) {
this.precipTodayIn = precipTodayIn;
}
/**
*
* @return
* The precipTodayMetric
*/
public String getPrecipTodayMetric() {
return precipTodayMetric;
}
/**
*
* @param precipTodayMetric
* The precip_today_metric
*/
public void setPrecipTodayMetric(String precipTodayMetric) {
this.precipTodayMetric = precipTodayMetric;
}
/**
*
* @return
* The icon
*/
public String getIcon() {
return icon;
}
/**
*
* @param icon
* The icon
*/
public void setIcon(String icon) {
this.icon = icon;
}
/**
*
* @return
* The iconUrl
*/
public String getIconUrl() {
return iconUrl;
}
/**
*
* @param iconUrl
* The icon_url
*/
public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
}
/**
*
* @return
* The forecastUrl
*/
public String getForecastUrl() {
return forecastUrl;
}
/**
*
* @param forecastUrl
* The forecast_url
*/
public void setForecastUrl(String forecastUrl) {
this.forecastUrl = forecastUrl;
}
/**
*
* @return
* The historyUrl
*/
public String getHistoryUrl() {
return historyUrl;
}
/**
*
* @param historyUrl
* The history_url
*/
public void setHistoryUrl(String historyUrl) {
this.historyUrl = historyUrl;
}
/**
*
* @return
* The obUrl
*/
public String getObUrl() {
return obUrl;
}
/**
*
* @param obUrl
* The ob_url
*/
public void setObUrl(String obUrl) {
this.obUrl = obUrl;
}
}
| [
"Algirdas@kodinis.lt"
] | Algirdas@kodinis.lt |
2ebb94d731e28c4b9a7270f18a877fea81023ec7 | 208ba847cec642cdf7b77cff26bdc4f30a97e795 | /cb/ca/src/main/java/org.wp.ca/ui/stats/StatsUIHelper.java | 8e6e59e6a251867f69eb9d70dfd3270b26e62862 | [] | no_license | kageiit/perf-android-large | ec7c291de9cde2f813ed6573f706a8593be7ac88 | 2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8 | refs/heads/master | 2021-01-12T14:00:19.468063 | 2016-09-27T13:10:42 | 2016-09-27T13:10:42 | 69,685,305 | 0 | 0 | null | 2016-09-30T16:59:49 | 2016-09-30T16:59:48 | null | UTF-8 | Java | false | false | 14,828 | java | package org.wp.ca.ui.stats;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Point;
import android.text.Spannable;
import android.text.style.URLSpan;
import android.util.SparseBooleanArray;
import android.view.Display;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Interpolator;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.widget.ExpandableListAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import org.wp.ca.R;
import org.wp.ca.WordPress;
import org.wp.ca.util.DisplayUtils;
class StatsUIHelper {
// Max number of rows to show in a stats fragment
private static final int STATS_GROUP_MAX_ITEMS = 10;
private static final int STATS_CHILD_MAX_ITEMS = 50;
private static final int ANIM_DURATION = 150;
// Used for tablet UI
private static final int TABLET_720DP = 720;
private static final int TABLET_600DP = 600;
private static boolean isInLandscape(Activity act) {
Display display = act.getWindowManager().getDefaultDisplay();
Point point = new Point();
display.getSize(point);
return (point.y < point.x);
}
// Load more bars for 720DP tablets
private static boolean shouldLoadMoreBars() {
return (StatsUtils.getSmallestWidthDP() >= TABLET_720DP);
}
public static void reloadLinearLayout(Context ctx, ListAdapter adapter, LinearLayout linearLayout, int maxNumberOfItemsToshow) {
if (ctx == null || linearLayout == null || adapter == null) {
return;
}
// limit number of items to show otherwise it would cause performance issues on the LinearLayout
int count = Math.min(adapter.getCount(), maxNumberOfItemsToshow);
if (count == 0) {
linearLayout.removeAllViews();
return;
}
int numExistingViews = linearLayout.getChildCount();
// remove excess views
if (count < numExistingViews) {
int numToRemove = numExistingViews - count;
linearLayout.removeViews(count, numToRemove);
numExistingViews = count;
}
int bgColor = Color.TRANSPARENT;
for (int i = 0; i < count; i++) {
final View view;
// reuse existing view when possible
if (i < numExistingViews) {
View convertView = linearLayout.getChildAt(i);
view = adapter.getView(i, convertView, linearLayout);
view.setBackgroundColor(bgColor);
setViewBackgroundWithoutResettingPadding(view, i == 0 ? 0 : R.drawable.stats_list_item_background);
} else {
view = adapter.getView(i, null, linearLayout);
view.setBackgroundColor(bgColor);
setViewBackgroundWithoutResettingPadding(view, i == 0 ? 0 : R.drawable.stats_list_item_background);
linearLayout.addView(view);
}
}
linearLayout.invalidate();
}
/**
*
* Padding information are reset when changing the background Drawable on a View.
* The reason why setting an image resets the padding is because 9-patch images can encode padding.
*
* See http://stackoverflow.com/a/10469121 and
* http://www.mail-archive.com/android-developers@googlegroups.com/msg09595.html
*
* @param v The view to apply the background resource
* @param backgroundResId The resource ID
*/
private static void setViewBackgroundWithoutResettingPadding(final View v, final int backgroundResId) {
final int paddingBottom = v.getPaddingBottom(), paddingLeft = v.getPaddingLeft();
final int paddingRight = v.getPaddingRight(), paddingTop = v.getPaddingTop();
v.setBackgroundResource(backgroundResId);
v.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
}
public static void reloadLinearLayout(Context ctx, ListAdapter adapter, LinearLayout linearLayout) {
reloadLinearLayout(ctx, adapter, linearLayout, STATS_GROUP_MAX_ITEMS);
}
public static void reloadGroupViews(final Context ctx,
final ExpandableListAdapter mAdapter,
final SparseBooleanArray mGroupIdToExpandedMap,
final LinearLayout mLinearLayout) {
reloadGroupViews(ctx, mAdapter, mGroupIdToExpandedMap, mLinearLayout, STATS_GROUP_MAX_ITEMS);
}
public static void reloadGroupViews(final Context ctx,
final ExpandableListAdapter mAdapter,
final SparseBooleanArray mGroupIdToExpandedMap,
final LinearLayout mLinearLayout,
final int maxNumberOfItemsToshow) {
if (ctx == null || mLinearLayout == null || mAdapter == null || mGroupIdToExpandedMap == null) {
return;
}
int groupCount = Math.min(mAdapter.getGroupCount(), maxNumberOfItemsToshow);
if (groupCount == 0) {
mLinearLayout.removeAllViews();
return;
}
int numExistingGroupViews = mLinearLayout.getChildCount();
// remove excess views
if (groupCount < numExistingGroupViews) {
int numToRemove = numExistingGroupViews - groupCount;
mLinearLayout.removeViews(groupCount, numToRemove);
numExistingGroupViews = groupCount;
}
int bgColor = Color.TRANSPARENT;
// add each group
for (int i = 0; i < groupCount; i++) {
boolean isExpanded = mGroupIdToExpandedMap.get(i);
// reuse existing view when possible
final View groupView;
if (i < numExistingGroupViews) {
View convertView = mLinearLayout.getChildAt(i);
groupView = mAdapter.getGroupView(i, isExpanded, convertView, mLinearLayout);
groupView.setBackgroundColor(bgColor);
setViewBackgroundWithoutResettingPadding(groupView, i == 0 ? 0 : R.drawable.stats_list_item_background);
} else {
groupView = mAdapter.getGroupView(i, isExpanded, null, mLinearLayout);
groupView.setBackgroundColor(bgColor);
setViewBackgroundWithoutResettingPadding(groupView, i == 0 ? 0 : R.drawable.stats_list_item_background);
mLinearLayout.addView(groupView);
}
// groupView is recycled, we need to reset it to the original state.
ViewGroup childContainer = (ViewGroup) groupView.findViewById(R.id.layout_child_container);
if (childContainer != null) {
childContainer.setVisibility(View.GONE);
}
// Remove any other prev animations set on the chevron
final ImageView chevron = (ImageView) groupView.findViewById(R.id.stats_list_cell_chevron);
if (chevron != null) {
chevron.clearAnimation();
chevron.setImageResource(R.drawable.stats_chevron_right);
}
// add children if this group is expanded
if (isExpanded) {
StatsUIHelper.showChildViews(mAdapter, mLinearLayout, i, groupView, false);
}
// toggle expand/collapse when group view is tapped
final int groupPosition = i;
groupView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mAdapter.getChildrenCount(groupPosition) == 0) {
return;
}
boolean shouldExpand = !mGroupIdToExpandedMap.get(groupPosition);
mGroupIdToExpandedMap.put(groupPosition, shouldExpand);
if (shouldExpand) {
StatsUIHelper.showChildViews(mAdapter, mLinearLayout, groupPosition, groupView, true);
} else {
StatsUIHelper.hideChildViews(groupView, groupPosition, true);
}
}
});
}
}
/*
* interpolator for all expand/collapse animations
*/
private static Interpolator getInterpolator() {
return new AccelerateInterpolator();
}
private static void hideChildViews(View groupView, int groupPosition, boolean animate) {
final ViewGroup childContainer = (ViewGroup) groupView.findViewById(R.id.layout_child_container);
if (childContainer == null) {
return;
}
if (childContainer.getVisibility() != View.GONE) {
if (animate) {
Animation expand = new ScaleAnimation(1.0f, 1.0f, 1.0f, 0.0f);
expand.setDuration(ANIM_DURATION);
expand.setInterpolator(getInterpolator());
expand.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) { }
@Override
public void onAnimationEnd(Animation animation) {
childContainer.setVisibility(View.GONE);
}
@Override
public void onAnimationRepeat(Animation animation) { }
});
childContainer.startAnimation(expand);
} else {
childContainer.setVisibility(View.GONE);
}
}
StatsUIHelper.setGroupChevron(false, groupView, groupPosition, animate);
}
/*
* shows the correct up/down chevron for the passed group
*/
private static void setGroupChevron(final boolean isGroupExpanded, View groupView, int groupPosition, boolean animate) {
final ImageView chevron = (ImageView) groupView.findViewById(R.id.stats_list_cell_chevron);
if (chevron == null) {
return;
}
if (isGroupExpanded) {
// change the background of the parent
setViewBackgroundWithoutResettingPadding(groupView, R.drawable.stats_list_item_expanded_background);
} else {
setViewBackgroundWithoutResettingPadding(groupView, groupPosition == 0 ? 0 : R.drawable.stats_list_item_background);
}
chevron.clearAnimation(); // Remove any other prev animations set on the chevron
if (animate) {
// make sure we start with the correct chevron for the prior state before animating it
chevron.setImageResource(isGroupExpanded ? R.drawable.stats_chevron_right : R.drawable.stats_chevron_down);
float start = (isGroupExpanded ? 0.0f : 0.0f);
float end = (isGroupExpanded ? 90.0f : -90.0f);
Animation rotate = new RotateAnimation(start, end, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setDuration(ANIM_DURATION);
rotate.setInterpolator(getInterpolator());
rotate.setFillAfter(true);
chevron.startAnimation(rotate);
} else {
chevron.setImageResource(isGroupExpanded ? R.drawable.stats_chevron_down : R.drawable.stats_chevron_right);
}
}
private static void showChildViews(ExpandableListAdapter mAdapter, LinearLayout mLinearLayout,
int groupPosition, View groupView, boolean animate) {
int childCount = Math.min(mAdapter.getChildrenCount(groupPosition), STATS_CHILD_MAX_ITEMS);
if (childCount == 0) {
return;
}
final ViewGroup childContainer = (ViewGroup) groupView.findViewById(R.id.layout_child_container);
if (childContainer == null) {
return;
}
int numExistingViews = childContainer.getChildCount();
if (childCount < numExistingViews) {
int numToRemove = numExistingViews - childCount;
childContainer.removeViews(childCount, numToRemove);
numExistingViews = childCount;
}
for (int i = 0; i < childCount; i++) {
boolean isLastChild = (i == childCount - 1);
if (i < numExistingViews) {
View convertView = childContainer.getChildAt(i);
mAdapter.getChildView(groupPosition, i, isLastChild, convertView, mLinearLayout);
} else {
View childView = mAdapter.getChildView(groupPosition, i, isLastChild, null, mLinearLayout);
// remove the right/left padding so the child total aligns to left
childView.setPadding(0,
childView.getPaddingTop(),
0,
isLastChild ? 0 : childView.getPaddingBottom()); // No padding bottom on last child
setViewBackgroundWithoutResettingPadding(childView, R.drawable.stats_list_item_child_background);
childContainer.addView(childView);
}
}
if (childContainer.getVisibility() != View.VISIBLE) {
if (animate) {
Animation expand = new ScaleAnimation(1.0f, 1.0f, 0.0f, 1.0f);
expand.setDuration(ANIM_DURATION);
expand.setInterpolator(getInterpolator());
childContainer.startAnimation(expand);
}
childContainer.setVisibility(View.VISIBLE);
}
StatsUIHelper.setGroupChevron(true, groupView, groupPosition, animate);
}
/**
* Removes URL underlines in a string by replacing URLSpan occurrences by
* URLSpanNoUnderline objects.
*
* @param pText A Spannable object. For example, a TextView casted as
* Spannable.
*/
public static void removeUnderlines(Spannable pText) {
URLSpan[] spans = pText.getSpans(0, pText.length(), URLSpan.class);
for(URLSpan span:spans) {
int start = pText.getSpanStart(span);
int end = pText.getSpanEnd(span);
pText.removeSpan(span);
span = new URLSpanNoUnderline(span.getURL());
pText.setSpan(span, start, end, 0);
}
}
public static int getNumOfBarsToShow() {
if (StatsUtils.getSmallestWidthDP() >= TABLET_720DP && DisplayUtils.isLandscape(WordPress.getContext())) {
return 15;
} else if (StatsUtils.getSmallestWidthDP() >= TABLET_600DP) {
return 10;
} else {
return 7;
}
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
cd6cd0751f4a00a13536ef4043f2f065a4f5ad95 | 6634a471d219f36314f2678fca35e53320da240a | /java-basic/app/src/main/java/com/eomcs/lang/ex07/Test01113.java | d43aa41acbb024075078a0ec508649522a1f7bea | [] | no_license | gksqlc6401/bitcamp-study | 1cb11bea6dea0b70d894bb62ed847479d7000ab7 | 4cad79c3636205aef56ff210ec1bd1b7f7f23d50 | refs/heads/main | 2023-06-06T12:08:26.348612 | 2021-06-29T11:43:49 | 2021-06-29T11:43:49 | 374,932,593 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 631 | java | package com.eomcs.lang.ex07;
import java.util.Scanner;
//# 메서드 : 사용 전
//
public class Test01113 {
static void spaces(int len) {
for(int i=0; i<len;i++) {
System.out.println(" ");
}
}
static void star(int len) {
for(int i=0;i<len;i++) {
System.out.println("*");
}
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("밑변의 길이는?:");
int len=sc.nextInt();
for(int starLen=1; star<len; starLen++) {
spaces((len-starLen) /2);
star(starLen);
System.out.println();
}
sc.close();
}
}
| [
"gksqlc6401@naver.com"
] | gksqlc6401@naver.com |
ea0d4be41a50f9f3182d98d9040677abaa261fe3 | 7d58e9f54d464ff18487f1cf66bda1c9368391de | /src/main/java/com/zyj/contorller/InputContorller.java | d21e8b47f31eb24521395087d0647ede6e818f1c | [] | no_license | unkigh/spring-boot | a22d51718dac74be861c2dd73f87b7c03417835d | 103f0a9c3b6d6ebbbe02628f9e20d4eb81377ba8 | refs/heads/master | 2022-06-24T02:18:06.249335 | 2020-03-11T09:27:02 | 2020-03-11T09:27:02 | 246,528,479 | 0 | 0 | null | 2022-06-21T02:57:54 | 2020-03-11T09:29:05 | Java | UTF-8 | Java | false | false | 807 | java | package com.zyj.contorller;
import com.zyj.service.InputService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.concurrent.ExecutionException;
/**
* @author:77
* @date: 2020/3/11 0011
* @time: 16:53
*/
@Controller
@ResponseBody
public class InputContorller {
@Autowired
private InputService service;
@RequestMapping("/set")
public Object set() {
try {
service.insert();
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
return 1;
}
}
| [
"1002907591@qq.com"
] | 1002907591@qq.com |
46e13af71b8b836c7097557c7248adc68ba54dfa | 939bc9b579671de84fb6b5bd047db57b3d186aca | /jdk.localedata/sun/util/resources/cldr/ext/CurrencyNames_ka.java | 231818f0538b1c7255df5e0459873eb11e2c1983 | [] | no_license | lc274534565/jdk11-rm | 509702ceacfe54deca4f688b389d836eb5021a17 | 1658e7d9e173f34313d2e5766f4f7feef67736e8 | refs/heads/main | 2023-01-24T07:11:16.084577 | 2020-11-16T14:21:37 | 2020-11-16T14:21:37 | 313,315,578 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 38,671 | java | /*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* COPYRIGHT AND PERMISSION NOTICE
*
* Copyright (C) 1991-2016 Unicode, Inc. All rights reserved.
* Distributed under the Terms of Use in
* http://www.unicode.org/copyright.html.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of the Unicode data files and any associated documentation
* (the "Data Files") or Unicode software and any associated documentation
* (the "Software") to deal in the Data Files or Software
* without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, and/or sell copies of
* the Data Files or Software, and to permit persons to whom the Data Files
* or Software are furnished to do so, provided that
* (a) this copyright and permission notice appear with all copies
* of the Data Files or Software,
* (b) this copyright and permission notice appear in associated
* documentation, and
* (c) there is clear notice in each modified Data File or in the Software
* as well as in the documentation associated with the Data File(s) or
* Software that the data or software has been modified.
*
* THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
* ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT OF THIRD PARTY RIGHTS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
* NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
* DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THE DATA FILES OR SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale,
* use or other dealings in these Data Files or Software without prior
* written authorization of the copyright holder.
*/
package sun.util.resources.cldr.ext;
import sun.util.resources.OpenListResourceBundle;
public class CurrencyNames_ka extends OpenListResourceBundle {
@Override
protected final Object[][] getContents() {
final Object[][] data = new Object[][] {
{ "AED", "AED" },
{ "AFN", "AFN" },
{ "ALL", "ALL" },
{ "AMD", "AMD" },
{ "ANG", "ANG" },
{ "AOA", "AOA" },
{ "ARS", "ARS" },
{ "AUD", "AUD" },
{ "AWG", "AWG" },
{ "AZN", "AZN" },
{ "BAM", "BAM" },
{ "BBD", "BBD" },
{ "BDT", "BDT" },
{ "BGN", "BGN" },
{ "BHD", "BHD" },
{ "BIF", "BIF" },
{ "BMD", "BMD" },
{ "BND", "BND" },
{ "BOB", "BOB" },
{ "BSD", "BSD" },
{ "BTN", "BTN" },
{ "BWP", "BWP" },
{ "BYN", "BYN" },
{ "BYR", "BYR" },
{ "BZD", "BZD" },
{ "CDF", "CDF" },
{ "CHF", "CHF" },
{ "CLP", "CLP" },
{ "CNH", "CNH" },
{ "CNY", "CNY" },
{ "COP", "COP" },
{ "CRC", "CRC" },
{ "CUC", "CUC" },
{ "CUP", "CUP" },
{ "CVE", "CVE" },
{ "CZK", "CZK" },
{ "DJF", "DJF" },
{ "DKK", "DKK" },
{ "DOP", "DOP" },
{ "DZD", "DZD" },
{ "EGP", "EGP" },
{ "ERN", "ERN" },
{ "ETB", "ETB" },
{ "FJD", "FJD" },
{ "FKP", "FKP" },
{ "GEL", "\u20be" },
{ "GHS", "GHS" },
{ "GIP", "GIP" },
{ "GMD", "GMD" },
{ "GNF", "GNF" },
{ "GTQ", "GTQ" },
{ "GYD", "GYD" },
{ "HKD", "HKD" },
{ "HNL", "HNL" },
{ "HRK", "HRK" },
{ "HTG", "HTG" },
{ "HUF", "HUF" },
{ "IDR", "IDR" },
{ "ILS", "ILS" },
{ "INR", "INR" },
{ "IQD", "IQD" },
{ "IRR", "IRR" },
{ "ISK", "ISK" },
{ "JMD", "JMD" },
{ "JOD", "JOD" },
{ "JPY", "JPY" },
{ "KES", "KES" },
{ "KGS", "KGS" },
{ "KHR", "KHR" },
{ "KMF", "KMF" },
{ "KPW", "KPW" },
{ "KRW", "KRW" },
{ "KWD", "KWD" },
{ "KYD", "KYD" },
{ "KZT", "KZT" },
{ "LAK", "LAK" },
{ "LBP", "LBP" },
{ "LKR", "LKR" },
{ "LRD", "LRD" },
{ "LTL", "LTL" },
{ "LVL", "LVL" },
{ "LYD", "LYD" },
{ "MAD", "MAD" },
{ "MDL", "MDL" },
{ "MGA", "MGA" },
{ "MKD", "MKD" },
{ "MMK", "MMK" },
{ "MNT", "MNT" },
{ "MOP", "MOP" },
{ "MRO", "MRO" },
{ "MUR", "MUR" },
{ "MVR", "MVR" },
{ "MWK", "MWK" },
{ "MYR", "MYR" },
{ "MZN", "MZN" },
{ "NAD", "NAD" },
{ "NGN", "NGN" },
{ "NIO", "NIO" },
{ "NOK", "NOK" },
{ "NPR", "NPR" },
{ "NZD", "NZD" },
{ "OMR", "OMR" },
{ "PAB", "PAB" },
{ "PEN", "PEN" },
{ "PGK", "PGK" },
{ "PHP", "PHP" },
{ "PKR", "PKR" },
{ "PLN", "PLN" },
{ "PYG", "PYG" },
{ "QAR", "QAR" },
{ "RON", "RON" },
{ "RSD", "RSD" },
{ "RUB", "RUB" },
{ "RWF", "RWF" },
{ "SAR", "SAR" },
{ "SBD", "SBD" },
{ "SCR", "SCR" },
{ "SDG", "SDG" },
{ "SEK", "SEK" },
{ "SGD", "SGD" },
{ "SHP", "SHP" },
{ "SLL", "SLL" },
{ "SOS", "SOS" },
{ "SRD", "SRD" },
{ "SSP", "SSP" },
{ "STD", "STD" },
{ "SYP", "SYP" },
{ "SZL", "SZL" },
{ "THB", "THB" },
{ "TJS", "TJS" },
{ "TMT", "TMT" },
{ "TND", "TND" },
{ "TOP", "TOP" },
{ "TRY", "TRY" },
{ "TTD", "TTD" },
{ "TZS", "TZS" },
{ "UAH", "UAH" },
{ "UGX", "UGX" },
{ "UYU", "UYU" },
{ "UZS", "UZS" },
{ "VEF", "VEF" },
{ "VND", "VND" },
{ "VUV", "VUV" },
{ "WST", "WST" },
{ "YER", "YER" },
{ "ZAR", "ZAR" },
{ "ZMK", "ZMK" },
{ "ZMW", "ZMW" },
{ "adp", "\u10d0\u10dc\u10d3\u10dd\u10e0\u10e3\u10da\u10d8 \u10de\u10d4\u10e1\u10d4\u10e2\u10d0" },
{ "aed", "\u10d0\u10e0\u10d0\u10d1\u10d7\u10d0 \u10d2\u10d0\u10d4\u10e0\u10d7\u10d8\u10d0\u10dc\u10d4\u10d1\u10e3\u10da\u10d8 \u10e1\u10d0\u10d0\u10db\u10d8\u10e0\u10dd\u10d4\u10d1\u10d8\u10e1 \u10d3\u10d8\u10e0\u10f0\u10d0\u10db\u10d8" },
{ "afa", "\u10d0\u10d5\u10e6\u10d0\u10dc\u10d8 (1927\u20132002)" },
{ "afn", "\u10d0\u10d5\u10e6\u10d0\u10dc\u10e3\u10e0\u10d8 \u10d0\u10d5\u10e6\u10d0\u10dc\u10d8" },
{ "all", "\u10d0\u10da\u10d1\u10d0\u10dc\u10e3\u10e0\u10d8 \u10da\u10d4\u10d9\u10d8" },
{ "amd", "\u10e1\u10dd\u10db\u10ee\u10e3\u10e0\u10d8 \u10d3\u10e0\u10d0\u10db\u10d8" },
{ "ang", "\u10dc\u10d8\u10d3\u10d4\u10e0\u10da\u10d0\u10dc\u10d3\u10d4\u10d1\u10d8\u10e1 \u10d0\u10dc\u10e2\u10d8\u10da\u10d4\u10d1\u10d8\u10e1 \u10d2\u10e3\u10da\u10d3\u10d4\u10dc\u10d8" },
{ "aoa", "\u10d0\u10dc\u10d2\u10dd\u10da\u10e3\u10e0\u10d8 \u10d9\u10d5\u10d0\u10dc\u10d6\u10d0" },
{ "aok", "\u10d0\u10dc\u10d2\u10dd\u10da\u10e3\u10e0\u10d8 \u10d9\u10d5\u10d0\u10dc\u10d6\u10d0 (1977\u20131990)" },
{ "aon", "\u10d0\u10dc\u10d2\u10dd\u10da\u10e3\u10e0\u10d8 \u10d0\u10ee\u10d0\u10da\u10d8 \u10d9\u10d5\u10d0\u10dc\u10d6\u10d0 (1990\u20132000)" },
{ "aor", "\u10d0\u10dc\u10d2\u10dd\u10da\u10e3\u10e0\u10d8 \u10db\u10d8\u10e2\u10dd\u10da\u10d4\u10d1\u10e3\u10da\u10d8 \u10d9\u10d5\u10d0\u10dc\u10d6\u10d0 (1995\u20131999)" },
{ "ara", "\u10d0\u10e0\u10d2\u10d4\u10dc\u10e2\u10d8\u10dc\u10e3\u10da\u10d8 \u10d0\u10e3\u10e1\u10e2\u10e0\u10d0\u10da\u10d8" },
{ "arp", "\u10d0\u10e0\u10d2\u10d4\u10dc\u10e2\u10d8\u10dc\u10e3\u10da\u10d8 \u10de\u10d4\u10e1\u10dd (1983\u20131985)" },
{ "ars", "\u10d0\u10e0\u10d2\u10d4\u10dc\u10e2\u10d8\u10dc\u10e3\u10da\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "ats", "\u10d0\u10d5\u10e1\u10e2\u10e0\u10d8\u10e3\u10da\u10d8 \u10e8\u10d8\u10da\u10d8\u10dc\u10d2\u10d8" },
{ "aud", "\u10d0\u10d5\u10e1\u10e2\u10e0\u10d0\u10da\u10d8\u10e3\u10e0\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "awg", "\u10d0\u10e0\u10e3\u10d1\u10d0\u10dc\u10e3\u10da\u10d8 \u10d2\u10e3\u10da\u10d3\u10d4\u10dc\u10d8" },
{ "azm", "\u10d0\u10d6\u10d4\u10e0\u10d1\u10d0\u10d8\u10ef\u10d0\u10dc\u10e3\u10da\u10d8 \u10db\u10d0\u10dc\u10d0\u10d7\u10d8 (1993\u20132006)" },
{ "azn", "\u10d0\u10d6\u10d4\u10e0\u10d1\u10d0\u10d8\u10ef\u10d0\u10dc\u10e3\u10da\u10d8 \u10db\u10d0\u10dc\u10d0\u10d7\u10d8" },
{ "bad", "\u10d1\u10dd\u10e1\u10dc\u10d8\u10d0-\u10f0\u10d4\u10e0\u10ea\u10dd\u10d2\u10dd\u10d5\u10d8\u10dc\u10d0\u10e1 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "bam", "\u10d1\u10dd\u10e1\u10dc\u10d8\u10d0 \u10d3\u10d0 \u10f0\u10d4\u10e0\u10ea\u10dd\u10d2\u10dd\u10d5\u10d8\u10dc\u10d0\u10e1 \u10d9\u10dd\u10dc\u10d5\u10d4\u10e0\u10e2\u10d8\u10e0\u10d4\u10d1\u10d0\u10d3\u10d8 \u10db\u10d0\u10e0\u10d9\u10d0" },
{ "bbd", "\u10d1\u10d0\u10e0\u10d1\u10d0\u10d3\u10dd\u10e1\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "bdt", "\u10d1\u10d0\u10dc\u10d2\u10da\u10d0\u10d3\u10d4\u10e8\u10e3\u10e0\u10d8 \u10e2\u10d0\u10d9\u10d0" },
{ "bec", "\u10d1\u10d4\u10da\u10d2\u10d8\u10e3\u10e0\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8 (\u10d9\u10dd\u10d5\u10d4\u10e0\u10e2\u10d8\u10e0\u10d4\u10d1\u10d0\u10d3\u10d8)" },
{ "bef", "\u10d1\u10d4\u10da\u10d2\u10d8\u10e3\u10e0\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "bel", "\u10d1\u10d4\u10da\u10d2\u10d8\u10e3\u10e0\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8 (\u10e4\u10d8\u10dc\u10d0\u10dc\u10e1\u10e3\u10e0\u10d8)" },
{ "bgl", "\u10d1\u10e3\u10da\u10d2\u10d0\u10e0\u10e3\u10da\u10d8 \u10db\u10e7\u10d0\u10e0\u10d8 \u10da\u10d4\u10d5\u10d8" },
{ "bgn", "\u10d1\u10e3\u10da\u10d2\u10d0\u10e0\u10e3\u10da\u10d8 \u10da\u10d4\u10d5\u10d8" },
{ "bhd", "\u10d1\u10d0\u10f0\u10e0\u10d4\u10d8\u10dc\u10e3\u10da\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "bif", "\u10d1\u10e3\u10e0\u10e3\u10dc\u10d3\u10d8\u10e3\u10da\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "bmd", "\u10d1\u10d4\u10e0\u10db\u10e3\u10d3\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "bnd", "\u10d1\u10e0\u10e3\u10dc\u10d4\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "bob", "\u10d1\u10dd\u10da\u10d8\u10d5\u10d8\u10e3\u10e0\u10d8 \u10d1\u10dd\u10da\u10d8\u10d5\u10d8\u10d0\u10dc\u10dd" },
{ "bop", "\u10d1\u10dd\u10da\u10d8\u10d5\u10d8\u10e3\u10e0\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "brb", "\u10d1\u10e0\u10d0\u10d6\u10d8\u10da\u10d8\u10e3\u10e0\u10d8 \u10d9\u10e0\u10e3\u10d6\u10d4\u10d8\u10e0\u10dd \u10dc\u10dd\u10d5\u10dd (1967\u20131986)" },
{ "brc", "\u10d1\u10e0\u10d0\u10d6\u10d8\u10da\u10d8\u10e3\u10e0\u10d8 \u10d9\u10e0\u10e3\u10d6\u10d0\u10d3\u10dd" },
{ "bre", "\u10d1\u10e0\u10d0\u10d6\u10d8\u10da\u10d8\u10e3\u10e0\u10d8 \u10d9\u10e0\u10e3\u10d6\u10d4\u10d8\u10e0\u10dd (1990\u20131993)" },
{ "brl", "\u10d1\u10e0\u10d0\u10d6\u10d8\u10da\u10d8\u10e3\u10e0\u10d8 \u10e0\u10d4\u10d0\u10da\u10d8" },
{ "brn", "\u10d1\u10e0\u10d0\u10d6\u10d8\u10da\u10d8\u10e3\u10e0\u10d8 \u10d9\u10e0\u10e3\u10d6\u10d0\u10d3\u10dd \u10dc\u10dd\u10d5\u10dd" },
{ "brr", "\u10d1\u10e0\u10d0\u10d6\u10d8\u10da\u10d8\u10e3\u10e0\u10d8 \u10d9\u10e0\u10e3\u10d6\u10d4\u10d8\u10e0\u10dd" },
{ "bsd", "\u10d1\u10d0\u10f0\u10d0\u10db\u10e3\u10e0\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "btn", "\u10d1\u10e3\u10e2\u10d0\u10dc\u10e3\u10e0\u10d8 \u10dc\u10d2\u10e3\u10da\u10e2\u10e0\u10e3\u10db\u10d8" },
{ "bwp", "\u10d1\u10dd\u10ea\u10d5\u10d0\u10dc\u10e3\u10e0\u10d8 \u10de\u10e3\u10da\u10d0" },
{ "byb", "\u10d0\u10ee\u10d0\u10da\u10d8 \u10d1\u10d4\u10da\u10d0\u10e0\u10e3\u10e1\u10d8\u10e3\u10da\u10d8 \u10e0\u10e3\u10d1\u10da\u10d8 (1994\u20131999)" },
{ "byn", "\u10d1\u10d4\u10da\u10dd\u10e0\u10e3\u10e1\u10e3\u10da\u10d8 \u10e0\u10e3\u10d1\u10da\u10d8" },
{ "byr", "\u10d1\u10d4\u10da\u10dd\u10e0\u10e3\u10e1\u10e3\u10da\u10d8 \u10e0\u10e3\u10d1\u10da\u10d8 (2000\u20132016)" },
{ "bzd", "\u10d1\u10d4\u10da\u10d8\u10d6\u10d8\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "cad", "\u10d9\u10d0\u10dc\u10d0\u10d3\u10e3\u10e0\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "cdf", "\u10d9\u10dd\u10dc\u10d2\u10dd\u10e1 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "chf", "\u10e8\u10d5\u10d4\u10d8\u10ea\u10d0\u10e0\u10d8\u10e3\u10da\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "clp", "\u10e9\u10d8\u10da\u10d4\u10e1 \u10de\u10d4\u10e1\u10dd" },
{ "cnh", "\u10e9\u10d8\u10dc\u10e3\u10e0\u10d8 \u10d8\u10e3\u10d0\u10dc\u10d8 (\u10dd\u10e4\u10e8\u10dd\u10e0\u10d8)" },
{ "cny", "\u10e9\u10d8\u10dc\u10e3\u10e0\u10d8 \u10d8\u10e3\u10d0\u10dc\u10d8" },
{ "cop", "\u10d9\u10dd\u10da\u10e3\u10db\u10d1\u10d8\u10e3\u10e0\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "crc", "\u10d9\u10dd\u10e1\u10e2\u10d0-\u10e0\u10d8\u10d9\u10e3\u10da\u10d8 \u10d9\u10dd\u10da\u10dd\u10dc\u10d8" },
{ "csd", "\u10eb\u10d5\u10d4\u10da\u10d8 \u10e1\u10d4\u10e0\u10d1\u10d8\u10e3\u10da\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "csk", "\u10e9\u10d4\u10ee\u10dd\u10e1\u10da\u10dd\u10d5\u10d0\u10d9\u10d8\u10d8\u10e1 \u10db\u10e7\u10d0\u10e0\u10d8 \u10d9\u10e0\u10dd\u10dc\u10d0" },
{ "cuc", "\u10d9\u10e3\u10d1\u10e3\u10e0\u10d8 \u10d9\u10dd\u10dc\u10d5\u10d4\u10e0\u10e2\u10d8\u10e0\u10d4\u10d1\u10d0\u10d3\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "cup", "\u10d9\u10e3\u10d1\u10e3\u10e0\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "cve", "\u10d9\u10d0\u10d1\u10dd-\u10d5\u10d4\u10e0\u10d3\u10d4\u10e1 \u10d4\u10e1\u10d9\u10e3\u10d3\u10dd" },
{ "cyp", "\u10d9\u10d5\u10d8\u10de\u10e0\u10dd\u10e1\u10d8\u10e1 \u10d2\u10d8\u10e0\u10d5\u10d0\u10dc\u10e5\u10d0" },
{ "czk", "\u10e9\u10d4\u10ee\u10e3\u10e0\u10d8 \u10d9\u10e0\u10dd\u10dc\u10d0" },
{ "ddm", "\u10d0\u10e6\u10db\u10dd\u10e1\u10d0\u10d5\u10da\u10d4\u10d7 \u10d2\u10d4\u10e0\u10db\u10d0\u10dc\u10e3\u10da\u10d8 \u10db\u10d0\u10e0\u10d9\u10d0" },
{ "dem", "\u10d2\u10d4\u10e0\u10db\u10d0\u10dc\u10e3\u10da\u10d8 \u10db\u10d0\u10e0\u10d9\u10d0" },
{ "djf", "\u10ef\u10d8\u10d1\u10e3\u10e2\u10d8\u10e1 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "dkk", "\u10d3\u10d0\u10dc\u10d8\u10e3\u10e0\u10d8 \u10d9\u10e0\u10dd\u10dc\u10d0" },
{ "dop", "\u10d3\u10dd\u10db\u10d8\u10dc\u10d8\u10d9\u10e3\u10e0\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "dzd", "\u10d0\u10da\u10df\u10d8\u10e0\u10e3\u10da\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "eek", "\u10d4\u10e1\u10e2\u10dd\u10dc\u10e3\u10e0\u10d8 \u10d9\u10e0\u10e3\u10dc\u10d0" },
{ "egp", "\u10d4\u10d2\u10d5\u10d8\u10de\u10e2\u10e3\u10e0\u10d8 \u10d2\u10d8\u10e0\u10d5\u10d0\u10dc\u10e5\u10d0" },
{ "ern", "\u10d4\u10e0\u10d8\u10e2\u10e0\u10d4\u10d8\u10e1 \u10dc\u10d0\u10d9\u10e4\u10d0" },
{ "esp", "\u10d4\u10e1\u10de\u10d0\u10dc\u10e3\u10e0\u10d8 \u10de\u10d4\u10e1\u10d4\u10e2\u10d0" },
{ "etb", "\u10d4\u10d7\u10d8\u10dd\u10de\u10d8\u10e3\u10e0\u10d8 \u10d1\u10d8\u10e0\u10d8" },
{ "eur", "\u10d4\u10d5\u10e0\u10dd" },
{ "fim", "\u10e4\u10d8\u10dc\u10e3\u10e0\u10d8 \u10db\u10d0\u10e0\u10d9\u10d0" },
{ "fjd", "\u10e4\u10d8\u10ef\u10d8\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "fkp", "\u10e4\u10dd\u10da\u10d9\u10da\u10d4\u10dc\u10d3\u10d8\u10e1 \u10d9\u10e3\u10dc\u10eb\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10e4\u10e3\u10dc\u10e2\u10d8" },
{ "frf", "\u10e4\u10e0\u10d0\u10dc\u10d2\u10e3\u10da\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "gbp", "\u10d1\u10e0\u10d8\u10e2\u10d0\u10dc\u10e3\u10da\u10d8 \u10d2\u10d8\u10e0\u10d5\u10d0\u10dc\u10e5\u10d0 \u10e1\u10e2\u10d4\u10e0\u10da\u10d8\u10dc\u10d2\u10d8" },
{ "gek", "\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8 \u10d9\u10e3\u10de\u10dd\u10dc\u10d8 \u10da\u10d0\u10e0\u10d8\u10d7" },
{ "gel", "\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8 \u10da\u10d0\u10e0\u10d8" },
{ "ghs", "\u10d2\u10d0\u10dc\u10e3\u10e0\u10d8 \u10e1\u10d4\u10d3\u10d8" },
{ "gip", "\u10d2\u10d8\u10d1\u10e0\u10d0\u10da\u10e2\u10d0\u10e0\u10e3\u10da\u10d8 \u10e4\u10e3\u10dc\u10e2\u10d8" },
{ "gmd", "\u10d2\u10d0\u10db\u10d1\u10d8\u10e3\u10e0\u10d8 \u10d3\u10d0\u10da\u10d0\u10e1\u10d8" },
{ "gnf", "\u10d2\u10d5\u10d8\u10dc\u10d4\u10e3\u10e0\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "grd", "\u10d1\u10d4\u10e0\u10eb\u10dc\u10e3\u10da\u10d8 \u10d3\u10e0\u10d0\u10f0\u10db\u10d0" },
{ "gtq", "\u10d2\u10d5\u10d0\u10e2\u10d4\u10db\u10d0\u10da\u10e3\u10e0\u10d8 \u10d9\u10d4\u10e2\u10e1\u10d0\u10da\u10d8" },
{ "gwe", "\u10de\u10dd\u10e0\u10e2\u10e3\u10d2\u10d0\u10da\u10d8\u10e3\u10e0\u10d8 \u10d2\u10d8\u10dc\u10d4\u10d0 \u10d4\u10e1\u10d9\u10e3\u10d3\u10dd" },
{ "gyd", "\u10d2\u10d0\u10d8\u10d0\u10dc\u10e3\u10e0\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "hkd", "\u10f0\u10dd\u10dc\u10d9\u10dd\u10dc\u10d2\u10d8\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "hnl", "\u10f0\u10dd\u10dc\u10d3\u10e3\u10e0\u10d0\u10e1\u10e3\u10da\u10d8 \u10da\u10d4\u10db\u10de\u10d8\u10e0\u10d0" },
{ "hrd", "\u10ee\u10dd\u10e0\u10d5\u10d0\u10e2\u10d8\u10e3\u10da\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "hrk", "\u10ee\u10dd\u10e0\u10d5\u10d0\u10e2\u10e3\u10da\u10d8 \u10d9\u10e3\u10dc\u10d0" },
{ "htg", "\u10f0\u10d0\u10d8\u10e2\u10e3\u10e0\u10d8 \u10d2\u10e3\u10e0\u10d3\u10d8" },
{ "huf", "\u10e3\u10dc\u10d2\u10e0\u10e3\u10da\u10d8 \u10e4\u10dd\u10e0\u10d8\u10dc\u10e2\u10d8" },
{ "idr", "\u10d8\u10dc\u10d3\u10dd\u10dc\u10d4\u10d6\u10d8\u10e3\u10e0\u10d8 \u10e0\u10e3\u10de\u10d8\u10d0" },
{ "iep", "\u10d8\u10e0\u10da\u10d0\u10dc\u10d3\u10d8\u10e3\u10e0\u10d8 \u10d2\u10d8\u10e0\u10d5\u10d0\u10dc\u10e5\u10d0" },
{ "ils", "\u10d8\u10e1\u10e0\u10d0\u10d4\u10da\u10d8\u10e1 \u10d0\u10ee\u10d0\u10da\u10d8 \u10e8\u10d4\u10d9\u10d4\u10da\u10d8" },
{ "inr", "\u10d8\u10dc\u10d3\u10e3\u10e0\u10d8 \u10e0\u10e3\u10de\u10d8\u10d0" },
{ "iqd", "\u10d4\u10e0\u10d0\u10e7\u10e3\u10da\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "irr", "\u10d8\u10e0\u10d0\u10dc\u10e3\u10da\u10d8 \u10e0\u10d8\u10d0\u10da\u10d8" },
{ "isk", "\u10d8\u10e1\u10da\u10d0\u10dc\u10d3\u10d8\u10e3\u10e0\u10d8 \u10d9\u10e0\u10dd\u10dc\u10d0" },
{ "itl", "\u10d8\u10e2\u10d0\u10da\u10d8\u10e3\u10e0\u10d8 \u10da\u10d8\u10e0\u10d0" },
{ "jmd", "\u10d8\u10d0\u10db\u10d0\u10d8\u10d9\u10e3\u10e0\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "jod", "\u10d8\u10dd\u10e0\u10d3\u10d0\u10dc\u10d8\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "jpy", "\u10d8\u10d0\u10de\u10dd\u10dc\u10e3\u10e0\u10d8 \u10d8\u10d4\u10dc\u10d8" },
{ "kes", "\u10d9\u10d4\u10dc\u10d8\u10e3\u10e0\u10d8 \u10e8\u10d8\u10da\u10d8\u10dc\u10d2\u10d8" },
{ "kgs", "\u10e7\u10d8\u10e0\u10d2\u10d8\u10d6\u10e3\u10da\u10d8 \u10e1\u10dd\u10db\u10d8" },
{ "khr", "\u10d9\u10d0\u10db\u10d1\u10dd\u10ef\u10e3\u10e0\u10d8 \u10e0\u10d8\u10d4\u10da\u10d8" },
{ "kmf", "\u10d9\u10dd\u10db\u10dd\u10e0\u10e3\u10da\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "kpw", "\u10e9\u10e0\u10d3\u10d8\u10da\u10dd\u10d4\u10d7 \u10d9\u10dd\u10e0\u10d4\u10e3\u10da\u10d8 \u10d5\u10dd\u10dc\u10d8" },
{ "krw", "\u10e1\u10d0\u10db\u10ee\u10e0\u10d4\u10d7 \u10d9\u10dd\u10e0\u10d4\u10e3\u10da\u10d8 \u10d5\u10dd\u10dc\u10d8" },
{ "kwd", "\u10e5\u10e3\u10d5\u10d4\u10d8\u10d7\u10e3\u10e0\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "kyd", "\u10d9\u10d0\u10d8\u10db\u10d0\u10dc\u10d8\u10e1 \u10d9\u10e3\u10dc\u10eb\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "kzt", "\u10e7\u10d0\u10d6\u10d0\u10ee\u10e3\u10e0\u10d8 \u10e2\u10d4\u10dc\u10d2\u10d4" },
{ "lak", "\u10da\u10d0\u10dd\u10e1\u10e3\u10e0\u10d8 \u10d9\u10d8\u10de\u10d8" },
{ "lbp", "\u10da\u10d8\u10d1\u10d0\u10dc\u10e3\u10e0\u10d8 \u10e4\u10e3\u10dc\u10e2\u10d8" },
{ "lkr", "\u10e8\u10e0\u10d8-\u10da\u10d0\u10dc\u10d9\u10e3\u10e0\u10d8 \u10e0\u10e3\u10de\u10d8\u10d0" },
{ "lrd", "\u10da\u10d8\u10d1\u10d4\u10e0\u10d8\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "ltl", "\u10da\u10d8\u10e2\u10d5\u10e3\u10e0\u10d8 \u10da\u10d8\u10e2\u10d0" },
{ "ltt", "\u10da\u10d8\u10e2\u10d5\u10e3\u10e0\u10d8 \u10e2\u10d0\u10da\u10dd\u10dc\u10d8" },
{ "luc", "\u10da\u10e3\u10e5\u10e1\u10d4\u10db\u10d1\u10e3\u10e0\u10d2\u10d8\u10e1 \u10d9\u10dd\u10dc\u10d5\u10d4\u10e0\u10e2\u10d8\u10e0\u10d4\u10d1\u10d0\u10d3\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "luf", "\u10da\u10e3\u10e5\u10e1\u10d4\u10db\u10d1\u10e3\u10e0\u10d2\u10d8\u10e1 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "lul", "\u10da\u10e3\u10e5\u10e1\u10d4\u10db\u10d1\u10e3\u10e0\u10d2\u10d8\u10e1 \u10e4\u10d8\u10dc\u10d0\u10dc\u10e1\u10e3\u10e0\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "lvl", "\u10da\u10d0\u10e2\u10d5\u10d8\u10e3\u10e0\u10d8 \u10da\u10d0\u10e2\u10d8" },
{ "lvr", "\u10da\u10d0\u10e2\u10d5\u10d8\u10e3\u10e0\u10d8 \u10e0\u10e3\u10d1\u10da\u10d8" },
{ "lyd", "\u10da\u10d8\u10d1\u10d8\u10e3\u10e0\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "mad", "\u10db\u10d0\u10e0\u10dd\u10d9\u10dd\u10e1 \u10d3\u10d8\u10e0\u10f0\u10d0\u10db\u10d8" },
{ "maf", "\u10db\u10d0\u10e0\u10dd\u10d9\u10dd\u10e1 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "mdl", "\u10db\u10dd\u10da\u10d3\u10dd\u10d5\u10e3\u10e0\u10d8 \u10da\u10d4\u10e3" },
{ "mga", "\u10db\u10d0\u10d3\u10d0\u10d2\u10d0\u10e1\u10d9\u10d0\u10e0\u10d8\u10e1 \u10d0\u10e0\u10d8\u10d0\u10e0\u10d8" },
{ "mgf", "\u10db\u10d0\u10d3\u10d0\u10d2\u10d0\u10e1\u10d9\u10d0\u10e0\u10d8\u10e1 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "mkd", "\u10db\u10d0\u10d9\u10d4\u10d3\u10dd\u10dc\u10d8\u10e3\u10e0\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "mlf", "\u10db\u10d0\u10da\u10d8\u10e1 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "mmk", "\u10db\u10d8\u10d0\u10dc\u10db\u10d0\u10e0\u10d8\u10e1 \u10d9\u10d8\u10d0\u10e2\u10d8" },
{ "mnt", "\u10db\u10dd\u10dc\u10e6\u10dd\u10da\u10e3\u10e0\u10d8 \u10e2\u10e3\u10d2\u10e0\u10d8\u10d9\u10d8" },
{ "mop", "\u10db\u10d0\u10d9\u10d0\u10e3\u10e1 \u10de\u10d0\u10e2\u10d0\u10d9\u10d0" },
{ "mro", "\u10db\u10d0\u10d5\u10e0\u10d8\u10e2\u10d0\u10dc\u10e3\u10da\u10d8 \u10e3\u10d2\u10d8\u10d0 (1973\u20132017)" },
{ "mru", "\u10db\u10d0\u10d5\u10e0\u10d8\u10e2\u10d0\u10dc\u10e3\u10da\u10d8 \u10e3\u10d2\u10d8\u10d0" },
{ "mtl", "\u10db\u10d0\u10da\u10e2\u10d8\u10e1 \u10da\u10d8\u10e0\u10d0" },
{ "mtp", "\u10db\u10d0\u10da\u10e2\u10d8\u10e1 \u10d2\u10d8\u10e0\u10d5\u10d0\u10dc\u10e5\u10d0" },
{ "mur", "\u10db\u10d0\u10d5\u10e0\u10d8\u10e2\u10d0\u10dc\u10e3\u10da\u10d8 \u10e0\u10e3\u10de\u10d8\u10d0" },
{ "mvr", "\u10db\u10d0\u10da\u10d3\u10d8\u10d5\u10e3\u10e0\u10d8 \u10e0\u10e3\u10e4\u10d8\u10d0" },
{ "mwk", "\u10db\u10d0\u10da\u10d0\u10d5\u10d8\u10e3\u10e0\u10d8 \u10d9\u10d5\u10d0\u10e9\u10d0" },
{ "mxn", "\u10db\u10d4\u10e5\u10e1\u10d8\u10d9\u10e3\u10e0\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "mxp", "\u10db\u10d4\u10e5\u10e1\u10d8\u10d9\u10e3\u10e0\u10d8 \u10d5\u10d4\u10e0\u10ea\u10ee\u10da\u10d8\u10e1 \u10de\u10d4\u10e1\u10dd (1861\u20131992)" },
{ "myr", "\u10db\u10d0\u10da\u10d0\u10d8\u10d6\u10d8\u10e3\u10e0\u10d8 \u10e0\u10d8\u10dc\u10d2\u10d8\u10e2\u10d8" },
{ "mze", "\u10db\u10dd\u10d6\u10d0\u10db\u10d1\u10d8\u10d9\u10e3\u10e0\u10d8 \u10d4\u10e1\u10d9\u10e3\u10d3\u10dd" },
{ "mzm", "\u10eb\u10d5\u10d4\u10da\u10d8 \u10db\u10dd\u10d6\u10d0\u10db\u10d1\u10d8\u10d9\u10e3\u10e0\u10d8 \u10db\u10d4\u10e2\u10d8\u10d9\u10d0\u10da\u10d8" },
{ "mzn", "\u10db\u10dd\u10d6\u10d0\u10db\u10d1\u10d8\u10d9\u10e3\u10e0\u10d8 \u10db\u10d4\u10e2\u10d8\u10d9\u10d0\u10da\u10d8" },
{ "nad", "\u10dc\u10d0\u10db\u10d8\u10d1\u10d8\u10e3\u10e0\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "ngn", "\u10dc\u10d8\u10d2\u10d4\u10e0\u10d8\u10e3\u10da\u10d8 \u10dc\u10d0\u10d8\u10e0\u10d0" },
{ "nic", "\u10dc\u10d8\u10d9\u10d0\u10e0\u10d0\u10d2\u10e3\u10d0\u10e1 \u10d9\u10dd\u10e0\u10d3\u10dd\u10d1\u10d0" },
{ "nio", "\u10dc\u10d8\u10d9\u10d0\u10e0\u10d0\u10d2\u10e3\u10e3\u10da\u10d8 \u10d9\u10dd\u10e0\u10d3\u10dd\u10d1\u10d0" },
{ "nlg", "\u10f0\u10dd\u10da\u10d0\u10dc\u10d3\u10d8\u10e3\u10e0\u10d8 \u10d2\u10e3\u10da\u10d3\u10d4\u10dc\u10d8" },
{ "nok", "\u10dc\u10dd\u10e0\u10d5\u10d4\u10d2\u10d8\u10e3\u10da\u10d8 \u10d9\u10e0\u10dd\u10dc\u10d0" },
{ "npr", "\u10dc\u10d4\u10de\u10d0\u10da\u10e3\u10e0\u10d8 \u10e0\u10e3\u10de\u10d8\u10d0" },
{ "nzd", "\u10d0\u10ee\u10d0\u10da\u10d8 \u10d6\u10d4\u10da\u10d0\u10dc\u10d3\u10d8\u10d8\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "omr", "\u10dd\u10db\u10d0\u10dc\u10d8\u10e1 \u10e0\u10d8\u10d0\u10da\u10d8" },
{ "pab", "\u10de\u10d0\u10dc\u10d0\u10db\u10e3\u10e0\u10d8 \u10d1\u10d0\u10da\u10d1\u10dd\u10d0" },
{ "pei", "\u10de\u10d4\u10e0\u10e3\u10e1 \u10d8\u10dc\u10e2\u10d8" },
{ "pen", "\u10de\u10d4\u10e0\u10e3\u10e1 \u10e1\u10dd\u10da\u10d8" },
{ "pes", "\u10de\u10d4\u10e0\u10e3\u10e1 \u10e1\u10dd\u10da\u10d8 (1863\u20131965)" },
{ "pgk", "\u10de\u10d0\u10de\u10e3\u10d0-\u10d0\u10ee\u10d0\u10da\u10d8 \u10d2\u10d5\u10d8\u10dc\u10d4\u10d8\u10e1 \u10d9\u10d8\u10dc\u10d0" },
{ "php", "\u10e4\u10d8\u10da\u10d8\u10de\u10d8\u10dc\u10e3\u10e0\u10d8 \u10de\u10d4\u10e1\u10dd" },
{ "pkr", "\u10de\u10d0\u10d9\u10d8\u10e1\u10e2\u10d0\u10dc\u10e3\u10e0\u10d8 \u10e0\u10e3\u10de\u10d8\u10d0" },
{ "pln", "\u10de\u10dd\u10da\u10dd\u10dc\u10e3\u10e0\u10d8 \u10d6\u10da\u10dd\u10e2\u10d8" },
{ "plz", "\u10de\u10dd\u10da\u10dd\u10dc\u10e3\u10e0\u10d8 \u10d6\u10da\u10dd\u10e2\u10d8 (1950\u20131995)" },
{ "pte", "\u10de\u10dd\u10e0\u10e2\u10e3\u10d2\u10d0\u10da\u10d8\u10e3\u10e0\u10d8 \u10d4\u10e1\u10d9\u10e3\u10d3\u10dd" },
{ "pyg", "\u10de\u10d0\u10e0\u10d0\u10d2\u10d5\u10d0\u10e3\u10da\u10d8 \u10d2\u10e3\u10d0\u10e0\u10d0\u10dc\u10d8" },
{ "qar", "\u10d9\u10d0\u10e2\u10d0\u10e0\u10d8\u10e1 \u10e0\u10d8\u10d0\u10da\u10d8" },
{ "rhd", "\u10e0\u10dd\u10d3\u10d4\u10d6\u10d8\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "rol", "\u10eb\u10d5\u10d4\u10da\u10d8 \u10e0\u10e3\u10db\u10d8\u10dc\u10e3\u10da\u10d8 \u10da\u10d4\u10e3" },
{ "ron", "\u10e0\u10e3\u10db\u10d8\u10dc\u10e3\u10da\u10d8 \u10da\u10d4\u10e3" },
{ "rsd", "\u10e1\u10d4\u10e0\u10d1\u10e3\u10da\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "rub", "\u10e0\u10e3\u10e1\u10e3\u10da\u10d8 \u10e0\u10e3\u10d1\u10da\u10d8" },
{ "rur", "\u10e0\u10e3\u10e1\u10e3\u10da\u10d8 \u10e0\u10e3\u10d1\u10da\u10d8 (1991\u20131998)" },
{ "rwf", "\u10e0\u10e3\u10d0\u10dc\u10d3\u10e3\u10da\u10d8 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "sar", "\u10e1\u10d0\u10e3\u10d3\u10d8\u10e1 \u10d0\u10e0\u10d0\u10d1\u10d4\u10d7\u10d8\u10e1 \u10e0\u10d8\u10d0\u10da\u10d8" },
{ "sbd", "\u10e1\u10dd\u10da\u10dd\u10db\u10dd\u10dc\u10d8\u10e1 \u10d9\u10e3\u10dc\u10eb\u10e3\u10da\u10d4\u10d1\u10d8\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "scr", "\u10e1\u10d4\u10d8\u10e8\u10d4\u10da\u10e3\u10e0\u10d8 \u10e0\u10e3\u10de\u10d8\u10d0" },
{ "sdd", "\u10e1\u10e3\u10d3\u10d0\u10dc\u10d8\u10e1 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "sdg", "\u10e1\u10e3\u10d3\u10d0\u10dc\u10e3\u10e0\u10d8 \u10e4\u10e3\u10dc\u10e2\u10d8" },
{ "sdp", "\u10e1\u10e3\u10d3\u10d0\u10dc\u10d8\u10e1 \u10d2\u10d8\u10e0\u10d5\u10d0\u10dc\u10e5\u10d0" },
{ "sek", "\u10e8\u10d5\u10d4\u10d3\u10e3\u10e0\u10d8 \u10d9\u10e0\u10dd\u10dc\u10d0" },
{ "sgd", "\u10e1\u10d8\u10dc\u10d2\u10d0\u10de\u10e3\u10e0\u10d8\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "shp", "\u10ec\u10db. \u10d4\u10da\u10d4\u10dc\u10d4\u10e1 \u10d9\u10e3\u10dc\u10eb\u10e3\u10da\u10d8\u10e1 \u10e4\u10e3\u10dc\u10e2\u10d8" },
{ "sll", "\u10e1\u10d8\u10d4\u10e0\u10d0-\u10da\u10d4\u10dd\u10dc\u10d4\u10e1 \u10da\u10d4\u10dd\u10dc\u10d4" },
{ "sos", "\u10e1\u10dd\u10db\u10d0\u10da\u10e3\u10e0\u10d8 \u10e8\u10d8\u10da\u10d8\u10dc\u10d2\u10d8" },
{ "srd", "\u10e1\u10e3\u10e0\u10d8\u10dc\u10d0\u10db\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "srg", "\u10e1\u10e3\u10e0\u10d8\u10dc\u10d0\u10db\u10d8\u10e1 \u10d2\u10e3\u10da\u10d3\u10d4\u10dc\u10d8" },
{ "ssp", "\u10e1\u10d0\u10db\u10ee\u10e0\u10d4\u10d7 \u10e1\u10e3\u10d3\u10d0\u10dc\u10e3\u10e0\u10d8 \u10e4\u10e3\u10dc\u10e2\u10d8" },
{ "std", "\u10e1\u10d0\u10dc-\u10e2\u10dd\u10db\u10d4 \u10d3\u10d0 \u10de\u10e0\u10d8\u10dc\u10e1\u10d8\u10de\u10d8\u10e1 \u10d3\u10dd\u10d1\u10e0\u10d0 (1977\u20132017)" },
{ "stn", "\u10e1\u10d0\u10dc-\u10e2\u10dd\u10db\u10d4 \u10d3\u10d0 \u10de\u10e0\u10d8\u10dc\u10e1\u10d8\u10de\u10d8\u10e1 \u10d3\u10dd\u10d1\u10e0\u10d0" },
{ "sur", "\u10e1\u10d0\u10d1\u10ed\u10dd\u10d7\u10d0 \u10e0\u10e3\u10d1\u10da\u10d8" },
{ "syp", "\u10e1\u10d8\u10e0\u10d8\u10e3\u10da\u10d8 \u10e4\u10e3\u10dc\u10e2\u10d8" },
{ "szl", "\u10e1\u10d5\u10d0\u10d6\u10d8\u10da\u10d4\u10dc\u10d3\u10d8\u10e1 \u10da\u10d8\u10da\u10d0\u10dc\u10d2\u10d4\u10dc\u10d8" },
{ "thb", "\u10e2\u10d0\u10d8\u10da\u10d0\u10dc\u10d3\u10e3\u10e0\u10d8 \u10d1\u10d0\u10e2\u10d8" },
{ "tjr", "\u10e2\u10d0\u10ef\u10d8\u10d9\u10e3\u10e0\u10d8 \u10e0\u10e3\u10d1\u10da\u10d8" },
{ "tjs", "\u10e2\u10d0\u10ef\u10d8\u10d9\u10e3\u10e0\u10d8 \u10e1\u10dd\u10db\u10dd\u10dc\u10d8" },
{ "tmm", "\u10d7\u10e3\u10e0\u10e5\u10db\u10d4\u10dc\u10e3\u10da\u10d8 \u10db\u10d0\u10dc\u10d0\u10d7\u10d8" },
{ "tmt", "\u10d7\u10e3\u10e0\u10e5\u10db\u10d4\u10dc\u10d4\u10d7\u10d8\u10e1 \u10db\u10d0\u10dc\u10d0\u10d7\u10d8" },
{ "tnd", "\u10e2\u10e3\u10dc\u10d8\u10e1\u10e3\u10e0\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "top", "\u10e2\u10dd\u10dc\u10d2\u10d0\u10dc\u10e3\u10e0\u10d8 \u10de\u10d0\u10d0\u10dc\u10d2\u10d0" },
{ "trl", "\u10d7\u10e3\u10e0\u10e5\u10e3\u10da\u10d8 \u10da\u10d8\u10e0\u10d0" },
{ "try", "\u10d0\u10ee\u10d0\u10da\u10d8 \u10d7\u10e3\u10e0\u10e5\u10e3\u10da\u10d8 \u10da\u10d8\u10e0\u10d0" },
{ "ttd", "\u10e2\u10e0\u10d8\u10dc\u10d8\u10d3\u10d0\u10d3 \u10d3\u10d0 \u10e2\u10dd\u10d1\u10d0\u10d2\u10dd\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "twd", "\u10e2\u10d0\u10d8\u10d5\u10d0\u10dc\u10e3\u10e0\u10d8 \u10d0\u10ee\u10d0\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "tzs", "\u10e2\u10d0\u10dc\u10d6\u10d0\u10dc\u10d8\u10e3\u10e0\u10d8 \u10e8\u10d8\u10da\u10d8\u10dc\u10d2\u10d8" },
{ "uah", "\u10e3\u10d9\u10e0\u10d0\u10d8\u10dc\u10e3\u10da\u10d8 \u10d2\u10e0\u10d8\u10d5\u10dc\u10d0" },
{ "uak", "\u10e3\u10d9\u10e0\u10d0\u10d8\u10dc\u10e3\u10da\u10d8 \u10d9\u10d0\u10e0\u10d1\u10dd\u10d5\u10d0\u10dc\u10d4\u10ea\u10d8" },
{ "ugs", "\u10e3\u10d2\u10d0\u10dc\u10d3\u10e3\u10e0\u10d8 \u10e8\u10d8\u10da\u10d8\u10dc\u10d2\u10d8 (1966\u20131987)" },
{ "ugx", "\u10e3\u10d2\u10d0\u10dc\u10d3\u10e3\u10e0\u10d8 \u10e8\u10d8\u10da\u10d8\u10dc\u10d2\u10d8" },
{ "usd", "\u10d0\u10e8\u10e8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "usn", "\u10d0\u10e8\u10e8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8 (\u10e8\u10d4\u10db\u10d3\u10d4\u10d2\u10d8 \u10d3\u10e6\u10d4)" },
{ "uss", "\u10d0\u10e8\u10e8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8 (\u10d8\u10d2\u10d8\u10d5\u10d4 \u10d3\u10e6\u10d4)" },
{ "uyp", "\u10e3\u10e0\u10e3\u10d2\u10d5\u10d0\u10d8\u10e1 \u10de\u10d4\u10e1\u10dd (1975\u20131993)" },
{ "uyu", "\u10e3\u10e0\u10e3\u10d2\u10d5\u10d0\u10d8\u10e1 \u10de\u10d4\u10e1\u10dd" },
{ "uzs", "\u10e3\u10d6\u10d1\u10d4\u10d9\u10e3\u10e0\u10d8 \u10e1\u10e3\u10db\u10d8" },
{ "veb", "\u10d5\u10d4\u10dc\u10d4\u10e1\u10e3\u10d4\u10da\u10d8\u10e1 \u10d1\u10dd\u10da\u10d8\u10d5\u10d0\u10e0\u10d8 (1871\u20132008)" },
{ "vef", "\u10d5\u10d4\u10dc\u10d4\u10e1\u10e3\u10d4\u10da\u10d8\u10e1 \u10d1\u10dd\u10da\u10d8\u10d5\u10d0\u10e0\u10d8" },
{ "vnd", "\u10d5\u10d8\u10d4\u10e2\u10dc\u10d0\u10db\u10e3\u10e0\u10d8 \u10d3\u10dd\u10dc\u10d2\u10d8" },
{ "vuv", "\u10d5\u10d0\u10dc\u10e3\u10d0\u10e2\u10e3\u10e1 \u10d5\u10d0\u10e2\u10e3" },
{ "wst", "\u10e1\u10d0\u10db\u10dd\u10e3\u10e0\u10d8 \u10e2\u10d0\u10da\u10d0" },
{ "xaf", "\u10ea\u10d4\u10dc\u10e2\u10e0\u10d0\u10da\u10e3\u10e0 \u10d0\u10e4\u10e0\u10d8\u10d9\u10e3\u10da\u10d8 CFA \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "xag", "\u10d5\u10d4\u10e0\u10ea\u10ee\u10da\u10d8" },
{ "xba", "\u10d4\u10d5\u10e0\u10dd\u10de\u10e3\u10da\u10d8 \u10d9\u10dd\u10db\u10de\u10de\u10dd\u10d6\u10d8\u10e2\u10e3\u10e0\u10d8 \u10d4\u10e0\u10d7\u10d4\u10e3\u10da\u10d8" },
{ "xbb", "\u10d4\u10d5\u10e0\u10dd\u10de\u10e3\u10da\u10d8 \u10e4\u10e3\u10da\u10d0\u10d3\u10d8 \u10d4\u10e0\u10d7\u10d4\u10e3\u10da\u10d8" },
{ "xcd", "\u10d0\u10e6\u10db\u10dd\u10e1\u10d0\u10d5\u10da\u10d4\u10d7 \u10d9\u10d0\u10e0\u10d8\u10d1\u10d8\u10e3\u10da\u10d8 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
{ "xeu", "\u10d4\u10d5\u10e0\u10dd\u10de\u10e3\u10da\u10d8 \u10e1\u10d0\u10d5\u10d0\u10da\u10e3\u10e2\u10dd \u10d4\u10e0\u10d7\u10d4\u10e3\u10da\u10d8" },
{ "xfo", "\u10e4\u10e0\u10d0\u10dc\u10d2\u10e3\u10da\u10d8 \u10dd\u10e5\u10e0\u10dd\u10e1 \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "xof", "(CFA) \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8 (BCEAO)" },
{ "xpf", "CFP \u10e4\u10e0\u10d0\u10dc\u10d9\u10d8" },
{ "xxx", "\u10e3\u10ea\u10dc\u10dd\u10d1\u10d8 \u10d5\u10d0\u10da\u10e3\u10e2\u10d0" },
{ "ydd", "\u10d8\u10d4\u10db\u10d4\u10dc\u10d8\u10e1 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "yer", "\u10d8\u10d4\u10db\u10d4\u10dc\u10d8\u10e1 \u10e0\u10d4\u10d0\u10da\u10d8" },
{ "yud", "\u10d8\u10e3\u10d2\u10dd\u10e1\u10da\u10d0\u10d5\u10d8\u10e3\u10e0\u10d8 \u10db\u10e7\u10d0\u10e0\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "yum", "\u10d8\u10e3\u10d2\u10dd\u10e1\u10da\u10d0\u10d5\u10d8\u10e3\u10e0\u10d8 \u10d0\u10ee\u10d0\u10da\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "yun", "\u10d8\u10e3\u10d2\u10dd\u10e1\u10da\u10d0\u10d5\u10d8\u10e3\u10e0\u10d8 \u10d9\u10dd\u10dc\u10d5\u10d4\u10e0\u10e2\u10d8\u10e0\u10d4\u10d1\u10d0\u10d3\u10d8 \u10d3\u10d8\u10dc\u10d0\u10e0\u10d8" },
{ "zar", "\u10e1\u10d0\u10db\u10ee\u10e0\u10d4\u10d7 \u10d0\u10e4\u10e0\u10d8\u10d9\u10e3\u10da\u10d8 \u10e0\u10d0\u10dc\u10d3\u10d8" },
{ "zmk", "\u10d6\u10d0\u10db\u10d1\u10d8\u10e3\u10e0\u10d8 \u10d9\u10d5\u10d0\u10ed\u10d0 (1968\u20132012)" },
{ "zmw", "\u10d6\u10d0\u10db\u10d1\u10d8\u10e3\u10e0\u10d8 \u10d9\u10d5\u10d0\u10ed\u10d0" },
{ "zrn", "\u10d6\u10d0\u10d8\u10e0\u10d8\u10e1 \u10d0\u10ee\u10d0\u10da\u10d8 \u10d6\u10d0\u10d8\u10e0\u10d8" },
{ "zrz", "\u10d6\u10d0\u10d8\u10e0\u10d8\u10e1 \u10d6\u10d0\u10d8\u10e0\u10d8" },
{ "zwd", "\u10d6\u10d8\u10db\u10d1\u10d0\u10d1\u10d5\u10d4\u10e1 \u10d3\u10dd\u10da\u10d0\u10e0\u10d8" },
};
return data;
}
}
| [
"274534565@qq.com"
] | 274534565@qq.com |
0c61ceeb81f7bba014fb738a34d96bb8edc4fc1d | e34c8a5774d853c5ee0fb5b90332609abc93c918 | /activiti-ee-spring-boot-example/src/main/java/com/alfresco/activiti/Application.java | 7575be76eb0e091eef9e07b5da667f037a98b6ee | [
"Apache-2.0"
] | permissive | cijujoseph/activiti-examples | e745bcaaa0db39e4ae3b4fb7091538ec8a2bba53 | e890315520f6803475f86789fceb093eebcc0c89 | refs/heads/master | 2021-01-11T19:18:16.567456 | 2019-05-07T03:23:06 | 2019-05-07T03:23:06 | 79,348,214 | 58 | 48 | Apache-2.0 | 2018-02-16T13:58:29 | 2017-01-18T14:33:28 | JavaScript | UTF-8 | Java | false | false | 917 | java | package com.alfresco.activiti;
import org.activiti.engine.IdentityService;
import org.activiti.engine.identity.User;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
InitializingBean usersAndGroupsInitializer(final IdentityService identityService) {
return new InitializingBean() {
public void afterPropertiesSet() throws Exception {
if (identityService.createUserQuery().userId("admin").list().size() == 0) {
User admin = identityService.newUser("admin");
admin.setPassword("password");
identityService.saveUser(admin);
}
}
};
}
}
| [
"cijujoseph@Cijus-MBP.T-mobile.com"
] | cijujoseph@Cijus-MBP.T-mobile.com |
2eef598068e35b3ff1d1283454f2f351832acbf4 | 61fe362986a0e26a945a3d63e4f0dd58b3117284 | /src/main/java/bingosoft/hrhelper/common/DateTransferUtils.java | dcf53ed137abc65baed9cc02f1e41689e38fd230 | [] | no_license | Chenwx0/bingosoft-hrhelper | a34c287211e8c7b951d310d6d6c95fec6d2fde3b | 59dbb9cd22b6811ee672a59824d15c51abfc7190 | refs/heads/master | 2020-03-23T14:14:53.073967 | 2018-08-31T09:03:07 | 2018-08-31T09:03:07 | 141,665,108 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 14,224 | java | package bingosoft.hrhelper.common;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
* 日期,日历,字符串转换工具类
* @author zhangyx
*/
public class DateTransferUtils {
private static SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
private static SimpleDateFormat datetime = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
public static Date getNowDate(){
return new Date();
}
// ****************************当前时间相关****************************
/**
* 获得以 yyyy-MM-dd 为形式的当前时间字符串
*
* @return String
*/
public static String getCurrentTimeByDay() {
String time = date.format(new Date(System.currentTimeMillis()));
return time;
}
/**
* 获得以 yyyy-MM-dd HH:mm:ss 为形式的当前时间字符串
*
* @return String
*/
public static String getCurrentTimeBySecond() {
String time = datetime.format(new Date(System.currentTimeMillis()));
return time;
}
/**
* 获得给定格式的当前时间字符串
*
* @param give
* String 给定的时间格式
* @return String
*/
public static String getCurrentTime(String give) {
SimpleDateFormat temp = new SimpleDateFormat(give);
return temp.format(new Date(System.currentTimeMillis()));
}
// ****************************String转换为Date****************************
/**
* 将String转化成date
*
* @throws ParseException
* */
public static Date pStringToDate(String str, String sfgs)
throws ParseException {
SimpleDateFormat sf = new SimpleDateFormat(sfgs);
return sf.parse(str);
}
/**
* 将String转化成date 格式为yyyy-MM-dd hh:mm:ss
*
* @throws ParseException
* */
public static Date pStringToDate(String str) throws ParseException {
return datetime.parse(str);
}
// ****************************Date转换为String****************************
/**
* 转换成日期格式的字符串 格式为yyyy-MM-dd
*
* @param Object
* @return String
*/
public static String dateFormat(Date o) {
if (o == null) {
return "";
}
return date.format(o);
}
/**
* 转换成时间格式的字符串 格式为yyyy-MM-dd hh:mm:ss
*
* @param Date
* @return String
*/
public static String dateTimeFormat(Date o) {
if (o == null) {
return "";
}
return datetime.format(o);
}
/**
* 转换成给定时间格式的字符串
*
* @param Date
* @param String
* @return String
*/
public static String getDateFormat(Date d, String format) {
return new SimpleDateFormat(format).format(d);
}
/**
* 日期格式化(yyyy年MM月dd日)
*
* @param Date
* @return String
* */
public static String fDateCNYR(Date date) {
return getDateFormat(date, "yyyy年MM月dd日");
}
/**
* 日期格式化(yyyy年MM月dd日 HH:mm)
*
* @param Date
* @return String
* */
public static String fDateCNYRS(Date date) {
return getDateFormat(date, "yyyy年MM月dd日 HH点");
}
/**
* 日期格式化(yyyy年MM月dd日 HH:mm)
*
* @param Date
* @return String
* */
public static String fDateCNYRSF(Date date) {
return getDateFormat(date, "yyyy年MM月dd日 HH:mm");
}
/**
* 日期格式化(yyyy年MM月dd日 HH:mm:ss)
*
* @param Date
* @return String
* */
public static String fDateCNYRSFM(Date date) {
return getDateFormat(date, "yyyy年MM月dd日 HH:mm:ss");
}
// ****************************时间格式的String转换为String****************************
/**
* 根据给定的时间格式字符串截取给定格式的字符串
*
* @param d
* String 给定时间格式为yyyy-MM-dd HH:mm:ss
* @param format
* String 给定的格式
* @return String
*/
public static String getDateFormat(String d, String format)
throws ParseException {
Date date = datetime.parse(d);
return getDateFormat(date, format);
}
// ****************************时间格式的String转换为long****************************
/**
* 通过字符串获得long型时间
*
* @param String
* @return long
*/
public static long getDateFromStr(String dateStr) {
long temp = 0L;
Date date = null;
try {
date = datetime.parse(dateStr);
} catch (Exception e) {
e.printStackTrace();
return temp;
}
temp = date.getTime();
return temp;
}
// ****************************Date转换为给定格式的Date****************************
/**
* 日期格式化(2014-03-04)
*
* @param Date
* @return Date
* @throws ParseException
* */
public static Date fDate(Date dat) throws ParseException {
String dateStr = date.format(dat);
return date.parse(dateStr);
}
/**
* 通过开始时间和间隔获得结束时间。
*
* @param String
* @param int
* @return String
*/
public static String getEndTime(String start, int span) {
if (isNullOrNone(start) || span == 0) {
return null;
}
long temp = getDateFromStr(start);
temp += span * 60L * 1000L;
return datetime.format(new Date(temp));
}
/**
* 格式化字符串,将2013-10-20 00:00:00.000000简化为2013-10-20 00:00:00
*
* @param String
* str
* @return String
* @throws ParseException
* */
public static String getFormatStringDay(String str) throws ParseException {
Date date = datetime.parse(str);
return datetime.format(date);
}
/**
* 判断是否为空
*
* @param String
* @return boolean
*/
public static boolean isNullOrNone(String src) {
if (null == src || "".equals(src)) {
return true;
}
return false;
}
/**
* 如果字符串长度大于25则截取前25个字符串后续改成省略号
*
* @param String
* @return String
*/
public static String showCount(String str) {
if (str != null) {
if (str.length() > 25) {
str = str.substring(0, 25);
str = str + "...";
}
} else {
str = "";
}
return str;
}
/**
* 是否符合日期格式yyyy-MM-dd
*
* @param day
* String 日期字符串
* @return boolean
*/
public static boolean isFormatDay(String day) {
return day
.matches("(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)");
}
/**
* 是否符合时间格式HH:mm:ss
*
* @param time
* String 时间字符串
* @return boolean
*/
public static boolean isFormatTime(String time) {
return time
.matches("(0[1-9]|1[0-9]|2[0-4]):(0[1-9]|[1-5][0-9]):(0[1-9]|[1-5][0-9])(\\.000000)?");
}
/**
* 是否符合时间格式yyyy-MM-dd HH:mm:ss
*
* @param time
* String 时间字符串
* @return boolean
*/
public static boolean isFormat(String time) {
String[] temp = time.split(" ");
return isFormatDay(temp[0]) && isFormatTime(temp[1]);
}
/**
* 通过给定的年、月、周获得该周内的每一天日期
*
* @param year
* int 年
* @param month
* int 月
* @param week
* int 周
* @return List<Date> 七天的日期
*/
public static List<Date> getDayByWeek(int year, int month, int week) {
List<Date> list = new ArrayList<Date>();
// 先滚动到该年.
Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
// 滚动到月:
c.set(Calendar.MONTH, month - 1);
// 滚动到周:
c.set(Calendar.WEEK_OF_MONTH, week);
// 得到该周第一天:
for (int i = 0; i < 6; i++) {
c.set(Calendar.DAY_OF_WEEK, i + 2);
list.add(c.getTime());
}
// 最后一天:
c.set(Calendar.WEEK_OF_MONTH, week + 1);
c.set(Calendar.DAY_OF_WEEK, 1);
list.add(c.getTime());
return list;
}
/**
* 获得当前日期是本月的第几周
*
* @return int
*/
public static int getCurWeekNoOfMonth() {
Date date = new Date(System.currentTimeMillis());
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
return calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH);
}
/**
* 获得当前日期是星期几
*
* @return int
*/
public static int getCurWeekNo(String dat) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
date = format.parse(dat);
} catch (ParseException e) {
e.printStackTrace();
}
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setTime(date);
return calendar.get(Calendar.DAY_OF_WEEK);
}
/**
* 获得当前的年份
*
* @return
*/
public static int getCurrentYear() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.YEAR);
}
/**
* 获得当前的月份
*
* @return
*/
public static int getCurrentMonth() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.MONTH) + 1;
}
/**
* 获得当前的日期天
*
* @return
*/
public static int getCurrentDay() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.DATE);
}
/**
* 获取当月最后一天
*
* @param Date date
* @param String format
* @return String
* */
public static String lastDayOfMoth(Date date, String format){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH,1);
cal.add(Calendar.MONTH,1);
cal.add(Calendar.DATE, -1);
date = cal.getTime();;
SimpleDateFormat sf = new SimpleDateFormat(format);
return sf.format(date);
}
/**
* 获取当月最后一天
*
* @param Date date
* @param String format
* @return String
* */
public static String firstDayOfMoth(Date date, String format){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, 0);
date = cal.getTime();;
SimpleDateFormat sf = new SimpleDateFormat(format);
return sf.format(date);
}
//****************************************************************
/**
* 转换成字符串方法,其中如果是Integer格式的返回0,如果是Double格式的返回0.0
*
* @param Object
* @return String
*/
public static String toString(Object o) {
if (o == null) {
if (o instanceof Integer) {
return "0";
}
if (o instanceof Double) {
return "0.0";
}
return "";
} else {
return o.toString();
}
}
/**
* 清空字符串,如果为“”则转换成null
*
* @param String
* @return String
*/
public static String emptyString2Null(String src) {
if (src != null) {
if ("".equals(src)) {
src = null;
}
}
return src;
}
/**
* 转化成可在hql中使用的字符串
* 1,2 转为 '1','2'
* */
public static String formatIds(String ids){
if(ids!=null&&ids!="")
{
String[] id = ids.split(",");
StringBuffer idsStr = new StringBuffer();
for(String str : id){
idsStr.append("'"+str+"',");
}
return idsStr.toString().substring(0,idsStr.length()-1);
}
else
{
return "";
}
}
/**
* 获取当前日期前一天
*
* @param Date date
* @return Date
* */
public static Date getSpecifiedDayBefore(Date date){
Calendar c = Calendar.getInstance();
c.setTime(date);
int day = c.get(Calendar.DATE);
c.set(Calendar.DATE, day-1);
date = c.getTime();
return date;
}
/**
* 比较两个日期的大小
*
* @param data1
* @param data2
*
* @return boolean
*
* @author zhangss 2016-5-18 13:47:16
* */
public boolean bjDate(Date date1, Date date2){
if (date1.getTime() > date2.getTime()) {
return true;
}
return false;
}
} | [
"Administrator@WIN-20140905DCS"
] | Administrator@WIN-20140905DCS |
69f9a3cf9030191f13b5abfff200d8eb01892438 | 260ffca605956d7cb9490a8c33e2fe856e5c97bf | /src/com/google/android/gms/games/stats/Stats$LoadPlayerStatsResult.java | f6235a277d695e89380e9b1d0a0445456b08043f | [] | no_license | yazid2016/com.incorporateapps.fakegps.fre | cf7f1802fcc6608ff9a1b82b73a17675d8068beb | 44856c804cea36982fcc61d039a46761a8103787 | refs/heads/master | 2021-06-02T23:32:09.654199 | 2016-07-21T03:28:48 | 2016-07-21T03:28:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 447 | java | package com.google.android.gms.games.stats;
import com.google.android.gms.common.api.Releasable;
import com.google.android.gms.common.api.Result;
public abstract interface Stats$LoadPlayerStatsResult
extends Releasable, Result
{
public abstract PlayerStats getPlayerStats();
}
/* Location:
* Qualified Name: com.google.android.gms.games.stats.Stats.LoadPlayerStatsResult
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
53a8c2654fcddd1f9e8cd851954f68e524be0d89 | cccf7cb89067d0652977be9d0bccc7a3138ebdeb | /exception_no_stack/src/main/java/javax0/blog/demo/throwable/v2/FileNumberedLineEmpty.java | 3a4e354d7c3569d57a64e93ef9e8ca132a807c65 | [
"Apache-2.0"
] | permissive | verhas/BLOG | ee55f98378c066e5bd7bd88e63042d6ad8a1dcaf | 653bb9a39f93400445c83b1b07b448e063dce85d | refs/heads/master | 2022-10-10T11:45:44.236508 | 2020-06-08T11:01:29 | 2020-06-08T11:01:29 | 260,171,726 | 2 | 3 | Apache-2.0 | 2020-05-17T15:02:21 | 2020-04-30T09:42:27 | Java | UTF-8 | Java | false | false | 455 | java | // snippet FileNumberedLineEmpty_v2
package javax0.blog.demo.throwable.v2;
public class FileNumberedLineEmpty extends NumberedLineEmpty {
final protected String fileName;
public FileNumberedLineEmpty(String fileName, NumberedLineEmpty cause) {
super(cause.lineNr, cause);
this.fileName = fileName;
}
@Override
public String getMessage() {
return fileName + ":" + lineNr + " is empty";
}
}
// end snippet
| [
"peter@verhas.com"
] | peter@verhas.com |
c5dbf4b3a282d95a0e46b56472fb91d7ae95b155 | 803167358b6ddee43912401f89d8c07eabf5e12d | /src/Practice/Graphs/TopologicalSort/TopologicalSort.java | a6d2c07739d768f1a3d2e533e97b611b1e730b14 | [] | no_license | SushmaSrimathtirumala/GeeksForGeeks | 7510c5d9c71c281b0957fda641abf164290a5229 | 7712707a414b10a553b3fcdbbb9757f259ca6143 | refs/heads/master | 2020-05-02T12:39:03.889681 | 2017-05-04T16:04:43 | 2018-05-04T04:03:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,001 | java | package Practice.Graphs.TopologicalSort;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
/**
* Created by gakshintala on 1/10/16.
*/
// NOT TESTED, refer the one in Hackerrank
public class TopologicalSort {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int testCases = scn.nextInt();
while (testCases-- > 0) {
int edgeCount = scn.nextInt();
int vertexCount = scn.nextInt();
Digraph_TS graph = new Digraph_TS(vertexCount);
while (edgeCount-- > 0) {
graph.addEdge(scn.nextInt(), scn.nextInt());
}
Arrays.stream(dfs(vertexCount, graph)).forEach(val -> System.out.print(val + " "));
}
}
private static int[] dfs(int vertexCount, Digraph_TS graph) {
boolean[] visited = new boolean[vertexCount];
List<Integer> reversePostOrder = new ArrayList<>();
for (int i = 0; i < vertexCount; i++) {
if (!visited[i]) {
dfs(graph, i, visited, reversePostOrder);
}
}
return reversePostOrder.stream().mapToInt(i -> i).toArray();
}
private static void dfs(Digraph_TS graph, int vertex, boolean[] visited, List<Integer> reversePostOrder) {
visited[vertex] = true;
for (int adj : graph.getConnectingNodes(vertex)) {
if (!visited[adj]) {
dfs(graph, adj, visited, reversePostOrder);
}
}
reversePostOrder.add(vertex);
}
}
class Digraph_TS {
private int n;
private List<Integer>[] adj;
Digraph_TS(int n) {
this.n = n;
this.adj = new List[n];
for (int i = 0; i < n; i++) {
adj[i] = new ArrayList<>();
}
}
public void addEdge(int u, int v) {
adj[u].add(v);
}
public List<Integer> getConnectingNodes(int source) {
return adj[source];
}
}
| [
"gopalakshintala@gmail.com"
] | gopalakshintala@gmail.com |
713acefb530024b388bf8647c7d2ddc8f811b378 | 3b146038e959df9d08fd800103064184ef437768 | /src/archive/RearrangeOrder.java | 62675cca7ba0dcaea045bc7f0767d3caf54f21c2 | [] | no_license | ShekharPaatni/java8 | 85d59005cb2d31014fe0ab0c381483d9305dd053 | 584dd930a53327eb035d52a2224a48514bc92d07 | refs/heads/master | 2020-07-17T08:45:57.512502 | 2019-09-03T04:13:04 | 2019-09-03T04:13:04 | 205,987,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 546 | java | package archive;
import java.util.Arrays;
/**
* @author Chandra Shekhar Paatni on 15/7/19
*/
public class RearrangeOrder {
public static void main(String[] args) {
arrange(new Long[] {4L, 0L, 2L, 1L, 3L}, 5);
}
static void arrange (Long arr[], int n) {
for (int i = 0; i < arr.length; i++) {
arr[i]+=(arr[Math.toIntExact(arr[i])] %n) *n;
}
for (int i = 0; i < arr.length; i++) {
arr[i]/=n;
}
Arrays.stream(arr).forEachOrdered(System.out::println);
}
}
| [
"chandrashekharpaatni@tothenew.com"
] | chandrashekharpaatni@tothenew.com |
05bf63a11f000eb0df718862c93fbac31c9d19ba | fc6853edeab40c9363a6d48f0e3c26e3caf7d1ec | /service-zuul/src/main/java/com/kyle/servicezuul/ServiceZuulApplication.java | 92f161de518ed8ec327f56d040ac27f4c3e9a876 | [] | no_license | kyle624701089/mySpringCloud | e6f230327bd21cd2d6754595437489836bdf31ae | 6b14777012d413ec9b92927cfb45aebb4bd01b89 | refs/heads/master | 2021-07-14T01:17:09.654966 | 2021-06-29T13:17:54 | 2021-06-29T13:17:54 | 147,090,499 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package com.kyle.servicezuul;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
@SpringBootApplication
@EnableDiscoveryClient
@EnableEurekaClient
@EnableZuulProxy
public class ServiceZuulApplication {
public static void main(String[] args) {
SpringApplication.run(ServiceZuulApplication.class, args);
}
}
| [
"624701089@qq.com"
] | 624701089@qq.com |
7ad6aaa3f2289516b47ebf542867ba3e633fa71a | c518b254fd563ae3baac662fcae0cedd720cf7f1 | /src/com/kstenschke/dummytext/PluginPreferences.java | 4f256660172fe3c4f2155ca28f91ef50e7a7cef4 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | WuglyakBolgoink/dummytext-plugin | 64bba73be6e62d15b84f756ffc7bafdc488d7459 | 7d5311c6b1bb54ffc4f4ba56dcd5ff9e604ecf5f | refs/heads/master | 2021-01-24T11:27:41.121714 | 2015-06-05T05:48:11 | 2015-06-05T05:48:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,369 | java | /*
* Copyright 2013-2014 Kay Stenschke
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.kstenschke.dummytext;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import org.jetbrains.annotations.NonNls;
import com.intellij.ide.util.PropertiesComponent;
/**
* Utility functions for preferences handling
* All preferences of the DummyText plugin are stored on project level
*/
public class PluginPreferences {
// @NonNls = element is not a string requiring internationalization and it does not contain such strings.
@NonNls
private static final String PROPERTY_GENRE = "PluginDummyText.Genre";
/**
* @return The currently opened project
*/
private static Project getOpenProject() {
Project[] projects = ProjectManager.getInstance().getOpenProjects();
return (projects.length > 0) ? projects[0] : null;
}
/**
* @return PropertiesComponent (project level)
*/
private static PropertiesComponent getPropertiesComponent() {
Project project = getOpenProject();
return project != null ? PropertiesComponent.getInstance(project) : null;
}
/**
* Store preference: genre
*
* @param genre Genre code, e.g. "pirates" (default) / "scifi" / ...
*/
public static void saveGenre(String genre) {
PropertiesComponent propertiesComponent = getPropertiesComponent();
if( propertiesComponent != null ) {
propertiesComponent.setValue(PROPERTY_GENRE, genre);
}
}
/**
* Get preference: genre
*
* @return String Genre code, e.g. "scifi", "pirates", "latin" (default)
*/
public static String getGenreCode() {
PropertiesComponent propertiesComponent = getPropertiesComponent();
String genre = null;
if( propertiesComponent != null ) {
genre = propertiesComponent.getValue(PROPERTY_GENRE);
}
return genre == null ? "latin" : genre;
}
} | [
"info@stenschke.com"
] | info@stenschke.com |
a7e0d6c8d9ca8425c7817a66f56cd5756e881353 | 4987e4d9676f04cc696eeeed5ae6b820144aa755 | /app/src/main/java/com/sand5/videostabilize/hyperlapse/camera2/utils/VideoStabilizationLearningsDump.java | d9f65613cb64ed3d39f41949b5b24edcc4ae6a13 | [] | no_license | afsaredrisy/Hyperlapse | 96fc6a472624517f1817e18c2f1f5caff4698298 | c41dc61d784f6e34031d94266845f97f66cd713a | refs/heads/master | 2020-12-01T09:48:11.534551 | 2017-02-03T23:06:34 | 2017-02-03T23:06:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,269 | java | package com.sand5.videostabilize.hyperlapse.camera2.utils;
/**
* Created by jeetdholakia on 1/12/17.
*/
public class VideoStabilizationLearningsDump {
/**
* Learnings and understandings from the book
* 1)Work on gyroscope
* Retrieve gyro timestamps and 3axis coords
* Calculate angular velocity from 3 axis
* Interpolate so as to get the perfect angular velocity for a give timestamp
*
* 2)Training video
* Extract good features to track
* Use optical flow to find where they are in frames
* Correlate that with gyroscope data
* Use RANSAC to improve good features to track algo and we get epic homography! WOW!
*
* 3) Handling rotations
* Generate Transformation matrices using opencv rodriguez
*/
/**
* Intrinsic parameters - Done!
* Rotation Matrix - Done!
* TODO : Extrinsic parameters
* Time gap between frame and gyrotimestamp
* Rolling shutter estimation (from the book nigga!)
*/
/**
* Stuff that is required for intrinsic parameters
*
* Intrinsic camera matrix is in the form of:
* [ fx s x
* 0 fy y
* 0 0 1]
* fx and fy are focal lengths in x and y direction
* s is the skew
* x and y are principle points
* fx = x/tan(ax)
* fy = y/tan(ay)
*
* Rolling shutter skew (DONE)
* fx and fy(DONE)
* Focal Length (DONE)
* Time stamp (Frame,Gyro,Accelerometer,Rotation) (DONE)
*
* Lens Pose rotation
* Inputs : x,y,z,w
* Formula:
* theta = 2* acos(w)
* ax = x/ sin(theta/2)
* ay = y/ sin(theta/2)
* az = z/ sin(theta/2)
*
* To create a 3*3 rotation matrix
* R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
* 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
* 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
*
*
* Formula to get angular velocity and angular position
* http://faculty.ucmerced.edu/mhyang/papers/cvpr16_mobile_deblurring.pdf
* https://developer.android.com/guide/topics/sensors/sensors_motion.html (Also includes getting gyro delta over a given time step)
* Sensor fusion activity
* Gyroscope and accelerometer use sensor coordinate system (use that or wrt world coordinate system?)
* Seems gyro to calculate rotation, and accelerometer to calculate translation are main players here
* For rotation wrt earths frame of reference,and remapping with sensors Frame of reference:
* https://developer.android.com/guide/topics/sensors/sensors_motion.html
*
* Paper on auto calibration (camera - gyroscope fusion)
* http://users.ece.utexas.edu/~bevans/papers/2015/autocalibration/autocalibrationIEEETransImageProcPaperDraft.pdf
* http://users.ece.utexas.edu/~bevans/students/phd/chao_jia/phd.pdf
* http://users.ece.utexas.edu/~bevans/projects/dsc/software/calibration/
*
*
*
*
*
* Extrinsic Parameters
*
*
* Distortion Parameters
*
*
*
* Timestamp calibration is also an issue!
* http://stackoverflow.com/questions/39745796/synchronizing-sensorevent-timestamp-with-system-nanotime-or-systemclock-e
*
*
*/
}
| [
"onemediasoft@gmail.com"
] | onemediasoft@gmail.com |
0e2e8447444406985f8200146d0bd9fb3b6f2406 | 80ce33fc67f7b5332afe65d07209d3b12e7fe3f0 | /wkj-monitor/src/test/java/com/cpucode/InfluxTest.java | 953ddb34f4d05b815f913cda22a6b5bc408f3575 | [] | no_license | CPU-Code/monitor | 7394f3f098e273b24d6a99c7c8a074841e197b53 | 21c94ea8315cd536c0da5455487c7fb909bb2362 | refs/heads/main | 2023-08-23T05:27:51.638467 | 2021-10-11T02:13:17 | 2021-10-11T02:13:17 | 412,294,771 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,287 | java | package com.cpucode;
import com.cpucode.monitor.MonitorApplication;
import com.cpucode.monitor.dto.QuotaInfo;
import com.cpucode.monitor.influx.InfluxRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @author : cpucode
* @date : 2021/10/3 16:55
* @github : https://github.com/CPU-Code
* @csdn : https://blog.csdn.net/qq_44226094
*/
@SpringBootTest(classes = MonitorApplication.class)
@RunWith(SpringRunner.class)
public class InfluxTest {
@Autowired
private InfluxRepository influxRepository;
@Test
public void testAdd(){
QuotaInfo quotaInfo = new QuotaInfo();
quotaInfo.setDeviceId("xxxxx");
quotaInfo.setQuotaId("1");
quotaInfo.setQuotaName("ddd");
quotaInfo.setReferenceValue("0-10");
quotaInfo.setUnit("摄氏度");
quotaInfo.setAlarm("1");
quotaInfo.setFloatValue(11.44f);
quotaInfo.setDoubleValue(11.44D);
quotaInfo.setIntegerValue(43);
quotaInfo.setBoolValue(false);
quotaInfo.setStringValue("fdsd");
influxRepository.add(quotaInfo);
}
}
| [
"923992029@qq.com"
] | 923992029@qq.com |
a825943f692d241f2abf365bbe658ae1c08b4309 | 53a7b7823b5e47e9c5ea98e14b14604d47ab7b26 | /src/main/java/com/cs/lexiao/admin/basesystem/webUtil/tag/ColumnTag.java | 553116f9d97f556266dc60eaf3417b683075482d | [] | no_license | zjhgx/admin-demo | 4fd7f786388a15e46eca3179db37ff160a3e6159 | 3001b2534a9cc606ed3947e1605e5b3394088299 | refs/heads/master | 2021-08-29T17:28:57.373972 | 2017-12-14T13:02:32 | 2017-12-14T13:02:32 | 114,249,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,882 | java | package com.cs.lexiao.admin.basesystem.webUtil.tag;
import java.util.List;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
/**
* column标签实现类
* @author shentuwy
* @date 2011-12-1
**/
public class ColumnTag extends TagSupport {
private static final long serialVersionUID = 4595126856147970993L;
private String title="";
private String field;
private boolean checkbox = false;
private int width = 70;
private String align = Column.ALIGN_CENTER;
private String formatter;
private boolean rownumber = false;
private boolean sortable = false;
public ColumnTag(){super();}
/** 标签初始方法 */
public int doStartTag() throws JspTagException{
return Tag.SKIP_BODY;
}
/** 标签结束方法 */
public int doEndTag() throws JspTagException{
Column column = new Column();
column.setTitle(this.title);
column.setField(this.field);
column.setCheckbox(this.checkbox);
column.setWidth(this.width);
if(this.align != null){
this.align = this.align.toLowerCase();
if(!Column.ALIGN_LEFT.equals(this.align) && !Column.ALIGN_CENTER.equals(this.align) && !Column.ALIGN_RIGHT.equals(this.align))
this.align = Column.ALIGN_CENTER;
}else
this.align = Column.ALIGN_CENTER;
column.setAlign(this.align);
column.setFormatter(this.formatter);
column.setRownumber(rownumber);
column.setSortable(sortable);
//TagSupport parentTag = (TagSupport)this.getParent();
List<Column> columns = (List<Column>)this.pageContext.getAttribute(ColumnsTag.COLUMNS_KEY);
//List<Column> columns = (List<Column>)parentTag.getValue(ColumnsTag.COLUMNS_KEY);
columns.add(column);
return Tag.EVAL_PAGE;
}
/** 释放资源 */
public void release(){
super.release();
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
public boolean isCheckbox() {
return checkbox;
}
public void setCheckbox(boolean checkbox) {
this.checkbox = checkbox;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public String getAlign() {
return align;
}
public void setAlign(String align) {
this.align = align;
}
public String getFormatter() {
return formatter;
}
public void setFormatter(String formatter) {
this.formatter = formatter;
}
public boolean isRownumber() {
return rownumber;
}
public void setRownumber(boolean rownumber) {
this.rownumber = rownumber;
}
public boolean isSortable() {
return sortable;
}
public void setSortable(boolean sortable) {
this.sortable = sortable;
}
}
| [
"hugaoxiang@tourongjia.com"
] | hugaoxiang@tourongjia.com |
52fd9e8c62872cf21b37cf5b9d6eaf34d9b9bd36 | 5186357a3cb8352c1abc1df7b91d7ad80c86ac05 | /app/app/src/main/java/com/example/wangalei/myapplication/Widgets/PickTime/WheelScroller.java | fdfbdb159ad388c3838ebe217b66ab62c5eb45e6 | [] | no_license | violinX/AndoridTotalProject | 343b9fc38e9fd319b2609de387a55df325a893aa | 03cd50710ec92f67eeb9ea670885200b164fb781 | refs/heads/master | 2021-01-22T21:37:30.012690 | 2017-06-14T10:02:11 | 2017-06-14T10:02:11 | 85,448,922 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,748 | java | package com.example.wangalei.myapplication.Widgets.PickTime;
/**
* Created by JD on 2017/4/7.
*/
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.animation.Interpolator;
import android.widget.Scroller;
/**
* Scroller class handles scrolling events and updates the
*/
public class WheelScroller {
/**
* Scrolling listener interface
*/
public interface ScrollingListener {
/**
* Scrolling callback called when scrolling is performed.
*
* @param distance
* the distance to scroll
*/
void onScroll(int distance);
/**
* Starting callback called when scrolling is started
*/
void onStarted();
/**
* Finishing callback called after justifying
*/
void onFinished();
/**
* Justifying callback called to justify a view when scrolling is ended
*/
void onJustify();
}
/** Scrolling duration */
private static final int SCROLLING_DURATION = 400;
/** Minimum delta for scrolling */
public static final int MIN_DELTA_FOR_SCROLLING = 1;
// Listener
private ScrollingListener listener;
// Context
private Context context;
// Scrolling
private GestureDetector gestureDetector;
private Scroller scroller;
private int lastScrollY;
private float lastTouchedY;
private boolean isScrollingPerformed;
/**
* Constructor
*
* @param context
* the current context
* @param listener
* the scrolling listener
*/
public WheelScroller(Context context, ScrollingListener listener) {
gestureDetector = new GestureDetector(context, gestureListener);
gestureDetector.setIsLongpressEnabled(false);
scroller = new Scroller(context);
this.listener = listener;
this.context = context;
}
/**
* Set the the specified scrolling interpolator
*
* @param interpolator
* the interpolator
*/
public void setInterpolator(Interpolator interpolator) {
scroller.forceFinished(true);
scroller = new Scroller(context, interpolator);
}
/**
* Scroll the wheel2
*
* @param distance
* the scrolling distance
* @param time
* the scrolling duration
*/
public void scroll(int distance, int time) {
scroller.forceFinished(true);
lastScrollY = 0;
scroller.startScroll(0, 0, 0, distance, time != 0 ? time : SCROLLING_DURATION);
setNextMessage(MESSAGE_SCROLL);
startScrolling();
}
/**
* Stops scrolling
*/
public void stopScrolling() {
scroller.forceFinished(true);
}
/**
* Handles Touch event
*
* @param event
* the motion event
* @return boolean
*/
public boolean onTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
lastTouchedY = event.getY();
scroller.forceFinished(true);
clearMessages();
break;
case MotionEvent.ACTION_MOVE:
// perform scrolling
int distanceY = (int) (event.getY() - lastTouchedY);
if (distanceY != 0) {
startScrolling();
listener.onScroll(distanceY);
lastTouchedY = event.getY();
}
break;
}
if (!gestureDetector.onTouchEvent(event) && event.getAction() == MotionEvent.ACTION_UP) {
justify();
}
return true;
}
// gesture listener
private GestureDetector.SimpleOnGestureListener gestureListener = new GestureDetector.SimpleOnGestureListener() {
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
// Do scrolling in onTouchEvent() since onScroll() are not call
// immediately
// when user touch and move the wheel2
return true;
}
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
lastScrollY = 0;
final int maxY = 0x7FFFFFFF;
final int minY = -maxY;
scroller.fling(0, lastScrollY, 0, (int) -velocityY, 0, 0, minY, maxY);
setNextMessage(MESSAGE_SCROLL);
return true;
}
};
// Messages
private final int MESSAGE_SCROLL = 0;
private final int MESSAGE_JUSTIFY = 1;
/**
* Set next message to queue. Clears queue before.
*
* @param message
* the message to set
*/
private void setNextMessage(int message) {
clearMessages();
animationHandler.sendEmptyMessage(message);
}
/**
* Clears messages from queue
*/
private void clearMessages() {
animationHandler.removeMessages(MESSAGE_SCROLL);
animationHandler.removeMessages(MESSAGE_JUSTIFY);
}
// animation handler
private Handler animationHandler = new Handler() {
public void handleMessage(Message msg) {
scroller.computeScrollOffset();
int currY = scroller.getCurrY();
int delta = lastScrollY - currY;
lastScrollY = currY;
if (delta != 0) {
listener.onScroll(delta);
}
// scrolling is not finished when it comes to final Y
// so, finish it manually
if (Math.abs(currY - scroller.getFinalY()) < MIN_DELTA_FOR_SCROLLING) {
currY = scroller.getFinalY();
scroller.forceFinished(true);
}
if (!scroller.isFinished()) {
animationHandler.sendEmptyMessage(msg.what);
} else if (msg.what == MESSAGE_SCROLL) {
justify();
} else {
finishScrolling();
}
}
};
/**
* Justifies wheel2
*/
private void justify() {
listener.onJustify();
setNextMessage(MESSAGE_JUSTIFY);
}
/**
* Starts scrolling
*/
private void startScrolling() {
if (!isScrollingPerformed) {
isScrollingPerformed = true;
listener.onStarted();
}
}
/**
* Finishes scrolling
*/
void finishScrolling() {
if (isScrollingPerformed) {
listener.onFinished();
isScrollingPerformed = false;
}
}
}
| [
"244341474@qq.com"
] | 244341474@qq.com |
cbec30cfe35b4d56d5a4339f9891b5c4a8bc6f33 | 60e74843a6350729ee380d6d767e9628f2bfd9b5 | /JavaCode/src/UserInterface/AuctionCentralEmployeeGUI/MainScreen_Admin.java | b6bd289f05a2a696eb09cde77c38edcb66432cf1 | [] | no_license | sriharikuduva/checkin1 | 852cd99260cc8a0a1284d28817ba8b08d993af4a | cee9721048cf767da1d4fc98f026a94813330d8b | refs/heads/master | 2020-03-08T16:02:55.005921 | 2018-06-09T18:05:59 | 2018-06-09T18:05:59 | 128,228,807 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,707 | java | import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.util.Observable;
public class MainScreen_Admin extends Observable {
private JPanel main;
private AuctionCentralEmployee currAdmin;
private DataControlCenter dataControl;
public MainScreen_Admin (AuctionCentralEmployee currAdmin, DataControlCenter dcc) {
this.main = new JPanel(new BorderLayout());
this.currAdmin = currAdmin;
this.dataControl = dcc;
JPanel accountDetails = this.getAccountDetails();
this.main.add(accountDetails, BorderLayout.NORTH);
JPanel options = this.getOptions();
this.main.add(options, BorderLayout.CENTER);
}
private JPanel getOptions() {
JPanel toSend = new JPanel(new GridLayout(5,1));
JButton changeMaxAuctions = new JButton("Change max number of upcoming auctions allowed");
JButton viewAllAuctions = new JButton("View all auctions between start and end dates, inclusive");
JButton viewAuctionsChrono = new JButton("View in brief all auctions in chronological order");
JButton cancelAuction = new JButton("Cancel a specific Auction");
JButton logout = new JButton("Logout");
this.setBehaviorForButtons(changeMaxAuctions, viewAllAuctions, viewAuctionsChrono, cancelAuction, logout);
toSend.add(changeMaxAuctions);
toSend.add(viewAllAuctions);
toSend.add(viewAuctionsChrono);
toSend.add(cancelAuction);
toSend.add(logout);
return toSend;
}
private void setBehaviorForButtons(JButton changeMaxAuctions, JButton viewAllAuctions,
JButton viewAuctionsChrono, JButton cancelAuction, JButton logout) {
// Go to this link if you don't understand lambda expressions
/*https://stackoverflow.com/questions/37695456/how-t
o-replace-anonymous-with-lambda-in-java?utm_medium=organic&utm_s
ource=google_rich_qa&utm_campaign=google_rich_qa*/
changeMaxAuctions.addActionListener((ActionEvent e) -> {
setChanged();
notifyObservers(1); // 1 - Change the frame from main to detailed(change max auction num)
});
viewAllAuctions.addActionListener((ActionEvent e) -> {
setChanged();
notifyObservers(2); // 2 - Change the frame to display all auctions
});
viewAuctionsChrono.addActionListener((ActionEvent e) -> {
setChanged();
notifyObservers(3); // 3 - Change frame to display auctions in chrono ordering
});
cancelAuction.addActionListener((ActionEvent e) -> {
setChanged();
notifyObservers(4); // 4 - Change frame to cancel an auction
});
logout.addActionListener((ActionEvent e) -> {
try {
this.dataControl.logOutAdmin();
} catch (IOException | ClassNotFoundException e1) { e1.printStackTrace(); }
System.exit(0);
});
}
private JPanel getAccountDetails() {
JPanel toSend = new JPanel(new GridLayout(4, 1));
JLabel title = new JLabel("\tAccount Details:");
String indent = "\t\t\t\t\t\t";
JLabel name = new JLabel(indent + "Name: " + currAdmin.getName());
JLabel userName = new JLabel(indent + "Username: " + currAdmin.getUsername());
JLabel status = new JLabel(indent + "Type: Auction Central Employee (Admin)");
toSend.add(title);
toSend.add(name);
toSend.add(userName);
toSend.add(status);
return toSend;
}
public JPanel getMainScreen() {
return this.main;
}
}
| [
"harikuduva7@gmail.com"
] | harikuduva7@gmail.com |
e347c735876c6d62748de4e29c0ccf3b379c89e2 | d2f527ea4eba624b63c35d118789d92adb90e465 | /community/mahout-mr/mr/src/test/java/org/apache/mahout/cf/taste/impl/similarity/TanimotoCoefficientSimilarityTest.java | 87f82b9df3a715e911d434b8fd4fd1ba7fcaa5b7 | [
"Apache-2.0",
"CPL-1.0",
"GPL-2.0-or-later",
"MIT",
"LicenseRef-scancode-mit-old-style",
"LicenseRef-scancode-public-domain",
"Classpath-exception-2.0"
] | permissive | apache/mahout | 070c039ad1c5dcedabb847bb1097494a5b2a46ef | 09f8a2461166311bb94f7e697a634e3475eeb2fd | refs/heads/trunk | 2023-08-16T15:08:13.076531 | 2023-07-27T18:16:20 | 2023-07-27T18:16:20 | 20,089,859 | 2,197 | 1,135 | Apache-2.0 | 2023-03-17T21:21:32 | 2014-05-23T07:00:07 | Java | UTF-8 | Java | false | false | 4,286 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.mahout.cf.taste.impl.similarity;
import org.apache.mahout.cf.taste.model.DataModel;
import org.junit.Test;
/** <p>Tests {@link TanimotoCoefficientSimilarity}.</p> */
public final class TanimotoCoefficientSimilarityTest extends SimilarityTestCase {
@Test
public void testNoCorrelation() throws Exception {
DataModel dataModel = getDataModel(
new long[] {1, 2},
new Double[][] {
{null, 2.0, 3.0},
{1.0},
});
double correlation = new TanimotoCoefficientSimilarity(dataModel).userSimilarity(1, 2);
assertCorrelationEquals(Double.NaN, correlation);
}
@Test
public void testFullCorrelation1() throws Exception {
DataModel dataModel = getDataModel(
new long[] {1, 2},
new Double[][] {
{1.0},
{1.0},
});
double correlation = new TanimotoCoefficientSimilarity(dataModel).userSimilarity(1, 2);
assertCorrelationEquals(1.0, correlation);
}
@Test
public void testFullCorrelation2() throws Exception {
DataModel dataModel = getDataModel(
new long[] {1, 2},
new Double[][] {
{1.0, 2.0, 3.0},
{1.0},
});
double correlation = new TanimotoCoefficientSimilarity(dataModel).userSimilarity(1, 2);
assertCorrelationEquals(0.3333333333333333, correlation);
}
@Test
public void testCorrelation1() throws Exception {
DataModel dataModel = getDataModel(
new long[] {1, 2},
new Double[][] {
{null, 2.0, 3.0},
{1.0, 1.0},
});
double correlation = new TanimotoCoefficientSimilarity(dataModel).userSimilarity(1, 2);
assertEquals(0.3333333333333333, correlation, EPSILON);
}
@Test
public void testCorrelation2() throws Exception {
DataModel dataModel = getDataModel(
new long[] {1, 2},
new Double[][] {
{null, 2.0, 3.0, 1.0},
{1.0, 1.0, null, 0.0},
});
double correlation = new TanimotoCoefficientSimilarity(dataModel).userSimilarity(1, 2);
assertEquals(0.5, correlation, EPSILON);
}
@Test
public void testRefresh() {
// Make sure this doesn't throw an exception
new TanimotoCoefficientSimilarity(getDataModel()).refresh(null);
}
@Test
public void testReturnNaNDoubleWhenNoSimilaritiesForTwoItems() throws Exception {
DataModel dataModel = getDataModel(
new long[] {1, 2},
new Double[][] {
{null, null, 3.0},
{1.0, 1.0, null},
});
Double similarity = new TanimotoCoefficientSimilarity(dataModel).itemSimilarity(1, 2);
assertEquals(Double.NaN, similarity, EPSILON);
}
@Test
public void testItemsSimilarities() throws Exception {
DataModel dataModel = getDataModel(
new long[] {1, 2},
new Double[][] {
{2.0, null, 2.0},
{1.0, 1.0, 1.0},
});
TanimotoCoefficientSimilarity tCS = new TanimotoCoefficientSimilarity(dataModel);
assertEquals(0.5, tCS.itemSimilarity(0, 1), EPSILON);
assertEquals(1, tCS.itemSimilarity(0, 2), EPSILON);
double[] similarities = tCS.itemSimilarities(0, new long [] {1, 2});
assertEquals(0.5, similarities[0], EPSILON);
assertEquals(1, similarities[1], EPSILON);
}
} | [
"srowen@apache.org"
] | srowen@apache.org |
d917251b0ea3b4a0034ffb135233341b1837c338 | 7f6a2366e3337ff7d1b22dbbf585926c04f600ff | /Print the quotient and remainder/Main.java | 016e525d1a827d31ba7aba28bb0edb994a9d9e5e | [] | no_license | vinayan86/C_Programs | 2ba27b2f7e28d220e19961a4d29176ef998828c7 | c21dad4cf18e2287221972d82f1ec38b74c3028b | refs/heads/master | 2022-02-21T06:12:02.971948 | 2019-09-28T06:36:18 | 2019-09-28T06:36:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | #include<stdio.h>
int main()
{
int n=365/4;
int s=365%4;
printf("Quotient: %d",n);
printf("\nRemainder: %d",s);
return 0;
} | [
"49578459+vinayan86@users.noreply.github.com"
] | 49578459+vinayan86@users.noreply.github.com |
ef3989d1d48e390774ac36ca79df546a6e74c856 | 8906069adc2c4d329b20a317627e22fedd3f18c9 | /src/Strategy/PlayStrategyFour.java | bffd8d0c1ffe302c1d4745f3fd53c3e24d5f612f | [] | no_license | Griffin1996/LandLord-Design-Pattern- | 31a4772719d0338fb90ddf9e883c23c51362a2cd | 55a4309817a3cc5359761ff0d1757f710c579d47 | refs/heads/master | 2021-01-20T06:17:11.718976 | 2017-04-30T15:44:09 | 2017-04-30T15:44:09 | 89,859,842 | 0 | 1 | null | null | null | null | WINDOWS-1252 | Java | false | false | 1,512 | java | package Strategy;
import java.util.List;
import Common.Order;
import FlyweightFactory.Card;
public class PlayStrategyFour extends Strategy {
public PlayStrategyFour(List<String> model1,List<String> model2,List<Card> player,List<String> list,int role){
CardAlgorithmInterface( model1, model2,player, list, role);
}
public void CardAlgorithmInterface(List<String> model1,List<String> model2,List<Card> player,List<String> list,int role) {
// TODO Auto-generated method stub
//ÅÅÐò°´Öظ´Êý
player=Order.getOrder(player);
int len1=model1.size();
int len2=model2.size();
if(len1<1 || len2<1)
return;
for(int i=0;i<len1;i++){
String []s=model1.get(i).split(",");
String []s2=model2.get(0).split(",");
if((s.length/3<=len2)&&(s.length*(3+s2.length)==player.size())&&Integer.parseInt(model1.get(i))>player.get(0). getValue())
{
list.add(model1.get(i));
for(int j=1;j<=s.length/3;j++)
list.add(model2.get(len2-j));
}
}
}
@Override
public int getValueInt(String n) {
// TODO Auto-generated method stub
String name[]=n.split(",");
String s=name[0];
int i=Integer.parseInt(s.substring(2, s.length()));
if(s.substring(0, 1).equals("5"))
i+=3;
if(s.substring(2, s.length()).equals("1")||s.substring(2, s.length()).equals("2"))
i+=13;
return i;
}
@Override
public void CardAlgorithmInterface(List<String> model, List<Card> player,
List<String> list, int role, int dizhuFlag) {
// TODO Auto-generated method stub
}
}
| [
"14281091@bjtu.edu.cn"
] | 14281091@bjtu.edu.cn |
ad0a8b0909a7acf777b242279470ade64aa475f1 | e010ebd33bbe7de8c5509bbdf967ed12a7f12695 | /src/main/java/com/wavemaker/tests/listeners/ThreadIdConverter.java | 4e2bca397beac5e561954dd221fa411ea4b572c1 | [] | no_license | saibonala/SampleTestNGProject | cb343c0a0c3c0f9ae464f3131f879db6a1cc9895 | 7fc83d35e657d303c0df60176bba441108e581ed | refs/heads/master | 2020-04-27T12:01:22.301078 | 2019-03-07T14:56:39 | 2019-03-07T14:56:39 | 174,318,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package com.wavemaker.tests.listeners;
import java.util.concurrent.atomic.AtomicInteger;
import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
/**
* Created by Tejaswi Maryala on 10/11/2018.
*/
public class ThreadIdConverter extends ClassicConverter {
private static AtomicInteger atomicInteger = new AtomicInteger();
private static final ThreadLocal<String> threadId = ThreadLocal.withInitial(() -> {
String format = String.format("%05d", atomicInteger.incrementAndGet());
System.out.println("Hello " + format);
return format;
});
@Override
public String convert(ILoggingEvent event) {
return threadId.get();
}
}
| [
"tejaswi.maryala@wavemaker.com"
] | tejaswi.maryala@wavemaker.com |
c54ad29b563b3d6fd849cb8b2d41fc2b4d92a9ba | cf18caf4907bd32b62c5b3c5a11de8ffd16acdc2 | /src/test/java/uk/ac/ebi/pride/spectracluster/cdf/NumberOfComparisonsAssessorTests.java | 15653b0f501f11ad8530a957ccdbbfb3ff60bd06 | [
"Apache-2.0"
] | permissive | zhengjiewhu/spectra-cluster | a5dc963298df88de35f4fe0750811c82f59427dd | 563d30b27ed8020403c60af15a0f5d8265708bf9 | refs/heads/master | 2020-05-01T17:56:40.619513 | 2018-08-28T15:18:28 | 2018-08-28T15:18:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,627 | java | package uk.ac.ebi.pride.spectracluster.cdf;
import junit.framework.Assert;
import org.junit.Test;
import uk.ac.ebi.pride.spectracluster.cluster.ICluster;
import uk.ac.ebi.pride.spectracluster.cluster.SpectralCluster;
import uk.ac.ebi.pride.spectracluster.consensus.ConsensusSpectrum;
import uk.ac.ebi.pride.spectracluster.spectrum.IPeak;
import java.util.ArrayList;
import java.util.List;
/**
* Created by jg on 13.10.17.
*/
public class NumberOfComparisonsAssessorTests {
@Test
public void testMinNumberComparisonAssessor() {
INumberOfComparisonAssessor assessor = new MinNumberComparisonsAssessor(5000);
Assert.assertEquals(5000, assessor.getNumberOfComparisons(null, 5));
Assert.assertEquals(7000, assessor.getNumberOfComparisons(null, 7000));
}
@Test
public void testSpectraPerBinNumberComparisonsAssessor() {
SpectraPerBinNumberComparisonAssessor assessor = new SpectraPerBinNumberComparisonAssessor(2F);
float[] existingPrecursors = {1F, 2F, 3F, 4F, 5F, 6F, 10F, 11F, 15F, 18F};
for (float prec : existingPrecursors) {
assessor.countSpectrum(prec);
}
List<IPeak> peaklist = new ArrayList<IPeak>();
ICluster cluster = new SpectralCluster("test", new ConsensusSpectrum("est", 1, 2,
2, 2, peaklist, 0.0F));
Assert.assertEquals(2, assessor.getNumberOfComparisons(cluster, 4));
cluster = new SpectralCluster("test", new ConsensusSpectrum("est", 1, 18,
2, 2, peaklist, 0.0F));
Assert.assertEquals(1, assessor.getNumberOfComparisons(cluster, 1));
}
}
| [
"jgriss8@yahoo.com"
] | jgriss8@yahoo.com |
09fb3dcbec30d3ace856861bdd7e835815d8de81 | cc20ff530872ce0698f363d5eb78a8161a661e01 | /app/src/main/java/com/example/rickh/weatherapp/data/Item.java | 23928f2b49ddda80677f89198a6aa5ba5281e7c1 | [] | no_license | RickHuisman/WeatherApp | 3fcfa85ba91e9f933e6fd558673776e6df22b3c3 | 275d1395ae8f06ada0c1e2aeeb1d756e0f4dab6f | refs/heads/master | 2019-07-18T19:59:46.242183 | 2017-12-20T18:40:58 | 2017-12-20T18:40:58 | 72,981,638 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,121 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2015 Yoel Nunez <dev@yoelnunez.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
package com.example.rickh.weatherapp.data;
import org.json.JSONException;
import org.json.JSONObject;
public class Item implements JSONPopulator {
private Condition condition;
private Forecast forecast;
public Forecast getForecast() {
return forecast;
}
public Condition getCondition() {
return condition;
}
@Override
public void populate(JSONObject data) throws JSONException {
condition = new Condition();
forecast = new Forecast();
condition.populate(data.optJSONObject("condition"));
forecast.populate(data.optJSONArray("forecast"));
}
@Override
public JSONObject toJSON() {
JSONObject data = new JSONObject();
try {
data.put("condition", condition.toJSON());
data.put("forecast", forecast.toJSON());
} catch (JSONException e) {
e.printStackTrace();
}
return data;
}
}
| [
"rick.huisman@live.nl"
] | rick.huisman@live.nl |
7f41ef56950d40a2b0e94f11af29903f1decaa1e | 8630a7dcbbad52cc4bc1a5e2e8771b80f698efdd | /packages/apps/EngineerMode/src/com/mediatek/engineermode/swla/SwlaActivity.java | a9f6511f199d22b845466d2ebb252ae5ea81baa2 | [
"Apache-2.0"
] | permissive | ferhung/android_mediatek_lenovo | c1405092e32fce6577dbea2579bccba596f0af85 | 52c949c07ef2936ea24ec7f01eb0bcdd593d9ec3 | refs/heads/cm-11.0 | 2021-01-22T12:44:26.346450 | 2014-09-22T03:41:53 | 2014-09-22T03:41:53 | 38,955,719 | 0 | 2 | null | 2015-07-12T08:53:44 | 2015-07-12T08:53:44 | null | UTF-8 | Java | false | false | 5,562 | java | /* Copyright Statement:
*
* This software/firmware and related documentation ("MediaTek Software") are
* protected under relevant copyright laws. The information contained herein is
* confidential and proprietary to MediaTek Inc. and/or its licensors. Without
* the prior written permission of MediaTek inc. and/or its licensors, any
* reproduction, modification, use or disclosure of MediaTek Software, and
* information contained herein, in whole or in part, shall be strictly
* prohibited.
*
* MediaTek Inc. (C) 2010. All rights reserved.
*
* BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO RECEIVER
* ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
* WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
* NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
* RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
* INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK SOFTWARE, AND RECEIVER AGREES
* TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
* RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
* OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
* SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
* RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
* STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
* ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE
* RELEASED HEREUNDER WILL BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE
* MEDIATEK SOFTWARE AT ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE
* CHARGE PAID BY RECEIVER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* The following software/firmware and/or related documentation ("MediaTek
* Software") have been modified by MediaTek Inc. All revisions are subject to
* any receiver's applicable license agreements with MediaTek Inc.
*/
package com.mediatek.engineermode.swla;
import android.app.Activity;
import android.app.AlertDialog;
import android.os.AsyncResult;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.mediatek.engineermode.Elog;
import com.mediatek.engineermode.R;
public class SwlaActivity extends Activity {
private Phone mPhone = null;
private static final int MSG_ASSERT = 1;
private static final int MSG_SWLA_ENABLE = 2;
private static final String TAG = "SWLA";
private final Handler mATCmdHander = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
AsyncResult ar;
switch (msg.what) {
case MSG_ASSERT:
ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
Toast.makeText(SwlaActivity.this, "Assert Modem Success.", Toast.LENGTH_LONG).show();
} else {
new AlertDialog.Builder(SwlaActivity.this).setTitle("Failed").setMessage("Assert Modem Failed.")
.setPositiveButton("OK", null).show();
Toast.makeText(SwlaActivity.this, "Failed.", Toast.LENGTH_LONG).show();
}
break;
case MSG_SWLA_ENABLE:
ar = (AsyncResult) msg.obj;
if (ar.exception == null) {
Toast.makeText(SwlaActivity.this, "Success", Toast.LENGTH_LONG).show();
} else {
new AlertDialog.Builder(SwlaActivity.this).setTitle("Failed").setMessage("Enable Softwore LA Failed.")
.setPositiveButton("OK", null).show();
Toast.makeText(SwlaActivity.this, "Failed.", Toast.LENGTH_LONG).show();
}
break;
default:
break;
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.swla_activity);
Button mAssert = (Button) findViewById(R.id.swla_assert_btn);
Button mSwla = (Button) findViewById(R.id.swla_swla_btn);
mAssert.setOnClickListener(new ButtonListener());
mSwla.setOnClickListener(new ButtonListener());
mPhone = PhoneFactory.getDefaultPhone();
}
class ButtonListener implements View.OnClickListener {
public void onClick(View v) {
switch (v.getId()) {
case R.id.swla_assert_btn:
sendATCommad("0", MSG_ASSERT);
break;
case R.id.swla_swla_btn:
sendATCommad("1", MSG_SWLA_ENABLE);
break;
default:
break;
}
}
};
private void sendATCommad(String str, int message) {
String aTCmd[] = new String[2];
aTCmd[0] = "AT+ESWLA=" + str;
aTCmd[1] = "";
mPhone.invokeOemRilRequestStrings(aTCmd, mATCmdHander.obtainMessage(message));
Elog.i(TAG, "Send ATCmd : " + aTCmd[0]);
}
}
| [
"idontknw.wang@gmail.com"
] | idontknw.wang@gmail.com |
d5e0120ade6f0e35fba9f7df6f33514b73bb1523 | d4823fb6e2425642d878b24ee595fe9c28d68129 | /springboot_demo01/src/main/java/com/action/Hellospring_boot.java | 16330c2286075d15086ba0ec57fe163b37a0c2d4 | [] | no_license | islandlxl/springbootStudy | 7ed0a13ad4946979370bef604c18168bab0681d3 | 3e4712d49136c822d74599e9bb25be57540514c6 | refs/heads/master | 2023-09-03T22:25:40.784047 | 2023-08-24T03:02:41 | 2023-08-24T03:02:41 | 238,632,764 | 1 | 0 | null | 2023-08-01T02:48:16 | 2020-02-06T07:37:28 | Java | UTF-8 | Java | false | false | 1,217 | java | package com.action;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/*
@project:com.action
@Title:Hellospring_boot
@Auther:lxl
@create:2018/12/10,12:02
*/
@Controller
public class Hellospring_boot {
@ResponseBody
@RequestMapping("/hello")
public String demo(){
return "hello spring-boot....";
}
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
new Thread(new Runnable() {
@Override
public void run() {
System.out.println(Thread.currentThread().getName()+"--------");
Hellospring_boot instance = getInstance();
System.out.println(instance);
}
},"t"+i).start();
}
}
private static Hellospring_boot hellospring_boot;
public static Hellospring_boot getInstance(){
if (hellospring_boot==null){
hellospring_boot=new Hellospring_boot();
}
return hellospring_boot;
}
}
| [
"569881564@qq.com"
] | 569881564@qq.com |
fbb5d6d9e6de25226fdd02a0a8037fb1f7c30f7a | 3d26e5040bc4887882e9f8061c08d30ad40c2393 | /shop_feign/src/main/java/com/qf/feign/CartFeign.java | f17504c8a24b3bd7987725afd24980ce028001bd | [] | no_license | Hthbryant/shop1906_hth | 52edd6cf07cf418f18e3ce0a0289e3448c63306b | 01b11bf7f501a5e7b17ae11691df8235e832e13f | refs/heads/master | 2020-08-08T19:43:59.159934 | 2019-11-07T04:37:17 | 2019-11-07T04:37:17 | 213,901,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 553 | java | package com.qf.feign;
import com.qf.entity.Shopcart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient("web-cart")
public interface CartFeign {
@RequestMapping("/cart/getCartByIds")
List<Shopcart> getCartByIds(@RequestParam("uid") Integer uid,@RequestParam("ids") Integer[] ids);
@RequestMapping("/cart/deleteById")
int deleteById(@RequestParam("id") Integer id);
}
| [
"1635618490@qq.com"
] | 1635618490@qq.com |
9f23e5a85c051e9b50db6f8ae22056548eaa9550 | 26eb3ee5670864b47ec3dc8139da25ed1c4fbce2 | /src/main/java/ru/ivmiit/web/forms/PublisherForm.java | c46d4cc438ac041f89ea5c170a6ff523bb290289 | [] | no_license | bairamovazat/BookMarket | 164366357fe4e787e31c0fd13587e3b7af6c0747 | 37087413667f46cecf9e979c332429f14b265ce1 | refs/heads/master | 2020-05-09T11:07:00.227532 | 2019-04-25T22:09:32 | 2019-04-25T22:09:32 | 181,067,334 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 274 | java | package ru.ivmiit.web.forms;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class PublisherForm {
private Long id;
private String name;
}
| [
"Bairamovazat@gmail.com"
] | Bairamovazat@gmail.com |
3b894532ab02c04461a1ebec5279bfe38e14f8b9 | 544b874087e43392aebf047189048c1e035d60f8 | /Timetable/src/com/timetable/dao/StudentDAOImpl.java | f349d984d5cefe5f85a514ffce5284c06f693a45 | [] | no_license | ilinca1996/timetable | 1516959ca86719b8d074ff435ad7ede66800ec1a | 0d23ee699e593c9785a1d1dd6df40c4b7a8e1097 | refs/heads/master | 2022-12-28T23:21:48.613937 | 2020-03-23T19:33:41 | 2020-03-23T19:33:41 | 221,931,969 | 0 | 0 | null | 2022-12-15T23:26:02 | 2019-11-15T13:42:18 | Java | UTF-8 | Java | false | false | 1,417 | java | package com.timetable.dao;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.timetable.model.Student;
import com.timetable.model.Subject;
@Repository
public class StudentDAOImpl implements StudentDAO{
@Autowired
private SessionFactory sessionFactory;
@Override
public List<Student> getStudents() {
Session session = sessionFactory.getCurrentSession();
Query<Student> theQuery = session.createQuery("from Student order by lastName", Student.class);
return theQuery.getResultList();
}
@Override
public void saveStudent(Student student) {
Session session = sessionFactory.getCurrentSession();
session.saveOrUpdate(student);
}
@Override
public List<Student> getStudentsByGroup(int groupId) {
Session session = sessionFactory.getCurrentSession();
Query<Student> theQuery = session.createQuery("from Student s where s.group=" + groupId + " order by lastName", Student.class);
return theQuery.getResultList();
}
@Override
public Student getStudentById(int studentId) {
Session session = sessionFactory.getCurrentSession();
Student student = session.get(Student.class, studentId);
return student;
}
}
| [
"tazla@DESKTOP-JVIM7L5.home"
] | tazla@DESKTOP-JVIM7L5.home |
087d410e148b3cadf948658950d04c0d8879bac7 | 63adf607491000b06f88a67f34e3237ab8399274 | /src/main/java/com/wallet/logger/MessageFormatter.java | 3350a93cf2f11cb5a51bf1f01b4dfa6fcc5b1fa7 | [] | no_license | LucasManciniDaSilva/walletAPI | 18ab39706fd9913893180215538b86d034871959 | bb33fe4f1df9654ea4629c0fb902f9e5cea7068b | refs/heads/master | 2020-08-10T07:24:29.094190 | 2020-01-13T11:10:36 | 2020-01-13T11:10:36 | 214,292,405 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 139 | java | package com.wallet.logger;
public interface MessageFormatter {
boolean handle(String message);
String format(String message);
}
| [
"Lucas.mancini@sensedia.com"
] | Lucas.mancini@sensedia.com |
d561ffc914e9f476fcef284e7f87f4bbefdcb328 | a6e8e40617e7c62ac3a605528eeb05fadea730a3 | /training/src/leetcode/_143_reorderList.java | 70ea7abd07a046d2506e0001c0296fbd7a11f3bf | [] | no_license | Deadpool110/Leetcode | 8f60cfbd13f15dae889b1e0385495d7daef70eca | a47ae23e21c0590f5884c6097bb59539bf8db610 | refs/heads/master | 2023-08-18T15:12:17.066031 | 2021-09-26T02:29:40 | 2021-09-26T02:29:40 | 206,506,282 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,494 | java | package leetcode;
import java.util.*;
public class _143_reorderList {
public void reorderList(ListNode head) {
if (head != null) {
Stack<ListNode> stack = new Stack<>();
ListNode tmp = new ListNode(head.val, head.next);
int i = 0;
while (tmp != null) {
stack.push(tmp);
tmp = tmp.next;
i++;
}
tmp = head;
while (i > 1) {
ListNode a = tmp.next;
tmp.next = stack.pop();
tmp.next.next = a;
tmp = tmp.next.next;
i -= 2;
}
tmp.next = null;
}
}
public void reorderList2(ListNode head) {
if (head == null) {
return;
}
List<ListNode> list = new ArrayList<ListNode>();
ListNode node = head;
while (node != null) {
list.add(node);
node = node.next;
}
int i = 0, j = list.size() - 1;
while (i < j) {
list.get(i).next = list.get(j);
i++;
if (i == j) {
break;
}
list.get(j).next = list.get(i);
j--;
}
list.get(i).next = null;
}
public void reorderList3(ListNode head) {
if (head == null) {
return;
}
ListNode mid = middleNode(head);
ListNode l1 = head;
ListNode l2 = mid.next;
mid.next = null;
l2 = reverseList(l2);
mergeList(l1, l2);
}
public ListNode middleNode(ListNode head) {
ListNode slow = head;
ListNode fast = head;
while (fast.next != null && fast.next.next != null) {
slow = slow.next;
fast = fast.next.next;
}
return slow;
}
public ListNode reverseList(ListNode head) {
ListNode prev = null;
ListNode curr = head;
while (curr != null) {
ListNode nextTemp = curr.next;
curr.next = prev;
prev = curr;
curr = nextTemp;
}
return prev;
}
public void mergeList(ListNode l1, ListNode l2) {
ListNode l1_tmp;
ListNode l2_tmp;
while (l1 != null && l2 != null) {
l1_tmp = l1.next;
l2_tmp = l2.next;
l1.next = l2;
l1 = l1_tmp;
l2.next = l1;
l2 = l2_tmp;
}
}
}
| [
"xin_pengpeng@bupt.edu.cn"
] | xin_pengpeng@bupt.edu.cn |
63f0c542ebebd276a1c8f7556304b9d1ba7c0c04 | 90fe57c04be6623923dc50d93bc9e4c86360107e | /java8.ayush/src/main/java/java8/ayush/assignment6/Main.java | f2e77157e04c954692ef01a4deb218093089c9db | [] | no_license | 7ayush7/repo2 | cb8803077ca6c3bc50d60bb89ea9cf4fd7089adc | aaf1c964fcff20e91158e0dad19cf037c4cc999f | refs/heads/master | 2023-03-26T19:30:13.282565 | 2021-03-24T15:05:31 | 2021-03-24T15:05:31 | 258,572,560 | 2 | 0 | null | 2020-10-13T22:13:26 | 2020-04-24T17:00:54 | Java | WINDOWS-1252 | Java | false | false | 2,029 | java | package java8.ayush.assignment6;
import java.util.ArrayList;
import java.util.List;
/**
* @author ayush.singh
*
* JDK 8 : Assignment 6 – Using lambda
return a lambda expression performing a specified action:
• PerformOperation isOdd(): The lambda expression must return true if a number is odd or false if it is even.
• PerformOperation isPrime(): The lambda expression must return true if a number is prime or false if it is composite.
• PerformOperation isPalindrome(): The lambda expression must return true if a number is a palindrome or false if it is not.
Input : list of integers
* */
@FunctionalInterface
interface Check {
public boolean condition(int num);
}
public class Main {
public static void main(String[] args) {
List<Integer> list = new ArrayList<Integer>();
for(int i=1;i<100;i++) {
list.add(i);
}
Check c = (int num)->{
return num%2!=0?Boolean.TRUE:Boolean.FALSE;
};
isOdd(list,c);
}
private static boolean isPallindrome(int num,Check c) {
System.out.println(num+": Is Pallindrome : "+c.condition(num));
return c.condition(num);
}
private static boolean isPrime(int c, Check check) {
System.out.println(c+": Is Prime : "+check.condition(c));
boolean t = check.condition(c)?Boolean.TRUE:isPallindrome(c,(int num)->{
int backup = num;
int sum = 0;
int rem = 0;
while(num>0) {
rem = num%10;
sum=sum*10+rem;
num=num/10;
}
return backup==sum?Boolean.TRUE:Boolean.FALSE;
});
return t;
}
private static void isOdd(List<Integer> list, Check c) {
for(int i:list) {
int val = i;
System.out.println(i+": Is Odd : "+c.condition(i));
boolean t = c.condition(i)?Boolean.TRUE:isPrime(i, (int num)->{
boolean isPrime = true;
if(num<2) {
isPrime=false;
}
else {
for(int j=2;j<num;j++) {
if(num%j==0 && num!=j) {
isPrime=false;
}
}
}
return isPrime;
});
}
}
}
| [
"7ayush7@gmail.com"
] | 7ayush7@gmail.com |
2e177757f455b2523909f97d12c0479ac6ce0ccb | 92e36f1d8716c258b1977f8571c98975c8d64a61 | /src/Convex/Figure.java | 5cfac213be41b5136dd16de918abd3b959b57e9b | [] | no_license | SneakBug8/mpoly-programming-spring-2020 | ffe4996ba4a27dff1297022624e3a94e1a96b6fb | 3c4d42313cc426de54a12225426f280bbba17fd0 | refs/heads/master | 2021-01-02T20:02:08.254629 | 2020-05-25T22:00:53 | 2020-05-25T22:00:53 | 239,778,282 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 254 | java | package Convex;
import java.awt.*;
//Интерфейс, задающий новый тип - фигуру.
interface Figure{
public double perimeter();
public double area();
public Figure add(R2Point p);
public void draw(Graphics g);
} | [
"sneakbug8@gmail.com"
] | sneakbug8@gmail.com |
332b04a12048829f8180826761fa2d5f33fe2a83 | 8668d5cbf445aa686cc6645be79e25bb822cc149 | /Factorial of a number/Main.java | bf4fa7f2fcab963e1c05f5a4f32a92f7c42e7d5b | [] | no_license | SanjayHullyal/Playground | 43116a62b09835adacd4dc34c4ae741231c2e479 | 0f534096f3844508164192e366c18dcb9e0eef56 | refs/heads/master | 2021-05-25T18:09:22.554931 | 2020-05-31T05:42:13 | 2020-05-31T05:42:13 | 253,862,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 148 | java | #include<iostream>
int main(){
// Type your code here
int n,sum=1;
std::cin>>n;
for(int i=1;i<=n;i++){
sum=sum*i;
}
std::cout<<sum;
} | [
"63310589+SanjayHullyal@users.noreply.github.com"
] | 63310589+SanjayHullyal@users.noreply.github.com |
bbe2353e782bad731a19018ad379d1b1b341e3cd | 59b5e53756d08df9d8de2ad7f38ba9de47723243 | /Final_Proj/src/Visitor.java | d22fc8afdcc4e4d399310fa261545222f3de0745 | [] | no_license | b5710547221/project | f83d5253496a308662b94bee24643fdc08ade8ea | adf57169c22030ebd33b191d92650f3c6719c8b3 | refs/heads/master | 2020-12-24T20:14:38.904512 | 2016-05-10T09:54:54 | 2016-05-10T09:54:54 | 58,449,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 664 | java |
//public class EvalVisitor {
//
// public int visit(Exp e){
// if(e instanceof PlusExp){
// PlusExp t = (PlusExp) e;
// return visit(t.getLeft())+visit(t.getRight());
// }else if(e instanceof MinusExp){
// PlusExp t = (PlusExp) e;
// return visit(t.getLeft())-visit(t.getRight());
// }else if(e instanceof Number){
// Number t = (Number) e;
// return Integer.parseInt(t.getValue());
// }
// }
//}
public interface Visitor{
public Object visit(PlusExp n);
public Object visit(MinusExp n);
public Object visit(multiExp n);
public Object visit(divideExp n);
public Object visit(Number n);
public Object visit(VarExp n);
} | [
"warat.n@ku.th"
] | warat.n@ku.th |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.