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
9910c090bd361c679e26d30719aac4102a90224e
8018ce0a6cc362bb82b89fdd420516de853941c7
/32-spring-boot-redis-cache/src/main/java/com/gzz/study/sys/syslog/SysLogDao.java
0b4390a6ad3e50f01ffa28dd5d9d08a0b44e5bc2
[]
no_license
user3614/spring-boot-examples
da8ddf4507f166631f20965c519e6824d60790d5
f61e2f446901dcab95d14c830824adceb215ae15
refs/heads/master
2023-04-15T08:51:37.062215
2021-04-09T10:50:23
2021-04-09T10:50:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,754
java
package com.gzz.study.sys.syslog; import java.util.List; import org.springframework.jdbc.core.BeanPropertyRowMapper; import org.springframework.stereotype.Repository; import com.gzz.common.base.BaseDao; import com.gzz.common.base.Page; import lombok.extern.slf4j.Slf4j; /** * @类说明 【请求日志】数据访问层 * @author 高振中 * @date 2020-03-12 12:11:06 **/ @Slf4j @Repository public class SysLogDao extends BaseDao { /** * @方法说明 新增【请求日志】记录 */ public int save(SysLog vo) { StringBuilder sql = new StringBuilder(); sql.append("INSERT INTO sys_log (id,client_ip,uri,type,method,param_data,session_id,request_time,"); sql.append("return_time,return_data,status_code,cost_time)"); sql.append(" VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"); Object[] params = { vo.getId(), vo.getClient_ip(), vo.getUri(), vo.getType(), vo.getMethod(), vo.getParam_data(), vo.getSession_id(), vo.getRequest_time(), // 太长换行 vo.getReturn_time(), vo.getReturn_data(), vo.getStatus_code(), vo.getCost_time() }; // log.info(super.sql(sql.toString(), params));// 显示SQL语句 return jdbcTemplate.update(sql.toString(), params); } /** * @方法说明 删除【请求日志】记录 */ public int delete(Object[] ids) { String sql = "DELETE FROM sys_log WHERE id IN" + toIn(ids); // log.info(super.sql(sql, ids));// 显示SQL语句 return jdbcTemplate.update(sql, ids); } /** * @方法说明 更新【请求日志】记录 */ public int update(SysLog vo) { StringBuilder sql = new StringBuilder(); sql.append("UPDATE sys_log SET client_ip=?,uri=?,type=?,method=?,param_data=?,session_id=?,request_time=?,return_time=?,"); sql.append("return_data=?,status_code=?,cost_time=?"); sql.append(" WHERE id=? "); Object[] params = { vo.getClient_ip(), vo.getUri(), vo.getType(), vo.getMethod(), vo.getParam_data(), vo.getSession_id(), vo.getRequest_time(), vo.getReturn_time(), // 太长换行 vo.getReturn_data(), vo.getStatus_code(), vo.getCost_time(), vo.getId() }; // log.info(super.sql(sql.toString(), params));// 显示SQL语句 return jdbcTemplate.update(sql.toString(), params); } /** * @方法说明 按条件查询分页【请求日志】列表 */ public Page<SysLog> page(SysLogCond cond) { StringBuilder sql = new StringBuilder(); sql.append("SELECT t.id,t.client_ip,t.uri,t.type,t.method,t.param_data,t.session_id,t.request_time,"); sql.append("t.return_time,t.return_data,t.status_code,t.cost_time"); sql.append(" FROM sys_log t"); sql.append(cond.where()); log.info(super.sql(sql.toString(), cond.array()));// 显示SQL语句 return queryPage(sql.toString(), cond, SysLog.class); } /** * @方法说明 按条件查询不分页【请求日志】列表 */ public List<SysLog> list(SysLogCond cond) { StringBuilder sql = new StringBuilder(); sql.append("SELECT t.id,t.client_ip,t.uri,t.type,t.method,t.param_data,t.session_id,t.request_time,"); sql.append("t.return_time,t.return_data,t.status_code,t.cost_time"); sql.append(" FROM sys_log t"); sql.append(cond.where()); sql.append(" ORDER BY id DESC"); // log.info(super.sql(sql.toString(),cond.array()));//显示SQL语句 return jdbcTemplate.query(sql.toString(), cond.array(), new BeanPropertyRowMapper<>(SysLog.class)); } /** * @方法说明 按主键查找单个【请求日志】记录 */ public SysLog findById(Integer id) { StringBuilder sql = new StringBuilder(); sql.append("SELECT t.id,t.client_ip,t.uri,t.type,t.method,t.param_data,t.session_id,t.request_time,"); sql.append("t.return_time,t.return_data,t.status_code,t.cost_time"); sql.append(" FROM sys_log t WHERE t.id=?"); // log.info(super.sql(sql.toString(),id));//显示SQL语句 return jdbcTemplate.queryForObject(sql.toString(), new BeanPropertyRowMapper<>(SysLog.class), id); } /** * @方法说明 按条件查询【请求日志】记录个数 */ public int count(SysLogCond cond) { String sql = "SELECT COUNT(1) FROM sys_log t " + cond.where(); // log.info(super.sql(sql,cond.array()));//显示SQL语句 return jdbcTemplate.queryForObject(sql, cond.array(), Integer.class); } /** * @方法说明 新增【请求日志】记录并返回自增涨主键值 */ public long saveReturnPK(SysLog vo) { StringBuilder sql = new StringBuilder(); sql.append("INSERT INTO sys_log (id,client_ip,uri,type,method,param_data,session_id,request_time,"); sql.append("return_time,return_data,status_code,cost_time)"); sql.append(" VALUES (:id,:client_ip,:uri,:type,:method,:param_data,:session_id,:request_time,"); sql.append(":return_time,:return_data,:status_code,:cost_time)"); // log.info(super.sql(sql.toString(), vo));// 显示SQL语句 return saveKey(vo, sql.toString(), "id"); } /** * @方法说明 批量插入【请求日志】记录 */ public int[] insertBatch(List<SysLog> list) { StringBuilder sql = new StringBuilder(); sql.append("INSERT INTO sys_log (id,client_ip,uri,type,method,param_data,session_id,request_time,"); sql.append("return_time,return_data,status_code,cost_time)"); sql.append(" VALUES (:id,:client_ip,:uri,:type,:method,:param_data,:session_id,:request_time,"); sql.append(":return_time,:return_data,:status_code,:cost_time)"); // log.info(super.sql(sql.toString(), list));// 显示SQL语句 return batchOperate(list, sql.toString()); } /** * @方法说明 逻辑删除【请求日志】记录 */ // public int delete(Object... ids) { // String sql = "UPDATE sys_log SET dr=1 WHERE id IN " + toIn(ids); // return jdbcTemplate.update(sql,ids); // } }
[ "2570613257@qq.com" ]
2570613257@qq.com
9703a0bd11c9c4ae70e034f760044bbf240077a8
1799f7deb35707cc5c20b4608b83428db5304d3c
/app/src/main/java/com/transverse/transverse/Dysphoria.java
78bf07416253430c00c4b0fa0813a6734244ddc1
[]
no_license
tchuanromanee/transverse
d3af8782bee36783308395d92d57210092861bc2
22e191047cf352dc40b6c3e84edb6e6fa5759ba2
refs/heads/master
2023-03-20T19:07:38.396074
2021-03-17T19:57:58
2021-03-17T19:57:58
269,770,280
0
0
null
null
null
null
UTF-8
Java
false
false
1,457
java
package com.transverse.transverse; import java.io.Serializable; public class Dysphoria implements Serializable { //private int type; private boolean isPhysical; private boolean isMental; private boolean isSocial; private int intensity; public Dysphoria() { isPhysical = false; isMental = false; isSocial = false; intensity = -1; } public Dysphoria(boolean isPhysical, boolean isMental, boolean isSocial, int intensity){ this.isPhysical = isPhysical; this.isMental = isMental; this.isSocial = isSocial; this.intensity = intensity; } public String toString() { String printString = ""; printString += "Type: " + "\n"; printString += "Intensity: " + intensity + "\n"; return printString; } public boolean isPhysical() { return isPhysical; } public void setPhysical(boolean isPhysical) { this.isPhysical = isPhysical; } public boolean isMental() { return isMental; } public void setMental(boolean isMental) { this.isMental = isMental; } public boolean isSocial() { return isSocial; } public void setSocial(boolean isSocial) { this.isSocial = isSocial; } public int getIntensity() { return intensity; } public void setIntensity(int intensity) { this.intensity = intensity; } }
[ "tchuanro@nd.edu" ]
tchuanro@nd.edu
5d6cb6fcff5dc0c1396597e584d51a522c583198
ae652ef9816665ffa9e5991452f29f50311425b0
/hell-ml/src/main/java/ps/hell/ml/graph/AdjacencyMatrix.java
3745db4a280cc7d1865f3c1df204d04435abf5e7
[]
no_license
qqgirllianxin/hell
97620a7657d48136113a789d97178bff9427875f
20080083b9efd160348471552b2cfb8661871db3
refs/heads/master
2021-01-13T14:13:09.394986
2016-09-30T12:26:26
2016-09-30T12:26:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
17,494
java
/******************************************************************************* * Copyright (c) 2010 Haifeng Li * * 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 ps.hell.ml.graph; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.Queue; import ps.hell.math.base.MathBase; import ps.hell.base.struct.PriorityQueue; /** * 图的邻接矩阵表示。只支持简单的图 * An adjacency matrix representation of a graph. Only simple graph is supported. * * @author Haifeng Li */ public class AdjacencyMatrix implements Graph { /** * The number of vertices. */ private int n; /** * Is the graph directed? */ private boolean digraph; /** * Adjacency matrix. Non-zero values are the weights of edges. */ private double[][] graph; /** * Constructor. * * @param n the number of vertices. */ public AdjacencyMatrix(int n) { this(n, false); } /** * Constructor. * * @param n the number of vertices. * @param digraph true if this is a directed graph. */ public AdjacencyMatrix(int n, boolean digraph) { this.n = n; this.digraph = digraph; graph = new double[n][n]; } @Override public int getNumVertices() { return n; } @Override public boolean hasEdge(int source, int target) { return graph[source][target] != 0.0; } @Override public double getWeight(int source, int target) { return graph[source][target]; } @Override public void setWeight(int source, int target, double weight) { graph[source][target] = weight; if (!digraph) { graph[target][source] = weight; } } @Override public Collection<Edge> getEdges() { Collection<Edge> set = new LinkedList<Edge>(); if (digraph) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (graph[i][j] != 0.0) { Edge edge = new Edge(); edge.v1 = i; edge.v2 = j; edge.weight = graph[i][j]; set.add(edge); } } } } else { for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { if (graph[i][j] != 0.0) { Edge edge = new Edge(); edge.v1 = i; edge.v2 = j; edge.weight = graph[i][j]; set.add(edge); } } } } return set; } @Override public Collection<Edge> getEdges(int vertex) { Collection<Edge> set = new LinkedList<Edge>(); for (int j = 0; j < n; j++) { if (graph[vertex][j] != 0.0) { Edge edge = new Edge(); edge.v1 = vertex; edge.v2 = j; edge.weight = graph[vertex][j]; set.add(edge); } } return set; } @Override public Collection<Edge> getEdges(int source, int target) { Collection<Edge> set = new LinkedList<Edge>(); Edge edge = getEdge(source, target); if (edge != null) { set.add(edge); } return set; } @Override public Edge getEdge(int source, int target) { if (graph[source][target] == 0.0) { return null; } Edge edge = new Edge(); edge.v1 = source; edge.v2 = target; edge.weight = graph[source][target]; return edge; } @Override public void addEdge(int source, int target) { if (digraph) { if (graph[source][target] == 0.0) { graph[source][target] = 1.0; } } else { if (graph[source][target] == 0.0) { graph[source][target] = 1.0; graph[target][source] = 1.0; } } } @Override public void addEdge(int source, int target, double weight) { if (digraph) { graph[source][target] = weight; } else { graph[source][target] = weight; graph[target][source] = weight; } } @Override public void removeEdges(Collection<Edge> edges) { Iterator<Edge> iter = edges.iterator(); while (iter.hasNext()) { removeEdge(iter.next()); } } @Override public void removeEdge(int source, int target) { if (digraph) { graph[source][target] = 0.0; } else { graph[source][target] = 0.0; graph[target][source] = 0.0; } } @Override public void removeEdge(Edge edge) { removeEdge(edge.v1, edge.v2); } @Override public int getDegree(int vertex) { if (digraph) { return getIndegree(vertex) + getOutdegree(vertex); } else { return getOutdegree(vertex); } } @Override public int getIndegree(int vertex) { int degree = 0; for (int i = 0; i < n; i++) { if (graph[i][vertex] != 0.0) { degree++; } } return degree; } @Override public int getOutdegree(int vertex) { int degree = 0; for (int j = 0; j < n; j++) { if (graph[vertex][j] != 0.0) { degree++; } } return degree; } /** * Depth-first search of graph. * @param v the start vertex. * @param pre the array to store the order that vertices will be visited. * @param ts the array to store the reverse topological order. * @param count the number of vertices have been visited before this search. * @return the number of vertices that have been visited after this search. */ private int dfsearch(int v, int[] pre, int[] ts, int count) { pre[v] = 0; for (int t = 0; t < n; t++) { if (graph[v][t] != 0.0 && pre[t] == -1) { count = dfsearch(t, pre, ts, count); } } ts[count++] = v; return count; } @Override public int[] sortdfs() { if (!digraph) { throw new UnsupportedOperationException("Topological sort is only meaningful for digraph."); } int count = 0; int[] pre = new int[n]; int[] ts = new int[n]; for (int i = 0; i < n; i++) { pre[i] = -1; ts[i] = -1; } for (int i = 0; i < n; i++) { if (pre[i] == -1) { count = dfsearch(i, pre, ts, count); } } return ts; } /** * Depth-first search connected components of graph. * @param v the start vertex. * @param cc the array to store the connected component id of vertices. * @param id the current component id. */ private void dfs(int v, int[] cc, int id) { cc[v] = id; for (int t = 0; t < n; t++) { if (graph[v][t] != 0.0) { if (cc[t] == -1) { dfs(t, cc, id); } } } } @Override public int[][] dfs() { int[] cc = new int[n]; Arrays.fill(cc, -1); int id = 0; for (int i = 0; i < n; i++) { if (cc[i] == -1) { dfs(i, cc, id++); } } int[] size = new int[id]; for (int i = 0; i < n; i++) { size[cc[i]]++; } int[][] components = new int[id][]; for (int i = 0; i < id; i++) { components[i] = new int[size[i]]; for (int j = 0, k = 0; j < n; j++) { if (cc[j] == i) { components[i][k++] = j; } } Arrays.sort(components[i]); } return components; } /** * Depth-first search of graph. * @param v the start vertex. * @param cc the array to store the connected component id of vertices. * @param id the current component id. */ private void dfs(Visitor visitor, int v, int[] cc, int id) { visitor.visit(v); cc[v] = id; for (int t = 0; t < n; t++) { if (graph[v][t] != 0.0) { if (cc[t] == -1) { dfs(visitor, t, cc, id); } } } } @Override public void dfs(Visitor visitor) { int[] cc = new int[n]; Arrays.fill(cc, -1); int id = 0; for (int i = 0; i < n; i++) { if (cc[i] == -1) { dfs(visitor, i, cc, id++); } } } @Override public int[] sortbfs() { if (!digraph) { throw new UnsupportedOperationException("Topological sort is only meaningful for digraph."); } int[] in = new int[n]; int[] ts = new int[n]; for (int i = 0; i < n; i++) { ts[i] = -1; for (int v = 0; v < n; v++) { if (graph[i][v] != 0.0) { in[v]++; } } } Queue<Integer> queue = new LinkedList<Integer>(); for (int i = 0; i < n; i++) { if (in[i] == 0) { queue.offer(i); } } for (int i = 0; queue.size() > 0; i++) { int t = queue.poll(); ts[i] = t; for (int v = 0; v < n; v++) { if (graph[t][v] != 0.0) { if (--in[v] == 0) { queue.offer(v); } } } } return ts; } /** * Breadth-first search connected components of graph. * @param v the start vertex. * @param cc the array to store the connected component id of vertices. * @param id the current component id. */ private void bfs(int v, int[] cc, int id) { cc[v] = id; Queue<Integer> queue = new LinkedList<Integer>(); queue.offer(v); while (queue.size() > 0) { int t = queue.poll(); for (int i = 0; i < n; i++) { if (graph[t][i] != 0.0 && cc[i] == -1) { queue.offer(i); cc[i] = id; } } } } @Override public int[][] bfs() { int[] cc = new int[n]; Arrays.fill(cc, -1); int id = 0; for (int i = 0; i < n; i++) { if (cc[i] == -1) { bfs(i, cc, id++); } } int[] size = new int[id]; for (int i = 0; i < n; i++) { size[cc[i]]++; } int[][] components = new int[id][]; for (int i = 0; i < id; i++) { components[i] = new int[size[i]]; for (int j = 0, k = 0; j < n; j++) { if (cc[j] == i) { components[i][k++] = j; } } Arrays.sort(components[i]); } return components; } /** * Breadth-first search of graph. * @param v the start vertex. * @param cc the array to store the connected component id of vertices. * @param id the current component id. */ private void bfs(Visitor visitor, int v, int[] cc, int id) { visitor.visit(v); cc[v] = id; Queue<Integer> queue = new LinkedList<Integer>(); queue.offer(v); while (queue.size() > 0) { int t = queue.poll(); for (int i = 0; i < n; i++) { if (graph[t][i] != 0.0 && cc[i] == -1) { visitor.visit(i); queue.offer(i); cc[i] = id; } } } } @Override public void bfs(Visitor visitor) { int[] cc = new int[n]; Arrays.fill(cc, -1); int id = 0; for (int i = 0; i < n; i++) { if (cc[i] == -1) { bfs(visitor, i, cc, id++); } } } @Override public double[] dijkstra(int s) { return dijkstra(s, true); } /** * Calculates the shortest path by Dijkstra algorithm. * @param s The source vertex. * @param weighted True to calculate weighted path. Otherwise, the edge weights will be ignored. * @return The distance to all vertices from the source. */ public double[] dijkstra(int s, boolean weighted) { double[] wt = new double[n]; Arrays.fill(wt, Double.POSITIVE_INFINITY); PriorityQueue queue = new PriorityQueue(wt); for (int v = 0; v < n; v++) { queue.insert(v); } wt[s] = 0.0; queue.lower(s); while (!queue.empty()) { int v = queue.poll(); if (!Double.isInfinite(wt[v])) { for (int w = 0; w < n; w++) { if (graph[v][w] != 0.0) { double p = weighted ? wt[v] + graph[v][w] : wt[v] + 1; if (p < wt[w]) { wt[w] = p; queue.lower(w); } } } } } return wt; } @Override public double[][] dijkstra() { double[][] wt = new double[n][]; for (int i = 0; i < n; i++) { wt[i] = dijkstra(i); } return wt; } @Override public AdjacencyMatrix subgraph(int[] vertices) { int[] v = vertices.clone(); Arrays.sort(v); AdjacencyMatrix g = new AdjacencyMatrix(v.length); for (int i = 0; i < v.length; i++) { for (int j = 0; j < v.length; j++) { g.graph[i][j] = graph[v[i]][v[j]]; } } return g; } /** * Returns the adjacency matrix. * @return the adjacency matrix */ public double[][] toArray() { return MathBase.clone(graph); } /** * Push-relabel algorithm for maximum flow */ private void push(double[][] flow, double[] excess, int u, int v) { double send = Math.min(excess[u], graph[u][v] - flow[u][v]); flow[u][v] += send; flow[v][u] -= send; excess[u] -= send; excess[v] += send; } private void relabel(double[][] flow, int[] height, int u) { int minHeight = 2*n; for (int v = 0; v < n; v++) { if (graph[u][v] - flow[u][v] > 0) { minHeight = Math.min(minHeight, height[v]); height[u] = minHeight + 1; } } } private void discharge(double[][] flow, double[] excess, int[] height, int[] seen, int u) { while (excess[u] > 0) { if (seen[u] < n) { int v = seen[u]; if ((graph[u][v] - flow[u][v] > 0) && (height[u] > height[v])) { push(flow, excess, u, v); } else { seen[u] += 1; } } else { relabel(flow, height, u); seen[u] = 0; } } } private static void moveToFront(int i, int[] array) { int temp = array[i]; for (int j = i; j > 0; j--) { array[j] = array[j - 1]; } array[0] = temp; } /** * Push-relabel algorithm for maximum flow */ public double pushRelabel(double[][] flow, int source, int sink) { int[] seen = new int[n]; int[] queue = new int[n-2]; for (int i = 0, p = 0; i < n; i++) { if ((i != source) && (i != sink)) { queue[p++] = i; } } int[] height = new int[n];//dijkstra(sink, false); height[source] = n; double[] excess = new double[n]; excess[source] = Double.MAX_VALUE; for (int i = 0; i < n; i++) { push(flow, excess, source, i); } int p = 0; while (p < n-2) { int u = queue[p]; double oldHeight = height[u]; discharge(flow, excess, height, seen, u); if (height[u] > oldHeight) { moveToFront(p, queue); p = 0; } else { p += 1; } } double maxflow = 0.0; for (int i = 0; i < n; i++) { maxflow += flow[source][i]; } return maxflow; } }
[ "lie.tian@fengjr.com" ]
lie.tian@fengjr.com
262d7d3f9e63dafd2c91a3e12f9d3c2dd277dc6e
7d7c178ea0b0bcb80f368446e58ae303f1b37e4d
/melody.plugin.libvirt/src/main/java/com/wat/melody/plugin/libvirt/common/AbstractOperation.java
d57721949554f02ac95c1f58423f86b35e48e9b3
[]
no_license
wat-org/melody
0818480ccc8a5a3a50069105a4b8fcd31bf07313
e313c433365494b580b97f2b525781a8aee2c484
refs/heads/master
2021-01-23T08:14:58.067831
2015-12-11T16:29:20
2015-12-11T16:29:20
16,883,338
0
1
null
null
null
null
UTF-8
Java
false
false
13,660
java
package com.wat.melody.plugin.libvirt.common; import javax.xml.xpath.XPathExpressionException; import org.libvirt.Connect; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.wat.cloud.libvirt.LibVirtCloud; import com.wat.cloud.libvirt.LibVirtInstanceController; import com.wat.melody.api.IResourcesDescriptor; import com.wat.melody.api.ITask; import com.wat.melody.api.Melody; import com.wat.melody.api.annotation.Attribute; import com.wat.melody.api.exception.PlugInConfigurationException; import com.wat.melody.cloud.instance.InstanceController; import com.wat.melody.cloud.instance.InstanceControllerRelatedToAnInstanceElement; import com.wat.melody.cloud.instance.InstanceControllerWithNetworkActivation; import com.wat.melody.cloud.instance.InstanceDatas; import com.wat.melody.cloud.instance.InstanceDatasValidator; import com.wat.melody.cloud.instance.exception.IllegalInstanceDatasException; import com.wat.melody.cloud.instance.xml.InstanceDatasLoader; import com.wat.melody.cloud.instance.xml.NetworkActivatorRelatedToAnInstanceElement; import com.wat.melody.cloud.network.activation.NetworkActivatorConfigurationCallback; import com.wat.melody.cloud.network.activation.xml.NetworkActivationHelper; import com.wat.melody.cloud.protectedarea.ProtectedAreaIds; import com.wat.melody.common.messages.Msg; import com.wat.melody.common.timeout.GenericTimeout; import com.wat.melody.common.timeout.exception.IllegalTimeoutException; import com.wat.melody.common.xml.DocHelper; import com.wat.melody.common.xml.exception.NodeRelatedException; import com.wat.melody.plugin.libvirt.common.exception.LibVirtException; import com.wat.melody.plugin.ssh.common.SshPlugInConfiguration; import com.wat.melody.plugin.telnet.common.TelnetPlugInConfiguration; /** * * @author Guillaume Cornet * */ public abstract class AbstractOperation implements ITask, InstanceDatasValidator, NetworkActivatorConfigurationCallback { private static GenericTimeout createTimeout(int timeout) { try { return GenericTimeout.parseLong(timeout); } catch (IllegalTimeoutException Ex) { throw new RuntimeException("Unexpected error while initializing " + "a GenricTimeout with value '" + timeout + "'. " + "Because this default value initialization is " + "hardcoded, such error cannot happened. " + "Source code has certainly been modified and " + "a bug have been introduced.", Ex); } } /** * Task's attribute, which specifies the {@link Element} which contains the * instance description. */ public static final String TARGET_ATTR = "target"; private String _target = null; private Element _targetElmt = null; private String _instanceId = null; private Connect _cloudConnection = null; private InstanceController _instanceController = null; private InstanceDatas _instanceDatas = null; private GenericTimeout _defaultTimeout = createTimeout(90000); public AbstractOperation() { } @Override public void validate() throws LibVirtException { // Build an InstanceDatas with target Element's datas found in the RD try { setInstanceDatas(new InstanceDatasLoader().load(getTargetElement(), this)); } catch (NodeRelatedException Ex) { throw new LibVirtException(Ex); } setInstanceController(createInstanceController()); } protected InstanceController createInstanceController() throws LibVirtException { InstanceController instanceCtrl = newLibVirtInstanceController(); instanceCtrl = new InstanceControllerRelatedToAnInstanceElement( instanceCtrl, getTargetElement()); if (NetworkActivationHelper .isNetworkActivationEnabled(getTargetElement())) { instanceCtrl = new InstanceControllerWithNetworkActivation( instanceCtrl, new NetworkActivatorRelatedToAnInstanceElement(this, getTargetElement())); } return instanceCtrl; } /** * Can be override by subclasses to provide enhanced behavior of the * {@link AwsInstanceController}. */ protected InstanceController newLibVirtInstanceController() { return new LibVirtInstanceController(getCloudConnection(), getInstanceId()); } protected IResourcesDescriptor getRD() { return Melody.getContext().getProcessorManager() .getResourcesDescriptor(); } protected LibVirtPlugInConfiguration getLibVirtPlugInConfiguration() throws LibVirtException { try { return LibVirtPlugInConfiguration.get(); } catch (PlugInConfigurationException Ex) { throw new LibVirtException(Ex); } } protected SshPlugInConfiguration getSshPlugInConfiguration() throws LibVirtException { try { return SshPlugInConfiguration.get(); } catch (PlugInConfigurationException Ex) { throw new LibVirtException(Ex); } } protected TelnetPlugInConfiguration getTelnetPlugInConfiguration() throws LibVirtException { try { return TelnetPlugInConfiguration.get(); } catch (PlugInConfigurationException Ex) { throw new LibVirtException(Ex); } } @Override public SshPlugInConfiguration getSshConfiguration() { try { return getSshPlugInConfiguration(); } catch (LibVirtException Ex) { throw new RuntimeException("Unexpected error when retrieving " + "Ssh Plug-In configuration. " + "Because such configuration registration have been " + "previously prouved, such error cannot happened."); } } @Override public TelnetPlugInConfiguration getTelnetConfiguration() { try { return getTelnetPlugInConfiguration(); } catch (LibVirtException Ex) { throw new RuntimeException("Unexpected error when retrieving " + "Telnet Plug-In configuration. " + "Because such configuration registration have been " + "previously prouved, such error cannot happened."); } } @Override public void validateAndTransform(InstanceDatas datas) throws IllegalInstanceDatasException { try { validateRegion(datas); validateSite(datas); validateImageId(datas); validateInstanceType(datas); validateKeyPairRepositoryPath(datas); validateKeyPairName(datas); validatePassphrase(datas); validateKeyPairSize(datas); validateProtectedAreaNames(datas); validateCreateTimeout(datas); validateDeleteTimeout(datas); validateStartTimeout(datas); validateStopTimeout(datas); } catch (LibVirtException Ex) { throw new IllegalInstanceDatasException(Ex); } } protected void validateRegion(InstanceDatas datas) throws IllegalInstanceDatasException, LibVirtException { if (datas.getRegion() == null) { throw new IllegalInstanceDatasException(Msg.bind( Messages.MachineEx_MISSING_REGION_ATTR, InstanceDatasLoader.REGION_ATTR)); } Connect connect = getLibVirtPlugInConfiguration().getCloudConnection( datas.getRegion()); if (connect == null) { throw new IllegalInstanceDatasException(Msg.bind( Messages.MachineEx_INVALID_REGION_ATTR, datas.getRegion())); } // Initialize Connection to LibVirt setCloudConnection(connect); } protected void validateSite(InstanceDatas datas) { // can be null } protected void validateImageId(InstanceDatas datas) throws IllegalInstanceDatasException { if (datas.getImageId() == null) { throw new IllegalInstanceDatasException(Msg.bind( Messages.MachineEx_MISSING_IMAGEID_ATTR, InstanceDatasLoader.IMAGEID_ATTR)); } if (!LibVirtCloud.imageIdExists(datas.getImageId())) { throw new IllegalInstanceDatasException(Msg.bind( Messages.MachineEx_INVALID_IMAGEID_ATTR, datas.getImageId(), datas.getRegion())); } } protected void validateInstanceType(InstanceDatas datas) throws IllegalInstanceDatasException { if (datas.getInstanceType() == null) { throw new IllegalInstanceDatasException(Msg.bind( Messages.MachineEx_MISSING_INSTANCETYPE_ATTR, InstanceDatasLoader.INSTANCETYPE_ATTR)); } } protected void validateKeyPairRepositoryPath(InstanceDatas datas) throws LibVirtException { if (datas.getKeyPairRepositoryPath() == null) { datas.setKeyPairRepositoryPath(getSshPlugInConfiguration() .getKeyPairRepositoryPath()); } } protected void validateKeyPairName(InstanceDatas datas) throws IllegalInstanceDatasException { if (datas.getKeyPairName() == null) { throw new IllegalInstanceDatasException(Msg.bind( Messages.MachineEx_MISSING_KEYPAIR_NAME_ATTR, InstanceDatasLoader.KEYPAIR_NAME_ATTR)); } } protected void validatePassphrase(InstanceDatas datas) { // can be null } protected void validateKeyPairSize(InstanceDatas datas) throws LibVirtException { if (datas.getKeyPairSize() == null) { datas.setKeyPairSize(getSshPlugInConfiguration().getKeyPairSize()); } } protected void validateProtectedAreaNames(InstanceDatas datas) { if (datas.getProtectedAreaIds() == null) { // if null, assign an empty list datas.setProtectedAreaIds(new ProtectedAreaIds()); } } protected void validateCreateTimeout(InstanceDatas datas) { if (datas.getCreateTimeout() == null) { datas.setCreateTimeout(getDefaultTimeout()); } } protected void validateDeleteTimeout(InstanceDatas datas) { if (datas.getDeleteTimeout() == null) { datas.setDeleteTimeout(getDefaultTimeout().factor(2)); } } protected void validateStartTimeout(InstanceDatas datas) { if (datas.getStartTimeout() == null) { datas.setStartTimeout(getDefaultTimeout()); } } protected void validateStopTimeout(InstanceDatas datas) { if (datas.getStopTimeout() == null) { datas.setStopTimeout(getDefaultTimeout()); } } protected InstanceDatas getInstanceDatas() { return _instanceDatas; } protected InstanceDatas setInstanceDatas(InstanceDatas instanceDatas) { if (instanceDatas == null) { throw new IllegalArgumentException("null: Not accepted. " + "Must be a valid " + InstanceDatas.class.getCanonicalName() + "."); } InstanceDatas previous = getInstanceDatas(); _instanceDatas = instanceDatas; return previous; } protected GenericTimeout getDefaultTimeout() { return _defaultTimeout; } protected GenericTimeout setDefaultTimeout(GenericTimeout timeout) { if (timeout == null) { throw new IllegalArgumentException("null: Not accepted. " + "Must be a valid " + GenericTimeout.class.getCanonicalName() + "."); } GenericTimeout previous = getDefaultTimeout(); _defaultTimeout = timeout; return previous; } protected Connect getCloudConnection() { return _cloudConnection; } protected Connect setCloudConnection(Connect cnx) { if (cnx == null) { throw new IllegalArgumentException("null: Not accepted. " + "Must be a valid " + Connect.class.getCanonicalName() + "."); } Connect previous = getCloudConnection(); _cloudConnection = cnx; return previous; } protected InstanceController getInstanceController() { return _instanceController; } protected InstanceController setInstanceController( InstanceController instance) { if (instance == null) { throw new IllegalArgumentException("null: Not accepted. " + "Must be a valid " + InstanceController.class.getCanonicalName() + "."); } InstanceController previous = getInstanceController(); _instanceController = instance; return previous; } /** * @return the targeted {@link Element}. */ protected Element getTargetElement() { return _targetElmt; } protected Element setTargetElement(Element n) { if (n == null) { throw new IllegalArgumentException("null: Not accepted. " + "Must be a valid " + Element.class.getCanonicalName() + " (the targeted LibVirt Instance Element Node)."); } Element previous = getTargetElement(); _targetElmt = n; return previous; } /** * @return the Instance Id which is registered in the targeted Element Node * (can be <tt>null</tt>). */ protected String getInstanceId() { return _instanceId; } protected String setInstanceId(String instanceId) { // can be null, if no Instance have been created yet // but cannot be an empty String if (instanceId != null && instanceId.trim().length() == 0) { instanceId = null; } String previous = getInstanceId(); _instanceId = instanceId; return previous; } /** * @return the XPath expression which selects the targeted Node. */ public String getTarget() { return _target; } @Attribute(name = TARGET_ATTR, mandatory = true) public String setTarget(String target) throws LibVirtException { if (target == null) { throw new IllegalArgumentException("null: Not accepted. " + "Must be a valid String (an XPath Expression, which " + "selects a unique XML Element node in the Resources " + "Descriptor)."); } NodeList nl = null; try { nl = getRD().evaluateAsNodeList(target); } catch (XPathExpressionException Ex) { throw new LibVirtException(Msg.bind( Messages.MachineEx_INVALID_TARGET_ATTR_NOT_XPATH, target)); } if (nl.getLength() == 0) { throw new LibVirtException(Msg.bind( Messages.MachineEx_INVALID_TARGET_ATTR_NO_NODE_MATCH, target)); } else if (nl.getLength() > 1) { throw new LibVirtException(Msg.bind( Messages.MachineEx_INVALID_TARGET_ATTR_MANY_NODES_MATCH, target, nl.getLength())); } Node n = nl.item(0); if (n.getNodeType() != Node.ELEMENT_NODE) { throw new LibVirtException(Msg.bind( Messages.MachineEx_INVALID_TARGET_ATTR_NOT_ELMT_MATCH, target, DocHelper.parseNodeType(n))); } setTargetElement((Element) n); try { setInstanceId(getTargetElement().getAttributeNode( InstanceDatasLoader.INSTANCE_ID_ATTR).getNodeValue()); } catch (NullPointerException ignored) { } String previous = getTarget(); _target = target; return previous; } }
[ "cornet.guillaume.pierre@gmail.com" ]
cornet.guillaume.pierre@gmail.com
2d3fdf93c67312343547d220990379a38b3586f9
85db9d9735f3a74f9ff8406062cfd06c2cde18fe
/app/src/main/java/uk/co/pped/specialfitness/components/widgets/HeaderAdapter.java
7eed7d34680e6f5043c9920d34de6f77ddb49be9
[]
no_license
PopeyeDevelopment/SpecialFitness
205457764dcc4deb6b225c8717d2f062472abb29
97fa11f896a4e3e9e8e3a370ce022e3998a63cd2
refs/heads/master
2021-01-16T18:00:17.492136
2017-11-23T15:58:26
2017-11-23T15:58:26
95,447,632
0
0
null
null
null
null
UTF-8
Java
false
false
4,655
java
package uk.co.pped.specialfitness.components.widgets; import android.content.Context; import android.os.Bundle; import android.preference.PreferenceActivity.Header; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.LinearLayout; import android.widget.TextView; import org.apache.commons.lang3.StringUtils; import uk.co.pped.specialfitness.R; import java.util.List; /** * Created by matthewi on 03/10/2017. */ public class HeaderAdapter extends ArrayAdapter<Header> { private static final String TAG = HeaderAdapter.class.getName(); static final int HEARDER_TYPE_SUPER_HEADER = 0; static final int HEADER_TYPE_NORMAL = 1; static final int HEARDER_TYPE_CATERGORY = 0; static final int HEADER_TYPE_OTHER = -1; public static final String HEADER_TYPE_KEY = "type"; public static final String HEADER_TYPE_HEADER = "header"; public static final String HEADER_TYPE_INTENT = "intent"; private LayoutInflater inflater; private boolean removeIconIfEmpty; public HeaderAdapter(Context context, List<Header> headers) { super(context, 0, headers); this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { Header header = getItem(position); int headerType = getHeaderType(header); // Reset the convertView to null as we have our own to use. convertView = null; if (convertView == null) { switch (headerType) { case HEARDER_TYPE_SUPER_HEADER: convertView = inflater.inflate(R.layout.settings_header_layout, parent, false); ((TextView) convertView.findViewById(android.R.id.title)).setText(header.getTitle(getContext().getResources())); break; default: convertView = inflater.inflate(R.layout.preferences_basic_layout, parent, false); ((TextView) convertView.findViewById(android.R.id.title)).setText(header.getTitle(getContext() .getResources())); String summary = (String) header.getSummary(getContext().getResources()); if (!StringUtils.isEmpty(summary)) { ((TextView) convertView.findViewById(android.R.id.summary)).setText(header .getSummary(getContext().getResources())); } else { ((TextView) convertView.findViewById(android.R.id.summary)).setVisibility(View.GONE); LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); llp.setMargins( DpToPxConvertion(10), DpToPxConvertion(10), DpToPxConvertion(10), DpToPxConvertion(10)); ((TextView) convertView.findViewById(android.R.id.title)).setLayoutParams(llp); } break; } } return convertView; } private static int getHeaderType(Header header) { final Bundle extras = header.fragmentArguments; if ((extras != null && !extras.containsKey(HEADER_TYPE_KEY) || extras == null)) { throw new IllegalStateException("getHeaderType: header does not contain extra element with name of type in."); } if (isSuperHeader((String) extras.get(HEADER_TYPE_KEY))) { if ((header.fragment != null || header.intent != null)) { Log.w(TAG, "getHeaderType: header can not have type of 'header' and have a fragment or intent. This header will be treated as a normal header."); return HEADER_TYPE_NORMAL; } return HEARDER_TYPE_SUPER_HEADER; } else { return HEADER_TYPE_NORMAL; } } private static boolean isSuperHeader(String type) { if (StringUtils.equalsIgnoreCase(type, HEADER_TYPE_HEADER)) { return true; } return false; } private int DpToPxConvertion(int dpValue) { return (int)((dpValue * getContext().getResources().getDisplayMetrics().density) + 0.5); } }
[ "Matthew.Inman@cdl.co.uk" ]
Matthew.Inman@cdl.co.uk
c110953766cca0d3b005a08f23ba3ac1fcba412f
062b181d2c26eb6555f759e2aeec8aecf4ef3db3
/2_Library/src/com/suboch/task1/publication/tag/IllustrationType.java
1616c84138f93ad2a9fed8110dae13e8f35e9781
[]
no_license
eonalion/JavaWebCourse
130389d631f7d603dc65ce73cf400b9d001174bf
3867683d0b8389ff42d62aeb39069c62b46c4b37
refs/heads/master
2020-07-23T14:32:51.999071
2016-11-21T21:17:14
2016-11-21T21:17:14
73,806,135
0
0
null
null
null
null
UTF-8
Java
false
false
140
java
package com.suboch.task1.publication.tag; /** * */ public enum IllustrationType { BLACK_AND_WHITE, COLOR, MIXED, NONE }
[ "Polina" ]
Polina
0f4bea025d0cba95b9ffac17909fa22b2285aba0
d20415b9575ddefe2bd366f5d440c07689d80615
/workup/old20/carPark/project/model/src/main/java/org/solent/com504/meter/model/service/MeterServiceFacade.java
d0e9fd766266ce4a06182f6f4a38540130272eb4
[ "Apache-2.0" ]
permissive
gallenc/solent2Public
bdb4589dfa69461085a27d2acf9ef2e4cc463239
ea190f93568fa5b16585ef0eae1aa9ed1f9f3804
refs/heads/master
2022-03-19T07:41:43.546058
2021-12-01T10:13:39
2021-12-01T10:13:39
147,677,883
12
181
Apache-2.0
2022-01-07T10:04:25
2018-09-06T13:29:32
Java
UTF-8
Java
false
false
123
java
package org.solent.com504.meter.model.service; public interface MeterServiceFacade { public String getHeartbeat(); }
[ "cgallen@opennms.org" ]
cgallen@opennms.org
a1b68f5d2025fd597ea1ce318464f59728c49dc8
5a6093ae22488d7bd66a6e615f0157b15940d2c2
/src/main/java/com/github/rishabh9/riko/upstox/websockets/exceptions/WebRequestException.java
b222430c137c658d1fd4f54a481ba71da9c29aec
[ "MIT" ]
permissive
amitparmar01/riko
9661a2b52207d78860a7c7e755c849dbd86e519b
15e5ceba1b5b466e50711cf7c60e0325a2844078
refs/heads/master
2021-10-11T01:00:15.104137
2019-01-20T14:21:34
2019-01-20T14:21:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,507
java
/* * MIT License * * Copyright (c) 2019 Rishabh Joshi * * 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.github.rishabh9.riko.upstox.websockets.exceptions; /** * Thrown when making a web request to Upstox fails. */ public class WebRequestException extends RuntimeException { public WebRequestException(String message) { super(message); } public WebRequestException(String message, Throwable cause) { super(message, cause); } }
[ "rishabh9@gmail.com" ]
rishabh9@gmail.com
ed41ac4fc127acb669b17c2cbd5b5ad36fbf8f2f
ecbac658598fed35b2194e1fd4514125d5a14c12
/app/src/main/java/doctech/example/anca/doctech/ListActivity.java
4ce2241131eeae927f20d33cfb1553a06cc2b10c
[]
no_license
Anca21/DoctorsOffice-Android
60fd1ab5964c52127313e43974f7d8ee76378fae
4c1256692c4461abb3e5c21f1291bcd5c61ecddb
refs/heads/master
2021-05-08T02:12:09.292226
2018-01-12T18:52:26
2018-01-12T18:52:26
107,980,845
0
0
null
null
null
null
UTF-8
Java
false
false
1,968
java
package doctech.example.anca.doctech; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.EditText; import android.widget.TextView; /** * Created by Anca on 11/10/2017. */ public class ListActivity extends AppCompatActivity { // @Override // protected void onCreate(Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setContentView(R.layout.activity_list); // // Intent intent = getIntent(); // String message = intent.getStringExtra("username"); // String message1 = intent.getStringExtra("name"); // String message2 = intent.getStringExtra("email"); // // EditText textView = (EditText) findViewById(R.id.username); // EditText textView1 = (EditText) findViewById(R.id.name); // EditText textView2 = (EditText) findViewById(R.id.email); // textView.setText(message); // textView1.setText(message1); // textView2.setText(message2); //// final Button edit = (Button) findViewById(R.id.button3); //// edit.setOnClickListener(new View.OnClickListener() { //// public void onClick(View view) { //// edit(); //// } //// }); // } // public void edit(){ // EditText editText = (EditText)findViewById(R.id.email); // EditText editText1 = (EditText)findViewById(R.id.name); // EditText editText2 = (EditText)findViewById(R.id.username); // EditText editText3 = (EditText)findViewById(R.id.cnp); // // String name = editText1.getText().toString(); // String email = editText.getText().toString(); // String username = editText2.getText().toString(); // String cnp = editText3.getText().toString(); // // editText.setText(email); // editText1.setText(name); // editText2.setText(username); // editText3.setText(cnp); // // // } // }
[ "anca_rusu01@yahoo.com" ]
anca_rusu01@yahoo.com
5d053b2d3c6ef7ec71005b9f5cd34e4ec498b75f
20231b3f94425f5317ed60aa74da03f96c6cb7d7
/src/main/java/com/github/fge/jsonschema/syntax/checkers/common/PatternPropertiesSyntaxChecker.java
7404979191ccc68d301105e23dc0c4ece8d1a2a6
[]
no_license
mattbishop/json-schema-core
c3f96d475eb2ba94f3f1a1b292f79a39a6f54a2e
2464c78e80087d0c46d9a83808e0d5a3ddf62c93
refs/heads/master
2021-01-17T01:57:43.657179
2013-05-02T22:19:15
2013-05-02T22:19:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,351
java
/* * Copyright (c) 2013, Francis Galiegue <fgaliegue@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the Lesser GNU General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * 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 * Lesser 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, see <http://www.gnu.org/licenses/>. */ package com.github.fge.jsonschema.syntax.checkers.common; import com.github.fge.jsonschema.exceptions.ProcessingException; import com.github.fge.jsonschema.report.ProcessingReport; import com.github.fge.jsonschema.syntax.checkers.SyntaxChecker; import com.github.fge.jsonschema.syntax.checkers.helpers.SchemaMapSyntaxChecker; import com.github.fge.jsonschema.tree.SchemaTree; import com.github.fge.jsonschema.util.RhinoHelper; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; import java.util.Set; import static com.github.fge.jsonschema.messages.SyntaxMessages.*; /** * Syntax checker for the {@code patternProperties} keyword * * @see com.github.fge.jsonschema.util.RhinoHelper */ public final class PatternPropertiesSyntaxChecker extends SchemaMapSyntaxChecker { private static final SyntaxChecker INSTANCE = new PatternPropertiesSyntaxChecker(); public static SyntaxChecker getInstance() { return INSTANCE; } private PatternPropertiesSyntaxChecker() { super("patternProperties"); } @Override protected void extraChecks(final ProcessingReport report, final SchemaTree tree) throws ProcessingException { /* * Check that the member names are regexes */ final Set<String> set = Sets.newHashSet(getNode(tree).fieldNames()); for (final String s: Ordering.natural().sortedCopy(set)) if (!RhinoHelper.regexIsValid(s)) report.error(newMsg(tree, INVALID_REGEX_MEMBER_NAME) .put("memberName", s)); } }
[ "fgaliegue@gmail.com" ]
fgaliegue@gmail.com
d1bdea21e7f3f82c5cca31d79cef4252ead2d604
066da52ebc9ed744467e6954be8a22f62fd54d2c
/src/main/java/ua/epam/liepin/servl/conference/command/admin/ViewAllUsers.java
a0dd596c8cbae3a955ada1148b2baed7bc02798d
[]
no_license
acsellW/ConferenceServl
597309239aaf041689ef9b2b898e31c20d1abdaa
79618cbff6e9ad2a618a6b1df97194692287cef7
refs/heads/master
2023-06-07T19:27:09.479194
2021-06-30T01:09:21
2021-06-30T01:09:21
372,312,035
0
0
null
null
null
null
UTF-8
Java
false
false
1,361
java
package ua.epam.liepin.servl.conference.command.admin; import ua.epam.liepin.servl.conference.command.Command; import ua.epam.liepin.servl.conference.constant.Constants; import ua.epam.liepin.servl.conference.entity.User; import ua.epam.liepin.servl.conference.factory.ServiceFactory; import ua.epam.liepin.servl.conference.service.UserService; import javax.servlet.http.HttpServletRequest; import java.util.List; public class ViewAllUsers implements Command { private final UserService userService; public ViewAllUsers() { userService = ServiceFactory.getInstance().getUserService(); } @Override public String execute(HttpServletRequest request) { int page = Constants.ONE; int recordsPerPage = Constants.SIX; if (request.getParameter(Constants.PAGE) != null) { page = Integer.parseInt(request.getParameter(Constants.PAGE)); } List<User> users = userService.findAll((page - Constants.ONE) * recordsPerPage, recordsPerPage); int noOfRecords = userService.getNoOfRecords(); int noOfPages = (int) Math.ceil(noOfRecords * Constants.ONE_DOUBLE / recordsPerPage); request.setAttribute("users", users); request.setAttribute("noOfPages", noOfPages); request.setAttribute("currentPage", page); return "/admin/view_users.jsp"; } }
[ "dxddima@gmail.com" ]
dxddima@gmail.com
5f1fe03fc89ac0f6a11835afb73b4976be7cae9b
57042b99cd7d2eef210615c73f36677441302680
/armed-police-message/src/main/java/udf/Borrowing.java
d999316635cdad3b2a4952abb4fb90082e99172d
[]
no_license
lylzmm/big-data-platform
c52f31ab97d19f57b553e4bc2e09600134958f16
02ae4ea69fcae127489f2ec90b747161b10e46bc
refs/heads/master
2023-08-10T17:43:44.179135
2021-10-11T01:03:57
2021-10-11T01:03:57
401,174,253
0
0
null
null
null
null
UTF-8
Java
false
false
6,940
java
package udf; import utils.StringUtil; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * * 借款 */ public class Borrowing { public static String borrowing(String line) { if (line.contains("已开通")) return ""; String result = ""; String msgOriginName = StringUtil.matchingSource(line); Pattern p1 = Pattern.compile("\\d+(\\.(\\d{1,2}))"); // 1111.00 Pattern p2 = Pattern.compile("(\\d{1,3}\\,)+(\\d{1,3})(\\.(\\d{0,2}))"); // 1,11.00 Matcher m1 = p1.matcher(line.trim()); Matcher m2 = p2.matcher(line.trim()); // 匹配金额 if (m2.find()) result = m2.group(); if (result.length() == 0 && m1.find()) result = m1.group(); if (result.split("\\.").length < 3) result = ""; return msgOriginName + "->3->" + result; } // public static String borrowing(String line) { // String result = ""; // Pattern p = Pattern.compile("\\d{1,8}"); // // // 匹配来源 // String msgOriginName = StringUtil.matchingSource(line); // // // 蚂蚁借呗 // if (line.contains("借呗")) { // if (line.contains("已到")) result = StringUtil.matchingMoney(line); // if (line.contains("正在借款")) result = getM(line, "正在借款"); // return "蚂蚁借呗->3->" + result; // } // // // // if (line.contains("京东金融")) { // // 如果包含 如:【京东金融】(借款到账)您申请的金条借款1000.00元,在尾号7214的银行卡中已到账,查看 // if (StringUtil.matchingParentheses(line).length() != 0) result = getM(line, "借款"); // return "京东金融->3->" + result; // } // // if (line.contains("借款") && p.matcher(line.trim()).find() // && !line.contains("失败") // && !line.contains("已结清") // && !line.contains("开通") // && !line.contains("额度") // && !line.contains("立享") // && !line.contains("领取") // && !line.contains("中国移动") // && !line.contains("中国联通") // && !line.contains("中国电信") // && !line.contains("可领") // && !line.contains("蚂蚁借呗") // && !line.contains("未通过审核") // && !line.contains("放款") // ) { // result = getM(line, "借款"); // } else if (line.contains("蚂蚁借呗")) { // result = getM(line, "借呗"); // } else if ((line.length() > 10 && line.contains("放款") && !line.contains("已获得") && !line.contains("立即领"))) { // result = getM(line, "放款"); // } // // return msgOriginName + "->3->" + result; // } public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream("input/借款.csv"))); String line = null; while ((line = br.readLine()) != null) { // line = "【极速贷】"; String borrowing = borrowing(line); if (borrowing.contains("京东金融")) { if ((borrowing.split("->").length < 3)) { System.out.println(line + "==" + borrowing); } } } br.close(); } public static String getM(String line, String keyWord) { String result = ""; Pattern p = Pattern.compile("[0-9]"); int startIndex = 0; int stopIndex = 0; int count = 0; boolean flag = false; boolean bracketFlag = false; boolean commaFlag = false; int start = line.indexOf(keyWord); for (int i = start; i < line.length(); i++) { String key = line.substring(i, i + 1); // 循环字符 // 第一种情况 支出(消费101店面), 提取金额 // 第二中情况 支出400.00元(消费) 提取金额 if (key.contains("(") || key.contains("(") || key.contains("【")) { bracketFlag = true; continue; } if (bracketFlag && (key.contains(")") || key.contains(")") || key.contains("】"))) { bracketFlag = false; } // 括号找完了 如: 支出(消费101店面),这样还没有找到金额就可以跳出循环了 if (!bracketFlag && !flag && (key.contains(",") || key.contains(";") || key.contains("。") || key.contains("、") || key.contains("!") || key.contains(","))) break; // 找完括号了在找金额 if (!bracketFlag && p.matcher(key).find() && count == 0) { startIndex = i; flag = true; count++; continue; } if (!bracketFlag && flag) { if (p.matcher(key).find()) continue; if (key.contains(",") && !commaFlag) continue; if (key.contains(".")) { commaFlag = true; continue; } stopIndex = i; break; } } if (startIndex != 0 && stopIndex == 0) { stopIndex = line.length(); } if (startIndex != 0) { result = line.substring(startIndex, stopIndex).replace(",", "").replace("[", ""); // 验证金额是否是需要的 int st = stopIndex; int sp = st + 1; // 如果金额后面是亿元 if (sp <= line.length()) { String unit = line.substring(st, sp); if (!unit.equals("元")) result = ""; else { // 获取关键字到金额中间的字符 String middle = line.substring(line.indexOf(keyWord) + keyWord.length(), startIndex); if (middle.contains("额度") || middle.contains("最高") || middle.contains("费率") || middle.contains("达标再送") || middle.contains("领取") || middle.contains("还款") || middle.contains("调整") || middle.contains("信用") || middle.contains("应还") || middle.contains("日息") || middle.contains("提升") ) result = ""; } } } return result; } }
[ "1764705089@qq.com" ]
1764705089@qq.com
cfdaabac2d1a0c11c17d68fbbb2a2807d89df1a8
5fa48a0da4bb139dd859c11c255114ef6872ba76
/alipaysdk/src/main/java/com/alipay/api/domain/AlipayMarketingCampaignDiscountOperateModel.java
22d6d869aaaa13e13d6cb9884c52a02f334a0901
[]
no_license
zhangzui/alipay_sdk
0b6c4ff198fc5c1249ff93b4d26245405015f70f
e86b338364b24f554e73a6be430265799765581c
refs/heads/master
2020-03-22T17:43:26.553694
2018-07-11T10:28:33
2018-07-11T10:28:33
140,411,652
0
0
null
null
null
null
UTF-8
Java
false
false
7,727
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 支付宝营销优惠立减活动操作 * * @author auto create * @since 1.0, 2017-03-03 16:48:01 */ public class AlipayMarketingCampaignDiscountOperateModel extends AlipayObject { private static final long serialVersionUID = 4737211333647363668L; /** * 幂等控制code,控制重复新增,修改时候可以不设置。 */ @ApiField("camp_code") private String campCode; /** * 用于账户立减优惠,渠道立减优惠活动时,在收银台页面显示给会员看,最多512个字符,汉字、英文字母、数字都算一个,本输入框支持简单的html符号。 */ @ApiField("camp_desc") private String campDesc; /** * 当operate_type=CAMP_MODIFIED 必设置camp_id */ @ApiField("camp_id") private String campId; /** * 活动名称 不超过24个字符 */ @ApiField("camp_name") private String campName; /** * 用于账户立减优惠,渠道立减优惠活动时,在收银台页面显示给会员看,请根据收银台可展示的实际字数填写,最多48个字符,汉字、英文字母、数字都算一个,只可输入中文、英文、数字、下划线以及中英文的双引号、逗号、句号、横杠、空格。 */ @ApiField("camp_slogan") private String campSlogan; /** * 折扣方式模型 如果类型选了discount,则这个模型必须输入 */ @ApiField("discount_dst_camp_prize_model") private DiscountDstCampPrizeModel discountDstCampPrizeModel; /** * 立减规则模型 */ @ApiField("dst_camp_rule_model") private DstCampRuleModel dstCampRuleModel; /** * 活动子时间,可以不传 */ @ApiListField("dst_camp_sub_time_model_list") @ApiField("date_area_model") private List<DateAreaModel> dstCampSubTimeModelList; /** * 活动结束时间 */ @ApiField("gmt_end") private String gmtEnd; /** * 活动开始时间 */ @ApiField("gmt_start") private String gmtStart; /** * 新增传CAMP_ADD,修改传CAMP_MODIFIED */ @ApiField("operate_type") private String operateType; /** * 奖品类型. 打折 满减 单笔减 阶梯优惠 抹零优惠 随机立减 订单金额减至 折扣方式 DISCOUNT("discount", "折扣方式"), REDUCE("reduce", "满立减"), SINGLE("single", "单笔减"), STAGED_DISCOUNT("staged_discount", "阶梯优惠"), RESET_ZERO_DISCOUNT("reset_zero_discount", "抹零优惠"), RANDOM_DISCOUNT("random", "随机立减"); REDUCE_TO_DISCOUNT("reduce_to_discount","订单金额减至 ") */ @ApiField("prize_type") private String prizeType; /** * 随机立减模型如果类型选了random,则这个模型必须输入 */ @ApiField("random_discount_dst_camp_prize_model") private RandomDiscountDstCampPrizeModel randomDiscountDstCampPrizeModel; /** * 满立减奖品模型 如果类型选了reduce,则这个模型必须输入 */ @ApiField("reduce_dst_camp_prize_model") private ReduceDstCampPrizeModel reduceDstCampPrizeModel; /** * 订单金额减至模型如果类型选了reduce_to_discount,则这个模型必须输入 */ @ApiField("reduce_to_discount_dst_camp_prize_model") private ReduceToDiscountDstCampPrizeModel reduceToDiscountDstCampPrizeModel; /** * 抹零优惠模型如果类型选了reset_zero_discount,则这个模型必须输入 */ @ApiField("reset_zero_dst_camp_prize_model") private ResetZeroDstCampPrizeModel resetZeroDstCampPrizeModel; /** * 单笔减奖品模型如果类型选了single,则这个模型必须输入 */ @ApiField("single_dst_camp_prize_model") private SingleDstCampPrizeModel singleDstCampPrizeModel; /** * 阶梯优惠如果类型选了staged_discount,则这个模型必须输入 */ @ApiField("staged_discount_dst_camp_prize_model") private StagedDiscountDstCampPrizeModel stagedDiscountDstCampPrizeModel; public String getCampCode() { return this.campCode; } public void setCampCode(String campCode) { this.campCode = campCode; } public String getCampDesc() { return this.campDesc; } public void setCampDesc(String campDesc) { this.campDesc = campDesc; } public String getCampId() { return this.campId; } public void setCampId(String campId) { this.campId = campId; } public String getCampName() { return this.campName; } public void setCampName(String campName) { this.campName = campName; } public String getCampSlogan() { return this.campSlogan; } public void setCampSlogan(String campSlogan) { this.campSlogan = campSlogan; } public DiscountDstCampPrizeModel getDiscountDstCampPrizeModel() { return this.discountDstCampPrizeModel; } public void setDiscountDstCampPrizeModel(DiscountDstCampPrizeModel discountDstCampPrizeModel) { this.discountDstCampPrizeModel = discountDstCampPrizeModel; } public DstCampRuleModel getDstCampRuleModel() { return this.dstCampRuleModel; } public void setDstCampRuleModel(DstCampRuleModel dstCampRuleModel) { this.dstCampRuleModel = dstCampRuleModel; } public List<DateAreaModel> getDstCampSubTimeModelList() { return this.dstCampSubTimeModelList; } public void setDstCampSubTimeModelList(List<DateAreaModel> dstCampSubTimeModelList) { this.dstCampSubTimeModelList = dstCampSubTimeModelList; } public String getGmtEnd() { return this.gmtEnd; } public void setGmtEnd(String gmtEnd) { this.gmtEnd = gmtEnd; } public String getGmtStart() { return this.gmtStart; } public void setGmtStart(String gmtStart) { this.gmtStart = gmtStart; } public String getOperateType() { return this.operateType; } public void setOperateType(String operateType) { this.operateType = operateType; } public String getPrizeType() { return this.prizeType; } public void setPrizeType(String prizeType) { this.prizeType = prizeType; } public RandomDiscountDstCampPrizeModel getRandomDiscountDstCampPrizeModel() { return this.randomDiscountDstCampPrizeModel; } public void setRandomDiscountDstCampPrizeModel(RandomDiscountDstCampPrizeModel randomDiscountDstCampPrizeModel) { this.randomDiscountDstCampPrizeModel = randomDiscountDstCampPrizeModel; } public ReduceDstCampPrizeModel getReduceDstCampPrizeModel() { return this.reduceDstCampPrizeModel; } public void setReduceDstCampPrizeModel(ReduceDstCampPrizeModel reduceDstCampPrizeModel) { this.reduceDstCampPrizeModel = reduceDstCampPrizeModel; } public ReduceToDiscountDstCampPrizeModel getReduceToDiscountDstCampPrizeModel() { return this.reduceToDiscountDstCampPrizeModel; } public void setReduceToDiscountDstCampPrizeModel(ReduceToDiscountDstCampPrizeModel reduceToDiscountDstCampPrizeModel) { this.reduceToDiscountDstCampPrizeModel = reduceToDiscountDstCampPrizeModel; } public ResetZeroDstCampPrizeModel getResetZeroDstCampPrizeModel() { return this.resetZeroDstCampPrizeModel; } public void setResetZeroDstCampPrizeModel(ResetZeroDstCampPrizeModel resetZeroDstCampPrizeModel) { this.resetZeroDstCampPrizeModel = resetZeroDstCampPrizeModel; } public SingleDstCampPrizeModel getSingleDstCampPrizeModel() { return this.singleDstCampPrizeModel; } public void setSingleDstCampPrizeModel(SingleDstCampPrizeModel singleDstCampPrizeModel) { this.singleDstCampPrizeModel = singleDstCampPrizeModel; } public StagedDiscountDstCampPrizeModel getStagedDiscountDstCampPrizeModel() { return this.stagedDiscountDstCampPrizeModel; } public void setStagedDiscountDstCampPrizeModel(StagedDiscountDstCampPrizeModel stagedDiscountDstCampPrizeModel) { this.stagedDiscountDstCampPrizeModel = stagedDiscountDstCampPrizeModel; } }
[ "zhangzuizui@qq.com" ]
zhangzuizui@qq.com
f275a38cfd18bfc2ddb3f8fcea31284b6faa40b6
312b1611a8345c86d6fb392f5df1bd1029e38a7a
/study_jdk/src/main/java/com/qihui/sun/zip/TestZipMain.java
6fa209a8e64e834b26438975f670ebc81f3370e2
[]
no_license
bigsun16/myDailyCode
a3637176f1b3b7a48ac76029da005ac1bac1e7be
93ba0a145cdbfdd045c384e62ec300396c7a9f36
refs/heads/master
2023-03-29T19:40:59.445837
2021-03-25T13:45:09
2021-03-25T13:45:09
297,890,322
0
0
null
null
null
null
UTF-8
Java
false
false
58
java
package com.qihui.sun.zip; public class TestZipMain { }
[ "bigsun16@126.com" ]
bigsun16@126.com
636db45ed7e321144f46ba2c94ae836ee0c6daba
bfda775fb6869d571bfa0e61de9772b761852102
/src/org/datos1/linkedDB/listas/ListaCircular.java
b01b6b89decb087735ccac790ff1e5f6b58bb2b6
[]
no_license
CrisAzofeifa/LinkedDB
f76896f56b65562848fba83e3fb7bffdb978f1a7
24b742bae4abde4e6638191eb0be691619c463ad
refs/heads/master
2021-10-10T09:38:30.358086
2017-09-29T09:04:34
2017-09-29T09:04:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,810
java
package org.datos1.linkedDB.listas; public class ListaCircular<Type> { private NodoCircular primerNodo; private int total_nodos; public NodoCircular getPrimerNodo() { return primerNodo; } public void setPrimerNodo(NodoCircular primerNodo) { this.primerNodo = primerNodo; } public int getTotal_nodos() { return total_nodos; } public void setTotal_nodos(int total_nodos) { this.total_nodos = total_nodos; } public ListaCircular() { primerNodo = null; } public boolean esta_vacia(){ return (primerNodo==null); } public void insertar( Type elemento ) { if ( esta_vacia()) { primerNodo = new NodoCircular( elemento ); primerNodo.siguiente = primerNodo; primerNodo.anterior = primerNodo; } else { NodoCircular actual = primerNodo; while(actual.siguiente != primerNodo) { actual = actual.siguiente; } NodoCircular ultimoNodo = actual; NodoCircular desplazado = primerNodo; primerNodo = new NodoCircular( elemento ,desplazado ,ultimoNodo ); ultimoNodo.siguiente = primerNodo; desplazado.anterior = primerNodo; } } public void imprimir() { if ( esta_vacia()) { System.out.println( "Vacía" ); return; } System.out.print( "La lista es: " ); NodoCircular actual = primerNodo; do { System.out.print( actual.dato.toString() + " " ); actual = actual.siguiente; } while ( actual != primerNodo ); System.out.println( "\n" ); } public void insertar_al_final(Type elemento) { NodoCircular nuevo = new NodoCircular<>(elemento); if (primerNodo == null) { primerNodo = nuevo; primerNodo.siguiente = primerNodo; } else { NodoCircular pivote = primerNodo; while (pivote.getSiguiente() != primerNodo) { pivote = pivote.getSiguiente(); } pivote.setSiguiente(nuevo); nuevo.setAnterior(pivote); nuevo.setSiguiente(primerNodo); primerNodo.setAnterior(nuevo); } } public boolean existe_elemento(Type elemento) { NodoCircular pivote; pivote = primerNodo; if (pivote.getDato().equals(elemento)) { return true; } else { pivote = pivote.getSiguiente(); while (pivote != primerNodo) { if (pivote.getDato().equals(elemento)) { return true; }else{ pivote = pivote.getSiguiente(); } } return false; } } }
[ "azofeifacris4@gmail.com" ]
azofeifacris4@gmail.com
ac315a24031b1e9bb0cc7d10ddf28061ddd51106
cc7d2e0a32c1ba4a1284d47a4bcb4c0fb1fdacd1
/src/main/java/me/danny/demojpa2/post/PostCustomRepository.java
0f5b063f6f21c2455c7e2fa275cd27ffde38c32a
[]
no_license
ewbdoohyun/demojpa2
17acc67f844bce25bf6d2df35db81fd38a675cc9
29f97ce934975149807d609204e16961f4ebc5da
refs/heads/master
2022-07-13T22:25:50.019824
2020-05-10T09:32:22
2020-05-10T09:32:22
262,746,212
0
0
null
null
null
null
UTF-8
Java
false
false
160
java
package me.danny.demojpa2.post; import java.util.List; public interface PostCustomRepository<T> { List<Post> findMyPost(); void delete(T entity); }
[ "doohyun.kim@mytrum.com" ]
doohyun.kim@mytrum.com
5cead451668c524d4421845962259f2ccaf69dc5
7704a953cc920c1e587c06e8664baf5177424c6e
/mobi-core/src/main/java/com/samsung/util/SMS.java
6b0074e16a2ac4954840c34c5235897d51b16b3c
[]
no_license
eiroca/mobiemulator
fba634c7611ed0b0e716b5d86ffff55cd674ba72
e396785b2aed81a9aea51c80f415e975d9fe8a85
refs/heads/master
2022-10-06T19:03:25.833070
2022-10-01T17:56:23
2022-10-01T17:56:23
177,340,668
1
0
null
2019-03-23T21:13:30
2019-03-23T21:13:30
null
UTF-8
Java
false
false
219
java
package com.samsung.util; /** * * @author Ashok Kumar Gujarathi */ public class SMS { public static boolean isSupported() { return false; } public static void send(final com.samsung.util.SM sm) { } }
[ "39483731+eiroca@users.noreply.github.com" ]
39483731+eiroca@users.noreply.github.com
ce74a3e4226cdf605f99986bd031ddf09b7829f3
a5d5e5496d00e6174d9e462e8d4979a8ef3d2baa
/com/google/android/gms/games/GameEntity.java
4ae2c5c8814f52eea32c06d2b20d27d975e08659
[]
no_license
niketpatel2525/Bulls-and-Cows
9dc9ce7e7d8a5bcdd59c476397f4a9103f844b3a
4bde931f0c7c03b7eb30011445e95d1abce8c193
refs/heads/master
2021-01-21T08:08:41.600159
2017-02-27T17:57:33
2017-02-27T17:57:33
83,336,905
0
0
null
null
null
null
UTF-8
Java
false
false
9,825
java
package com.google.android.gms.games; import android.database.CharArrayBuffer; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable.Creator; import com.google.android.gms.internal.dd; import com.google.android.gms.internal.dl; import com.google.android.gms.internal.eg; import com.google.android.gms.internal.en; import com.sxnyodot.uefqvmio207964.C0303k; public final class GameEntity extends en implements Game { public static final Creator<GameEntity> CREATOR; private final int iM; private final String mk; private final String ml; private final String mm; private final String mn; private final String mo; private final String mp; private final Uri mq; private final Uri mr; private final Uri ms; private final boolean mt; private final boolean mu; private final String mv; private final int mw; private final int mx; private final int my; /* renamed from: com.google.android.gms.games.GameEntity.a */ static final class C0358a extends C0075a { C0358a() { } public /* synthetic */ Object createFromParcel(Parcel x0) { return m1115t(x0); } public GameEntity m1115t(Parcel parcel) { if (en.m1894c(dd.aW()) || dd.m1228y(GameEntity.class.getCanonicalName())) { return super.m148t(parcel); } String readString = parcel.readString(); String readString2 = parcel.readString(); String readString3 = parcel.readString(); String readString4 = parcel.readString(); String readString5 = parcel.readString(); String readString6 = parcel.readString(); String readString7 = parcel.readString(); Uri parse = readString7 == null ? null : Uri.parse(readString7); readString7 = parcel.readString(); Uri parse2 = readString7 == null ? null : Uri.parse(readString7); readString7 = parcel.readString(); return new GameEntity(1, readString, readString2, readString3, readString4, readString5, readString6, parse, parse2, readString7 == null ? null : Uri.parse(readString7), parcel.readInt() > 0, parcel.readInt() > 0, parcel.readString(), parcel.readInt(), parcel.readInt(), parcel.readInt()); } } static { CREATOR = new C0358a(); } GameEntity(int versionCode, String applicationId, String displayName, String primaryCategory, String secondaryCategory, String description, String developerName, Uri iconImageUri, Uri hiResImageUri, Uri featuredImageUri, boolean playEnabledGame, boolean instanceInstalled, String instancePackageName, int gameplayAclStatus, int achievementTotalCount, int leaderboardCount) { this.iM = versionCode; this.mk = applicationId; this.ml = displayName; this.mm = primaryCategory; this.mn = secondaryCategory; this.mo = description; this.mp = developerName; this.mq = iconImageUri; this.mr = hiResImageUri; this.ms = featuredImageUri; this.mt = playEnabledGame; this.mu = instanceInstalled; this.mv = instancePackageName; this.mw = gameplayAclStatus; this.mx = achievementTotalCount; this.my = leaderboardCount; } public GameEntity(Game game) { this.iM = 1; this.mk = game.getApplicationId(); this.mm = game.getPrimaryCategory(); this.mn = game.getSecondaryCategory(); this.mo = game.getDescription(); this.mp = game.getDeveloperName(); this.ml = game.getDisplayName(); this.mq = game.getIconImageUri(); this.mr = game.getHiResImageUri(); this.ms = game.getFeaturedImageUri(); this.mt = game.isPlayEnabledGame(); this.mu = game.isInstanceInstalled(); this.mv = game.getInstancePackageName(); this.mw = game.getGameplayAclStatus(); this.mx = game.getAchievementTotalCount(); this.my = game.getLeaderboardCount(); } static int m2062a(Game game) { return dl.hashCode(game.getApplicationId(), game.getDisplayName(), game.getPrimaryCategory(), game.getSecondaryCategory(), game.getDescription(), game.getDeveloperName(), game.getIconImageUri(), game.getHiResImageUri(), game.getFeaturedImageUri(), Boolean.valueOf(game.isPlayEnabledGame()), Boolean.valueOf(game.isInstanceInstalled()), game.getInstancePackageName(), Integer.valueOf(game.getGameplayAclStatus()), Integer.valueOf(game.getAchievementTotalCount()), Integer.valueOf(game.getLeaderboardCount())); } static boolean m2063a(Game game, Object obj) { if (!(obj instanceof Game)) { return false; } if (game == obj) { return true; } Game game2 = (Game) obj; return dl.equal(game2.getApplicationId(), game.getApplicationId()) && dl.equal(game2.getDisplayName(), game.getDisplayName()) && dl.equal(game2.getPrimaryCategory(), game.getPrimaryCategory()) && dl.equal(game2.getSecondaryCategory(), game.getSecondaryCategory()) && dl.equal(game2.getDescription(), game.getDescription()) && dl.equal(game2.getDeveloperName(), game.getDeveloperName()) && dl.equal(game2.getIconImageUri(), game.getIconImageUri()) && dl.equal(game2.getHiResImageUri(), game.getHiResImageUri()) && dl.equal(game2.getFeaturedImageUri(), game.getFeaturedImageUri()) && dl.equal(Boolean.valueOf(game2.isPlayEnabledGame()), Boolean.valueOf(game.isPlayEnabledGame())) && dl.equal(Boolean.valueOf(game2.isInstanceInstalled()), Boolean.valueOf(game.isInstanceInstalled())) && dl.equal(game2.getInstancePackageName(), game.getInstancePackageName()) && dl.equal(Integer.valueOf(game2.getGameplayAclStatus()), Integer.valueOf(game.getGameplayAclStatus())) && dl.equal(Integer.valueOf(game2.getAchievementTotalCount()), Integer.valueOf(game.getAchievementTotalCount())) && dl.equal(Integer.valueOf(game2.getLeaderboardCount()), Integer.valueOf(game.getLeaderboardCount())); } static String m2064b(Game game) { return dl.m387d(game).m386a("ApplicationId", game.getApplicationId()).m386a("DisplayName", game.getDisplayName()).m386a("PrimaryCategory", game.getPrimaryCategory()).m386a("SecondaryCategory", game.getSecondaryCategory()).m386a(C0303k.DESCRIPTION, game.getDescription()).m386a("DeveloperName", game.getDeveloperName()).m386a("IconImageUri", game.getIconImageUri()).m386a("HiResImageUri", game.getHiResImageUri()).m386a("FeaturedImageUri", game.getFeaturedImageUri()).m386a("PlayEnabledGame", Boolean.valueOf(game.isPlayEnabledGame())).m386a("InstanceInstalled", Boolean.valueOf(game.isInstanceInstalled())).m386a("InstancePackageName", game.getInstancePackageName()).m386a("GameplayAclStatus", Integer.valueOf(game.getGameplayAclStatus())).m386a("AchievementTotalCount", Integer.valueOf(game.getAchievementTotalCount())).m386a("LeaderboardCount", Integer.valueOf(game.getLeaderboardCount())).toString(); } public int describeContents() { return 0; } public boolean equals(Object obj) { return m2063a(this, obj); } public Game freeze() { return this; } public int getAchievementTotalCount() { return this.mx; } public String getApplicationId() { return this.mk; } public String getDescription() { return this.mo; } public void getDescription(CharArrayBuffer dataOut) { eg.m447b(this.mo, dataOut); } public String getDeveloperName() { return this.mp; } public void getDeveloperName(CharArrayBuffer dataOut) { eg.m447b(this.mp, dataOut); } public String getDisplayName() { return this.ml; } public void getDisplayName(CharArrayBuffer dataOut) { eg.m447b(this.ml, dataOut); } public Uri getFeaturedImageUri() { return this.ms; } public int getGameplayAclStatus() { return this.mw; } public Uri getHiResImageUri() { return this.mr; } public Uri getIconImageUri() { return this.mq; } public String getInstancePackageName() { return this.mv; } public int getLeaderboardCount() { return this.my; } public String getPrimaryCategory() { return this.mm; } public String getSecondaryCategory() { return this.mn; } public int getVersionCode() { return this.iM; } public int hashCode() { return m2062a(this); } public boolean isDataValid() { return true; } public boolean isInstanceInstalled() { return this.mu; } public boolean isPlayEnabledGame() { return this.mt; } public String toString() { return m2064b((Game) this); } public void writeToParcel(Parcel dest, int flags) { int i = 1; String str = null; if (aX()) { dest.writeString(this.mk); dest.writeString(this.ml); dest.writeString(this.mm); dest.writeString(this.mn); dest.writeString(this.mo); dest.writeString(this.mp); dest.writeString(this.mq == null ? null : this.mq.toString()); dest.writeString(this.mr == null ? null : this.mr.toString()); if (this.ms != null) { str = this.ms.toString(); } dest.writeString(str); dest.writeInt(this.mt ? 1 : 0); if (!this.mu) { i = 0; } dest.writeInt(i); dest.writeString(this.mv); dest.writeInt(this.mw); dest.writeInt(this.mx); dest.writeInt(this.my); return; } C0075a.m146a(this, dest, flags); } }
[ "niketpatel2525@gmail.com" ]
niketpatel2525@gmail.com
b3a89df8eceae7371013b3cad186eea59ce1f9f0
c25c4eba8298d23258f93fa2b4b4bbc0731e82de
/app/src/main/java/com/wenping/tinkerdemo/app/SampleApplication.java
9bf2ac9ebcf38b365d0a2ea959fbd022f0d7af70
[]
no_license
WenPingkk/bugly-tinkerDemo
34ab2ddb07386d86cb1520cab5c0a975f5983203
c8fbf403347a0dc59afbdee5517bbd5b1b002977
refs/heads/master
2021-05-13T22:37:39.821711
2018-01-06T15:25:36
2018-01-06T15:25:36
116,492,612
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
package com.wenping.tinkerdemo.app; import com.tencent.tinker.loader.app.TinkerApplication; import com.tencent.tinker.loader.shareutil.ShareConstants; /** * * @author WenPing * @date 1/4/2018 */ public class SampleApplication extends TinkerApplication { public SampleApplication() { super(ShareConstants.TINKER_ENABLE_ALL, "com.wenping.tinkerdemo.app.SampleApplicationLike", "com.tencent.tinker.loader.TinkerLoader", false); } }
[ "wenpingkk@163.com" ]
wenpingkk@163.com
a152384565fea2f38c2bb61d0cc3f5820d86f390
fc0dba059a5d1e901acab4a8cd6c67b88069cf08
/src/Простые_сортировки/SelectionSort.java
564c67b99962dbea315ead8da741de9417b407e4
[]
no_license
AnnaEleeva/SortingAlgorithms
2fb49b32ebd9dded28ac378f0c1ba8fe24c2dcfa
2f75188f1793ff9d9dd712c7535cfa787250bea3
refs/heads/master
2023-07-14T09:02:09.744712
2021-08-23T08:11:26
2021-08-23T08:11:26
398,969,005
0
0
null
null
null
null
UTF-8
Java
false
false
1,765
java
//сортировка выбором - ищем минимум и ставим его в начало //О(n^2)-время. O(n)-память package Простые_сортировки; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.Scanner; public class SelectionSort { static int[] arrayNumbers; public static void main(String[] args) throws IOException { String fileName = "C:\\Загрузки\\SpringSecurityAuthorization\\SortingAlgorithms\\src\\test1.txt"; Path path = Paths.get(fileName); Scanner scanner = new Scanner(path); String [] string =scanner.nextLine().split(" "); arrayNumbers = Arrays.stream(string).mapToInt(Integer::parseInt).toArray(); printArray(arrayNumbers); System.out.println(); selectionSort(arrayNumbers); printArray(arrayNumbers); } //сортировка выбором - ищем минимум и ставим его в начало (в циклично сдвигающуюся левую границу) //О(n^2) public static void selectionSort(int[] array){ int min, temp; for (int index = 0; index < array.length-1; index++){ min = index; //ищем минимум for (int scan = index+1; scan < array.length; scan++){ if (array[scan] < array[min]) min = scan; } // Swap the values temp = array[min]; array[min] = array[index]; array[index] = temp; } } public static void printArray(int[]array){ for(int e:array){ System.out.print(e+" "); } } }
[ "anna_eleeva@yahoo.com" ]
anna_eleeva@yahoo.com
be55088bdcf78200671428d3673a88a729a45207
9c25a2ecfc9cbab40683411c6382cba6d07646af
/src/test/java/API/PetReq.java
ec24c20893c217a15759af4418851de030331f6c
[]
no_license
kadirszn/gitApi
3a6c28ca6dc3d2787c6913ad89515e1d2a4fb186
dd76c6efe213f46075d592670fe05abf82823c38
refs/heads/master
2022-12-19T17:24:36.911743
2020-07-06T19:03:01
2020-07-06T19:03:01
276,206,382
0
0
null
2020-10-13T23:12:38
2020-06-30T20:53:21
Java
UTF-8
Java
false
false
38
java
package API; public class PetReq { }
[ "kadirsuzen28@gmail.com" ]
kadirsuzen28@gmail.com
b2fee18bed24aff19309bbd6e3a0b044564fe69a
f2bd11b8fca9db146520b13eddad21485ad0255d
/src/chapter12/compound/p3_factory/RedheadDuck.java
6e390cc617711374e9e829014a453fcc3a3eeeef
[]
no_license
lukewaldron87/head-first-design-patterns
94b5ada720f2ac2c2779c0b544fe49dc508a4c95
f4395f356988f54983814051b9742974b4a202a9
refs/heads/master
2022-12-10T13:58:14.811548
2020-08-26T16:20:48
2020-08-26T16:20:48
279,800,943
0
0
null
null
null
null
UTF-8
Java
false
false
173
java
package chapter12.compound.p3_factory; public class RedheadDuck implements Quackable { @Override public void quack() { System.out.println("Quack"); } }
[ "lukewaldron87@gmail.com" ]
lukewaldron87@gmail.com
b85773b81f5febdb890c0f06a430a280c012c5f5
697e8d0a012693876df14ce2440b42d7818149ac
/XChange-develop/xchange-core/src/test/java/com/xeiam/xchange/dto/trade/UserTradeTest.java
d5d2f8837316074a8ecccf067180f489f8c4edf9
[ "MIT" ]
permissive
tochkov/coin-eye
0bdadf195408d77dda220d6558ebc775330ee75c
f04bb141cab3a04d348b04bbf9f00351176bb8d3
refs/heads/master
2021-01-01T04:26:00.984029
2016-04-15T14:22:17
2016-04-15T14:22:17
56,127,186
2
5
null
null
null
null
UTF-8
Java
false
false
2,887
java
package com.xeiam.xchange.dto.trade; import static org.fest.assertions.api.Assertions.assertThat; import java.math.BigDecimal; import java.util.Date; import com.xeiam.xchange.currency.Currency; import org.junit.Test; import com.xeiam.xchange.currency.CurrencyPair; import com.xeiam.xchange.dto.Order.OrderType; public class UserTradeTest { @Test public void testBuilder() { final OrderType type = OrderType.BID; final BigDecimal tradableAmount = new BigDecimal("99.401"); final CurrencyPair currencyPair = CurrencyPair.LTC_BTC; final BigDecimal price = new BigDecimal("251.64"); final Date timestamp = new Date(); final String id = "id"; final String orderId = "OrderId"; final BigDecimal feeAmount = new BigDecimal("0.0006"); final Currency feeCurrency = Currency.BTC; final UserTrade copy = new UserTrade.Builder().type(type).tradableAmount(tradableAmount).currencyPair(currencyPair).price(price) .timestamp(timestamp).id(id).orderId(orderId).feeAmount(feeAmount).feeCurrency(feeCurrency).build(); assertThat(copy.getType()).isEqualTo(type); assertThat(copy.getTradableAmount()).isEqualTo(tradableAmount); assertThat(copy.getCurrencyPair()).isEqualTo(currencyPair); assertThat(copy.getPrice()).isEqualTo(price); assertThat(copy.getTimestamp()).isEqualTo(timestamp); assertThat(copy.getId()).isEqualTo(id); assertThat(copy.getOrderId()).isEqualTo(orderId); assertThat(copy.getFeeAmount()).isEqualTo(feeAmount); assertThat(copy.getFeeCurrency()).isEqualTo(feeCurrency); } @Test public void testBuilderFrom() { final OrderType type = OrderType.ASK; final BigDecimal tradableAmount = new BigDecimal("100.501"); final CurrencyPair currencyPair = CurrencyPair.BTC_USD; final BigDecimal price = new BigDecimal("250.34"); final Date timestamp = new Date(); final String id = "id"; final String orderId = "OrderId"; final BigDecimal feeAmount = new BigDecimal("0"); final Currency feeCurrency = Currency.BTC; final UserTrade original = new UserTrade(type, tradableAmount, currencyPair, price, timestamp, id, orderId, feeAmount, feeCurrency); final UserTrade copy = UserTrade.Builder.from(original).build(); assertThat(copy.getType()).isEqualTo(original.getType()); assertThat(copy.getTradableAmount()).isEqualTo(original.getTradableAmount()); assertThat(copy.getCurrencyPair()).isEqualTo(original.getCurrencyPair()); assertThat(copy.getPrice()).isEqualTo(original.getPrice()); assertThat(copy.getTimestamp()).isEqualTo(original.getTimestamp()); assertThat(copy.getId()).isEqualTo(original.getId()); assertThat(copy.getOrderId()).isEqualTo(original.getOrderId()); assertThat(copy.getFeeAmount()).isEqualTo(original.getFeeAmount()); assertThat(copy.getFeeCurrency()).isEqualTo(original.getFeeCurrency()); } }
[ "philip.tochkov@gmail.com" ]
philip.tochkov@gmail.com
ce7eb7f6c691cfc51413337979039f620d3e0192
79c5af5328924648a5b0b2310c859be4e3b94aa2
/app/src/main/java/com/edu/peers/managers/ContentCommentsManager.java
7dcbb67f92a7ec243775ddfe8b11f98e41bed334
[]
no_license
Kibnelson/CS6460_final_project
ef3dbca99a6ecabf64c5847be7ae0bcb5b035eda
417f6faf021b7a049e89469ccfb2af6936da2804
refs/heads/master
2021-01-20T06:03:42.999013
2017-04-30T07:38:47
2017-04-30T07:38:47
89,835,768
0
1
null
null
null
null
UTF-8
Java
false
false
1,979
java
package com.edu.peers.managers; import com.google.gson.Gson; import android.content.Context; import com.cloudant.sync.documentstore.DocumentRevision; import com.edu.peers.cloudant.CloudantStore; import com.edu.peers.models.ContentCommentsObject; import com.edu.peers.others.AppException; import com.edu.peers.others.Constants; import com.edu.peers.others.Hash; import org.json.JSONObject; /** * Created by nelson on 6/15/15. */ public class ContentCommentsManager { private CloudantStore cloudantStore; private Context context; public ContentCommentsManager(CloudantStore cloudantStore, Context context) { this.cloudantStore = cloudantStore; this.context = context; } /** * Authenticate a User * * @throws AppException App Exception */ public static boolean authenticate(String clearPassword, String encryptedPassword) throws AppException { if (Hash.checkPassword(clearPassword, encryptedPassword)) { return true; } return false; } public void addContentComment(ContentCommentsObject contentCommentsObject) { try { JSONObject jsonObject = new JSONObject(new Gson().toJson(contentCommentsObject)); cloudantStore.addDocument(jsonObject, Constants.CONTENT_FILES_COMMENTS); } catch (Exception e) { e.printStackTrace(); } } public ContentCommentsObject getContentObjectComments() { DocumentRevision basicDocumentRevision; ContentCommentsObject contentCommentsObject = null; try { basicDocumentRevision = cloudantStore.getDocument(Constants.CONTENT_FILES_COMMENTS); if (basicDocumentRevision != null) { contentCommentsObject = new Gson().fromJson(basicDocumentRevision.getBody().toString(), ContentCommentsObject.class); } } catch (Exception e) { e.printStackTrace(); } return contentCommentsObject; } public int getDocumentCount() { return cloudantStore.getDocumentCount(); } }
[ "nelsonbo@ke.ibm.com" ]
nelsonbo@ke.ibm.com
5cf026070a6e8daebd223d4b10dc0092291472be
b18f923e3dae20fafc47a861f72e14cb50348a88
/app/src/main/java/com/example/worklesson/MainBlackTheme.java
eb8b43a4ed7cf7f99e5f5691e4c1c2358df2fe77
[]
no_license
akmred/dz_Lesson
1083ccd95ccf119e9a1de0eb3caf40af23980333
68d3a1cda4eabd734779b6133c57f30c3e9d2bd9
refs/heads/master
2021-03-12T14:48:35.467841
2020-05-24T11:02:30
2020-05-24T11:02:30
246,629,960
0
0
null
2020-06-08T17:34:31
2020-03-11T16:58:06
Java
UTF-8
Java
false
false
751
java
package com.example.worklesson; public final class MainBlackTheme { // Внутреннее поле будет хранить единственный экземляр private static MainBlackTheme blackTheme = null; //Поле для синхронизации private static final Object synsObj = new Object(); private boolean isBlackTheme; private MainBlackTheme(){ this.isBlackTheme = false; } public boolean getIsBlackTheme(){ return this.isBlackTheme; } public static MainBlackTheme getBlackTheme(){ synchronized (synsObj){ if (blackTheme == null){ blackTheme = new MainBlackTheme(); } return blackTheme; } } }
[ "akmred@gmail.com" ]
akmred@gmail.com
3caf6c6df3fb8bb54eabaf78ba8e527a000fd17e
dac81dba47bed920c133e1a4dc2e9486ea8fffc0
/src/main/java/com/example/onboarding/products/application/port/in/CreateProductUseCase.java
fdcdf3dc811fea10950bd873442dd0fc09901976
[]
no_license
SindyFuentesG/onboardingLatam
8e768aeb678e7f1bd77e6fa8fb1b80f4f42c136e
364e9ba7ea24433b87ef8a411cfda0c97d7f7462
refs/heads/master
2022-12-28T12:17:01.791010
2020-10-01T19:47:50
2020-10-01T19:47:50
299,609,754
0
0
null
null
null
null
UTF-8
Java
false
false
462
java
package com.example.onboarding.products.application.port.in; import com.example.onboarding.products.application.domain.Product; import com.example.onboarding.products.application.domain.ProductNotCreated; import io.vavr.control.Try; import lombok.Value; public interface CreateProductUseCase { Try<Product> createProduct(CreateProductCommand command); @Value(staticConstructor = "of") class CreateProductCommand { ProductNotCreated product; } }
[ "sindy.fuentes@globant.com" ]
sindy.fuentes@globant.com
2960f38f631a69359d26ddf9ab7240cd85f35907
169582f78798241d3801b004dd4285e59abba68d
/libCore/src/main/java/com/fanwe/library/model/ViewRecter.java
7e7a18b8a4031318d6a20986feee06f1289c656a
[ "Apache-2.0" ]
permissive
crazyit/libcore-1.0.91
6f2e3a178eba719b366bf89228b79ca22889d180
4e4dfdb275ad3ca3520477520bb4c3f0354882cd
refs/heads/master
2022-11-18T13:37:40.480056
2020-07-10T04:02:20
2020-07-10T04:02:20
278,346,982
0
0
null
null
null
null
UTF-8
Java
false
false
845
java
package com.fanwe.library.model; import android.graphics.Rect; import android.view.View; import com.fanwe.library.utils.SDViewUtil; public class ViewRecter implements Recter { private View view; public ViewRecter(View view) { super(); this.view = view; } public View getView() { return view; } @Override public Rect getRect() { return SDViewUtil.getGlobalVisibleRect(view); } @Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof ViewRecter)) { return false; } ViewRecter viewRecter = (ViewRecter) o; if (!view.equals(viewRecter.getView())) { return false; } return true; } }
[ "768013173@qq.com" ]
768013173@qq.com
fe785ed44ce7d91ea7fcca779301a3cdfd854022
6acce9f946279ea9976dca92b82ec41df082541c
/spring-study/src/main/java/cn/guxiangfly/ext/MyApplicationListener.java
2a259f1b5636443668a4ae66bc2f8fd30be8c82d
[]
no_license
GuXiangFly/technology-study
a7d03a9c5590cb435b473de2ce3ee985ed3b803f
7325e65364fb7f1902c5347c9a5e19a637496b60
refs/heads/master
2022-07-07T08:46:26.657513
2022-06-09T08:58:56
2022-06-09T08:58:56
226,807,615
0
1
null
2021-04-08T14:58:52
2019-12-09T07:10:05
Java
UTF-8
Java
false
false
495
java
package cn.guxiangfly.ext; import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; @Component public class MyApplicationListener implements ApplicationListener<ApplicationEvent> { //当容器中发布此事件以后,方法触发 @Override public void onApplicationEvent(ApplicationEvent event) { // TODO Auto-generated method stub System.out.println("收到事件:"+event); } }
[ "guxiang02@meituan.com" ]
guxiang02@meituan.com
b7b8a0839a9915921663577b3f10fbeef7ed2d57
988e2554bb45e565d0d3af43c1d1791e0167c624
/src/main/java/Robot.java
d79bc4b2b57c0d4daf1df8888d74625bcfdeca25
[]
no_license
benjaminbowen00/MartianRobotTestingSurface
fbf3fc28dad03b9dd52253e2bbf4e6f28e8eba23
b95905658f7b1a33a0f651a2792b199c82afce53
refs/heads/master
2021-05-05T10:03:54.407471
2018-01-18T08:08:58
2018-01-18T08:08:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,249
java
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static java.lang.StrictMath.floorMod; public class Robot { private ArrayList<Integer> position; private String orientation; private String routeDirections; private boolean lost; public Robot(Integer xStart, Integer yStart, String orientation, String routeDirections) { this.position = new ArrayList<>(Arrays.asList(xStart, yStart)); this.orientation = orientation; this.routeDirections = routeDirections; this.lost = false; } public String getOrientation() { return orientation; } public void setOrientation(String orientation) { this.orientation = orientation; } public ArrayList<Integer> getPosition() { return position; } public String getRouteDirections() { return routeDirections; } public void setPosition(ArrayList<Integer> position) { this.position = position; } public boolean isLost() { return lost; } public void setLost(boolean lost) { this.lost = lost; } public void turnR(){ List<String> compassPoints = Arrays.asList("N", "E", "S", "W"); int currentOrientationIndex = compassPoints.indexOf(this.getOrientation()); int newOrientationIndex = floorMod(currentOrientationIndex +1, 4); this.setOrientation(compassPoints.get(newOrientationIndex)); } public void turnL(){ List<String> compassPoints = Arrays.asList("N", "E", "S", "W"); int currentOrientationIndex = compassPoints.indexOf(this.getOrientation()); int newOrientationIndex = floorMod(currentOrientationIndex -1, 4); this.setOrientation(compassPoints.get(newOrientationIndex)); } public void moveF(){ switch(this.getOrientation()){ case "N":{Integer newY = this.getPosition().get(1) +1 ; this.position.set(1, newY); } break; case "E": {Integer newX = this.getPosition().get(0) +1 ; this.position.set(0, newX); } break; case"S": {Integer newY = this.getPosition().get(1) -1 ; this.position.set(1, newY); } break; case "W": {Integer newX = this.getPosition().get(0) -1 ; this.position.set(0, newX); } break; } } public ArrayList<Integer> testF(ArrayList<Integer> currentPosition){ ArrayList<Integer> currentPosition2 = new ArrayList<>(currentPosition); switch(this.getOrientation()){ case "N":{Integer newY = currentPosition2.get(1) +1 ; currentPosition2.set(1, newY); return currentPosition2;} case "E": {Integer newX = currentPosition2.get(0) +1 ; currentPosition2.set(0, newX); return currentPosition2; } case"S": {Integer newY = currentPosition2.get(1) -1 ; currentPosition2.set(1, newY); return currentPosition2; } case "W": {Integer newX = currentPosition2.get(0) -1 ; currentPosition2.set(0, newX); return currentPosition2; } } return currentPosition2; } }
[ "benjibowen@hotmail.com" ]
benjibowen@hotmail.com
01e7aed5ea77d9a132d2158565aae62c3e170543
204e93089f82f8a901dd0bdf0155ad5db853cba5
/src/UserInterface/Airplane/AddAirplane.java
8f9bbafe1c08555dae594c970622c590fd5eb5aa
[]
no_license
AnjaliSajeevan/FlightBookingApplication-Java
2c11a91c565db7f7652232a62fec084769bcdd26
1570b6ece01883141c916a07a459932a04f5e06c
refs/heads/master
2023-04-19T04:18:38.818570
2021-04-30T19:30:06
2021-04-30T19:30:06
363,236,769
0
0
null
null
null
null
UTF-8
Java
false
false
19,830
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package UserInterface.Airplane; import Business.AirlinerDirectory; import Business.Airplane; import Business.User.Airliner; import java.awt.CardLayout; import java.awt.Component; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.Date; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.JPanel; /** * * @author sayu */ public class AddAirplane extends javax.swing.JPanel { /** * Creates new form AddAirplane */ private JPanel CardSequenceJPanel; private Airliner a; AddAirplane(JPanel CardSequenceJPanel, Airliner a) { initComponents(); this.CardSequenceJPanel = CardSequenceJPanel; this.a=a; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); txtAirplaneName = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); txtWingSpan = new javax.swing.JTextField(); txtHeight = new javax.swing.JTextField(); txtEngine = new javax.swing.JTextField(); txtLength = new javax.swing.JTextField(); btnCreate = new javax.swing.JButton(); backBtn = new javax.swing.JButton(); txtSeatingCapacity = new javax.swing.JTextField(); txtCabinWidth = new javax.swing.JTextField(); jLabel9 = new javax.swing.JLabel(); btnLoadDatas = new javax.swing.JButton(); setBackground(new java.awt.Color(0, 102, 102)); jLabel1.setFont(new java.awt.Font("Tahoma", 3, 18)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("CREATE AIRPLANE "); jLabel8.setText("Airplane Name:"); txtAirplaneName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtAirplaneNameActionPerformed(evt); } }); jLabel3.setText("Seating Capacity:"); jLabel4.setText("Engine Type:"); jLabel6.setText("Height of Airplane (m):"); jLabel7.setText("Wing span of Airplane (m):"); jLabel5.setText("Length of Airplane (m) :"); txtWingSpan.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtWingSpanActionPerformed(evt); } }); txtHeight.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtHeightActionPerformed(evt); } }); txtEngine.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtEngineActionPerformed(evt); } }); txtLength.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtLengthActionPerformed(evt); } }); btnCreate.setFont(new java.awt.Font("Tahoma", 3, 13)); // NOI18N btnCreate.setText("Create"); btnCreate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCreateActionPerformed(evt); } }); backBtn.setText("< BACK"); backBtn.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backBtnActionPerformed(evt); } }); txtSeatingCapacity.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtSeatingCapacityActionPerformed(evt); } }); txtCabinWidth.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtCabinWidthActionPerformed(evt); } }); jLabel9.setText("Cabin Width (m):"); btnLoadDatas.setFont(new java.awt.Font("Tahoma", 3, 13)); // NOI18N btnLoadDatas.setText("Load Data"); btnLoadDatas.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLoadDatasActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(23, 23, 23) .addComponent(backBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(160, 160, 160) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(txtAirplaneName, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel5) .addComponent(jLabel4) .addComponent(jLabel6) .addComponent(jLabel7) .addComponent(jLabel9) .addComponent(jLabel3) .addComponent(jLabel8)) .addGap(109, 109, 109) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txtEngine) .addComponent(txtLength) .addComponent(txtHeight, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(txtWingSpan, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(txtCabinWidth, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(txtSeatingCapacity, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(btnCreate, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(57, 57, 57) .addComponent(btnLoadDatas) .addGap(42, 42, 42))))) .addContainerGap(250, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jLabel1) .addGap(307, 307, 307)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(58, 58, 58) .addComponent(backBtn) .addGap(54, 54, 54) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 141, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtSeatingCapacity, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtAirplaneName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(jLabel3) .addGap(9, 9, 9))) .addGap(27, 27, 27) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtEngine, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addGap(32, 32, 32) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(txtLength, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(25, 25, 25) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(txtHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(26, 26, 26) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtWingSpan, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtCabinWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9)) .addGap(115, 115, 115) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnLoadDatas, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnCreate, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(144, 144, 144)) ); }// </editor-fold>//GEN-END:initComponents private void txtAirplaneNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtAirplaneNameActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtAirplaneNameActionPerformed private void txtWingSpanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtWingSpanActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtWingSpanActionPerformed private void txtHeightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtHeightActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtHeightActionPerformed private void txtEngineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEngineActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtEngineActionPerformed private void txtLengthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtLengthActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtLengthActionPerformed private void btnCreateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCreateActionPerformed // TODO add your handling code here: String airlineName = txtAirplaneName.getText(); if(airlineName==null || airlineName.equalsIgnoreCase("")) { JOptionPane.showMessageDialog(null, "Please enter proper Airplane Name"); return; } String seating=txtSeatingCapacity.getText(); try{ Integer.parseInt(seating); }catch(NumberFormatException e){ JOptionPane.showMessageDialog(null, "Please type in a number for Seat Capacity"); return;} // int seating = Integer.parseInt(txtSeatingCapacity.getText()); String engine = txtEngine.getText(); if(engine==null || engine.equalsIgnoreCase("")) { JOptionPane.showMessageDialog(null, "Please enter proper engine details"); return; } String wingSpan = txtWingSpan.getText(); if(wingSpan==null || engine.equalsIgnoreCase("")) { JOptionPane.showMessageDialog(null, "Please enter proper wing span"); return; } String length = txtLength.getText(); if(length==null || length.equalsIgnoreCase("")) { JOptionPane.showMessageDialog(null, "Please enter proper length"); return; } String height = txtHeight.getText(); if(height==null || height.equalsIgnoreCase("")) { JOptionPane.showMessageDialog(null, "Please enter proper height"); return; } String cabinWidth = txtCabinWidth.getText(); if(cabinWidth==null || cabinWidth.equalsIgnoreCase("")) { JOptionPane.showMessageDialog(null, "Please enter proper cabin width"); return; } Airplane p = a.getAirplaneDirectory().addAirplane(); p.setAirplaneName(airlineName); p.setSeatingCapacity(Integer.parseInt(seating)); p.setEngine(engine); p.setLength(length); p.setHeight(height); p.setWingspan(wingSpan); p.setCabinWidth(cabinWidth); JOptionPane.showMessageDialog(null, "Airplane Created Successfully"); txtCabinWidth.setText(""); txtHeight.setText(""); txtLength.setText(""); txtWingSpan.setText(""); txtEngine.setText(""); txtAirplaneName.setText(""); txtSeatingCapacity.setText(""); }//GEN-LAST:event_btnCreateActionPerformed private void backBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBtnActionPerformed // TODO add your handling code here: CardSequenceJPanel.remove(this); Component[] componentArray = CardSequenceJPanel.getComponents(); Component component = componentArray[componentArray.length - 1]; ManageAirplane manageAirplane = (ManageAirplane) component; manageAirplane.populateTable(); CardLayout layout = (CardLayout) CardSequenceJPanel.getLayout(); layout.previous(CardSequenceJPanel); }//GEN-LAST:event_backBtnActionPerformed private void txtSeatingCapacityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSeatingCapacityActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtSeatingCapacityActionPerformed private void txtCabinWidthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCabinWidthActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtCabinWidthActionPerformed private void btnLoadDatasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoadDatasActionPerformed // TODO add your handling code here: String filepath = "C:\\Users\\anjal\\Documents\\NetBeansProjects\\Assignment4\\Emirates.csv"; File file = new File(filepath); String line =null; String name; int seat; String Engine; String Length; String Height ; String wingspan; String cabinsize; BufferedReader br; try { br = new BufferedReader(new FileReader(file)); for(int i=0;i<10;i++) { while((line = br.readLine()) != null ){ String[] temp = line.split(","); name=temp[0]; seat=Integer.parseInt(temp[1]); Engine=temp[2]; Length=temp[3]; Height=temp[4]; wingspan=temp[5]; cabinsize=temp[6]; Airplane p = a.getAirplaneDirectory().addAirplane(); p.setAirplaneName(name); p.setSeatingCapacity(seat); p.setEngine(Engine); p.setLength(Length); p.setHeight(Height); p.setWingspan(wingspan); p.setCabinWidth(cabinsize); } }} catch (FileNotFoundException ex) { Logger.getLogger(AddAirplane.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(AddAirplane.class.getName()).log(Level.SEVERE, null, ex); } JOptionPane.showMessageDialog(null, "Data Successfully Loaded"); }//GEN-LAST:event_btnLoadDatasActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton backBtn; private javax.swing.JButton btnCreate; private javax.swing.JButton btnLoadDatas; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JTextField txtAirplaneName; private javax.swing.JTextField txtCabinWidth; private javax.swing.JTextField txtEngine; private javax.swing.JTextField txtHeight; private javax.swing.JTextField txtLength; private javax.swing.JTextField txtSeatingCapacity; private javax.swing.JTextField txtWingSpan; // End of variables declaration//GEN-END:variables }
[ "sajeevan.a@northeastern.edu" ]
sajeevan.a@northeastern.edu
c4a5d752a8ce5ef02ba11a182706e6adb2d24bc5
364e81cb0c01136ac179ff42e33b2449c491b7e5
/spell/tags/1.5.0/spel-gui/spel-client-codeview/src/com/astra/ses/spell/gui/presentation/code/Activator.java
a56f7ce832aa4a678f4c6015477cc300d20b0ead
[]
no_license
unnch/spell-sat
2b06d9ed62b002e02d219bd0784f0a6477e365b4
fb11a6800316b93e22ee8c777fe4733032004a4a
refs/heads/master
2021-01-23T11:49:25.452995
2014-10-14T13:04:18
2014-10-14T13:04:18
42,499,379
0
0
null
null
null
null
UTF-8
Java
false
false
3,862
java
/////////////////////////////////////////////////////////////////////////////// // // PACKAGE : com.astra.ses.spell.gui.presentation.code // // FILE : Activator.java // // DATE : 2008-11-21 08:55 // // Copyright (C) 2008, 2010 SES ENGINEERING, Luxembourg S.A.R.L. // // By using this software in any way, you are agreeing to be bound by // the terms of this license. // // All rights reserved. This program and the accompanying materials // are made available under the terms of the Eclipse Public License v1.0 // which accompanies this distribution, and is available at // http://www.eclipse.org/legal/epl-v10.html // // NO WARRANTY // EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED // ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER // EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR // CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A // PARTICULAR PURPOSE. Each Recipient is solely responsible for determining // the appropriateness of using and distributing the Program and assumes all // risks associated with its exercise of rights under this Agreement , // including but not limited to the risks and costs of program errors, // compliance with applicable laws, damage to or loss of data, programs or // equipment, and unavailability or interruption of operations. // // DISCLAIMER OF LIABILITY // EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY // CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION // LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE // EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGES. // // Contributors: // SES ENGINEERING - initial API and implementation and/or initial documentation // // PROJECT : SPELL // // SUBPROJECT: SPELL GUI Client // /////////////////////////////////////////////////////////////////////////////// package com.astra.ses.spell.gui.presentation.code; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; /** * The activator class controls the plug-in life cycle */ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "com.astra.ses.spell.gui.codeview"; // The shared instance private static Activator plugin; /** * The constructor */ public Activator() { } /* * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) */ public void start(BundleContext context) throws Exception { super.start(context); plugin = this; System.out.println("[*] Activated: " + PLUGIN_ID); } /* * (non-Javadoc) * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) */ public void stop(BundleContext context) throws Exception { plugin = null; super.stop(context); } /** * Returns the shared instance * * @return the shared instance */ public static Activator getDefault() { return plugin; } /*************************************************************************** * Returns an image descriptor for the image file at the given * plug-in relative path * * @param path the path * @return the image descriptor **************************************************************************/ public static ImageDescriptor getImageDescriptor(String path) { return imageDescriptorFromPlugin(PLUGIN_ID, path); } }
[ "rafael.chinchilla@gmail.com" ]
rafael.chinchilla@gmail.com
48d921a6f2b7e5b1d969661b6794edd2c42f37c2
167dceb36d5464916274e7fdb40669f79de3ab14
/novel_web/src/main/java/com/microc/novel/web/controller/MyController.java
1ff0c9b2b9a604832b4d9eb6618e94ec0ca24332
[]
no_license
CuiChuping/novel
6963ba4f78748469cfd7af099ad3e6b8e6794aac
7685be563ff8413867bff6a86bcddae85fe1531d
refs/heads/master
2020-04-18T12:47:59.752621
2016-08-25T16:56:36
2016-08-25T16:56:36
66,576,108
27
18
null
null
null
null
UTF-8
Java
false
false
1,124
java
package com.microc.novel.web.controller; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import com.microc.novel.web.service.MyService; @Controller public class MyController { @Autowired private MyService myService; @RequestMapping("/my") public String my() { return "my/my"; } @RequestMapping("my/suggestion") public String suggestion() { return "my/suggestion"; } @RequestMapping("my/suggestionSubmit") public String suggestionSubmit(HttpServletRequest request, String contactWay, String suggestion) { //后期可添加获取更多信息 myService.suggestionSubmit(contactWay, suggestion); System.err.println("sdsd"); return "my/my"; } @RequestMapping("my/callus") public String callus() { return "my/callus"; } @RequestMapping("my/aboutSoftWare") public String aboutSoftWare() { return "my/aboutSoftWare"; } @RequestMapping("my/relief") public String relief() { return "my/relief"; } }
[ "820072274@qq.com" ]
820072274@qq.com
1c61ad80d16b305bc5d24fc90960141e94c567e4
a23f83907dcc649779366bce06b233a1175d9598
/app/src/main/java/com/zaimutest777/zaim/bottombar/BottomBarActivity.java
461dc83f1ae603235af630e7375f3e2c669ff03e
[]
no_license
ilhamShih/Zaim
17715f1c0f4c424be8d208c4912191546a8dabf9
f275393351e10dcca150cb696a83342e338bc7dd
refs/heads/master
2023-07-21T21:24:42.755514
2021-09-02T12:05:53
2021-09-02T12:05:53
402,369,955
1
0
null
null
null
null
UTF-8
Java
false
false
2,665
java
package com.zaimutest777.zaim.bottombar; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.fragment.app.Fragment; import com.google.android.material.bottomnavigation.BottomNavigationView; import com.zaimutest777.zaim.R; import com.zaimutest777.zaim.bottombar.fragments.CardFragment; import com.zaimutest777.zaim.bottombar.fragments.KredityFragment; import com.zaimutest777.zaim.bottombar.fragments.ZaimyFragment; public class BottomBarActivity extends AppCompatActivity { Toolbar toolbar; private static final String SELECTION = "SELECTION"; private BottomNavigationView bottomNavigationView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); toolbar = findViewById(R.id.toolbar); // setSupportActionBar(toolbar); setupBottomMenu(savedInstanceState); } @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(SELECTION, bottomNavigationView.getSelectedItemId()); } private void setupToolbar() { } private void setupBottomMenu(Bundle savedInstanceState) { bottomNavigationView = findViewById(R.id.bottom_navigation); bottomNavigationView.setOnNavigationItemSelectedListener(item -> { switch (item.getItemId()) { case R.id.page_home: showFragment(new ZaimyFragment()); toolbar.setTitle(R.string.bottom_nav_home); break; case R.id.page_list: showFragment(new CardFragment()); toolbar.setTitle(R.string.bottom_nav_list); break; case R.id.page_fav: showFragment(new KredityFragment()); toolbar.setTitle(R.string.bottom_nav_fav); break; default: throw new IllegalArgumentException("item not implemented : " + item.getItemId()); } return true; }); if (savedInstanceState == null) { bottomNavigationView.setSelectedItemId(R.id.page_home); } else { bottomNavigationView.setSelectedItemId(savedInstanceState.getInt(SELECTION)); } } private void showFragment(Fragment frg) { getSupportFragmentManager() .beginTransaction() .replace(R.id.container, frg) .commitAllowingStateLoss(); } }
[ "shihnazarow@gmail.com" ]
shihnazarow@gmail.com
992ade35020c38befdf59f32861b7c110cf46a37
d4b7c73a213d45c13e1d2774e5efa09704161951
/app/src/androidTest/java/dmg/xqg/com/surfaceviewtest/ExampleInstrumentedTest.java
797570fcb91ee732c95bba32c7c2bd35bf1a3c54
[ "Apache-2.0" ]
permissive
xqgdmg/SurfaceViewTest
28472cf4bb303e939226ca4dc5408523ac462643
b8b09e4aae9fbd646da4fa358a3ea34397ec031d
refs/heads/master
2021-05-12T13:04:36.031942
2018-01-10T09:15:12
2018-01-10T09:15:12
116,927,340
0
0
null
null
null
null
UTF-8
Java
false
false
758
java
package dmg.xqg.com.surfaceviewtest; 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.*; /** * Instrumentation 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("dmg.xqg.com.surfaceviewtest", appContext.getPackageName()); } }
[ "zhenxing@2016" ]
zhenxing@2016
d5898d42ddee9af87e07b3ba9d7f689b10f03538
0205999a193bf670cd9d6e5b37e342b75f4e15b8
/spring-test/src/test/java/org/springframework/test/web/servlet/htmlunit/MockMvcConnectionBuilderSupportTests.java
25ea35091febcf736d189ac696e07a1cfcd9e9c1
[ "Apache-2.0" ]
permissive
leaderli/spring-source
18aa9a8c7c5e22d6faa6167e999ff88ffa211ba0
0edd75b2cedb00ad1357e7455a4fe9474b3284da
refs/heads/master
2022-02-18T16:34:19.625966
2022-01-29T08:56:48
2022-01-29T08:56:48
204,468,286
0
0
null
null
null
null
UTF-8
Java
false
false
5,674
java
/* * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.test.web.servlet.htmlunit; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebConnection; import com.gargoylesoftware.htmlunit.WebRequest; import com.gargoylesoftware.htmlunit.WebResponse; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.net.URL; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; /** * Integration tests for {@link MockMvcWebConnectionBuilderSupport}. * * @author Rob Winch * @author Rossen Stoyanchev * @since 4.2 */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration @WebAppConfiguration @SuppressWarnings("rawtypes") public class MockMvcConnectionBuilderSupportTests { private final WebClient client = mock(WebClient.class); private MockMvcWebConnectionBuilderSupport builder; @Autowired private WebApplicationContext wac; @Before public void setup() { given(this.client.getWebConnection()).willReturn(mock(WebConnection.class)); this.builder = new MockMvcWebConnectionBuilderSupport(this.wac) { }; } @Test public void constructorMockMvcNull() { assertThatIllegalArgumentException().isThrownBy(() -> new MockMvcWebConnectionBuilderSupport((MockMvc) null) { }); } @Test public void constructorContextNull() { assertThatIllegalArgumentException().isThrownBy(() -> new MockMvcWebConnectionBuilderSupport((WebApplicationContext) null) { }); } @Test public void context() throws Exception { WebConnection conn = this.builder.createConnection(this.client); assertMockMvcUsed(conn, "http://localhost/"); assertMockMvcNotUsed(conn, "https://example.com/"); } @Test public void mockMvc() throws Exception { MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); WebConnection conn = new MockMvcWebConnectionBuilderSupport(mockMvc) { }.createConnection(this.client); assertMockMvcUsed(conn, "http://localhost/"); assertMockMvcNotUsed(conn, "https://example.com/"); } @Test public void mockMvcExampleDotCom() throws Exception { WebConnection conn = this.builder.useMockMvcForHosts("example.com").createConnection(this.client); assertMockMvcUsed(conn, "http://localhost/"); assertMockMvcUsed(conn, "https://example.com/"); assertMockMvcNotUsed(conn, "http://other.example/"); } @Test public void mockMvcAlwaysUseMockMvc() throws Exception { WebConnection conn = this.builder.alwaysUseMockMvc().createConnection(this.client); assertMockMvcUsed(conn, "http://other.example/"); } @Test public void defaultContextPathEmpty() throws Exception { WebConnection conn = this.builder.createConnection(this.client); assertThat(getResponse(conn, "http://localhost/abc").getContentAsString()).isEqualTo(""); } @Test public void defaultContextPathCustom() throws Exception { WebConnection conn = this.builder.contextPath("/abc").createConnection(this.client); assertThat(getResponse(conn, "http://localhost/abc/def").getContentAsString()).isEqualTo("/abc"); } private void assertMockMvcUsed(WebConnection connection, String url) throws Exception { assertThat(getResponse(connection, url)).isNotNull(); } private void assertMockMvcNotUsed(WebConnection connection, String url) throws Exception { assertThat(getResponse(connection, url)).isNull(); } private WebResponse getResponse(WebConnection connection, String url) throws IOException { return connection.getResponse(new WebRequest(new URL(url))); } @Configuration @EnableWebMvc static class Config { @RestController static class ContextPathController { @RequestMapping("/def") public String contextPath(HttpServletRequest request) { return request.getContextPath(); } } } }
[ "429243408@qq.com" ]
429243408@qq.com
3491b115650a4e21212c40a5cd69bd80ab6baeab
70ee64048a861ad7dfb9df7b3453627d6f429ae9
/src/main/java/com/jsst/cloud/provider/DemoProvider.java
124d41ef2954215f6e9fe67f944bb2cd4350ff32
[]
no_license
2925807448/MDAutospace
d1a7a6381bb7a4ffa8c0a231b82b34c7c10ae06b
a837a97c1fa044b6102ed5182ece8d01eab1380f
refs/heads/master
2020-05-09T16:22:50.908946
2019-04-14T06:23:27
2019-04-14T06:23:27
181,268,259
0
0
null
null
null
null
UTF-8
Java
false
false
695
java
package com.jsst.cloud.provider; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.annotations.DataProvider; public class DemoProvider { private static final Logger logger = LoggerFactory.getLogger(DemoProvider.class); @DataProvider(name = "providerDemoData") public static Object[][] providerDemoData(Method method) { System.out.println(method.getName()); Object[][] result = null; if (method.getName().equals("testGetInterface")) { result = new Object[][] { new Object[] { "86a9bce0-e887-11e8-868d-23e1e07aa73d" } }; } return result; } }
[ "2925807448@qq.com" ]
2925807448@qq.com
66290565d7460dfa82ff45adcafe6d5fb14d0525
f9a6066dbc06b8f58502b9b5672d4f415670df16
/Test/app/src/main/java/com/example/root/test/MainActivity.java
fedc3ba7dd875c05fffed84511367f74bf2a5397
[ "CC-BY-4.0", "Apache-2.0", "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-unknown-license-reference" ]
permissive
okwow123/firebaselogin
08185d1d8865ee3f3a486ee91280862dda75e745
40bbd989ad41032e167dfb6285ba8cdb5231dd43
refs/heads/master
2020-12-02T08:10:00.483494
2017-08-07T13:00:56
2017-08-07T13:00:56
96,778,650
0
0
null
null
null
null
UTF-8
Java
false
false
334
java
package com.example.root.test; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } }
[ "okwow123@naver.com" ]
okwow123@naver.com
92e74588d383e1e3c1bea560ff3f19695a2c4a1e
d73bc47f0fc62db2f4696b94c76aa61a945cdae7
/src/test/java/authzserver/AuthzServerApplicationTest.java
e658498d4ae638639fb468651add13ea4b35a987
[ "Apache-2.0" ]
permissive
OpenConext-Attic/OpenConext-authorization-server
a8aca1e76983297088ad65961d9f91c3c964c728
cced3dcdffa183692f375f46880ca581dd4c5863
refs/heads/master
2023-01-31T22:42:58.638288
2020-12-16T08:10:16
2020-12-16T08:10:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,650
java
package authzserver; import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.github.tomakehurst.wiremock.verification.LoggedRequest; import org.apache.commons.codec.binary.Base64; import org.junit.Rule; import org.junit.Test; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import static authzserver.shibboleth.ShibbolethPreAuthenticatedProcessingFilter.SHIB_AUTHENTICATING_AUTHORITY; import static authzserver.shibboleth.ShibbolethPreAuthenticatedProcessingFilter.SHIB_DISPLAY_NAME; import static authzserver.shibboleth.ShibbolethPreAuthenticatedProcessingFilter.SHIB_EDU_PERSON_PRINCIPAL_NAME; import static authzserver.shibboleth.ShibbolethPreAuthenticatedProcessingFilter.SHIB_EMAIL; import static authzserver.shibboleth.ShibbolethPreAuthenticatedProcessingFilter.SHIB_NAME_ID_HEADER_NAME; import static authzserver.shibboleth.ShibbolethPreAuthenticatedProcessingFilter .SHIB_SCHAC_HOME_ORGANIZATION_HEADER_NAME; import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.findAll; import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor; import static com.github.tomakehurst.wiremock.client.WireMock.matching; import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class AuthzServerApplicationTest extends AbstractIntegrationTest{ private String callback = "http://localhost:8889/callback"; @Rule public WireMockRule wireMockRule = new WireMockRule(8889); @Test public void test_skip_confirmation_autoapprove_true() throws InterruptedException { String serverUrl = "http://localhost:" + this.port; HttpHeaders headers = getShibHttpHeaders(); wireMockRule.stubFor(get(urlMatching("/callback.*")).withQueryParam("code", matching(".*")).willReturn(aResponse().withStatus(200))); ResponseEntity<String> response = restTemplate.exchange(serverUrl + "/oauth/authorize?response_type=code&client_id=test_client&scope=read&redirect_uri={callback}", HttpMethod.GET, new HttpEntity<>(headers), String.class, Collections.singletonMap("callback", callback)); assertEquals(200, response.getStatusCode().value()); List<LoggedRequest> requests = findAll(getRequestedFor(urlMatching("/callback.*"))); assertEquals(1, requests.size()); String authorizationCode = requests.get(0).queryParameter("code").firstValue(); addAuthorizationHeaders(headers); MultiValueMap<String, String> bodyMap = getAuthorizationCodeFormParameters(authorizationCode); Map body = restTemplate.exchange(serverUrl + "/oauth/token", HttpMethod.POST, new HttpEntity<>(bodyMap, headers), Map.class).getBody(); assertEquals("bearer", body.get("token_type")); String accessToken = (String) body.get("access_token"); assertNotNull(accessToken); // Now for the completeness of the scenario retrieve the Principal (e.g. impersonating a Resource Server) using the accessCode MultiValueMap<String, String> formData = new LinkedMultiValueMap<>(); formData.add("token", accessToken); Map principal = restTemplate.exchange(serverUrl + "/oauth/check_token", HttpMethod.POST, new HttpEntity<>(formData, headers), Map.class).getBody(); assertEquals("urn:collab:person:example.com:mock-user", principal.get("user_name")); assertEquals("admin@example.com", principal.get("email")); assertEquals("admin@example.com", principal.get("eduPersonPrincipalName")); assertEquals("John Doe", principal.get("displayName")); //resourceIds assertEquals(Arrays.asList("groups", "whatever" ), principal.get("aud")); } @Test public void testErrorPage() { String url = "http://localhost:" + this.port + "/bogus"; Map map = testRestTemplate.getForObject(url, Map.class); assertEquals(500, map.get("status")); HttpHeaders headers = getShibHttpHeaders(); ResponseEntity<Map> response = testRestTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(headers), Map.class); assertEquals(404, response.getBody().get("status")); } @Test public void testOpenRedirectResourceServer() throws Exception { HttpHeaders headers = getShibHttpHeaders(); String serverUrl = "http://localhost:" + this.port + "/oauth/authorize?response_type=code&client_id=test_resource_server&scope=read&redirect_uri=https://google.com"; ResponseEntity<String> response = testRestTemplate.exchange(serverUrl, HttpMethod.GET, new HttpEntity<>(headers), String.class, callback); assertEquals(400, response.getStatusCode().value()); String body = response.getBody(); assertTrue(body.contains("A redirect_uri can only be used by implicit or authorization_code grant types")); } private MultiValueMap<String, String> getAuthorizationCodeFormParameters(String authorizationCode) { MultiValueMap<String, String> bodyMap = new LinkedMultiValueMap<>(); bodyMap.add("grant_type", "authorization_code"); bodyMap.add("code", authorizationCode); bodyMap.add("redirect_uri", callback); return bodyMap; } private void addAuthorizationHeaders(HttpHeaders headers) { String authenticationCredentials = "Basic " + new String(Base64.encodeBase64(new String("test_client" + ":" + "secret").getBytes(Charset.forName("UTF-8")))); headers.add("Authorization", authenticationCredentials); headers.add("Content-Type", "application/x-www-form-urlencoded"); headers.add("Accept", "application/json"); } private HttpHeaders getShibHttpHeaders() { HttpHeaders headers = new HttpHeaders(); headers.add(SHIB_NAME_ID_HEADER_NAME, "urn:collab:person:example.com:mock-user"); headers.add(SHIB_AUTHENTICATING_AUTHORITY, "my-university"); headers.add(SHIB_SCHAC_HOME_ORGANIZATION_HEADER_NAME, "example.com"); headers.add(SHIB_EMAIL, "admin@example.com"); headers.add(SHIB_EDU_PERSON_PRINCIPAL_NAME, "admin@example.com"); headers.add(SHIB_DISPLAY_NAME, "John Doe"); return headers; } }
[ "oharsta@zilverline.com" ]
oharsta@zilverline.com
3a53095496b22d6d6f07ad42a7c836c6c0342af4
e65459cfc4488d186363fbce47b0c24b79a898fe
/src/main/java/cn/stackflow/aums/common/bean/DeptDTO.java
17afc50fe1cb361a0093f5796cb51a03568c1188
[ "Apache-2.0" ]
permissive
yanmuzhang/aums-backend-java
4861a9dc8d9610fb5c64590ab169c1e591e1f23a
904d3e2a565d491c5f3f9795a7322ba91fbc58ed
refs/heads/master
2022-12-06T09:43:43.666649
2020-09-02T06:08:06
2020-09-02T06:08:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
621
java
package cn.stackflow.aums.common.bean; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; import javax.validation.constraints.NotEmpty; import java.time.LocalDateTime; /** * @author: zhangc/jaguar_zc@sina.com * @create: 2020-07-05 10:33 */ @Getter @Setter public class DeptDTO { private String id; @NotEmpty private String name;//账号 private String appId;//应用ID private String remark;//部门描述 @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime;//创建时间 private String createUser;//创建人 }
[ "jaguar_zc@sina.com" ]
jaguar_zc@sina.com
3251553ef233ac7bfc20c07da2409f30fd30aa44
f00f3694fb02747684d16ad8663b1cf21bb46f8d
/src/com/justdoit/samplecontentprovider/ToDoItem.java
3de930c996247280b8f86839fa664459e22c5532
[]
no_license
Venkat27/SimpleContentProvider
cd1af942ef7f758a48b857a90beb87443c1640de
d4932dcbd0b9d75119c95f7c300a5cd2a420c3e6
refs/heads/master
2020-04-18T02:48:22.037828
2014-04-10T05:58:50
2014-04-10T05:58:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
661
java
package com.justdoit.samplecontentprovider; import java.text.SimpleDateFormat; import java.util.Date; public class ToDoItem { String task; Date created; public String getTask() { return task; } public Date getCreated() { return created; } public ToDoItem(String _task) { this(_task, new Date(java.lang.System.currentTimeMillis())); } public ToDoItem(String _task, Date _created) { task = _task; created = _created; } @Override public String toString() { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy"); String dateString = sdf.format(created); return "(" + dateString + ") " + task; } }
[ "sivakishore.meka@gmail.com" ]
sivakishore.meka@gmail.com
4e6361baf4a6a169223f102fc18bc5392b66cccf
7f46306ced929b98cad7a107d1db6ccde14f228b
/test-es/src/test/java/com/cnn/testes/TestEsApplicationTests.java
b959c0fe240928810633f94a4780004f48c2e3be
[]
no_license
stxyg/study_demo
fda4e8feed04d74187fa6c56cdf72af8c6587857
e0d2ace0c07cce68247670e70449f1417de68a99
refs/heads/main
2023-04-10T22:31:42.371869
2021-04-15T17:17:06
2021-04-15T17:17:06
358,335,076
0
0
null
null
null
null
UTF-8
Java
false
false
206
java
package com.cnn.testes; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class TestEsApplicationTests { @Test void contextLoads() { } }
[ "ningning.cheng@100credit.com" ]
ningning.cheng@100credit.com
8076faaa021b270a7029e3c4759a7e5ce4a92fbe
c5afb92c0c941870f6a255915f53e45a35c15ffd
/src/com/codepath/apps/mytwitterapp/fragments/TweetsListFragment.java
3680fb81c8c690013debabf4099cbec72c60ac8d
[]
no_license
karayu/CodepathTwitter
21f4068854574878ad011e130489ed1f9f282650
ef5035a7f716961904dc7053467de5949c80a1b2
refs/heads/master
2016-09-05T17:33:46.441236
2013-10-31T09:03:49
2013-10-31T09:03:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,261
java
package com.codepath.apps.mytwitterapp.fragments; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONObject; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Toast; import com.codepath.apps.mytwitterapp.EndlessScrollListener; import com.codepath.apps.mytwitterapp.MyTwitterClientApp; import com.codepath.apps.mytwitterapp.R; import com.codepath.apps.mytwitterapp.TweetsAdapter; import com.codepath.apps.mytwitterapp.models.Tweet; import com.loopj.android.http.JsonHttpResponseHandler; import eu.erikw.PullToRefreshListView; import eu.erikw.PullToRefreshListView.OnRefreshListener; public abstract class TweetsListFragment extends Fragment { TweetsAdapter adapter; PullToRefreshListView lvTweets; long min_id = 0; boolean refresh = false; @Override public View onCreateView(LayoutInflater inf, ViewGroup parent, Bundle savedInstanceState) { return inf.inflate(R.layout.fragment_tweets_list, parent, false); } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); ArrayList<Tweet> tweets = new ArrayList<Tweet>(); adapter = new TweetsAdapter(getActivity(), tweets); lvTweets = (PullToRefreshListView) getActivity().findViewById(R.id.lvTweets); lvTweets.setAdapter(adapter); //endless scroll listener lvTweets.setOnScrollListener(new EndlessScrollListener() { @Override public void onLoadMore(int page, int totalItemsCount) { fetchTimelineAsync(); } }); // Set a listener to be invoked when user pulls down lvTweets.setOnRefreshListener(new OnRefreshListener() { @Override public void onRefresh() { refresh = true; fetchTimelineAsync(); } }); } public abstract void fetchTimelineAsync(); public TweetsAdapter getAdapter() { return adapter; } /*public void setMinId(Long m) { min_id = m; } public long getMinId() { return min_id; }*/ }
[ "lele.yu@gmail.com" ]
lele.yu@gmail.com
0dd3ff3d47fde136b32f39f241678b049e110a6d
5c25bc8ffd08d9b4c3a9342dd7e57f33e3cb6821
/src/com/remita/demo/epayment/BankBranchOps/PaySalaryViaRRRApprovalTest.java
c61347483f24af899833ece1bc6c39806d3529d0
[]
no_license
samsonojoMOOC/Selenium-Webdriver-RemitaPayment
f08c56643db5bcb840a9fb9dbf0a87e19125b26b
90db3155297754cf2319f116104228874441ac78
refs/heads/master
2020-04-06T03:42:00.450751
2017-03-25T18:33:58
2017-03-25T18:33:58
31,249,777
1
0
null
null
null
null
UTF-8
Java
false
false
1,646
java
package com.remita.demo.epayment.BankBranchOps; import java.io.IOException; import junit.framework.Assert; import org.apache.log4j.Logger; import org.junit.Assume; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.Alert; import org.openqa.selenium.By; import testsDemo.TestBase; import utilDemo.TestUtility; public class PaySalaryViaRRRApprovalTest extends TestBase{ Logger ApplicationLogs = Logger.getLogger("devpinoyLogger"); @Before public void beforeTest() throws IOException{ initialize(); ApplicationLogs.debug("Initializing the System"); // xlsx file if(TestUtility.isSkip("PaySalaryViaRRRApprovalTest")) Assume.assumeTrue(false); } @SuppressWarnings("deprecation") @Test public void massApprovalPaymentTest() throws InterruptedException{ // implement getObjectByXpath("lnk_inbox").click(); ApplicationLogs.debug("Pay Salary via RRR Approval Module: Clicked the Inbox Link" ); int size = driver.findElements(By.tagName("iframe")).size(); System.out.println("Total frames in page- "+size); driver.switchTo().frame(0); getObjectByXpath("lnk_transDetail").click(); ApplicationLogs.debug("Pay Salary via RRR Approval Module: Clicked the Transaction link" ); driver.findElement(By.id("record_1")).click(); ApplicationLogs.debug("Pay Salary via RRR Approval Module: Clicked the Radio button" ); driver.findElement(By.name("postbtn")).click(); ApplicationLogs.debug("Pay Salary via RRR Approval Module: Clicked the Post transaction button" ); Alert al = driver.switchTo().alert(); al.accept(); driver.switchTo().defaultContent(); } }
[ "samson.ojo@gmail.com" ]
samson.ojo@gmail.com
39fae2cd8459d04015264beb3845fee8e0cd963d
6e2c9f4288e8d96a9fdac1b66ecaad69369efe73
/app/src/main/java/git/attendance/app/main/components/ResultActivity.java
8eb94a33844e11665307918052db2fbaa8df8a24
[]
no_license
iamjpsharma/git_attendance_app
97f0823b09e066d8e4895b74335af05d3385e994
5b5615f25b82eeb09e14f85ad932b9f49f33e1b4
refs/heads/master
2023-02-19T16:14:56.490252
2021-01-24T10:42:29
2021-01-24T10:42:29
332,422,896
0
0
null
null
null
null
UTF-8
Java
false
false
1,777
java
package git.attendance.app.main.components; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; import java.math.BigDecimal; import java.math.RoundingMode; import git.attendance.app.R; public class ResultActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_result_activity); EditText sgpa, percentage; sgpa = (EditText) findViewById(R.id.sgpa); percentage = (EditText) findViewById(R.id.percentage); TextView t = (TextView) findViewById(R.id.t); TextView t1 = (TextView) findViewById(R.id.t3); try { Bundle b = getIntent().getExtras(); float final_sgpa = b.getFloat("final_sgpa"); int flag = b.getInt("flag"); float final_perc = b.getFloat("final_perc"); if (flag == 0) { t.setText("Your CGPA is "); percentage.setVisibility(View.INVISIBLE); t1.setVisibility(View.INVISIBLE); } BigDecimal bd = new BigDecimal(final_sgpa).setScale(2, RoundingMode.HALF_EVEN); final_sgpa = bd.floatValue(); BigDecimal bd1 = new BigDecimal(final_perc).setScale(2, RoundingMode.HALF_EVEN); final_perc = bd1.floatValue(); sgpa.setText(String.valueOf(final_sgpa)); percentage.setText(String.valueOf(final_perc + "%")); } catch (Exception e) { Toast.makeText(getBaseContext(), "Exception Occured", Toast.LENGTH_LONG).show(); } } }
[ "sjaiprakash457@gmail.com" ]
sjaiprakash457@gmail.com
bdaa1d0d96cc8302aab31f72a0d8d3226aed4896
2c6e2ba03eb71ca45fe690ff6e4586f6e2fa0f17
/material/apks/banco/sources/com/google/common/collect/ByFunctionOrdering.java
8bf3f827414308143ed6d01d03369ad0baf28570
[]
no_license
lcrcastor/curso-mobile-2019
3088a196139b3e980ed6e09797a0bbf5efb6440b
7585fccb6437a17c841772c1d9fb0701d6c68042
refs/heads/master
2023-04-06T21:46:32.333236
2020-10-30T19:47:54
2020-10-30T19:47:54
308,680,747
0
1
null
2023-03-26T06:57:57
2020-10-30T16:08:31
Java
UTF-8
Java
false
false
1,605
java
package com.google.common.collect; import com.google.common.annotations.GwtCompatible; import com.google.common.base.Function; import com.google.common.base.Objects; import com.google.common.base.Preconditions; import java.io.Serializable; import javax.annotation.Nullable; @GwtCompatible(serializable = true) final class ByFunctionOrdering<F, T> extends Ordering<F> implements Serializable { private static final long serialVersionUID = 0; final Function<F, ? extends T> a; final Ordering<T> b; ByFunctionOrdering(Function<F, ? extends T> function, Ordering<T> ordering) { this.a = (Function) Preconditions.checkNotNull(function); this.b = (Ordering) Preconditions.checkNotNull(ordering); } public int compare(F f, F f2) { return this.b.compare(this.a.apply(f), this.a.apply(f2)); } public boolean equals(@Nullable Object obj) { boolean z = true; if (obj == this) { return true; } if (!(obj instanceof ByFunctionOrdering)) { return false; } ByFunctionOrdering byFunctionOrdering = (ByFunctionOrdering) obj; if (!this.a.equals(byFunctionOrdering.a) || !this.b.equals(byFunctionOrdering.b)) { z = false; } return z; } public int hashCode() { return Objects.hashCode(this.a, this.b); } public String toString() { StringBuilder sb = new StringBuilder(); sb.append(this.b); sb.append(".onResultOf("); sb.append(this.a); sb.append(")"); return sb.toString(); } }
[ "luis@MARK-2.local" ]
luis@MARK-2.local
d9f07e52ae0b0c15f2e7000a155e7c663ef1be05
7e50d207de0e949d4fe981f72ccef91cd8edc1eb
/src/mainPacket/DrawPanel.java
6bafee8497d0da47029a546f1ea51962f3eb026d
[]
no_license
Finessecret/KG2020_G32_Task2
21c5d058d1a93c2477c195edeab487d2ccb91e6c
e775e96d83aa5d0b482d865d1dce9acf04de19bb
refs/heads/master
2023-01-05T12:18:44.193219
2020-10-30T12:37:36
2020-10-30T12:37:36
308,626,333
0
0
null
null
null
null
UTF-8
Java
false
false
1,435
java
package mainPacket; import mainPacket.LineDrawers.BresenhemLineDrawer; import mainPacket.LineDrawers.DDALineDrawer; import mainPacket.LineDrawers.WyLineDrawer; import mainPacket.utils.DrawUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.awt.image.BufferedImage; public class DrawPanel extends JPanel implements MouseMotionListener { private Point position = new Point(0,0); @Override public void paint(Graphics g) { BufferedImage bi = new BufferedImage(getWidth(),getHeight(),BufferedImage.TYPE_INT_RGB); Graphics bi_g = bi.createGraphics(); bi_g.setColor(Color.WHITE); bi_g.fillRect(0,0,getWidth(),getHeight()); bi_g.setColor(Color.BLACK); PixelDrawer pd =new GraphicsPixelDrawer(bi_g); LineDrawer ld = new WyLineDrawer(pd); drawAll(ld); g.drawImage(bi,0,0,null); bi_g.dispose(); } private void drawAll(LineDrawer ld){ DrawUtils.drawSnowflake(ld,getWidth()/4,getHeight()/2,100,32); ld.drawLine(getWidth()/2,getHeight()/2,position.x,position.y); } public DrawPanel(){ this.addMouseMotionListener(this); } @Override public void mouseDragged(MouseEvent e) { } @Override public void mouseMoved(MouseEvent e) { position = new Point(e.getX(),e.getY()); repaint(); } }
[ "magistern01@mail.ru" ]
magistern01@mail.ru
02a076b5de1504b6f185c4762b1f4dd477f7739a
65aa87645671992a479745351c12f1624dee2a97
/core/src/test/java/ui/text/TextFieldDemo.java
4a9b92bcf38816368178909dde5b6daa332f32b0
[ "MIT" ]
permissive
BySlin/darklaf
edd5d8a7e7e0aba8ce8027cfef239ef4e916f8a1
5cf63e99df67f86c6123d0389b36289ad2d274d4
refs/heads/master
2021-01-05T19:50:15.214384
2020-02-17T13:45:59
2020-02-17T13:45:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,142
java
/* * MIT License * * Copyright (c) 2020 Jannis Weis * * 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 ui.text; import ui.ComponentDemo; import ui.DemoPanel; import javax.swing.*; import java.awt.*; public class TextFieldDemo implements ComponentDemo { public static void main(final String[] args) { ComponentDemo.showDemo(new TextFieldDemo()); } @Override public JComponent createComponent() { JTextField textField = new JTextField("Demo TextField"); DemoPanel panel = new DemoPanel(textField); JPanel controlPanel = panel.getControls(); controlPanel.setLayout(new GridLayout(3, 2)); controlPanel.add(new JCheckBox("enabled") {{ setSelected(textField.isEnabled()); addActionListener(e -> textField.setEnabled(isSelected())); }}); controlPanel.add(new JCheckBox("editable") {{ setSelected(textField.isEditable()); addActionListener(e -> textField.setEditable(isSelected())); }}); controlPanel.add(new JCheckBox("LeftToRight") {{ setEnabled(true); addActionListener(e -> textField.setComponentOrientation(isSelected() ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT)); }}); controlPanel.add(new JCheckBox("JTextComponent.roundedSelection") {{ setSelected(true); addActionListener(e -> textField.putClientProperty("JTextComponent.roundedSelection", isSelected())); }}); controlPanel.add(new JCheckBox("JTextField.variant = search") {{ addActionListener(e -> textField.putClientProperty("JTextField.variant", isSelected() ? "search" : "")); }}); controlPanel.add(new JCheckBox("JTextComponent.hasError") {{ addActionListener(e -> textField.putClientProperty("JTextComponent.hasError", isSelected())); }}); return panel; } @Override public String getTitle() { return "TextField Demo"; } }
[ "weisj@arcor.de" ]
weisj@arcor.de
e7c81ba61b95b42f4affe72fdaad80a19ef2670b
aabb0c94c02de66d2d38f6b9feee9bf79cbdb3f7
/app/src/main/java/com/jishang/bimeng/entity/dt/detail/Dt_dt_data_cm_usEntity.java
7b72b77d9120aaa5b788bb8172d42b048c24e023
[]
no_license
zhaohuiyuliang/LE_BiMeng
e90fa88f937dd62e3c9584ff43d54f8e32f5eb30
1b24683427078dee1654f2521bd58cb90f946d61
refs/heads/master
2021-01-18T04:44:20.743052
2017-03-08T03:55:25
2017-03-08T03:55:25
84,274,344
0
0
null
null
null
null
UTF-8
Java
false
false
1,026
java
package com.jishang.bimeng.entity.dt.detail; import java.io.Serializable; public class Dt_dt_data_cm_usEntity implements Serializable{ private String username; private String head_img; private String uid; public Dt_dt_data_cm_usEntity() { super(); } public Dt_dt_data_cm_usEntity(String username, String head_img, String uid) { super(); this.username = username; this.head_img = head_img; this.uid = uid; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getHead_img() { return head_img; } public void setHead_img(String head_img) { this.head_img = head_img; } public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } @Override public String toString() { return "Dt_dt_data_cm_usEntity [username=" + username + ", head_img=" + head_img + ", uid=" + uid + "]"; } }
[ "wwwduyang@sina.cn" ]
wwwduyang@sina.cn
392787729917053e3ad1029c46450a83f8192f4c
173a703113759468a6d9d75556c0c5ee36e326cc
/src/main/java/tvmapps/TVFacetris.java
45ed22736282da73d65a5fa78bdc95f146a776c3
[]
no_license
reportmill/TVMApps
f08589ff5ed3a7311d194bd45b726a07d6f043e2
421d0e1a25e3edaf07252a357e12504341aef6b2
refs/heads/master
2023-06-08T01:34:56.366949
2023-05-29T15:38:20
2023-05-29T15:38:20
239,150,476
0
0
null
null
null
null
UTF-8
Java
false
false
331
java
package tvmapps; import snapdemos.facetris.Facetris; public class TVFacetris { /** * Standard main method. */ public static void main(String[] args) { snaptea.TV.set(); Facetris game = new Facetris(); game.getWindow().setMaximized(true); game.setWindowVisible(true); } }
[ "jeff@reportmill.com" ]
jeff@reportmill.com
5e37616d79465f1ac724a54bab7eec8d60c077ec
db3d8c410b8a297ed62c2d2f889f45829c7cf1b4
/app/src/main/java/practicaltest02/eim/systems/cs/pub/ro/practicaltest02/general/Constants.java
377701c616b71847d130d2f530721f8aa6161f5e
[ "Apache-2.0" ]
permissive
florentinap/PracticalTest02_v1
519f7e44b2d6771b15d62b5967c9980789798f9f
2370611406e1330271d4e809a0ae6f6704c9a473
refs/heads/master
2020-03-17T03:35:00.885565
2018-05-13T15:48:00
2018-05-13T15:48:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,009
java
package practicaltest02.eim.systems.cs.pub.ro.practicaltest02.general; /** * Created by Florentina on 13-May-18. */ public interface Constants { final public static String TAG = "[PracticalTest02]"; final public static boolean DEBUG = true; final public static String WEB_SERVICE_ADDRESS = "https://www.wunderground.com/cgi-bin/findweather/getForecast"; final public static String TEMPERATURE = "temperature"; final public static String WIND_SPEED = "wind_speed"; final public static String CONDITION = "condition"; final public static String PRESSURE = "pressure"; final public static String HUMIDITY = "humidity"; final public static String ALL = "all"; final public static String EMPTY_STRING = ""; final public static String QUERY_ATTRIBUTE = "query"; final public static String SCRIPT_TAG = "script"; final public static String SEARCH_KEY = "wui.api_data =\n"; final public static String CURRENT_OBSERVATION = "current_observation"; }
[ "florentina.ptc@gmail.com" ]
florentina.ptc@gmail.com
7384e9f7fa131718552521da6b0b4de9c15fad54
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/3/3_038540ec87ae846992e22a46c26a3014540a6ee5/EventProcessor/3_038540ec87ae846992e22a46c26a3014540a6ee5_EventProcessor_s.java
48fb83017ec1a9ccb8da461bd4f94acd82b4efa6
[]
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,613
java
/** * Copyright (c) 2012 Daniele Pantaleone, Mathias Van Malderen * * 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. * * @author Daniele Pantaleone * @version 1.0 * @copyright Daniele Pantaleone, 4 September, 2013 * @package com.orion.misc **/ package com.orion.misc; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Collection; import java.util.concurrent.BlockingQueue; import org.apache.commons.logging.Log; import org.joda.time.DateTime; import com.google.common.collect.Multimap; import com.orion.event.Event; import com.orion.exception.EventInterruptedException; import com.orion.misc.RegisteredMethod; import com.orion.plugin.Plugin; public class EventProcessor implements Runnable { private final Log log; private BlockingQueue<Event> eventBus; private Multimap<Class<?>, RegisteredMethod> regMethod; /** * Object constructor * * @author Daniele Pantaleone * @param log Main logger object reference * @param eventBus A <tt>BlockingQueue</tt> from where to fetch events * @param regMethod A <tt>Multimap</tt> which associate each <tt>Event</tt> to * a method **/ public EventProcessor(Log log, BlockingQueue<Event> eventBus, Multimap<Class<?>, RegisteredMethod> regMethod) { this.log = log; this.eventBus = eventBus; this.regMethod = regMethod; this.log.debug("Event processor initialized: " + this.regMethod.size() + " events registered"); } /** * Runnable implementation<br> * Will iterate throught all the events stored by the parser in the queue * It peeks an <tt>Event</tt> from the queue and process it over all * the mapped <tt>Methods</tt> retrieved from the registered events map * * @author Daniele Pantaleone **/ @Override public void run() { this.log.debug("Event processor started: " + new DateTime().toString()); while (true) { try { if (Thread.interrupted()) { throw new InterruptedException(); } Event event = this.eventBus.take(); Collection<RegisteredMethod> collection = this.regMethod.get(event.getClass()); // Skip if this event is not mapped over any method if ((collection == null) || (collection.size() == 0)) { continue; } // Iterating over all the RegisteredEvent for (RegisteredMethod r : collection) { try { Method method = r.getMethod(); Plugin plugin = r.getPlugin(); if (!plugin.isEnabled()) { continue; } method.invoke(plugin, event); } catch (InvocationTargetException | IllegalAccessException | IllegalArgumentException e) { // A plugin requested to stop processing this event so // we'll not iterate through the remaining event handlers if (e.getCause().getClass().equals(EventInterruptedException.class)) { continue; } // Logging the Exception and keep processing events anyway this.log.error("[" + r.getPlugin().getClass().getSimpleName() + "] Could not process event " + event.getClass().getSimpleName(), e); continue; } } } catch (InterruptedException e) { // Thread has received interrupt signal // Breaking the cycle so it will terminate break; } } this.log.debug("Event processor stopped: " + new DateTime().toString()); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
52ddeabae812bc7fbd2f0970388f8951567baff5
ea8013860ed0b905c64f449c8bce9e0c34a23f7b
/SystemUIGoogle/sources/com/android/systemui/privacy/logging/PrivacyLogger$logPrivacyItemsToHold$2.java
79be964fa7948850c38e196b3073bf461e5a2a4f
[]
no_license
TheScarastic/redfin_b5
5efe0dc0d40b09a1a102dfb98bcde09bac4956db
6d85efe92477576c4901cce62e1202e31c30cbd2
refs/heads/master
2023-08-13T22:05:30.321241
2021-09-28T12:33:20
2021-09-28T12:33:20
411,210,644
1
0
null
null
null
null
UTF-8
Java
false
false
841
java
package com.android.systemui.privacy.logging; import com.android.systemui.log.LogMessage; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; /* compiled from: PrivacyLogger.kt */ /* access modifiers changed from: package-private */ /* loaded from: classes.dex */ public final class PrivacyLogger$logPrivacyItemsToHold$2 extends Lambda implements Function1<LogMessage, String> { public static final PrivacyLogger$logPrivacyItemsToHold$2 INSTANCE = new PrivacyLogger$logPrivacyItemsToHold$2(); PrivacyLogger$logPrivacyItemsToHold$2() { super(1); } public final String invoke(LogMessage logMessage) { Intrinsics.checkNotNullParameter(logMessage, "$this$log"); return Intrinsics.stringPlus("Holding items: ", logMessage.getStr1()); } }
[ "warabhishek@gmail.com" ]
warabhishek@gmail.com
04adb1f0fb0e300720612cd53ef991aa11c1b096
4c2023206036a3483b4fde5c8d930beae47ba171
/src/fil/algorithm/BLFF/BLFF.java
614be4c1809a1f1c2fd59103445d339a1b45ba06
[]
no_license
nfvteamHUST/EdgeCloudSimulator
3fe9caf6a8f75dd8496c5a98761d959c431bb7cf
91d5dea67f140edeb326360f0696a4bd7d4e93a2
refs/heads/main
2023-02-06T18:11:00.276481
2020-12-16T06:45:52
2020-12-16T06:45:52
301,652,110
0
0
null
null
null
null
UTF-8
Java
false
false
23,489
java
/** * @author EdgeCloudTeam-HUST * * @date */ package fil.algorithm.BLFF; import java.util.LinkedList; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Random; import java.util.Set; import fil.algorithm.routing.NetworkRouting; import fil.resource.substrate.Rpi; import fil.resource.virtual.*; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.PrintStream; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class BLFF { final static int NUM_PI = 300; final static int K_PORT_SWITCH = 10; // 3 server/edge switch final static int TOTAL_CAPACITY = 40000; final static int EDGE_CAPACITY = 30000; final static int CLOUD_CAPACITY = 25000; private Topology topo; private FatTree fatTree; private MappingServer mappingServer; private NetworkRouting coreNetwork; private LinkedList<Rpi> listRpi; private LinkedList<Integer> edgePosition; private Map<Rpi, LinkedList<SFC>> listSFConRpi; public BLFF() { // default constructor topo = new Topology(); fatTree = new FatTree(); topo = fatTree.genFatTree(K_PORT_SWITCH); mappingServer = new MappingServer(); coreNetwork = new NetworkRouting(); listSFConRpi = new HashMap<>(NUM_PI); listRpi = new LinkedList<Rpi>(); edgePosition = new LinkedList<>(); edgePosition.add(10); edgePosition.add(5); edgePosition.add(13); edgePosition.add(14); for(int i = 0; i < NUM_PI; i++ ) { Random rand = new Random (); int position = rand.nextInt(4); Rpi rpi = new Rpi(i, edgePosition.get(position)); listRpi.add(rpi); listSFConRpi.put(rpi, new LinkedList<SFC>()); } } public static void BLMapping(Topology topo, MappingServer mappingServer, Rpi pi, LinkedList<Double> listChainRequest, LinkedList<SFC> listSFConRpi, LinkedList<SFC> listSFCFinalPi) { boolean doneFlag = false; boolean remapPi = false; boolean doneMap = false; int SFCIndexIncrease = 0; int remapLoopCount = 0; int numChainSuccessCur = 0; double minPower = Integer.MAX_VALUE; Capture capture = new Capture(); Decode decode = new Decode(); Density density = new Density(); ReceiveDensity receive = new ReceiveDensity(); MAP_LOOP: while (doneFlag == false) { if (listSFConRpi.size() == 7) { pi.setOverload(true); break; } if(listChainRequest.size() == 0) { break; } int offDecode = 0; int offDensity = 0; int numChainRequest = listChainRequest.size(); // reallocate as listChainSize may had been changed for (offDecode = 0; offDecode <= numChainRequest; offDecode++) { for(offDensity = offDecode; offDensity >= offDecode && offDensity <= numChainRequest; offDensity++) { int numOffDecode = 0; int numOffDensity = 0; LinkedList<SFC> listSFCTemp = new LinkedList<>(); for(int numSFC = 0; numSFC < numChainRequest; numSFC++ ) { // initialize SFC list double endTime = listChainRequest.get(numSFC); // error after remapping numChain exceeds listChainSize String sfcID = String.valueOf(SFCIndexIncrease); SFC sfc = new SFC(sfcID, pi.getId(), endTime); sfc.setServicePosition(capture, true); sfc.setServicePosition(receive, false); if(numOffDecode < offDecode) { sfc.setServicePosition(decode, false); } else sfc.setServicePosition(decode, true); if(numOffDensity < offDensity) { sfc.setServicePosition(density, false); } else sfc.setServicePosition(density, true); listSFCTemp.add(sfc); SFCIndexIncrease++; numOffDecode++; numOffDensity++; } double bandwidthPiUsed = (offDecode)*capture.getBandwidth() + (offDensity - offDecode)*decode.getBandwidth() + (numChainRequest - offDensity)*density.getBandwidth(); double cpuPiUsed = numChainRequest*capture.getCpu_pi() + (numChainRequest - offDecode)*decode.getCpu_pi() + (numChainRequest - offDensity)*density.getCpu_pi(); /* check Pi resource pool ************************************************/ if(bandwidthPiUsed > pi.getRemainBandwidth()) { if (listChainRequest.size() <= numChainSuccessCur || numChainSuccessCur > 0) { // prevent system continue loop even final result has been selected break MAP_LOOP; } else { //numChain --; doneFlag = false; } } else if (cpuPiUsed > pi.getRemainCPU()) continue; else { double powerPiTemp = numChainRequest*capture.getPower() +(numChainRequest - offDecode)*decode.getPower() + (numChainRequest - offDensity)*density.getPower(); double powerServerTemp = calculatePseudoPowerServer(numChainRequest*receive.getCpu_server() + offDecode*decode.getCpu_server() + offDensity*density.getCpu_server()); double totalPowerTemp = powerPiTemp + powerServerTemp; if (numChainRequest >= numChainSuccessCur && totalPowerTemp <= minPower) { //QoS and acceptance rate priority numChainSuccessCur = numChainRequest; minPower = totalPowerTemp; doneFlag = true; // used to break MAP_LOOP // } //<------calculate number of VNF migration // if(remapPi == true) { // for(int i = 0; i < numChainBefore; i++) { // numVNFinServerAfter += listSFCTemp.get(i).numServiceInServer(); // } // numVNFMigration += Math.abs(numVNFinServerAfter - numVNFinServerBefore); // } //<------add to listSFC output listSFCFinalPi.clear(); for(int index = 0; index < listSFCTemp.size(); index++) { listSFCFinalPi.add(listSFCTemp.get(index)); } } else { System.out.println("Maploop has gone so wrong, stop! \n"); if (offDecode == numChainRequest) { // last loop break MAP_LOOP; } continue; } } } // OFF_DENSITY LOOP } // OFF_DECODE LOOP if(doneFlag == false) { listChainRequest.removeLast(); // remove last object if(listChainRequest.size() <= 0) { break MAP_LOOP; } else continue; } } } public static double calculatePseudoPowerServer(double cpuServer) { double numServer = Math.floor(cpuServer/100); double cpuFragment = cpuServer - 100*numServer; return numServer*powerServer(100) + powerServer(cpuFragment); } public static double powerServer(double cpu) { return (95*(cpu/100) + 221); } public static void write_integer (String filename, LinkedList<Integer> x) throws IOException{ //write result to file BufferedWriter outputWriter = null; outputWriter = new BufferedWriter(new FileWriter(filename)); for (int i = 0; i < x.size(); i++) { outputWriter.write(Integer.toString(x.get(i))); outputWriter.newLine(); } outputWriter.flush(); outputWriter.close(); } public static void write_integer (String filename, int [] x) throws IOException{ //write result to file BufferedWriter outputWriter = null; outputWriter = new BufferedWriter(new FileWriter(filename)); for (int i = 0; i < x.length; i++) { // Maybe: //outputWriter.write(x.get(i)); // Or: outputWriter.write(Integer.toString(x[i])); outputWriter.newLine(); } outputWriter.flush(); outputWriter.close(); } public static void write_double (String filename, LinkedList<Double> x) throws IOException { //write result to file BufferedWriter outputWriter = null; outputWriter = new BufferedWriter(new FileWriter(filename)); for (int i = 0; i < x.size(); i++) { // Maybe: // outputWriter.write(x[i]); // Or: outputWriter.write(Double.toString(x.get(i))); outputWriter.newLine(); } outputWriter.flush(); outputWriter.close(); } public static void write_double (String filename, double [] x) throws IOException { //write result to file BufferedWriter outputWriter = null; outputWriter = new BufferedWriter(new FileWriter(filename)); for (int i = 0; i < x.length; i++) { // Maybe: // outputWriter.write(x[i]); // Or: outputWriter.write(Double.toString(x[i])); outputWriter.newLine(); } outputWriter.flush(); outputWriter.close(); } public static void write_excel(String filename, Map<Integer,LinkedList<Integer>> map) throws IOException { //Create blank workbook XSSFWorkbook workbook = new XSSFWorkbook(); //Create a blank sheet XSSFSheet spreadsheet = workbook.createSheet(); //Create row object XSSFRow row; Set < Integer > keyid = map.keySet(); int rowid = 0; for (Integer key : keyid) { row = spreadsheet.createRow(rowid++); LinkedList<Integer> objectArr = map.get(key); int cellid = 0; for (Object obj : objectArr){ Cell cell = row.createCell(cellid++); cell.setCellValue(obj.toString()); } } //Write the workbook in file system FileOutputStream out = new FileOutputStream(new File(filename)); workbook.write(out); out.close(); workbook.close(); } public static void write_excel_double(String filename, Map<Integer,LinkedList<Double>> map) throws IOException { //Create blank workbook XSSFWorkbook workbook = new XSSFWorkbook(); //Create a blank sheet XSSFSheet spreadsheet = workbook.createSheet(); //Create row object XSSFRow row; Set < Integer > keyid = map.keySet(); int rowid = 0; for (Integer key : keyid) { row = spreadsheet.createRow(rowid++); LinkedList<Double> objectArr = map.get(key); int cellid = 0; for (Object obj : objectArr){ Cell cell = row.createCell(cellid++); cell.setCellValue(obj.toString()); } } //Write the workbook in file system FileOutputStream out = new FileOutputStream(new File(filename)); workbook.write(out); out.close(); workbook.close(); } public void run(Map<Integer,HashMap<Integer,LinkedList<Double>>> listRequest, LinkedList<Integer> timeWindow){ // Creating a log file PrintStream out = null; try { out = new PrintStream(new File("./Plot/output.txt")); } catch (FileNotFoundException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } System.setOut(out); LinkedList<Double> totalPowerSystemConsolidation = new LinkedList<Double>(); LinkedList<Double> totalPowerSystem = new LinkedList<Double>(); LinkedList<Double> totalPowerPerSFC = new LinkedList<Double>(); LinkedList<Double> serverUtilization = new LinkedList<Double>(); LinkedList<Double> totalChainAcceptance = new LinkedList<Double>(); LinkedList<Double> totalPiAcceptance = new LinkedList<Double>(); LinkedList<Integer> listServerUsed = new LinkedList<Integer>(); LinkedList<Integer> totalChainSystem = new LinkedList<Integer>(); LinkedList<Integer> totalChainActive = new LinkedList<Integer>(); LinkedList<Integer> totalDecOffload = new LinkedList<Integer>(); LinkedList<Integer> totalDenOffload = new LinkedList<Integer>(); LinkedList<Integer> totalChainReject = new LinkedList<Integer>(); LinkedList<Double> totalLoadEdge = new LinkedList<Double>(); LinkedList<Double> totalBwEdge = new LinkedList<Double>(); LinkedList<Integer> totalChainLeave = new LinkedList<Integer>(); LinkedList<Integer> totalChainRequest = new LinkedList<>(); LinkedList<Integer> listVNFmigration = new LinkedList<>(); LinkedList<Double> listLinkUsage = new LinkedList<Double>(); LinkedList<Double> cpuEdgeUsagePerSFC = new LinkedList<Double>(); LinkedList<Double> cpuServerUsagePerSFC = new LinkedList<Double>(); LinkedList<Double> averageBWUsage = new LinkedList<Double>(); LinkedList<Double> capacity = new LinkedList<Double>(); LinkedList<Double> capacityEdge = new LinkedList<Double>(); LinkedList<Double> capacityCloud = new LinkedList<Double>(); Map<Integer, LinkedList<Integer>> listRequestForEachPi = new HashMap<>(); Map<Integer, LinkedList<Integer>> listLeaveForEachPi = new HashMap<>(); Map<Integer, LinkedList<Integer>> listOffForEachPi_temp = new HashMap<>(); Map<Integer, LinkedList<Integer>> listOffForEachPi = new HashMap<>(); Map<Integer, LinkedList<Double>> listCPUForEachPi = new HashMap<>(); Map<Integer, LinkedList<Double>> listBWForEachPi = new HashMap<>(); for(int i = 0; i < NUM_PI; i++) { listRequestForEachPi.put(i,new LinkedList<Integer>()); listLeaveForEachPi.put(i,new LinkedList<Integer>()); listOffForEachPi_temp.put(i, new LinkedList<Integer>()); listOffForEachPi.put(i, new LinkedList<Integer>()); listCPUForEachPi.put(i, new LinkedList<Double>()); listBWForEachPi.put(i, new LinkedList<Double>()); } double acceptance = 0; double acceptancePi = 0; int requestIndex = 0; // number of request LinkedList<Integer> requestRandomReceive = new LinkedList<>(); //<------REQUEST_LOOP while (requestIndex < timeWindow.size()) { HashMap<Integer,LinkedList<Double>> listRequestPi = listRequest.get(requestIndex); int numPiReceive = 0; // number of Pi receives request > 0 int piAccept = 0; int numSFCReqThisTW = 0; int numMapReqThisTW = 0; LinkedList<Double> loadEdgeNumPi = new LinkedList<>(); LinkedList<Double> bwEdgeNumPi = new LinkedList<>(); for (Entry<Integer, LinkedList<Double>> entry : listRequestPi.entrySet()) { Rpi pi = listRpi.get(entry.getKey()); int numSFCReqThisPi = entry.getValue().size(); int numSFCLevThisPi = 0; listRequestForEachPi.get(pi.getId()).add(numSFCReqThisPi); numSFCReqThisTW += numSFCReqThisPi; if (numSFCReqThisPi != 0) numPiReceive ++; LinkedList<SFC> listSFCFinalPi = new LinkedList<SFC>(); LinkedList<SFC> listCurSFCOnPi = listSFConRpi.get(pi); LinkedList<SFC> listSFCLeave = new LinkedList<>(); System.out.println("Request number " + requestIndex); System.out.println("Pi number " + (pi.getId()+1)+ " with " +entry.getValue().size()+ " chains need to be mapped"); System.out.println("Pi has mapped "+ listCurSFCOnPi.size()); //<--------END--OF--SERVICE--PROCESS System.out.println("Start leaving process ...."); if(listCurSFCOnPi.size() != 0 && listCurSFCOnPi != null) { boolean flagLeave = false; for(SFC sfc : listCurSFCOnPi) { if(sfc.getEndTime() <= requestIndex) { flagLeave = true; listSFCLeave.add(sfc); numSFCLevThisPi ++; } } if(flagLeave == true) { for(SFC sfc : listCurSFCOnPi) { // remove all sfc belongs to pi in listSFCTotal if(mappingServer.getListSFCTotal().contains(sfc)) mappingServer.getListSFCTotal().remove(sfc); } mappingServer.getServiceMapping().resetRpiSFC(listCurSFCOnPi, topo); // reset at server coreNetwork.NetworkReset(pi); // reset network pi.reset(); // reset rpi //<-----------remap leftover SFC for(SFC sfc : listSFCLeave) { if(listCurSFCOnPi.contains(sfc)) listCurSFCOnPi.remove(sfc); } LinkedList<Double> listSFCRemapLeave = new LinkedList<>(); for (SFC sfc : listCurSFCOnPi) { double endTime = sfc.getEndTime(); listSFCRemapLeave.add(endTime); } listCurSFCOnPi.clear(); if(listSFCRemapLeave.size() != 0){ BLMapping(topo, mappingServer, pi, listSFCRemapLeave, listCurSFCOnPi, listSFCFinalPi); coreNetwork.NetworkRun(listSFCFinalPi, pi); mappingServer.runMapping(listSFCFinalPi, topo); //===finalize after remapping ====// listCurSFCOnPi.addAll(mappingServer.getListSFC()); Double cpuEdgeUsage = 0.0; Double bwEdgeUsage = 0.0; for(SFC sfc : mappingServer.getListSFC()) { cpuEdgeUsage += sfc.cpuEdgeUsage(); bwEdgeUsage += sfc.bandwidthUsageOutDC(); } pi.setUsedCPU(cpuEdgeUsage); // change CPU pi-server pi.setUsedBandwidth(bwEdgeUsage); //change Bandwidth used by Pi listSFCFinalPi.clear(); } } } else ; listLeaveForEachPi.get(pi.getId()).add(numSFCLevThisPi); //<------------JOIN --PROCESS System.out.println("Start joining process ...."); LinkedList<Double> listEndTime = new LinkedList<>(); for(int index = 0; index < entry.getValue().size(); index++) { double endTime = entry.getValue().get(index) + (double) requestIndex; listEndTime.add(endTime); } if(pi.isOverload() == true) { System.out.println("This pi is already overloaded"); } else if(listEndTime.size() == 0) { System.out.println("This pi receive zero request"); } else { BLMapping(topo, mappingServer, pi, listEndTime, listCurSFCOnPi, listSFCFinalPi); } //<-----Only successful mapping can jump into the below condition if(listSFCFinalPi.size() != 0 && pi.isOverload() == false && listEndTime.size()!= 0) { // case Pi mapping is success mappingServer.runMapping(listSFCFinalPi, topo); //<------set value for Rpi after mapping successfully Double cpuEdgeUsage = 0.0; Double bwEdgeUsage = 0.0; for(SFC sfc : mappingServer.getListSFC()) { cpuEdgeUsage += sfc.cpuEdgeUsage(); bwEdgeUsage += sfc.bandwidthUsageOutDC(); } pi.setUsedCPU(cpuEdgeUsage); // change CPU pi-server pi.setUsedBandwidth(bwEdgeUsage); //change Bandwidth used by Pi numMapReqThisTW += mappingServer.getListSFC().size(); piAccept ++; //num of accepted Pi (accept if at least 1 SFC has been mapped } //<----Every mapping step has to do this loadEdgeNumPi.add(pi.getUsedCPU()); bwEdgeNumPi.add(pi.getUsedBandwidth()); int offServiceCur = 0; for(SFC sfc : listCurSFCOnPi) { if(sfc.getService(2).getBelongToEdge() == false) offServiceCur ++; if(sfc.getService(3).getBelongToEdge() == false) offServiceCur ++; } listOffForEachPi_temp.get(pi.getId()).add(offServiceCur); if(requestIndex == 0) { listOffForEachPi.get(pi.getId()).add(offServiceCur); }else { int offServicePre = listOffForEachPi_temp.get(pi.getId()).get(requestIndex - 1); int offService = offServiceCur - offServicePre; listOffForEachPi.get(pi.getId()).add(offService); } double cpuPiCur = pi.getUsedCPU(); double bwPiCur = pi.getUsedBandwidth(); listCPUForEachPi.get(pi.getId()).add(cpuPiCur); listBWForEachPi.get(pi.getId()).add(bwPiCur); } //end Rpi for loop double sumCPUPi = 0.0; double sumBwPi = 0.0; for (int index = 0; index < NUM_PI; index++) { sumCPUPi += listRpi.get(index).getUsedCPU(); sumBwPi += listRpi.get(index).getUsedBandwidth(); } totalLoadEdge.add(requestIndex,(sumCPUPi/(NUM_PI))); totalBwEdge.add(requestIndex,(sumBwPi/NUM_PI)); acceptance = (numMapReqThisTW*1.0)/numSFCReqThisTW; //after a request acceptancePi = (piAccept*1.0)/numPiReceive; totalChainAcceptance.add(requestIndex, acceptance); totalPiAcceptance.add(requestIndex, acceptancePi); totalChainRequest.add(numMapReqThisTW); //<--------calculate average bandwidth usage double totalBandwidthSFC = 0; double totalSFCSize = 0; for(Entry<Rpi, LinkedList<SFC>> entry : listSFConRpi.entrySet()) { LinkedList<SFC> listSFCRpi = entry.getValue(); totalSFCSize += listSFCRpi.size(); for(SFC sfc : listSFCRpi) { totalBandwidthSFC += sfc.getBandwidthSFC(); } } averageBWUsage.add((totalBandwidthSFC*1.0)/totalSFCSize); serverUtilization.add(topo.getCPUServerUtilization()); listServerUsed.add(topo.getServerUsed()); totalChainActive.add(mappingServer.getListSFCTotal().size()); totalPowerSystem.add( mappingServer.getPower() + mappingServer.PowerEdgeUsage() + NUM_PI*1.28); //<-------calculate system capacity block double cpuEdge = 0; double cpuCloud = 0; double usedCapacity = 0; double usedCapacityEdge = 0; double usedCapacityCloud = 0; cpuEdge = mappingServer.cpuEdgeAllSFC(); cpuCloud = mappingServer.cpuServerAllSFC(); usedCapacity = (cpuEdge/2 + cpuCloud)*1.0/TOTAL_CAPACITY; usedCapacityEdge = cpuEdge/EDGE_CAPACITY; usedCapacityCloud = cpuCloud/CLOUD_CAPACITY; capacityEdge.add(usedCapacityEdge); capacityCloud.add(usedCapacityCloud); capacity.add(usedCapacity); cpuEdgeUsagePerSFC.add(mappingServer.cpuEdgePerSFC()); cpuServerUsagePerSFC.add(mappingServer.cpuServerPerSFC()); requestIndex++; } // end while loop (request) try { write_double("./PlotBL-FF/totalPiAcceptance.txt",totalPiAcceptance); write_double("./PlotBL-FF/capacity.txt",capacity); write_double("./PlotBL-FF/capacityEdge.txt",capacityEdge); write_double("./PlotBL-FF/capacityCloud.txt",capacityCloud); write_double("./PlotBL-FF/averageBWUsage.txt",averageBWUsage); write_double("./PlotBL-FF/totalPowerSystemConsolidation.txt",totalPowerSystemConsolidation); write_double("./PlotBL-FF/listLinkUsage.txt",listLinkUsage); write_double("./PlotBL-FF/cpuEdgeUsagePerSFC.txt",cpuEdgeUsagePerSFC); write_double("./PlotBL-FF/cpuServerUsagePerSFC.txt",cpuServerUsagePerSFC); write_double("./PlotBL-FF/serverUtilization.txt",serverUtilization); write_integer("./PlotBL-FF/NumVNFMigration.txt",listVNFmigration); write_integer("./PlotBL-FF/totalChainLeave.txt",totalChainLeave); write_integer("./PlotBL-FF/listServerUsed.txt",listServerUsed); write_integer("./PlotBL-FF/requestRandom.txt",requestRandomReceive); write_integer("./PlotBL-FF/totalDecOffload.txt",totalDecOffload); write_integer("./PlotBL-FF/totalDenOffload.txt",totalDenOffload); write_double("./PlotBL-FF/totalPowerSystem.txt",totalPowerSystem); write_double("./PlotBL-FF/totalPowerSystemPerSFC.txt",totalPowerPerSFC); write_double("./PlotBL-FF/totalLoadEdge.txt",totalLoadEdge); write_double("./PlotBL-FF/totalBwEdge.txt",totalBwEdge); write_double("./PlotBL-FF/totalChainAcceptance.txt",totalChainAcceptance); write_integer("./PlotBL-FF/totalChainSystem.txt",totalChainSystem); write_integer("./PlotBL-FF/totalChainActive.txt",totalChainActive); write_integer("./PlotBL-FF/totalChainReject.txt",totalChainReject); write_excel("./PlotBL-FF/requestEachPiDetail.xlsx",listRequestForEachPi); write_excel("./PlotBL-FF/leaveEachPiDetail.xlsx",listLeaveForEachPi); write_excel("./PlotBL-FF/offSerEachPi01.xlsx",listOffForEachPi); write_excel_double("./PlotBL-FF/cpuEachPi01.xlsx",listCPUForEachPi); write_excel_double("./PlotBL-FF/bwEachPi01.xlsx",listBWForEachPi); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public Map<Rpi, LinkedList<SFC>> getListSFConRpi() { return listSFConRpi; } public void setListSFConRpi(Map<Rpi, LinkedList<SFC>> listSFConRpi) { this.listSFConRpi = listSFConRpi; } public LinkedList<Rpi> getListRpi() { return listRpi; } public void setListRpi(LinkedList<Rpi> listRpi) { this.listRpi = listRpi; } public LinkedList<Integer> getEdgePosition() { return edgePosition; } public void setEdgePosition(LinkedList<Integer> edgePosition) { this.edgePosition = edgePosition; } }
[ "72436467+nfvteamHUST@users.noreply.github.com" ]
72436467+nfvteamHUST@users.noreply.github.com
60e0a554c0a6558dceb5ec2a4057dd95bd128b4a
cde7dd2c648823fe07c1f6286cd2fb7dbbf43b42
/sk-api/src/main/java/cn/sk/api/sys/shiro/JwtToken.java
0c0478878e27ff8a0960c6667740d649191f81ac
[]
no_license
zhouxiaopin/sk-elementui-bg
c6237f8c09552cf4c425bc8c119e05e73b39205e
ea2d657a65779c7e95d9f6bd44cb0d5376553775
refs/heads/master
2022-12-20T21:16:08.837444
2020-06-05T01:53:58
2020-06-05T01:53:58
232,781,146
0
0
null
2022-10-12T20:36:01
2020-01-09T10:17:56
TSQL
UTF-8
Java
false
false
457
java
package cn.sk.api.sys.shiro; import org.apache.shiro.authc.AuthenticationToken; /** *@Deseription *@Author zhoucp *@Date 2020/1/6 15:50 **/ public class JwtToken implements AuthenticationToken { private String token; public JwtToken(String token) { this.token = token; } @Override public Object getPrincipal() { return token; } @Override public Object getCredentials() { return token; } }
[ "1156693737@qq.com" ]
1156693737@qq.com
f86d6e2f47f17f132b9ff66fb2b594e66e2ce2af
d9afa31ca95ee7a62d182fe434d2cddc09c0343d
/app/src/main/java/com/example/po/stadiummanagement3/Holder/AreaHolder.java
a600e7368beec641ea2fe815a04a28418bd7f3dd
[]
no_license
z619850002/StadiumManagement
7e9d903f5641ac1973649dbff003c013ddb38936
124158c7a3765ca41ea3c769d7b826142787a7d3
refs/heads/master
2021-08-31T18:43:23.206506
2017-12-22T11:54:58
2017-12-22T11:54:58
113,872,996
0
0
null
2017-12-11T15:05:03
2017-12-11T15:05:03
null
UTF-8
Java
false
false
1,494
java
package com.example.po.stadiummanagement3.Holder; import android.content.Context; import android.content.Intent; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.example.po.stadiummanagement3.Activity.ScheduleActivity; import com.example.po.stadiummanagement3.R; import butterknife.BindView; import butterknife.ButterKnife; /** * Created by 13701 on 2017/11/29. */ public class AreaHolder extends RecyclerView.ViewHolder{ @BindView(R.id.text_view1) public TextView textView; @BindView(R.id.imageView2) public ImageView imageView2; private Context _context; public AreaHolder(View itemView, Context context) { super(itemView); _context = context; ButterKnife.bind(this,itemView); } public void bindInfo(String text){ if(text == "游泳馆"){ imageView2.setImageResource(R.drawable.pool); textView.setText(text); }else if(text == "篮球馆"){ imageView2.setImageResource(R.drawable.basketball); textView.setText(text); }else if(text == "乒乓球馆"){ imageView2.setImageResource(R.drawable.pingpang); textView.setText(text); }else if(text == "羽毛球馆"){ imageView2.setImageResource(R.drawable.badminton); textView.setText(text); } } }
[ "137012120@qq.com" ]
137012120@qq.com
5c962d11fa5d19cec6856b9de5ba130ce3564dd0
8a184ea2e67c4a448e974bd7de8f3325de73c495
/spring-bean_assemble/src/main/java/com/du/test1/UserService.java
dbc8d3a58ded65c5dd38713dbdf732ec419bc03c
[]
no_license
Ai-yoo/Spring_Test
5e6e580b6a9258b439bdadcf07c7e9c4db783686
f9ed7d22fbb12abc1629ec1f093be9d26111f552
refs/heads/master
2020-03-18T23:51:50.933678
2018-06-16T01:02:30
2018-06-16T01:02:30
135,434,177
0
0
null
null
null
null
UTF-8
Java
false
false
166
java
package com.du.test1; /** * Created with IDEA * * @author duzhentong * @Date 2018/6/4 * @Time 16:43 */ public interface UserService { public void run(); }
[ "duzhentong123@foxmail.com" ]
duzhentong123@foxmail.com
4897c6d6bc3faa31d03bf021b021916600ef0e4e
6bb24052960c6c4cd67fcf0a04cee83c38449f2e
/src/main/java/com/cg/java/services/EmpServices.java
b71ea8bd73caf9b21fc88fbd32e6cc486920d339
[]
no_license
SahilSingla827/Spring010
0578a8e794effa327bfe8bbc541f265d4071e7d4
6b4a2749a46619934cd42983dc28e23335068ff3
refs/heads/master
2021-02-12T20:11:50.828819
2020-03-03T12:12:33
2020-03-03T12:12:33
244,626,169
0
0
null
null
null
null
UTF-8
Java
false
false
1,425
java
package com.cg.java.services; public class EmpServices { private String companyName; private String address; private SalaryServices services; private float yrlyPackage; public EmpServices() { System.out.println("EmpService object created."); } /*public EmpServices(String companyName,String address) { super(); System.out.println("In two para constructor"); this.companyName=companyName; this.address=address; }*/ public EmpServices(String companyName,String address,float yPackage) { super(); System.out.println("In three para constructor"); this.companyName=companyName; this.address=address; this.yrlyPackage=yPackage; } public String getMessage() { System.out.println(services.calcSalary()); return "welcome Spring training!"+ companyName+yrlyPackage; } //Properties public String getCompanyName() {//companyName return companyName; } public void setCompanyName(String companyName) { this.companyName = companyName; } public String getAddress() { return address; } public void setAddress(String address) {//address->property name this.address = address; } public SalaryServices getServices() {//services return services; } public void setServices(SalaryServices services) { this.services = services; } public float getYrlyPackage() { return yrlyPackage; } public void setYrlyPackage(float yrlyPackage) { this.yrlyPackage = yrlyPackage; } }
[ "sahilsingla826@gmail.com" ]
sahilsingla826@gmail.com
05c914a7c2c8f9a2c9e2ad8fde5a6c07486904f2
be933c7d15261d291ce1d07f9ec361880de38ae0
/src/NumberFormatTest.java
83990bc9135552377e25c11090293c4fb785b6fb
[]
no_license
blueberrystream/misc
a7aec163683bd249406ebbb5c5d545b637827b5f
678df49147c40119911516e3327e64af1e94b12c
refs/heads/master
2016-09-05T16:48:11.366938
2013-08-16T09:58:43
2013-08-16T09:58:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
967
java
import java.text.NumberFormat; import java.text.ParseException; import java.util.Date; /** * @author KID / @blueberrystream */ public class NumberFormatTest { /** * @param args */ public static void main(final String[] args) throws ParseException { final NumberFormat numberFormat = NumberFormat.getNumberInstance(); numberFormat.setGroupingUsed(false); Long l = new Date().getTime(); final Double d = l.doubleValue(); System.out.println(l); System.out.println(d); String s = l.toString(); l = Long.valueOf(s); System.out.println(s); System.out.println(l); s = d.toString(); // l = Long.valueOf(s); // ->NumberFormatException l = numberFormat.parse(s).longValue(); System.out.println(s); System.out.println(l); System.out.println(numberFormat.format(d)); s = "123,456,789"; l = numberFormat.parse(s).longValue(); System.out.println(s); System.out.println(l); } }
[ "kid0725+github@gmail.com" ]
kid0725+github@gmail.com
31987a4c67d6700faee0e64c97b82d8b2038d433
f850abeb603ccd5d6c789f29c722be852f104f19
/src/day5stringmethod/StringSoru3.java
d44dee15f284e22e5d1468350524d3c241ba31fa
[]
no_license
osaykan/javaofishours
442e31bd2fd4bd4dc87b8d7040189c3c38733848
a633bde0865b111be173e4bdcdd32cb91f85d01a
refs/heads/master
2023-04-07T19:23:42.964359
2021-04-18T11:47:32
2021-04-18T11:47:32
359,128,338
0
0
null
null
null
null
ISO-8859-3
Java
false
false
458
java
package day5stringmethod; import java.util.Scanner; public class StringSoru3 { public static void main(String[] args) { //Kullanicidan alinan String kümesi icerisinde aranan Stringi bulan kodu yaziniz Scanner scan = new Scanner(System.in); System.out.println("Bir cümle giriniz"); String str = scan.nextLine(); System.out.println("Bulunacak kelimeyi giriniz"); String bul = scan.nextLine(); System.out.println(str.contains(bul)); } }
[ "67019192+osaykan@users.noreply.github.com" ]
67019192+osaykan@users.noreply.github.com
8d602f174d3ed230ae337ac51cca6f87f66da5ac
0036f1fc77caa48dfb242179e94aa7317fd5c3a9
/backend/service/src/main/java/com/eve/payall/test/feignclient/backend/service/api/exceptions/UserNotFoundException.java
aab02cc8bad16149af72297e0aba49ef470d2da3
[]
no_license
bulent-kopuklu/springboot-feignclient
cb95f89a8cb45701487be002a2531b096b3bbd99
bd303f7d90de926b0647b826e2b764d71b7b9a83
refs/heads/master
2020-08-17T00:24:25.880554
2019-10-16T15:33:46
2019-10-16T15:33:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package com.eve.payall.test.feignclient.backend.service.api.exceptions; public class UserNotFoundException extends ResourceNotFoundException { public UserNotFoundException(Long id) { super("Could not found user. id:" + id); } }
[ "bulent.kopuklu@digitalplanet.com.tr" ]
bulent.kopuklu@digitalplanet.com.tr
52de1d85d11a230d27ed83681570ea5beae7c003
9ec27dca6c230779fefdab78f4c489d4e8381f92
/main/java/uk/co/real_logic/sbe/util/BitUtil.java
780fd9be07e28c95348c2fe6b877e467da9909e1
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
qbm/simple-binary-encoding
3bf97778f670a0a8a757cc59f79009a71dd6ac2b
f85121528f57c6ffa189672eec6084a50189b072
refs/heads/master
2020-12-28T08:29:47.954447
2013-12-31T17:38:08
2013-12-31T17:38:08
15,595,031
1
0
null
null
null
null
UTF-8
Java
false
false
2,384
java
/* * Copyright 2013 Real Logic Ltd. * * 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 uk.co.real_logic.sbe.util; import sun.misc.Unsafe; import java.lang.reflect.Field; import java.security.AccessController; import java.security.PrivilegedExceptionAction; /** * Miscellaneous useful functions for dealing with low level bits and bytes. */ public class BitUtil { /** Size of a byte in bytes */ public static final int SIZE_OF_BYTE = 1; /** Size of a boolean in bytes */ public static final int SIZE_OF_BOOLEAN = 1; /** Size of a char in bytes */ public static final int SIZE_OF_CHAR = 2; /** Size of a short in bytes */ public static final int SIZE_OF_SHORT = 2; /** Size of an int in bytes */ public static final int SIZE_OF_INT = 4; /** Size of a a float in bytes */ public static final int SIZE_OF_FLOAT = 4; /** Size of a long in bytes */ public static final int SIZE_OF_LONG = 8; /** Size of a double in bytes */ public static final int SIZE_OF_DOUBLE = 8; private static final Unsafe UNSAFE; static { try { final PrivilegedExceptionAction<Unsafe> action = new PrivilegedExceptionAction<Unsafe>() { public Unsafe run() throws Exception { final Field f = Unsafe.class.getDeclaredField("theUnsafe"); f.setAccessible(true); return (Unsafe)f.get(null); } }; UNSAFE = AccessController.doPrivileged(action); } catch (final Exception ex) { throw new RuntimeException(ex); } } /** * Get the instance of {@link sun.misc.Unsafe}. * * @return the instance of Unsafe */ public static Unsafe getUnsafe() { return UNSAFE; } }
[ "mjpt777@gmail.com" ]
mjpt777@gmail.com
e83ad31a998395394ba3400f7612eab9045c9a61
2b97b1759f0c0205c1e54d9316b843ed1c058eb0
/webservice/clase2/ClientWebService/src/net/webservicex/gw/ObjectFactory.java
ee686f2f84eeb9211c22d4d4f10e83108d3a3e27
[]
no_license
luis4god/educit15
0553617b9140e07d1401f82d79b82075ebba7b92
02a0c430f64559b195dd16cffe22f23516c7657b
refs/heads/master
2021-01-16T19:00:22.807926
2015-09-11T01:02:37
2015-09-11T01:02:37
34,878,633
0
0
null
null
null
null
UTF-8
Java
false
false
2,176
java
package net.webservicex.gw; import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; /** * This object contains factory methods for each * Java content interface and Java element interface * generated in the net.webservicex package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML * content can consist of schema derived interfaces * and classes representing the binding of schema * type definitions, element declarations and model * groups. Factory methods for each of these are * provided in this class. * */ @XmlRegistry public class ObjectFactory { private final static QName _String_QNAME = new QName("http://www.webserviceX.NET", "string"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: net.webservicex * */ public ObjectFactory() { } /** * Create an instance of {@link GetWeather } * */ public GetWeather createGetWeather() { return new GetWeather(); } /** * Create an instance of {@link GetCitiesByCountryResponse } * */ public GetCitiesByCountryResponse createGetCitiesByCountryResponse() { return new GetCitiesByCountryResponse(); } /** * Create an instance of {@link GetWeatherResponse } * */ public GetWeatherResponse createGetWeatherResponse() { return new GetWeatherResponse(); } /** * Create an instance of {@link GetCitiesByCountry } * */ public GetCitiesByCountry createGetCitiesByCountry() { return new GetCitiesByCountry(); } /** * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} * */ @XmlElementDecl(namespace = "http://www.webserviceX.NET", name = "string") public JAXBElement<String> createString(String value) { return new JAXBElement<String>(_String_QNAME, String.class, null, value); } }
[ "luis4god@gmail.com" ]
luis4god@gmail.com
acecb81e08058d473219d901f67d60735c20971a
cd0ddf2d66685152a0af3387a31ffc11412e4638
/src/main/java/com/marksman/chapter8/CyclicBarrierTest3.java
59ff502a6ee01e5a212e243d6addc742fbc0f93c
[]
no_license
Marksman111/theArtOfJavaConcurrencyProgramming
3dbbdef09c5123dc2b4df22ed7af9eace1a5c869
756e70a3dcc432defe2d8d7524f72cdfafbe06d9
refs/heads/master
2020-03-22T10:37:40.230941
2018-08-20T13:59:32
2018-08-20T13:59:32
139,915,641
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
package com.marksman.chapter8; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; /** * @author weilb * @date 2018/8/20 * @description */ public class CyclicBarrierTest3 { static CyclicBarrier c = new CyclicBarrier(2); public static void main(String[] args) throws BrokenBarrierException,InterruptedException{ Thread thread = new Thread(new Runnable() { @Override public void run() { try { c.await(); } catch (InterruptedException e) { e.printStackTrace(); } catch (BrokenBarrierException e) { e.printStackTrace(); } } }); thread.start(); thread.interrupt(); try { c.await(); } catch (Exception e) { System.out.println(c.isBroken()); } } }
[ "wlb825077462@gmail.com" ]
wlb825077462@gmail.com
ccd6f09b4d21dae31425f48bda552c1479022dc5
f70d9ac1d94e91d76f75288a100dfdaa66dd4471
/grpcHelloServer/src/io/grpc/examples/helloworld/GreeterGrpc.java
a5f2dd021e76ee111b8d36428e075515d5fde69e
[]
no_license
sinasina444/SearchAdsWebService
620c68b0f5ff6aa59309c6e36ebd7cbe6ee7c388
86bd22fd3b775be04f18aeaa7b2e6940d591f829
refs/heads/master
2020-03-16T13:20:38.436434
2018-05-09T03:44:50
2018-05-09T03:44:50
132,687,365
20
0
null
null
null
null
UTF-8
Java
false
false
8,522
java
package io.grpc.examples.helloworld; import static io.grpc.stub.ClientCalls.asyncUnaryCall; import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; import static io.grpc.stub.ClientCalls.blockingUnaryCall; import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; import static io.grpc.stub.ClientCalls.futureUnaryCall; import static io.grpc.MethodDescriptor.generateFullMethodName; import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; /** * <pre> * The greeting service definition. * </pre> */ @javax.annotation.Generated( value = "by gRPC proto compiler (version 1.3.0)", comments = "Source: helloworld.proto") public final class GreeterGrpc { private GreeterGrpc() {} public static final String SERVICE_NAME = "helloworld.Greeter"; // Static method descriptors that strictly reflect the proto. @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor<io.grpc.examples.helloworld.HelloRequest, io.grpc.examples.helloworld.HelloReply> METHOD_SAY_HELLO = io.grpc.MethodDescriptor.create( io.grpc.MethodDescriptor.MethodType.UNARY, generateFullMethodName( "helloworld.Greeter", "SayHello"), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.getDefaultInstance()), io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloReply.getDefaultInstance())); /** * Creates a new async stub that supports all call types for the service */ public static GreeterStub newStub(io.grpc.Channel channel) { return new GreeterStub(channel); } /** * Creates a new blocking-style stub that supports unary and streaming output calls on the service */ public static GreeterBlockingStub newBlockingStub( io.grpc.Channel channel) { return new GreeterBlockingStub(channel); } /** * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service */ public static GreeterFutureStub newFutureStub( io.grpc.Channel channel) { return new GreeterFutureStub(channel); } /** * <pre> * The greeting service definition. * </pre> */ public static abstract class GreeterImplBase implements io.grpc.BindableService { /** * <pre> * Sends a greeting * </pre> */ public void sayHello(io.grpc.examples.helloworld.HelloRequest request, io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply> responseObserver) { asyncUnimplementedUnaryCall(METHOD_SAY_HELLO, responseObserver); } @Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( METHOD_SAY_HELLO, asyncUnaryCall( new MethodHandlers< io.grpc.examples.helloworld.HelloRequest, io.grpc.examples.helloworld.HelloReply>( this, METHODID_SAY_HELLO))) .build(); } } /** * <pre> * The greeting service definition. * </pre> */ public static final class GreeterStub extends io.grpc.stub.AbstractStub<GreeterStub> { private GreeterStub(io.grpc.Channel channel) { super(channel); } private GreeterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @Override protected GreeterStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterStub(channel, callOptions); } /** * <pre> * Sends a greeting * </pre> */ public void sayHello(io.grpc.examples.helloworld.HelloRequest request, io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply> responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request, responseObserver); } } /** * <pre> * The greeting service definition. * </pre> */ public static final class GreeterBlockingStub extends io.grpc.stub.AbstractStub<GreeterBlockingStub> { private GreeterBlockingStub(io.grpc.Channel channel) { super(channel); } private GreeterBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @Override protected GreeterBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterBlockingStub(channel, callOptions); } /** * <pre> * Sends a greeting * </pre> */ public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request) { return blockingUnaryCall( getChannel(), METHOD_SAY_HELLO, getCallOptions(), request); } } /** * <pre> * The greeting service definition. * </pre> */ public static final class GreeterFutureStub extends io.grpc.stub.AbstractStub<GreeterFutureStub> { private GreeterFutureStub(io.grpc.Channel channel) { super(channel); } private GreeterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @Override protected GreeterFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterFutureStub(channel, callOptions); } /** * <pre> * Sends a greeting * </pre> */ public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloReply> sayHello( io.grpc.examples.helloworld.HelloRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request); } } private static final int METHODID_SAY_HELLO = 0; 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 GreeterImplBase serviceImpl; private final int methodId; MethodHandlers(GreeterImplBase serviceImpl, int methodId) { this.serviceImpl = serviceImpl; this.methodId = methodId; } @Override @SuppressWarnings("unchecked") public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { case METHODID_SAY_HELLO: serviceImpl.sayHello((io.grpc.examples.helloworld.HelloRequest) request, (io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply>) responseObserver); break; default: throw new AssertionError(); } } @Override @SuppressWarnings("unchecked") public io.grpc.stub.StreamObserver<Req> invoke( io.grpc.stub.StreamObserver<Resp> responseObserver) { switch (methodId) { default: throw new AssertionError(); } } } private static final class GreeterDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier { @Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return io.grpc.examples.helloworld.HelloWorldProto.getDescriptor(); } } private static volatile io.grpc.ServiceDescriptor serviceDescriptor; public static io.grpc.ServiceDescriptor getServiceDescriptor() { io.grpc.ServiceDescriptor result = serviceDescriptor; if (result == null) { synchronized (GreeterGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new GreeterDescriptorSupplier()) .addMethod(METHOD_SAY_HELLO) .build(); } } } return result; } }
[ "yuwuqu444@gmail.com" ]
yuwuqu444@gmail.com
4c80a926bf9de110f5fb24b951bc989d287d3148
bafab6aea4107c2915cc2da62fa14296f4f9ded9
/kie-wb-common-stunner/kie-wb-common-stunner-core/kie-wb-common-stunner-api/kie-wb-common-stunner-client-api/src/main/java/org/kie/workbench/common/stunner/core/client/shape/factory/CompositeShapeFactory.java
50d90c8604319d46db6cc918dd69eadb91c7152a
[ "Apache-2.0" ]
permissive
lazarotti/kie-wb-common
7da98f53758c211c94002660cf44698b9a2cccc4
bc98aca29846baaa01fb9a5dc468ab4f3f55a8c7
refs/heads/master
2021-01-12T01:46:55.935051
2017-01-09T10:58:05
2017-01-09T10:58:05
78,430,514
0
0
null
2017-01-09T13:19:14
2017-01-09T13:19:14
null
UTF-8
Java
false
false
919
java
/* * Copyright 2016 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.kie.workbench.common.stunner.core.client.shape.factory; import org.kie.workbench.common.stunner.core.client.shape.Shape; public interface CompositeShapeFactory<W, C, S extends Shape, F extends ShapeFactory<?, C, ?>> extends ShapeFactory<W, C, S> { void addFactory( F factory ); }
[ "manstis@users.noreply.github.com" ]
manstis@users.noreply.github.com
0777a0cdb8a57b96d92ac24d1197656e8244e2cf
af9499e1c334ed8dfa774b76641c4502e7f38171
/toolab-http/src/test/java/net/toolab/http/TestResponseHandlerTest.java
a3523df18a9962a26d9fe667b6e0ace3bc15e07f
[ "Apache-2.0" ]
permissive
juphich/toolab
b1a10291d9d1d552fd656b4c0a25a73d520a44ea
6c7cdd993ec720b8efe0c6ee40cf177c75e95fc6
refs/heads/master
2021-01-23T18:56:54.308067
2014-04-30T08:22:47
2014-04-30T08:22:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,179
java
package net.toolab.http; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; import java.io.IOException; import net.toolab.http.mock.Message; import net.toolab.http.mock.MockMessageHandler; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.HttpVersion; import org.apache.http.client.ClientProtocolException; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.message.BasicHttpResponse; import org.junit.Test; public class TestResponseHandlerTest { @Test public void testJsonHandler() throws ClientProtocolException, IOException { StringEntity entity = new StringEntity("code:code0/message:test-message", ContentType.create("text/plain", "UTF-8")); HttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK"); response.setEntity(entity); MockMessageHandler handler = new MockMessageHandler(); Message message = handler.handleResponse(response); assertThat(message.getCode(), is("code0")); assertThat(message.getMessage(), is("test-message")); } }
[ "juphich@gmail.com" ]
juphich@gmail.com
b80c4933069055985250d3b83ad769f154702175
d20244f441504d9f119dfadacb3bfdd5a024b8e2
/ehmp/product/production/soap-handler/src/main/java/gov/va/med/jmeadows_2_3_1/webservice/Alert.java
a2fe936fc4a2595bc9d730322d1384dd554bbdea
[ "Apache-2.0" ]
permissive
djwhitten/eHMP
33976e37cbf389c3deb598c598096fc0f160c1d4
2356516960cdb701996fe6273ac29aacced25101
refs/heads/master
2022-11-16T02:46:10.345118
2020-02-26T18:35:51
2020-02-26T18:35:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,038
java
package gov.va.med.jmeadows_2_3_1.webservice; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for alert complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="alert"> * &lt;complexContent> * &lt;extension base="{http://webservice.vds.URL /}dataBean"> * &lt;sequence> * &lt;element name="alertId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="messageText" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "alert", namespace = "http://webservice.vds.URL /", propOrder = { "alertId", "messageText" }) public class Alert extends DataBean { protected String alertId; protected String messageText; /** * Gets the value of the alertId property. * * @return * possible object is * {@link String } * */ public String getAlertId() { return alertId; } /** * Sets the value of the alertId property. * * @param value * allowed object is * {@link String } * */ public void setAlertId(String value) { this.alertId = value; } /** * Gets the value of the messageText property. * * @return * possible object is * {@link String } * */ public String getMessageText() { return messageText; } /** * Sets the value of the messageText property. * * @param value * allowed object is * {@link String } * */ public void setMessageText(String value) { this.messageText = value; } }
[ "sam.habiel@gmail.com" ]
sam.habiel@gmail.com
467d139719120c6a33337bcc309c03659f9db558
6d333756b5d1c840c4f1d12a4ccf782684ed4132
/SessionStart/src/StartClassV1.java
6ae91e2be89a3985fb9c1b6e8c60f793f46863f8
[]
no_license
IshanGupta10/JavaCodesAndPractices
f4d7fedf6379251084be0a9144ed1ebcf212c748
c158c2cc5c5634f04f16a1af3bf39db896d441e8
refs/heads/master
2020-04-06T07:10:21.421591
2016-09-05T04:17:38
2016-09-05T04:17:38
64,817,175
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
//Code for swapping for two variables. import java.util.*; public class StartClassV1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(), b = sc.nextInt() , temp = 0; sc.close(); temp = a; a = b; b = temp; System.out.println("a = "+ a +" and b = " + b); } }
[ "ishangupta.work@gmail.com" ]
ishangupta.work@gmail.com
11ff18c32c34c9a0cbf72e74bf61b005ad11685d
29f78bfb928fb6f191b08624ac81b54878b80ded
/generated_SPs_SCs/SACConf/service_provider/src/main/java/large3/output/OutputDataClassName_4_5.java
8974a7203ad10c471f00e53eeec2823b4c62fea7
[]
no_license
MSPL4SOA/MSPL4SOA-tool
8a78e73b4ac7123cf1815796a70f26784866f272
9f3419e416c600cba13968390ee89110446d80fb
refs/heads/master
2020-04-17T17:30:27.410359
2018-07-27T14:18:55
2018-07-27T14:18:55
66,304,158
0
1
null
null
null
null
UTF-8
Java
false
false
1,805
java
package large3.output; import java.io.Serializable; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "OutputDataClassName_4_5") @XmlType(name = "outputDataClassName_4_5", propOrder = { "OutputName_4_5_1", "OutputName_4_5_2", "OutputName_4_5_3", "OutputName_4_5_4", "OutputName_4_5_5" }) public class OutputDataClassName_4_5 implements Serializable { private static final long serialVersionUID = 1L; @XmlElement(name = "OutputName_4_5_1") protected String OutputName_4_5_1; @XmlElement(name = "OutputName_4_5_2") protected Float OutputName_4_5_2; @XmlElement(name = "OutputName_4_5_3") protected Float OutputName_4_5_3; @XmlElement(name = "OutputName_4_5_4") protected Float OutputName_4_5_4; @XmlElement(name = "OutputName_4_5_5") protected Float OutputName_4_5_5; public String getOutputName_4_5_1() { return OutputName_4_5_1; } public Float getOutputName_4_5_2() { return OutputName_4_5_2; } public Float getOutputName_4_5_3() { return OutputName_4_5_3; } public Float getOutputName_4_5_4() { return OutputName_4_5_4; } public Float getOutputName_4_5_5() { return OutputName_4_5_5; } public void setOutputName_4_5_1(String value) { this.OutputName_4_5_1 = value; } public void setOutputName_4_5_2(Float value) { this.OutputName_4_5_2 = value; } public void setOutputName_4_5_3(Float value) { this.OutputName_4_5_3 = value; } public void setOutputName_4_5_4(Float value) { this.OutputName_4_5_4 = value; } public void setOutputName_4_5_5(Float value) { this.OutputName_4_5_5 = value; } }
[ "akram.kamoun@gmail.com" ]
akram.kamoun@gmail.com
64f4ddd9e1c2deea20ec0e82f9ceb249f5d7f60c
81597b9d6b50df808035699d741a4e6cb994398e
/study_pdf/src/main/java/com/spinach/frame/itextpdf/sandbox/objects/Grid.java
be0bc59cfe6126c088a94ba5a83ea61caea36a04
[]
no_license
spinachgit/study_frame_third
d78fa794c39adbaaa708eae6c05e4d9ed30eb32f
23fe388e291ffff7a5da7d0987117e3106d024d2
refs/heads/master
2021-05-12T18:19:08.267682
2018-03-04T06:27:22
2018-03-04T06:27:22
113,398,256
0
0
null
null
null
null
UTF-8
Java
false
false
1,414
java
package com.spinach.frame.itextpdf.sandbox.objects; import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.PageSize; import com.itextpdf.text.Rectangle; import com.itextpdf.text.pdf.PdfContentByte; import com.itextpdf.text.pdf.PdfWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import com.spinach.frame.itextpdf.sandbox.WrapToTest; @WrapToTest public class Grid { public static final String DEST = "results/objects/grid.pdf"; public static void main(String[] args) throws IOException, DocumentException { File file = new File(DEST); file.getParentFile().mkdirs(); new Grid().createPdf(DEST); } public void createPdf(String dest) throws FileNotFoundException, DocumentException { Rectangle pagesize = PageSize.LETTER; Document document = new Document(pagesize); PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(dest)); document.open(); PdfContentByte canvas = writer.getDirectContent(); for (float x = 0; x < pagesize.getWidth(); ) { for (float y = 0; y < pagesize.getHeight(); ) { canvas.circle(x, y, 1f); y += 72f; } x += 72f; } canvas.fill(); document.close(); } }
[ "1043204960@qq.com" ]
1043204960@qq.com
2d2e73eae7f5acc2429c3c45388fbfc7d7e096f2
b716bfaaa8de43c346ed1cdc641eb0eddc64f58f
/boletin5_1/src/boletin5_1/Boletin5_1.java
6c85289c00ab79fdd0f4cd36444768505c773c5b
[]
no_license
MarioBlancosoto/boletin5_Completo
cadb6a7fb48a962ccff941a0f0381f13bccc99b7
e5107e6e452040dfb384f1a7dffbfb7d9016e842
refs/heads/master
2021-06-06T14:10:10.808286
2016-11-03T07:54:48
2016-11-03T07:54:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
603
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package boletin5_1; import javax.swing.JOptionPane; /** * * @author oracle */ public class Boletin5_1 { public static void main(String[] args) { int num1; num1 = Integer.parseInt(JOptionPane.showInputDialog("introduce o numero")); if (num1>0) System.out.println("o numero e positivo"); System.out.println(" adios "); } }
[ "ytaly@192.168.0.10" ]
ytaly@192.168.0.10
4efa496fe064801cebf3b44ecfdf97e958899e2b
c518e22afaf5ea6cfc95f9c0b9b8e4a48e24da08
/src/main/java/com/despegar/Main.java
7bcaee76ff6dd59f32998548c6d1e6a3928f762f
[]
no_license
patri2310/Directorios
4115b0058d38b528ee45b7c79b3a014ed5f2ec4f
63071e22d45adb0fb1dd0ece1de72296b5667ca6
refs/heads/master
2023-06-30T23:52:34.349789
2021-07-30T21:03:06
2021-07-30T21:03:06
391,156,520
0
0
null
null
null
null
UTF-8
Java
false
false
1,767
java
package com.despegar; import com.despegar.command.CommandExit; import com.despegar.command.CommandLs; import com.despegar.tree.Dir; import java.util.Scanner; public class Main { private static final CommandExit exit = new CommandExit("exit"); private static final CommandLs ls = new CommandLs("ls"); private static Dir actualDir = Dir.builder().name("/").build(); public static void main(String[] args) { enterCommand(); } private static void enterCommand() { Scanner sc = new Scanner(System.in); System.out.print(">"); String command = sc.nextLine(); String parameter = null; String[] strings = command.split("/"); if (command.contains("ls")) { if (strings.length == 2) { actualDir = Dir.builder().name(strings[1].trim()).build(); } else if (strings.length == 1) { actualDir = Dir.builder().name("/").build(); } command = strings[0].trim(); if (command.contains("-r")) { String[] strings0 = command.split("-r"); command = strings0[0].trim(); parameter = "-r"; } } System.out.printf("command: %s%n", command); System.out.printf("name: %s%n", actualDir.getName()); switch (command) { case "ls": if (parameter == null) ls.execute(actualDir); else ls.execute(actualDir, parameter); break; case "exit": exit.execute(actualDir); break; default: command = "error"; } if (!command.equals("error") && !command.equals("exit")) enterCommand(); } }
[ "fernandezp@despegar.com" ]
fernandezp@despegar.com
020064bbdfafccb2d1ce8e79d50f18e228aad3be
11b002b186bab769a0e68e4fe4db64bfe258f41a
/src/test/java/com/outcastgeek/traversal/pojos/PojoLevelFour.java
d0da54b0ccc1507f9ec539be0e3a348efe0af497
[ "Apache-2.0" ]
permissive
outcastgeek/beantraversal
f073e23ba9d4c4579b6b347a262ddbbf41a4dfbf
d8b07cf664850eb820e9be40a86e15b2200874f1
refs/heads/master
2021-01-18T14:13:43.716260
2013-08-05T02:27:18
2013-08-05T02:27:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,248
java
package com.outcastgeek.traversal.pojos; /* Copyright 2013 outcastgeek 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. */ /** * Created with IntelliJ IDEA. * User: outcastgeek * Date: 8/1/13 * Time: 1:17 PM * To change this template use File | Settings | File Templates. */ public class PojoLevelFour { private String pojoLevelFour1; private String pojoLevelFour2; public String getPojoLevelFour1() { return pojoLevelFour1; } public void setPojoLevelFour1(String pojoLevelFour1) { this.pojoLevelFour1 = pojoLevelFour1; } public String getPojoLevelFour2() { return pojoLevelFour2; } public void setPojoLevelFour2(String pojoLevelFour2) { this.pojoLevelFour2 = pojoLevelFour2; } }
[ "outcastgeek@gmail.com" ]
outcastgeek@gmail.com
a5ad4f6477d50f01518fa7b4eae02f4aaad4ab75
cd46bca6de5f85469d3c9c8dc3e918321e809972
/src/main/java/kr/co/drpnd/dao/DocDao.java
9f4291c862ccb7851a5098b976114a2ca6a8f60d
[]
no_license
kihoon76/groupware
bf959c1ecbbe42a31b8bcfa24d3a2f8ca6a52a73
ed33dfbfdbe04381b60446c4a454dcdda6576c53
refs/heads/master
2022-12-21T15:59:38.693369
2019-09-18T05:18:14
2019-09-18T05:18:14
143,798,028
1
1
null
2022-12-16T11:31:14
2018-08-07T00:31:33
JavaScript
UTF-8
Java
false
false
152
java
package kr.co.drpnd.dao; import java.util.List; import java.util.Map; public interface DocDao { List<Map<String, String>> selectNormalDocList(); }
[ "lovedeer118@gmail.com" ]
lovedeer118@gmail.com
bc4baa96f43093cba9eef74bde6d685215a49d43
3df8c6f99fb8b0519118c15355afc988ced43ded
/src/main/java/myapp/myapp/domain/board/BoardRepository.java
da2e7ce0e75cb84917f0a21a48d595acbf6fb28f
[]
no_license
minsuk1/share-dailylife
965766b72f5d9786577d21083fc23512aee050c7
9decad75bf0d02acbbbe8601db4412c8f59f0a12
refs/heads/master
2023-07-10T13:38:23.018571
2021-07-18T09:35:40
2021-07-18T09:35:40
373,404,517
1
0
null
null
null
null
UTF-8
Java
false
false
694
java
package myapp.myapp.domain.board; import myapp.myapp.domain.board.repository.BoardRepositoryCustom; import org.springframework.data.jpa.repository.JpaRepository; public interface BoardRepository extends JpaRepository<Board, Long>, BoardRepositoryCustom { } // 참고: https://jojoldu.tistory.com/372 // https://docs.spring.io/spring-data/jpa/docs/2.1.3.RELEASE/reference/html/#repositories.custom-implementations // customRepository를 JpaRepository 상속 클래스에서 상속 가능 // BoardRepository에서 BoardRepositoryCustom, JpaRepository extends // BoardRepositoryCustomImpl에서 BoardRepositoryCustom implements // BoardRepository에서 BoardRepositoryCustomImpl사용 가능
[ "palt1230@naver.com" ]
palt1230@naver.com
208f6674ff2ca998d2fc703ae7f38d9478f938bb
7218a8a5074a5f3d0105d55e0a73fef1b72b1368
/src/main/java/com/github/danilkozyrev/filestorageapi/mapper/UserInfoMapper.java
6e71cb0f3107f09cb2b3c0b52472e36f592dfdba
[ "MIT" ]
permissive
danilkozyrev/file-storage-api
8a113655a3ad5adb6f95e1706561a30658dc9bd0
bce5564ef11a1fed0c83a71e2aac803ba7a8c44b
refs/heads/master
2021-09-28T16:19:04.343585
2021-09-22T21:54:27
2021-09-22T21:54:27
196,000,933
6
2
MIT
2023-08-24T20:27:09
2019-07-09T12:07:16
Java
UTF-8
Java
false
false
748
java
package com.github.danilkozyrev.filestorageapi.mapper; import com.github.danilkozyrev.filestorageapi.domain.Role; import com.github.danilkozyrev.filestorageapi.domain.User; import com.github.danilkozyrev.filestorageapi.dto.projection.UserInfo; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import java.util.List; @Mapper( implementationName = "DefaultUserInfoMapper", implementationPackage = "com.github.danilkozyrev.filestorageapi.mapper.impl") public interface UserInfoMapper { @Mapping(source = "dateCreated", target = "dateRegistered") UserInfo mapUser(User user); List<UserInfo> mapUsers(Iterable<User> users); default String roleToString(Role role) { return role.getName(); } }
[ "kozyrev.danil@gmail.com" ]
kozyrev.danil@gmail.com
1d330c7f3385ead82791650926f89c271cbac974
9893e8e024f7039e56adc4ebb2c6c60dbb7535c9
/app/src/main/java/com/cheda/skysevents/startscreen/SignedInActivity.java
d6c4c6531037cec07f16e62b7a261490cea69d76
[]
no_license
emusvibe/night-life
6a0c50ad36561aa673c7dbb550158802f2be9fcf
fe94c475940336437327fed506873f97063695dc
refs/heads/master
2022-11-17T17:05:01.919306
2020-07-07T06:48:21
2020-07-07T06:48:21
277,739,033
0
0
null
null
null
null
UTF-8
Java
false
false
12,076
java
/* * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. 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.cheda.skysevents.startscreen; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.support.annotation.MainThread; import android.support.annotation.NonNull; import android.support.annotation.StringRes; import android.support.design.widget.Snackbar; import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.text.TextUtils; import android.transition.Slide; import android.transition.Transition; import android.transition.TransitionInflater; import android.view.Gravity; import android.view.View; import android.view.Window; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.bumptech.glide.Glide; import com.cheda.skysevents.ProfileActivity; import com.cheda.skysevents.R; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.EmailAuthProvider; import com.google.firebase.auth.FacebookAuthProvider; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.auth.GoogleAuthProvider; import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; public class SignedInActivity extends AppCompatActivity { private static final String EXTRA_SIGNED_IN_CONFIG = "extra_signed_in_config"; private int type; static final int TYPE_PROGRAMMATICALLY = 0; @BindView(android.R.id.content) View mRootView; @BindView(R.id.user_profile_picture) ImageView mUserProfilePicture; @BindView(R.id.user_email) TextView mUserEmail; @BindView(R.id.user_display_name) TextView mUserDisplayName; @BindView(R.id.user_phone_number) TextView mUserPhoneNumber; @BindView(R.id.user_enabled_providers) TextView mEnabledProviders; private IdpResponse mIdpResponse; private SignedInConfig mSignedInConfig; @Override public void onCreate(Bundle savedInstanceState) { getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS); super.onCreate(savedInstanceState); setupWindowAnimations(); FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser(); if (currentUser == null) { startActivity(LoginReg.createIntent(this)); finish(); return; } mIdpResponse = IdpResponse.fromResultIntent(getIntent()); mSignedInConfig = getIntent().getParcelableExtra(EXTRA_SIGNED_IN_CONFIG); setContentView(R.layout.signed_in_layout); ButterKnife.bind(this); populateProfile(); populateIdpToken(); } private void setupWindowAnimations() { Slide enterTransition = null; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { enterTransition = new Slide(); enterTransition.setSlideEdge(Gravity.LEFT); enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long)); getWindow().setEnterTransition(enterTransition); getWindow().setExitTransition(enterTransition); // getWindow().addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); // getWindow().setReenterTransition(enterTransition); getWindow().setAllowEnterTransitionOverlap(false); } } @OnClick(R.id.sign_out) public void signOut() { AuthUI.getInstance() .signOut(this) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { startActivity(LoginReg.createIntent(SignedInActivity.this)); finish(); } else { showSnackbar(R.string.sign_out_failed); } } }); } @OnClick(R.id.delete_account) public void deleteAccountClicked() { AlertDialog dialog = new AlertDialog.Builder(this) .setMessage("Are you sure you want to delete this account?") .setPositiveButton("Yes, nuke it!", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { deleteAccount(); } }) .setNegativeButton("No", null) .create(); dialog.show(); } private void deleteAccount() { AuthUI.getInstance() .delete(this) .addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { startActivity(LoginReg.createIntent(SignedInActivity.this)); finish(); } else { showSnackbar(R.string.delete_account_failed); } } }); } @MainThread private void populateProfile() { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if (user.getPhotoUrl() != null) { Picasso.with(this) .load(user.getPhotoUrl()) .fit() .placeholder(R.drawable.ic_avatr) .into(mUserProfilePicture); } mUserEmail.setText( TextUtils.isEmpty(user.getEmail()) ? "No email" : user.getEmail()); mUserPhoneNumber.setText( TextUtils.isEmpty(user.getPhoneNumber()) ? "No phone number" : user.getPhoneNumber()); mUserDisplayName.setText( TextUtils.isEmpty(user.getDisplayName()) ? "No display name" : user.getDisplayName()); StringBuilder providerList = new StringBuilder(100); providerList.append("Providers used: "); if (user.getProviders() == null || user.getProviders().isEmpty()) { providerList.append("none"); } else { Iterator<String> providerIter = user.getProviders().iterator(); while (providerIter.hasNext()) { String provider = providerIter.next(); if (GoogleAuthProvider.PROVIDER_ID.equals(provider)) { providerList.append("Google"); } else if (FacebookAuthProvider.PROVIDER_ID.equals(provider)) { providerList.append("Facebook"); } else if (EmailAuthProvider.PROVIDER_ID.equals(provider)) { providerList.append("Company Email"); } else { providerList.append(provider); } if (providerIter.hasNext()) { providerList.append(", "); } } } mEnabledProviders.setText(providerList); } private void populateIdpToken() { String token = null; String secret = null; if (mIdpResponse != null) { token = mIdpResponse.getIdpToken(); secret = mIdpResponse.getIdpSecret(); } View idpTokenLayout = findViewById(R.id.idp_token_layout); if (token == null) { idpTokenLayout.setVisibility(View.GONE); } else { idpTokenLayout.setVisibility(View.VISIBLE); ((TextView) findViewById(R.id.idp_token)).setText(token); } View idpSecretLayout = findViewById(R.id.idp_secret_layout); if (secret == null) { idpSecretLayout.setVisibility(View.GONE); } else { idpSecretLayout.setVisibility(View.VISIBLE); ((TextView) findViewById(R.id.idp_secret)).setText(secret); } } @MainThread private void showSnackbar(@StringRes int errorMessageRes) { // Toast.makeText(this, errorMessageRes, Toast.LENGTH_SHORT).show(); Snackbar.make(mRootView, errorMessageRes, Snackbar.LENGTH_LONG).show(); } public static final class SignedInConfig implements Parcelable { int logo; // int theme; List<AuthUI.IdpConfig> providerInfo; String tosUrl; // boolean isCredentialSelectorEnabled; // boolean isHintSelectorEnabled; SignedInConfig(int logo, List<AuthUI.IdpConfig> providerInfo, String tosUrl) { this.logo = logo; this.providerInfo = providerInfo; this.tosUrl = tosUrl; } SignedInConfig(Parcel in) { logo = in.readInt(); // theme = in.readInt(); providerInfo = new ArrayList<>(); in.readList(providerInfo, AuthUI.IdpConfig.class.getClassLoader()); tosUrl = in.readString(); // isCredentialSelectorEnabled = in.readInt() != 0; // isHintSelectorEnabled = in.readInt() != 0; } public static final Creator<SignedInConfig> CREATOR = new Creator<SignedInConfig>() { @Override public SignedInConfig createFromParcel(Parcel in) { return new SignedInConfig(in); } @Override public SignedInConfig[] newArray(int size) { return new SignedInConfig[size]; } }; @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(logo); // dest.writeInt(theme); dest.writeList(providerInfo); dest.writeString(tosUrl); // dest.writeInt(isCredentialSelectorEnabled ? 1 : 0); // dest.writeInt(isHintSelectorEnabled ? 1 : 0); } } public static Intent createIntent( Context context, IdpResponse idpResponse, SignedInConfig signedInConfig) { Intent startIntent = idpResponse == null ? new Intent() : idpResponse.toIntent(); return startIntent.setClass(context, SignedInActivity.class) .putExtra(EXTRA_SIGNED_IN_CONFIG, signedInConfig); } @Override public void onBackPressed() { super.onBackPressed(); Intent bck = new Intent(this, ProfileActivity.class); Slide slideTransition = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { slideTransition = new Slide(); slideTransition.setSlideEdge(Gravity.RIGHT); slideTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long)); getWindow().setReenterTransition(slideTransition); // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // finishAfterTransition(); // } } startActivity(bck); } }
[ "edmore@shavatraining.co.za" ]
edmore@shavatraining.co.za
1667743168f13418f5912ace1981ade59cd3f0cc
ad3f8a1fac3981eb0689b3916f1cdd532e4c195e
/app/src/main/java/com/example/akambinul1/gitapplicationtest/ItemDetailActivity.java
0f66a837c220ab37255697ba5fe97756cdc7eb6a
[]
no_license
AmithKambinul/GitApplicationTest
fa99a30ccc09075211495077da3a43b602c3c1e4
2ae141299af30daa0c789abd6fa4acb394cb066f
refs/heads/master
2021-07-15T23:28:11.189798
2017-10-19T15:03:39
2017-10-19T15:03:39
107,561,220
0
0
null
null
null
null
UTF-8
Java
false
false
3,487
java
package com.example.akambinul1.gitapplicationtest; import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.widget.Toolbar; import android.view.View; import android.support.v7.app.AppCompatActivity; import android.support.v7.app.ActionBar; import android.support.v4.app.NavUtils; import android.view.MenuItem; /** * An activity representing a single Item detail screen. This * activity is only used narrow width devices. On tablet-size devices, * item details are presented side-by-side with a list of items * in a {@link ItemListActivity}. */ public class ItemDetailActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_detail); Toolbar toolbar = (Toolbar) findViewById(R.id.detail_toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own detail action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); // Show the Up button in the action bar. ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } // savedInstanceState is non-null when there is fragment state // saved from previous configurations of this activity // (e.g. when rotating the screen from portrait to landscape). // In this case, the fragment will automatically be re-added // to its container so we don't need to manually add it. // For more information, see the Fragments API guide at: // // http://developer.android.com/guide/components/fragments.html // if (savedInstanceState == null) { // Create the detail fragment and add it to the activity // using a fragment transaction. Bundle arguments = new Bundle(); arguments.putString(ItemDetailFragment.ARG_ITEM_ID, getIntent().getStringExtra(ItemDetailFragment.ARG_ITEM_ID)); ItemDetailFragment fragment = new ItemDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction() .add(R.id.item_detail_container, fragment) .commit(); } } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { // This ID represents the Home or Up button. In the case of this // activity, the Up button is shown. Use NavUtils to allow users // to navigate up one level in the application structure. For // more details, see the Navigation pattern on Android Design: // // http://developer.android.com/design/patterns/navigation.html#up-vs-back // NavUtils.navigateUpTo(this, new Intent(this, ItemListActivity.class)); return true; } return super.onOptionsItemSelected(item); } }
[ "a.kambinul@umiami.edu" ]
a.kambinul@umiami.edu
155e0057c8a5f03916f9d8073fb80670df331166
ccf82688f082e26cba5fc397c76c77cc007ab2e8
/Mage.Sets/src/mage/cards/b/BloatedContaminator.java
0cf4eda698329238ab3d25dad1ec4e19794e87e7
[ "MIT" ]
permissive
magefree/mage
3261a89320f586d698dd03ca759a7562829f247f
5dba61244c738f4a184af0d256046312ce21d911
refs/heads/master
2023-09-03T15:55:36.650410
2023-09-03T03:53:12
2023-09-03T03:53:12
4,158,448
1,803
1,133
MIT
2023-09-14T20:18:55
2012-04-27T13:18:34
Java
UTF-8
Java
false
false
1,360
java
package mage.cards.b; import java.util.UUID; import mage.MageInt; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.effects.common.counter.ProliferateEffect; import mage.constants.SubType; import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.ToxicAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; /** * @author TheElk801 */ public final class BloatedContaminator extends CardImpl { public BloatedContaminator(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.PHYREXIAN); this.subtype.add(SubType.BEAST); this.power = new MageInt(4); this.toughness = new MageInt(4); // Trample this.addAbility(TrampleAbility.getInstance()); // Toxic 1 this.addAbility(new ToxicAbility(1)); // Whenever Bloated Contaminator deals combat damage to a player, proliferate. this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ProliferateEffect(), false)); } private BloatedContaminator(final BloatedContaminator card) { super(card); } @Override public BloatedContaminator copy() { return new BloatedContaminator(this); } }
[ "theelk801@gmail.com" ]
theelk801@gmail.com
e2214070b5a24f13e146bfc9cd27f419a61b6958
0627384298a9054aecf504dc7ac76d86da944d01
/app/src/main/java/com/cameraparamter/entry/RecordInfo.java
2e02c9d80a12d521f3790233f4f48c1d27fcd154
[]
no_license
DoggyZhang/CameraParamter
590dac9c7dac28c3b4db118161758b748293572f
68815a2143812b715bf776b0fa7c8e470e7f3b4a
refs/heads/master
2020-06-11T09:47:56.069993
2016-12-06T08:18:17
2016-12-06T08:18:17
75,687,890
3
0
null
null
null
null
UTF-8
Java
false
false
633
java
package com.cameraparamter.entry; /** * Created by Administrator on 2016/12/2. */ public class RecordInfo { public String name; public String path; public long duration; public RecordInfo() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public long getDuration() { return duration; } public void setDuration(long duration) { this.duration = duration; } }
[ "572924155@qq.com" ]
572924155@qq.com
c005da9f4657ded8b76d70c510c1f8b3b9e510ed
6ed8105108b0a71c6edc5887386aceba6c2888e5
/AlgorithmQuestions/src/com/changshuogao/solution09/Solution09.java
34621ea95862cf4aa4d6ac9844367cb5aceea724
[]
no_license
changshuo1989/Algorithm
56d922ce67f37f8597dc7f7f551807fbe327d23f
1474f2ce7271a2007e3875d55e3d87dd59aaa7f1
refs/heads/master
2021-01-18T22:39:39.267330
2016-11-03T22:29:18
2016-11-03T22:29:18
72,600,232
0
0
null
null
null
null
UTF-8
Java
false
false
988
java
package com.changshuogao.solution09; import java.util.Arrays; import java.util.HashMap; import java.util.Map; /* * * Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1].*/ public class Solution09 { public static void main(String[] args) { int[] num={12,23,45,18,6,9}; int[] res=new Solution09().twoSum(num, 29); System.out.println(Arrays.toString(res)); } public int[] twoSum(int[] num, int target){ if(num==null){ return null; } int[] res=new int[2]; Map<Integer, Integer> map=new HashMap<Integer, Integer>(); for(int i=0; i<num.length; i++){ if(map.containsKey(target-num[i])){ res[0]=map.get(target-num[i]); res[1]=i; return res; } else{ map.put(num[i], i); } } return res; } }
[ "gaochangshuo1989@gmail.com" ]
gaochangshuo1989@gmail.com
8913ed44a1958b2abf9f93ddf38024dcbfe2de67
75c707019b6c1928b00adabd99aa0d7442317854
/src/main/java/de/blau/android/services/util/ExtendedLocation.java
da0a2600c3be58052189485e0f7f77b9680c6936
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
MarcusWolschon/osmeditor4android
d774d41e46dbab82ac33d6128508ccd46506e79a
5170bfaac8e561a70b9d6ac03f412013ab563abc
refs/heads/master
2023-09-01T17:41:09.037801
2023-08-31T09:22:24
2023-08-31T09:22:24
32,623,844
343
109
NOASSERTION
2023-09-13T11:22:03
2015-03-21T07:25:43
Java
UTF-8
Java
false
false
4,700
java
package de.blau.android.services.util; import android.location.Location; import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.NonNull; public class ExtendedLocation extends Location implements Parcelable { private static final int HAS_HDOP_MASK = 1; private static final int HAS_GEOID_HEIGHT_MASK = 2; private static final int HAS_GEOID_CORRECTION_MASK = 4; private static final int HAS_BAROMETRIC_HEIGHT_MASK = 8; private static final int USE_BAROMETRIC_HEIGHT_MASK = 16; private int flags = 0; private double hdop = Double.NaN; private double geoidHeight = Double.NaN; private double geoidCorrection = Double.NaN; private double barometricHeight = Double.NaN; public static final Parcelable.Creator<ExtendedLocation> CREATOR = new Parcelable.Creator<ExtendedLocation>() { @Override public ExtendedLocation createFromParcel(Parcel in) { Location l = Location.CREATOR.createFromParcel(in); ExtendedLocation el = new ExtendedLocation(l); el.flags = in.readInt(); el.hdop = in.readDouble(); el.geoidHeight = in.readDouble(); el.geoidCorrection = in.readDouble(); el.barometricHeight = in.readDouble(); return el; } @Override public ExtendedLocation[] newArray(int size) { return new ExtendedLocation[size]; } }; /** * Construct a new instance for a specific provider * * @param provider the provider */ public ExtendedLocation(@NonNull String provider) { super(provider); } /** * Copy constructor * * @param location the Location to copy */ public ExtendedLocation(@NonNull Location location) { super(location); } /** * Check if we have a hdop value * * @return true if present */ public boolean hasHdop() { return (flags & HAS_HDOP_MASK) != 0; } /** * @return the hdop */ public double getHdop() { return hdop; } /** * @param hdop the hdop to set */ public void setHdop(double hdop) { this.hdop = hdop; flags |= HAS_HDOP_MASK; } /** * Check if we have a height over the geoid value * * @return true if present */ public boolean hasGeoidHeight() { return (flags & HAS_GEOID_HEIGHT_MASK) != 0; } /** * @return the mslHeight */ public double getGeoidHeight() { return geoidHeight; } /** * @param geoidHeight the height over the geoid to set */ public void setGeoidHeight(double geoidHeight) { this.geoidHeight = geoidHeight; flags |= HAS_GEOID_HEIGHT_MASK; } /** * Check if we have a geoid correction value * * @return true if present */ public boolean hasGeoidCorrection() { return (flags & HAS_GEOID_CORRECTION_MASK) != 0; } /** * @return the geoidCorrection */ public double getGeoidCorrection() { return geoidCorrection; } /** * @param geoidCorrection the geoidCorrection to set */ public void setGeoidCorrection(double geoidCorrection) { this.geoidCorrection = geoidCorrection; flags |= HAS_GEOID_CORRECTION_MASK; } /** * Check if we have a barometric height value * * @return true if present */ public boolean hasBarometricHeight() { return (flags & HAS_BAROMETRIC_HEIGHT_MASK) != 0; } /** * @return the barometricHeight */ public double getBarometricHeight() { return barometricHeight; } /** * @param barometricHeight the barometricHeight to set */ public void setBarometricHeight(double barometricHeight) { this.barometricHeight = barometricHeight; flags |= HAS_BAROMETRIC_HEIGHT_MASK; } /** * Check if we should use barometric height values * * @return true if present */ public boolean useBarometricHeight() { return (flags & USE_BAROMETRIC_HEIGHT_MASK) != 0; } /** * Indicate that we should use barometric height */ public void setUseBarometricHeight() { flags |= USE_BAROMETRIC_HEIGHT_MASK; } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeInt(this.flags); dest.writeDouble(hdop); dest.writeDouble(geoidHeight); dest.writeDouble(geoidCorrection); dest.writeDouble(barometricHeight); } }
[ "simon@poole.ch" ]
simon@poole.ch
06f4a54b8e36a886c8b70ebdcc1c869848f35f55
b8621588fb0fe0590d6b6aabed9adc954a693c03
/Knoda/src/main/java/unsorted/BitmapTools.java
8dd3fc3a4e881b33dc48054be1ddc6e02b429243
[]
no_license
knodafuture/knoda-android
6ebae06b0f224cb7ef5845881077e7f795559948
589b30a3c160fc87b473eb80b55b7cc35a8812c5
refs/heads/master
2021-01-09T07:02:08.340290
2014-09-11T13:45:42
2014-09-11T13:45:42
15,742,273
0
0
null
null
null
null
UTF-8
Java
false
false
1,252
java
package unsorted; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.media.ThumbnailUtils; public class BitmapTools { public static Bitmap getclip(Bitmap bitmap) { return getclipSized(bitmap, bitmap.getWidth(), bitmap.getHeight()); } public static Bitmap getclipSized(Bitmap bitmap, int width, int height) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final Rect rect2 = new Rect(0, 0, width, height); paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2, bitmap.getWidth() / 2, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return ThumbnailUtils.extractThumbnail(output, width, height); } }
[ "jcailteux@knoda.com" ]
jcailteux@knoda.com
b0ba649d200ff62849f886f4f7c8577363d307f9
22f2c6b3ae9d4b100ed5fc11d6f051d9a2ed3d7d
/src/main/java/com/takeaway/challenge/util/Constants.java
181e08f0d4ef774d336fef6390b2c7b3d0fe0fad
[]
no_license
amol1092/bob-challenge-employee-service
6d83def17ee8971e7b37e8bdd5af0244daf999ae
71aa8efcf46b13757929a2775f7dc8129adb8a79
refs/heads/master
2023-01-30T19:43:20.935810
2020-12-16T09:32:37
2020-12-16T09:32:37
319,426,951
0
0
null
null
null
null
UTF-8
Java
false
false
1,055
java
package com.takeaway.challenge.util; public class Constants { public static final String EMPLOYEES_BASE_URL = "/employees"; public static final String DEPARTMENTS_BASE_URL = "/departments"; public static final String ID_URL = "/{id}"; public static final String CREATED_RESPONSE_MESSAGE = "created"; public static final String DEPARTMENT_CREATE_BAD_REQUEST_RESPONSE_MESSAGE = "Department exists with same name." + " Please try another one"; public static final String EMPLOYEE_CREATE_BAD_REQUEST_RESPONSE_MESSAGE = "Employee exists with same email address. " + "Please try another one"; public static final String EMPLOYEE_FOUND_MESSAGE = "Employee found"; public static final String EMPLOYEE_NOT_FOUND_MESSAGE = "Employee not found"; public static final String UPDATED_RESPONSE_MESSAGE = "updated"; public static final String DELETED_RESPONSE_MESSAGE = "deleted"; public static final String NOT_DELETED_RESPONSE_MESSAGE = "not deleted"; public static final String EMPLOYEE_EVENTS_TOPIC = "employee.events"; }
[ "amole.92@gmail.com" ]
amole.92@gmail.com
471eba1ee9c93d21dfc508d56b7ee7f8df7ac8ac
fe2d70b6e294fa9c1d8891e4a291de3a32ee230f
/src/org/noip/mrgreenleaves/retestchapter10/UseFormen2D.java
3f0f31f903c2ace00db4cbfb03b4d77f553c5494
[]
no_license
MrEcrm/calcul
8eb92a0db36366d1043a92f9fb7a2ef30002325f
73dd93b8b5fd2a351d92a43bb1b9d63707acb95c
refs/heads/master
2022-09-22T19:07:47.426572
2020-06-03T15:40:52
2020-06-03T15:40:52
269,126,765
0
0
null
null
null
null
UTF-8
Java
false
false
1,323
java
package org.noip.mrgreenleaves.retestchapter10; public class UseFormen2D { public static void main(String[] args) { Formen2D viereck = new Viereck(12,10); Formen2D kreis = new Kreis(20); System.out.printf("%s hat einen Umfang von %g und eine Fläche von %g%n", viereck.getClass(), viereck.getUmfang(), viereck.getFläche()); System.out.printf("%s hat einen Umfang von %g und eine Fläche von %g%n", kreis.getClass(), kreis.getUmfang(), kreis.getFläche()); if(viereck instanceof Formen2D) { System.out.printf("%s ist eine Instanz von Formen2d %n", viereck.getClass()); } else { System.out.printf("%s ist keine Instanz von Formen2d%n", viereck.getClass()); } if(viereck instanceof Viereck) { System.out.printf("%s ist eine Instanz von Viereck %n", viereck.getClass()); } else { System.out.printf("%s ist keine Instanz von Viereck%n", viereck.getClass()); } if(viereck instanceof Kreis) { System.out.printf("%s ist eine Instanz von Formen2d %n", viereck.getClass()); } else { System.out.printf("%s ist keine Instanz von Kreis%n", viereck.getClass()); } } }
[ "drmordillo@gmail.com" ]
drmordillo@gmail.com
61c2c5561b17259d5d1c569650384db2a84251d9
d579b25070df5010c6f04c26928354cbc2f067ef
/benchmarks/generation/math_4/target/npefix/npefix-output/org/apache/commons/math3/optim/nonlinear/scalar/gradient/Preconditioner.java
b3b1c28d1e767ce4bd48457fef5d16ebe334aed1
[ "Apache-2.0", "BSD-3-Clause", "Minpack" ]
permissive
Spirals-Team/itzal-experiments
b9714f7a340ef9a2e4e748b5b723789592ea1cd5
87be2e8c554462ef38e7574dbdd5b28dadb52421
refs/heads/master
2022-04-07T22:45:06.765973
2020-03-03T06:18:03
2020-03-03T06:18:03
113,832,374
0
0
null
2020-03-03T06:18:05
2017-12-11T08:26:25
null
UTF-8
Java
false
false
160
java
package org.apache.commons.math3.optim.nonlinear.scalar.gradient; public interface Preconditioner { double[] precondition(double[] point, double[] r); }
[ "martin.monperrus@gnieh.org" ]
martin.monperrus@gnieh.org
6165774b8fefaff677c7b1d7955e640a39fc9238
17f54f17fbab8f72cd927157853e5ac64115b0c3
/Android_Code/TrueSecrets/src/com/inapppurchase/util/Security.java
2bed68ee3d053fe6cd6d758978684e8ae3a4857a
[]
no_license
minakshibh/TrueSecrets
7e37ac9513239041dc0ae3b8a1a61f0233d803a1
80e078fd94cd40f45a9a92fd1f58ee7fe4f16fce
refs/heads/master
2021-01-10T06:34:53.369614
2016-09-12T11:11:47
2016-09-12T11:11:47
47,602,291
0
0
null
null
null
null
UTF-8
Java
false
false
5,012
java
/* Copyright (c) 2012 Google 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 com.inapppurchase.util; import android.text.TextUtils; import android.util.Log; import org.json.JSONException; import org.json.JSONObject; import java.security.InvalidKeyException; import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.security.Signature; import java.security.SignatureException; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; /** * Security-related methods. For a secure implementation, all of this code * should be implemented on a server that communicates with the * application on the device. For the sake of simplicity and clarity of this * example, this code is included here and is executed on the device. If you * must verify the purchases on the phone, you should obfuscate this code to * make it harder for an attacker to replace the code with stubs that treat all * purchases as verified. */ public class Security { private static final String TAG = "IABUtil/Security"; private static final String KEY_FACTORY_ALGORITHM = "RSA"; private static final String SIGNATURE_ALGORITHM = "SHA1withRSA"; /** * Verifies that the data was signed with the given signature, and returns * the verified purchase. The data is in JSON format and signed * with a private key. The data also contains the {@link PurchaseState} * and product ID of the purchase. * @param base64PublicKey the base64-encoded public key to use for verifying. * @param signedData the signed JSON string (signed, not encrypted) * @param signature the signature for the data, signed with the private key */ public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) { if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey) || TextUtils.isEmpty(signature)) { Log.e(TAG, "Purchase verification failed: missing data."); return false; } PublicKey key = Security.generatePublicKey(base64PublicKey); return Security.verify(key, signedData, signature); } /** * Generates a PublicKey instance from a string containing the * Base64-encoded public key. * * @param encodedPublicKey Base64-encoded public key * @throws IllegalArgumentException if encodedPublicKey is invalid */ public static PublicKey generatePublicKey(String encodedPublicKey) { try { byte[] decodedKey = Base64.decode(encodedPublicKey); KeyFactory keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORITHM); return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey)); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (InvalidKeySpecException e) { Log.e(TAG, "Invalid key specification."); throw new IllegalArgumentException(e); } catch (Base64DecoderException e) { Log.e(TAG, "Base64 decoding failed."); throw new IllegalArgumentException(e); } } /** * Verifies that the signature from the server matches the computed * signature on the data. Returns true if the data is correctly signed. * * @param publicKey public key associated with the developer account * @param signedData signed data from server * @param signature server signature * @return true if the data and signature match */ public static boolean verify(PublicKey publicKey, String signedData, String signature) { Signature sig; try { sig = Signature.getInstance(SIGNATURE_ALGORITHM); sig.initVerify(publicKey); sig.update(signedData.getBytes()); if (!sig.verify(Base64.decode(signature))) { Log.e(TAG, "Signature verification failed."); return false; } return true; } catch (NoSuchAlgorithmException e) { Log.e(TAG, "NoSuchAlgorithmException."); } catch (InvalidKeyException e) { Log.e(TAG, "Invalid key specification."); } catch (SignatureException e) { Log.e(TAG, "Signature exception."); } catch (Base64DecoderException e) { Log.e(TAG, "Base64 decoding failed."); } return false; } }
[ "misha311289@yahoo.in" ]
misha311289@yahoo.in
315fc04517df511a89672ddc31cf22d5ff2a7dbc
a13fb51da57de0bde7144f45a057d3c7769965ed
/src/main/java/com/luiz/minhasfinancas/model/repository/LancamentoRepository.java
9be184af3f4dc2585e147f1816b03aa1fc26fa12
[]
no_license
LuizAgStefani/Spring-React_Udemy
f050a4374232d5113239b281c8905dde9fcf314d
5d686d84529bb593918c5b1ac5735b1db2e70b77
refs/heads/master
2023-08-11T14:02:21.597715
2021-09-22T15:39:34
2021-09-22T15:39:34
398,259,654
0
0
null
null
null
null
UTF-8
Java
false
false
1,111
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.luiz.minhasfinancas.model.repository; import com.luiz.minhasfinancas.model.entity.Lancamento; import com.luiz.minhasfinancas.model.enums.StatusLancamento; import com.luiz.minhasfinancas.model.enums.TipoLancamento; import java.math.BigDecimal; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; /** * * @author luiz */ public interface LancamentoRepository extends JpaRepository<Lancamento,Long>{ @Query(value = "select sum(l.valor) from Lancamento l join l.usuario u " + "where u.id = :idUsuario and l.tipo =:tipo and l.status = :status group by u") BigDecimal obterSaldoPorTipoLancamentoEUsuarioEStatus( @Param("idUsuario") Long idUsuario, @Param("tipo") TipoLancamento tipo, @Param("status") StatusLancamento status); }
[ "lastefani@cliptech.com.br" ]
lastefani@cliptech.com.br
0c0251c119094308b63bcc3ca423d85591a7501d
1055a89ac254d1b4fc0e1a46e22cc989b7a3476a
/frontend/src/main/java/com/niit/controller/CartController.java
fa38239d553feed0b7809a3d3efd1d5f8972ab7f
[]
no_license
Uthraa1234/niit-project-frontend
55ddfe9ff493711307ad2b9e1e519892b0e46921
ca8c40d9aafcad103769d665ea8322ae9759ccad
refs/heads/master
2021-07-24T05:00:10.611832
2017-11-04T06:58:47
2017-11-04T06:58:47
108,439,539
0
0
null
null
null
null
UTF-8
Java
false
false
4,834
java
package com.niit.controller; import java.util.List; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.User; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import com.niit.model.Cart; import com.niit.model.Product; import com.niit.service.CartService; import com.niit.service.ProductService; @Controller public class CartController { @Autowired private ProductService productService; @Autowired private CartService cartService; @RequestMapping("/cart/{productId}") public String cart(@PathVariable("productId") int productId, @RequestParam int units,Model model){ Product product =productService.getproductbyid(productId); model.addAttribute("product", product); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); String username = user.getUsername(); System.out.println(username); List<Cart> cartitems = cartService.getCartbyusername(username); for (Cart cartitem : cartitems) { if(cartitem.getProducts().getProductId()==productId){ cartitem.setQuantity(cartitem.getQuantity()+1); cartitem.setTotal(product.getPrice()*cartitem.getQuantity()); product.setStock(product.getStock()-1); productService.saveProduct(product); cartService.saveCart(cartitem); model.addAttribute("units", cartitem.getQuantity()); return "redirect:/mycart"; } } Cart cart=new Cart(); cart.setProductName(product.getProductName()); cart.setPrice(product.getPrice()); cart.setQuantity(units); cart.setTotal(product.getPrice()); cart.setUser(username); cart.setProducts(product); product.setStock(product.getStock()-1); productService.saveProduct(product); cartService.saveCart(cart); return "redirect:/mycart"; } @RequestMapping("/mycart") public String getcart(HttpSession session,Model model) { int tot=0; User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); String username = user.getUsername(); System.out.println(username); List<Cart> cart = cartService.getCartbyusername(username); for(Cart c:cart){ tot=tot+c.getTotal(); } model.addAttribute("total", tot); model.addAttribute("i", cart); session.setAttribute("count", cart.size()); return "cart"; } @RequestMapping("/cart/minus/{id}") public String minus(@PathVariable int id, Model model) { Product product = productService.getproductbyid(id); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); String username = user.getUsername(); List<Cart> cartitems =cartService.getCartbyusername(username) ; for (Cart cartitem : cartitems) { if (cartitem.getProducts().getProductId() == id) { if (cartitem.getQuantity() > 1) { cartitem.setQuantity(cartitem.getQuantity() - 1); cartitem.setTotal(cartitem.getProducts().getPrice() * cartitem.getQuantity()); product.setStock(product.getStock() + 1); productService.saveProduct(product); cartService.saveCart(cartitem); } } } return "redirect:/mycart"; } @RequestMapping("/cart/plus/{id}") public String plus(@PathVariable int id, Model model) { Product product = productService.getproductbyid(id); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); String username = user.getUsername(); List<Cart> cartitems =cartService.getCartbyusername(username) ; System.out.println(cartitems.size()); for (Cart cartitem : cartitems) { if (product.getStock() > 0) { if (cartitem.getProducts().getProductId() == id) { cartitem.setQuantity(cartitem.getQuantity() + 1); cartitem.setTotal(cartitem.getProducts().getPrice() * cartitem.getQuantity()); product.setStock(product.getStock() - 1); productService.saveProduct(product); cartService.saveCart(cartitem); System.out.println(cartitem.getQuantity()); } } } return "redirect:/mycart"; } @RequestMapping("/cart/removecartitem/{cartitemid}") public String removecartitem(@PathVariable int cartitemid,Model model) { cartService.removecartitem(cartitemid); return "redirect:/mycart"; } @RequestMapping("/cart/removecart") public String removecart(Model model) { User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); String username = user.getUsername(); cartService.removeallcartitem(username); return "redirect:/mycart"; } }
[ "30919079+Uthraa1234@users.noreply.github.com" ]
30919079+Uthraa1234@users.noreply.github.com
87bba6d234d574087cc86e9f9c3867296bf23d2f
b1caa1e6966c3fef1e6a0e11f2c999b8b21c0a1e
/src/PrisonSearch/AStarHeuristics/FarthestRockHeuristic.java
9e8874c6b1d754ca7e7e03eabe2afc869af1f7fb
[]
no_license
mostafa-abdullah/R2D2Escape
c1034f16e7c19a3f08814c42058e8eadbd068403
74bee6d8ac4b47392baaf8b16f115aad6bb666f6
refs/heads/master
2021-08-26T05:35:24.576407
2017-11-21T20:16:38
2017-11-21T20:19:16
106,530,178
0
0
null
null
null
null
UTF-8
Java
false
false
1,479
java
package PrisonSearch.AStarHeuristics; import GenericSearch.State; import GenericSearch.StateHeuristic; import PrisonSearch.Cell; import PrisonSearch.PrisonState; public class FarthestRockHeuristic extends StateHeuristic{ /** * Calculate the manhattan distance between the player and the farthest rock not on a pressure pad * @param: The state calculate the heuristic value for * @return: The heuristic value calculated for the given state */ @Override public int calculate(State s) { final int INFINITY = (int) 1e9; PrisonState state = (PrisonState) s; int myX = -1, myY = -1; Cell[][] grid = state.getGrid(); for(int i = 0; i < grid.length; i++) for(int j = 0; j < grid[i].length; j++) if(grid[i][j] == Cell.ME) { myX = i; myY = j; } int[] iBorders = {0, grid.length}; int[] jBorders = {0, grid[0].length}; int max = 0; for(int i = 0; i < grid.length; i++) for(int j = 0; j < grid[i].length; j++) if(grid[i][j] == Cell.ROCK) { for(int bi = 0; bi < 2; bi++) for(int bj = 0; bj < 2; bj++) if(i == iBorders[bi] && j == jBorders[bj]) return INFINITY; max = Math.max(max, Math.abs(myX - i) + Math.abs(myY - j)); } return max; } }
[ "mostafaabdullahahmed@gmail.com" ]
mostafaabdullahahmed@gmail.com
326d649105094a50931aca760ae04f6441c24958
9be90560426097cba9a644a625fa631914dc9b9b
/_02strategy/src/main/java/online/cccccc/CatMinComparable.java
c77eac143cef9145655a4d0b15ea7c7d95e26a82
[ "Apache-2.0" ]
permissive
cqiang102/DesignPatterns
97f31c92df0fba2533c9dd16ecfa2b39535f854e
056c5f1e3c826f99625860bc78117704d263cf4b
refs/heads/master
2020-09-04T01:34:35.607873
2019-11-18T03:38:52
2019-11-18T03:38:52
219,630,423
0
0
null
null
null
null
UTF-8
Java
false
false
369
java
package online.cccccc; /** * @author 你是电脑 * @create 2019/11/5 - 10:25 */ public class CatMinComparable implements Comparable<Cat> { @Override public int compareTo(Cat o1, Cat o2) { if(o1.weight > o2.weight){ return 1; } else if(o1.weight < o2.weight){ return -1; } return 0; } }
[ "2375622526@qq.com" ]
2375622526@qq.com
248ed24b4fd0ac7cb99b57ff71758df52c4f2cf4
7823f683ed11adf948cfc8dfeecb1e40ba5f6682
/src/com/khronos/collada/EllipseType.java
d16a966766b65b6030d506426c82f536939deda1
[]
no_license
laubfall/collada-loader
f17fbb8965f318fc13230486ec2fe20e0779143c
7493808cf90c618cf566da546862ab15371431b9
refs/heads/master
2020-06-03T11:26:56.138692
2014-12-14T12:13:45
2014-12-14T12:13:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,886
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.06.29 at 06:09:13 PM CEST // package com.khronos.collada; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlList; import javax.xml.bind.annotation.XmlType; /** * Describes an ellipse in 3D space. An ellipse is defined by its major and minor radii and, as with any conic curve, is positioned in space with a right-handed coordinate system where: - the origin is the center of the ellipse, - the "X Direction" defines the major axis, and - the "Y Direction" defines the minor axis. The origin, "X Direction" and "Y Direction" of this coordinate system define the plane of the ellipse. The coordinate system is the local coordinate system of the ellipse. The "main Direction" of this coordinate system is the vector normal to the plane of the ellipse. The axis, of which the origin and unit vector are respectively the origin and "main Direction" of the local coordinate system, is termed the "Axis" or "main Axis" of the ellipse. The "main Direction" of the local coordinate system gives an explicit orientation to the ellipse (definition of the trigonometric sense), determining the direction in which the parameter increases along the ellipse. The Geom_Ellipse ellipse is parameterized by an angle: P(U) = O + MajorRad*Cos(U)*XDir + MinorRad*Sin(U)*YDir where: - P is the point of parameter U, - O, XDir and YDir are respectively the origin, "X <br> Direction" and "Y Direction" of its local coordinate system, - MajorRad and MinorRad are the major and minor radii of the ellipse. The "X Axis" of the local coordinate system therefore defines the origin of the parameter of the ellipse. An ellipse is a closed and periodic curve. The period is 2.*Pi and the parameter range is [ 0, 2.*Pi [. * * <p>Java class for ellipse_type complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ellipse_type"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="radius" type="{http://www.collada.org/2008/03/COLLADASchema}float2_type"/> * &lt;element name="extra" type="{http://www.collada.org/2008/03/COLLADASchema}extra_type" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ellipse_type", propOrder = { "radius", "extra" }) public class EllipseType { @XmlList @XmlElement(type = Double.class) protected List<Double> radius; protected List<ExtraType> extra; /** * Gets the value of the radius property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the radius property. * * <p> * For example, to add a new item, do as follows: * <pre> * getRadius().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Double } * * */ public List<Double> getRadius() { if (radius == null) { radius = new ArrayList<Double>(); } return this.radius; } /** * Gets the value of the extra property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the extra property. * * <p> * For example, to add a new item, do as follows: * <pre> * getExtra().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link ExtraType } * * */ public List<ExtraType> getExtra() { if (extra == null) { extra = new ArrayList<ExtraType>(); } return this.extra; } public void fuck(){System.out.println("fuuuuuuuck");} }
[ "dan.ludwig@gmx.de" ]
dan.ludwig@gmx.de
624aabf7fac23d740c4896baba4415a540950d96
422035d2bfe48e4da0e3772a0346dc812fdf4d43
/app/src/main/java/com/yininghuang/zhihudailynews/utils/CircleTransform.java
94f43b962123bb172f717f95fb5dfe86813df1d4
[ "Apache-2.0" ]
permissive
850759383/ZhihuDailyNews
ff2f36573975056edbfa2fd92ba37c7a53c2d66b
3214792689b33530883d71b7e1cb5ef9e136e973
refs/heads/master
2021-01-17T18:07:03.518958
2019-03-06T05:51:56
2019-03-06T05:51:56
71,041,795
12
5
null
2017-05-02T05:24:30
2016-10-16T09:49:21
Java
UTF-8
Java
false
false
1,658
java
package com.yininghuang.zhihudailynews.utils; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.Paint; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; /** * Created by Yining Huang on 2016/10/20. */ public class CircleTransform extends BitmapTransformation { public CircleTransform(Context context) { super(context); } @Override protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) { return circleCrop(pool, toTransform); } private static Bitmap circleCrop(BitmapPool pool, Bitmap source) { if (source == null) return null; int size = Math.min(source.getWidth(), source.getHeight()); int x = (source.getWidth() - size) / 2; int y = (source.getHeight() - size) / 2; Bitmap squared = Bitmap.createBitmap(source, x, y, size, size); Bitmap result = pool.get(size, size, Bitmap.Config.ARGB_8888); if (result == null) { result = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888); } Canvas canvas = new Canvas(result); Paint paint = new Paint(); paint.setShader(new BitmapShader(squared, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP)); paint.setAntiAlias(true); float r = size / 2f; canvas.drawCircle(r, r, r, paint); return result; } @Override public String getId() { return getClass().getName(); } }
[ "iamyining@yahoo.com" ]
iamyining@yahoo.com
1e597ba5cf5d322275f4763d9ab8ce42768eea20
d385e42e2bb97873e5b516c6b369d2e0071314f8
/src/main/java/com/example/webcrawler/dao/PageDaoImpl.java
6aa7fdaf6c586ff4c194224fbafa7c5f6e319aae
[]
no_license
kapilgupta101292/web-crawler
7f511d9b69920b1a49e5add4ea81f96dba498d41
fffb6c723116b6a6caab1d47e2dc50a39dbb3549
refs/heads/master
2022-09-19T17:57:29.302793
2020-04-05T16:41:09
2020-04-05T16:41:09
253,017,883
1
0
null
2022-09-01T23:22:52
2020-04-04T14:27:05
Java
UTF-8
Java
false
false
1,054
java
package com.example.webcrawler.dao; import com.example.webcrawler.model.Page; import org.bson.Document; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Update; import org.springframework.stereotype.Repository; import java.util.List; @Repository public class PageDaoImpl implements PageDao { @Autowired private MongoTemplate mongoTemplate; public List<Page> getAllPages() { return mongoTemplate.findAll(Page.class); } public Page addNewPage(Page page) { Query query = new Query(Criteria.where("_id").is(page.getLink())); Document doc = new Document(); // org.bson.Document mongoTemplate.getConverter().write(page, doc); Update update = Update.fromDocument(doc); mongoTemplate.upsert(query, update, "page"); return page; } }
[ "kapil.gupta@sirionlabs.com" ]
kapil.gupta@sirionlabs.com
abe25e1253750b4987dae58312cda1ec1f8c297a
c57d43c7911c5011f76869e49380e3613e712e46
/maplisthopkins/src/main/java/com/reversewait/domain/UserSite.java
0a417dd37df625df51b697d34edbf7617945d469
[]
no_license
johnobarker/maplisthopkins
67e6047ea8d9bc71a500740eadde171140fa66c1
e408554578079ccf4c0b3412216a479dc3e4ef23
refs/heads/master
2016-09-05T16:46:19.445750
2013-03-02T21:23:15
2013-03-02T21:23:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,130
java
package com.reversewait.domain; import java.io.Serializable; import org.bson.types.ObjectId; import org.springframework.data.annotation.Id; import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.mapping.Document; @Document public class UserSite implements Serializable { private static final long serialVersionUID = 1L; @Id private ObjectId id; @Indexed private String userId; // the user object associated with this site private String siteName; private String contactUserName; private String contactPassword; private String contactName; private String contactAddress1; private String contactAddress2; private String contactCity; private String contactState; private String contactZip; private String contactEmail; private String contactPhone1; private String contactPhone2; public UserSite() {this.id = ObjectId.get();} public UserSite (String siteName, String contactUserName, String contactPassword) { this.siteName = siteName; this.contactUserName = contactUserName; this.contactPassword = contactPassword; } public String getSiteName() { return siteName; } public void setSiteName(String siteName) { this.siteName = siteName; } public String getContactUserName() { return contactUserName; } public void setContactUserName(String contactUserName) { this.contactUserName = contactUserName; } public String getContactPassword() { return contactPassword; } public void setContactPassword(String contactPassword) { this.contactPassword = contactPassword; } public String getContactName() { return contactName; } public void setContactName(String contactName) { this.contactName = contactName; } public String getContactAddress1() { return contactAddress1; } public void setContactAddress1(String contactAddress1) { this.contactAddress1 = contactAddress1; } public String getContactAddress2() { return contactAddress2; } public void setContactAddress2(String contactAddress2) { this.contactAddress2 = contactAddress2; } public String getContactCity() { return contactCity; } public void setContactCity(String contactCity) { this.contactCity = contactCity; } public String getContactState() { return contactState; } public void setContactState(String contactState) { this.contactState = contactState; } public String getContactZip() { return contactZip; } public void setContactZip(String contactZip) { this.contactZip = contactZip; } public String getContactEmail() { return contactEmail; } public void setContactEmail(String contactEmail) { this.contactEmail = contactEmail; } public String getContactPhone1() { return contactPhone1; } public void setContactPhone1(String contactPhone1) { this.contactPhone1 = contactPhone1; } public String getContactPhone2() { return contactPhone2; } public void setContactPhone2(String contactPhone2) { this.contactPhone2 = contactPhone2; } public String getUserId() { return userId; } public void setUserId(String userId) { this.userId = userId; } }
[ "mherb@cevo.com" ]
mherb@cevo.com
ca48fac849e6e7da1fae4dab35ad9ebaa5ffc44d
47bee068ddb9dacfff94d08341f604ebe97f9fef
/src/main/java/com/smlsnnshn/Lessons/day31_ArrayList/AddAll.java
7b95728300d20a5f7e5382e317672579c69fe766
[]
no_license
ismailsinansahin/JavaLessons
55686229d946390a52383f5d80e1053f411286e7
768cb63e22462e7c2eef709102df5d19d9c98568
refs/heads/master
2023-07-18T23:10:31.302133
2021-09-14T20:56:35
2021-09-14T20:56:35
360,487,169
2
0
null
null
null
null
UTF-8
Java
false
false
501
java
package com.smlsnnshn.Lessons.day31_ArrayList; import java.util.ArrayList; public class AddAll { public static void main(String[] args) { ArrayList<String> l1 = new ArrayList<>(); l1.add("Java"); l1.add("JS"); ArrayList<String> l2 = new ArrayList<>(); l2.add("C#"); l2.add("C++"); System.out.println(l1.toString()); System.out.println(l2.toString()); l2.addAll(l1); System.out.println(l2.toString()); l1.addAll(l2); System.out.println(l1.toString()); } }
[ "ismailsinansahin@gmail.com" ]
ismailsinansahin@gmail.com
ebe30a0701f62b56eca5ad8334ae2d27d71be11b
d36df09c2916abc8ee63229d75bda7da9994b18d
/src/Common/TextureModel.java
680dc80cf5869f73d61c80541b7d3fbcdf692215
[]
no_license
emilkolvigraun/3dmesh
d813e1ac1288aad3b31abf87943c5507c11ab5d9
f80467e3e00d7333b02f84e5850d959698c9486d
refs/heads/master
2021-10-26T01:13:07.579753
2019-04-09T14:14:16
2019-04-09T14:14:16
179,960,148
1
0
null
null
null
null
UTF-8
Java
false
false
416
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package Common; import com.badlogic.gdx.graphics.g3d.Model; /** * * @author Emil S. Kolvig-Raun */ public interface TextureModel { public Model getModel(); public float getWidth(); public float getHeight(); }
[ "emilkolvigraun@gmail.com" ]
emilkolvigraun@gmail.com
bdcaa673f8ff0746bcd86386023e448ec10eb8c4
3480e580745ca789dfdc2f7516597053bc2d5c9b
/Rereso/app/src/main/java/id/ipaddr/android/rereso/domain/model/CertificateOfBirthForm.java
62a8a7d8fe5d2b13f974492dde9f35386fe135ef
[ "MIT" ]
permissive
ipaddr/Capstone-Project
af3bfd124f49f0cf51f1869863661cfd23e8bf2d
d1e87d5d81247593dfc5b1304eb389f66eae8cfe
refs/heads/master
2020-05-25T00:23:31.697270
2017-08-16T10:20:56
2017-08-16T10:20:56
84,893,099
0
0
null
null
null
null
UTF-8
Java
false
false
3,409
java
package id.ipaddr.android.rereso.domain.model; import android.graphics.Bitmap; /** * Created by iip on 3/16/17. */ public class CertificateOfBirthForm { private String patriarch; private String familyCardNumber; private Baby baby; private Citizen mother; private Citizen father; private Citizen rapporteur; private Citizen firstSpectator; private Citizen secondSpectator; private String rapporteurSignature; private String firstSpectatorSignature; private String secondSpectatorSignature; public CertificateOfBirthForm(){} public CertificateOfBirthForm(String patriarch, String familyCardNumber, Baby baby, Citizen mother, Citizen father, Citizen rapporteur, Citizen firstSpectator, Citizen secondSpectator, String rapporteurSignature, String firstSpectatorSignature, String secondSpectatorSignature) { this.patriarch = patriarch; this.familyCardNumber = familyCardNumber; this.baby = baby; this.mother = mother; this.father = father; this.rapporteur = rapporteur; this.firstSpectator = firstSpectator; this.secondSpectator = secondSpectator; this.rapporteurSignature = rapporteurSignature; this.firstSpectatorSignature = firstSpectatorSignature; this.secondSpectatorSignature = secondSpectatorSignature; } public String getPatriarch() { return patriarch; } public void setPatriarch(String patriarch) { this.patriarch = patriarch; } public String getFamilyCardNumber() { return familyCardNumber; } public void setFamilyCardNumber(String familyCardNumber) { this.familyCardNumber = familyCardNumber; } public Baby getBaby() { return baby; } public void setBaby(Baby baby) { this.baby = baby; } public Citizen getMother() { return mother; } public void setMother(Citizen mother) { this.mother = mother; } public Citizen getFather() { return father; } public void setFather(Citizen father) { this.father = father; } public Citizen getRapporteur() { return rapporteur; } public void setRapporteur(Citizen rapporteur) { this.rapporteur = rapporteur; } public Citizen getFirstSpectator() { return firstSpectator; } public void setFirstSpectator(Citizen firstSpectator) { this.firstSpectator = firstSpectator; } public Citizen getSecondSpectator() { return secondSpectator; } public void setSecondSpectator(Citizen secondSpectator) { this.secondSpectator = secondSpectator; } public String getRapporteurSignature() { return rapporteurSignature; } public void setRapporteurSignature(String rapporteurSignature) { this.rapporteurSignature = rapporteurSignature; } public String getFirstSpectatorSignature() { return firstSpectatorSignature; } public void setFirstSpectatorSignature(String firstSpectatorSignature) { this.firstSpectatorSignature = firstSpectatorSignature; } public String getSecondSpectatorSignature() { return secondSpectatorSignature; } public void setSecondSpectatorSignature(String secondSpectatorSignature) { this.secondSpectatorSignature = secondSpectatorSignature; } }
[ "i_p_addr@yahoo.com" ]
i_p_addr@yahoo.com
503eb38a29859915fb88d4041779d538a1db6555
02d78b4f948ac76c80ccbc2acc2cf7fb434bcdb6
/src/main/java/com/goufaan/homeworkupload/Misc.java
43075485b737f2c03446d00b2be18056cae225f8
[ "MIT" ]
permissive
gaoffan/HomeworkUpload
173522806565cafb57b137ee580b20dc0c8b3047
46ba01bf035ada86a80bbc179ca97d48192af005
refs/heads/master
2022-02-01T06:16:20.172008
2019-06-15T13:08:58
2019-06-15T13:08:58
188,438,113
1
0
null
null
null
null
UTF-8
Java
false
false
1,159
java
package com.goufaan.homeworkupload; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class Misc { public static void ZipMultiFile(String filepath ,String zipPath) { try { File file = new File(filepath); File zipFile = new File(zipPath); InputStream input; ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipFile)); if(file.isDirectory()){ File[] files = file.listFiles(); for (File value : files) { input = new FileInputStream(value); zipOut.putNextEntry(new ZipEntry(file.getName() + File.separator + value.getName())); int temp; while ((temp = input.read()) != -1) { zipOut.write(temp); } input.close(); } } zipOut.close(); } catch (Exception e) { e.printStackTrace(); } } }
[ "suzukaze.kouko@gmail.com" ]
suzukaze.kouko@gmail.com
b1ec1678519bf3fef93cd74891da2b6454d51300
9503ede76210ac2e580ec1ad6aecf462a5d64045
/labs/vcloud-director/src/test/java/org/jclouds/vcloud/director/v1_5/features/MetadataApiExpectTest.java
736d0167270f3098afe2fbc049d172141bfdbabb
[ "Apache-2.0" ]
permissive
abayer/jclouds
3802f76485076b85ca854b2fcbb2f0c7272d6c03
707a77fedbaa9cd6b1b1a5deb684d37e1f45da05
refs/heads/master
2021-01-17T16:25:21.372064
2013-02-22T01:09:50
2013-02-24T01:31:15
3,712,289
1
0
null
null
null
null
UTF-8
Java
false
false
8,892
java
/* * Licensed to jclouds, Inc. (jclouds) under one or more * contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. jclouds 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.jclouds.vcloud.director.v1_5.features; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.ANY; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.ERROR; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.METADATA_ENTRY; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType.TASK; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; import java.net.URI; import java.util.TimeZone; import org.jclouds.rest.ResourceNotFoundException; import org.jclouds.vcloud.director.v1_5.VCloudDirectorException; import org.jclouds.vcloud.director.v1_5.domain.Link; import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry; import org.jclouds.vcloud.director.v1_5.domain.Task; import org.jclouds.vcloud.director.v1_5.internal.VCloudDirectorAdminApiExpectTest; import org.testng.annotations.Test; /** * Tests the request/response behavior of {@link org.jclouds.vcloud.director.v1_5.features.MetadataApi} * * @author Adam Lowe */ @Test(groups = { "unit", "user" }, testName = "MetadataApiExpectTest") public class MetadataApiExpectTest extends VCloudDirectorAdminApiExpectTest { public MetadataApiExpectTest() { TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")); } public void testVappTemplateMetadata() { final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; URI uri = URI.create(endpoint + templateId); MetadataApi api = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata").acceptMedia(ANY).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/metadata.xml", METADATA).httpResponseBuilder().build(), new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build() ).getMetadataApi(uri); assertNotNull(api); Metadata metadata = api.get(); assertEquals(metadata, exampleMetadata()); Task task = api.putAll(exampleMetadata()); assertNotNull(task); } @Test(expectedExceptions = VCloudDirectorException.class) public void testErrorGetMetadata() { final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; URI uri = URI.create(endpoint + templateId); MetadataApi api = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata").acceptMedia(ANY).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getMetadataApi(uri); api.get(); } @Test(expectedExceptions = VCloudDirectorException.class) public void testErrorEditMetadata() { final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; URI uri = URI.create(endpoint + templateId); MetadataApi api = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer().apiCommand("POST", templateId + "/metadata").xmlFilePayload("/vapptemplate/metadata.xml", METADATA).acceptMedia(TASK).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getMetadataApi(uri); api.putAll(exampleMetadata()); } public void testVappTemplateMetadataValue() { final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; URI uri = URI.create(endpoint + templateId); MetadataApi api = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).httpResponseBuilder().build(), new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata/12345").xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).acceptMedia(TASK).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build(), new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId + "/metadata/12345").acceptMedia(TASK).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/task/task.xml", TASK).httpResponseBuilder().build() ).getMetadataApi(uri); assertNotNull(api); String metadata = api.get("12345"); assertEquals(metadata, "some value"); Task task = api.put("12345", "some value"); assertNotNull(task); task = api.remove("12345"); assertNotNull(task); } public void testErrorGetMetadataValue() { final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; URI uri = URI.create(endpoint + templateId); MetadataApi api = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer().apiCommand("GET", templateId + "/metadata/12345").acceptMedia(METADATA_ENTRY).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getMetadataApi(uri); assertNull(api.get("12345")); } @Test(expectedExceptions = VCloudDirectorException.class) public void testErrorEditMetadataValue() { final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; URI uri = URI.create(endpoint + templateId); MetadataApi api = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer().apiCommand("PUT", templateId + "/metadata/12345").xmlFilePayload("/vapptemplate/metadataValue.xml", METADATA_ENTRY).acceptMedia(TASK).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error400.xml", ERROR).httpResponseBuilder().statusCode(400).build()).getMetadataApi(uri); api.put("12345", "some value"); } @Test(expectedExceptions = ResourceNotFoundException.class) public void testRemoveMissingMetadataValue() { final String templateId = "/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9"; URI uri = URI.create(endpoint + templateId); MetadataApi api = orderedRequestsSendResponses(loginRequest, sessionResponse, new VcloudHttpRequestPrimer().apiCommand("DELETE", templateId + "/metadata/12345").acceptMedia(TASK).httpRequestBuilder().build(), new VcloudHttpResponsePrimer().xmlFilePayload("/vapptemplate/error403.xml", ERROR).httpResponseBuilder().statusCode(403).build()).getMetadataApi(uri); api.remove("12345"); } private Metadata exampleMetadata() { return Metadata.builder() .href(URI.create("https://vcloudbeta.bluelock.com/api/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9/metadata")) .type("application/vnd.vmware.vcloud.metadata+xml") .link(Link.builder().href(URI.create("https://vcloudbeta.bluelock.com/api/vAppTemplate/vappTemplate-ef4415e6-d413-4cbb-9262-f9bbec5f2ea9")) .type("application/vnd.vmware.vcloud.vAppTemplate+xml").rel("up").build()) .entry(MetadataEntry.builder().key("key").value("value").build()).build(); } }
[ "adrian.f.cole@gmail.com" ]
adrian.f.cole@gmail.com