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
cbfff7dba70981f4cd78dae8c04dc62e56d68f79
e4af14ed158db19852fff05e05d2723f130b422e
/SummerHoliday/src/com/zzxy/demo/Equal.java
faf8351a623d743a28ea2414abeb208afe7cd440
[]
no_license
Anakinliu/IJCE_Projects
86a4c3f19b846d4686a41d91788900738d81e40c
cda6a3721e80af777d3899cc7d2ea36ce6b8777e
refs/heads/master
2021-07-06T14:35:35.361909
2020-08-14T13:44:26
2020-08-14T13:44:26
69,360,946
0
0
null
2020-10-13T01:11:46
2016-09-27T13:42:08
Java
UTF-8
Java
false
false
1,207
java
package com.zzxy.demo; /** * Created by liu_y. * On 2016/8/21. */ class Anim{ String name; Anim(String name){ this.name = name; } } class Shark extends Anim{ String name; int age; Shark(String n,int age){ super(n); name = n; this.age = age; } public boolean equals(Object obj){ if (obj == null){ return false; } else { if (obj instanceof Shark){ Shark s = (Shark)obj; if (s.name == this.name && s.age == this.age){ return true; } } } return false; } } public class Equal { public static void main(String[] args) { Shark s1 = new Shark("z", 1); Anim a2 = new Shark("a shark", 2); System.out.println(a2.name); System.out.println(a2 instanceof Anim); System.out.println(a2 instanceof Shark); System.out.println("----------------"); Shark s2 = new Shark("z", 1); System.out.println(s1.equals(s2)); String s3 = new String("ss"); String s4 = new String("ss"); System.out.println(s3.equals(s4)); } }
[ "gugeliuyinquan@gmail.com" ]
gugeliuyinquan@gmail.com
cbddd28b135373c048487e753b999773dda65aaf
1eda8a2d6427186ad2810e22ab17e3a41e988fa4
/src/coinChange/CoinChange.java
cef6ae36de372465627ef7422fc63b00e8cd0062
[]
no_license
mayankshri87/brainTeaser
dee75ea0bdf2d463c0fc12559be84e0f3ed75abd
532c77e01d75ba14fe98e1a7c1291d333d7045ab
refs/heads/master
2020-03-26T14:50:15.328868
2018-08-16T15:44:46
2018-08-16T15:44:46
145,007,513
0
0
null
null
null
null
UTF-8
Java
false
false
2,015
java
package coinChange; import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.regex.*; public class CoinChange { static int ways(int n, int[] coins) { int[][] solutionMatrix = new int[coins.length+1][n+1]; for(int i=0;i<coins.length+1;i++){ solutionMatrix[i][0] = 1; } for(int j=1;j<n+1;j++){ solutionMatrix[0][1] = 0; } for(int i=1; i<coins.length+1;i++){ for(int j=1;j<n+1;j++){ if(coins[i-1]<=j){ solutionMatrix[i][j] = solutionMatrix[i-1][j] + solutionMatrix[i][j-coins[i-1]]; }else{ solutionMatrix[i][j] = solutionMatrix[i][j-1]; } } } for(int i=0;i<coins.length+1;i++){ for(int j=1;j<n+1;j++){ System.out.print(solutionMatrix[i][j]+" "); } System.out.println(); } return (solutionMatrix[coins.length][n]); } private static final Scanner scanner = new Scanner(System.in); public static void main(String[] args) throws IOException { // BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH"))); String[] nm = scanner.nextLine().split(" "); int n = Integer.parseInt(nm[0]); int m = Integer.parseInt(nm[1]); int[] coins = new int[m]; String[] coinsItems = scanner.nextLine().split(" "); scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?"); for (int i = 0; i < m; i++) { int coinsItem = Integer.parseInt(coinsItems[i]); coins[i] = coinsItem; } int res = ways(n, coins); System.out.println(res); /* bufferedWriter.write(String.valueOf(res)); bufferedWriter.newLine(); bufferedWriter.close();*/ scanner.close(); } }
[ "mshrivastava@dminc.com" ]
mshrivastava@dminc.com
0204ac31c6f44872cb342b620ccbcd782b237e7d
fc44406bb7d77d0945344825ea71c11ee0233cc1
/src/main/java/com/black/web/config/RedisConfig.java
3b74f5f8b32218ae6088d9ace7a83e03a3e8a0af
[]
no_license
w6180358w/collect
c24a5a3bff41f4c0a02ef74d308ac421deb30855
856a19cfc12d733147b0770a17afb35bcc9253a3
refs/heads/master
2020-03-16T00:56:39.945301
2018-12-14T16:11:56
2018-12-14T16:11:56
132,429,158
0
0
null
null
null
null
UTF-8
Java
false
false
2,621
java
package com.black.web.config; import java.lang.reflect.Method; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.interceptor.KeyGenerator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.cache.RedisCacheManager; import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; @Configuration @EnableCaching public class RedisConfig extends CachingConfigurerSupport{ @Bean public KeyGenerator keyGenerator() { return new KeyGenerator() { @Override public Object generate(Object target, Method method, Object... params) { StringBuilder sb = new StringBuilder(); sb.append(target.getClass().getName()); sb.append(method.getName()); for (Object obj : params) { sb.append(obj.toString()); } return sb.toString(); } }; } @SuppressWarnings("rawtypes") @Bean public CacheManager cacheManager(RedisTemplate redisTemplate) { RedisCacheManager rcm = new RedisCacheManager(redisTemplate); //设置缓存过期时间 //rcm.setDefaultExpiration(60);//秒 return rcm; } @Bean public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory factory) { StringRedisTemplate template = new StringRedisTemplate(factory); @SuppressWarnings({ "rawtypes", "unchecked" }) Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); ObjectMapper om = new ObjectMapper(); om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); jackson2JsonRedisSerializer.setObjectMapper(om); template.setValueSerializer(jackson2JsonRedisSerializer); template.afterPropertiesSet(); return template; } }
[ "272416634@163.com" ]
272416634@163.com
dff4734dbd18e72571e70fcc49e5291d175ec15b
72fa614d2a5a8f14491869677412b98165c10102
/src/Valid_Sudoku/Solution.java
fddcb5f4f4acd122833abe152d6831a05d9bac9b
[]
no_license
Zephry/LeetCode
9db14fdedc0fce14785dbe0575788a967dad745e
7cb4086bf34d2f880813f1f6e59e73a3ff1617b3
refs/heads/master
2021-01-01T17:41:53.695260
2015-03-20T09:33:28
2015-03-20T09:33:28
23,644,543
0
0
null
null
null
null
UTF-8
Java
false
false
2,104
java
package Valid_Sudoku; public class Solution { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(Integer.valueOf('2')); } public boolean isValidSudoku(char[][] board) { return isValidRow(board) && isValidCol(board) && isValidArea(board); } public boolean isValidRow(char[][] board) { int[] num = new int[10]; for(int m=0;m<board.length;m++) { for(int i=0;i<num.length;i++) { num[i] = i+1; } for(int n=0;n<board[m].length;n++) { if(board[m][n] != '.') { if(num[Integer.valueOf(board[m][n])-49] != -1) { num[Integer.valueOf(board[m][n])-49] = -1; }else { return false; } } } } return true; } public boolean isValidCol(char[][] board) { int[] num = new int[10]; int mMax = board.length; int nMax = board[0].length; for(int m=0;m<mMax;m++) { for(int i=0;i<num.length;i++) { num[i] = i+1; } for(int n=0;n<nMax;n++) { if(board[n][m] != '.') { if(num[Integer.valueOf(board[n][m])-49] != -1) { num[Integer.valueOf(board[n][m])-49] = -1; }else { return false; } } } } return true; } public boolean isValidArea(char[][] board) { int[] num = new int[10]; int mMax = board.length; int nMax = board[0].length; for(int m=0;m<mMax;m=m+3) { for(int n=0;n<nMax;n=n+3) { for(int i=0;i<num.length;i++) { num[i] = i+1; } for(int i=n;i<n+3;i++) { for(int j=m;j<m+3;j++) { if(board[i][j] != '.') { if(num[Integer.valueOf(board[i][j]-49)] != -1) { num[Integer.valueOf(board[i][j]-49)] = -1; }else { return false; } } } } } } return true; } }
[ "454410517@qq.com" ]
454410517@qq.com
5c1aa3f0c70f9a66cc83742205bc5249c753e721
51eed9bd49748f5db89711e092591f36966a8b5f
/open-ssp-parent/core/src/main/java/com/rfxlab/ssp/core/system/vertx/SspServletVertxHandler.java
ba84bfc117e16580233e6c8b4f5c4430ad5721ad
[ "MIT" ]
permissive
rfxlab/openssp
21e7f174d07ad8601f6460819b56ef7bf0cc6026
9a1648aeec5c64b3ebe7a8531707cab0cfb9ef00
refs/heads/master
2021-04-27T17:18:35.113400
2018-03-07T02:48:40
2018-03-07T02:48:40
122,319,444
0
0
null
2018-02-21T10:02:18
2018-02-21T10:02:18
null
UTF-8
Java
false
false
1,492
java
package com.rfxlab.ssp.core.system.vertx; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.atg.openssp.common.core.entry.CoreSupplyServlet; import com.atg.openssp.common.core.exchange.Exchange; import com.atg.openssp.common.exception.RequestException; import com.atg.openssp.core.exchange.ExchangeServer; import com.atg.openssp.core.exchange.RequestSessionAgent; public class SspServletVertxHandler extends CoreSupplyServlet<RequestSessionAgent> { private static final long serialVersionUID = 1L; @Override protected RequestSessionAgent getAgent(final HttpServletRequest request, final HttpServletResponse response) throws RequestException { return new RequestSessionAgent(request, response); } @Override protected Exchange<RequestSessionAgent> getServer() { return new ExchangeServer(); } public SspServletVertxHandler() throws ServletException { init(); } public void handle(final VertxHttpServletRequest request, final VertxHttpServletResponse response) throws ServletException, IOException { String uri = request.getRequestURI(); String site = request.getParameter("site"); System.out.println("URI: " + uri); if (site != null) { try { doGet(request, response); } catch (Exception e) { e.printStackTrace(); response.getWriter().write("error"); } } response.flushBuffer(); response.writeToVertx(); } }
[ "tantrieuf31@gmail.com" ]
tantrieuf31@gmail.com
a96616ac4e1589d79c2407e4782fd1d5659ab5d2
c4d3481cf298b00e6a8b6596aa5a529e2782cc6d
/app/src/main/java/com/example/health_cation/model/User.java
57c8fc2a3e2e0eeba7b2131269213d5f3462215a
[]
no_license
lpoliveiraneto/Health_Cation
1d848a781e68715b85f94e59e9fe7d8aa3727177
6603ad83f048609833c9b391b3ce4522e22c196d
refs/heads/master
2020-07-16T22:10:36.848348
2019-09-06T02:26:04
2019-09-06T02:26:04
205,879,097
0
0
null
null
null
null
UTF-8
Java
false
false
2,012
java
package com.example.health_cation.model; public class User { private int id; private String nome; private int idade; private String email; private String senha; private float altura; private float peso; private String parente; private String contato_parente; public User(String nome, String email, String senha, float altura, float peso, String parente, String contato_parente){ this.nome = nome; this.email = email; this.senha = senha; this.altura = altura; this.peso = peso; this.parente = parente; this.contato_parente = contato_parente; } public User(){ } public int getId() { return id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public int getIdade() { return idade; } public void setIdade(int idade) { this.idade = idade; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getSenha() { return senha; } public void setSenha(String senha) { this.senha = senha; } public float getAltura() { return altura; } public void setAltura(float altura) { this.altura = altura; } public float getPeso() { return peso; } public void setPeso(float peso) { this.peso = peso; } public String getParente() { return parente; } public void setParente(String parente) { this.parente = parente; } public String getContato_parente() { return contato_parente; } public void setContato_parente(String contato_parente) { this.contato_parente = contato_parente; } public void setId(int id) { this.id = id; } public boolean temIdValido() { return id>0; } }
[ "leonidespires@gmail.com" ]
leonidespires@gmail.com
b6e02b41bb794abc3c92a2ec2929845237c62f47
d04ca464c2da848520c07051db4a0f973a939e2c
/smartmap/ycsys-smartmap-common/src/main/java/com/ycsys/smartmap/sys/util/NetWorkUtil.java
655a4645ab20dfc992bd1cf5ebfd56eb7f4fcbe6
[]
no_license
zkg642/basemuilti
093aab479e6a5e494b9f9223543ff2155d390177
59dc0aa669a10159d35a28d570aa95cdd26fcafb
refs/heads/master
2020-04-10T04:18:48.071551
2017-01-25T08:58:15
2017-01-25T08:58:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,577
java
package com.ycsys.smartmap.sys.util; import com.ycsys.smartmap.sys.common.utils.StringUtils; import javax.servlet.http.HttpServletRequest; import java.net.InetAddress; import java.net.NetworkInterface; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @description 获取客户端ip * @author lixiaoxin * @date 2017年1月3日 */ public class NetWorkUtil { /**获取ip地址**/ public static String getIpAddress(HttpServletRequest request) { String ip = request.getHeader("x-forwarded-for"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("http_client_ip"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } if (ip != null && ip.indexOf(",") != -1) { ip = ip.substring(ip.lastIndexOf(",") + 1, ip.length()).trim(); } if ("0:0:0:0:0:0:0:1".equals(ip)) { ip = "127.0.0.1"; } return ip; } /**获取本机Mac地址**/ public static String getLocalMacAddr(){ String mac = null; try { NetworkInterface netInterface = NetworkInterface.getByInetAddress(InetAddress.getLocalHost()); byte[] macAddr = netInterface.getHardwareAddress(); List<String> list = new ArrayList<>(); for (byte b : macAddr) { String str = Integer.toHexString((int) (b & 0xff)); if (str.length() == 1) { str = "0" + str; } list.add(str); } mac = StringUtils.join(list,"-"); }catch (Exception e){ e.printStackTrace(); return null; } return mac; } /** * 获取本机ip地址 * 已通过:windows linux unix系统的测试 * **/ public static String getLocalIp() { String sIP = ""; InetAddress ip = null; try { boolean bFindIP = false; Enumeration<NetworkInterface> netInterfaces = (Enumeration<NetworkInterface>) NetworkInterface .getNetworkInterfaces(); while (netInterfaces.hasMoreElements()) { if (bFindIP) { break; } NetworkInterface ni = (NetworkInterface) netInterfaces .nextElement(); Enumeration<InetAddress> ips = ni.getInetAddresses(); while (ips.hasMoreElements()) { ip = (InetAddress) ips.nextElement(); if (!ip.isLoopbackAddress() && ip.getHostAddress().matches( "(\\d{1,3}\\.){3}\\d{1,3}")) { bFindIP = true; break; } } } } catch (Exception e) { e.printStackTrace(); return ip.getHostAddress(); } if (null != ip) { sIP = ip.getHostAddress(); } return sIP; } /** * 判断内外网环境 * @param ip * @return */ public static Boolean isInnerNet(String ip) { Boolean status=false; try { if(ip.equals("0:0:0:0:0:0:0:1") || ip.equals("127.0.0.1")){ status=true; }else{ //内网正则 String reg = "(10|172|192)\\.([0-1][0-9]{0,2}|[2][0-5]{0,2}|[3-9][0-9]{0,1})\\.([0-1][0-9]{0,2}|[2][0-5]{0,2}|[3-9][0-9]{0,1})\\.([0-1][0-9]{0,2}|[2][0-5]{0,2}|[3-9][0-9]{0,1})"; Pattern p = Pattern.compile(reg); Matcher matcher = p.matcher(ip); status= matcher.find(); } } catch (Exception e) { e.printStackTrace(); } return status; } }
[ "chemphern@gmailcom" ]
chemphern@gmailcom
93799f2c9b98000c5dadf110c72a9b98d13f0547
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_5648941810974720_0/java/r00T/GettingTheDigits.java
4370a4fff8345aad96acf875fbb0515caa730311
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
Java
false
false
1,083
java
import java.util.Scanner; public class GettingTheDigits { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); for(int i = 1; i <= n ; i++) { String str = scanner.next(); processTestCase(i, str); } } private static void processTestCase(int t, String str) { int arr[] = new int[26]; for(int i = 0; i<str.length();i++) { arr[str.charAt(i) - 'A']++; } int digit[] = new int[10]; digit[2] = arr['W'-'A']; digit[4] = arr['U'-'A']; digit[6] = arr['X'-'A']; digit[8] = arr['G'-'A']; digit[0] = arr['Z'-'A']; digit[5] = arr['F'-'A'] - digit[4]; digit[7] = arr['V'-'A'] - digit[5]; digit[9] = arr['I'-'A'] - digit[8] - digit[6] - digit[5]; digit[3] = arr['R'-'A']- digit[4] - digit[0]; digit[1] = arr['O'-'A']- digit[4] - digit[0] - digit[2]; System.out.print("Case #" + t + ": "); for(int i = 0; i < 10 ;i++) { for(int j = 0;j < digit[i];j++) { System.out.print(i); } } System.out.println(); } }
[ "alexandra1.back@gmail.com" ]
alexandra1.back@gmail.com
2d6204daf6ddf6176dc75fac91a7805f9cb97226
30b7170877d57633aa76500146ffbe361bea4cb3
/Automation_WorkSpace/Columbia_automation/src/com/qa/columbia/functions/v5_3/Upload_EGCprogramSVP.java
8fa11b48fe62470de2bfa8003517785b6f24b60b
[]
no_license
Testcolumbia/columbia
ef3c990f1af6a0c97621e83d7db5be7d065d96e1
2a1869ee68b2c51c11a8dad64c49d4884145b156
refs/heads/master
2020-06-04T16:17:51.422822
2011-09-15T08:19:32
2011-09-15T08:19:32
2,385,301
0
0
null
null
null
null
UTF-8
Java
false
false
2,714
java
/* * This method is used to upload an EGC program to the social viewer portal. */ package com.qa.columbia.functions.v5_3; import java.util.Calendar; import java.util.Date; import com.qa.columbia.repository.v5_3.*; import com.qa.columbia.executor.*; import com.thoughtworks.selenium.*; public class Upload_EGCprogramSVP extends TesterAsserter { public static void test_Upload_EGCprogramSVP(Selenium sel, String str_EGcprogramName,String str_EGCchannelname, String str_streamingMediaFile) throws Exception { Utility_Functions utilityFunction = new Utility_Functions(); //Fetching values for Global Variables from XMl file String str_path ="Global_variables.xml"; Date date=Calendar.getInstance().getTime(); String Var_frameWork_Path = utilityFunction.GetValue(str_path ,"Var_frameWork_Path"); // String VAR_MAX_WAIT = utilityFunction.GetValue(str_path ,"VAR_MAX_WAIT") ; String VAR_MED_WAIT = utilityFunction.GetValue(str_path ,"VAR_MED_WAIT") ; //sel.waitForPageToLoad(VAR_MAX_WAIT); sel.click(EnvObjectMap_Rep.lnk_AddProgram_SVP); sel.waitForPageToLoad(VAR_MED_WAIT); sel.type(EnvObjectMap_Rep.txt_egcProgramNameSVP, str_EGcprogramName); sel.select("channel", "label="+str_EGCchannelname); sel.focus(EnvObjectMap_Rep.fileUPl_egcStreamingMediaSVP); //press tab sel.keyPressNative("9"); //Press tab sel.keyPressNative(java.awt.event.KeyEvent.VK_SPACE + ""); //Wait for loading the page utilityFunction.waitForChangesToReflect(); //Path of the autoit file to upload file String auto_it_contentUpload = Var_frameWork_Path + "\\commonfiles\\upload_file.exe"; String filePath = Var_frameWork_Path + "\\commonfiles\\" + str_streamingMediaFile; String []cmd = {auto_it_contentUpload, filePath}; Runtime.getRuntime().exec(cmd); if(sel.isElementPresent(EnvObjectMap_Rep.btn_egcSubmitprogramSVP)) { System.out.println(sel.isElementPresent(EnvObjectMap_Rep.btn_egcSubmitprogramSVP)); //Variable to click the Submit button. sel.click(EnvObjectMap_Rep.btn_egcSubmitprogramSVP); } else { System.out.println(sel.isElementPresent(EnvObjectMap_Rep.btn_egcSaveprogramSVP)); //Variable to click the Submit button if Save button is present. sel.click(EnvObjectMap_Rep.btn_egcSaveprogramSVP); } for (int second = 0;; second++) { if (second >= 600) fail("timeout"); try { if (sel.isTextPresent(str_EGcprogramName)) break; } catch (Exception e) {} Thread.sleep(1000); } utilityFunction.waitForChangesToReflect(); assertTrue("Upload_EGCprogramSVP","Social VP: EGC program has been created successfully.",date,sel.isTextPresent(str_EGcprogramName)); } }
[ "narekumar@.bebo.com" ]
narekumar@.bebo.com
a856249edd60951471f74c7a09c2946a23229abd
05e558a3993cb6c4084b51219a306bb54997c1b1
/src/com/george/design/observerpatter/example/NotificationService.java
aeb1b2d7c0a88608b2572e296e65fc2077c498ea
[]
no_license
yaowanghuaerjie/DesignPatter
eddc563a02d7d8590280b34b4aaeb1363393b8eb
f4daf4816382e582ed41dcd3485868d4b52beebc
refs/heads/master
2023-02-11T02:35:21.186771
2020-12-31T05:53:48
2020-12-31T05:53:48
286,500,384
0
0
null
null
null
null
UTF-8
Java
false
false
212
java
package com.george.design.observerpatter.example; public class NotificationService { public void sendInBoxMessage(long userId) { System.out.println("恭喜" + userId + "用户注册成功"); } }
[ "wulong@carsir.xin" ]
wulong@carsir.xin
67856cef005ac7e8ba8d8ed6a011bffde3ca3728
7fb8dd45f1f56f431e6c8a3b7280c03577282d13
/agorava-empireavenue-api/src/main/java/org/agorava/empireavenue/service/HistoryService.java
36fbe33030698b8f77f96e1ba17f15b0f9fbbef4
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0" ]
permissive
shan-bala/agorava-empireavenue
aecc9ea27fb2158212fdb7e8a3a58ed4a5c56d38
6b1d4eedf2b549e637559dee85aea0c1a8af2217
refs/heads/master
2020-12-25T21:01:36.972323
2014-01-04T13:06:10
2014-01-04T13:06:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
/* * Copyright 2014 Agorava. * * 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.agorava.empireavenue.service; /** * * @author Rajmahendra Hegde <rajmahendra@gmail.com> * @since 0.7.0 */ public interface HistoryService { }
[ "rajmahendra@gmail.com" ]
rajmahendra@gmail.com
bc71fb09310abbfc7f5a616772272ec5f5ed3fa5
4ff35a802fb018dc2efb568d05e0a21f0186ee71
/src/main/java/com/rabidgremlin/mutters/core/CleanedInput.java
74093b7b92021c2efe14a04c7c1099288fe362c0
[ "Apache-2.0" ]
permissive
karthi2016/Mutters
2fdbbc42ae2fbfcd1f4686f63a0fba28e4489d55
a52d8e0154f7e07a585114e1b19a1beebeff96a8
refs/heads/master
2021-01-21T16:54:34.311947
2017-05-02T04:01:07
2017-05-02T04:01:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,430
java
package com.rabidgremlin.mutters.core; import java.util.Collections; import java.util.List; /** * This class holds a cleaned version of a utterance as a series of tokens. * * @see com.rabidgremlin.mutters.core.InputCleaner * * @author rabidgremlin * */ public class CleanedInput { /** The list of orginal tokens. */ private List<String> originalTokens; /** The cleaned tokens. */ private List<String> cleanedTokens; /** * Constructor. * * @param originalTokens The original tokens. * @param cleanedTokens The cleaned tokens. */ public CleanedInput(List<String> originalTokens, List<String> cleanedTokens) { this.originalTokens = originalTokens; this.cleanedTokens = cleanedTokens; } /** * Returns the original tokens. * * @return The original tokens. */ public List<String> getOriginalTokens() { return Collections.unmodifiableList(originalTokens); } /** * Returns the cleaned tokens. * * @return The cleaned tokens. */ public List<String> getCleanedTokens() { return Collections.unmodifiableList(cleanedTokens); } /* * (non-Javadoc) * * @see java.lang.Object#toString() * */ @Override public String toString() { return "CleanedInput [originalTokens=" + originalTokens + ", cleanedTokens=" + cleanedTokens + "]"; } }
[ "jack@rabidgremlin.com" ]
jack@rabidgremlin.com
1c9c8da7f0881e826ae69a2291533573c1221017
575c43c22855a9fad17710423de9da1b3511d436
/chl-common/src/main/java/com/chl/sys/service/impl/PermissionServiceImpl.java
f75b0fe6edfaa7190bf3cb1f409f53b2f9802237
[]
no_license
badbad001/chl-boot
ef738c23ced60c197051576643934cfc2e0f96bc
28a006a9b004d7a56bfb754da61519e265f91c84
refs/heads/master
2022-07-30T17:12:43.924297
2020-02-09T07:13:51
2020-02-09T07:13:51
239,264,822
0
0
null
2022-02-09T22:22:17
2020-02-09T07:33:19
JavaScript
UTF-8
Java
false
false
493
java
package com.chl.sys.service.impl; import com.chl.sys.pojo.Permission; import com.chl.sys.mapper.PermissionMapper; import com.chl.sys.service.PermissionService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * <p> * 服务实现类 * </p> * * @author 陈汉龙 * @since 2020-01-04 */ @Service public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService { }
[ "1946408873@qq.com" ]
1946408873@qq.com
123c1fc66fdb471efbe7267fd8d6d198ec613bcc
95c49f466673952b465e19a5ee3ae6eff76bee00
/src/main/java/com/zhihu/android/app/p1311ui/activity/action/impl/GlobalPopup.java
73f5a8d448359483307abed582bc4269d3d153d5
[]
no_license
Phantoms007/zhihuAPK
58889c399ae56b16a9160a5f48b807e02c87797e
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
refs/heads/main
2023-01-24T01:34:18.716323
2020-11-25T17:14:55
2020-11-25T17:14:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,016
java
package com.zhihu.android.app.p1311ui.activity.action.impl; import android.annotation.SuppressLint; import android.os.Bundle; import com.trello.rxlifecycle2.android.ActivityEvent; import com.zhihu.android.app.p1121k.GlobalPopUpEvent; import com.zhihu.android.app.p1121k.GlobalPopupHandler; import com.zhihu.android.app.p1311ui.activity.MainActivity; import com.zhihu.android.app.p1311ui.activity.action.ActionOnPostCreate; import com.zhihu.android.app.p1311ui.activity.action.ActionOnResume; import com.zhihu.android.app.p1311ui.activity.action.ActionOnStop; import com.zhihu.android.base.util.RxBus; import java.util.concurrent.TimeUnit; import p2189io.reactivex.Observable; import p2189io.reactivex.p2205a.p2207b.AndroidSchedulers; import p2189io.reactivex.p2231i.Schedulers; /* renamed from: com.zhihu.android.app.ui.activity.action.impl.GlobalPopup */ public enum GlobalPopup implements ActionOnPostCreate.AbstractC15750a, ActionOnResume.AbstractC15755a, ActionOnStop.AbstractC15758a { INSTANCE; static /* synthetic */ void lambda$asyncOnPostCreate$1(Throwable th) throws Exception { } @Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnStop.AbstractC15758a /* renamed from: a_ */ public /* synthetic */ void mo79178a_(MainActivity mainActivity) { ActionOnStop.AbstractC15758a.CC.$default$a_(this, mainActivity); } @Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnPostCreate.AbstractC15750a public /* synthetic */ void onPostCreate(MainActivity mainActivity, Bundle bundle) { ActionOnPostCreate.AbstractC15750a.CC.$default$onPostCreate(this, mainActivity, bundle); } @Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnResume.AbstractC15755a public /* synthetic */ void onResume(MainActivity mainActivity) { ActionOnResume.AbstractC15755a.CC.$default$onResume(this, mainActivity); } @Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnPostCreate.AbstractC15750a @SuppressLint({"CheckResult"}) public void asyncOnPostCreate(MainActivity mainActivity, Bundle bundle) { RxBus.m86979a().mo84369b(GlobalPopUpEvent.class).compose(mainActivity.bindUntilEvent(ActivityEvent.DESTROY)).observeOn(AndroidSchedulers.m147557a()).subscribe($$Lambda$GlobalPopup$1Gw2drIzZv9yXiJFltPwA14xhM.INSTANCE, $$Lambda$GlobalPopup$9X37E1iZAIJbvz6gPOUW3kD1Qw.INSTANCE); } @Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnResume.AbstractC15755a @SuppressLint({"CheckResult"}) public void asyncOnResume(MainActivity mainActivity) { Observable.just(1).subscribeOn(Schedulers.m148537b()).delay(2, TimeUnit.SECONDS).observeOn(AndroidSchedulers.m147557a()).subscribe($$Lambda$GlobalPopup$ckHvapmvgJAFWtGxCXFZVAg03pc.INSTANCE); } @Override // com.zhihu.android.app.p1311ui.activity.action.ActionOnStop.AbstractC15758a public void onStop(MainActivity mainActivity) { GlobalPopupHandler.m63465a().mo68153c(); } }
[ "seasonpplp@qq.com" ]
seasonpplp@qq.com
158a44d5c50b644176842fcd0e39ad23597f7db0
01dba05d46877104b5e760516fbffdf33bd9a296
/src/main/java/com/mag/jwt/SecurityJwt/exception/ValidationException.java
811612182939b81cef011d0d84fc75b19d39118e
[]
no_license
maghouston/koulouchey
f2f6a4e3ff4e2f1869ad2c6c22ccc5966b8e7865
95c0cda777523d8657f0d5dc316f6533e17589e5
refs/heads/master
2022-06-14T09:01:12.403007
2020-04-03T15:16:33
2020-04-03T15:16:33
251,116,625
0
0
null
2022-05-25T23:23:31
2020-03-29T19:32:09
Java
UTF-8
Java
false
false
317
java
package com.mag.jwt.SecurityJwt.exception; public class ValidationException extends RuntimeException { private static final long serialVersionUID = 1L; private String msg; public ValidationException(String msg) { this.msg = msg; } public String getMsg() { return msg; } }
[ "magloire.namber@gmail.com" ]
magloire.namber@gmail.com
4252cc702be7d4b5bc6c334c5797d7a3598f49e4
6921947b0b588d4097e35d34a0dc22ec3f72ea87
/OOD_FinalProject/src/CookingStyle/StreetBar.java
856fbb0c992c96562fbd8b448435b709ade6da89
[]
no_license
EvanSat/OOD_FinalProject
b01519f4e610d527f17e4073b9fc5a41583dbc61
3e4f1fb819769ba836d9012b4f49425f2186b841
refs/heads/master
2022-12-30T12:38:34.217043
2020-10-21T17:32:24
2020-10-21T17:32:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
553
java
package CookingStyle; public class StreetBar extends BarPlace { Drink createDrink(int item) { // #1 Dry Martini if (item == 1) { return new StreetBarDryMartini(); // # 2 Dirty Martini } else if (item == 2) { return new StreetBarDirtyMartini(); // # 3 Kids Martini } else if (item == 3) { return new StreetBarKidsMartini(); // # 4 Tiramisu } else if (item == 4) { return new StreetBarTiramisu(); // # 5 Jello Shots } else if (item == 5) { return new StreetBarJelloShots(); } else return null; } }
[ "zhanovich@mail.usf.edu" ]
zhanovich@mail.usf.edu
b8f962170fce5db03ad05dbab767ccb91f2272a9
ef6260bdfe0d4e0413ec165d43b0e09ec0b016c8
/branches/headlessBranch/trunk/src/com/wisc/csvParser/DataChainJPanel.java
023af5aab0e1c418ebff5d3fb5dd758871739dcd
[]
no_license
BGCX261/ziggystardust-svn-to-git
5ecb75987837b2bbe2a192a1d267b502e6869bf4
6c74e87a7f9e6954db3bbbdb8c310ac0ca6dcaea
refs/heads/master
2016-08-05T07:09:37.180708
2015-08-25T15:44:54
2015-08-25T15:44:54
41,584,056
0
0
null
null
null
null
UTF-8
Java
false
false
13,687
java
/* * This file is part of ZiggyStardust. * * ZiggyStardust is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * ZiggyStardust is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.wisc.csvParser; import java.awt.CardLayout; import java.awt.Color; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.ListCellRenderer; import javax.swing.SwingUtilities; import java.util.Vector; import org.apache.log4j.Logger; /** * * @author lawinslow */ public class DataChainJPanel extends JPanel implements PropertyChangeListener { private DataChain datachain; private Vector<IStatusPanel> lastPanels; private String name = ""; private Logger logger = Logger.getLogger(DataChainJPanel.class.getName()); /** Creates new form DataChainJPanel * * @param chain The underlying DataChain object that this GUI interface represents */ public DataChainJPanel(DataChain chain) { initComponents(); datachain = chain; //call update methods to synch display state to object state. updateChainList(); setStartedState(datachain.isStarted()); datachain.addPropertyChangeListener(this); } public DataChain getDataChain() { return datachain; } /** 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. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); chainList = new javax.swing.JList(); ContentPane = new javax.swing.JPanel(); addButton = new javax.swing.JButton(); removeButton = new javax.swing.JButton(); moveUpButton = new javax.swing.JButton(); moveDownButton = new javax.swing.JButton(); startButton = new javax.swing.JButton(); stopButton = new javax.swing.JButton(); chainList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { chainListValueChanged(evt); } }); jScrollPane1.setViewportView(chainList); ContentPane.setLayout(new java.awt.CardLayout()); addButton.setText("Add"); addButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addButtonActionPerformed(evt); } }); removeButton.setLabel("Remove"); removeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { removeButtonActionPerformed(evt); } }); moveUpButton.setText("^"); moveUpButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { moveUpButtonActionPerformed(evt); } }); moveDownButton.setText("v"); moveDownButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { moveDownButtonActionPerformed(evt); } }); startButton.setText("Start"); startButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { startButtonActionPerformed(evt); } }); stopButton.setText("Stop"); stopButton.setEnabled(false); stopButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { stopButtonActionPerformed(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(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(moveUpButton) .addComponent(addButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(moveDownButton) .addComponent(removeButton))) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(startButton) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(stopButton))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ContentPane, javax.swing.GroupLayout.PREFERRED_SIZE, 420, javax.swing.GroupLayout.PREFERRED_SIZE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(6, 6, 6) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(startButton) .addComponent(stopButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(addButton) .addComponent(removeButton)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(moveUpButton) .addComponent(moveDownButton)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(ContentPane, javax.swing.GroupLayout.DEFAULT_SIZE, 334, Short.MAX_VALUE) ); }// </editor-fold>//GEN-END:initComponents private void chainListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_chainListValueChanged if (evt instanceof javax.swing.event.ListSelectionEvent && chainList.getSelectedValue() instanceof IStatusPanel) { CardLayout tmp = (CardLayout) ContentPane.getLayout(); tmp.show(ContentPane, ((IStatusPanel) chainList.getSelectedValue()).getPanelID()); } }//GEN-LAST:event_chainListValueChanged private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed FilterPickerDialog d = new FilterPickerDialog( (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, this), true); d.setVisible(true); if (d.getReturnStatus() == FilterPickerDialog.RET_OK) { try { datachain.addIntermediateFilter( DataFilterFactory.getDataFilter( d.getReturnType())); } catch (Exception e) { e.printStackTrace(); } } }//GEN-LAST:event_addButtonActionPerformed private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed if (chainList.getSelectedValue() instanceof IDataRepository) { datachain.removeIntermediateFilter( (IDataRepository) chainList.getSelectedValue()); } }//GEN-LAST:event_removeButtonActionPerformed private void moveUpButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveUpButtonActionPerformed if(chainList.getSelectedValue() instanceof IDataRepository) { datachain.moveIntermediateFilter((IDataRepository) chainList.getSelectedValue(), DataChain.direction.UP); } else { return; } }//GEN-LAST:event_moveUpButtonActionPerformed private void moveDownButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveDownButtonActionPerformed if(chainList.getSelectedValue() instanceof IDataRepository) { datachain.moveIntermediateFilter((IDataRepository) chainList.getSelectedValue(), DataChain.direction.DOWN); } else { return; } }//GEN-LAST:event_moveDownButtonActionPerformed private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed internalStart(); }//GEN-LAST:event_startButtonActionPerformed private void stopButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_stopButtonActionPerformed internalStop(); }//GEN-LAST:event_stopButtonActionPerformed private void internalStart(){ if(datachain.Start()) setStartedState(true); } private void internalStop(){ if(datachain.Stop()) setStartedState(false); } private void updateChainList() { CardLayout layout = (CardLayout) ContentPane.getLayout(); if (lastPanels != null) { for (IStatusPanel s : lastPanels) { ContentPane.remove(s.getStatusJPanel()); } } lastPanels = datachain.getObjectChain(); for (IStatusPanel s : lastPanels) { ContentPane.add(s.getStatusJPanel(), s.getPanelID()); } chainList.setListData(lastPanels); } private void setStartedState(boolean isStarted){ startButton.setEnabled(!isStarted); moveUpButton.setEnabled(!isStarted); moveDownButton.setEnabled(!isStarted); addButton.setEnabled(!isStarted); removeButton.setEnabled(!isStarted); stopButton.setEnabled(isStarted); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel ContentPane; private javax.swing.JButton addButton; private javax.swing.JList chainList; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton moveDownButton; private javax.swing.JButton moveUpButton; private javax.swing.JButton removeButton; private javax.swing.JButton startButton; private javax.swing.JButton stopButton; // End of variables declaration//GEN-END:variables public class MyCellRenderer extends JLabel implements ListCellRenderer { public MyCellRenderer() { setOpaque(true); } @Override public java.awt.Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { setText(value.toString()); if (value instanceof IDataParser) { this.setBackground( ((IDataParser) value).isStarted() ? Color.GREEN : Color.RED); } else if (value instanceof IDataRepository) { this.setBackground( ((IDataRepository) value).isStarted() ? Color.GREEN : Color.RED); } else { this.setBackground(Color.GRAY); } if (isSelected) { setBackground(Color.lightGray); } return this; } } /** * Handles the property change events to update the UI display. * @param e The property change event. */ @Override public void propertyChange(PropertyChangeEvent e){ if(e.getPropertyName().equalsIgnoreCase("chain")){ this.updateChainList(); }else if(e.getPropertyName().equalsIgnoreCase("isrunning") || e.getPropertyName().equalsIgnoreCase("isrunning")){ this.setStartedState(datachain.isStarted()); } } }
[ "you@example.com" ]
you@example.com
395ac012d363a296b46bff1474fdf2f4308513a9
1e4724e7f56e16a2565e101407c8d1e6cbdbe2c9
/camTest/src/main/java/com/remedeo/remedeoapp/exceptions/DuplicateRecordException.java
2091dffb9191fe6496ea04f7c5b1453e404e1d62
[]
no_license
vasuthakker/Remideo1
37d2794b51b73bc9eb0838617549745f3f3b6c55
d88aff74fda64158d851933b732597015d0326c7
refs/heads/master
2021-01-10T19:33:44.129912
2015-05-06T09:24:06
2015-05-06T09:24:06
35,138,635
0
0
null
null
null
null
UTF-8
Java
false
false
261
java
package com.remedeo.remedeoapp.exceptions; @SuppressWarnings("serial") public class DuplicateRecordException extends Exception { public DuplicateRecordException() { super(); } public DuplicateRecordException(String message) { super(message); } }
[ "vasu0123@gmail.com" ]
vasu0123@gmail.com
456de6e5d14358598a7b785f67a50095301f16e3
d7e4f1bf914838c3eb1f4cf25448b98540c5b232
/WEBSITE_THITRACNGHIEMONLINE/src/Controller/ThemSV.java
2415617dcdd3c03fcef91a14eb2e90229d99393f
[]
no_license
tomiot1006/WebThiTracNghiemOnline
a4b7882f47b385585e86a36abb2e6b0c117e7f04
ee6238f29f37dc0042f12d0ebf14580e23ba962d
refs/heads/master
2021-09-02T07:36:43.435821
2017-12-31T14:38:03
2017-12-31T14:38:03
115,866,829
0
0
null
null
null
null
UTF-8
Java
false
false
2,795
java
package Controller; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; import java.sql.ResultSet; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import Model.ConnectionSQL; /** * Servlet implementation class ThemSV */ @WebServlet("/ThemSV") public class ThemSV extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public ThemSV() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getRequestDispatcher("/WEB-INF/ThemSV.jsp").forward(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setCharacterEncoding("utf-8"); request.setCharacterEncoding("utf-8"); if(request.getParameter("txtPhoto") == null) { response.sendRedirect("upload.jsp"); return; } PrintWriter out = response.getWriter(); FileInputStream input = null; File theFile = new File(request.getParameter("txtPhoto")); int username = 1;//Integer.parseInt(request.getParameter("username")); String hoten = request.getParameter("hoten"); int khoa=Integer.parseInt(request.getParameter("khoa")); System.out.println(request.getParameter("khoa")); String ngaysinh = request.getParameter("ngaysinh"); String cmnd = request.getParameter("cmnd"); String quequan = request.getParameter("quequan"); String hinhanh = theFile.getAbsolutePath(); String gioitinh = request.getParameter("gioitinh"); String type="sinhvien"; String pass="12345"; //String stt=""; try { ResultSet rs = new ConnectionSQL().chonDuLieuTuDTB("select * from Account"); while(rs.next()){ String s = rs.getString(1); username=Integer.parseInt(s)+1; } new ConnectionSQL().thucThiCauLenhSQL("insert into Account values('"+username+"','"+pass+"','"+hoten+"','"+khoa+"','"+ngaysinh+"','"+gioitinh+"','"+cmnd+"','"+quequan+"','"+hinhanh+"','"+type+"')"); request.getRequestDispatcher("/WEB-INF/admin.jsp").forward(request, response); } catch (Exception e) { e.printStackTrace(); } } }
[ "tomio@tomiot" ]
tomio@tomiot
e3061f5136cadfa5752e5b7e4368d9f377cd211f
78b33de70d8250ef9217d4b4273bbb3db8e95150
/fest-swing/src/test/java/org/fest/swing/core/BasicComponentFinder_findByLabelAndType_Test.java
acc461a669bd0ea54efc949647c5303956f90d6a
[ "Apache-2.0" ]
permissive
walterxie/fest-swing-1.x
cb5799bbabe3f50b81d1037daeef2918ce4ca0d9
9eb16c2b53e2971a27da5ea66a0d31454efd21d7
refs/heads/master
2021-01-17T01:12:01.014392
2015-04-13T23:33:52
2015-04-13T23:33:52
30,573,138
0
0
null
2015-02-10T03:34:19
2015-02-10T03:34:19
null
UTF-8
Java
false
false
1,672
java
/* * Created on Jul 24, 2009 * * 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. * * Copyright @2009-2013 the original author or authors. */ package org.fest.swing.core; import static org.fest.assertions.Assertions.assertThat; import static org.fest.test.ExpectedException.none; import javax.swing.JButton; import javax.swing.JLabel; import org.fest.swing.exception.ComponentLookupException; import org.fest.test.ExpectedException; import org.junit.Rule; import org.junit.Test; /** * Tests for {@link BasicComponentFinder#findByLabel(String, Class)}. * * @author Alex Ruiz * @author Yvonne Wang */ public class BasicComponentFinder_findByLabelAndType_Test extends BasicComponentFinder_TestCase { @Rule public ExpectedException thrown = none(); @Test public void should_find_Component() { JButton button = finder.findByLabel("A Label", JButton.class); assertThat(button).isSameAs(window.button); } @Test public void should_throw_error_if_Component_not_found() { thrown.expect(ComponentLookupException.class); thrown.expectMessageToContain("label='list'", "type=javax.swing.JLabel"); finder.findByLabel("list", JLabel.class); } }
[ "alruiz@google.com" ]
alruiz@google.com
6654b3f911fded3a8c70fa72f265dccc4d120a73
d291f1872a8275b7794f91827a5a4f615934cd73
/jOOQ/src/main/java/org/jooq/impl/DateDiff.java
8ef93a03a1727a8c8b1564c80cf6fa08ff5069fe
[ "Apache-2.0" ]
permissive
pecko/jOOQ
2c9930e55bbd3b139651c4cba01ee453e9ff5ea0
cab313f6730a48edb1ad6afa1f56327dd400eafc
refs/heads/master
2020-12-02T16:32:37.041672
2015-12-29T12:56:48
2015-12-29T12:56:48
15,281,817
1
0
null
null
null
null
UTF-8
Java
false
false
3,718
java
/** * Copyright (c) 2009-2015, Data Geekery GmbH (http://www.datageekery.com) * 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. * * Other licenses: * ----------------------------------------------------------------------------- * Commercial licenses for this work are available. These replace the above * ASL 2.0 and offer limited warranties, support, maintenance, and commercial * database integrations. * * For more information, please visit: http://www.jooq.org/licenses * * * * * * * * * * * * * * * * */ package org.jooq.impl; import static org.jooq.impl.DSL.field; import static org.jooq.impl.DSL.function; import java.sql.Date; import org.jooq.Configuration; import org.jooq.Field; /** * @author Lukas Eder */ class DateDiff extends AbstractFunction<Integer> { /** * Generated UID */ private static final long serialVersionUID = -4813228000332771961L; private final Field<Date> date1; private final Field<Date> date2; DateDiff(Field<Date> date1, Field<Date> date2) { super("datediff", SQLDataType.INTEGER, date1, date2); this.date1 = date1; this.date2 = date2; } @Override final Field<Integer> getFunction0(Configuration configuration) { switch (configuration.family()) { case MARIADB: case MYSQL: return function("datediff", getDataType(), date1, date2); case DERBY: return field("{fn {timestampdiff}({sql_tsi_day}, {0}, {1}) }", getDataType(), date2, date1); case FIREBIRD: return field("{datediff}(day, {0}, {1})", getDataType(), date2, date1); case H2: case HSQLDB: /* [pro] xx xxxx xxxxxxxxx xx [/pro] */ return field("{datediff}('day', {0}, {1})", getDataType(), date2, date1); case SQLITE: return field("({strftime}('%s', {0}) - {strftime}('%s', {1})) / 86400", getDataType(), date1, date2); /* [pro] xx xxxx xxxxxxx xx [/pro] */ case CUBRID: case POSTGRES: // [#4481] Parentheses are important in case this expression is // placed in the context of other arithmetic return field("({0} - {1})", getDataType(), date1, date2); /* [pro] xx xxxx xxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxxxxxx xxxx xxxx xxxx xxxxxxxxxx xxxx xxxxxxx xxxx xxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxx xxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxxxxxx xxxx xxxx xxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxx xxxxxxxx xxxx xxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxx xxxxxx xxxxxxx xx xxxx xxxxxxx xx xxxxxxx xxxx xxxxxxx xx [/pro] */ } // Default implementation for equals() and hashCode() return date1.sub(date2).cast(Integer.class); } }
[ "lukas.eder@gmail.com" ]
lukas.eder@gmail.com
3d347025f7bc87e5b620338e2ed1421966e774fa
15d6f1a73e08922d6b5520d92bf09ad698dae66a
/aula_20201008_enumeracoes/src/aula081020/comparador/nome/NomeDescententeComparator.java
567ee2a214ba0284b5c11f00e88243c3350452b3
[]
no_license
limamarcelo/entra21
76e3b84f11dc30faccc4bef59fa9ebc25cad6110
2ae4c565db8087c0a9eab49d62392d444677b8e1
refs/heads/master
2023-02-19T15:42:59.923178
2021-01-20T10:26:45
2021-01-20T10:26:45
296,712,967
0
0
null
null
null
null
UTF-8
Java
false
false
302
java
package aula081020.comparador.nome; import java.util.Comparator; import aula081020.cliente.Cliente; public class NomeDescententeComparator implements Comparator<Cliente> { public int compare(Cliente cliente1, Cliente cliente2) { return cliente1.getNome().compareTo(cliente2.getNome()) * -1; } }
[ "miranda.rs@gmail.com" ]
miranda.rs@gmail.com
ea81bdbcb4a74d65e8364caa21dba0217c7b5017
907532a31fe974fb257e6e6f5371be6ce969ac2d
/locator/gen/net/tigoe/locator/BuildConfig.java
f9f4277bf7a56e675152580a9b3fc9a65369bc53
[]
no_license
don/GettingStartedWithNFC
ac4b04a1c0e178f787503daa93b2edc153771220
c49950955becbb48ccb7953c07340a5350890ac6
refs/heads/master
2021-01-18T08:38:44.347574
2013-02-06T22:46:52
2013-02-06T22:46:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
159
java
/** Automatically generated file. DO NOT MODIFY */ package net.tigoe.locator; public final class BuildConfig { public final static boolean DEBUG = true; }
[ "tom.igoe@gmail.com" ]
tom.igoe@gmail.com
ba50235db5c697112eac5dab4f94d165e0517ef7
9c4c1c5bebd24a4085e4da83224e2795b17e7ab5
/crmd-cas-bean/src/main/java/com/ffcs/crmd/cas/bean/devops/comm/descriptors/MsgHeadDescriptor.java
82db30bf3cce41c47fbc8d0f7c031e93676d645b
[]
no_license
myloveyuvip/cas
465ab0e5dde150e33c833a5bff8fad7250692460
3899eae2953111f5c4de396f3940cec9b92ba53a
refs/heads/master
2020-12-26T03:55:49.280946
2016-06-21T03:13:12
2016-06-21T03:13:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
15,253
java
/* * This class was automatically generated with * <a href="http://www.castor.org">Castor 1.3.3</a>, using an XML * Schema. * $Id$ */ package com.ffcs.crmd.cas.bean.devops.comm.descriptors; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import com.ffcs.crmd.cas.bean.devops.comm.MsgHead; /** * * * @version $Revision$ $Date$ */ public class MsgHeadDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { /** * Field _elementDefinition. */ private boolean _elementDefinition; /** * Field _nsPrefix. */ private java.lang.String _nsPrefix; /** * Field _nsURI. */ private java.lang.String _nsURI; /** * Field _xmlName. */ private java.lang.String _xmlName; /** * Field _identity. */ private org.exolab.castor.xml.XMLFieldDescriptor _identity; public MsgHeadDescriptor() { super(); _nsURI = "http://www.chinatelecom.com/crm/comm/"; _xmlName = "msgHead"; _elementDefinition = false; org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; org.exolab.castor.mapping.FieldHandler handler = null; org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors //-- initialize element descriptors //-- time desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "time", "time", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { MsgHead target = (MsgHead) object; return target.getTime(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { MsgHead target = (MsgHead) object; target.setTime( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setNameSpaceURI("http://www.chinatelecom.com/crm/comm/"); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: time fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- from desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "from", "from", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { MsgHead target = (MsgHead) object; return target.getFrom(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { MsgHead target = (MsgHead) object; target.setFrom( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setNameSpaceURI("http://www.chinatelecom.com/crm/comm/"); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: from fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- to desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "to", "to", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { MsgHead target = (MsgHead) object; return target.getTo(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { MsgHead target = (MsgHead) object; target.setTo( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setNameSpaceURI("http://www.chinatelecom.com/crm/comm/"); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: to fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- sysSign desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "sysSign", "sysSign", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { MsgHead target = (MsgHead) object; return target.getSysSign(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { MsgHead target = (MsgHead) object; target.setSysSign( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setNameSpaceURI("http://www.chinatelecom.com/crm/comm/"); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: sysSign fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- msgType desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "msgType", "msgType", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { MsgHead target = (MsgHead) object; return target.getMsgType(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { MsgHead target = (MsgHead) object; target.setMsgType( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setNameSpaceURI("http://www.chinatelecom.com/crm/comm/"); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: msgType fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- serial desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "serial", "serial", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { MsgHead target = (MsgHead) object; return target.getSerial(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { MsgHead target = (MsgHead) object; target.setSerial( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setNameSpaceURI("http://www.chinatelecom.com/crm/comm/"); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: serial fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); } /** * Method getAccessMode. * * @return the access mode specified for this class. */ @Override() public org.exolab.castor.mapping.AccessMode getAccessMode() { return null; } /** * Method getIdentity. * * @return the identity field, null if this class has no * identity. */ @Override() public org.exolab.castor.mapping.FieldDescriptor getIdentity() { return _identity; } /** * Method getJavaClass. * * @return the Java class represented by this descriptor. */ @Override() public java.lang.Class getJavaClass() { return com.ffcs.crmd.cas.bean.devops.comm.MsgHead.class; } /** * Method getNameSpacePrefix. * * @return the namespace prefix to use when marshaling as XML. */ @Override() public java.lang.String getNameSpacePrefix() { return _nsPrefix; } /** * Method getNameSpaceURI. * * @return the namespace URI used when marshaling and * unmarshaling as XML. */ @Override() public java.lang.String getNameSpaceURI() { return _nsURI; } /** * Method getValidator. * * @return a specific validator for the class described by this * ClassDescriptor. */ @Override() public org.exolab.castor.xml.TypeValidator getValidator() { return this; } /** * Method getXMLName. * * @return the XML Name for the Class being described. */ @Override() public java.lang.String getXMLName() { return _xmlName; } /** * Method isElementDefinition. * * @return true if XML schema definition of this Class is that * of a global * element or element with anonymous type definition. */ public boolean isElementDefinition() { return _elementDefinition; } }
[ "qn_guo@sina.com" ]
qn_guo@sina.com
c8a78238f099bec1f1fc83d80173e95f36a58c77
108bc3981da86a3382b39d4e31a19069468869df
/programming pracice/Threading/method Syncronization/src/com/company/Main.java
56cca37716820e84adb33fa36f32c48d41e431d5
[]
no_license
mohamedabotir/Programming
9995a1ade15ebb80ccbfec12a8ddec2af36cc83a
1ee20baf0786114df9366fb6b2cc3c40baeec079
refs/heads/master
2022-12-03T02:45:59.289767
2020-08-23T12:16:35
2020-08-23T12:16:35
277,856,783
0
0
null
null
null
null
UTF-8
Java
false
false
225
java
package com.company; public class Main { public static void main(String[] args) { Q q = new Q(); new Producer(q); new Consumer(q); System.out.println("Press Control-C to stop."); } }
[ "mohamedabotyear@gmail.com" ]
mohamedabotyear@gmail.com
19a9d08b1b996577c8a3493b9f170099bae3b2a5
450d8eb28eabac39dc0048e3c51c24d93ff80153
/threads/src/ch8/threadFactory_in_Executor/Main.java
d306dc8c3d0aefde6d7c5c7a4503c55a907a1c6c
[]
no_license
meshvedov/j9-concurrency-cookbook
1b90f86b874178e95319948c1d0e6c31800061e1
47fce192a3ab45a58089f39d6b8fdd9284976599
refs/heads/master
2020-03-21T15:53:24.638172
2018-07-13T12:30:04
2018-07-13T12:30:04
138,738,621
0
0
null
null
null
null
UTF-8
Java
false
false
633
java
package ch8.threadFactory_in_Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class Main { public static void main(String[] args) throws InterruptedException { MyThreadFactory threadFactory = new MyThreadFactory("MyThreadFactory"); ExecutorService executor = Executors.newCachedThreadPool(threadFactory); MyTask task = new MyTask(); executor.submit(task); executor.shutdown(); executor.awaitTermination(1, TimeUnit.DAYS); System.out.printf("Main: End of the program.\n"); } }
[ "micangel@mail.ru" ]
micangel@mail.ru
e593e0760692c1f5bad6ccf5d802dee3d25b58e9
669033961046d67b45ed7d3f5ea00a97bef7ef60
/Spring Advanced Exam/src/main/java/springadvanced/exam/utils/init/InitializeDefaultUsers.java
d5996983b67cf7bef49719a653bb119b627aa562
[]
no_license
soheili/Spring-Advanced-Exam
76b5fe4e6e89c92b7c01d57c0d04d9647bd8667c
e243151573cf08aa0886f854dc300df82f7d9419
refs/heads/master
2023-01-22T05:58:38.144854
2020-12-07T15:36:19
2020-12-07T15:36:19
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,171
java
package springadvanced.exam.utils.init; import org.springframework.boot.CommandLineRunner; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Component; import springadvanced.exam.cart.domain.Cart; import springadvanced.exam.user.domain.userEntity.UserEntity; import springadvanced.exam.user.domain.userRole.UserRole; import springadvanced.exam.user.repository.UserEntityRepository; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; @Component public class InitializeDefaultUsers implements CommandLineRunner { private final UserEntityRepository userEntityRepository; private final PasswordEncoder passwordEncoder; public InitializeDefaultUsers(UserEntityRepository userEntityRepository, PasswordEncoder passwordEncoder) { this.userEntityRepository = userEntityRepository; this.passwordEncoder = passwordEncoder; } @Override public void run(String... args) throws Exception { if (this.userEntityRepository.count() > 2) { return; } List<UserEntity> users = new ArrayList<>(); for (int i = 1; i <=3 ; i++) { UserEntity userEntity = new UserEntity(); userEntity.setUsername("TestUser" + i); userEntity.setPassword(passwordEncoder.encode("123")); userEntity.setEmail("TestUser" + i + "@test.com"); userEntity.setPersonalDiscount(0.0); userEntity.setTotalPurchases(0); userEntity.setRegisteredOn(LocalDateTime.now()); Cart cart = new Cart(); cart.setUser(userEntity); userEntity.setCart(cart); UserRole user = new UserRole("ROLE_USER"); user.setUser(userEntity); if (i == 1) { UserRole admin = new UserRole("ROLE_ADMIN"); admin.setUser(userEntity); userEntity.setRoles(List.of(user, admin)); } else { userEntity.setRoles(List.of(user)); } users.add(userEntity); } this.userEntityRepository.saveAll(users); } }
[ "53002640+kostovvl@users.noreply.github.com" ]
53002640+kostovvl@users.noreply.github.com
34c079d97935c3b902674337c02bc9afac1f3290
4f4edebf74205c0cd332042648ae523d3514555c
/src/main/java/io/github/ma1uta/matrix/gene/model/common/EmptyResponse.java
c00bb51e0bce8b25c0532ad96b4fa742353dfb76
[ "Apache-2.0" ]
permissive
ma1uta/gene
dfb8532bf7907dc340c8ee2e58b2e1526480daf3
3507be1de0b5f591c9a6f0e3f065a33a51291013
refs/heads/master
2020-03-23T15:30:39.071142
2018-09-21T19:03:32
2018-09-21T19:03:32
141,753,194
2
0
null
null
null
null
UTF-8
Java
false
false
711
java
/* * Copyright sablintolya@gmail.com * * 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 io.github.ma1uta.matrix.gene.model.common; /** * Empty response. */ public class EmptyResponse { }
[ "sablintolya@gmail.com" ]
sablintolya@gmail.com
ff392b78499db3fa7443e25ece807d178f242d03
60fb993a5e3665285231bd12d3a5f0d5bf72213e
/app/src/main/java/com/moxiu/keyboard/KeyBoardActivity.java
2e0eeaaced1c977e4ac2aa2621da8174b36f68e1
[]
no_license
chongbo2013/AndroidKeyBoard
12c493a7798fafe6df6aaeb96bbfea82aac58d22
57223edc536e2eed5ccb8f07f99c5bac4315a40a
refs/heads/master
2021-06-05T12:18:26.100727
2016-10-26T06:51:58
2016-10-26T06:51:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
614
java
package com.moxiu.keyboard; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; /** * ferris.xu * 对软键盘输入框进行封装 2016-10-26 14:11:15 */ public class KeyBoardActivity extends AppCompatActivity { EmoticonsKeyBoard ek_bar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_key_board); ek_bar= (EmoticonsKeyBoard) findViewById(R.id.ek_bar); } @Override protected void onPause() { super.onPause(); ek_bar.onResume(); } }
[ "xufeifan@moxiu.net" ]
xufeifan@moxiu.net
f570587894a921b1892d71d39e122da827a6e5b2
19f029c2451e06bab12ae750715e67c7ae3172c1
/AapCoreDomain/src/main/java/com/next/aap/core/persistance/User.java
7e7dbf17e5f7fcc7f6f127c757fe55cd9d323721
[]
no_license
AamAadmiParty/aap-backend
cd5d2c2063311bc03b125d22df23cc4c3268cae0
305c7d3fddef86b9ca3c485e4f62e5c7e3ba39ed
refs/heads/master
2021-07-12T02:38:14.902840
2019-07-28T16:16:29
2019-07-28T16:16:29
46,349,900
1
1
null
2021-07-06T23:14:46
2015-11-17T13:48:04
Java
UTF-8
Java
false
false
21,235
java
package com.next.aap.core.persistance; import java.util.Date; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Version; import com.next.aap.web.dto.CreationType; @Entity @Table(name="users") public class User { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @Version @Column(name="ver") private int ver; @Column(name="date_created") private Date dateCreated; @Column(name="date_modified") private Date dateModified; @Column(name="creator_id") private Long creatorId; @Column(name="modifier_id") private Long modifierId; @Column(name = "external_id", nullable = false, length=256) private String externalId; @Column(name = "membership_no") private String membershipNumber; @Column(name = "legacy_membership_no") private String legacyMembershipNumber; @Column(name = "name", nullable = false, length=256) private String name; @Column(name = "father_name") private String fatherName; @Column(name = "mother_name") private String motherName; @Column(name = "address", length=512) private String address; @Column(name = "gender") private String gender; @Column(name = "creation_type", nullable = false) @Enumerated(EnumType.STRING) private CreationType creationType; @Column(name = "date_of_birth") private Date dateOfBirth; @Column(name = "nri") private boolean nri; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="nri_country_id") private Country nriCountry; @Column(name="nri_country_id", insertable=false,updatable=false) private Long nriCountryId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="nri_country_region_id") private CountryRegion nriCountryRegion; @Column(name="nri_country_region_id", insertable=false,updatable=false) private Long nriCountryRegionId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="nri_country_region_area_id") private CountryRegionArea nriCountryRegionArea; @Column(name="nri_country_region_area_id", insertable=false,updatable=false) private Long nriCountryRegionAreaId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="living_state_id") private State stateLiving; @Column(name="living_state_id", insertable=false,updatable=false) private Long stateLivingId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="living_district_id") private District districtLiving; @Column(name="living_district_id", insertable=false,updatable=false) private Long districtLivingId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="living_ac_id") private AssemblyConstituency assemblyConstituencyLiving; @Column(name="living_ac_id", insertable=false,updatable=false) private Long assemblyConstituencyLivingId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="living_pc_id") private ParliamentConstituency parliamentConstituencyLiving; @Column(name="living_pc_id", insertable=false,updatable=false) private Long parliamentConstituencyLivingId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="voting_state_id") private State stateVoting; @Column(name="voting_state_id", insertable=false,updatable=false) private Long stateVotingId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="voting_district_id") private District districtVoting; @Column(name="voting_district_id", insertable=false,updatable=false) private Long districtVotingId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="voting_ac_id") private AssemblyConstituency assemblyConstituencyVoting; @Column(name="voting_ac_id", insertable=false,updatable=false) private Long assemblyConstituencyVotingId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}) @JoinColumn(name="voting_pc_id") private ParliamentConstituency parliamentConstituencyVoting; @Column(name="voting_pc_id", insertable=false,updatable=false) private Long parliamentConstituencyVotingId; @OneToMany(mappedBy="user", fetch=FetchType.LAZY) private Set<FacebookAccount> facebookAccounts; @OneToMany(mappedBy="user", fetch=FetchType.LAZY) private Set<TwitterAccount> twitterAccounts; @OneToMany(mappedBy="user", fetch=FetchType.LAZY) private Set<Donation> donations; @OneToMany(mappedBy="user", fetch=FetchType.LAZY) private Set<Email> emails; @OneToMany(mappedBy="user", fetch=FetchType.LAZY) private Set<Phone> phones; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_all_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="role_id") }) Set<Role> allRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_state_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="state_role_id") }) Set<StateRole> stateRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_district_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="district_role_id") }) Set<DistrictRole> districtRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_ac_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="ac_role_id") }) Set<AcRole> acRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_pc_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="pc_role_id") }) Set<PcRole> pcRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_country_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="country_role_id") }) Set<CountryRole> countryRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_country_region_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="country_region_role_id") }) Set<CountryRegionRole> countryRegionRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_country_region_area_roles", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="country_region_area_role_id") }) Set<CountryRegionAreaRole> countryRegionAreaRoles; @ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinTable(name = "user_interests", joinColumns = { @JoinColumn(name="user_id") }, inverseJoinColumns = { @JoinColumn(name="interest_id") }) Set<Interest> interests; @Column(name = "allow_tweets", nullable = false) private boolean allowTweets; @Column(name = "profile_pic") private String profilePic; @Column(name = "super_admin", nullable = false) private boolean superAdmin; @Column(name = "member", nullable = false) private boolean member; @Column(name = "donor", nullable = false) private boolean donor; @Column(name = "volunteer", nullable = false) private boolean volunteer; @Column(name = "membership_status") private String membershipStatus; @Column(name = "passport_number") private String passportNumber; @Column(name = "identity_number") private String identityNumber; @Column(name = "identity_type") private String identityType; @Column(name = "voter_id") private String voterId; @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) @JoinColumn(name="membership_confirmed_by") private User membershipConfirmedBy; @Column(name="membership_confirmed_by", insertable=false,updatable=false) private Long membershipConfirmedById; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public int getVer() { return ver; } public void setVer(int ver) { this.ver = ver; } public Date getDateCreated() { return dateCreated; } public void setDateCreated(Date dateCreated) { this.dateCreated = dateCreated; } public Date getDateModified() { return dateModified; } public void setDateModified(Date dateModified) { this.dateModified = dateModified; } public Long getCreatorId() { return creatorId; } public void setCreatorId(Long creatorId) { this.creatorId = creatorId; } public Long getModifierId() { return modifierId; } public void setModifierId(Long modifierId) { this.modifierId = modifierId; } public String getExternalId() { return externalId; } public void setExternalId(String externalId) { this.externalId = externalId; } public String getMembershipNumber() { return membershipNumber; } public void setMembershipNumber(String membershipNumber) { this.membershipNumber = membershipNumber; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getFatherName() { return fatherName; } public void setFatherName(String fatherName) { this.fatherName = fatherName; } public String getMotherName() { return motherName; } public void setMotherName(String motherName) { this.motherName = motherName; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public Date getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(Date dateOfBirth) { this.dateOfBirth = dateOfBirth; } public boolean isNri() { return nri; } public void setNri(boolean nri) { this.nri = nri; } public Country getNriCountry() { return nriCountry; } public void setNriCountry(Country nriCountry) { this.nriCountry = nriCountry; } public Long getNriCountryId() { return nriCountryId; } public void setNriCountryId(Long nriCountryId) { this.nriCountryId = nriCountryId; } public State getStateLiving() { return stateLiving; } public void setStateLiving(State stateLiving) { this.stateLiving = stateLiving; } public Long getStateLivingId() { return stateLivingId; } public void setStateLivingId(Long stateLivingId) { this.stateLivingId = stateLivingId; } public District getDistrictLiving() { return districtLiving; } public void setDistrictLiving(District districtLiving) { this.districtLiving = districtLiving; } public Long getDistrictLivingId() { return districtLivingId; } public void setDistrictLivingId(Long districtLivingId) { this.districtLivingId = districtLivingId; } public AssemblyConstituency getAssemblyConstituencyLiving() { return assemblyConstituencyLiving; } public void setAssemblyConstituencyLiving(AssemblyConstituency assemblyConstituencyLiving) { this.assemblyConstituencyLiving = assemblyConstituencyLiving; } public Long getAssemblyConstituencyLivingId() { return assemblyConstituencyLivingId; } public void setAssemblyConstituencyLivingId(Long assemblyConstituencyLivingId) { this.assemblyConstituencyLivingId = assemblyConstituencyLivingId; } public ParliamentConstituency getParliamentConstituencyLiving() { return parliamentConstituencyLiving; } public void setParliamentConstituencyLiving(ParliamentConstituency parliamentConstituencyLiving) { this.parliamentConstituencyLiving = parliamentConstituencyLiving; } public Long getParliamentConstituencyLivingId() { return parliamentConstituencyLivingId; } public void setParliamentConstituencyLivingId(Long parliamentConstituencyLivingId) { this.parliamentConstituencyLivingId = parliamentConstituencyLivingId; } public State getStateVoting() { return stateVoting; } public void setStateVoting(State stateVoting) { this.stateVoting = stateVoting; } public Long getStateVotingId() { return stateVotingId; } public void setStateVotingId(Long stateVotingId) { this.stateVotingId = stateVotingId; } public District getDistrictVoting() { return districtVoting; } public void setDistrictVoting(District districtVoting) { this.districtVoting = districtVoting; } public Long getDistrictVotingId() { return districtVotingId; } public void setDistrictVotingId(Long districtVotingId) { this.districtVotingId = districtVotingId; } public AssemblyConstituency getAssemblyConstituencyVoting() { return assemblyConstituencyVoting; } public void setAssemblyConstituencyVoting(AssemblyConstituency assemblyConstituencyVoting) { this.assemblyConstituencyVoting = assemblyConstituencyVoting; } public Long getAssemblyConstituencyVotingId() { return assemblyConstituencyVotingId; } public void setAssemblyConstituencyVotingId(Long assemblyConstituencyVotingId) { this.assemblyConstituencyVotingId = assemblyConstituencyVotingId; } public ParliamentConstituency getParliamentConstituencyVoting() { return parliamentConstituencyVoting; } public void setParliamentConstituencyVoting(ParliamentConstituency parliamentConstituencyVoting) { this.parliamentConstituencyVoting = parliamentConstituencyVoting; } public Long getParliamentConstituencyVotingId() { return parliamentConstituencyVotingId; } public void setParliamentConstituencyVotingId(Long parliamentConstituencyVotingId) { this.parliamentConstituencyVotingId = parliamentConstituencyVotingId; } public Set<FacebookAccount> getFacebookAccounts() { return facebookAccounts; } public void setFacebookAccounts(Set<FacebookAccount> facebookAccounts) { this.facebookAccounts = facebookAccounts; } public Set<TwitterAccount> getTwitterAccounts() { return twitterAccounts; } public void setTwitterAccounts(Set<TwitterAccount> twitterAccounts) { this.twitterAccounts = twitterAccounts; } public Set<Role> getAllRoles() { return allRoles; } public void setAllRoles(Set<Role> allRoles) { this.allRoles = allRoles; } public Set<StateRole> getStateRoles() { return stateRoles; } public void setStateRoles(Set<StateRole> stateRoles) { this.stateRoles = stateRoles; } public Set<DistrictRole> getDistrictRoles() { return districtRoles; } public void setDistrictRoles(Set<DistrictRole> districtRoles) { this.districtRoles = districtRoles; } public Set<AcRole> getAcRoles() { return acRoles; } public void setAcRoles(Set<AcRole> acRoles) { this.acRoles = acRoles; } public Set<PcRole> getPcRoles() { return pcRoles; } public void setPcRoles(Set<PcRole> pcRoles) { this.pcRoles = pcRoles; } public boolean isAllowTweets() { return allowTweets; } public void setAllowTweets(boolean allowTweets) { this.allowTweets = allowTweets; } public String getProfilePic() { return profilePic; } public void setProfilePic(String profilePic) { this.profilePic = profilePic; } public boolean isSuperAdmin() { return superAdmin; } public void setSuperAdmin(boolean superAdmin) { this.superAdmin = superAdmin; } public boolean isMember() { return member; } public void setMember(boolean member) { this.member = member; } public String getMembershipStatus() { return membershipStatus; } public void setMembershipStatus(String membershipStatus) { this.membershipStatus = membershipStatus; } public String getPassportNumber() { return passportNumber; } public void setPassportNumber(String passportNumber) { this.passportNumber = passportNumber; } public String getVoterId() { return voterId; } public void setVoterId(String voterId) { this.voterId = voterId; } public User getMembershipConfirmedBy() { return membershipConfirmedBy; } public void setMembershipConfirmedBy(User membershipConfirmedBy) { this.membershipConfirmedBy = membershipConfirmedBy; } public Long getMembershipConfirmedById() { return membershipConfirmedById; } public void setMembershipConfirmedById(Long membershipConfirmedById) { this.membershipConfirmedById = membershipConfirmedById; } public Set<Interest> getInterests() { return interests; } public void setInterests(Set<Interest> interests) { this.interests = interests; } public CountryRegion getNriCountryRegion() { return nriCountryRegion; } public void setNriCountryRegion(CountryRegion nriCountryRegion) { this.nriCountryRegion = nriCountryRegion; } public Long getNriCountryRegionId() { return nriCountryRegionId; } public void setNriCountryRegionId(Long nriCountryRegionId) { this.nriCountryRegionId = nriCountryRegionId; } public CountryRegionArea getNriCountryRegionArea() { return nriCountryRegionArea; } public void setNriCountryRegionArea(CountryRegionArea nriCountryRegionArea) { this.nriCountryRegionArea = nriCountryRegionArea; } public Long getNriCountryRegionAreaId() { return nriCountryRegionAreaId; } public void setNriCountryRegionAreaId(Long nriCountryRegionAreaId) { this.nriCountryRegionAreaId = nriCountryRegionAreaId; } public Set<CountryRole> getCountryRoles() { return countryRoles; } public void setCountryRoles(Set<CountryRole> countryRoles) { this.countryRoles = countryRoles; } public Set<CountryRegionRole> getCountryRegionRoles() { return countryRegionRoles; } public void setCountryRegionRoles(Set<CountryRegionRole> countryRegionRoles) { this.countryRegionRoles = countryRegionRoles; } public Set<CountryRegionAreaRole> getCountryRegionAreaRoles() { return countryRegionAreaRoles; } public void setCountryRegionAreaRoles(Set<CountryRegionAreaRole> countryRegionAreaRoles) { this.countryRegionAreaRoles = countryRegionAreaRoles; } public boolean isVolunteer() { return volunteer; } public void setVolunteer(boolean volunteer) { this.volunteer = volunteer; } public boolean isDonor() { return donor; } public void setDonor(boolean donor) { this.donor = donor; } public CreationType getCreationType() { return creationType; } public void setCreationType(CreationType creationType) { this.creationType = creationType; } public Set<Donation> getDonations() { return donations; } public void setDonations(Set<Donation> donations) { this.donations = donations; } public Set<Email> getEmails() { return emails; } public void setEmails(Set<Email> emails) { this.emails = emails; } public Set<Phone> getPhones() { return phones; } public void setPhones(Set<Phone> phones) { this.phones = phones; } public String getLegacyMembershipNumber() { return legacyMembershipNumber; } public void setLegacyMembershipNumber(String legacyMembershipNumber) { this.legacyMembershipNumber = legacyMembershipNumber; } public String getIdentityNumber() { return identityNumber; } public void setIdentityNumber(String identityNumber) { this.identityNumber = identityNumber; } public String getIdentityType() { return identityType; } public void setIdentityType(String identityType) { this.identityType = identityType; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; User other = (User) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } @Override public String toString() { return "User [id=" + id + ", ver=" + ver + ", externalId=" + externalId + ", name=" + name + ", dateOfBith=" + dateOfBirth + "]"; } }
[ "ping2ravi@gmail.com" ]
ping2ravi@gmail.com
4efb3ba349e657970db6050608bae304dac93861
5ab300a1302d0ba6464facfe6dc1bc59637b5332
/src/main/java/com/matsg/nationsbans/sql/SQLManager.java
4334218a61578e005e3912c1ff807b8dbb0fdb08
[]
no_license
matsgemmeke/nations-bans-plugin
9472ce5196761e6f10ab8f2f760d77c3cc43f425
5a28e6257d3617e397e3e20c5625f9c969ef524d
refs/heads/master
2021-07-01T20:12:13.580945
2017-09-20T16:08:13
2017-09-20T16:08:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,225
java
package com.matsg.nationsbans.sql; import com.matsg.nationsbans.Ban; import com.matsg.nationsbans.NationsBans; import com.matsg.nationsbans.SettingsManager; import com.matsg.nationsbans.config.SQLConfig; import net.md_5.bungee.api.plugin.Plugin; import java.sql.*; import java.util.*; public class SQLManager { private static SQLManager instance; private final String ip, database, username, password; private Connection connection; private SQLConfig sql; private SQLManager(Plugin plugin) { this.sql = SettingsManager.getInstance().getSQLConfig(); this.ip = sql.getDatabaseIP(); this.database = sql.getDatabaseName(); this.username = sql.getUsername(); this.password = sql.getPassword(); try { connection = openConnection(); plugin.getLogger().info("Connection to database established."); } catch (Exception e) { plugin.getLogger().warning("Can not connect to the SQL database! Have you configured everything correctly?"); } finally { closeConnection(); } } public static SQLManager getInstance() { if (instance == null) { instance = new SQLManager(NationsBans.getPlugin()); } return instance; } public void closeConnection() { try { if (isConnected()) { connection.close(); } } catch (SQLException e) { e.printStackTrace(); } } public Ban getBan(String name) { try { connection = openConnection(); PreparedStatement ps = connection.prepareStatement("SELECT * FROM `bans` WHERE PlayerName = ? AND PardonDate > CURRENT_TIMESTAMP;"); ps.setString(1, name); ResultSet rs = ps.executeQuery(); if (!rs.next()) { return null; } Ban ban = new Ban( UUID.fromString(rs.getString("PlayerUUID")), rs.getString("PlayerName"), rs.getString("StaffName"), rs.getString("Reason"), rs.getTimestamp("BanDate"), rs.getTimestamp("PardonDate") ); ps.close(); rs.close(); return ban; } catch (SQLException e) { e.printStackTrace(); } finally { closeConnection(); } return null; } public Ban getBan(UUID uuid) { try { connection = openConnection(); PreparedStatement ps = connection.prepareStatement("SELECT * FROM `bans` WHERE PlayerUUID = ? AND PardonDate > CURRENT_TIMESTAMP;"); ps.setString(1, uuid.toString()); ResultSet rs = ps.executeQuery(); if (!rs.next()) { return null; } Ban ban = new Ban( UUID.fromString(rs.getString("PlayerUUID")), rs.getString("PlayerName"), rs.getString("StaffName"), rs.getString("Reason"), rs.getTimestamp("BanDate"), rs.getTimestamp("PardonDate") ); ps.close(); rs.close(); return ban; } catch (SQLException e) { e.printStackTrace(); } finally { closeConnection(); } return null; } public boolean isConnected() throws SQLException { return connection != null || !connection.isClosed(); } public Connection openConnection() throws SQLException { Connection connection = DriverManager.getConnection("jdbc:mysql://" + ip + ":3306/" + database, username, password); return connection; } public void registerBan(Ban ban) { try { connection = openConnection(); PreparedStatement ps = connection.prepareStatement("INSERT INTO `bans`(PlayerUUID, PlayerName, StaffName, Reason, BanDate, PardonDate) VALUES(?, ?, ?, ?, ?, ?);"); ps.setString(1, ban.getPlayerUUID().toString()); ps.setString(2, ban.getPlayerName()); ps.setString(3, ban.getStaffName()); ps.setString(4, ban.getReason()); ps.setTimestamp(5, ban.getBanDate()); ps.setTimestamp(6, ban.getPardonDate()); ps.execute(); ps.close(); } catch (SQLException e) { e.printStackTrace(); } finally { closeConnection(); } } public void removeBan(Ban ban) { try { connection = openConnection(); //We want the record to continue to exist in the database, so update the pardon date rather than removing the ban PreparedStatement ps = connection.prepareStatement("UPDATE `bans` SET PardonDate = CURRENT_TIMESTAMP WHERE PlayerUUID = ? AND PardonDate > CURRENT_TIMESTAMP;"); ps.setString(1, ban.getPlayerUUID().toString()); ps.execute(); ps.close(); } catch (SQLException e) { e.printStackTrace(); } finally { closeConnection(); } } }
[ "matsgemmeke@gmail.com" ]
matsgemmeke@gmail.com
8bdcc2b7817ba79ebddd591227e21d6408935ed3
029b116ed5f4e5f1ebc8c61a66f89cc6bf702a54
/app/src/main/java/com/rainmachine/presentation/screens/restrictions/RestrictedMonthAdapter.java
4962632749cc75fc3563cced3923ee4e97ed0492
[]
no_license
vick08/rainmachine-android-app
282d9ac88f11adb9f9fdfd6dd88bfaaf0298b90a
d919bd86b77cf2b679c1fe92087f8f266d07f425
refs/heads/master
2021-07-20T05:15:57.906201
2017-10-28T14:03:48
2017-10-28T14:03:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,273
java
package com.rainmachine.presentation.screens.restrictions; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.rainmachine.R; import com.rainmachine.presentation.util.adapter.GenericListAdapter; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; public class RestrictedMonthAdapter extends GenericListAdapter<String> { public RestrictedMonthAdapter(Context ctx, List<String> items) { super(ctx, items); } @Override public View newView(LayoutInflater inflater, int position, ViewGroup container) { View row = inflater.inflate(R.layout.item_restricted_month, container, false); ViewHolder holder = new ViewHolder(row); row.setTag(holder); return row; } @Override public void bindView(Object item, int position, View view) { ViewHolder holder = (ViewHolder) view.getTag(); String month = getItem(position); holder.month.setText(month); } static class ViewHolder { @BindView(R.id.month) TextView month; public ViewHolder(View view) { ButterKnife.bind(this, view); } } }
[ "catalin.morosan@gmail.com" ]
catalin.morosan@gmail.com
3ea7b2e37cb4621254aff78ce14b82620f04914e
47e685e70d278baf8d8c895f7595f9f8bb702226
/src/main/java/com/mysp/dao/UserDao.java
95eb28fc78e5708aaee7591b505dcf2be2d73f69
[]
no_license
swustzl/mysp
1e3e02836e86c304f596c7582bdc46bde8593b04
205c301b829b1b23d755aec209e745180d718ec3
refs/heads/master
2021-01-10T03:11:20.160895
2015-10-26T11:47:53
2015-10-26T11:47:53
43,807,779
0
0
null
null
null
null
UTF-8
Java
false
false
562
java
package com.mysp.dao; import com.mysp.model.User; import org.springframework.stereotype.Repository; import javax.annotation.Resource; import org.apache.ibatis.session.SqlSession; import java.util.List; /** * Created by zlovet on 2015/10/22. */ @Repository public class UserDao { @Resource private SqlSession sqlSession; //public void addOne(User user) { // sqlSession.insert("RoleConfigMapper.addRoleConfig", roleConfig); // } public List<User> selectUser() { return sqlSession.selectList("UserMapper.getUser"); } }
[ "903679262@qq.com" ]
903679262@qq.com
5eb6b139f8b272ac9ce580a49880cbcc56f4df85
8c2150d1fe5ca118bc65b618a421ac53d77e8962
/SWB4/swb/SWBJSR283/src/org/semanticwb/jcr283/implementation/SPARQLQuery.java
18ac95c4391ab6d7bd64689b0e08efe466ab3304
[]
no_license
haxdai/SemanticWebBuilder
b3d7b7d872e014a52bf493f613d145eb1e87b2e6
dad201959b3429adaf46caa2990cc5ca6bd448e7
refs/heads/master
2021-01-20T10:49:55.948762
2017-01-26T18:01:17
2017-01-26T18:01:17
62,407,043
0
0
null
null
null
null
UTF-8
Java
false
false
4,927
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.semanticwb.jcr283.implementation; import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.rdf.model.Literal; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Resource; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import javax.jcr.PropertyType; import javax.jcr.RepositoryException; import javax.jcr.query.InvalidQueryException; import javax.jcr.query.QueryResult; import org.semanticwb.Logger; import org.semanticwb.SWBUtils; import org.semanticwb.jcr283.repository.model.Base; import org.semanticwb.model.SWBContext; import org.semanticwb.platform.SemanticObject; /** * * @author victor.lorenzana */ public final class SPARQLQuery extends QueryImp { private static Logger log = SWBUtils.getLogger(SPARQLQuery.class); public static final String SPARQL = "SPARQL"; private static final String NL = "\r\n"; private StringBuilder prefixStatement = new StringBuilder(""); public SPARQLQuery(SessionImp session, String statement) throws RepositoryException { super(session, statement, SPARQL); for (String prefix : session.getNamespacePrefixes()) { String uri = session.getNamespaceURI(prefix); if (!uri.endsWith("#")) { uri += "#"; } prefixStatement.append("PREFIX " + prefix + ": <" + uri + ">" + NL); } } public QueryResult execute() throws InvalidQueryException, RepositoryException { HashSet<SemanticObject> semanticObjects = new HashSet<SemanticObject>(); Model model = SWBContext.getWorkspace(session.getWorkspaceImp().getName()).getSemanticObject().getModel().getRDFModel(); String sparql = prefixStatement.toString() + statement; com.hp.hpl.jena.query.Query query = com.hp.hpl.jena.query.QueryFactory.create(sparql); QueryExecution qexec = QueryExecutionFactory.create(query, model); HashSet<String> columnames = new HashSet<String>(); ArrayList<RowImp> rows = new ArrayList<RowImp>(); try { ResultSet rs = qexec.execSelect(); List resultVars1 = rs.getResultVars(); for (Object name : resultVars1) { columnames.add(name.toString()); } while (rs.hasNext()) { ArrayList<ValueImp> values = new ArrayList<ValueImp>(); QuerySolution rb = rs.nextSolution(); List resultVars = rs.getResultVars(); for (Object name : resultVars) { if (rb.get(name.toString()).isResource()) { Resource res = rb.getResource(name.toString()); SemanticObject obj = SemanticObject.createSemanticObject(res); if (obj != null && (obj.getSemanticClass().isSubClass(Base.sclass) || obj.getSemanticClass().equals(Base.sclass))) { semanticObjects.add(obj); } Base base = new Base(obj); NodeImp node = session.getWorkspaceImp().getNodeManager().getNodeByIdentifier(base.getId(), session, NodeTypeManagerImp.loadNodeType(obj.getSemanticClass())); ValueImp value = new ValueImp(node, PropertyType.REFERENCE); values.add(value); } else if (rb.get(name.toString()).isLiteral()) { Literal lit = rb.getLiteral(name.toString()); ValueImp value = new ValueImp(lit.getValue(), PropertyType.STRING); values.add(value); } } RowImp row=new RowImp(session, columnames.toArray(new String[columnames.size()]), values.toArray(new ValueImp[values.size()])); rows.add(row); } } catch (Throwable e) { log.error(e); } finally { qexec.close(); } HashSet<NodeImp> nodes = new HashSet<NodeImp>(); for (SemanticObject obj : semanticObjects) { Base base = new Base(obj); NodeImp node = session.getWorkspaceImp().getNodeManager().getNodeByIdentifier(base.getId(), session, NodeTypeManagerImp.loadNodeType(obj.getSemanticClass())); if (node != null) { nodes.add(node); } } return new QueryResultImp(nodes, columnames.toArray(new String[columnames.size()]), rows); } }
[ "vlorenzana73@users.noreply.github.com" ]
vlorenzana73@users.noreply.github.com
ae7759d200fb321d40cb9f996511000de685fd45
c5c4d6b81a56a9353a62a6b7ade7ea9cecf8b80a
/src/test/java/zm/co/creativate/CreativateApplicationTests.java
49951c32165743e756b2ecb5edb9498cf28e0388
[]
no_license
cinnamon-honey/creativate
3d7a3f5f909a0b4323a4850b9bf3f36d0a202417
e04f02a47f58d81af2eced44e627b9c1370aea21
refs/heads/master
2021-01-15T16:48:06.008134
2017-08-08T20:20:47
2017-08-08T20:20:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
337
java
package zm.co.creativate; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class CreativateApplicationTests { @Test public void contextLoads() { } }
[ "chishimba.mumbi@gmail.com" ]
chishimba.mumbi@gmail.com
adb3e10ca7ba28c1d9a85c0abefe801f06cf513f
9738a78468c1bc7c546ffc2351a78d0ded8a3404
/Dao/src/main/java/by/restaurantHibernate/pojos/Order.java
6d8dff7d28ba79eb3ef693eb87371dc67143587f
[]
no_license
sensesnet/rest_hibernate
e22899852d3f51a32b6ec6514a9d9b051e2b6918
208b1a6db5ba1ccf4b06b780ca126abae2e02974
refs/heads/master
2021-06-26T19:54:20.728062
2017-04-03T20:59:27
2017-04-03T20:59:27
58,499,906
0
0
null
null
null
null
UTF-8
Java
false
false
1,561
java
package by.restaurantHibernate.pojos; import javax.persistence.*; @Entity @Table(name="ORDER_MEAL_USER") public class Order { @Id @Column(name = "id") @GeneratedValue(strategy = GenerationType.AUTO) private int id; @Column(name = "order_Id", unique = false, nullable = false) private int orderId; @Column(name = "meal_Id", unique = false, nullable = false) private int mealId; @Column(name = "user_Id", unique = false, nullable = false) private int userId; // @ManyToOne( fetch = FetchType.LAZY) // //@Cascade(CascadeType.ALL) // @JoinColumn(name = "order_Id") // private OrderStatus orderStatus; // // public OrderStatus getOrderStatus() {return orderStatus;} // // public void setOrderStatus(OrderStatus orderStatus) {this.orderStatus = orderStatus;} public int getId() { return id; } public void setId(int id) { this.id = id; } public int getOrderId() {return orderId;} public void setOrderId(int orderId) {this.orderId = orderId;} public int getMealId() { return mealId; } public void setMealId(int mealId) { this.mealId = mealId; } public int getUserId() { return userId; } public void setUserId(int userId) { this.userId = userId; } @Override public String toString() { return "Order{" + "id=" + id + ", orderId=" + orderId + ", mealId=" + mealId + ", userId=" + userId + '}'; } }
[ "sensesnet@gmail.com" ]
sensesnet@gmail.com
bcb4c4ceb60add9a011f26cf4e27e6c986e3c938
851d7883e667b1883a327fe29e24c180ec63cb09
/src/blocks/poi/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/EP_Type.java
dc1f28035b18b060b29c9618ee445d91ae97d0ba
[ "Apache-2.0" ]
permissive
sri-desai/Cocoon
6772622f5e4b45339df25825cfc5bc50360b48a3
a513391476ea1d8c835df03187947bf0fde913c2
refs/heads/master
2021-07-10T22:46:35.108428
2017-10-06T03:36:02
2017-10-06T03:36:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,238
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements; import org.apache.cocoon.components.elementprocessor.types.NumericConverter; import org.apache.cocoon.components.elementprocessor.types.NumericResult; import org.apache.cocoon.components.elementprocessor.types.Validator; import java.io.IOException; /** * No-op implementation of ElementProcessor to handle the "type" tag * * This element is not used in HSSFSerializer 1.0 * * This element has no attributes, but has string content, which is * numeric. * * @author Marc Johnson (marc_johnson27591@hotmail.com) * @version CVS $Id$ */ public class EP_Type extends BaseElementProcessor { private NumericResult _type; private static final Validator _validator = new Validator() { public IOException validate(final Number number) { return GTKTypes.isValid(number.intValue()) ? null : new IOException("\"" + number + "\" is not a legal value"); } }; /** * constructor */ public EP_Type() { super(null); _type = null; } /** * @return the type * * @exception IOException if the type is not numeric */ int getType() throws IOException { if (_type == null) { _type = NumericConverter.extractInteger(getData(), _validator); } return _type.intValue(); } } // end public class EP_Type
[ "srinivas.desai491@gmail.com" ]
srinivas.desai491@gmail.com
68ad06d2d9a0bf3ff0287459c3e3b7227075c8a4
64455b7ce0658de6992bb219d8b150dddb30881c
/DesignPatterns/src/main/java/br/com/bcp/pattern/templatemethod/HTMLData.java
089278e31a0be022a30520896c21629ef13d005c
[]
no_license
bproenca/java
f1fba9f21026a67ec3131fed39692999ef6faed0
0b9a9c9620e60b22a57cc61fa3bd467269e270db
refs/heads/master
2023-01-09T15:34:48.597389
2019-12-21T21:46:42
2019-12-21T21:46:42
202,936,509
0
0
null
2023-01-02T21:58:51
2019-08-17T22:25:25
HTML
UTF-8
Java
false
false
322
java
package br.com.bcp.pattern.templatemethod; public class HTMLData extends Template { @Override protected String link(final String texto, final String url) { return "<a href='" + url + "'>" + texto + "</a>"; } @Override protected String transform(final String texto) { return texto.toLowerCase(); } }
[ "bruno.proenca@synchro.com.br" ]
bruno.proenca@synchro.com.br
d3a81db2fa6ebbb651145129998e6bfa0726d948
55209524ae66e286e62fb8b00b3e3152ab0fd68c
/MyApp2/src/com/lehaibo/myapp2/activity/AboutActivity.java
180036d617f746f86fa9b71a3ee466fd2a77961a
[]
no_license
lehaibo/Android_demos
b15359a051831b5d8783fa5f0d66bbbf4bff79a7
d996e713f7ed21e1cb944f142054388e99ec12f8
refs/heads/master
2016-09-06T11:34:16.479425
2014-06-24T02:44:35
2014-06-24T02:44:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,351
java
package com.lehaibo.myapp2.activity; import java.util.List; import org.json.JSONException; import roboguice.inject.InjectView; import android.app.Dialog; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import com.lehaibo.myapp2.MyApplication; import com.lehaibo.myapp2.R; import com.lehaibo.myapp2.base.BaseActivity; import com.lehaibo.myapp2.base.PublicTypeBuilder; import com.lehaibo.myapp2.dialog.DialogBuilder; import com.lehaibo.myapp2.dialog.IDialogInterface; import com.lehaibo.myapp2.model.PublicType; import com.lehaibo.myapp2.network.BaseRequestPacket; import com.lehaibo.myapp2.network.ClientEngine; import com.lehaibo.myapp2.network.IRequestDataPacketCallback; import com.lehaibo.myapp2.network.ResponseDataPacket; import com.lehaibo.myapp2.util.CommonLog; import com.lehaibo.myapp2.util.CommonUtil; import com.lehaibo.myapp2.util.LogFactory; public class AboutActivity extends BaseActivity implements OnClickListener, IRequestDataPacketCallback, IDialogInterface { private static final CommonLog log = LogFactory.createLog(); @InjectView (R.id.btn_back) Button mBtnBack; @InjectView (R.id.ll_advise) View mAdviseView; @InjectView (R.id.ll_attention) View mAttentionWeiboView; @InjectView (R.id.ll_checkupdate) View mCheckUpdateView; @InjectView (R.id.ll_support) View mSupportDevelopterView; @InjectView (R.id.iv_updateicon) ImageView mIVUpageIcon; @InjectView (R.id.tv_version) TextView mTVVersion; private ClientEngine mClientEngine; private PublicType.CheckUpdateResult object = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.abount_layout); setupViews(); initData(); } private void setupViews(){ mBtnBack.setOnClickListener(this); mSupportDevelopterView.setOnClickListener(this); mAttentionWeiboView.setOnClickListener(this); mCheckUpdateView.setOnClickListener(this); mAdviseView.setOnClickListener(this); } private void initData(){ mClientEngine= ClientEngine.getInstance(this); object = MyApplication.getInstance().getNewVersion(); if (object != null && object.mHaveNewVer != 0){ showUpdateIcon(true); }else{ showUpdateIcon(false); PublicType.CheckUpdate object = PublicTypeBuilder.buildCheckUpdate(this); BaseRequestPacket packet = new BaseRequestPacket(); packet.action = PublicType.CHECK_UPDATE_MSGID; packet.object = object; packet.extra = new Object(); mClientEngine.httpGetRequestEx(packet, this); } updateView(); } private void showUpdateIcon(boolean flag){ if (flag){ mIVUpageIcon.setVisibility(View.VISIBLE); }else{ mIVUpageIcon.setVisibility(View.GONE); } } @Override public void onClick(View view) { switch(view.getId()){ case R.id.btn_back: finish(); break; case R.id.ll_advise: goAdviseActivity(); break; case R.id.ll_attention: attention(); break; case R.id.ll_checkupdate: checkUpdate(); break; case R.id.ll_support: support(); break; } } private void updateView(){ String value = getResources().getString(R.string.tvt_ver_pre) + CommonUtil.getSoftVersion(this); mTVVersion.setText(value); } private void goAdviseActivity(){ // Intent intent = new Intent(); // intent.setClass(this, AdviseActivity.class); // startActivity(intent); } private void attention(){ // Platform plat = ShareSDK.getPlatform(this, SinaWeibo.NAME); // plat.setPlatformActionListener(this); // plat.followFriend("2881812642"); } private void checkUpdate(){ if (object != null && object.mHaveNewVer != 0){ if (updateDialog != null){ updateDialog.dismiss(); } updateDialog = getUpdateDialog(object.mContentList); updateDialog.show(); }else{ PublicType.CheckUpdate object = PublicTypeBuilder.buildCheckUpdate(this); BaseRequestPacket packet = new BaseRequestPacket(); packet.action = PublicType.CHECK_UPDATE_MSGID; packet.object = object; mClientEngine.httpGetRequestEx(packet, this); CommonUtil.showToast(R.string.toast_checking_update, this); } } private void support(){ // Intent intent = new Intent(); // intent.setClass(this, SupportActivity.class); // startActivity(intent); } @Override public void onSuccess(int requestAction, ResponseDataPacket dataPacket, Object extra) { log.e("onSuccess! requestAction = " + requestAction + ", dataPacket ==> \n" + dataPacket.toString()); switch(requestAction){ case PublicType.CHECK_UPDATE_MSGID: onGetCheckUpdate(dataPacket, extra); break; } } @Override public void onRequestFailure(int requestAction, String content, Object extra) { log.e("onRequestFailure --> requestAction = " + requestAction); CommonUtil.showToast(R.string.toast_getdata_fail, this); } @Override public void onAnylizeFailure(int requestAction, String content, Object extra) { log.e("onAnylizeFailure! requestAction = " + requestAction + "\ncontent = " + content); } // public void onComplete(Platform platform, int action, // HashMap<String, Object> res) { // log.e("onComplete Platform = " + platform.getName() + ", action = " + action); // // runOnUiThread(new Runnable() { // // @Override // public void run() { // CommonUtil.showToast(R.string.toast_attention_success, AboutActivity.this); // // } // }); // // // } // public void onError(Platform platform, int action, Throwable t) { // t.printStackTrace(); // log.e("onError Platform = " + platform.getName() + ", action = " + action); // // runOnUiThread(new Runnable() { // // @Override // public void run() { // CommonUtil.showToast(R.string.toast_attention_fail, AboutActivity.this); // // } // }); // // // } // public void onCancel(Platform platform, int action) { // log.e("onCancel Platform = " + platform.getName() + ", action = " + action); // // } private Dialog updateDialog; private void onGetCheckUpdate( ResponseDataPacket dataPacket, Object extra){ object = new PublicType.CheckUpdateResult(); try { object.parseJson(dataPacket.data); // log.e("mHaveNewVer = " + object.mHaveNewVer + "\nmVerCode = " + object.mVerCode + // "\nmVerName = " + object.mVerName + "\nmAppUrl = " + object.mAppUrl + "\nmContent.size = " + object.mContentList.size()); } catch (JSONException e) { e.printStackTrace(); CommonUtil.showToast(R.string.toast_anylizedata_fail, this); object = null; return ; } if (object.mHaveNewVer != 0){ showUpdateIcon(true); if (extra == null){ if (updateDialog != null){ updateDialog.dismiss(); } updateDialog = getUpdateDialog(object.mContentList); updateDialog.show(); } MyApplication.getInstance().setNewVersionFlag(object); }else{ if (extra == null){ CommonUtil.showToast(R.string.toast_no_update, this); } } } private Dialog getUpdateDialog(List<String > list){ int size = list.size(); StringBuffer sBuffer = new StringBuffer(); for(int i = 0; i < size; i++){ String value = String.valueOf(i + 1) + "." + list.get(i); sBuffer.append(value); if (i != size - 1){ sBuffer.append("\n"); } } log.e("msg = " + sBuffer.toString()); Dialog dialog = DialogBuilder.buildNormalDialog(this, "版本更新" + object.mVerName, sBuffer.toString(), this); return dialog; } @Override public void onSure() { if (updateDialog != null){ updateDialog.dismiss(); } log.e("object:" + object); if (object != null){ Intent intents = new Intent(Intent.ACTION_VIEW); intents.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intents.setData(Uri.parse(object.mAppUrl)); startActivity(intents); log.e("jump to url:" + object.mAppUrl); } } @Override public void onCancel() { if (updateDialog != null){ updateDialog.dismiss(); } } }
[ "lehaibo@126.com" ]
lehaibo@126.com
7a7a73928be355995a869a6ebc57f4e26b9e9f74
bbf008f631c3e64476f8914f907af596ff4adfb6
/organizer/organizer-lib/src/main/java/com/bbtech/organizer/server/dao/LogDao.java
88c835be98787796382cc402aa39b01d438d23be
[]
no_license
jwbennet/organizer
ae21d36351f6815d64525ea87dd4df18b2ee5983
7e9afc67d87b47e63c7ac1e4cf890d7f4ab1a1e3
refs/heads/master
2021-01-22T16:45:38.370878
2014-02-09T23:35:43
2014-02-09T23:35:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,179
java
package com.bbtech.organizer.server.dao; import java.util.List; import org.joda.time.DateTime; import com.bbtech.organizer.server.entities.Log; public interface LogDao { public static final String FIND_ALL = "Log.findAll"; public static final String FIND_ALL_QUERY = "SELECT l FROM Log l"; public static final String FIND_BY_ID = "Log.findById"; public static final String FIND_BY_ID_QUERY = "SELECT l FROM Log l WHERE l.id = :id"; public static final String FIND_BY_DATE_RANGE = "Log.findByDateRange"; public static final String FIND_BY_DATE_RANGE_QUERY = "SELECT l FROM Log l WHERE l.date >= :startDate AND l.date < :endDate ORDER BY l.date ASC"; public static final String DELETE_BY_ID = "Log.deleteById"; public static final String DELETE_BY_ID_QUERY = "DELETE FROM Log l WHERE l.id = :id"; public static final String ID_PARAM = "id"; public static final String START_DATE_PARAM = "startDate"; public static final String END_DATE_PARAM = "endDate"; Log findById(Long id); List<Log> findAll(); List<Log> findByDateRange(DateTime start, DateTime end); Log save(Log log); void delete(Log log); void deleteById(Long id); }
[ "jwbennet@gmail.com" ]
jwbennet@gmail.com
6c29eadb635d13500f898d1fc87e40f7629727f8
cedf10d5882ff867a36247e037469a4da642df2b
/src/main/java/com/monstrenyatko/desert/util/PropertyLoader.java
947b732a84e0ce427a2bee0e0792f56fcbdb5d07
[ "MIT" ]
permissive
monstrenyatko/desert
6df5ab71aa4950bac57fd10a3f50919c0d7cce9f
20c8daeefd417bf31433500c56f3fedec8741e69
refs/heads/master
2020-05-20T08:44:34.861595
2014-12-25T10:56:47
2014-12-25T10:56:47
28,416,528
1
0
null
null
null
null
UTF-8
Java
false
false
3,073
java
/* ******************************************************************************* * * Purpose: Property loader implementation * ******************************************************************************* * Copyright Monstrenyatko 2014. * * Distributed under the MIT License. * (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) ******************************************************************************* */ package com.monstrenyatko.desert.util; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import org.junit.Assert; import org.openqa.selenium.Capabilities; import org.openqa.selenium.remote.DesiredCapabilities; /** * Class that extracts properties from the prop file. */ public class PropertyLoader { public static Capabilities loadCapabilities() { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setBrowserName(loadProperty("browser.name")); return capabilities; } public static String loadProperty(final String name) { String res = get().load(name); if (res == null) { Assert.fail("Can't get property, name: "+name); } return res; } public static Integer loadPropertyInteger(final String name) { String value = loadProperty(name); try { return new Integer(value); } catch (NumberFormatException e) { e.printStackTrace(); Assert.fail("Can't parse Integer property, name: "+name); } return null; } private static final String PROPERTIES_LIBRARY = "/desert-base.properties"; private static final String PROPERTIES_DEFAULT = "/desert.properties"; private static final String PROPERTIES_ENV_VAR = "config.path"; private static PropertyLoader instance; private Properties propertyLibrary; private Properties propertyDefault; private Properties property; private String load(final String name) { String res = null; if (property != null) { res = property.getProperty(name); } if (res == null && propertyDefault != null) { res = propertyDefault.getProperty(name); } if (res == null && propertyLibrary != null) { res = propertyLibrary.getProperty(name); } return res; } synchronized private static PropertyLoader get() { if (instance == null) { try { instance = new PropertyLoader(); } catch (Exception e) { e.printStackTrace(); Assert.fail("Can't initialize property loader"); } } return instance; } private PropertyLoader() throws IOException { { Properties tmp = new Properties(); tmp.load(PropertyLoader.class.getResourceAsStream(PROPERTIES_LIBRARY)); propertyLibrary = tmp; } { Properties tmp = new Properties(); InputStream stream = PropertyLoader.class.getResourceAsStream(PROPERTIES_DEFAULT); if (stream != null) { tmp.load(stream); } propertyDefault = tmp; } { String propertyPath = System.getProperty(PROPERTIES_ENV_VAR); if (propertyPath != null) { Properties tmp = new Properties(); tmp.load(PropertyLoader.class.getResourceAsStream(propertyPath)); property = tmp; } } } }
[ "monstrenyatko@gmail.com" ]
monstrenyatko@gmail.com
edb4df77713899981390e591bbe3ad2d8f55df5e
ffa83215d4a44581f44173100331bda1900b24fe
/build/Android/Preview/app/src/main/java/com/foreign/Uno/IO/AAssetManager.java
696379ec77d844410baf59b2fb2fce8ea23e76a8
[]
no_license
imkimbosung/ARkit_fuse
167d1c77ee497d5b626e69af16e0e84b13c54457
3b378d6408551d6867f2e5b3d7d8b6f5114e7f69
refs/heads/master
2020-04-19T02:34:33.970273
2019-02-04T08:26:54
2019-02-04T08:26:54
167,907,696
0
0
null
null
null
null
UTF-8
Java
false
false
748
java
package com.foreign.Uno.IO; // fuse defined imports import com.uno.UnoObject; import com.uno.BoolArray; import com.uno.ByteArray; import com.uno.CharArray; import com.uno.DoubleArray; import com.uno.FloatArray; import com.uno.IntArray; import com.uno.LongArray; import com.uno.ObjectArray; import com.uno.ShortArray; import com.uno.StringArray; import com.Bindings.UnoHelper; import com.Bindings.UnoWrapped; import com.Bindings.ExternedBlockHost; public class AAssetManager { static void debug_log(Object message) { android.util.Log.d("AR_example", (message==null ? "null" : message.toString())); } public static Object GetJavaObject52() { return com.fuse.Activity.getRootActivity().getAssets(); } }
[ "ghalsru@naver.com" ]
ghalsru@naver.com
1a71fc8df7bb8623864d3ac7e9d5e50a377a9d50
221cd5045a8656dd45bae689a58c3d37cecd1f9e
/src/main/java/com/forum/forum/ForumApplication.java
059614b71bd74be259e090097ca5ff09f8f492c3
[]
no_license
KenanRico/Anom
5f4b5d148b3e68ed1d4b4e6c5ed3fd9035ff67c8
730a17a9387fdcf72557aa5431e733cfc0b6fd67
refs/heads/master
2020-07-26T01:07:04.358663
2020-01-02T01:23:34
2020-01-02T01:25:49
208,481,748
0
0
null
null
null
null
UTF-8
Java
false
false
305
java
package com.forum.forum; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ForumApplication{ public static void main(String[] args) { SpringApplication.run(ForumApplication.class, args); } }
[ "kenan.hu@mail.utoronto.ca" ]
kenan.hu@mail.utoronto.ca
391bce50c39a1c388b517884dbe5d62ce9f17c2c
ee775c97c58406fd4ba19ad9a81337a2e2d6efea
/FoodSener/app/src/main/java/com/example/tianyunchen/foodsener/activity/BaseActivity.java
3b90b51c0a595f9f275f76c4491678331842d645
[ "Apache-2.0" ]
permissive
tianyun6655/love-foodie-android
7f5ac51dd959eb337b4f9abbe7035ed74492f5a2
bf7741ffcb9d28f43fbc320fc29a6a885552748d
refs/heads/master
2021-01-12T15:49:56.479668
2016-10-25T09:33:27
2016-10-25T09:33:27
71,881,112
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
package com.example.tianyunchen.foodsener.activity; import android.support.v4.app.FragmentActivity; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.TextView; import com.example.tianyunchen.foodsener.R; import com.special.ResideMenu.ResideMenu; /** * Created by tianyun chen on 2016/9/13. */ public abstract class BaseActivity extends FragmentActivity implements View.OnClickListener { private TextView textView; public abstract void initViews(); public void setTitleTest(String title){ textView = (TextView)findViewById(R.id.toolbar_text); textView.setText(title); ResideMenu resideMenu = new ResideMenu(this); } public void setTitleSize(float size){ textView = (TextView)findViewById(R.id.toolbar_text); textView.setTextSize(size); } }
[ "tianyun chen" ]
tianyun chen
d970258a0859dce4f83f7139bc3c755295f681de
ed30d5187809b7679f982afa1e9fe090530a2168
/app/src/main/java/com/example/android/SpotifyStreamerWithBeaconSupport/ArtistLinearLayout.java
737d082a2405603f983be537c20f123cd5f68b1a
[]
no_license
johnshea/SpotifyStreamerWithBeaconSupport
d923bc4779612f74e17925813bd6225c6ea21c72
5f9dc59d40659e8e385c3b601b414b6773deba1e
refs/heads/master
2021-01-10T09:56:30.676327
2015-09-28T04:25:31
2015-09-28T04:25:31
43,279,669
0
0
null
null
null
null
UTF-8
Java
false
false
1,512
java
package com.example.android.SpotifyStreamerWithBeaconSupport; import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.LinearLayout; import com.squareup.picasso.Picasso; import com.squareup.picasso.Target; /** * Created by John on 6/29/2015. */ public class ArtistLinearLayout extends LinearLayout implements Target { public ArtistLinearLayout(Context context) { super(context); } public ArtistLinearLayout(Context context, AttributeSet attrs) { super(context, attrs); } public ArtistLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override public void onBitmapFailed(Drawable errorDrawable) { } @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, 100, 100, false); Drawable background = new BitmapDrawable(getResources(), scaledBitmap); background.setAlpha(25); // ScaleDrawable scaleDrawable = new ScaleDrawable(background, 0x01 | 0x10, 10.0f, 10.0f); // Drawable littleBackground = scaleDrawable.getDrawable(); this.setBackground(background); // this.setBackgroundColor(Color.BLUE); } @Override public void onPrepareLoad(Drawable placeHolderDrawable) { } }
[ "jscruffy@hotmail.com" ]
jscruffy@hotmail.com
9fa13af1e68bb38f99a9296d91b3c22d5910e1e3
ac7c8bced8f41c78094211ff818ebbeb966ab872
/java-programs/Student.java
1ea4700d20b4a36beeacf89774e4a8f8f734580a
[]
no_license
misguided-coder/dbs-april-full-stack
5f59e61b6f9c95a0ff58bc471bca9c397bbe35dd
a83d7e315894911f4ed47c27401e1fc3a0e23b4c
refs/heads/master
2020-05-15T04:45:11.739792
2019-04-18T13:35:41
2019-04-18T13:35:41
182,093,574
0
1
null
null
null
null
UTF-8
Java
false
false
551
java
class Student { String name; int hindiMarks; int englishMarks; public final static int MARKS = 500; Student(String name,int hindiMarks,int englishMarks) { this.name = name; this.hindiMarks = hindiMarks; this.englishMarks = englishMarks; } void info() { System.out.printf("NAME : %s%n",this.name); System.out.printf("HINDIMARKS : %s%n",this.hindiMarks); System.out.printf("ENGLISHMARKS : %s%n",this.englishMarks); System.out.printf("MARKS : %s%n",this.MARKS); System.out.println("=================================="); } }
[ "hi2tyagi@yahoo.com" ]
hi2tyagi@yahoo.com
7ccedb8e4f9c7f2020346786504a1ae19b51cfe1
2b1d8f0e49a5730bcbed1d5309efa4d58ed9bf0e
/src/main/java/self/philbrown/gsonparceable/GsonCreator.java
c93f54258427c6eb021b0a3cd8b0d74b38430cdf
[ "Apache-2.0" ]
permissive
phil-brown/GsonParcelableModule
f11a3edec9ac2cd088f0996b2bc0152f4887dc68
f168b1d9c5cea66f1c026ca697c3f9cbe0aa597b
refs/heads/master
2021-01-10T22:23:06.975781
2015-09-16T17:45:34
2015-09-16T17:45:34
42,603,270
0
1
null
null
null
null
UTF-8
Java
false
false
2,198
java
package self.philbrown.gsonparceable; import android.os.Parcel; import android.os.Parcelable; import com.google.gson.Gson; import java.lang.reflect.Array; import java.lang.reflect.ParameterizedType; /** * Parcelable Creator class that uses GSON to convert a Parcel to an Object * * @author Phil Brown * @since 1:27 PM Aug 14, 2015 */ public abstract class GsonCreator<T extends GsonParcelable> implements Parcelable.Creator<T> { /** * The class that will be unmarshalled from the Parcel object */ private Class<T> clazz; /** * Constructor * @param clazz the class that will be created from the Parcel */ public GsonCreator(Class<T> clazz) { this.clazz = clazz; } /** * Constructor. No class is required as the parameter, as it will be determined automatically. */ public GsonCreator() { this.clazz = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; } @Override public T createFromParcel(Parcel parcel) { return getGson().fromJson(parcel.readString(), clazz); } @Override public T[] newArray(int size) { return (T[]) Array.newInstance(clazz, size); } /** * Subclasses must return the GSON instance that should be used. Simple objects can just use * the default GSON, however it is recommended to have a static copy so unparceling does not * create a new instance every time: * <pre> * public class Person extends GsonParcelable { * private static Gson sGson = new Gson(); * * public static final GsonCreator<Person> CREATOR = new GsonCreator<Person>(Person.class) { * @Override * public Gson getGson() { * return sGson; * } * }; * * @Override * public GsonCreator getCREATOR() { * return CREATOR; * } * } * </pre> * More complex objects (such as objects containing other models) can use more complex Gson instances. * @return */ public abstract Gson getGson(); }
[ "philip22brown@gmail.com" ]
philip22brown@gmail.com
6610ee91a564043c4d16bf450d64f5354cbfc64a
91a036780ac75e462bfa14e804dbd2056671c8b6
/sys/src/main/java/com/bw/fit/system/position/entity/TPosition.java
e613e1aa51827ecbd5be22d5877743c46030444d
[]
no_license
yanghui1103/cloud
d7c6622e630cd7b69616c3202574a3ce92cc22b1
7a801c7263dd1e6ac932b3fe53c3c5674f945b7b
refs/heads/master
2020-04-09T04:54:37.983132
2019-04-21T04:33:46
2019-04-21T04:33:46
160,042,916
0
0
null
null
null
null
UTF-8
Java
false
false
853
java
package com.bw.fit.system.position.entity; import com.bw.fit.system.common.entity.BaseEntity; public class TPosition extends BaseEntity{ private String name; private String code ; private String simpleName; private String grade; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getSimpleName() { return simpleName; } public void setSimpleName(String simpleName) { this.simpleName = simpleName; } public String getGrade() { return grade; } public void setGrade(String grade) { this.grade = grade; } @Override public String toString() { return "TPosition [name=" + name + ", code=" + code + ", simpleName=" + simpleName +", grade=" + grade + "]"; } }
[ "yanghui1103@foxmail.com" ]
yanghui1103@foxmail.com
8a08f962fc7f189da3b953f6a72d3d27a1aa08b1
8b7f27b9d0ab852ee38e10ca267d6d361d9749dc
/src/main/java/wildycraft/client/model/ModelUntouchable.java
51b2083d66f7715503533ddd69dc9fd11bfc76a9
[]
no_license
Nolpfij/Wildycraft
209e8b69c75f04a277ebfd4a9b90564f1308626d
cc1d676762295523d99f92257c8cab7133833703
refs/heads/master
2021-01-10T15:51:38.289170
2015-12-11T18:29:14
2015-12-11T18:29:14
47,723,253
1
0
null
null
null
null
UTF-8
Java
false
false
6,291
java
package wildycraft.client.model; import org.lwjgl.opengl.GL11; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelUntouchable extends ModelBase { //fields ModelRenderer ring; ModelRenderer abdomen; ModelRenderer torso; ModelRenderer rightarm1; ModelRenderer rightarm2; ModelRenderer righthand; ModelRenderer leftarm1; ModelRenderer lefttarm2; ModelRenderer lefthand; ModelRenderer head; ModelRenderer clasp; ModelRenderer loop1; ModelRenderer loop2; ModelRenderer spike1; ModelRenderer spike2; ModelRenderer spike3; ModelRenderer spike4; public ModelUntouchable() { textureWidth = 256; textureHeight = 128; ring = new ModelRenderer(this, 59, 88); ring.addBox(-16F, 15F, -16F, 32, 4, 32); ring.setRotationPoint(0F, 5F, 0F); ring.setTextureSize(256, 128); ring.mirror = true; setRotation(ring, 0F, 0F, 0F); abdomen = new ModelRenderer(this, 76, 52); abdomen.addBox(-11.5F, 8F, -11.5F, 23, 10, 23); abdomen.setRotationPoint(0F, 5F, 0F); abdomen.setTextureSize(256, 128); abdomen.mirror = true; setRotation(abdomen, 0F, 0F, 0F); torso = new ModelRenderer(this, 90, 11); torso.addBox(-8.5F, -8F, -8.5F, 17, 19, 17); torso.setRotationPoint(0F, 5F, 0F); torso.setTextureSize(256, 128); torso.mirror = true; setRotation(torso, 0F, 0F, 0F); rightarm1 = new ModelRenderer(this, 175, 42); rightarm1.addBox(-14F, -4.5F, -4.5F, 14, 9, 9); rightarm1.setRotationPoint(-8F, 2F, 0F); rightarm1.setTextureSize(256, 128); rightarm1.mirror = true; setRotation(rightarm1, 0F, 0F, 0F); rightarm2 = new ModelRenderer(this, 175, 65); rightarm2.addBox(-13F, -4F, -14F, 8, 8, 10); rightarm2.setRotationPoint(-8F, 2F, 0F); rightarm2.setTextureSize(256, 128); rightarm2.mirror = true; setRotation(rightarm2, 0F, 0F, 0F); righthand = new ModelRenderer(this, 209, 89); righthand.addBox(-13.5F, -6F, -22F, 9, 12, 9); righthand.setRotationPoint(-8F, 2F, 0F); righthand.setTextureSize(256, 128); righthand.mirror = true; setRotation(righthand, 0F, 0F, 0F); leftarm1 = new ModelRenderer(this, 175, 42); leftarm1.addBox(0F, -4.5F, -4.5F, 14, 9, 9); leftarm1.setRotationPoint(8F, 2F, 0F); leftarm1.setTextureSize(256, 128); leftarm1.mirror = true; setRotation(leftarm1, 0F, 0F, 0F); lefttarm2 = new ModelRenderer(this, 175, 65); lefttarm2.addBox(5F, -4F, -14F, 8, 8, 10); lefttarm2.setRotationPoint(8F, 2F, 0F); lefttarm2.setTextureSize(256, 128); lefttarm2.mirror = true; setRotation(lefttarm2, 0F, 0F, 0F); lefthand = new ModelRenderer(this, 209, 89); lefthand.addBox(4.5F, -6F, -22F, 9, 12, 9); lefthand.setRotationPoint(8F, 2F, 0F); lefthand.setTextureSize(256, 128); lefthand.mirror = true; setRotation(lefthand, 0F, 0F, 0F); head = new ModelRenderer(this, 168, 4); head.addBox(-4.5F, -8F, -10F, 9, 8, 19); head.setRotationPoint(0F, -1F, 0F); head.setTextureSize(256, 128); head.mirror = true; setRotation(head, 0F, 0F, 0F); clasp = new ModelRenderer(this, 30, 43); clasp.addBox(-3.5F, -5F, -10F, 7, 6, 2); clasp.setRotationPoint(0F, 5F, 0F); clasp.setTextureSize(256, 128); clasp.mirror = true; setRotation(clasp, 0F, 0F, 0F); loop1 = new ModelRenderer(this, 11, 56); loop1.addBox(-4F, -12F, -9.4F, 3, 21, 19); loop1.setRotationPoint(0F, 5F, 0F); loop1.setTextureSize(256, 128); loop1.mirror = true; setRotation(loop1, 0F, 0F, 0.9773844F); loop2 = new ModelRenderer(this, 11, 56); loop2.addBox(1F, -12F, -9.4F, 3, 21, 19); loop2.setRotationPoint(0F, 5F, 0F); loop2.setTextureSize(256, 128); loop2.mirror = true; setRotation(loop2, 0F, 0F, -0.9773844F); spike1 = new ModelRenderer(this, 21, 22); spike1.addBox(-1.5F, -12F, -4F, 3, 4, 3); spike1.setRotationPoint(0F, -1F, 0F); spike1.setTextureSize(256, 128); spike1.mirror = true; setRotation(spike1, 0F, 0F, 0F); spike2 = new ModelRenderer(this, 51, 22); spike2.addBox(-1.5F, -11.5F, 1.5F, 3, 4, 3); spike2.setRotationPoint(0F, -1F, 0F); spike2.setTextureSize(256, 128); spike2.mirror = true; setRotation(spike2, 0F, 0F, 0F); spike3 = new ModelRenderer(this, 21, 6); spike3.addBox(-1F, -10F, -8F, 2, 3, 2); spike3.setRotationPoint(0F, -1F, 0F); spike3.setTextureSize(256, 128); spike3.mirror = true; setRotation(spike3, 0F, 0F, 0F); spike4 = new ModelRenderer(this, 45, 6); spike4.addBox(-1F, -9F, 6F, 2, 3, 2); spike4.setRotationPoint(0F, -1F, 0F); spike4.setTextureSize(256, 128); spike4.mirror = true; setRotation(spike4, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glAlphaFunc(GL11.GL_GREATER, 0); spike1.render(f5); spike2.render(f5); spike3.render(f5); spike4.render(f5); head.render(f5); clasp.render(f5); loop1.render(f5); loop2.render(f5); ring.render(f5); abdomen.render(f5); torso.render(f5); rightarm1.render(f5); rightarm2.render(f5); righthand.render(f5); leftarm1.render(f5); lefttarm2.render(f5); lefthand.render(f5); GL11.glPopAttrib(); GL11.glPopMatrix(); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } }
[ "vh077501@gmail.com" ]
vh077501@gmail.com
74bcb1f267b07feee7065e1994e3d5baa0581939
e8d7390dcdc5320119edbd02715f57ef0b729923
/OOP_LAB/WEEK_11/Appbro.java
afaa731c0b1fe3ce528deb15569d67918b8b0175
[]
no_license
beltmankelo/OOP_Java
4790e847a680cb7810d559fc612a95f5362c1dd7
9589a4b5f754dfec896d7ce312e8c970036f7f03
refs/heads/master
2020-08-29T02:12:44.985307
2019-10-27T17:50:26
2019-10-27T17:50:26
217,890,778
0
0
null
null
null
null
UTF-8
Java
false
false
693
java
import javafx.scene.control.*; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.layout.*; import javafx.scene.paint.Color; public class Appbro extends Application{ public void start(Stage primaryStage) { primaryStage.setTitle("This is the first JavaFX Application"); Label lb=new Label(); lb.setText("Welcome to JavaFX programming"); lb.setTextFill(Color.MAGENTA); FlowPane root=new FlowPane(); root.setHgap(10); root.setVgap(8); root.getChildren().add(lb); Scene ms=new Scene(root,500,200); primaryStage.setScene(ms); primaryStage.show(); } public static void main(String[] args) { launch(args); } }
[ "adityank3434@gmail.com" ]
adityank3434@gmail.com
8fafff3e0f7a6717e3fbe43e0c97ece8844dbb48
29363e9aed82b14ec16febb9701d449db5270cba
/container/quiz2/orig07/src/main/java/org/interventure/configuration/cglibproxy/ProxyCreator.java
36a458ab05cbbd83a393ca1394c8c40e72b0c83c
[]
no_license
interventure-growingtogether/spring-certification
1d039f3bf089553d580cd4719fad4b69d3e9be80
b8bd5ac507ecca59abc089dec08143fe80a6f1ce
refs/heads/master
2022-01-22T06:50:37.743024
2019-11-27T13:16:41
2019-11-27T13:16:41
207,088,173
1
0
null
2022-01-21T23:34:16
2019-09-08T09:13:29
Java
UTF-8
Java
false
false
751
java
package org.interventure.configuration.cglibproxy; import org.interventure.configuration.AppConfig; import org.interventure.configuration.dynamicproxy.AppConfigDynamicProxy; import org.springframework.cglib.proxy.Enhancer; import org.springframework.cglib.proxy.InvocationHandler; /** * @author <a href="mailto:slavisa.avramovic@escriba.de">avramovics</a> * @since 2019-11-18 */ public class ProxyCreator { public static AppConfig newProxyInstance(AppConfig proxy) { AppConfigDynamicProxy dp = new AppConfigDynamicProxy(proxy); Enhancer e = new Enhancer(); e.setSuperclass(AppConfig.class); e.setCallback((InvocationHandler) (o, method, objects) -> dp.invoke(proxy, method, objects)); return (AppConfig) e.create(); } }
[ "avramovic.slavisa@partake.de" ]
avramovic.slavisa@partake.de
e1591640c2cbcdc429e5979d6997b4cbe10fe0a1
5288d97cbe0b708ef00b20308d36efb291b0ba3d
/SentimentAnalysis/src/com/sa/servlet/UserServlet.java
e35b55e671dbe1444fafdf39e4c59eb71f8a4d4b
[]
no_license
shanthakumarimv/SparkSentimentAnalysis
0c8d2414b7b48a1e32bc99931b3c718dec5a518a
9511dd5124e6e42aebf8c6fa87181927ce0ec8fb
refs/heads/master
2022-12-31T01:47:21.063318
2020-08-24T13:30:31
2020-08-24T13:30:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,077
java
package com.sa.servlet; import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.sa.dao.UserDAO; import com.sa.daoimpl.UserDAOImpl; import com.sa.model.User; public class UserServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { UserDAO dao = new UserDAOImpl(); try { String request_type = req.getParameter("request_type"); if (request_type.equals("register")) { User user = new User(); String addr = req.getParameter("addr"); user.setAddr(addr); String email = req.getParameter("email"); user.setEmail(email); String fname = req.getParameter("fname"); user.setFname(fname); String lname = req.getParameter("lname"); user.setLname(lname); String gender = req.getParameter("gender"); user.setGender(gender); String mobile = req.getParameter("mobile"); user.setMobile(mobile); String password = req.getParameter("password"); user.setPassword(password); String role = req.getParameter("role"); if (role == null || role.trim().length() == 0) role = "USER"; user.setRole(role); if ((addr == null || addr.trim().length() == 0) || (email == null || email.trim().length() == 0) || (fname == null || fname.trim().length() == 0) || (lname == null || lname.trim().length() == 0) || (mobile == null || mobile.trim().length() == 0) || (role == null || role.trim().length() == 0) || (gender == null || gender.trim().length() == 0) || (password == null || password.trim().length() == 0)) { resp.sendRedirect( "register.jsp?msg=Error! All the fields are mandatory. Please provide the details."); } else { dao.register(user); resp.sendRedirect("register.jsp?msg=Registration Successful"); } } else if (request_type.equals("login")) { String email = req.getParameter("email"); String password = req.getParameter("password"); User user = dao.getUserDetails(email, password); if (email == null || email.trim().length() == 0 || password == null || password.trim().length() == 0) { resp.sendRedirect("login.jsp?msg=Error! All the fields are mandatory. Please provide the details"); } else if (user != null) { req.getSession().setAttribute("user", user); resp.sendRedirect("welcome.jsp?msg=Successfully logged in as " + user.getFname() + " " + user.getLname() + " (" + user.getRole() + ") "); } else { resp.sendRedirect("login.jsp?msg=Invalid Credentials"); } } else if (request_type.equals("updateprofile")) { User user = new User(); String addr = req.getParameter("addr"); String email = req.getParameter("email"); String fname = req.getParameter("fname"); String lname = req.getParameter("lname"); String gender = req.getParameter("gender"); String mobile = req.getParameter("mobile"); String role = req.getParameter("role"); if (role == null || role.trim().length() == 0) role = "USER"; user.setAddr(addr); user.setEmail(email); user.setFname(fname); user.setLname(lname); user.setGender(gender); user.setMobile(mobile); user.setRole(role); if ((addr == null || addr.trim().length() == 0) || (email == null || email.trim().length() == 0) || (fname == null || fname.trim().length() == 0) || (lname == null || lname.trim().length() == 0) || (mobile == null || mobile.trim().length() == 0) || (role == null || role.trim().length() == 0) || (gender == null || gender.trim().length() == 0)) { resp.sendRedirect( "updateprofile.jsp?msg=Error! All the fields are mandatory. Please provide the details"); } else { dao.updateProfile(user); req.getSession().removeAttribute("user"); req.getSession().setAttribute("user", user); resp.sendRedirect("updateprofile.jsp?msg=Profile Updated Successfully"); } } else if (request_type.equals("changepassword")) { String oldpassword = req.getParameter("oldpassword"); String newpassword = req.getParameter("newpassword"); if (oldpassword == null || oldpassword.trim().length() == 0 || newpassword == null || newpassword.trim().length() == 0) { resp.sendRedirect( "changepassword.jsp?msg=Error! All the fields are mandatory. Please provide the details"); } else { boolean result = dao.changePassword(((User) req.getSession().getAttribute("user")).getEmail(), oldpassword, newpassword); if (result) { resp.sendRedirect("changepassword.jsp?msg=Successfully Updated Your Password"); } else { resp.sendRedirect("changepassword.jsp?msg=Your Current Password is Wrong"); } } } else if (request_type.equals("deleteprofile")) { dao.deleteProfile(((User) req.getSession().getAttribute("user")).getEmail()); req.getSession().invalidate(); resp.sendRedirect("login.jsp?msg=Profile Deleted Successfully"); } else if (request_type.equals("logout")) { req.getSession().invalidate(); resp.sendRedirect("login.jsp?msg=Successfully Logged Out"); } else if (request_type.equals("adminlogout")) { req.getSession().invalidate(); resp.sendRedirect("adminlogin.jsp?msg=Successfully Logged Out"); } else if (request_type.equals("adminlogin")) { Map<String, String> admins = new HashMap<String, String>(); admins.put("admin@admin.com", "admin"); String email = req.getParameter("email"); String password = req.getParameter("password"); if (admins.containsKey(email)) { if (admins.get(email).equals(password)) { req.getSession().setAttribute("adminemail", email); resp.sendRedirect("adminwelcome.jsp?msg=Welcome " + email); } else { resp.sendRedirect("adminlogin.jsp?msg=Login Error"); } } else { resp.sendRedirect("adminlogin.jsp?msg=Login Error"); } } } catch (Exception e) { e.printStackTrace(); resp.sendRedirect("error.jsp?msg=OOPS! Something went wrong"); } } @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doGet(req, resp); } }
[ "ashokkumar24799@gmail.com" ]
ashokkumar24799@gmail.com
56da50f21bfee459f7b501271b87294a72a99e3d
c0ddb018492b892c5c4d136d13f08e0f659e9e85
/app/src/main/java/com/example/themoon/entity/MeteorParam.java
478a245b4f829f114acacbf676976b3e4dcbd0b4
[]
no_license
cuiwenju2017/TheMoon
f30f9e1d6ceac6154f8a5f6660e7ae560d6795cd
eca7b121864d577db6562c9c19997643d2db2eb0
refs/heads/master
2023-08-05T05:51:02.864302
2021-09-17T10:45:47
2021-09-17T10:45:47
407,047,383
1
0
null
null
null
null
UTF-8
Java
false
false
1,031
java
package com.example.themoon.entity; import android.content.Context; import com.example.themoon.utils.Unit; public class MeteorParam { public double translateX; public double translateY; public double radians; public int width, height; public double widthRatio; /** * 初始化数据 * @param width * @param height * @param widthRatio */ public void init(int width, int height, double widthRatio) { this.width = width; this.height = height; this.widthRatio = widthRatio; reset(); } /** * 重置数据 */ public void reset() { translateX = width + Math.random() * 20.0 * width; radians = - (Math.random() * 5 - 0.05); translateY = Math.random() * 0.5 * height * widthRatio; } /** * 移动 */ public void move(Context context) { translateX -= Unit.dip2px(context,30); if (translateX <= -1.0 * width / widthRatio) { reset(); } } }
[ "1755140651@qq.com" ]
1755140651@qq.com
76e0f2b8a6746a5004af7734bf8e704ed2ee76ec
799ac62876d05cf3f6680d2e992eaee26b3111ef
/src/pathfinder/gui/mainapp/UpdateRouteController.java
2683f8f20b3678b0e199cf4319f4b280da331dca
[]
no_license
Essux/PathFinder
5d0a077426591b255ce9c318e9d14bb2efe347c0
6776b26c64e570379f56ea79cfaf28290544f315
refs/heads/master
2021-01-20T03:16:56.454857
2017-04-30T23:20:58
2017-04-30T23:20:58
89,517,120
0
0
null
null
null
null
UTF-8
Java
false
false
587
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 pathfinder.gui.mainapp; import java.net.URL; import java.util.ResourceBundle; import javafx.fxml.Initializable; /** * FXML Controller class * * @author JuanJose */ public class UpdateRouteController implements Initializable { /** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { // TODO } }
[ "jjsuarestra99@gmail.com" ]
jjsuarestra99@gmail.com
73dbc9f711541b51cafdd6c451af7f77b3d5c2e8
ccf3b9914a04e121a323de4050dc8a1c450bf21b
/20_JAVA_Training_Practice/20_JAVA_Multi_Threading/Concurrent/L_27_task_2710/MailServer.java
5b666a8e14ce3b1e096d8261ef6f37b6a1a76173
[]
no_license
PetrBelmst/JavaRush_Course_Rep
81333e65963bb69ee2f032acbaab025580cc5bde
39e6fb64f8d5fc9b5284c8477b70cd1c62a769d5
refs/heads/master
2021-05-23T14:20:51.674509
2020-05-05T05:45:25
2020-05-05T05:45:25
253,335,289
1
0
null
null
null
null
UTF-8
Java
false
false
803
java
package com.company; public class MailServer implements Runnable { private Mail mail; public MailServer(Mail mail) { this.mail = mail; } @Override public void run() { long startTime = System.currentTimeMillis(); //сделайте что-то тут - do something here synchronized (mail) { try { while (mail.getText() == null) { mail.wait(); } } catch (InterruptedException e) {} String name = Thread.currentThread().getName(); long endTime = System.currentTimeMillis(); System.out.format("%s MailServer received: [%s] in %d ms after start", name, mail.getText(), (endTime - startTime)); } } }
[ "PetrBelmst@users.noreply.github.com" ]
PetrBelmst@users.noreply.github.com
a4c66459065daa1c5f1a2575055b1c69212d82ac
f26dd2bfb3e4853b677e4c3142de95f400f1653b
/Framework/src/test/java/com/flipkart/testing/tests/FlipkartScenario1Test.java
58e0295f4639915e980c5d4b0bf2137ad5b38f96
[]
no_license
KritikaSahare/SeleniumAssignment
cb8695a42641ddedddfe5e02887db85678200443
af11b71fa0f993f9618a793fcae177ad4398a197
refs/heads/master
2023-01-05T01:22:45.104764
2020-11-02T09:55:13
2020-11-02T09:55:13
309,319,284
0
0
null
null
null
null
UTF-8
Java
false
false
2,818
java
package com.flipkart.testing.tests; import org.openqa.selenium.By; import org.testng.annotations.BeforeClass; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import com.flipkart.framework.browser.BrowserAction; import com.flipkart.framework.browser.BrowserWait; import com.flipkart.framework.logger.ScriptLogger; import com.flipkart.framework.objects.Documentation; import com.flipkart.framework.objects.exceptions.ApplicationException; import com.flipkart.framework.objects.helpers.LoadObjectMaps; import com.flipkart.framework.selenium.WebDriverAction; import com.flipkart.testing.objectmaps.FlipkartHomePageObjectMap; import com.flipkart.testing.objectmaps.MobileListingPageObjectMap; import com.flipkart.testing.pages.FlipkartHomePage; import com.flipkart.testing.pages.MobileListingPage; public class FlipkartScenario1Test { @BeforeClass(alwaysRun=true) @Documentation(step = "Load object maps", expected = "Object map configuration should be loaded") public static void loadObjectMaps(){ ScriptLogger.info(); LoadObjectMaps.loadObjects(); } @Test @Documentation(step="Click the cross button of login modal", expected="Able to click") public static void clickLoginModalCrossButtonTest() throws Exception { FlipkartHomePage.clickLoginModalCrossButton(); } @Test(dependsOnMethods = "clickLoginModalCrossButtonTest", priority = 1) @Documentation(step="hover on Electronics", expected="Able to hover") public static void hoverOnElectronicsLinkTest() throws Exception{ FlipkartHomePage.hoverOnElectronicsLink(); Thread.sleep(3000); } @Test(dependsOnMethods = "hoverOnElectronicsLinkTest", priority = 1) @Parameters("mobileBrand") @Documentation(step="Click Mobile phone brand button", expected="Able to click") public static void clickMobilePhoneBrandTest(String mobileBrand) throws Exception{ FlipkartHomePage.clickMobilePhoneBrand(mobileBrand); } @Test(dependsOnMethods = "clickMobilePhoneBrandTest", priority = 1) public static void waitForPageToBeLoadedTest() throws Exception { BrowserWait.waitForPageToBeLoaded(); BrowserAction.refresh(); } @Test(dependsOnMethods = "waitForPageToBeLoadedTest", priority = 1) @Documentation(step="Click Sort By Low to High Tab",expected ="Able to click") public static void clickSortByLowToHighTest() throws Exception { MobileListingPage.clickSortByLowToHigh(); BrowserWait.waitForPageToBeLoaded(); } @Test(dependsOnMethods = "clickSortByLowToHighTest", priority = 1) @Documentation(step="Verify prices are sorted in low to high",expected ="Prices should be sorted") public static void verifySortLowToHighOfNProducts() throws ApplicationException { MobileListingPage.verifySortLowToHighOfNProducts(3); } }
[ "saharekritika@gmail.com" ]
saharekritika@gmail.com
3bcbf0e4acd7d6ce4b1c4fbb7997d2f49484d0a0
2a7e413a4ad79443f55b1806f53ed96b846ab2b2
/GeoProblemSolving-back/src/main/java/cn/edu/njnu/geoproblemsolving/comparison/bean/TaskOutputItem.java
864321d46fbb7e0bbe0b0e65f006bc6229b9c74a
[]
no_license
SuilandCoder/GeoProblemSolving_CMIP
62cfebea4c29ba8f0e8f87e9f5485da33756d93a
9ed5ed60aebe6d871f44aa832a2d6907cce97739
refs/heads/master
2022-12-13T14:57:16.425669
2020-04-19T06:50:16
2020-04-19T06:50:16
211,809,738
0
0
null
2022-12-10T06:30:15
2019-09-30T08:13:58
JavaScript
UTF-8
Java
false
false
500
java
package cn.edu.njnu.geoproblemsolving.comparison.bean; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.data.mongodb.core.mapping.Document; /** * @Author: SongJie * @Description: * @Date: Created in 10:51 2019/10/14 * @Modified By: **/ @Data @NoArgsConstructor @AllArgsConstructor @Document public class TaskOutputItem extends DataItem { String fileName; String suffix; String downloadUrl; String dataStoreId; }
[ "jie77474966@qq.com" ]
jie77474966@qq.com
dbab22e448cc69172980c7f738347a93ec9bb511
9dde01e31f83475cf364d4ed11a45326c2e69ef9
/src/main/java/generics/company/employees/ITSpecialist.java
211a7467b4adfc13fb3ea362457ccedcd7c900cb
[]
no_license
BobrMsuu/JavaTraining
f618653efa2943ec54162dd56450e9264d71ae1f
232aedb34ea4a37f564ccf784f29ad17e7c57e7f
refs/heads/master
2022-12-06T21:19:11.850277
2020-08-27T15:20:12
2020-08-27T15:20:12
276,171,679
0
0
null
null
null
null
UTF-8
Java
false
false
172
java
package generics.company.employees; public class ITSpecialist extends Employee { public ITSpecialist(String name, Float salary) { super(name, salary); } }
[ "nurkyz.dzh@gmail.com" ]
nurkyz.dzh@gmail.com
1a3a8c18638a63a81e9a587013bab52f85c97ffb
d62b103a0e904173ba7eb61323add5b81b0f1b8e
/src/main/java/cn/greenflash/soft/config/DatabaseConfiguration.java
6f493c2c99350727ea786ca504195e1ecc91ba60
[]
no_license
xxqj/jhipster-sample-application
701202904da9e188d63c1d5aa361562664580aa4
0bdc6a6c9e30b97939544536851b5f6f4fb0cde5
refs/heads/master
2022-12-21T20:09:08.944950
2019-12-23T08:19:43
2019-12-23T08:19:43
229,708,310
0
0
null
2022-12-16T04:43:01
2019-12-23T08:19:26
Java
UTF-8
Java
false
false
952
java
package cn.greenflash.soft.config; import io.github.jhipster.config.JHipsterConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.transaction.annotation.EnableTransactionManagement; @Configuration @EnableJpaRepositories("cn.greenflash.soft.repository") @EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") @EnableTransactionManagement @EnableElasticsearchRepositories("cn.greenflash.soft.repository.search") public class DatabaseConfiguration { private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class); }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
7e8c174144bce8e972bcb224e0f1098a144d2900
4cd6545e2a8014ecf5d9f8c4527633bbc8ad2fb0
/src/main/java/com/cg/oam/service/MedicineServiceImpl.java
f38cdd68b25bd0624b6cb7783ff7afa25aa6d0b3
[]
no_license
swarnag44/ONLINEAYURVEDICMEDICINEAPPFINAL
e1c64da88f5cd741c424e2c4c5cfbccb2f7ad50c
ae1eb597df30a293158ce55d0996fea8a8f1f9c9
refs/heads/master
2023-03-30T15:51:13.307503
2021-03-30T15:19:58
2021-03-30T15:19:58
353,047,031
0
0
null
null
null
null
UTF-8
Java
false
false
2,792
java
package com.cg.oam.service; import java.util.List; import java.util.stream.Collectors; import javax.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.cg.oam.entity.Medicine; import com.cg.oam.exception.CustomerNotFoundException; import com.cg.oam.exception.MedicineNotFoundException; import com.cg.oam.model.MedicineModel; import com.cg.oam.repository.MedicineRepository; @Service public class MedicineServiceImpl implements IMedicineService{ @Autowired private MedicineRepository medRepo; @Autowired private EMParser parser; public MedicineServiceImpl() { } public MedicineServiceImpl(MedicineRepository repo) { super(); this.medRepo = repo; this.parser=new EMParser(); } /** * @return the parser */ public EMParser getParser() { return parser; } /** * @param parser the parser to set */ public void setParser(EMParser parser) { this.parser = parser; } @Transactional @Override public MedicineModel add(MedicineModel medicineModel) throws MedicineNotFoundException { if (medicineModel != null) { if (medRepo.existsById(medicineModel.getMedicineId())) { throw new MedicineNotFoundException("Medicine with Id " + medicineModel.getMedicineId() + " is exist already"); }else { Medicine medicine = parser.parse(medicineModel); System.out.println("medicine -==============>"+ medicine); medicineModel = parser.parse(medRepo.save(parser.parse(medicineModel))); } } return medicineModel; } @Transactional @Override public MedicineModel save(MedicineModel medicineModel) throws MedicineNotFoundException { return medicineModel = parser.parse(medRepo.save(parser.parse(medicineModel))); } @Override public void deleteById(String medicineId) { medRepo.deleteById(medicineId); } @Override public MedicineModel findById(String medicineId) throws MedicineNotFoundException { if (!medRepo.existsById(medicineId)) throw new MedicineNotFoundException("No Medicine found for the given id"); return parser.parse(medRepo.findById(medicineId).get()); } @Override public List<MedicineModel> findAll() { return medRepo.findAll().stream().map(parser::parse).collect(Collectors.toList()); } @Transactional @Override public MedicineModel modify(MedicineModel medicineModel, String medicineId) throws MedicineNotFoundException { if(medicineModel != null) { if(!medRepo.existsById(medicineId)) { throw new MedicineNotFoundException("no such id"); } medicineModel = parser.parse(medRepo.save(parser.parse(medicineModel))); } return medicineModel; } @Override public boolean existsById(String medicineId) { return medRepo.existsById(medicineId); } }
[ "swarnarekhagangabathina@gmail.com" ]
swarnarekhagangabathina@gmail.com
96d15e3f62854bd580a464406e5870fc314e681e
abc16b21fd2d8f098053649727d4d1b04acc54a3
/app/src/main/java/org/electricuniverse/lab_6/MainActivity.java
e7d38e48d46f4d34fa490fa696dcee59b1cf64e2
[]
no_license
ricardo-alonzo-ugalde-EE/Lab_6
f118b9ca26d69c86bc348e18185adc67d3a61c59
ff689b52c12f971daa70b09b5217f62957aee356
refs/heads/master
2023-01-12T19:17:20.625877
2020-11-16T18:20:15
2020-11-16T18:20:15
313,083,682
0
0
null
null
null
null
UTF-8
Java
false
false
2,678
java
package org.electricuniverse.lab_6; import androidx.annotation.RequiresApi; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.Toast; import com.google.android.material.floatingactionbutton.FloatingActionButton; public class MainActivity extends AppCompatActivity { private RecyclerView mRecyclerView; private RecyclerView.LayoutManager mLayoutManager; private MyDBHelper dbHelper; private MyRecyclerAdapter adapter; private String filter = ""; @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override protected void onCreate(Bundle savedInstanceState) { Log.d("TAG", " OnCreate"); super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Window window = MainActivity.this.getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); window.setStatusBarColor(ContextCompat.getColor(MainActivity.this, R.color.colorAccent)); mRecyclerView = (RecyclerView)findViewById(R.id.mainRecyclerView); mLayoutManager = new LinearLayoutManager(this); mLayoutManager.scrollToPosition(0); mRecyclerView.setLayoutManager(mLayoutManager); populateRecyclerView(filter); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(MainActivity.this, "clicked cig", Toast.LENGTH_SHORT).show(); goToAddUserActivity(); } }); } private void populateRecyclerView(String filter) { dbHelper = new MyDBHelper(this); adapter = new MyRecyclerAdapter(dbHelper.contactList(filter), this, mRecyclerView); mRecyclerView.setAdapter(adapter); } @Override protected void onResume() { super.onResume(); adapter.updateList(dbHelper.contactList(filter)); Log.d("TAG", "Resume"); } private void goToAddUserActivity() { Intent intent = new Intent (MainActivity.this, AddNewContact.class); startActivity(intent); } }
[ "34896374+ricardo-alonzo-ugalde-EE@users.noreply.github.com" ]
34896374+ricardo-alonzo-ugalde-EE@users.noreply.github.com
f7241beaeb179e4fb3267ec47f252c6405a2fb83
6772605e667fd9631691b77fb4bc2ebb87b2a17c
/untitled folder/src/headfirstdp/chapter3/LowerCaseInputStream.java
212a15a5475f62218b85ea50c95cd68e7c93871d
[]
no_license
scorpionrao/html5
56c2ef9e1a70ba6c1410cfeb1b1ca763b5c7bd2c
a09e00b72671a3176949127344cde56b785931ca
refs/heads/master
2021-01-16T20:34:07.016497
2014-10-11T18:01:27
2014-10-11T18:01:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
611
java
package headfirstdp.chapter3; import java.io.FilterInputStream; import java.io.InputStream; import java.io.IOException; public class LowerCaseInputStream extends FilterInputStream { public LowerCaseInputStream(InputStream in) { super(in); } public int read() throws IOException { int c = super.read(); return (c == -1 ? c : Character.toLowerCase((char)c)); } public int read(byte[] b, int offset, int len) throws IOException { int result = super.read(b, offset, len); for(int i=offset; i<offset+result; i++) { b[i] = (byte) Character.toLowerCase((char)b[i]); } return result; } }
[ "rgonugunta@clearslide.com" ]
rgonugunta@clearslide.com
530882f6a528e537c3314ec7ec6dbfde011d5760
ca4a070f1a09d681a89a7ef0ab13e753e66746c0
/backend/src/main/java/com/udacity/gradle/builditbigger/backend/Joke.java
03c424da01c09e43b44ce694bfe8ed7b4deb2bab
[]
no_license
ahmetturk/Build-It-Bigger
9dae832674d2c394db6ba9c09708de17980966fa
cb4fbae2b5c6c550e05dc76d6d93b098a0e62141
refs/heads/master
2020-03-20T04:34:00.771842
2018-06-18T17:53:13
2018-06-18T17:53:13
137,187,229
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package com.udacity.gradle.builditbigger.backend; /** * The object model for the data we are sending through endpoints */ public class Joke { private String text; public String getText() { return text; } public void setText(String string) { text = string; } }
[ "ahmet.turk@commencis.com" ]
ahmet.turk@commencis.com
e6d1aa14eb4e09fe1250524ddeed29b76360917a
4302d742f984608d28f08435eead409815aa34ef
/src/main/java/com/wwc/ypt/redis/RedisLock.java
0f97b1a19d789c9f286d2bc68fc11ccbe15f44dc
[]
no_license
wangwencheng/ypt
1812e3040b14e82eb4b7ad9c8b4564a9097c42a5
e3dc4f80e653b08c38afab60d787b81618cb4d56
refs/heads/master
2020-04-13T01:28:41.750574
2019-01-20T14:48:22
2019-01-20T14:48:22
160,999,096
0
0
null
null
null
null
UTF-8
Java
false
false
2,035
java
package com.wwc.ypt.redis; import redis.clients.jedis.Jedis; import java.time.Duration; import java.util.function.Supplier; /** * 通过Lock("参数key")获取一个redis实现的分布式lock对象 * 通过lock方法 获取锁,如果true 则获取成功 false 失败,入参为过期时间 * eg * try (RLock lock = redisAccess.getLock("key")) { 通过try catch resource方式 关闭资源 等同于最后调用 close方法 * if (lock.lock(111, TimeUnit.SECONDS)) { * 获取锁成功执行代码处 * } * } * unlock释放锁 * lockWithAction 为拓展函数 用于支持 通过lambada表达式 实现如果获取锁成功则执行第三参数逻辑且返回结果 * <p> * eg * RLockResponse<String> stringRLockResponse = lock.lockWithAction(10, TimeUnit.SECONDS, this::ifLockGoAction); * * 需要手动调用close关闭资源 建议使用try catch resource方式 * <p> * Created by Nick Guo on 2017/9/29. */ public final class RedisLock implements XLock { private final String key; private final Jedis jedis; RedisLock(String key, Jedis jedis) { this.key = key; this.jedis = jedis; } @Override public void close() { jedis.close(); } @Override public boolean lock(Duration lockTime) { return "OK".equals(jedis.set(key, "1", "NX", "PX", lockTime.toMillis())); } public <T> XLockResponse<T> lockAndThen(Duration lockTime, Supplier<T> supplier) { return this.lockAndThen(lockTime, false, supplier); } @Override public <T> XLockResponse<T> lockAndThen(Duration lockTime, boolean isRelease, Supplier<T> supplier) { boolean lock = lock(lockTime); try { if (lock) { return new XLockResponse<>(true, supplier.get()); } else { return new XLockResponse<>(false); } } finally { if (isRelease && lock) unlock(); } } @Override public void unlock() { jedis.del(key); } }
[ "273273wang" ]
273273wang
5a771d1e63f481bc66b87ce8ce27a26c86028962
7793aa694b1a068d358528ac6f7b51edfdaeb043
/src/main/java/com/sa/G8/Grupo01/Reto3/entity/Game.java
c973a34c7b100f47c462905279a53a74f078e8d2
[]
no_license
Marcelafuertes/Reto3
f828a6d2809dde9a0e580cfd387cfcc091946f88
f72b818a44c74ff838a9ae66f850afba89aa0b7a
refs/heads/master
2023-08-21T01:03:19.545993
2021-10-17T18:48:11
2021-10-17T18:48:11
418,200,495
0
0
null
null
null
null
UTF-8
Java
false
false
2,185
java
package com.sa.G8.Grupo01.Reto3.entity; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * * @author Novosix */ /** * anotaciones para determinar a game como entidad */ @Data @AllArgsConstructor @NoArgsConstructor @Entity /** * crea la tabla game */ @Table(name="game") /** * crea la clase game */ public class Game { /** * determina el id y el tipo de generacion del mismo */ @Id @GeneratedValue (strategy = GenerationType.IDENTITY) /** * atribudo id que es la llave primaria */ private int id; /** * atribudo nombre del juego */ private String name; /** * quien desarrolo el juego */ private String developer; /** * en que año se creo */ private int year; /** * descripcion del juego */ private String description; /** * anotaciones para hacer la relacion de mucho a uno con categoria */ @ManyToOne @JoinColumn(name = "Category_id") @JsonIgnoreProperties("games") /** * el atributo que muestra de categoria */ private Category category; /** * anotaciones para hacer la relacion uno a muchos con mensajes */ @OneToMany(cascade = {CascadeType.PERSIST},mappedBy="game",orphanRemoval = true) @JsonIgnoreProperties({"game","client"}) /** * la lista de mensajes que se muestra */ private List<Message> messages; /** * anotaciones para hacer la relacion uno a muchos con reservaciones */ @OneToMany(cascade = {CascadeType.PERSIST},mappedBy="game",orphanRemoval = true) @JsonIgnoreProperties({"game"}) /** * la lista de reservaciones que muestra */ private List<Reservation> reservations; }
[ "marcela.fuertes.mt@correo.usa.edu.co" ]
marcela.fuertes.mt@correo.usa.edu.co
d8b514a29c4f97089f273dd1a51d6798ebb4e21a
3568c9772fad54ffe71683de31525464642f3cf9
/office2/src/main/java/eu/doppel_helix/jna/tlb/office2/MsoCalloutType.java
58fbda67538c5906b95d76ddad049c169bd6b175
[ "MIT" ]
permissive
NoonRightsWarriorBehindHovering/COMTypelibraries
c853c41bb495031702d0ad7a4d215ab894c12bbd
c17acfca689305c0e23d4ff9d8ee437e0ee3d437
refs/heads/master
2023-06-21T20:52:51.519721
2020-03-13T22:33:48
2020-03-13T22:33:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
package eu.doppel_helix.jna.tlb.office2; import com.sun.jna.platform.win32.COM.util.IComEnum; public enum MsoCalloutType implements IComEnum { /** * (-2) */ msoCalloutMixed(-2), /** * (1) */ msoCalloutOne(1), /** * (2) */ msoCalloutTwo(2), /** * (3) */ msoCalloutThree(3), /** * (4) */ msoCalloutFour(4), ; private MsoCalloutType(long value) { this.value = value; } private long value; public long getValue() { return this.value; } }
[ "mblaesing@doppel-helix.eu" ]
mblaesing@doppel-helix.eu
30c1104187ecc54ddb9862f6e5048a40e730338a
47580f306d7ad0b0b847842eec0df9e8079ee04b
/spring-security-hibernate/src/main/java/com/websystique/springsecurity/controller/HelloWorldController.java
ad2d89f38ee3f5f19e81d68f445364a9feb2af8a
[]
no_license
hhugohm/repo1
7e51f063c7211bf24e489ba5906e9c5a38cc7413
b72b243ef07dea548535102202cd285bc4259e6a
refs/heads/master
2021-01-17T22:30:41.003096
2015-11-12T17:47:24
2015-11-12T17:47:24
41,923,730
0
0
null
2015-09-04T15:37:02
2015-09-04T15:37:02
null
UTF-8
Java
false
false
2,311
java
package com.websystique.springsecurity.controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller public class HelloWorldController { @RequestMapping(value = { "/", "/home" }, method = RequestMethod.GET) public String homePage(ModelMap model) { model.addAttribute("greeting", "Hi, Welcome to mysite"); return "welcome"; } @RequestMapping(value = "/admin", method = RequestMethod.GET) public String adminPage(ModelMap model) { model.addAttribute("user", getPrincipal()); return "admin"; } @RequestMapping(value = "/db", method = RequestMethod.GET) public String dbaPage(ModelMap model) { model.addAttribute("user", getPrincipal()); return "dba"; } @RequestMapping(value = "/Access_Denied", method = RequestMethod.GET) public String accessDeniedPage(ModelMap model) { model.addAttribute("user", getPrincipal()); return "accessDenied"; } @RequestMapping(value = "/login", method = RequestMethod.GET) public String loginPage() { return "login"; } @RequestMapping(value="/logout", method = RequestMethod.GET) public String logoutPage (HttpServletRequest request, HttpServletResponse response) { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (auth != null){ new SecurityContextLogoutHandler().logout(request, response, auth); } return "redirect:/login?logout"; } private String getPrincipal(){ String userName = null; Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); if (principal instanceof UserDetails) { userName = ((UserDetails)principal).getUsername(); } else { userName = principal.toString(); } return userName; } }
[ "hector.hidalgo@MX-IT00790.globant.com" ]
hector.hidalgo@MX-IT00790.globant.com
4ead9c0acf26dc90539f0ab59dca199b5e853f17
06c50712dda56367b97026fcd31eb6381621faf5
/java-collection/src/main/java/cn/lee/jason/lang/string/buffer/StringBufferTest.java
a7a43be36aeeae1dda21593eb4920a38da194ce8
[]
no_license
jasonlee529/spring-examples
fe82991e80f11698d7a5b18094552388f73d5514
45bec496a78f39fffe0693ccb3ffe87c92c66d73
refs/heads/master
2021-01-13T05:25:41.856781
2017-06-20T09:59:30
2017-06-20T09:59:30
81,434,082
0
2
null
null
null
null
UTF-8
Java
false
false
438
java
package cn.lee.jason.lang.string.buffer; /** * Created by jason on 17/5/15. */ public class StringBufferTest { public static void main(String[] args) { StringBuffer a = new StringBuffer("A"); StringBuffer b = new StringBuffer("B"); operator(a, b); System.out.println(a + "," + b); } public static void operator(StringBuffer x, StringBuffer y) { x.append(y); y = x; } }
[ "libo529@gmail.com" ]
libo529@gmail.com
75e411b36e173a3235179e9b31398e296239648f
3111fe334686c5c7fe08dca708827a6b50f88328
/app/src/main/java/com/invicibledevs/elixir/MainActivity.java
7ae1a6a592981da610830af883aa434e2d20a05d
[]
no_license
Sathriyansiva/Elixir2
26081fe0e15baf9335189eff67386463fd5e9633
5d2487965cc7064774a96dba2af565c0b3ffbe76
refs/heads/master
2021-01-12T03:58:28.891318
2016-12-27T09:45:02
2016-12-27T09:45:02
77,444,512
0
0
null
null
null
null
UTF-8
Java
false
false
14,467
java
package com.invicibledevs.elixir; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.text.Html; import android.view.KeyEvent; import android.view.View; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; import com.invicibledevs.elixir.dao.ServiceReceiptDataSource; import com.invicibledevs.elixir.dao.UserDataSource; import com.invicibledevs.elixir.helper.APIHelpers; import com.invicibledevs.elixir.helper.LocationService; import com.invicibledevs.elixir.model.ServiceReceipt; import com.invicibledevs.elixir.model.User; import java.util.ArrayList; public class MainActivity extends AppCompatActivity implements Runnable{ private TextView marqueeGNews, marqueePNews, welcomeMsgTextView, locationMsgTextView, versionLabel, marqueeDetails ,feedback; private UserDataSource theUserDataSource; private LocationManager mLocationManager; private Location currentLocation; private LinearLayout msgLinearLayout, regularUserDashboardLayout, agentDashBoardLayout; private RelativeLayout reportDashboardLayout; ServiceReceiptDataSource theServiceReceiptDataSource; private User aUser; private APIHelpers apiHelper; private ProgressDialog progressDialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); welcomeMsgTextView = (TextView) findViewById(R.id.welcome_msg); marqueeGNews = (TextView)findViewById(R.id.marquee_g_news); marqueeGNews.setSelected(true); marqueePNews = (TextView)findViewById(R.id.marquee_p_news); marqueePNews.setSelected(true); marqueeDetails = (TextView)findViewById(R.id.marquee_details); marqueeDetails.setSelected(true); locationMsgTextView = (TextView)findViewById(R.id.location); versionLabel = (TextView)findViewById(R.id.versionLabel); msgLinearLayout = (LinearLayout) findViewById(R.id.msgLayout); regularUserDashboardLayout = (LinearLayout) findViewById(R.id.regularUserDashboardLayout); reportDashboardLayout = (RelativeLayout) findViewById(R.id.reportUserDashboardLayout); agentDashBoardLayout = (LinearLayout) findViewById(R.id.agentUserDashboardLayout); if(theUserDataSource == null) theUserDataSource = new UserDataSource(getApplicationContext()); SharedPreferences elixirPreferences = getApplicationContext().getSharedPreferences("ELIXIRPreferences", getApplicationContext().MODE_PRIVATE); String roleName = elixirPreferences.getString("rolename", ""); if(roleName.equalsIgnoreCase("Bc Collector")) { msgLinearLayout.setVisibility(View.GONE); regularUserDashboardLayout.setVisibility(View.GONE); locationMsgTextView.setVisibility(View.GONE); reportDashboardLayout.setVisibility(View.VISIBLE); agentDashBoardLayout.setVisibility(View.GONE); } else if(roleName.equalsIgnoreCase("Agent")) { msgLinearLayout.setVisibility(View.VISIBLE); regularUserDashboardLayout.setVisibility(View.GONE); locationMsgTextView.setVisibility(View.GONE); reportDashboardLayout.setVisibility(View.GONE); agentDashBoardLayout.setVisibility(View.VISIBLE); } else { msgLinearLayout.setVisibility(View.VISIBLE); regularUserDashboardLayout.setVisibility(View.VISIBLE); locationMsgTextView.setVisibility(View.VISIBLE); reportDashboardLayout.setVisibility(View.GONE); agentDashBoardLayout.setVisibility(View.GONE); } aUser = theUserDataSource.getUserByUserId(elixirPreferences.getString("loggedInUserId","")); welcomeMsgTextView.setText("Welcome " + aUser.getExecutiveName() + "!!!"); locationMsgTextView.setText( elixirPreferences.getString("areaName","")); marqueeGNews.setText(aUser.getGeneralNews()); marqueePNews.setText(aUser.getPersonalNews()); marqueeDetails.setText(aUser.getDetails()); PackageInfo pinfo; try { pinfo = getPackageManager().getPackageInfo(getPackageName(), 0); versionLabel.setText("V"+pinfo.versionName); } catch (PackageManager.NameNotFoundException e) { versionLabel.setText(""); } } public void showAttendanceView(View view) { if(theServiceReceiptDataSource == null) theServiceReceiptDataSource = new ServiceReceiptDataSource(getApplicationContext()); ArrayList<ServiceReceipt> theServiceReceipts = theServiceReceiptDataSource.getAllServiceReceipts(); if(theServiceReceipts.size()>20) { AlertDialog.Builder alt_bld = new AlertDialog.Builder(MainActivity.this); alt_bld.setMessage("You have saved more than 80 Service Receipt images locally. Please Sync those images first and then do attendance.") .setCancelable(true); AlertDialog alert = alt_bld.create(); alert.setButton(-1,"OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alert.setTitle("Error"); alert.show(); return; } LocationService aLocationService = LocationService.getLocationManager(getApplicationContext()); aLocationService.initLocationService(getApplicationContext()); Location currentLocation = aLocationService.location; float[] results = new float[1]; if(currentLocation == null) { AlertDialog.Builder alt_bld = new AlertDialog.Builder(MainActivity.this); alt_bld.setMessage("Please enable GPS service in settings to do attendance") .setCancelable(true); AlertDialog alert = alt_bld.create(); alert.setButton(-1,"OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alert.setTitle("Error"); alert.show(); return; } else if(aUser.getLatitude() == null || aUser.getLongitude() == null || aUser.getLatitude().length() == 0 || aUser.getLongitude().length() == 0) { AlertDialog.Builder alt_bld = new AlertDialog.Builder(MainActivity.this); alt_bld.setMessage("Please contact admin since your're not mapped to location.") .setCancelable(true); AlertDialog alert = alt_bld.create(); alert.setButton(-1,"OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alert.setTitle("Error"); alert.show(); return; } Location.distanceBetween(Double.parseDouble(aUser.getLatitude()), Double.parseDouble(aUser.getLongitude()), currentLocation.getLatitude(), currentLocation.getLongitude(), results); // Location.distanceBetween(Double.parseDouble(aUser.getLatitude()), Double.parseDouble(aUser.getLongitude()), 13.088618, 80.284861, results); if(results[0]<400) { Intent mainIntent = new Intent(this, AttendanceActivity.class); startActivity(mainIntent); } else { AlertDialog.Builder alt_bld = new AlertDialog.Builder(MainActivity.this); String distance = "Distance:"+results[0]; String workLocation = "Work Location:" + aUser.getLatitude() +"," + aUser.getLongitude(); String currentLocationStr = " Current Location:" + currentLocation.getLatitude() +"," + currentLocation.getLongitude(); alt_bld.setMessage("Please visit the work location to do attendance. "+workLocation+currentLocationStr +" "+distance ) .setCancelable(true); AlertDialog alert = alt_bld.create(); alert.setButton(-1,"OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alert.setTitle("Error"); alert.show(); } } public void showServiceReceiptView(View view) { getServiceReceiptDetails(); } public void showOTWView(View view) { Intent mainIntent = new Intent(this, OTWListActivity.class); startActivity(mainIntent); } public void showLeadsView(View view) { Intent mainIntent = new Intent(this, LeadsActivity.class); startActivity(mainIntent); } public void showCMSView(View view) { Intent mainIntent = new Intent(this, CMSListActivity.class); startActivity(mainIntent); } public void showEntryView(View view) { Intent mainIntent = new Intent(this, PaymentEntryActivity.class); startActivity(mainIntent); } public void showReportView(View view) { Intent mainIntent = new Intent(this, PaymentReportActivity.class); startActivity(mainIntent); } public void showPoliciesView(View view) { Intent mainIntent = new Intent(this, PolicyListActivity.class); startActivity(mainIntent); } public void showPaymentEntryView(View view) { Intent mainIntent = new Intent(this, AgentPaymentEntryActivity.class); startActivity(mainIntent); } public void showSendPhotosView(View view) { Intent mainIntent = new Intent(this, PhotosPolicyActivity.class); startActivity(mainIntent); } public void showReceiveFilesView(View view) { Intent mainIntent = new Intent(this, ReceiveFilesActivity.class); startActivity(mainIntent); } public void sendFeedback(View view){ Intent mainIntent=new Intent(this,FeedbackActivity.class); startActivity(mainIntent); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { logoutApp(null); return false; } return super.onKeyUp(keyCode, event); } public void logoutApp(View view) { AlertDialog.Builder alt_bld = new AlertDialog.Builder(this); alt_bld.setMessage("Do you want to Logout?") .setCancelable(true); AlertDialog alert = alt_bld.create(); alert.setButton(-1, "YES", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { theUserDataSource.deleteUserByUserId(aUser.getUserId()); finish(); } }); alert.setButton(-2, "NO", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alert.setTitle("Confirm"); alert.show(); } public void getServiceReceiptDetails() { progressDialog = ProgressDialog.show(MainActivity.this, "", "Please wait...", true); Thread thread = new Thread(this); thread.start(); } @Override public void run() { if(isInternetConnected()) { if(apiHelper == null) apiHelper = new APIHelpers(); apiHelper.getServiceReceiptDetails(aUser, getApplicationContext(), handler); } else { Message message = new Message(); Bundle mBundle = new Bundle(); mBundle.putString("responseStatus", "The service could not be reached. Please try again later."); mBundle.putString("msgTitle", "Cannot Connect"); message.setData(mBundle); message.what = 0; handler.sendMessage(message); } } private Handler handler = new Handler() { public String responseStatus; public String msgTitle; @Override public void handleMessage(Message msg) { Bundle bundle = msg.getData(); responseStatus = bundle.getString("responseStatus"); msgTitle = bundle.getString("msgTitle"); if (msg.what == 1) { if (progressDialog.isShowing()) progressDialog.dismiss(); showServiceReceipt(); } else if (msg.what == 0) { if (progressDialog.isShowing()) progressDialog.dismiss(); AlertDialog.Builder alt_bld = new AlertDialog.Builder(MainActivity.this); alt_bld.setMessage(responseStatus) .setCancelable(true); AlertDialog alert = alt_bld.create(); alert.setButton(-1, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }); alert.setTitle(msgTitle); alert.show(); } } }; /** * Returns the internet connection status * @return */ private boolean isInternetConnected() { ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ni = cm.getActiveNetworkInfo(); if (ni!=null && ni.isAvailable() && ni.isConnected()) { return true; } else { return false; } } private void showServiceReceipt() { Intent mainIntent = new Intent(this, ServiceReceiptActivity.class); startActivity(mainIntent); } public void showExecutiveReportView(View view) { Intent mainIntent = new Intent(this, ExecutiveReportActivity.class); startActivity(mainIntent); } }
[ "sathriyan8@gmail.com" ]
sathriyan8@gmail.com
1fb344d7f9aab5230122fa8c1c38e7624d32e927
2a360f4fda059305958daa6d3dcc0173f1ffe5a7
/src/com/sshtools/shift/HomeAction.java
867bab36939f6e69bbb354dc2b76f9797f07ab82
[]
no_license
mikelo/powervnc
dc327c8a199c3e2634e9e91bf790526f9e15b3ff
1135128f95ab714a91e99eed46f813f922fe3f77
refs/heads/master
2021-01-10T21:46:27.425312
2015-06-14T20:46:14
2015-06-14T20:46:14
37,426,811
0
0
null
null
null
null
UTF-8
Java
false
false
2,077
java
/* * My3SP * * Copyright (C) 2003 3SP LTD. All Rights Reserved * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 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 * GNU General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ package com.sshtools.shift; import java.awt.event.KeyEvent; import javax.swing.Action; import javax.swing.KeyStroke; import com.sshtools.common.ui.ResourceIcon; import com.sshtools.common.ui.StandardAction; abstract class HomeAction extends StandardAction { /** * Creates a new HomeAction object. */ public HomeAction() { putValue(Action.NAME, "Home Directory"); putValue(Action.SMALL_ICON, new ResourceIcon(HomeAction.class, "home.png")); putValue(Action.SHORT_DESCRIPTION, "Go to my home directory"); putValue(Action.LONG_DESCRIPTION, "Go to my home directory"); putValue(Action.MNEMONIC_KEY, new Integer('h')); putValue(Action.ACTION_COMMAND_KEY, "home-command"); putValue(StandardAction.MENU_NAME, "Navigate"); putValue(StandardAction.ON_MENUBAR, new Boolean(true)); putValue(StandardAction.MENU_ITEM_GROUP, new Integer(90)); putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(0)); putValue(StandardAction.ON_TOOLBAR, new Boolean(true)); putValue(StandardAction.TOOLBAR_GROUP, new Integer(50)); putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(10)); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0)); } }
[ "" ]
f783e36a439e9fb09c18ba6cd2bc080a980a6d35
b3c2e1547387c0e3d5879308957688d6f24b5ac6
/ioc/src/main/java/com/redmaple/spring/bean/PropertyArg.java
80fc0418afdf619f492d1de23bb9db5da8edaa1c
[]
no_license
redmaple1/framework-spring
b907637eb6caa9e1faff412c5f8f598fae15578d
ac06a3325b52c011dd9e473df1e4fd78bdabfc2a
refs/heads/master
2020-04-21T00:16:25.690725
2019-02-05T05:25:02
2019-02-05T05:25:02
169,191,393
0
0
null
null
null
null
UTF-8
Java
false
false
174
java
package com.redmaple.spring.bean; import lombok.Data; @Data public class PropertyArg { private String typeName; private String name; private String value; }
[ "renxiaoya168@163.com" ]
renxiaoya168@163.com
5048bfc07cf24c31de1da7d515449c2533283373
a3f2c2def994013395a011483581ff91b966cf19
/src/main/java/com/ccff/o2o/service/ShopCategoryService.java
3808a8961fddd1678ea1a8e46c0f7f0955be32bc
[]
no_license
WangZhefeng93/o2o
afec87a8d7ec655bf31577d46c8ad0d3d8205800
0a14a2dbb730af6e8004539bbc64a08f2dd58dc7
refs/heads/master
2020-05-22T14:08:40.729716
2019-05-20T12:10:14
2019-05-20T12:10:14
186,378,006
0
0
null
null
null
null
UTF-8
Java
false
false
218
java
package com.ccff.o2o.service; import com.ccff.o2o.entity.ShopCategory; import java.util.List; public interface ShopCategoryService { List<ShopCategory> getShopCategoryList(ShopCategory shopCategoryCondition); }
[ "704419968@qq.com" ]
704419968@qq.com
956c904bee032ac099dea0343aacf914b280d6b0
d7a3b3c8aa1b122849aa3d690547929ea823039d
/src/main/java/me/xenodev/sp/events/all/FreeItemEvent.java
4e7855af2fccf77bad66f4843efadf5a08f7fa11
[]
no_license
XenoshiYT/SkyPvP
5202014167a8fef6b1d4e4af45bdbbcd98036e82
5b862678a294b5f3acc648aa9524d130686ec13f
refs/heads/master
2023-07-11T15:15:26.522451
2021-09-02T20:25:53
2021-09-02T20:25:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,861
java
package me.xenodev.sp.events.all; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Rotation; import org.bukkit.entity.Entity; import org.bukkit.entity.ItemFrame; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerInteractAtEntityEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; public class FreeItemEvent implements Listener { @EventHandler public void onInteract(PlayerInteractAtEntityEvent e){ Entity entity = e.getRightClicked(); Player p = e.getPlayer(); if(entity instanceof ItemFrame){ ItemFrame frame = (ItemFrame) e.getRightClicked(); if(!(p.hasPermission("skypvp.freeitem.rotate") && p.isSneaking())) { frame.setRotation(Rotation.NONE); if(!(frame.getItem().getType().equals(Material.AIR) || frame.getItem().equals(null))){ e.setCancelled(true); ItemStack stack = frame.getItem(); Inventory inv = Bukkit.createInventory(null, 9*3, "§a§lFree Items"); for(int i = 0; i < 27; i++){ inv.setItem(i, stack); } p.openInventory(inv); } } } } @EventHandler public void onDamageEntity(EntityDamageByEntityEvent e){ Entity damager = e.getDamager(); Entity entity = e.getEntity(); if(damager instanceof Player && entity instanceof ItemFrame){ Player p = (Player) e.getDamager(); if(!(p.hasPermission("skypvp.freeitem.remove") && p.isSneaking())){ e.setCancelled(true); } } } }
[ "DragonWolfHD2015@gmail.com" ]
DragonWolfHD2015@gmail.com
f0601f0cec8c13f5cc922a4efbf42d4295035684
30f950b59174cbf1395f173dba54631d379f0969
/src/test/java/ru/otus/spring01/dao/QuestionDaoImplTest.java
46230fed7bbe937da1a6a13751a641df92c7232f
[]
no_license
SlawaBE/otus_spring_2018_11
b3d6222e18aa8091fcb6a0e03edc4425c96991c2
b06108acdad21046a7282b401cc26a6156f82001
refs/heads/master
2020-04-09T08:57:32.549669
2018-12-25T16:36:22
2018-12-25T16:36:22
160,215,250
0
0
null
2018-12-25T16:36:23
2018-12-03T15:46:34
Java
UTF-8
Java
false
false
1,477
java
package ru.otus.spring01.dao; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.context.MessageSource; import ru.otus.spring01.TestUtils; import java.util.Locale; import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static ru.otus.spring01.TestUtils.assertEqualsQuestions; /** * Created by Stanislav on 03.12.2018 */ @DisplayName("Класс QuestionDaoImpl") public class QuestionDaoImplTest { @Test @DisplayName("Получаем null при неудачном чтении файла") public void testFailGetQuestions() { MessageSource mock = mock(MessageSource.class); when(mock.getMessage(anyString(), any(), any(Locale.class))).thenReturn("not_found.csv"); QuestionDaoImpl dao = new QuestionDaoImpl(mock); assertNull(dao.getQuestions()); } @Test() @DisplayName("Успешное получение списка вопросов") public void testGetQuestions() { MessageSource mock = mock(MessageSource.class); when(mock.getMessage(anyString(), any(), any(Locale.class))).thenReturn("test.csv"); QuestionDaoImpl dao = new QuestionDaoImpl(mock); assertEqualsQuestions(dao.getQuestions(), TestUtils.getQuestions()); } }
[ "britvin.slawa@yandex.ru" ]
britvin.slawa@yandex.ru
d0bd6cf1219511bc43150b3ea6f4c0440c6919be
28c2ff3a03874567448cba7e5193e4716aa6fe5b
/src/main/java/com/lee/common/dao/BaseDAO.java
4d8e9fbd8a7d0339e4c41eac2a6a208801c2ff0d
[]
no_license
nobywhy/leeadmin
68c717238e65723be0b038bfb9b6cdc144768697
6ef34d1aae5b44a8020629c1328bbc66b50c2ce4
refs/heads/master
2021-01-19T21:40:13.686950
2015-12-17T08:00:23
2015-12-17T08:00:23
48,161,096
1
0
null
null
null
null
UTF-8
Java
false
false
490
java
package com.lee.common.dao; import java.util.List; import java.util.Map; public interface BaseDAO{ public void create(Map<String,Object> m); public void update(Map<String,Object> m); public void delete(long id); public Map<String,Object> getById(long id); public int getByConditionCount(Map<String,Object> qm); public List<Map<String,Object>> getByConditionPage(Map<String,Object> qm); public List<Map<String,Object>> getByCondition(Map<String,Object> qm); }
[ "479247255@qq.com" ]
479247255@qq.com
636cd254845eec71c51904b6240de173db77f965
2e62fdcf3cf7be6524a39f2bef2e2dbdec0fa67b
/src/main/java/com/repository/VehicleRepository.java
d67ebe228edbf33304dd47564be50a348b3c5532
[]
no_license
Evefei/loadingSys
9c21851ea16e40f594e3981b287a67240b7f31e3
fe4812a3dd0f9ec8579e0c480aadb775672c94a8
refs/heads/master
2020-04-08T18:14:25.543967
2019-04-26T02:36:39
2019-04-26T02:36:39
159,599,568
1
0
null
null
null
null
UTF-8
Java
false
false
330
java
package com.repository; import com.domain.Vehicle; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data repository for the Vehicle entity. */ @SuppressWarnings("unused") @Repository public interface VehicleRepository extends JpaRepository<Vehicle, Long> { }
[ "876965375@qq.com" ]
876965375@qq.com
c391f9573296512cc079f1a681071a2c51217152
d826f8a92f7b048f05100681e2f9379e1931eed3
/2017sh-tel/shkd_zj_server/src/cn/sh/ideal/controller/CoachController.java
510189555123be369fc0210b8a28438a5c6f273f
[]
no_license
kainsqm/SSK
70164d91530e4657b7820a38537e21fea0b178d5
ef9e748d37d3f4ae639b901ba4ce3d124e5a2183
refs/heads/master
2021-01-18T16:36:19.420984
2017-08-17T02:18:13
2017-08-17T02:18:13
100,462,801
0
0
null
null
null
null
UTF-8
Java
false
false
34,260
java
package cn.sh.ideal.controller; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.log4j.Logger; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import cn.sh.ideal.annotation.Log; import cn.sh.ideal.intercept.LogDescriptionArgsObject; import cn.sh.ideal.model.CoachInfo; import cn.sh.ideal.model.CoachMain; import cn.sh.ideal.model.CoachServer; import cn.sh.ideal.service.ICoachService; import cn.sh.ideal.util.Constans; import cn.sh.ideal.util.LogUitls; import cn.sh.ideal.util.SearchBean; import cn.sh.ideal.util.SearchResultBean; import com.github.pagehelper.PageHelper; @Controller @RequestMapping("/controller/coach") public class CoachController { private static Logger log = Logger.getLogger(FunctionController.class); @Resource private ICoachService coachService; @RequiresPermissions("coach:query") @RequestMapping(value="/togetCoachMonth",method=RequestMethod.GET) public String togetCoachMonth(HttpServletRequest request, HttpServletResponse response){ String role=request.getAttribute("role_flag").toString(); String userworkid=request.getAttribute("userworkid").toString(); request.setAttribute("roleflag", role); request.setAttribute("userworkid", userworkid); return "coach_program/coachInfoList_qc"; } @RequestMapping(value="/tocoachInfoListDudao",method=RequestMethod.GET) public String tocoachInfoListDudao(){ return "coach_program/coachInfoList_dudao"; } @RequestMapping(value="/tocoachInfoList",method=RequestMethod.GET) public String tocoachInfoList(HttpServletRequest request, HttpServletResponse response){ String role=request.getAttribute("role_flag").toString(); String userworkid=request.getAttribute("userworkid").toString(); request.setAttribute("roleflag", role); request.setAttribute("userworkid", userworkid); return "coach_program/coachInfoList"; } /** * 获取辅导月计划列表 * @param request * @param response * @param cm */ @RequestMapping(value = "/getCoachMonth", method = RequestMethod.POST) public void getCoachMonth(HttpServletRequest request, HttpServletResponse response, CoachMain cm) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); try { int currentPage = Integer.parseInt(request.getParameter("page")); int pageSize = Integer.parseInt(request.getParameter("pagesize")); String role_flag=String.valueOf(request .getAttribute(Constans.ROLE_FLAG)); String userid=String.valueOf(request .getAttribute(Constans.USER_INFO_USERID)); PageHelper.startPage(currentPage, pageSize); if("role_1".equals(role_flag)){ cm.setUserid(Integer.parseInt(userid)); }else if("role_3".equals(role_flag)){ cm.setCreateid(Integer.parseInt(userid)); } cm.setSumImprove(coachService.getSummarizeState(cm.getPass())); if(cm.getPass()!=null&&cm.getPass()!=""){ cm.setPass(coachService.getPassState(cm.getPass())); } List<CoachMain> cmList = coachService.queryCoachMain(cm); int counts = coachService.queryCoachMainCount(cm); String json = "{\"Total\":" + counts + " , \"Rows\":" + JSONArray.fromObject(cmList).toString() + "}"; System.out.println(json.toString()); response.getWriter().print(json.toString()); // return object.toString(); } catch (Exception e) { log.error("获取辅导月计划列表异常:" + e.getMessage()); } } /** * 个人辅导计划查询的员工信息(单选) */ @RequestMapping(value = "/getSinglePage", method = RequestMethod.POST) public String getSinglePage(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); String workId = request.getParameter("workId");// 工号 String userName = request.getParameter("userName");// 姓名 String currentPage = request.getParameter("currentPage"); SearchBean search = new SearchBean(); if (currentPage != null) { search.setCurrentPage(Integer.parseInt(currentPage)); } Map<String, String> map = new HashMap<String, String>(); // map.put("workId", workId); map.put("userName", userName); map.put("start", String.valueOf(search.getStart())); map.put("end", String.valueOf(search.getEnd())); SearchResultBean result = coachService.queryUserList(map); try { request.setAttribute("papers", URLDecoder.decode(request .getParameter("papers_hid"), "utf-8"));// lfj 2012-10-26 add } catch (UnsupportedEncodingException e) { log.info(e); } request.setAttribute("allUserList", result.getData()); request.setAttribute("pageBean", result.getSearcherBean()); return "coach_program/operSinglePage"; } @Log(methodname = "addCoachMonth", modulename = "辅导计划", funcname = "新增辅导月计划", description = "新增辅导月计划,{0}", code = "ZJ") @RequestMapping(value = "/addCoachMonth", method = RequestMethod.POST) public void addCoachMonth(HttpServletRequest request, HttpServletResponse response, CoachMain coac) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); String username=request.getParameter("username"); String userid=request.getParameter("userid"); String starttime=request.getParameter("starttime"); String endtime=request.getParameter("endtime"); String coachproject=request.getParameter("coachproject"); coachproject=coachproject.substring(0, coachproject.lastIndexOf(",")); String improve=request.getParameter("improve"); String specificationlanguage=request.getParameter("specificationlanguage"); String politetoneoofvoice=request.getParameter("politetoneoofvoice"); String abilitytocommunicate=request.getParameter("abilitytocommunicate"); String objectionhandling=request.getParameter("objectionhandling"); String flowstandard=request.getParameter("flowstandard"); String deadlyerror=request.getParameter("deadlyerror"); String marketingskills=request.getParameter("marketingskills"); String createuserid=String.valueOf(request .getAttribute(Constans.USER_INFO_USERID)); coac.setUsername(username); coac.setCreateid(Integer.parseInt(createuserid)); coac.setUserid(Integer.parseInt(userid)); coac.setStarttime(starttime); coac.setEndtime(endtime); coac.setRemaker(improve); coac.setCoachproject(coachproject); boolean blag = coachService.insert(coac); CoachServer cocachserver = new CoachServer(); cocachserver.setAbilitytocommunicate(abilitytocommunicate); cocachserver.setCoachmainid(coac.getCoachmainId()); cocachserver.setDeadlyerror(deadlyerror); cocachserver.setFlowstandard(flowstandard); cocachserver.setMarketingskills(marketingskills); cocachserver.setObjectionhandling(objectionhandling); cocachserver.setPolitetoneoofvoice(politetoneoofvoice); cocachserver.setSpecificationlanguage(specificationlanguage); boolean flag = coachService.insertcoachserver(cocachserver); JSONObject json = new JSONObject(); json.put("flag", flag); try { response.getWriter().print(json); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { "操作成功,月计划id:"+coac.getCoachmainId() })); } catch (IOException e) { log.error("新增月计划异常:" + e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { e.getMessage() })); } } @RequiresPermissions(value={"coach:upd","coach:addmon"},logical=Logical.OR) @RequestMapping(value = "/getcocahbyid", method = RequestMethod.GET) public String getcocahbyid(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); String coachmainId = request.getParameter("coachmainId"); String pd = request.getParameter("pd"); CoachMain coac = coachService.selectByPrimaryKey(Integer .parseInt(coachmainId)); CoachServer coacs = coachService.selectCoachServerByid(Integer .parseInt(coachmainId)); List<CoachMain> coachteam = coachService.getcoachteam(); request.setAttribute("coachteam", coachteam); request.setAttribute("coacs", coacs); request.setAttribute("coac", coac); request.setAttribute("userid", coac.getUserid()); request.setAttribute("coachproject", coac.getCoachproject()); request.setAttribute("pd", pd); if("addinfo".equals(pd)){ boolean blag=true; List<CoachInfo> cmList = coachService.selectByKeyCoachInfo(Integer.parseInt(coachmainId)); //判断该月计划下的周计划是否有待受理员班长处理的 如果有 则不显示辅导总结按钮 for (CoachInfo coachInfo : cmList) { if("1".equals(coachInfo.getState())){ blag=false; break; } } if(cmList.size()==0){ //表明该月计划没有周计划 则不显示辅导总结按钮 blag=false; } request.setAttribute("blag", blag); return "coach_program/coachInfo_items_qc"; }else{ return "coach_program/editcoachmain"; } } /** * 督导查询自己审核的月计划 * **/ @RequiresPermissions("dbcoach:query") @RequestMapping(value = "/getDDCheckCoachMonth", method = RequestMethod.POST) public void getDDCheckCoachMonth(HttpServletRequest request, HttpServletResponse response, CoachMain cm) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); String tz=request.getParameter("tz"); List<CoachMain> coachteam=coachService.getcoachteam(); try { int currentPage = Integer.parseInt(request.getParameter("page")); int pageSize = Integer.parseInt(request.getParameter("pagesize")); PageHelper.startPage(currentPage, pageSize); if(cm.getPass()!=null&&cm.getPass()!=""){ System.out.println("pass:"+ Integer.parseInt(cm.getPass())); switch (Integer.parseInt(cm.getPass())) { case 0: cm.setPass("0"); break; case 1: cm.setPass("1"); cm.setSumImprove(null); break; case 2: cm.setPass("2"); break; case 3: cm.setSumImprove("0"); cm.setPass(null); break; case 4: cm.setSumImprove("1"); cm.setPass(null); break; case 5: cm.setSumImprove("2"); cm.setPass(null); break; default: } } /* cm.setPass(coachService.getPassState(cm.getPass())); cm .setSumImprove(coachService.getSummarizeState(cm .getSumImprove()));*/ List<CoachMain> cmList = coachService.queryCoachMain(cm); int counts = coachService.queryCoachMainCount(cm); String json = "{\"Total\":" + counts + " , \"Rows\":" + JSONArray.fromObject(cmList).toString() + "}"; System.out.println(json.toString()); response.getWriter().print(json.toString()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { "操作成功" })); // return object.toString(); } catch (Exception e) { log.error("获取督导查询自己审核的月计划列表异常:" + e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { e.getMessage() })); } } /** * 督导查询月计划详情信息 * **/ @RequiresPermissions("dbcoach:getinfo") @RequestMapping(value = "/getCoachInfoDuDao", method = RequestMethod.GET) public String getCoachInfoDuDao(HttpServletRequest request, HttpServletResponse response, CoachMain cm) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); try { String coachmainId = request.getParameter("coachmainId"); CoachMain coac = coachService.selectByPrimaryKey(Integer .parseInt(coachmainId)); CoachServer coacs = coachService.selectCoachServerByid(Integer .parseInt(coachmainId)); List<CoachMain> coachteam = coachService.getcoachteam(); request.setAttribute("coachteam", coachteam); request.setAttribute("coacs", coacs); request.setAttribute("coac", coac); request.setAttribute("coachmainId", coachmainId); request.setAttribute("coachproject", coac.getCoachproject()); return "coach_program/coachInfo_items_dudao"; } catch (Exception e) { log.error("督导查询月计划详情信息异常:" + e.getMessage()); } return ""; } /** * 显示督导审核月计划页面 * **/ @RequiresPermissions("dbcoach:check") @RequestMapping(value = "/getCoachInfoCheck", method = RequestMethod.GET) public String getCoachInfoCheck(HttpServletRequest request, HttpServletResponse response, CoachMain cm) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); try { String coachmainId = request.getParameter("coachmainId"); CoachMain coac = coachService.selectByPrimaryKey(Integer .parseInt(coachmainId)); CoachServer coacs = coachService.selectCoachServerByid(Integer .parseInt(coachmainId)); List<CoachMain> coachteam = coachService.getcoachteam(); request.setAttribute("coachteam", coachteam); request.setAttribute("coacs", coacs); request.setAttribute("coac", coac); request.setAttribute("coachmainId", coachmainId); request.setAttribute("coachproject", coac.getCoachproject()); return "coach_program/check_coachmain"; } catch (Exception e) { log.error("显示督导审核月计划页面异常:" + e.getMessage()); } return ""; } @RequiresPermissions(value={"coach:add","coach:zj","csrcoach:query"},logical=Logical.OR) @RequestMapping(value = "/getcoachtime", method = RequestMethod.GET) public String getcoachtime(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); try { String tz=request.getParameter("tz"); List<CoachMain> coachteam = coachService.getcoachteam(); request.setAttribute("coachteam", coachteam); if("zjx".equals(tz)){ String id=request.getParameter("id"); String coachmainId=request.getParameter("coachmainId"); if(!"0".equals(id)){ CoachInfo coachinfo=coachService.selecCoachInfotByid(Integer.parseInt(id)); request.setAttribute("coachinfo", coachinfo); request.setAttribute("msg", "info"); } CoachMain coach=coachService.selectByPrimaryKey(Integer.parseInt(coachmainId)); request.setAttribute("coach", coach); request.setAttribute("coachmainId", coachmainId); request.setAttribute("id", id); return "coach_program/coachInfo_items_one_info"; }else if("fdzj".equals(tz)){ String coachmainId=request.getParameter("coachmainId"); request.setAttribute("coachmainId", coachmainId); CoachMain coac = coachService.selectByPrimaryKey(Integer.parseInt(coachmainId)); request.setAttribute("coac", coac); request.setAttribute("coachproject", coac.getCoachproject()); if(null!=coac.getSumImprove()){ if(coac.getSumImprove().equals("2") || coac.getSumImprove().equals("1")){ return "coach_program/coachInfo_zongjie_qcinfo"; } } return "coach_program/coachInfo_zongjie_qc"; }else{ return "coach_program/edit_coachInfo_main"; } } catch (Exception e) { log.error("获取辅导项目异常:" + e.getMessage(),e); } return ""; } @RequestMapping(value = "/getcoachtimeByDudao", method = RequestMethod.GET) public String getcoachtimeByDudao(HttpServletRequest request, HttpServletResponse response) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); try { List<CoachMain> coachteam = coachService.getcoachteam(); request.setAttribute("coachteam", coachteam); String id=request.getParameter("id"); String coachmainId=request.getParameter("coachmainId"); if(!"0".equals(id)){ CoachInfo coachinfo=coachService.selecCoachInfotByid(Integer.parseInt(id)); request.setAttribute("coachinfo", coachinfo); request.setAttribute("msg", "info"); } CoachMain coach=coachService.selectByPrimaryKey(Integer.parseInt(coachmainId)); request.setAttribute("coach", coach); request.setAttribute("coachmainId", coachmainId); request.setAttribute("id", id); return "coach_program/coachInfo_items_one_info"; } catch (Exception e) { log.error("获取辅导项目异常:" + e.getMessage()); } return ""; } @RequiresPermissions(value={"coach:upd","csrcoach:sub"},logical=Logical.OR) @Log(methodname="updCoachmain",modulename="辅导计划",funcname="修改月辅导计划",description="修改月辅导计划,{0}", code = "ZJ") @RequestMapping(value="/updCoachmain",method = RequestMethod.POST) public void updCoachmain(HttpServletRequest request,HttpServletResponse response,CoachMain coac){ String coachmainId=request.getParameter("coachmainId"); String username=request.getParameter("username"); String userid=request.getParameter("userid"); String starttime=request.getParameter("starttime"); String endtime=request.getParameter("endtime"); String coachproject=request.getParameter("coachproject"); coachproject=coachproject.substring(0, coachproject.lastIndexOf(",")); String improve=request.getParameter("improve"); String specificationlanguage=request.getParameter("specificationlanguage"); String politetoneoofvoice=request.getParameter("politetoneoofvoice"); String abilitytocommunicate=request.getParameter("abilitytocommunicate"); String objectionhandling=request.getParameter("objectionhandling"); String flowstandard=request.getParameter("flowstandard"); String deadlyerror=request.getParameter("deadlyerror"); String marketingskills=request.getParameter("marketingskills"); String upduserid=String.valueOf(request .getAttribute(Constans.USER_INFO_USERID)); coac.setUsername(username); coac.setModifid(Integer.parseInt(upduserid)); if(userid!=""&&userid!=null){ coac.setUserid(Integer.parseInt(userid)); } coac.setStarttime(starttime); coac.setEndtime(endtime); coac.setPass("2"); coac.setRemaker(improve); coac.setCoachproject(coachproject); CoachServer cocachserver=new CoachServer(); cocachserver.setAbilitytocommunicate(abilitytocommunicate); cocachserver.setCoachmainid(Integer.parseInt(coachmainId)); cocachserver.setDeadlyerror(deadlyerror); cocachserver.setFlowstandard(flowstandard); cocachserver.setMarketingskills(marketingskills); cocachserver.setObjectionhandling(objectionhandling); cocachserver.setPolitetoneoofvoice(politetoneoofvoice); cocachserver.setSpecificationlanguage(specificationlanguage); boolean flag=false; try { flag = coachService.updateCoachByid(coac, cocachserver); } catch (Exception e1) { // TODO Auto-generated catch block log.info(e1); } JSONObject json=new JSONObject(); json.put("flag", flag); try { response.getWriter().print(json); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{"操作成功,辅导计划id:"+coachmainId})); } catch (IOException e) { log.error("修改月辅导计划异常:"+e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{e.getMessage()})); } } @RequiresPermissions("coach:add") @Log(methodname="addCoachInfo",modulename="辅导计划",funcname="新增辅导周计划",description="新增辅导周计划,{0}", code = "ZJ") @RequestMapping(value="/addCoachInfo",method = RequestMethod.POST) public void addCoachInfo(HttpServletRequest request,HttpServletResponse response,CoachInfo coac){ response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); String coachmainId=request.getParameter("coachmainId"); String starttime=request.getParameter("starttime"); String endtime=request.getParameter("endtime"); String coachproject=request.getParameter("coachproject"); coachproject=coachproject.substring(0, coachproject.lastIndexOf(",")); String coachmethod=request.getParameter("coachmethod"); String instructions=request.getParameter("instructions"); String coachrecord=request.getParameter("coachrecord"); String comforablestate=request.getParameter("comforablestate"); String uncomforable=request.getParameter("uncomforable"); String describe=request.getParameter("describe"); String createuserid=String.valueOf(request .getAttribute(Constans.USER_INFO_USERID)); coac.setCoachmainId(Integer.parseInt(coachmainId)); coac.setStarttime(starttime); coac.setEndtime(endtime); coac.setCoachproject(coachproject); coac.setCoachmethod(coachmethod); coac.setInstructions(instructions); coac.setCoachrecord(coachrecord); coac.setComforablestate(comforablestate); coac.setUncomforable(uncomforable); coac.setDescribe(describe); coac.setCreateid(createuserid); coac.setValid("0"); coac.setState("1"); boolean flag=coachService.insertCoachInfo(coac); JSONObject json=new JSONObject(); json.put("flag", flag); try { response.getWriter().print(json); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{"操作成功,周计划id:"+coac.getId()})); } catch (IOException e) { log.error("新增周计划异常:"+e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{e.getMessage()})); } } @RequiresPermissions(value={"coach:update","csrcoach:sub"},logical=Logical.OR) @Log(methodname="updCoachInfo",modulename="辅导计划",funcname="修改辅导周计划",description="修改辅导周计划,{0}", code = "ZJ") @RequestMapping(value="/updCoachInfo",method = RequestMethod.POST) public void updCoachInfo(HttpServletRequest request,HttpServletResponse response,CoachInfo coac){ response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); String comforablestate = request.getParameter("comforablestate"); String uncomforable =request.getParameter("uncomforable"); String describe =request.getParameter("describe"); String id =request.getParameter("id"); String roleflag=String.valueOf(request .getAttribute(Constans.ROLE_FLAG)); String userid=String.valueOf(request .getAttribute(Constans.USER_INFO_USERID)); SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); Date date=new Date(); if("role_1".equals(roleflag)){ coac.setState("2"); coac.setModifid(userid); coac.setModiftime(sdf.format(date)); }else if("role_2".equals(roleflag)){ coac.setState("3"); coac.setPassuserid(userid); coac.setPasstime(sdf.format(date)); } coac.setComforablestate(comforablestate); coac.setUncomforable(uncomforable); coac.setDescribe(describe); coac.setId(Integer.parseInt(id)); boolean flag=coachService.updcoachInfo(coac); JSONObject json=new JSONObject(); json.put("flag", flag); try { response.getWriter().print(json); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{"操作成功,周计划id:"+id})); } catch (IOException e) { log.error("修改辅导周计划:"+e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{e.getMessage()})); } } /** * 督导查询审核的月计划中的周计划列表 * **/ @RequestMapping(value = "/getDDCheckCoachInfo", method = RequestMethod.POST) public void getDDCheckCoachInfo(HttpServletRequest request, HttpServletResponse response, CoachMain cm) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); try { int currentPage = Integer.parseInt(request.getParameter("page")); int pageSize = Integer.parseInt(request.getParameter("pagesize")); PageHelper.startPage(currentPage, pageSize); int coachmainId = Integer.parseInt(request .getParameter("coachmainId")); List<CoachInfo> cmList = coachService .selectByKeyCoachInfo(coachmainId); for (int i = 0; i < cmList.size(); i++) { Map<String,String> map=new HashMap<String, String>(); String id=cmList.get(i).getCoachproject(); map.put("id", id); String name=coachService.getCoachProjectById(map); cmList.get(i).setCoachproject(name); } int counts = coachService.selectByKeyCoachInfoCount(coachmainId); String json = "{\"Total\":" + counts + " , \"Rows\":" + JSONArray.fromObject(cmList).toString() + "}"; System.out.println(json.toString()); response.getWriter().print(json.toString()); // return object.toString(); } catch (Exception e) { log.error("获取督导查询审核的月计划中的周计划列表异常:" + e.getMessage()); } } /** * @author niewq 删除辅导计划 * **/ @RequiresPermissions("dbcoach:del") @Log(methodname = "deleteCoachMain", modulename = "辅导计划", funcname = "删除辅导计划", description = "删除辅导计划,{0}", code = "ZJ") @RequestMapping(value = "/deleteCoachMain", method = RequestMethod.POST) public void deleteCoachMain(HttpServletRequest request, HttpServletResponse response) { response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/html;charset=UTF-8"); JSONObject object=new JSONObject(); try { int coachmainId = Integer.parseInt(request .getParameter("coachmainId")); coachService.deleteCoachMain(coachmainId); // response.getWriter().write( // "<script language='javascript'>alert('操作成功!'); " // + "window.location.href='" // + request.getContextPath() // + "/page/coach_program/coachInfoList_dudao.jsp'" // + "</script>"); object.put("status", "1"); response.getWriter().write(object.toString()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { "操作成功,月计划id:"+coachmainId})); } catch (Exception e) { log.error("删除辅导计划异常:" + e.getMessage()); //response.getWriter().write("<script>alert('操作失败!');</script>"); object.put("status", "0"); try { response.getWriter().write(object.toString()); } catch (IOException e1) { log.info(e1); } LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { e.getMessage() })); } } /** * 督导审核月计划处理 * * @param mapping * @param form * @param request * @param response * @return * @throws Exception */ @Log(methodname = "DuDaoCheckCoachMain", modulename = "辅导计划", funcname = "督导审核月计划处理", description = "督导审核月计划处理,{0}", code = "ZJ") @RequestMapping(value = "/DuDaoCheckCoachMain", method = RequestMethod.POST) public void DuDaoCheckCoachMain(HttpServletRequest request, HttpServletResponse response) { response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/html;charset=UTF-8"); try { String coachmainId = request.getParameter("coachmainId"); CoachMain cm = new CoachMain(); cm.setCoachmainId(Integer.parseInt(coachmainId)); cm.setPass(request.getParameter("pass")); cm.setPassinfo(request.getParameter("passinfo")); String userid = String.valueOf(request .getAttribute(Constans.USER_INFO_USERID)); cm.setPassuserid(userid); int result = coachService.updateDuDaoCheckCoachMain(cm); JSONObject json = new JSONObject(); json.put("data", result); response.getWriter().print(json); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { "操作成功,月计划id:"+coachmainId})); } catch (Exception e) { log.error("督导审核月计划处理异常:" + e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { e.getMessage() })); } } /** * 督导审核辅导总结页面详情 * **/ @RequiresPermissions("dbcoach:zjcheck") @RequestMapping(value = "/getCoachMainCheck", method = RequestMethod.GET) public String getCoachMainCheck(HttpServletRequest request, HttpServletResponse response, CoachMain cm) { response.setContentType("text/html;charset=utf-8"); response.setCharacterEncoding("UTF-8"); try { String coachmainId = request.getParameter("coachmainId"); CoachMain coac = coachService.selectByPrimaryKey(Integer .parseInt(coachmainId)); CoachServer coacs = coachService.selectCoachServerByid(Integer .parseInt(coachmainId)); List<CoachMain> coachteam = coachService.getcoachteam(); request.setAttribute("coachteam", coachteam); request.setAttribute("coacs", coacs); request.setAttribute("coac", coac); request.setAttribute("coachmainId", coachmainId); request.setAttribute("coachproject", coac.getCoachproject()); return "coach_program/coachInfo_zongjie_check"; } catch (Exception e) { log.error("获取督导审核辅导总结页面详情异常:" + e.getMessage()); } return ""; } /** * 督导审核辅导总结操作 * * @param mapping * @param form * @param request * @param response * @return * @throws Exception */ @RequiresPermissions("dbcoach:zjcheck") @Log(methodname = "checkCoachSummary", modulename = "辅导计划", funcname = "督导审核辅导总结操作", description = "督导审核辅导总结操作,{0}", code = "ZJ") @RequestMapping(value = "/checkCoachSummary", method = RequestMethod.POST) public void checkCoachSummary(HttpServletRequest request, HttpServletResponse response) { response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/html;charset=UTF-8"); try { String coachmainId = request.getParameter("coachmainId"); CoachMain cm = new CoachMain(); cm.setCoachmainId(Integer.parseInt(coachmainId)); cm.setSumImprove(request.getParameter("sumImprove")); cm.setSumSuggest(request.getParameter("sumSuggest")); String userid = String.valueOf(request .getAttribute(Constans.USER_INFO_USERID)); cm.setSumCreateUserId(Integer.parseInt(userid)); int result = coachService.updateCoachSummary(cm); JSONObject json = new JSONObject(); json.put("data", result); response.getWriter().print(json); } catch (Exception e) { log.error("督导审核辅导总结操作:" + e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects( new Object[] { e.getMessage() })); } } //@RequiresPermissions("coach:query") @Log(methodname = "deleteCoachInfo", modulename = "辅导计划", funcname = "删除辅导周计划", description = "删除辅导周计划,{0}", code = "ZJ") @RequestMapping(value = "/deleteCoachInfo", method = RequestMethod.POST) public void deleteCoachInfo(HttpServletRequest request,HttpServletResponse response){ response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/html;charset=UTF-8"); String id = request.getParameter("id"); boolean blag=coachService.deleteCoachInfo(Integer.parseInt(id)); JSONObject json=new JSONObject(); json.put("blag", blag); try { response.getWriter().print(json); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{"操作成功,周计划id:"+id})); } catch (IOException e) { log.error("删除周计划异常:"+e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{e.getMessage()})); } } @RequiresPermissions("coach:zjsub") @Log(methodname = "addCoachzj", modulename = "辅导计划", funcname = "新增辅导周总结", description = "辅导总结添加,{0}", code = "ZJ") @RequestMapping(value = "/addCoachzj", method = RequestMethod.POST) public void addCoachzj(HttpServletRequest request,HttpServletResponse response,CoachMain coach){ response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/html;charset=UTF-8"); String sumCoachproject=request.getParameter("sumCoachproject"); sumCoachproject=sumCoachproject.substring(0, sumCoachproject.lastIndexOf(",")); String coachmainId=request.getParameter("coachmainId"); String sumSummarize=request.getParameter("sumSummarize"); String isgj=request.getParameter("isgj"); String qcremark=request.getParameter("qcremark"); coach.setSumCoachproject(sumCoachproject); coach.setCoachmainId(Integer.parseInt(coachmainId)); coach.setSumSummarize(sumSummarize); coach.setIsgj(isgj); coach.setQcremark(qcremark); coach.setSumImprove("2"); boolean blag=coachService.updatezjBycoachmainid(coach); JSONObject json=new JSONObject(); json.put("blag", blag); try { response.getWriter().print(json); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{"操作成功:对应月计划id:"+coachmainId})); } catch (IOException e) { log.error("新增辅导总结异常:"+e.getMessage()); LogUitls.setArgs(LogDescriptionArgsObject.newInstant().setObjects(new Object[]{e.getMessage()})); } } @RequiresPermissions("csrcoach:query") @RequestMapping(value = "/getCoachInfo", method = RequestMethod.POST) public void getCoachInfo(HttpServletRequest request,HttpServletResponse response){ response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/html;charset=UTF-8"); String acceptorWorkId=request.getParameter("acceptorWorkId"); String starttime=request.getParameter("starttime"); String endtime=request.getParameter("endtime"); CoachInfo coac=new CoachInfo(); coac.setAcceptorWorkId(acceptorWorkId); coac.setStarttime(starttime); coac.setEndtime(endtime); List<CoachInfo> listcoac=coachService.selectByinfo(coac); int total=coachService.selectByinfoCount(coac); String json = "{\"Total\":" + total + " , \"Rows\":" + JSONArray.fromObject(listcoac).toString() + "}"; try { System.out.println(json.toString()); response.getWriter().print(json.toString()); } catch (IOException e) { log.error("获取辅导周计划列表异常:"+e.getMessage()); } } }
[ "857876576@qq.com" ]
857876576@qq.com
e5c8cdfedafd3e2a190df20775b508d1d5c68bd9
926e6cc22f2b93d23fef94eafb2f555d18e1ebd9
/Testing2/src/com/example/testing2/MainActivity.java
4ec1bf5348b76b9ce6f1f0bf2910bc8582ed1b1e
[]
no_license
saqibkhalil91/testing3
7de617af4514e975c6d1a8284005b46a498d601d
b454bab8e97ce8eaa04dd6999d6ab1c7b5682302
refs/heads/master
2021-01-10T21:05:52.298588
2015-02-04T12:01:42
2015-02-04T12:01:42
30,296,682
0
0
null
null
null
null
UTF-8
Java
false
false
927
java
package com.example.testing2; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "saqib.khalil@coeus-solutions.de" ]
saqib.khalil@coeus-solutions.de
c0e6aea22f2cd726fa5e534e6a1c26958cb94a9e
17ff2215de0d27829c7ce9c285e84abecc1654cf
/Test_ReactNative_NativeModules/android/app/src/main/java/com/test_reactnative_nativemodules/MainActivity.java
081aa67b03f5200ffeed05708cb23ddd4f649d88
[ "MIT" ]
permissive
ksti/Test_react-native-nativeModules
e04873e19d6d0fcda57a7647f0e2290e16c113ac
51eda398f03931e6bbc028cc2b21005c91d64ebb
refs/heads/master
2021-01-20T07:15:12.681606
2017-06-21T12:09:13
2017-06-21T12:09:13
89,982,917
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package com.test_reactnative_nativemodules; import com.facebook.react.ReactActivity; public class MainActivity extends ReactActivity { /** * Returns the name of the main component registered from JavaScript. * This is used to schedule rendering of the component. */ @Override protected String getMainComponentName() { return "Test_ReactNative_NativeModules"; } }
[ "1353990812@qq.com" ]
1353990812@qq.com
16dc38298cb10d76f4f4df8f6a7d7a1c7ea3b6a7
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/openhab--openhab1-addons/fa12b4995431363abd730bab812fbdf659cb459a/after/RFXComHumidityMessage.java
f4f9cd315f2e143452573284b6b087e0de695cb4
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
5,608
java
/** * Copyright (c) 2010-2013, openHAB.org and others. * * 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 */ package org.openhab.binding.rfxcom.internal.messages; import java.util.Arrays; import java.util.List; import javax.xml.bind.DatatypeConverter; import org.openhab.binding.rfxcom.RFXComValueSelector; import org.openhab.binding.rfxcom.internal.RFXComException; import org.openhab.core.library.items.NumberItem; import org.openhab.core.library.items.StringItem; import org.openhab.core.library.types.DecimalType; import org.openhab.core.library.types.StringType; import org.openhab.core.types.State; import org.openhab.core.types.Type; import org.openhab.core.types.UnDefType; /** * RFXCOM data class for humidity message. * * @author Pauli Anttila, Jan Sjölander * @since 1.4.0 */ public class RFXComHumidityMessage extends RFXComBaseMessage { public enum SubType { LACROSSE_TX3(1), LACROSSE_WS2300(2), UNKNOWN(255); private final int subType; SubType(int subType) { this.subType = subType; } SubType(byte subType) { this.subType = subType; } public byte toByte() { return (byte) subType; } } public enum HumidityStatus { NORMAL(0), COMFORT(1), DRY(2), WET(3), UNKNOWN(255); private final int humidityStatus; HumidityStatus(int humidityStatus) { this.humidityStatus = humidityStatus; } HumidityStatus(byte humidityStatus) { this.humidityStatus = humidityStatus; } public byte toByte() { return (byte) humidityStatus; } } private final static List<RFXComValueSelector> supportedValueSelectors = Arrays .asList(RFXComValueSelector.RAW_DATA, RFXComValueSelector.SIGNAL_LEVEL, RFXComValueSelector.BATTERY_LEVEL, RFXComValueSelector.HUMIDITY, RFXComValueSelector.HUMIDITY_STATUS); public SubType subType = SubType.LACROSSE_TX3; public int sensorId = 0; public byte humidity = 0; public HumidityStatus humidityStatus = HumidityStatus.NORMAL; public byte signalLevel = 0; public byte batteryLevel = 0; public RFXComHumidityMessage() { packetType = PacketType.HUMIDITY; } public RFXComHumidityMessage(byte[] data) { encodeMessage(data); } @Override public String toString() { String str = ""; str += super.toString(); str += "\n - Sub type = " + subType; str += "\n - Id = " + sensorId; str += "\n - Humidity = " + humidity; str += "\n - Humidity status = " + humidityStatus; str += "\n - Signal level = " + signalLevel; str += "\n - Battery level = " + batteryLevel; return str; } @Override public void encodeMessage(byte[] data) { super.encodeMessage(data); try { subType = SubType.values()[super.subType]; } catch (Exception e) { subType = SubType.UNKNOWN; } sensorId = (data[4] & 0xFF) << 8 | (data[5] & 0xFF); humidity = data[6]; try { humidityStatus = HumidityStatus.values()[data[7]]; } catch (Exception e) { humidityStatus = HumidityStatus.UNKNOWN; } signalLevel = (byte) ((data[8] & 0xF0) >> 4); batteryLevel = (byte) (data[8] & 0x0F); } @Override public byte[] decodeMessage() { byte[] data = new byte[9]; data[0] = 0x0A; data[1] = RFXComBaseMessage.PacketType.HUMIDITY.toByte(); data[2] = subType.toByte(); data[3] = seqNbr; data[4] = (byte) ((sensorId & 0xFF00) >> 8); data[5] = (byte) (sensorId & 0x00FF); data[6] = humidity; data[7] = humidityStatus.toByte(); data[8] = (byte) (((signalLevel & 0x0F) << 4) | (batteryLevel & 0x0F));// Janne return data; } @Override public String generateDeviceId() { return String.valueOf(sensorId); } @Override public State convertToState(RFXComValueSelector valueSelector) throws RFXComException { org.openhab.core.types.State state = UnDefType.UNDEF; if (valueSelector.getItemClass() == NumberItem.class) { if (valueSelector == RFXComValueSelector.SIGNAL_LEVEL) { state = new DecimalType(signalLevel); } else if (valueSelector == RFXComValueSelector.BATTERY_LEVEL) { state = new DecimalType(batteryLevel); } else if (valueSelector == RFXComValueSelector.HUMIDITY) { state = new DecimalType(humidity); } else { throw new RFXComException("Can't convert " + valueSelector + " to NumberItem"); } } else if (valueSelector.getItemClass() == StringItem.class) { if (valueSelector == RFXComValueSelector.RAW_DATA) { state = new StringType( DatatypeConverter.printHexBinary(rawMessage)); } else if (valueSelector == RFXComValueSelector.HUMIDITY_STATUS) { state = new StringType(humidityStatus.toString()); } else { throw new RFXComException("Can't convert " + valueSelector + " to StringItem"); } } else { throw new RFXComException("Can't convert " + valueSelector + " to " + valueSelector.getItemClass()); } return state; } @Override public void convertFromState(RFXComValueSelector valueSelector, String id, Object subType, Type type, byte seqNumber) throws RFXComException { throw new RFXComException("Not supported"); } @Override public Object convertSubType(String subType) throws RFXComException { for (SubType s : SubType.values()) { if (s.toString().equals(subType)) { return s; } } throw new RFXComException("Unknown sub type " + subType); } @Override public List<RFXComValueSelector> getSupportedValueSelectors() throws RFXComException { return supportedValueSelectors; } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
72a4cff57dd01ced9346d2c0d7b382daf4e7767f
a6601b596747a102433a1aa063745dc4a9e3ff26
/backend/src/test/java/com/devsuperior/dscatalog/resources/ProductResourceTests.java
9ec7da6c4f1c37e43ddae37005a4d5892386d144
[]
no_license
marcosviniciusam90/dscatalog-bds
7740a14b61d128f39f17b5e3c5a2dc4c376379dd
6853f6cc9199fca475df55e5751dad377a2f9ab3
refs/heads/master
2023-07-03T05:07:30.249635
2021-07-26T23:00:41
2021-07-26T23:00:41
366,542,540
0
0
null
null
null
null
UTF-8
Java
false
false
7,358
java
package com.devsuperior.dscatalog.resources; import com.devsuperior.dscatalog.dto.ProductDTO; import com.devsuperior.dscatalog.services.ProductService; import com.devsuperior.dscatalog.services.exceptions.DatabaseIntegrityException; import com.devsuperior.dscatalog.services.exceptions.ResourceNotFoundException; import com.devsuperior.dscatalog.utils.Factory; import com.devsuperior.dscatalog.utils.TokenUtil; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import java.util.List; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @AutoConfigureMockMvc class ProductResourceTests { private static final String API_ENDPOINT = "/products"; @Autowired private MockMvc mockMvc; @MockBean private ProductService productService; @Autowired private ObjectMapper objectMapper; @Autowired private TokenUtil tokenUtil; private String accessToken; private Long existingId; private Long nonExistingId; private Long dependentId; private ProductDTO productDTO; private PageImpl<ProductDTO> page; @BeforeEach void setUp() throws Exception { accessToken = tokenUtil.obtainAccessToken(mockMvc, "maria@gmail.com", "123456"); existingId = 1L; nonExistingId = 2L; dependentId = 3L; productDTO = Factory.createProductDTO(); page = new PageImpl<>(List.of(productDTO)); when(productService.find(any(String.class), any(Long.class), any(Pageable.class))).thenReturn(page); when(productService.findById(existingId)).thenReturn(productDTO); when(productService.findById(nonExistingId)).thenThrow(ResourceNotFoundException.class); when(productService.update(eq(existingId), any(ProductDTO.class))).thenReturn(productDTO); when(productService.update(eq(nonExistingId), any(ProductDTO.class))).thenThrow(ResourceNotFoundException.class); doNothing().when(productService).delete(existingId); doThrow(ResourceNotFoundException.class).when(productService).delete(nonExistingId); doThrow(DatabaseIntegrityException.class).when(productService).delete(dependentId); when(productService.create(any(ProductDTO.class))).thenReturn(productDTO); } @Test void findShouldReturnPage() throws Exception { ResultActions result = mockMvc.perform(get(API_ENDPOINT) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isOk()); } @Test void findByIdShouldReturnProductDTOWhenIdExists() throws Exception { ResultActions result = mockMvc.perform(get(API_ENDPOINT + "/{id}", existingId) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isOk()); result.andExpect(jsonPath("$.id").exists()); result.andExpect(jsonPath("$.name").exists()); result.andExpect(jsonPath("$.description").exists()); } @Test void findByIdShouldReturnNotFoundWhenIdDoesNotExist() throws Exception { ResultActions result = mockMvc.perform(get(API_ENDPOINT + "/{id}", nonExistingId) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isNotFound()); } @Test void updateShouldReturnProductDTOWhenIdExists() throws Exception { String jsonBody = objectMapper.writeValueAsString(productDTO); ResultActions result = mockMvc.perform(put(API_ENDPOINT + "/{id}", existingId) .header("Authorization", "Bearer " + accessToken) .content(jsonBody) .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isOk()); result.andExpect(jsonPath("$.id").exists()); result.andExpect(jsonPath("$.name").exists()); result.andExpect(jsonPath("$.description").exists()); } @Test void updateShouldReturnNotFoundWhenIdDoesNotExist() throws Exception{ String jsonBody = objectMapper.writeValueAsString(productDTO); ResultActions result = mockMvc.perform(put(API_ENDPOINT + "/{id}", nonExistingId) .header("Authorization", "Bearer " + accessToken) .content(jsonBody) .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isNotFound()); } @Test void createShouldReturnStatusCreatedAndProductDTO() throws Exception { String jsonBody = objectMapper.writeValueAsString(productDTO); ResultActions result = mockMvc.perform(post(API_ENDPOINT) .header("Authorization", "Bearer " + accessToken) .content(jsonBody) .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isCreated()); result.andExpect(jsonPath("$.id").exists()); result.andExpect(jsonPath("$.name").exists()); result.andExpect(jsonPath("$.description").exists()); } @Test void deleteShouldReturnNoContentWhenIdExists() throws Exception { ResultActions result = mockMvc.perform(delete(API_ENDPOINT + "/{id}", existingId) .header("Authorization", "Bearer " + accessToken) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isNoContent()); } @Test void deleteShouldReturnNotFoundWhenIdDoesNotExist() throws Exception { ResultActions result = mockMvc.perform(delete(API_ENDPOINT + "/{id}", nonExistingId) .header("Authorization", "Bearer " + accessToken) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isNotFound()); } @Test void deleteShouldReturnBadRequestWhenIdIsDependent() throws Exception { ResultActions result = mockMvc.perform(delete(API_ENDPOINT + "/{id}", dependentId) .header("Authorization", "Bearer " + accessToken) .accept(MediaType.APPLICATION_JSON)); result.andExpect(status().isBadRequest()); } }
[ "marcos.mendonca@matera.com" ]
marcos.mendonca@matera.com
f8744ad74085dc2274311132ccad117f654d8efc
732364cc898d998585418e7374f18cc89bbeef9e
/src/domain/Query.java
ca340e2e905ba52ce664855349c17cb2e3bc1064
[]
no_license
proyectocoviditcm2020/SEIMR_RS_Simulador
55499f28a389e2320048d763971a20225bb7ebce
0f86b1be6ec25ff6abd5d537a5e3f3f638e80b68
refs/heads/master
2023-03-12T22:46:08.032608
2021-03-03T00:59:14
2021-03-03T00:59:14
343,954,020
0
0
null
null
null
null
UTF-8
Java
false
false
1,834
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 domain; import java.util.ArrayList; import java.util.HashMap; import optimization.problems.Covid19; /** * * @author thinkpad */ public class Query { public enum DataType { RECOVERY_DATA, DEATH_DATA; }; private HashMap<DataType, ArrayList<Double>> data; private Covid19.SerieType problemType; private int iterations; private int populationSize; private int executions; public Query(HashMap<DataType, ArrayList<Double>> data, Covid19.SerieType problemType, int iterations, int populationSize, int executions) { this.data = data; this.problemType = problemType; this.iterations = iterations; this.populationSize = populationSize; this.executions = executions; } public HashMap<DataType, ArrayList<Double>> getData() { return data; } public void setData(HashMap<DataType, ArrayList<Double>> data) { this.data = data; } public Covid19.SerieType getProblemType() { return problemType; } public void setProblemType(Covid19.SerieType problemType) { this.problemType = problemType; } public int getIterations() { return iterations; } public void setIterations(int iterations) { this.iterations = iterations; } public int getPopulationSize() { return populationSize; } public void setPopulationSize(int populationSize) { this.populationSize = populationSize; } public int getExecutions() { return executions; } public void setExecutions(int executions) { this.executions = executions; } }
[ "al_x3@VesselPC" ]
al_x3@VesselPC
3552aa469ea4b8ea2fd9d7a4b4a5a1e4b5171649
79311e69ff73e74554d785557cf3f16ca816e8aa
/app.about/src/main/java/com/rmbmiss/app/about/MainActivity.java
be7e4446d40daf8910b236e73ae5775b4c7ee553
[]
no_license
PanGuDaShen/SuperGods
628cda5fdb1d42e01e38eaa45ce84d4387e18e8d
181ab941f28826430693fc3fc9e3c83311201fc5
refs/heads/master
2021-01-01T18:39:52.016625
2017-08-25T07:10:08
2017-08-25T07:10:08
98,397,516
0
1
null
null
null
null
UTF-8
Java
false
false
334
java
package com.rmbmiss.app.about; 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); } }
[ "1135913362@qq.com" ]
1135913362@qq.com
e7b950c704744a16cdb24111db20220cf0b191b4
6164a623437d9d8345a36387efa2617525f5195f
/app/src/main/java/com/example/sekankun/app/PlateEditOnImageView.java
8f0eb1fed8181b477bb43232980e2af2e30dc6a3
[]
no_license
gzock/SeKanKun
b3b38ac2cf0fae9de78a19d3b5f1f884d17c7dee
396383878679eb7ddebe4fe1d91205edc4d17a33
refs/heads/master
2020-03-26T20:06:34.090911
2014-05-02T02:13:57
2014-05-02T02:13:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,366
java
package com.example.sekankun.app; import android.content.pm.ActivityInfo; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Environment; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import java.io.File; public class PlateEditOnImageView extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_plate_edit_on_image_view); //施工看板 TextView constructName = (TextView)findViewById(R.id.constructName); constructName.setText("テスト"); TextView constructField = (TextView)findViewById(R.id.constructField); constructField.setText(SekouKanriDB.getCurrentBuilding() + " " + SekouKanriDB.getCurrentFloor() + " " + SekouKanriDB.getCurrentRoom()); TextView constructContent = (TextView)findViewById(R.id.constructContent); constructContent.setText(SekouKanriDB.getCurrentTarget()); TextView constructBeAf = (TextView)findViewById(R.id.constructBeAf); constructBeAf.setText(SekouKanriDB.getWhichBeforeAfter()); String pictureTargetName = null; Bundle extras; extras = getIntent().getExtras(); pictureTargetName = extras.getString("pictureTargetName"); File dir = new File(Environment.getExternalStorageDirectory().getPath() + "/test"); if(dir.exists()){ Log.d("MyApp", "/test ok"); Log.d("MyApp", "FileName -> " + pictureTargetName); Log.d("MyApp", "DirName -> " + dir.getAbsolutePath()); File file = new File(dir.getAbsolutePath() + "/" + pictureTargetName); if (file.exists()) { Log.d("MyApp", "Path -> " + file.getPath()); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); Bitmap _bm = BitmapFactory.decodeFile(file.getPath()); ((ImageView)findViewById(R.id.imageView)).setImageBitmap(_bm); }else{ //存在しない Log.d("MyApp","Not Exist Picture..."); } } // ドラッグ対象Viewとイベント処理クラスを紐付ける LinearLayout dragView = (LinearLayout) findViewById(R.id.plateBase); DragViewListener listener = new DragViewListener(dragView); dragView.setOnTouchListener(listener); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.plate_edit_on_image_view, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
[ "gzock0308@hotmail.co.jp" ]
gzock0308@hotmail.co.jp
bc34814c858658b5859d131b9d91032737a8a4b9
659e8734f163d2d05248364d3f6bb3820d8e41f3
/src/main/java/com/example/homemediaplayer/repositories/TagRepository.java
22621052e3c2613effc585fb673bdb90a0a48b16
[]
no_license
Kostyansa/YouTube-API-test-project
8bc49b19aa0a27583286008211bc8b05a3c44894
e64480b035270eeec591136acd6834c0f69de486
refs/heads/master
2022-07-31T05:42:44.409142
2020-05-22T14:57:15
2020-05-22T14:57:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
303
java
package com.example.homemediaplayer.repositories; import com.example.homemediaplayer.entity.Tag; import java.util.List; public interface TagRepository { List<Tag> get(); Tag get(Long id); Tag get(String value); List<Tag> get(String... tags); void insertTag(String... values); }
[ "kostyansa@gmail.com" ]
kostyansa@gmail.com
57b99ab1f3227e032673c4a480c5c48b084f4c36
57a1b1e6fec1d686ca614a0d3d1d13aff983924d
/app/src/main/java/com/example/deshan/mad_sims/Attendance/DatabaseHelper.java
8bd5666fc3f6caf258ab643187f30a16dc73233c
[]
no_license
DeshanFernando/MAD_SIMS
73ed132d49acb68a8ecf77ddf93366b187c48634
31cc61a22a86e193a226a7ec8f837f203725a109
refs/heads/master
2020-03-27T04:56:35.578958
2018-10-07T05:05:45
2018-10-07T05:05:45
145,980,663
0
5
null
2018-10-07T05:05:46
2018-08-24T10:57:56
Java
UTF-8
Java
false
false
2,489
java
package com.example.deshan.mad_sims.Attendance; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DatabaseHelper extends SQLiteOpenHelper { public DatabaseHelper(Context context) { super(context,"Attendance.db" , null, 1); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("create table attendance (id integer primary key autoincrement,subject text,type text,date text )"); } @Override public void onUpgrade(SQLiteDatabase db, int i, int i1) { db.execSQL("drop table if exists attendance"); } public boolean insertData(String subject, String type, String date){ SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put("subject", subject); contentValues.put("type", type); contentValues.put("date", date); long result = db.insert("attendance", null, contentValues); if(result == -1) return false; else return true; } public Cursor getAllData(){ SQLiteDatabase db = this.getWritableDatabase(); Cursor res = db.rawQuery("select * from attendance", null); return res; } public Cursor getForUpdate(String id){ SQLiteDatabase db = this.getWritableDatabase(); Cursor res = db.rawQuery("SELECT * FROM attendance WHERE id = ?", new String[]{ id }); return res; } public int updateData(String id, String subject, String type, String date) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put("id", id); contentValues.put("subject", subject); contentValues.put("type", type); contentValues.put("date", date); int i = db.update("attendance", contentValues , "id = ?", new String[] {id}); return i; } public int deleteData(String id){ SQLiteDatabase db = this.getWritableDatabase(); return db.delete("attendance", "id = ?", new String[] {id}); } public Cursor getSubData(String sub){ SQLiteDatabase db = this.getWritableDatabase(); Cursor res = db.rawQuery("SELECT * FROM attendance WHERE subject = ?", new String[]{ sub }); return res; } }
[ "deshanprabuddha13@gmail.com" ]
deshanprabuddha13@gmail.com
9aad53b92810f98aada8212487d1eb652c619183
d99806bb17e4a22325f775539981c6b7799b9d16
/nsheets/src/main/java/pt/isep/nsheets/client/application/code/CodeModule.java
3e4edc9f34944d9f3984045b683465e10ff65b5e
[]
no_license
Fuel4us/GWTFinalProject
3d0e1194f142cfcbdfc3d24f37a7537ff3a30dfb
b6c2f6add1687ca7800a9ec243edbe067ca6090c
refs/heads/master
2020-03-21T19:47:13.534718
2018-06-28T05:33:43
2018-06-28T05:33:43
138,969,901
0
0
null
null
null
null
UTF-8
Java
false
false
344
java
package pt.isep.nsheets.client.application.code; import com.gwtplatform.mvp.client.gin.AbstractPresenterModule; public class CodeModule extends AbstractPresenterModule { @Override protected void configure() { bindPresenter(CodePresenter.class, CodePresenter.MyView.class, CodeView.class, CodePresenter.MyProxy.class); } }
[ "1050475@isep.ipp.pt" ]
1050475@isep.ipp.pt
1bf32768974ce1120bb05896a176105d6d45b7b6
4e01884e2e806c96179f396b933c7a14b671a69d
/src/main/java/com/gft/restservice/model/Geolocation.java
6daae7afd15afd41ef1850a3f37340f2a4c4a26d
[ "MIT" ]
permissive
rgutialo/shop-restful-service
3090db8b48c09e1d7f814ad8089c6df78f6e7938
f5f5a75760ea4f2a41dfe66da4cc6cd2abde08a0
refs/heads/master
2021-01-19T21:40:38.719005
2017-04-21T16:47:59
2017-04-21T16:47:59
88,686,010
0
0
null
null
null
null
UTF-8
Java
false
false
1,624
java
package com.gft.restservice.model; import java.io.Serializable; import com.fasterxml.jackson.annotation.JsonIgnore; import com.gft.restservice.services.GeoService; /** * Base class for Geolocation Entity * * @author Raul Gutierrez */ public class Geolocation implements Serializable { private Double latitude; private Double longitude; // calculated data from latitude and longitude in runtime @JsonIgnore private transient Double distance; private static final long serialVersionUID = 6210366512436661558L; public Geolocation() { this.latitude = null; this.longitude = null; this.distance = null; } public Geolocation(Double lat, Double lon, Double hereLat, Double hereLon) { this.latitude = lat; this.longitude = lon; if (hereLat == null || hereLon == null) this.distance = null; else setDistanceKm(hereLat, hereLon); } public Double getLatitude() { return latitude; } public void setLatitude(Double latitude) { this.latitude = latitude; } public Double getLongitude() { return longitude; } public void setLongitude(Double longitude) { this.longitude = longitude; } /** * Sets the distance in kilometers from a place to the point placed in the * instance object * * @param lat * latitude's point * @param lon * longitude's point * */ public void setDistanceKm(Double lat, Double lon) { this.distance = GeoService.getDistance(this.getLatitude(), this.getLongitude(), lat, lon); } public Double getDistance() { return distance; } public void setDistance(Double distance) { this.distance = distance; } }
[ "raul.gutialo@gmail.com" ]
raul.gutialo@gmail.com
ed0f9ce6099c1e8dcc28cd2286e4f1ed8e7d61bd
f6e5f4852b75dee46ea7937de105d6805c067a54
/injured-web-manager/target/classes/com/injured/common/utils/ExceptionUtil.java
bad2390704b7113a1fe7225755fee3ee3d259451
[ "MIT" ]
permissive
XuanYuanWuDi/springboot-demo
e0ac138a35d6d1ff7f72a2bba896efb2732d1aa5
4eb08f87fce9fcc34612bb06b9049d741eda0a00
refs/heads/master
2022-12-25T23:57:01.628568
2019-11-29T10:04:58
2019-11-29T10:04:58
224,823,311
0
0
null
2022-12-10T05:42:55
2019-11-29T09:39:51
Java
UTF-8
Java
false
false
1,009
java
package com.injured.common.utils; import java.io.PrintWriter; import java.io.StringWriter; import org.apache.commons.lang3.exception.ExceptionUtils; import com.injured.common.utils.StringUtils; /** * 错误信息处理类。 * * @author lzx */ public class ExceptionUtil { /** * 获取exception的详细错误信息。 */ public static String getExceptionMessage(Throwable e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw, true)); String str = sw.toString(); return str; } public static String getRootErrorMseeage(Exception e) { Throwable root = ExceptionUtils.getRootCause(e); root = (root == null ? e : root); if (root == null) { return ""; } String msg = root.getMessage(); if (msg == null) { return "null"; } return StringUtils.defaultString(msg); } }
[ "15330053776@163.com" ]
15330053776@163.com
2e564ebcc2d513fb2810e905c5377d9c1e96e4c0
b5c3597057a0f14a7f4d09d322096fa5141f9da3
/ASS2.java
85ca11bfa8bf8748d1ad2f0532e9bd003a535cfa
[]
no_license
jeongyj789/lecture
d5a74ebecd7ddafcfb7aead075f85d4906e0858a
74ef130eab057d933a04234e6fb4239fe5cb16b9
refs/heads/master
2022-11-09T00:16:31.551341
2020-06-25T09:34:48
2020-06-25T09:34:48
253,532,029
0
0
null
null
null
null
UHC
Java
false
false
2,773
java
<<<<<<< HEAD import java.util.Scanner; import java.util.Stack; class Stacks<E> { private E data[]; private int top; private int length; public Stacks(int size) { data = (E[]) new Object[size]; top = 0; length = 0; } // push public void push(E newItem) { data[top++] = newItem; } // pop public void pop() { if(top>0) top--; } // top public E top() { return data[top-1]; } // empty public boolean empty() { return top==0; } public int empty1() { // 공백 여부 if (length ==0) { return 1; } else return 0; } } public class ASS2 { public static void main(String[] args) { // TODO Auto-generated method stub // 아치선이 겹치는 부분이 없어야 좋은단어이다. // A와B가 인접해야 한다. Scanner sc = new Scanner(System.in); Stacks<Character> stack = new Stacks<Character>(100000); int num = sc.nextInt(); // 입력할 문자열 갯수 sc.nextLine(); int result=0; // for(int i=0; i<num; i++) { String input = sc.nextLine(); // 문자열 입력 ABAB, AABB, ABBA for(int j=0; j<input.length(); j++) { if (!stack.empty() && input.charAt(j) == stack.top()) { // 빈공간이 아니면서 stack의 top 값과 같을경우 stack.pop(); } else {stack.push(input.charAt(j)); } } if(!stack.empty()) { // '(' 하나만 입력한 경우 제외 result++; } } System.out.println(result); } } ======= import java.util.Scanner; class Stack<E> { private E data[]; private int top; public Stack(int size) { data = (E[]) new Object[size]; top = 0; } // push public void push(E newItem) { data[top++] = newItem; } // pop public void pop() { if(top>0) top--; } // top public E top() { return data[top-1]; } // empty public boolean empty() { return top==0; } } public class ASS2 { public static void main(String[] args) { // TODO Auto-generated method stub // 아치선이 겹치는 부분이 없어야 좋은단어이다. // A와B가 인접해야 한다. Scanner sc = new Scanner(System.in); Stack<Character> stack = new Stack<Character>(100000); int num = sc.nextInt(); // 입력할 문자열 갯수 sc.nextLine(); int result=0; // for(int i=0; i<num; i++) { System.out.println(i); String input = sc.nextLine(); // 문자열 입력 ABAB, AABB, ABBA for(int j=0; j<input.length(); j++) { if (!stack.empty() && input.charAt(j) == stack.top()) { // 빈공간이 아니면서 stack의 top 값과 같을경우 stack.pop(); } else {stack.push(input.charAt(j)); } } if(stack.empty()) {result++; } } System.out.println(result); } } >>>>>>> 0549d8a1f7a3bf940967035b44651d5e5a22bb13
[ "jeongyj789@naver.com" ]
jeongyj789@naver.com
6cacd671e722c1c3bd6a90692917e8e2e6af4bf3
5a8f49229f5578e8fd3de721997381a144c7e799
/GuessBirthday.java
f9031ae964ab9fd6f879408e1549f1c0f7ca9ada
[]
no_license
AbrahamMtz007/PA7B
df4a04c6a226a6bae917dc19af9edd4c165ad52f
9985af4827b86eef33f44d7dd54b1f785989b945
refs/heads/master
2021-07-25T16:13:37.938270
2018-12-10T22:29:13
2018-12-10T22:29:13
147,430,456
0
0
null
null
null
null
UTF-8
Java
false
false
1,972
java
import java.util.Scanner; public class GuessBirthday{ public static void main(String[] args) { String set1 = "1 3 5 7 \n" + "9 11 13 15 \n" + "17 19 21 23 \n" + "25 27 29 31"; String set2 = "2 3 6 7 \n" + "10 11 14 15 \n" + "18 19 22 23 \n" + "26 27 30 31"; String set3 = "4 5 6 7 \n" + "12 13 14 15 \n" + "20 21 22 23 \n" + "28 29 30 31"; String set4 = "8 9 10 11 \n" + "12 13 14 15 \n" + "24 25 26 27 \n" + "28 29 30 31"; String set5 = "16 17 18 19 \n" + "20 21 22 23 \n" + "24 25 26 27 \n" + "28 29 30 31"; Scanner input = new Scanner(System.in); int day = 0; System.out.println("is your birthday in set1??\n"); System.out.println(set1); System.out.println("\n Enter 0 for NO and 1 for YES: "); int answer = input.nextInt(); if (answer == 1) { //day = day +1; //acumulador day+=1; } System.out.println("is your birthday in set2??\n"); System.out.println(set2); System.out.println("\n Enter 0 for NO and 1 for YES: "); answer = input.nextInt(); if (answer == 1) { day+=2; } System.out.println("is your birthday in set3??\n"); System.out.println(set3); System.out.println("\n Enter 0 for NO and 1 for YES: "); answer = input.nextInt(); if (answer == 1) { day+=4; } System.out.println("is your birthday in set4??\n"); System.out.println(set4); System.out.println("\n Enter 0 for NO and 1 for YES: "); answer = input.nextInt(); if (answer == 1) { day+=8; } System.out.println("is your birthday in set5??\n"); System.out.println(set5); System.out.println("\n Enter 0 for NO and 1 for YES: "); answer = input.nextInt(); if (answer == 1) { day+=16; } System.out.println("\n Your birthday is "+ day); } }
[ "lighestal009@gmail.com" ]
lighestal009@gmail.com
c3d31f406b7ace64424083f3383c36d3266af502
573b9c497f644aeefd5c05def17315f497bd9536
/src/main/java/com/alipay/api/response/AlipayDataDataserviceAdUserbalanceOnlineResponse.java
482d6dd20ca9717d70826d7538662821507d26d3
[ "Apache-2.0" ]
permissive
zzzyw-work/alipay-sdk-java-all
44d72874f95cd70ca42083b927a31a277694b672
294cc314cd40f5446a0f7f10acbb5e9740c9cce4
refs/heads/master
2022-04-15T21:17:33.204840
2020-04-14T12:17:20
2020-04-14T12:17:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
877
java
package com.alipay.api.response; import java.util.List; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.data.dataservice.ad.userbalance.online response. * * @author auto create * @since 1.0, 2019-11-01 10:52:57 */ public class AlipayDataDataserviceAdUserbalanceOnlineResponse extends AlipayResponse { private static final long serialVersionUID = 5421236288944253692L; /** * 操作成功投放账户id列表 */ @ApiListField("success_user_id_list") @ApiField("number") private List<Long> successUserIdList; public void setSuccessUserIdList(List<Long> successUserIdList) { this.successUserIdList = successUserIdList; } public List<Long> getSuccessUserIdList( ) { return this.successUserIdList; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
83084de963048f81042995b4475f22c55fcb1b73
75883a8317f5167bbb0542af49b2add27ff7e5e0
/subjects/components/code/commons-geometry/commons-geometry-spherical/src/main/java/org/apache/commons/geometry/spherical/twod/Transform2S.java
8ab514ddc31d85966d7206aaa86a19b79a506e68
[ "Apache-2.0", "LicenseRef-scancode-generic-cla", "MIT" ]
permissive
mitchellolsthoorn/SSBSE-Research-2021-crossover-replication
5162c72e74f291607f8b17f5679aba393ecc4d37
1c552ac94884621fe6fdc13ce9a2772f36087b20
refs/heads/main
2023-04-19T02:36:21.986651
2021-05-17T18:55:13
2021-05-17T18:55:13
362,049,944
0
0
null
null
null
null
UTF-8
Java
false
false
10,704
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.geometry.spherical.twod; import org.apache.commons.geometry.core.Transform; import org.apache.commons.geometry.euclidean.threed.AffineTransformMatrix3D; import org.apache.commons.geometry.euclidean.threed.Vector3D; import org.apache.commons.geometry.euclidean.threed.rotation.QuaternionRotation; /** Implementation of the {@link Transform} interface for spherical 2D points. * * <p>This class uses an {@link AffineTransformMatrix3D} to perform spherical point transforms * in Euclidean 3D space.</p> * * <p>Instances of this class are guaranteed to be immutable.</p> */ public final class Transform2S implements Transform<Point2S> { /** Static instance representing the identity transform. */ private static final Transform2S IDENTITY = new Transform2S(AffineTransformMatrix3D.identity()); /** Static transform instance that reflects across the x-y plane. */ private static final AffineTransformMatrix3D XY_PLANE_REFLECTION = AffineTransformMatrix3D.createScale(1, 1, -1); /** Euclidean transform matrix underlying the spherical transform. */ private final AffineTransformMatrix3D euclideanTransform; /** Construct a new instance from its underlying Euclidean transform. * @param euclideanTransform underlying Euclidean transform */ private Transform2S(final AffineTransformMatrix3D euclideanTransform) { this.euclideanTransform = euclideanTransform; } /** Get the Euclidean transform matrix underlying the spherical transform. * @return the Euclidean transform matrix underlying the spherical transform */ public AffineTransformMatrix3D getEuclideanTransform() { return euclideanTransform; } /** {@inheritDoc} */ @Override public Point2S apply(final Point2S pt) { final Vector3D vec = pt.getVector(); return Point2S.from(euclideanTransform.apply(vec)); } /** {@inheritDoc} */ @Override public boolean preservesOrientation() { return euclideanTransform.preservesOrientation(); } /** {@inheritDoc} */ @Override public Transform2S inverse() { return new Transform2S(euclideanTransform.inverse()); } /** Apply a rotation of {@code angle} radians around the given point to this instance. * @param pt point to rotate around * @param angle rotation angle in radians * @return transform resulting from applying the specified rotation to this instance */ public Transform2S rotate(final Point2S pt, final double angle) { return premultiply(createRotation(pt, angle)); } /** Apply a rotation of {@code angle} radians around the given 3D axis to this instance. * @param axis 3D axis of rotation * @param angle rotation angle in radians * @return transform resulting from applying the specified rotation to this instance */ public Transform2S rotate(final Vector3D axis, final double angle) { return premultiply(createRotation(axis, angle)); } /** Apply the given quaternion rotation to this instance. * @param quaternion quaternion rotation to apply * @return transform resulting from applying the specified rotation to this instance */ public Transform2S rotate(final QuaternionRotation quaternion) { return premultiply(createRotation(quaternion)); } /** Apply a reflection across the equatorial plane defined by the given pole point * to this instance. * @param pole pole point defining the equatorial reflection plane * @return transform resulting from applying the specified reflection to this instance */ public Transform2S reflect(final Point2S pole) { return premultiply(createReflection(pole)); } /** Apply a reflection across the equatorial plane defined by the given pole vector * to this instance. * @param poleVector pole vector defining the equatorial reflection plane * @return transform resulting from applying the specified reflection to this instance */ public Transform2S reflect(final Vector3D poleVector) { return premultiply(createReflection(poleVector)); } /** Multiply the underlying Euclidean transform of this instance by that of the argument, eg, * {@code other * this}. The returned transform performs the equivalent of * {@code other} followed by {@code this}. * @param other transform to multiply with * @return a new transform computed by multiplying the matrix of this * instance by that of the argument * @see AffineTransformMatrix3D#multiply(AffineTransformMatrix3D) */ public Transform2S multiply(final Transform2S other) { return multiply(this, other); } /** Multiply the underlying Euclidean transform matrix of the argument by that of this instance, eg, * {@code this * other}. The returned transform performs the equivalent of {@code this} * followed by {@code other}. * @param other transform to multiply with * @return a new transform computed by multiplying the matrix of the * argument by that of this instance * @see AffineTransformMatrix3D#premultiply(AffineTransformMatrix3D) */ public Transform2S premultiply(final Transform2S other) { return multiply(other, this); } /** {@inheritDoc} */ @Override public int hashCode() { return euclideanTransform.hashCode(); } /** * Return true if the given object is an instance of {@link Transform2S} * and the underlying Euclidean transform matrices are exactly equal. * @param obj object to test for equality with the current instance * @return true if the underlying transform matrices are exactly equal */ @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof Transform2S)) { return false; } final Transform2S other = (Transform2S) obj; return euclideanTransform.equals(other.euclideanTransform); } /** {@inheritDoc} */ @Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append(this.getClass().getSimpleName()) .append("[euclideanTransform= ") .append(getEuclideanTransform()) .append("]"); return sb.toString(); } /** Return an instance representing the identity transform. This transform is guaranteed * to return an <em>equivalent</em> (ie, co-located) point for any input point. However, the * points are not guaranteed to contain exactly equal coordinates. For example, at the poles, an * infinite number of points exist that vary only in the azimuth coordinate. When one of these * points is transformed by this identity transform, the returned point may contain a different * azimuth value from the input, but it will still represent the same location in space. * @return an instance representing the identity transform */ public static Transform2S identity() { return IDENTITY; } /** Create a transform that rotates the given angle around {@code pt}. * @param pt point to rotate around * @param angle angle of rotation in radians * @return a transform that rotates the given angle around {@code pt} */ public static Transform2S createRotation(final Point2S pt, final double angle) { return createRotation(pt.getVector(), angle); } /** Create a transform that rotates the given angle around {@code axis}. * @param axis 3D axis of rotation * @param angle angle of rotation in radians * @return a transform that rotates the given angle {@code axis} */ public static Transform2S createRotation(final Vector3D axis, final double angle) { return createRotation(QuaternionRotation.fromAxisAngle(axis, angle)); } /** Create a transform that performs the given 3D rotation. * @param quaternion quaternion instance representing the 3D rotation * @return a transform that performs the given 3D rotation */ public static Transform2S createRotation(final QuaternionRotation quaternion) { return new Transform2S(quaternion.toMatrix()); } /** Create a transform that performs a reflection across the equatorial plane * defined by the given pole point. * @param pole pole point defining the equatorial reflection plane * @return a transform that performs a reflection across the equatorial plane * defined by the given pole point */ public static Transform2S createReflection(final Point2S pole) { return createReflection(pole.getVector()); } /** Create a transform that performs a reflection across the equatorial plane * defined by the given pole point. * @param poleVector pole vector defining the equatorial reflection plane * @return a transform that performs a reflection across the equatorial plane * defined by the given pole point */ public static Transform2S createReflection(final Vector3D poleVector) { final QuaternionRotation quat = QuaternionRotation.createVectorRotation(poleVector, Vector3D.Unit.PLUS_Z); final AffineTransformMatrix3D matrix = quat.toMatrix() .premultiply(XY_PLANE_REFLECTION) .premultiply(quat.inverse().toMatrix()); return new Transform2S(matrix); } /** Multiply the Euclidean transform matrices of the arguments together. * @param a first transform * @param b second transform * @return the transform computed as {@code a x b} */ private static Transform2S multiply(final Transform2S a, final Transform2S b) { return new Transform2S(a.euclideanTransform.multiply(b.euclideanTransform)); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
d16e4b48c1e2233acac057ab12765bdcb4e71e34
8cb8dfc284ed5a378c401cbd3c518bc249c2d04f
/src/test/java/InventoryTest.java
001637ff9511a27fc1c11b9abae03983b0a19724
[]
no_license
london-coder/ITV-Kata-Java
60aaa064269349ac84ee9e4ec9cbedbc470baea4
8f68deaa6b409356409c7a17b288dd01248daf60
refs/heads/master
2021-01-02T09:29:51.262390
2017-08-09T23:15:11
2017-08-09T23:15:11
99,225,521
0
0
null
null
null
null
UTF-8
Java
false
false
442
java
package kata; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; public class InventoryTest { Inventory inv = new Inventory(); @Test public void inventorySize() { assertEquals(4, inv.inventory.size()); } @Test public void skuEntryA() { assertTrue(inv.inventory.containsKey("A")); } @Test public void skuEntryB() { assertTrue(inv.inventory.containsKey("B")); } }
[ "alan.lewis@objectaction.com" ]
alan.lewis@objectaction.com
8fc95d9ccc145fcc98ca0b75195ad96931eaef4f
a78ec961206c075b9c2dd6a12a576b4bf4036ae5
/BankSystem/src/Test/Test_01.java
f9ae6e150744d6e22de829fa01ceb5b3f8bdbf16
[]
no_license
zhoujunjie2018/myfirstgit
d0f763f33d8f81fea4be5546a827844d2a0d534b
7537f90381731595643fc750b9175b7562a79831
refs/heads/master
2020-03-19T03:00:50.812265
2018-06-09T16:10:35
2018-06-09T16:10:35
135,685,425
0
0
null
null
null
null
UTF-8
Java
false
false
149
java
package Test; public class Test_01 { public static void main(String[] args) { String str="zhubajie"; System.out.println(str.length()); } }
[ "307398944@qq.com" ]
307398944@qq.com
d1607d53f7e91f2f4ea6b37e9184bfd8e36e236f
7ec3eff10b192ef269c29f1a0b675d52633e47e5
/PeerAssessments/A1P2 - 2/Assignment1Part2/src/ca/utoronto/utm/jugpuzzle/Jug.java
86fd6869b677f8edb043dccf19ac6dc746c8b0b3
[]
no_license
aniaskudlarska/csc207
551c4fa89e98d9a499d7c86378418b69ff84b5b6
e728a04fdd9ba08b4581dc00a270e9a8e5ece397
refs/heads/master
2020-03-22T20:49:23.767598
2018-07-11T22:30:36
2018-07-11T22:30:36
140,633,684
0
0
null
null
null
null
UTF-8
Java
false
false
2,973
java
package ca.utoronto.utm.jugpuzzle; /** * Model a Jug and its contained liquid. The Jug has a non-negative amount of * liquid, and a capacity, the maximum amount of liquid the Jug can hold. At all * times 0<=amount<=capacity. * * @author arnold * */ public class Jug { private int capacity = 0; // Always 0<=capacity private int amount = 0; // Always 0<=amount<=capacity /** * Construct a Jug with the specified integers 0<=amount<=capacity. * If invalid capacity or amount are presented, a Jug with * amount=capacity=0 is created. * * @param capacity * a non negative integer * @param amount * an integer such that 0<=amount<=capacity */ public Jug(int capacity, int amount) { if (0 <= amount && amount <= capacity) { this.setCapacity(capacity); this.add(amount); } } /** * Create an empty Jug of the specified capacity. See Jug(amount, capacity) * for details. * @param capacity */ public Jug(int capacity) { this(capacity, 0); } /** * Set the capacity of this to c if possible, otherwise this * is unchanged. * * @param c * the target capacity, with 0<=c */ private void setCapacity(int c) { if (c < 0) return; if (c < this.amount) return; this.capacity = c; } /** * Fill this from other Jug, either emptying other or filling this. * Spilling this into this leaves this unchanged. * @param other * a different Jug whose contents will spill into this */ public void spillInto(Jug other) { if (this == other) return; else this.remove(other.add(this.amount)); } /** * Add up to addAmount into this Jug, or until this is full. * * @param addAmount * non-negative integer amount to be added to this * @return the amount actually added to this */ public int add(int addAmount) { if (addAmount < 0) return 0; int freeSpace = this.capacity - this.amount; if (addAmount > freeSpace){ addAmount = freeSpace; } this.amount = this.amount + addAmount; return addAmount; } /** * @return the amount currently in this */ public int getAmount() { return amount; } /** * @return the capacity of this */ public int getCapacity() { return capacity; } // remove up to removeAmount from this Jug // @return the amount actually removed /** * Remove up to removeAmount from this Jug, or until this is empty * * @param removeAmount * the non-negative integer amount to be removed from this * @return the amount actually removed from this */ public int remove(int removeAmount) { boolean tooMuch = false; if (removeAmount < 0) return 0; if (removeAmount > this.amount){ removeAmount = this.amount; tooMuch = true; } this.amount = this.amount - removeAmount; return removeAmount; } /** * @return a String representation of this */ public String toString() { return "(" + amount + "/" + capacity + ")"; } }
[ "adam.skudlarski@mail.utoronto.a" ]
adam.skudlarski@mail.utoronto.a
85cd42308c8c10c064f0566967b9004560f2ab86
f7fadc413cad92f03721742b9c5d94281c12ba02
/Java/project/ATM/Cash.java
5af2d514f867da40be2814b887a5df5ccdd2d59c
[]
no_license
amitmca/EducationalMaterial
f7acc7f701b42fb5f2821e56bab4ce253532c3f7
088a1fe34a0bdd4b46ea5cc7f930d8d1a3f510d0
refs/heads/master
2021-06-06T18:20:39.774159
2019-11-30T15:52:07
2019-11-30T15:52:07
134,157,178
0
0
null
null
null
null
UTF-8
Java
false
false
6,087
java
import java.awt.*; // import java.awt.event.*; // PACKAGES import javax.swing.*; // import java.sql.*; // public class Cash extends JFrame implements ActionListener{ public JButton button1,button2,button3,button4,button5,button6,cancelBut; private JLabel label1,label2,label3,label4,label5,label6; private JTextField textField; static String url = "jdbc:odbc:abc"; //---Constructor--- public Cash(){ super("Cash"); Container container=getContentPane() ; container.setLayout(null); textField=new JTextField(10); button1 = new JButton(">>>"); button1.setPreferredSize(new Dimension(100,30)); button1.setSize(button1.getPreferredSize()); button1.setLocation(50,50); button1.addActionListener(this); container.add(button1); button2 = new JButton(">>>"); button2.setPreferredSize(new Dimension(100,30)); button2.setSize(button2.getPreferredSize()); button2.setLocation(50,100); button2.addActionListener(this); container.add(button2); button3 = new JButton(">>>"); button3.setPreferredSize(new Dimension(100,30)); button3.setSize(button3.getPreferredSize()); button3.setLocation(50,150); button3.addActionListener(this); container.add(button3); button4 = new JButton("<<<"); button4.setPreferredSize(new Dimension(100,30)); button4.setSize(button4.getPreferredSize()); button4.setLocation(375,50); //---makes the communication with the odbc Driver--- button4.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ if(event.getSource()==button1){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); }catch(ClassNotFoundException a){ JOptionPane.showMessageDialog(null, url,"CLASS NOT FOUND EXCEPTION !!!",JOptionPane.INFORMATION_MESSAGE); }}DB s=new DB();s.CashScreen();} }); container.add(button4); button5 = new JButton("<<<"); button5.setPreferredSize(new Dimension(100,30)); button5.setSize(button5.getPreferredSize()); button5.setLocation(375,100); button5.addActionListener(this); container.add(button5); button6 = new JButton("<<<"); button6.setPreferredSize(new Dimension(100,30)); button6.setSize(button6.getPreferredSize()); button6.setLocation(375,150); //---makes the communication with the odbc Driver--- button6.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent event){ if(event.getSource()==button1){ try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); }catch(ClassNotFoundException a){ JOptionPane.showMessageDialog(null, url,"CLASS NOT FOUND EXCEPTION !!!",JOptionPane.INFORMATION_MESSAGE); }}DB s=new DB();s.ExecutionForAnother();} }); container.add(button6); cancelBut = new JButton("CANCEL"); cancelBut.setPreferredSize(new Dimension(100,30)); cancelBut.setSize(cancelBut.getPreferredSize()); cancelBut.setLocation(375,200); cancelBut.addActionListener(this); container.add(cancelBut); label1=new JLabel(" 10 $"); label1.setPreferredSize(new Dimension(75,30)); label1.setSize(label1.getPreferredSize()); label1.setLocation(150,50); container.add(label1); label2=new JLabel(" 20 $"); label2.setPreferredSize(new Dimension(75,30)); label2.setSize(label2.getPreferredSize()); label2.setLocation(300,50); container.add(label2); label3=new JLabel(" 40 $"); label3.setPreferredSize(new Dimension(75,30)); label3.setSize(label3.getPreferredSize()); label3.setLocation(150,100); container.add(label3); label4=new JLabel(" 50 $"); label4.setPreferredSize(new Dimension(75,30)); label4.setSize(label4.getPreferredSize()); label4.setLocation(300,100); container.add(label4); label5=new JLabel(" 100 $"); label5.setPreferredSize(new Dimension(75,30)); label5.setSize(label5.getPreferredSize()); label5.setLocation(150,150); container.add(label5); label6=new JLabel(" Another.."); label6.setPreferredSize(new Dimension(85,30)); label6.setSize(label6.getPreferredSize()); label6.setLocation(300,150); container.add(label6); setSize(500,400); setVisible(true); }//---Method for Actionlistener--- public void actionPerformed(ActionEvent event){ if(event.getSource()==cancelBut){ this.hide();//closes the present application MainMenu s=new MainMenu();s.Main();//and goes to MainMenu } } }
[ "amitbaramatimca@gmail.com" ]
amitbaramatimca@gmail.com
faeadff9475381e05a8e4c2f6966a65dd0403fae
5adc6f4f1c00b94818f6d754bfb5b9cb802c67d7
/src/main/java/com/thoughtworks/tw101/introductory_programming_exercises/PrimeFactors.java
dd6b60afa1c8e74ca59f5d5415a3bb93916b1665
[]
no_license
weberswords/tw101-laura-diamondex-refactor
e5981b3361f4d00fc2131550bb12fb94646ca1c8
d5bcfd799b90bdf4fa439852681884e19e3c0793
refs/heads/master
2021-01-01T16:42:23.051480
2017-07-22T20:46:00
2017-07-22T20:46:00
97,897,320
0
0
null
null
null
null
UTF-8
Java
false
false
1,926
java
package com.thoughtworks.tw101.introductory_programming_exercises; // Prime Factors Exercise // Write a method generate(int n) that given an integer n will return a list of integers such that the numbers // are the prime factors of N and are arranged in increasing numerical order. // // For example, generate(1) should return an empty list and generate(30) should return the numbers: 2,3,5. import java.util.ArrayList; import java.util.List; public class PrimeFactors { public static void main(String[] args) { List<Integer> primeFactors1 = generate(30); List<Integer> primeFactors2 = generate(1); //List<Integer> primeFactors3 = generate(79); //List<Integer> primeFactors4 = generate(1000); //List<Integer> primeFactors5 = generate(999); System.out.println(primeFactors1); System.out.println(primeFactors2); } // factor of n: n%i==0 // prime: private static List<Integer> generate(int n) { ArrayList<Integer> list = new ArrayList<Integer>(); for (int i=1; i<=n; i++) { // if the number is a factor of n and is also prime --> prime factor if (n%i==0 && isPrime(i)) { list.add(i); } } return list; } private static boolean isPrime(int n) { if (n < 2) { return false; } else if (n==2) { return true; } // no even number is prime (except 2... see above) else if (n%2==0) { return false; } // check if divisible by odd numbers (because if divisible by even number, already caught by n%2==0 ) // prime definition: only divisible by 1 and itself else { for (int i=3; i<n; i+=2) { if (n%i==0) { return false; } } return true; } } }
[ "weberswords@gmail.com" ]
weberswords@gmail.com
f6934c869761c11d4bb9f1fa462ffff84a383d29
bd47dd34250daa45ae3ade87462ff55445c9e259
/app/src/main/java/com/yichongliu/lyccoursetable/util/LycExcelUtils.java
b5e8432a163e0736c44c38ae8c9b8a0aa1000364
[]
no_license
YiChong-Liu/LycCourseTable
8459ed61363c4ed43942a02b242c2baf226ea459
8a7687d06290151083993d6728002e7edad14807
refs/heads/master
2022-12-27T02:23:27.190994
2020-10-07T05:29:24
2020-10-07T05:29:24
301,935,827
0
0
null
null
null
null
UTF-8
Java
false
false
5,947
java
package com.yichongliu.lyccoursetable.util; import com.yichongliu.lyccoursetable.bean.LycCourse; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Random; import jxl.Cell; import jxl.Range; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; public class LycExcelUtils { public static interface HandleResult { LycCourse handle(String courseStr, int row, int col); } /** * @param path String * @param startRow int 课程表(不算表头)开始行数(从1开始) * @param startCol int 课程表(不算表头)开始列数(从1开始) * @return List<Course> 返回课程列表 * <p> * 只读取6行7列 */ public static List<LycCourse> handleExcel(String path, int startRow, int startCol, HandleResult handleResult) { InputStream inputStream = null; List<LycCourse> courseList = new ArrayList<>(); //Log.d("filePath",path); Workbook excel = null; try { File file = new File(path); if (file.exists()) { inputStream = new FileInputStream(file); } else { //Log.d("file","do not exist"); return courseList; } excel = Workbook.getWorkbook(inputStream); Sheet rs = excel.getSheet(0); int rowCount = 6; int weight = 2; Range[] ranges = rs.getMergedCells(); if (startCol + 7 - 1 > rs.getColumns() || startRow + rowCount - 1 > rs.getRows()) { return courseList; } startCol -= 2;//rs.getCell以零开始 startRow -= 2; for (int i = 1; i <= 7; i++) { for (int j = 1; j <= rowCount; j++) { Cell cell = rs.getCell(startCol + i, startRow + j); String str = handleCell(cell.getContents()); int row_length = 1; for (Range range : ranges) { if (range.getTopLeft() == cell) { row_length = range.getBottomRight().getRow() - cell.getRow() + 1; break; } } if (!str.isEmpty()) { //一个格子有两个课程,分割处理 String[] strings = str.split("\n\n"); for (String s : strings) { LycCourse course = handleResult.handle(s, j, i); if (course != null) { course.setClassLength(weight * row_length); courseList.add(course); } } } } } return courseList; } catch (BiffException | IOException e) { e.printStackTrace(); return null; } finally { try { if (excel != null) excel.close(); if (inputStream != null) inputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } public static List<LycCourse> handleExcel(String path, int startRow, int startCol) { return handleExcel(path, startRow, startCol, new HandleResult() { @Override public LycCourse handle(String courseStr, int row, int col) { LycCourse course = getCourseFromString(courseStr); if (course == null) return null; course.setDayOfWeek(col); course.setClassStart(row * 2 - 1); return course; } }); } public static List<LycCourse> handleExcel(String path) { return handleExcel(path, 2, 2); } /** * 从表格中的内容提取课程信息 * * @param str String * @return Course */ public static LycCourse getCourseFromString(String str) { String[] contents = str.split("\n"); if (contents.length < 4) return null; LycCourse course = new LycCourse(); course.setName(contents[0]); course.setTeacher(contents[1]); course.setWeekOfTerm(getWeekOfTermFromString(contents[2])); course.setClassRoom(contents[3]); return course; } private static int getWeekOfTermFromString(String str) { //Log.d("excel",str); String[] s1 = str.split("\\["); String[] s11 = s1[0].split(","); int weekOfTerm = 0; for (String s : s11) { if (s == null || s.isEmpty()) continue; if (s.contains("-")) { int space = 2; if (s1[1].equals("周]")) { space = 1; } String[] s2 = s.split("-"); if (s2.length != 2) { System.out.println("error"); return 0; } int p = Integer.parseInt(s2[0]); int q = Integer.parseInt(s2[1]); for (int n = p; n <= q; n += space) { weekOfTerm += 1 << (LycConfig.getMaxWeekNum() - n); } } else { weekOfTerm += 1 << (LycConfig.getMaxWeekNum() - Integer.parseInt(s)); } } return weekOfTerm; } /** * 去除字符串的首尾回车和空格 * * @param str * @return */ private static String handleCell(String str) { str = str.replaceAll("^\n|\n$", "");//去除首尾换行符 str = str.trim();//去除首尾空格 return str; } }
[ "jiuliuwangdao@foxmail.com" ]
jiuliuwangdao@foxmail.com
4ccd03b8afdd7af20f2ee29e70b314f169e7a3ce
ef6ccb390fb81375b6c267a02d20e2601dedffc3
/game1/src/game1/Blocks.java
5eb3940191aab3348eeac3bcb66553e892b58a59
[]
no_license
aychwhysee/game1
5e31662ae39271940dfca16cba39cc96073250cb
364457f66a3618566e1c57fc4db473c8579f9330
refs/heads/master
2021-01-25T08:54:31.230959
2014-10-15T05:20:10
2014-10-15T05:20:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,754
java
package game1; import java.awt.Color; import java.util.Random; import tester.*; import javalib.funworld.*; import javalib.colors.*; import javalib.worldcanvas.*; import javalib.worldimages.*; public class Blocks { public Posn posn; // block one public Posn posn2; // block two public int speed; public int b_width; // Board width public int b_height; // Board height public final int width = 20; // Block width public final int height = 20; // Block height public IColor color1 = new Blue(); //block one public IColor color2 = new Red(); // block two public Random random = new Random(); public Blocks(int b_width, int b_height, int speed) { this.b_width = b_width; this.b_height = b_height; this.speed = speed; this.posn = new Posn(randomX(b_width), 0); this.posn2 = new Posn(randomX(b_width), 0); } public Blocks(Posn posn, Posn posn2, int b_width, int b_height, int speed) { this.posn = posn; this.posn2 = posn2; this.b_width = b_width; this.b_height = b_height; this.speed = speed; } public int randomX(int b_width) { return random.nextInt(b_width - (width * 2)) + width; } public Blocks fall() { return new Blocks( new Posn(this.posn.x, this.posn.y + speed), new Posn(this.posn2.x, this.posn.y + speed), this.b_width, this.b_height, this.speed); } public WorldImage drawImage() { return new OverlayImages(new RectangleImage(this.posn, this.width, this.height, this.color1), new RectangleImage(this.posn2, this.width, this.height, this.color2)); } }
[ "hacho@vassar.edu" ]
hacho@vassar.edu