blob_id
stringlengths 40
40
| __id__
int64 225
39,780B
| directory_id
stringlengths 40
40
| path
stringlengths 6
313
| content_id
stringlengths 40
40
| detected_licenses
list | license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| repo_url
stringlengths 25
151
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
70
| visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 7.28k
689M
⌀ | star_events_count
int64 0
131k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 23
values | gha_fork
bool 2
classes | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_updated_at
timestamp[ns] | gha_pushed_at
timestamp[ns] | gha_size
int64 0
40.4M
⌀ | gha_stargazers_count
int32 0
112k
⌀ | gha_forks_count
int32 0
39.4k
⌀ | gha_open_issues_count
int32 0
11k
⌀ | gha_language
stringlengths 1
21
⌀ | gha_archived
bool 2
classes | gha_disabled
bool 1
class | content
stringlengths 7
4.37M
| src_encoding
stringlengths 3
16
| language
stringclasses 1
value | length_bytes
int64 7
4.37M
| extension
stringclasses 24
values | filename
stringlengths 4
174
| language_id
stringclasses 1
value | entities
list | contaminating_dataset
stringclasses 0
values | malware_signatures
list | redacted_content
stringlengths 7
4.37M
| redacted_length_bytes
int64 7
4.37M
| alphanum_fraction
float32 0.25
0.94
| alpha_fraction
float32 0.25
0.94
| num_lines
int32 1
84k
| avg_line_length
float32 0.76
99.9
| std_line_length
float32 0
220
| max_line_length
int32 5
998
| is_vendor
bool 2
classes | is_generated
bool 1
class | max_hex_length
int32 0
319
| hex_fraction
float32 0
0.38
| max_unicode_length
int32 0
408
| unicode_fraction
float32 0
0.36
| max_base64_length
int32 0
506
| base64_fraction
float32 0
0.5
| avg_csv_sep_count
float32 0
4
| is_autogen_header
bool 1
class | is_empty_html
bool 1
class | shard
stringclasses 16
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71bb9caec70b29fec21a2367630341d98cdee46b
| 30,279,519,495,583 |
3bebf7581c8faa6d63f364317dffacb84c5ff82b
|
/agGirisiMain.java
|
11e8e9c85ef689e738b0d2974ada9390c83c1584
|
[] |
no_license
|
rahmikse/This-and-static
|
https://github.com/rahmikse/This-and-static
|
15ef959e6969a1aa789758f892244ff865f30508
|
a3e2dbddbc77ef6115cd06121023238dbdc33180
|
refs/heads/master
| 2022-06-14T03:36:48.049000 | 2020-05-07T12:50:10 | 2020-05-07T12:50:10 | 257,646,671 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sunum;
public class agGirisiMain {
public static void main(String[] args) {
agGirisi sinif1 = new agGirisi(" 8.8.4.4" ,8080); // sinif1 adında bir sınıf tanımladık.IP ve Port değerlerini gönderdik.
sinif1.Method("169.0.0.2"); // Yerel IP tanımladık.
}
}
|
ISO-8859-9
|
Java
| 290 |
java
|
agGirisiMain.java
|
Java
|
[
{
"context": " ve Port değerlerini gönderdik.\r\n\t\tsinif1.Method(\"169.0.0.2\"); // Yerel IP tanımladık.\r\n\t}\r\n\r\n}\r\n",
"end": 243,
"score": 0.9995383024215698,
"start": 234,
"tag": "IP_ADDRESS",
"value": "169.0.0.2"
}
] | null |
[] |
package sunum;
public class agGirisiMain {
public static void main(String[] args) {
agGirisi sinif1 = new agGirisi(" 8.8.4.4" ,8080); // sinif1 adında bir sınıf tanımladık.IP ve Port değerlerini gönderdik.
sinif1.Method("172.16.58.3"); // Yerel IP tanımladık.
}
}
| 292 | 0.679715 | 0.619217 | 10 | 26.1 | 37.063324 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
13
|
003f9e61a9618575c966ab279dbddcaa3951eb88
| 11,656,541,288,110 |
28b48ad411b0f493964d3063da68bf0a5f6393a1
|
/src/test/java/com/nike/gimme/a/cli/commands/HelloWorldCommand.java
|
367eb2dc87b26d6d59a83de37d3e9303d623f615
|
[
"Apache-2.0"
] |
permissive
|
tlisonbee/gimme-a-cli
|
https://github.com/tlisonbee/gimme-a-cli
|
3f38b30c1d0a2f546ec15ffec17d614a22c79f91
|
6d2de663d3d43b6740aeb1170484a087b7477fa2
|
refs/heads/master
| 2020-06-22T03:27:25.605000 | 2019-07-18T16:02:32 | 2019-07-18T16:02:32 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright 2019-present, Nike, Inc.
* All rights reserved.
*
* This source code is licensed under the Apache-2.0 license found in
* the LICENSE file in the root directory of this source tree.
*/
package com.nike.gimme.a.cli.commands;
import com.beust.jcommander.Parameter;
import com.nike.gimme.a.cli.Command;
import com.nike.gimme.a.cli.Terminal;
import org.springframework.beans.factory.annotation.Autowired;
public class HelloWorldCommand implements Command {
@Parameter(names = {"--name"}, required = true)
private String name;
@Autowired
private Terminal terminal;
@Override
public void execute() {
terminal.info("Hello " + name);
}
}
|
UTF-8
|
Java
| 693 |
java
|
HelloWorldCommand.java
|
Java
|
[
{
"context": "/*\n * Copyright 2019-present, Nike, Inc.\n * All rights reserved.\n *\n * This source c",
"end": 34,
"score": 0.9548954367637634,
"start": 30,
"tag": "NAME",
"value": "Nike"
}
] | null |
[] |
/*
* Copyright 2019-present, Nike, Inc.
* All rights reserved.
*
* This source code is licensed under the Apache-2.0 license found in
* the LICENSE file in the root directory of this source tree.
*/
package com.nike.gimme.a.cli.commands;
import com.beust.jcommander.Parameter;
import com.nike.gimme.a.cli.Command;
import com.nike.gimme.a.cli.Terminal;
import org.springframework.beans.factory.annotation.Autowired;
public class HelloWorldCommand implements Command {
@Parameter(names = {"--name"}, required = true)
private String name;
@Autowired
private Terminal terminal;
@Override
public void execute() {
terminal.info("Hello " + name);
}
}
| 693 | 0.712843 | 0.704185 | 29 | 22.896551 | 21.997406 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.37931 | false | false |
13
|
7b960395de4964f0ba2e7b086363d0655f365dd7
| 3,401,614,156,669 |
dc6b2411ed752e08e61cddb466f64181aba8a6e7
|
/app/src/main/java/com/zjw/dr/util/DensityHelper.java
|
f637ffe43cbca8a2eead6d6f35bcb29c154270d3
|
[] |
no_license
|
zhujinwie/Dr
|
https://github.com/zhujinwie/Dr
|
33611991ede7f05f0715b2da9395f89ee95fb3d6
|
34a9e9ca89cb97630f093d9c74b2b352203d69a6
|
refs/heads/master
| 2021-01-25T11:28:07.410000 | 2018-03-01T07:58:09 | 2018-03-01T07:58:09 | 123,399,344 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.zjw.dr.util;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
/**
* Created by 祝锦伟 on 2018/2/25.
*/
public class DensityHelper {
/**
* dip 转 px
* **/
public static int dip2px(Context context,float dpValue){
final float scale=context.getResources().getDisplayMetrics().density;
return (int)(dpValue*scale+0.5f);
}
/**
*
* px 转 dp
* **/
public static int px2dip(Context context,float pxValue){
final float scale=context.getResources().getDisplayMetrics().density;
return (int)(pxValue/scale+0.5f);
}
/**
* 获取 屏幕 宽 和 高
* **/
public static int[] getDevicePx(Activity activity){
DisplayMetrics metrics=new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
int width=metrics.widthPixels;
int heigth=metrics.heightPixels;
return new int[]{width,heigth};
}
}
|
UTF-8
|
Java
| 1,029 |
java
|
DensityHelper.java
|
Java
|
[
{
"context": "t android.util.DisplayMetrics;\n\n/**\n * Created by 祝锦伟 on 2018/2/25.\n */\n\npublic class DensityHelper {\n\n",
"end": 145,
"score": 0.9997697472572327,
"start": 142,
"tag": "NAME",
"value": "祝锦伟"
}
] | null |
[] |
package com.zjw.dr.util;
import android.app.Activity;
import android.content.Context;
import android.util.DisplayMetrics;
/**
* Created by 祝锦伟 on 2018/2/25.
*/
public class DensityHelper {
/**
* dip 转 px
* **/
public static int dip2px(Context context,float dpValue){
final float scale=context.getResources().getDisplayMetrics().density;
return (int)(dpValue*scale+0.5f);
}
/**
*
* px 转 dp
* **/
public static int px2dip(Context context,float pxValue){
final float scale=context.getResources().getDisplayMetrics().density;
return (int)(pxValue/scale+0.5f);
}
/**
* 获取 屏幕 宽 和 高
* **/
public static int[] getDevicePx(Activity activity){
DisplayMetrics metrics=new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
int width=metrics.widthPixels;
int heigth=metrics.heightPixels;
return new int[]{width,heigth};
}
}
| 1,029 | 0.633831 | 0.620896 | 46 | 20.847826 | 23.363821 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.347826 | false | false |
13
|
405d6ddcdb04181511a9b1727a0514a68fb5e22b
| 24,326,694,828,272 |
3c0fa460c1b379c765c73a03027d6a00b7b42b82
|
/src/Strings/Assignments/ReverseEachWord.java
|
362735f8c93e9770df6e39fd188cec7616fcec1d
|
[] |
no_license
|
Kurosakicoder/JavaDSALGO
|
https://github.com/Kurosakicoder/JavaDSALGO
|
c2055b6f6d8b2f7bb39b6990248cd8f710d6a6ae
|
38a9a95601c2c250e0bc0b49f60754956a994b81
|
refs/heads/main
| 2023-07-08T10:53:26.122000 | 2021-08-28T06:04:16 | 2021-08-28T06:04:16 | 330,218,395 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Strings.Assignments;
import java.util.Scanner;
public class ReverseEachWord {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String str = s.nextLine();
System.out.println(reverseEachWord(str));
}
public static String reverseEachWord(String str) {
//Your code goes here
String ans = "";
int currentWordStart = 0;
int i;
for(i = 0; i < str.length();i++ ){
if(str.charAt(i) == ' '){
int currentWordEnd = i - 1;
String reversedWord = "";
for(int j = currentWordStart; j <= currentWordEnd; j++){
reversedWord = str.charAt(j) + reversedWord;
}
ans += reversedWord + " ";
currentWordStart = i + 1;
}
}
int currentWordEnd = i - 1;
String reversedWord = "";
for(int j = currentWordStart; j <= currentWordEnd; j++){
reversedWord = str.charAt(j) + reversedWord;
}
ans += reversedWord;
return ans;
}
}
|
UTF-8
|
Java
| 1,123 |
java
|
ReverseEachWord.java
|
Java
|
[] | null |
[] |
package Strings.Assignments;
import java.util.Scanner;
public class ReverseEachWord {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String str = s.nextLine();
System.out.println(reverseEachWord(str));
}
public static String reverseEachWord(String str) {
//Your code goes here
String ans = "";
int currentWordStart = 0;
int i;
for(i = 0; i < str.length();i++ ){
if(str.charAt(i) == ' '){
int currentWordEnd = i - 1;
String reversedWord = "";
for(int j = currentWordStart; j <= currentWordEnd; j++){
reversedWord = str.charAt(j) + reversedWord;
}
ans += reversedWord + " ";
currentWordStart = i + 1;
}
}
int currentWordEnd = i - 1;
String reversedWord = "";
for(int j = currentWordStart; j <= currentWordEnd; j++){
reversedWord = str.charAt(j) + reversedWord;
}
ans += reversedWord;
return ans;
}
}
| 1,123 | 0.512912 | 0.50846 | 40 | 27.075001 | 20.430843 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false |
13
|
257fd113bfa1427d1b92da54eeb41510e5275c51
| 7,902,739,833,982 |
cb31830cd02c44edcb06d949a4ad501d486e0fec
|
/src/main/java/com/example/MyRouteBuilder.java
|
f2ed109d484bc8dae1b0a6a46aada6d788f244e6
|
[] |
no_license
|
DariusX/camel-no-spring
|
https://github.com/DariusX/camel-no-spring
|
5a90411f7365f0e7cf7178181be48a663d578f0e
|
2d532665418f9a6ed47d9fb0ba30d03b1417cc72
|
refs/heads/master
| 2023-04-29T20:06:06.749000 | 2019-09-23T03:42:03 | 2019-09-23T03:42:03 | 210,258,913 | 0 | 0 | null | false | 2023-04-14T19:31:23 | 2019-09-23T03:42:28 | 2019-09-23T03:42:58 | 2023-04-14T19:31:22 | 3 | 0 | 0 | 1 |
Java
| false | false |
package com.example;
import org.apache.camel.builder.RouteBuilder;
public class MyRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
interceptFrom("servlet:*")
.log("->>>>>>>>>> Intercepted <<<<<<<<<<<<<<<<<-");
System.out.println("---------------- MyRouteBuilder --------------------");
from("timer://foo?fixedRate=true&period=15s")
.log("... Timer ...");
from("servlet:hello?matchOnUriPrefix=true")
.setBody(constant("<b>Hello World </b> "))
.log("${body} ${headers}");
restConfiguration().component("servlet").host("localhost");
rest("/ping")
.get()
.produces("text/plain")
.route()
.transform(constant("Ping\n")).endRest();
}
}
|
UTF-8
|
Java
| 908 |
java
|
MyRouteBuilder.java
|
Java
|
[] | null |
[] |
package com.example;
import org.apache.camel.builder.RouteBuilder;
public class MyRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
interceptFrom("servlet:*")
.log("->>>>>>>>>> Intercepted <<<<<<<<<<<<<<<<<-");
System.out.println("---------------- MyRouteBuilder --------------------");
from("timer://foo?fixedRate=true&period=15s")
.log("... Timer ...");
from("servlet:hello?matchOnUriPrefix=true")
.setBody(constant("<b>Hello World </b> "))
.log("${body} ${headers}");
restConfiguration().component("servlet").host("localhost");
rest("/ping")
.get()
.produces("text/plain")
.route()
.transform(constant("Ping\n")).endRest();
}
}
| 908 | 0.476872 | 0.47467 | 34 | 25.705883 | 26.681707 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.235294 | false | false |
13
|
3cd30549ea0c1916ac3b30e1a10792dc73c6a2b7
| 25,056,839,234,276 |
9bcfa007c17128125296d4d95e6d7322c9b060cc
|
/src/main/java/pl/mprzymus/ztwl5/authors/model/AuthorListDto.java
|
2914911742d31fd6698883f600c4289c83afa134
|
[] |
no_license
|
mprzymus/ztw-l5
|
https://github.com/mprzymus/ztw-l5
|
a16183eb39f318f2d6870b2a54c6ad6976fed883
|
66559e278e85b67655e038c13dd7421728f823ea
|
refs/heads/master
| 2023-04-01T23:39:49.589000 | 2021-04-08T15:36:18 | 2021-04-08T15:36:18 | 353,703,435 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package pl.mprzymus.ztwl5.authors.model;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import java.util.List;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public record AuthorListDto(List<AuthorDto> authors) {
}
|
UTF-8
|
Java
| 245 |
java
|
AuthorListDto.java
|
Java
|
[] | null |
[] |
package pl.mprzymus.ztwl5.authors.model;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import java.util.List;
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public record AuthorListDto(List<AuthorDto> authors) {
}
| 245 | 0.82449 | 0.820408 | 9 | 26.222221 | 25.676525 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
13
|
064c53aa15b505e126d44321b26aea7a6652fe50
| 23,252,953,006,930 |
3f04594766fc17d0bcbcae6e0f21da20d02d210f
|
/src/main/java/com/primeton/controller/filter/Filter1_CheckToken.java
|
dcd516804e3958385615195a4404b386e7e89710
|
[] |
no_license
|
55345249/project
|
https://github.com/55345249/project
|
68dce324bd519716b57247e834ebb7eec3a71588
|
2343dc0428f4f3d4e6bcb92ae331fd5dc01fafdd
|
refs/heads/master
| 2021-09-13T21:17:47.032000 | 2018-05-04T09:01:54 | 2018-05-04T09:01:54 | 124,476,142 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.primeton.controller.filter;
import com.primeton.third.jwt.Jwt;
import com.primeton.third.jwt.TokenState;
import net.minidev.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
//toekn校验过滤器,所有的API接口请求都要经过该过滤器(除了登陆接口)
@WebFilter(urlPatterns = "/servlet/*", initParams = {@WebInitParam(name = "ignore", value = "/servlet/login")})
public class Filter1_CheckToken implements Filter {
private static final Logger logger = LoggerFactory.getLogger(Filter1_CheckToken.class);
private String ignoresParam = "";
@Override
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) arg0;
HttpServletResponse response = (HttpServletResponse) arg1;
if (canIgnore(request)) {
chain.doFilter(arg0, arg1);
return;
}
//其他API接口一律校验token
logger.info("开始校验token");
//从请求头中获取token
String token = request.getHeader("token");
logger.info("token过滤器中获取的token=" + token);
Map<String, Object> resultMap = Jwt.validToken(token);
TokenState state = TokenState.getTokenState((String) resultMap.get("state"));
switch (state) {
case VALID:
//取出payload中数据,放入到request作用域中
request.setAttribute("data", resultMap.get("data"));
//放行
chain.doFilter(request, response);
break;
case EXPIRED:
case INVALID:
logger.info("无效token");
//token过期或者无效,则输出错误信息返回给ajax
JSONObject outputMsg = new JSONObject();
outputMsg.put("success", false);
outputMsg.put("msg", "您的token不合法或者过期了,请重新登陆");
output(outputMsg.toJSONString(), response);
break;
}
}
public void output(String jsonStr, HttpServletResponse response) throws IOException {
response.setContentType("text/html;charset=UTF-8;");
PrintWriter out = response.getWriter();
out.write(jsonStr);
out.flush();
out.close();
}
@Override
public void init(FilterConfig arg0) throws ServletException {
logger.info("token过滤器初始化了");
ignoresParam = arg0.getInitParameter("ignore");
}
@Override
public void destroy() {
}
private boolean canIgnore(HttpServletRequest request) {
String url = request.getRequestURI();
if (url.endsWith(ignoresParam.replace("*", ""))) {
return true;
} else {
return false;
}
}
}
|
UTF-8
|
Java
| 3,212 |
java
|
Filter1_CheckToken.java
|
Java
|
[] | null |
[] |
package com.primeton.controller.filter;
import com.primeton.third.jwt.Jwt;
import com.primeton.third.jwt.TokenState;
import net.minidev.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
//toekn校验过滤器,所有的API接口请求都要经过该过滤器(除了登陆接口)
@WebFilter(urlPatterns = "/servlet/*", initParams = {@WebInitParam(name = "ignore", value = "/servlet/login")})
public class Filter1_CheckToken implements Filter {
private static final Logger logger = LoggerFactory.getLogger(Filter1_CheckToken.class);
private String ignoresParam = "";
@Override
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain chain) throws IOException, ServletException {
HttpServletRequest request = (HttpServletRequest) arg0;
HttpServletResponse response = (HttpServletResponse) arg1;
if (canIgnore(request)) {
chain.doFilter(arg0, arg1);
return;
}
//其他API接口一律校验token
logger.info("开始校验token");
//从请求头中获取token
String token = request.getHeader("token");
logger.info("token过滤器中获取的token=" + token);
Map<String, Object> resultMap = Jwt.validToken(token);
TokenState state = TokenState.getTokenState((String) resultMap.get("state"));
switch (state) {
case VALID:
//取出payload中数据,放入到request作用域中
request.setAttribute("data", resultMap.get("data"));
//放行
chain.doFilter(request, response);
break;
case EXPIRED:
case INVALID:
logger.info("无效token");
//token过期或者无效,则输出错误信息返回给ajax
JSONObject outputMsg = new JSONObject();
outputMsg.put("success", false);
outputMsg.put("msg", "您的token不合法或者过期了,请重新登陆");
output(outputMsg.toJSONString(), response);
break;
}
}
public void output(String jsonStr, HttpServletResponse response) throws IOException {
response.setContentType("text/html;charset=UTF-8;");
PrintWriter out = response.getWriter();
out.write(jsonStr);
out.flush();
out.close();
}
@Override
public void init(FilterConfig arg0) throws ServletException {
logger.info("token过滤器初始化了");
ignoresParam = arg0.getInitParameter("ignore");
}
@Override
public void destroy() {
}
private boolean canIgnore(HttpServletRequest request) {
String url = request.getRequestURI();
if (url.endsWith(ignoresParam.replace("*", ""))) {
return true;
} else {
return false;
}
}
}
| 3,212 | 0.635939 | 0.631597 | 91 | 31.901098 | 24.943918 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.67033 | false | false |
13
|
b7365ea318f25cf001fb7e45ec348680a2d5dbfe
| 33,002,528,743,957 |
98bacc06808b8637559ce5ed3a1ae744aa828d23
|
/src/合并k个有序链表.java
|
a842d4bcd92f1176d5ee5b1e1155636043500fb8
|
[] |
no_license
|
fogbirdfree/algorithm
|
https://github.com/fogbirdfree/algorithm
|
adcfe0e2a4c42533c4881d8736e109a855c86c8c
|
ef40aa4fe4de2f5b4ed846d6f53a3b973261d706
|
refs/heads/master
| 2023-04-27T10:48:04.747000 | 2021-02-23T10:39:36 | 2021-02-23T10:39:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.util.HashMap;
public class 合并k个有序链表 {
public static void main(String[] args){
}
}
class ListNode2 {
int val;
ListNode2 next;
ListNode2(int x) { val = x; }
}
class Solution18 {
public ListNode2 mergeKLists(ListNode2[] lists) {
ListNode2 head = null;
for (int i = 0; i < lists.length; i++){
head = hebing(head,lists[i]);
}
return head;
}
private ListNode2 hebing(ListNode2 ln, ListNode2 list) {
ListNode2 dummyHead = new ListNode2(0);
ListNode2 tail = dummyHead;
while (ln != null && list != null) {
if (ln.val > list.val) {
tail.next = list;
list = list.next;
} else {
tail.next = ln;
ln = ln.next;
}
tail = tail.next;
}
if (ln == null) {
tail.next = list;
} else {
tail.next = ln;
}
return dummyHead.next;
}
}
|
UTF-8
|
Java
| 1,022 |
java
|
合并k个有序链表.java
|
Java
|
[] | null |
[] |
import java.util.HashMap;
public class 合并k个有序链表 {
public static void main(String[] args){
}
}
class ListNode2 {
int val;
ListNode2 next;
ListNode2(int x) { val = x; }
}
class Solution18 {
public ListNode2 mergeKLists(ListNode2[] lists) {
ListNode2 head = null;
for (int i = 0; i < lists.length; i++){
head = hebing(head,lists[i]);
}
return head;
}
private ListNode2 hebing(ListNode2 ln, ListNode2 list) {
ListNode2 dummyHead = new ListNode2(0);
ListNode2 tail = dummyHead;
while (ln != null && list != null) {
if (ln.val > list.val) {
tail.next = list;
list = list.next;
} else {
tail.next = ln;
ln = ln.next;
}
tail = tail.next;
}
if (ln == null) {
tail.next = list;
} else {
tail.next = ln;
}
return dummyHead.next;
}
}
| 1,022 | 0.482143 | 0.46627 | 45 | 21.422222 | 16.254215 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.466667 | false | false |
13
|
ea074e3f95290855fd3f2827c5fca5cd1be7fbdc
| 33,002,528,744,880 |
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
|
/methods/Method_8574.java
|
e65eaf2c91a36769bd74ac37c9ded1bcb774fc2f
|
[] |
no_license
|
P79N6A/icse_20_user_study
|
https://github.com/P79N6A/icse_20_user_study
|
5b9c42c6384502fdc9588430899f257761f1f506
|
8a3676bc96059ea2c4f6d209016f5088a5628f3c
|
refs/heads/master
| 2020-06-24T08:25:22.606000 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public void updateMatrix(){
presentationMatrix.reset();
presentationMatrix.postTranslate(-state.getWidth() / 2,-state.getHeight() / 2);
presentationMatrix.postRotate(state.getOrientation());
state.getConcatMatrix(presentationMatrix);
presentationMatrix.postTranslate(areaView.getCropCenterX(),areaView.getCropCenterY());
imageView.setImageMatrix(presentationMatrix);
}
|
UTF-8
|
Java
| 381 |
java
|
Method_8574.java
|
Java
|
[] | null |
[] |
public void updateMatrix(){
presentationMatrix.reset();
presentationMatrix.postTranslate(-state.getWidth() / 2,-state.getHeight() / 2);
presentationMatrix.postRotate(state.getOrientation());
state.getConcatMatrix(presentationMatrix);
presentationMatrix.postTranslate(areaView.getCropCenterX(),areaView.getCropCenterY());
imageView.setImageMatrix(presentationMatrix);
}
| 381 | 0.80315 | 0.7979 | 8 | 46.625 | 26.846497 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
13
|
dad5b97b2b3862e7b1c2fcdffc3a2d4783288305
| 33,002,528,744,628 |
8c45015379c3cf75a330632ae7e962a887d46624
|
/src/com/interceptor/MyInterceptor1.java
|
296a41aa1939496cc1be9836d5fde024835fc24f
|
[] |
no_license
|
ghuan/SSH
|
https://github.com/ghuan/SSH
|
1a251af6dbb2fd86106433b4b58389cfb2992d89
|
9b681f1c31cadd4f12e1cc4eed6ce783bcd4bcf6
|
refs/heads/master
| 2021-06-05T16:02:24.025000 | 2018-07-09T14:58:39 | 2018-07-09T14:58:39 | 58,302,855 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class MyInterceptor1 implements Interceptor {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void init() {
// TODO Auto-generated method stub
}
@Override
public String intercept(ActionInvocation arg0) throws Exception {
// TODO Auto-generated method stub
long start = System.currentTimeMillis();
System.out.println("1");
String result = arg0.invoke();
long end = System.currentTimeMillis();
System.out.println(arg0.getAction().getClass().getName()+" is invoked1 :" + (end-start)+" ms");
return result;
}
}
|
UTF-8
|
Java
| 821 |
java
|
MyInterceptor1.java
|
Java
|
[] | null |
[] |
package com.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class MyInterceptor1 implements Interceptor {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void init() {
// TODO Auto-generated method stub
}
@Override
public String intercept(ActionInvocation arg0) throws Exception {
// TODO Auto-generated method stub
long start = System.currentTimeMillis();
System.out.println("1");
String result = arg0.invoke();
long end = System.currentTimeMillis();
System.out.println(arg0.getAction().getClass().getName()+" is invoked1 :" + (end-start)+" ms");
return result;
}
}
| 821 | 0.691839 | 0.680877 | 36 | 20.805555 | 23.438831 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.138889 | false | false |
13
|
67c6f6965eac72761680d9401d5b13aa2f88a284
| 32,152,125,234,150 |
47b9daf34909d23c30615c3186620c8b0e6013d3
|
/bdf2-jbpm4-designer/src/main/java/com/bstek/bdf2/jbpm4/designer/converter/impl/TaskConverter.java
|
5ecb620e54acb293c434d44e9056d40e4d87d7bd
|
[
"Apache-2.0"
] |
permissive
|
294033186/bdf2
|
https://github.com/294033186/bdf2
|
5548dc23cd5b5d220558893165e923182dc5387f
|
496ccd60feafb9e59b65020fbc2a4199a506fb4f
|
refs/heads/master
| 2020-03-28T05:46:06.446000 | 2017-11-26T03:11:53 | 2017-11-26T03:11:53 | 147,795,504 | 1 | 1 |
Apache-2.0
| true | 2018-09-07T08:36:24 | 2018-09-07T08:36:24 | 2018-09-03T06:35:04 | 2017-11-26T03:12:02 | 3,885 | 0 | 0 | 0 | null | false | null |
package com.bstek.bdf2.jbpm4.designer.converter.impl;
import org.dom4j.Element;
import org.dom4j.tree.BaseElement;
import org.springframework.stereotype.Component;
import com.bstek.bdf2.jbpm4.designer.converter.JpdlInfo;
/**
* @author Jacky.gao
* @since 2013-6-18
*/
@Component
public class TaskConverter extends AbstractConverter{
public JpdlInfo toJpdl(Element element) {
BaseElement targetElement=new BaseElement("task");
String name=this.buildCommonJpdlElement(element, targetElement);
String assignmentType=element.attributeValue("assignmentType");
String assignmentValue=element.attributeValue("assignmentValue");
if(assignmentType.equals("assignment-handler")){
BaseElement handlerElement=new BaseElement("assignment-handler");
handlerElement.addAttribute("class", assignmentValue);
targetElement.add(handlerElement);
}else{
targetElement.addAttribute(assignmentType, assignmentValue);
}
JpdlInfo info=new JpdlInfo();
info.setName(name);
info.setElement(targetElement);
return info;
}
public boolean support(String shapeId){
return shapeId.equals("jbpm4.Task");
}
}
|
UTF-8
|
Java
| 1,120 |
java
|
TaskConverter.java
|
Java
|
[
{
"context": "jbpm4.designer.converter.JpdlInfo;\n\n/**\n * @author Jacky.gao\n * @since 2013-6-18\n */\n@Component\npublic class T",
"end": 248,
"score": 0.9991378784179688,
"start": 239,
"tag": "NAME",
"value": "Jacky.gao"
}
] | null |
[] |
package com.bstek.bdf2.jbpm4.designer.converter.impl;
import org.dom4j.Element;
import org.dom4j.tree.BaseElement;
import org.springframework.stereotype.Component;
import com.bstek.bdf2.jbpm4.designer.converter.JpdlInfo;
/**
* @author Jacky.gao
* @since 2013-6-18
*/
@Component
public class TaskConverter extends AbstractConverter{
public JpdlInfo toJpdl(Element element) {
BaseElement targetElement=new BaseElement("task");
String name=this.buildCommonJpdlElement(element, targetElement);
String assignmentType=element.attributeValue("assignmentType");
String assignmentValue=element.attributeValue("assignmentValue");
if(assignmentType.equals("assignment-handler")){
BaseElement handlerElement=new BaseElement("assignment-handler");
handlerElement.addAttribute("class", assignmentValue);
targetElement.add(handlerElement);
}else{
targetElement.addAttribute(assignmentType, assignmentValue);
}
JpdlInfo info=new JpdlInfo();
info.setName(name);
info.setElement(targetElement);
return info;
}
public boolean support(String shapeId){
return shapeId.equals("jbpm4.Task");
}
}
| 1,120 | 0.783929 | 0.771429 | 36 | 30.111111 | 23.652317 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.694444 | false | false |
13
|
c663f77b837cf75e406347adcc4ad0bc2e9df366
| 35,210,141,894,142 |
71858492a1f9295da61e7eb3e1b700dd400f83c4
|
/p3/src/myUtilAula3/Employee.java
|
0eb869ff0744a2c478794ec1b707708069c07ff9
|
[] |
no_license
|
Unn4m3DD/escolisca
|
https://github.com/Unn4m3DD/escolisca
|
c6808ff4e426dc5e6863304ba4488aa44b4f11dc
|
68e20dbb4e2e90371df296dfd8d5f753a09ca152
|
refs/heads/master
| 2023-03-02T16:39:51.520000 | 2021-02-16T12:11:28 | 2021-02-16T12:11:28 | 316,180,900 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package myUtilAula3;
import java.util.Date;
public class Employee extends Client {
private int employeeId, nif;
private static int emploeyeeIdCount = 1;
public Employee(String name, String cc, Date birthDate, int nif) {
super(name, cc, birthDate);
this.employeeId = emploeyeeIdCount;
this.nif = nif;
emploeyeeIdCount++;
}
public String getHeader(){
return "|----------|----------|---|----------|-----|------|-----------|\n"+
"| name| cc| id| BDay| left|Emp Id| NIF|\n"+
"|----------|----------|---|----------|-----|------|-----------|\n";
}
@Override
public String toString() {
return super.toString() + String.format("%6.6s|%10.10s|",employeeId, nif);
}
public int getEmployeeId() {
return employeeId;
}
public int getNif() {
return nif;
}
}
|
UTF-8
|
Java
| 921 |
java
|
Employee.java
|
Java
|
[] | null |
[] |
package myUtilAula3;
import java.util.Date;
public class Employee extends Client {
private int employeeId, nif;
private static int emploeyeeIdCount = 1;
public Employee(String name, String cc, Date birthDate, int nif) {
super(name, cc, birthDate);
this.employeeId = emploeyeeIdCount;
this.nif = nif;
emploeyeeIdCount++;
}
public String getHeader(){
return "|----------|----------|---|----------|-----|------|-----------|\n"+
"| name| cc| id| BDay| left|Emp Id| NIF|\n"+
"|----------|----------|---|----------|-----|------|-----------|\n";
}
@Override
public String toString() {
return super.toString() + String.format("%6.6s|%10.10s|",employeeId, nif);
}
public int getEmployeeId() {
return employeeId;
}
public int getNif() {
return nif;
}
}
| 921 | 0.485342 | 0.476656 | 32 | 27.78125 | 26.513834 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.4375 | false | false |
13
|
142b39a4756584e32699a61cb224f00c3b12d6be
| 20,718,922,299,404 |
0225912043968e53a56bc7a463442d9907f4d7b9
|
/src/main/java/helloRest/CamelHelloRestExample.java
|
a7a5e9570c30b45f56e0bf14f3a3b985944619f3
|
[] |
no_license
|
mDehning/camel_helloWorld
|
https://github.com/mDehning/camel_helloWorld
|
33584f5006b5cb8b883399675c1a77022be2e2ed
|
ff84442c14215f603f7dd0b8425da1f9b8bd7fe2
|
refs/heads/master
| 2021-01-21T10:48:40.028000 | 2017-09-06T11:27:07 | 2017-09-06T11:27:07 | 101,988,235 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package helloRest;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.rest.RestBindingMode;
public class CamelHelloRestExample {
public static void main(String[] args) throws Exception{
CamelContext context = new DefaultCamelContext();
try{
//ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
// RestletComponent r = new RestletComponent();
//
// context.addComponent("restlet", new RestletComponent());
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
restConfiguration()
.component("restlet")
.host("localhost")
.port("8585")
.bindingMode(RestBindingMode.auto);
rest("/say")
.get("/hello").to("direct:hello");
from("direct:hello")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
System.out.println("Hello World! Nice to meet you!");
}
});
}
});
context.start();
while(true){
try{
// Run, run, run forever
Thread.sleep(50000);
} catch(InterruptedException e){}
}
} finally{
context.stop();
}
}
}
|
UTF-8
|
Java
| 1,475 |
java
|
CamelHelloRestExample.java
|
Java
|
[] | null |
[] |
package helloRest;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.rest.RestBindingMode;
public class CamelHelloRestExample {
public static void main(String[] args) throws Exception{
CamelContext context = new DefaultCamelContext();
try{
//ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
// RestletComponent r = new RestletComponent();
//
// context.addComponent("restlet", new RestletComponent());
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
restConfiguration()
.component("restlet")
.host("localhost")
.port("8585")
.bindingMode(RestBindingMode.auto);
rest("/say")
.get("/hello").to("direct:hello");
from("direct:hello")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
System.out.println("Hello World! Nice to meet you!");
}
});
}
});
context.start();
while(true){
try{
// Run, run, run forever
Thread.sleep(50000);
} catch(InterruptedException e){}
}
} finally{
context.stop();
}
}
}
| 1,475 | 0.637966 | 0.631864 | 54 | 25.314816 | 22.265089 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.833333 | false | false |
13
|
dab4eb7e780aa52dc3d71c01b344c412b7d7dc90
| 34,033,320,883,802 |
c712fac67578c621935c948088cbea895895a73e
|
/android_wc_gui/WordCloud.java
|
10d3d6419b2b71e7bcfa88976944e6c37e045d00
|
[] |
no_license
|
SliverShooter/java_wc_gui
|
https://github.com/SliverShooter/java_wc_gui
|
69dd0145d76262c2508010622125531f9d885302
|
fd65efbac9b9b6b0b873af05ce790eeabd9bcb92
|
refs/heads/master
| 2021-01-13T10:36:31.126000 | 2016-10-22T13:56:38 | 2016-10-22T13:56:38 | 68,987,715 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.speedshooter.wordcloud;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.widget.Button;
import android.widget.ImageView;
import java.util.ArrayList;
/**
* Created by SpeedShooter on 2016/10/16.
*/
public class WordCloud extends Thread{
private Activity main;
private ImageView img;
private Button button;
private int MaxW = 0;
private int MaxH = 0;
private ArrayList<WordCloud_StringInfo> Words = new ArrayList<WordCloud_StringInfo>();
private Rect org = new Rect();
private int dot_local = 0;
private Point initial_dot = new Point();
private Point dot = new Point();
private int loop_step = 1;
public WordCloud(ArrayList<WordCloud_StringInfo> Words, int MaxW, int MaxH, ImageView img, Button button, Activity main){
this.main = main;
this.img = img;
this.button = button;
this.MaxW = MaxW;
this.MaxH = MaxH;
this.Words = Words;
Words.get(0).setLocation(((MaxW - Words.get(0).getWidth()) / 2),
((MaxH - Words.get(0).getHeight()) / 2));
org = new Rect(Words.get(0).X() - Words.get(1).getWidth(),
Words.get(0).Y() - Words.get(1).getHeight(),
Words.get(0).X() + Words.get(0).getWidth(),
Words.get(0).Y() + Words.get(0).getHeight()
);
}
public ArrayList<WordCloud_StringInfo> getWords(){
return Words;
}
@Override
public void run() {
super.run();
Paint paint = new Paint();
paint.setTextSize(Words.get(0).getSize());
paint.setColor(Color.WHITE);
paint.setTypeface(Typeface.create("Serif", Typeface.BOLD));
for(int i = 1; i < Words.size(); i++){
Boolean isRun = true;
do{
if(( (dot.x == Rect_getPoint(org, 0, org_add())) &&
(dot.y == Rect_getPoint(org, 1, org_add())) ) &&
(loop_step != 5) ){
loop_step++; //arrival next border
}
else if(((dot.x == initial_dot.x) && (dot.y == initial_dot.y)) &&
(loop_step == 5)){
if(!isOutOfRange(org, MaxW, MaxH, Words.get(i))){
loop_step = 1; //all border have been a tour, set new border
//set new border
org.set(Expand(org, 2));
//reset choose dot
init_dot_set();
}
else{
isRun = false;
}
}
else{
switch((dot_local + loop_step - 1) % 4){
case 0:
dot.set(dot.x + 1, dot.y);
break;
case 2:
dot.set(dot.x - 1, dot.y);
break;
case 1:
dot.set(dot.x, dot.y + 1);
break;
case 3:
dot.set(dot.x, dot.y - 1);
break;
default:
break;
}
Words.get(i).setLocation(dot.x, dot.y);
Boolean Collision = false;
for(int j = 0; j < i; j++){
if(WordCloud_StringInfo.isCollision(Words.get(i), Words.get(j))){
Collision = true;
}
}
if(!Collision){
paint.setTextSize(Words.get(i).getSize());
final WordCloud_Draw wcd = new WordCloud_Draw(img);
wcd.setWords(Words, i);
main.runOnUiThread(new Runnable() {
@Override
public void run() {
img.setImageBitmap(wcd.onDrawImg());
}
});
isRun = false;
}
}
}while(isRun);
if((i + 1) < Words.size()){
dot_reset(i + 1);
}
}
main.runOnUiThread(new Runnable() {
@Override
public void run() {
button.setEnabled(true);
button.setText("SHOW");
}
});
}
public int org_add(){
return ((dot_local + loop_step) % 4);
}
public void dot_reset(int new_Rect){
org = new Rect(Words.get(0).X() - Words.get(new_Rect).getWidth(),
Words.get(0).Y() - Words.get(new_Rect).getHeight(),
Words.get(0).X() + Words.get(0).getWidth(),
Words.get(0).Y() + Words.get(0).getHeight()
);
init_dot_set();
loop_step = 1;
}
public void init_dot_set(){
//set initial choose dot value
dot_local = (int)(Math.random() * 4);
if((dot_local == 0) || (dot_local == 2)){
dot.set((int) (Math.random() * (Rect_getPoint(org, 0, 1) - Rect_getPoint(org, 0, 0) + 1)) + Rect_getPoint(org, 0, 0),
Rect_getPoint(org, 1, dot_local));
}
else if((dot_local == 1) || (dot_local == 3)){
dot.set(Rect_getPoint(org, 0, dot_local),
(int)(Math.random() * (Rect_getPoint(org, 1, 3) - Rect_getPoint(org, 1, 0) + 1)) + Rect_getPoint(org, 1, 0));
}
initial_dot = new Point(dot.x, dot.y);
}
public Rect Expand(Rect rect, int value){
Rect r = new Rect();
r.set(rect.left - value, rect.top - value, rect.right + value, rect.bottom + value);
return r;
}
public Boolean isOutOfRange(Rect rect, int width, int height, WordCloud_StringInfo word){
Boolean result = false;
if(rect.left < 0 || rect.top < 0){
result = true;
}
if(rect.left + rect.width() + word.getWidth() >= width || rect.top < 0){
result = true;
}
if(rect.right + word.getWidth() >= width || rect.bottom + word.getHeight() >= height){
result = true;
}
if(rect.left < 0 || rect.top + rect.height() >= height){
result = true;
}
return result;
}
public int Rect_getPoint(Rect rect, int xy, int value){
Point P = new Point(0, 0);
int result = 0;
switch (value){
case 0:
P = new Point(rect.left, rect.top);
break;
case 1:
P = new Point(rect.left + rect.width(), rect.top);
break;
case 2:
P = new Point(rect.right, rect.bottom);
break;
case 3:
P = new Point(rect.left, rect.top + rect.height());
break;
}
if(xy == 0){
result = P.x;
}
else{
result = P.y;
}
return result;
}
}
|
UTF-8
|
Java
| 7,334 |
java
|
WordCloud.java
|
Java
|
[
{
"context": "w;\n\nimport java.util.ArrayList;\n\n/**\n * Created by SpeedShooter on 2016/10/16.\n */\npublic class WordCloud extends",
"end": 354,
"score": 0.9982936382293701,
"start": 342,
"tag": "USERNAME",
"value": "SpeedShooter"
}
] | null |
[] |
package com.example.speedshooter.wordcloud;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.widget.Button;
import android.widget.ImageView;
import java.util.ArrayList;
/**
* Created by SpeedShooter on 2016/10/16.
*/
public class WordCloud extends Thread{
private Activity main;
private ImageView img;
private Button button;
private int MaxW = 0;
private int MaxH = 0;
private ArrayList<WordCloud_StringInfo> Words = new ArrayList<WordCloud_StringInfo>();
private Rect org = new Rect();
private int dot_local = 0;
private Point initial_dot = new Point();
private Point dot = new Point();
private int loop_step = 1;
public WordCloud(ArrayList<WordCloud_StringInfo> Words, int MaxW, int MaxH, ImageView img, Button button, Activity main){
this.main = main;
this.img = img;
this.button = button;
this.MaxW = MaxW;
this.MaxH = MaxH;
this.Words = Words;
Words.get(0).setLocation(((MaxW - Words.get(0).getWidth()) / 2),
((MaxH - Words.get(0).getHeight()) / 2));
org = new Rect(Words.get(0).X() - Words.get(1).getWidth(),
Words.get(0).Y() - Words.get(1).getHeight(),
Words.get(0).X() + Words.get(0).getWidth(),
Words.get(0).Y() + Words.get(0).getHeight()
);
}
public ArrayList<WordCloud_StringInfo> getWords(){
return Words;
}
@Override
public void run() {
super.run();
Paint paint = new Paint();
paint.setTextSize(Words.get(0).getSize());
paint.setColor(Color.WHITE);
paint.setTypeface(Typeface.create("Serif", Typeface.BOLD));
for(int i = 1; i < Words.size(); i++){
Boolean isRun = true;
do{
if(( (dot.x == Rect_getPoint(org, 0, org_add())) &&
(dot.y == Rect_getPoint(org, 1, org_add())) ) &&
(loop_step != 5) ){
loop_step++; //arrival next border
}
else if(((dot.x == initial_dot.x) && (dot.y == initial_dot.y)) &&
(loop_step == 5)){
if(!isOutOfRange(org, MaxW, MaxH, Words.get(i))){
loop_step = 1; //all border have been a tour, set new border
//set new border
org.set(Expand(org, 2));
//reset choose dot
init_dot_set();
}
else{
isRun = false;
}
}
else{
switch((dot_local + loop_step - 1) % 4){
case 0:
dot.set(dot.x + 1, dot.y);
break;
case 2:
dot.set(dot.x - 1, dot.y);
break;
case 1:
dot.set(dot.x, dot.y + 1);
break;
case 3:
dot.set(dot.x, dot.y - 1);
break;
default:
break;
}
Words.get(i).setLocation(dot.x, dot.y);
Boolean Collision = false;
for(int j = 0; j < i; j++){
if(WordCloud_StringInfo.isCollision(Words.get(i), Words.get(j))){
Collision = true;
}
}
if(!Collision){
paint.setTextSize(Words.get(i).getSize());
final WordCloud_Draw wcd = new WordCloud_Draw(img);
wcd.setWords(Words, i);
main.runOnUiThread(new Runnable() {
@Override
public void run() {
img.setImageBitmap(wcd.onDrawImg());
}
});
isRun = false;
}
}
}while(isRun);
if((i + 1) < Words.size()){
dot_reset(i + 1);
}
}
main.runOnUiThread(new Runnable() {
@Override
public void run() {
button.setEnabled(true);
button.setText("SHOW");
}
});
}
public int org_add(){
return ((dot_local + loop_step) % 4);
}
public void dot_reset(int new_Rect){
org = new Rect(Words.get(0).X() - Words.get(new_Rect).getWidth(),
Words.get(0).Y() - Words.get(new_Rect).getHeight(),
Words.get(0).X() + Words.get(0).getWidth(),
Words.get(0).Y() + Words.get(0).getHeight()
);
init_dot_set();
loop_step = 1;
}
public void init_dot_set(){
//set initial choose dot value
dot_local = (int)(Math.random() * 4);
if((dot_local == 0) || (dot_local == 2)){
dot.set((int) (Math.random() * (Rect_getPoint(org, 0, 1) - Rect_getPoint(org, 0, 0) + 1)) + Rect_getPoint(org, 0, 0),
Rect_getPoint(org, 1, dot_local));
}
else if((dot_local == 1) || (dot_local == 3)){
dot.set(Rect_getPoint(org, 0, dot_local),
(int)(Math.random() * (Rect_getPoint(org, 1, 3) - Rect_getPoint(org, 1, 0) + 1)) + Rect_getPoint(org, 1, 0));
}
initial_dot = new Point(dot.x, dot.y);
}
public Rect Expand(Rect rect, int value){
Rect r = new Rect();
r.set(rect.left - value, rect.top - value, rect.right + value, rect.bottom + value);
return r;
}
public Boolean isOutOfRange(Rect rect, int width, int height, WordCloud_StringInfo word){
Boolean result = false;
if(rect.left < 0 || rect.top < 0){
result = true;
}
if(rect.left + rect.width() + word.getWidth() >= width || rect.top < 0){
result = true;
}
if(rect.right + word.getWidth() >= width || rect.bottom + word.getHeight() >= height){
result = true;
}
if(rect.left < 0 || rect.top + rect.height() >= height){
result = true;
}
return result;
}
public int Rect_getPoint(Rect rect, int xy, int value){
Point P = new Point(0, 0);
int result = 0;
switch (value){
case 0:
P = new Point(rect.left, rect.top);
break;
case 1:
P = new Point(rect.left + rect.width(), rect.top);
break;
case 2:
P = new Point(rect.right, rect.bottom);
break;
case 3:
P = new Point(rect.left, rect.top + rect.height());
break;
}
if(xy == 0){
result = P.x;
}
else{
result = P.y;
}
return result;
}
}
| 7,334 | 0.446141 | 0.434279 | 212 | 33.594341 | 24.896305 | 129 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.853774 | false | false |
13
|
3984728177a9869e9b6422c1b5a9e65778bf3528
| 35,081,292,893,472 |
e1a2a9888dca515e396f6330c0ce68eac8b8bf01
|
/spring-proxy/src/main/java/com/github/mxsm/proxy/two/LogPointcut.java
|
699aa319130c21a78ccb30f0b374f9e881289fdb
|
[] |
no_license
|
mxsm/spring-sample
|
https://github.com/mxsm/spring-sample
|
f012b332e77aadb4496863f1255130645c380193
|
77a0a57b562a73d609019a2016b2da71bea679b5
|
refs/heads/master
| 2022-12-20T23:43:42.473000 | 2022-03-13T06:23:28 | 2022-03-13T06:23:28 | 189,825,869 | 0 | 5 | null | false | 2022-12-16T15:33:20 | 2019-06-02T09:06:08 | 2022-01-29T02:28:15 | 2022-12-16T15:33:17 | 202 | 0 | 2 | 7 |
Java
| false | false |
package com.github.mxsm.proxy.two;
import java.lang.reflect.Method;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.core.annotation.AnnotatedElementUtils;
/**
* @author mxsm
* @date 2021/11/26 16:17
* @Since 1.0.0
*/
public class LogPointcut extends StaticMethodMatcherPointcut{
@Override
public boolean matches(Method method, Class<?> targetClass) {
return AnnotatedElementUtils.hasAnnotation(method, Log.class);
}
}
|
UTF-8
|
Java
| 492 |
java
|
LogPointcut.java
|
Java
|
[
{
"context": "package com.github.mxsm.proxy.two;\n\nimport java.lang.reflect.Method;\nimpo",
"end": 23,
"score": 0.898598849773407,
"start": 19,
"tag": "USERNAME",
"value": "mxsm"
},
{
"context": ".annotation.AnnotatedElementUtils;\n\n/**\n * @author mxsm\n * @date 2021/11/26 16:17\n * @Since 1.0.0\n */\npub",
"end": 223,
"score": 0.9994847774505615,
"start": 219,
"tag": "USERNAME",
"value": "mxsm"
}
] | null |
[] |
package com.github.mxsm.proxy.two;
import java.lang.reflect.Method;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.core.annotation.AnnotatedElementUtils;
/**
* @author mxsm
* @date 2021/11/26 16:17
* @Since 1.0.0
*/
public class LogPointcut extends StaticMethodMatcherPointcut{
@Override
public boolean matches(Method method, Class<?> targetClass) {
return AnnotatedElementUtils.hasAnnotation(method, Log.class);
}
}
| 492 | 0.762195 | 0.731707 | 18 | 26.333334 | 26.400757 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.388889 | false | false |
13
|
611b1bfa20b162a7db085f3f378848a28990755b
| 12,790,412,647,184 |
63e5940424226ebd695c81bb141a010e24ba5b5e
|
/src/games/spaceCops/entity/character/enemy/BasicEnemy.java
|
1f141c5796f03f308cf39b43decce27889513e17
|
[] |
no_license
|
TeleGD/tgd-space-cops
|
https://github.com/TeleGD/tgd-space-cops
|
249e0790739cbf562aafc4d141d972c7b2a502b6
|
37871ae13e39c403211f83684f970e75a471d30d
|
refs/heads/master
| 2021-06-08T02:54:08.326000 | 2021-05-20T17:57:32 | 2021-05-20T17:57:32 | 173,144,494 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package games.spaceCops.entity.character.enemy;
import java.util.Random;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.state.StateBasedGame;
import app.AppLoader;
import games.spaceCops.entity.projectile.Projectile;
import games.spaceCops.explosion.Explosion;
import games.spaceCops.World;
public class BasicEnemy extends Enemy{
private Random rand;
private double targetX; //Coordonnees de la prochaine position
private double targetY;
private boolean explosed = false;
private boolean xOk,yOk; //Si les coordonees x et y sont atteintes
private int marge = 10; //Marge d'erreur
private Explosion explo;
public BasicEnemy(World world, double x, double y, double width, double height, int time) {
super(world, x, y, width, height, time);
speedX = 0.3;
speedY = 0.3;
hp = 1;
rand = new Random();
moveArea(0, 0, 800, 400);
skin = AppLoader.loadPicture("/images/spaceCops/ennemi1.png");
skin = skin.getScaledCopy((float) 1);
}
@Override
public void update(GameContainer container, StateBasedGame game, int delta) {
super.update(container, game, delta);
if(!explosed && !this.alive){
explo = new Explosion(x,y,0.75);
explosed = true;
}
if(explo!=null)
{
explo.update(container,game,delta);
if(explo.finishTest()){
super.destroy();
}
}
}
public void render(GameContainer container, StateBasedGame game, Graphics g) {
if(alive)
g.drawImage(skin,(float)x,(float)y);
if(explo!=null)
explo.render(container,game,g);
}
public void move(int delta){
moveX(delta);
if(x<targetX-marge){
speedX = Math.abs(speedX);
xOk = false;
}else if(x > targetX+marge){
speedX = -Math.abs(speedX);
xOk = false;
}else{
speedX = 0;
xOk = true;
}
moveY(delta);
if(y<targetY-marge){
speedY = Math.abs(speedY);
yOk = false;
}else if(y > targetY+marge){
speedY = -Math.abs(speedY);
yOk = false;
}else{
speedY = 0;
yOk = true;
}
if(xOk && yOk){
moveArea(0 ,0 ,800 ,300);
speedX = 0.3;
speedY = 0.3;
}
}
public void destroy(){
if(alive)
world.setScore(world.getScore()+1);
}
public void moveArea(double x, double y, double width, double height){
targetX = genDouble(x,x+width);
targetY = genDouble(y,y+height);
}
public double genDouble(double min, double max){
return (min+rand.nextInt((int)(max - min)));
}
public void shoot(){
if(alive)
new Projectile(world, x,y,180,0.8, false);
}
}
|
UTF-8
|
Java
| 2,487 |
java
|
BasicEnemy.java
|
Java
|
[] | null |
[] |
package games.spaceCops.entity.character.enemy;
import java.util.Random;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.state.StateBasedGame;
import app.AppLoader;
import games.spaceCops.entity.projectile.Projectile;
import games.spaceCops.explosion.Explosion;
import games.spaceCops.World;
public class BasicEnemy extends Enemy{
private Random rand;
private double targetX; //Coordonnees de la prochaine position
private double targetY;
private boolean explosed = false;
private boolean xOk,yOk; //Si les coordonees x et y sont atteintes
private int marge = 10; //Marge d'erreur
private Explosion explo;
public BasicEnemy(World world, double x, double y, double width, double height, int time) {
super(world, x, y, width, height, time);
speedX = 0.3;
speedY = 0.3;
hp = 1;
rand = new Random();
moveArea(0, 0, 800, 400);
skin = AppLoader.loadPicture("/images/spaceCops/ennemi1.png");
skin = skin.getScaledCopy((float) 1);
}
@Override
public void update(GameContainer container, StateBasedGame game, int delta) {
super.update(container, game, delta);
if(!explosed && !this.alive){
explo = new Explosion(x,y,0.75);
explosed = true;
}
if(explo!=null)
{
explo.update(container,game,delta);
if(explo.finishTest()){
super.destroy();
}
}
}
public void render(GameContainer container, StateBasedGame game, Graphics g) {
if(alive)
g.drawImage(skin,(float)x,(float)y);
if(explo!=null)
explo.render(container,game,g);
}
public void move(int delta){
moveX(delta);
if(x<targetX-marge){
speedX = Math.abs(speedX);
xOk = false;
}else if(x > targetX+marge){
speedX = -Math.abs(speedX);
xOk = false;
}else{
speedX = 0;
xOk = true;
}
moveY(delta);
if(y<targetY-marge){
speedY = Math.abs(speedY);
yOk = false;
}else if(y > targetY+marge){
speedY = -Math.abs(speedY);
yOk = false;
}else{
speedY = 0;
yOk = true;
}
if(xOk && yOk){
moveArea(0 ,0 ,800 ,300);
speedX = 0.3;
speedY = 0.3;
}
}
public void destroy(){
if(alive)
world.setScore(world.getScore()+1);
}
public void moveArea(double x, double y, double width, double height){
targetX = genDouble(x,x+width);
targetY = genDouble(y,y+height);
}
public double genDouble(double min, double max){
return (min+rand.nextInt((int)(max - min)));
}
public void shoot(){
if(alive)
new Projectile(world, x,y,180,0.8, false);
}
}
| 2,487 | 0.678327 | 0.662244 | 113 | 21.00885 | 19.995794 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.283186 | false | false |
13
|
89a238ff68b7319517e6f7b2f347f347d158ac9c
| 32,538,672,274,814 |
8a4fe4ef23fba2feffce3b2dcb0824ec340d431d
|
/src/mp3something/Timer.java
|
6407529e85f36c365198143cbbdeea8b7374eec1
|
[] |
no_license
|
imrayya/MP3_Decoder
|
https://github.com/imrayya/MP3_Decoder
|
b16d59c58d340a7a173363df2b9641709218e6eb
|
8185b321affb586aad589fce8b78d192df22817a
|
refs/heads/master
| 2018-04-05T13:52:28.758000 | 2015-09-16T17:22:59 | 2015-09-16T17:22:59 | 42,372,709 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package mp3something;
public class Timer {
public Timer() {
}
private long start;
private long end;
void start() {
start = System.nanoTime();
}
void end() {
end = System.nanoTime() - start;
}
long getEndTime() {
return end;
}
}
|
UTF-8
|
Java
| 320 |
java
|
Timer.java
|
Java
|
[] | null |
[] |
package mp3something;
public class Timer {
public Timer() {
}
private long start;
private long end;
void start() {
start = System.nanoTime();
}
void end() {
end = System.nanoTime() - start;
}
long getEndTime() {
return end;
}
}
| 320 | 0.4875 | 0.484375 | 22 | 12.545455 | 11.823425 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | false | false |
13
|
067ea74389a3b8761cdd623d7e24e524c43d43ba
| 15,023,795,634,477 |
bb245ea3b58a91cb8972d61d7830fffbeb2c72e5
|
/Parking/后台管理系统/SmartID_YJY/src/com/dhsr/smartid/tingchexitong/web/TingcheController.java
|
0cfd92643160bc6a2220549abd79652ca235c36a
|
[] |
no_license
|
liuxiaogangqq/SmartID_YJY
|
https://github.com/liuxiaogangqq/SmartID_YJY
|
8a7af694774d6c1227f5e0c119c1e8f12576a4da
|
54b4041caae0fc6989293018ad5660c65a1eb742
|
refs/heads/master
| 2023-04-02T07:26:39.611000 | 2021-04-13T02:51:37 | 2021-04-13T02:51:37 | 356,897,205 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.dhsr.smartid.tingchexitong.web;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.alibaba.fastjson.JSON;
import com.dhsr.smartid.base.web.BaseController;
import com.dhsr.smartid.peizhiguanli.domain.Operator;
import com.dhsr.smartid.tingchexitong.domain.CarInfo;
import com.dhsr.smartid.tingchexitong.domain.CarType;
import com.dhsr.smartid.tingchexitong.domain.Holiday;
import com.dhsr.smartid.tingchexitong.domain.ParkInfo;
import com.dhsr.smartid.tingchexitong.domain.PassRules;
import com.dhsr.smartid.tingchexitong.service.TingcheService;
import com.dhsr.smartid.util.DataGridModel;
import com.dhsr.smartid.util.HttpClintUtil;
import com.dhsr.smartid.util.LogInfo;
@Controller
public class TingcheController extends BaseController {
@Resource
private TingcheService tingcheService;
private Boolean checkJurisdiction(Operator operator, String pageRightId) {
Boolean result = false;
if(operator.getOperatorId().equals("admin")){
return true;
}else{
String[] PageList = operator.getPageList().split(",");
for (String Page : PageList) {
if (Page.indexOf(pageRightId) == 0) {
result = true;
break;
}
}
return result;
}
}
@RequestMapping(value = "/tccmain", method = RequestMethod.GET)
public String rsywmain(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "8");
if (result) {
return "/tcxt/tccmain";
} else {
model.put("noSystem", "您没有进入停车管理系统的权限");
return "/index";
}
} else {
model.put("backLogin", "login.html");
return "/tcxt/tccmain";
}
}
@RequestMapping(value = "/tccright", method = RequestMethod.GET)
public String rsywright() {
return "/tcxt/tccright";
}
@RequestMapping(value = "/tccsidebar", method = RequestMethod.GET)
public String rsywsidebar() {
return "/tcxt/tccsidebar";
}
@RequestMapping(value = "/tcctop", method = RequestMethod.GET)
public String rsywtop() {
return "/tcxt/tcctop";
}
// 停车场管理界面
@RequestMapping(value = "/parkInfo", method = RequestMethod.GET)
public String parkInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "801");
if (result) {
return "/tcxt/parkInfo";
} else {
model.put("noPage", "您没有进入停车场 管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆信息界面
@RequestMapping(value = "/userCarInfo", method = RequestMethod.GET)
public String userCarInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "802");
if (result) {
return "/tcxt/carInfo";
} else {
model.put("noPage", "您没有进入车辆信息管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆信息导入界面
@RequestMapping(value = "/carExcel", method = RequestMethod.GET)
public String carExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "802");
if (result) {
return "/tcxt/carExcel";
} else {
model.put("noPage", "您没有进入车辆信息管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆类型界面
@RequestMapping(value = "/carType", method = RequestMethod.GET)
public String carType(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "803");
if (result) {
return "/tcxt/carType";
} else {
model.put("noPage", "您没有进入车辆类型管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆类型界面
@RequestMapping(value = "/passRules", method = RequestMethod.GET)
public String passRules(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "804");
if (result) {
return "/tcxt/passRules";
} else {
model.put("noPage", "您没有进入通行规则管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 节假日管理界面
@RequestMapping(value = "/holiday", method = RequestMethod.GET)
public String holiday(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "805");
if (result) {
return "/tcxt/holiday1";
} else {
model.put("noPage", "您没有进入节假日管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 预约车管理界面
@RequestMapping(value = "/yuyueche", method = RequestMethod.GET)
public String yuyueche(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "810");
if (result) {
return "/tcxt/yuyueche";
} else {
model.put("noPage", "您没有进入预约车管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 固定车通行记录
@RequestMapping(value = "/gudingchejilu", method = RequestMethod.GET)
public String gudingchejilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "806");
if (result) {
return "/tcxt/gudingchejilu";
} else {
model.put("noPage", "您没有进入固定车通行记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 预约车通行记录
@RequestMapping(value = "/yuyuechejilu", method = RequestMethod.GET)
public String yuyuechejilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "807");
if (result) {
return "/tcxt/yuyuechejilu";
} else {
model.put("noPage", "您没有进入预约车通行记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 特殊车通行记录
@RequestMapping(value = "/teshuchejilu", method = RequestMethod.GET)
public String teshuchejilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "809");
if (result) {
return "/tcxt/teshuchejilu";
} else {
model.put("noPage", "您没有进入特殊车通行记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 异常记录查询界面
@RequestMapping(value = "/yichangjilu", method = RequestMethod.GET)
public String yichangjilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "808");
if (result) {
return "/tcxt/yichangjilu";
} else {
model.put("noPage", "您没有进入异常车辆记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 异常记录查询界面
@RequestMapping(value = "/xiaofeiTJ", method = RequestMethod.GET)
public String xiaofeiTJ(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "813");
if (result) {
return "/tcxt/conLog";
} else {
model.put("noPage", "您没有进入预约消费记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 所有车辆通行记录界面
@RequestMapping(value = "/chargeRecord", method = RequestMethod.GET)
public String chargeRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "811");
if (result) {
return "/tcxt/chargeRecord";
} else {
model.put("noPage", "您没有进入车辆收费记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 消费记录统计界面
@RequestMapping(value = "/contcStatistics", method = RequestMethod.GET)
public String conStatistics(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "812");
if (result) {
return "/tcxt/conStatistics";
} else {
model.put("noPage", "您没有进入消费记录统计的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 消费记录统计界面
@RequestMapping(value = "/parkNumber", method = RequestMethod.GET)
public String parkNumber(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "813");
if (result) {
return "/tcxt/parkNumber";
} else {
model.put("noPage", "您没有进入车位数量管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
/**
* 查询停车场方法,在前台显示
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/parkInfo/select", method = RequestMethod.POST)
public void selectParkInfo(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectParkInfo(dgm, parkInfo);
renderText(response, result);
}
/**
* 新增停车场信息
* @param request
* @param response
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/parkInfo/insert", method = RequestMethod.POST)
public void insertParkInfo(HttpServletRequest request, HttpServletResponse response,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertParkInfo(parkInfo);
renderText(response, result);
}
/**
* 更新停车场信息
* @param request
* @param response
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/parkInfo/update", method = RequestMethod.POST)
public void updateParkInfo(HttpServletRequest request, HttpServletResponse response,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateParkInfo(parkInfo);
renderText(response, result);
}
/**
* 查询车辆信息
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/userCarInfo/select", method = RequestMethod.POST)
public void selectuserCarInfo(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectuserCarInfo(dgm,request);
renderText(response, result);
}
/**
* 查询车辆类型,界面显示
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carType/select", method = RequestMethod.POST)
public void selectCarType(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarType(dgm,request);
renderText(response, result);
}
/**
* 新增车辆类型
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carType/insert", method = RequestMethod.POST)
public void insertCarType(HttpServletRequest request, HttpServletResponse response, CarType carType,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertCarType(carType);
renderText(response, result);
}
/**
* 修改车辆类型
* @param request
* @param response
* @param carType
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carType/update", method = RequestMethod.POST)
public void updateCarType(HttpServletRequest request, HttpServletResponse response, CarType carType,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateCarType(carType);
renderText(response, result);
}
/**
* 查询车辆类型,在下拉框显示
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carTypeBox/select", method = RequestMethod.POST)
public void selectCarTypeBox(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarTypeBox(dgm,request);
renderText(response, result);
}
/**
* 新增车辆信息
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carInfo/insert", method = RequestMethod.POST)
public void insertCarInfo(HttpServletRequest request, HttpServletResponse response, CarInfo carInfo,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertCarInfo(carInfo,request);
renderText(response, result);
}
/**
* 修改车辆信息
* @param request
* @param response
* @param carInfo
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carInfo/update", method = RequestMethod.POST)
public void updateCarInfo(HttpServletRequest request, HttpServletResponse response, CarInfo carInfo,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateCarInfo(carInfo,request);
renderText(response, result);
}
/**
* 新增通行规则
* @param request
* @param response
* @param passRules
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/passRules/insert", method = RequestMethod.POST)
public void insertPassRules(HttpServletRequest request, HttpServletResponse response, PassRules passRules,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertPassRules(passRules,request);
renderText(response, result);
}
/**
* 修改通行规则
* @param request
* @param response
* @param passRules
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/passRules/update", method = RequestMethod.POST)
public void updatePassRules(HttpServletRequest request, HttpServletResponse response, PassRules passRules,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updatePassRules(passRules,request);
renderText(response, result);
}
/**
* 查询通行规则
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/passRules/select", method = RequestMethod.POST)
public void selectPassRules(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectPassRules(dgm,request);
renderText(response, result);
}
/**
* 查询节假日
* @param request
* @param dgm
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/select",method=RequestMethod.POST)
public void attendanceHolidayInfo(HttpServletRequest request, DataGridModel dgm,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectAttendanceHoliday(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceHoliday/select", e, "查询考勤节假日异常");
}
}
/**
* 插入节假日
* @param request
* @param dgm
* @param attendance_Holiday
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/insert",method=RequestMethod.POST)
public void attendanceGroupInsert(HttpServletRequest request, DataGridModel dgm,Holiday holiday,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertAttendanceHoliday(request, holiday);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceGroup/insert", e, "添加考勤节假日异常");
}
}
/**
* 修改节假日
* @param request
* @param dgm
* @param attendance_Holiday
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/update",method=RequestMethod.POST)
public void attendanceHolidayUpdate(HttpServletRequest request, DataGridModel dgm,Holiday holiday,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateAttendanceHoliday(request, holiday);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceHoliday/update", e, "修改考勤节假日异常");
}
}
/**
* 删除考勤组
* @param request
* @param dgm
* @param GroupInnerId
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/delete",method=RequestMethod.POST)
public void attendanceHolidayDelete(HttpServletRequest request, DataGridModel dgm,Integer HolidayInnerId,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.delelteAttendanceHoliday(request, HolidayInnerId);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceHoliday/delete", e, "删除考勤节假日异常");
}
}
/**
* 存储车辆进出记录
* @param request
* @param response
* @param model
*/
/*@RequestMapping(value = "/carRecord",method=RequestMethod.POST)
public void insertCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertCarRecord(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "carRecord", e, "接收推送的通行记录");
}
}*/
/**
* 查询预约车辆信息
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/ReservationCar/select",method=RequestMethod.POST)
public void selectReservationCar(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectReservationCar(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
/**
* 查询固定车通行记录
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/GDCarRecord/select",method=RequestMethod.POST)
public void selectGDCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectGDCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
/**
* 查询特殊车通行记录
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/TSCarRecord/select",method=RequestMethod.POST)
public void selectTSCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectTSCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询特殊车辆通行记录信息");
}
}
/**
* 查询固定车通行记录
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/YYCarRecord/select",method=RequestMethod.POST)
public void selectYYCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYYCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
@RequestMapping(value = "/CarRecord",method=RequestMethod.POST)
public void CarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYYCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
@RequestMapping(value = "/StopCharging/update",method=RequestMethod.POST)
public void StopCharging(HttpServletRequest request, HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.StopCharging(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "提前停止预约");
}
}
@RequestMapping(value = "/YCCarRecord/select",method=RequestMethod.POST)
public void selectYCCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYCChargeRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "异常收费记录查询");
}
}
@RequestMapping(value = "/YCchargeRecordInfo/update",method=RequestMethod.POST)
public void updateYCchargeRecordInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateYCchargeRecordInfo(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/CarconLog/select",method=RequestMethod.POST)
public void selectCarconLog(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarconLog(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/SYYCarRecord/select",method=RequestMethod.POST)
public void selectSYYCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectSYYCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/SLSCarRecord/select",method=RequestMethod.POST)
public void selectSGDCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectSLSCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/carStopShengyu/select",method=RequestMethod.POST)
public void selectcarStopShengyu(HttpServletRequest request, HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectcarStopShengyu(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/CarInfoExcel/select",method=RequestMethod.POST)
public void selectCarInfoExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarInfoExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/YuyuecheExcel/select",method=RequestMethod.POST)
public void selectYuyuecheExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYuyuecheExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/Visitor_OrderRecord/insert",method=RequestMethod.POST)
public void insertVisitor_OrderRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertVisitor_OrderRecord(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "新增临时车预约记录");
}
}
@RequestMapping(value = "/chargeRecordInfo/select",method=RequestMethod.POST)
public void selectChargeRecordInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectChargeRecordInfo(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "查询收费记录");
}
}
@RequestMapping(value = "/carInfoTime/update",method=RequestMethod.POST)
public void updateCarInfoTime(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateCarInfoTime(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "批量修改车辆时间信息");
}
}
@RequestMapping(value = "/tcConStatistics/select",method=RequestMethod.POST)
public void selectTcConStatistics(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectTcConStatistics(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "批量修改车辆时间信息");
}
}
@RequestMapping(value = "/showCarExcel",method=RequestMethod.POST)
public void showCarExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.showCarExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "批量修改车辆时间信息");
}
}
@RequestMapping(value = "/chargeRecordInfoExcel/select",method=RequestMethod.POST)
public void selectChargeRecordInfoExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectChargeRecordInfoExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "导出车辆收费信息表");
}
}
@RequestMapping(value = "/VisitorState/update",method=RequestMethod.POST)
public void updateVisState(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateVisState(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "修改预约记录状态");
}
}
@RequestMapping(value = "/ParkNumberDate/select",method=RequestMethod.POST)
public void selectParkNumberDate(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectParkNumberDate(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "查询一个月内车位数量");
}
}
@RequestMapping(value = "/parkDateNumber/update",method=RequestMethod.POST)
public void updateParkDateNumber(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateParkDateNumber(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "修改车位数量");
}
}
}
|
UTF-8
|
Java
| 32,951 |
java
|
TingcheController.java
|
Java
|
[] | null |
[] |
package com.dhsr.smartid.tingchexitong.web;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.alibaba.fastjson.JSON;
import com.dhsr.smartid.base.web.BaseController;
import com.dhsr.smartid.peizhiguanli.domain.Operator;
import com.dhsr.smartid.tingchexitong.domain.CarInfo;
import com.dhsr.smartid.tingchexitong.domain.CarType;
import com.dhsr.smartid.tingchexitong.domain.Holiday;
import com.dhsr.smartid.tingchexitong.domain.ParkInfo;
import com.dhsr.smartid.tingchexitong.domain.PassRules;
import com.dhsr.smartid.tingchexitong.service.TingcheService;
import com.dhsr.smartid.util.DataGridModel;
import com.dhsr.smartid.util.HttpClintUtil;
import com.dhsr.smartid.util.LogInfo;
@Controller
public class TingcheController extends BaseController {
@Resource
private TingcheService tingcheService;
private Boolean checkJurisdiction(Operator operator, String pageRightId) {
Boolean result = false;
if(operator.getOperatorId().equals("admin")){
return true;
}else{
String[] PageList = operator.getPageList().split(",");
for (String Page : PageList) {
if (Page.indexOf(pageRightId) == 0) {
result = true;
break;
}
}
return result;
}
}
@RequestMapping(value = "/tccmain", method = RequestMethod.GET)
public String rsywmain(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "8");
if (result) {
return "/tcxt/tccmain";
} else {
model.put("noSystem", "您没有进入停车管理系统的权限");
return "/index";
}
} else {
model.put("backLogin", "login.html");
return "/tcxt/tccmain";
}
}
@RequestMapping(value = "/tccright", method = RequestMethod.GET)
public String rsywright() {
return "/tcxt/tccright";
}
@RequestMapping(value = "/tccsidebar", method = RequestMethod.GET)
public String rsywsidebar() {
return "/tcxt/tccsidebar";
}
@RequestMapping(value = "/tcctop", method = RequestMethod.GET)
public String rsywtop() {
return "/tcxt/tcctop";
}
// 停车场管理界面
@RequestMapping(value = "/parkInfo", method = RequestMethod.GET)
public String parkInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "801");
if (result) {
return "/tcxt/parkInfo";
} else {
model.put("noPage", "您没有进入停车场 管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆信息界面
@RequestMapping(value = "/userCarInfo", method = RequestMethod.GET)
public String userCarInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "802");
if (result) {
return "/tcxt/carInfo";
} else {
model.put("noPage", "您没有进入车辆信息管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆信息导入界面
@RequestMapping(value = "/carExcel", method = RequestMethod.GET)
public String carExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "802");
if (result) {
return "/tcxt/carExcel";
} else {
model.put("noPage", "您没有进入车辆信息管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆类型界面
@RequestMapping(value = "/carType", method = RequestMethod.GET)
public String carType(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "803");
if (result) {
return "/tcxt/carType";
} else {
model.put("noPage", "您没有进入车辆类型管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 车辆类型界面
@RequestMapping(value = "/passRules", method = RequestMethod.GET)
public String passRules(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "804");
if (result) {
return "/tcxt/passRules";
} else {
model.put("noPage", "您没有进入通行规则管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 节假日管理界面
@RequestMapping(value = "/holiday", method = RequestMethod.GET)
public String holiday(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "805");
if (result) {
return "/tcxt/holiday1";
} else {
model.put("noPage", "您没有进入节假日管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 预约车管理界面
@RequestMapping(value = "/yuyueche", method = RequestMethod.GET)
public String yuyueche(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "810");
if (result) {
return "/tcxt/yuyueche";
} else {
model.put("noPage", "您没有进入预约车管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 固定车通行记录
@RequestMapping(value = "/gudingchejilu", method = RequestMethod.GET)
public String gudingchejilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "806");
if (result) {
return "/tcxt/gudingchejilu";
} else {
model.put("noPage", "您没有进入固定车通行记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 预约车通行记录
@RequestMapping(value = "/yuyuechejilu", method = RequestMethod.GET)
public String yuyuechejilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "807");
if (result) {
return "/tcxt/yuyuechejilu";
} else {
model.put("noPage", "您没有进入预约车通行记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 特殊车通行记录
@RequestMapping(value = "/teshuchejilu", method = RequestMethod.GET)
public String teshuchejilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "809");
if (result) {
return "/tcxt/teshuchejilu";
} else {
model.put("noPage", "您没有进入特殊车通行记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 异常记录查询界面
@RequestMapping(value = "/yichangjilu", method = RequestMethod.GET)
public String yichangjilu(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "808");
if (result) {
return "/tcxt/yichangjilu";
} else {
model.put("noPage", "您没有进入异常车辆记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 异常记录查询界面
@RequestMapping(value = "/xiaofeiTJ", method = RequestMethod.GET)
public String xiaofeiTJ(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "813");
if (result) {
return "/tcxt/conLog";
} else {
model.put("noPage", "您没有进入预约消费记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 所有车辆通行记录界面
@RequestMapping(value = "/chargeRecord", method = RequestMethod.GET)
public String chargeRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "811");
if (result) {
return "/tcxt/chargeRecord";
} else {
model.put("noPage", "您没有进入车辆收费记录的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 消费记录统计界面
@RequestMapping(value = "/contcStatistics", method = RequestMethod.GET)
public String conStatistics(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "812");
if (result) {
return "/tcxt/conStatistics";
} else {
model.put("noPage", "您没有进入消费记录统计的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
// 消费记录统计界面
@RequestMapping(value = "/parkNumber", method = RequestMethod.GET)
public String parkNumber(HttpServletRequest request, HttpServletResponse response, ModelMap model) {
Operator operator = (Operator) request.getSession().getAttribute("operatorSession");
if (operator != null) {
Boolean result = checkJurisdiction(operator, "813");
if (result) {
return "/tcxt/parkNumber";
} else {
model.put("noPage", "您没有进入车位数量管理的权限!");
return "/tcxt/tccmain";
}
} else {
return "redirect:tccmain.html";
}
}
/**
* 查询停车场方法,在前台显示
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/parkInfo/select", method = RequestMethod.POST)
public void selectParkInfo(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectParkInfo(dgm, parkInfo);
renderText(response, result);
}
/**
* 新增停车场信息
* @param request
* @param response
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/parkInfo/insert", method = RequestMethod.POST)
public void insertParkInfo(HttpServletRequest request, HttpServletResponse response,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertParkInfo(parkInfo);
renderText(response, result);
}
/**
* 更新停车场信息
* @param request
* @param response
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/parkInfo/update", method = RequestMethod.POST)
public void updateParkInfo(HttpServletRequest request, HttpServletResponse response,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateParkInfo(parkInfo);
renderText(response, result);
}
/**
* 查询车辆信息
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/userCarInfo/select", method = RequestMethod.POST)
public void selectuserCarInfo(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectuserCarInfo(dgm,request);
renderText(response, result);
}
/**
* 查询车辆类型,界面显示
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carType/select", method = RequestMethod.POST)
public void selectCarType(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarType(dgm,request);
renderText(response, result);
}
/**
* 新增车辆类型
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carType/insert", method = RequestMethod.POST)
public void insertCarType(HttpServletRequest request, HttpServletResponse response, CarType carType,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertCarType(carType);
renderText(response, result);
}
/**
* 修改车辆类型
* @param request
* @param response
* @param carType
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carType/update", method = RequestMethod.POST)
public void updateCarType(HttpServletRequest request, HttpServletResponse response, CarType carType,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateCarType(carType);
renderText(response, result);
}
/**
* 查询车辆类型,在下拉框显示
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carTypeBox/select", method = RequestMethod.POST)
public void selectCarTypeBox(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarTypeBox(dgm,request);
renderText(response, result);
}
/**
* 新增车辆信息
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carInfo/insert", method = RequestMethod.POST)
public void insertCarInfo(HttpServletRequest request, HttpServletResponse response, CarInfo carInfo,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertCarInfo(carInfo,request);
renderText(response, result);
}
/**
* 修改车辆信息
* @param request
* @param response
* @param carInfo
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/carInfo/update", method = RequestMethod.POST)
public void updateCarInfo(HttpServletRequest request, HttpServletResponse response, CarInfo carInfo,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateCarInfo(carInfo,request);
renderText(response, result);
}
/**
* 新增通行规则
* @param request
* @param response
* @param passRules
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/passRules/insert", method = RequestMethod.POST)
public void insertPassRules(HttpServletRequest request, HttpServletResponse response, PassRules passRules,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertPassRules(passRules,request);
renderText(response, result);
}
/**
* 修改通行规则
* @param request
* @param response
* @param passRules
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/passRules/update", method = RequestMethod.POST)
public void updatePassRules(HttpServletRequest request, HttpServletResponse response, PassRules passRules,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.updatePassRules(passRules,request);
renderText(response, result);
}
/**
* 查询通行规则
* @param request
* @param response
* @param dgm
* @param modelMap
* @param parkInfo
* @throws IOException
*/
@RequestMapping(value = "/passRules/select", method = RequestMethod.POST)
public void selectPassRules(HttpServletRequest request, HttpServletResponse response, DataGridModel dgm,
ModelMap modelMap, ParkInfo parkInfo) throws IOException {
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectPassRules(dgm,request);
renderText(response, result);
}
/**
* 查询节假日
* @param request
* @param dgm
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/select",method=RequestMethod.POST)
public void attendanceHolidayInfo(HttpServletRequest request, DataGridModel dgm,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectAttendanceHoliday(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceHoliday/select", e, "查询考勤节假日异常");
}
}
/**
* 插入节假日
* @param request
* @param dgm
* @param attendance_Holiday
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/insert",method=RequestMethod.POST)
public void attendanceGroupInsert(HttpServletRequest request, DataGridModel dgm,Holiday holiday,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertAttendanceHoliday(request, holiday);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceGroup/insert", e, "添加考勤节假日异常");
}
}
/**
* 修改节假日
* @param request
* @param dgm
* @param attendance_Holiday
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/update",method=RequestMethod.POST)
public void attendanceHolidayUpdate(HttpServletRequest request, DataGridModel dgm,Holiday holiday,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateAttendanceHoliday(request, holiday);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceHoliday/update", e, "修改考勤节假日异常");
}
}
/**
* 删除考勤组
* @param request
* @param dgm
* @param GroupInnerId
* @param response
* @param model
*/
@RequestMapping(value = "/attendanceHoliday/delete",method=RequestMethod.POST)
public void attendanceHolidayDelete(HttpServletRequest request, DataGridModel dgm,Integer HolidayInnerId,HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.delelteAttendanceHoliday(request, HolidayInnerId);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "attendanceHoliday/delete", e, "删除考勤节假日异常");
}
}
/**
* 存储车辆进出记录
* @param request
* @param response
* @param model
*/
/*@RequestMapping(value = "/carRecord",method=RequestMethod.POST)
public void insertCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertCarRecord(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "carRecord", e, "接收推送的通行记录");
}
}*/
/**
* 查询预约车辆信息
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/ReservationCar/select",method=RequestMethod.POST)
public void selectReservationCar(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectReservationCar(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
/**
* 查询固定车通行记录
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/GDCarRecord/select",method=RequestMethod.POST)
public void selectGDCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectGDCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
/**
* 查询特殊车通行记录
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/TSCarRecord/select",method=RequestMethod.POST)
public void selectTSCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectTSCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询特殊车辆通行记录信息");
}
}
/**
* 查询固定车通行记录
* @param request
* @param response
* @param model
* @param dgm
*/
@RequestMapping(value = "/YYCarRecord/select",method=RequestMethod.POST)
public void selectYYCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYYCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
@RequestMapping(value = "/CarRecord",method=RequestMethod.POST)
public void CarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYYCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "ReservationCar", e, "查询预约车辆信息");
}
}
@RequestMapping(value = "/StopCharging/update",method=RequestMethod.POST)
public void StopCharging(HttpServletRequest request, HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.StopCharging(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "提前停止预约");
}
}
@RequestMapping(value = "/YCCarRecord/select",method=RequestMethod.POST)
public void selectYCCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYCChargeRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "异常收费记录查询");
}
}
@RequestMapping(value = "/YCchargeRecordInfo/update",method=RequestMethod.POST)
public void updateYCchargeRecordInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateYCchargeRecordInfo(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/CarconLog/select",method=RequestMethod.POST)
public void selectCarconLog(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarconLog(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/SYYCarRecord/select",method=RequestMethod.POST)
public void selectSYYCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectSYYCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/SLSCarRecord/select",method=RequestMethod.POST)
public void selectSGDCarRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectSLSCarRecord(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/carStopShengyu/select",method=RequestMethod.POST)
public void selectcarStopShengyu(HttpServletRequest request, HttpServletResponse response, ModelMap model){
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectcarStopShengyu(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/CarInfoExcel/select",method=RequestMethod.POST)
public void selectCarInfoExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectCarInfoExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/YuyuecheExcel/select",method=RequestMethod.POST)
public void selectYuyuecheExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectYuyuecheExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "处理异常收费记录");
}
}
@RequestMapping(value = "/Visitor_OrderRecord/insert",method=RequestMethod.POST)
public void insertVisitor_OrderRecord(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.insertVisitor_OrderRecord(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "StopCharging", e, "新增临时车预约记录");
}
}
@RequestMapping(value = "/chargeRecordInfo/select",method=RequestMethod.POST)
public void selectChargeRecordInfo(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectChargeRecordInfo(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "查询收费记录");
}
}
@RequestMapping(value = "/carInfoTime/update",method=RequestMethod.POST)
public void updateCarInfoTime(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateCarInfoTime(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "批量修改车辆时间信息");
}
}
@RequestMapping(value = "/tcConStatistics/select",method=RequestMethod.POST)
public void selectTcConStatistics(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectTcConStatistics(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "批量修改车辆时间信息");
}
}
@RequestMapping(value = "/showCarExcel",method=RequestMethod.POST)
public void showCarExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.showCarExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "批量修改车辆时间信息");
}
}
@RequestMapping(value = "/chargeRecordInfoExcel/select",method=RequestMethod.POST)
public void selectChargeRecordInfoExcel(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectChargeRecordInfoExcel(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "导出车辆收费信息表");
}
}
@RequestMapping(value = "/VisitorState/update",method=RequestMethod.POST)
public void updateVisState(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateVisState(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "修改预约记录状态");
}
}
@RequestMapping(value = "/ParkNumberDate/select",method=RequestMethod.POST)
public void selectParkNumberDate(HttpServletRequest request, HttpServletResponse response, ModelMap model,DataGridModel dgm) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.selectParkNumberDate(request,dgm);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "查询一个月内车位数量");
}
}
@RequestMapping(value = "/parkDateNumber/update",method=RequestMethod.POST)
public void updateParkDateNumber(HttpServletRequest request, HttpServletResponse response, ModelMap model) throws Exception{
response.setCharacterEncoding("utf-8");
String result = tingcheService.updateParkDateNumber(request);
try {
renderText(response, result);
} catch (IOException e) {
LogInfo.logError(TingcheController.class, "chargeRecordInfo", e, "修改车位数量");
}
}
}
| 32,951 | 0.736671 | 0.733842 | 933 | 32.713825 | 32.118927 | 152 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.468382 | false | false |
13
|
07c00b749de7e46d95b8734e86c341765dc8b678
| 22,539,988,411,985 |
399087d30f49cdf03a7118d842f326370400c4c0
|
/utils/src/main/java/com/tangzhen/data/prefs/AppPreferencesHelper.java
|
8ab3b7d6d2e3ad705152f3794342f6e3cf8c4b19
|
[] |
no_license
|
lwtwan321/tangzhen
|
https://github.com/lwtwan321/tangzhen
|
f1fb9d52c05eb6b46cf67f935cfe69a917a4c54f
|
e9c18e988fe06ca9403b9d79cd5145fecea9236a
|
refs/heads/master
| 2020-04-27T20:34:58.305000 | 2019-03-19T16:20:46 | 2019-03-19T16:20:46 | 174,663,148 | 2 | 0 | null | false | 2019-03-19T09:10:55 | 2019-03-09T07:35:14 | 2019-03-19T09:10:52 | 2019-03-19T09:10:50 | 172 | 0 | 0 | 0 |
Java
| false | null |
package com.tangzhen.data.prefs;
import android.content.Context;
import android.content.SharedPreferences;
import com.tangzhen.di.ApplicationContext;
import com.tangzhen.di.PreferenceInfo;
import javax.inject.Inject;
public class AppPreferencesHelper implements PreferencesHelper {
private static final String PREF_KEY_CURRENT_USER_NAME = "PREF_KEY_CURRENT_USER_NAME";
private final SharedPreferences mPrefs;
@Inject
public AppPreferencesHelper(@ApplicationContext Context context,
@PreferenceInfo String mPrefsName) {
mPrefs = context.getSharedPreferences(mPrefsName, Context.MODE_PRIVATE);
}
@Override
public String getCurrentUserName() {
return mPrefs.getString(PREF_KEY_CURRENT_USER_NAME, null);
}
@Override
public void setCurrentUserName(String userName) {
mPrefs.edit().putString(PREF_KEY_CURRENT_USER_NAME, userName).apply();
}
}
|
UTF-8
|
Java
| 946 |
java
|
AppPreferencesHelper.java
|
Java
|
[] | null |
[] |
package com.tangzhen.data.prefs;
import android.content.Context;
import android.content.SharedPreferences;
import com.tangzhen.di.ApplicationContext;
import com.tangzhen.di.PreferenceInfo;
import javax.inject.Inject;
public class AppPreferencesHelper implements PreferencesHelper {
private static final String PREF_KEY_CURRENT_USER_NAME = "PREF_KEY_CURRENT_USER_NAME";
private final SharedPreferences mPrefs;
@Inject
public AppPreferencesHelper(@ApplicationContext Context context,
@PreferenceInfo String mPrefsName) {
mPrefs = context.getSharedPreferences(mPrefsName, Context.MODE_PRIVATE);
}
@Override
public String getCurrentUserName() {
return mPrefs.getString(PREF_KEY_CURRENT_USER_NAME, null);
}
@Override
public void setCurrentUserName(String userName) {
mPrefs.edit().putString(PREF_KEY_CURRENT_USER_NAME, userName).apply();
}
}
| 946 | 0.72833 | 0.72833 | 32 | 28.5625 | 28.817245 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.46875 | false | false |
13
|
96310bf7608e6269e7d7ce6d96852e2db784ce80
| 7,395,933,733,606 |
a7549d9621c937f3ac6a61b277edc5d8ce63d7d2
|
/app/src/main/java/io/github/andreybgm/gigreminder/screen/locationchoice/uievent/LoadLocationsEvent.java
|
9ce51379488679aecf83e517a94d8c074048cce8
|
[
"Apache-2.0"
] |
permissive
|
andreybgm/gigreminder
|
https://github.com/andreybgm/gigreminder
|
6851d8c189112fad7734aa7237bf7259d6883c77
|
464630f59a7825155d3c286a643e7cdb7ac687b8
|
refs/heads/master
| 2020-12-02T20:59:23.428000 | 2017-10-11T20:01:42 | 2017-10-11T20:01:42 | 96,240,703 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package io.github.andreybgm.gigreminder.screen.locationchoice.uievent;
import io.github.andreybgm.gigreminder.screen.base.UiEvent;
public class LoadLocationsEvent implements UiEvent {
public static final LoadLocationsEvent INSTANCE = new LoadLocationsEvent();
private LoadLocationsEvent() {
}
}
|
UTF-8
|
Java
| 310 |
java
|
LoadLocationsEvent.java
|
Java
|
[
{
"context": "package io.github.andreybgm.gigreminder.screen.locationchoice.uievent;\n\nimpor",
"end": 27,
"score": 0.999294638633728,
"start": 18,
"tag": "USERNAME",
"value": "andreybgm"
},
{
"context": ".screen.locationchoice.uievent;\n\nimport io.github.andreybgm.gigreminder.screen.base.UiEvent;\n\npublic class Lo",
"end": 98,
"score": 0.999321460723877,
"start": 89,
"tag": "USERNAME",
"value": "andreybgm"
}
] | null |
[] |
package io.github.andreybgm.gigreminder.screen.locationchoice.uievent;
import io.github.andreybgm.gigreminder.screen.base.UiEvent;
public class LoadLocationsEvent implements UiEvent {
public static final LoadLocationsEvent INSTANCE = new LoadLocationsEvent();
private LoadLocationsEvent() {
}
}
| 310 | 0.8 | 0.8 | 10 | 30 | 30.835045 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3 | false | false |
13
|
1a136a261dc2fb98be584701b97d376c8ef7b0ea
| 1,589,137,967,534 |
bda806c6c994a7779f809866d7ced81133af6453
|
/src/main/java/lt/vianet/alna/saka/calculation/CalculateBranches.java
|
928f79c9caa4c4b79c74b4c27f9a5bedcac73928
|
[] |
no_license
|
AS2000/Alna_Saka
|
https://github.com/AS2000/Alna_Saka
|
8312f127fa9a095975f72792b27b30409a70360a
|
44b1b2084278b41ddb080b5130bb107920fe441b
|
refs/heads/master
| 2018-12-12T06:07:17.604000 | 2018-11-07T09:19:17 | 2018-11-07T09:19:17 | 148,481,036 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package lt.vianet.alna.saka.calculation;
import lt.vianet.alna.saka.Data.TreeBranch;
public class CalculateBranches {
private int longestTrank = 0;
private int branchQty = 1;
public int getLongestTrank(TreeBranch treeTrunk) {
if (!countBranches(treeTrunk)) {
return longestTrank;
}
return longestTrank = 0;
}
private boolean countBranches(TreeBranch treeTrunk) {
if (treeTrunk.getTreeBranches().isEmpty()) {
if (branchQty > longestTrank) {
longestTrank = branchQty;
}
return false;
}
branchQty++;
for (int i = 0; i < treeTrunk.getTreeBranches().size(); i++) {
if (countBranches(treeTrunk.getTreeBranches().get(i))) {
return true;
}
}
branchQty--;
return false;
}
}
|
UTF-8
|
Java
| 890 |
java
|
CalculateBranches.java
|
Java
|
[] | null |
[] |
package lt.vianet.alna.saka.calculation;
import lt.vianet.alna.saka.Data.TreeBranch;
public class CalculateBranches {
private int longestTrank = 0;
private int branchQty = 1;
public int getLongestTrank(TreeBranch treeTrunk) {
if (!countBranches(treeTrunk)) {
return longestTrank;
}
return longestTrank = 0;
}
private boolean countBranches(TreeBranch treeTrunk) {
if (treeTrunk.getTreeBranches().isEmpty()) {
if (branchQty > longestTrank) {
longestTrank = branchQty;
}
return false;
}
branchQty++;
for (int i = 0; i < treeTrunk.getTreeBranches().size(); i++) {
if (countBranches(treeTrunk.getTreeBranches().get(i))) {
return true;
}
}
branchQty--;
return false;
}
}
| 890 | 0.560674 | 0.55618 | 45 | 18.777779 | 20.788767 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.311111 | false | false |
13
|
40c0158665340edd9b9cab77b619cb290965f540
| 11,373,073,401,325 |
dd5ca11a884135dc806a8f185af2a079b553970b
|
/src/main/java/ResponsePojo/ExecutiveSummary/Data.java
|
4e804c7591d088e20eaeb955ec76af80c18b26dd
|
[] |
no_license
|
mrigeshsingh/RestAssured
|
https://github.com/mrigeshsingh/RestAssured
|
b55727648251957747e6acd3647421ead14d1229
|
a6bb9e12342a6c3af9cc11e3f706c54d4e7ecd19
|
refs/heads/master
| 2022-12-02T06:29:44.745000 | 2020-03-12T10:00:46 | 2020-03-12T10:00:46 | 242,727,825 | 0 | 0 | null | false | 2022-11-16T00:45:08 | 2020-02-24T12:14:44 | 2020-03-12T09:59:00 | 2022-11-16T00:45:05 | 3,300 | 0 | 0 | 2 |
Java
| false | false |
package ResponsePojo.ExecutiveSummary;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class Data {
private List<responseMetricsInfo> qualityRisk;
private List<responseMetricsInfo> warehouseSummary;
private List<responseMetricsInfo> costSummary;
private List<responseMetricsInfo> demographics;
@JsonProperty("QUALITY_RISK")
public List<responseMetricsInfo> getQualityRisk() {
return qualityRisk;
}
public void setQualityRisk(List<responseMetricsInfo> qualityRisk) {
this.qualityRisk = qualityRisk;
}
@JsonProperty("WAREHOUSE_SUMMARY")
public List<responseMetricsInfo> getWarehouseSummary() {
return warehouseSummary;
}
public void setWarehouseSummary(List<responseMetricsInfo> warehouseSummary) {
this.warehouseSummary = warehouseSummary;
}
@JsonProperty("COST_SUMMARY")
public List<responseMetricsInfo> getCostSummary() {
return costSummary;
}
public void setCostSummary(List<responseMetricsInfo> costSummary) {
this.costSummary = costSummary;
}
@JsonProperty("DEMOGRAPHICS")
public List<responseMetricsInfo> getDemographics() {
return demographics;
}
public void setDemographics(List<responseMetricsInfo> demographics) {
this.demographics = demographics;
}
// public static void main(String[] args) throws JsonProcessingException {
// Data Data = new Data();
// ObjectMapper objectMapper = new ObjectMapper();
// String json = objectMapper.writeValueAsString(Data);
// System.out.println("json = " + json);
//
// }
}
|
UTF-8
|
Java
| 1,667 |
java
|
Data.java
|
Java
|
[] | null |
[] |
package ResponsePojo.ExecutiveSummary;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
public class Data {
private List<responseMetricsInfo> qualityRisk;
private List<responseMetricsInfo> warehouseSummary;
private List<responseMetricsInfo> costSummary;
private List<responseMetricsInfo> demographics;
@JsonProperty("QUALITY_RISK")
public List<responseMetricsInfo> getQualityRisk() {
return qualityRisk;
}
public void setQualityRisk(List<responseMetricsInfo> qualityRisk) {
this.qualityRisk = qualityRisk;
}
@JsonProperty("WAREHOUSE_SUMMARY")
public List<responseMetricsInfo> getWarehouseSummary() {
return warehouseSummary;
}
public void setWarehouseSummary(List<responseMetricsInfo> warehouseSummary) {
this.warehouseSummary = warehouseSummary;
}
@JsonProperty("COST_SUMMARY")
public List<responseMetricsInfo> getCostSummary() {
return costSummary;
}
public void setCostSummary(List<responseMetricsInfo> costSummary) {
this.costSummary = costSummary;
}
@JsonProperty("DEMOGRAPHICS")
public List<responseMetricsInfo> getDemographics() {
return demographics;
}
public void setDemographics(List<responseMetricsInfo> demographics) {
this.demographics = demographics;
}
// public static void main(String[] args) throws JsonProcessingException {
// Data Data = new Data();
// ObjectMapper objectMapper = new ObjectMapper();
// String json = objectMapper.writeValueAsString(Data);
// System.out.println("json = " + json);
//
// }
}
| 1,667 | 0.705459 | 0.705459 | 62 | 25.887096 | 25.592403 | 81 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.306452 | false | false |
13
|
0396344a062fc1edd4ee366c9c74b3551805c873
| 21,114,059,242,066 |
76e9510cbb72f628650327ce2e3250b8e074de5d
|
/tcmc-aris 2.3.2/.svn/pristine/93/9335a151460a3ae359fdb072a5d23bb40290b0bd.svn-base
|
00801067896cbf69f8e88cbe6c22ff6691dc07f2
|
[] |
no_license
|
sinc3721/git
|
https://github.com/sinc3721/git
|
ba7ee760191ac825c4079c1db8777a5d01077102
|
14e3a820f51914bab711448cd4eb39cb519a3c2a
|
refs/heads/master
| 2016-09-16T11:50:53.606000 | 2016-07-07T03:23:05 | 2016-07-07T03:23:05 | 62,770,361 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.tcmc.aris.service.ivf.dao;
import com.tcmc.aris.service.core.IBaseDao;
import com.tcmc.aris.service.ivf.model.RecordQueryRenewModel;
import com.tcmc.aris.service.ivf.pojo.FreezeRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 冷冻查询续存 DAO
* @author dengmiaomiao
* @date 2016年6月12日 17:16
*/
public interface IRecordQueryRenewDao extends IBaseDao {
/**
* 分页冷冻储存信息列表
*
* @author dengmiaomiao
* @date 2016年6月12日 15:17
*
* @param pageSize
* @param offSet
* @param queryObject
* @param otherParameters
* @return
*/
public List<RecordQueryRenewModel> queryRqrPageList(@Param("pageSize") int pageSize, @Param("offSet") int offSet, @Param("queryObject") FreezeRecord queryObject,
@Param("otherParameters") Map<String, Object> otherParameters);
/**
* 获取冷冻查询续存信息总数量
*
* @author dengmiaomiao
* @date 2016年6月12日 15:17
*
* @param queryObject
* @param otherParameters
* @return
*/
public Integer countRqrPage(@Param("queryObject") FreezeRecord queryObject, @Param("otherParameters") Map<String, Object> otherParameters);
}
|
UTF-8
|
Java
| 1,322 |
9335a151460a3ae359fdb072a5d23bb40290b0bd.svn-base
|
Java
|
[
{
"context": "mport java.util.Map;\n\n/**\n * 冷冻查询续存 DAO\n * @author dengmiaomiao\n * @date 2016年6月12日 17:16\n */\n\npublic interface I",
"end": 331,
"score": 0.9996612668037415,
"start": 319,
"tag": "USERNAME",
"value": "dengmiaomiao"
},
{
"context": "{\n\n /**\n * 分页冷冻储存信息列表\n *\n * @author dengmiaomiao\n * @date 2016年6月12日 15:17\n *\n * @para",
"end": 481,
"score": 0.999714195728302,
"start": 469,
"tag": "USERNAME",
"value": "dengmiaomiao"
},
{
"context": " /**\n * 获取冷冻查询续存信息总数量\n *\n * @author dengmiaomiao\n * @date 2016年6月12日 15:17\n *\n * @para",
"end": 982,
"score": 0.9997086524963379,
"start": 970,
"tag": "USERNAME",
"value": "dengmiaomiao"
}
] | null |
[] |
package com.tcmc.aris.service.ivf.dao;
import com.tcmc.aris.service.core.IBaseDao;
import com.tcmc.aris.service.ivf.model.RecordQueryRenewModel;
import com.tcmc.aris.service.ivf.pojo.FreezeRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 冷冻查询续存 DAO
* @author dengmiaomiao
* @date 2016年6月12日 17:16
*/
public interface IRecordQueryRenewDao extends IBaseDao {
/**
* 分页冷冻储存信息列表
*
* @author dengmiaomiao
* @date 2016年6月12日 15:17
*
* @param pageSize
* @param offSet
* @param queryObject
* @param otherParameters
* @return
*/
public List<RecordQueryRenewModel> queryRqrPageList(@Param("pageSize") int pageSize, @Param("offSet") int offSet, @Param("queryObject") FreezeRecord queryObject,
@Param("otherParameters") Map<String, Object> otherParameters);
/**
* 获取冷冻查询续存信息总数量
*
* @author dengmiaomiao
* @date 2016年6月12日 15:17
*
* @param queryObject
* @param otherParameters
* @return
*/
public Integer countRqrPage(@Param("queryObject") FreezeRecord queryObject, @Param("otherParameters") Map<String, Object> otherParameters);
}
| 1,322 | 0.663724 | 0.637239 | 45 | 26.666666 | 34.324593 | 165 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
13
|
|
7f73e954b3501b7dcf7c334d95fc2bd6b59d3c38
| 23,819,888,628,103 |
71bde796d651d856316fc596954357a9a7d997c1
|
/src/main/java/io/s3soft/product/resource/ProductResource.java
|
b5d21c4c06b54b629776b27f9cabc4a6c27438ef
|
[] |
no_license
|
ShaikshaLove/Product-Microservice
|
https://github.com/ShaikshaLove/Product-Microservice
|
251e58d177f99592425b7d25bb3ecccfa52384bd
|
25c4a180adb737f7ed9d8345755f88ded3259baa
|
refs/heads/master
| 2020-04-27T07:42:54.838000 | 2019-03-08T13:22:05 | 2019-03-08T13:22:05 | 174,145,298 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package io.s3soft.product.resource;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import java.util.StringTokenizer;
import javax.servlet.ServletContext;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.ServletContextAware;
import org.springframework.web.multipart.MultipartFile;
import io.s3soft.product.model.Product;
import io.s3soft.product.service.IProductService;
import io.s3soft.product.wrapper.ProductWrapper;
/**
* @author shaiksha
*
*/
@RestController
@RequestMapping("/api/products")
public class ProductResource implements InitializingBean,ServletContextAware {
@Autowired
private Environment env;
private String imagePath;
private String imageLocation;
@Autowired
private IProductService productService;
@SuppressWarnings("resource")
@GetMapping(produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ProductWrapper > getAllProducts(){
ProductWrapper productWrapper=new ProductWrapper();
List<Product> products=productService.getAllProducts();
products.forEach((product)->{
File imageDirectory=new File(imagePath,"images");
if(!imageDirectory.exists()) {
imageDirectory.mkdir();
}
File image=new File(imageDirectory,product.getImageName());
if(!image.exists()) {
FileOutputStream fos=null;
try {
image.createNewFile();
fos=new FileOutputStream(image);
fos.write(product.getImage());
fos.flush();
fos.close();
} catch (IOException e) {
try {
fos.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
e.printStackTrace();
}
}
product.setImage(null);
product.setCategories(null);
});
productWrapper.setProducts(products);
return ResponseEntity.ok(productWrapper);
}
@PostMapping(consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Product> saveProduct(@RequestBody Product product) {
Product p=productService.saveProduct(product);
p.setImage(null);
return new ResponseEntity<Product>(p,HttpStatus.CREATED);
}
@GetMapping(value="/{productId}",produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Optional<Product>> getProductById(@PathVariable("productId")String productId){
Product product=productService.getProductById(productId);
File imageDirectory=new File(imagePath,"images");
if(!imageDirectory.exists()) {
imageDirectory.mkdir();
}
File image=new File(imageDirectory,product.getImageName());
if(!image.exists()) {
FileOutputStream fos=null;
try {
image.createNewFile();
fos=new FileOutputStream(image);
fos.write(product.getImage());
fos.flush();
fos.close();
} catch (IOException e) {
try {
fos.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
product.setImage(null);
product.setCategories(null);
return new ResponseEntity<Optional<Product>>(Optional.of(product),HttpStatus.OK);
}
@DeleteMapping(value="/{productId}")
public ResponseEntity<Optional<String>> deleteProductById(@PathVariable("productId")String productId){
productService.deleteProduct(productId);
return new ResponseEntity<Optional<String>>(Optional.of("Record has been removed "+productId),HttpStatus.OK);
}
@PutMapping(produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Product> updateProduct(@RequestBody Product product){
Product p=productService.upadateProduct(product);
p.setImage(null);
p.setCategories(null);
return new ResponseEntity<Product>(p,HttpStatus.OK);
}
@PostMapping(value="/upload",consumes=MediaType.ALL_VALUE,produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Product> uploadImage(@RequestParam("file")MultipartFile imageFile,@RequestParam("productId")String productId) {
Product product=productService.getProductById(productId);
try {
StringTokenizer st=new StringTokenizer(imageFile.getOriginalFilename(),".");
String extention="jpg";
while(st.hasMoreTokens()) {
String token=st.nextToken();
if(token.equals("jpg")) {
extention=".jpg";
}
if(token.equals("png")) {
extention=".png";
}
}
product.setImage(imageFile.getBytes());
product.setImageName(productId+""+extention);
product.setImageLocation(imageLocation+""+productId+""+extention);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Product p=productService.upadateProduct(product);
p.setImage(null);
p.setCategories(null);
return new ResponseEntity<Product>(p,HttpStatus.OK);
}
@Override
public void afterPropertiesSet() throws Exception {
imageLocation=env.getProperty("image.location");
}
@Override
public void setServletContext(ServletContext servletContext) {
imagePath=servletContext.getRealPath("/");
}
}
|
UTF-8
|
Java
| 6,078 |
java
|
ProductResource.java
|
Java
|
[
{
"context": "product.wrapper.ProductWrapper;\r\n\r\n/**\r\n * @author shaiksha\r\n *\r\n */\r\n@RestController\r\n@RequestMapping(\"/api/",
"end": 1410,
"score": 0.9976847767829895,
"start": 1402,
"tag": "USERNAME",
"value": "shaiksha"
}
] | null |
[] |
package io.s3soft.product.resource;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import java.util.StringTokenizer;
import javax.servlet.ServletContext;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.ServletContextAware;
import org.springframework.web.multipart.MultipartFile;
import io.s3soft.product.model.Product;
import io.s3soft.product.service.IProductService;
import io.s3soft.product.wrapper.ProductWrapper;
/**
* @author shaiksha
*
*/
@RestController
@RequestMapping("/api/products")
public class ProductResource implements InitializingBean,ServletContextAware {
@Autowired
private Environment env;
private String imagePath;
private String imageLocation;
@Autowired
private IProductService productService;
@SuppressWarnings("resource")
@GetMapping(produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<ProductWrapper > getAllProducts(){
ProductWrapper productWrapper=new ProductWrapper();
List<Product> products=productService.getAllProducts();
products.forEach((product)->{
File imageDirectory=new File(imagePath,"images");
if(!imageDirectory.exists()) {
imageDirectory.mkdir();
}
File image=new File(imageDirectory,product.getImageName());
if(!image.exists()) {
FileOutputStream fos=null;
try {
image.createNewFile();
fos=new FileOutputStream(image);
fos.write(product.getImage());
fos.flush();
fos.close();
} catch (IOException e) {
try {
fos.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
e.printStackTrace();
}
}
product.setImage(null);
product.setCategories(null);
});
productWrapper.setProducts(products);
return ResponseEntity.ok(productWrapper);
}
@PostMapping(consumes=MediaType.APPLICATION_JSON_VALUE,produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Product> saveProduct(@RequestBody Product product) {
Product p=productService.saveProduct(product);
p.setImage(null);
return new ResponseEntity<Product>(p,HttpStatus.CREATED);
}
@GetMapping(value="/{productId}",produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Optional<Product>> getProductById(@PathVariable("productId")String productId){
Product product=productService.getProductById(productId);
File imageDirectory=new File(imagePath,"images");
if(!imageDirectory.exists()) {
imageDirectory.mkdir();
}
File image=new File(imageDirectory,product.getImageName());
if(!image.exists()) {
FileOutputStream fos=null;
try {
image.createNewFile();
fos=new FileOutputStream(image);
fos.write(product.getImage());
fos.flush();
fos.close();
} catch (IOException e) {
try {
fos.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
product.setImage(null);
product.setCategories(null);
return new ResponseEntity<Optional<Product>>(Optional.of(product),HttpStatus.OK);
}
@DeleteMapping(value="/{productId}")
public ResponseEntity<Optional<String>> deleteProductById(@PathVariable("productId")String productId){
productService.deleteProduct(productId);
return new ResponseEntity<Optional<String>>(Optional.of("Record has been removed "+productId),HttpStatus.OK);
}
@PutMapping(produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Product> updateProduct(@RequestBody Product product){
Product p=productService.upadateProduct(product);
p.setImage(null);
p.setCategories(null);
return new ResponseEntity<Product>(p,HttpStatus.OK);
}
@PostMapping(value="/upload",consumes=MediaType.ALL_VALUE,produces=MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Product> uploadImage(@RequestParam("file")MultipartFile imageFile,@RequestParam("productId")String productId) {
Product product=productService.getProductById(productId);
try {
StringTokenizer st=new StringTokenizer(imageFile.getOriginalFilename(),".");
String extention="jpg";
while(st.hasMoreTokens()) {
String token=st.nextToken();
if(token.equals("jpg")) {
extention=".jpg";
}
if(token.equals("png")) {
extention=".png";
}
}
product.setImage(imageFile.getBytes());
product.setImageName(productId+""+extention);
product.setImageLocation(imageLocation+""+productId+""+extention);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Product p=productService.upadateProduct(product);
p.setImage(null);
p.setCategories(null);
return new ResponseEntity<Product>(p,HttpStatus.OK);
}
@Override
public void afterPropertiesSet() throws Exception {
imageLocation=env.getProperty("image.location");
}
@Override
public void setServletContext(ServletContext servletContext) {
imagePath=servletContext.getRealPath("/");
}
}
| 6,078 | 0.722935 | 0.721619 | 177 | 32.338982 | 26.058134 | 134 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.367232 | false | false |
13
|
8bf612825caf438586afa4df6930d8d4ad6ce017
| 16,922,171,156,585 |
d5c7b08a049a772fa5017ccb9b6645a6c3367e1f
|
/About_Bishe/cloud-star/business/service-file-user/src/main/java/com/god23bin/fu/controller/UserDirectoryController.java
|
f1a67a4cdfa1e5637f65903c916bf2a23f6d72de
|
[] |
no_license
|
God23Bin/RoadOfLearning_Java
|
https://github.com/God23Bin/RoadOfLearning_Java
|
537c1bfffebae3d0187330b2825927b4ba40a069
|
d4b3c37b8573a67be079180b0c97e3a7922d9969
|
refs/heads/master
| 2023-03-15T04:06:31.362000 | 2022-03-15T07:31:08 | 2022-03-15T07:31:08 | 336,578,547 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.god23bin.fu.controller;
import com.god23bin.commonutils.Result;
import com.god23bin.commonbase.entity.TNode;
import com.god23bin.commonbase.entity.UserDirectory;
import com.god23bin.fu.service.UserDirectoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 用户目录结构表 前端控制器
* </p>
*
* @author god23bin
* @since 2022-01-24
*/
@RestController
@CrossOrigin
@RequestMapping("/fu/user-directory")
public class UserDirectoryController {
@Autowired
UserDirectoryService userDirectoryService;
@ApiOperation(value = "根据传入的用户ID、文件夹名字、和父文件夹的ID新建文件夹")
@PostMapping("createFolder/{userId}/{folderName}/{parentId}")
public Result createFolder(@PathVariable String userId, @PathVariable String folderName, @PathVariable long parentId) {
UserDirectory userDir = userDirectoryService.createFolder(userId, folderName, parentId);
if (userDir != null) {
return Result.ok().data("dir", userDir);
} else {
return Result.error();
}
}
@ApiOperation(value = "根据传入的用户ID、父文件夹的ID、和目录路径url删除文件夹")
@PostMapping("deleteFolder/{userId}/{parentId}")
public Result deleteFolder(@PathVariable String userId, @PathVariable long parentId, @RequestBody String url) {
boolean b = userDirectoryService.deleteFolder(userId, parentId, url);
if (b) {
return Result.ok();
} else {
return Result.error();
}
}
@ApiOperation(value = "根据传入的用户ID、文件夹名字、父文件夹的ID、和目录路径url 重命名文件夹")
@PostMapping("renameFolder/{userId}/{folderName}/{parentId}")
public Result renameFolder(@PathVariable String userId, @PathVariable String folderName, @PathVariable long parentId, @RequestBody String url) {
TNode tNode = userDirectoryService.renameFolder(userId, folderName, parentId, url);
if (tNode != null) {
return Result.ok().data("s", tNode);
} else {
return Result.error();
}
}
}
|
UTF-8
|
Java
| 2,276 |
java
|
UserDirectoryController.java
|
Java
|
[
{
"context": "\n/**\n * <p>\n * 用户目录结构表 前端控制器\n * </p>\n *\n * @author god23bin\n * @since 2022-01-24\n */\n@RestController\n@CrossOr",
"end": 445,
"score": 0.9994592666625977,
"start": 437,
"tag": "USERNAME",
"value": "god23bin"
}
] | null |
[] |
package com.god23bin.fu.controller;
import com.god23bin.commonutils.Result;
import com.god23bin.commonbase.entity.TNode;
import com.god23bin.commonbase.entity.UserDirectory;
import com.god23bin.fu.service.UserDirectoryService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* <p>
* 用户目录结构表 前端控制器
* </p>
*
* @author god23bin
* @since 2022-01-24
*/
@RestController
@CrossOrigin
@RequestMapping("/fu/user-directory")
public class UserDirectoryController {
@Autowired
UserDirectoryService userDirectoryService;
@ApiOperation(value = "根据传入的用户ID、文件夹名字、和父文件夹的ID新建文件夹")
@PostMapping("createFolder/{userId}/{folderName}/{parentId}")
public Result createFolder(@PathVariable String userId, @PathVariable String folderName, @PathVariable long parentId) {
UserDirectory userDir = userDirectoryService.createFolder(userId, folderName, parentId);
if (userDir != null) {
return Result.ok().data("dir", userDir);
} else {
return Result.error();
}
}
@ApiOperation(value = "根据传入的用户ID、父文件夹的ID、和目录路径url删除文件夹")
@PostMapping("deleteFolder/{userId}/{parentId}")
public Result deleteFolder(@PathVariable String userId, @PathVariable long parentId, @RequestBody String url) {
boolean b = userDirectoryService.deleteFolder(userId, parentId, url);
if (b) {
return Result.ok();
} else {
return Result.error();
}
}
@ApiOperation(value = "根据传入的用户ID、文件夹名字、父文件夹的ID、和目录路径url 重命名文件夹")
@PostMapping("renameFolder/{userId}/{folderName}/{parentId}")
public Result renameFolder(@PathVariable String userId, @PathVariable String folderName, @PathVariable long parentId, @RequestBody String url) {
TNode tNode = userDirectoryService.renameFolder(userId, folderName, parentId, url);
if (tNode != null) {
return Result.ok().data("s", tNode);
} else {
return Result.error();
}
}
}
| 2,276 | 0.692639 | 0.683078 | 61 | 33.27869 | 32.927208 | 148 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.557377 | false | false |
13
|
26493976d2f879314538b0423e218948cb8db85a
| 21,199,958,640,008 |
4e3701ff1212d5a00c61332e07a9a83481a697b9
|
/Treinamento-Backend/src/main/java/netgloo/controllers/AlunoController.java
|
46739dc1c1b5d630d287ca1d44e83a765d653847
|
[] |
no_license
|
icarusbro/treinamentojava
|
https://github.com/icarusbro/treinamentojava
|
0bc0a7f854433b3bb807b83f1c11005c497dd2e9
|
bf69b279f78a539548ec849918cffdb9cba482bd
|
refs/heads/master
| 2021-01-21T10:46:34.675000 | 2017-02-24T18:08:10 | 2017-02-24T18:08:10 | 83,487,294 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package netgloo.controllers;
import netgloo.Excecoes.*;
import netgloo.Service.AlunoService;
import netgloo.models.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping(value="/aluno")
public class AlunoController {
@Autowired
AlunoService servico;
@RequestMapping(value="/create",method = RequestMethod.POST)
@ResponseBody
public ResponseEntity<String> create(@RequestBody AlunoCreateForm aluno){
try {
servico.create(aluno);
return ResponseEntity.status(HttpStatus.OK).body("OK");
} catch (CpfJaCadastradoException e) {
return ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE).body(e.getMessage());
} catch (EnderecoInvalidoException e) {
return ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE).body(e.getMessage());
} catch (AlunoInvalidoException e) {
return ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE).body(e.getMessage());
}
}
@RequestMapping(value="/search")
@ResponseBody
public List<Aluno> search(@RequestBody AlunoSearchForm aluno){
return servico.search(aluno);
}
@RequestMapping(value="/delete")
@ResponseBody
public String delete(Long id){
try {
if(servico.delete(id)){
return "Ok";
}
} catch (AlunoInvalidoException e) {
return e.getMessage();
}catch (DataIntegrityViolationException e){
return "Aluno possui associação com disciplina, e não pode ser deletado.";
}
return "Error!";
}
@RequestMapping(value="/update")
@ResponseBody
public String update(@RequestBody AlunoUpdateForm alunoUpdateForm){
try {
if(servico.update(alunoUpdateForm)){
return "Ok";
}
} catch (AlunoInvalidoException e) {
return e.getMessage();
} catch (EnderecoInvalidoException e) {
return e.getMessage();
}
return "Error";
}
@RequestMapping(value="/matricular")
@ResponseBody
public String matricular(@RequestBody AlunoDisciplinaKey alunoKey){
try {
servico.matricular(alunoKey);
return "ok";
} catch (AlunoNaoExisteExeption e) {
return e.getMessage();
} catch (DisciplinaNaoExisteExeption e) {
return e.getMessage();
} catch (AlunoInvalidoException e){
return e.getMessage();
}catch (Exception e){
return "Ocorreu um erro SQL" + e.getMessage();
}
}
@RequestMapping(value="/retrieve")
@ResponseBody
public List<Disciplina> retriveAll(Long id){
return servico.getAllDisciplinas(id);
}
@RequestMapping(value="/desmatricular")
@ResponseBody
public String desmatricular(@RequestBody AlunoDisciplinaKey alunoDisciplinaKey){
try {
servico.desmatricular(alunoDisciplinaKey);
return "Ok";
} catch (DisciplinaInvalidaException e) {
return e.getMessage();
} catch (MatriculaNaoExisteExeption e) {
return e.getMessage();
} catch (DadosInvalidaException e) {
return e.getMessage();
}
}
@RequestMapping(value="/enviarNota")
@ResponseBody
public String enviarNota(Long idAluno){
try {
return servico.enviarNota(idAluno);
} catch (AlunoInvalidoException e) {
return e.getMessage();
} catch (DadosInvalidaException e) {
return e.getMessage();
}
}
}
|
UTF-8
|
Java
| 4,108 |
java
|
AlunoController.java
|
Java
|
[] | null |
[] |
package netgloo.controllers;
import netgloo.Excecoes.*;
import netgloo.Service.AlunoService;
import netgloo.models.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
@RequestMapping(value="/aluno")
public class AlunoController {
@Autowired
AlunoService servico;
@RequestMapping(value="/create",method = RequestMethod.POST)
@ResponseBody
public ResponseEntity<String> create(@RequestBody AlunoCreateForm aluno){
try {
servico.create(aluno);
return ResponseEntity.status(HttpStatus.OK).body("OK");
} catch (CpfJaCadastradoException e) {
return ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE).body(e.getMessage());
} catch (EnderecoInvalidoException e) {
return ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE).body(e.getMessage());
} catch (AlunoInvalidoException e) {
return ResponseEntity.status(HttpStatus.NOT_ACCEPTABLE).body(e.getMessage());
}
}
@RequestMapping(value="/search")
@ResponseBody
public List<Aluno> search(@RequestBody AlunoSearchForm aluno){
return servico.search(aluno);
}
@RequestMapping(value="/delete")
@ResponseBody
public String delete(Long id){
try {
if(servico.delete(id)){
return "Ok";
}
} catch (AlunoInvalidoException e) {
return e.getMessage();
}catch (DataIntegrityViolationException e){
return "Aluno possui associação com disciplina, e não pode ser deletado.";
}
return "Error!";
}
@RequestMapping(value="/update")
@ResponseBody
public String update(@RequestBody AlunoUpdateForm alunoUpdateForm){
try {
if(servico.update(alunoUpdateForm)){
return "Ok";
}
} catch (AlunoInvalidoException e) {
return e.getMessage();
} catch (EnderecoInvalidoException e) {
return e.getMessage();
}
return "Error";
}
@RequestMapping(value="/matricular")
@ResponseBody
public String matricular(@RequestBody AlunoDisciplinaKey alunoKey){
try {
servico.matricular(alunoKey);
return "ok";
} catch (AlunoNaoExisteExeption e) {
return e.getMessage();
} catch (DisciplinaNaoExisteExeption e) {
return e.getMessage();
} catch (AlunoInvalidoException e){
return e.getMessage();
}catch (Exception e){
return "Ocorreu um erro SQL" + e.getMessage();
}
}
@RequestMapping(value="/retrieve")
@ResponseBody
public List<Disciplina> retriveAll(Long id){
return servico.getAllDisciplinas(id);
}
@RequestMapping(value="/desmatricular")
@ResponseBody
public String desmatricular(@RequestBody AlunoDisciplinaKey alunoDisciplinaKey){
try {
servico.desmatricular(alunoDisciplinaKey);
return "Ok";
} catch (DisciplinaInvalidaException e) {
return e.getMessage();
} catch (MatriculaNaoExisteExeption e) {
return e.getMessage();
} catch (DadosInvalidaException e) {
return e.getMessage();
}
}
@RequestMapping(value="/enviarNota")
@ResponseBody
public String enviarNota(Long idAluno){
try {
return servico.enviarNota(idAluno);
} catch (AlunoInvalidoException e) {
return e.getMessage();
} catch (DadosInvalidaException e) {
return e.getMessage();
}
}
}
| 4,108 | 0.646772 | 0.646772 | 125 | 31.84 | 22.551416 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.368 | false | false |
13
|
a81b8445f62f8bc31215a4e6bacf6380b1decc13
| 1,065,151,900,145 |
f516e9517a3cae4d88c28a3b9c41ae5a6d1c4af9
|
/CleverCup/src/main/java/com/example/fuad/myapplication/Register.java
|
7bdb75e4c19903a5c66c45d58c7937e915a06eef
|
[] |
no_license
|
Fuad607/Clever_cup
|
https://github.com/Fuad607/Clever_cup
|
2353f19ba7fc12e022421fda1e79912bb4f9c1d1
|
b635430da5c9be3c7629fc2c65181f50364273d8
|
refs/heads/master
| 2020-03-17T10:13:08.515000 | 2017-01-25T22:51:55 | 2017-01-25T22:51:55 | 133,497,028 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.fuad.myapplication;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ProgressBar;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class Register extends AppCompatActivity implements View.OnClickListener {
private Button buttonRegister;
private EditText editTextEmail;
private EditText editTextPassword;
private EditText rePassword;
private ProgressDialog progressDialog;
private FirebaseAuth firebaseAuth;
private TextView textview;
private DatabaseReference mdatabaseReference;
private FirebaseUser user;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
firebaseAuth=FirebaseAuth.getInstance();
progressDialog=new ProgressDialog(this);
buttonRegister=(Button) findViewById(R.id.buttonRegister);
editTextEmail =(EditText) findViewById(R.id.editTextEmail);
editTextPassword=(EditText) findViewById(R.id.editPassword);
rePassword=(EditText) findViewById(R.id.rePassword);
textview=(TextView) findViewById(R.id.textviewsignin);
mdatabaseReference= FirebaseDatabase.getInstance().getReference();
buttonRegister.setOnClickListener(this);
textview.setOnClickListener(this);
}
private void registerUser(){
String email=editTextEmail.getText().toString().trim();
String password=editTextPassword.getText().toString().trim();
String repassword=rePassword.getText().toString().trim();
if(TextUtils.isEmpty(email)){
Toast.makeText(this,"Please enter email",Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(password)){
Toast.makeText(this,"Please enter password",Toast.LENGTH_SHORT).show();
return;
}
if(!repassword.equals(password)){
Toast.makeText(this,"Password is not matching" ,Toast.LENGTH_SHORT).show();
return;
}
if(Connection()==false){
Toast.makeText(getApplicationContext(), "No internet connection", Toast.LENGTH_LONG).show();
return;
}
progressDialog.setMessage("Registering Please Wait...");
progressDialog.show();
firebaseAuth.createUserWithEmailAndPassword(email,password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
user=firebaseAuth.getCurrentUser();
mdatabaseReference.child(user.getUid()).setValue("0");
Toast.makeText(Register.this,"Registered Successfully",Toast.LENGTH_SHORT).show();
finish();
startActivity(new Intent(getApplicationContext(), MainActivity.class));
}else{
Toast.makeText(Register.this,"Registration unseccessfully,Please try again",Toast.LENGTH_SHORT).show();
}
progressDialog.dismiss();
}
});
}
public boolean Connection() {
ConnectivityManager connect = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connect.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
return true;
}
return false;
}
@Override
public void onClick(View view) {
if(view==buttonRegister){
registerUser();
}
if(view == textview){
onBackPressed();
}
}
}
|
UTF-8
|
Java
| 4,647 |
java
|
Register.java
|
Java
|
[] | null |
[] |
package com.example.fuad.myapplication;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ProgressBar;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class Register extends AppCompatActivity implements View.OnClickListener {
private Button buttonRegister;
private EditText editTextEmail;
private EditText editTextPassword;
private EditText rePassword;
private ProgressDialog progressDialog;
private FirebaseAuth firebaseAuth;
private TextView textview;
private DatabaseReference mdatabaseReference;
private FirebaseUser user;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
firebaseAuth=FirebaseAuth.getInstance();
progressDialog=new ProgressDialog(this);
buttonRegister=(Button) findViewById(R.id.buttonRegister);
editTextEmail =(EditText) findViewById(R.id.editTextEmail);
editTextPassword=(EditText) findViewById(R.id.editPassword);
rePassword=(EditText) findViewById(R.id.rePassword);
textview=(TextView) findViewById(R.id.textviewsignin);
mdatabaseReference= FirebaseDatabase.getInstance().getReference();
buttonRegister.setOnClickListener(this);
textview.setOnClickListener(this);
}
private void registerUser(){
String email=editTextEmail.getText().toString().trim();
String password=editTextPassword.getText().toString().trim();
String repassword=rePassword.getText().toString().trim();
if(TextUtils.isEmpty(email)){
Toast.makeText(this,"Please enter email",Toast.LENGTH_SHORT).show();
return;
}
if(TextUtils.isEmpty(password)){
Toast.makeText(this,"Please enter password",Toast.LENGTH_SHORT).show();
return;
}
if(!repassword.equals(password)){
Toast.makeText(this,"Password is not matching" ,Toast.LENGTH_SHORT).show();
return;
}
if(Connection()==false){
Toast.makeText(getApplicationContext(), "No internet connection", Toast.LENGTH_LONG).show();
return;
}
progressDialog.setMessage("Registering Please Wait...");
progressDialog.show();
firebaseAuth.createUserWithEmailAndPassword(email,password)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()){
user=firebaseAuth.getCurrentUser();
mdatabaseReference.child(user.getUid()).setValue("0");
Toast.makeText(Register.this,"Registered Successfully",Toast.LENGTH_SHORT).show();
finish();
startActivity(new Intent(getApplicationContext(), MainActivity.class));
}else{
Toast.makeText(Register.this,"Registration unseccessfully,Please try again",Toast.LENGTH_SHORT).show();
}
progressDialog.dismiss();
}
});
}
public boolean Connection() {
ConnectivityManager connect = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connect.getActiveNetworkInfo();
if (networkInfo != null && networkInfo.isConnected()) {
return true;
}
return false;
}
@Override
public void onClick(View view) {
if(view==buttonRegister){
registerUser();
}
if(view == textview){
onBackPressed();
}
}
}
| 4,647 | 0.659996 | 0.659565 | 130 | 34.746155 | 27.373011 | 131 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.684615 | false | false |
13
|
bdd4a84a3756ee82130e9da85293b2db87276c78
| 14,362,370,707,107 |
fc1e0e638c5c11151f53d092095a023795e0eb83
|
/domene/src/main/java/no/nav/foreldrepenger/mottak/task/TilJournalføringTask.java
|
c70b379cfe83cfb0301a9b8a86c26cf8bcf69a4c
|
[
"MIT"
] |
permissive
|
gjengeda/fpfordel
|
https://github.com/gjengeda/fpfordel
|
5395d1c2a104b3272833c467a88f80e2c6899a01
|
b85104d094d40232aa6bb18f7e6314eb6e5f778b
|
refs/heads/master
| 2021-01-07T06:46:28.213000 | 2020-02-04T16:02:22 | 2020-02-04T16:02:22 | 241,610,471 | 0 | 0 |
MIT
| true | 2020-02-19T11:58:01 | 2020-02-19T11:58:00 | 2020-02-04T16:02:26 | 2020-02-11T04:52:07 | 3,076 | 0 | 0 | 0 | null | false | false |
package no.nav.foreldrepenger.mottak.task;
import java.util.Optional;
import java.util.UUID;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.transaction.Transactional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import no.nav.foreldrepenger.fordel.kodeverdi.DokumentTypeId;
import no.nav.foreldrepenger.mottak.behandlendeenhet.EnhetsTjeneste;
import no.nav.foreldrepenger.mottak.domene.dokument.DokumentRepository;
import no.nav.foreldrepenger.mottak.domene.oppgavebehandling.OpprettGSakOppgaveTask;
import no.nav.foreldrepenger.mottak.felles.MottakMeldingDataWrapper;
import no.nav.foreldrepenger.mottak.felles.MottakMeldingFeil;
import no.nav.foreldrepenger.mottak.felles.WrappedProsessTaskHandler;
import no.nav.foreldrepenger.mottak.journal.dokumentforsendelse.DokumentforsendelseResponse;
import no.nav.foreldrepenger.mottak.journal.dokumentforsendelse.JournalTilstand;
import no.nav.foreldrepenger.mottak.tjeneste.TilJournalføringTjeneste;
import no.nav.foreldrepenger.mottak.tjeneste.dokumentforsendelse.dto.ForsendelseStatus;
import no.nav.vedtak.exception.IntegrasjonException;
import no.nav.vedtak.felles.integrasjon.aktør.klient.AktørConsumerMedCache;
import no.nav.vedtak.felles.prosesstask.api.ProsessTask;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskRepository;
/**
* <p>
* ProssessTask som utleder journalføringsbehov og forsøker rette opp disse.
* </p>
*/
@Dependent
@ProsessTask(TilJournalføringTask.TASKNAME)
public class TilJournalføringTask extends WrappedProsessTaskHandler {
public static final String TASKNAME = "fordeling.tilJournalforing";
public static final String JOURNALMANGLER_EXCEPTION_KODE = "FP-453958";
private static final Logger LOG = LoggerFactory.getLogger(TilJournalføringTask.class);
private final TilJournalføringTjeneste journalføring;
private final EnhetsTjeneste enhetsidTjeneste;
private final DokumentRepository dokumentRepository;
private final AktørConsumerMedCache aktør;
@Inject
public TilJournalføringTask(ProsessTaskRepository prosessTaskRepository,
TilJournalføringTjeneste journalføringTjeneste,
EnhetsTjeneste enhetsidTjeneste,
DokumentRepository dokumentRepository,
AktørConsumerMedCache aktørConsumer) {
super(prosessTaskRepository);
this.journalføring = journalføringTjeneste;
this.enhetsidTjeneste = enhetsidTjeneste;
this.dokumentRepository = dokumentRepository;
this.aktør = aktørConsumer;
}
@Override
public void precondition(MottakMeldingDataWrapper dataWrapper) {
if (!dataWrapper.getAktørId().isPresent()) {
throw MottakMeldingFeil.FACTORY.prosesstaskPreconditionManglerProperty(TASKNAME,
MottakMeldingDataWrapper.AKTØR_ID_KEY, dataWrapper.getId()).toException();
}
if (!dataWrapper.getSaksnummer().isPresent()) {
throw MottakMeldingFeil.FACTORY.prosesstaskPreconditionManglerProperty(TASKNAME,
MottakMeldingDataWrapper.SAKSNUMMER_KEY, dataWrapper.getId()).toException();
}
}
@Transactional
@Override
public MottakMeldingDataWrapper doTask(MottakMeldingDataWrapper dataWrapper) {
Optional<String> fnr = aktør.hentPersonIdentForAktørId(dataWrapper.getAktørId().get());// NOSONAR
if (fnr.isEmpty()) {
throw MottakMeldingFeil.FACTORY.fantIkkePersonidentForAktørId(TASKNAME, dataWrapper.getId()).toException();
}
String enhetsId = enhetsidTjeneste.hentFordelingEnhetId(dataWrapper.getTema(), dataWrapper.getBehandlingTema(),
dataWrapper.getJournalførendeEnhet(), fnr);
if (dataWrapper.getArkivId() == null) {
UUID forsendelseId = dataWrapper.getForsendelseId().orElseThrow(IllegalStateException::new);
Boolean forsøkEndeligJF = true;
DokumentforsendelseResponse response = journalføring.journalførDokumentforsendelse(forsendelseId,
dataWrapper.getSaksnummer(), dataWrapper.getAvsenderId(), forsøkEndeligJF,
dataWrapper.getRetryingTask());
dataWrapper.setArkivId(response.getJournalpostId());
// Hvis endelig journalføring feiler (fx pga doktype annet), send til manuell
// journalføring (journalpost er opprettet).
if (!JournalTilstand.ENDELIG_JOURNALFØRT.equals(response.getJournalTilstand())) {
MottakMeldingFeil.FACTORY.feilJournalTilstandForventetTilstandEndelig(response.getJournalTilstand())
.log(LOG);
dokumentRepository.oppdaterForseldelseMedArkivId(forsendelseId, dataWrapper.getArkivId(),
ForsendelseStatus.GOSYS);
return dataWrapper.nesteSteg(OpprettGSakOppgaveTask.TASKNAME);
}
} else {
String innhold = dataWrapper.getDokumentTypeId().map(DokumentTypeId::getTermNavn).orElse("Ukjent innhold");
try {
if (!journalføring.tilJournalføring(dataWrapper.getArkivId(), dataWrapper.getSaksnummer().get(),
dataWrapper.getAktørId().get(), enhetsId, innhold)) {
return dataWrapper.nesteSteg(OpprettGSakOppgaveTask.TASKNAME);
}
} catch (IntegrasjonException e) {
if (JOURNALMANGLER_EXCEPTION_KODE.equals(e.getFeil().getKode())) {
String logMessage = e.getFeil().getKode() + " " + e.getFeil().getFeilmelding();
LOG.info(logMessage);
return dataWrapper.nesteSteg(OpprettGSakOppgaveTask.TASKNAME);
} else {
throw e;
}
}
}
Optional<UUID> forsendelseId = dataWrapper.getForsendelseId();
forsendelseId.ifPresent(uuid -> dokumentRepository.oppdaterForsendelseMetadata(uuid, dataWrapper.getArkivId(),
dataWrapper.getSaksnummer().get(), ForsendelseStatus.PENDING));
return dataWrapper.nesteSteg(KlargjorForVLTask.TASKNAME);
}
}
|
UTF-8
|
Java
| 6,154 |
java
|
TilJournalføringTask.java
|
Java
|
[] | null |
[] |
package no.nav.foreldrepenger.mottak.task;
import java.util.Optional;
import java.util.UUID;
import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.transaction.Transactional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import no.nav.foreldrepenger.fordel.kodeverdi.DokumentTypeId;
import no.nav.foreldrepenger.mottak.behandlendeenhet.EnhetsTjeneste;
import no.nav.foreldrepenger.mottak.domene.dokument.DokumentRepository;
import no.nav.foreldrepenger.mottak.domene.oppgavebehandling.OpprettGSakOppgaveTask;
import no.nav.foreldrepenger.mottak.felles.MottakMeldingDataWrapper;
import no.nav.foreldrepenger.mottak.felles.MottakMeldingFeil;
import no.nav.foreldrepenger.mottak.felles.WrappedProsessTaskHandler;
import no.nav.foreldrepenger.mottak.journal.dokumentforsendelse.DokumentforsendelseResponse;
import no.nav.foreldrepenger.mottak.journal.dokumentforsendelse.JournalTilstand;
import no.nav.foreldrepenger.mottak.tjeneste.TilJournalføringTjeneste;
import no.nav.foreldrepenger.mottak.tjeneste.dokumentforsendelse.dto.ForsendelseStatus;
import no.nav.vedtak.exception.IntegrasjonException;
import no.nav.vedtak.felles.integrasjon.aktør.klient.AktørConsumerMedCache;
import no.nav.vedtak.felles.prosesstask.api.ProsessTask;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskRepository;
/**
* <p>
* ProssessTask som utleder journalføringsbehov og forsøker rette opp disse.
* </p>
*/
@Dependent
@ProsessTask(TilJournalføringTask.TASKNAME)
public class TilJournalføringTask extends WrappedProsessTaskHandler {
public static final String TASKNAME = "fordeling.tilJournalforing";
public static final String JOURNALMANGLER_EXCEPTION_KODE = "FP-453958";
private static final Logger LOG = LoggerFactory.getLogger(TilJournalføringTask.class);
private final TilJournalføringTjeneste journalføring;
private final EnhetsTjeneste enhetsidTjeneste;
private final DokumentRepository dokumentRepository;
private final AktørConsumerMedCache aktør;
@Inject
public TilJournalføringTask(ProsessTaskRepository prosessTaskRepository,
TilJournalføringTjeneste journalføringTjeneste,
EnhetsTjeneste enhetsidTjeneste,
DokumentRepository dokumentRepository,
AktørConsumerMedCache aktørConsumer) {
super(prosessTaskRepository);
this.journalføring = journalføringTjeneste;
this.enhetsidTjeneste = enhetsidTjeneste;
this.dokumentRepository = dokumentRepository;
this.aktør = aktørConsumer;
}
@Override
public void precondition(MottakMeldingDataWrapper dataWrapper) {
if (!dataWrapper.getAktørId().isPresent()) {
throw MottakMeldingFeil.FACTORY.prosesstaskPreconditionManglerProperty(TASKNAME,
MottakMeldingDataWrapper.AKTØR_ID_KEY, dataWrapper.getId()).toException();
}
if (!dataWrapper.getSaksnummer().isPresent()) {
throw MottakMeldingFeil.FACTORY.prosesstaskPreconditionManglerProperty(TASKNAME,
MottakMeldingDataWrapper.SAKSNUMMER_KEY, dataWrapper.getId()).toException();
}
}
@Transactional
@Override
public MottakMeldingDataWrapper doTask(MottakMeldingDataWrapper dataWrapper) {
Optional<String> fnr = aktør.hentPersonIdentForAktørId(dataWrapper.getAktørId().get());// NOSONAR
if (fnr.isEmpty()) {
throw MottakMeldingFeil.FACTORY.fantIkkePersonidentForAktørId(TASKNAME, dataWrapper.getId()).toException();
}
String enhetsId = enhetsidTjeneste.hentFordelingEnhetId(dataWrapper.getTema(), dataWrapper.getBehandlingTema(),
dataWrapper.getJournalførendeEnhet(), fnr);
if (dataWrapper.getArkivId() == null) {
UUID forsendelseId = dataWrapper.getForsendelseId().orElseThrow(IllegalStateException::new);
Boolean forsøkEndeligJF = true;
DokumentforsendelseResponse response = journalføring.journalførDokumentforsendelse(forsendelseId,
dataWrapper.getSaksnummer(), dataWrapper.getAvsenderId(), forsøkEndeligJF,
dataWrapper.getRetryingTask());
dataWrapper.setArkivId(response.getJournalpostId());
// Hvis endelig journalføring feiler (fx pga doktype annet), send til manuell
// journalføring (journalpost er opprettet).
if (!JournalTilstand.ENDELIG_JOURNALFØRT.equals(response.getJournalTilstand())) {
MottakMeldingFeil.FACTORY.feilJournalTilstandForventetTilstandEndelig(response.getJournalTilstand())
.log(LOG);
dokumentRepository.oppdaterForseldelseMedArkivId(forsendelseId, dataWrapper.getArkivId(),
ForsendelseStatus.GOSYS);
return dataWrapper.nesteSteg(OpprettGSakOppgaveTask.TASKNAME);
}
} else {
String innhold = dataWrapper.getDokumentTypeId().map(DokumentTypeId::getTermNavn).orElse("Ukjent innhold");
try {
if (!journalføring.tilJournalføring(dataWrapper.getArkivId(), dataWrapper.getSaksnummer().get(),
dataWrapper.getAktørId().get(), enhetsId, innhold)) {
return dataWrapper.nesteSteg(OpprettGSakOppgaveTask.TASKNAME);
}
} catch (IntegrasjonException e) {
if (JOURNALMANGLER_EXCEPTION_KODE.equals(e.getFeil().getKode())) {
String logMessage = e.getFeil().getKode() + " " + e.getFeil().getFeilmelding();
LOG.info(logMessage);
return dataWrapper.nesteSteg(OpprettGSakOppgaveTask.TASKNAME);
} else {
throw e;
}
}
}
Optional<UUID> forsendelseId = dataWrapper.getForsendelseId();
forsendelseId.ifPresent(uuid -> dokumentRepository.oppdaterForsendelseMetadata(uuid, dataWrapper.getArkivId(),
dataWrapper.getSaksnummer().get(), ForsendelseStatus.PENDING));
return dataWrapper.nesteSteg(KlargjorForVLTask.TASKNAME);
}
}
| 6,154 | 0.720896 | 0.719588 | 120 | 49.966667 | 34.882404 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.683333 | false | false |
13
|
708e494540dbc7790bd089a560916dd1bc742584
| 32,186,484,927,463 |
ebe03baa9795c6a0187d9eba3e5bbc1937db3029
|
/r2dbc/r2dbc-transaction/src/main/java/com/vinsguru/r2dbctransaction/dto/DepositRequest.java
|
29693e930092497e012ad70f23ecaeefeeb7cfcb
|
[] |
no_license
|
vinsguru/vinsguru-blog-code-samples
|
https://github.com/vinsguru/vinsguru-blog-code-samples
|
3680fe7de55d1926f9a4a58d73127e364e8b9190
|
44044cf71bc1edf50744f0c4e146ce1b0e9229d5
|
refs/heads/master
| 2022-07-05T10:18:49.476000 | 2022-06-30T14:42:34 | 2022-06-30T14:42:34 | 205,614,848 | 422 | 606 | null | false | 2022-06-30T14:42:35 | 2019-09-01T01:29:19 | 2022-06-30T14:30:12 | 2022-06-30T14:42:34 | 73,584 | 282 | 451 | 4 |
Java
| false | false |
package com.vinsguru.r2dbctransaction.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor(staticName = "create")
public class DepositRequest {
private int account;
private int amount;
}
|
UTF-8
|
Java
| 317 |
java
|
DepositRequest.java
|
Java
|
[] | null |
[] |
package com.vinsguru.r2dbctransaction.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
@Data
@ToString
@NoArgsConstructor
@AllArgsConstructor(staticName = "create")
public class DepositRequest {
private int account;
private int amount;
}
| 317 | 0.798107 | 0.794953 | 17 | 17.647058 | 14.580169 | 42 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.411765 | false | false |
13
|
641a70a90a328b3263494afe9041f4090acff44c
| 14,637,248,593,385 |
516cdc967db8a90132e5f58f5f7d3cd8a03f3454
|
/CB_UI/src/CB_UI/MapManagerEventPtr.java
|
820c4b21572f770ba6a78b79d043987c157c2f9d
|
[] |
no_license
|
Longri/cachebox
|
https://github.com/Longri/cachebox
|
6b81223c167ef96f19159fd1f92428aa147e4f1b
|
318fa29dbfbf1c1467524941402ad4f1bc0a069c
|
refs/heads/master
| 2020-04-08T15:34:56.169000 | 2018-12-20T07:40:49 | 2018-12-20T07:40:49 | 159,484,576 | 0 | 0 | null | true | 2018-11-28T10:30:03 | 2018-11-28T10:30:03 | 2018-11-27T21:05:27 | 2018-11-27T21:05:25 | 495,970 | 0 | 0 | 0 | null | false | null |
package CB_UI;
import CB_Locator.Map.Descriptor;
import CB_Locator.Map.Layer;
public class MapManagerEventPtr {
public static MapManagerEvent Ptr = null;
public static byte[] OnGetMapTile(Layer layer, Descriptor descriptor) {
if (Ptr != null) {
return Ptr.GetMapTile(layer, descriptor);
} else
return null;
}
}
|
UTF-8
|
Java
| 381 |
java
|
MapManagerEventPtr.java
|
Java
|
[] | null |
[] |
package CB_UI;
import CB_Locator.Map.Descriptor;
import CB_Locator.Map.Layer;
public class MapManagerEventPtr {
public static MapManagerEvent Ptr = null;
public static byte[] OnGetMapTile(Layer layer, Descriptor descriptor) {
if (Ptr != null) {
return Ptr.GetMapTile(layer, descriptor);
} else
return null;
}
}
| 381 | 0.629921 | 0.629921 | 15 | 23.4 | 21.412769 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.533333 | false | false |
13
|
8e8bf12427eb39354ab5bdf339bebe227745da86
| 21,397,527,114,838 |
d0711be404c3153b25d7ffefce8c65101480ac26
|
/src/main/java/duke/util/Event.java
|
fd9e201d46b52392af14869e2c328cb415d83dbe
|
[] |
no_license
|
Clouddoggo/duke
|
https://github.com/Clouddoggo/duke
|
2ec8a9ff20821d2b21c69f23cfbef9071e6d884c
|
4de1ae8418e15476286790c0fe82f26324367f5a
|
refs/heads/master
| 2020-12-15T07:17:03.381000 | 2020-03-11T03:10:34 | 2020-03-11T03:10:34 | 235,029,944 | 0 | 0 | null | true | 2020-02-12T04:06:07 | 2020-01-20T06:02:17 | 2020-02-12T02:52:50 | 2020-02-12T04:06:06 | 1,621 | 0 | 0 | 3 |
Java
| false | false |
package duke.util;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* Represents a Event task.
*
* <p>CS2103T AY19/20 Semester 2
* Individual Duke project
* 29 Jan 2020
*
* @author Jel
*/
public class Event extends Task {
private LocalDate at;
/**
* Constructs an Event instance.
* @param description The description or details of the Event.
* @param at The date where the Event will happen.
*/
public Event(String description, LocalDate at) {
super(description);
this.at = at;
}
public LocalDate getScheduledTime() {
return this.at;
}
/**
* Overrides the Object's toString method
* and contains the task identifier, status icon, description,
* and scheduled time of the event.
* @return The String that containing the Event's details.
*/
@Override
public String toString() {
assert at != null : "At date does not exist.";
return String.format("[E]%s (at: %s)", super.toString(),
this.at.format(DateTimeFormatter.ofPattern("MMM d yyyy")));
}
}
|
UTF-8
|
Java
| 1,138 |
java
|
Event.java
|
Java
|
[
{
"context": "dividual Duke project\n * 29 Jan 2020\n *\n * @author Jel\n */\npublic class Event extends Task {\n private",
"end": 219,
"score": 0.9972939491271973,
"start": 216,
"tag": "NAME",
"value": "Jel"
}
] | null |
[] |
package duke.util;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* Represents a Event task.
*
* <p>CS2103T AY19/20 Semester 2
* Individual Duke project
* 29 Jan 2020
*
* @author Jel
*/
public class Event extends Task {
private LocalDate at;
/**
* Constructs an Event instance.
* @param description The description or details of the Event.
* @param at The date where the Event will happen.
*/
public Event(String description, LocalDate at) {
super(description);
this.at = at;
}
public LocalDate getScheduledTime() {
return this.at;
}
/**
* Overrides the Object's toString method
* and contains the task identifier, status icon, description,
* and scheduled time of the event.
* @return The String that containing the Event's details.
*/
@Override
public String toString() {
assert at != null : "At date does not exist.";
return String.format("[E]%s (at: %s)", super.toString(),
this.at.format(DateTimeFormatter.ofPattern("MMM d yyyy")));
}
}
| 1,138 | 0.625659 | 0.612478 | 44 | 24.863636 | 22.764196 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.340909 | false | false |
13
|
5ea7691593d9e73446be263b2add91fe2fb9fc69
| 28,209,345,246,029 |
3ae30eda1d28ca08097446a81d93d1da3b0dfd7b
|
/DbUnit-Exemplo-Cinema/src/br/ufc/quixada/verificacao/dao/DAO.java
|
ed0347b44efe51f86ec7951a31ecb9f4937ca303
|
[] |
no_license
|
klairton/MID-BD-Exemplo-DbUnit
|
https://github.com/klairton/MID-BD-Exemplo-DbUnit
|
a84553eefd3a460103beaaa814f209971fd234f5
|
d5bad2683350e7d80987845b8fa057f61e5f79b5
|
refs/heads/master
| 2016-03-22T21:18:22.757000 | 2012-08-07T13:36:56 | 2012-08-07T13:36:56 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.ufc.quixada.verificacao.dao;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class DAO {
private Connection conn;
private Statement stmt;
private Statement novaStatement() {
try {
return this.conn.createStatement();
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
final protected Statement statement() {
if(this.stmt == null){
this.stmt = novaStatement();
}
return this.stmt;
}
final protected Connection conn(){
return this.conn;
}
public DAO(Connection conn) {
super();
this.conn = conn;
}
}
|
UTF-8
|
Java
| 616 |
java
|
DAO.java
|
Java
|
[] | null |
[] |
package br.ufc.quixada.verificacao.dao;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
public class DAO {
private Connection conn;
private Statement stmt;
private Statement novaStatement() {
try {
return this.conn.createStatement();
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
final protected Statement statement() {
if(this.stmt == null){
this.stmt = novaStatement();
}
return this.stmt;
}
final protected Connection conn(){
return this.conn;
}
public DAO(Connection conn) {
super();
this.conn = conn;
}
}
| 616 | 0.691558 | 0.691558 | 37 | 15.675675 | 13.764533 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.540541 | false | false |
13
|
9f98dbe220d96e29e98c513d41f7aca2e0ce4f46
| 18,159,121,760,205 |
6f18e3b592fb1673f8267bb18e53d608dc342424
|
/MyThreadProj/src/com/india/sync/p4/Test7.java
|
ffaccf3dbb9a1d16b7af89bdcf17aa7407ee84b6
|
[] |
no_license
|
kabitakumari/THREAD
|
https://github.com/kabitakumari/THREAD
|
1ebae5727b2bd492efa0ff08b377fb6b58560b87
|
633d9e8572a1c5e4e4b15b493be0e35c987ac3de
|
refs/heads/master
| 2016-09-06T05:13:50.070000 | 2015-08-18T14:45:48 | 2015-08-18T14:45:48 | 40,855,033 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.india.sync.p4;
public class Test7 {
public static void main(String args[]) {
Account ac1 = new Account();
WithdrawThread mth1 = new WithdrawThread(ac1);
UpdateAddThread mth2 = new UpdateAddThread(ac1);
mth1.start();
mth2.start();
}
}
class WithdrawThread extends Thread {
Account ac = null;
WithdrawThread(Account ac) {
this.ac = ac;
}
public void run() {
ac.withdraw();
}
}
class UpdateAddThread extends Thread {
Account ac = null;
UpdateAddThread(Account ac) {
this.ac = ac;
}
public void run() {
ac.updateAddress();
}
}
class Account {
synchronized void withdraw() {
Thread th = Thread.currentThread();
for (int i = 1; i <= 10; i++) {
System.out.println("WITHDRAW\t" + i + "\t" + th.getName() + "\t"
+ this);
try {
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
void updateAddress() {
Thread th = Thread.currentThread();
for (int i = 1; i <= 10; i++) {
System.out.println("UP-ADD\t" + i + "\t" + th.getName() + "\t"
+ this);
try {
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
|
UTF-8
|
Java
| 1,209 |
java
|
Test7.java
|
Java
|
[] | null |
[] |
package com.india.sync.p4;
public class Test7 {
public static void main(String args[]) {
Account ac1 = new Account();
WithdrawThread mth1 = new WithdrawThread(ac1);
UpdateAddThread mth2 = new UpdateAddThread(ac1);
mth1.start();
mth2.start();
}
}
class WithdrawThread extends Thread {
Account ac = null;
WithdrawThread(Account ac) {
this.ac = ac;
}
public void run() {
ac.withdraw();
}
}
class UpdateAddThread extends Thread {
Account ac = null;
UpdateAddThread(Account ac) {
this.ac = ac;
}
public void run() {
ac.updateAddress();
}
}
class Account {
synchronized void withdraw() {
Thread th = Thread.currentThread();
for (int i = 1; i <= 10; i++) {
System.out.println("WITHDRAW\t" + i + "\t" + th.getName() + "\t"
+ this);
try {
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
void updateAddress() {
Thread th = Thread.currentThread();
for (int i = 1; i <= 10; i++) {
System.out.println("UP-ADD\t" + i + "\t" + th.getName() + "\t"
+ this);
try {
Thread.sleep(1000);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
| 1,209 | 0.575682 | 0.556658 | 63 | 17.222221 | 16.37986 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.904762 | false | false |
13
|
cb93b6270ebf3ae0519989b59c6e837bef90708d
| 32,770,600,495,143 |
e9dbca7d16ae0d6ace5ffbdd0597986d8c7f2f78
|
/src/main/java/yokohama/unit/ast/FourPhaseTest.java
|
a8efbae6094e5506d4f11b4fea13383f7b638ae2
|
[
"MIT"
] |
permissive
|
tkob/yokohamaunit
|
https://github.com/tkob/yokohamaunit
|
29ea191d9ed7916ed0c9e516b014a3673ea57a80
|
5e60b512153fbea81efdabc172afa2543a191224
|
refs/heads/master
| 2021-01-20T07:46:06.989000 | 2016-01-21T13:01:32 | 2016-01-21T13:01:32 | 27,025,404 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package yokohama.unit.ast;
import yokohama.unit.position.Span;
import java.util.Optional;
import lombok.EqualsAndHashCode;
import lombok.Value;
@Value
@EqualsAndHashCode(exclude={"span"})
public class FourPhaseTest implements Definition {
private String name;
private Optional<Phase> setup;
private Optional<Phase> exercise;
private VerifyPhase verify;
private Optional<Phase> teardown;
private Span span;
@Override
public <T> T accept(DefinitionVisitor<T> visitor) {
return visitor.visitFourPhaseTest(this);
}
}
|
UTF-8
|
Java
| 560 |
java
|
FourPhaseTest.java
|
Java
|
[] | null |
[] |
package yokohama.unit.ast;
import yokohama.unit.position.Span;
import java.util.Optional;
import lombok.EqualsAndHashCode;
import lombok.Value;
@Value
@EqualsAndHashCode(exclude={"span"})
public class FourPhaseTest implements Definition {
private String name;
private Optional<Phase> setup;
private Optional<Phase> exercise;
private VerifyPhase verify;
private Optional<Phase> teardown;
private Span span;
@Override
public <T> T accept(DefinitionVisitor<T> visitor) {
return visitor.visitFourPhaseTest(this);
}
}
| 560 | 0.742857 | 0.742857 | 22 | 24.454546 | 16.672588 | 55 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.545455 | false | false |
13
|
a1b70bea309073ec69e6baeb66c21efe01b6a267
| 8,117,488,213,569 |
a0018782506828fafaca81ae1151a7187a06e7cb
|
/src/main/java/com/icosnet/rfid/service/impl/ArticleServiceImpl.java
|
85635ac3e3051f69ab27ce23291734be0c5e006c
|
[] |
no_license
|
zirconias/RFID_REWRITE
|
https://github.com/zirconias/RFID_REWRITE
|
0b4382e337cdee02c8ca6de992f411ed0e94d603
|
4e72957ade5c439a4ed09c52696a73869c73de99
|
refs/heads/master
| 2021-01-21T19:28:40.272000 | 2015-05-02T13:44:53 | 2015-05-02T13:44:53 | 34,864,522 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.icosnet.rfid.service.impl;
import com.icosnet.rfid.domain.model.Article;
import com.icosnet.rfid.domain.repository.ArticleRepository;
import com.icosnet.rfid.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by xirconias on 01/05/15.
*/
@Repository
@Transactional
@Service("articleService")
public class ArticleServiceImpl implements ArticleService {
ArticleRepository articleRepository;
@Override
@Transactional(readOnly = true)
public List<Article> findAll() {
return null;
}
@Override
@Transactional(readOnly = true)
public Article findById(Long id) {
return null;
}
@Override
public Article save(Article article) {
return null;
}
@Override
@Transactional(readOnly = true)
public Page<Article> findAllByPage(Pageable pageable) {
return null;
}
@Autowired
public void setArticleRepository(ArticleRepository articleRepository) {
this.articleRepository = articleRepository;
}
}
|
UTF-8
|
Java
| 1,348 |
java
|
ArticleServiceImpl.java
|
Java
|
[
{
"context": "tional;\n\nimport java.util.List;\n\n/**\n * Created by xirconias on 01/05/15.\n */\n@Repository\n@Transactional\n@Serv",
"end": 566,
"score": 0.999622642993927,
"start": 557,
"tag": "USERNAME",
"value": "xirconias"
}
] | null |
[] |
package com.icosnet.rfid.service.impl;
import com.icosnet.rfid.domain.model.Article;
import com.icosnet.rfid.domain.repository.ArticleRepository;
import com.icosnet.rfid.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by xirconias on 01/05/15.
*/
@Repository
@Transactional
@Service("articleService")
public class ArticleServiceImpl implements ArticleService {
ArticleRepository articleRepository;
@Override
@Transactional(readOnly = true)
public List<Article> findAll() {
return null;
}
@Override
@Transactional(readOnly = true)
public Article findById(Long id) {
return null;
}
@Override
public Article save(Article article) {
return null;
}
@Override
@Transactional(readOnly = true)
public Page<Article> findAllByPage(Pageable pageable) {
return null;
}
@Autowired
public void setArticleRepository(ArticleRepository articleRepository) {
this.articleRepository = articleRepository;
}
}
| 1,348 | 0.744065 | 0.739614 | 53 | 24.433962 | 21.583107 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.320755 | false | false |
13
|
467c6d00e1d2efd65a99342746a9bd4f82950b69
| 10,934,986,738,141 |
9cdb46034655aee1bfdebef557b56efe33ec4d10
|
/catalogo-service/src/main/java/com/autohelp/catalogoservice/model/FilmeFuturo.java
|
d640780d9d2b6d34bc252781e40e4136b5bb7139
|
[] |
no_license
|
SidneiReis/trabalhoMicroserviceFiap
|
https://github.com/SidneiReis/trabalhoMicroserviceFiap
|
0eb52a68e56b190e31180f34be13641959068352
|
fff2f467811fc8f54829342b46b2c837cdf709ef
|
refs/heads/master
| 2022-11-02T14:41:15.319000 | 2020-06-21T14:56:44 | 2020-06-21T14:56:44 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.autohelp.catalogoservice.model;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="tb_filme_futuro")
public class FilmeFuturo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
private long idUsuario;
private long idFilme;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getIdUsuario() {
return idUsuario;
}
public void setIdUsuario(long idUsuario) {
this.idUsuario = idUsuario;
}
public long getIdFilme() {
return idFilme;
}
public void setIdFilme(long idFilme) {
this.idFilme = idFilme;
}
}
|
UTF-8
|
Java
| 861 |
java
|
FilmeFuturo.java
|
Java
|
[] | null |
[] |
package com.autohelp.catalogoservice.model;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="tb_filme_futuro")
public class FilmeFuturo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
private long idUsuario;
private long idFilme;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getIdUsuario() {
return idUsuario;
}
public void setIdUsuario(long idUsuario) {
this.idUsuario = idUsuario;
}
public long getIdFilme() {
return idFilme;
}
public void setIdFilme(long idFilme) {
this.idFilme = idFilme;
}
}
| 861 | 0.75029 | 0.749129 | 48 | 16.9375 | 16.419508 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.041667 | false | false |
13
|
3557d6eb2e2635c4e1514a2ecf847d0b95aea160
| 5,755,256,188,891 |
3a61634aebbfb1d1462b15ab708ffc60aa8fe58f
|
/app/src/main/java/com/shellcore/android/messaging/addContact/AddContactRepositoryImpl.java
|
1d067b3860ec4294a8b857c64964482b228b4c55
|
[] |
no_license
|
ShellCore/Messaging
|
https://github.com/ShellCore/Messaging
|
bee5c562cb7fcf7fe7ff59d34b1d1fdf28bbf253
|
3f4a9b8196752be8147c68cf6e080f899809b055
|
refs/heads/master
| 2021-01-19T09:26:36.711000 | 2017-04-16T23:39:17 | 2017-04-16T23:39:17 | 82,107,813 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.shellcore.android.messaging.addContact;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.ValueEventListener;
import com.shellcore.android.messaging.addContact.events.AddContactEvent;
import com.shellcore.android.messaging.domain.FirebaseHelper;
import com.shellcore.android.messaging.entities.User;
import com.shellcore.android.messaging.libs.EventBus;
import com.shellcore.android.messaging.libs.GreenRobotEventBus;
/**
* Created by Cesar on 14/02/2017.
*/
public class AddContactRepositoryImpl implements AddContactRepository {
// Servicios
private EventBus eventBus;
private FirebaseHelper helper;
public AddContactRepositoryImpl() {
this.eventBus = GreenRobotEventBus.getInstance();
this.helper = FirebaseHelper.getInstance();
}
@Override
public void addContact(final String email) {
final String key = email.replace(".", "_");
DatabaseReference userReference = helper.getUserReference(email);
userReference.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
User user = dataSnapshot.getValue(User.class);
if (user != null) {
DatabaseReference myContactsReference = helper.getMyContactsReference();
myContactsReference.child(key)
.setValue(user.isOnline());
String currentUserKey = helper.getAuthUserEmail();
currentUserKey = currentUserKey.replace(".", "_");
DatabaseReference reverseContactReference = helper.getContactsReference(email);
reverseContactReference.child(currentUserKey).setValue(User.ONLINE);
postSuccess();
} else {
postError();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
postError();
}
});
}
private void postSuccess() {
post(false);
}
private void postError() {
post(true);
}
private void post(boolean error) {
AddContactEvent event = new AddContactEvent();
event.setError(error);
eventBus.post(event);
}
}
|
UTF-8
|
Java
| 2,480 |
java
|
AddContactRepositoryImpl.java
|
Java
|
[
{
"context": "saging.libs.GreenRobotEventBus;\n\n/**\n * Created by Cesar on 14/02/2017.\n */\npublic class AddContactReposit",
"end": 597,
"score": 0.99955815076828,
"start": 592,
"tag": "NAME",
"value": "Cesar"
}
] | null |
[] |
package com.shellcore.android.messaging.addContact;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.ValueEventListener;
import com.shellcore.android.messaging.addContact.events.AddContactEvent;
import com.shellcore.android.messaging.domain.FirebaseHelper;
import com.shellcore.android.messaging.entities.User;
import com.shellcore.android.messaging.libs.EventBus;
import com.shellcore.android.messaging.libs.GreenRobotEventBus;
/**
* Created by Cesar on 14/02/2017.
*/
public class AddContactRepositoryImpl implements AddContactRepository {
// Servicios
private EventBus eventBus;
private FirebaseHelper helper;
public AddContactRepositoryImpl() {
this.eventBus = GreenRobotEventBus.getInstance();
this.helper = FirebaseHelper.getInstance();
}
@Override
public void addContact(final String email) {
final String key = email.replace(".", "_");
DatabaseReference userReference = helper.getUserReference(email);
userReference.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
User user = dataSnapshot.getValue(User.class);
if (user != null) {
DatabaseReference myContactsReference = helper.getMyContactsReference();
myContactsReference.child(key)
.setValue(user.isOnline());
String currentUserKey = helper.getAuthUserEmail();
currentUserKey = currentUserKey.replace(".", "_");
DatabaseReference reverseContactReference = helper.getContactsReference(email);
reverseContactReference.child(currentUserKey).setValue(User.ONLINE);
postSuccess();
} else {
postError();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
postError();
}
});
}
private void postSuccess() {
post(false);
}
private void postError() {
post(true);
}
private void post(boolean error) {
AddContactEvent event = new AddContactEvent();
event.setError(error);
eventBus.post(event);
}
}
| 2,480 | 0.648387 | 0.645161 | 72 | 33.444443 | 27.1707 | 99 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.472222 | false | false |
13
|
aaebe4a62cc71bde71985ca80f48a8417273042c
| 16,655,883,177,063 |
77d563c12dbd8431f5647dc0f735a06b766db87f
|
/alexademo/src/main/java/com/alexa/challenge/alexademo/model/System.java
|
351e26f11f71937e618fe17ad7c5221894dc282f
|
[] |
no_license
|
Kolawole-Akinwande/spinnaker-demo
|
https://github.com/Kolawole-Akinwande/spinnaker-demo
|
173430a56da402b25d7f62eea5f501a271ff9a81
|
c3594cb3f8c19d0338facf17b255a9781c901189
|
refs/heads/master
| 2020-05-27T00:49:58.213000 | 2019-05-24T13:55:54 | 2019-05-24T13:55:54 | 188,429,415 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.alexa.challenge.alexademo.model;
public class System {
public Device device;
public Application application;
public User user;
public String apiEndpoint;
public String apiAccessToken;
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Application getApplication() {
return application;
}
public void setApplication(Application application) {
this.application = application;
}
public Device getDevice() {
return device;
}
public void setDevice(Device device) {
this.device = device;
}
public String getApiEndpoint() {
return apiEndpoint;
}
public void setApiEndpoint(String apiEndpoint) {
this.apiEndpoint = apiEndpoint;
}
public String getApiAccessToken() {
return apiAccessToken;
}
public void setApiAccessToken(String apiAccessToken) {
this.apiAccessToken = apiAccessToken;
}
}
|
UTF-8
|
Java
| 1,080 |
java
|
System.java
|
Java
|
[] | null |
[] |
package com.alexa.challenge.alexademo.model;
public class System {
public Device device;
public Application application;
public User user;
public String apiEndpoint;
public String apiAccessToken;
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Application getApplication() {
return application;
}
public void setApplication(Application application) {
this.application = application;
}
public Device getDevice() {
return device;
}
public void setDevice(Device device) {
this.device = device;
}
public String getApiEndpoint() {
return apiEndpoint;
}
public void setApiEndpoint(String apiEndpoint) {
this.apiEndpoint = apiEndpoint;
}
public String getApiAccessToken() {
return apiAccessToken;
}
public void setApiAccessToken(String apiAccessToken) {
this.apiAccessToken = apiAccessToken;
}
}
| 1,080 | 0.616667 | 0.616667 | 49 | 20.040817 | 17.824495 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.326531 | false | false |
13
|
f494fd17e68297f0b080749695cf6428d1ac7f3a
| 25,022,479,480,891 |
025bdfd7e584f13da7e497a3d5a9f101617bba4e
|
/cuco-parent/cuco-service/src/main/java/cn/cuco/service/member/carUsed/MemberCarportService.java
|
2dba074dccb0fa164df899ec06415592923e4d89
|
[] |
no_license
|
syz133350475/githubRepertory
|
https://github.com/syz133350475/githubRepertory
|
deb70cc8192404a2a85072d732f5ed6107118c9f
|
4665f8a458dd7eb2921c20f1a6c67566c2bba2f3
|
refs/heads/master
| 2021-06-23T22:09:52.892000 | 2017-09-05T07:22:50 | 2017-09-05T07:22:50 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package cn.cuco.service.member.carUsed;
import cn.cuco.entity.MemberCarport;
import cn.cuco.entity.MemberFavoriteCartype;
import cn.cuco.page.PageResult;
/**
* @ClassName: MemberCarportService
* @Description: 用户车库相关接口
* @author zc.du
* @date 2017年2月23日 上午10:33:07
*/
public interface MemberCarportService {
/**
* @Title: createMemberCarport
* @Description: 创建用户车库
* @author zc.du
* @param memberCarport
* @return MemberCarport
*/
public MemberCarport createMemberCarport(MemberCarport memberCarport);
/**
* @Title: getMemberCarportById
* @Description: 根据用户车库ID获取用户车库
* @author zc.du
* @param id 用户车库ID
* @return
* @return MemberCarport
*/
public MemberCarport getMemberCarportById(Long id);
/**
* @Title: getMemberCarport
* @Description: 查询用户车库
* @author zc.du
* @param memberCarport
* @return MemberCarport
*/
public MemberCarport getMemberCarport(MemberCarport memberCarport);
/**
* @Title: updateMemberCarportStatusByUnlockin
* @Description: 根据用户车库ID修改其状态为"解锁中"
* @author zc.du
* @param memberCarportId
* @return MemberCarport
*/
public MemberCarport updateMemberCarportStatusByUnlockin(Long memberCarportId);
/**
* @Title: updateMemberCarportStatusByUnlocked
* @Description: 根据用户车库ID修改其状态为"已解锁"
* @author zc.du
* @param memberCarportId
* @return MemberCarport
*/
public MemberCarport updateMemberCarportStatusByUnlocked(Long memberCarportId);
/**
* @Title: updateMemberCarportStatusByDisable
* @Description: 根据用户车库ID修改其状态为"已停用"
* @author zc.du
* @param memberCarportId
* @return MemberCarport
*/
public MemberCarport updateMemberCarportStatusByDisable(Long memberCarportId);
/**
* @Title: getMemberCarportListByPage
* @Description: 根据用户ID分页查询用户车库列表
* @author zc.du
* @param memberCarport
* @return PageResult<MemberCarport>
*/
public PageResult<MemberCarport> getMemberCarportListByPage(MemberCarport memberCarport);
/**
* @Title: createMarkFavoriteCarType
* @Description: 标记喜欢车型
* @author zc.du
* @param memberFavoriteCartype
* @return MemberFavoriteCartype
*/
public MemberFavoriteCartype createMarkFavoriteCarType(MemberFavoriteCartype memberFavoriteCartype);
/**
* @Title: updateCountOrMileage
* @Description: 更新"使用次数"、"行驶里程"数量(count、mileage自行设置、操作人、操作人ID)
* @author zc.du
* @param memberCarport
* @return MemberCarport
*/
public MemberCarport updateCountOrMileage(MemberCarport memberCarport);
}
|
UTF-8
|
Java
| 2,945 |
java
|
MemberCarportService.java
|
Java
|
[
{
"context": "CarportService \n* @Description: 用户车库相关接口\n* @author zc.du\n* @date 2017年2月23日 上午10:33:07 \n*/\npublic interfa",
"end": 237,
"score": 0.999461829662323,
"start": 232,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": "rCarport \n * @Description: 创建用户车库\n * @author zc.du\n * @param memberCarport\n * @return MemberCa",
"end": 403,
"score": 0.9993546009063721,
"start": 398,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": " \n * @Description: 根据用户车库ID获取用户车库\n * @author zc.du\n * @param id 用户车库ID\n * @return\n * @retur",
"end": 645,
"score": 0.9975063800811768,
"start": 640,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": "rCarport \n * @Description: 查询用户车库\n * @author zc.du\n * @param memberCarport\n * @return MemberCa",
"end": 866,
"score": 0.9962412118911743,
"start": 861,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": " * @Description: 根据用户车库ID修改其状态为\"解锁中\"\n * @author zc.du\n * @param memberCarportId\n * @return Member",
"end": 1125,
"score": 0.9993412494659424,
"start": 1120,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": "* @Description: 根据用户车库ID修改其状态为\"已解锁\"\n * @author zc.du\n * @param memberCarportId\n * @return Memb",
"end": 1400,
"score": 0.999329686164856,
"start": 1395,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": " @Description: 根据用户车库ID修改其状态为\"已停用\"\n * @author zc.du\n * @param memberCarportId\n * @return ",
"end": 1680,
"score": 0.9988681674003601,
"start": 1678,
"tag": "USERNAME",
"value": "zc"
},
{
"context": " * @Description: 根据用户ID分页查询用户车库列表\n * @author zc.du\n * @param memberCarport\n * @return PageResu",
"end": 1949,
"score": 0.9994891881942749,
"start": 1944,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": "eCarType \n * @Description: 标记喜欢车型\n * @author zc.du\n * @param memberFavoriteCartype\n * @return ",
"end": 2219,
"score": 0.9995830655097961,
"start": 2214,
"tag": "USERNAME",
"value": "zc.du"
},
{
"context": "行驶里程\"数量(count、mileage自行设置、操作人、操作人ID)\n * @author zc.du\n * @param memberCarport\n * @return MemberCa",
"end": 2540,
"score": 0.999567985534668,
"start": 2535,
"tag": "USERNAME",
"value": "zc.du"
}
] | null |
[] |
package cn.cuco.service.member.carUsed;
import cn.cuco.entity.MemberCarport;
import cn.cuco.entity.MemberFavoriteCartype;
import cn.cuco.page.PageResult;
/**
* @ClassName: MemberCarportService
* @Description: 用户车库相关接口
* @author zc.du
* @date 2017年2月23日 上午10:33:07
*/
public interface MemberCarportService {
/**
* @Title: createMemberCarport
* @Description: 创建用户车库
* @author zc.du
* @param memberCarport
* @return MemberCarport
*/
public MemberCarport createMemberCarport(MemberCarport memberCarport);
/**
* @Title: getMemberCarportById
* @Description: 根据用户车库ID获取用户车库
* @author zc.du
* @param id 用户车库ID
* @return
* @return MemberCarport
*/
public MemberCarport getMemberCarportById(Long id);
/**
* @Title: getMemberCarport
* @Description: 查询用户车库
* @author zc.du
* @param memberCarport
* @return MemberCarport
*/
public MemberCarport getMemberCarport(MemberCarport memberCarport);
/**
* @Title: updateMemberCarportStatusByUnlockin
* @Description: 根据用户车库ID修改其状态为"解锁中"
* @author zc.du
* @param memberCarportId
* @return MemberCarport
*/
public MemberCarport updateMemberCarportStatusByUnlockin(Long memberCarportId);
/**
* @Title: updateMemberCarportStatusByUnlocked
* @Description: 根据用户车库ID修改其状态为"已解锁"
* @author zc.du
* @param memberCarportId
* @return MemberCarport
*/
public MemberCarport updateMemberCarportStatusByUnlocked(Long memberCarportId);
/**
* @Title: updateMemberCarportStatusByDisable
* @Description: 根据用户车库ID修改其状态为"已停用"
* @author zc.du
* @param memberCarportId
* @return MemberCarport
*/
public MemberCarport updateMemberCarportStatusByDisable(Long memberCarportId);
/**
* @Title: getMemberCarportListByPage
* @Description: 根据用户ID分页查询用户车库列表
* @author zc.du
* @param memberCarport
* @return PageResult<MemberCarport>
*/
public PageResult<MemberCarport> getMemberCarportListByPage(MemberCarport memberCarport);
/**
* @Title: createMarkFavoriteCarType
* @Description: 标记喜欢车型
* @author zc.du
* @param memberFavoriteCartype
* @return MemberFavoriteCartype
*/
public MemberFavoriteCartype createMarkFavoriteCarType(MemberFavoriteCartype memberFavoriteCartype);
/**
* @Title: updateCountOrMileage
* @Description: 更新"使用次数"、"行驶里程"数量(count、mileage自行设置、操作人、操作人ID)
* @author zc.du
* @param memberCarport
* @return MemberCarport
*/
public MemberCarport updateCountOrMileage(MemberCarport memberCarport);
}
| 2,945 | 0.685192 | 0.680343 | 95 | 27.221052 | 22.445808 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.136842 | false | false |
13
|
57d5956d1efc6cc40ac36b1cd874182f7fe12eb9
| 26,860,725,535,048 |
de6c2c3186768c59bdee61b7734c631d1191d38d
|
/app/src/main/java/com/nilepoint/monitorevaluatemobile/participant/FindPartcipantHostActivity.java
|
9968d571accb619473786ef8b01fb3f5f2b0c705
|
[] |
no_license
|
abnormalbbk/nilepoint-mobile
|
https://github.com/abnormalbbk/nilepoint-mobile
|
4ea55fef865740a06baf721407a525289d1bc803
|
cfc41d595669b6b870090b7a5623ba3ed03f4705
|
refs/heads/master
| 2020-09-09T17:40:57.715000 | 2019-11-13T17:26:26 | 2019-11-13T17:26:26 | 221,514,193 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.nilepoint.monitorevaluatemobile.participant;
import android.app.SearchManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.SearchView;
import com.nilepoint.monitorevaluatemobile.R;
import com.nilepoint.persistence.Datastore;
/**
* Activity that holds all searching capabilities, from the list as well as the barcode
*/
public class FindPartcipantHostActivity extends AppCompatActivity implements
BarcodeScannerButtonFragment.OnFragmentInteractionListener,
ParticipantListFragment.OnFragmentInteractionListener{
protected static final String TAG = "FindHostActivity";
private static final String FIRST_NAME_KEY = "firstName";
private static final String LAST_NAME_KEY = "lastName";
private static final String SPECIFY = "specify_activity";
protected Datastore data = Datastore.init(this);
private ParticipantListFragment listFragment = new ParticipantListFragment();
//private Switch sortParticipantBy;
//Views for host activity
protected SearchView searchView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_find_partcipant_host);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.find_a_participant_heading);
// getSupportActionBar().setDisplayHomeAsUpEnabled(false);
Fragment frg = new BarcodeScannerButtonFragment();
Bundle args = new Bundle();
args.putString("activityStartFlag", "viewProfile");
frg.setArguments(args);
startFragment(frg);
searchView = (SearchView) findViewById(R.id.client_list_searchview);
searchView.clearFocus();
searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
startFragment(listFragment);
}
});
searchView.setQueryHint("Name, FH Code or Area");
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
return false;
}
public boolean onQueryTextChange(String s) {
listFragment.search(s);
return false;
}
});
Intent intent = getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
//doMySearch(query);
}
}
public static String getFirstNameKey() {
return FIRST_NAME_KEY;
}
public static String getLastNameKey() {
return LAST_NAME_KEY;
}
public void startFragment(Fragment fragment){
getSupportFragmentManager()
.beginTransaction().replace(R.id.find_participant_fragment_container, fragment, SPECIFY)
.commit();
}
@Override
public void onFragmentInteraction(Uri uri) {
}
@Override
public void onBackPressed(){
super.onBackPressed();
this.finish();
}
}
|
UTF-8
|
Java
| 3,415 |
java
|
FindPartcipantHostActivity.java
|
Java
|
[
{
"context": " private static final String FIRST_NAME_KEY = \"firstName\";\n private static final String LAST_NAME_KEY =",
"end": 881,
"score": 0.9022765755653381,
"start": 872,
"tag": "KEY",
"value": "firstName"
},
{
"context": "\n private static final String LAST_NAME_KEY = \"lastName\";\n\n private static final String SPECIFY = \"spe",
"end": 941,
"score": 0.9517010450363159,
"start": 933,
"tag": "KEY",
"value": "lastName"
}
] | null |
[] |
package com.nilepoint.monitorevaluatemobile.participant;
import android.app.SearchManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.SearchView;
import com.nilepoint.monitorevaluatemobile.R;
import com.nilepoint.persistence.Datastore;
/**
* Activity that holds all searching capabilities, from the list as well as the barcode
*/
public class FindPartcipantHostActivity extends AppCompatActivity implements
BarcodeScannerButtonFragment.OnFragmentInteractionListener,
ParticipantListFragment.OnFragmentInteractionListener{
protected static final String TAG = "FindHostActivity";
private static final String FIRST_NAME_KEY = "firstName";
private static final String LAST_NAME_KEY = "lastName";
private static final String SPECIFY = "specify_activity";
protected Datastore data = Datastore.init(this);
private ParticipantListFragment listFragment = new ParticipantListFragment();
//private Switch sortParticipantBy;
//Views for host activity
protected SearchView searchView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_find_partcipant_host);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.find_a_participant_heading);
// getSupportActionBar().setDisplayHomeAsUpEnabled(false);
Fragment frg = new BarcodeScannerButtonFragment();
Bundle args = new Bundle();
args.putString("activityStartFlag", "viewProfile");
frg.setArguments(args);
startFragment(frg);
searchView = (SearchView) findViewById(R.id.client_list_searchview);
searchView.clearFocus();
searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
startFragment(listFragment);
}
});
searchView.setQueryHint("Name, FH Code or Area");
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String s) {
return false;
}
public boolean onQueryTextChange(String s) {
listFragment.search(s);
return false;
}
});
Intent intent = getIntent();
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
String query = intent.getStringExtra(SearchManager.QUERY);
//doMySearch(query);
}
}
public static String getFirstNameKey() {
return FIRST_NAME_KEY;
}
public static String getLastNameKey() {
return LAST_NAME_KEY;
}
public void startFragment(Fragment fragment){
getSupportFragmentManager()
.beginTransaction().replace(R.id.find_participant_fragment_container, fragment, SPECIFY)
.commit();
}
@Override
public void onFragmentInteraction(Uri uri) {
}
@Override
public void onBackPressed(){
super.onBackPressed();
this.finish();
}
}
| 3,415 | 0.680527 | 0.679649 | 112 | 29.491072 | 26.434216 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.482143 | false | false |
13
|
0419c1f7f65ee1cdb0e85e2676b6b6e9fbc1a5d3
| 11,682,311,084,569 |
a3429a84fe32a4db9e4bc7ae69790bc6d8aa2253
|
/src/vrbprog/PlaneShapes/Vertice2D.java
|
8d8382bf96d9a550414c7a94022fc1fdc0cbfd31
|
[] |
no_license
|
vrbprog/CursorHW4
|
https://github.com/vrbprog/CursorHW4
|
cafda27c9e30fd7f599f5e156a13a4d48a9b2e2b
|
836dc8338fac74cce3521949711783a2eb33599c
|
refs/heads/master
| 2023-01-16T07:06:48.127000 | 2020-11-21T23:08:02 | 2020-11-21T23:08:02 | 314,793,955 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package vrbprog.PlaneShapes;
import vrbprog.Shapes.Vertice;
public class Vertice2D extends Vertice {
private int y;
public Vertice2D(int x, int y) {
super(x);
this.y = y;
}
public int getY() {
return y;
}
@Override
public String toString() {
return "Vertice2D{" +
"x=" + getX() +
", y=" + y +
'}';
}
}
|
UTF-8
|
Java
| 419 |
java
|
Vertice2D.java
|
Java
|
[] | null |
[] |
package vrbprog.PlaneShapes;
import vrbprog.Shapes.Vertice;
public class Vertice2D extends Vertice {
private int y;
public Vertice2D(int x, int y) {
super(x);
this.y = y;
}
public int getY() {
return y;
}
@Override
public String toString() {
return "Vertice2D{" +
"x=" + getX() +
", y=" + y +
'}';
}
}
| 419 | 0.479714 | 0.472554 | 24 | 16.458334 | 12.913104 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false |
13
|
f9469a59931439d6a390dc1c85e79deba967cbc0
| 15,693,810,557,599 |
e133538fa825b85523bc830a5b0752dc127ea310
|
/Java/FileSearcher/src/Rights.java
|
00e74c9df38782f61cc571ac3b7b87ff3486fcab
|
[] |
no_license
|
karabutov/Code-Examples
|
https://github.com/karabutov/Code-Examples
|
2ec9fc87ce9b5044311aeace04adcf832539abec
|
fa7e686d1b9b9f44da367739cd9b0936337bfbd7
|
refs/heads/master
| 2020-03-25T16:08:17.617000 | 2018-08-12T16:03:26 | 2018-08-12T16:03:26 | 143,916,560 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ru.karabutov.file_seacher.pattern;
public class Rights extends TypeOfInfo {
Rights(String info){
super(info, 11);
}
@Override
public boolean printLine() {
if(!isPrinted()) {
System.out.print(getInfo());
setPrinted(true);
return true;
} else {
for(int i = 0; i < getSizeOfField(); i++) {
System.out.print(" ");
}
return true;
}
}
@Override
public void printColoumn() {
System.out.print("Rights(read, write, execute)");
for(int i = 0; i < getSizeOfField() + 4; i++) {
System.out.print(" ");
}
}
}
|
UTF-8
|
Java
| 591 |
java
|
Rights.java
|
Java
|
[] | null |
[] |
package ru.karabutov.file_seacher.pattern;
public class Rights extends TypeOfInfo {
Rights(String info){
super(info, 11);
}
@Override
public boolean printLine() {
if(!isPrinted()) {
System.out.print(getInfo());
setPrinted(true);
return true;
} else {
for(int i = 0; i < getSizeOfField(); i++) {
System.out.print(" ");
}
return true;
}
}
@Override
public void printColoumn() {
System.out.print("Rights(read, write, execute)");
for(int i = 0; i < getSizeOfField() + 4; i++) {
System.out.print(" ");
}
}
}
| 591 | 0.575296 | 0.566836 | 32 | 16.46875 | 16.116732 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2 | false | false |
13
|
98655540ee1ec5acd5e72e756fa7d11ad053b3e6
| 32,083,405,718,763 |
c99881551bd454222ceaba31157673780172ae18
|
/2D-Array/1.RowWiseSum.java
|
89d6b68bf8b975fcf386b3343a6a175ad4a9beb3
|
[] |
no_license
|
GSamridhi09/DS_JAVA
|
https://github.com/GSamridhi09/DS_JAVA
|
02f47abaac6b3039c5ed359cf0044c5cd5f759c3
|
01c4d80f5d0dc218d1e1dbc024673161cd42bea4
|
refs/heads/main
| 2023-08-04T05:44:30.443000 | 2021-09-19T18:38:40 | 2021-09-19T18:38:40 | 403,153,900 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int r=s.nextInt();
int c=s.nextInt();
int sum=0;
int arr[][]=new int[r][c];
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
arr[i][j]=s.nextInt();
}
}
for(int i=0;i<r;i++)
{
sum=0;
for(int j=0;j<c;j++)
{
sum+=arr[i][j];
}
System.out.print(sum+" ");
}
}
}
|
UTF-8
|
Java
| 497 |
java
|
1.RowWiseSum.java
|
Java
|
[] | null |
[] |
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int r=s.nextInt();
int c=s.nextInt();
int sum=0;
int arr[][]=new int[r][c];
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
arr[i][j]=s.nextInt();
}
}
for(int i=0;i<r;i++)
{
sum=0;
for(int j=0;j<c;j++)
{
sum+=arr[i][j];
}
System.out.print(sum+" ");
}
}
}
| 497 | 0.434608 | 0.422535 | 27 | 17.333334 | 11.595018 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.888889 | false | false |
13
|
8d1abf22469e3e99090af79922d2adbf53d0d16a
| 429,496,741,967 |
62d349a3093a78f3601ecf823d5f57266d6ad8c3
|
/app/src/main/java/mr/elhadj/tramwaytransport/LogRecyclerViewAdapter.java
|
c433bc642e5c7ce62f281351d40f8571a9b389d3
|
[
"MIT"
] |
permissive
|
dinoelhadj/TramwayTransportApp
|
https://github.com/dinoelhadj/TramwayTransportApp
|
f54c5d8aedd21f780a3f7ab474ac6bf9a0fc44b9
|
7a2b3d4e6af938c0367ca98cbd88a89c002db9be
|
refs/heads/master
| 2023-06-20T08:37:49.474000 | 2021-04-19T03:40:20 | 2021-04-19T03:40:20 | 324,190,247 | 4 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package mr.elhadj.tramwaytransport;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class LogRecyclerViewAdapter extends RecyclerView.Adapter<LogRecyclerViewAdapter.LogViewHolder> {
private ArrayList<Log> myLogArrayList;
private OnItemClickListener myListener;
public interface OnItemClickListener {
void onItemClick(int position);
}
public void setOnItemClickListener(OnItemClickListener listener){
myListener = listener;
}
public static class LogViewHolder extends RecyclerView.ViewHolder{
public TextView tv_idLogRv, tv_logRv;
public LogViewHolder(@NonNull View itemView, final OnItemClickListener listener) {
super(itemView);
tv_idLogRv = itemView.findViewById(R.id.tv_idLogRv);
tv_logRv = itemView.findViewById(R.id.tv_logRv);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null){
int position = getAdapterPosition();
if (position!= RecyclerView.NO_POSITION){
listener.onItemClick(position);
}
}
}
});
}
}
public LogRecyclerViewAdapter(ArrayList<Log> LogArrayList){
myLogArrayList = LogArrayList;
}
@NonNull
@Override
public LogViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.rv_logitem,parent,false);
LogViewHolder lvh = new LogViewHolder(v, myListener);
return lvh;
}
@Override
public void onBindViewHolder(@NonNull LogViewHolder holder, int position) {
Log currentItem = myLogArrayList.get(position);
String toDisplay = "";
if (currentItem.getAct().toLowerCase().matches("located")){
toDisplay = "Agent " + currentItem.getAgent_id() + " located"
+ " stop " + currentItem.getStop_id()
+ " vehicle " + currentItem.getVehicle_id()
+ " dest " + currentItem.getDestination_id();
} else {
toDisplay = "Agent " + currentItem.getAgent_id() + " "
+ currentItem.getAct().toLowerCase()
+ " card " + currentItem.getCard_id()
+ " stop " + currentItem.getStop_id()
+ " vehicle " + currentItem.getVehicle_id()
+ " dest " + currentItem.getDestination_id();
}
holder.tv_idLogRv.setText(currentItem.getId());
holder.tv_logRv.setText(toDisplay);
}
@Override
public int getItemCount() {
return myLogArrayList.size();
}
}
|
UTF-8
|
Java
| 3,041 |
java
|
LogRecyclerViewAdapter.java
|
Java
|
[] | null |
[] |
package mr.elhadj.tramwaytransport;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class LogRecyclerViewAdapter extends RecyclerView.Adapter<LogRecyclerViewAdapter.LogViewHolder> {
private ArrayList<Log> myLogArrayList;
private OnItemClickListener myListener;
public interface OnItemClickListener {
void onItemClick(int position);
}
public void setOnItemClickListener(OnItemClickListener listener){
myListener = listener;
}
public static class LogViewHolder extends RecyclerView.ViewHolder{
public TextView tv_idLogRv, tv_logRv;
public LogViewHolder(@NonNull View itemView, final OnItemClickListener listener) {
super(itemView);
tv_idLogRv = itemView.findViewById(R.id.tv_idLogRv);
tv_logRv = itemView.findViewById(R.id.tv_logRv);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null){
int position = getAdapterPosition();
if (position!= RecyclerView.NO_POSITION){
listener.onItemClick(position);
}
}
}
});
}
}
public LogRecyclerViewAdapter(ArrayList<Log> LogArrayList){
myLogArrayList = LogArrayList;
}
@NonNull
@Override
public LogViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.rv_logitem,parent,false);
LogViewHolder lvh = new LogViewHolder(v, myListener);
return lvh;
}
@Override
public void onBindViewHolder(@NonNull LogViewHolder holder, int position) {
Log currentItem = myLogArrayList.get(position);
String toDisplay = "";
if (currentItem.getAct().toLowerCase().matches("located")){
toDisplay = "Agent " + currentItem.getAgent_id() + " located"
+ " stop " + currentItem.getStop_id()
+ " vehicle " + currentItem.getVehicle_id()
+ " dest " + currentItem.getDestination_id();
} else {
toDisplay = "Agent " + currentItem.getAgent_id() + " "
+ currentItem.getAct().toLowerCase()
+ " card " + currentItem.getCard_id()
+ " stop " + currentItem.getStop_id()
+ " vehicle " + currentItem.getVehicle_id()
+ " dest " + currentItem.getDestination_id();
}
holder.tv_idLogRv.setText(currentItem.getId());
holder.tv_logRv.setText(toDisplay);
}
@Override
public int getItemCount() {
return myLogArrayList.size();
}
}
| 3,041 | 0.607366 | 0.607366 | 88 | 33.545456 | 28.041328 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.420455 | false | false |
13
|
dd22ff92d8d859a751e4e2d4b511ddca9b0d4a87
| 21,363,167,372,877 |
f7b5feb3f6f31945442c79bf0c624fdc8d18e5d1
|
/src/PurchaseRequest.java
|
9d68ecfdf00714c1f81a455e0ba3cab4e90ef0b5
|
[] |
no_license
|
deniseclark/prs_application
|
https://github.com/deniseclark/prs_application
|
11dd079a016cbe9e5bec8d23923cbe2e9bb1be0a
|
cb8d05d3e40b1bf22850c7833af60c5f01ed5623
|
refs/heads/master
| 2021-08-08T08:51:29.727000 | 2017-11-10T00:35:36 | 2017-11-10T00:35:36 | 110,181,876 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
//*****************************************************************************
//*** ***
//*** Class Name: PurchaseRequest ***
//*** ***
//*** Description: The PurchaseRequest Class Corresponds to the ***
//*** PURCHASE_REQUEST Table in the PRS Database. ***
//*** All of the Functionality in the Purchase Request Class ***
//*** is Applicable to Creating an Object Instance of a ***
//*** Purchase Request Class. See also the Class ***
//*** PurchaseRequestDB for Performing DML Applicable to the ***
//*** PURCHASE_REQUEST Table based on the Purchase Request ***
//*** Class. ***
//*** ***
//*****************************************************************************
public class PurchaseRequest {
// **************************
// *** Instance Variables ***
// **************************
private int id;
private int userId;
private String description;
private String justification;
private String dateNeeded; // Coming from DB as DATE ???
private String deliveryMode;
private int statusId;
private double total;
private String submittedDate; // Coming from DB as DATE ???
private String reasonForRejection;
private boolean isActive;
// ***************************
// *** Default Constructor ***
// ***************************
public PurchaseRequest() {
id = 0;
userId = 0;
description = "";
justification = "";
dateNeeded = "";
deliveryMode = "";
statusId = 0;
total = 0.0;
submittedDate = "";
reasonForRejection = "";
isActive = true;
}
// ***********************************
// *** Fully Qualified Constructor ***
// ***********************************
public PurchaseRequest(int id, int userId, String description, String justification, String dateNeeded,
String deliveryMode, int statusId, double total, String submittedDate, String reasonForRejection,
boolean isActive) {
this.id = id;
this.userId = userId;
this.description = description;
this.justification = justification;
this.dateNeeded = dateNeeded;
this.deliveryMode = deliveryMode;
this.statusId = statusId;
this.total = total;
this.submittedDate = submittedDate;
this.reasonForRejection = reasonForRejection;
this.isActive = isActive;
}
// ***************************
// *** Setters and Getters ***
// ***************************
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getJustification() {
return justification;
}
public void setJustification(String justification) {
this.justification = justification;
}
public String getDateNeeded() {
return dateNeeded;
}
public void setDateNeeded(String dateNeeded) {
this.dateNeeded = dateNeeded;
}
public String getDeliveryMode() {
return deliveryMode;
}
public void setDeliveryMode(String deliveryMode) {
this.deliveryMode = deliveryMode;
}
public int getStatusId() {
return statusId;
}
public void setStatusId(int statusId) {
this.statusId = statusId;
}
public double getTotal() {
return total;
}
public void setTotal(double total) {
this.total = total;
}
public String getSubmittedDate() {
return submittedDate;
}
public void setSubmittedDate(String submittedDate) {
this.submittedDate = submittedDate;
}
public String getReasonForRejection() {
return reasonForRejection;
}
public void setReasonForRejection(String reasonForRejection) {
this.reasonForRejection = reasonForRejection;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
// **********************************
// ***@Override - hashCode Method ***
// **********************************
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((dateNeeded == null) ? 0 : dateNeeded.hashCode());
result = prime * result + ((deliveryMode == null) ? 0 : deliveryMode.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + id;
result = prime * result + (isActive ? 1231 : 1237);
result = prime * result + ((justification == null) ? 0 : justification.hashCode());
result = prime * result + ((reasonForRejection == null) ? 0 : reasonForRejection.hashCode());
result = prime * result + statusId;
result = prime * result + ((submittedDate == null) ? 0 : submittedDate.hashCode());
long temp;
temp = Double.doubleToLongBits(total);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + userId;
return result;
}
// ********************************
// ***@Override - equals Method ***
// ********************************
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PurchaseRequest other = (PurchaseRequest) obj;
if (dateNeeded == null) {
if (other.dateNeeded != null)
return false;
} else if (!dateNeeded.equals(other.dateNeeded))
return false;
if (deliveryMode == null) {
if (other.deliveryMode != null)
return false;
} else if (!deliveryMode.equals(other.deliveryMode))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (id != other.id)
return false;
if (isActive != other.isActive)
return false;
if (justification == null) {
if (other.justification != null)
return false;
} else if (!justification.equals(other.justification))
return false;
if (reasonForRejection == null) {
if (other.reasonForRejection != null)
return false;
} else if (!reasonForRejection.equals(other.reasonForRejection))
return false;
if (statusId != other.statusId)
return false;
if (submittedDate == null) {
if (other.submittedDate != null)
return false;
} else if (!submittedDate.equals(other.submittedDate))
return false;
if (Double.doubleToLongBits(total) != Double.doubleToLongBits(other.total))
return false;
if (userId != other.userId)
return false;
return true;
}
// **********************************
// ***@Override - toString Method ***
// **********************************
@Override
public String toString() {
return "PurchaseRequest [id=" + id + ", userId=" + userId + ", description=" + description + ", "
+ "justification=" + justification + ", dateNeeded=" + dateNeeded + ", deliveryMode=" + deliveryMode
+ ", " + "statusID=" + statusId + ", total=" + total + ", submittedDate=" + submittedDate + ", "
+ "reasonForRejection=" + reasonForRejection + ", isActive=" + isActive + "]";
}
// *************************************************************************
// *** Display the Content of the Object - More Formatted than toString ***
// *************************************************************************
public void displayPurchaseRequest() {
System.out.println();
System.out.println("Current Purchase Request Values");
System.out.println("-------------------------------");
System.out.println("ID: " + this.id);
System.out.println("UserID: " + this.userId);
System.out.println("Description: " + this.description);
System.out.println("Justification: " + this.justification);
System.out.println("DateNeeded: " + this.dateNeeded);
System.out.println("DeliveryMode: " + this.deliveryMode);
System.out.println("StatusID: " + this.statusId);
System.out.println("Total: " + this.total);
System.out.println("SubmittedDate: " + this.submittedDate);
System.out.println("Reason for Rejection: " + this.reasonForRejection);
System.out.println("Active: " + this.isActive);
}
}
|
UTF-8
|
Java
| 8,519 |
java
|
PurchaseRequest.java
|
Java
|
[] | null |
[] |
//*****************************************************************************
//*** ***
//*** Class Name: PurchaseRequest ***
//*** ***
//*** Description: The PurchaseRequest Class Corresponds to the ***
//*** PURCHASE_REQUEST Table in the PRS Database. ***
//*** All of the Functionality in the Purchase Request Class ***
//*** is Applicable to Creating an Object Instance of a ***
//*** Purchase Request Class. See also the Class ***
//*** PurchaseRequestDB for Performing DML Applicable to the ***
//*** PURCHASE_REQUEST Table based on the Purchase Request ***
//*** Class. ***
//*** ***
//*****************************************************************************
public class PurchaseRequest {
// **************************
// *** Instance Variables ***
// **************************
private int id;
private int userId;
private String description;
private String justification;
private String dateNeeded; // Coming from DB as DATE ???
private String deliveryMode;
private int statusId;
private double total;
private String submittedDate; // Coming from DB as DATE ???
private String reasonForRejection;
private boolean isActive;
// ***************************
// *** Default Constructor ***
// ***************************
public PurchaseRequest() {
id = 0;
userId = 0;
description = "";
justification = "";
dateNeeded = "";
deliveryMode = "";
statusId = 0;
total = 0.0;
submittedDate = "";
reasonForRejection = "";
isActive = true;
}
// ***********************************
// *** Fully Qualified Constructor ***
// ***********************************
public PurchaseRequest(int id, int userId, String description, String justification, String dateNeeded,
String deliveryMode, int statusId, double total, String submittedDate, String reasonForRejection,
boolean isActive) {
this.id = id;
this.userId = userId;
this.description = description;
this.justification = justification;
this.dateNeeded = dateNeeded;
this.deliveryMode = deliveryMode;
this.statusId = statusId;
this.total = total;
this.submittedDate = submittedDate;
this.reasonForRejection = reasonForRejection;
this.isActive = isActive;
}
// ***************************
// *** Setters and Getters ***
// ***************************
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getJustification() {
return justification;
}
public void setJustification(String justification) {
this.justification = justification;
}
public String getDateNeeded() {
return dateNeeded;
}
public void setDateNeeded(String dateNeeded) {
this.dateNeeded = dateNeeded;
}
public String getDeliveryMode() {
return deliveryMode;
}
public void setDeliveryMode(String deliveryMode) {
this.deliveryMode = deliveryMode;
}
public int getStatusId() {
return statusId;
}
public void setStatusId(int statusId) {
this.statusId = statusId;
}
public double getTotal() {
return total;
}
public void setTotal(double total) {
this.total = total;
}
public String getSubmittedDate() {
return submittedDate;
}
public void setSubmittedDate(String submittedDate) {
this.submittedDate = submittedDate;
}
public String getReasonForRejection() {
return reasonForRejection;
}
public void setReasonForRejection(String reasonForRejection) {
this.reasonForRejection = reasonForRejection;
}
public boolean isActive() {
return isActive;
}
public void setActive(boolean isActive) {
this.isActive = isActive;
}
// **********************************
// ***@Override - hashCode Method ***
// **********************************
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((dateNeeded == null) ? 0 : dateNeeded.hashCode());
result = prime * result + ((deliveryMode == null) ? 0 : deliveryMode.hashCode());
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + id;
result = prime * result + (isActive ? 1231 : 1237);
result = prime * result + ((justification == null) ? 0 : justification.hashCode());
result = prime * result + ((reasonForRejection == null) ? 0 : reasonForRejection.hashCode());
result = prime * result + statusId;
result = prime * result + ((submittedDate == null) ? 0 : submittedDate.hashCode());
long temp;
temp = Double.doubleToLongBits(total);
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + userId;
return result;
}
// ********************************
// ***@Override - equals Method ***
// ********************************
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PurchaseRequest other = (PurchaseRequest) obj;
if (dateNeeded == null) {
if (other.dateNeeded != null)
return false;
} else if (!dateNeeded.equals(other.dateNeeded))
return false;
if (deliveryMode == null) {
if (other.deliveryMode != null)
return false;
} else if (!deliveryMode.equals(other.deliveryMode))
return false;
if (description == null) {
if (other.description != null)
return false;
} else if (!description.equals(other.description))
return false;
if (id != other.id)
return false;
if (isActive != other.isActive)
return false;
if (justification == null) {
if (other.justification != null)
return false;
} else if (!justification.equals(other.justification))
return false;
if (reasonForRejection == null) {
if (other.reasonForRejection != null)
return false;
} else if (!reasonForRejection.equals(other.reasonForRejection))
return false;
if (statusId != other.statusId)
return false;
if (submittedDate == null) {
if (other.submittedDate != null)
return false;
} else if (!submittedDate.equals(other.submittedDate))
return false;
if (Double.doubleToLongBits(total) != Double.doubleToLongBits(other.total))
return false;
if (userId != other.userId)
return false;
return true;
}
// **********************************
// ***@Override - toString Method ***
// **********************************
@Override
public String toString() {
return "PurchaseRequest [id=" + id + ", userId=" + userId + ", description=" + description + ", "
+ "justification=" + justification + ", dateNeeded=" + dateNeeded + ", deliveryMode=" + deliveryMode
+ ", " + "statusID=" + statusId + ", total=" + total + ", submittedDate=" + submittedDate + ", "
+ "reasonForRejection=" + reasonForRejection + ", isActive=" + isActive + "]";
}
// *************************************************************************
// *** Display the Content of the Object - More Formatted than toString ***
// *************************************************************************
public void displayPurchaseRequest() {
System.out.println();
System.out.println("Current Purchase Request Values");
System.out.println("-------------------------------");
System.out.println("ID: " + this.id);
System.out.println("UserID: " + this.userId);
System.out.println("Description: " + this.description);
System.out.println("Justification: " + this.justification);
System.out.println("DateNeeded: " + this.dateNeeded);
System.out.println("DeliveryMode: " + this.deliveryMode);
System.out.println("StatusID: " + this.statusId);
System.out.println("Total: " + this.total);
System.out.println("SubmittedDate: " + this.submittedDate);
System.out.println("Reason for Rejection: " + this.reasonForRejection);
System.out.println("Active: " + this.isActive);
}
}
| 8,519 | 0.570255 | 0.567437 | 268 | 30.787313 | 25.726814 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.932836 | false | false |
13
|
325ab00617c71dbc7c852a3efd78d6d1b177643d
| 3,169,685,918,142 |
36f1439f0323f766c9a63634e97de5b9409a7049
|
/Legend/src/com/legend/lib/deleteProduct.java
|
1f9dbaa0e2159c0a3449ea55feb92669f34de63a
|
[] |
no_license
|
meher404/Legend-Deploy
|
https://github.com/meher404/Legend-Deploy
|
0e69014c9718af335cece5c3110030d408c9ba98
|
94e49dbef068ddcc7661f9703f232f25189a747f
|
refs/heads/master
| 2021-01-23T00:06:59.802000 | 2015-05-18T10:23:03 | 2015-05-18T10:23:03 | 35,810,653 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.legend.lib;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class deleteProduct {
static DBConnection db=null;
static Connection con=null;
static Statement st=null;
static Statement st1=null;
static Connection conn = null;
static Statement stmt = null;
static ResultSet rs=null;
static ResultSet rs1=null;
static PreparedStatement prep;
public void deleteProductAdmin(String pid){
try {
db=new DBConnection();
con=db.getConnection();
st = con.createStatement();
int i=st.executeUpdate("update product set status=\"Inactive\" where PID='"+pid+"';" );
System.out.println(i);
} catch (SQLException e) {
e.printStackTrace();
}
}
public void deleteFromCart(String uid,String pid){
try {
db=new DBConnection();
con=db.getConnection();
st = con.createStatement();
int i=st.executeUpdate("delete from cart where userid='"+uid+"' and PID='"+pid+"' ;" );
System.out.println(i);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
|
UTF-8
|
Java
| 1,129 |
java
|
deleteProduct.java
|
Java
|
[] | null |
[] |
package com.legend.lib;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class deleteProduct {
static DBConnection db=null;
static Connection con=null;
static Statement st=null;
static Statement st1=null;
static Connection conn = null;
static Statement stmt = null;
static ResultSet rs=null;
static ResultSet rs1=null;
static PreparedStatement prep;
public void deleteProductAdmin(String pid){
try {
db=new DBConnection();
con=db.getConnection();
st = con.createStatement();
int i=st.executeUpdate("update product set status=\"Inactive\" where PID='"+pid+"';" );
System.out.println(i);
} catch (SQLException e) {
e.printStackTrace();
}
}
public void deleteFromCart(String uid,String pid){
try {
db=new DBConnection();
con=db.getConnection();
st = con.createStatement();
int i=st.executeUpdate("delete from cart where userid='"+uid+"' and PID='"+pid+"' ;" );
System.out.println(i);
} catch (SQLException e) {
e.printStackTrace();
}
}
}
| 1,129 | 0.695306 | 0.693534 | 50 | 21.58 | 19.290506 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.16 | false | false |
13
|
6d36365b2ac6a8213e30422845f97f310c7a5f9b
| 1,279,900,298,479 |
0ac8d28c0b54de8d713f7131c2864bf678f06004
|
/springMVCHibernate5-my/src/main/java/com/hzitxx/spring/demo/aspect/LogAspect.java
|
7058fd9043f4c1aada4ee9a7c60f5d23fbc22b18
|
[] |
no_license
|
cglkoo/oldProject
|
https://github.com/cglkoo/oldProject
|
0f37957ce9b5ed32e7baaa66b28338c072fbea13
|
a83f25e1eb3c911e265ba133dfdbc371504b14b0
|
refs/heads/master
| 2022-12-21T15:01:18.457000 | 2019-04-20T08:11:13 | 2019-04-20T08:11:23 | 178,792,635 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.hzitxx.spring.demo.aspect;
import java.util.Arrays;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.JoinPoint;
public class LogAspect {
private Logger logger = LogManager.getRootLogger();
/**
* 调用业务逻辑方法前的 Advice
* 方法关联一个链接点参数joinPoint
* @param joinPoint
*/
public void doBefore(JoinPoint joinPoint){
//System.out.println("===== 执行方法前的动作 =====");
logger.info("==== 执行任务前做日志记录 ====");
String methodName = joinPoint.getSignature().getName();
//System.out.println("执行的方法是:" + methodName);
logger.info("执行的方法是:" + methodName);
List<Object> param = Arrays.asList(joinPoint.getArgs());
//System.out.println("方法的参数有:" + param);
logger.debug("该方法的参数是:" + param);
}
/**
* 调用业务逻辑方法后的Advice
* 方法关联一个链接点参数joinPoint
* @param joinPoint
*/
public void doAfter(JoinPoint joinPoint){
//System.out.println("===== 执行方法后的动作 =====");
logger.info("===== 执行方法后的动作 =====");
String methodName = joinPoint.getSignature().getName();
//System.out.println("执行的方法是:" + methodName);
logger.info("执行的方法是:" + methodName);
}
public void afterThrowing(JoinPoint joinPoint, Exception ex){
logger.error("==== 方法抛异常后 ===");
logger.error("执行的方法是:" + joinPoint.getSignature().getName() + ",异常信息是:");
logger.error(ex.getMessage());
}
}
|
UTF-8
|
Java
| 1,674 |
java
|
LogAspect.java
|
Java
|
[] | null |
[] |
package com.hzitxx.spring.demo.aspect;
import java.util.Arrays;
import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.JoinPoint;
public class LogAspect {
private Logger logger = LogManager.getRootLogger();
/**
* 调用业务逻辑方法前的 Advice
* 方法关联一个链接点参数joinPoint
* @param joinPoint
*/
public void doBefore(JoinPoint joinPoint){
//System.out.println("===== 执行方法前的动作 =====");
logger.info("==== 执行任务前做日志记录 ====");
String methodName = joinPoint.getSignature().getName();
//System.out.println("执行的方法是:" + methodName);
logger.info("执行的方法是:" + methodName);
List<Object> param = Arrays.asList(joinPoint.getArgs());
//System.out.println("方法的参数有:" + param);
logger.debug("该方法的参数是:" + param);
}
/**
* 调用业务逻辑方法后的Advice
* 方法关联一个链接点参数joinPoint
* @param joinPoint
*/
public void doAfter(JoinPoint joinPoint){
//System.out.println("===== 执行方法后的动作 =====");
logger.info("===== 执行方法后的动作 =====");
String methodName = joinPoint.getSignature().getName();
//System.out.println("执行的方法是:" + methodName);
logger.info("执行的方法是:" + methodName);
}
public void afterThrowing(JoinPoint joinPoint, Exception ex){
logger.error("==== 方法抛异常后 ===");
logger.error("执行的方法是:" + joinPoint.getSignature().getName() + ",异常信息是:");
logger.error(ex.getMessage());
}
}
| 1,674 | 0.656516 | 0.655099 | 51 | 25.686274 | 20.892338 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.54902 | false | false |
13
|
64cb6f8a0dde2e973387b96fe9c6c3b91a853b23
| 29,867,202,613,852 |
f08ec1a5dc248fc7dae55a4a8a4da5a51a46a82b
|
/mock-app/src/main/java/com/fortech/mockapp/service/CompanyService.java
|
2cfb4b549718656ee0aa32d83f15bc15aace5f9c
|
[] |
no_license
|
radasilviu/mock-server-client-backend
|
https://github.com/radasilviu/mock-server-client-backend
|
971ffddeadc89ba0b78149513887ce270b5ddb26
|
3199d195f9fff813de8dd306d3563b7ed0261071
|
refs/heads/master
| 2023-01-11T23:11:20.703000 | 2020-11-10T10:07:33 | 2020-11-10T10:07:33 | 295,981,241 | 0 | 0 | null | false | 2020-11-10T10:07:34 | 2020-09-16T09:08:36 | 2020-11-05T11:04:42 | 2020-11-10T10:07:34 | 187 | 0 | 0 | 0 |
Java
| false | false |
package com.fortech.mockapp.service;
import com.fortech.mockapp.configuration.model.PagedRequest;
import com.fortech.mockapp.entities.CompanyModel;
import com.fortech.mockapp.repository.CompanyRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service
public class CompanyService {
private CompanyRepository companyRepository;
private Pager<CompanyModel, Integer> companyPager;
@Autowired
public CompanyService(CompanyRepository companyRepository, Pager companyPager) {
this.companyRepository = companyRepository;
this.companyPager = companyPager;
setPagerRepository();
}
private void setPagerRepository() {
this.companyPager.setRepository(this.companyRepository);
}
public CompanyModel update(int id, CompanyModel company) {
Optional<CompanyModel> temp = companyRepository.findById(id);
temp.get().setName(company.getName());
return companyRepository.save(temp.get());
}
public void delete(int id) {
companyRepository.deleteById(id);
}
public Map<String, Object> list(PagedRequest requestParams) {
companyPager.setRequestParams(requestParams);
return companyPager.getPagedResponse();
}
public Page findByFilter(String filter, Pageable pageable, ArrayList<String> columns) {
Page page = companyRepository.findAll(new Specification<CompanyModel>() {
@Override
public Predicate toPredicate(Root<CompanyModel> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> predicates = new ArrayList<>();
if (!filter.equals("")) {
for (String column : columns) {
predicates.add(
criteriaBuilder.like(
criteriaBuilder.lower(
root.get(column).as(String.class)
), "%" + filter.toLowerCase() + "%"
)
);
}
} else {
predicates.add(criteriaBuilder.equal(criteriaBuilder.literal(1), 1));
}
return criteriaBuilder.or(
predicates.toArray(new Predicate[] {})
);
}
}, pageable);
return page;
}
}
|
UTF-8
|
Java
| 2,907 |
java
|
CompanyService.java
|
Java
|
[] | null |
[] |
package com.fortech.mockapp.service;
import com.fortech.mockapp.configuration.model.PagedRequest;
import com.fortech.mockapp.entities.CompanyModel;
import com.fortech.mockapp.repository.CompanyRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@Service
public class CompanyService {
private CompanyRepository companyRepository;
private Pager<CompanyModel, Integer> companyPager;
@Autowired
public CompanyService(CompanyRepository companyRepository, Pager companyPager) {
this.companyRepository = companyRepository;
this.companyPager = companyPager;
setPagerRepository();
}
private void setPagerRepository() {
this.companyPager.setRepository(this.companyRepository);
}
public CompanyModel update(int id, CompanyModel company) {
Optional<CompanyModel> temp = companyRepository.findById(id);
temp.get().setName(company.getName());
return companyRepository.save(temp.get());
}
public void delete(int id) {
companyRepository.deleteById(id);
}
public Map<String, Object> list(PagedRequest requestParams) {
companyPager.setRequestParams(requestParams);
return companyPager.getPagedResponse();
}
public Page findByFilter(String filter, Pageable pageable, ArrayList<String> columns) {
Page page = companyRepository.findAll(new Specification<CompanyModel>() {
@Override
public Predicate toPredicate(Root<CompanyModel> root, CriteriaQuery<?> query, CriteriaBuilder criteriaBuilder) {
List<Predicate> predicates = new ArrayList<>();
if (!filter.equals("")) {
for (String column : columns) {
predicates.add(
criteriaBuilder.like(
criteriaBuilder.lower(
root.get(column).as(String.class)
), "%" + filter.toLowerCase() + "%"
)
);
}
} else {
predicates.add(criteriaBuilder.equal(criteriaBuilder.literal(1), 1));
}
return criteriaBuilder.or(
predicates.toArray(new Predicate[] {})
);
}
}, pageable);
return page;
}
}
| 2,907 | 0.643275 | 0.642587 | 79 | 35.79747 | 26.650755 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.582278 | false | false |
13
|
e58ff41a801530fc2c040a04027f1f8895b1d275
| 3,547,643,037,815 |
de2e884d7e5bca4971e7a9872837d1bbe9c5e978
|
/app/src/main/java/com/movie/mling/movieapp/iactivityview/MovieInfoActivityView.java
|
7193ef29b823d61ca0ab660e1832a45850621260
|
[] |
no_license
|
mamengling/MoviePYQ
|
https://github.com/mamengling/MoviePYQ
|
8d6757abe2f90bc47ae81701e5b85cc22617ebcd
|
3520bdd34c8ba86914a555f37e751a6f42433df4
|
refs/heads/master
| 2020-08-13T23:51:54.758000 | 2019-06-19T07:05:22 | 2019-06-19T07:05:22 | 215,059,111 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.movie.mling.movieapp.iactivityview;
import com.movie.mling.movieapp.base.IBaseActView;
import com.movie.mling.movieapp.mode.bean.MovieInfoBean;
/**
* 作者: MLing
* 邮箱:mamenglingkl1314@163.com
* 创建时间 :2018/3/9 12:39
* $DESE$
*/
public interface MovieInfoActivityView extends IBaseActView {
/**
* 成功回调
*/
public void excuteSuccessCallBack(MovieInfoBean mCallBackVo);
/**
* 成功回调
*/
public void excuteSuccessFavCallBack(MovieInfoBean mCallBackVo);
/**
* 成功回调
*/
public void excuteSuccessDigCallBack(MovieInfoBean mCallBackVo);
/**
* 成功回调
*/
public void excuteSuccessPaoCallBack(MovieInfoBean mCallBackVo);
}
|
UTF-8
|
Java
| 748 |
java
|
MovieInfoActivityView.java
|
Java
|
[
{
"context": "ling.movieapp.mode.bean.MovieInfoBean;\n\n/**\n * 作者: MLing\n * 邮箱:mamenglingkl1314@163.com\n * 创建时间 :2018/3/9 ",
"end": 174,
"score": 0.9772864580154419,
"start": 169,
"tag": "USERNAME",
"value": "MLing"
},
{
"context": ".mode.bean.MovieInfoBean;\n\n/**\n * 作者: MLing\n * 邮箱:mamenglingkl1314@163.com\n * 创建时间 :2018/3/9 12:39\n * $DESE$\n */\npublic inte",
"end": 205,
"score": 0.9999069571495056,
"start": 181,
"tag": "EMAIL",
"value": "mamenglingkl1314@163.com"
}
] | null |
[] |
package com.movie.mling.movieapp.iactivityview;
import com.movie.mling.movieapp.base.IBaseActView;
import com.movie.mling.movieapp.mode.bean.MovieInfoBean;
/**
* 作者: MLing
* 邮箱:<EMAIL>
* 创建时间 :2018/3/9 12:39
* $DESE$
*/
public interface MovieInfoActivityView extends IBaseActView {
/**
* 成功回调
*/
public void excuteSuccessCallBack(MovieInfoBean mCallBackVo);
/**
* 成功回调
*/
public void excuteSuccessFavCallBack(MovieInfoBean mCallBackVo);
/**
* 成功回调
*/
public void excuteSuccessDigCallBack(MovieInfoBean mCallBackVo);
/**
* 成功回调
*/
public void excuteSuccessPaoCallBack(MovieInfoBean mCallBackVo);
}
| 731 | 0.693084 | 0.668588 | 30 | 22.133333 | 24.162966 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.233333 | false | false |
13
|
cbdddc2383402478e42d5698766964132174af81
| 16,123,307,232,951 |
5d76b555a3614ab0f156bcad357e45c94d121e2d
|
/src-v3/oauth/signpost/AbstractOAuthConsumer.java
|
109ac1392e9c0c2a93e64bf558235eac7e33fd5f
|
[] |
no_license
|
BinSlashBash/xcrumby
|
https://github.com/BinSlashBash/xcrumby
|
8e09282387e2e82d12957d22fa1bb0322f6e6227
|
5b8b1cc8537ae1cfb59448d37b6efca01dded347
|
refs/heads/master
| 2016-09-01T05:58:46.144000 | 2016-02-15T13:23:25 | 2016-02-15T13:23:25 | 51,755,603 | 5 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package oauth.signpost;
import com.crumby.impl.crumby.UnsupportedUrlFragment;
import java.io.IOException;
import java.util.Random;
import oauth.signpost.basic.UrlStringRequestAdapter;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
import oauth.signpost.http.HttpParameters;
import oauth.signpost.http.HttpRequest;
import oauth.signpost.signature.AuthorizationHeaderSigningStrategy;
import oauth.signpost.signature.HmacSha1MessageSigner;
import oauth.signpost.signature.OAuthMessageSigner;
import oauth.signpost.signature.QueryStringSigningStrategy;
import oauth.signpost.signature.SigningStrategy;
public abstract class AbstractOAuthConsumer implements OAuthConsumer {
private static final long serialVersionUID = 1;
private HttpParameters additionalParameters;
private String consumerKey;
private String consumerSecret;
private OAuthMessageSigner messageSigner;
private final Random random;
private HttpParameters requestParameters;
private boolean sendEmptyTokens;
private SigningStrategy signingStrategy;
private String token;
protected abstract HttpRequest wrap(Object obj);
public AbstractOAuthConsumer(String consumerKey, String consumerSecret) {
this.random = new Random(System.nanoTime());
this.consumerKey = consumerKey;
this.consumerSecret = consumerSecret;
setMessageSigner(new HmacSha1MessageSigner());
setSigningStrategy(new AuthorizationHeaderSigningStrategy());
}
public void setMessageSigner(OAuthMessageSigner messageSigner) {
this.messageSigner = messageSigner;
messageSigner.setConsumerSecret(this.consumerSecret);
}
public void setSigningStrategy(SigningStrategy signingStrategy) {
this.signingStrategy = signingStrategy;
}
public void setAdditionalParameters(HttpParameters additionalParameters) {
this.additionalParameters = additionalParameters;
}
public synchronized HttpRequest sign(HttpRequest request) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException {
if (this.consumerKey == null) {
throw new OAuthExpectationFailedException("consumer key not set");
} else if (this.consumerSecret == null) {
throw new OAuthExpectationFailedException("consumer secret not set");
} else {
this.requestParameters = new HttpParameters();
try {
if (this.additionalParameters != null) {
this.requestParameters.putAll(this.additionalParameters, false);
}
collectHeaderParameters(request, this.requestParameters);
collectQueryParameters(request, this.requestParameters);
collectBodyParameters(request, this.requestParameters);
completeOAuthParameters(this.requestParameters);
this.requestParameters.remove(OAuth.OAUTH_SIGNATURE);
String signature = this.messageSigner.sign(request, this.requestParameters);
OAuth.debugOut("signature", signature);
this.signingStrategy.writeSignature(signature, request, this.requestParameters);
OAuth.debugOut("Request URL", request.getRequestUrl());
} catch (IOException e) {
throw new OAuthCommunicationException(e);
}
}
return request;
}
public synchronized HttpRequest sign(Object request) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException {
return sign(wrap(request));
}
public synchronized String sign(String url) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException {
HttpRequest request;
request = new UrlStringRequestAdapter(url);
SigningStrategy oldStrategy = this.signingStrategy;
this.signingStrategy = new QueryStringSigningStrategy();
sign(request);
this.signingStrategy = oldStrategy;
return request.getRequestUrl();
}
public void setTokenWithSecret(String token, String tokenSecret) {
this.token = token;
this.messageSigner.setTokenSecret(tokenSecret);
}
public String getToken() {
return this.token;
}
public String getTokenSecret() {
return this.messageSigner.getTokenSecret();
}
public String getConsumerKey() {
return this.consumerKey;
}
public String getConsumerSecret() {
return this.consumerSecret;
}
protected void completeOAuthParameters(HttpParameters out) {
if (!out.containsKey(OAuth.OAUTH_CONSUMER_KEY)) {
out.put(OAuth.OAUTH_CONSUMER_KEY, this.consumerKey, true);
}
if (!out.containsKey(OAuth.OAUTH_SIGNATURE_METHOD)) {
out.put(OAuth.OAUTH_SIGNATURE_METHOD, this.messageSigner.getSignatureMethod(), true);
}
if (!out.containsKey(OAuth.OAUTH_TIMESTAMP)) {
out.put(OAuth.OAUTH_TIMESTAMP, generateTimestamp(), true);
}
if (!out.containsKey(OAuth.OAUTH_NONCE)) {
out.put(OAuth.OAUTH_NONCE, generateNonce(), true);
}
if (!out.containsKey(OAuth.OAUTH_VERSION)) {
out.put(OAuth.OAUTH_VERSION, OAuth.VERSION_1_0, true);
}
if (!out.containsKey(OAuth.OAUTH_TOKEN)) {
if ((this.token != null && !this.token.equals(UnsupportedUrlFragment.DISPLAY_NAME)) || this.sendEmptyTokens) {
out.put(OAuth.OAUTH_TOKEN, this.token, true);
}
}
}
public HttpParameters getRequestParameters() {
return this.requestParameters;
}
public void setSendEmptyTokens(boolean enable) {
this.sendEmptyTokens = enable;
}
protected void collectHeaderParameters(HttpRequest request, HttpParameters out) {
out.putAll(OAuth.oauthHeaderToParamsMap(request.getHeader(OAuth.HTTP_AUTHORIZATION_HEADER)), false);
}
protected void collectBodyParameters(HttpRequest request, HttpParameters out) throws IOException {
String contentType = request.getContentType();
if (contentType != null && contentType.startsWith(OAuth.FORM_ENCODED)) {
out.putAll(OAuth.decodeForm(request.getMessagePayload()), true);
}
}
protected void collectQueryParameters(HttpRequest request, HttpParameters out) {
String url = request.getRequestUrl();
int q = url.indexOf(63);
if (q >= 0) {
out.putAll(OAuth.decodeForm(url.substring(q + 1)), true);
}
}
protected String generateTimestamp() {
return Long.toString(System.currentTimeMillis() / 1000);
}
protected String generateNonce() {
return Long.toString(this.random.nextLong());
}
}
|
UTF-8
|
Java
| 6,956 |
java
|
AbstractOAuthConsumer.java
|
Java
|
[] | null |
[] |
package oauth.signpost;
import com.crumby.impl.crumby.UnsupportedUrlFragment;
import java.io.IOException;
import java.util.Random;
import oauth.signpost.basic.UrlStringRequestAdapter;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
import oauth.signpost.http.HttpParameters;
import oauth.signpost.http.HttpRequest;
import oauth.signpost.signature.AuthorizationHeaderSigningStrategy;
import oauth.signpost.signature.HmacSha1MessageSigner;
import oauth.signpost.signature.OAuthMessageSigner;
import oauth.signpost.signature.QueryStringSigningStrategy;
import oauth.signpost.signature.SigningStrategy;
public abstract class AbstractOAuthConsumer implements OAuthConsumer {
private static final long serialVersionUID = 1;
private HttpParameters additionalParameters;
private String consumerKey;
private String consumerSecret;
private OAuthMessageSigner messageSigner;
private final Random random;
private HttpParameters requestParameters;
private boolean sendEmptyTokens;
private SigningStrategy signingStrategy;
private String token;
protected abstract HttpRequest wrap(Object obj);
public AbstractOAuthConsumer(String consumerKey, String consumerSecret) {
this.random = new Random(System.nanoTime());
this.consumerKey = consumerKey;
this.consumerSecret = consumerSecret;
setMessageSigner(new HmacSha1MessageSigner());
setSigningStrategy(new AuthorizationHeaderSigningStrategy());
}
public void setMessageSigner(OAuthMessageSigner messageSigner) {
this.messageSigner = messageSigner;
messageSigner.setConsumerSecret(this.consumerSecret);
}
public void setSigningStrategy(SigningStrategy signingStrategy) {
this.signingStrategy = signingStrategy;
}
public void setAdditionalParameters(HttpParameters additionalParameters) {
this.additionalParameters = additionalParameters;
}
public synchronized HttpRequest sign(HttpRequest request) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException {
if (this.consumerKey == null) {
throw new OAuthExpectationFailedException("consumer key not set");
} else if (this.consumerSecret == null) {
throw new OAuthExpectationFailedException("consumer secret not set");
} else {
this.requestParameters = new HttpParameters();
try {
if (this.additionalParameters != null) {
this.requestParameters.putAll(this.additionalParameters, false);
}
collectHeaderParameters(request, this.requestParameters);
collectQueryParameters(request, this.requestParameters);
collectBodyParameters(request, this.requestParameters);
completeOAuthParameters(this.requestParameters);
this.requestParameters.remove(OAuth.OAUTH_SIGNATURE);
String signature = this.messageSigner.sign(request, this.requestParameters);
OAuth.debugOut("signature", signature);
this.signingStrategy.writeSignature(signature, request, this.requestParameters);
OAuth.debugOut("Request URL", request.getRequestUrl());
} catch (IOException e) {
throw new OAuthCommunicationException(e);
}
}
return request;
}
public synchronized HttpRequest sign(Object request) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException {
return sign(wrap(request));
}
public synchronized String sign(String url) throws OAuthMessageSignerException, OAuthExpectationFailedException, OAuthCommunicationException {
HttpRequest request;
request = new UrlStringRequestAdapter(url);
SigningStrategy oldStrategy = this.signingStrategy;
this.signingStrategy = new QueryStringSigningStrategy();
sign(request);
this.signingStrategy = oldStrategy;
return request.getRequestUrl();
}
public void setTokenWithSecret(String token, String tokenSecret) {
this.token = token;
this.messageSigner.setTokenSecret(tokenSecret);
}
public String getToken() {
return this.token;
}
public String getTokenSecret() {
return this.messageSigner.getTokenSecret();
}
public String getConsumerKey() {
return this.consumerKey;
}
public String getConsumerSecret() {
return this.consumerSecret;
}
protected void completeOAuthParameters(HttpParameters out) {
if (!out.containsKey(OAuth.OAUTH_CONSUMER_KEY)) {
out.put(OAuth.OAUTH_CONSUMER_KEY, this.consumerKey, true);
}
if (!out.containsKey(OAuth.OAUTH_SIGNATURE_METHOD)) {
out.put(OAuth.OAUTH_SIGNATURE_METHOD, this.messageSigner.getSignatureMethod(), true);
}
if (!out.containsKey(OAuth.OAUTH_TIMESTAMP)) {
out.put(OAuth.OAUTH_TIMESTAMP, generateTimestamp(), true);
}
if (!out.containsKey(OAuth.OAUTH_NONCE)) {
out.put(OAuth.OAUTH_NONCE, generateNonce(), true);
}
if (!out.containsKey(OAuth.OAUTH_VERSION)) {
out.put(OAuth.OAUTH_VERSION, OAuth.VERSION_1_0, true);
}
if (!out.containsKey(OAuth.OAUTH_TOKEN)) {
if ((this.token != null && !this.token.equals(UnsupportedUrlFragment.DISPLAY_NAME)) || this.sendEmptyTokens) {
out.put(OAuth.OAUTH_TOKEN, this.token, true);
}
}
}
public HttpParameters getRequestParameters() {
return this.requestParameters;
}
public void setSendEmptyTokens(boolean enable) {
this.sendEmptyTokens = enable;
}
protected void collectHeaderParameters(HttpRequest request, HttpParameters out) {
out.putAll(OAuth.oauthHeaderToParamsMap(request.getHeader(OAuth.HTTP_AUTHORIZATION_HEADER)), false);
}
protected void collectBodyParameters(HttpRequest request, HttpParameters out) throws IOException {
String contentType = request.getContentType();
if (contentType != null && contentType.startsWith(OAuth.FORM_ENCODED)) {
out.putAll(OAuth.decodeForm(request.getMessagePayload()), true);
}
}
protected void collectQueryParameters(HttpRequest request, HttpParameters out) {
String url = request.getRequestUrl();
int q = url.indexOf(63);
if (q >= 0) {
out.putAll(OAuth.decodeForm(url.substring(q + 1)), true);
}
}
protected String generateTimestamp() {
return Long.toString(System.currentTimeMillis() / 1000);
}
protected String generateNonce() {
return Long.toString(this.random.nextLong());
}
}
| 6,956 | 0.69839 | 0.696521 | 172 | 39.44186 | 32.318943 | 160 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.680233 | false | false |
13
|
799647c0d5af4394da0725621ac7e56d1e595eb2
| 21,182,778,762,270 |
e9f3210efb37fb369b1017afc4e80c5faa341314
|
/3 year/FoodStorage/FoodStorage/src/main/java/com/ooad/g18208/FoodStorage/model/Recipe.java
|
410332bc1c739b93c3ce9c8515efc2f35e09758a
|
[] |
no_license
|
dashsofron/NsuEducation
|
https://github.com/dashsofron/NsuEducation
|
1825fa23bc7a981783e97472192146c61ee714b8
|
bd82370393a2930f9ef3ad22c7a68475092f9f63
|
refs/heads/master
| 2023-08-29T02:43:32.721000 | 2021-11-04T03:42:52 | 2021-11-04T03:42:52 | 243,964,406 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ooad.g18208.FoodStorage.model;
import java.util.List;
public class Recipe {
private String name;
private int id;
private long time;
private int difficulty;
private String rule;
private List<NeededGood> ingredients;
public String getName() {
return name;
}
public int getId() {
return id;
}
public long getTime() {
return time;
}
public int getDifficulty() {
return difficulty;
}
public String getRule() {
return rule;
}
public List<NeededGood> getIngredients() {
return ingredients;
}
public void setName(String name) {
this.name = name;
}
public void setId(int id) {
this.id = id;
}
public void setTime(long time) {
this.time = time;
}
public void setDifficulty(int difficulty) {
this.difficulty = difficulty;
}
public void setRule(String rule) {
this.rule = rule;
}
public void setIngredients(List<NeededGood> ingredients) {
this.ingredients = ingredients;
}
}
|
UTF-8
|
Java
| 1,106 |
java
|
Recipe.java
|
Java
|
[] | null |
[] |
package com.ooad.g18208.FoodStorage.model;
import java.util.List;
public class Recipe {
private String name;
private int id;
private long time;
private int difficulty;
private String rule;
private List<NeededGood> ingredients;
public String getName() {
return name;
}
public int getId() {
return id;
}
public long getTime() {
return time;
}
public int getDifficulty() {
return difficulty;
}
public String getRule() {
return rule;
}
public List<NeededGood> getIngredients() {
return ingredients;
}
public void setName(String name) {
this.name = name;
}
public void setId(int id) {
this.id = id;
}
public void setTime(long time) {
this.time = time;
}
public void setDifficulty(int difficulty) {
this.difficulty = difficulty;
}
public void setRule(String rule) {
this.rule = rule;
}
public void setIngredients(List<NeededGood> ingredients) {
this.ingredients = ingredients;
}
}
| 1,106 | 0.594937 | 0.590416 | 61 | 17.131147 | 15.657686 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.327869 | false | false |
13
|
5cd91f0e485a9a6820eead954d521dba1639ddfa
| 22,222,160,811,034 |
32a202416b4fe82ab1aa9405e22c45ef62d70c07
|
/clp_souyijie_service/src/main/java/com/inext/service/impl/MerchantProductPurposeServiceImpl.java
|
563c6e9da21102c994d3f8e488ba7f54358939ff
|
[] |
no_license
|
licheng700/stone2018
|
https://github.com/licheng700/stone2018
|
81d07a5a0effbbbae7aa4617ec7523f03136c453
|
0fa99cc630bc17f98d5448cbc8b38e0f4b129ce8
|
refs/heads/master
| 2019-03-17T02:38:54.214000 | 2018-02-27T06:25:08 | 2018-02-27T06:25:08 | 123,080,763 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.inext.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.inext.dao.IMerchantProductPurposeDao;
import com.inext.entity.MerchantProductPurpose;
import com.inext.service.IMerchantProductPurposeService;
@Service
@Transactional
public class MerchantProductPurposeServiceImpl implements IMerchantProductPurposeService {
@Autowired
private IMerchantProductPurposeDao merchantProductPurposeDao;
@Override
public List<MerchantProductPurpose> getAllList(Map<String, Object> param) {
return merchantProductPurposeDao.getAllList(param);
}
}
|
UTF-8
|
Java
| 750 |
java
|
MerchantProductPurposeServiceImpl.java
|
Java
|
[] | null |
[] |
package com.inext.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.inext.dao.IMerchantProductPurposeDao;
import com.inext.entity.MerchantProductPurpose;
import com.inext.service.IMerchantProductPurposeService;
@Service
@Transactional
public class MerchantProductPurposeServiceImpl implements IMerchantProductPurposeService {
@Autowired
private IMerchantProductPurposeDao merchantProductPurposeDao;
@Override
public List<MerchantProductPurpose> getAllList(Map<String, Object> param) {
return merchantProductPurposeDao.getAllList(param);
}
}
| 750 | 0.850667 | 0.850667 | 25 | 29 | 27.987141 | 90 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.8 | false | false |
13
|
32a7bef333173ef37b2ed4ba3c81276bf7a4eda1
| 33,835,752,370,201 |
d1ac09928d302d70cd913a79b40cde83c04e2ee0
|
/src/events/brainsynder/games/team/SnowPack.java
|
9c9aa59f0fa9e2cc2e826da6149027c461b2c129
|
[] |
no_license
|
CatsCraft-Private/MiniEvents
|
https://github.com/CatsCraft-Private/MiniEvents
|
908b8b279bcc006372f5cfbb27b9fdad59f0df07
|
e3f4c6a6e98a6ddc1ff8495ede6cba52ecbac58b
|
refs/heads/master
| 2021-01-02T23:19:24.492000 | 2017-11-26T23:40:13 | 2017-11-26T23:40:13 | 99,498,644 | 0 | 1 | null | false | 2017-08-08T17:22:05 | 2017-08-06T16:19:21 | 2017-08-06T16:31:39 | 2017-08-08T17:11:31 | 19,464 | 0 | 1 | 2 |
Java
| null | null |
package events.brainsynder.games.team;
import de.robingrether.idisguise.disguise.DisguiseType;
import de.robingrether.idisguise.disguise.MobDisguise;
import events.brainsynder.key.GameSettings;
import events.brainsynder.key.IGamePlayer;
import events.brainsynder.key.teams.TeamGameMaker;
import events.brainsynder.managers.GameManager;
import events.brainsynder.utils.DisguiseHandler;
import events.brainsynder.utils.RandomRef;
import events.brainsynder.utils.ScoreboardHandler;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.scheduler.BukkitRunnable;
import simple.brainsynder.api.ParticleMaker;
import simple.brainsynder.nms.ITitleMessage;
import simple.brainsynder.utils.Reflection;
import java.util.*;
public class SnowPack extends TeamGameMaker {
private int time = 240, per18 = 0;
private boolean announced = false;
private List<Integer> keyTimes = Arrays.asList(1, 2, 3, 4, 5, 10, 20, 30, 60, 120, 180);
private List<String> snowmen = new ArrayList<>();
public SnowPack(String mapID) {
super(mapID);
randomTeams = false;
}
public SnowPack() {
super();
randomTeams = false;
}
@Override
public String getName() {
return "SnowPack";
}
@Override public void onScoreboardLoad(IGamePlayer player) {
if (player.getScoreHandler() == null) {
ScoreboardHandler handler = new ScoreboardHandler(player.getPlayer().getUniqueId());
handler.setTitle(0, "❅ &bSnowPack &f❅");
handler.setLine(0, 14, "&3Time Left: ", "&b" + RandomRef.formatHHMMSS(time));
LinkedList<String> listed = new LinkedList<>(getPlayers ());
int count = 12;
handler.setLine(0, 13, "&3Players ", "&3In The Event");
while ((listed.peekFirst() != null) && (count >= 8)) {
handler.setLine(0, count, "&3❅ ", "&b" + listed.pollFirst());
count--;
}
if (listed.peekFirst() != null) {
handler.setLineBlank(0, (count - 1));
handler.setLine(0, (count - 2), "&3❅ ", "&bAnd Some More");
}
handler.toggleScoreboard();
player.setScoreHandler(handler);
}
}
@Override public void onScoreboardUpdate(IGamePlayer player) {
if (player.getScoreHandler() != null) {
ScoreboardHandler handler = player.getScoreHandler();
handler.setLine(0, 14, "&3Time Left: ", "&b" + RandomRef.formatHHMMSS(time));
LinkedList<String> listed = new LinkedList<>(getPlayers ());
int count = 12;
handler.setLine(0, 13, "&3Players ", "&3In The Event");
while ((listed.peekFirst() != null) && (count >= 8)) {
handler.setLine(0, count, "&3❅ ", "&b" + listed.pollFirst());
count--;
}
if (listed.peekFirst() != null) {
handler.setLineBlank(0, (count - 1));
handler.setLine(0, (count - 2), "&3❅ ", "&bAnd Some More");
}
}
}
@Override
public void onLeave(IGamePlayer player) {
super.onLeave(player);
if (snowmen.contains(player.getPlayer().getName())) {
if (DisguiseHandler.getApi().isDisguised(player.getPlayer())) {
DisguiseHandler.getApi().undisguise(player.getPlayer());
}
snowmen.remove(player.getPlayer().getName());
if (snowmen.isEmpty()) {
tellPlayers (player.getPlayer().getName() + " has left the game, Selecting a new Snowman...");
randomTagged();
}
}
}
@Override
public void perTick() {
super.perTick();
if (per18 == 18) {
time--;
per18 = 0;
announced = false;
}
per18++;
if (time <= 0) {
if (getRedTeam().size() == 0) {
onWin(getBlueTeam());
}else{
onWin(getRedTeam());
}
return;
}
if (keyTimes.contains(time) && (!announced)) {
String timeLeft = time + " Second(s)";
switch (time) {
case 180:
timeLeft = "3 Minutes";
break;
case 120:
timeLeft = "2 Minutes";
break;
case 60:
timeLeft = "1 Minute";
break;
}
tellPlayers("§7Time Left: §b" + timeLeft);
announced = true;
}
}
private void randomTagged() {
Random r = new Random();
List<String> alive = new ArrayList<>();
getPlayers ().stream().filter(player -> (
(!deadPlayers.contains(GameManager.getPlayer(player).getPlayer().getName()))
&& (!snowmen.contains(GameManager.getPlayer(player).getPlayer().getName())))).forEach(alive::add);
if (alive.size() <= 1) {
onWin(GameManager.getPlayer(alive.get(0)));
onEnd();
plugin.getEventMain().end();
return;
}
int a = r.nextInt(alive.size());
IGamePlayer player = GameManager.getPlayer(alive.get(a));
setSnowman(player);
}
@Override
public void onStart() {
getPlayers().forEach(name -> {
IGamePlayer player = GameManager.getPlayer(name);
player.setTeam(getRedTeam());
getRedTeam().addMember(player, false);
player.getPlayer().teleport(getSpawn(player.getTeam()));
});
super.onStart();
gameSettings = new GameSettings(true);
for (String name : getPlayers ()) {
Player player = GameManager.getPlayer(name).getPlayer();
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cYou have 2 seconds to spread out..."));
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
if (getPlayers ().size() != 0) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', ChatColor.AQUA + "Selecting Snowman..."));
}
}, 120L);
}
new BukkitRunnable() {
@Override
public void run() {
SnowPack.super.onStart();
randomTagged();
ITitleMessage title = Reflection.getTitleMessage();
players.forEach(name -> {
IGamePlayer player = GameManager.getPlayer(name);
if (!snowmen.contains(name)) {
title.sendMessage(player.getPlayer(), 0, 2, 0, "§3Objective:", "§bRun from the Snowmen");
}
});
}
}.runTaskLater(plugin, 130);
}
@Override
public void equipPlayer(Player player) {
equipDefaultPlayer(player);
}
@Override
public void equipDefaultPlayer(Player player) {
player.getInventory().clear();
player.getInventory().setArmorContents(null);
}
@Override
public boolean allowsPVP() {
return true;
}
@EventHandler
public void onHit(EntityDamageByEntityEvent event) {
if (!(event.getDamager() instanceof Player)) return;
if (!(event.getEntity() instanceof Player)) return;
IGamePlayer player = GameManager.getPlayer((Player) event.getEntity());
if (player.isPlaying()) {
if (player.getGame() instanceof SnowPack) {
if (!plugin.getEventMain().eventstarted) {
event.setCancelled(true);
return;
}
if (snowmen.contains(event.getDamager().getName()) && (!snowmen.contains(player.getPlayer().getName()))) {
if (getRedTeam().size() == 1) {
onWin(getBlueTeam());
event.setCancelled(true);
return;
}
setSnowman(player);
}
event.setCancelled(true);
}
}
}
@Override
public void onEnd() {
getPlayers ().forEach(name -> {
IGamePlayer player = GameManager.getPlayer(name);
if (DisguiseHandler.getApi().isDisguised(player.getPlayer()) && snowmen.contains(player.getPlayer().getName())) {
DisguiseHandler.getApi().undisguise(player.getPlayer());
snowmen.remove(player.getPlayer().getName());
}
});
super.onEnd();
}
private void setSnowman (IGamePlayer player) {
player.setTeam(getBlueTeam());
getBlueTeam().addMember(player, false);
getRedTeam().removeMember(player);
snowmen.add(player.getPlayer().getName());
MobDisguise disguise = new MobDisguise(DisguiseType.SNOWMAN);
disguise.setCustomNameVisible(true);
disguise.setCustomName(player.getTeam().getChatColor() + player.getPlayer().getName());
DisguiseHandler.getApi().disguise(player.getPlayer(), disguise);
actionPlayers("§3§l" + player.getPlayer().getName() + " §8§lhas been turned into a Snowman!");
ParticleMaker maker = new ParticleMaker(ParticleMaker.Particle.BLOCK_CRACK, 15, 0.5);
maker.setData(Material.PACKED_ICE);
maker.sendToLocation(player.getPlayer().getEyeLocation());
ITitleMessage title = Reflection.getTitleMessage();
title.sendMessage(player.getPlayer(), 0, 2, 0, "§4Objective:", "§c§lTag all the Runners");
}
@Override
public String[] description() {
return new String[]{
"§f❅ §bSnowPack §f❅",
"§7Don't let the cold get to you...",
"§7or you might turn into one of them..."
};
}
}
|
UTF-8
|
Java
| 10,066 |
java
|
SnowPack.java
|
Java
|
[] | null |
[] |
package events.brainsynder.games.team;
import de.robingrether.idisguise.disguise.DisguiseType;
import de.robingrether.idisguise.disguise.MobDisguise;
import events.brainsynder.key.GameSettings;
import events.brainsynder.key.IGamePlayer;
import events.brainsynder.key.teams.TeamGameMaker;
import events.brainsynder.managers.GameManager;
import events.brainsynder.utils.DisguiseHandler;
import events.brainsynder.utils.RandomRef;
import events.brainsynder.utils.ScoreboardHandler;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.scheduler.BukkitRunnable;
import simple.brainsynder.api.ParticleMaker;
import simple.brainsynder.nms.ITitleMessage;
import simple.brainsynder.utils.Reflection;
import java.util.*;
public class SnowPack extends TeamGameMaker {
private int time = 240, per18 = 0;
private boolean announced = false;
private List<Integer> keyTimes = Arrays.asList(1, 2, 3, 4, 5, 10, 20, 30, 60, 120, 180);
private List<String> snowmen = new ArrayList<>();
public SnowPack(String mapID) {
super(mapID);
randomTeams = false;
}
public SnowPack() {
super();
randomTeams = false;
}
@Override
public String getName() {
return "SnowPack";
}
@Override public void onScoreboardLoad(IGamePlayer player) {
if (player.getScoreHandler() == null) {
ScoreboardHandler handler = new ScoreboardHandler(player.getPlayer().getUniqueId());
handler.setTitle(0, "❅ &bSnowPack &f❅");
handler.setLine(0, 14, "&3Time Left: ", "&b" + RandomRef.formatHHMMSS(time));
LinkedList<String> listed = new LinkedList<>(getPlayers ());
int count = 12;
handler.setLine(0, 13, "&3Players ", "&3In The Event");
while ((listed.peekFirst() != null) && (count >= 8)) {
handler.setLine(0, count, "&3❅ ", "&b" + listed.pollFirst());
count--;
}
if (listed.peekFirst() != null) {
handler.setLineBlank(0, (count - 1));
handler.setLine(0, (count - 2), "&3❅ ", "&bAnd Some More");
}
handler.toggleScoreboard();
player.setScoreHandler(handler);
}
}
@Override public void onScoreboardUpdate(IGamePlayer player) {
if (player.getScoreHandler() != null) {
ScoreboardHandler handler = player.getScoreHandler();
handler.setLine(0, 14, "&3Time Left: ", "&b" + RandomRef.formatHHMMSS(time));
LinkedList<String> listed = new LinkedList<>(getPlayers ());
int count = 12;
handler.setLine(0, 13, "&3Players ", "&3In The Event");
while ((listed.peekFirst() != null) && (count >= 8)) {
handler.setLine(0, count, "&3❅ ", "&b" + listed.pollFirst());
count--;
}
if (listed.peekFirst() != null) {
handler.setLineBlank(0, (count - 1));
handler.setLine(0, (count - 2), "&3❅ ", "&bAnd Some More");
}
}
}
@Override
public void onLeave(IGamePlayer player) {
super.onLeave(player);
if (snowmen.contains(player.getPlayer().getName())) {
if (DisguiseHandler.getApi().isDisguised(player.getPlayer())) {
DisguiseHandler.getApi().undisguise(player.getPlayer());
}
snowmen.remove(player.getPlayer().getName());
if (snowmen.isEmpty()) {
tellPlayers (player.getPlayer().getName() + " has left the game, Selecting a new Snowman...");
randomTagged();
}
}
}
@Override
public void perTick() {
super.perTick();
if (per18 == 18) {
time--;
per18 = 0;
announced = false;
}
per18++;
if (time <= 0) {
if (getRedTeam().size() == 0) {
onWin(getBlueTeam());
}else{
onWin(getRedTeam());
}
return;
}
if (keyTimes.contains(time) && (!announced)) {
String timeLeft = time + " Second(s)";
switch (time) {
case 180:
timeLeft = "3 Minutes";
break;
case 120:
timeLeft = "2 Minutes";
break;
case 60:
timeLeft = "1 Minute";
break;
}
tellPlayers("§7Time Left: §b" + timeLeft);
announced = true;
}
}
private void randomTagged() {
Random r = new Random();
List<String> alive = new ArrayList<>();
getPlayers ().stream().filter(player -> (
(!deadPlayers.contains(GameManager.getPlayer(player).getPlayer().getName()))
&& (!snowmen.contains(GameManager.getPlayer(player).getPlayer().getName())))).forEach(alive::add);
if (alive.size() <= 1) {
onWin(GameManager.getPlayer(alive.get(0)));
onEnd();
plugin.getEventMain().end();
return;
}
int a = r.nextInt(alive.size());
IGamePlayer player = GameManager.getPlayer(alive.get(a));
setSnowman(player);
}
@Override
public void onStart() {
getPlayers().forEach(name -> {
IGamePlayer player = GameManager.getPlayer(name);
player.setTeam(getRedTeam());
getRedTeam().addMember(player, false);
player.getPlayer().teleport(getSpawn(player.getTeam()));
});
super.onStart();
gameSettings = new GameSettings(true);
for (String name : getPlayers ()) {
Player player = GameManager.getPlayer(name).getPlayer();
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cYou have 2 seconds to spread out..."));
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
if (getPlayers ().size() != 0) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', ChatColor.AQUA + "Selecting Snowman..."));
}
}, 120L);
}
new BukkitRunnable() {
@Override
public void run() {
SnowPack.super.onStart();
randomTagged();
ITitleMessage title = Reflection.getTitleMessage();
players.forEach(name -> {
IGamePlayer player = GameManager.getPlayer(name);
if (!snowmen.contains(name)) {
title.sendMessage(player.getPlayer(), 0, 2, 0, "§3Objective:", "§bRun from the Snowmen");
}
});
}
}.runTaskLater(plugin, 130);
}
@Override
public void equipPlayer(Player player) {
equipDefaultPlayer(player);
}
@Override
public void equipDefaultPlayer(Player player) {
player.getInventory().clear();
player.getInventory().setArmorContents(null);
}
@Override
public boolean allowsPVP() {
return true;
}
@EventHandler
public void onHit(EntityDamageByEntityEvent event) {
if (!(event.getDamager() instanceof Player)) return;
if (!(event.getEntity() instanceof Player)) return;
IGamePlayer player = GameManager.getPlayer((Player) event.getEntity());
if (player.isPlaying()) {
if (player.getGame() instanceof SnowPack) {
if (!plugin.getEventMain().eventstarted) {
event.setCancelled(true);
return;
}
if (snowmen.contains(event.getDamager().getName()) && (!snowmen.contains(player.getPlayer().getName()))) {
if (getRedTeam().size() == 1) {
onWin(getBlueTeam());
event.setCancelled(true);
return;
}
setSnowman(player);
}
event.setCancelled(true);
}
}
}
@Override
public void onEnd() {
getPlayers ().forEach(name -> {
IGamePlayer player = GameManager.getPlayer(name);
if (DisguiseHandler.getApi().isDisguised(player.getPlayer()) && snowmen.contains(player.getPlayer().getName())) {
DisguiseHandler.getApi().undisguise(player.getPlayer());
snowmen.remove(player.getPlayer().getName());
}
});
super.onEnd();
}
private void setSnowman (IGamePlayer player) {
player.setTeam(getBlueTeam());
getBlueTeam().addMember(player, false);
getRedTeam().removeMember(player);
snowmen.add(player.getPlayer().getName());
MobDisguise disguise = new MobDisguise(DisguiseType.SNOWMAN);
disguise.setCustomNameVisible(true);
disguise.setCustomName(player.getTeam().getChatColor() + player.getPlayer().getName());
DisguiseHandler.getApi().disguise(player.getPlayer(), disguise);
actionPlayers("§3§l" + player.getPlayer().getName() + " §8§lhas been turned into a Snowman!");
ParticleMaker maker = new ParticleMaker(ParticleMaker.Particle.BLOCK_CRACK, 15, 0.5);
maker.setData(Material.PACKED_ICE);
maker.sendToLocation(player.getPlayer().getEyeLocation());
ITitleMessage title = Reflection.getTitleMessage();
title.sendMessage(player.getPlayer(), 0, 2, 0, "§4Objective:", "§c§lTag all the Runners");
}
@Override
public String[] description() {
return new String[]{
"§f❅ §bSnowPack §f❅",
"§7Don't let the cold get to you...",
"§7or you might turn into one of them..."
};
}
}
| 10,066 | 0.557803 | 0.546442 | 269 | 36.297398 | 27.347836 | 125 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.728625 | false | false |
13
|
fba12de9a0eeeafe6ee4d2a24ad94d87808e3922
| 18,133,351,950,652 |
fde9edd40828cbb7bd1e541d7c6fac99aeb01142
|
/shoppingapp/app/src/main/java/com/example/shoppingapplication/NoteDatabase.java
|
2a8b77394d12a276ed1ce19e4dd837ba6a3d8097
|
[
"Apache-2.0"
] |
permissive
|
Exarchias/shoppingApplication
|
https://github.com/Exarchias/shoppingApplication
|
2387aace77851db85a0c65c9fa6ac5e92a8fee7b
|
c75ca613e22bdb4e69761962d22d7e21cc2fcdd4
|
refs/heads/master
| 2021-01-03T20:24:51.165000 | 2020-03-27T20:44:15 | 2020-03-27T20:44:15 | 240,224,904 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.shoppingapplication;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteDatabase;
//Robert: This is the actual DataBase.
//PLEASE avoid to do any changes in this class, (apart of the hardcoded populations of course)
@Database(entities = {Note.class, User.class, Item.class}, version = 9, exportSchema = false)
public abstract class NoteDatabase extends RoomDatabase {
//Robert: it is a singleton pattern. That means that no second Database can be initiated.
private static NoteDatabase instance;
public abstract NoteDao noteDao();
public abstract UserDao userDao();
public abstract ItemDao itemDao();
public static synchronized NoteDatabase getInstance(Context context) {
if (instance == null) {
instance = Room.databaseBuilder(context.getApplicationContext(),
NoteDatabase.class, "note_database")
.allowMainThreadQueries()
.fallbackToDestructiveMigration()
.addCallback(roomCallback)
.build();
}
return instance;
}
//Robert: This is used for the hardcoded population of the Data Base.
//Now it is used for testing purposes, BUT it will be surely be a Superuser,
//for safety reasons
private static RoomDatabase.Callback roomCallback = new RoomDatabase.Callback() {
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db) {
super.onCreate(db);
new PopulateDbAsyncTask(instance).execute();
}
};
//ASYNC for popylating the data base on creation. Try to avoid changes here.
private static class PopulateDbAsyncTask extends AsyncTask<Void, Void, Void> {
private NoteDao noteDao;
private UserDao userDao;
private ItemDao itemDao;
private PopulateDbAsyncTask(NoteDatabase db) {
noteDao = db.noteDao();
userDao = db.userDao();
itemDao = db.itemDao();
}
@Override
protected Void doInBackground(Void... voids) {
//====== Populate the Data base here with hardcoded items ======================
//==============================================================================
return null;
}
}
}
|
UTF-8
|
Java
| 2,507 |
java
|
NoteDatabase.java
|
Java
|
[
{
"context": "port androidx.sqlite.db.SupportSQLiteDatabase;\n\n//Robert: This is the actual DataBase.\n//PLEASE avoid to d",
"end": 316,
"score": 0.9994078278541565,
"start": 310,
"tag": "NAME",
"value": "Robert"
},
{
"context": " class NoteDatabase extends RoomDatabase {\n\n //Robert: it is a singleton pattern. That means that no se",
"end": 607,
"score": 0.9991797804832458,
"start": 601,
"tag": "NAME",
"value": "Robert"
},
{
"context": ";\n }\n return instance;\n }\n\n //Robert: This is used for the hardcoded population of the",
"end": 1322,
"score": 0.9991140365600586,
"start": 1316,
"tag": "NAME",
"value": "Robert"
}
] | null |
[] |
package com.example.shoppingapplication;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteDatabase;
//Robert: This is the actual DataBase.
//PLEASE avoid to do any changes in this class, (apart of the hardcoded populations of course)
@Database(entities = {Note.class, User.class, Item.class}, version = 9, exportSchema = false)
public abstract class NoteDatabase extends RoomDatabase {
//Robert: it is a singleton pattern. That means that no second Database can be initiated.
private static NoteDatabase instance;
public abstract NoteDao noteDao();
public abstract UserDao userDao();
public abstract ItemDao itemDao();
public static synchronized NoteDatabase getInstance(Context context) {
if (instance == null) {
instance = Room.databaseBuilder(context.getApplicationContext(),
NoteDatabase.class, "note_database")
.allowMainThreadQueries()
.fallbackToDestructiveMigration()
.addCallback(roomCallback)
.build();
}
return instance;
}
//Robert: This is used for the hardcoded population of the Data Base.
//Now it is used for testing purposes, BUT it will be surely be a Superuser,
//for safety reasons
private static RoomDatabase.Callback roomCallback = new RoomDatabase.Callback() {
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db) {
super.onCreate(db);
new PopulateDbAsyncTask(instance).execute();
}
};
//ASYNC for popylating the data base on creation. Try to avoid changes here.
private static class PopulateDbAsyncTask extends AsyncTask<Void, Void, Void> {
private NoteDao noteDao;
private UserDao userDao;
private ItemDao itemDao;
private PopulateDbAsyncTask(NoteDatabase db) {
noteDao = db.noteDao();
userDao = db.userDao();
itemDao = db.itemDao();
}
@Override
protected Void doInBackground(Void... voids) {
//====== Populate the Data base here with hardcoded items ======================
//==============================================================================
return null;
}
}
}
| 2,507 | 0.636219 | 0.63582 | 68 | 35.882355 | 28.500015 | 94 | false | false | 0 | 0 | 0 | 0 | 81 | 0.03231 | 0.529412 | false | false |
13
|
97083c8bdacf8803de92740f7ddedf9c7dc9b02a
| 20,581,483,331,887 |
1026848db858991c4746e3f61f2b97747320cd86
|
/common/src/main/java/AuthResult.java
|
4eb7ed0166b0de40d1040acb7bf46bdf4f08f9b5
|
[] |
no_license
|
PavelTikhonov/cloudStorage
|
https://github.com/PavelTikhonov/cloudStorage
|
3d196d58e57c8f476dc7a4a43cd1cf81e1a64106
|
f706f7dc7e5a5794051f7bed55375cd7b06448c5
|
refs/heads/master
| 2020-06-19T11:55:00.852000 | 2019-07-21T15:21:01 | 2019-07-21T15:21:01 | 196,697,988 | 0 | 0 | null | false | 2019-10-31T02:14:10 | 2019-07-13T08:30:41 | 2019-07-25T20:47:25 | 2019-10-31T02:14:07 | 79 | 0 | 0 | 2 |
Java
| false | false |
public class AuthResult extends AbstractMessage {
private String result;
public AuthResult(String result) {
this.result = result;
}
public String getResult() {
return result;
}
}
|
UTF-8
|
Java
| 217 |
java
|
AuthResult.java
|
Java
|
[] | null |
[] |
public class AuthResult extends AbstractMessage {
private String result;
public AuthResult(String result) {
this.result = result;
}
public String getResult() {
return result;
}
}
| 217 | 0.640553 | 0.640553 | 11 | 18.727272 | 16.514957 | 49 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | false | false |
13
|
b3795070aa442d634db3857dbcc00b93fe2768ad
| 1,924,145,385,984 |
98eab43f7c89f9bcf750133e109e5e9ca18b1d1f
|
/src/main/java/br/jus/cnj/service/SecurityService.java
|
6cabfc931ad9f6d9f728fd254b395dbcb02ddd0d
|
[] |
no_license
|
welder496/SpringTiles
|
https://github.com/welder496/SpringTiles
|
f549cd58f1395ed628f03e723cf767804f60919d
|
7f2a5bcdf3e6d2e36389c5643a53d58e6bd296a4
|
refs/heads/master
| 2020-12-25T09:08:56.256000 | 2016-07-27T14:10:31 | 2016-07-27T14:10:31 | 63,269,964 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.jus.cnj.service;
import java.util.HashSet;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.session.SessionInformation;
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
@Service
public class SecurityService {
HashSet<User> userList = new HashSet<User>();
@Autowired
@Qualifier("sessionRegistry")
private SessionRegistry sessionRegistry;
public 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;
}
public void getCurrentUser(String usuario){
SecurityContext ctx = SecurityContextHolder.getContext();
List<Object> principals = sessionRegistry.getAllPrincipals();
for (Object principal: principals){
if (principal instanceof User){
userList.add((User)principal);
}
}
for (User user: userList){
if (user.getUsername().equals(usuario)) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user.getUsername(),user.getPassword(),user.getAuthorities());
ctx.setAuthentication(authentication);
}
}
}
public void expireUserSessions(String usuario){
for (Object principal: sessionRegistry.getAllPrincipals()){
if (principal instanceof User){
UserDetails userDetails = (UserDetails) principal;
if (userDetails.getUsername().equals(usuario)){
for (SessionInformation information: sessionRegistry.getAllSessions(userDetails, true)){
userList.remove((User)principal);
information.expireNow();
}
}
}
}
}
}
|
UTF-8
|
Java
| 2,273 |
java
|
SecurityService.java
|
Java
|
[] | null |
[] |
package br.jus.cnj.service;
import java.util.HashSet;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.session.SessionInformation;
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
@Service
public class SecurityService {
HashSet<User> userList = new HashSet<User>();
@Autowired
@Qualifier("sessionRegistry")
private SessionRegistry sessionRegistry;
public 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;
}
public void getCurrentUser(String usuario){
SecurityContext ctx = SecurityContextHolder.getContext();
List<Object> principals = sessionRegistry.getAllPrincipals();
for (Object principal: principals){
if (principal instanceof User){
userList.add((User)principal);
}
}
for (User user: userList){
if (user.getUsername().equals(usuario)) {
UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user.getUsername(),user.getPassword(),user.getAuthorities());
ctx.setAuthentication(authentication);
}
}
}
public void expireUserSessions(String usuario){
for (Object principal: sessionRegistry.getAllPrincipals()){
if (principal instanceof User){
UserDetails userDetails = (UserDetails) principal;
if (userDetails.getUsername().equals(usuario)){
for (SessionInformation information: sessionRegistry.getAllSessions(userDetails, true)){
userList.remove((User)principal);
information.expireNow();
}
}
}
}
}
}
| 2,273 | 0.773867 | 0.773867 | 70 | 31.471428 | 30.250252 | 158 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.228571 | false | false |
13
|
cc39b16055c947f221f4b616ebd21b8e599b4642
| 26,053,271,644,510 |
1fd531bf5c69578471c4628c021a8d6831c93d53
|
/MeetYouUpV11/app/src/main/java/com/example/andrei/meetyouupv11/model/Profile.java
|
25daa32639157df5baaab929301c739f0ea9ba17
|
[] |
no_license
|
Shliferd/MeetYouUp11
|
https://github.com/Shliferd/MeetYouUp11
|
8da6a470cbd56f4870daca9cc32836267076dace
|
0d98e6cc93fd5e416b6722c1480eba68734f08dc
|
refs/heads/master
| 2020-03-18T01:49:59.909000 | 2018-07-04T17:49:44 | 2018-07-04T17:49:44 | 134,161,769 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.andrei.meetyouupv11.model;
import java.util.ArrayList;
import java.util.List;
public class Profile {
private String userId;
private String name;
private String keyWords;
private String dateOfBirth;
private String profileDescription;
private String profilePictureUrl;
private List<String> listOfGroups = new ArrayList<>();
private List<String> listOfEvents = new ArrayList<>();
private List<String> pendingEvents = new ArrayList<>();
private List<String> declinedEvents = new ArrayList<>();
public Profile() {
}
public Profile(String userId, String name, String keyWords, String dateOfBirth, String profileDescription, String profilePictureUrl) {
this.userId = userId;
this.name = name;
this.keyWords = keyWords;
this.dateOfBirth = dateOfBirth;
this.profileDescription = profileDescription;
this.profilePictureUrl = profilePictureUrl;
this.addGroup("None");
this.addEventsAttendance("None");
this.addToPendingEventsList("None");
this.addDeclinedEvent("None");
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKeyWords() {
return keyWords;
}
public void setKeyWords(String keyWords) {
this.keyWords = keyWords;
}
public String getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(String dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public String getProfileDescription() {
return profileDescription;
}
public void setProfileDescription(String profileDescription) {
this.profileDescription = profileDescription;
}
public String getProfilePictureUrl() {
return profilePictureUrl;
}
public void setProfilePictureUrl(String profilePictureUrl) {
this.profilePictureUrl = profilePictureUrl;
}
public List<String> getListOfGroups() {
return listOfGroups;
}
public void setListOfGroups(List<String> listOfGroups) {
this.listOfGroups = listOfGroups;
}
public List<String> getListOfEvents() {
return listOfEvents;
}
public void setListOfEvents(List<String> listOfEvents) {
this.listOfEvents = listOfEvents;
}
public List<String> getPendingEvents() {
return pendingEvents;
}
public void setPendingEvents(List<String> pendingEvents) {
this.pendingEvents = pendingEvents;
}
public List<String> getDeclinedEvents() {
return declinedEvents;
}
public void setDeclinedEvents(List<String> declinedEvents) {
this.declinedEvents = declinedEvents;
}
public void addEventsAttendance(String eventId) {
if (this.listOfEvents.isEmpty()) {
this.listOfEvents.add(eventId);
} else if (this.listOfEvents.get(0).equals("None")) {
this.listOfEvents.clear();
this.listOfEvents.add(eventId);
} else if (!eventId.equals("None")) {
this.listOfEvents.add(eventId);
}
}
public void addToPendingEventsList(String eventId) {
if (this.pendingEvents.isEmpty()) {
this.pendingEvents.add(eventId);
} else if (this.pendingEvents.get(0).equals("None")) {
this.pendingEvents.clear();
this.pendingEvents.add(eventId);
} else if (!eventId.equals("None")) {
this.pendingEvents.add(eventId);
}
}
public void addDeclinedEvent(String eventId) {
if (this.declinedEvents.isEmpty()) {
this.declinedEvents.add(eventId);
} else if (this.declinedEvents.get(0).equals("None")) {
this.declinedEvents.clear();
this.declinedEvents.add(eventId);
} else if (!eventId.equals("None")) {
this.declinedEvents.add(eventId);
}
}
public void addGroup(String groupId) {
if (this.listOfGroups.isEmpty()) {
this.listOfGroups.add(groupId);
} else if (this.listOfGroups.get(0).equals("None")) {
this.listOfGroups.clear();
this.listOfGroups.add(groupId);
} else if (!groupId.equals("None")) {
this.listOfGroups.add(groupId);
}
}
public void removeFromDeclinedEvents(String eventId) {
if (this.getDeclinedEvents().contains(eventId)) {
this.declinedEvents.remove(eventId);
if (declinedEvents.isEmpty()) {
this.declinedEvents.add("None");
}
}
}
public void removeFromPendingEvents(String eventId) {
if (this.getPendingEvents().contains(eventId)) {
this.pendingEvents.remove(eventId);
if (pendingEvents.isEmpty()) {
this.pendingEvents.add("None");
}
}
}
public void removeFromlistOfEvents(String eventId) {
if (this.getPendingEvents().contains(eventId)) {
this.listOfEvents.remove(eventId);
if (listOfEvents.isEmpty()) {
this.listOfEvents.add("None");
}
}
}
public void removeFromlistOfGroups(String eventId) {
if (this.getListOfGroups().contains(eventId)) {
this.listOfGroups.remove(eventId);
if (listOfGroups.isEmpty()) {
this.listOfGroups.add("None");
}
}
}
}
|
UTF-8
|
Java
| 5,637 |
java
|
Profile.java
|
Java
|
[
{
"context": "package com.example.andrei.meetyouupv11.model;\n\nimport java.util.ArrayList;\n",
"end": 26,
"score": 0.8873092532157898,
"start": 20,
"tag": "USERNAME",
"value": "andrei"
}
] | null |
[] |
package com.example.andrei.meetyouupv11.model;
import java.util.ArrayList;
import java.util.List;
public class Profile {
private String userId;
private String name;
private String keyWords;
private String dateOfBirth;
private String profileDescription;
private String profilePictureUrl;
private List<String> listOfGroups = new ArrayList<>();
private List<String> listOfEvents = new ArrayList<>();
private List<String> pendingEvents = new ArrayList<>();
private List<String> declinedEvents = new ArrayList<>();
public Profile() {
}
public Profile(String userId, String name, String keyWords, String dateOfBirth, String profileDescription, String profilePictureUrl) {
this.userId = userId;
this.name = name;
this.keyWords = keyWords;
this.dateOfBirth = dateOfBirth;
this.profileDescription = profileDescription;
this.profilePictureUrl = profilePictureUrl;
this.addGroup("None");
this.addEventsAttendance("None");
this.addToPendingEventsList("None");
this.addDeclinedEvent("None");
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getKeyWords() {
return keyWords;
}
public void setKeyWords(String keyWords) {
this.keyWords = keyWords;
}
public String getDateOfBirth() {
return dateOfBirth;
}
public void setDateOfBirth(String dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public String getProfileDescription() {
return profileDescription;
}
public void setProfileDescription(String profileDescription) {
this.profileDescription = profileDescription;
}
public String getProfilePictureUrl() {
return profilePictureUrl;
}
public void setProfilePictureUrl(String profilePictureUrl) {
this.profilePictureUrl = profilePictureUrl;
}
public List<String> getListOfGroups() {
return listOfGroups;
}
public void setListOfGroups(List<String> listOfGroups) {
this.listOfGroups = listOfGroups;
}
public List<String> getListOfEvents() {
return listOfEvents;
}
public void setListOfEvents(List<String> listOfEvents) {
this.listOfEvents = listOfEvents;
}
public List<String> getPendingEvents() {
return pendingEvents;
}
public void setPendingEvents(List<String> pendingEvents) {
this.pendingEvents = pendingEvents;
}
public List<String> getDeclinedEvents() {
return declinedEvents;
}
public void setDeclinedEvents(List<String> declinedEvents) {
this.declinedEvents = declinedEvents;
}
public void addEventsAttendance(String eventId) {
if (this.listOfEvents.isEmpty()) {
this.listOfEvents.add(eventId);
} else if (this.listOfEvents.get(0).equals("None")) {
this.listOfEvents.clear();
this.listOfEvents.add(eventId);
} else if (!eventId.equals("None")) {
this.listOfEvents.add(eventId);
}
}
public void addToPendingEventsList(String eventId) {
if (this.pendingEvents.isEmpty()) {
this.pendingEvents.add(eventId);
} else if (this.pendingEvents.get(0).equals("None")) {
this.pendingEvents.clear();
this.pendingEvents.add(eventId);
} else if (!eventId.equals("None")) {
this.pendingEvents.add(eventId);
}
}
public void addDeclinedEvent(String eventId) {
if (this.declinedEvents.isEmpty()) {
this.declinedEvents.add(eventId);
} else if (this.declinedEvents.get(0).equals("None")) {
this.declinedEvents.clear();
this.declinedEvents.add(eventId);
} else if (!eventId.equals("None")) {
this.declinedEvents.add(eventId);
}
}
public void addGroup(String groupId) {
if (this.listOfGroups.isEmpty()) {
this.listOfGroups.add(groupId);
} else if (this.listOfGroups.get(0).equals("None")) {
this.listOfGroups.clear();
this.listOfGroups.add(groupId);
} else if (!groupId.equals("None")) {
this.listOfGroups.add(groupId);
}
}
public void removeFromDeclinedEvents(String eventId) {
if (this.getDeclinedEvents().contains(eventId)) {
this.declinedEvents.remove(eventId);
if (declinedEvents.isEmpty()) {
this.declinedEvents.add("None");
}
}
}
public void removeFromPendingEvents(String eventId) {
if (this.getPendingEvents().contains(eventId)) {
this.pendingEvents.remove(eventId);
if (pendingEvents.isEmpty()) {
this.pendingEvents.add("None");
}
}
}
public void removeFromlistOfEvents(String eventId) {
if (this.getPendingEvents().contains(eventId)) {
this.listOfEvents.remove(eventId);
if (listOfEvents.isEmpty()) {
this.listOfEvents.add("None");
}
}
}
public void removeFromlistOfGroups(String eventId) {
if (this.getListOfGroups().contains(eventId)) {
this.listOfGroups.remove(eventId);
if (listOfGroups.isEmpty()) {
this.listOfGroups.add("None");
}
}
}
}
| 5,637 | 0.618059 | 0.616995 | 194 | 28.056702 | 22.598282 | 138 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.371134 | false | false |
13
|
6cd089f5933d1e965331d1305883448656c12fd6
| 11,845,519,827,212 |
a5b43123d91d23581ae1f1cc725d7b004a4caa25
|
/java/LongestConsec.java
|
58751604c9a3ea2aa4d0f9fdc6cbaea56828473d
|
[] |
no_license
|
ivan570/code
|
https://github.com/ivan570/code
|
376001416a01f0a870a0d73796f1a61dd3bfe958
|
e5a8e9bf7c9ea27b070ca3f351bb54cb16ce0317
|
refs/heads/main
| 2023-05-23T04:48:30.477000 | 2021-06-11T15:50:30 | 2021-06-11T15:50:30 | 330,686,610 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
class LongestConsec {
public static String longestConsec(String[] strarr, int k) {
String str = "";
for(int i = 0;i < strarr.length - k;i++) {
String temp = "";
for(int n = 0;n < k;n++) {
temp += strarr[i+n];
}
if( temp.length() > str.length() )
str = temp;
}
return str;
}
public static void main(String[] args) {
String str[] = {"wlwsasphmxx","owiaxujylentrklctozmymu","wpgozvxxiu"};
System.out.println(longestConsec(str, 2));
}
}
|
UTF-8
|
Java
| 539 |
java
|
LongestConsec.java
|
Java
|
[] | null |
[] |
class LongestConsec {
public static String longestConsec(String[] strarr, int k) {
String str = "";
for(int i = 0;i < strarr.length - k;i++) {
String temp = "";
for(int n = 0;n < k;n++) {
temp += strarr[i+n];
}
if( temp.length() > str.length() )
str = temp;
}
return str;
}
public static void main(String[] args) {
String str[] = {"wlwsasphmxx","owiaxujylentrklctozmymu","wpgozvxxiu"};
System.out.println(longestConsec(str, 2));
}
}
| 539 | 0.525046 | 0.519481 | 19 | 27.421053 | 20.463873 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.526316 | false | false |
13
|
8c016d1795eb5710f9e69976e07ce4e133917018
| 8,108,898,319,996 |
cd2d295fee9d65f2a86d3a6700485def6cfeebe9
|
/Bayu/Juli-20-2018/AvengersBudgetPlan.java
|
d99127252c8d836c891a2105ef3132baa28cdb81
|
[] |
no_license
|
Padepokan79/BootcampG8
|
https://github.com/Padepokan79/BootcampG8
|
e6c44b07a3f112ca2269ceb9bf24ac182648de17
|
4bdc87461b83bcb9c0888ca7f9b758e4bb668905
|
refs/heads/master
| 2020-03-23T09:45:00.739000 | 2018-09-10T01:03:23 | 2018-09-10T01:03:23 | 141,406,266 | 0 | 0 | null | false | 2018-09-10T01:03:15 | 2018-07-18T08:39:19 | 2018-09-10T01:03:04 | 2018-09-10T01:03:15 | 379 | 0 | 0 | 1 |
Java
| false | null |
import static java.lang.System.*;
import java.util.Scanner;
public class AvengersBudgetPlan {
public static void main( String[] args ) {
Scanner keyboard = new Scanner(System.in);
Double performScale ;
String hero ;
System.out.println( "===========================" );
System.out.println( "Avengers Bugdet Plan 2050" );
System.out.print( "Masukan nama pahlawan : " );
hero = keyboard.next();
System.out.print( "Masukan skala performa (0.0-10.0) : " );
performScale = keyboard.nextDouble();
if ( performScale < 3)
out.println( "Anda, " +hero+ " tidak mendapatkan apa-apa, denda $ 1.000 ");
else if ( performScale > 3 && performScale <= 5)
out.println( "Anda, " +hero+ " mendapat dana sebesar 30% dari dana yang diajukan");
else if ( performScale > 5 && performScale <= 7)
out.println( "Anda, " +hero+ " mendapat dana sebesar 50% dari dana yang diajukan");
else if ( performScale > 7 && performScale <= 9)
out.println( "Anda, " +hero+ " mendapat dana sebesar 75% dari dana yang diajukan");
else if ( performScale > 9 && performScale <= 10)
out.println( "Anda, " +hero+ " mendapat 100% dana");
else
out.print( "Sorry, RAB tidak mencukupi");
}
}
|
UTF-8
|
Java
| 1,196 |
java
|
AvengersBudgetPlan.java
|
Java
|
[] | null |
[] |
import static java.lang.System.*;
import java.util.Scanner;
public class AvengersBudgetPlan {
public static void main( String[] args ) {
Scanner keyboard = new Scanner(System.in);
Double performScale ;
String hero ;
System.out.println( "===========================" );
System.out.println( "Avengers Bugdet Plan 2050" );
System.out.print( "Masukan nama pahlawan : " );
hero = keyboard.next();
System.out.print( "Masukan skala performa (0.0-10.0) : " );
performScale = keyboard.nextDouble();
if ( performScale < 3)
out.println( "Anda, " +hero+ " tidak mendapatkan apa-apa, denda $ 1.000 ");
else if ( performScale > 3 && performScale <= 5)
out.println( "Anda, " +hero+ " mendapat dana sebesar 30% dari dana yang diajukan");
else if ( performScale > 5 && performScale <= 7)
out.println( "Anda, " +hero+ " mendapat dana sebesar 50% dari dana yang diajukan");
else if ( performScale > 7 && performScale <= 9)
out.println( "Anda, " +hero+ " mendapat dana sebesar 75% dari dana yang diajukan");
else if ( performScale > 9 && performScale <= 10)
out.println( "Anda, " +hero+ " mendapat 100% dana");
else
out.print( "Sorry, RAB tidak mencukupi");
}
}
| 1,196 | 0.648829 | 0.622074 | 30 | 38.900002 | 25.683134 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.533333 | false | false |
13
|
2423335e61993fe918e4bed06050626219df0857
| 8,108,898,318,052 |
d1dd708d37b5a590d2142381c2c73bde0f4734a6
|
/Demo2/src/ScriptHelper/InventoryListingHelper.java
|
1353fdb2283900a2cd1627bcccb13b2b0b50d719
|
[] |
no_license
|
ashwani360/Demo
|
https://github.com/ashwani360/Demo
|
9958dc90cd4bd2cf55d68aa154cafc6ec745f1e5
|
fd60272baf927373a32489bebd7ddac40163744a
|
refs/heads/master
| 2020-03-25T22:08:52.982000 | 2018-08-09T22:12:13 | 2018-08-09T22:12:13 | 144,207,846 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ScriptHelper;
import java.io.IOException;
import org.dom4j.DocumentException;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import Driver.DriverHelper;
import Driver.xmlreader;
public class InventoryListingHelper extends DriverHelper{
WebElement el;
xmlreader xml=new xmlreader("C:\\Users\\ashwanis\\eclipse-workspace\\Demo2\\src\\Locators\\Inventorylisting.xml");
public InventoryListingHelper(WebDriver parentdriver)
{
super(parentdriver);
}
public void VerifyListing(String result) throws Exception, Exception
{
Thread.sleep(3000);
Assert.assertEquals(result, Gettext(getwebelement(xml.getlocator("//locators/Name"))));
}
public void ViewLive() throws Exception
{
Clickon(getwebelement(xml.getlocator("//locators/ViewLive")));
}
}
|
UTF-8
|
Java
| 903 |
java
|
InventoryListingHelper.java
|
Java
|
[
{
"context": "ent el;\r\n\txmlreader xml=new xmlreader(\"C:\\\\Users\\\\ashwanis\\\\eclipse-workspace\\\\Demo2\\\\src\\\\Locators\\\\Invento",
"end": 426,
"score": 0.9222109913825989,
"start": 418,
"tag": "USERNAME",
"value": "ashwanis"
}
] | null |
[] |
package ScriptHelper;
import java.io.IOException;
import org.dom4j.DocumentException;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.testng.Assert;
import Driver.DriverHelper;
import Driver.xmlreader;
public class InventoryListingHelper extends DriverHelper{
WebElement el;
xmlreader xml=new xmlreader("C:\\Users\\ashwanis\\eclipse-workspace\\Demo2\\src\\Locators\\Inventorylisting.xml");
public InventoryListingHelper(WebDriver parentdriver)
{
super(parentdriver);
}
public void VerifyListing(String result) throws Exception, Exception
{
Thread.sleep(3000);
Assert.assertEquals(result, Gettext(getwebelement(xml.getlocator("//locators/Name"))));
}
public void ViewLive() throws Exception
{
Clickon(getwebelement(xml.getlocator("//locators/ViewLive")));
}
}
| 903 | 0.747508 | 0.740864 | 36 | 23.083334 | 27.854158 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.166667 | false | false |
13
|
b4f1718d77dec1fec26007239b022a12dfdbf9c5
| 15,066,745,276,614 |
a0660812be22a1ce5ae4e4f2a32102d2290f127e
|
/app/src/main/java/com/example/mehrbod/a250movies/RankResultActivitySecondThread.java
|
f2053e9ec1b720baf5c8f6aac8389c3da5ef8c00
|
[] |
no_license
|
mehrbodkh/250Movies
|
https://github.com/mehrbodkh/250Movies
|
2d67af8b838b170faccf5936cdc7fc12e5f184c0
|
09813cccdfd807bcd7e5df6e53f84637fc459990
|
refs/heads/master
| 2020-12-02T06:43:32.324000 | 2017-07-11T11:51:54 | 2017-07-11T11:51:54 | 96,887,670 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.mehrbod.a250movies;
import android.app.Activity;
import android.database.Cursor;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
* Created by Mehrbod on 5/31/2017.
*/
public class RankResultActivitySecondThread implements Runnable {
private Activity activity;
private DataBaseHelper movieDB;
public String finalRes;
public RankResultActivitySecondThread(Activity activity) {
this.activity = activity;
movieDB = new DataBaseHelper(activity);
}
@Override
public void run() {
String movieRank = activity.getIntent().getStringExtra("movieRank");
String movieName = activity.getIntent().getStringExtra("movieName");
Cursor checkCursor = movieDB.getData(movieRank);
checkCursor.moveToNext();
String checkStarts = checkCursor.getString(2);
if (checkStarts.equals("")) {
Log.d("Entered", "checkStarts");
ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(new WikiHtmlFileCreator(activity, movieName, movieRank));
executorService.shutdown();
boolean isTerminated = false;
try {
isTerminated = executorService.awaitTermination(60, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (isTerminated) {
Log.d("Entered", "isTerminated");
boolean readIsNeeded = false;
Cursor cursor = movieDB.getData(movieRank);
cursor.moveToNext();
if (cursor.getString(2).equals("")) {
readIsNeeded = true;
}
String res[] = null;
finalRes = null;
if (readIsNeeded) {
res = makeList();
movieDB.updateData(movieRank, movieName, res[0], res[1], res[2], res[3], res[4], res[5]);
finalRes =
"Rank: " + movieRank + "\n" + "Title: " + movieName + "\n" + "Stars: " + res[0] + "\n" +
"Writers: " + res[1] + "\n" + "Music: " + res[2] + "\n" + "Producers: " +
res[3] + "\n" + "Director: " + res[4] + "\n";
} else {
finalRes =
"Rank: " + movieRank + "\n" + "Title: " + movieName + "\n" + "Stars: " + cursor.getString(2) + "\n" +
"Writers: " + cursor.getString(3) + "\n" + "Music: " + cursor.getString(4) + "\n" + "Producers: " +
cursor.getString(5) + "\n" + "Director: " + cursor.getString(6) + "\n";
}
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
ProgressBar progressBar = (ProgressBar) activity.findViewById(R.id.progressBarRankResultActivity);
ViewGroup viewGroup = (ViewGroup) progressBar.getParent();
viewGroup.removeView(progressBar);
TextView textView = (TextView) activity.findViewById(R.id.textViewRankResultActivity);
textView.setText(RankResultActivitySecondThread.this.finalRes);
}
});
}
}
else {
finalRes =
"Rank: " + movieRank + "\n" + "Title: " + movieName + "\n" + "Stars: " + checkCursor.getString(2) + "\n" +
"Writers: " + checkCursor.getString(3) + "\n" + "Music: " + checkCursor.getString(4) + "\n" + "Producers: " +
checkCursor.getString(5) + "\n" + "Director: " + checkCursor.getString(6) + "\n";
activity.runOnUiThread(new Runnable() {
@Override
public void run() {ProgressBar progressBar = (ProgressBar) activity.findViewById(R.id.progressBarRankResultActivity);
ViewGroup viewGroup = (ViewGroup) progressBar.getParent();
viewGroup.removeView(progressBar);
TextView textView = (TextView) activity.findViewById(R.id.textViewRankResultActivity);
textView.setText(RankResultActivitySecondThread.this.finalRes);
}
});
}
}
private String[] makeList() {
ArrayList<String> director = new ArrayList<>();
ArrayList<String> producer = new ArrayList<>();
ArrayList<String> writer = new ArrayList<>();
ArrayList<String> stars = new ArrayList<>();
ArrayList<String> music = new ArrayList<>();
String year = null;
String[] result = new String[6];
try {
InputStream inputStream = activity.openFileInput("movieFile.txt");
Scanner inputFile = new Scanner(inputStream);
// to-do: read the file and extract the data from it
String directorTemp = "";
String producerTemp = "";
String writerTemp = "";
String starsTemp = "";
String musicTemp = "";
while (inputFile.hasNextLine()) {
String temp = inputFile.nextLine();
if (temp.contains("<th scope=\"row\" style=\"white-" +
"space:nowrap;padding-right:0.65em;\">Directed by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
directorTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
director.add(directorTemp);
directorTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
directorTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
director.add(directorTemp);
directorTemp = "";
}
}
if (temp.contains("<th scope=\"row\" " +
"style=\"white-space:nowrap;padding-right:0.65em;\">Produced by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
producerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
producer.add(producerTemp);
producerTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
producerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
producer.add(producerTemp);
producerTemp = "";
}
}
if (temp.contains("<th scope=\"row\" style=\"white-space:" +
"nowrap;padding-right:0.65em;\">Screenplay by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
writerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
writer.add(writerTemp);
writerTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
writerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
writer.add(writerTemp);
writerTemp = "";
}
}
if (temp.contains("<th scope=\"row\" style=\"white-space:" +
"nowrap;padding-right:0.65em;\">Starring</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
starsTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
stars.add(starsTemp);
starsTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
starsTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
stars.add(starsTemp);
starsTemp = "";
}
}
if (temp.contains("<th scope=\"row\" style=\"white-space:" +
"nowrap;padding-right:0.65em;\">Music by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
musicTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
music.add(musicTemp);
musicTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
musicTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
music.add(musicTemp);
musicTemp = "";
}
}
}
result[0] = rowToString(stars);
result[1] = rowToString(writer);
result[2] = rowToString(music);
result[3] = rowToString(producer);
result[4] = rowToString(director);
result[5] = year;
} catch (FileNotFoundException e) {
e.printStackTrace();
}
return result;
}
private String rowToString(ArrayList<String> list) {
String resultString = "";
if (list.size() > 1) {
for (int i = 0; i < list.size() - 1; i++) {
resultString += list.get(i) + ", ";
}
resultString += list.get(list.size() - 1);
}else if (list.size() == 1){
resultString += list.get(0);
}
return resultString;
}
}
|
UTF-8
|
Java
| 17,526 |
java
|
RankResultActivitySecondThread.java
|
Java
|
[
{
"context": " java.util.concurrent.TimeUnit;\n\n/**\n * Created by Mehrbod on 5/31/2017.\n */\n\npublic class RankResultActivit",
"end": 494,
"score": 0.9967171549797058,
"start": 487,
"tag": "USERNAME",
"value": "Mehrbod"
}
] | null |
[] |
package com.example.mehrbod.a250movies;
import android.app.Activity;
import android.database.Cursor;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
* Created by Mehrbod on 5/31/2017.
*/
public class RankResultActivitySecondThread implements Runnable {
private Activity activity;
private DataBaseHelper movieDB;
public String finalRes;
public RankResultActivitySecondThread(Activity activity) {
this.activity = activity;
movieDB = new DataBaseHelper(activity);
}
@Override
public void run() {
String movieRank = activity.getIntent().getStringExtra("movieRank");
String movieName = activity.getIntent().getStringExtra("movieName");
Cursor checkCursor = movieDB.getData(movieRank);
checkCursor.moveToNext();
String checkStarts = checkCursor.getString(2);
if (checkStarts.equals("")) {
Log.d("Entered", "checkStarts");
ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(new WikiHtmlFileCreator(activity, movieName, movieRank));
executorService.shutdown();
boolean isTerminated = false;
try {
isTerminated = executorService.awaitTermination(60, TimeUnit.SECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (isTerminated) {
Log.d("Entered", "isTerminated");
boolean readIsNeeded = false;
Cursor cursor = movieDB.getData(movieRank);
cursor.moveToNext();
if (cursor.getString(2).equals("")) {
readIsNeeded = true;
}
String res[] = null;
finalRes = null;
if (readIsNeeded) {
res = makeList();
movieDB.updateData(movieRank, movieName, res[0], res[1], res[2], res[3], res[4], res[5]);
finalRes =
"Rank: " + movieRank + "\n" + "Title: " + movieName + "\n" + "Stars: " + res[0] + "\n" +
"Writers: " + res[1] + "\n" + "Music: " + res[2] + "\n" + "Producers: " +
res[3] + "\n" + "Director: " + res[4] + "\n";
} else {
finalRes =
"Rank: " + movieRank + "\n" + "Title: " + movieName + "\n" + "Stars: " + cursor.getString(2) + "\n" +
"Writers: " + cursor.getString(3) + "\n" + "Music: " + cursor.getString(4) + "\n" + "Producers: " +
cursor.getString(5) + "\n" + "Director: " + cursor.getString(6) + "\n";
}
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
ProgressBar progressBar = (ProgressBar) activity.findViewById(R.id.progressBarRankResultActivity);
ViewGroup viewGroup = (ViewGroup) progressBar.getParent();
viewGroup.removeView(progressBar);
TextView textView = (TextView) activity.findViewById(R.id.textViewRankResultActivity);
textView.setText(RankResultActivitySecondThread.this.finalRes);
}
});
}
}
else {
finalRes =
"Rank: " + movieRank + "\n" + "Title: " + movieName + "\n" + "Stars: " + checkCursor.getString(2) + "\n" +
"Writers: " + checkCursor.getString(3) + "\n" + "Music: " + checkCursor.getString(4) + "\n" + "Producers: " +
checkCursor.getString(5) + "\n" + "Director: " + checkCursor.getString(6) + "\n";
activity.runOnUiThread(new Runnable() {
@Override
public void run() {ProgressBar progressBar = (ProgressBar) activity.findViewById(R.id.progressBarRankResultActivity);
ViewGroup viewGroup = (ViewGroup) progressBar.getParent();
viewGroup.removeView(progressBar);
TextView textView = (TextView) activity.findViewById(R.id.textViewRankResultActivity);
textView.setText(RankResultActivitySecondThread.this.finalRes);
}
});
}
}
private String[] makeList() {
ArrayList<String> director = new ArrayList<>();
ArrayList<String> producer = new ArrayList<>();
ArrayList<String> writer = new ArrayList<>();
ArrayList<String> stars = new ArrayList<>();
ArrayList<String> music = new ArrayList<>();
String year = null;
String[] result = new String[6];
try {
InputStream inputStream = activity.openFileInput("movieFile.txt");
Scanner inputFile = new Scanner(inputStream);
// to-do: read the file and extract the data from it
String directorTemp = "";
String producerTemp = "";
String writerTemp = "";
String starsTemp = "";
String musicTemp = "";
while (inputFile.hasNextLine()) {
String temp = inputFile.nextLine();
if (temp.contains("<th scope=\"row\" style=\"white-" +
"space:nowrap;padding-right:0.65em;\">Directed by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
directorTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
director.add(directorTemp);
directorTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
directorTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
director.add(directorTemp);
directorTemp = "";
}
}
if (temp.contains("<th scope=\"row\" " +
"style=\"white-space:nowrap;padding-right:0.65em;\">Produced by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
producerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
producer.add(producerTemp);
producerTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
producerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
producer.add(producerTemp);
producerTemp = "";
}
}
if (temp.contains("<th scope=\"row\" style=\"white-space:" +
"nowrap;padding-right:0.65em;\">Screenplay by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
writerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
writer.add(writerTemp);
writerTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
writerTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
writer.add(writerTemp);
writerTemp = "";
}
}
if (temp.contains("<th scope=\"row\" style=\"white-space:" +
"nowrap;padding-right:0.65em;\">Starring</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
starsTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
stars.add(starsTemp);
starsTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
starsTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
stars.add(starsTemp);
starsTemp = "";
}
}
if (temp.contains("<th scope=\"row\" style=\"white-space:" +
"nowrap;padding-right:0.65em;\">Music by</th>")) {
String secondTemp = inputFile.nextLine();
if (secondTemp.equals("<td style=\"line-height:1.3em;\">")) {
inputFile.nextLine();
inputFile.nextLine();
while (true) {
secondTemp = inputFile.nextLine();
if (secondTemp.contains("</ul>")) {
break;
}
boolean start = false;
for (int i = 1; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
musicTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
music.add(musicTemp);
musicTemp = "";
}
} else if (secondTemp.contains("<td style=\"line-height:1.3em;\">")) {
boolean start = false;
for (int i = 33; i < secondTemp.length(); i++) {
if (secondTemp.charAt(i) == '<') {
start = false;
}
if (start) {
musicTemp += secondTemp.charAt(i);
}
if (secondTemp.charAt(i) == '>' && secondTemp.charAt(i - 1) == '"') {
start = true;
}
}
music.add(musicTemp);
musicTemp = "";
}
}
}
result[0] = rowToString(stars);
result[1] = rowToString(writer);
result[2] = rowToString(music);
result[3] = rowToString(producer);
result[4] = rowToString(director);
result[5] = year;
} catch (FileNotFoundException e) {
e.printStackTrace();
}
return result;
}
private String rowToString(ArrayList<String> list) {
String resultString = "";
if (list.size() > 1) {
for (int i = 0; i < list.size() - 1; i++) {
resultString += list.get(i) + ", ";
}
resultString += list.get(list.size() - 1);
}else if (list.size() == 1){
resultString += list.get(0);
}
return resultString;
}
}
| 17,526 | 0.382232 | 0.37607 | 432 | 39.569443 | 29.734314 | 137 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.511574 | false | false |
13
|
79c3f88d60a8944c82a36918ff2655bc5f64ff6c
| 3,642,132,289,068 |
12d840e02ef6f56b7688b9faabc0be50ee9600a9
|
/src/by/epam/module1/output/Print.java
|
356f62be823cfee18360d99517ff5f743b7eb83d
|
[] |
no_license
|
MikitaP/numberMultiplication
|
https://github.com/MikitaP/numberMultiplication
|
48441544889669e6c542c97556caca73e47076f9
|
c1521bade62f91e1ccf76137fc9dabb7935c0748
|
refs/heads/master
| 2021-01-22T10:51:50.313000 | 2017-02-20T09:15:40 | 2017-02-20T09:15:40 | 82,049,373 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package by.epam.module1.output;
import by.epam.module1.numbers.InputNumber;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class Print {
private static final String FILE_PATH;
static {
FILE_PATH = "data\\out_result.txt";
}
private static final String OUTPUT_TEXT = "Product of numbers multiplication = ";
public static void writeFile(ArrayList<InputNumber> listResult) {
String textToWrite = "";
for (InputNumber inputNumber : listResult) {
textToWrite += new StringBuilder().append( OUTPUT_TEXT ).append( inputNumber.getInputValue() ).append( "\n" ).toString();
}
File file = new File( FILE_PATH );
boolean isCreated = true;
if (file.exists()) {
isCreated = false;
}
FileWriter fr = null;
try {
fr = new FileWriter( file );
fr.write( textToWrite );
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fr.close();
if (isCreated) {
System.out.println( "File was created" );
} else {
System.out.println( "File was overwritten" );
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
|
UTF-8
|
Java
| 1,413 |
java
|
Print.java
|
Java
|
[] | null |
[] |
package by.epam.module1.output;
import by.epam.module1.numbers.InputNumber;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class Print {
private static final String FILE_PATH;
static {
FILE_PATH = "data\\out_result.txt";
}
private static final String OUTPUT_TEXT = "Product of numbers multiplication = ";
public static void writeFile(ArrayList<InputNumber> listResult) {
String textToWrite = "";
for (InputNumber inputNumber : listResult) {
textToWrite += new StringBuilder().append( OUTPUT_TEXT ).append( inputNumber.getInputValue() ).append( "\n" ).toString();
}
File file = new File( FILE_PATH );
boolean isCreated = true;
if (file.exists()) {
isCreated = false;
}
FileWriter fr = null;
try {
fr = new FileWriter( file );
fr.write( textToWrite );
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
fr.close();
if (isCreated) {
System.out.println( "File was created" );
} else {
System.out.println( "File was overwritten" );
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
| 1,413 | 0.545648 | 0.544232 | 49 | 27.836735 | 24.67449 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.44898 | false | false |
13
|
8d0d4cd2608699441de38ceeebf97a3a4fce71c4
| 27,230,092,700,470 |
e73ddfb4a2a638f6bc1d0c3bd4db3e8a03f0535b
|
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Pushbot_2019.java
|
2c87bb111e68eecfeabbc51bedef776e192c63cb
|
[
"BSD-3-Clause"
] |
permissive
|
ehssteelhornets/SkyStone2019-master
|
https://github.com/ehssteelhornets/SkyStone2019-master
|
02c3eeeaf797989d16ee6d69dfbdf03bd73c90a8
|
e91e5c4113abd6b4d703f38623916f5386a6ad9e
|
refs/heads/master
| 2020-08-15T18:00:43.660000 | 2020-01-28T20:20:40 | 2020-01-28T20:20:40 | 215,384,537 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;
import com.qualcomm.robotcore.hardware.HardwareMap;
import com.qualcomm.robotcore.hardware.Servo;
import com.qualcomm.robotcore.hardware.CRServo;
import com.qualcomm.robotcore.util.ElapsedTime;
public class Pushbot_2019 {
public DcMotor leftDrive;
public DcMotor rightDrive;
public DcMotor leftDrive2;
public DcMotor rightDrive2;
public DcMotor vertExt;
public DcMotor tapeExt;
public Servo foundHook1;
public Servo foundHook2;
public Servo rightClaw;
public Servo leftClaw;
public CRServo tuckAwayClaw1;
public CRServo tuckAwayClaw2;
public DcMotor stoneClaw;
/* local OpMode members. */
HardwareMap hwMap;
private ElapsedTime period = new ElapsedTime();
/* Constructor */
public Pushbot_2019(){
}
/* Initialize standard Hardware interfaces */
public void init(HardwareMap ahwMap) {
// Save reference to Hardware map
hwMap = ahwMap;
//Define and Initialize servos
foundHook1 = hwMap.get(Servo.class, "foundHook1");
foundHook2 = hwMap.get(Servo.class, "foundHook2");
leftClaw = hwMap.get(Servo.class, "leftClaw");
rightClaw = hwMap.get(Servo.class, "rightClaw");
tuckAwayClaw1 = hwMap.get(CRServo.class, "tuckAwayClaw1");
tuckAwayClaw2 = hwMap.get(CRServo.class, "tuckAwayClaw2");
//set servo to starting position
foundHook1.setPosition(0.0);
foundHook2.setPosition(1.0);
leftClaw.setPosition(.35);
rightClaw.setPosition(0.5);
tuckAwayClaw1.setPower(-.4);
tuckAwayClaw2.setPower(.8);
// Define and Initialize Motors
leftDrive = hwMap.get(DcMotor.class, "left_drive");
rightDrive = hwMap.get(DcMotor.class, "right_drive");
leftDrive2 = hwMap.get(DcMotor.class, "left_drive2");
rightDrive2 = hwMap.get(DcMotor.class, "right_drive2");
vertExt = hwMap.get(DcMotor.class, "vertExt");
tapeExt = hwMap.get(DcMotor.class, "tapeExt");
stoneClaw = hwMap.get(DcMotor.class, "stoneClaw");
//Set motor direction
leftDrive.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors
rightDrive.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors
leftDrive2.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors
rightDrive2.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors
vertExt.setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors
tapeExt.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors
stoneClaw.setDirection(DcMotor.Direction.FORWARD);
// Set all motors to zero power
leftDrive.setPower(0);
rightDrive.setPower(0);
rightDrive2.setPower(0);
leftDrive2.setPower(0);
vertExt.setPower(0);
tapeExt.setPower(0);
stoneClaw.setPower(0);
// Set all motors to run without encoders.
// May want to use RUN_USING_ENCODERS if encoders are installed.
leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
leftDrive2.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
rightDrive2.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
vertExt.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
stoneClaw.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
}
}
|
UTF-8
|
Java
| 3,671 |
java
|
Pushbot_2019.java
|
Java
|
[] | null |
[] |
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;
import com.qualcomm.robotcore.hardware.HardwareMap;
import com.qualcomm.robotcore.hardware.Servo;
import com.qualcomm.robotcore.hardware.CRServo;
import com.qualcomm.robotcore.util.ElapsedTime;
public class Pushbot_2019 {
public DcMotor leftDrive;
public DcMotor rightDrive;
public DcMotor leftDrive2;
public DcMotor rightDrive2;
public DcMotor vertExt;
public DcMotor tapeExt;
public Servo foundHook1;
public Servo foundHook2;
public Servo rightClaw;
public Servo leftClaw;
public CRServo tuckAwayClaw1;
public CRServo tuckAwayClaw2;
public DcMotor stoneClaw;
/* local OpMode members. */
HardwareMap hwMap;
private ElapsedTime period = new ElapsedTime();
/* Constructor */
public Pushbot_2019(){
}
/* Initialize standard Hardware interfaces */
public void init(HardwareMap ahwMap) {
// Save reference to Hardware map
hwMap = ahwMap;
//Define and Initialize servos
foundHook1 = hwMap.get(Servo.class, "foundHook1");
foundHook2 = hwMap.get(Servo.class, "foundHook2");
leftClaw = hwMap.get(Servo.class, "leftClaw");
rightClaw = hwMap.get(Servo.class, "rightClaw");
tuckAwayClaw1 = hwMap.get(CRServo.class, "tuckAwayClaw1");
tuckAwayClaw2 = hwMap.get(CRServo.class, "tuckAwayClaw2");
//set servo to starting position
foundHook1.setPosition(0.0);
foundHook2.setPosition(1.0);
leftClaw.setPosition(.35);
rightClaw.setPosition(0.5);
tuckAwayClaw1.setPower(-.4);
tuckAwayClaw2.setPower(.8);
// Define and Initialize Motors
leftDrive = hwMap.get(DcMotor.class, "left_drive");
rightDrive = hwMap.get(DcMotor.class, "right_drive");
leftDrive2 = hwMap.get(DcMotor.class, "left_drive2");
rightDrive2 = hwMap.get(DcMotor.class, "right_drive2");
vertExt = hwMap.get(DcMotor.class, "vertExt");
tapeExt = hwMap.get(DcMotor.class, "tapeExt");
stoneClaw = hwMap.get(DcMotor.class, "stoneClaw");
//Set motor direction
leftDrive.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors
rightDrive.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors
leftDrive2.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors
rightDrive2.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors
vertExt.setDirection(DcMotor.Direction.REVERSE);// Set to FORWARD if using AndyMark motors
tapeExt.setDirection(DcMotor.Direction.FORWARD);// Set to FORWARD if using AndyMark motors
stoneClaw.setDirection(DcMotor.Direction.FORWARD);
// Set all motors to zero power
leftDrive.setPower(0);
rightDrive.setPower(0);
rightDrive2.setPower(0);
leftDrive2.setPower(0);
vertExt.setPower(0);
tapeExt.setPower(0);
stoneClaw.setPower(0);
// Set all motors to run without encoders.
// May want to use RUN_USING_ENCODERS if encoders are installed.
leftDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
leftDrive2.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
rightDrive2.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
rightDrive.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
vertExt.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
stoneClaw.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
}
}
| 3,671 | 0.69191 | 0.677472 | 84 | 42.702381 | 23.721991 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.892857 | false | false |
13
|
0f5535644476af1e5acc7bbecbd2e2d5db49b7f8
| 2,508,260,921,541 |
88ead4f3128176d3b68f5eadcae168f867f18309
|
/src/main/java/com/security/validation/date/FutureLocalDateValidator.java
|
8dc1b76a2cf1df4357dac7c315ea17aa560b654e
|
[] |
no_license
|
synthesize01/Validator
|
https://github.com/synthesize01/Validator
|
6d4f1c9a46706d312967013c5e92c9a056337ce0
|
475cfa220c1ddc3cf388151fd38a88d1417ae32a
|
refs/heads/master
| 2020-01-05T08:16:46.873000 | 2018-03-03T15:45:28 | 2018-03-03T15:45:28 | 123,703,106 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.security.validation.date;
import com.security.validation.Validator;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class FutureLocalDateValidator implements Validator<LocalDate> {
@Override
public boolean isValid(LocalDate input) {
LocalDate now = LocalDate.now();
return input.isAfter(now);
}
}
|
UTF-8
|
Java
| 360 |
java
|
FutureLocalDateValidator.java
|
Java
|
[] | null |
[] |
package com.security.validation.date;
import com.security.validation.Validator;
import java.time.LocalDate;
import java.time.LocalDateTime;
public class FutureLocalDateValidator implements Validator<LocalDate> {
@Override
public boolean isValid(LocalDate input) {
LocalDate now = LocalDate.now();
return input.isAfter(now);
}
}
| 360 | 0.744444 | 0.744444 | 15 | 23 | 21.32604 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4 | false | false |
13
|
e473cb1fbef37295c39219e6d5343982b0b141f7
| 8,194,797,619,083 |
ad7a4ead69cf32b98843022325928fd4cbb7240a
|
/src/main/java/com/izdebski/SpringBootInitializeDatabaseHibernate/repository/EmployeeRepository.java
|
fc55a474ecd3e1b076b5bba390784ffc6a2d415c
|
[] |
no_license
|
iizdebski/Spring-Boot-Initialize-a-database-using-Hibernate
|
https://github.com/iizdebski/Spring-Boot-Initialize-a-database-using-Hibernate
|
e92990836f902811a5f6ff6a2e2c495fa1683957
|
c71f34bf1a72cdd4838bfbd6a315dce468e24f30
|
refs/heads/master
| 2020-04-12T16:34:05.036000 | 2018-12-20T18:28:05 | 2018-12-20T18:28:05 | 162,616,598 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.izdebski.SpringBootInitializeDatabaseHibernate.repository;
import com.izdebski.SpringBootInitializeDatabaseHibernate.entity.Employee;
import org.springframework.data.repository.CrudRepository;
public interface EmployeeRepository extends CrudRepository<Employee, Integer> {
}
|
UTF-8
|
Java
| 288 |
java
|
EmployeeRepository.java
|
Java
|
[] | null |
[] |
package com.izdebski.SpringBootInitializeDatabaseHibernate.repository;
import com.izdebski.SpringBootInitializeDatabaseHibernate.entity.Employee;
import org.springframework.data.repository.CrudRepository;
public interface EmployeeRepository extends CrudRepository<Employee, Integer> {
}
| 288 | 0.881944 | 0.881944 | 7 | 40.285713 | 35.094624 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false |
13
|
c8b5dc9e6429fcbf434708f02b2a1fba9d0e0f61
| 8,194,797,618,575 |
c261aad017beb12f9485d475b80b754f35928908
|
/src/com/bjsj/budget/dao/LookValueDao.java
|
a02126242160c43c591b179fec78e57d408384dd
|
[] |
no_license
|
weichen666/budget
|
https://github.com/weichen666/budget
|
e6356a0845492559451d24e3423682547e939d1f
|
9c9ead800d6f4d6fc22228263e767324ef1271db
|
refs/heads/master
| 2020-03-06T06:10:05.311000 | 2017-09-01T08:06:15 | 2017-09-01T08:06:15 | 93,922,278 | 0 | 4 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.bjsj.budget.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.bjsj.budget.model.LookValue;
import com.bjsj.budget.page.PageInfo;
import com.bjsj.budget.page.PageObject;
public interface LookValueDao extends BaseDao {
List<LookValue> queryLookValueInfo(@Param("map") Map<String, String> queryMap,
@Param("page") PageInfo pageInfo);
int getLookValueInfoCount(@Param("map") Map<String, String> queryMap);
List<Map> queryLookTypeInfo(@Param("map")Map<String, String> queryMap, @Param("page")PageInfo pageInfo);
int getLookTypeInfoCount(@Param("map") Map<String, String> queryMap);
int deleteByPrimaryKey(Integer lookvalueId);
int insert(LookValue record);
LookValue selectByPrimaryKey(Integer lookvalueId);
int updateByPrimaryKey(LookValue record);
/**
* 字典值新增的时候是否存在
* @param lv
* @return
*/
int getLookValueCountAdd(LookValue lv);
int findByName(String name);
int findByCode(String code);
}
|
UTF-8
|
Java
| 1,058 |
java
|
LookValueDao.java
|
Java
|
[] | null |
[] |
package com.bjsj.budget.dao;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.bjsj.budget.model.LookValue;
import com.bjsj.budget.page.PageInfo;
import com.bjsj.budget.page.PageObject;
public interface LookValueDao extends BaseDao {
List<LookValue> queryLookValueInfo(@Param("map") Map<String, String> queryMap,
@Param("page") PageInfo pageInfo);
int getLookValueInfoCount(@Param("map") Map<String, String> queryMap);
List<Map> queryLookTypeInfo(@Param("map")Map<String, String> queryMap, @Param("page")PageInfo pageInfo);
int getLookTypeInfoCount(@Param("map") Map<String, String> queryMap);
int deleteByPrimaryKey(Integer lookvalueId);
int insert(LookValue record);
LookValue selectByPrimaryKey(Integer lookvalueId);
int updateByPrimaryKey(LookValue record);
/**
* 字典值新增的时候是否存在
* @param lv
* @return
*/
int getLookValueCountAdd(LookValue lv);
int findByName(String name);
int findByCode(String code);
}
| 1,058 | 0.733075 | 0.733075 | 39 | 24.564102 | 26.006701 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.230769 | false | false |
13
|
db11e768b0e9265fbe8d03f66a9485c4b215365d
| 34,359,756,476 |
c6d04360577b0a191cc343850b996574f6f2bafc
|
/SpringBootDemo/src/main/java/com/example/demo/entities/DepartmentInfo.java
|
dcfdc84a06aeb4104bbb9b9213bbdc36135fe0e7
|
[] |
no_license
|
Transformice27/ds
|
https://github.com/Transformice27/ds
|
85a8e88051621d5ab252ce7a562ef9e55f6d3d70
|
58b716f941caf31a1fb0298fe63ad799a6a3f8d7
|
refs/heads/main
| 2023-02-10T03:55:44.283000 | 2021-01-07T07:06:04 | 2021-01-07T07:06:04 | 327,530,381 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
//package com.example.demo.entities;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.GeneratedValue;
//import javax.persistence.Id;
//import javax.persistence.Table;
//import lombok.Getter;
//import lombok.Setter;
//
//@Setter
//@Getter
//@Entity
//@Table(name="Department")
//public class DepartmentInfo {
//
// @Id
// @GeneratedValue
// private Integer id;
//
// @Column(name = "departmentName", nullable = false, length = 20)
// private String departmentName;
//
//
//}
|
UTF-8
|
Java
| 553 |
java
|
DepartmentInfo.java
|
Java
|
[] | null |
[] |
//package com.example.demo.entities;
//
//import javax.persistence.Column;
//import javax.persistence.Entity;
//import javax.persistence.GeneratedValue;
//import javax.persistence.Id;
//import javax.persistence.Table;
//import lombok.Getter;
//import lombok.Setter;
//
//@Setter
//@Getter
//@Entity
//@Table(name="Department")
//public class DepartmentInfo {
//
// @Id
// @GeneratedValue
// private Integer id;
//
// @Column(name = "departmentName", nullable = false, length = 20)
// private String departmentName;
//
//
//}
| 553 | 0.676311 | 0.672694 | 25 | 20.120001 | 16.209429 | 66 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.8 | false | false |
13
|
7b9fa77a0b2af61745111feb3eb6eb8f32d855be
| 7,524,782,719,079 |
8a06957394b9173cac67868a2fda27ac2c3a3729
|
/spring-cloud-redisson/src/main/java/com/company/spring/redis/service/RedissonService.java
|
87ddb8e59011357b444ebbc3a98cda6d6d050a02
|
[] |
no_license
|
BinLee218/spring-cloud-my
|
https://github.com/BinLee218/spring-cloud-my
|
f5fcfbb158e1f0968cf19f4eeb7cabf02b1c94f2
|
61c6ab46ed7f6724e10253691bdd12117ae4c0c5
|
refs/heads/master
| 2023-04-19T17:23:00.935000 | 2021-05-18T09:44:31 | 2021-05-18T09:44:31 | 289,687,884 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.company.spring.redis.service;
import com.sun.prism.shader.Solid_TextureYV12_AlphaTest_Loader;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RSet;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Service;
import javax.xml.bind.SchemaOutputResolver;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
/**
* @author bin.li
* @date 2020/9/10
*/
@Service
@Slf4j
public class RedissonService {
@Autowired
private RedissonClient redisson;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
private RedisTemplate<Object, Object> redisTemplate;
public void testLock(){
RLock testLock = redisson.getLock("testLock");
try {
log.info("我要准备加锁了{}", Thread.currentThread().getName());
testLock.lock();
Thread.sleep(10000);
} catch (Exception e) {
e.printStackTrace();
} finally {
log.info("我要准备释放锁了{}", Thread.currentThread().getName());
testLock.unlock();
}
}
public void testString(){
//字符串操作
/**
* 字符串操作
*/
ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
valueOperations.set("key001", "key001");
System.out.println(valueOperations.get("key001"));
valueOperations.set("key:001", "key001", 10000);
System.out.println(valueOperations.get("key:001",10000, (10000 + "key001".length())));
valueOperations.set("key:002", "key002", 100, TimeUnit.SECONDS);
System.out.println(valueOperations.get("key:002"));
valueOperations.setBit("key:bit", 10, Boolean.FALSE);
System.out.println(valueOperations.getBit("key:bit", 10));
Long increment = valueOperations.increment("key:increment");
System.out.println(increment);
//key存在才更新
System.out.println(valueOperations.setIfPresent("key:001", "key001key001"));
System.out.println(valueOperations.setIfPresent("key:003", "key001key001"));
String andSet = valueOperations.getAndSet("key:001", "key:001");
System.out.println(andSet);
System.out.println(stringRedisTemplate.delete("age"));
//hash操作
/**
* hash操作
*/
HashOperations<String, Object, Object> opsForHash = stringRedisTemplate.opsForHash();
opsForHash.put("hash:key", "name","你好");
opsForHash.put("hash:key", "age","29");
opsForHash.put("hash:key", "gender","男");
opsForHash.put("hash:key", "address","三里屯");
System.out.println(opsForHash.delete("hash:key", "address"));
System.out.println(opsForHash.lengthOfValue("hash:key", "name"));
System.out.println(opsForHash.lengthOfValue("hash:key", "age"));
System.out.println(opsForHash.lengthOfValue("hash:key", "gender"));
System.out.println(opsForHash.lengthOfValue("hash:key", "address"));
/**
* 队列操作
*/
stringRedisTemplate.delete("list:key");
stringRedisTemplate.delete("list:key1");
//左进左出 栈
// 1 2 3 4
// 你好世界4 你好世界3 你好世界2 你好世界1
ListOperations<String, String> opsForList = stringRedisTemplate.opsForList();
opsForList.leftPush("list:key", "你好世界1");
opsForList.leftPush("list:key", "你好世界2");
opsForList.leftPush("list:key", "你好世界3");
opsForList.leftPush("list:key", "你好世界4");
System.out.println(opsForList.leftPop("list:key"));
//右近右出 栈
// 1 2 3 4
// 你好世界1 你好世界2 你好世界3 你好世界4
opsForList.rightPush("list:key1", "你好世界1");
opsForList.rightPush("list:key1", "你好世界2");
opsForList.rightPush("list:key1", "你好世界3");
opsForList.rightPush("list:key1", "你好世界4");
System.out.println(opsForList.rightPop("list:key1"));
//左进右出 队列
opsForList.leftPush("list:key2", "你好世界1");
opsForList.leftPush("list:key2", "你好世界2");
opsForList.leftPush("list:key2", "你好世界3");
opsForList.leftPush("list:key2", "你好世界4");
System.out.println(opsForList.rightPop("list:key2"));
/**
* SET集合操作
*/
SetOperations<String, String> opsForSet = stringRedisTemplate.opsForSet();
//插入
opsForSet.add("set:key", "set1");
opsForSet.add("set:key", "set2");
opsForSet.add("set:key", "set3");
opsForSet.add("set:key", "set4");
opsForSet.add("set:key", "set5");
opsForSet.add("set:key1", "set11");
opsForSet.add("set:key1", "set22");
opsForSet.add("set:key1", "set3");
opsForSet.add("set:key1", "set44");
opsForSet.add("set:key1", "set5");
//value是否存在
System.out.println(opsForSet.isMember("set:key", "set1"));
//所有value
Set<String> members = opsForSet.members("set:key");
for (String member : members) {
System.out.println(member);
}
//弹出一个数据
// System.out.println(opsForSet.pop("set:key"));
//删除
// System.out.println(opsForSet.remove("set:key", "set5"));
//取两个set不同的数据
System.out.println("=======分割线=======");
Set<String> difference = opsForSet.difference("set:key", "set:key1");
difference.forEach(System.out::println);
//取不同数据放到新set
System.out.println(opsForSet.differenceAndStore("set:key", "set:key1", "set:key2"));
//取两边相同的数据
System.out.println("=======分割线=======");
Set<String> intersect = opsForSet.intersect("set:key", "set:key1");
intersect.forEach(System.out::println);
//取相同数据放到新set
System.out.println(opsForSet.intersectAndStore("set:key", "set:key1", "set:key3"));
//合并两个集合,并且去重
System.out.println("=======分割线=======");
Set<String> union = opsForSet.union("set:key", "set:key1");
union.forEach(System.out::println);
//合并去重放到新set
System.out.println(opsForSet.unionAndStore("set:key", "set:key1", "set:key4"));
System.out.println("=======分割线=======");
/**
* zset操作
*/
ZSetOperations<String, String> opsForZSet = stringRedisTemplate.opsForZSet();
opsForZSet.add("zset:key","key1",32.4);
opsForZSet.add("zset:key","key2",22.4);
opsForZSet.add("zset:key","key3",42.4);
opsForZSet.add("zset:key","key4",62.4);
opsForZSet.add("zset:key","key5",12.4);
opsForZSet.zCard("zset:key");
}
}
|
UTF-8
|
Java
| 7,661 |
java
|
RedissonService.java
|
Java
|
[
{
"context": "mport java.util.function.Consumer;\n\n/**\n * @author bin.li\n * @date 2020/9/10\n */\n@Service\n@Slf4j\npublic ",
"end": 989,
"score": 0.8542518615722656,
"start": 986,
"tag": "NAME",
"value": "bin"
},
{
"context": "t java.util.function.Consumer;\n\n/**\n * @author bin.li\n * @date 2020/9/10\n */\n@Service\n@Slf4j\npublic cla",
"end": 992,
"score": 0.5984551310539246,
"start": 990,
"tag": "USERNAME",
"value": "li"
},
{
"context": "ash();\n opsForHash.put(\"hash:key\", \"name\",\"你好\");\n opsForHash.put(\"hash:key\", \"age\",\"29\"",
"end": 3057,
"score": 0.5436276793479919,
"start": 3056,
"tag": "NAME",
"value": "你"
},
{
"context": "sh();\n opsForHash.put(\"hash:key\", \"name\",\"你好\");\n opsForHash.put(\"hash:key\", \"age\",\"29\")",
"end": 3058,
"score": 0.5968974232673645,
"start": 3057,
"tag": "USERNAME",
"value": "好"
},
{
"context": "rList();\n opsForList.leftPush(\"list:key\", \"你好世界1\");\n opsForList.leftPush(\"list:key\", \"你好世界2",
"end": 3963,
"score": 0.9987311959266663,
"start": 3958,
"tag": "KEY",
"value": "你好世界1"
},
{
"context": "你好世界1\");\n opsForList.leftPush(\"list:key\", \"你好世界2\");\n opsForList.leftPush(\"list:key\", \"你好世界3",
"end": 4013,
"score": 0.9985295534133911,
"start": 4008,
"tag": "KEY",
"value": "你好世界2"
},
{
"context": "你好世界2\");\n opsForList.leftPush(\"list:key\", \"你好世界3\");\n opsForList.leftPush(\"list:key\", \"你好世界4",
"end": 4063,
"score": 0.9988612532615662,
"start": 4058,
"tag": "KEY",
"value": "你好世界3"
},
{
"context": "你好世界3\");\n opsForList.leftPush(\"list:key\", \"你好世界4\");\n System.out.println(opsForList.leftPop(",
"end": 4113,
"score": 0.9988157153129578,
"start": 4108,
"tag": "KEY",
"value": "你好世界4"
},
{
"context": " 你好世界4\n opsForList.rightPush(\"list:key1\", \"你好世界1\");\n opsForList.rightPush(\"list:key1\", \"你好世",
"end": 4335,
"score": 0.9983240365982056,
"start": 4330,
"tag": "KEY",
"value": "你好世界1"
},
{
"context": "世界1\");\n opsForList.rightPush(\"list:key1\", \"你好世界2\");\n opsForList.rightPush(\"list:key1\", \"你好世",
"end": 4387,
"score": 0.9986411929130554,
"start": 4382,
"tag": "KEY",
"value": "你好世界2"
},
{
"context": "世界2\");\n opsForList.rightPush(\"list:key1\", \"你好世界3\");\n opsForList.rightPush(\"list:key1\", \"你好世",
"end": 4439,
"score": 0.9986362457275391,
"start": 4434,
"tag": "KEY",
"value": "你好世界3"
},
{
"context": "世界3\");\n opsForList.rightPush(\"list:key1\", \"你好世界4\");\n System.out.println(opsForList.rightPop",
"end": 4491,
"score": 0.9986405968666077,
"start": 4486,
"tag": "KEY",
"value": "你好世界4"
},
{
"context": "进右出 队列\n opsForList.leftPush(\"list:key2\", \"你好世界1\");\n opsForList.leftPush(\"list:key2\", \"你好世界",
"end": 4623,
"score": 0.9984499216079712,
"start": 4618,
"tag": "KEY",
"value": "你好世界1"
},
{
"context": "好世界1\");\n opsForList.leftPush(\"list:key2\", \"你好世界2\");\n opsForList.leftPush(\"list:key2\", \"你好世界",
"end": 4674,
"score": 0.9984660744667053,
"start": 4669,
"tag": "KEY",
"value": "你好世界2"
},
{
"context": "好世界2\");\n opsForList.leftPush(\"list:key2\", \"你好世界3\");\n opsForList.leftPush(\"list:key2\", \"你好世界",
"end": 4725,
"score": 0.9987345933914185,
"start": 4720,
"tag": "KEY",
"value": "你好世界3"
},
{
"context": "好世界3\");\n opsForList.leftPush(\"list:key2\", \"你好世界4\");\n System.out.println(opsForList.rightPop",
"end": 4776,
"score": 0.9987558722496033,
"start": 4771,
"tag": "KEY",
"value": "你好世界4"
},
{
"context": ", \"set11\");\n opsForSet.add(\"set:key1\", \"set22\");\n opsForSet.add(\"set:key1\", \"set3\");\n ",
"end": 5276,
"score": 0.8266086578369141,
"start": 5274,
"tag": "KEY",
"value": "22"
},
{
"context": "\", \"set3\");\n opsForSet.add(\"set:key1\", \"set44\");\n opsForSet.add(\"set:key1\", \"set5\");\n ",
"end": 5363,
"score": 0.5791758298873901,
"start": 5361,
"tag": "KEY",
"value": "44"
},
{
"context": "rZSet();\n opsForZSet.add(\"zset:key\",\"key1\",32.4);\n opsForZSet.add(\"zset:key\",\"key2\",22.4);",
"end": 6956,
"score": 0.9394534826278687,
"start": 6952,
"tag": "KEY",
"value": "32.4"
},
{
"context": "\",32.4);\n opsForZSet.add(\"zset:key\",\"key2\",22.4);\n opsForZSet.add(\"zset:key\",\"key3\",42.4);",
"end": 7004,
"score": 0.9607303142547607,
"start": 7000,
"tag": "KEY",
"value": "22.4"
},
{
"context": "\",22.4);\n opsForZSet.add(\"zset:key\",\"key3\",42.4);\n opsForZSet.add(\"zset:key\",\"key4\",62.4);",
"end": 7052,
"score": 0.8558809757232666,
"start": 7048,
"tag": "KEY",
"value": "42.4"
},
{
"context": "\",42.4);\n opsForZSet.add(\"zset:key\",\"key4\",62.4);\n opsForZSet.add(\"zset:key\",\"key5\",12.4);",
"end": 7100,
"score": 0.9341732859611511,
"start": 7096,
"tag": "KEY",
"value": "62.4"
},
{
"context": "\",62.4);\n opsForZSet.add(\"zset:key\",\"key5\",12.4);\n opsForZSet.zCard(\"zset:key\");\n }\n\n\n\n",
"end": 7148,
"score": 0.9526858329772949,
"start": 7144,
"tag": "KEY",
"value": "12.4"
}
] | null |
[] |
package com.company.spring.redis.service;
import com.sun.prism.shader.Solid_TextureYV12_AlphaTest_Loader;
import lombok.extern.slf4j.Slf4j;
import org.redisson.api.RLock;
import org.redisson.api.RSet;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Service;
import javax.xml.bind.SchemaOutputResolver;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
/**
* @author bin.li
* @date 2020/9/10
*/
@Service
@Slf4j
public class RedissonService {
@Autowired
private RedissonClient redisson;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Autowired
private RedisTemplate<Object, Object> redisTemplate;
public void testLock(){
RLock testLock = redisson.getLock("testLock");
try {
log.info("我要准备加锁了{}", Thread.currentThread().getName());
testLock.lock();
Thread.sleep(10000);
} catch (Exception e) {
e.printStackTrace();
} finally {
log.info("我要准备释放锁了{}", Thread.currentThread().getName());
testLock.unlock();
}
}
public void testString(){
//字符串操作
/**
* 字符串操作
*/
ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
valueOperations.set("key001", "key001");
System.out.println(valueOperations.get("key001"));
valueOperations.set("key:001", "key001", 10000);
System.out.println(valueOperations.get("key:001",10000, (10000 + "key001".length())));
valueOperations.set("key:002", "key002", 100, TimeUnit.SECONDS);
System.out.println(valueOperations.get("key:002"));
valueOperations.setBit("key:bit", 10, Boolean.FALSE);
System.out.println(valueOperations.getBit("key:bit", 10));
Long increment = valueOperations.increment("key:increment");
System.out.println(increment);
//key存在才更新
System.out.println(valueOperations.setIfPresent("key:001", "key001key001"));
System.out.println(valueOperations.setIfPresent("key:003", "key001key001"));
String andSet = valueOperations.getAndSet("key:001", "key:001");
System.out.println(andSet);
System.out.println(stringRedisTemplate.delete("age"));
//hash操作
/**
* hash操作
*/
HashOperations<String, Object, Object> opsForHash = stringRedisTemplate.opsForHash();
opsForHash.put("hash:key", "name","你好");
opsForHash.put("hash:key", "age","29");
opsForHash.put("hash:key", "gender","男");
opsForHash.put("hash:key", "address","三里屯");
System.out.println(opsForHash.delete("hash:key", "address"));
System.out.println(opsForHash.lengthOfValue("hash:key", "name"));
System.out.println(opsForHash.lengthOfValue("hash:key", "age"));
System.out.println(opsForHash.lengthOfValue("hash:key", "gender"));
System.out.println(opsForHash.lengthOfValue("hash:key", "address"));
/**
* 队列操作
*/
stringRedisTemplate.delete("list:key");
stringRedisTemplate.delete("list:key1");
//左进左出 栈
// 1 2 3 4
// 你好世界4 你好世界3 你好世界2 你好世界1
ListOperations<String, String> opsForList = stringRedisTemplate.opsForList();
opsForList.leftPush("list:key", "你好世界1");
opsForList.leftPush("list:key", "你好世界2");
opsForList.leftPush("list:key", "你好世界3");
opsForList.leftPush("list:key", "你好世界4");
System.out.println(opsForList.leftPop("list:key"));
//右近右出 栈
// 1 2 3 4
// 你好世界1 你好世界2 你好世界3 你好世界4
opsForList.rightPush("list:key1", "你好世界1");
opsForList.rightPush("list:key1", "你好世界2");
opsForList.rightPush("list:key1", "你好世界3");
opsForList.rightPush("list:key1", "你好世界4");
System.out.println(opsForList.rightPop("list:key1"));
//左进右出 队列
opsForList.leftPush("list:key2", "你好世界1");
opsForList.leftPush("list:key2", "你好世界2");
opsForList.leftPush("list:key2", "你好世界3");
opsForList.leftPush("list:key2", "你好世界4");
System.out.println(opsForList.rightPop("list:key2"));
/**
* SET集合操作
*/
SetOperations<String, String> opsForSet = stringRedisTemplate.opsForSet();
//插入
opsForSet.add("set:key", "set1");
opsForSet.add("set:key", "set2");
opsForSet.add("set:key", "set3");
opsForSet.add("set:key", "set4");
opsForSet.add("set:key", "set5");
opsForSet.add("set:key1", "set11");
opsForSet.add("set:key1", "set22");
opsForSet.add("set:key1", "set3");
opsForSet.add("set:key1", "set44");
opsForSet.add("set:key1", "set5");
//value是否存在
System.out.println(opsForSet.isMember("set:key", "set1"));
//所有value
Set<String> members = opsForSet.members("set:key");
for (String member : members) {
System.out.println(member);
}
//弹出一个数据
// System.out.println(opsForSet.pop("set:key"));
//删除
// System.out.println(opsForSet.remove("set:key", "set5"));
//取两个set不同的数据
System.out.println("=======分割线=======");
Set<String> difference = opsForSet.difference("set:key", "set:key1");
difference.forEach(System.out::println);
//取不同数据放到新set
System.out.println(opsForSet.differenceAndStore("set:key", "set:key1", "set:key2"));
//取两边相同的数据
System.out.println("=======分割线=======");
Set<String> intersect = opsForSet.intersect("set:key", "set:key1");
intersect.forEach(System.out::println);
//取相同数据放到新set
System.out.println(opsForSet.intersectAndStore("set:key", "set:key1", "set:key3"));
//合并两个集合,并且去重
System.out.println("=======分割线=======");
Set<String> union = opsForSet.union("set:key", "set:key1");
union.forEach(System.out::println);
//合并去重放到新set
System.out.println(opsForSet.unionAndStore("set:key", "set:key1", "set:key4"));
System.out.println("=======分割线=======");
/**
* zset操作
*/
ZSetOperations<String, String> opsForZSet = stringRedisTemplate.opsForZSet();
opsForZSet.add("zset:key","key1",32.4);
opsForZSet.add("zset:key","key2",22.4);
opsForZSet.add("zset:key","key3",42.4);
opsForZSet.add("zset:key","key4",62.4);
opsForZSet.add("zset:key","key5",12.4);
opsForZSet.zCard("zset:key");
}
}
| 7,661 | 0.61708 | 0.591709 | 196 | 35.795918 | 25.84864 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.964286 | false | false |
13
|
1005910b89530652d3406f2f80befed26c022a6c
| 9,629,316,692,044 |
9a3122f217eef2605122549aff6d63c599269a83
|
/android-rgb-tool/src/main/java/com/fastebro/androidrgbtool/palette/ImagePaletteActivity.java
|
f9ab1a6f9c17cd47ebe6c6020957e68d10b575cd
|
[
"Apache-2.0"
] |
permissive
|
SnowVolf/rgb-tool
|
https://github.com/SnowVolf/rgb-tool
|
3b9b279d89e7a9141a5e3dd567310baba8ae2b64
|
f47ec86ab1a3dc3911abe20f4eb94dd354c2b3d4
|
refs/heads/master
| 2021-01-25T00:48:06.300000 | 2017-07-30T08:42:26 | 2017-07-30T08:42:26 | 98,509,202 | 2 | 0 | null | true | 2017-07-27T07:53:31 | 2017-07-27T07:53:31 | 2017-04-20T11:56:07 | 2017-05-18T20:02:11 | 1,133 | 0 | 0 | 0 | null | null | null |
package com.fastebro.androidrgbtool.palette;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.print.PrintManager;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.MenuItemCompat;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.GridView;
import android.support.v7.widget.ShareActionProvider;
import com.fastebro.androidrgbtool.R;
import com.fastebro.androidrgbtool.commons.EventBaseActivity;
import com.fastebro.androidrgbtool.model.events.PrintPaletteEvent;
import com.fastebro.androidrgbtool.print.PrintJobDialogFragment;
import com.fastebro.androidrgbtool.print.RGBToolPrintPaletteAdapter;
import com.fastebro.androidrgbtool.utils.PaletteUtils;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by danielealtomare on 27/12/14.
* Project: rgb-tool
*/
public class ImagePaletteActivity extends EventBaseActivity {
@BindView(R.id.palette_grid)
GridView paletteGrid;
public static final String EXTRA_SWATCHES = "com.fastebro.androidrgbtool.EXTRA_SWATCHES";
public static final String FILENAME = "com.fastebro.androidrgbtool.EXTRA_FILENAME";
private String filename;
private ArrayList<PaletteSwatch> swatches;
private ShareActionProvider shareActionProvider;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_palette);
ButterKnife.bind(this);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
if (getIntent().getExtras().getString(FILENAME) != null) {
filename = getIntent().getStringExtra(FILENAME);
}
if (getIntent().getParcelableArrayListExtra(EXTRA_SWATCHES) != null) {
swatches = getIntent().getParcelableArrayListExtra(EXTRA_SWATCHES);
paletteGrid.setAdapter(new ImagePaletteAdapter(this, swatches));
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.image_palette, menu);
MenuItem item = menu.findItem(R.id.action_share);
shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
updateSharedPalette();
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finishAfterTransition();
return true;
} else if (item.getItemId() == R.id.action_print) {
showPrintPaletteDialog();
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
private void updateSharedPalette() {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, PaletteUtils.getPaletteMessage(filename, swatches));
shareIntent.setType("text/plain");
setShareIntent(shareIntent);
}
private void setShareIntent(Intent shareIntent) {
if (shareActionProvider != null) {
shareActionProvider.setShareIntent(shareIntent);
}
}
private void showPrintPaletteDialog() {
DialogFragment dialog = PrintJobDialogFragment.newInstance(PrintJobDialogFragment.PRINT_PALETTE_JOB);
dialog.show(getSupportFragmentManager(), null);
}
@Subscribe
public void onPrintPaletteEvent(PrintPaletteEvent event) {
printColor(event.message);
}
@TargetApi(Build.VERSION_CODES.KITKAT)
private void printColor(String message) {
// Get a PrintManager instance
PrintManager printManager = (PrintManager) getSystemService(Context.PRINT_SERVICE);
// Set job name, which will be displayed in the print queue
String jobName = getString(R.string.app_name) + "_Color_Palette";
// Start a print job, passing in a PrintDocumentAdapter implementation
// to handle the generation of a print document
printManager.print(jobName,
new RGBToolPrintPaletteAdapter(
this,
message,
filename,
swatches),
null);
}
}
|
UTF-8
|
Java
| 4,534 |
java
|
ImagePaletteActivity.java
|
Java
|
[
{
"context": "import butterknife.ButterKnife;\n\n/**\n * Created by danielealtomare on 27/12/14.\n * Project: rgb-tool\n */\npublic clas",
"end": 992,
"score": 0.9995430707931519,
"start": 977,
"tag": "USERNAME",
"value": "danielealtomare"
}
] | null |
[] |
package com.fastebro.androidrgbtool.palette;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.print.PrintManager;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.MenuItemCompat;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.GridView;
import android.support.v7.widget.ShareActionProvider;
import com.fastebro.androidrgbtool.R;
import com.fastebro.androidrgbtool.commons.EventBaseActivity;
import com.fastebro.androidrgbtool.model.events.PrintPaletteEvent;
import com.fastebro.androidrgbtool.print.PrintJobDialogFragment;
import com.fastebro.androidrgbtool.print.RGBToolPrintPaletteAdapter;
import com.fastebro.androidrgbtool.utils.PaletteUtils;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by danielealtomare on 27/12/14.
* Project: rgb-tool
*/
public class ImagePaletteActivity extends EventBaseActivity {
@BindView(R.id.palette_grid)
GridView paletteGrid;
public static final String EXTRA_SWATCHES = "com.fastebro.androidrgbtool.EXTRA_SWATCHES";
public static final String FILENAME = "com.fastebro.androidrgbtool.EXTRA_FILENAME";
private String filename;
private ArrayList<PaletteSwatch> swatches;
private ShareActionProvider shareActionProvider;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_image_palette);
ButterKnife.bind(this);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
if (getIntent().getExtras().getString(FILENAME) != null) {
filename = getIntent().getStringExtra(FILENAME);
}
if (getIntent().getParcelableArrayListExtra(EXTRA_SWATCHES) != null) {
swatches = getIntent().getParcelableArrayListExtra(EXTRA_SWATCHES);
paletteGrid.setAdapter(new ImagePaletteAdapter(this, swatches));
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.image_palette, menu);
MenuItem item = menu.findItem(R.id.action_share);
shareActionProvider = (ShareActionProvider) MenuItemCompat.getActionProvider(item);
updateSharedPalette();
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
finishAfterTransition();
return true;
} else if (item.getItemId() == R.id.action_print) {
showPrintPaletteDialog();
return true;
} else {
return super.onOptionsItemSelected(item);
}
}
private void updateSharedPalette() {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, PaletteUtils.getPaletteMessage(filename, swatches));
shareIntent.setType("text/plain");
setShareIntent(shareIntent);
}
private void setShareIntent(Intent shareIntent) {
if (shareActionProvider != null) {
shareActionProvider.setShareIntent(shareIntent);
}
}
private void showPrintPaletteDialog() {
DialogFragment dialog = PrintJobDialogFragment.newInstance(PrintJobDialogFragment.PRINT_PALETTE_JOB);
dialog.show(getSupportFragmentManager(), null);
}
@Subscribe
public void onPrintPaletteEvent(PrintPaletteEvent event) {
printColor(event.message);
}
@TargetApi(Build.VERSION_CODES.KITKAT)
private void printColor(String message) {
// Get a PrintManager instance
PrintManager printManager = (PrintManager) getSystemService(Context.PRINT_SERVICE);
// Set job name, which will be displayed in the print queue
String jobName = getString(R.string.app_name) + "_Color_Palette";
// Start a print job, passing in a PrintDocumentAdapter implementation
// to handle the generation of a print document
printManager.print(jobName,
new RGBToolPrintPaletteAdapter(
this,
message,
filename,
swatches),
null);
}
}
| 4,534 | 0.696295 | 0.69431 | 133 | 33.090225 | 26.763924 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.526316 | false | false |
13
|
37ec979fd16230b3353bd4c423422345d5e05e59
| 15,393,162,804,191 |
ee8f4bed66c5928536f5a1656a523f65cf5081ef
|
/BJP_Project/src/Repository/InspectElements.java
|
2ef6d6ff34a97d14b6f779085ab356888d50520e
|
[] |
no_license
|
naginiT/BjPBySadanandam
|
https://github.com/naginiT/BjPBySadanandam
|
b31c1bf52f36b6eec330806cde1bfff589c5da2d
|
c6408d83f00490c9f6c06574391a51def7788a45
|
refs/heads/master
| 2020-03-24T00:02:04.293000 | 2018-07-25T08:17:28 | 2018-07-25T08:17:28 | 142,269,244 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Repository;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
public class InspectElements extends OpenBrowser{
//AdminLogin
static By AdminButton=By.xpath("/html/body/div[1]/div/div/div[1]/div/button/b/a");
static By user=By.name("username");
static By pswd=By.name("password");
static By LoginButton=By.xpath("/html/body/div[2]/div/div/form/div[3]/button");
static By menubar=By.xpath("/html/body/div/header/b/nav/a");
static By moreinfo=By.xpath("/html/body/div/b/div[1]/section/div[1]/div[1]/div/div[3]/a/font");
static By moreinfo1=By.xpath("/html/body/div/b/div[1]/section/div[1]/div/div/div[3]/a[1]/font");
static By back=By.cssSelector("body > div > b > div.content-wrapper > section > div:nth-child(1) > div > div > div.small-box-footer > a:nth-child(2) > font");
static By back1=By.xpath("/html/body/div/b/div[1]/form/button");
//ForgotUsernameORPassword
static By UsernameORpassword=By.xpath("/html/body/div/div/div/form/div[6]/a");
static By backToMainPage=By.xpath("/html/body/div[2]/div/div/form/div[5]/a");
static By email1 =By.name("email");
static By submit1=By.xpath("/html/body/form/input[2]");
static By backToMainPageAfter_D_Login=By.xpath("/html/body/div/div/div/form/div[5]/a");
//MyProfilePage
static By MyProfilePage=By.cssSelector("body > div > header > b > nav > div > ul > li > a > span");
static By Signout=By.cssSelector("body > div > header > b > nav > div > ul > li > ul > li.user-footer > div.pull-right > a");
static By AdminEdit=By.xpath("/html/body/div/header/b/nav/div/ul/li/ul/li[3]/div[1]/a");
static By Submit_EditAdmin=By.xpath("/html/body/div/b/div[1]/div/div/form/div[9]/div/button");
static By Submit_EditAdmin1=By.xpath(" /html/body/div/b/div[1]/div/div/form/div[9]/div/button");
static By Ok_EditAdmin=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
static By MyProfilePage1=By.cssSelector("body > div > header > nav > div > ul > li > a > img");
static By AdminEdit1=By.xpath("/html/body/div/header/nav/div/ul/li/ul/li[2]/div[1]/a");
//AdminHomePage
static By constitution=By.xpath("/html/body/div/b/aside/section/ul/li[2]/a");
static By AddConstitution=By.cssSelector("body > div > b > aside > section > ul > li.treeview.menu-open > ul > li.active > a");
static By viewconstitution=By.xpath("/html/body/div/b/aside/section/ul/li[2]/ul/li[2]/a");
static By Divisions=By.xpath("/html/body/div/aside/section/ul/li[3]/a/span[1]");
static By AddDivisions=By.cssSelector("body > div > aside > section > ul > li.treeview.menu-open > ul > li.active > a");
static By viewdivisions=By.cssSelector("body > div > b > aside > section > ul > li.treeview.menu-open > ul > li:nth-child(2) > a");
static By DivisionsAfterPositive=By.xpath("/html/body/div/b/aside/section/ul/li[3]/a/span[1]");
static By AddDivisionsAfterPositive=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[1]/a");
static By ViewDivisionsAfterPositive=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[2]/a");
//AddConstitutions
static By constitutionname=By.name("constitution");
static By Firstname=By.name("firstname");
static By middlename=By.name("middlename");
static By lastname=By.name("lastname");
static By username=By.name("username");
static By password=By.name("password");
static By email=By.name("email");
static By gender=By.xpath("/html/body/div/b/div/div/div/form/div[8]/div/div/div[2]/label/input");
static By gender_D=By.xpath("/html/body/div/b/div/div/div/form/div[9]/div/div/div[2]/label/input");
static By mobile=By.xpath("//*[@id=\"phone\"]");
static By submit=By.xpath("/html/body/div/b/div/div/div/form/div[11]/div/button");
static By OK=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
//ViewConstitutions
static By CheckBox=By.xpath("//*[@id=\"customers\"]/tbody/tr[2]/td[1]/div/ins");
static By SelectAllCheckBox=By.cssSelector("#customers > tbody > tr:nth-child(1) > th:nth-child(1) > div > button > i");
static By Delete=By.xpath("//*[@id=\"customers\"]/tbody/tr[1]/th[1]/div/div/button/i");
// AddDivisions
static By DivisionName=By.name("division");
static By HomePageOfDivision=By.xpath("/html/body/div/b/div/div/div");
static By mobile_D=By.name("mobile");
static By submit_D=By.xpath("/html/body/div/b/div/div/div/form/div[12]/div/button");
//ViewDivisions
static By checkbox_D=By.xpath("//*[@id=\"customers\"]/tbody/tr[2]/td[1]/div/ins");
static By selectallcheckbox_D=By.cssSelector("#customers > tbody > tr:nth-child(1) > th:nth-child(1) > div > button > i");
static By delete_D=By.xpath("//*[@id=\"customers\"]/tbody/tr[1]/th[1]/div/div/button/i");
//DivisionLogin
static By Divisionloginbtn=By.xpath("/html/body/div[1]/div/div/div[3]/div/button/b/a");
static By loginbtn_D=By.xpath("/html/body/div/div/div/form/div[3]/button");
//DivisionHomePage
static By AddProblem=By.xpath("/html/body/div/b/aside/section/ul/li[2]/a/span[1]");
static By ViewProblem=By.xpath("/html/body/div/b/aside/section/ul/li[3]/a/span[1]");
//AddProblem
static By gender_AddProblem=By.xpath("/html/body/div/b/div/div/div/form/div[6]/div/div/div[2]/label/input");
static By problemtype=By.name("problemtype");
static By enterproblem=By.id("comment");
static By submit_addproblem=By.xpath("/html/body/div/b/div/div/div/form/div[12]/div/button");
static By ok_addproblemsuccess=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
//ViewProblems
static By EditBtn_Viewproblem=By.xpath("//*[@id=\"customers\"]/tbody/tr[2]/td[6]/button/a");
static By submit_editproblem=By.xpath("/html/body/div/b/div[1]/div/div/form/div[10]/div/button");
//ConstitutionLogin
static By ConstitutionLoginbtn=By.xpath("/html/body/div[1]/div/div/div[2]/div/button/span/b/a");
static By Login_C=By.xpath("/html/body/div/div/div/form/div[3]/button");
//ConstitutionHomePage
static By viewproblem=By.xpath("/html/body/div/b/div[1]/section/div/div/div[1]/div[3]/div/a/font");
static By Delete_viewproblem=By.cssSelector("body > div > div.content-wrapper > section > div > div > div > div.box-body.table-responsive.no-padding > table > tbody > tr:nth-child(2) > td:nth-child(6) > form > button > span");
static By back_c=By.xpath("/html/body/div/div[1]/section/form/button");
static By ViewDivisions_C=By.xpath("/html/body/div/b/aside/section/ul/li[2]/a/span[1]");
static By problems=By.cssSelector("body > div > b > aside > section > ul > li.treeview > a > span:nth-child(2)");
static By pendingproblems=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[1]/a");
static By successproblems=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[2]/a");
static By Approve=By.xpath("/html/body/div/b/div/section/div/div/div/div[2]/table/tbody/tr[2]/td[5]/form/button/span");
static By Ok_Approve=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
//AdminLoginMethods
public static WebElement adminbutton() {
return driver.findElement(AdminButton);
}
public static WebElement UserName() {
return driver.findElement(user);
}
public static WebElement Password() {
return driver.findElement(pswd);
}
public static WebElement Login() {
return driver.findElement(LoginButton);
}
public static WebElement MenuBar() {
return driver.findElement(menubar);
}
public static WebElement MoreInfo() {
return driver.findElement(moreinfo);
}
public static WebElement MoreInfo1() {
return driver.findElement(moreinfo1);
}
public static WebElement Back() {
return driver.findElement(back);
}
public static WebElement Back1() {
return driver.findElement(back1);
}
//ForgotUsernameORPassword
public static WebElement UsernameORPassword() {
return driver.findElement(UsernameORpassword);
}
public static WebElement BackToMainPage() {
return driver.findElement(backToMainPage);
}
public static WebElement BackToMainPageAfter_D_Login() {
return driver.findElement(backToMainPageAfter_D_Login);
}
public static WebElement email1() {
return driver.findElement(email1);
}
public static WebElement Submit1() {
return driver.findElement(submit1);
}
//MyProfilePage
public static WebElement MyProfilePage() {
return driver.findElement(MyProfilePage);
}
public static WebElement MyProfilePage1() {
return driver.findElement(MyProfilePage1);
}
public static WebElement SignOut() {
return driver.findElement(Signout);
}
public static WebElement AdminEdit() {
return driver.findElement(AdminEdit);
}
public static WebElement AdminEdit1() {
return driver.findElement(AdminEdit1);
}
public static WebElement Submit_EditAdmin() {
return driver.findElement(Submit_EditAdmin);
}
public static WebElement Submit_EditAdmin1() {
return driver.findElement(Submit_EditAdmin1);
}
public static WebElement Ok_EditAdmin() {
return driver.findElement(Ok_EditAdmin);
}
//AdminHomePage methods
public static WebElement Constitutions() {
return driver.findElement(constitution);
}
public static WebElement AddConstitutions() {
return driver.findElement(AddConstitution);
}
public static WebElement ViewConstitutions() {
return driver.findElement(viewconstitution);
}
public static WebElement Divisions() {
return driver.findElement(Divisions);
}
public static WebElement DivisionAfterPositive() {
return driver.findElement(DivisionsAfterPositive);
}
public static WebElement AddDivisionAfterPositive() {
return driver.findElement(AddDivisionsAfterPositive);
}
public static WebElement ViewDivisionAfterPositive() {
return driver.findElement(ViewDivisionsAfterPositive);
}
public static WebElement AddDivisions() {
return driver.findElement(AddDivisions);
}
public static WebElement ViewDivisions() {
return driver.findElement(viewdivisions);
}
//AddConstitutions Methods
public static WebElement ConstitutionName() {
return driver.findElement(constitutionname);
}
public static WebElement FirstName() {
return driver.findElement(Firstname);
}
public static WebElement MiddleName() {
return driver.findElement(middlename);
}
public static WebElement LastName() {
return driver.findElement(lastname);
}
public static WebElement UserName1() {
return driver.findElement(username);
}
public static WebElement Password1() {
return driver.findElement(password);
}
public static WebElement email() {
return driver.findElement(email);
}
public static WebElement Gender() {
return driver.findElement(gender);
}
public static WebElement Mobile() {
return driver.findElement(mobile);
}
public static WebElement SubmitButton() {
return driver.findElement(submit);
}
public static WebElement OK() {
return driver.findElement(OK);
}
//ViewConstitutions
public static WebElement ChechBox() {
return driver.findElement(CheckBox);
}
public static WebElement SelectAllChechBox() {
return driver.findElement(SelectAllCheckBox);
}
public static WebElement Delete() {
return driver.findElement(Delete);
}
//ADdDivisions
public static WebElement DivisionName() {
return driver.findElement(DivisionName);
}
public static WebElement HomePageDivision() {
return driver.findElement(HomePageOfDivision);
}
public static WebElement Gender_D() {
return driver.findElement(gender_D);
}
public static WebElement Mobile_D() {
return driver.findElement(mobile_D);
}
public static WebElement Submit_D() {
return driver.findElement(submit_D);
}
//ViewDivisions
public static WebElement CheckBox_D() {
return driver.findElement(checkbox_D);
}
public static WebElement SelectAllCheckBox_D() {
return driver.findElement(selectallcheckbox_D);
}
public static WebElement Delete_D() {
return driver.findElement(delete_D);
}
//DivisionLogin
public static WebElement DivisionLogin_D() {
return driver.findElement(Divisionloginbtn);
}
public static WebElement Login_D() {
return driver.findElement(loginbtn_D);
}
//DivisionHomePage
public static WebElement Addproblem_D() {
return driver.findElement(AddProblem);
}
public static WebElement ViewProblem_D() {
return driver.findElement(ViewProblem);
}
//Add Problem
public static WebElement Gender_AddProblem() {
return driver.findElement(gender_AddProblem);
}
public static WebElement ProblemType() {
return driver.findElement(problemtype);
}
public static WebElement EnterProblem() {
return driver.findElement(enterproblem);
}
public static WebElement Submit_AddProblem() {
return driver.findElement(submit_addproblem);
}
public static WebElement Ok_AddProblemSuccess() {
return driver.findElement(ok_addproblemsuccess);
}
//ViewProblem
public static WebElement Edit_ViewProblem() {
return driver.findElement(EditBtn_Viewproblem);
}
public static WebElement Submit_EditProblem() {
return driver.findElement(submit_editproblem);
}
//ConstitutionLogin
public static WebElement ConstitutionLoginButton() {
return driver.findElement(ConstitutionLoginbtn);
}
public static WebElement Login_C() {
return driver.findElement(Login_C);
}
//ConstitutionHomePage
public static WebElement ViewProblem_C() {
return driver.findElement(viewproblem);
}
public static WebElement Delete_ViewProblem() {
return driver.findElement(Delete_viewproblem);
}
public static WebElement Back_Viewproblem_c() {
return driver.findElement(back_c);
}
public static WebElement ViewDivisions_C() {
return driver.findElement(ViewDivisions_C);
}
public static WebElement problems_C() {
return driver.findElement(problems);
}
public static WebElement PendingProblems() {
return driver.findElement(pendingproblems);
}
public static WebElement SuccessProblems() {
return driver.findElement(successproblems);
}
public static WebElement Approve_PendingProblem() {
return driver.findElement(Approve);
}
public static WebElement Ok_ProblemApproved() {
return driver.findElement(Ok_Approve);
}
}
|
UTF-8
|
Java
| 15,531 |
java
|
InspectElements.java
|
Java
|
[
{
"context": "1]/div/button/b/a\");\r\n static By user=By.name(\"username\");\r\n static By pswd=By.name(\"password\");\r\n ",
"end": 287,
"score": 0.9994834661483765,
"start": 279,
"tag": "USERNAME",
"value": "username"
},
{
"context": "ame(\"lastname\");\r\n static By username=By.name(\"username\");\r\n static By password=By.name(\"password\");\r\n",
"end": 3441,
"score": 0.9970276951789856,
"start": 3433,
"tag": "USERNAME",
"value": "username"
},
{
"context": "ame(\"username\");\r\n static By password=By.name(\"password\");\r\n static By email=By.name(\"email\");\r\n st",
"end": 3486,
"score": 0.994146466255188,
"start": 3478,
"tag": "PASSWORD",
"value": "password"
},
{
"context": " UserName1() {\r\n\t \t\r\n\t \treturn driver.findElement(username);\r\n\t \t\r\n\t }\r\n public static WebElement Password1(",
"end": 11161,
"score": 0.6431933045387268,
"start": 11153,
"tag": "USERNAME",
"value": "username"
}
] | null |
[] |
package Repository;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
public class InspectElements extends OpenBrowser{
//AdminLogin
static By AdminButton=By.xpath("/html/body/div[1]/div/div/div[1]/div/button/b/a");
static By user=By.name("username");
static By pswd=By.name("password");
static By LoginButton=By.xpath("/html/body/div[2]/div/div/form/div[3]/button");
static By menubar=By.xpath("/html/body/div/header/b/nav/a");
static By moreinfo=By.xpath("/html/body/div/b/div[1]/section/div[1]/div[1]/div/div[3]/a/font");
static By moreinfo1=By.xpath("/html/body/div/b/div[1]/section/div[1]/div/div/div[3]/a[1]/font");
static By back=By.cssSelector("body > div > b > div.content-wrapper > section > div:nth-child(1) > div > div > div.small-box-footer > a:nth-child(2) > font");
static By back1=By.xpath("/html/body/div/b/div[1]/form/button");
//ForgotUsernameORPassword
static By UsernameORpassword=By.xpath("/html/body/div/div/div/form/div[6]/a");
static By backToMainPage=By.xpath("/html/body/div[2]/div/div/form/div[5]/a");
static By email1 =By.name("email");
static By submit1=By.xpath("/html/body/form/input[2]");
static By backToMainPageAfter_D_Login=By.xpath("/html/body/div/div/div/form/div[5]/a");
//MyProfilePage
static By MyProfilePage=By.cssSelector("body > div > header > b > nav > div > ul > li > a > span");
static By Signout=By.cssSelector("body > div > header > b > nav > div > ul > li > ul > li.user-footer > div.pull-right > a");
static By AdminEdit=By.xpath("/html/body/div/header/b/nav/div/ul/li/ul/li[3]/div[1]/a");
static By Submit_EditAdmin=By.xpath("/html/body/div/b/div[1]/div/div/form/div[9]/div/button");
static By Submit_EditAdmin1=By.xpath(" /html/body/div/b/div[1]/div/div/form/div[9]/div/button");
static By Ok_EditAdmin=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
static By MyProfilePage1=By.cssSelector("body > div > header > nav > div > ul > li > a > img");
static By AdminEdit1=By.xpath("/html/body/div/header/nav/div/ul/li/ul/li[2]/div[1]/a");
//AdminHomePage
static By constitution=By.xpath("/html/body/div/b/aside/section/ul/li[2]/a");
static By AddConstitution=By.cssSelector("body > div > b > aside > section > ul > li.treeview.menu-open > ul > li.active > a");
static By viewconstitution=By.xpath("/html/body/div/b/aside/section/ul/li[2]/ul/li[2]/a");
static By Divisions=By.xpath("/html/body/div/aside/section/ul/li[3]/a/span[1]");
static By AddDivisions=By.cssSelector("body > div > aside > section > ul > li.treeview.menu-open > ul > li.active > a");
static By viewdivisions=By.cssSelector("body > div > b > aside > section > ul > li.treeview.menu-open > ul > li:nth-child(2) > a");
static By DivisionsAfterPositive=By.xpath("/html/body/div/b/aside/section/ul/li[3]/a/span[1]");
static By AddDivisionsAfterPositive=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[1]/a");
static By ViewDivisionsAfterPositive=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[2]/a");
//AddConstitutions
static By constitutionname=By.name("constitution");
static By Firstname=By.name("firstname");
static By middlename=By.name("middlename");
static By lastname=By.name("lastname");
static By username=By.name("username");
static By password=By.name("<PASSWORD>");
static By email=By.name("email");
static By gender=By.xpath("/html/body/div/b/div/div/div/form/div[8]/div/div/div[2]/label/input");
static By gender_D=By.xpath("/html/body/div/b/div/div/div/form/div[9]/div/div/div[2]/label/input");
static By mobile=By.xpath("//*[@id=\"phone\"]");
static By submit=By.xpath("/html/body/div/b/div/div/div/form/div[11]/div/button");
static By OK=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
//ViewConstitutions
static By CheckBox=By.xpath("//*[@id=\"customers\"]/tbody/tr[2]/td[1]/div/ins");
static By SelectAllCheckBox=By.cssSelector("#customers > tbody > tr:nth-child(1) > th:nth-child(1) > div > button > i");
static By Delete=By.xpath("//*[@id=\"customers\"]/tbody/tr[1]/th[1]/div/div/button/i");
// AddDivisions
static By DivisionName=By.name("division");
static By HomePageOfDivision=By.xpath("/html/body/div/b/div/div/div");
static By mobile_D=By.name("mobile");
static By submit_D=By.xpath("/html/body/div/b/div/div/div/form/div[12]/div/button");
//ViewDivisions
static By checkbox_D=By.xpath("//*[@id=\"customers\"]/tbody/tr[2]/td[1]/div/ins");
static By selectallcheckbox_D=By.cssSelector("#customers > tbody > tr:nth-child(1) > th:nth-child(1) > div > button > i");
static By delete_D=By.xpath("//*[@id=\"customers\"]/tbody/tr[1]/th[1]/div/div/button/i");
//DivisionLogin
static By Divisionloginbtn=By.xpath("/html/body/div[1]/div/div/div[3]/div/button/b/a");
static By loginbtn_D=By.xpath("/html/body/div/div/div/form/div[3]/button");
//DivisionHomePage
static By AddProblem=By.xpath("/html/body/div/b/aside/section/ul/li[2]/a/span[1]");
static By ViewProblem=By.xpath("/html/body/div/b/aside/section/ul/li[3]/a/span[1]");
//AddProblem
static By gender_AddProblem=By.xpath("/html/body/div/b/div/div/div/form/div[6]/div/div/div[2]/label/input");
static By problemtype=By.name("problemtype");
static By enterproblem=By.id("comment");
static By submit_addproblem=By.xpath("/html/body/div/b/div/div/div/form/div[12]/div/button");
static By ok_addproblemsuccess=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
//ViewProblems
static By EditBtn_Viewproblem=By.xpath("//*[@id=\"customers\"]/tbody/tr[2]/td[6]/button/a");
static By submit_editproblem=By.xpath("/html/body/div/b/div[1]/div/div/form/div[10]/div/button");
//ConstitutionLogin
static By ConstitutionLoginbtn=By.xpath("/html/body/div[1]/div/div/div[2]/div/button/span/b/a");
static By Login_C=By.xpath("/html/body/div/div/div/form/div[3]/button");
//ConstitutionHomePage
static By viewproblem=By.xpath("/html/body/div/b/div[1]/section/div/div/div[1]/div[3]/div/a/font");
static By Delete_viewproblem=By.cssSelector("body > div > div.content-wrapper > section > div > div > div > div.box-body.table-responsive.no-padding > table > tbody > tr:nth-child(2) > td:nth-child(6) > form > button > span");
static By back_c=By.xpath("/html/body/div/div[1]/section/form/button");
static By ViewDivisions_C=By.xpath("/html/body/div/b/aside/section/ul/li[2]/a/span[1]");
static By problems=By.cssSelector("body > div > b > aside > section > ul > li.treeview > a > span:nth-child(2)");
static By pendingproblems=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[1]/a");
static By successproblems=By.xpath("/html/body/div/b/aside/section/ul/li[3]/ul/li[2]/a");
static By Approve=By.xpath("/html/body/div/b/div/section/div/div/div/div[2]/table/tbody/tr[2]/td[5]/form/button/span");
static By Ok_Approve=By.xpath("/html/body/div[2]/div/div[10]/button[1]");
//AdminLoginMethods
public static WebElement adminbutton() {
return driver.findElement(AdminButton);
}
public static WebElement UserName() {
return driver.findElement(user);
}
public static WebElement Password() {
return driver.findElement(pswd);
}
public static WebElement Login() {
return driver.findElement(LoginButton);
}
public static WebElement MenuBar() {
return driver.findElement(menubar);
}
public static WebElement MoreInfo() {
return driver.findElement(moreinfo);
}
public static WebElement MoreInfo1() {
return driver.findElement(moreinfo1);
}
public static WebElement Back() {
return driver.findElement(back);
}
public static WebElement Back1() {
return driver.findElement(back1);
}
//ForgotUsernameORPassword
public static WebElement UsernameORPassword() {
return driver.findElement(UsernameORpassword);
}
public static WebElement BackToMainPage() {
return driver.findElement(backToMainPage);
}
public static WebElement BackToMainPageAfter_D_Login() {
return driver.findElement(backToMainPageAfter_D_Login);
}
public static WebElement email1() {
return driver.findElement(email1);
}
public static WebElement Submit1() {
return driver.findElement(submit1);
}
//MyProfilePage
public static WebElement MyProfilePage() {
return driver.findElement(MyProfilePage);
}
public static WebElement MyProfilePage1() {
return driver.findElement(MyProfilePage1);
}
public static WebElement SignOut() {
return driver.findElement(Signout);
}
public static WebElement AdminEdit() {
return driver.findElement(AdminEdit);
}
public static WebElement AdminEdit1() {
return driver.findElement(AdminEdit1);
}
public static WebElement Submit_EditAdmin() {
return driver.findElement(Submit_EditAdmin);
}
public static WebElement Submit_EditAdmin1() {
return driver.findElement(Submit_EditAdmin1);
}
public static WebElement Ok_EditAdmin() {
return driver.findElement(Ok_EditAdmin);
}
//AdminHomePage methods
public static WebElement Constitutions() {
return driver.findElement(constitution);
}
public static WebElement AddConstitutions() {
return driver.findElement(AddConstitution);
}
public static WebElement ViewConstitutions() {
return driver.findElement(viewconstitution);
}
public static WebElement Divisions() {
return driver.findElement(Divisions);
}
public static WebElement DivisionAfterPositive() {
return driver.findElement(DivisionsAfterPositive);
}
public static WebElement AddDivisionAfterPositive() {
return driver.findElement(AddDivisionsAfterPositive);
}
public static WebElement ViewDivisionAfterPositive() {
return driver.findElement(ViewDivisionsAfterPositive);
}
public static WebElement AddDivisions() {
return driver.findElement(AddDivisions);
}
public static WebElement ViewDivisions() {
return driver.findElement(viewdivisions);
}
//AddConstitutions Methods
public static WebElement ConstitutionName() {
return driver.findElement(constitutionname);
}
public static WebElement FirstName() {
return driver.findElement(Firstname);
}
public static WebElement MiddleName() {
return driver.findElement(middlename);
}
public static WebElement LastName() {
return driver.findElement(lastname);
}
public static WebElement UserName1() {
return driver.findElement(username);
}
public static WebElement Password1() {
return driver.findElement(password);
}
public static WebElement email() {
return driver.findElement(email);
}
public static WebElement Gender() {
return driver.findElement(gender);
}
public static WebElement Mobile() {
return driver.findElement(mobile);
}
public static WebElement SubmitButton() {
return driver.findElement(submit);
}
public static WebElement OK() {
return driver.findElement(OK);
}
//ViewConstitutions
public static WebElement ChechBox() {
return driver.findElement(CheckBox);
}
public static WebElement SelectAllChechBox() {
return driver.findElement(SelectAllCheckBox);
}
public static WebElement Delete() {
return driver.findElement(Delete);
}
//ADdDivisions
public static WebElement DivisionName() {
return driver.findElement(DivisionName);
}
public static WebElement HomePageDivision() {
return driver.findElement(HomePageOfDivision);
}
public static WebElement Gender_D() {
return driver.findElement(gender_D);
}
public static WebElement Mobile_D() {
return driver.findElement(mobile_D);
}
public static WebElement Submit_D() {
return driver.findElement(submit_D);
}
//ViewDivisions
public static WebElement CheckBox_D() {
return driver.findElement(checkbox_D);
}
public static WebElement SelectAllCheckBox_D() {
return driver.findElement(selectallcheckbox_D);
}
public static WebElement Delete_D() {
return driver.findElement(delete_D);
}
//DivisionLogin
public static WebElement DivisionLogin_D() {
return driver.findElement(Divisionloginbtn);
}
public static WebElement Login_D() {
return driver.findElement(loginbtn_D);
}
//DivisionHomePage
public static WebElement Addproblem_D() {
return driver.findElement(AddProblem);
}
public static WebElement ViewProblem_D() {
return driver.findElement(ViewProblem);
}
//Add Problem
public static WebElement Gender_AddProblem() {
return driver.findElement(gender_AddProblem);
}
public static WebElement ProblemType() {
return driver.findElement(problemtype);
}
public static WebElement EnterProblem() {
return driver.findElement(enterproblem);
}
public static WebElement Submit_AddProblem() {
return driver.findElement(submit_addproblem);
}
public static WebElement Ok_AddProblemSuccess() {
return driver.findElement(ok_addproblemsuccess);
}
//ViewProblem
public static WebElement Edit_ViewProblem() {
return driver.findElement(EditBtn_Viewproblem);
}
public static WebElement Submit_EditProblem() {
return driver.findElement(submit_editproblem);
}
//ConstitutionLogin
public static WebElement ConstitutionLoginButton() {
return driver.findElement(ConstitutionLoginbtn);
}
public static WebElement Login_C() {
return driver.findElement(Login_C);
}
//ConstitutionHomePage
public static WebElement ViewProblem_C() {
return driver.findElement(viewproblem);
}
public static WebElement Delete_ViewProblem() {
return driver.findElement(Delete_viewproblem);
}
public static WebElement Back_Viewproblem_c() {
return driver.findElement(back_c);
}
public static WebElement ViewDivisions_C() {
return driver.findElement(ViewDivisions_C);
}
public static WebElement problems_C() {
return driver.findElement(problems);
}
public static WebElement PendingProblems() {
return driver.findElement(pendingproblems);
}
public static WebElement SuccessProblems() {
return driver.findElement(successproblems);
}
public static WebElement Approve_PendingProblem() {
return driver.findElement(Approve);
}
public static WebElement Ok_ProblemApproved() {
return driver.findElement(Ok_Approve);
}
}
| 15,533 | 0.652373 | 0.643745 | 555 | 25.983784 | 31.906588 | 230 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.232432 | false | false |
13
|
53c714c79f19f0409b1d47531fb5d08d631eea75
| 33,054,068,325,821 |
8c647600c5f43878e9396efa56aecb22da001c4d
|
/simplified-tests/src/test/java/org/nypl/simplified/tests/local/opds/OPDSFeedEntryParserTest.java
|
c1df2017baca35fa12517bfb0f3b5750d3776bbb
|
[
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] |
permissive
|
jonathangreen/Simplified-Android-Core
|
https://github.com/jonathangreen/Simplified-Android-Core
|
e6df5f3a0a4c92a11811704bb0f07d757677c5a1
|
34a6fda48570a75372723b71acd36130570e1bcb
|
refs/heads/master
| 2022-12-11T02:54:58.447000 | 2020-07-21T16:11:28 | 2020-07-21T16:11:28 | 292,624,474 | 0 | 0 |
NOASSERTION
| true | 2020-09-03T16:35:13 | 2020-09-03T16:35:12 | 2020-09-02T18:27:49 | 2020-09-02T18:57:20 | 23,955 | 0 | 0 | 0 | null | false | false |
package org.nypl.simplified.tests.local.opds;
import org.nypl.simplified.tests.opds.OPDSFeedEntryParserContract;
public final class OPDSFeedEntryParserTest extends OPDSFeedEntryParserContract {
}
|
UTF-8
|
Java
| 199 |
java
|
OPDSFeedEntryParserTest.java
|
Java
|
[] | null |
[] |
package org.nypl.simplified.tests.local.opds;
import org.nypl.simplified.tests.opds.OPDSFeedEntryParserContract;
public final class OPDSFeedEntryParserTest extends OPDSFeedEntryParserContract {
}
| 199 | 0.854271 | 0.854271 | 7 | 27.428572 | 32.766956 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | false | false |
13
|
dbe7101acd90ba6ce76b26ebca158f74a3a46b0a
| 7,782,480,758,576 |
0d43618050dab63b2e317e0cd11e998ffa08e747
|
/analize-it/src/main/java/ru/alfabattle/kukolev/dto/UserAnalyticDto.java
|
4e79a9d6cfa015800930153cc711842d5361a198
|
[] |
no_license
|
kukolev/alfabattle
|
https://github.com/kukolev/alfabattle
|
aa6fcd9fe0627db92419de44fade1b429139282b
|
8ba15d1f5f12aaab0545686a0d4c9c578b365556
|
refs/heads/master
| 2022-11-13T02:34:25.117000 | 2020-06-27T13:58:52 | 2020-06-27T13:58:52 | 274,348,837 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ru.alfabattle.kukolev.dto;
import lombok.*;
import java.math.BigDecimal;
import java.util.*;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserAnalyticDto {
private String userId;
private BigDecimal totalSum = new BigDecimal(0);
private Map<String, AnalyticInfoDto> analyticInfo = new HashMap<>();
}
|
UTF-8
|
Java
| 335 |
java
|
UserAnalyticDto.java
|
Java
|
[] | null |
[] |
package ru.alfabattle.kukolev.dto;
import lombok.*;
import java.math.BigDecimal;
import java.util.*;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserAnalyticDto {
private String userId;
private BigDecimal totalSum = new BigDecimal(0);
private Map<String, AnalyticInfoDto> analyticInfo = new HashMap<>();
}
| 335 | 0.761194 | 0.758209 | 15 | 21.333334 | 19.841595 | 72 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.533333 | false | false |
13
|
2b64ab8daed611a760c420836efee5c5864a8f35
| 31,696,858,659,496 |
32bb7c996e02691cea319b86c5a74bb84b7aee12
|
/src/main/java/com/hbhb/cw/report/service/impl/ReportNoticeServiceImpl.java
|
ae080a86cc47dd44313e5af83b1b0e7e749a7ee8
|
[] |
no_license
|
hbhb-devloper/report-manage
|
https://github.com/hbhb-devloper/report-manage
|
a60dd6b01983e831174d7f94487426c59471fd60
|
6107e72c703942999040a9113f1db4801c57f635
|
refs/heads/master
| 2023-03-18T02:38:59.421000 | 2021-03-20T12:05:42 | 2021-03-20T12:05:42 | 349,712,531 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.hbhb.cw.report.service.impl;
import com.hbhb.core.utils.DateUtil;
import com.hbhb.cw.report.enums.NoticeState;
import com.hbhb.cw.report.enums.NoticeType;
import com.hbhb.cw.report.mapper.ReportNoticeMapper;
import com.hbhb.cw.report.model.ReportNotice;
import com.hbhb.cw.report.rpc.FlowTypeApiExp;
import com.hbhb.cw.report.rpc.SysDictApiExp;
import com.hbhb.cw.report.rpc.SysUserApiExp;
import com.hbhb.cw.report.rpc.UnitApiExp;
import com.hbhb.cw.report.service.ReportNoticeService;
import com.hbhb.cw.report.web.vo.NoticeReqVO;
import com.hbhb.cw.report.web.vo.NoticeResVO;
import com.hbhb.cw.report.web.vo.NoticeVO;
import com.hbhb.cw.report.web.vo.ReportNoticeVO;
import com.hbhb.cw.systemcenter.enums.DictCode;
import com.hbhb.cw.systemcenter.enums.TypeCode;
import com.hbhb.cw.systemcenter.vo.DictVO;
import org.beetl.sql.core.page.DefaultPageRequest;
import org.beetl.sql.core.page.PageRequest;
import org.beetl.sql.core.page.PageResult;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
/**
* @author yzc
* @since 2021-01-18
*/
@Service
@Slf4j
public class ReportNoticeServiceImpl implements ReportNoticeService {
@Resource
private ReportNoticeMapper noticeMapper;
@Resource
private SysUserApiExp userApi;
@Resource
private SysDictApiExp dictApi;
@Resource
private FlowTypeApiExp typeApi;
@Resource
private UnitApiExp unitApi;
@Override
public void addReportNotice(ReportNoticeVO build) {
ReportNotice notice = new ReportNotice();
BeanUtils.copyProperties(build, notice);
noticeMapper.insert(notice);
}
@Override
public void changeNoticeState(Long id) {
ReportNotice printNotice = new ReportNotice();
printNotice.setId(id);
printNotice.setState(1);
noticeMapper.updateTemplateById(printNotice);
}
@Override
public PageResult<NoticeResVO> pageReportNotice(NoticeReqVO noticeVo, Integer pageNum, Integer pageSize) {
PageRequest request = DefaultPageRequest.of(pageNum, pageSize);
PageResult<NoticeResVO> page = noticeMapper.selectPageByCond(noticeVo, request);
// 项目状态字典
List<DictVO> stateList = dictApi.getDict(TypeCode.FUND.value(), DictCode.FUND_INVOICE_STATUS.value());
Map<String, String> stateMap = stateList.stream().collect(
Collectors.toMap(DictVO::getValue, DictVO::getLabel));
// 组装
page.getList().forEach(item -> {
item.setStateLabel(stateMap.get(item.getState().toString()));
item.setFlowType(typeApi.getNameById(item.getFlowTypeId()));
item.setUnitName(unitApi.getUnitInfo(item.getUnitId()).getUnitName());
});
return page;
}
@Override
public List<NoticeVO> listReportNotice(Integer userId) {
List<ReportNotice> list = noticeMapper.createLambdaQuery()
.andEq(ReportNotice::getReceiver, userId)
.andEq(ReportNotice::getState, NoticeState.UN_READ.value())
.desc(ReportNotice::getCreateTime)
.select();
if (CollectionUtils.isEmpty(list)) {
return new ArrayList<>();
}
List<Integer> userIds = list.stream().map(ReportNotice::getPromoter).collect(Collectors.toList());
Map<Integer, String> userMap = userApi.getUserMapById(userIds);
return list.stream()
.map(notice -> NoticeVO.builder()
.id(notice.getId())
.content(notice.getContent())
.reportId(notice.getReportId())
.date(DateUtil.dateToString(notice.getCreateTime()))
.userName(userMap.get(notice.getPromoter()))
.noticeType(NoticeType.REPORT.value())
.build())
.collect(Collectors.toList());
}
@Override
public Long countNotice(Integer userId) {
return noticeMapper.createLambdaQuery()
.andEq(ReportNotice::getReceiver, userId)
.andEq(ReportNotice::getState, NoticeState.UN_READ.value())
.count();
}
}
|
UTF-8
|
Java
| 4,447 |
java
|
ReportNoticeServiceImpl.java
|
Java
|
[
{
"context": "\nimport lombok.extern.slf4j.Slf4j;\n\n/**\n * @author yzc\n * @since 2021-01-18\n */\n@Service\n@Slf4j\npublic c",
"end": 1301,
"score": 0.9996237754821777,
"start": 1298,
"tag": "USERNAME",
"value": "yzc"
}
] | null |
[] |
package com.hbhb.cw.report.service.impl;
import com.hbhb.core.utils.DateUtil;
import com.hbhb.cw.report.enums.NoticeState;
import com.hbhb.cw.report.enums.NoticeType;
import com.hbhb.cw.report.mapper.ReportNoticeMapper;
import com.hbhb.cw.report.model.ReportNotice;
import com.hbhb.cw.report.rpc.FlowTypeApiExp;
import com.hbhb.cw.report.rpc.SysDictApiExp;
import com.hbhb.cw.report.rpc.SysUserApiExp;
import com.hbhb.cw.report.rpc.UnitApiExp;
import com.hbhb.cw.report.service.ReportNoticeService;
import com.hbhb.cw.report.web.vo.NoticeReqVO;
import com.hbhb.cw.report.web.vo.NoticeResVO;
import com.hbhb.cw.report.web.vo.NoticeVO;
import com.hbhb.cw.report.web.vo.ReportNoticeVO;
import com.hbhb.cw.systemcenter.enums.DictCode;
import com.hbhb.cw.systemcenter.enums.TypeCode;
import com.hbhb.cw.systemcenter.vo.DictVO;
import org.beetl.sql.core.page.DefaultPageRequest;
import org.beetl.sql.core.page.PageRequest;
import org.beetl.sql.core.page.PageResult;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
/**
* @author yzc
* @since 2021-01-18
*/
@Service
@Slf4j
public class ReportNoticeServiceImpl implements ReportNoticeService {
@Resource
private ReportNoticeMapper noticeMapper;
@Resource
private SysUserApiExp userApi;
@Resource
private SysDictApiExp dictApi;
@Resource
private FlowTypeApiExp typeApi;
@Resource
private UnitApiExp unitApi;
@Override
public void addReportNotice(ReportNoticeVO build) {
ReportNotice notice = new ReportNotice();
BeanUtils.copyProperties(build, notice);
noticeMapper.insert(notice);
}
@Override
public void changeNoticeState(Long id) {
ReportNotice printNotice = new ReportNotice();
printNotice.setId(id);
printNotice.setState(1);
noticeMapper.updateTemplateById(printNotice);
}
@Override
public PageResult<NoticeResVO> pageReportNotice(NoticeReqVO noticeVo, Integer pageNum, Integer pageSize) {
PageRequest request = DefaultPageRequest.of(pageNum, pageSize);
PageResult<NoticeResVO> page = noticeMapper.selectPageByCond(noticeVo, request);
// 项目状态字典
List<DictVO> stateList = dictApi.getDict(TypeCode.FUND.value(), DictCode.FUND_INVOICE_STATUS.value());
Map<String, String> stateMap = stateList.stream().collect(
Collectors.toMap(DictVO::getValue, DictVO::getLabel));
// 组装
page.getList().forEach(item -> {
item.setStateLabel(stateMap.get(item.getState().toString()));
item.setFlowType(typeApi.getNameById(item.getFlowTypeId()));
item.setUnitName(unitApi.getUnitInfo(item.getUnitId()).getUnitName());
});
return page;
}
@Override
public List<NoticeVO> listReportNotice(Integer userId) {
List<ReportNotice> list = noticeMapper.createLambdaQuery()
.andEq(ReportNotice::getReceiver, userId)
.andEq(ReportNotice::getState, NoticeState.UN_READ.value())
.desc(ReportNotice::getCreateTime)
.select();
if (CollectionUtils.isEmpty(list)) {
return new ArrayList<>();
}
List<Integer> userIds = list.stream().map(ReportNotice::getPromoter).collect(Collectors.toList());
Map<Integer, String> userMap = userApi.getUserMapById(userIds);
return list.stream()
.map(notice -> NoticeVO.builder()
.id(notice.getId())
.content(notice.getContent())
.reportId(notice.getReportId())
.date(DateUtil.dateToString(notice.getCreateTime()))
.userName(userMap.get(notice.getPromoter()))
.noticeType(NoticeType.REPORT.value())
.build())
.collect(Collectors.toList());
}
@Override
public Long countNotice(Integer userId) {
return noticeMapper.createLambdaQuery()
.andEq(ReportNotice::getReceiver, userId)
.andEq(ReportNotice::getState, NoticeState.UN_READ.value())
.count();
}
}
| 4,447 | 0.680433 | 0.677725 | 120 | 35.924999 | 25.638891 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.583333 | false | false |
13
|
774c0d847f2a0f775411c86854436ee598b4cca7
| 8,839,042,716,179 |
5f9e12ccf8a6e3ba081d1a7dd8edf24090269d1f
|
/MySpider/src/spider/FinishedURLQueue.java
|
42f309ebc67b5bf9a13c7b110b58375eeeba6cde
|
[] |
no_license
|
shadowalker1150257856/spider
|
https://github.com/shadowalker1150257856/spider
|
e40190490babc9541ed2463e9a612a38a55d6d6a
|
f74e9c235e9bce69c3494340dc4da96040b1c064
|
refs/heads/master
| 2016-08-08T13:37:11.291000 | 2014-02-25T11:50:08 | 2014-02-25T11:50:08 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package spider;
import java.util.*;
import org.springframework.stereotype.Component;
@Component
public class FinishedURLQueue{
private Vector<String> finishedURLQueue = new Vector<String>();
/*返回URL*/
public synchronized String removeURL(){
boolean result = finishedURLQueue.isEmpty();
if(!result){
try{
String url = finishedURLQueue.remove(0);
return url;
}catch(ArrayIndexOutOfBoundsException e){
return null;
}
}
return null;
}
/*插入URL*/
public synchronized void insertURL(String url) throws Exception{
boolean result = finishedURLQueue.add(url);
if(!result)
throw new Exception("[fail to insert URL:"+url+"]:"+new Date());
}
/*判断是否为空*/
public synchronized boolean isEmpty() throws Exception{
throw new Exception("[finished url queue is empty]:"+new Date());
}
/*判断指定URL是否存在*/
public synchronized boolean isExist(String url){
int index = finishedURLQueue.lastIndexOf(url);
if(index == -1) return false;
else return true;
}
}
|
GB18030
|
Java
| 1,033 |
java
|
FinishedURLQueue.java
|
Java
|
[] | null |
[] |
package spider;
import java.util.*;
import org.springframework.stereotype.Component;
@Component
public class FinishedURLQueue{
private Vector<String> finishedURLQueue = new Vector<String>();
/*返回URL*/
public synchronized String removeURL(){
boolean result = finishedURLQueue.isEmpty();
if(!result){
try{
String url = finishedURLQueue.remove(0);
return url;
}catch(ArrayIndexOutOfBoundsException e){
return null;
}
}
return null;
}
/*插入URL*/
public synchronized void insertURL(String url) throws Exception{
boolean result = finishedURLQueue.add(url);
if(!result)
throw new Exception("[fail to insert URL:"+url+"]:"+new Date());
}
/*判断是否为空*/
public synchronized boolean isEmpty() throws Exception{
throw new Exception("[finished url queue is empty]:"+new Date());
}
/*判断指定URL是否存在*/
public synchronized boolean isExist(String url){
int index = finishedURLQueue.lastIndexOf(url);
if(index == -1) return false;
else return true;
}
}
| 1,033 | 0.708124 | 0.706118 | 43 | 22.186047 | 21.844328 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.790698 | false | false |
13
|
30ac19c4bee2aea3c7b48a63d3a9df9410137352
| 5,308,579,639,704 |
5de4425c555c3a58be0dd8d5b880ecb6fc3f69b7
|
/src/info/programese/service/AreaComputacaoService.java
|
6b2ac4d7f9eb13c3b92c6d9638537ceccb3e3fb3
|
[] |
no_license
|
livaper/ProgrameSe
|
https://github.com/livaper/ProgrameSe
|
f0f5f38ba732dc59f711932c6e3759c555250f48
|
de2685b2658079909ecdc91f58f7d6550725b21d
|
refs/heads/master
| 2020-06-16T05:53:54.268000 | 2016-12-04T15:46:30 | 2016-12-04T15:46:30 | 75,240,620 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package info.programese.service;
import java.sql.SQLException;
import java.util.List;
import info.programese.dao.AreaComputacaoDAO;
import info.programese.model.AreaComputacao;
public class AreaComputacaoService {
public static List<AreaComputacao> getTodasAreasComputacao() {
try {
return AreaComputacaoDAO.getTodasAreasComputacao();
} catch (SQLException e) {
return null;
}
}
public static AreaComputacao getAreaComputacaoById(int id) {
try {
return AreaComputacaoDAO.getAreaComputacaoById(id);
} catch (SQLException e) {
return null;
}
}
public static List<AreaComputacao> getAreasEmObjetoAprendizagem(Integer idObjeto) {
try {
return AreaComputacaoDAO.getAreasEmObjetoAprendizagem(idObjeto);
} catch (SQLException e) {
return null;
}
}
}
|
UTF-8
|
Java
| 791 |
java
|
AreaComputacaoService.java
|
Java
|
[] | null |
[] |
package info.programese.service;
import java.sql.SQLException;
import java.util.List;
import info.programese.dao.AreaComputacaoDAO;
import info.programese.model.AreaComputacao;
public class AreaComputacaoService {
public static List<AreaComputacao> getTodasAreasComputacao() {
try {
return AreaComputacaoDAO.getTodasAreasComputacao();
} catch (SQLException e) {
return null;
}
}
public static AreaComputacao getAreaComputacaoById(int id) {
try {
return AreaComputacaoDAO.getAreaComputacaoById(id);
} catch (SQLException e) {
return null;
}
}
public static List<AreaComputacao> getAreasEmObjetoAprendizagem(Integer idObjeto) {
try {
return AreaComputacaoDAO.getAreasEmObjetoAprendizagem(idObjeto);
} catch (SQLException e) {
return null;
}
}
}
| 791 | 0.76359 | 0.76359 | 34 | 22.264706 | 23.659731 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.558824 | false | false |
13
|
78218bb81ada7b48be1b7b016d08ab9f7a0bdc04
| 28,982,439,359,034 |
95d93397fb6720a5e60c5ff70d0f4f286a450d45
|
/app/src/main/java/com/mezyapps/new_reportanalyst/view/adapter/OutstandingHDReceivableAdapter.java
|
04e8c51d5983530445a09838778dc7e9580b8e83
|
[] |
no_license
|
mezyapps/NewReportAnalyst
|
https://github.com/mezyapps/NewReportAnalyst
|
efe6e3e37529020ef8af68a4af8046813c7d805a
|
a20847a969397c1b35a3feaec6e0a8a4c3457f4d
|
refs/heads/master
| 2020-07-21T07:59:19.312000 | 2020-02-19T10:33:02 | 2020-02-19T10:33:02 | 206,787,209 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.mezyapps.new_reportanalyst.view.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mezyapps.new_reportanalyst.R;
import com.mezyapps.new_reportanalyst.model.OutstandingPayableHDModel;
import com.mezyapps.new_reportanalyst.model.OutstandingReceivableModel;
import java.util.ArrayList;
public class OutstandingHDReceivableAdapter extends RecyclerView.Adapter<OutstandingHDReceivableAdapter.MyViewHolder> {
private ArrayList<OutstandingReceivableModel> outstandingReceivableModelArrayList;
private Context mContext;
public OutstandingHDReceivableAdapter(ArrayList<OutstandingReceivableModel> outstandingReceivableModelArrayList, Context mContext) {
this.outstandingReceivableModelArrayList = outstandingReceivableModelArrayList;
this.mContext = mContext;
}
@NonNull
@Override
public OutstandingHDReceivableAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.list_os_hd_payable,parent,false);
return new OutstandingHDReceivableAdapter.MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull OutstandingHDReceivableAdapter.MyViewHolder holder, int position) {
final OutstandingReceivableModel outstandingReceivableModel=outstandingReceivableModelArrayList.get(position);
holder.textPartyNamePayable.setText(outstandingReceivableModel.getParty_name());
holder.textAmount.setText(outstandingReceivableModel.getAmt());
}
@Override
public int getItemCount() {
return outstandingReceivableModelArrayList.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder {
private TextView textPartyNamePayable,textAmount;
public MyViewHolder(@NonNull View itemView) {
super(itemView);
textPartyNamePayable=itemView.findViewById(R.id.textPartyNamePayable);
textAmount=itemView.findViewById(R.id.textAmount);
}
}
}
|
UTF-8
|
Java
| 2,247 |
java
|
OutstandingHDReceivableAdapter.java
|
Java
|
[] | null |
[] |
package com.mezyapps.new_reportanalyst.view.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.mezyapps.new_reportanalyst.R;
import com.mezyapps.new_reportanalyst.model.OutstandingPayableHDModel;
import com.mezyapps.new_reportanalyst.model.OutstandingReceivableModel;
import java.util.ArrayList;
public class OutstandingHDReceivableAdapter extends RecyclerView.Adapter<OutstandingHDReceivableAdapter.MyViewHolder> {
private ArrayList<OutstandingReceivableModel> outstandingReceivableModelArrayList;
private Context mContext;
public OutstandingHDReceivableAdapter(ArrayList<OutstandingReceivableModel> outstandingReceivableModelArrayList, Context mContext) {
this.outstandingReceivableModelArrayList = outstandingReceivableModelArrayList;
this.mContext = mContext;
}
@NonNull
@Override
public OutstandingHDReceivableAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.list_os_hd_payable,parent,false);
return new OutstandingHDReceivableAdapter.MyViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull OutstandingHDReceivableAdapter.MyViewHolder holder, int position) {
final OutstandingReceivableModel outstandingReceivableModel=outstandingReceivableModelArrayList.get(position);
holder.textPartyNamePayable.setText(outstandingReceivableModel.getParty_name());
holder.textAmount.setText(outstandingReceivableModel.getAmt());
}
@Override
public int getItemCount() {
return outstandingReceivableModelArrayList.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder {
private TextView textPartyNamePayable,textAmount;
public MyViewHolder(@NonNull View itemView) {
super(itemView);
textPartyNamePayable=itemView.findViewById(R.id.textPartyNamePayable);
textAmount=itemView.findViewById(R.id.textAmount);
}
}
}
| 2,247 | 0.785937 | 0.785937 | 57 | 38.403507 | 38.549061 | 136 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.561404 | false | false |
13
|
6cdf4442ce21d9acc96ad45819855d33d18a6a95
| 19,172,734,064,611 |
89dd7dae68c13f8445e847e19be80ddbd1e4d31d
|
/MmbnDemo/src/com/example/mmbndemo/battle/attacks/Airshot.java
|
7bd0e845dd1c8226f23ff3182552ac94ed986aee
|
[] |
no_license
|
asapoz2/mmbngame
|
https://github.com/asapoz2/mmbngame
|
e249ebb11d6bb4d5d1d1d6f83d1ef2aba08d9dc0
|
68114dfe40d766c34f6cdbab1214a607f49ec1e8
|
refs/heads/master
| 2021-01-22T23:26:27.167000 | 2017-03-20T23:50:12 | 2017-03-20T23:50:12 | 85,638,536 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.mmbndemo.battle.attacks;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import com.example.mmbndemo.AndroidTutorial;
import com.example.mmbndemo.BitmapGetter;
import com.example.mmbndemo.R;
import com.example.mmbndemo.battle.BattleAttack;
import com.example.mmbndemo.battle.BattleInfo;
import com.example.mmbndemo.battle.BattleObject;
public class Airshot extends BattleAttack {
long startTimer;
private static Bitmap gunpic=null;
private static Bitmap megapic=null;
public Airshot(int x, int y,long numTimer){
this.x=x;
this.y=y;
startTimer=numTimer;
//currPhase=2;
shouldDie=false;
if(gunpic==null){
gunpic=BitmapGetter.getBitmap(R.drawable.airshot1);
megapic=BitmapGetter.getBitmap(R.drawable.mmbuster);
}
}
public void doAttack(BattleInfo info, long numTimer){
//currPhase--;
/*if(currPhase<=1){
shouldDie=true;
}*/
if(numTimer>startTimer+1){
shouldDie=true;
}else{
for(int i=x+1;i<6;i++){
if((i<info.horiz)&&info.getOccupier(info.toTileNumber(i, y))!=null ){
//System.out.println("found bad guy at "+i+","+y);
BattleObject occupier=info.getOccupier(info.toTileNumber(i, y));
int currTile=info.getTileOf(occupier);
occupier.damage(info,20);
if(!occupier.checkDead()){
if((i+1<=5)&&info.getOccupier(info.toTileNumber(i+1, y))==null){
info.setOccupier(occupier, info.toTileNumber(i+1, y));
info.setOccupier(null, currTile);
occupier.setX(i+1);
}
}
//info.damage(info.getOccupier(info.toTileNumber(i, y)),10);
return;
}
}
}
}
public void draw(Canvas c, BattleInfo info){
double scale=AndroidTutorial.scale;
double megax=x*40*scale;
double megay=(y*24+43)*scale;
/*g.drawImage((Image)defaultimage,megax,megay,megax+48,megay+46,0,0,48,46,null);
g.drawImage((Image)gunpic,megax+30,megay+10,megax+30+18,megay+10+13,0,0,18,13,null);*/
Rect dest= new Rect((int)(40*scale*x), (int)(43*scale+24*scale*y),(int)( 48*scale+40*scale*x),(int)(46*scale+43*scale+24*scale*y));
c.drawBitmap(megapic, null, dest, null);
Rect dest2= new Rect((int)(megax+30*scale), (int)(megay+10*scale),(int)( megax+48*scale),(int)(megay+23*scale));
c.drawBitmap(gunpic, null, dest2, null);
}
public boolean checkDead(){
return shouldDie;
}
}
|
UTF-8
|
Java
| 2,352 |
java
|
Airshot.java
|
Java
|
[] | null |
[] |
package com.example.mmbndemo.battle.attacks;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import com.example.mmbndemo.AndroidTutorial;
import com.example.mmbndemo.BitmapGetter;
import com.example.mmbndemo.R;
import com.example.mmbndemo.battle.BattleAttack;
import com.example.mmbndemo.battle.BattleInfo;
import com.example.mmbndemo.battle.BattleObject;
public class Airshot extends BattleAttack {
long startTimer;
private static Bitmap gunpic=null;
private static Bitmap megapic=null;
public Airshot(int x, int y,long numTimer){
this.x=x;
this.y=y;
startTimer=numTimer;
//currPhase=2;
shouldDie=false;
if(gunpic==null){
gunpic=BitmapGetter.getBitmap(R.drawable.airshot1);
megapic=BitmapGetter.getBitmap(R.drawable.mmbuster);
}
}
public void doAttack(BattleInfo info, long numTimer){
//currPhase--;
/*if(currPhase<=1){
shouldDie=true;
}*/
if(numTimer>startTimer+1){
shouldDie=true;
}else{
for(int i=x+1;i<6;i++){
if((i<info.horiz)&&info.getOccupier(info.toTileNumber(i, y))!=null ){
//System.out.println("found bad guy at "+i+","+y);
BattleObject occupier=info.getOccupier(info.toTileNumber(i, y));
int currTile=info.getTileOf(occupier);
occupier.damage(info,20);
if(!occupier.checkDead()){
if((i+1<=5)&&info.getOccupier(info.toTileNumber(i+1, y))==null){
info.setOccupier(occupier, info.toTileNumber(i+1, y));
info.setOccupier(null, currTile);
occupier.setX(i+1);
}
}
//info.damage(info.getOccupier(info.toTileNumber(i, y)),10);
return;
}
}
}
}
public void draw(Canvas c, BattleInfo info){
double scale=AndroidTutorial.scale;
double megax=x*40*scale;
double megay=(y*24+43)*scale;
/*g.drawImage((Image)defaultimage,megax,megay,megax+48,megay+46,0,0,48,46,null);
g.drawImage((Image)gunpic,megax+30,megay+10,megax+30+18,megay+10+13,0,0,18,13,null);*/
Rect dest= new Rect((int)(40*scale*x), (int)(43*scale+24*scale*y),(int)( 48*scale+40*scale*x),(int)(46*scale+43*scale+24*scale*y));
c.drawBitmap(megapic, null, dest, null);
Rect dest2= new Rect((int)(megax+30*scale), (int)(megay+10*scale),(int)( megax+48*scale),(int)(megay+23*scale));
c.drawBitmap(gunpic, null, dest2, null);
}
public boolean checkDead(){
return shouldDie;
}
}
| 2,352 | 0.696429 | 0.664541 | 73 | 31.219177 | 26.686535 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.520548 | false | false |
13
|
a4e7368d9b12f72744f0f9939b276dead838a92c
| 30,812,095,431,944 |
60552e6d0e6634b9505edb4b16302dc62dc00133
|
/SocketAnywhere/src/com/socketanywhere/nonbreaking/NBSocketListenerThread.java
|
73c19cf597f64af7c7f1dac6a413bb6652f86a68
|
[
"Apache-2.0"
] |
permissive
|
jgwest/socket-anywhere
|
https://github.com/jgwest/socket-anywhere
|
33ece4a6e65317864f4053b0b3f0c1156f432c7e
|
ef0a2976c25d62763ef7b56672acbc8d4a06ec3c
|
refs/heads/master
| 2021-06-20T06:04:35.539000 | 2021-02-09T04:20:39 | 2021-02-09T04:21:07 | 173,500,114 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
Copyright 2012, 2013 Jonathan West
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.socketanywhere.nonbreaking;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.Queue;
import com.socketanywhere.net.ISocketTL;
/** Listens for commands on a given thread; each time a socket is opened, a new instance
* of this thread is started to read on it. */
public class NBSocketListenerThread extends Thread {
ConnectionBrain _brain;
ISocketTL _innerSocket;
boolean _continueParsing = true;
NBOptions _options;
NBSocketCommandThread _scThread;
public NBSocketListenerThread(ISocketTL socket, ConnectionBrain brain, NBOptions options) {
super(NBSocketListenerThread.class.getName());
setPriority(Thread.NORM_PRIORITY+2);
setDaemon(true);
_innerSocket = socket;
_brain = brain;
_options = options;
_scThread = new NBSocketCommandThread(this);
_scThread.start();
}
/** Returns either a byte array with ALL of the requests bytes, or null (or throws IOE) */
private static byte[] readAndWait(InputStream is, int bytesWanted) throws IOException{
byte[] result = new byte[bytesWanted];
int currPos = 0;
int bytesRemaining = bytesWanted;
while(bytesRemaining > 0) {
// System.out.println(Thread.currentThread().getId()+" - bytesRemaining:"+bytesRemaining);
int bytesRead = is.read(result, currPos, bytesRemaining);
if(bytesRead == -1) {
return null;
} else {
bytesRemaining -= bytesRead;
currPos += bytesRead;
}
}
return result;
}
@Override
public void run() {
try {
_continueParsing = true;
while(_continueParsing) {
InputStream is = _innerSocket.getInputStream();
int bytesRead = 0;
// read magic number (4 bytes)
byte[] magicNumArr = readAndWait(is, 4);
if(magicNumArr == null) { _continueParsing = false; break; }
boolean matchMagicNumber = true;
if(magicNumArr.length != CmdAbstract.MAGIC_NUMBER.length) {
matchMagicNumber = false;
} else {
for(int x = 0; x < magicNumArr.length; x++) {
if(magicNumArr[x] != CmdAbstract.MAGIC_NUMBER[x]) {
matchMagicNumber = false;
break;
}
}
}
if(!matchMagicNumber) {
// Magic number doesn't match, so kill the socket and reconnect
_innerSocket.close();
NBLog.debug("Command received with invalid magic number. Socket closed.");
_continueParsing = false;
break;
}
bytesRead += 4;
// read cmd id (2 bytes)
byte[] cmdIdArr = readAndWait(is, 2);
if(cmdIdArr == null) { _continueParsing = false; break; }
bytesRead += 2;
// read command length (4 bytes)
byte[] lengthArr = readAndWait(is, 4);
if(lengthArr == null) { _continueParsing = false; break; }
int cmdLength = CmdAbstract.b2i(lengthArr);
bytesRead += 4;
byte[] innerCmdData = readAndWait(is, cmdLength-bytesRead);
if(innerCmdData == null) { _continueParsing = false; break; }
bytesRead += innerCmdData.length;
// Copy the entire command into a new array
byte[] fullCmdData = new byte[bytesRead];
int currPos = 0;
System.arraycopy(magicNumArr, 0, fullCmdData, currPos, magicNumArr.length); currPos += magicNumArr.length;
System.arraycopy(cmdIdArr, 0, fullCmdData, currPos, cmdIdArr.length); currPos += cmdIdArr.length;
System.arraycopy(lengthArr, 0, fullCmdData, currPos, lengthArr.length); currPos += lengthArr.length;
System.arraycopy(innerCmdData, 0, fullCmdData, currPos, innerCmdData.length); currPos += innerCmdData.length;
CmdAbstract cmd = CmdFactory.getInstance().createCommand(cmdIdArr);
try {
cmd.parseCommand(fullCmdData);
// _brain.eventCommandReceived(_innerSocket, cmd);
_scThread.addCommand(cmd);
} catch(Exception e) {
NBLog.error("Exception on command parsing of socket. ["+_continueParsing+"]");
if(_continueParsing) {
e.printStackTrace();
}
_continueParsing = false;
}
}
} catch (Exception e) {
if(_continueParsing) {
// If continue parsing is false, that means we stopped the thread, and this exception can be ignored.
NBLog.debug("Exception in NBSocketListenerThread - socket probably dead.");
}
}
// try {
// _innerSocket.close();
// } catch (IOException e) { }
_brain.eventConnErrDetectedReconnectIfNeeded(_innerSocket);
}
/** Stops the thread (from parsing) */
public void stopParsing() {
_continueParsing = false;
}
}
class NBSocketCommandThread extends Thread {
Queue<CmdAbstract> _queue = new LinkedList<CmdAbstract>();
NBSocketListenerThread _thread;
long _totalUnproccessedCmdLength = 0;
public NBSocketCommandThread(NBSocketListenerThread thread) {
super(NBSocketCommandThread.class.getName());
_thread = thread;
setPriority(Thread.NORM_PRIORITY+2);
}
public void addCommand(CmdAbstract cmd) {
synchronized(_queue) {
_queue.offer(cmd);
_totalUnproccessedCmdLength += cmd.getParsedCmdLength();
if(_queue.size() == 1) {
_queue.notify();
}
}
if(_thread._options.getMaxDataReceivedBuffer() != -1 /* INFINITE*/ ) {
// If we aren't clearing the queue fast enough, then block
boolean contQueueLoop = false;
do {
synchronized(_queue) {
if(_totalUnproccessedCmdLength >= _thread._options.getMaxDataReceivedBuffer()) {
contQueueLoop = true;
try { Thread.sleep(50); } catch(Exception e) {}
} else {
contQueueLoop = false;
}
}
} while(contQueueLoop);
}
}
@Override
public void run() {
while(_thread._continueParsing) {
CmdAbstract c = null;
synchronized(_queue) {
while(_queue.size() == 0 && _thread._continueParsing) {
try { _queue.wait(); } catch (InterruptedException e) { e.printStackTrace();
}
}
if(_queue.size() > 0) {
c = _queue.poll();
_totalUnproccessedCmdLength -= c.getParsedCmdLength();
}
}
if(c != null) {
_thread._brain.eventCommandReceived(_thread._innerSocket, c);
}
}
synchronized(_queue) {
_queue.clear();
}
}
}
|
UTF-8
|
Java
| 6,924 |
java
|
NBSocketListenerThread.java
|
Java
|
[
{
"context": "/*\r\n\tCopyright 2012, 2013 Jonathan West\r\n\r\n Licensed under the Apache License, Version ",
"end": 39,
"score": 0.9998801350593567,
"start": 26,
"tag": "NAME",
"value": "Jonathan West"
}
] | null |
[] |
/*
Copyright 2012, 2013 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.socketanywhere.nonbreaking;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.Queue;
import com.socketanywhere.net.ISocketTL;
/** Listens for commands on a given thread; each time a socket is opened, a new instance
* of this thread is started to read on it. */
public class NBSocketListenerThread extends Thread {
ConnectionBrain _brain;
ISocketTL _innerSocket;
boolean _continueParsing = true;
NBOptions _options;
NBSocketCommandThread _scThread;
public NBSocketListenerThread(ISocketTL socket, ConnectionBrain brain, NBOptions options) {
super(NBSocketListenerThread.class.getName());
setPriority(Thread.NORM_PRIORITY+2);
setDaemon(true);
_innerSocket = socket;
_brain = brain;
_options = options;
_scThread = new NBSocketCommandThread(this);
_scThread.start();
}
/** Returns either a byte array with ALL of the requests bytes, or null (or throws IOE) */
private static byte[] readAndWait(InputStream is, int bytesWanted) throws IOException{
byte[] result = new byte[bytesWanted];
int currPos = 0;
int bytesRemaining = bytesWanted;
while(bytesRemaining > 0) {
// System.out.println(Thread.currentThread().getId()+" - bytesRemaining:"+bytesRemaining);
int bytesRead = is.read(result, currPos, bytesRemaining);
if(bytesRead == -1) {
return null;
} else {
bytesRemaining -= bytesRead;
currPos += bytesRead;
}
}
return result;
}
@Override
public void run() {
try {
_continueParsing = true;
while(_continueParsing) {
InputStream is = _innerSocket.getInputStream();
int bytesRead = 0;
// read magic number (4 bytes)
byte[] magicNumArr = readAndWait(is, 4);
if(magicNumArr == null) { _continueParsing = false; break; }
boolean matchMagicNumber = true;
if(magicNumArr.length != CmdAbstract.MAGIC_NUMBER.length) {
matchMagicNumber = false;
} else {
for(int x = 0; x < magicNumArr.length; x++) {
if(magicNumArr[x] != CmdAbstract.MAGIC_NUMBER[x]) {
matchMagicNumber = false;
break;
}
}
}
if(!matchMagicNumber) {
// Magic number doesn't match, so kill the socket and reconnect
_innerSocket.close();
NBLog.debug("Command received with invalid magic number. Socket closed.");
_continueParsing = false;
break;
}
bytesRead += 4;
// read cmd id (2 bytes)
byte[] cmdIdArr = readAndWait(is, 2);
if(cmdIdArr == null) { _continueParsing = false; break; }
bytesRead += 2;
// read command length (4 bytes)
byte[] lengthArr = readAndWait(is, 4);
if(lengthArr == null) { _continueParsing = false; break; }
int cmdLength = CmdAbstract.b2i(lengthArr);
bytesRead += 4;
byte[] innerCmdData = readAndWait(is, cmdLength-bytesRead);
if(innerCmdData == null) { _continueParsing = false; break; }
bytesRead += innerCmdData.length;
// Copy the entire command into a new array
byte[] fullCmdData = new byte[bytesRead];
int currPos = 0;
System.arraycopy(magicNumArr, 0, fullCmdData, currPos, magicNumArr.length); currPos += magicNumArr.length;
System.arraycopy(cmdIdArr, 0, fullCmdData, currPos, cmdIdArr.length); currPos += cmdIdArr.length;
System.arraycopy(lengthArr, 0, fullCmdData, currPos, lengthArr.length); currPos += lengthArr.length;
System.arraycopy(innerCmdData, 0, fullCmdData, currPos, innerCmdData.length); currPos += innerCmdData.length;
CmdAbstract cmd = CmdFactory.getInstance().createCommand(cmdIdArr);
try {
cmd.parseCommand(fullCmdData);
// _brain.eventCommandReceived(_innerSocket, cmd);
_scThread.addCommand(cmd);
} catch(Exception e) {
NBLog.error("Exception on command parsing of socket. ["+_continueParsing+"]");
if(_continueParsing) {
e.printStackTrace();
}
_continueParsing = false;
}
}
} catch (Exception e) {
if(_continueParsing) {
// If continue parsing is false, that means we stopped the thread, and this exception can be ignored.
NBLog.debug("Exception in NBSocketListenerThread - socket probably dead.");
}
}
// try {
// _innerSocket.close();
// } catch (IOException e) { }
_brain.eventConnErrDetectedReconnectIfNeeded(_innerSocket);
}
/** Stops the thread (from parsing) */
public void stopParsing() {
_continueParsing = false;
}
}
class NBSocketCommandThread extends Thread {
Queue<CmdAbstract> _queue = new LinkedList<CmdAbstract>();
NBSocketListenerThread _thread;
long _totalUnproccessedCmdLength = 0;
public NBSocketCommandThread(NBSocketListenerThread thread) {
super(NBSocketCommandThread.class.getName());
_thread = thread;
setPriority(Thread.NORM_PRIORITY+2);
}
public void addCommand(CmdAbstract cmd) {
synchronized(_queue) {
_queue.offer(cmd);
_totalUnproccessedCmdLength += cmd.getParsedCmdLength();
if(_queue.size() == 1) {
_queue.notify();
}
}
if(_thread._options.getMaxDataReceivedBuffer() != -1 /* INFINITE*/ ) {
// If we aren't clearing the queue fast enough, then block
boolean contQueueLoop = false;
do {
synchronized(_queue) {
if(_totalUnproccessedCmdLength >= _thread._options.getMaxDataReceivedBuffer()) {
contQueueLoop = true;
try { Thread.sleep(50); } catch(Exception e) {}
} else {
contQueueLoop = false;
}
}
} while(contQueueLoop);
}
}
@Override
public void run() {
while(_thread._continueParsing) {
CmdAbstract c = null;
synchronized(_queue) {
while(_queue.size() == 0 && _thread._continueParsing) {
try { _queue.wait(); } catch (InterruptedException e) { e.printStackTrace();
}
}
if(_queue.size() > 0) {
c = _queue.poll();
_totalUnproccessedCmdLength -= c.getParsedCmdLength();
}
}
if(c != null) {
_thread._brain.eventCommandReceived(_thread._innerSocket, c);
}
}
synchronized(_queue) {
_queue.clear();
}
}
}
| 6,917 | 0.644714 | 0.638793 | 241 | 26.738588 | 26.541639 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.215768 | false | false |
13
|
24273eda54e98b86f3f76bc118ab2efbe3b03d62
| 12,799,002,588,082 |
3350ffee4d15756c7fc4278ebe119429cbddeaa8
|
/src/main/java/pl/olszewski/Blog/repository/AttachmentRepository.java
|
5fc4ef740bc5b78106d8ea3d5650d33d4e24fd89
|
[] |
no_license
|
loki380/Blog
|
https://github.com/loki380/Blog
|
9223dff4b3a2fbf6758064a3c056ee53f30e7b32
|
395ff9a7d26baf2670e32db73effcb43b8d1b984
|
refs/heads/master
| 2023-03-28T19:39:28.919000 | 2021-03-31T11:20:35 | 2021-03-31T11:20:35 | 353,327,889 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package pl.olszewski.Blog.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import pl.olszewski.Blog.domain.Attachment;
import pl.olszewski.Blog.domain.Author;
import java.util.List;
@Repository
public interface AttachmentRepository extends JpaRepository<Attachment, Integer> {
Attachment findById(int id);
Attachment findByFilename(String filename);
List<Attachment> findAllByIdPost(int id);
void deleteByFilename(String filename);
void deleteAllByPostId(Integer id);
}
|
UTF-8
|
Java
| 574 |
java
|
AttachmentRepository.java
|
Java
|
[] | null |
[] |
package pl.olszewski.Blog.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import pl.olszewski.Blog.domain.Attachment;
import pl.olszewski.Blog.domain.Author;
import java.util.List;
@Repository
public interface AttachmentRepository extends JpaRepository<Attachment, Integer> {
Attachment findById(int id);
Attachment findByFilename(String filename);
List<Attachment> findAllByIdPost(int id);
void deleteByFilename(String filename);
void deleteAllByPostId(Integer id);
}
| 574 | 0.799652 | 0.799652 | 23 | 23.956522 | 24.333691 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.521739 | false | false |
13
|
6717d425a15be653d8f3c705edd73b760f6c74a2
| 16,879,221,532,324 |
bdd820e89b8385ff03e583ea70d119246d1bb0ff
|
/test_maven/src/main/java/com/chenxi/test/utils/ChoseMobileUtils.java
|
07939fa7f59ed222c6f65f960d749e2addfe88c5
|
[] |
no_license
|
cy930826/test
|
https://github.com/cy930826/test
|
cb767b1bb81516ff8b77bbb8cb385a379b1b0620
|
cff4689fb5a44d2c335872afc23884fc2d34ee6c
|
refs/heads/master
| 2020-03-19T05:47:59.128000 | 2018-06-04T02:38:11 | 2018-06-04T02:38:11 | 135,962,886 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.chenxi.test.utils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class ChoseMobileUtils {
public static void createDianxinExcel(List<String>list){
int rowNo = 0;
int cellNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (list != null && list.size() > 0) {
for(int i = rowNo; i< list.size(); i ++) {
row = sheet.createRow(i);//获得第i行
cell = row.createCell(cellNo);//第i行第一个单元格
cell.setCellValue(list.get(i));
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\电信MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createLiantongExcel(List<String>list){
int rowNo = 0;
int cellNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (list != null && list.size() > 0) {
for(int i = rowNo; i< list.size(); i ++) {
row = sheet.createRow(i);//获得第i行
cell = row.createCell(cellNo);//第i行第一个单元格
cell.setCellValue(list.get(i));
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\联通MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createYidongExcel(List<String>list){
int rowNo = 0;
int cellNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (list != null && list.size() > 0) {
for(int i = rowNo; i< list.size(); i ++) {
row = sheet.createRow(i);//获得第i行
cell = row.createCell(cellNo);//第i行第一个单元格
cell.setCellValue(list.get(i));
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\移动MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createLiantongMD5MobileExcel(Map<String, String>map){
int rowNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (map != null && map.size() > 0) {
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
row = sheet.createRow(rowNo);//获得第i行
cell = row.createCell(0);//第i行第一个单元格
cell.setCellValue(stringStringEntry.getKey());
cell = row.createCell(1);//第i行第二个单元格
cell.setCellValue(stringStringEntry.getValue());
rowNo ++;
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\联通MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createYidongMD5MobileExcel(Map<String, String>map){
int rowNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (map != null && map.size() > 0) {
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
row = sheet.createRow(rowNo);//获得第i行
cell = row.createCell(0);//第i行第一个单元格
cell.setCellValue(stringStringEntry.getKey());
cell = row.createCell(1);//第i行第二个单元格
cell.setCellValue(stringStringEntry.getValue());
rowNo ++;
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\移动MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createDianxinMD5MobileExcel(Map<String, String>map){
int rowNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (map != null && map.size() > 0) {
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
row = sheet.createRow(rowNo);//获得第i行
cell = row.createCell(0);//第i行第一个单元格
cell.setCellValue(stringStringEntry.getKey());
cell = row.createCell(1);//第i行第二个单元格
cell.setCellValue(stringStringEntry.getValue());
rowNo ++;
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\电信MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
UTF-8
|
Java
| 6,041 |
java
|
ChoseMobileUtils.java
|
Java
|
[] | null |
[] |
package com.chenxi.test.utils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
public class ChoseMobileUtils {
public static void createDianxinExcel(List<String>list){
int rowNo = 0;
int cellNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (list != null && list.size() > 0) {
for(int i = rowNo; i< list.size(); i ++) {
row = sheet.createRow(i);//获得第i行
cell = row.createCell(cellNo);//第i行第一个单元格
cell.setCellValue(list.get(i));
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\电信MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createLiantongExcel(List<String>list){
int rowNo = 0;
int cellNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (list != null && list.size() > 0) {
for(int i = rowNo; i< list.size(); i ++) {
row = sheet.createRow(i);//获得第i行
cell = row.createCell(cellNo);//第i行第一个单元格
cell.setCellValue(list.get(i));
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\联通MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createYidongExcel(List<String>list){
int rowNo = 0;
int cellNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (list != null && list.size() > 0) {
for(int i = rowNo; i< list.size(); i ++) {
row = sheet.createRow(i);//获得第i行
cell = row.createCell(cellNo);//第i行第一个单元格
cell.setCellValue(list.get(i));
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\移动MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createLiantongMD5MobileExcel(Map<String, String>map){
int rowNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (map != null && map.size() > 0) {
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
row = sheet.createRow(rowNo);//获得第i行
cell = row.createCell(0);//第i行第一个单元格
cell.setCellValue(stringStringEntry.getKey());
cell = row.createCell(1);//第i行第二个单元格
cell.setCellValue(stringStringEntry.getValue());
rowNo ++;
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\联通MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createYidongMD5MobileExcel(Map<String, String>map){
int rowNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (map != null && map.size() > 0) {
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
row = sheet.createRow(rowNo);//获得第i行
cell = row.createCell(0);//第i行第一个单元格
cell.setCellValue(stringStringEntry.getKey());
cell = row.createCell(1);//第i行第二个单元格
cell.setCellValue(stringStringEntry.getValue());
rowNo ++;
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\移动MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void createDianxinMD5MobileExcel(Map<String, String>map){
int rowNo = 0;
XSSFCell cell;
XSSFRow row;
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet();
if (map != null && map.size() > 0) {
for (Map.Entry<String, String> stringStringEntry : map.entrySet()) {
row = sheet.createRow(rowNo);//获得第i行
cell = row.createCell(0);//第i行第一个单元格
cell.setCellValue(stringStringEntry.getKey());
cell = row.createCell(1);//第i行第二个单元格
cell.setCellValue(stringStringEntry.getValue());
rowNo ++;
}
}
try {
FileOutputStream fout = new FileOutputStream("C:\\Users\\dell\\Desktop\\电信MobileNo"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date()) + ".xlsx");
wb.write(fout);
} catch (Exception e) {
e.printStackTrace();
}
}
}
| 6,041 | 0.55382 | 0.5497 | 164 | 34.518291 | 32.333149 | 162 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.615854 | false | false |
13
|
ded3718d7038bc26d47ea32828aa0acec9070a09
| 13,666,585,976,313 |
7894ca69c76c70e61168cf8b7b0f7eeaea0b8dea
|
/src/main/java/com/ai/baas/batch/client/util/RouterUtil.java
|
07f3ed3be8497b5a4d2dac29068ff79f9df81df5
|
[] |
no_license
|
AI-OPT/baas-batch-order-client
|
https://github.com/AI-OPT/baas-batch-order-client
|
1549bcb943894cc9ff3a2ee69563ecd5bea62edb
|
19b3a2e738cd58bda69fb249904b96fae34ed8d8
|
refs/heads/master
| 2016-09-15T11:51:51.923000 | 2016-09-06T08:54:29 | 2016-09-06T08:54:29 | 62,537,319 | 1 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ai.baas.batch.client.util;
import com.ai.baas.batch.client.service.ICalProcessor;
public class RouterUtil {
@SuppressWarnings("unchecked")
public ICalProcessor getProcessorByRoute(String strClazz)throws Exception{
Class<ICalProcessor> clazz = (Class<ICalProcessor>)Class.forName(strClazz);
return clazz.newInstance();
}
}
|
UTF-8
|
Java
| 356 |
java
|
RouterUtil.java
|
Java
|
[] | null |
[] |
package com.ai.baas.batch.client.util;
import com.ai.baas.batch.client.service.ICalProcessor;
public class RouterUtil {
@SuppressWarnings("unchecked")
public ICalProcessor getProcessorByRoute(String strClazz)throws Exception{
Class<ICalProcessor> clazz = (Class<ICalProcessor>)Class.forName(strClazz);
return clazz.newInstance();
}
}
| 356 | 0.766854 | 0.766854 | 12 | 27.666666 | 27.629494 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.916667 | false | false |
13
|
e83b4eed83702feabcbe822055e09e765adadbb1
| 670,014,948,449 |
973fa912f19fdb6ccd8fd387a718f0c968ef248b
|
/app/src/main/java/xyz/yakdmt/followmeradio/injection/component/ActivityComponent.java
|
f154e3e866b975360678944f1a415629cc4e6723
|
[] |
no_license
|
yakdmt/follow-me-radio-android
|
https://github.com/yakdmt/follow-me-radio-android
|
1b22ebbf603a215b52644a2161a02c23ad51de75
|
d9eda9576a3047ed82cef14e1277a3147e7ec9d5
|
refs/heads/master
| 2021-01-20T21:16:23.575000 | 2016-06-12T14:12:48 | 2016-06-12T14:12:48 | 59,887,012 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package xyz.yakdmt.followmeradio.injection.component;
import android.app.Activity;
import android.content.Context;
import dagger.Component;
import xyz.yakdmt.followmeradio.injection.ActivityContext;
import xyz.yakdmt.followmeradio.injection.PerActivity;
import xyz.yakdmt.followmeradio.injection.modules.ActivityModule;
import xyz.yakdmt.followmeradio.ui.main.MainActivity;
/**
* Created by yakdmt on 09/04/16.
*/
@PerActivity
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
void inject(MainActivity mainActivity);
@ActivityContext Context context();
Activity activity();
}
|
UTF-8
|
Java
| 669 |
java
|
ActivityComponent.java
|
Java
|
[
{
"context": "owmeradio.ui.main.MainActivity;\n\n/**\n * Created by yakdmt on 09/04/16.\n */\n@PerActivity\n@Component(dependen",
"end": 401,
"score": 0.9996326565742493,
"start": 395,
"tag": "USERNAME",
"value": "yakdmt"
}
] | null |
[] |
package xyz.yakdmt.followmeradio.injection.component;
import android.app.Activity;
import android.content.Context;
import dagger.Component;
import xyz.yakdmt.followmeradio.injection.ActivityContext;
import xyz.yakdmt.followmeradio.injection.PerActivity;
import xyz.yakdmt.followmeradio.injection.modules.ActivityModule;
import xyz.yakdmt.followmeradio.ui.main.MainActivity;
/**
* Created by yakdmt on 09/04/16.
*/
@PerActivity
@Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
void inject(MainActivity mainActivity);
@ActivityContext Context context();
Activity activity();
}
| 669 | 0.807175 | 0.798206 | 24 | 26.875 | 24.856777 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
13
|
900ed26ffd60ae136cbb0f98011b07bd235fbf17
| 13,091,060,386,389 |
01ce875263d1842cbe3cbde34362ad991338be12
|
/app/src/main/java/com/hotmail/ghazaljaved1993/movieslice/Activity/SearchResultsActivity.java
|
25ddcc914f4ac0626580770be04f2aad997ae001
|
[] |
no_license
|
javedghazal/MovieSlice
|
https://github.com/javedghazal/MovieSlice
|
b3186dbd108823d895973f717ecce5522188f3e1
|
69567700f08af71ecfc134a303e63c965b6c9749
|
refs/heads/master
| 2021-01-01T18:52:28.969000 | 2017-07-27T00:40:09 | 2017-07-27T00:40:09 | 76,057,770 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.hotmail.ghazaljaved1993.movieslice.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.widget.Toast;
import com.hotmail.ghazaljaved1993.movieslice.Retrofit.ApiClient;
import com.hotmail.ghazaljaved1993.movieslice.R;
import com.hotmail.ghazaljaved1993.movieslice.Retrofit.ApiInterface;
import com.hotmail.ghazaljaved1993.movieslice.data.Movie;
import com.hotmail.ghazaljaved1993.movieslice.data.MoviesResponse;
import com.hotmail.ghazaljaved1993.movieslice.Adapters.MoviesAdapter;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class SearchResultsActivity extends AppCompatActivity {
RecyclerView recycler_search;
private GridLayoutManager gridLayoutManager;
private MoviesAdapter moviesAdapter;
Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search_results);
Log.d("Inside: ", "SearchResultsActivity");
toolbar = (Toolbar) findViewById(R.id.toolbar_searchResults);
setSupportActionBar(toolbar);
recycler_search = (RecyclerView) findViewById(R.id.recycler_search);
gridLayoutManager = new GridLayoutManager(this, 1);
recycler_search.setLayoutManager(gridLayoutManager);
Intent i = getIntent();
if(i!=null)
{
Log.d("Inside: ", "I IS NOT NULL");
final String query = i.getStringExtra("query");
setTitle("Search Results for "+query);
String api_key = "aa30ea4bd93242bad0effff696d4e82a";
ApiInterface apiService =
ApiClient.getClient().create(ApiInterface.class);
Call<MoviesResponse> call = apiService.getSearchMovie(query, api_key);
call.enqueue(new Callback<MoviesResponse>() {
@Override
public void onResponse(Call<MoviesResponse> call, Response<MoviesResponse> response) {
List<Movie> results = response.body().getResults();
// Log.d("SEARCH ACTIVITY", "Number of search received: " + results.size());
// Log.d("SEARCH ACTIVITY", "" + results.get(0).getTitle());
if(!results.isEmpty())
{
moviesAdapter = new MoviesAdapter(SearchResultsActivity.this, SearchResultsActivity.this, getResources(), results);
recycler_search.setAdapter(moviesAdapter);
}
else
{
setTitle("No Results found for "+query);
}
}
@Override
public void onFailure(Call<MoviesResponse> call, Throwable t) {
Toast.makeText(getApplicationContext(), t.toString(), Toast.LENGTH_LONG).show();
}
});
}
}
}
|
UTF-8
|
Java
| 3,203 |
java
|
SearchResultsActivity.java
|
Java
|
[
{
"context": "sults for \"+query);\n String api_key = \"aa30ea4bd93242bad0effff696d4e82a\";\n ApiInterface apiService =\n ",
"end": 1868,
"score": 0.9996382594108582,
"start": 1836,
"tag": "KEY",
"value": "aa30ea4bd93242bad0effff696d4e82a"
}
] | null |
[] |
package com.hotmail.ghazaljaved1993.movieslice.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.widget.Toast;
import com.hotmail.ghazaljaved1993.movieslice.Retrofit.ApiClient;
import com.hotmail.ghazaljaved1993.movieslice.R;
import com.hotmail.ghazaljaved1993.movieslice.Retrofit.ApiInterface;
import com.hotmail.ghazaljaved1993.movieslice.data.Movie;
import com.hotmail.ghazaljaved1993.movieslice.data.MoviesResponse;
import com.hotmail.ghazaljaved1993.movieslice.Adapters.MoviesAdapter;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class SearchResultsActivity extends AppCompatActivity {
RecyclerView recycler_search;
private GridLayoutManager gridLayoutManager;
private MoviesAdapter moviesAdapter;
Toolbar toolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search_results);
Log.d("Inside: ", "SearchResultsActivity");
toolbar = (Toolbar) findViewById(R.id.toolbar_searchResults);
setSupportActionBar(toolbar);
recycler_search = (RecyclerView) findViewById(R.id.recycler_search);
gridLayoutManager = new GridLayoutManager(this, 1);
recycler_search.setLayoutManager(gridLayoutManager);
Intent i = getIntent();
if(i!=null)
{
Log.d("Inside: ", "I IS NOT NULL");
final String query = i.getStringExtra("query");
setTitle("Search Results for "+query);
String api_key = "aa30ea4bd93242bad0effff696d4e82a";
ApiInterface apiService =
ApiClient.getClient().create(ApiInterface.class);
Call<MoviesResponse> call = apiService.getSearchMovie(query, api_key);
call.enqueue(new Callback<MoviesResponse>() {
@Override
public void onResponse(Call<MoviesResponse> call, Response<MoviesResponse> response) {
List<Movie> results = response.body().getResults();
// Log.d("SEARCH ACTIVITY", "Number of search received: " + results.size());
// Log.d("SEARCH ACTIVITY", "" + results.get(0).getTitle());
if(!results.isEmpty())
{
moviesAdapter = new MoviesAdapter(SearchResultsActivity.this, SearchResultsActivity.this, getResources(), results);
recycler_search.setAdapter(moviesAdapter);
}
else
{
setTitle("No Results found for "+query);
}
}
@Override
public void onFailure(Call<MoviesResponse> call, Throwable t) {
Toast.makeText(getApplicationContext(), t.toString(), Toast.LENGTH_LONG).show();
}
});
}
}
}
| 3,203 | 0.65064 | 0.634405 | 78 | 40.064102 | 28.949709 | 139 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.75641 | false | false |
13
|
a6249d1220e1ee662405cbd270bfa611618a327a
| 33,500,744,964,369 |
01bc2bf9e407513edf486fb70921a7a3af93d4a4
|
/projetmajeur/Partie Serveur/Faircorp Commun/src/main/java/com/emse/spring/faircorp/model/LightDao.java
|
33e5a12ae312e560ea5d401f256af56447b6630a
|
[] |
no_license
|
NoeSAFFAF/MyWork
|
https://github.com/NoeSAFFAF/MyWork
|
4e38d61ea704cd6b581912af8ceeed3225f048e2
|
25f6cbe8fd1dba97e681b2231f9e4b0e7aed10f4
|
refs/heads/master
| 2022-04-10T17:21:24.235000 | 2020-03-27T18:12:33 | 2020-03-27T18:12:33 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.emse.spring.faircorp.model;
//On crée une interface pour implémenter des méthodes de JpaRepository, utile pour pour modifier notre table de manière dynamique
import com.emse.spring.faircorp.entity.Light;
import org.springframework.data.jpa.repository.JpaRepository;
public interface LightDao extends JpaRepository<Light,Long>,LightDaoCustom {
}
|
UTF-8
|
Java
| 363 |
java
|
LightDao.java
|
Java
|
[] | null |
[] |
package com.emse.spring.faircorp.model;
//On crée une interface pour implémenter des méthodes de JpaRepository, utile pour pour modifier notre table de manière dynamique
import com.emse.spring.faircorp.entity.Light;
import org.springframework.data.jpa.repository.JpaRepository;
public interface LightDao extends JpaRepository<Light,Long>,LightDaoCustom {
}
| 363 | 0.832869 | 0.832869 | 8 | 43.875 | 42.25647 | 129 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.75 | false | false |
13
|
eff9510ae6b2022ebbfd8f1d8c1c1ee938459fd1
| 14,439,680,110,344 |
99a15911a848676894f7cbae01d514d052f16043
|
/ai-steering/SteeringFX_final/src/common/misc/Cgdi.java
|
85dfe6ca865ccf7d44dfc212018040b55efa3e8f
|
[] |
no_license
|
algerd/ai
|
https://github.com/algerd/ai
|
13f2adb6a7c7eea27e64c23912186513a9dc8baf
|
4fa0212d4fe30106b497fd4f9c44399866185b76
|
refs/heads/master
| 2021-01-11T10:16:28.198000 | 2016-11-01T15:49:14 | 2016-11-01T15:49:14 | 72,550,742 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package common.misc;
import common.D2.Vector2D;
import java.util.List;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.paint.Color;
public class Cgdi {
private GraphicsContext gc;
public Cgdi(GraphicsContext gc) {
this.gc = gc;
}
public void clear() {
gc.clearRect(0, 0, gc.getCanvas().getWidth(), gc.getCanvas().getHeight());
}
public void drawPolygon(List<Vector2D> points) {
int length = points.size();
if (length > 0) {
double[] xPoints = new double[length];
double[] yPoints = new double[length];
for (int i = 0 ; i < length; i++) {
xPoints[i] = points.get(i).x;
yPoints[i] = points.get(i).y;
}
gc.setLineWidth(1.0);
gc.setStroke(Color.BLACK);
gc.strokePolygon(xPoints, yPoints, length);
}
}
public void drawCircle(double x, double y, double radius) {
gc.setLineWidth(1.0);
gc.setStroke(Color.RED);
gc.strokeOval(x, y, radius * 2, radius * 2);
}
public void drawLine(Vector2D from, Vector2D to) {
gc.setLineWidth(1.0);
gc.setStroke(Color.BLACK);
gc.strokeLine(from.x, from.y, to.x, to.y);
}
public void drawLine(double fromX, double fromY, double toX, double toY) {
gc.setLineWidth(1.0);
gc.setStroke(Color.BLACK);
gc.strokeLine(fromX, fromY, toX, toY);
}
}
|
UTF-8
|
Java
| 1,528 |
java
|
Cgdi.java
|
Java
|
[] | null |
[] |
package common.misc;
import common.D2.Vector2D;
import java.util.List;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.paint.Color;
public class Cgdi {
private GraphicsContext gc;
public Cgdi(GraphicsContext gc) {
this.gc = gc;
}
public void clear() {
gc.clearRect(0, 0, gc.getCanvas().getWidth(), gc.getCanvas().getHeight());
}
public void drawPolygon(List<Vector2D> points) {
int length = points.size();
if (length > 0) {
double[] xPoints = new double[length];
double[] yPoints = new double[length];
for (int i = 0 ; i < length; i++) {
xPoints[i] = points.get(i).x;
yPoints[i] = points.get(i).y;
}
gc.setLineWidth(1.0);
gc.setStroke(Color.BLACK);
gc.strokePolygon(xPoints, yPoints, length);
}
}
public void drawCircle(double x, double y, double radius) {
gc.setLineWidth(1.0);
gc.setStroke(Color.RED);
gc.strokeOval(x, y, radius * 2, radius * 2);
}
public void drawLine(Vector2D from, Vector2D to) {
gc.setLineWidth(1.0);
gc.setStroke(Color.BLACK);
gc.strokeLine(from.x, from.y, to.x, to.y);
}
public void drawLine(double fromX, double fromY, double toX, double toY) {
gc.setLineWidth(1.0);
gc.setStroke(Color.BLACK);
gc.strokeLine(fromX, fromY, toX, toY);
}
}
| 1,528 | 0.555628 | 0.543194 | 53 | 27.811321 | 21.135731 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.886792 | false | false |
13
|
9bd686922f7765840c1a016398c7f094db1c2443
| 24,670,292,197,857 |
c85a09effeb5c55f35ad2b10717d7a64757e5448
|
/src/main/java/com/schetinin/examples/App.java
|
f5ceb82ad06fbbce694f8ceedc6e4fc6a08e134d
|
[] |
no_license
|
Schetinin/examples
|
https://github.com/Schetinin/examples
|
0144ced9895a153bda83daf18ae75a8850b80408
|
65574b9481f4b99e705ac4b62de508e0408d4f3c
|
refs/heads/master
| 2021-08-28T08:28:04.839000 | 2017-12-11T18:20:13 | 2017-12-11T18:20:13 | 111,366,083 | 0 | 1 | null | false | 2017-11-23T17:32:34 | 2017-11-20T05:31:41 | 2017-11-20T05:34:51 | 2017-11-23T17:32:34 | 35 | 0 | 1 | 0 |
Java
| false | null |
package com.schetinin.examples;
import java.io.IOException;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Hello world!
*/
public class App {
public static final int HITTER_POOL_SIZE = 10;
public static final int STATS_POOL_SIZE = 30;
private static final int FAKE_POOL_SIZE = 5;
private static ExecutorService hittersPool;
private static ExecutorService statsPool;
private static ExecutorService fakePool;
private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
public static void sout(String str){
System.out.println(String.format("%s [%s] - %s",dateFormat.format(new Date()),Thread.currentThread().getName(),str));
}
public static void main(String[] args) throws InterruptedException {
sout("On queue");
for (int i = 0; i <= 21; i++) {
System.out.print(String.format("%d, ", Fibonatchi.calc(i)));
}
sout("\nrecursion");
for (int i = 0; i <= 21; i++) {
System.out.print(String.format("%d, ", FibonatchiRecursion.calc(i)));
}
System.out.print("\n\nSorting\n\tBefore\n\t\t");
int[] arr = {7, 4, 76, 78, 3, 6, 7, 8, 42, 324, 346, 68786, 21, 0};
for (int i = 0; i < arr.length; i++) {
System.out.print(String.format("%d, ", arr[i]));
}
BubbleSort.sort(arr);
System.out.print("\n\tAfter\n\t\t");
for (int i = 0; i < arr.length; i++) {
System.out.print(String.format("%d, ", arr[i]));
}
sout("\nStat test begin");
runHitStatisticTest();
sout("\nAll threads made. Press any key to exit");
Thread.sleep(100000);
pauseWhileKeyPress();
StatConsoleReader.work.set(false);
Hitter.work.set(false);
FakeRunner.work.set(false);
hittersPool.shutdown();
statsPool.shutdown();
fakePool.shutdown();
}
private static void pauseWhileKeyPress() {
try {
//System.in.read();
Thread.sleep(3000);
} catch (Exception e) {
}
}
private static class Hitter extends BaseRunner{
@Override
protected void process() {
try {
HitStatistics.getInstance().hit();
//Thread.sleep((long) (Math.random() * 1000));
} catch (Exception e) {
work.set(false);
}
}
}
private static class StatConsoleReader extends BaseRunner {
private HitStatistics.Period period;
public StatConsoleReader(HitStatistics.Period period) {
this.period = period;
}
@Override
protected void process() {
try {
sout(String.format(" Period:%s\t-\tstat:%d", period.toString(), HitStatistics.getInstance().getCountPerPeriod(period)));
Thread.sleep(1000);
} catch (InterruptedException e) {
work.set(false);
}
}
}
private static class StatFakeReader extends BaseRunner{
static AtomicBoolean work = new AtomicBoolean(true);
private HitStatistics.Period period;
public StatFakeReader(HitStatistics.Period period) {
this.period = period;
}
@Override
protected void process() {
try {
HitStatistics.getInstance().getCountPerPeriod(period);
} catch (Exception e) {
work.set(false);
}
}
}
private static class FakeRunner extends BaseRunner {
@Override
protected void process() {
}
}
private static void runHitStatisticTest() {
hittersPool = Executors.newFixedThreadPool(HITTER_POOL_SIZE);
statsPool = Executors.newFixedThreadPool(HitStatistics.Period.values().length+STATS_POOL_SIZE);
fakePool = Executors.newFixedThreadPool(FAKE_POOL_SIZE);
for (int i = 0; i < HITTER_POOL_SIZE; i++) {
hittersPool.execute(new Hitter());
}
/*for (HitStatistics.Period period : HitStatistics.Period.values()) {
statsPool.execute(new StatConsoleReader(period));
}*/
statsPool.execute(new StatConsoleReader(HitStatistics.Period.SECOND));
for (int i = 0; i < FAKE_POOL_SIZE; i++) {
pauseWhileKeyPress();
try {
statsPool.execute(new FakeRunner());
sout(String.format("Add %d reader:FAKE",i+1));
} catch (Exception e) {
return;
}
}
List<HitStatistics.Period> periods = Arrays.asList(HitStatistics.Period.values());
Iterator<HitStatistics.Period> periodIterator = periods.iterator();
sout("Press any key to add fake reader");
for (int i = 0; i < STATS_POOL_SIZE; i++) {
pauseWhileKeyPress();
try {
if(!periodIterator.hasNext()){
periodIterator = periods.iterator();
}
HitStatistics.Period currPeriod = periodIterator.next();
statsPool.execute(new StatFakeReader(currPeriod));
sout(String.format("Add %d reader:%s",i+1,currPeriod.toString()));
} catch (Exception e) {
return;
}
}
}
}
|
UTF-8
|
Java
| 5,517 |
java
|
App.java
|
Java
|
[] | null |
[] |
package com.schetinin.examples;
import java.io.IOException;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* Hello world!
*/
public class App {
public static final int HITTER_POOL_SIZE = 10;
public static final int STATS_POOL_SIZE = 30;
private static final int FAKE_POOL_SIZE = 5;
private static ExecutorService hittersPool;
private static ExecutorService statsPool;
private static ExecutorService fakePool;
private static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
public static void sout(String str){
System.out.println(String.format("%s [%s] - %s",dateFormat.format(new Date()),Thread.currentThread().getName(),str));
}
public static void main(String[] args) throws InterruptedException {
sout("On queue");
for (int i = 0; i <= 21; i++) {
System.out.print(String.format("%d, ", Fibonatchi.calc(i)));
}
sout("\nrecursion");
for (int i = 0; i <= 21; i++) {
System.out.print(String.format("%d, ", FibonatchiRecursion.calc(i)));
}
System.out.print("\n\nSorting\n\tBefore\n\t\t");
int[] arr = {7, 4, 76, 78, 3, 6, 7, 8, 42, 324, 346, 68786, 21, 0};
for (int i = 0; i < arr.length; i++) {
System.out.print(String.format("%d, ", arr[i]));
}
BubbleSort.sort(arr);
System.out.print("\n\tAfter\n\t\t");
for (int i = 0; i < arr.length; i++) {
System.out.print(String.format("%d, ", arr[i]));
}
sout("\nStat test begin");
runHitStatisticTest();
sout("\nAll threads made. Press any key to exit");
Thread.sleep(100000);
pauseWhileKeyPress();
StatConsoleReader.work.set(false);
Hitter.work.set(false);
FakeRunner.work.set(false);
hittersPool.shutdown();
statsPool.shutdown();
fakePool.shutdown();
}
private static void pauseWhileKeyPress() {
try {
//System.in.read();
Thread.sleep(3000);
} catch (Exception e) {
}
}
private static class Hitter extends BaseRunner{
@Override
protected void process() {
try {
HitStatistics.getInstance().hit();
//Thread.sleep((long) (Math.random() * 1000));
} catch (Exception e) {
work.set(false);
}
}
}
private static class StatConsoleReader extends BaseRunner {
private HitStatistics.Period period;
public StatConsoleReader(HitStatistics.Period period) {
this.period = period;
}
@Override
protected void process() {
try {
sout(String.format(" Period:%s\t-\tstat:%d", period.toString(), HitStatistics.getInstance().getCountPerPeriod(period)));
Thread.sleep(1000);
} catch (InterruptedException e) {
work.set(false);
}
}
}
private static class StatFakeReader extends BaseRunner{
static AtomicBoolean work = new AtomicBoolean(true);
private HitStatistics.Period period;
public StatFakeReader(HitStatistics.Period period) {
this.period = period;
}
@Override
protected void process() {
try {
HitStatistics.getInstance().getCountPerPeriod(period);
} catch (Exception e) {
work.set(false);
}
}
}
private static class FakeRunner extends BaseRunner {
@Override
protected void process() {
}
}
private static void runHitStatisticTest() {
hittersPool = Executors.newFixedThreadPool(HITTER_POOL_SIZE);
statsPool = Executors.newFixedThreadPool(HitStatistics.Period.values().length+STATS_POOL_SIZE);
fakePool = Executors.newFixedThreadPool(FAKE_POOL_SIZE);
for (int i = 0; i < HITTER_POOL_SIZE; i++) {
hittersPool.execute(new Hitter());
}
/*for (HitStatistics.Period period : HitStatistics.Period.values()) {
statsPool.execute(new StatConsoleReader(period));
}*/
statsPool.execute(new StatConsoleReader(HitStatistics.Period.SECOND));
for (int i = 0; i < FAKE_POOL_SIZE; i++) {
pauseWhileKeyPress();
try {
statsPool.execute(new FakeRunner());
sout(String.format("Add %d reader:FAKE",i+1));
} catch (Exception e) {
return;
}
}
List<HitStatistics.Period> periods = Arrays.asList(HitStatistics.Period.values());
Iterator<HitStatistics.Period> periodIterator = periods.iterator();
sout("Press any key to add fake reader");
for (int i = 0; i < STATS_POOL_SIZE; i++) {
pauseWhileKeyPress();
try {
if(!periodIterator.hasNext()){
periodIterator = periods.iterator();
}
HitStatistics.Period currPeriod = periodIterator.next();
statsPool.execute(new StatFakeReader(currPeriod));
sout(String.format("Add %d reader:%s",i+1,currPeriod.toString()));
} catch (Exception e) {
return;
}
}
}
}
| 5,517 | 0.569694 | 0.558456 | 178 | 29.994383 | 26.723196 | 136 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.640449 | false | false |
13
|
54ba80e707d45f258f19351e542e53e567e7a4a0
| 12,549,894,455,270 |
16a890c51aefc41d530a6bf18d0f62b0da158a6f
|
/stagemonitor-core/src/test/java/org/stagemonitor/core/configuration/ConfigurationTest.java
|
a21571f022687e7aa76fa7ded3b5917052960b0f
|
[
"BSD-3-Clause",
"Apache-2.0",
"MIT"
] |
permissive
|
b22sk2/stagemonitor
|
https://github.com/b22sk2/stagemonitor
|
a9ec01b74d2bc5800f56322be16bed3c9ebbb342
|
5570650e39e5ed2edcbe7c26e730a60a6893ab1d
|
refs/heads/master
| 2021-01-19T20:50:28.432000 | 2017-04-16T06:20:19 | 2017-04-16T06:20:19 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package org.stagemonitor.core.configuration;
import org.junit.Before;
import org.junit.Test;
import org.stagemonitor.core.CorePlugin;
import org.stagemonitor.core.configuration.source.ConfigurationSource;
import org.stagemonitor.core.configuration.source.SimpleSource;
import org.stagemonitor.core.configuration.source.SystemPropertyConfigurationSource;
import org.stagemonitor.core.util.JsonUtils;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.stagemonitor.core.Stagemonitor.STAGEMONITOR_PASSWORD;
public class ConfigurationTest {
private Configuration configuration;
private CorePlugin corePlugin;
@Before
public void init() {
configuration = new Configuration(Collections.singletonList(new CorePlugin()),
Collections.<ConfigurationSource>singletonList(new SimpleSource()), STAGEMONITOR_PASSWORD);
corePlugin = configuration.getConfig(CorePlugin.class);
}
@Test
public void testGetConfigSubclass() {
final CorePlugin corePluginMock = mock(CorePlugin.class);
configuration = new Configuration(Collections.singletonList(corePluginMock),
Collections.<ConfigurationSource>singletonList(new SimpleSource()), STAGEMONITOR_PASSWORD);
assertSame(corePluginMock, configuration.getConfig(CorePlugin.class));
assertNull(configuration.getConfig(new ConfigurationOptionProvider(){}.getClass()));
}
@Test
public void testUpdateConfigurationWithoutPasswordSet() throws IOException {
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", null);
fail();
} catch (IllegalStateException e) {
assertEquals("'stagemonitor.password' is not set.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfiguration() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
assertFalse(corePlugin.isInternalMonitoringActive());
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", null);
assertTrue(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationWrongDatatype() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, "").add("stagemonitor.internal.monitoring", "1"));
configuration.reloadAllConfigurationOptions();
assertFalse(corePlugin.isInternalMonitoringActive());
assertEquals("Error in Test Configuration Source: Can't convert '1' to Boolean.", configuration.getConfigurationOptionByKey("stagemonitor.internal.monitoring").getErrorMessage());
configuration.save("stagemonitor.internal.monitoring", "true", "Test Configuration Source", null);
assertTrue(corePlugin.isInternalMonitoringActive());
assertNull(configuration.getConfigurationOptionByKey("stagemonitor.internal.monitoring").getErrorMessage());
}
@Test
public void testUpdateConfigurationWrongConfigurationSource() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "foo", null);
fail();
} catch (IllegalArgumentException e) {
assertEquals("Configuration source 'foo' does not exist.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationNotSaveableConfigurationSource() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
configuration.addConfigurationSource(new SystemPropertyConfigurationSource());
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "Java System Properties", null);
fail();
} catch (UnsupportedOperationException e) {
assertEquals("Saving to Java System Properties is not possible.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationNonDynamicTransient() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
assertEquals(0, corePlugin.getConsoleReportingInterval());
try {
configuration.save("stagemonitor.reporting.interval.console", "1", "Transient Configuration Source", null);
fail();
} catch (IllegalArgumentException e) {
assertEquals("Non dynamic options can't be saved to a transient configuration source.", e.getMessage());
}
assertEquals(0, corePlugin.getConsoleReportingInterval());
}
@Test
public void testUpdateConfigurationNonDynamicPersistent() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
final ConfigurationSource persistentSourceMock = mock(ConfigurationSource.class);
when(persistentSourceMock.isSavingPossible()).thenReturn(true);
when(persistentSourceMock.isSavingPersistent()).thenReturn(true);
when(persistentSourceMock.getName()).thenReturn("Test Persistent");
configuration.addConfigurationSource(persistentSourceMock);
assertEquals(0, corePlugin.getConsoleReportingInterval());
configuration.save("stagemonitor.reporting.interval.console", "1", "Test Persistent", null);
verify(persistentSourceMock).save("stagemonitor.reporting.interval.console", "1");
}
@Test
public void testSetNewPasswordViaQueryParamsShouldFail() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
try {
configuration.save(STAGEMONITOR_PASSWORD, "pwd", "Transient Configuration Source", null);
fail();
} catch (IllegalArgumentException e) {
assertEquals("Config key 'stagemonitor.password' does not exist.", e.getMessage());
}
}
@Test
public void testUpdateConfigurationWithoutPassword() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, "pwd"));
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", null);
fail();
} catch (IllegalStateException e) {
assertEquals("Wrong password for 'stagemonitor.password'.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationWithPassword() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, "pwd"));
assertFalse(corePlugin.isInternalMonitoringActive());
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", "pwd");
assertTrue(corePlugin.isInternalMonitoringActive());
}
@Test
public void testAddConfigurationSource() {
Configuration configuration = new Configuration("");
configuration.addConfigurationSource(new SimpleSource());
assertEquals(Collections.singletonMap("Transient Configuration Source", true), configuration.getNamesOfConfigurationSources());
}
@Test
public void testIsPasswordSetTrue() throws Exception {
Configuration configuration = new Configuration("pwd");
configuration.addConfigurationSource(SimpleSource.forTest("pwd", ""));
assertTrue(configuration.isPasswordSet());
}
@Test
public void testIsPasswordSetFalse() throws Exception {
Configuration configuration = new Configuration("pwd");
assertFalse(configuration.isPasswordSet());
}
@Test(expected = IllegalArgumentException.class)
public void testDuplicateLabel() throws Exception {
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(
ConfigurationOption.stringOption().key("foo").description("Foo").build(),
ConfigurationOption.stringOption().key("foo").label("Bar").build());
new Configuration(Collections.singletonList(optionProvider), Collections.emptyList(), "");
}
@Test
public void testOnConfigurationChanged() throws Exception {
AtomicBoolean changeListenerFired = new AtomicBoolean(false);
final ConfigurationOption<String> configurationOption = ConfigurationOption.stringOption()
.key("foo")
.dynamic(true)
.defaultValue("old")
.addChangeListener(new ConfigurationOption.ChangeListener<String>() {
@Override
public void onChange(ConfigurationOption<?> configurationOption, String oldValue, String newValue) {
assertEquals("foo", configurationOption.getKey());
assertEquals("old", oldValue);
assertEquals("new", newValue);
changeListenerFired.set(true);
throw new RuntimeException("This is an expected test exception. " +
"It is thrown to test whether Configuration can cope with change listeners that throw an exception.");
}
}).build();
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(configurationOption);
final SimpleSource configurationSource = new SimpleSource("test");
final Configuration config = new Configuration(Collections.singletonList(optionProvider), Collections.singletonList(configurationSource), "");
config.save("foo", "new", "test");
assertTrue(changeListenerFired.get());
}
@Test(expected = IllegalStateException.class)
public void testFailOnRequiredValueMissing() throws Exception {
final ConfigurationOption<String> configurationOption = ConfigurationOption.stringOption().key("foo").required().build();
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(configurationOption);
new Configuration(Collections.singletonList(optionProvider), Collections.emptyList(), "", true);
}
@Test
public void testValidateConfigurationOption() throws Exception {
final ConfigurationOption<Boolean> configurationOption = ConfigurationOption.booleanOption()
.key("foo")
.defaultValue(true)
.addValidator(new ConfigurationOption.Validator<Boolean>() {
@Override
public void assertValid(Boolean value) {
if (!value) {
throw new IllegalArgumentException("Validation failed");
}
}
})
.build();
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(configurationOption);
final SimpleSource configurationSource = new SimpleSource("test");
final Configuration config = new Configuration(Collections.singletonList(optionProvider), Collections.singletonList(configurationSource), "");
try {
config.save("foo", "false", "test");
fail();
} catch (IllegalArgumentException e) {
assertEquals("Validation failed", e.getMessage());
}
}
@Test
public void testValidateDefaultConfigurationOption() throws Exception {
try {
ConfigurationOption.booleanOption()
.key("foo")
.defaultValue(false)
.addValidator(new ConfigurationOption.Validator<Boolean>() {
@Override
public void assertValid(Boolean value) {
if (!value) {
throw new IllegalArgumentException("Validation failed");
}
}
})
.build();
fail();
} catch (IllegalArgumentException e) {
assertEquals("Validation failed", e.getMessage());
}
}
@Test
public void testToJsonDoesNotThrowException() throws Exception {
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(
ConfigurationOption.stringOption().key("foo").description("Foo").configurationCategory("Foos").build());
final Configuration configuration = new Configuration(Collections.singletonList(optionProvider), Collections.emptyList(), "");
JsonUtils.getMapper().writeValueAsString(configuration.getConfigurationOptionsByCategory());
}
private static class TestConfigurationOptionProvider extends ConfigurationOptionProvider {
private final List<ConfigurationOption<?>> configurationOptions;
public static ConfigurationOptionProvider of(ConfigurationOption<?>... configurationOptions) {
return new TestConfigurationOptionProvider(configurationOptions);
}
private TestConfigurationOptionProvider(ConfigurationOption<?>... configurationOptions) {
this.configurationOptions = Arrays.asList(configurationOptions);
}
@Override
public List<ConfigurationOption<?>> getConfigurationOptions() {
return configurationOptions;
}
}
}
|
UTF-8
|
Java
| 12,771 |
java
|
ConfigurationTest.java
|
Java
|
[
{
"context": "y {\n\t\t\tconfiguration.save(STAGEMONITOR_PASSWORD, \"pwd\", \"Transient Configuration Source\", null);\n\t\t\tfai",
"end": 6169,
"score": 0.7040292620658875,
"start": 6166,
"tag": "PASSWORD",
"value": "pwd"
},
{
"context": "urce(SimpleSource.forTest(STAGEMONITOR_PASSWORD, \"pwd\"));\n\t\tassertFalse(corePlugin.isInternalMonitoring",
"end": 6529,
"score": 0.6135500073432922,
"start": 6526,
"tag": "PASSWORD",
"value": "pwd"
}
] | null |
[] |
package org.stagemonitor.core.configuration;
import org.junit.Before;
import org.junit.Test;
import org.stagemonitor.core.CorePlugin;
import org.stagemonitor.core.configuration.source.ConfigurationSource;
import org.stagemonitor.core.configuration.source.SimpleSource;
import org.stagemonitor.core.configuration.source.SystemPropertyConfigurationSource;
import org.stagemonitor.core.util.JsonUtils;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.stagemonitor.core.Stagemonitor.STAGEMONITOR_PASSWORD;
public class ConfigurationTest {
private Configuration configuration;
private CorePlugin corePlugin;
@Before
public void init() {
configuration = new Configuration(Collections.singletonList(new CorePlugin()),
Collections.<ConfigurationSource>singletonList(new SimpleSource()), STAGEMONITOR_PASSWORD);
corePlugin = configuration.getConfig(CorePlugin.class);
}
@Test
public void testGetConfigSubclass() {
final CorePlugin corePluginMock = mock(CorePlugin.class);
configuration = new Configuration(Collections.singletonList(corePluginMock),
Collections.<ConfigurationSource>singletonList(new SimpleSource()), STAGEMONITOR_PASSWORD);
assertSame(corePluginMock, configuration.getConfig(CorePlugin.class));
assertNull(configuration.getConfig(new ConfigurationOptionProvider(){}.getClass()));
}
@Test
public void testUpdateConfigurationWithoutPasswordSet() throws IOException {
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", null);
fail();
} catch (IllegalStateException e) {
assertEquals("'stagemonitor.password' is not set.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfiguration() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
assertFalse(corePlugin.isInternalMonitoringActive());
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", null);
assertTrue(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationWrongDatatype() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, "").add("stagemonitor.internal.monitoring", "1"));
configuration.reloadAllConfigurationOptions();
assertFalse(corePlugin.isInternalMonitoringActive());
assertEquals("Error in Test Configuration Source: Can't convert '1' to Boolean.", configuration.getConfigurationOptionByKey("stagemonitor.internal.monitoring").getErrorMessage());
configuration.save("stagemonitor.internal.monitoring", "true", "Test Configuration Source", null);
assertTrue(corePlugin.isInternalMonitoringActive());
assertNull(configuration.getConfigurationOptionByKey("stagemonitor.internal.monitoring").getErrorMessage());
}
@Test
public void testUpdateConfigurationWrongConfigurationSource() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "foo", null);
fail();
} catch (IllegalArgumentException e) {
assertEquals("Configuration source 'foo' does not exist.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationNotSaveableConfigurationSource() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
configuration.addConfigurationSource(new SystemPropertyConfigurationSource());
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "Java System Properties", null);
fail();
} catch (UnsupportedOperationException e) {
assertEquals("Saving to Java System Properties is not possible.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationNonDynamicTransient() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
assertEquals(0, corePlugin.getConsoleReportingInterval());
try {
configuration.save("stagemonitor.reporting.interval.console", "1", "Transient Configuration Source", null);
fail();
} catch (IllegalArgumentException e) {
assertEquals("Non dynamic options can't be saved to a transient configuration source.", e.getMessage());
}
assertEquals(0, corePlugin.getConsoleReportingInterval());
}
@Test
public void testUpdateConfigurationNonDynamicPersistent() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
final ConfigurationSource persistentSourceMock = mock(ConfigurationSource.class);
when(persistentSourceMock.isSavingPossible()).thenReturn(true);
when(persistentSourceMock.isSavingPersistent()).thenReturn(true);
when(persistentSourceMock.getName()).thenReturn("Test Persistent");
configuration.addConfigurationSource(persistentSourceMock);
assertEquals(0, corePlugin.getConsoleReportingInterval());
configuration.save("stagemonitor.reporting.interval.console", "1", "Test Persistent", null);
verify(persistentSourceMock).save("stagemonitor.reporting.interval.console", "1");
}
@Test
public void testSetNewPasswordViaQueryParamsShouldFail() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, ""));
try {
configuration.save(STAGEMONITOR_PASSWORD, "pwd", "Transient Configuration Source", null);
fail();
} catch (IllegalArgumentException e) {
assertEquals("Config key 'stagemonitor.password' does not exist.", e.getMessage());
}
}
@Test
public void testUpdateConfigurationWithoutPassword() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, "pwd"));
assertFalse(corePlugin.isInternalMonitoringActive());
try {
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", null);
fail();
} catch (IllegalStateException e) {
assertEquals("Wrong password for 'stagemonitor.password'.", e.getMessage());
}
assertFalse(corePlugin.isInternalMonitoringActive());
}
@Test
public void testUpdateConfigurationWithPassword() throws IOException {
configuration.addConfigurationSource(SimpleSource.forTest(STAGEMONITOR_PASSWORD, "pwd"));
assertFalse(corePlugin.isInternalMonitoringActive());
configuration.save("stagemonitor.internal.monitoring", "true", "Transient Configuration Source", "pwd");
assertTrue(corePlugin.isInternalMonitoringActive());
}
@Test
public void testAddConfigurationSource() {
Configuration configuration = new Configuration("");
configuration.addConfigurationSource(new SimpleSource());
assertEquals(Collections.singletonMap("Transient Configuration Source", true), configuration.getNamesOfConfigurationSources());
}
@Test
public void testIsPasswordSetTrue() throws Exception {
Configuration configuration = new Configuration("pwd");
configuration.addConfigurationSource(SimpleSource.forTest("pwd", ""));
assertTrue(configuration.isPasswordSet());
}
@Test
public void testIsPasswordSetFalse() throws Exception {
Configuration configuration = new Configuration("pwd");
assertFalse(configuration.isPasswordSet());
}
@Test(expected = IllegalArgumentException.class)
public void testDuplicateLabel() throws Exception {
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(
ConfigurationOption.stringOption().key("foo").description("Foo").build(),
ConfigurationOption.stringOption().key("foo").label("Bar").build());
new Configuration(Collections.singletonList(optionProvider), Collections.emptyList(), "");
}
@Test
public void testOnConfigurationChanged() throws Exception {
AtomicBoolean changeListenerFired = new AtomicBoolean(false);
final ConfigurationOption<String> configurationOption = ConfigurationOption.stringOption()
.key("foo")
.dynamic(true)
.defaultValue("old")
.addChangeListener(new ConfigurationOption.ChangeListener<String>() {
@Override
public void onChange(ConfigurationOption<?> configurationOption, String oldValue, String newValue) {
assertEquals("foo", configurationOption.getKey());
assertEquals("old", oldValue);
assertEquals("new", newValue);
changeListenerFired.set(true);
throw new RuntimeException("This is an expected test exception. " +
"It is thrown to test whether Configuration can cope with change listeners that throw an exception.");
}
}).build();
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(configurationOption);
final SimpleSource configurationSource = new SimpleSource("test");
final Configuration config = new Configuration(Collections.singletonList(optionProvider), Collections.singletonList(configurationSource), "");
config.save("foo", "new", "test");
assertTrue(changeListenerFired.get());
}
@Test(expected = IllegalStateException.class)
public void testFailOnRequiredValueMissing() throws Exception {
final ConfigurationOption<String> configurationOption = ConfigurationOption.stringOption().key("foo").required().build();
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(configurationOption);
new Configuration(Collections.singletonList(optionProvider), Collections.emptyList(), "", true);
}
@Test
public void testValidateConfigurationOption() throws Exception {
final ConfigurationOption<Boolean> configurationOption = ConfigurationOption.booleanOption()
.key("foo")
.defaultValue(true)
.addValidator(new ConfigurationOption.Validator<Boolean>() {
@Override
public void assertValid(Boolean value) {
if (!value) {
throw new IllegalArgumentException("Validation failed");
}
}
})
.build();
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(configurationOption);
final SimpleSource configurationSource = new SimpleSource("test");
final Configuration config = new Configuration(Collections.singletonList(optionProvider), Collections.singletonList(configurationSource), "");
try {
config.save("foo", "false", "test");
fail();
} catch (IllegalArgumentException e) {
assertEquals("Validation failed", e.getMessage());
}
}
@Test
public void testValidateDefaultConfigurationOption() throws Exception {
try {
ConfigurationOption.booleanOption()
.key("foo")
.defaultValue(false)
.addValidator(new ConfigurationOption.Validator<Boolean>() {
@Override
public void assertValid(Boolean value) {
if (!value) {
throw new IllegalArgumentException("Validation failed");
}
}
})
.build();
fail();
} catch (IllegalArgumentException e) {
assertEquals("Validation failed", e.getMessage());
}
}
@Test
public void testToJsonDoesNotThrowException() throws Exception {
final ConfigurationOptionProvider optionProvider = TestConfigurationOptionProvider.of(
ConfigurationOption.stringOption().key("foo").description("Foo").configurationCategory("Foos").build());
final Configuration configuration = new Configuration(Collections.singletonList(optionProvider), Collections.emptyList(), "");
JsonUtils.getMapper().writeValueAsString(configuration.getConfigurationOptionsByCategory());
}
private static class TestConfigurationOptionProvider extends ConfigurationOptionProvider {
private final List<ConfigurationOption<?>> configurationOptions;
public static ConfigurationOptionProvider of(ConfigurationOption<?>... configurationOptions) {
return new TestConfigurationOptionProvider(configurationOptions);
}
private TestConfigurationOptionProvider(ConfigurationOption<?>... configurationOptions) {
this.configurationOptions = Arrays.asList(configurationOptions);
}
@Override
public List<ConfigurationOption<?>> getConfigurationOptions() {
return configurationOptions;
}
}
}
| 12,771 | 0.78138 | 0.780753 | 312 | 39.932693 | 37.676407 | 181 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.503205 | false | false |
13
|
aef2caabd0d331e1d98dd4873b0e78849b2cdaf2
| 5,171,140,628,289 |
34431ca3f07af7de7b2e10a1b7629a7b7a8837e8
|
/com/smule/singandroid/customviews/ParticleGenerator.java
|
9948d8bd4fe5618569eaf6de84559f2a6b3a90fb
|
[] |
no_license
|
Bizarrus/Sing
|
https://github.com/Bizarrus/Sing
|
7d3f131a90c82f6007d3ddde98af96dd45a0ca42
|
d7c9384f0bd57dfccd590da8515fe13dbde77f1f
|
refs/heads/master
| 2020-03-21T01:32:11.114000 | 2018-06-30T12:45:58 | 2018-06-30T12:45:58 | 137,946,905 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Decompiled with CFR 0_123.
*
* Could not load the following classes:
* android.content.Context
* android.content.res.Resources
* android.graphics.Bitmap
* android.graphics.BitmapFactory
* android.graphics.Canvas
* android.graphics.Color
* android.graphics.ColorFilter
* android.graphics.LightingColorFilter
* android.graphics.Paint
* android.graphics.Point
* android.graphics.PointF
* android.view.animation.AccelerateInterpolator
* android.view.animation.Interpolator
*/
package com.smule.singandroid.customviews;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.LightingColorFilter;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PointF;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Interpolator;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class ParticleGenerator {
private static final String a = ParticleGenerator.class.getName();
private final List<Particle> b = new LinkedList<Particle>();
private final List<Particle> c = new LinkedList<Particle>();
private final Point d = new Point();
private int e;
private long f;
private float g;
private float h;
private boolean i = false;
private double j;
private double k;
private int l;
private float m;
private final Bitmap n;
public ParticleGenerator(Context context, int n, float f, float f2, double d, double d2, int n2, float f3) {
context = BitmapFactory.decodeResource((Resources)context.getResources(), (int)n);
this.j = d;
this.k = d2;
this.l = n2;
this.m = f3;
this.n = Bitmap.createScaledBitmap((Bitmap)context, (int)((int)f), (int)((int)f2), (boolean)true);
context.recycle();
}
private double a(double d, double d2) {
return (d2 - d) * Math.random() + d;
}
private int b(int n, int n2) {
return (int)((double)n + Math.random() * (double)(n2 - n + 1));
}
public void a() {
this.i = true;
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public void a(float f) {
synchronized (this) {
int n;
long l;
this.g = f;
long l2 = System.currentTimeMillis();
if (this.i) {
l = 0;
this.i = false;
} else {
l = this.f > 0 ? l2 - this.f : 0;
l = Math.max(l, 0);
}
float f2 = (float)l / 1000.0f;
this.h += f * f2;
int n2 = (int)this.h;
for (n = 0; n < n2; ++n) {
Object object;
if (!this.c.isEmpty()) {
object = this.c.remove(0);
object.a(this.d.x, this.d.y, this.e);
} else {
object = new Particle(this.d.x, this.d.y, this.e, this.j, this.k, this.l, this.m);
}
this.b.add((Particle)object);
}
this.h -= (float)n2;
if (!this.b.isEmpty()) {
for (Particle particle : this.b) {
if (!particle.a()) continue;
particle.a(f2);
}
for (n = this.b.size() - 1; n >= 0; --n) {
if (!this.b.get(n).b()) continue;
this.c.add(this.b.remove(n));
}
}
this.f = l2;
return;
}
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public void a(int n, int n2) {
synchronized (this) {
Object object = this.c.iterator();
while (object.hasNext()) {
object.next().a(0, 0, n);
}
int n3 = this.c.size() - n2;
if (n3 > 0) {
object = new LinkedList();
for (n2 = 0; n2 < n3; ++n2) {
object.add(new Particle(0, 0, n, this.j, this.k, this.l, this.m));
}
this.c.addAll((Collection<Particle>)object);
}
return;
}
}
public void a(int n, int n2, int n3) {
this.d.x = n;
this.d.y = n2;
this.e = n3;
}
public void a(Canvas canvas) {
synchronized (this) {
Iterator<Particle> iterator = this.b.iterator();
while (iterator.hasNext()) {
iterator.next().a(canvas);
}
return;
}
}
public void b() {
synchronized (this) {
int n = this.b.size();
for (int i = 0; i < n; ++i) {
this.c.add(this.b.remove(0));
}
return;
}
}
public class Particle {
private final double b;
private final double c;
private final Paint d;
private Interpolator e;
private final float[] f;
private Map<Integer, ColorFilter> g;
private final Point h;
private final PointF i;
private double j;
private double k;
private int l;
private long m;
private float n;
private int o;
private ColorFilter p;
private int q;
public Particle(int n, int n2, int n3, double d, double d2, int n4, float f) {
this.d = new Paint();
this.f = new float[3];
this.g = new HashMap<Integer, ColorFilter>();
this.h = new Point();
this.i = new PointF();
this.j = 2.0943951023931953;
this.k = 4.1887902047863905;
this.b = (double)ParticleGenerator.this.n.getWidth() / 2.0;
this.c = (double)ParticleGenerator.this.n.getHeight() / 2.0;
this.j = d;
this.k = d2;
this.n = n4;
this.q = 0;
this.e = new AccelerateInterpolator(f);
this.a(n, n2, n3);
}
public void a(float f) {
if (this.l != 1) {
Point point = this.h;
point.x = (int)((float)point.x + this.i.x * f);
point = this.h;
point.y = (int)((float)point.y + this.i.y * f);
this.q = (int)((float)this.q + 1000.0f * f);
if ((float)this.q >= this.n) {
this.l = 1;
}
f = (float)this.q / this.n;
int n = (int)Math.max((1.0f - this.e.getInterpolation(f)) * 255.0f, 0.0f);
this.d.setAlpha(n);
}
}
/*
* Enabled aggressive block sorting
*/
public void a(int n, int n2, int n3) {
this.h.x = n;
this.h.y = n2;
this.l = 0;
this.m = System.currentTimeMillis();
this.q = 0;
double d = ParticleGenerator.this.a(this.j, this.k);
double d2 = ParticleGenerator.this.a(75.0, 300.0);
this.i.x = (float)(Math.cos(d) * d2);
this.i.y = (float)(Math.sin(d) * d2);
if (this.g.containsKey(n3)) {
this.p = this.g.get(n3);
} else {
Color.colorToHSV((int)n3, (float[])this.f);
this.f[0] = (int)(this.f[0] + ((float)ParticleGenerator.this.b(0, 33) - 16.5f));
this.f[1] = (float)((double)this.f[1] + (ParticleGenerator.this.a(0.0, 0.5) - 0.25));
this.f[2] = (float)((double)this.f[2] + (ParticleGenerator.this.a(0.0, 0.4000000059604645) - 0.20000000298023224));
this.o = Color.HSVToColor((float[])this.f);
this.p = new LightingColorFilter(this.o, 0);
this.g.put(n3, this.p);
}
this.d.setColor(this.o);
this.d.setAntiAlias(true);
this.d.setColorFilter(this.p);
ParticleGenerator.this.f = this.m;
}
public void a(Canvas canvas) {
int n = (int)((double)this.h.x - this.b);
int n2 = (int)((double)this.h.y - this.c);
canvas.drawBitmap(ParticleGenerator.this.n, (float)n, (float)n2, this.d);
}
public boolean a() {
if (this.l == 0) {
return true;
}
return false;
}
public boolean b() {
if (this.l == 1) {
return true;
}
return false;
}
}
}
|
UTF-8
|
Java
| 8,929 |
java
|
ParticleGenerator.java
|
Java
|
[] | null |
[] |
/*
* Decompiled with CFR 0_123.
*
* Could not load the following classes:
* android.content.Context
* android.content.res.Resources
* android.graphics.Bitmap
* android.graphics.BitmapFactory
* android.graphics.Canvas
* android.graphics.Color
* android.graphics.ColorFilter
* android.graphics.LightingColorFilter
* android.graphics.Paint
* android.graphics.Point
* android.graphics.PointF
* android.view.animation.AccelerateInterpolator
* android.view.animation.Interpolator
*/
package com.smule.singandroid.customviews;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.LightingColorFilter;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.PointF;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Interpolator;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class ParticleGenerator {
private static final String a = ParticleGenerator.class.getName();
private final List<Particle> b = new LinkedList<Particle>();
private final List<Particle> c = new LinkedList<Particle>();
private final Point d = new Point();
private int e;
private long f;
private float g;
private float h;
private boolean i = false;
private double j;
private double k;
private int l;
private float m;
private final Bitmap n;
public ParticleGenerator(Context context, int n, float f, float f2, double d, double d2, int n2, float f3) {
context = BitmapFactory.decodeResource((Resources)context.getResources(), (int)n);
this.j = d;
this.k = d2;
this.l = n2;
this.m = f3;
this.n = Bitmap.createScaledBitmap((Bitmap)context, (int)((int)f), (int)((int)f2), (boolean)true);
context.recycle();
}
private double a(double d, double d2) {
return (d2 - d) * Math.random() + d;
}
private int b(int n, int n2) {
return (int)((double)n + Math.random() * (double)(n2 - n + 1));
}
public void a() {
this.i = true;
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public void a(float f) {
synchronized (this) {
int n;
long l;
this.g = f;
long l2 = System.currentTimeMillis();
if (this.i) {
l = 0;
this.i = false;
} else {
l = this.f > 0 ? l2 - this.f : 0;
l = Math.max(l, 0);
}
float f2 = (float)l / 1000.0f;
this.h += f * f2;
int n2 = (int)this.h;
for (n = 0; n < n2; ++n) {
Object object;
if (!this.c.isEmpty()) {
object = this.c.remove(0);
object.a(this.d.x, this.d.y, this.e);
} else {
object = new Particle(this.d.x, this.d.y, this.e, this.j, this.k, this.l, this.m);
}
this.b.add((Particle)object);
}
this.h -= (float)n2;
if (!this.b.isEmpty()) {
for (Particle particle : this.b) {
if (!particle.a()) continue;
particle.a(f2);
}
for (n = this.b.size() - 1; n >= 0; --n) {
if (!this.b.get(n).b()) continue;
this.c.add(this.b.remove(n));
}
}
this.f = l2;
return;
}
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public void a(int n, int n2) {
synchronized (this) {
Object object = this.c.iterator();
while (object.hasNext()) {
object.next().a(0, 0, n);
}
int n3 = this.c.size() - n2;
if (n3 > 0) {
object = new LinkedList();
for (n2 = 0; n2 < n3; ++n2) {
object.add(new Particle(0, 0, n, this.j, this.k, this.l, this.m));
}
this.c.addAll((Collection<Particle>)object);
}
return;
}
}
public void a(int n, int n2, int n3) {
this.d.x = n;
this.d.y = n2;
this.e = n3;
}
public void a(Canvas canvas) {
synchronized (this) {
Iterator<Particle> iterator = this.b.iterator();
while (iterator.hasNext()) {
iterator.next().a(canvas);
}
return;
}
}
public void b() {
synchronized (this) {
int n = this.b.size();
for (int i = 0; i < n; ++i) {
this.c.add(this.b.remove(0));
}
return;
}
}
public class Particle {
private final double b;
private final double c;
private final Paint d;
private Interpolator e;
private final float[] f;
private Map<Integer, ColorFilter> g;
private final Point h;
private final PointF i;
private double j;
private double k;
private int l;
private long m;
private float n;
private int o;
private ColorFilter p;
private int q;
public Particle(int n, int n2, int n3, double d, double d2, int n4, float f) {
this.d = new Paint();
this.f = new float[3];
this.g = new HashMap<Integer, ColorFilter>();
this.h = new Point();
this.i = new PointF();
this.j = 2.0943951023931953;
this.k = 4.1887902047863905;
this.b = (double)ParticleGenerator.this.n.getWidth() / 2.0;
this.c = (double)ParticleGenerator.this.n.getHeight() / 2.0;
this.j = d;
this.k = d2;
this.n = n4;
this.q = 0;
this.e = new AccelerateInterpolator(f);
this.a(n, n2, n3);
}
public void a(float f) {
if (this.l != 1) {
Point point = this.h;
point.x = (int)((float)point.x + this.i.x * f);
point = this.h;
point.y = (int)((float)point.y + this.i.y * f);
this.q = (int)((float)this.q + 1000.0f * f);
if ((float)this.q >= this.n) {
this.l = 1;
}
f = (float)this.q / this.n;
int n = (int)Math.max((1.0f - this.e.getInterpolation(f)) * 255.0f, 0.0f);
this.d.setAlpha(n);
}
}
/*
* Enabled aggressive block sorting
*/
public void a(int n, int n2, int n3) {
this.h.x = n;
this.h.y = n2;
this.l = 0;
this.m = System.currentTimeMillis();
this.q = 0;
double d = ParticleGenerator.this.a(this.j, this.k);
double d2 = ParticleGenerator.this.a(75.0, 300.0);
this.i.x = (float)(Math.cos(d) * d2);
this.i.y = (float)(Math.sin(d) * d2);
if (this.g.containsKey(n3)) {
this.p = this.g.get(n3);
} else {
Color.colorToHSV((int)n3, (float[])this.f);
this.f[0] = (int)(this.f[0] + ((float)ParticleGenerator.this.b(0, 33) - 16.5f));
this.f[1] = (float)((double)this.f[1] + (ParticleGenerator.this.a(0.0, 0.5) - 0.25));
this.f[2] = (float)((double)this.f[2] + (ParticleGenerator.this.a(0.0, 0.4000000059604645) - 0.20000000298023224));
this.o = Color.HSVToColor((float[])this.f);
this.p = new LightingColorFilter(this.o, 0);
this.g.put(n3, this.p);
}
this.d.setColor(this.o);
this.d.setAntiAlias(true);
this.d.setColorFilter(this.p);
ParticleGenerator.this.f = this.m;
}
public void a(Canvas canvas) {
int n = (int)((double)this.h.x - this.b);
int n2 = (int)((double)this.h.y - this.c);
canvas.drawBitmap(ParticleGenerator.this.n, (float)n, (float)n2, this.d);
}
public boolean a() {
if (this.l == 0) {
return true;
}
return false;
}
public boolean b() {
if (this.l == 1) {
return true;
}
return false;
}
}
}
| 8,929 | 0.50812 | 0.485497 | 278 | 31.115108 | 21.574724 | 131 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.776978 | false | false |
13
|
c8717e21b9b2330f24ea95a43e21415ffd09db21
| 5,720,896,476,170 |
61602d4b976db2084059453edeafe63865f96ec5
|
/com/xunlei/androidvip/parameter/AndroidVipSubOfflineBtListTaskInfo.java
|
60137ad0c38b0de472e94ac7c678fc8455379a20
|
[] |
no_license
|
ZoranLi/thunder
|
https://github.com/ZoranLi/thunder
|
9d18fd0a0ec0a5bb3b3f920f9413c1ace2beb4d0
|
0778679ef03ba1103b1d9d9a626c8449b19be14b
|
refs/heads/master
| 2020-03-20T23:29:27.131000 | 2018-06-19T06:43:26 | 2018-06-19T06:43:26 | 137,848,886 | 12 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.xunlei.androidvip.parameter;
public class AndroidVipSubOfflineBtListTaskInfo {
public String mCid;
public String mCookie;
public int mDownloadStatus;
public long mFileSize;
public int mFileType;
public String mGcid;
public long mLeftLiveTime;
public String mLixianUrl;
public String mMessage;
public int mProgress;
public String mRefUrl;
public int mSpeed;
public long mTaskId;
public String mTaskName;
public String mUrl;
public int mUsedTime;
public int mVod;
}
|
UTF-8
|
Java
| 545 |
java
|
AndroidVipSubOfflineBtListTaskInfo.java
|
Java
|
[] | null |
[] |
package com.xunlei.androidvip.parameter;
public class AndroidVipSubOfflineBtListTaskInfo {
public String mCid;
public String mCookie;
public int mDownloadStatus;
public long mFileSize;
public int mFileType;
public String mGcid;
public long mLeftLiveTime;
public String mLixianUrl;
public String mMessage;
public int mProgress;
public String mRefUrl;
public int mSpeed;
public long mTaskId;
public String mTaskName;
public String mUrl;
public int mUsedTime;
public int mVod;
}
| 545 | 0.724771 | 0.724771 | 21 | 24.952381 | 10.092318 | 49 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.857143 | false | false |
13
|
e32b81fd0191f1f639026559a84a2ed50b19b010
| 30,253,749,680,223 |
a4f94f4701a59cafc7407aed2d525b2dff985c95
|
/core/languageDesign/refactoring/source_gen/jetbrains/mps/lang/refactoring/generator/baseLanguage/template/main/QueriesGenerated.java
|
81e919c8630fffc096092281b95922081486f97f
|
[] |
no_license
|
jamice/code-orchestra-core
|
https://github.com/jamice/code-orchestra-core
|
ffda62860f5b117386aa6455f4fdf61661abbe9e
|
b2bbf8362be2e2173864c294c635badb2e27ecc6
|
refs/heads/master
| 2021-01-15T13:24:53.517000 | 2013-05-09T21:39:28 | 2013-05-09T21:39:28 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package jetbrains.mps.lang.refactoring.generator.baseLanguage.template.main;
/*Generated by MPS */
import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.generator.template.BaseMappingRuleContext;
import jetbrains.mps.smodel.SNode;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.generator.template.PropertyMacroContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.smodel.behaviour.BehaviorManager;
import jetbrains.mps.lang.pattern.GeneratedMatchingPattern;
import jetbrains.mps.typesystem.inference.TypeChecker;
import jetbrains.mps.lang.plugin.behavior.KeyMapKeystroke_Behavior;
import jetbrains.mps.generator.template.ReferenceMacroContext;
import jetbrains.mps.lang.typesystem.runtime.HUtil;
import jetbrains.mps.lang.refactoring.behavior.MPSParameterType_Behavior;
import jetbrains.mps.generator.template.IfMacroContext;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext;
import java.util.List;
import java.util.ArrayList;
import jetbrains.mps.lang.refactoring.behavior.RequiredAdditionalArgument_Behavior;
import jetbrains.mps.lang.refactoring.behavior.RefactoringArgument_Behavior;
import jetbrains.mps.lang.pattern.IMatchingPattern;
import java.util.Set;
import java.util.HashSet;
import jetbrains.mps.smodel.SModelUtil_new;
import jetbrains.mps.project.GlobalScope;
import jetbrains.mps.smodel.SReference;
import jetbrains.mps.smodel.SModelReference;
import jetbrains.mps.smodel.SNodeId;
public class QueriesGenerated {
public static boolean baseMappingRule_Condition_478744034994714447(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
SNode parent = SNodeOperations.getParent(_context.getNode());
if (SNodeOperations.isInstanceOf(parent, "jetbrains.mps.baseLanguage.structure.AssignmentExpression")) {
return !(SLinkOperations.getTarget(SNodeOperations.cast(parent, "jetbrains.mps.baseLanguage.structure.AssignmentExpression"), "lValue", true) == _context.getNode());
}
return true;
}
public static boolean baseMappingRule_Condition_478744034994714473(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RequiredAdditionalArgumentReference");
}
public static boolean baseMappingRule_Condition_5934994956486892156(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return !(SNodeOperations.hasRole(_context.getNode(), "jetbrains.mps.baseLanguage.structure.AssignmentExpression", "lValue"));
}
public static boolean baseMappingRule_Condition_5934994956486892165(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringArgumentReference");
}
public static boolean baseMappingRule_Condition_7786266509745404976(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "moduleType", true) != null);
}
public static boolean baseMappingRule_Condition_7786266509745405243(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "concept", false) != null);
}
public static Object propertyMacro_GetPropertyValue_6528618226609204856(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1199462157225(final IOperationContext operationContext, final PropertyMacroContext _context) {
return ((String) BehaviorManager.getInstance().invoke(Object.class, SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "keystroke", true), "jetbrains.mps.lang.editor.structure.CellKeyMapKeystroke"), "call_getKeyStroke_1213877273475", new Class[]{SNode.class}));
}
public static Object propertyMacro_GetPropertyValue_1199462256696(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_1198673899511(final IOperationContext operationContext, final PropertyMacroContext _context) {
return "My_" + SPropertyOperations.getString(_context.getNode(), "name") + "_Condition";
}
public static Object propertyMacro_GetPropertyValue_1189698210116(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1189776889452(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1189698215259(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1189776896095(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1191238748328(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "userFriendlyName");
}
public static Object propertyMacro_GetPropertyValue_1789893890062506474(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_1197993525530(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name") + "_componentCreator";
}
public static Object propertyMacro_GetPropertyValue_1198600574129(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name") + "_initialValue";
}
public static Object propertyMacro_GetPropertyValue_7110754463748604112(final IOperationContext operationContext, final PropertyMacroContext _context) {
{
GeneratedMatchingPattern pattern_x583g4_a0s = new QueriesGenerated.Pattern_x583g4_a0a0a0a81();
SNode coercedNode_x583g4_a0s = TypeChecker.getInstance().getRuntimeSupport().coerce_(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), pattern_x583g4_a0s);
if (coercedNode_x583g4_a0s != null) {
SNode abstractConceptDeclaration = SNodeOperations.cast(((SNode) pattern_x583g4_a0s.getFieldValue("patternVar_concept")), "jetbrains.mps.lang.structure.structure.AbstractConceptDeclaration");
return SNodeOperations.getModel(abstractConceptDeclaration).getSModelFqName() + "." + SPropertyOperations.getString(abstractConceptDeclaration, "name");
} else {
}
}
return null;
}
public static Object propertyMacro_GetPropertyValue_7110754463748604238(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_7110754463748604250(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "presentation");
}
public static Object propertyMacro_GetPropertyValue_1189697560065(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1190733623863(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RequiredAdditionalArgumentReference"), "argument", false), "name");
}
public static Object propertyMacro_GetPropertyValue_1217265953059(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), "argument", false), "name");
}
public static Object propertyMacro_GetPropertyValue_1212245181527(final IOperationContext operationContext, final PropertyMacroContext _context) {
return ((String) BehaviorManager.getInstance().invoke(Object.class, SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "finderDeclaration", false), "jetbrains.mps.lang.findUsages.structure.FinderDeclaration"), "call_getGeneratedClassLongName_1213877240120", new Class[]{SNode.class}));
}
public static Object propertyMacro_GetPropertyValue_478744034994714493(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_7573235936722710647(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_6215884973916329887(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_6215884973916329851(final IOperationContext operationContext, final PropertyMacroContext _context) {
return ((SLinkOperations.getTarget(_context.getNode(), "keystroke", true) == null) ?
"" :
KeyMapKeystroke_Behavior.call_getKeyStroke_1213877278942(SLinkOperations.getTarget(_context.getNode(), "keystroke", true))
);
}
public static Object propertyMacro_GetPropertyValue_478744034994714810(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "userFriendlyName");
}
public static Object propertyMacro_GetPropertyValue_478744034994714829(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_478744034994715649(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_7573235936722758678(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getBoolean(_context.getNode(), "allowMultiple");
}
public static Object propertyMacro_GetPropertyValue_7573235936722758651(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false), "name") + "_Target";
}
public static Object propertyMacro_GetPropertyValue_7573235936722759810(final IOperationContext operationContext, final PropertyMacroContext _context) {
if (SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference")) {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference"), "baseVariableDeclaration", false), "name");
} else {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringParameterReference"), "refactoringParameter", false), "name");
}
}
public static Object propertyMacro_GetPropertyValue_7573235936722759785(final IOperationContext operationContext, final PropertyMacroContext _context) {
if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference")) {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference"), "baseVariableDeclaration", false), "name");
} else {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameterReference"), "refactoringParameter", false), "name");
}
}
public static Object propertyMacro_GetPropertyValue_3644668945280030591(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false), "name");
}
public static Object propertyMacro_GetPropertyValue_3644668945280073777(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "title");
}
public static Object propertyMacro_GetPropertyValue_3644668945280073883(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode refactoringParameter = SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false);
SNode refactoring = SNodeOperations.getAncestor(refactoringParameter, "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false);
return SPropertyOperations.getString(refactoring, "name") + "_" + SPropertyOperations.getString(refactoringParameter, "name") + "_Settings";
}
public static Object propertyMacro_GetPropertyValue_3060724424231928584(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode refactoringParameter = SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false);
SNode refactoring = SNodeOperations.getAncestor(refactoringParameter, "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false);
return SPropertyOperations.getString(refactoring, "name") + "_" + SPropertyOperations.getString(refactoringParameter, "name") + "_Chooser";
}
public static Object propertyMacro_GetPropertyValue_5934994956485965416(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getBoolean(_context.getNode(), "stretch");
}
public static Object propertyMacro_GetPropertyValue_5934994956486031356(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false), "name");
}
public static Object propertyMacro_GetPropertyValue_4312073247720715217(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), "parameter", false), "name");
}
public static Object referenceMacro_GetReferent_6528618226609334501(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "applicableConcept", false);
}
public static Object referenceMacro_GetReferent_7110754463748604065(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "componentCreator_old");
}
public static Object referenceMacro_GetReferent_7110754463748604216(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "conditionConstructor_old");
}
public static Object referenceMacro_GetReferent_7110754463748604269(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "initialValue_old");
}
public static Object referenceMacro_GetReferent_1200935757745(final IOperationContext operationContext, final ReferenceMacroContext _context) {
SNode classifierType = TypeChecker.getInstance().getRuntimeSupport().coerce_(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "argument", false), "argumentType", true), HUtil.createMatchingPatternByConceptFQName("jetbrains.mps.baseLanguage.structure.ClassifierType"), true);
return SLinkOperations.getTarget(classifierType, "classifier", false);
}
public static Object referenceMacro_GetReferent_6215884973916316575(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), "target", true), "refactoringTargetConstructor");
}
public static Object referenceMacro_GetReferent_7573235936722758662(final IOperationContext operationContext, final ReferenceMacroContext _context) {
if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.NodeTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a0a94().createNode(), "enumConstantDeclaration", false);
} else if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.ModelTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a0a0xb().createNode(), "enumConstantDeclaration", false);
} else if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.ModuleTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a1a0xb().createNode(), "enumConstantDeclaration", false);
} else if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.AnyTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a2a0xb().createNode(), "enumConstantDeclaration", false);
}
return null;
}
public static Object referenceMacro_GetReferent_8041810900052414627(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false), "refactoringClass");
}
public static Object referenceMacro_GetReferent_7786266509745404941(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "moduleType", true), "classifier", false);
}
public static Object referenceMacro_GetReferent_7786266509745404970(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "concept", false);
}
public static Object referenceMacro_GetReferent_3644668945280073911(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.MPSParameterChooser", false, false), "settingsClass");
}
public static Object referenceMacro_GetReferent_4413749148913757642(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "settingsConstructor");
}
public static Object referenceMacro_GetReferent_3644668945280030643(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(MPSParameterType_Behavior.call_getCreatorMethod_4413749148913760555(SLinkOperations.getTarget(_context.getNode(), "paramType", true)), "baseMethodDeclaration", false);
}
public static Object referenceMacro_GetReferent_4413749148913760650(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(MPSParameterType_Behavior.call_getCreatorMethod_4413749148913760555(SLinkOperations.getTarget(_context.getNode(), "paramType", true)), "classConcept", false);
}
public static Object referenceMacro_GetReferent_5934994956486126386(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "customChooserConstructor");
}
public static Object referenceMacro_GetReferent_5934994956486083401(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.CustomParameterChooser", false, false), "customChooserClass");
}
public static Object referenceMacro_GetReferent_5934994956486316708(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.CustomParameterChooser", false, false), "customChooserClass");
}
public static Object referenceMacro_GetReferent_5934994956487138577(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.CustomParameterChooser", false, false), "customChooserClass");
}
public static Object referenceMacro_GetReferent_4312073247720715335(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "parameter", false), "chooser", true), "jetbrains.mps.lang.refactoring.structure.MPSParameterChooser"), "settingsConstructor");
}
public static Object referenceMacro_GetReferent_4312073247720514254(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false), "refactoringClass");
}
public static boolean ifMacro_Condition_1199462382860(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) == null) && (SLinkOperations.getTarget(_context.getNode(), "keystroke", true) == null);
}
public static boolean ifMacro_Condition_1199462333157(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) == null) && (SLinkOperations.getTarget(_context.getNode(), "keystroke", true) != null);
}
public static boolean ifMacro_Condition_1199462335285(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) != null);
}
public static boolean ifMacro_Condition_1198674172362(final IOperationContext operationContext, final IfMacroContext _context) {
return true;
}
public static boolean ifMacro_Condition_1789893890062507458(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) != null);
}
public static boolean ifMacro_Condition_1789893890062507285(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", null, null);
}
public static boolean ifMacro_Condition_1789893890062507297(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "model", null);
}
public static boolean ifMacro_Condition_1789893890062507309(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "language", null);
}
public static boolean ifMacro_Condition_1789893890062507321(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "solution", null);
}
public static boolean ifMacro_Condition_1789893890062507333(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "devkit", null);
}
public static boolean ifMacro_Condition_1789893890062505213(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "isApplicableClause", true) != null);
}
public static boolean ifMacro_Condition_6528618226609334511(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "applicableConcept", false) != null);
}
public static boolean ifMacro_Condition_1789893890062500133(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "isApplicableToModelClause", true) != null);
}
public static boolean ifMacro_Condition_700745782152800956(final IOperationContext operationContext, final IfMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true) != null && SPropertyOperations.getBoolean(_context.getNode(), "refactorImmediatelyIfNoUsages");
}
public static boolean ifMacro_Condition_6528618226609334567(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062301483(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062301596(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "doRefactorClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062301668(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "getModelsToGenerateClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062321107(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "getModelsToUpdateClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062321131(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062321166(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "nodesToOpenClause", true) != null);
}
public static boolean ifMacro_Condition_6528618226609334578(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelClause", true) != null);
}
public static boolean ifMacro_Condition_700745782152520300(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.getBoolean(_context.getNode(), "oneTargetOnly");
}
public static boolean ifMacro_Condition_7110754463748604074(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) != null);
}
public static boolean ifMacro_Condition_7110754463748604088(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a78().createNode());
}
public static boolean ifMacro_Condition_7110754463748604145(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a88().createNode());
}
public static boolean ifMacro_Condition_7110754463748604169(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a98().createNode());
}
public static boolean ifMacro_Condition_7110754463748604193(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a09().createNode());
}
public static boolean ifMacro_Condition_7110754463748604224(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "filterClause", true) != null);
}
public static boolean ifMacro_Condition_7110754463748604277(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "initialValue", true) != null);
}
public static boolean ifMacro_Condition_7110754463748604327(final IOperationContext operationContext, final IfMacroContext _context) {
return ListSequence.fromList(SLinkOperations.getTargets(_context.getNode(), "arguments", true)).isNotEmpty();
}
public static boolean ifMacro_Condition_1212243788664(final IOperationContext operationContext, final IfMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchNode", true) == null;
}
public static boolean ifMacro_Condition_1212243800827(final IOperationContext operationContext, final IfMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchScope", true) == null;
}
public static boolean ifMacro_Condition_6215884973916329838(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) == null);
}
public static boolean ifMacro_Condition_478744034994714858(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) != null);
}
public static boolean ifMacro_Condition_7573235936722711769(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "initBlock", true) != null);
}
public static boolean ifMacro_Condition_616550569929040368(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "modelsToGenerateBlock", true) != null);
}
public static boolean ifMacro_Condition_7573235936722711846(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "doWhenDoneBlock", true) != null);
}
public static boolean ifMacro_Condition_1347577327951505984(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "affectedNodesBlock", true) != null);
}
public static boolean ifMacro_Condition_1347577327951506011(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelBlock", true) != null);
}
public static boolean ifMacro_Condition_1347577327951669531(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelBlock", true) == null);
}
public static boolean ifMacro_Condition_7573235936722758695(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "isApplicableBlock", true) == null);
}
public static boolean ifMacro_Condition_3644668945280073833(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "filterBlock", true) != null);
}
public static boolean ifMacro_Condition_3644668945280073856(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "initialValueBlock", true) != null);
}
public static boolean ifMacro_Condition_3302086321379147975(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "focusedComponent", true) == null);
}
public static SNode sourceNodeQuery_1198673965458(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1198674072178(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1198674859451(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "filterClause", true), "body", true);
}
public static SNode sourceNodeQuery_1198674956266(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1789893890062505223(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "isApplicableClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062505117(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "isApplicableToModelClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062301545(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062301658(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "doRefactorClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062301688(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "getModelsToGenerateClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062321117(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "getModelsToUpdateClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062321151(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "updateModelClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062321190(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "nodesToOpenClause", true), "body", true);
}
public static SNode sourceNodeQuery_1197993779521(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1197992605929(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true), "body", true);
}
public static SNode sourceNodeQuery_1198600035299(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1198600088963(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "initialValue", true), "body", true);
}
public static SNode sourceNodeQuery_7110754463748604052(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1197373531048(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "rValue", true);
}
public static SNode sourceNodeQuery_1197387263078(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_1197387243573(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newConceptFQName", true);
}
public static SNode sourceNodeQuery_1197387243581(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newFeatureName", true);
}
public static SNode sourceNodeQuery_1198577826555(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argument", true);
}
public static SNode sourceNodeQuery_1199623494551(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199623490797(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1199623613817(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199623611204(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "roleInTarget", true);
}
public static SNode sourceNodeQuery_1199623608450(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1199623733861(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199623737069(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1199623873330(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199625039959(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "roleInTarget", true);
}
public static SNode sourceNodeQuery_1199623869841(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1204723894467(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_1212243848033(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchNode", true);
}
public static SNode sourceNodeQuery_1212243880040(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchScope", true);
}
public static SNode sourceNodeQuery_3242588059496756733(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_3242588059496756749(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_7573235936722711758(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "initBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722711151(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "doRefactorBlock", true), "body", true);
}
public static SNode sourceNodeQuery_616550569929040349(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "modelsToGenerateBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722711835(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "doWhenDoneBlock", true), "body", true);
}
public static SNode sourceNodeQuery_1347577327951505972(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "affectedNodesBlock", true), "body", true);
}
public static SNode sourceNodeQuery_1347577327951506001(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "updateModelBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722758760(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "isApplicableBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722758977(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SNodeOperations.copyNode(TypeChecker.getInstance().getTypeOf(_context.getNode()));
}
public static SNode sourceNodeQuery_7573235936722759823(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "rValue", true);
}
public static SNode sourceNodeQuery_7573235936722759862(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getRuntimeSupport().coerce_(TypeChecker.getInstance().getTypeOf(_context.getNode()), HUtil.createMatchingPatternByConceptFQName("jetbrains.mps.baseLanguage.structure.ClassifierType"), true);
}
public static SNode sourceNodeQuery_4131204317224631832(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "refactoringParameter", false), "chooser", true);
}
public static SNode sourceNodeQuery_3644668945280073794(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getRuntimeSupport().coerce_(TypeChecker.getInstance().getTypeOf(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false)), HUtil.createMatchingPatternByConceptFQName("jetbrains.mps.baseLanguage.structure.ClassifierType"), true);
}
public static SNode sourceNodeQuery_3644668945280073810(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getTypeOf(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false));
}
public static SNode sourceNodeQuery_3644668945280073822(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "filterBlock", true), "body", true);
}
public static SNode sourceNodeQuery_3644668945280073845(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "initialValueBlock", true), "body", true);
}
public static SNode sourceNodeQuery_3644668945280073866(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getTypeOf(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false));
}
public static SNode sourceNodeQuery_5934994956486433145(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), "mainComponent", true));
}
public static SNode sourceNodeQuery_5934994956486316508(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "mainComponent", true);
}
public static SNode sourceNodeQuery_3302086321379147988(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "focusedComponent", true);
}
public static SNode sourceNodeQuery_5934994956485965449(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "commitBlock", true), "body", true);
}
public static SNode sourceNodeQuery_5934994956486031368(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "value", true);
}
public static SNode sourceNodeQuery_5934994956486031328(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "error", true);
}
public static SNode sourceNodeQuery_3302086321379403314(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_3302086321379403322(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newConceptFQName", true);
}
public static SNode sourceNodeQuery_3302086321379403330(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newFeatureName", true);
}
public static SNode sourceNodeQuery_3302086321379403391(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_4312073247720567550(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "text", true);
}
public static Iterable sourceNodesQuery_1201177824403(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "arguments", true)) {
if (RequiredAdditionalArgument_Behavior.call_isTransient_1213877343864(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "internalArguments", true)) {
if (RequiredAdditionalArgument_Behavior.call_isTransient_1213877343864(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_1198673830801(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
List<SNode> requiredUserEnteredArguments = SLinkOperations.getTargets(_context.getNode(), "arguments", true);
for (SNode argument : requiredUserEnteredArguments) {
if ((SLinkOperations.getTarget(argument, "filterClause", true) != null)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_1189698183859(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "arguments", true);
}
public static Iterable sourceNodesQuery_1189698208144(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "internalArguments", true);
}
public static Iterable sourceNodesQuery_1197992301257(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
List<SNode> requiredUserEnteredArguments = SLinkOperations.getTargets(_context.getNode(), "arguments", true);
for (SNode argument : requiredUserEnteredArguments) {
if ((SLinkOperations.getTarget(argument, "chooseComponentClause", true) != null)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_1198600029014(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
List<SNode> requiredUserEnteredArguments = SLinkOperations.getTargets(_context.getNode(), "arguments", true);
for (SNode argument : requiredUserEnteredArguments) {
if ((SLinkOperations.getTarget(argument, "initialValue", true) != null)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_7110754463748604291(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "arguments", true);
}
public static Iterable sourceNodesQuery_1212245202911(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "finders", true);
}
public static Iterable sourceNodesQuery_478744034994714500(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "parameter", true)) {
if (RefactoringArgument_Behavior.call_isTransient_478744034994716004(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_7573235936722710654(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "field", true)) {
if (RefactoringArgument_Behavior.call_isTransient_478744034994716004(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_4131204317224631821(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "parameter", true);
}
public static class Pattern_x583g4_a0a0a0a81 extends GeneratedMatchingPattern implements IMatchingPattern {
/*package*/ SNode patternVar_concept;
public Pattern_x583g4_a0a0a0a81() {
}
public boolean match(SNode nodeToMatch) {
{
SNode nodeToMatch_QueriesGenerated_x583g4_a0a0a81;
nodeToMatch_QueriesGenerated_x583g4_a0a0a81 = nodeToMatch;
if (!("jetbrains.mps.lang.smodel.structure.SNodeType".equals(nodeToMatch_QueriesGenerated_x583g4_a0a0a81.getConceptFqName()))) {
return false;
}
patternVar_concept = nodeToMatch_QueriesGenerated_x583g4_a0a0a81.getReferent("concept");
}
return true;
}
public boolean hasAntiquotations() {
return false;
}
public void fillFieldValuesFrom(GeneratedMatchingPattern pattern) {
if (pattern != null && pattern.getClass() == this.getClass()) {
patternVar_concept = (SNode) pattern.getFieldValue("patternVar_concept");
}
}
public Object getFieldValue(String fieldName) {
if ("patternVar_concept".equals(fieldName)) {
return patternVar_concept;
}
return null;
}
public void performActions(Object o) {
}
}
public static class QuotationClass_x583g4_a0a0a0a94 {
public QuotationClass_x583g4_a0a0a0a94() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.NODE")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a0a0a0a0xb {
public QuotationClass_x583g4_a0a0a0a0xb() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.MODEL")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a0a0a1a0xb {
public QuotationClass_x583g4_a0a0a1a0xb() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.MODULE")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a0a0a2a0xb {
public QuotationClass_x583g4_a0a0a2a0xb() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.ANY")));
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a78 {
public QuotationClass_x583g4_a1a0a0a78() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.StringType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a88 {
public QuotationClass_x583g4_a1a0a0a88() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.lang.smodel.structure.SNodeType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a98 {
public QuotationClass_x583g4_a1a0a0a98() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.lang.smodel.structure.SModelType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a09 {
public QuotationClass_x583g4_a1a0a0a09() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.ClassifierType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("classifier", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.smodel(jetbrains.mps.smodel@java_stub)"), SNodeId.fromString("~SModelDescriptor")));
result = quotedNode1_2;
}
return result;
}
}
}
|
UTF-8
|
Java
| 65,217 |
java
|
QueriesGenerated.java
|
Java
|
[] | null |
[] |
package jetbrains.mps.lang.refactoring.generator.baseLanguage.template.main;
/*Generated by MPS */
import jetbrains.mps.smodel.IOperationContext;
import jetbrains.mps.generator.template.BaseMappingRuleContext;
import jetbrains.mps.smodel.SNode;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.generator.template.PropertyMacroContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.smodel.behaviour.BehaviorManager;
import jetbrains.mps.lang.pattern.GeneratedMatchingPattern;
import jetbrains.mps.typesystem.inference.TypeChecker;
import jetbrains.mps.lang.plugin.behavior.KeyMapKeystroke_Behavior;
import jetbrains.mps.generator.template.ReferenceMacroContext;
import jetbrains.mps.lang.typesystem.runtime.HUtil;
import jetbrains.mps.lang.refactoring.behavior.MPSParameterType_Behavior;
import jetbrains.mps.generator.template.IfMacroContext;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodeContext;
import jetbrains.mps.generator.template.SourceSubstituteMacroNodesContext;
import java.util.List;
import java.util.ArrayList;
import jetbrains.mps.lang.refactoring.behavior.RequiredAdditionalArgument_Behavior;
import jetbrains.mps.lang.refactoring.behavior.RefactoringArgument_Behavior;
import jetbrains.mps.lang.pattern.IMatchingPattern;
import java.util.Set;
import java.util.HashSet;
import jetbrains.mps.smodel.SModelUtil_new;
import jetbrains.mps.project.GlobalScope;
import jetbrains.mps.smodel.SReference;
import jetbrains.mps.smodel.SModelReference;
import jetbrains.mps.smodel.SNodeId;
public class QueriesGenerated {
public static boolean baseMappingRule_Condition_478744034994714447(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
SNode parent = SNodeOperations.getParent(_context.getNode());
if (SNodeOperations.isInstanceOf(parent, "jetbrains.mps.baseLanguage.structure.AssignmentExpression")) {
return !(SLinkOperations.getTarget(SNodeOperations.cast(parent, "jetbrains.mps.baseLanguage.structure.AssignmentExpression"), "lValue", true) == _context.getNode());
}
return true;
}
public static boolean baseMappingRule_Condition_478744034994714473(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RequiredAdditionalArgumentReference");
}
public static boolean baseMappingRule_Condition_5934994956486892156(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return !(SNodeOperations.hasRole(_context.getNode(), "jetbrains.mps.baseLanguage.structure.AssignmentExpression", "lValue"));
}
public static boolean baseMappingRule_Condition_5934994956486892165(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringArgumentReference");
}
public static boolean baseMappingRule_Condition_7786266509745404976(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "moduleType", true) != null);
}
public static boolean baseMappingRule_Condition_7786266509745405243(final IOperationContext operationContext, final BaseMappingRuleContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "concept", false) != null);
}
public static Object propertyMacro_GetPropertyValue_6528618226609204856(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1199462157225(final IOperationContext operationContext, final PropertyMacroContext _context) {
return ((String) BehaviorManager.getInstance().invoke(Object.class, SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "keystroke", true), "jetbrains.mps.lang.editor.structure.CellKeyMapKeystroke"), "call_getKeyStroke_1213877273475", new Class[]{SNode.class}));
}
public static Object propertyMacro_GetPropertyValue_1199462256696(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_1198673899511(final IOperationContext operationContext, final PropertyMacroContext _context) {
return "My_" + SPropertyOperations.getString(_context.getNode(), "name") + "_Condition";
}
public static Object propertyMacro_GetPropertyValue_1189698210116(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1189776889452(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1189698215259(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1189776896095(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1191238748328(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "userFriendlyName");
}
public static Object propertyMacro_GetPropertyValue_1789893890062506474(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_1197993525530(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name") + "_componentCreator";
}
public static Object propertyMacro_GetPropertyValue_1198600574129(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name") + "_initialValue";
}
public static Object propertyMacro_GetPropertyValue_7110754463748604112(final IOperationContext operationContext, final PropertyMacroContext _context) {
{
GeneratedMatchingPattern pattern_x583g4_a0s = new QueriesGenerated.Pattern_x583g4_a0a0a0a81();
SNode coercedNode_x583g4_a0s = TypeChecker.getInstance().getRuntimeSupport().coerce_(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), pattern_x583g4_a0s);
if (coercedNode_x583g4_a0s != null) {
SNode abstractConceptDeclaration = SNodeOperations.cast(((SNode) pattern_x583g4_a0s.getFieldValue("patternVar_concept")), "jetbrains.mps.lang.structure.structure.AbstractConceptDeclaration");
return SNodeOperations.getModel(abstractConceptDeclaration).getSModelFqName() + "." + SPropertyOperations.getString(abstractConceptDeclaration, "name");
} else {
}
}
return null;
}
public static Object propertyMacro_GetPropertyValue_7110754463748604238(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_7110754463748604250(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "presentation");
}
public static Object propertyMacro_GetPropertyValue_1189697560065(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_1190733623863(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RequiredAdditionalArgumentReference"), "argument", false), "name");
}
public static Object propertyMacro_GetPropertyValue_1217265953059(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), "argument", false), "name");
}
public static Object propertyMacro_GetPropertyValue_1212245181527(final IOperationContext operationContext, final PropertyMacroContext _context) {
return ((String) BehaviorManager.getInstance().invoke(Object.class, SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "finderDeclaration", false), "jetbrains.mps.lang.findUsages.structure.FinderDeclaration"), "call_getGeneratedClassLongName_1213877240120", new Class[]{SNode.class}));
}
public static Object propertyMacro_GetPropertyValue_478744034994714493(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_7573235936722710647(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_6215884973916329887(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_6215884973916329851(final IOperationContext operationContext, final PropertyMacroContext _context) {
return ((SLinkOperations.getTarget(_context.getNode(), "keystroke", true) == null) ?
"" :
KeyMapKeystroke_Behavior.call_getKeyStroke_1213877278942(SLinkOperations.getTarget(_context.getNode(), "keystroke", true))
);
}
public static Object propertyMacro_GetPropertyValue_478744034994714810(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "userFriendlyName");
}
public static Object propertyMacro_GetPropertyValue_478744034994714829(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode overriden = SLinkOperations.getTarget(_context.getNode(), "overrides", false);
if (overriden == null) {
return null;
}
return SNodeOperations.getModel(overriden).getSModelFqName() + "." + SPropertyOperations.getString(overriden, "name");
}
public static Object propertyMacro_GetPropertyValue_478744034994715649(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "name");
}
public static Object propertyMacro_GetPropertyValue_7573235936722758678(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getBoolean(_context.getNode(), "allowMultiple");
}
public static Object propertyMacro_GetPropertyValue_7573235936722758651(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false), "name") + "_Target";
}
public static Object propertyMacro_GetPropertyValue_7573235936722759810(final IOperationContext operationContext, final PropertyMacroContext _context) {
if (SNodeOperations.isInstanceOf(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference")) {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference"), "baseVariableDeclaration", false), "name");
} else {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(_context.getNode(), "lValue", true), "jetbrains.mps.lang.refactoring.structure.RefactoringParameterReference"), "refactoringParameter", false), "name");
}
}
public static Object propertyMacro_GetPropertyValue_7573235936722759785(final IOperationContext operationContext, final PropertyMacroContext _context) {
if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference")) {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringFieldReference"), "baseVariableDeclaration", false), "name");
} else {
return SPropertyOperations.getString(SLinkOperations.getTarget(SNodeOperations.cast(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameterReference"), "refactoringParameter", false), "name");
}
}
public static Object propertyMacro_GetPropertyValue_3644668945280030591(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false), "name");
}
public static Object propertyMacro_GetPropertyValue_3644668945280073777(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), "title");
}
public static Object propertyMacro_GetPropertyValue_3644668945280073883(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode refactoringParameter = SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false);
SNode refactoring = SNodeOperations.getAncestor(refactoringParameter, "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false);
return SPropertyOperations.getString(refactoring, "name") + "_" + SPropertyOperations.getString(refactoringParameter, "name") + "_Settings";
}
public static Object propertyMacro_GetPropertyValue_3060724424231928584(final IOperationContext operationContext, final PropertyMacroContext _context) {
SNode refactoringParameter = SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false);
SNode refactoring = SNodeOperations.getAncestor(refactoringParameter, "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false);
return SPropertyOperations.getString(refactoring, "name") + "_" + SPropertyOperations.getString(refactoringParameter, "name") + "_Chooser";
}
public static Object propertyMacro_GetPropertyValue_5934994956485965416(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getBoolean(_context.getNode(), "stretch");
}
public static Object propertyMacro_GetPropertyValue_5934994956486031356(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false), "name");
}
public static Object propertyMacro_GetPropertyValue_4312073247720715217(final IOperationContext operationContext, final PropertyMacroContext _context) {
return SPropertyOperations.getString(SLinkOperations.getTarget(_context.getNode(), "parameter", false), "name");
}
public static Object referenceMacro_GetReferent_6528618226609334501(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "applicableConcept", false);
}
public static Object referenceMacro_GetReferent_7110754463748604065(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "componentCreator_old");
}
public static Object referenceMacro_GetReferent_7110754463748604216(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "conditionConstructor_old");
}
public static Object referenceMacro_GetReferent_7110754463748604269(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "initialValue_old");
}
public static Object referenceMacro_GetReferent_1200935757745(final IOperationContext operationContext, final ReferenceMacroContext _context) {
SNode classifierType = TypeChecker.getInstance().getRuntimeSupport().coerce_(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "argument", false), "argumentType", true), HUtil.createMatchingPatternByConceptFQName("jetbrains.mps.baseLanguage.structure.ClassifierType"), true);
return SLinkOperations.getTarget(classifierType, "classifier", false);
}
public static Object referenceMacro_GetReferent_6215884973916316575(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SLinkOperations.getTarget(_context.getNode(), "target", true), "refactoringTargetConstructor");
}
public static Object referenceMacro_GetReferent_7573235936722758662(final IOperationContext operationContext, final ReferenceMacroContext _context) {
if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.NodeTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a0a94().createNode(), "enumConstantDeclaration", false);
} else if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.ModelTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a0a0xb().createNode(), "enumConstantDeclaration", false);
} else if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.ModuleTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a1a0xb().createNode(), "enumConstantDeclaration", false);
} else if (SNodeOperations.isInstanceOf(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.AnyTarget")) {
return SLinkOperations.getTarget(new QueriesGenerated.QuotationClass_x583g4_a0a0a2a0xb().createNode(), "enumConstantDeclaration", false);
}
return null;
}
public static Object referenceMacro_GetReferent_8041810900052414627(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false), "refactoringClass");
}
public static Object referenceMacro_GetReferent_7786266509745404941(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "moduleType", true), "classifier", false);
}
public static Object referenceMacro_GetReferent_7786266509745404970(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "concept", false);
}
public static Object referenceMacro_GetReferent_3644668945280073911(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.MPSParameterChooser", false, false), "settingsClass");
}
public static Object referenceMacro_GetReferent_4413749148913757642(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "settingsConstructor");
}
public static Object referenceMacro_GetReferent_3644668945280030643(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(MPSParameterType_Behavior.call_getCreatorMethod_4413749148913760555(SLinkOperations.getTarget(_context.getNode(), "paramType", true)), "baseMethodDeclaration", false);
}
public static Object referenceMacro_GetReferent_4413749148913760650(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return SLinkOperations.getTarget(MPSParameterType_Behavior.call_getCreatorMethod_4413749148913760555(SLinkOperations.getTarget(_context.getNode(), "paramType", true)), "classConcept", false);
}
public static Object referenceMacro_GetReferent_5934994956486126386(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(_context.getNode(), "customChooserConstructor");
}
public static Object referenceMacro_GetReferent_5934994956486083401(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.CustomParameterChooser", false, false), "customChooserClass");
}
public static Object referenceMacro_GetReferent_5934994956486316708(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.CustomParameterChooser", false, false), "customChooserClass");
}
public static Object referenceMacro_GetReferent_5934994956487138577(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.CustomParameterChooser", false, false), "customChooserClass");
}
public static Object referenceMacro_GetReferent_4312073247720715335(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.cast(SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "parameter", false), "chooser", true), "jetbrains.mps.lang.refactoring.structure.MPSParameterChooser"), "settingsConstructor");
}
public static Object referenceMacro_GetReferent_4312073247720514254(final IOperationContext operationContext, final ReferenceMacroContext _context) {
return _context.getOutputNodeByInputNodeAndMappingLabel(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.Refactoring", false, false), "refactoringClass");
}
public static boolean ifMacro_Condition_1199462382860(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) == null) && (SLinkOperations.getTarget(_context.getNode(), "keystroke", true) == null);
}
public static boolean ifMacro_Condition_1199462333157(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) == null) && (SLinkOperations.getTarget(_context.getNode(), "keystroke", true) != null);
}
public static boolean ifMacro_Condition_1199462335285(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) != null);
}
public static boolean ifMacro_Condition_1198674172362(final IOperationContext operationContext, final IfMacroContext _context) {
return true;
}
public static boolean ifMacro_Condition_1789893890062507458(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) != null);
}
public static boolean ifMacro_Condition_1789893890062507285(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", null, null);
}
public static boolean ifMacro_Condition_1789893890062507297(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "model", null);
}
public static boolean ifMacro_Condition_1789893890062507309(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "language", null);
}
public static boolean ifMacro_Condition_1789893890062507321(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "solution", null);
}
public static boolean ifMacro_Condition_1789893890062507333(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.hasValue(_context.getNode(), "refactoringTargetKind", "devkit", null);
}
public static boolean ifMacro_Condition_1789893890062505213(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "isApplicableClause", true) != null);
}
public static boolean ifMacro_Condition_6528618226609334511(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "applicableConcept", false) != null);
}
public static boolean ifMacro_Condition_1789893890062500133(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "isApplicableToModelClause", true) != null);
}
public static boolean ifMacro_Condition_700745782152800956(final IOperationContext operationContext, final IfMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true) != null && SPropertyOperations.getBoolean(_context.getNode(), "refactorImmediatelyIfNoUsages");
}
public static boolean ifMacro_Condition_6528618226609334567(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062301483(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062301596(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "doRefactorClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062301668(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "getModelsToGenerateClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062321107(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "getModelsToUpdateClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062321131(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelClause", true) != null);
}
public static boolean ifMacro_Condition_1789893890062321166(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "nodesToOpenClause", true) != null);
}
public static boolean ifMacro_Condition_6528618226609334578(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelClause", true) != null);
}
public static boolean ifMacro_Condition_700745782152520300(final IOperationContext operationContext, final IfMacroContext _context) {
return SPropertyOperations.getBoolean(_context.getNode(), "oneTargetOnly");
}
public static boolean ifMacro_Condition_7110754463748604074(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) != null);
}
public static boolean ifMacro_Condition_7110754463748604088(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a78().createNode());
}
public static boolean ifMacro_Condition_7110754463748604145(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a88().createNode());
}
public static boolean ifMacro_Condition_7110754463748604169(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a98().createNode());
}
public static boolean ifMacro_Condition_7110754463748604193(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true) == null) && TypeChecker.getInstance().getSubtypingManager().isSubtype(SLinkOperations.getTarget(_context.getNode(), "argumentType", true), new QueriesGenerated.QuotationClass_x583g4_a1a0a0a09().createNode());
}
public static boolean ifMacro_Condition_7110754463748604224(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "filterClause", true) != null);
}
public static boolean ifMacro_Condition_7110754463748604277(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "initialValue", true) != null);
}
public static boolean ifMacro_Condition_7110754463748604327(final IOperationContext operationContext, final IfMacroContext _context) {
return ListSequence.fromList(SLinkOperations.getTargets(_context.getNode(), "arguments", true)).isNotEmpty();
}
public static boolean ifMacro_Condition_1212243788664(final IOperationContext operationContext, final IfMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchNode", true) == null;
}
public static boolean ifMacro_Condition_1212243800827(final IOperationContext operationContext, final IfMacroContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchScope", true) == null;
}
public static boolean ifMacro_Condition_6215884973916329838(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) == null);
}
public static boolean ifMacro_Condition_478744034994714858(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "overrides", false) != null);
}
public static boolean ifMacro_Condition_7573235936722711769(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "initBlock", true) != null);
}
public static boolean ifMacro_Condition_616550569929040368(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "modelsToGenerateBlock", true) != null);
}
public static boolean ifMacro_Condition_7573235936722711846(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "doWhenDoneBlock", true) != null);
}
public static boolean ifMacro_Condition_1347577327951505984(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "affectedNodesBlock", true) != null);
}
public static boolean ifMacro_Condition_1347577327951506011(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelBlock", true) != null);
}
public static boolean ifMacro_Condition_1347577327951669531(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "updateModelBlock", true) == null);
}
public static boolean ifMacro_Condition_7573235936722758695(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "isApplicableBlock", true) == null);
}
public static boolean ifMacro_Condition_3644668945280073833(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "filterBlock", true) != null);
}
public static boolean ifMacro_Condition_3644668945280073856(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "initialValueBlock", true) != null);
}
public static boolean ifMacro_Condition_3302086321379147975(final IOperationContext operationContext, final IfMacroContext _context) {
return (SLinkOperations.getTarget(_context.getNode(), "focusedComponent", true) == null);
}
public static SNode sourceNodeQuery_1198673965458(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1198674072178(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1198674859451(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "filterClause", true), "body", true);
}
public static SNode sourceNodeQuery_1198674956266(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1789893890062505223(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "isApplicableClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062505117(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "isApplicableToModelClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062301545(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "affectedNodesClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062301658(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "doRefactorClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062301688(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "getModelsToGenerateClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062321117(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "getModelsToUpdateClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062321151(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "updateModelClause", true), "body", true);
}
public static SNode sourceNodeQuery_1789893890062321190(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "nodesToOpenClause", true), "body", true);
}
public static SNode sourceNodeQuery_1197993779521(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1197992605929(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "chooseComponentClause", true), "body", true);
}
public static SNode sourceNodeQuery_1198600035299(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1198600088963(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "initialValue", true), "body", true);
}
public static SNode sourceNodeQuery_7110754463748604052(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argumentType", true);
}
public static SNode sourceNodeQuery_1197373531048(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "rValue", true);
}
public static SNode sourceNodeQuery_1197387263078(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_1197387243573(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newConceptFQName", true);
}
public static SNode sourceNodeQuery_1197387243581(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newFeatureName", true);
}
public static SNode sourceNodeQuery_1198577826555(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "argument", true);
}
public static SNode sourceNodeQuery_1199623494551(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199623490797(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1199623613817(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199623611204(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "roleInTarget", true);
}
public static SNode sourceNodeQuery_1199623608450(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1199623733861(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199623737069(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1199623873330(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_1199625039959(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "roleInTarget", true);
}
public static SNode sourceNodeQuery_1199623869841(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_1204723894467(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_1212243848033(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchNode", true);
}
public static SNode sourceNodeQuery_1212243880040(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "searchScope", true);
}
public static SNode sourceNodeQuery_3242588059496756733(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "whatToMove", true);
}
public static SNode sourceNodeQuery_3242588059496756749(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "destination", true);
}
public static SNode sourceNodeQuery_7573235936722711758(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "initBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722711151(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "doRefactorBlock", true), "body", true);
}
public static SNode sourceNodeQuery_616550569929040349(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "modelsToGenerateBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722711835(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "doWhenDoneBlock", true), "body", true);
}
public static SNode sourceNodeQuery_1347577327951505972(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "affectedNodesBlock", true), "body", true);
}
public static SNode sourceNodeQuery_1347577327951506001(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "updateModelBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722758760(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "isApplicableBlock", true), "body", true);
}
public static SNode sourceNodeQuery_7573235936722758977(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SNodeOperations.copyNode(TypeChecker.getInstance().getTypeOf(_context.getNode()));
}
public static SNode sourceNodeQuery_7573235936722759823(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "rValue", true);
}
public static SNode sourceNodeQuery_7573235936722759862(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getRuntimeSupport().coerce_(TypeChecker.getInstance().getTypeOf(_context.getNode()), HUtil.createMatchingPatternByConceptFQName("jetbrains.mps.baseLanguage.structure.ClassifierType"), true);
}
public static SNode sourceNodeQuery_4131204317224631832(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "refactoringParameter", false), "chooser", true);
}
public static SNode sourceNodeQuery_3644668945280073794(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getRuntimeSupport().coerce_(TypeChecker.getInstance().getTypeOf(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false)), HUtil.createMatchingPatternByConceptFQName("jetbrains.mps.baseLanguage.structure.ClassifierType"), true);
}
public static SNode sourceNodeQuery_3644668945280073810(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getTypeOf(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false));
}
public static SNode sourceNodeQuery_3644668945280073822(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "filterBlock", true), "body", true);
}
public static SNode sourceNodeQuery_3644668945280073845(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "initialValueBlock", true), "body", true);
}
public static SNode sourceNodeQuery_3644668945280073866(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getTypeOf(SNodeOperations.getAncestor(_context.getNode(), "jetbrains.mps.lang.refactoring.structure.RefactoringParameter", false, false));
}
public static SNode sourceNodeQuery_5934994956486433145(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), "mainComponent", true));
}
public static SNode sourceNodeQuery_5934994956486316508(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "mainComponent", true);
}
public static SNode sourceNodeQuery_3302086321379147988(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "focusedComponent", true);
}
public static SNode sourceNodeQuery_5934994956485965449(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(SLinkOperations.getTarget(_context.getNode(), "commitBlock", true), "body", true);
}
public static SNode sourceNodeQuery_5934994956486031368(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "value", true);
}
public static SNode sourceNodeQuery_5934994956486031328(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "error", true);
}
public static SNode sourceNodeQuery_3302086321379403314(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_3302086321379403322(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newConceptFQName", true);
}
public static SNode sourceNodeQuery_3302086321379403330(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "newFeatureName", true);
}
public static SNode sourceNodeQuery_3302086321379403391(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "feature", true);
}
public static SNode sourceNodeQuery_4312073247720567550(final IOperationContext operationContext, final SourceSubstituteMacroNodeContext _context) {
return SLinkOperations.getTarget(_context.getNode(), "text", true);
}
public static Iterable sourceNodesQuery_1201177824403(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "arguments", true)) {
if (RequiredAdditionalArgument_Behavior.call_isTransient_1213877343864(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "internalArguments", true)) {
if (RequiredAdditionalArgument_Behavior.call_isTransient_1213877343864(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_1198673830801(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
List<SNode> requiredUserEnteredArguments = SLinkOperations.getTargets(_context.getNode(), "arguments", true);
for (SNode argument : requiredUserEnteredArguments) {
if ((SLinkOperations.getTarget(argument, "filterClause", true) != null)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_1189698183859(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "arguments", true);
}
public static Iterable sourceNodesQuery_1189698208144(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "internalArguments", true);
}
public static Iterable sourceNodesQuery_1197992301257(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
List<SNode> requiredUserEnteredArguments = SLinkOperations.getTargets(_context.getNode(), "arguments", true);
for (SNode argument : requiredUserEnteredArguments) {
if ((SLinkOperations.getTarget(argument, "chooseComponentClause", true) != null)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_1198600029014(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
List<SNode> requiredUserEnteredArguments = SLinkOperations.getTargets(_context.getNode(), "arguments", true);
for (SNode argument : requiredUserEnteredArguments) {
if ((SLinkOperations.getTarget(argument, "initialValue", true) != null)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_7110754463748604291(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "arguments", true);
}
public static Iterable sourceNodesQuery_1212245202911(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "finders", true);
}
public static Iterable sourceNodesQuery_478744034994714500(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "parameter", true)) {
if (RefactoringArgument_Behavior.call_isTransient_478744034994716004(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_7573235936722710654(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
List<SNode> result = new ArrayList<SNode>();
for (SNode argument : SLinkOperations.getTargets(_context.getNode(), "field", true)) {
if (RefactoringArgument_Behavior.call_isTransient_478744034994716004(argument)) {
ListSequence.fromList(result).addElement(argument);
}
}
return result;
}
public static Iterable sourceNodesQuery_4131204317224631821(final IOperationContext operationContext, final SourceSubstituteMacroNodesContext _context) {
return SLinkOperations.getTargets(_context.getNode(), "parameter", true);
}
public static class Pattern_x583g4_a0a0a0a81 extends GeneratedMatchingPattern implements IMatchingPattern {
/*package*/ SNode patternVar_concept;
public Pattern_x583g4_a0a0a0a81() {
}
public boolean match(SNode nodeToMatch) {
{
SNode nodeToMatch_QueriesGenerated_x583g4_a0a0a81;
nodeToMatch_QueriesGenerated_x583g4_a0a0a81 = nodeToMatch;
if (!("jetbrains.mps.lang.smodel.structure.SNodeType".equals(nodeToMatch_QueriesGenerated_x583g4_a0a0a81.getConceptFqName()))) {
return false;
}
patternVar_concept = nodeToMatch_QueriesGenerated_x583g4_a0a0a81.getReferent("concept");
}
return true;
}
public boolean hasAntiquotations() {
return false;
}
public void fillFieldValuesFrom(GeneratedMatchingPattern pattern) {
if (pattern != null && pattern.getClass() == this.getClass()) {
patternVar_concept = (SNode) pattern.getFieldValue("patternVar_concept");
}
}
public Object getFieldValue(String fieldName) {
if ("patternVar_concept".equals(fieldName)) {
return patternVar_concept;
}
return null;
}
public void performActions(Object o) {
}
}
public static class QuotationClass_x583g4_a0a0a0a94 {
public QuotationClass_x583g4_a0a0a0a94() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.NODE")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a0a0a0a0xb {
public QuotationClass_x583g4_a0a0a0a0xb() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.MODEL")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a0a0a1a0xb {
public QuotationClass_x583g4_a0a0a1a0xb() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.MODULE")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a0a0a2a0xb {
public QuotationClass_x583g4_a0a0a2a0xb() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.EnumConstantReference", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("enumConstantDeclaration", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType.ANY")));
quotedNode1_2.addReference(SReference.create("enumClass", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.refactoring.framework(jetbrains.mps.refactoring.framework@java_stub)"), SNodeId.fromString("~IRefactoringTarget$TargetType")));
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a78 {
public QuotationClass_x583g4_a1a0a0a78() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.StringType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a88 {
public QuotationClass_x583g4_a1a0a0a88() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.lang.smodel.structure.SNodeType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a98 {
public QuotationClass_x583g4_a1a0a0a98() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.lang.smodel.structure.SModelType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
result = quotedNode1_2;
}
return result;
}
}
public static class QuotationClass_x583g4_a1a0a0a09 {
public QuotationClass_x583g4_a1a0a0a09() {
}
public SNode createNode() {
SNode result = null;
Set<SNode> _parameterValues_129834374 = new HashSet<SNode>();
SNode quotedNode_1 = null;
{
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration("jetbrains.mps.baseLanguage.structure.ClassifierType", null, GlobalScope.getInstance(), false);
SNode quotedNode1_2 = quotedNode_1;
quotedNode1_2.addReference(SReference.create("classifier", quotedNode1_2, SModelReference.fromString("f:java_stub#jetbrains.mps.smodel(jetbrains.mps.smodel@java_stub)"), SNodeId.fromString("~SModelDescriptor")));
result = quotedNode1_2;
}
return result;
}
}
}
| 65,217 | 0.794103 | 0.736832 | 1,050 | 61.111427 | 68.744606 | 335 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.032381 | false | false |
13
|
b81493e5835d71e8bd24c9dfab1d30a54157bdff
| 12,781,822,701,874 |
960d3b70ca60ce5707bd08b5ac2a81866ef969c2
|
/src/main/java/cn/momia/mapi/api/feed/FeedV1Api.java
|
0fa83d73167245683278fb228fa59109228f400f
|
[
"Apache-2.0"
] |
permissive
|
lovemomia/mapi
|
https://github.com/lovemomia/mapi
|
0dbdb27695ca9e82e5566d7db3b5000b6eaaa701
|
5957708df30819dba8a89d10e2b92943ff4ea7f0
|
refs/heads/master
| 2021-03-27T19:37:32.298000 | 2016-07-11T04:14:39 | 2016-07-11T04:14:39 | 40,113,157 | 1 | 0 | null | false | 2016-07-11T04:14:39 | 2015-08-03T08:11:50 | 2016-01-19T07:16:27 | 2016-07-11T04:14:39 | 712 | 1 | 0 | 0 |
Java
| null | null |
package cn.momia.mapi.api.feed;
import cn.momia.common.core.dto.PagedList;
import cn.momia.common.core.http.MomiaHttpResponse;
import cn.momia.mapi.api.AbstractApi;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/v1/feed")
public class FeedV1Api extends AbstractApi {
@Deprecated
@RequestMapping(method = RequestMethod.GET)
public MomiaHttpResponse list() {
return MomiaHttpResponse.SUCCESS(PagedList.EMPTY);
}
}
|
UTF-8
|
Java
| 613 |
java
|
FeedV1Api.java
|
Java
|
[] | null |
[] |
package cn.momia.mapi.api.feed;
import cn.momia.common.core.dto.PagedList;
import cn.momia.common.core.http.MomiaHttpResponse;
import cn.momia.mapi.api.AbstractApi;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/v1/feed")
public class FeedV1Api extends AbstractApi {
@Deprecated
@RequestMapping(method = RequestMethod.GET)
public MomiaHttpResponse list() {
return MomiaHttpResponse.SUCCESS(PagedList.EMPTY);
}
}
| 613 | 0.796085 | 0.792822 | 18 | 33.055557 | 21.754877 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.444444 | false | false |
13
|
70282fb83f075096a2c6544b58d7285a393b1c93
| 13,683,765,807,062 |
ccabfef78210b4140509b139e50743d7db586a4e
|
/src/data/ReviewManager.java
|
da311be1ab2f92cd04349913a6a39f577f471991
|
[] |
no_license
|
JimmyRothric/HotelManagementSystem
|
https://github.com/JimmyRothric/HotelManagementSystem
|
d8e8f01e8ddca4fb30e77315ad8b695fc21cb20d
|
fbecf4c22ac8b8e3a073a5aa34d722c5f7ba2682
|
refs/heads/master
| 2021-09-05T07:34:10.156000 | 2018-01-25T08:32:08 | 2018-01-25T08:32:08 | 113,012,581 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package data;
public class ReviewManager {
private ReviewManager() {}
private static final ReviewManager instance = new ReviewManager();
public ReviewManager getReviewManager() {
return instance;
}
}
|
UTF-8
|
Java
| 213 |
java
|
ReviewManager.java
|
Java
|
[] | null |
[] |
package data;
public class ReviewManager {
private ReviewManager() {}
private static final ReviewManager instance = new ReviewManager();
public ReviewManager getReviewManager() {
return instance;
}
}
| 213 | 0.746479 | 0.746479 | 12 | 16.75 | 20.207775 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
13
|
c4ac80d027a7d1cf82428b21512298e15b498094
| 16,140,487,167,471 |
d6d8a3d3d7b006f2eaa1bbaaf872975a76649906
|
/mobile-parent/mobile-driver/src/main/java/com/wait/conditions/ExpectedCondition.java
|
8bbf10cc5ba7ed8761c32d6a23d854a5c3f6de4a
|
[] |
no_license
|
amordas/dte-mobile-driver
|
https://github.com/amordas/dte-mobile-driver
|
d73d032f4cb14332831594a6e0aaf7c66d7cf839
|
b40433769d5c8e33586656e9cad596f6d1272b2c
|
refs/heads/master
| 2015-08-08T11:42:42.938000 | 2013-07-11T15:56:48 | 2013-07-11T15:56:48 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.wait.conditions;
import com.nativedriver.NativeDriver;
import com.wait.Function;
public abstract interface ExpectedCondition<T> extends Function<NativeDriver, T> {
}
|
UTF-8
|
Java
| 181 |
java
|
ExpectedCondition.java
|
Java
|
[] | null |
[] |
package com.wait.conditions;
import com.nativedriver.NativeDriver;
import com.wait.Function;
public abstract interface ExpectedCondition<T> extends Function<NativeDriver, T> {
}
| 181 | 0.812155 | 0.812155 | 8 | 21.625 | 26.837183 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
13
|
77e90baee67781b989daf435802d82f3a9a9dd0b
| 5,789,615,932,774 |
63318b07e95a9d4a39cd00538e9a4988713bc187
|
/Tax_Credits_Automation/src/main/java/adp/tcs/automation/stepsfiles/ManualKeySteps.java
|
5126c9342998fdf246554b7519fe14730e1374cc
|
[] |
no_license
|
garghina02/Jbehave
|
https://github.com/garghina02/Jbehave
|
c508e3ff449632ced7bd04521c28f9b635f4d305
|
d61c2f73f9e72a247f22020d83d4ad0d4d249e9d
|
refs/heads/master
| 2020-02-05T21:47:36.258000 | 2017-08-19T10:00:17 | 2017-08-19T10:00:17 | 97,934,056 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package adp.tcs.automation.stepsfiles;
import adp.tcs.automation.locators.ManualKeyLocators;
import adp.tcs.automation.pages.EditPersonalInformation;
import adp.tcs.automation.pages.ManualKeyPages;
import adp.tcs.automation.pages.MonitoringPages;
import adp.tcs.automation.pages.SearchSSNthroughHub;
import adp.tcs.automation.utilities.ExcelReaderWriter;
import adp.tcs.automation.utilities.WndowAction;
import adp.tcs.automation.utilities.randomSSNgenrater;
import org.jbehave.core.annotations.Named;
import org.jbehave.core.annotations.When;
import org.openqa.selenium.By;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ManualKeySteps extends BaseTempletSteps{
private final SearchSSNthroughHub hub = new SearchSSNthroughHub();
private final WndowAction windowAct = new WndowAction();
private final MonitoringPages monitorElements = new MonitoringPages();
private final ManualKeyPages manualKeyElements= new ManualKeyPages();
private final HubValidationsSteps hubValidationsSteps = new HubValidationsSteps();
private final EditPersonalInformation editPersonalInformation = new EditPersonalInformation();
private randomSSNgenrater ssnGenerator = new randomSSNgenrater();
private ExcelReaderWriter excelReaderWriter = new ExcelReaderWriter();
private Manager_Hire_Steps mgrHire = new Manager_Hire_Steps();
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
Date date = new Date();
public void gotoManualKeyFromPaperPage() {
try {
hub.navigateBackOffice();
monitorElements.data_Entry_Link().click();
sleep(2000);
manualKeyElements.manulKeyLinkOnDataEntry().click();
sleep(3000);
userClick(monitorElements.data_Entry_Link());
sleep(2000);
userClick(manualKeyElements.manulKeyLinkOnDataEntry());
sleep(2000);
if(!isDisplayed(manualKeyElements.companyNameInputFieldsOnManualKeyPage())) {
for (int i = 1; i <= 10; i++) {
userClick(monitorElements.data_Entry_Link());
sleep(2000);
userClick(manualKeyElements.manulKeyLinkOnDataEntry());
sleep(2000);
if (isDisplayed(manualKeyElements.companyNameInputFieldsOnManualKeyPage())) {
break;
}
}
}
getDriver().findElement(By.xpath("//div[@class=\"form-data-container ng-scope\"]")).click();
//Actions action = new Actions(driver);
// WebElement mainMenu = driver.findElement(By.linkText("MainMenu"));
//action.moveToElement( monitorElements.data_Entry_Link()).moveToElement(manualKeyElements.manulKeyLinkOnDataEntry()).click().build().perform();
sleep(2000);
} catch (Exception e) {
e.printStackTrace();
verifyTest("User is on hub page -- gotoManualKeyFromPaperPage() ", false);
}
}
/*
This method is used for Performing Manual Key In from Paper.
*/
@When("Perform manaul Key from paper screening")
public void manaulKeyFromPaperScreening(@Named("CurrentDate") String currentDate) {
try {
verifyTest("Perform manaul Key from paper screening");
sleep(10000);
waitForLoad();
gotoManualKeyFromPaperPage();
manualKeyElements.companyNameInputFieldsOnManualKeyPage().sendKeys(getExcelData().get("COMPANY_NAME"));
editPersonalInformation.edit_Company_Select().click();
hubValidationsSteps.unitNameSelection(getExcelData().get("UNIT_LOCATION"));
sleep(2000);
waitForLoad();
//manualKeyElements.startScreeningBtnOnManualKeyPage().click();
sleep(4000);
waitForLoad();
// windowAct.switchtoMultiChildWindow(manualKeyElements.startScreeningBtnOnManualKeyPage());
windowAct.switchtoWindowForManualKey(manualKeyElements.startScreeningBtnOnManualKeyPage());
sleep(5000);
waitForLoad();
performFormRevisionPageActions();
sleep(2000);
waitForLoad();
performPersonalInfoPageActions(currentDate);
sleep(2000);
waitForLoad();
performConfirmSsnPageActions();
sleep(2000);
waitForLoad();
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("AUGUST 2009 (2010 RFV)")) {
performManaulForm8850Aug2009RFVPageActions();
waitForLoad();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JANUARY 2012 (2012 RFV)")) {
performManaulForm8850Jan2012RFVPageActions();
waitForLoad();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JUNE 2015 (2015 RFV)")) {
performManaulForm8850June2015RFVPageActions();
waitForLoad();
}
sleep(2000);
verifyThankYouPage();
//getConfirmationNumber();
excelReaderWriter.writeSSNAndConfirmationNumber();
System.out.println("Screening Completed!!! SSN : "+ getExcelData().get("SSN"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Perform manaul Key from paper screening : manaulKeyFromPaperScreening()", false);
}
}
public void performFormRevisionPageActions(){
try {
sleep(2000);
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("AUGUST 2009 (2010 RFV)")) {
manualKeyElements.formRevisionQuestion_August_2009().click();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JANUARY 2012 (2012 RFV)")) {
manualKeyElements.formRevisionQuestion_January_2012().click();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JUNE 2015 (2015 RFV)")) {
manualKeyElements.formRevisionQuestion_June_2015().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performFormRevisionPageActions page",false);
}
}
public void performPersonalInfoPageActions(String currentDate){
try {
String currentDatet = String.valueOf(dateFormat.format(date));
System.out.println(currentDatet);
String ssn = String.valueOf(ssnGenerator.generateSSN());
getExcelData().put("SSN", ssn);
getExcelData().put("CSSN", ssn);
manualKeyElements.personalInfoFirstName().sendKeys(getExcelData().get("FNAME"));
manualKeyElements.personalInfoMiddleName().sendKeys(getExcelData().get("MNAME"));
manualKeyElements.personalInfoLastName().sendKeys(getExcelData().get("LNAME"));
manualKeyElements.personalInfoSsn().sendKeys(getExcelData().get("SSN"));
manualKeyElements.personalInfoStreetAddress().sendKeys(getExcelData().get("HOME_STREET_ADDRESS"));
manualKeyElements.personalInfoZip().sendKeys(getExcelData().get("ZIP"));
//manualKeyElements.personalInfoCity().sendKeys(getExcelData().get("CITY"));
//selectDropdown(manualKeyElements.personalInfoState(),getExcelData().get("STATE"));
manualKeyElements.personalInfoTelephone().sendKeys(getExcelData().get("TELEPHONE"));
manualKeyElements.personalInfoDOB().sendKeys(getExcelData().get("DOB"));
if(currentDate.equalsIgnoreCase("Y")){
manualKeyElements.personalInfoGaveInfoDate().sendKeys(currentDatet);
manualKeyElements.personalInfoJobOfferDate().sendKeys(currentDatet);
manualKeyElements.personalInfoHireDate().sendKeys(currentDatet);
manualKeyElements.personalInfoStartDate().sendKeys(currentDatet);
}else {
manualKeyElements.personalInfoGaveInfoDate().sendKeys(getExcelData().get("HIRE_GAVE_INFO_DATE"));
manualKeyElements.personalInfoJobOfferDate().sendKeys(getExcelData().get("HIRE_JOB_OFFER_DATE"));
manualKeyElements.personalInfoHireDate().sendKeys(getExcelData().get("HIRE_DATE"));
manualKeyElements.personalInfoStartDate().sendKeys(getExcelData().get("HIRE_START_DATE"));
}
if(!getExcelData().get("MISSING_HIRE_START_DATE_CHECK").equals("NO")) {
manualKeyElements.personalInfoMissingDate().click();
}
selectDropdown(manualKeyElements.personalInfoJobPosition(),getExcelData().get("HIRE_JOB_POSITION"));
manualKeyElements.personalInfoStartWage().sendKeys(getExcelData().get("HIRE_WAGE"));
manualKeyElements.form_Revision_Continue_Button().click();
waitForLoad();
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performPersonalInfoPageActions page",false);
}
}
public void performConfirmSsnPageActions(){
try {
manualKeyElements.confirmSSNAgain().sendKeys(getExcelData().get("SSN"));
manualKeyElements.confirmSSNConfirmationNumber().sendKeys(getExcelData().get("CSSN"));
manualKeyElements.confirmSSNOperatorName().sendKeys(getExcelData().get("OPERATOR_NAME"));
manualKeyElements.confirmSSNTodaysDate().sendKeys(currentdate());
manualKeyElements.form_Revision_Continue_Button().click();
sleep(3000);
waitForLoad();
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performConfirmSsnPageActions page",false);
}
}
public void performManaulForm8850June2015RFVPageActions(){
try {
boolean isWOTCCvEnabled = false;
boolean isWOTCFsEnabled = false;
boolean isWOTCVrEnabled = false;
boolean isWOTCWEnabled = false;
boolean isWOTCFEnabled = false;
boolean isWOTCLTUEEnabled = false;
boolean isWOTCLTUEBothEnabled = false;
if(getExcelData().get("Have you previously worked for Motox?").equals("YES")){
manualKeyElements.form8850June2015RFVQ1().click();
}
if(getExcelData().get("1a- Are you a veteran of the US Armed Forces?").equals("YES")){
manualKeyElements.form8850June2015RFVQ2().click();
isWOTCCvEnabled = true;
}
if(getExcelData().get("1b- Are you entitled to receive compensation for a service connected disability?").equals("YES")){
manualKeyElements.form8850June2015RFVQ3().click();
}
if(getExcelData().get("Were you discharged or released from active duty from the armed forces in the past year?").equals("YES")){
manualKeyElements.form8850June2015RFVQ4().click();
}
if(getExcelData().get("Were you unemployed for a combined total of at least 4 weeks but less than 6 months in the past year?").equals("YES")){
manualKeyElements.form8850June2015RFVQ5().click();
}
if(getExcelData().get("Were you unemployed for a combined total of 6 months or more in the past year?").equals("YES")){
manualKeyElements.form8850June2015RFVQ6().click();
}
if(getExcelData().get("2a- Have you or a family member (while living in your houseland) received Food Stamps anytime within the last 15 months?").equals("YES")){
manualKeyElements.form8850June2015RFVQ7().click();
isWOTCFsEnabled = true;
}
if(getExcelData().get("3a - Have you participated in a vocational rehabilitation program?").equals("YES")){
manualKeyElements.form8850June2015RFVQ8().click();
isWOTCVrEnabled = true;
}
if(getExcelData().get("4a - Are you a member or a family that received Welfare (AFDC or TANF)").equals("YES")){
manualKeyElements.form8850June2015RFVQ9().click();
isWOTCWEnabled = true;
}
if(getExcelData().get("5a - Did you receive Supplemental Security Income (SSI) within the last 90 days?").equals("YES")){
manualKeyElements.form8850June2015RFVQ10().click();
}
if(getExcelData().get("6a - Are you currently receiving Social Security Administration disability benefits (SSDI)?").equals("YES")){
manualKeyElements.form8850June2015RFVQ11().click();
}
if(getExcelData().get("7a - Have you been convicted of a felony or have you received deferred adjudication for a felony?").equals("YES")){
manualKeyElements.form8850June2015RFVQ12().click();
isWOTCFEnabled = true;
}
if(getExcelData().get("7b - Were you released, or did you start a work release program or transition center within the past 12 months?").equals("YES")){
manualKeyElements.form8850June2015RFVQ13().click();
}
if(getExcelData().get("Have you been continuously unemployed for the last 27 weeks (since at least 03/29/2016)?").equals("YES") &&
getExcelData().get("During your period of unemployment, did you, at any time, receive State or Federal unemployment compensation?").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
manualKeyElements.form8850June2015RFVQ15().click();
isWOTCLTUEBothEnabled = true;
}else{
if(getExcelData().get("Have you been continuously unemployed for the last 27 weeks (since at least 03/29/2016)?").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
isWOTCLTUEEnabled = true;
}
if(getExcelData().get("During your period of unemployment, did you, at any time, receive State or Federal unemployment compensation?").equals("YES")){
manualKeyElements.form8850June2015RFVQ15().click();
isWOTCLTUEEnabled = true;
}
}
if(isWOTCCvEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_BRANCH)){
wotc_CV_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_CV_PageActions();
}
}
if(isWOTCFsEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS_PRIMARY_RECIPIENT_NAME)){
wotc_FS_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_FS_PageActions();
}
}
if(isWOTCVrEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_VR_STATE_LOCAL_AGENCY)){
wotc_VR_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_VR_PageActions();
}
}
if(isWOTCWEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_W_PRIMARY_RECIPIENT_NAME)){
wotc_W_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_W_PageActions();
}
}
if(isWOTCFEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_F_FEDERAL_YES)){
wotc_F_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_F_PageActions();
}
}
if(isWOTCLTUEEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_LTUE_START_DATE_UNEMPL)){
wotc_LTUE_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_LTUE_PageActions();
}
}
if(isWOTCLTUEBothEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_LTUE_START_DATE_UNEMPL)){
wotc_LTUE_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_LTUE_PageActions();
}
}
if(isDisplayed(ManualKeyLocators.continueButton)){
manualKeyElements.form_Revision_Continue_Button().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performManaulForm8850June2015RFVPageActions page",false);
}
}
public void wotc_CV_PageActions() {
try {
manualKeyElements.wotcCVBranch().sendKeys(getExcelData().get("WOTC_CV/WOTC_DV/WOTC_UV_BRANCH"));
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_STATE)){
selectDropdownByValue(manualKeyElements.wotcCVState(),getExcelData().get("WOTC_FS_STATE"));
}
} catch (Exception e) {
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_CV_PageActions() ", false);
e.printStackTrace();
}
}
public void wotc_FS_PageActions() {
try {
manualKeyElements.wotcFsPrimaryRecipientName().sendKeys(getExcelData().get("WOTC_FS_PRIMARY_RECIPIENT_NAME"));
manualKeyElements.wotcFsCity().sendKeys(getExcelData().get("WOTC_FS_CITY"));
selectDropdownByValue(manualKeyElements.wotcFsState(),getExcelData().get("WOTC_FS_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_FS_PageActions() ", false);
}
}
public void wotc_VR_PageActions() {
try {
if(getExcelData().get("WOTC_VR_IF_YES").equals("STATE/LOCAL AGENCY")) {
manualKeyElements.wotcVrStateLocalAgency().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("VETERAN ADMINISTRATION")) {
manualKeyElements.wotcVrVeteranAdministration().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("TICKET TO WORK")) {
manualKeyElements.wotcVrTicketToWork().click();
}
manualKeyElements.wotcVrCounslerName().sendKeys(getExcelData().get("WOTC_VR_COUNSLER_NAME"));
manualKeyElements.wotcVrCity().sendKeys(getExcelData().get("WOTC_VR_CITY"));
selectDropdownByValue(manualKeyElements.wotcVrState(),getExcelData().get("WOTC_VR_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_VR_PageActions() ", false);
}
}
public void wotc_W_PageActions() {
try {
manualKeyElements.wotWPrimarryRecipientName().sendKeys(getExcelData().get("WOTC_W_PRIMARY_RECIPIENT_NAME"));
manualKeyElements.wotcWCity().sendKeys(getExcelData().get("WOTC_W_CITY"));
selectDropdownByValue(manualKeyElements.wotcWState(),getExcelData().get("WOTC_W_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_W_PageActions() ", false);
}
}
public void wotc_F_PageActions() {
try {
if(getExcelData().get("WOTC_F_CONVICTION").equals("FEDERAL")) {
manualKeyElements.wotcFFederalYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("STATE")) {
manualKeyElements.wotcFStateYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("NONE (DEFERRED ADJUDICATION)")) {
manualKeyElements.wotcFNoneYes().click();
}
manualKeyElements.wotcFConvictionMonthYear().sendKeys(getExcelData().get("WOTC_F_CONVICTION_MONTH_YEAR"));
manualKeyElements.wotcFReleaseMonthYear().sendKeys(getExcelData().get("WOTC_F_RELEASE_MONTH_YEAR"));
manualKeyElements.wotcFInmate().sendKeys(getExcelData().get("WOTC_F_INMATE"));
manualKeyElements.wotcFCity().sendKeys(getExcelData().get("WOTC_F_CITY"));
selectDropdownByValue(manualKeyElements.wotcFState(),getExcelData().get("WOTC_F_STATE"));
manualKeyElements.wotcFProbationOfficer().sendKeys(getExcelData().get("WOTC_F_PROBATION_OFFICER"));
manualKeyElements.wotcFProbationOfficerPhone().sendKeys(getExcelData().get("WOTC_F_PROBATION_OFFICER_PHONE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_F_PageActions() ", false);
}
}
public void wotc_LTUE_PageActions() {
try {
manualKeyElements.wotcLtueStartDateUnempl().sendKeys(getExcelData().get("WOTC_LTUE_START_DATE_UNEMPL"));
selectDropdownByValue(manualKeyElements.wotcLtueState(),getExcelData().get("WOTC_LTUE_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_LTUE_PageActions() ", false);
}
}
public void verifyThankYouPage() {
try {
String thankText = manualKeyElements.thankYouPageTitle().getText();
String empQulify = manualKeyElements.emplQulifyText().getText();
String screeningCompleted = manualKeyElements.screeningCompletedText().getText();
if(!thankText.equals("Thank You Page") || !empQulify.equals(getExcelData().get("QULIFY_TEXT")) ||
!screeningCompleted.equals("Screening completed - thank you! You can safely close this window/tab now.")){
verifyTest("Thank you page from manual key is not matching", false);
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_LTUE_PageActions() ", false);
}
}
public void performManaulForm8850Jan2012RFVPageActions(){
try {
boolean isWOTCCvEnabled = false;
boolean isWOTCFsEnabled = false;
boolean isWOTCVrEnabled = false;
boolean isWOTCWEnabled = false;
boolean isWOTCFEnabled = false;
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q1").equals("YES")){
manualKeyElements.form8850June2015RFVQ1().click();
isWOTCCvEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q2").equals("YES")){
manualKeyElements.form8850June2015RFVQ2().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q3").equals("YES")){
manualKeyElements.form8850June2015RFVQ3().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q4").equals("YES")){
manualKeyElements.form8850June2015RFVQ4().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q5").equals("YES")){
manualKeyElements.form8850June2015RFVQ5().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q6").equals("YES")){
manualKeyElements.form8850June2015RFVQ6().click();
isWOTCFsEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q7").equals("YES")){
manualKeyElements.form8850June2015RFVQ7().click();
isWOTCVrEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q8").equals("YES")){
manualKeyElements.form8850June2015RFVQ8().click();
isWOTCWEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q9").equals("YES")){
manualKeyElements.form8850June2015RFVQ9().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q10").equals("YES")){
manualKeyElements.form8850June2015RFVQ10().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q11").equals("YES")){
manualKeyElements.form8850June2015RFVQ11().click();
isWOTCFEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q12").equals("YES")){
manualKeyElements.form8850June2015RFVQ12().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q13").equals("YES")){
manualKeyElements.form8850June2015RFVQ13().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q14").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
}
if(isWOTCCvEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_BRANCH)){
wotc_CV_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_CV_PageActions();
}
}
if(isWOTCFsEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS_PRIMARY_RECIPIENT_NAME)){
wotc_FS_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_FS_PageActions();
}
}
if(isWOTCVrEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_VR_STATE_LOCAL_AGENCY)){
wotc_VR_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_VR_PageActions();
}
}
if(isWOTCWEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_W_PRIMARY_RECIPIENT_NAME)){
wotc_W_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_W_PageActions();
}
}
if(isWOTCFEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_F_FEDERAL_YES)){
wotc_F_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_F_PageActions();
}
}
if(isDisplayed(ManualKeyLocators.continueButton)){
manualKeyElements.form_Revision_Continue_Button().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performManaulForm8850Jan2012RFVPageActions page",false);
}
}
public void performManaulForm8850Aug2009RFVPageActions(){
try {
boolean isWOTCCvAug2009FormEnabled = false;
boolean isWOTCCvAug2009FormStateEnabled = false;
boolean isWOTCFsAug2009FormEnabled = false;
boolean isWOTCVrAug2009FormEnabled = false;
boolean isWOTCWAug2009FormEnabled = false;
boolean isWOTCFAug2009FormEnabled = false;
boolean isWOTCFs25Aug2009FormEnabled = false;
boolean isStateQuestionsAug2009FormEnabled = true;
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q1").equals("YES")){
manualKeyElements.form8850June2015RFVQ1().click();
//isStateQuestionsAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q2").equals("YES")){
manualKeyElements.form8850June2015RFVQ2().click();
isWOTCCvAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q3").equals("YES")){
manualKeyElements.form8850June2015RFVQ3().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q4").equals("YES")){
manualKeyElements.form8850June2015RFVQ4().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q5").equals("YES")){
manualKeyElements.form8850June2015RFVQ5().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q6").equals("YES")){
manualKeyElements.form8850June2015RFVQ6().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q7").equals("YES")){
manualKeyElements.form8850June2015RFVQ7().click();
if(!isWOTCCvAug2009FormEnabled){
isWOTCCvAug2009FormStateEnabled = true;
}
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q8").equals("YES")){
manualKeyElements.form8850June2015RFVQ8().click();
isWOTCFsAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q9").equals("YES")){
manualKeyElements.form8850June2015RFVQ9().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q10").equals("YES")){
manualKeyElements.form8850June2015RFVQ10().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q11").equals("YES")){
manualKeyElements.form8850June2015RFVQ11().click();
isWOTCWAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q12").equals("YES")){
manualKeyElements.form8850June2015RFVQ12().click();
isWOTCFAug2009FormEnabled= true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q13").equals("YES")){
manualKeyElements.form8850June2015RFVQ13().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q14").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q15").equals("YES")){
manualKeyElements.form8850June2015RFVQ15().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q16").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ16().click();
isWOTCVrAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q17").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ17().click();
isWOTCFs25Aug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q18").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ18().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q19").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ19().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q20").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ20().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q21").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ21().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q22").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ22().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q23").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ23().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q24").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ24().click();
}
if(isWOTCCvAug2009FormEnabled || isWOTCCvAug2009FormStateEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_BRANCH_SERVICE)){
wotcCVAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcCVAug2009FormPageActions();
}
}
if(isWOTCFsAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS_PRIMARY_FOOD_STAMPS_RECIPIENT)){
wotcFSAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcFSAug2009FormPageActions();
}
}
if(isWOTCWAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_W_PRIMARY_RECIPIENT_CHILD_NAME)){
wotcWAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcWAug2009FormPageActions();
}
}
if(isWOTCFAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_F_AUG_2009_CONVICTION_DATE)){
wotcFAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcFAug2009FormPageActions();
}
}
if(isWOTCVrAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_VR_AUG_2009_COUNSLER_NAME)){
wotcVrAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcVrAug2009FormPageActions();
}
}
if(isWOTCFs25Aug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS25_AUG_2009_FOOD_RECIPIENT)){
wotcFs25Aug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcFs25Aug2009FormPageActions();
}
}
if(isStateQuestionsAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.STATE_QUESTIONS_TEXT)){
stateQuestions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
stateQuestions();
}
}
if(isDisplayed(ManualKeyLocators.continueButton)){
manualKeyElements.form_Revision_Continue_Button().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performManaulForm8850Aug2009RFVPageActions page",false);
}
}
public void stateQuestions() {
try {
String stateQuestionText = manualKeyElements.stateQuestionText().getText();
if(!stateQuestionText.equals("State Questions")){
verifyTest("State Question Text not matched", false);
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- stateQuestions() ", false);
}
}
public void wotcFs25Aug2009FormPageActions() {
try {
manualKeyElements.wotcFs25FoodRecipient().sendKeys(getExcelData().get("WOTC_FS25_AUG_2009_FOOD_RECIPIENT"));
manualKeyElements.wotcFs25Relation().sendKeys(getExcelData().get("WOTC_FS25_AUG_2009_RELATION"));
manualKeyElements.wotcFs25City().sendKeys(getExcelData().get("WOTC_FS25_AUG_2009_CITY"));
selectDropdownByValue(manualKeyElements.wotcFs25State(),getExcelData().get("WOTC_FS25_AUG_2009_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcFs25Aug2009FormPageActions() ", false);
}
}
public void wotcVrAug2009FormPageActions() {
try {
if(getExcelData().get("WOTC_VR_IF_YES").equals("STATE/LOCAL AGENCY")) {
manualKeyElements.wotcVrStateLocalAgency().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("VETERAN ADMINISTRATION")) {
manualKeyElements.wotcVrVeteranAdministration().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("TICKET TO WORK")) {
manualKeyElements.wotcVrTicketToWork().click();
}
manualKeyElements.wotcVrAug2009City().sendKeys(getExcelData().get("WOTC_VR_AUG_2009_CITY"));
selectDropdownByValue(manualKeyElements.wotcVrAug2009State(),getExcelData().get("WOTC_VR_AUG_2009_STATE"));
manualKeyElements.wotcVrAug2009CounslerName().sendKeys(getExcelData().get("WOTC_VR_AUG_2009_COUNSLER_NAME"));
manualKeyElements.wotcVrAug2009CounslerPhone().sendKeys(getExcelData().get("WOTC_VR_AUG_2009_COUNSLER_PHONE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcVrAug2009FormPageActions() ", false);
}
}
public void wotcFAug2009FormPageActions() {
try {
manualKeyElements.wotcFConvictionDate().sendKeys(getExcelData().get("WOTC_F_AUG_2009_CONVICTION_DATE"));
if(getExcelData().get("WOTC_F_CONVICTION").equals("FEDERAL")) {
manualKeyElements.wotcFFederalYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("STATE")) {
manualKeyElements.wotcFStateYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("NONE (DEFERRED ADJUDICATION)")) {
manualKeyElements.wotcFNoneYes().click();
}
manualKeyElements.wotcFFormAug2009ReleaseMonthYear().sendKeys(getExcelData().get("WOTC_F_AUG_2009_RELEASE_MONTH_YEAR"));
manualKeyElements.wotcFWorkReleaseProg().sendKeys(getExcelData().get("WOTC_F_AUG_2009_WORK_RELEASE_PROG"));
manualKeyElements.wotcFFromAug2009City().sendKeys(getExcelData().get("WOTC_F_AUG_2009_CITY"));
manualKeyElements.wotcFFormAug2009ProbationOfficer().sendKeys(getExcelData().get("WOTC_F_AUG_2009_PROBATION_OFFICER"));
manualKeyElements.wotcFFormAug2009ProbationOfficerPhone().sendKeys(getExcelData().get("WOTC_F_AUG_2009_PROBATION_OFFICER_PHONE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcFAug2009FormPageActions() ", false);
}
}
public void wotcWAug2009FormPageActions() {
try {
manualKeyElements.wotcWChildName().sendKeys(getExcelData().get("WOTC_W_PRIMARY_RECIPIENT_CHILD_NAME"));
manualKeyElements.wotcWRelation().sendKeys(getExcelData().get("WOTC_W_RELATION_TO_YOU"));
manualKeyElements.wotcWFormAug2009City().sendKeys(getExcelData().get("WOTC_W_AUG_2009_CITY"));
selectDropdownByValue(manualKeyElements.wotcWFormAug2009State(),getExcelData().get("WOTC_W_AUG_2009_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcWAug2009FormPageActions() ", false);
}
}
public void wotcFSAug2009FormPageActions() {
try {
manualKeyElements.wotcFsFoodStampsRecipients().sendKeys(getExcelData().get("WOTC_FS_PRIMARY_FOOD_STAMPS_RECIPIENT"));
manualKeyElements.wotcFsCity().sendKeys(getExcelData().get("WOTC_FS_CITY"));
selectDropdownByValue(manualKeyElements.wotcFsState(),getExcelData().get("WOTC_FS_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcFSAug2009FormPageActions() ", false);
}
}
public void wotcCVAug2009FormPageActions() {
try {
manualKeyElements.wotcVBranchService().sendKeys(getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_BRANCH_SERVICE"));
manualKeyElements.wotcVStartMonthYear().sendKeys(getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_START_MONTH_YEAR"));
manualKeyElements.wotcVServiceEndMonthYear().sendKeys(getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_SERVICE_END_MONTH_YEAR"));
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_STATE_BENIFITS)){
selectDropdownByValue(manualKeyElements.wotcVStateBenifits(),getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_STATE_BENIFITS"));
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcCVAug2009FormPageActions() ", false);
}
}
}
|
UTF-8
|
Java
| 37,387 |
java
|
ManualKeySteps.java
|
Java
|
[
{
"context": "InfoGaveInfoDate().sendKeys(getExcelData().get(\"HIRE_GAVE_INFO_DATE\"));\n\t\t\t\tmanualKeyElements.personalInfoJobOfferDat",
"end": 7083,
"score": 0.6615794897079468,
"start": 7066,
"tag": "KEY",
"value": "RE_GAVE_INFO_DATE"
},
{
"context": "InfoJobOfferDate().sendKeys(getExcelData().get(\"HIRE_JOB_OFFER_DATE\"));\n\t\t\t\tmanualKeyElements.personalInfoHireDate().",
"end": 7185,
"score": 0.6601430177688599,
"start": 7168,
"tag": "KEY",
"value": "RE_JOB_OFFER_DATE"
},
{
"context": "onalInfoHireDate().sendKeys(getExcelData().get(\"HIRE_DATE\"));\n\t\t\t\tmanualKeyElements.personalInfoStartD",
"end": 7268,
"score": 0.5843023657798767,
"start": 7266,
"tag": "KEY",
"value": "RE"
},
{
"context": "ments.wotcCVBranch().sendKeys(getExcelData().get(\"WOTC_CV/WOTC_DV/WOTC_UV_BRANCH\"));\t\t\t\n\t\t\tif(isDisplayed(ManualKeyLocators.WOTC_C",
"end": 15672,
"score": 0.9294370412826538,
"start": 15642,
"tag": "KEY",
"value": "WOTC_CV/WOTC_DV/WOTC_UV_BRANCH"
},
{
"context": "wotcVrCounslerName().sendKeys(getExcelData().get(\"WOTC_VR_COUNSLER_NAME\"));\n\t\t\tmanualKeyElements.wotcVrCity().sendKeys(ge",
"end": 17054,
"score": 0.7475898861885071,
"start": 17033,
"tag": "KEY",
"value": "WOTC_VR_COUNSLER_NAME"
},
{
"context": "lements.wotcVrCity().sendKeys(getExcelData().get(\"WOTC_VR_CITY\"));\n\t\t\tselectDropdownByValue(manualKeyElements.wo",
"end": 17134,
"score": 0.8483043313026428,
"start": 17122,
"tag": "KEY",
"value": "WOTC_VR_CITY"
},
{
"context": "lements.wotcWCity().sendKeys(getExcelData().get(\"WOTC_W_CITY\"));\n \t\tselectDropdownByValue(manualKeyEl",
"end": 17614,
"score": 0.702240526676178,
"start": 17610,
"tag": "KEY",
"value": "OTC_"
},
{
"context": "ts.wotcWCity().sendKeys(getExcelData().get(\"WOTC_W_CITY\"));\n \t\tselectDropdownByValue(manualKeyElements",
"end": 17620,
"score": 0.5969011187553406,
"start": 17616,
"tag": "KEY",
"value": "CITY"
},
{
"context": "ageActions() {\n\t\ttry {\n\t\t\tmanualKeyElements.wotcFs25FoodRecipient().sendKeys(getExcelData().get(\"WOTC_",
"end": 32523,
"score": 0.6289747953414917,
"start": 32521,
"tag": "KEY",
"value": "25"
},
{
"context": "ions() {\n\t\ttry {\n\t\t\tmanualKeyElements.wotcFs25FoodRecipient().sendKeys(getExcelData().get(\"WOTC_FS25_AUG_2009",
"end": 32536,
"score": 0.5616556406021118,
"start": 32527,
"tag": "KEY",
"value": "Recipient"
},
{
"context": "cFs25FoodRecipient().sendKeys(getExcelData().get(\"WOTC_FS25_AUG_2009_FOOD_RECIPIENT\"));\n\t\t\tmanualKeyElements.wotcFs25Relation().sendK",
"end": 32601,
"score": 0.997011125087738,
"start": 32568,
"tag": "KEY",
"value": "WOTC_FS25_AUG_2009_FOOD_RECIPIENT"
},
{
"context": "09_FOOD_RECIPIENT\"));\n\t\t\tmanualKeyElements.wotcFs25Relation().sendKeys(getExcelData().get(\"WOTC_FS25_",
"end": 32635,
"score": 0.8434068560600281,
"start": 32634,
"tag": "KEY",
"value": "5"
},
{
"context": "s.wotcFs25Relation().sendKeys(getExcelData().get(\"WOTC_FS25_AUG_2009_RELATION\"));\n \t\tmanualKeyElements.wotcFs25City().sendKe",
"end": 32702,
"score": 0.9970201849937439,
"start": 32675,
"tag": "KEY",
"value": "WOTC_FS25_AUG_2009_RELATION"
},
{
"context": "AUG_2009_RELATION\"));\n \t\tmanualKeyElements.wotcFs25City().sendKeys(getExcelData().get(\"WOTC_FS25_AUG_2009",
"end": 32743,
"score": 0.7199125289916992,
"start": 32735,
"tag": "KEY",
"value": "Fs25City"
},
{
"context": "ments.wotcFs25City().sendKeys(getExcelData().get(\"WOTC_FS25_AUG_2009_CITY\"));\n \t\tselectDropdownByValue(manualKeyElements",
"end": 32798,
"score": 0.9933911561965942,
"start": 32775,
"tag": "KEY",
"value": "WOTC_FS25_AUG_2009_CITY"
},
{
"context": "wotcVrAug2009City().sendKeys(getExcelData().get(\"WOTC_VR_AUG_2009_CITY\"));\n\t\t\tselectDropdownByValue(manualK",
"end": 33628,
"score": 0.735397219657898,
"start": 33621,
"tag": "KEY",
"value": "OTC_VR_"
},
{
"context": "009City().sendKeys(getExcelData().get(\"WOTC_VR_AUG_2009_CITY\"));\n\t\t\tselectDropdownByValue(manualKeyEle",
"end": 33633,
"score": 0.7511042356491089,
"start": 33632,
"tag": "KEY",
"value": "2"
},
{
"context": "ty().sendKeys(getExcelData().get(\"WOTC_VR_AUG_2009_CITY\"));\n\t\t\tselectDropdownByValue(manualKeyElement",
"end": 33636,
"score": 0.5846126079559326,
"start": 33636,
"tag": "KEY",
"value": ""
},
{
"context": "ug2009CounslerName().sendKeys(getExcelData().get(\"WOTC_VR_AUG_2009_COUNSLER_NAME\"));\n\t\t\tmanualKeyElements.wotcVrAug2009CounslerPho",
"end": 33865,
"score": 0.853408694267273,
"start": 33835,
"tag": "KEY",
"value": "WOTC_VR_AUG_2009_COUNSLER_NAME"
},
{
"context": "2009CounslerPhone().sendKeys(getExcelData().get(\"WOTC_VR_AUG_2009_COUNSLER_PHONE\"));\n\t\t\t\n\t\t} catch (Exception e) ",
"end": 33963,
"score": 0.852526843547821,
"start": 33950,
"tag": "KEY",
"value": "OTC_VR_AUG_20"
},
{
"context": "one().sendKeys(getExcelData().get(\"WOTC_VR_AUG_2009_COUNSLER_PHONE\"));\n\t\t\t\n\t\t} catch (Exception e) {\t\t",
"end": 33966,
"score": 0.7159859538078308,
"start": 33964,
"tag": "KEY",
"value": "9_"
},
{
"context": "Keys(getExcelData().get(\"WOTC_VR_AUG_2009_COUNSLER_PHONE\"));\n\t\t\t\n\t\t} catch (Exception e) {\t\t\t\n\t\t\te.printSt",
"end": 33980,
"score": 0.7145233154296875,
"start": 33975,
"tag": "KEY",
"value": "PHONE"
},
{
"context": "09ProbationOfficer().sendKeys(getExcelData().get(\"WOTC_F_AUG_2009_PROBATION_OFFICER\"));\n\t\t\tmanualKeyElements.wotcFFormAug2009Probatio",
"end": 35146,
"score": 0.9663243293762207,
"start": 35113,
"tag": "KEY",
"value": "WOTC_F_AUG_2009_PROBATION_OFFICER"
},
{
"context": "bationOfficerPhone().sendKeys(getExcelData().get(\"WOTC_F_AUG_2009_PROBATION_OFFICER_PHONE\"));\n\t\t} catch (Exception e",
"end": 35257,
"score": 0.8939724564552307,
"start": 35241,
"tag": "KEY",
"value": "WOTC_F_AUG_2009_"
},
{
"context": "Keys(getExcelData().get(\"WOTC_F_AUG_2009_PROBATION_OFFICER_PHONE\"));\n\t\t} catch (Exception e) {\t\t\t\n\t\t\te.p",
"end": 35270,
"score": 0.7331229448318481,
"start": 35267,
"tag": "KEY",
"value": "OFF"
},
{
"context": "ExcelData().get(\"WOTC_F_AUG_2009_PROBATION_OFFICER_PHONE\"));\n\t\t} catch (Exception e) {\t\t\t\n\t\t\te.printStackT",
"end": 35280,
"score": 0.7173987627029419,
"start": 35275,
"tag": "KEY",
"value": "PHONE"
},
{
"context": "odStampsRecipients().sendKeys(getExcelData().get(\"WOTC_FS_PRIMARY_FOOD_STAMPS_RECIPIENT\"));\n \t\tmanualKeyE",
"end": 36216,
"score": 0.7447376251220703,
"start": 36208,
"tag": "KEY",
"value": "WOTC_FS_"
},
{
"context": "nts().sendKeys(getExcelData().get(\"WOTC_FS_PRIMARY_FOOD_STAMPS_RECIPIENT\"));\n \t\tmanualKeyElements.",
"end": 36223,
"score": 0.5461639165878296,
"start": 36223,
"tag": "KEY",
"value": ""
},
{
"context": "ys(getExcelData().get(\"WOTC_FS_PRIMARY_FOOD_STAMPS_RECIPIENT\"));\n \t\tmanualKeyElements.wotcFsCity()",
"end": 36235,
"score": 0.6291247010231018,
"start": 36235,
"tag": "KEY",
"value": ""
},
{
"context": "ents.wotcFsCity().sendKeys(getExcelData().get(\"WOTC_FS_CITY\"));\n \t\tselectDropdownByValue(manualKey",
"end": 36320,
"score": 0.5151233673095703,
"start": 36319,
"tag": "KEY",
"value": "C"
}
] | null |
[] |
package adp.tcs.automation.stepsfiles;
import adp.tcs.automation.locators.ManualKeyLocators;
import adp.tcs.automation.pages.EditPersonalInformation;
import adp.tcs.automation.pages.ManualKeyPages;
import adp.tcs.automation.pages.MonitoringPages;
import adp.tcs.automation.pages.SearchSSNthroughHub;
import adp.tcs.automation.utilities.ExcelReaderWriter;
import adp.tcs.automation.utilities.WndowAction;
import adp.tcs.automation.utilities.randomSSNgenrater;
import org.jbehave.core.annotations.Named;
import org.jbehave.core.annotations.When;
import org.openqa.selenium.By;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ManualKeySteps extends BaseTempletSteps{
private final SearchSSNthroughHub hub = new SearchSSNthroughHub();
private final WndowAction windowAct = new WndowAction();
private final MonitoringPages monitorElements = new MonitoringPages();
private final ManualKeyPages manualKeyElements= new ManualKeyPages();
private final HubValidationsSteps hubValidationsSteps = new HubValidationsSteps();
private final EditPersonalInformation editPersonalInformation = new EditPersonalInformation();
private randomSSNgenrater ssnGenerator = new randomSSNgenrater();
private ExcelReaderWriter excelReaderWriter = new ExcelReaderWriter();
private Manager_Hire_Steps mgrHire = new Manager_Hire_Steps();
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
Date date = new Date();
public void gotoManualKeyFromPaperPage() {
try {
hub.navigateBackOffice();
monitorElements.data_Entry_Link().click();
sleep(2000);
manualKeyElements.manulKeyLinkOnDataEntry().click();
sleep(3000);
userClick(monitorElements.data_Entry_Link());
sleep(2000);
userClick(manualKeyElements.manulKeyLinkOnDataEntry());
sleep(2000);
if(!isDisplayed(manualKeyElements.companyNameInputFieldsOnManualKeyPage())) {
for (int i = 1; i <= 10; i++) {
userClick(monitorElements.data_Entry_Link());
sleep(2000);
userClick(manualKeyElements.manulKeyLinkOnDataEntry());
sleep(2000);
if (isDisplayed(manualKeyElements.companyNameInputFieldsOnManualKeyPage())) {
break;
}
}
}
getDriver().findElement(By.xpath("//div[@class=\"form-data-container ng-scope\"]")).click();
//Actions action = new Actions(driver);
// WebElement mainMenu = driver.findElement(By.linkText("MainMenu"));
//action.moveToElement( monitorElements.data_Entry_Link()).moveToElement(manualKeyElements.manulKeyLinkOnDataEntry()).click().build().perform();
sleep(2000);
} catch (Exception e) {
e.printStackTrace();
verifyTest("User is on hub page -- gotoManualKeyFromPaperPage() ", false);
}
}
/*
This method is used for Performing Manual Key In from Paper.
*/
@When("Perform manaul Key from paper screening")
public void manaulKeyFromPaperScreening(@Named("CurrentDate") String currentDate) {
try {
verifyTest("Perform manaul Key from paper screening");
sleep(10000);
waitForLoad();
gotoManualKeyFromPaperPage();
manualKeyElements.companyNameInputFieldsOnManualKeyPage().sendKeys(getExcelData().get("COMPANY_NAME"));
editPersonalInformation.edit_Company_Select().click();
hubValidationsSteps.unitNameSelection(getExcelData().get("UNIT_LOCATION"));
sleep(2000);
waitForLoad();
//manualKeyElements.startScreeningBtnOnManualKeyPage().click();
sleep(4000);
waitForLoad();
// windowAct.switchtoMultiChildWindow(manualKeyElements.startScreeningBtnOnManualKeyPage());
windowAct.switchtoWindowForManualKey(manualKeyElements.startScreeningBtnOnManualKeyPage());
sleep(5000);
waitForLoad();
performFormRevisionPageActions();
sleep(2000);
waitForLoad();
performPersonalInfoPageActions(currentDate);
sleep(2000);
waitForLoad();
performConfirmSsnPageActions();
sleep(2000);
waitForLoad();
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("AUGUST 2009 (2010 RFV)")) {
performManaulForm8850Aug2009RFVPageActions();
waitForLoad();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JANUARY 2012 (2012 RFV)")) {
performManaulForm8850Jan2012RFVPageActions();
waitForLoad();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JUNE 2015 (2015 RFV)")) {
performManaulForm8850June2015RFVPageActions();
waitForLoad();
}
sleep(2000);
verifyThankYouPage();
//getConfirmationNumber();
excelReaderWriter.writeSSNAndConfirmationNumber();
System.out.println("Screening Completed!!! SSN : "+ getExcelData().get("SSN"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Perform manaul Key from paper screening : manaulKeyFromPaperScreening()", false);
}
}
public void performFormRevisionPageActions(){
try {
sleep(2000);
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("AUGUST 2009 (2010 RFV)")) {
manualKeyElements.formRevisionQuestion_August_2009().click();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JANUARY 2012 (2012 RFV)")) {
manualKeyElements.formRevisionQuestion_January_2012().click();
}
if(getExcelData().get("VERSION_FORM_8850_RFV").equals("JUNE 2015 (2015 RFV)")) {
manualKeyElements.formRevisionQuestion_June_2015().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performFormRevisionPageActions page",false);
}
}
public void performPersonalInfoPageActions(String currentDate){
try {
String currentDatet = String.valueOf(dateFormat.format(date));
System.out.println(currentDatet);
String ssn = String.valueOf(ssnGenerator.generateSSN());
getExcelData().put("SSN", ssn);
getExcelData().put("CSSN", ssn);
manualKeyElements.personalInfoFirstName().sendKeys(getExcelData().get("FNAME"));
manualKeyElements.personalInfoMiddleName().sendKeys(getExcelData().get("MNAME"));
manualKeyElements.personalInfoLastName().sendKeys(getExcelData().get("LNAME"));
manualKeyElements.personalInfoSsn().sendKeys(getExcelData().get("SSN"));
manualKeyElements.personalInfoStreetAddress().sendKeys(getExcelData().get("HOME_STREET_ADDRESS"));
manualKeyElements.personalInfoZip().sendKeys(getExcelData().get("ZIP"));
//manualKeyElements.personalInfoCity().sendKeys(getExcelData().get("CITY"));
//selectDropdown(manualKeyElements.personalInfoState(),getExcelData().get("STATE"));
manualKeyElements.personalInfoTelephone().sendKeys(getExcelData().get("TELEPHONE"));
manualKeyElements.personalInfoDOB().sendKeys(getExcelData().get("DOB"));
if(currentDate.equalsIgnoreCase("Y")){
manualKeyElements.personalInfoGaveInfoDate().sendKeys(currentDatet);
manualKeyElements.personalInfoJobOfferDate().sendKeys(currentDatet);
manualKeyElements.personalInfoHireDate().sendKeys(currentDatet);
manualKeyElements.personalInfoStartDate().sendKeys(currentDatet);
}else {
manualKeyElements.personalInfoGaveInfoDate().sendKeys(getExcelData().get("HIRE_GAVE_INFO_DATE"));
manualKeyElements.personalInfoJobOfferDate().sendKeys(getExcelData().get("HIRE_JOB_OFFER_DATE"));
manualKeyElements.personalInfoHireDate().sendKeys(getExcelData().get("HIRE_DATE"));
manualKeyElements.personalInfoStartDate().sendKeys(getExcelData().get("HIRE_START_DATE"));
}
if(!getExcelData().get("MISSING_HIRE_START_DATE_CHECK").equals("NO")) {
manualKeyElements.personalInfoMissingDate().click();
}
selectDropdown(manualKeyElements.personalInfoJobPosition(),getExcelData().get("HIRE_JOB_POSITION"));
manualKeyElements.personalInfoStartWage().sendKeys(getExcelData().get("HIRE_WAGE"));
manualKeyElements.form_Revision_Continue_Button().click();
waitForLoad();
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performPersonalInfoPageActions page",false);
}
}
public void performConfirmSsnPageActions(){
try {
manualKeyElements.confirmSSNAgain().sendKeys(getExcelData().get("SSN"));
manualKeyElements.confirmSSNConfirmationNumber().sendKeys(getExcelData().get("CSSN"));
manualKeyElements.confirmSSNOperatorName().sendKeys(getExcelData().get("OPERATOR_NAME"));
manualKeyElements.confirmSSNTodaysDate().sendKeys(currentdate());
manualKeyElements.form_Revision_Continue_Button().click();
sleep(3000);
waitForLoad();
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performConfirmSsnPageActions page",false);
}
}
public void performManaulForm8850June2015RFVPageActions(){
try {
boolean isWOTCCvEnabled = false;
boolean isWOTCFsEnabled = false;
boolean isWOTCVrEnabled = false;
boolean isWOTCWEnabled = false;
boolean isWOTCFEnabled = false;
boolean isWOTCLTUEEnabled = false;
boolean isWOTCLTUEBothEnabled = false;
if(getExcelData().get("Have you previously worked for Motox?").equals("YES")){
manualKeyElements.form8850June2015RFVQ1().click();
}
if(getExcelData().get("1a- Are you a veteran of the US Armed Forces?").equals("YES")){
manualKeyElements.form8850June2015RFVQ2().click();
isWOTCCvEnabled = true;
}
if(getExcelData().get("1b- Are you entitled to receive compensation for a service connected disability?").equals("YES")){
manualKeyElements.form8850June2015RFVQ3().click();
}
if(getExcelData().get("Were you discharged or released from active duty from the armed forces in the past year?").equals("YES")){
manualKeyElements.form8850June2015RFVQ4().click();
}
if(getExcelData().get("Were you unemployed for a combined total of at least 4 weeks but less than 6 months in the past year?").equals("YES")){
manualKeyElements.form8850June2015RFVQ5().click();
}
if(getExcelData().get("Were you unemployed for a combined total of 6 months or more in the past year?").equals("YES")){
manualKeyElements.form8850June2015RFVQ6().click();
}
if(getExcelData().get("2a- Have you or a family member (while living in your houseland) received Food Stamps anytime within the last 15 months?").equals("YES")){
manualKeyElements.form8850June2015RFVQ7().click();
isWOTCFsEnabled = true;
}
if(getExcelData().get("3a - Have you participated in a vocational rehabilitation program?").equals("YES")){
manualKeyElements.form8850June2015RFVQ8().click();
isWOTCVrEnabled = true;
}
if(getExcelData().get("4a - Are you a member or a family that received Welfare (AFDC or TANF)").equals("YES")){
manualKeyElements.form8850June2015RFVQ9().click();
isWOTCWEnabled = true;
}
if(getExcelData().get("5a - Did you receive Supplemental Security Income (SSI) within the last 90 days?").equals("YES")){
manualKeyElements.form8850June2015RFVQ10().click();
}
if(getExcelData().get("6a - Are you currently receiving Social Security Administration disability benefits (SSDI)?").equals("YES")){
manualKeyElements.form8850June2015RFVQ11().click();
}
if(getExcelData().get("7a - Have you been convicted of a felony or have you received deferred adjudication for a felony?").equals("YES")){
manualKeyElements.form8850June2015RFVQ12().click();
isWOTCFEnabled = true;
}
if(getExcelData().get("7b - Were you released, or did you start a work release program or transition center within the past 12 months?").equals("YES")){
manualKeyElements.form8850June2015RFVQ13().click();
}
if(getExcelData().get("Have you been continuously unemployed for the last 27 weeks (since at least 03/29/2016)?").equals("YES") &&
getExcelData().get("During your period of unemployment, did you, at any time, receive State or Federal unemployment compensation?").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
manualKeyElements.form8850June2015RFVQ15().click();
isWOTCLTUEBothEnabled = true;
}else{
if(getExcelData().get("Have you been continuously unemployed for the last 27 weeks (since at least 03/29/2016)?").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
isWOTCLTUEEnabled = true;
}
if(getExcelData().get("During your period of unemployment, did you, at any time, receive State or Federal unemployment compensation?").equals("YES")){
manualKeyElements.form8850June2015RFVQ15().click();
isWOTCLTUEEnabled = true;
}
}
if(isWOTCCvEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_BRANCH)){
wotc_CV_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_CV_PageActions();
}
}
if(isWOTCFsEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS_PRIMARY_RECIPIENT_NAME)){
wotc_FS_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_FS_PageActions();
}
}
if(isWOTCVrEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_VR_STATE_LOCAL_AGENCY)){
wotc_VR_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_VR_PageActions();
}
}
if(isWOTCWEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_W_PRIMARY_RECIPIENT_NAME)){
wotc_W_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_W_PageActions();
}
}
if(isWOTCFEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_F_FEDERAL_YES)){
wotc_F_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_F_PageActions();
}
}
if(isWOTCLTUEEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_LTUE_START_DATE_UNEMPL)){
wotc_LTUE_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_LTUE_PageActions();
}
}
if(isWOTCLTUEBothEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_LTUE_START_DATE_UNEMPL)){
wotc_LTUE_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_LTUE_PageActions();
}
}
if(isDisplayed(ManualKeyLocators.continueButton)){
manualKeyElements.form_Revision_Continue_Button().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performManaulForm8850June2015RFVPageActions page",false);
}
}
public void wotc_CV_PageActions() {
try {
manualKeyElements.wotcCVBranch().sendKeys(getExcelData().get("WOTC_CV/WOTC_DV/WOTC_UV_BRANCH"));
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_STATE)){
selectDropdownByValue(manualKeyElements.wotcCVState(),getExcelData().get("WOTC_FS_STATE"));
}
} catch (Exception e) {
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_CV_PageActions() ", false);
e.printStackTrace();
}
}
public void wotc_FS_PageActions() {
try {
manualKeyElements.wotcFsPrimaryRecipientName().sendKeys(getExcelData().get("WOTC_FS_PRIMARY_RECIPIENT_NAME"));
manualKeyElements.wotcFsCity().sendKeys(getExcelData().get("WOTC_FS_CITY"));
selectDropdownByValue(manualKeyElements.wotcFsState(),getExcelData().get("WOTC_FS_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_FS_PageActions() ", false);
}
}
public void wotc_VR_PageActions() {
try {
if(getExcelData().get("WOTC_VR_IF_YES").equals("STATE/LOCAL AGENCY")) {
manualKeyElements.wotcVrStateLocalAgency().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("VETERAN ADMINISTRATION")) {
manualKeyElements.wotcVrVeteranAdministration().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("TICKET TO WORK")) {
manualKeyElements.wotcVrTicketToWork().click();
}
manualKeyElements.wotcVrCounslerName().sendKeys(getExcelData().get("WOTC_VR_COUNSLER_NAME"));
manualKeyElements.wotcVrCity().sendKeys(getExcelData().get("<KEY>"));
selectDropdownByValue(manualKeyElements.wotcVrState(),getExcelData().get("WOTC_VR_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_VR_PageActions() ", false);
}
}
public void wotc_W_PageActions() {
try {
manualKeyElements.wotWPrimarryRecipientName().sendKeys(getExcelData().get("WOTC_W_PRIMARY_RECIPIENT_NAME"));
manualKeyElements.wotcWCity().sendKeys(getExcelData().get("WOTC_W_CITY"));
selectDropdownByValue(manualKeyElements.wotcWState(),getExcelData().get("WOTC_W_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_W_PageActions() ", false);
}
}
public void wotc_F_PageActions() {
try {
if(getExcelData().get("WOTC_F_CONVICTION").equals("FEDERAL")) {
manualKeyElements.wotcFFederalYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("STATE")) {
manualKeyElements.wotcFStateYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("NONE (DEFERRED ADJUDICATION)")) {
manualKeyElements.wotcFNoneYes().click();
}
manualKeyElements.wotcFConvictionMonthYear().sendKeys(getExcelData().get("WOTC_F_CONVICTION_MONTH_YEAR"));
manualKeyElements.wotcFReleaseMonthYear().sendKeys(getExcelData().get("WOTC_F_RELEASE_MONTH_YEAR"));
manualKeyElements.wotcFInmate().sendKeys(getExcelData().get("WOTC_F_INMATE"));
manualKeyElements.wotcFCity().sendKeys(getExcelData().get("WOTC_F_CITY"));
selectDropdownByValue(manualKeyElements.wotcFState(),getExcelData().get("WOTC_F_STATE"));
manualKeyElements.wotcFProbationOfficer().sendKeys(getExcelData().get("WOTC_F_PROBATION_OFFICER"));
manualKeyElements.wotcFProbationOfficerPhone().sendKeys(getExcelData().get("WOTC_F_PROBATION_OFFICER_PHONE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_F_PageActions() ", false);
}
}
public void wotc_LTUE_PageActions() {
try {
manualKeyElements.wotcLtueStartDateUnempl().sendKeys(getExcelData().get("WOTC_LTUE_START_DATE_UNEMPL"));
selectDropdownByValue(manualKeyElements.wotcLtueState(),getExcelData().get("WOTC_LTUE_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_LTUE_PageActions() ", false);
}
}
public void verifyThankYouPage() {
try {
String thankText = manualKeyElements.thankYouPageTitle().getText();
String empQulify = manualKeyElements.emplQulifyText().getText();
String screeningCompleted = manualKeyElements.screeningCompletedText().getText();
if(!thankText.equals("Thank You Page") || !empQulify.equals(getExcelData().get("QULIFY_TEXT")) ||
!screeningCompleted.equals("Screening completed - thank you! You can safely close this window/tab now.")){
verifyTest("Thank you page from manual key is not matching", false);
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotc_LTUE_PageActions() ", false);
}
}
public void performManaulForm8850Jan2012RFVPageActions(){
try {
boolean isWOTCCvEnabled = false;
boolean isWOTCFsEnabled = false;
boolean isWOTCVrEnabled = false;
boolean isWOTCWEnabled = false;
boolean isWOTCFEnabled = false;
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q1").equals("YES")){
manualKeyElements.form8850June2015RFVQ1().click();
isWOTCCvEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q2").equals("YES")){
manualKeyElements.form8850June2015RFVQ2().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q3").equals("YES")){
manualKeyElements.form8850June2015RFVQ3().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q4").equals("YES")){
manualKeyElements.form8850June2015RFVQ4().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q5").equals("YES")){
manualKeyElements.form8850June2015RFVQ5().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q6").equals("YES")){
manualKeyElements.form8850June2015RFVQ6().click();
isWOTCFsEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q7").equals("YES")){
manualKeyElements.form8850June2015RFVQ7().click();
isWOTCVrEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q8").equals("YES")){
manualKeyElements.form8850June2015RFVQ8().click();
isWOTCWEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q9").equals("YES")){
manualKeyElements.form8850June2015RFVQ9().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q10").equals("YES")){
manualKeyElements.form8850June2015RFVQ10().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q11").equals("YES")){
manualKeyElements.form8850June2015RFVQ11().click();
isWOTCFEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q12").equals("YES")){
manualKeyElements.form8850June2015RFVQ12().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q13").equals("YES")){
manualKeyElements.form8850June2015RFVQ13().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q14").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
}
if(isWOTCCvEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_BRANCH)){
wotc_CV_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_CV_PageActions();
}
}
if(isWOTCFsEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS_PRIMARY_RECIPIENT_NAME)){
wotc_FS_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_FS_PageActions();
}
}
if(isWOTCVrEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_VR_STATE_LOCAL_AGENCY)){
wotc_VR_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_VR_PageActions();
}
}
if(isWOTCWEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_W_PRIMARY_RECIPIENT_NAME)){
wotc_W_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_W_PageActions();
}
}
if(isWOTCFEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_F_FEDERAL_YES)){
wotc_F_PageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotc_F_PageActions();
}
}
if(isDisplayed(ManualKeyLocators.continueButton)){
manualKeyElements.form_Revision_Continue_Button().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performManaulForm8850Jan2012RFVPageActions page",false);
}
}
public void performManaulForm8850Aug2009RFVPageActions(){
try {
boolean isWOTCCvAug2009FormEnabled = false;
boolean isWOTCCvAug2009FormStateEnabled = false;
boolean isWOTCFsAug2009FormEnabled = false;
boolean isWOTCVrAug2009FormEnabled = false;
boolean isWOTCWAug2009FormEnabled = false;
boolean isWOTCFAug2009FormEnabled = false;
boolean isWOTCFs25Aug2009FormEnabled = false;
boolean isStateQuestionsAug2009FormEnabled = true;
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q1").equals("YES")){
manualKeyElements.form8850June2015RFVQ1().click();
//isStateQuestionsAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q2").equals("YES")){
manualKeyElements.form8850June2015RFVQ2().click();
isWOTCCvAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q3").equals("YES")){
manualKeyElements.form8850June2015RFVQ3().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q4").equals("YES")){
manualKeyElements.form8850June2015RFVQ4().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q5").equals("YES")){
manualKeyElements.form8850June2015RFVQ5().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q6").equals("YES")){
manualKeyElements.form8850June2015RFVQ6().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q7").equals("YES")){
manualKeyElements.form8850June2015RFVQ7().click();
if(!isWOTCCvAug2009FormEnabled){
isWOTCCvAug2009FormStateEnabled = true;
}
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q8").equals("YES")){
manualKeyElements.form8850June2015RFVQ8().click();
isWOTCFsAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q9").equals("YES")){
manualKeyElements.form8850June2015RFVQ9().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q10").equals("YES")){
manualKeyElements.form8850June2015RFVQ10().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q11").equals("YES")){
manualKeyElements.form8850June2015RFVQ11().click();
isWOTCWAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q12").equals("YES")){
manualKeyElements.form8850June2015RFVQ12().click();
isWOTCFAug2009FormEnabled= true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q13").equals("YES")){
manualKeyElements.form8850June2015RFVQ13().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q14").equals("YES")){
manualKeyElements.form8850June2015RFVQ14().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q15").equals("YES")){
manualKeyElements.form8850June2015RFVQ15().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q16").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ16().click();
isWOTCVrAug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q17").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ17().click();
isWOTCFs25Aug2009FormEnabled = true;
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q18").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ18().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q19").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ19().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q20").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ20().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q21").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ21().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q22").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ22().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q23").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ23().click();
}
if(getExcelData().get("FORM_8850_JAN_2012_RFV_Q24").equals("YES")){
manualKeyElements.form8850Aug2009RFVQ24().click();
}
if(isWOTCCvAug2009FormEnabled || isWOTCCvAug2009FormStateEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_BRANCH_SERVICE)){
wotcCVAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcCVAug2009FormPageActions();
}
}
if(isWOTCFsAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS_PRIMARY_FOOD_STAMPS_RECIPIENT)){
wotcFSAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcFSAug2009FormPageActions();
}
}
if(isWOTCWAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_W_PRIMARY_RECIPIENT_CHILD_NAME)){
wotcWAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcWAug2009FormPageActions();
}
}
if(isWOTCFAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_F_AUG_2009_CONVICTION_DATE)){
wotcFAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcFAug2009FormPageActions();
}
}
if(isWOTCVrAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_VR_AUG_2009_COUNSLER_NAME)){
wotcVrAug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcVrAug2009FormPageActions();
}
}
if(isWOTCFs25Aug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.WOTC_FS25_AUG_2009_FOOD_RECIPIENT)){
wotcFs25Aug2009FormPageActions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
wotcFs25Aug2009FormPageActions();
}
}
if(isStateQuestionsAug2009FormEnabled){
if(isDisplayed(ManualKeyLocators.STATE_QUESTIONS_TEXT)){
stateQuestions();
}else{
manualKeyElements.form_Revision_Continue_Button().click();
sleep(2000);
stateQuestions();
}
}
if(isDisplayed(ManualKeyLocators.continueButton)){
manualKeyElements.form_Revision_Continue_Button().click();
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Faliure in performManaulForm8850Aug2009RFVPageActions page",false);
}
}
public void stateQuestions() {
try {
String stateQuestionText = manualKeyElements.stateQuestionText().getText();
if(!stateQuestionText.equals("State Questions")){
verifyTest("State Question Text not matched", false);
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- stateQuestions() ", false);
}
}
public void wotcFs25Aug2009FormPageActions() {
try {
manualKeyElements.wotcFs25FoodRecipient().sendKeys(getExcelData().get("WOTC_FS25_AUG_2009_FOOD_RECIPIENT"));
manualKeyElements.wotcFs25Relation().sendKeys(getExcelData().get("WOTC_FS25_AUG_2009_RELATION"));
manualKeyElements.wotcFs25City().sendKeys(getExcelData().get("WOTC_FS25_AUG_2009_CITY"));
selectDropdownByValue(manualKeyElements.wotcFs25State(),getExcelData().get("WOTC_FS25_AUG_2009_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcFs25Aug2009FormPageActions() ", false);
}
}
public void wotcVrAug2009FormPageActions() {
try {
if(getExcelData().get("WOTC_VR_IF_YES").equals("STATE/LOCAL AGENCY")) {
manualKeyElements.wotcVrStateLocalAgency().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("VETERAN ADMINISTRATION")) {
manualKeyElements.wotcVrVeteranAdministration().click();
}
if(getExcelData().get("WOTC_VR_IF_YES").equals("TICKET TO WORK")) {
manualKeyElements.wotcVrTicketToWork().click();
}
manualKeyElements.wotcVrAug2009City().sendKeys(getExcelData().get("WOTC_VR_AUG_2009_CITY"));
selectDropdownByValue(manualKeyElements.wotcVrAug2009State(),getExcelData().get("WOTC_VR_AUG_2009_STATE"));
manualKeyElements.wotcVrAug2009CounslerName().sendKeys(getExcelData().get("WOTC_VR_AUG_2009_COUNSLER_NAME"));
manualKeyElements.wotcVrAug2009CounslerPhone().sendKeys(getExcelData().get("W<KEY>09_COUNSLER_PHONE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcVrAug2009FormPageActions() ", false);
}
}
public void wotcFAug2009FormPageActions() {
try {
manualKeyElements.wotcFConvictionDate().sendKeys(getExcelData().get("WOTC_F_AUG_2009_CONVICTION_DATE"));
if(getExcelData().get("WOTC_F_CONVICTION").equals("FEDERAL")) {
manualKeyElements.wotcFFederalYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("STATE")) {
manualKeyElements.wotcFStateYes().click();
}
if(getExcelData().get("WOTC_F_CONVICTION").equals("NONE (DEFERRED ADJUDICATION)")) {
manualKeyElements.wotcFNoneYes().click();
}
manualKeyElements.wotcFFormAug2009ReleaseMonthYear().sendKeys(getExcelData().get("WOTC_F_AUG_2009_RELEASE_MONTH_YEAR"));
manualKeyElements.wotcFWorkReleaseProg().sendKeys(getExcelData().get("WOTC_F_AUG_2009_WORK_RELEASE_PROG"));
manualKeyElements.wotcFFromAug2009City().sendKeys(getExcelData().get("WOTC_F_AUG_2009_CITY"));
manualKeyElements.wotcFFormAug2009ProbationOfficer().sendKeys(getExcelData().get("WOTC_F_AUG_2009_PROBATION_OFFICER"));
manualKeyElements.wotcFFormAug2009ProbationOfficerPhone().sendKeys(getExcelData().get("WOTC_F_AUG_2009_PROBATION_OFFICER_PHONE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcFAug2009FormPageActions() ", false);
}
}
public void wotcWAug2009FormPageActions() {
try {
manualKeyElements.wotcWChildName().sendKeys(getExcelData().get("WOTC_W_PRIMARY_RECIPIENT_CHILD_NAME"));
manualKeyElements.wotcWRelation().sendKeys(getExcelData().get("WOTC_W_RELATION_TO_YOU"));
manualKeyElements.wotcWFormAug2009City().sendKeys(getExcelData().get("WOTC_W_AUG_2009_CITY"));
selectDropdownByValue(manualKeyElements.wotcWFormAug2009State(),getExcelData().get("WOTC_W_AUG_2009_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcWAug2009FormPageActions() ", false);
}
}
public void wotcFSAug2009FormPageActions() {
try {
manualKeyElements.wotcFsFoodStampsRecipients().sendKeys(getExcelData().get("WOTC_FS_PRIMARY_FOOD_STAMPS_RECIPIENT"));
manualKeyElements.wotcFsCity().sendKeys(getExcelData().get("WOTC_FS_CITY"));
selectDropdownByValue(manualKeyElements.wotcFsState(),getExcelData().get("WOTC_FS_STATE"));
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcFSAug2009FormPageActions() ", false);
}
}
public void wotcCVAug2009FormPageActions() {
try {
manualKeyElements.wotcVBranchService().sendKeys(getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_BRANCH_SERVICE"));
manualKeyElements.wotcVStartMonthYear().sendKeys(getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_START_MONTH_YEAR"));
manualKeyElements.wotcVServiceEndMonthYear().sendKeys(getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_SERVICE_END_MONTH_YEAR"));
if(isDisplayed(ManualKeyLocators.WOTC_CV_WOTC_DV_WOTC_UV_STATE_BENIFITS)){
selectDropdownByValue(manualKeyElements.wotcVStateBenifits(),getExcelData().get("WOTC_CV_WOTC_DV_WOTC_UV_STATE_BENIFITS"));
}
} catch (Exception e) {
e.printStackTrace();
verifyTest("Manual Form 8850 Jun2015 RFV 2015 Page -- wotcCVAug2009FormPageActions() ", false);
}
}
}
| 37,372 | 0.661192 | 0.614679 | 868 | 42.072582 | 34.555347 | 170 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.922811 | false | false |
13
|
195367879a3e4bc5b5f83c36b28b3802e10e7930
| 25,993,142,139,795 |
332a6b1a512d14429c67d1084fa00945cc811082
|
/src/main/java/com/hcl/BankApplication/repository/Repository.java
|
437013337a14dbd74bca87a2c1b7793e89311d5e
|
[] |
no_license
|
RajithaHCL/BankApllication
|
https://github.com/RajithaHCL/BankApllication
|
c442c4569a9e11fed9b7ea4919a588cfc8e91ffd
|
c1068ee043af706a6349f74f2679c703a294379d
|
refs/heads/master
| 2020-06-19T00:45:27.214000 | 2019-07-12T05:47:28 | 2019-07-12T05:47:28 | 196,508,643 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.hcl.BankApplication.repository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.hcl.BankApplication.Model.User;
public interface Repository extends JpaRepository<User , Long> {
//@Query("select * from bankapplication.user;")
}
|
UTF-8
|
Java
| 395 |
java
|
Repository.java
|
Java
|
[] | null |
[] |
package com.hcl.BankApplication.repository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.hcl.BankApplication.Model.User;
public interface Repository extends JpaRepository<User , Long> {
//@Query("select * from bankapplication.user;")
}
| 395 | 0.8 | 0.8 | 17 | 22.235294 | 26.554117 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.705882 | false | false |
13
|
26f8ee37fecf1ce8e97967ec3f89ed3d86c69e14
| 9,028,021,272,624 |
18f1d3bea22d0fb6fea80fe75e8aa03db5ede5ec
|
/ehangtian/src/com/framework/common/base/entity/RechCash.java
|
78462ec4d2e1346c8fdab5aa3cbc755896f21b34
|
[] |
no_license
|
e04610112/project
|
https://github.com/e04610112/project
|
4e751f2f7ccebf88ed0ed578a96c6372d1b7af56
|
53c462e10dd31e1d883892c294e43e1e79639c65
|
refs/heads/master
| 2016-09-10T01:33:55.532000 | 2014-07-14T09:04:49 | 2014-07-14T09:04:49 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.framework.common.base.entity;
import java.util.Date;
public class RechCash extends WorkFlowHelp{
private Long cashRechId;
private String rechNo;
private String cardAccountType;
private Long orgId;
private Long netOrgId;
private Integer rechPrice;
private String receFlag;
private String rechWay;
private String voucherNo;
private String invoiceNo;
private String receDesc;
private Long applyOperId;
private Date applyTime;
private String applyDesc;
private String startCardNo;
private String endCardNo;
private Integer price;
private String nodeStatusDesc;
private String startdate;
private String enddate;
private int firstResult;
private int maxResult;
private String payerBankName;
private String payerBankNo;
private Integer payerMoney;
private Double payerMoneyDouble;//用于前台传数据
private Double rechPriceDouble;
private Double priceDouble;
private String netFlag;
public String getNetFlag() {
return netFlag;
}
public void setNetFlag(String netFlag) {
this.netFlag = netFlag;
}
public Double getPayerMoneyDouble() {
return payerMoneyDouble;
}
public void setPayerMoneyDouble(Double payerMoneyDouble) {
this.payerMoneyDouble = payerMoneyDouble;
}
public String getPayerBankName() {
return payerBankName;
}
public void setPayerBankName(String payerBankName) {
this.payerBankName = payerBankName;
}
public String getPayerBankNo() {
return payerBankNo;
}
public void setPayerBankNo(String payerBankNo) {
this.payerBankNo = payerBankNo;
}
public Integer getPayerMoney() {
return payerMoney;
}
public void setPayerMoney(Integer payerMoney) {
this.payerMoney = payerMoney;
}
public Long getCashRechId() {
return cashRechId;
}
public void setCashRechId(Long cashRechId) {
this.cashRechId = cashRechId;
}
public String getRechNo() {
return rechNo;
}
public void setRechNo(String rechNo) {
this.rechNo = rechNo;
}
public String getCardAccountType() {
return cardAccountType;
}
public void setCardAccountType(String cardAccountType) {
this.cardAccountType = cardAccountType;
}
public Long getOrgId() {
return orgId;
}
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
public Long getNetOrgId() {
return netOrgId;
}
public void setNetOrgId(Long netOrgId) {
this.netOrgId = netOrgId;
}
public Integer getRechPrice() {
return rechPrice;
}
public void setRechPrice(Integer rechPrice) {
this.rechPrice = rechPrice;
}
public String getReceFlag() {
return receFlag;
}
public void setReceFlag(String receFlag) {
this.receFlag = receFlag;
}
public String getRechWay() {
return rechWay;
}
public void setRechWay(String rechWay) {
this.rechWay = rechWay;
}
public String getVoucherNo() {
return voucherNo;
}
public void setVoucherNo(String voucherNo) {
this.voucherNo = voucherNo;
}
public String getInvoiceNo() {
return invoiceNo;
}
public void setInvoiceNo(String invoiceNo) {
this.invoiceNo = invoiceNo;
}
public String getReceDesc() {
return receDesc;
}
public void setReceDesc(String receDesc) {
this.receDesc = receDesc;
}
public Long getApplyOperId() {
return applyOperId;
}
public void setApplyOperId(Long applyOperId) {
this.applyOperId = applyOperId;
}
public Date getApplyTime() {
return applyTime;
}
public void setApplyTime(Date applyTime) {
this.applyTime = applyTime;
}
public String getApplyDesc() {
return applyDesc;
}
public void setApplyDesc(String applyDesc) {
this.applyDesc = applyDesc;
}
public String getStartCardNo() {
return startCardNo;
}
public void setStartCardNo(String startCardNo) {
this.startCardNo = startCardNo;
}
public String getEndCardNo() {
return endCardNo;
}
public void setEndCardNo(String endCardNo) {
this.endCardNo = endCardNo;
}
public Integer getPrice() {
return price;
}
public void setPrice(Integer price) {
this.price = price;
}
public String getNodeStatusDesc() {
return nodeStatusDesc;
}
public void setNodeStatusDesc(String nodeStatusDesc) {
this.nodeStatusDesc = nodeStatusDesc;
}
public String getStartdate() {
return startdate;
}
public void setStartdate(String startdate) {
this.startdate = startdate;
}
public String getEnddate() {
return enddate;
}
public void setEnddate(String enddate) {
this.enddate = enddate;
}
public int getFirstResult() {
return firstResult;
}
public void setFirstResult(int firstResult) {
this.firstResult = firstResult;
}
public int getMaxResult() {
return maxResult;
}
public void setMaxResult(int maxResult) {
this.maxResult = maxResult;
}
public Double getRechPriceDouble() {
return rechPriceDouble;
}
public void setRechPriceDouble(Double rechPriceDouble) {
this.rechPriceDouble = rechPriceDouble;
}
public Double getPriceDouble() {
return priceDouble;
}
public void setPriceDouble(Double priceDouble) {
this.priceDouble = priceDouble;
}
}
|
UTF-8
|
Java
| 5,352 |
java
|
RechCash.java
|
Java
|
[] | null |
[] |
package com.framework.common.base.entity;
import java.util.Date;
public class RechCash extends WorkFlowHelp{
private Long cashRechId;
private String rechNo;
private String cardAccountType;
private Long orgId;
private Long netOrgId;
private Integer rechPrice;
private String receFlag;
private String rechWay;
private String voucherNo;
private String invoiceNo;
private String receDesc;
private Long applyOperId;
private Date applyTime;
private String applyDesc;
private String startCardNo;
private String endCardNo;
private Integer price;
private String nodeStatusDesc;
private String startdate;
private String enddate;
private int firstResult;
private int maxResult;
private String payerBankName;
private String payerBankNo;
private Integer payerMoney;
private Double payerMoneyDouble;//用于前台传数据
private Double rechPriceDouble;
private Double priceDouble;
private String netFlag;
public String getNetFlag() {
return netFlag;
}
public void setNetFlag(String netFlag) {
this.netFlag = netFlag;
}
public Double getPayerMoneyDouble() {
return payerMoneyDouble;
}
public void setPayerMoneyDouble(Double payerMoneyDouble) {
this.payerMoneyDouble = payerMoneyDouble;
}
public String getPayerBankName() {
return payerBankName;
}
public void setPayerBankName(String payerBankName) {
this.payerBankName = payerBankName;
}
public String getPayerBankNo() {
return payerBankNo;
}
public void setPayerBankNo(String payerBankNo) {
this.payerBankNo = payerBankNo;
}
public Integer getPayerMoney() {
return payerMoney;
}
public void setPayerMoney(Integer payerMoney) {
this.payerMoney = payerMoney;
}
public Long getCashRechId() {
return cashRechId;
}
public void setCashRechId(Long cashRechId) {
this.cashRechId = cashRechId;
}
public String getRechNo() {
return rechNo;
}
public void setRechNo(String rechNo) {
this.rechNo = rechNo;
}
public String getCardAccountType() {
return cardAccountType;
}
public void setCardAccountType(String cardAccountType) {
this.cardAccountType = cardAccountType;
}
public Long getOrgId() {
return orgId;
}
public void setOrgId(Long orgId) {
this.orgId = orgId;
}
public Long getNetOrgId() {
return netOrgId;
}
public void setNetOrgId(Long netOrgId) {
this.netOrgId = netOrgId;
}
public Integer getRechPrice() {
return rechPrice;
}
public void setRechPrice(Integer rechPrice) {
this.rechPrice = rechPrice;
}
public String getReceFlag() {
return receFlag;
}
public void setReceFlag(String receFlag) {
this.receFlag = receFlag;
}
public String getRechWay() {
return rechWay;
}
public void setRechWay(String rechWay) {
this.rechWay = rechWay;
}
public String getVoucherNo() {
return voucherNo;
}
public void setVoucherNo(String voucherNo) {
this.voucherNo = voucherNo;
}
public String getInvoiceNo() {
return invoiceNo;
}
public void setInvoiceNo(String invoiceNo) {
this.invoiceNo = invoiceNo;
}
public String getReceDesc() {
return receDesc;
}
public void setReceDesc(String receDesc) {
this.receDesc = receDesc;
}
public Long getApplyOperId() {
return applyOperId;
}
public void setApplyOperId(Long applyOperId) {
this.applyOperId = applyOperId;
}
public Date getApplyTime() {
return applyTime;
}
public void setApplyTime(Date applyTime) {
this.applyTime = applyTime;
}
public String getApplyDesc() {
return applyDesc;
}
public void setApplyDesc(String applyDesc) {
this.applyDesc = applyDesc;
}
public String getStartCardNo() {
return startCardNo;
}
public void setStartCardNo(String startCardNo) {
this.startCardNo = startCardNo;
}
public String getEndCardNo() {
return endCardNo;
}
public void setEndCardNo(String endCardNo) {
this.endCardNo = endCardNo;
}
public Integer getPrice() {
return price;
}
public void setPrice(Integer price) {
this.price = price;
}
public String getNodeStatusDesc() {
return nodeStatusDesc;
}
public void setNodeStatusDesc(String nodeStatusDesc) {
this.nodeStatusDesc = nodeStatusDesc;
}
public String getStartdate() {
return startdate;
}
public void setStartdate(String startdate) {
this.startdate = startdate;
}
public String getEnddate() {
return enddate;
}
public void setEnddate(String enddate) {
this.enddate = enddate;
}
public int getFirstResult() {
return firstResult;
}
public void setFirstResult(int firstResult) {
this.firstResult = firstResult;
}
public int getMaxResult() {
return maxResult;
}
public void setMaxResult(int maxResult) {
this.maxResult = maxResult;
}
public Double getRechPriceDouble() {
return rechPriceDouble;
}
public void setRechPriceDouble(Double rechPriceDouble) {
this.rechPriceDouble = rechPriceDouble;
}
public Double getPriceDouble() {
return priceDouble;
}
public void setPriceDouble(Double priceDouble) {
this.priceDouble = priceDouble;
}
}
| 5,352 | 0.689209 | 0.689209 | 280 | 18.067858 | 17.096544 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.807143 | false | false |
13
|
488dd93ee12907b9fddbd68881d462ebfbec393c
| 23,545,010,728,620 |
23b56f0a73efe08b7f567638c373658ba88d4a6a
|
/app/src/main/java/pe/com/drecipe/diabeticrecipeproject/models/Patient.java
|
ef7fb8e7e3cea21e4a7121b120ec400837c32c82
|
[] |
no_license
|
jhonaSD/DiabeticRecipeProject
|
https://github.com/jhonaSD/DiabeticRecipeProject
|
371ee6eb170a0579acdfa5ac35ec6b4069538e36
|
9595e59af285c46e778efa09bfce26b5e719a260
|
refs/heads/master
| 2020-03-05T20:21:18.244000 | 2017-04-01T03:53:27 | 2017-04-01T03:53:27 | 83,113,201 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package pe.com.drecipe.diabeticrecipeproject.models;
import org.json.JSONObject;
import java.io.Serializable;
import pe.com.drecipe.diabeticrecipeproject.util.Constantes;
/**
* Created by jhonnatan on 20/03/2017.
*/
public class Patient implements Serializable{
private Integer cod_patient;
private String nom_patient;
private String user_patient;
private String email_patient;
private String pass_patient;
private String user_token;
public Patient(){}
public Integer getCod_patient() {
return cod_patient;
}
public void setCod_patient(Integer cod_patient) {
this.cod_patient = cod_patient;
}
public String getNom_patient() {
return nom_patient;
}
public void setNom_patient(String nom_patient) {
this.nom_patient = nom_patient;
}
public String getUser_patient() {
return user_patient;
}
public void setUser_patient(String user_patient) {
this.user_patient = user_patient;
}
public String getEmail_patient() {
return email_patient;
}
public void setEmail_patient(String email_patient) {
this.email_patient = email_patient;
}
public String getPass_patient() {
return pass_patient;
}
public void setPass_patient(String pass_patient) {
this.pass_patient = pass_patient;
}
public String getUser_token() {
return user_token;
}
public void setUser_token(String user_token) {
this.user_token = user_token;
}
public static void build(JSONObject jsonPatient){
try {
Constantes.PACIENTE.setCod_patient(Integer.valueOf(jsonPatient.getString("cod_patient")));
Constantes.PACIENTE.setUser_patient(jsonPatient.getString("user_patient"));
Constantes.PACIENTE.setNom_patient(jsonPatient.getString("nom_patient"));
Constantes.PACIENTE.setUser_token(jsonPatient.getString("token"));
}catch (Exception ex){
ex.printStackTrace();
}
}
}
|
UTF-8
|
Java
| 2,050 |
java
|
Patient.java
|
Java
|
[
{
"context": "crecipeproject.util.Constantes;\n\n/**\n * Created by jhonnatan on 20/03/2017.\n */\n\npublic class Patient implemen",
"end": 202,
"score": 0.9996197819709778,
"start": 193,
"tag": "USERNAME",
"value": "jhonnatan"
}
] | null |
[] |
package pe.com.drecipe.diabeticrecipeproject.models;
import org.json.JSONObject;
import java.io.Serializable;
import pe.com.drecipe.diabeticrecipeproject.util.Constantes;
/**
* Created by jhonnatan on 20/03/2017.
*/
public class Patient implements Serializable{
private Integer cod_patient;
private String nom_patient;
private String user_patient;
private String email_patient;
private String pass_patient;
private String user_token;
public Patient(){}
public Integer getCod_patient() {
return cod_patient;
}
public void setCod_patient(Integer cod_patient) {
this.cod_patient = cod_patient;
}
public String getNom_patient() {
return nom_patient;
}
public void setNom_patient(String nom_patient) {
this.nom_patient = nom_patient;
}
public String getUser_patient() {
return user_patient;
}
public void setUser_patient(String user_patient) {
this.user_patient = user_patient;
}
public String getEmail_patient() {
return email_patient;
}
public void setEmail_patient(String email_patient) {
this.email_patient = email_patient;
}
public String getPass_patient() {
return pass_patient;
}
public void setPass_patient(String pass_patient) {
this.pass_patient = pass_patient;
}
public String getUser_token() {
return user_token;
}
public void setUser_token(String user_token) {
this.user_token = user_token;
}
public static void build(JSONObject jsonPatient){
try {
Constantes.PACIENTE.setCod_patient(Integer.valueOf(jsonPatient.getString("cod_patient")));
Constantes.PACIENTE.setUser_patient(jsonPatient.getString("user_patient"));
Constantes.PACIENTE.setNom_patient(jsonPatient.getString("nom_patient"));
Constantes.PACIENTE.setUser_token(jsonPatient.getString("token"));
}catch (Exception ex){
ex.printStackTrace();
}
}
}
| 2,050 | 0.656098 | 0.652195 | 82 | 24 | 23.801004 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.329268 | false | false |
13
|
e8f45f8221d89da68bef33cd9b3e05f499c4954a
| 19,052,474,977,845 |
01498ecab50c3dcbbfc582a2752e6becc0fe9d2d
|
/app/src/main/java/arcus/app/device/adapter/DeviceListAdapter.java
|
04b7e0685057cf970fea5b76251cc68c8a703b52
|
[
"Apache-2.0"
] |
permissive
|
ddavis7528/arcusandroid
|
https://github.com/ddavis7528/arcusandroid
|
94080889c988c972fabfce9df3fc65877443b1c1
|
38b691ff3025743994463837d6a2905b43b9c3c2
|
refs/heads/master
| 2020-09-11T15:40:25.814000 | 2019-10-21T05:26:45 | 2019-10-21T05:26:45 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright 2019 Arcus Project.
*
* 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 arcus.app.device.adapter;
import android.content.Context;
import android.graphics.Color;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.iris.client.capability.DeviceConnection;
import com.iris.client.capability.HubConnection;
import com.iris.client.capability.Presence;
import com.iris.client.model.DeviceModel;
import arcus.app.R;
import arcus.app.common.image.ImageManager;
import arcus.app.common.image.picasso.transformation.BlackWhiteInvertTransformation;
import arcus.app.common.image.picasso.transformation.CropCircleTransformation;
import arcus.app.common.image.picasso.transformation.Invert;
import arcus.app.common.utils.CorneaUtils;
import arcus.app.device.model.DeviceType;
import java.util.ArrayList;
import java.util.List;
public class DeviceListAdapter extends BaseAdapter {
public static final int TYPE_ITEM = 0;
public static final int TYPE_FOOTER = 1;
private Context context;
private List<DeviceModel> items;
private LayoutInflater inflater;
private boolean useLightColorScheme = true;
private boolean showZwaveUnpairing = true;
public DeviceListAdapter(Context context, List<DeviceModel> items) {
this.context = context;
this.inflater = LayoutInflater.from(context);
if(items != null){
this.items = new ArrayList<>(items);
} else{
this.items = new ArrayList<>();
}
}
public void setDevices(List<DeviceModel> devices) {
this.items.clear();
this.items.addAll(devices);
notifyDataSetChanged();
}
@Override
public int getCount() {
return items.size() + 1;
}
@Override
public int getViewTypeCount() {
return 2;
}
@Override
public int getItemViewType(int position) {
return (position == items.size() ? TYPE_FOOTER : TYPE_ITEM);
}
@Override
public DeviceModel getItem(int position) {
return items.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
public void setUseLightColorScheme (boolean useLightColorScheme) {
this.useLightColorScheme = useLightColorScheme;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
int type = getItemViewType(position);
if (convertView == null) {
holder = new ViewHolder();
switch (type) {
case TYPE_ITEM:
convertView = inflater.inflate(R.layout.device_list_item, null);
holder.deviceImage = (ImageView) convertView.findViewById(R.id.device_image);
holder.chevronImage = (ImageView) convertView.findViewById(R.id.imgChevron);
holder.name = (TextView) convertView.findViewById(R.id.list_item_name);
holder.device = (TextView) convertView.findViewById(R.id.list_item_description);
holder.redDot = (ImageView) convertView.findViewById(R.id.red_dot);
holder.cloudImage = (ImageView) convertView.findViewById(R.id.cloud_image);
break;
case TYPE_FOOTER:
convertView = inflater.inflate(R.layout.cell_device_listing_zwave_tools, null);
if (showZwaveUnpairing) {
holder.name = (TextView) convertView.findViewById(R.id.footer_button);
}
else {
View settingsView = convertView.findViewById(R.id.settings_list_layout);
if (settingsView != null) {
settingsView.setVisibility(View.GONE);
}
}
break;
}
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
if (type == TYPE_FOOTER) {
// Nothing to do
} else {
DeviceModel deviceModel = getItem(position);
String hint = deviceModel == null ? "" : deviceModel.getDevtypehint();
if (DeviceType.fromHint(hint).isCloudConnected()) {
holder.cloudImage.setVisibility(View.VISIBLE);
showCloud(holder.cloudImage, deviceModel);
showHideRedDot(holder, deviceModel);
}
else {
holder.cloudImage.setVisibility(View.GONE);
showHideRedDot(holder, deviceModel);
}
holder.name.setTextColor(useLightColorScheme ? Color.WHITE : Color.BLACK);
holder.device.setTextColor(useLightColorScheme ? Color.WHITE : Color.BLACK);
holder.deviceImage.setImageResource(R.drawable.device_list_placeholder);
Invert invertForStockImages = useLightColorScheme ? Invert.BLACK_TO_WHITE : Invert.NONE;
ImageManager.with(context)
.putSmallDeviceImage(deviceModel)
.withTransformForStockImages(new BlackWhiteInvertTransformation(invertForStockImages))
.withTransformForUgcImages(new CropCircleTransformation())
.into(holder.deviceImage)
.execute();
holder.chevronImage.setImageResource(useLightColorScheme ? R.drawable.device_list_chevron : R.drawable.chevron);
holder.name.setText(deviceModel.getName());
holder.device.setVisibility(View.GONE);
}
return convertView;
}
private void showCloud(ImageView view, DeviceModel model) {
if (DeviceConnection.STATE_OFFLINE.equals(model.get(DeviceConnection.ATTR_STATE))) {
view.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.cloud_small_pink));
}
else {
view.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.cloud_small_white));
}
}
private void showHideRedDot(ViewHolder holder, DeviceModel model) {
if (model != null){
boolean deviceOffline;
if (CorneaUtils.hasCapability(model, HubConnection.class)){
deviceOffline = HubConnection.STATE_OFFLINE.equals(model.get(HubConnection.ATTR_STATE));
} else {
deviceOffline = DeviceConnection.STATE_OFFLINE.equals(model.get(DeviceConnection.ATTR_STATE));
}
if (deviceOffline && !CorneaUtils.hasCapability(model, Presence.class)){
holder.redDot.setVisibility(View.VISIBLE);
} else {
holder.redDot.setVisibility(View.GONE);
}
}
}
public static class ViewHolder {
public TextView name;
public TextView device;
public ImageView deviceImage;
public ImageView chevronImage;
public ImageView redDot;
public ImageView cloudImage;
}
}
|
UTF-8
|
Java
| 7,749 |
java
|
DeviceListAdapter.java
|
Java
|
[] | null |
[] |
/*
* Copyright 2019 Arcus Project.
*
* 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 arcus.app.device.adapter;
import android.content.Context;
import android.graphics.Color;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.iris.client.capability.DeviceConnection;
import com.iris.client.capability.HubConnection;
import com.iris.client.capability.Presence;
import com.iris.client.model.DeviceModel;
import arcus.app.R;
import arcus.app.common.image.ImageManager;
import arcus.app.common.image.picasso.transformation.BlackWhiteInvertTransformation;
import arcus.app.common.image.picasso.transformation.CropCircleTransformation;
import arcus.app.common.image.picasso.transformation.Invert;
import arcus.app.common.utils.CorneaUtils;
import arcus.app.device.model.DeviceType;
import java.util.ArrayList;
import java.util.List;
public class DeviceListAdapter extends BaseAdapter {
public static final int TYPE_ITEM = 0;
public static final int TYPE_FOOTER = 1;
private Context context;
private List<DeviceModel> items;
private LayoutInflater inflater;
private boolean useLightColorScheme = true;
private boolean showZwaveUnpairing = true;
public DeviceListAdapter(Context context, List<DeviceModel> items) {
this.context = context;
this.inflater = LayoutInflater.from(context);
if(items != null){
this.items = new ArrayList<>(items);
} else{
this.items = new ArrayList<>();
}
}
public void setDevices(List<DeviceModel> devices) {
this.items.clear();
this.items.addAll(devices);
notifyDataSetChanged();
}
@Override
public int getCount() {
return items.size() + 1;
}
@Override
public int getViewTypeCount() {
return 2;
}
@Override
public int getItemViewType(int position) {
return (position == items.size() ? TYPE_FOOTER : TYPE_ITEM);
}
@Override
public DeviceModel getItem(int position) {
return items.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
public void setUseLightColorScheme (boolean useLightColorScheme) {
this.useLightColorScheme = useLightColorScheme;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
int type = getItemViewType(position);
if (convertView == null) {
holder = new ViewHolder();
switch (type) {
case TYPE_ITEM:
convertView = inflater.inflate(R.layout.device_list_item, null);
holder.deviceImage = (ImageView) convertView.findViewById(R.id.device_image);
holder.chevronImage = (ImageView) convertView.findViewById(R.id.imgChevron);
holder.name = (TextView) convertView.findViewById(R.id.list_item_name);
holder.device = (TextView) convertView.findViewById(R.id.list_item_description);
holder.redDot = (ImageView) convertView.findViewById(R.id.red_dot);
holder.cloudImage = (ImageView) convertView.findViewById(R.id.cloud_image);
break;
case TYPE_FOOTER:
convertView = inflater.inflate(R.layout.cell_device_listing_zwave_tools, null);
if (showZwaveUnpairing) {
holder.name = (TextView) convertView.findViewById(R.id.footer_button);
}
else {
View settingsView = convertView.findViewById(R.id.settings_list_layout);
if (settingsView != null) {
settingsView.setVisibility(View.GONE);
}
}
break;
}
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
if (type == TYPE_FOOTER) {
// Nothing to do
} else {
DeviceModel deviceModel = getItem(position);
String hint = deviceModel == null ? "" : deviceModel.getDevtypehint();
if (DeviceType.fromHint(hint).isCloudConnected()) {
holder.cloudImage.setVisibility(View.VISIBLE);
showCloud(holder.cloudImage, deviceModel);
showHideRedDot(holder, deviceModel);
}
else {
holder.cloudImage.setVisibility(View.GONE);
showHideRedDot(holder, deviceModel);
}
holder.name.setTextColor(useLightColorScheme ? Color.WHITE : Color.BLACK);
holder.device.setTextColor(useLightColorScheme ? Color.WHITE : Color.BLACK);
holder.deviceImage.setImageResource(R.drawable.device_list_placeholder);
Invert invertForStockImages = useLightColorScheme ? Invert.BLACK_TO_WHITE : Invert.NONE;
ImageManager.with(context)
.putSmallDeviceImage(deviceModel)
.withTransformForStockImages(new BlackWhiteInvertTransformation(invertForStockImages))
.withTransformForUgcImages(new CropCircleTransformation())
.into(holder.deviceImage)
.execute();
holder.chevronImage.setImageResource(useLightColorScheme ? R.drawable.device_list_chevron : R.drawable.chevron);
holder.name.setText(deviceModel.getName());
holder.device.setVisibility(View.GONE);
}
return convertView;
}
private void showCloud(ImageView view, DeviceModel model) {
if (DeviceConnection.STATE_OFFLINE.equals(model.get(DeviceConnection.ATTR_STATE))) {
view.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.cloud_small_pink));
}
else {
view.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.cloud_small_white));
}
}
private void showHideRedDot(ViewHolder holder, DeviceModel model) {
if (model != null){
boolean deviceOffline;
if (CorneaUtils.hasCapability(model, HubConnection.class)){
deviceOffline = HubConnection.STATE_OFFLINE.equals(model.get(HubConnection.ATTR_STATE));
} else {
deviceOffline = DeviceConnection.STATE_OFFLINE.equals(model.get(DeviceConnection.ATTR_STATE));
}
if (deviceOffline && !CorneaUtils.hasCapability(model, Presence.class)){
holder.redDot.setVisibility(View.VISIBLE);
} else {
holder.redDot.setVisibility(View.GONE);
}
}
}
public static class ViewHolder {
public TextView name;
public TextView device;
public ImageView deviceImage;
public ImageView chevronImage;
public ImageView redDot;
public ImageView cloudImage;
}
}
| 7,749 | 0.636598 | 0.634921 | 213 | 35.380283 | 30.183647 | 124 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.511737 | false | false |
13
|
ce63dad70b3c045c148c39384716b0a569d2f40f
| 18,219,251,289,317 |
706fa650eb607c5ea4749a7873edb408023547d5
|
/src/main/java/br/sp/gov/cleiton/financiamento/controller/IntencaoController.java
|
e54c1b7b69e3cf24eab2442e87315141b1d23641
|
[] |
no_license
|
CleitonRodriguesAraujo96/financiamento-API
|
https://github.com/CleitonRodriguesAraujo96/financiamento-API
|
c3df4279aa1c89591fcff007dd7d724bcab2bd0f
|
e101b24baa4ae52f5d16fe1a8d9bfb0cdd889432
|
refs/heads/main
| 2023-06-05T02:47:27.114000 | 2021-06-24T02:57:23 | 2021-06-24T02:57:23 | 379,786,956 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.sp.gov.cleiton.financiamento.controller;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;
import br.sp.gov.cleiton.financiamento.dto.ClienteDto;
import br.sp.gov.cleiton.financiamento.service.impl.ClienteServiceImlp;
@Controller
public class IntencaoController {
@Autowired
ClienteServiceImlp service;
@GetMapping("novo-cliente")
public ModelAndView HomeIntencao() {
ModelAndView view = new ModelAndView("IntencaoCadastro");
view.addObject("cliente", new ClienteDto());
return view;
}
@PostMapping("salva-cliente")
public String SalvaCliente(@Valid ClienteDto clienteDto, BindingResult result, Model model) {
if(result.hasErrors()) {
model.addAttribute("cliente", clienteDto);
return "IntencaoCadastro";
}
service.salvarCliente(clienteDto);
return "redirect:/";
}
@GetMapping("/cliente/{id}")
public ModelAndView editarCliente(@PathVariable Long id) {
ModelAndView view = new ModelAndView("IntencaoCadastro");
ClienteDto clienteDto = service.editarCliente(id);
view.addObject("cliente", clienteDto);
return view;
}
}
|
UTF-8
|
Java
| 1,505 |
java
|
IntencaoController.java
|
Java
|
[] | null |
[] |
package br.sp.gov.cleiton.financiamento.controller;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;
import br.sp.gov.cleiton.financiamento.dto.ClienteDto;
import br.sp.gov.cleiton.financiamento.service.impl.ClienteServiceImlp;
@Controller
public class IntencaoController {
@Autowired
ClienteServiceImlp service;
@GetMapping("novo-cliente")
public ModelAndView HomeIntencao() {
ModelAndView view = new ModelAndView("IntencaoCadastro");
view.addObject("cliente", new ClienteDto());
return view;
}
@PostMapping("salva-cliente")
public String SalvaCliente(@Valid ClienteDto clienteDto, BindingResult result, Model model) {
if(result.hasErrors()) {
model.addAttribute("cliente", clienteDto);
return "IntencaoCadastro";
}
service.salvarCliente(clienteDto);
return "redirect:/";
}
@GetMapping("/cliente/{id}")
public ModelAndView editarCliente(@PathVariable Long id) {
ModelAndView view = new ModelAndView("IntencaoCadastro");
ClienteDto clienteDto = service.editarCliente(id);
view.addObject("cliente", clienteDto);
return view;
}
}
| 1,505 | 0.78804 | 0.78804 | 49 | 29.714285 | 24.52404 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.591837 | false | false |
13
|
25bb478ac70ba8b6132c099e28bfd60828a8bd1f
| 6,957,847,087,022 |
7e0e0696e90c55b41a09f7d41b485ad10df279c1
|
/app/src/main/java/com/myapp/appbase/func/FnWidget.java
|
43f6272cfe27242b9a99456fc1d83951d31a6c63
|
[] |
no_license
|
KittyHawkITStudio/InfoScreen
|
https://github.com/KittyHawkITStudio/InfoScreen
|
42858e95cff21be175bf7745649bd89f2c2e4da2
|
dd24e986615a151092fb9a9a419a10624cabb2d7
|
refs/heads/main
| 2023-02-02T10:05:28.707000 | 2020-12-07T09:18:14 | 2020-12-07T09:18:14 | 309,397,491 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.myapp.appbase.func;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.DatePicker;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.Toast;
import com.myapp.appbase.widget.SpinnerOption;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
/** 界面元素相关配置 */
public class FnWidget {
/** 隐藏导航栏 */
public void hideBar(Context context){
/*
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
*/
}
/** 展示导航栏 */
public void showBar(Context context){
/*
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
decorView.setSystemUiVisibility(uiOptions);
*/
}
/** 加载Spinner列表 */
public static void initSpinner(Spinner sp, ArrayList<SpinnerOption> options,
Context context) {
ArrayAdapter<SpinnerOption> adapter = new ArrayAdapter<SpinnerOption>(
context, android.R.layout.simple_spinner_item, options);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp.setAdapter(adapter);
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapter, View view, int position, long id) { };
@Override
public void onNothingSelected(AdapterView<?> arg0) { }
});
}
/** 根据value, 设置spinner默认选中 */
public static void matchSpinner(Spinner spinner, String str, int matchMode) {
SpinnerAdapter adapter = spinner.getAdapter();
int k = adapter.getCount();
for (int i = 0; i < k; i++) {
boolean isMatch = false;
switch (matchMode) {
case SpinnerOption.MODE_VALUE:
isMatch = ((SpinnerOption) adapter.getItem(i)).getValue().equals(str);
break;
case SpinnerOption.MODE_TEXT:
isMatch = ((SpinnerOption) adapter.getItem(i)).getText().equals(str);
break;
}
Log.d(((SpinnerOption) adapter.getItem(i)).getValue(), isMatch + "");
if (isMatch) {
spinner.setSelection(i);
break;
}
}
}
public static void clearSpinner(Spinner sp) {
sp.setAdapter(null);
}
/** 初始化日期选择框 */
public static void initDatePicker(DatePicker datepicker, DatePicker.OnDateChangedListener listener) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
datepicker.init(year, month, day, listener);
}
/** 设置日期选择框的日期 */
public static void setDatePicker(DatePicker datepicker, Date mDate, DatePicker.OnDateChangedListener listener){
Calendar calendar = Calendar.getInstance();
calendar.setTime(mDate);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
datepicker.init(year, month, day, listener);
}
}
|
UTF-8
|
Java
| 3,209 |
java
|
FnWidget.java
|
Java
|
[] | null |
[] |
package com.myapp.appbase.func;
import android.content.Context;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.DatePicker;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.Toast;
import com.myapp.appbase.widget.SpinnerOption;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
/** 界面元素相关配置 */
public class FnWidget {
/** 隐藏导航栏 */
public void hideBar(Context context){
/*
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
*/
}
/** 展示导航栏 */
public void showBar(Context context){
/*
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_VISIBLE;
decorView.setSystemUiVisibility(uiOptions);
*/
}
/** 加载Spinner列表 */
public static void initSpinner(Spinner sp, ArrayList<SpinnerOption> options,
Context context) {
ArrayAdapter<SpinnerOption> adapter = new ArrayAdapter<SpinnerOption>(
context, android.R.layout.simple_spinner_item, options);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
sp.setAdapter(adapter);
sp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapter, View view, int position, long id) { };
@Override
public void onNothingSelected(AdapterView<?> arg0) { }
});
}
/** 根据value, 设置spinner默认选中 */
public static void matchSpinner(Spinner spinner, String str, int matchMode) {
SpinnerAdapter adapter = spinner.getAdapter();
int k = adapter.getCount();
for (int i = 0; i < k; i++) {
boolean isMatch = false;
switch (matchMode) {
case SpinnerOption.MODE_VALUE:
isMatch = ((SpinnerOption) adapter.getItem(i)).getValue().equals(str);
break;
case SpinnerOption.MODE_TEXT:
isMatch = ((SpinnerOption) adapter.getItem(i)).getText().equals(str);
break;
}
Log.d(((SpinnerOption) adapter.getItem(i)).getValue(), isMatch + "");
if (isMatch) {
spinner.setSelection(i);
break;
}
}
}
public static void clearSpinner(Spinner sp) {
sp.setAdapter(null);
}
/** 初始化日期选择框 */
public static void initDatePicker(DatePicker datepicker, DatePicker.OnDateChangedListener listener) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
datepicker.init(year, month, day, listener);
}
/** 设置日期选择框的日期 */
public static void setDatePicker(DatePicker datepicker, Date mDate, DatePicker.OnDateChangedListener listener){
Calendar calendar = Calendar.getInstance();
calendar.setTime(mDate);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH);
int day = calendar.get(Calendar.DAY_OF_MONTH);
datepicker.init(year, month, day, listener);
}
}
| 3,209 | 0.722775 | 0.722133 | 103 | 29.223301 | 25.336161 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.223301 | false | false |
8
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.